Skip to main content
POST
/
procure_offer
Procure Offer
curl --request POST \
  --url https://supply-api.compute-index.com/procure_offer \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "offer_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "ssh_public_key": "<string>",
  "cloud_init": "<string>",
  "cluster_name": "<string>"
}
'
{
  "offer_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "status": "<string>",
  "procured_at": "2023-11-07T05:31:56Z",
  "resource_ids": [
    "3c90c3cc-0d44-4b50-8888-8dd25736052a"
  ],
  "error": "<string>"
}
Provision GPU instances from a previously retrieved offer.
Offers expire after 30 minutes. Procurement of an expired offer will fail with 410 Gone.

Required fields

FieldDescription
offer_idUUID from a previous /get_offers response
ssh_public_keyYour SSH public key for root access

Optional fields

FieldDescription
cloud_initStartup script — #cloud-config YAML or #!/bin/bash shell script
resource_nameCustom name for the resource

Cloud-init support

Pass a cloud-init script to configure the instance on first boot:
{
  "offer_id": "uuid-here",
  "ssh_public_key": "ssh-ed25519 AAAA...",
  "cloud_init": "#cloud-config\npackages:\n  - htop\n  - jq\nruncmd:\n  - echo 'Ready' > /tmp/ready.txt"
}
Both #cloud-config YAML and #!/bin/bash scripts are supported. See the Cloud-Init guide for details.

Asynchronous provisioning

Procurement is asynchronous. The response indicates provisioning has started — poll GET /offers/{offer_id}/status to track progress.

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Body

application/json

Request to procure a specific offer.

offer_id
string<uuid>
required
ssh_public_key
string
required

SSH public key to add to provisioned instances for access

Minimum string length: 1
cloud_init
string | null

Cloud-init script to run on instance boot. Must start with '#cloud-config' (YAML) or '#!/' (shell script). Max 64KB.

cluster_name
string | null

Name for the cluster (cluster offers only). Auto-generated if not provided.

Response

Successful Response

Procurement response - status determines the outcome.

offer_id
string<uuid>
required

The offer that was procured

status
string
required

Status: procured, failed, or provisioning_in_progress

procured_at
string<date-time> | null

Timestamp when the offer was procured (present when status=procured)

resource_ids
string<uuid>[] | null

IDs of resources created or affected during procurement (present when status=procured)

error
string | null

Error message describing the failure (present when status=failed)