> ## Documentation Index
> Fetch the complete documentation index at: https://docs.compute-desk.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Procure Offer

> Procure a GPU offer.

Note: This is a long-running operation (vendor provisioning can take minutes)

Provision GPU instances from a previously retrieved offer.

<Warning>
  Offers expire after 30 minutes. Procurement of an expired offer will fail with `410 Gone`.
</Warning>

## Required fields

| Field            | Description                                 |
| ---------------- | ------------------------------------------- |
| `offer_id`       | UUID from a previous `/get_offers` response |
| `ssh_public_key` | Your SSH public key for root access         |

## Optional fields

| Field           | Description                                                         |
| --------------- | ------------------------------------------------------------------- |
| `cloud_init`    | Startup script — `#cloud-config` YAML or `#!/bin/bash` shell script |
| `resource_name` | Custom name for the resource                                        |

## Cloud-init support

Pass a cloud-init script to configure the instance on first boot:

```json theme={null}
{
  "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](/guides/cloud-init) for details.

## Asynchronous provisioning

Procurement is asynchronous. The response indicates provisioning has started — poll [`GET /offers/{offer_id}/status`](/api-reference/endpoint/get-offer-status) to track progress.


## OpenAPI

````yaml POST /procure_offer
openapi: 3.1.0
info:
  title: Supply Service
  description: GPU offers querying and provisioning service
  version: 0.1.0
servers:
  - url: https://supply-api.compute-desk.com
security: []
paths:
  /procure_offer:
    post:
      tags:
        - Offers
      summary: Procure Offer
      description: >-
        Procure a GPU offer.


        Note: This is a long-running operation (vendor provisioning can take
        minutes)
      operationId: procure_offer_procure_offer_post
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ProcureOfferRequest'
        required: true
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProcureOfferResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
        - HTTPBearer: []
components:
  schemas:
    ProcureOfferRequest:
      properties:
        offer_id:
          type: string
          format: uuid
          title: Offer Id
        ssh_public_key:
          type: string
          minLength: 1
          title: Ssh Public Key
          description: SSH public key to add to provisioned instances for access
        cloud_init:
          anyOf:
            - type: string
            - type: 'null'
          title: Cloud Init
          description: >-
            Cloud-init script to run on instance boot. Must start with
            '#cloud-config' (YAML) or '#!/' (shell script). Max 64KB.
        cluster_name:
          anyOf:
            - type: string
            - type: 'null'
          title: Cluster Name
          description: >-
            Name for the cluster (cluster offers only). Auto-generated if not
            provided.
      type: object
      required:
        - offer_id
        - ssh_public_key
      title: ProcureOfferRequest
      description: Request to procure a specific offer.
    ProcureOfferResponse:
      properties:
        offer_id:
          type: string
          format: uuid
          title: Offer Id
          description: The offer that was procured
        status:
          type: string
          title: Status
          description: 'Status: procured, failed, or provisioning_in_progress'
        procured_at:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Procured At
          description: Timestamp when the offer was procured (present when status=procured)
        resource_ids:
          anyOf:
            - items:
                type: string
                format: uuid
              type: array
            - type: 'null'
          title: Resource Ids
          description: >-
            IDs of resources created or affected during procurement (present
            when status=procured)
        error:
          anyOf:
            - type: string
            - type: 'null'
          title: Error
          description: Error message describing the failure (present when status=failed)
      type: object
      required:
        - offer_id
        - status
      title: ProcureOfferResponse
      description: Procurement response - status determines the outcome.
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
  securitySchemes:
    HTTPBearer:
      type: http
      scheme: bearer

````