> ## 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.

# Get Offer Status

> Get procurement status and instance details for an offer.

This endpoint checks the real-time status of provisioned instances.

Poll this endpoint after procurement to check instance readiness.

## Procurement status values

| Status                     | Meaning                                                             |
| -------------------------- | ------------------------------------------------------------------- |
| `available`                | Offer exists but not yet procured                                   |
| `provisioning_started`     | Procurement initiated, vendor provisioning in progress              |
| `provisioning_in_progress` | Vendor is creating the instance                                     |
| `ready`                    | Instance is active — check `instances` array for connection details |
| `failed`                   | Procurement failed — check `failure_reason`                         |

## Polling pattern

```bash theme={null}
# Poll every 15 seconds until ready
while true; do
  STATUS=$(curl -s https://supply-api.compute-desk.com/offers/$OFFER_ID/status \
    -H "Authorization: Bearer $TOKEN" | jq -r '.procurement_status')
  echo "Status: $STATUS"
  [ "$STATUS" = "ready" ] && break
  [ "$STATUS" = "failed" ] && echo "FAILED" && break
  sleep 15
done
```

When `procurement_status` is `ready`, the `instances` array contains:

* `external_ip` — Public IP address
* `ssh_command` — Ready-to-use SSH command (e.g., `ssh root@1.2.3.4`)
* `status` — Instance status (usually `running`)


## OpenAPI

````yaml GET /offers/{offer_id}/status
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:
  /offers/{offer_id}/status:
    get:
      tags:
        - Offers
      summary: Get Offer Status
      description: |-
        Get procurement status and instance details for an offer.

        This endpoint checks the real-time status of provisioned instances.
      operationId: get_offer_status_offers__offer_id__status_get
      parameters:
        - name: offer_id
          in: path
          required: true
          schema:
            type: string
            format: uuid
            title: Offer Id
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/OfferStatusResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
        - HTTPBearer: []
components:
  schemas:
    OfferStatusResponse:
      properties:
        offer_id:
          type: string
          format: uuid
          title: Offer Id
          description: Unique offer identifier
        status:
          type: string
          title: Status
          description: 'Offer status: available, procured, failed, or expired'
        procurement_status:
          anyOf:
            - type: string
            - type: 'null'
          title: Procurement Status
          description: 'Procurement status: pending, provisioning, ready, or failed'
        instances:
          items:
            $ref: '#/components/schemas/InstanceDetail'
          type: array
          title: Instances
          description: Provisioned instances (empty until procurement starts)
        resources:
          items:
            $ref: '#/components/schemas/OfferResourceInfo'
          type: array
          title: Resources
          description: Resources created by this offer
        progress:
          anyOf:
            - type: string
            - type: 'null'
          title: Progress
          description: Human-readable progress (e.g. '2/4 instances running')
        failure_reason:
          anyOf:
            - type: string
            - type: 'null'
          title: Failure Reason
          description: Reason for failure (present when status=failed)
        created_at:
          type: string
          format: date-time
          title: Created At
          description: When this offer was created
        procured_at:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Procured At
          description: When this offer was procured (null if not yet procured)
      type: object
      required:
        - offer_id
        - status
        - created_at
      title: OfferStatusResponse
      description: Status of an offer and its provisioned instances.
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    InstanceDetail:
      properties:
        instance_id:
          type: string
          title: Instance Id
          description: Vendor-assigned instance identifier
        instance_name:
          type: string
          title: Instance Name
          description: Human-readable instance name
        zone:
          type: string
          title: Zone
          description: Availability zone where the instance is running
        external_ip:
          anyOf:
            - type: string
            - type: 'null'
          title: External Ip
          description: Public IP address (null while provisioning)
        internal_ip:
          anyOf:
            - type: string
            - type: 'null'
          title: Internal Ip
          description: Private IP address (null while provisioning)
        status:
          type: string
          title: Status
          description: >-
            Instance status: running, stopped, terminated, preempted, error, or
            vendor-specific values
        ssh_command:
          anyOf:
            - type: string
            - type: 'null'
          title: Ssh Command
          description: Ready-to-use SSH command (null until instance is RUNNING)
      type: object
      required:
        - instance_id
        - instance_name
        - zone
        - status
      title: InstanceDetail
      description: Details of a provisioned instance.
    OfferResourceInfo:
      properties:
        resource_id:
          type: string
          format: uuid
          title: Resource Id
        resource_type:
          type: string
          title: Resource Type
        role:
          type: string
          title: Role
        status:
          type: string
          title: Status
      type: object
      required:
        - resource_id
        - resource_type
        - role
        - status
      title: OfferResourceInfo
      description: A resource created by an offer.
    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

````