# POST /api/v1/hosts/pairings

Open a host pairing (installer; unauthenticated)

Operation: `createHostPairing`.

Open a host pairing (installer; unauthenticated)

Called by the one-line installer (`curl -fsSL https://amplerun.com/host | sudo bash`). Returns a short user_code for a person to approve on /pair and a poll_secret only the installer holds; only their hashes are stored. Expires after 10 minutes. The code alone never yields a token. Rate-limited per source address.

## Endpoint

`POST https://amplerun-api.spiry.org/api/v1/hosts/pairings`

## 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 |
| --- | --- | --- | --- |
| `summary` | object | Required | What the installer reports about the machine. Unverified; shown to the approver. |

```json
{
  "type": "object",
  "additionalProperties": false,
  "required": [
    "summary"
  ],
  "properties": {
    "summary": {
      "type": "object",
      "additionalProperties": false,
      "description": "What the installer reports about the machine. Unverified; shown to the approver.",
      "required": [
        "hostname",
        "gpus"
      ],
      "properties": {
        "hostname": {
          "type": "string",
          "maxLength": 253
        },
        "os": {
          "type": "string",
          "maxLength": 100
        },
        "gpus": {
          "type": "array",
          "maxItems": 16,
          "items": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "name"
            ],
            "properties": {
              "name": {
                "type": "string",
                "maxLength": 100
              },
              "vram_mib": {
                "type": "integer",
                "minimum": 0
              }
            }
          }
        }
      }
    }
  }
}
```

## Responses

### `201`

Pairing opened.

`application/json`
| Field | Type | Presence | Description |
| --- | --- | --- | --- |
| `pairing_id` | UUID | Required |  |
| `user_code` | string | Required | XXXX-XXXX from an alphabet without look-alike characters |
| `poll_secret` | string | Required | Shown once; needed to poll. |
| `expires_at` | Rfc3339Utc | Required |  |
| `interval` | integer | Required | Seconds between polls. |
| `verification_uri` | string | Required |  |
| `verification_uri_complete` | string | Required |  |

```json
{
  "type": "object",
  "additionalProperties": false,
  "required": [
    "pairing_id",
    "user_code",
    "poll_secret",
    "expires_at",
    "interval",
    "verification_uri",
    "verification_uri_complete"
  ],
  "properties": {
    "pairing_id": {
      "$ref": "#/components/schemas/UUID"
    },
    "user_code": {
      "type": "string",
      "description": "XXXX-XXXX from an alphabet without look-alike characters"
    },
    "poll_secret": {
      "type": "string",
      "description": "Shown once; needed to poll."
    },
    "expires_at": {
      "$ref": "#/components/schemas/Rfc3339Utc"
    },
    "interval": {
      "type": "integer",
      "description": "Seconds between polls."
    },
    "verification_uri": {
      "type": "string"
    },
    "verification_uri_complete": {
      "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/hosts/pairings'
```

[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-host-pairing/
