# POST /api/v1/agents/accounts/challenge

Step 1 of agent self-registration; an EIP-4361 message to sign (unauthenticated)

Operation: `createAgentAccountChallenge`.

Step 1 of agent self-registration; an EIP-4361 message to sign (unauthenticated)

Returns a server-written Sign-In with Ethereum (EIP-4361) message for this address: this deployment's domain and URI, Base (chain 8453), a single-use nonce and a five-minute expiry. Its statement carries the Terms version the agent accepts by signing. Sign it exactly as returned (EIP-191 personal_sign) with the wallet's key. EOA wallets only. Rate-limited per source address and per wallet. Not /api/v1/agents/enroll, which enrolls host machines.

## Endpoint

`POST https://amplerun-api.spiry.org/api/v1/agents/accounts/challenge`

## Authentication

No default Bearer requirement is declared for this operation. Read its description for wallet signatures, host enrollment or other specialized proofs.

## Request body

Required body. 

### `application/json`

| Field | Type | Presence | Description |
| --- | --- | --- | --- |
| `address` | string | Required |  |

```json
{
  "type": "object",
  "additionalProperties": false,
  "required": [
    "address"
  ],
  "properties": {
    "address": {
      "type": "string",
      "pattern": "^0x[0-9a-fA-F]{40}$"
    }
  }
}
```

## Responses

### `200`

The message to sign.

`application/json`
| Field | Type | Presence | Description |
| --- | --- | --- | --- |
| `message` | string | Required |  |
| `expires_at` | Rfc3339Utc | Required |  |
| `terms_version` | string | Required |  |
| `terms_url` | string | Required |  |

```json
{
  "type": "object",
  "additionalProperties": false,
  "required": [
    "message",
    "expires_at",
    "terms_version",
    "terms_url"
  ],
  "properties": {
    "message": {
      "type": "string"
    },
    "expires_at": {
      "$ref": "#/components/schemas/Rfc3339Utc"
    },
    "terms_version": {
      "type": "string",
      "example": "rental-v1"
    },
    "terms_url": {
      "type": "string"
    }
  }
}
```

### `default`

Error envelope. 401 unauthenticated, 403/404 forbidden, 409 conflict, 422 invalid input, 429 rate limited (code UNAVAILABLE, retryable:true, no Retry-After header), 503 unavailable money/provider state with retryable:true.

`application/json`
| Field | Type | Presence | Description |
| --- | --- | --- | --- |
| `error` | object | Required |  |

```json
{
  "$ref": "#/components/schemas/ErrorEnvelope"
}
```

## Static request outline

Replace path/query placeholders and provide the required JSON body, headers and credential from the sections above. This is a request outline, not a command that chooses an amount or starts a rental for you.

```sh
curl --request POST 'https://amplerun-api.spiry.org/api/v1/agents/accounts/challenge'
```

[Schema definitions](https://docs.amplerun.com/reference/schemas.md) · [Download OpenAPI](/openapi.json) · [Authentication](https://docs.amplerun.com/agents/authentication.md) · [Errors and recovery](https://docs.amplerun.com/reference/errors.md)

---
Generated from the AmpleRun API contract.
Canonical: https://docs.amplerun.com/reference/api/create-agent-account-challenge/
