{
  "openapi": "3.0.3",
  "info": {
    "title": "Spot gateway API",
    "description": "OpenAI-compatible inference API for Spot (aispotmarket.com). Production host is https://api.aispotmarket.com. URL version is /v1. Breaking changes increment the path. Deprecated operations receive RFC 9745 Deprecation and RFC 8594 Sunset headers at least 90 days apart. Policy: https://aispotmarket.com/docs/api/versioning/. Rate limits: RateLimit, RateLimit-Policy, and Retry-After on 429 — https://aispotmarket.com/docs/api/rate-limits/.",
    "license": {
      "name": "MIT"
    },
    "version": "1.0.0"
  },
  "servers": [
    {
      "url": "https://api.aispotmarket.com",
      "description": "Production Spot gateway"
    }
  ],
  "paths": {
    "/v1/chat/completions": {
      "post": {
        "tags": [
          "crate"
        ],
        "summary": "OpenAI-compatible chat completion with an optional Spot `max_price` bid.",
        "description": "OpenAI-compatible chat completion with an optional Spot `max_price` bid.\n\nAuthenticate with `Authorization: Bearer <buyer_key>`. Set `max_price` to the\nmost you will pay per 1,000 tokens. Host: `https://api.aispotmarket.com`.",
        "operationId": "chat_completions",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ChatCompletionRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OpenAI-compatible completion",
            "headers": {
              "RateLimit": {
                "schema": {
                  "type": "string"
                },
                "description": "Remaining quota for the current window"
              },
              "RateLimit-Policy": {
                "schema": {
                  "type": "string"
                },
                "description": "Advertised per-key quota policy"
              },
              "X-RateLimit-Limit": {
                "schema": {
                  "type": "string"
                },
                "description": "Burst size"
              },
              "X-RateLimit-Remaining": {
                "schema": {
                  "type": "string"
                },
                "description": "Requests left in the burst"
              },
              "X-RateLimit-Reset": {
                "schema": {
                  "type": "string"
                },
                "description": "Seconds until the window refreshes"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ChatCompletionResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "402": {
            "description": "Nothing crossed at or under `max_price`",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "429": {
            "description": "Per-key rate limit exceeded",
            "headers": {
              "RateLimit": {
                "schema": {
                  "type": "string"
                },
                "description": "Remaining quota (0 when exhausted)"
              },
              "RateLimit-Policy": {
                "schema": {
                  "type": "string"
                },
                "description": "Advertised per-key quota policy"
              },
              "Retry-After": {
                "schema": {
                  "type": "string"
                },
                "description": "Seconds to wait before retrying"
              },
              "X-RateLimit-Limit": {
                "schema": {
                  "type": "string"
                },
                "description": "Burst size"
              },
              "X-RateLimit-Remaining": {
                "schema": {
                  "type": "string"
                },
                "description": "Requests left in the burst"
              },
              "X-RateLimit-Reset": {
                "schema": {
                  "type": "string"
                },
                "description": "Seconds until the window refreshes"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearer_buyer": []
          }
        ]
      }
    },
    "/v1/contracts": {
      "post": {
        "tags": [
          "crate"
        ],
        "summary": "Buy a capacity ticket (take / set / market).",
        "description": "Buy a capacity ticket (take / set / market).\n\nAuthenticate with `Authorization: Bearer <buyer_key>`. Fill mints a\ndelivery ticket (`sk-contract-…`). GTC returns immediately; poll\n`GET /v1/orders/{id}`.",
        "operationId": "create_contract",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateContractRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Capacity order (open, partial, or filled)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CapacityOrderResponse"
                }
              }
            }
          },
          "402": {
            "description": "IOC/FOK did not fill",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearer_buyer": []
          }
        ]
      }
    },
    "/v1/contracts/{id}": {
      "get": {
        "tags": [
          "crate"
        ],
        "summary": "Read a delivery ticket the caller owns.",
        "description": "Read a delivery ticket the caller owns.",
        "operationId": "get_contract",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "Contract id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Delivery ticket",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Contract"
                }
              }
            }
          },
          "403": {
            "description": "Not the owner",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "404": {
            "description": "Unknown contract",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearer_buyer": []
          }
        ]
      }
    },
    "/v1/orders/{id}": {
      "get": {
        "tags": [
          "crate"
        ],
        "summary": "Poll a capacity order. GTC rests return `open` plus this id.",
        "description": "Poll a capacity order. GTC rests return `open` plus this id.",
        "operationId": "get_order",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "Capacity order id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Capacity order",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CapacityOrderResponse"
                }
              }
            }
          },
          "403": {
            "description": "Not the owner",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "404": {
            "description": "Unknown order",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearer_buyer": []
          }
        ]
      }
    },
    "/v1/sellers/{id}/asks": {
      "post": {
        "tags": [
          "crate"
        ],
        "summary": "Rest a seller ask on the Spot order book.",
        "description": "Rest a seller ask on the Spot order book.\n\nAuthenticate with `X-Seller-API-Key`. `id` is the seller id returned at\nregistration. Price is a decimal string per 1,000 tokens.",
        "operationId": "submit_ask",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "Seller id returned by POST /v1/sellers/register",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SubmitAskRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Resting ask",
            "headers": {
              "RateLimit": {
                "schema": {
                  "type": "string"
                },
                "description": "Remaining quota for the current window"
              },
              "RateLimit-Policy": {
                "schema": {
                  "type": "string"
                },
                "description": "Advertised per-key quota policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SubmitAskResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "429": {
            "description": "Per-key rate limit exceeded",
            "headers": {
              "RateLimit": {
                "schema": {
                  "type": "string"
                },
                "description": "Remaining quota (0 when exhausted)"
              },
              "Retry-After": {
                "schema": {
                  "type": "string"
                },
                "description": "Seconds to wait before retrying"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        },
        "security": [
          {
            "x_seller_api_key": []
          }
        ]
      }
    },
    "/v1/sellers/{id}/capacity": {
      "post": {
        "tags": [
          "crate"
        ],
        "summary": "Report informational capacity for a seller and model.",
        "description": "Report informational capacity for a seller and model.\n\nAuthenticate with `X-Seller-API-Key`. This updates the dashboard profile; it\ndoes not create asks or change the order book.",
        "operationId": "report_capacity",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "Seller id returned by POST /v1/sellers/register",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ReportCapacityRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Capacity snapshot",
            "headers": {
              "RateLimit": {
                "schema": {
                  "type": "string"
                },
                "description": "Remaining quota for the current window"
              },
              "RateLimit-Policy": {
                "schema": {
                  "type": "string"
                },
                "description": "Advertised per-key quota policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ReportCapacityResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "429": {
            "description": "Per-key rate limit exceeded",
            "headers": {
              "RateLimit": {
                "schema": {
                  "type": "string"
                },
                "description": "Remaining quota (0 when exhausted)"
              },
              "Retry-After": {
                "schema": {
                  "type": "string"
                },
                "description": "Seconds to wait before retrying"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        },
        "security": [
          {
            "x_seller_api_key": []
          }
        ]
      }
    },
    "/v1/sellers/{id}/deliveries": {
      "get": {
        "tags": [
          "crate"
        ],
        "summary": "List outstanding reserved lots for the authenticated seller.",
        "description": "List outstanding reserved lots for the authenticated seller.",
        "operationId": "list_seller_deliveries",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "Seller id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Outstanding reserved lots",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ListSellerDeliveriesResponse"
                }
              }
            }
          },
          "403": {
            "description": "Wrong seller key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        },
        "security": [
          {
            "x_seller_api_key": []
          }
        ]
      }
    }
  },
  "components": {
    "schemas": {
      "CapacityOrderResponse": {
        "type": "object",
        "description": "Response for `POST /v1/contracts` and `GET /v1/orders/{id}`.",
        "required": [
          "order_id",
          "status",
          "instrument",
          "quantity",
          "filled"
        ],
        "properties": {
          "contract": {
            "allOf": [
              {
                "$ref": "#/components/schemas/Contract"
              }
            ],
            "nullable": true
          },
          "filled": {
            "type": "integer",
            "format": "int64",
            "description": "Filled so far.",
            "minimum": 0
          },
          "instrument": {
            "type": "string",
            "description": "Instrument."
          },
          "order_id": {
            "type": "string",
            "description": "Buyer order id (the resting or completed bid)."
          },
          "quantity": {
            "type": "integer",
            "format": "int64",
            "description": "Requested size.",
            "minimum": 0
          },
          "status": {
            "$ref": "#/components/schemas/CapacityOrderStatus"
          }
        }
      },
      "CapacityOrderStatus": {
        "type": "string",
        "description": "Lifecycle of a capacity order.",
        "enum": [
          "open",
          "partial",
          "filled",
          "rejected"
        ]
      },
      "ChatChoice": {
        "type": "object",
        "description": "One choice in a chat completion response.",
        "required": [
          "index",
          "message"
        ],
        "properties": {
          "finish_reason": {
            "type": "string",
            "description": "Why generation stopped (for example `\"stop\"`).",
            "nullable": true
          },
          "index": {
            "type": "integer",
            "format": "int32",
            "description": "Zero-based index among choices.",
            "minimum": 0
          },
          "message": {
            "$ref": "#/components/schemas/ChatMessage"
          }
        }
      },
      "ChatCompletionRequest": {
        "type": "object",
        "description": "OpenAI-compatible chat completion request body.",
        "required": [
          "model",
          "messages"
        ],
        "properties": {
          "max_price": {
            "type": "string",
            "description": "Maximum price per 1,000 tokens the buyer will pay, if any.",
            "nullable": true
          },
          "messages": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ChatMessage"
            },
            "description": "Conversation so far."
          },
          "model": {
            "type": "string",
            "description": "Model identifier."
          },
          "stream": {
            "type": "boolean",
            "description": "When `true`, the server should stream tokens. Streaming itself is later work.",
            "nullable": true
          }
        }
      },
      "ChatCompletionResponse": {
        "type": "object",
        "description": "OpenAI-compatible chat completion response body.",
        "required": [
          "id",
          "object",
          "created",
          "model",
          "choices"
        ],
        "properties": {
          "choices": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ChatChoice"
            },
            "description": "Generated choices."
          },
          "created": {
            "type": "integer",
            "format": "int64",
            "description": "Unix timestamp (seconds)."
          },
          "id": {
            "type": "string",
            "description": "Completion identifier."
          },
          "model": {
            "type": "string",
            "description": "Model that produced the completion."
          },
          "object": {
            "type": "string",
            "description": "Object type, typically `\"chat.completion\"`."
          },
          "usage": {
            "allOf": [
              {
                "$ref": "#/components/schemas/Usage"
              }
            ],
            "nullable": true
          }
        }
      },
      "ChatMessage": {
        "type": "object",
        "description": "A single message in a chat completion.",
        "required": [
          "role",
          "content"
        ],
        "properties": {
          "content": {
            "type": "string",
            "description": "Message text."
          },
          "role": {
            "$ref": "#/components/schemas/ChatRole"
          }
        }
      },
      "ChatRole": {
        "type": "string",
        "description": "Role of a chat message, matching OpenAI's public names.",
        "enum": [
          "system",
          "user",
          "assistant"
        ]
      },
      "Contract": {
        "type": "object",
        "description": "Delivery ticket minted when a capacity order fills.",
        "required": [
          "id",
          "remaining",
          "quantity",
          "expires_at",
          "delivery_start",
          "lots"
        ],
        "properties": {
          "credential": {
            "type": "string",
            "description": "Bearer credential (`sk-contract-…`). Present when the caller is\nallowed to see it (create / owner GET).",
            "nullable": true
          },
          "delivery_start": {
            "type": "string",
            "description": "When delivery may begin (forwards may be in the future)."
          },
          "expires_at": {
            "type": "string",
            "description": "When the ticket stops being deliverable."
          },
          "id": {
            "type": "string",
            "description": "Contract identifier."
          },
          "lots": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ContractLot"
            },
            "description": "Reserved lots (seller ids only — no endpoints)."
          },
          "quantity": {
            "type": "integer",
            "format": "int64",
            "description": "Original filled size.",
            "minimum": 0
          },
          "remaining": {
            "type": "integer",
            "format": "int64",
            "description": "Tokens still deliverable.",
            "minimum": 0
          }
        }
      },
      "ContractLot": {
        "type": "object",
        "description": "One reserved seller lot on a delivery ticket.",
        "required": [
          "id",
          "seller_id",
          "quantity",
          "remaining",
          "price"
        ],
        "properties": {
          "id": {
            "type": "string",
            "description": "Lot identifier."
          },
          "price": {
            "type": "string",
            "description": "Fill price per 1,000 tokens."
          },
          "quantity": {
            "type": "integer",
            "format": "int64",
            "description": "Original lot size.",
            "minimum": 0
          },
          "remaining": {
            "type": "integer",
            "format": "int64",
            "description": "Unburned tokens.",
            "minimum": 0
          },
          "seller_id": {
            "type": "string",
            "description": "Bound seller."
          }
        }
      },
      "ContractOrderType": {
        "type": "string",
        "description": "How the bid lifts or joins the book.",
        "enum": [
          "take",
          "set",
          "limit",
          "market"
        ]
      },
      "ContractSplit": {
        "type": "object",
        "description": "Optional routing filters on a capacity buy.",
        "properties": {
          "privacy": {
            "type": "string",
            "description": "Privacy / data-handling class.",
            "nullable": true
          },
          "region": {
            "type": "string",
            "description": "Jurisdiction / region (`any` or omitted = sweep).",
            "nullable": true
          },
          "venue_pin": {
            "type": "string",
            "description": "Pin a specific venue / model id.",
            "nullable": true
          }
        }
      },
      "CreateContractRequest": {
        "type": "object",
        "description": "Body of `POST /v1/contracts`.",
        "required": [
          "instrument",
          "quantity"
        ],
        "properties": {
          "delivery": {
            "allOf": [
              {
                "$ref": "#/components/schemas/DeliverySpec"
              }
            ],
            "nullable": true
          },
          "instrument": {
            "type": "string",
            "description": "Instrument / model id."
          },
          "max_price": {
            "type": "string",
            "description": "Limit price per 1,000 tokens. Required except for `market` orders.",
            "nullable": true
          },
          "order": {
            "$ref": "#/components/schemas/ContractOrderType"
          },
          "quantity": {
            "type": "integer",
            "format": "int64",
            "description": "Token quantity to buy.",
            "minimum": 0
          },
          "split": {
            "allOf": [
              {
                "$ref": "#/components/schemas/ContractSplit"
              }
            ],
            "nullable": true
          },
          "time_in_force": {
            "$ref": "#/components/schemas/TimeInForce"
          },
          "ttl_seconds": {
            "type": "integer",
            "format": "int64",
            "description": "Delivery window after fill (spot tickets). Defaults to 86400.",
            "nullable": true,
            "minimum": 0
          }
        }
      },
      "DeliverySpec": {
        "oneOf": [
          {
            "type": "string",
            "description": "Named tenor (`spot`, `1d`, `1m`)."
          },
          {
            "type": "object",
            "description": "Explicit delivery window.",
            "required": [
              "start",
              "end"
            ],
            "properties": {
              "end": {
                "$ref": "#/components/schemas/DateTime"
              },
              "start": {
                "$ref": "#/components/schemas/DateTime"
              }
            }
          }
        ],
        "description": "Forward delivery specification.\n\nUntagged so the wire accepts `\"1d\"`, `\"1m\"`, `\"spot\"`, or\n`{\"start\":\"…\",\"end\":\"…\"}`."
      },
      "ErrorBody": {
        "type": "object",
        "required": [
          "code",
          "message"
        ],
        "properties": {
          "code": {
            "type": "string",
            "description": "Wire error code."
          },
          "message": {
            "type": "string",
            "description": "Human-readable detail."
          }
        }
      },
      "ListSellerDeliveriesResponse": {
        "type": "object",
        "description": "Response for `GET /v1/sellers/{id}/deliveries`.",
        "required": [
          "deliveries"
        ],
        "properties": {
          "deliveries": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/SellerDelivery"
            },
            "description": "Outstanding lots, most-recent first."
          }
        }
      },
      "ReportCapacityRequest": {
        "type": "object",
        "description": "Body of `POST /v1/sellers/{id}/capacity`.\n\nInformational only — updates the seller's capacity profile for the\ndashboard. It never creates asks or touches the order book. Token counts are\n`u64`, so non-negativity is enforced by the type and zero is a valid report.",
        "required": [
          "model_id",
          "available_tokens",
          "queued_tokens"
        ],
        "properties": {
          "available_tokens": {
            "type": "integer",
            "format": "int64",
            "description": "Tokens the seller can serve right now.",
            "minimum": 0
          },
          "model_id": {
            "type": "string",
            "description": "Model / instrument the capacity applies to."
          },
          "queued_tokens": {
            "type": "integer",
            "format": "int64",
            "description": "Tokens currently queued / committed.",
            "minimum": 0
          }
        }
      },
      "ReportCapacityResponse": {
        "type": "object",
        "description": "Response for `POST /v1/sellers/{id}/capacity`.",
        "required": [
          "seller_id",
          "model_id",
          "available_tokens",
          "queued_tokens",
          "reported_at"
        ],
        "properties": {
          "available_tokens": {
            "type": "integer",
            "format": "int64",
            "description": "Tokens the seller can serve right now (echoed).",
            "minimum": 0
          },
          "model_id": {
            "type": "string",
            "description": "Model / instrument the capacity applies to."
          },
          "queued_tokens": {
            "type": "integer",
            "format": "int64",
            "description": "Tokens currently queued / committed (echoed).",
            "minimum": 0
          },
          "reported_at": {
            "type": "string",
            "description": "When the profile was recorded."
          },
          "seller_id": {
            "type": "string",
            "description": "Seller the profile belongs to."
          }
        }
      },
      "SellerDelivery": {
        "type": "object",
        "description": "A seller's outstanding delivery obligation.",
        "required": [
          "contract_id",
          "lot_id",
          "buyer_id",
          "instrument",
          "remaining",
          "expires_at",
          "delivery_start"
        ],
        "properties": {
          "buyer_id": {
            "type": "string",
            "description": "Buyer."
          },
          "contract_id": {
            "type": "string",
            "description": "Contract this lot belongs to."
          },
          "delivery_start": {
            "type": "string",
            "description": "When delivery may begin."
          },
          "expires_at": {
            "type": "string",
            "description": "When the obligation expires."
          },
          "instrument": {
            "type": "string",
            "description": "Instrument."
          },
          "lot_id": {
            "type": "string",
            "description": "Lot identifier."
          },
          "remaining": {
            "type": "integer",
            "format": "int64",
            "description": "Unburned tokens this seller still owes.",
            "minimum": 0
          }
        }
      },
      "SubmitAskRequest": {
        "type": "object",
        "description": "Body of `POST /v1/sellers/{id}/asks`.",
        "required": [
          "model_id",
          "price",
          "capacity"
        ],
        "properties": {
          "capacity": {
            "type": "integer",
            "format": "int64",
            "description": "Token capacity offered. Must be strictly positive.",
            "minimum": 0
          },
          "delivery": {
            "type": "string",
            "description": "Forward tenor (`1d`, `1m`) or omitted for spot. Rests on a\n`{model}::{tenor}` book when set.",
            "nullable": true
          },
          "model_id": {
            "type": "string",
            "description": "Model / instrument this ask offers. Must be in the seller's models."
          },
          "price": {
            "type": "string",
            "description": "Ask limit price per 1000 tokens. Must be strictly positive."
          },
          "ttl_seconds": {
            "type": "integer",
            "format": "int64",
            "description": "Time-to-live in seconds. Defaults to 300 (5 minutes) when omitted.",
            "nullable": true,
            "minimum": 0
          }
        }
      },
      "SubmitAskResponse": {
        "type": "object",
        "description": "Response for `POST /v1/sellers/{id}/asks`.",
        "required": [
          "ask_id",
          "seller_id",
          "model_id",
          "price",
          "capacity",
          "remaining",
          "created_at",
          "expires_at"
        ],
        "properties": {
          "ask_id": {
            "type": "string",
            "description": "Newly created ask identifier."
          },
          "capacity": {
            "type": "integer",
            "format": "int64",
            "description": "Token capacity offered.",
            "minimum": 0
          },
          "created_at": {
            "type": "string",
            "description": "When the ask was accepted."
          },
          "expires_at": {
            "type": "string",
            "description": "When the ask will expire if not refreshed or cancelled."
          },
          "model_id": {
            "type": "string",
            "description": "Model / instrument offered."
          },
          "price": {
            "type": "string",
            "description": "Ask limit price per 1000 tokens."
          },
          "remaining": {
            "type": "integer",
            "format": "int64",
            "description": "Unfilled token quantity (equals `capacity` at creation).",
            "minimum": 0
          },
          "seller_id": {
            "type": "string",
            "description": "Seller that owns the ask."
          }
        }
      },
      "TimeInForce": {
        "type": "string",
        "description": "Time-in-force for a capacity order.",
        "enum": [
          "ioc",
          "fok",
          "gtc"
        ]
      },
      "Usage": {
        "type": "object",
        "description": "Token accounting on an OpenAI-compatible completion.",
        "required": [
          "prompt_tokens",
          "completion_tokens",
          "total_tokens"
        ],
        "properties": {
          "completion_tokens": {
            "type": "integer",
            "format": "int32",
            "description": "Tokens generated in the completion.",
            "minimum": 0
          },
          "prompt_tokens": {
            "type": "integer",
            "format": "int32",
            "description": "Tokens consumed from the prompt.",
            "minimum": 0
          },
          "total_tokens": {
            "type": "integer",
            "format": "int32",
            "description": "`prompt_tokens + completion_tokens`.",
            "minimum": 0
          }
        }
      }
    },
    "securitySchemes": {
      "bearer_buyer": {
        "type": "http",
        "scheme": "bearer"
      },
      "x_seller_api_key": {
        "type": "apiKey",
        "in": "header",
        "name": "X-Seller-API-Key"
      }
    }
  }
}