OpenFill is in development. Inference is off, but is tested end to end, and will switch on at launch. All data currently on the site is for live testing: it will be erased at launch.

Skip to content
openfill

API reference

OpenFill speaks the OpenAI API. Point base_url at the address below, send your key as a bearer token, and the whole surface is the index under it.

Base URL

https://api.openfill.ai/v1

Authorization

Bearer of_live_...

Authentication

Every endpoint that is yours takes Authorization: Bearer and a key made on API keys. A key starts with of_live_, is shown once, and can carry its own price limit per market model, which a request on that key inherits when it names none. A missing or revoked key answers 401; an account that is suspended or being deleted answers 403. The market data needs no key at all.

Conventions

Bodies and errors

Requests and responses are JSON, with the exception of a file upload, which is multipart, and a file download, which is the file. Chat and Responses HTTP errors use the OpenAI envelope; Messages uses the Anthropic envelope. Streaming failures arrive in each wire's event format. See errors and retries. There is no version header; the shapes are OpenAI's, and the fields OpenFill adds are named with a prefix or documented beside the field they extend.

Headers a request can carry

HeaderMeaning
AuthorizationBearer of_live_... Required on everything except the market data.
x-api-keyThe same key, as the Anthropic SDKs send it. Read on every route that takes a key when Authorization is absent.
Content-Typeapplication/json, except the file upload.
Idempotency-KeyUp to 255 characters. Applies to chat, completions, Responses and Messages, scoped to the account.
X-Price-LimitSame as price_limit. The body wins if both are present.
X-Expires-AfterSame as max_wait. The body wins if both are present, and a header that is not a whole number of seconds is refused with 400 even then.

Headers a response can carry

HeaderMeaning
Retry-AfterSeconds to wait, on a 429 and on a 503 that names one. Absent on a 429 inside a stream, which has no headers left to send.
x-request-idOn every response, a stream's head included. The OpenAI SDKs expose it as _request_id; quote it when you write to us and we can find that exact request in the log.
x-openfill-order-idOn accepted submissions and successful replays. A live stream sends it in its head before the first token; a blocking response sends headers when it completes. The same value is usage.x_market.order_id.
x-openfill-warningOn a 202 for a detached order whose result will not be stored. This legacy header is sent when account storage is off. Read the body's warning and result_stored fields for per-request storage controls and replays.

No x-ratelimit header is sent. Configured limits are published on GET /v1/rate-limits. Rate and queue ceilings answer 429; body sizes and field bounds have the statuses on the rate limits page.

Machine-readable

The whole surface is described at GET https://api.openfill.ai/openapi.json, OpenAPI 3.1, maintained alongside the route handlers. Route coverage is checked against the mounted API; the endpoint pages describe translation and streaming behavior.

Every docs page is also served as Markdown at its address plus .md, or with Accept: text/markdown at the address itself, and /llms-full.txt holds all of them in reading order for an agent that wants the whole set in one fetch.

Timestamps and pages

The OpenAI-shaped objects (files, batches) carry epoch seconds, as OpenAI's do. The OpenFill objects (orders, usage records, market data) carry ISO 8601 strings, except the bucket starts on the OHLC, uptime and statistics series and the from and to bounds of a history or statistics window, which are epoch seconds so a chart can plot them without parsing.

Lists of orders and usage records page by cursor: pass next_cursor from one response as ?cursor= on the next until has_more is false. File and batch lists page by ?after= with the last id, as OpenAI's does.

Endpoint index

Everything the API serves. Each group heading links to the page with the request and response shapes.

MethodPathAuthWhat it does
Chat and completions
POST/v1/chat/completionsKeySend a chat request. On a market model it rests at your price until capacity reaches it.
POST/v1/completionsKeyThe legacy text completion shape, priced identically.
Responses API
POST/v1/responsesKeyThe OpenAI Responses shape, stateless, on the same market. Codex CLI and the Responses SDKs.
Messages API
POST/v1/messagesKeyThe Anthropic Messages shape on the same market. Claude Code and the Anthropic SDKs.
POST/v1/messages/count_tokensKeyThe gateway's prompt estimate for a body. Free, and it creates no order.
Orders, account and usage
GET/v1/ordersKeyYour orders, newest first, filtered and paged.
GET/v1/orders/{id}KeyOne order: status, queue position, what it cleared at.
GET/v1/orders/{id}/resultKeyThe stored response body, in the shape of the endpoint the request came in on.
DELETE/v1/orders/{id}/resultKeyDelete a stored result ahead of your storage period.
POST/v1/orders/priceKeyChange the price limit on up to 500 queued orders on market models at once.
POST/v1/orders/{id}/cancelKeyCancel an order that is still queued.
GET/v1/accountKeyBalance, order counts, defaults and your storage setting.
PATCH/v1/accountKeyChange the defaults your requests inherit.
GET/v1/usageKeyYour charges, newest first, with the balance alongside.
Files and batches
POST/v1/filesKeyUpload a JSONL batch input file.
GET/v1/filesKeyEvery file on the account, newest first.
GET/v1/files/{id}KeyOne file: size, purpose and when it expires.
DELETE/v1/files/{id}KeyDelete a file, unless a batch is still working from it.
GET/v1/files/{id}/contentKeyDownload a file, input or batch output.
POST/v1/batchesKeyRun every line of an uploaded file as an order.
GET/v1/batchesKeyYour batches, newest first.
GET/v1/batches/{id}KeyOne batch: status, counts and file ids.
POST/v1/batches/{id}/cancelKeyStop a batch that is validating or running.
Market data
GET/v1/modelsPublicEvery model served, how it is priced, its pricing ratio and length limits, and the reference mix.
GET/v1/models/{model}PublicOne model's entry from that list, by id or by alias.
GET/v1/rate-limitsPublicEvery rate, queue, batch and size limit, as enforced.
GET/v1/marketPublicThe clearing level now, its mode, whether it is frozen, and the same level split into dollars per 1M cached, uncached and output tokens. A market model only, like every /v1/market route.
GET/v1/market/levelsPublicEvery market's clearing level right now, in one call.
GET/v1/market/streamPublicServer-sent events: one market's level as it moves, with the same split.
GET/v1/market/levels/streamPublicServer-sent events: every market's level, as deltas.
GET/v1/market/price-lockPublicThe current quote, how long it is valid, the share of locked requests with a price limit above the quote that started in time, and the same split.
GET/v1/market/price-lock/streamPublicServer-sent events: one quote per window boundary, with the same split.
GET/v1/market/historyPublicThe level over a window, downsampled to one point per bucket.
GET/v1/market/ohlcPublicOpen, high, low, close and time-weighted mean per bucket.
GET/v1/uptimePublicProbe results per bucket, pooled unless you pass ?model=, and whether the model has capacity now.
GET/v1/stats/tokensPublicToken volume per model over a window.
GET/v1/stats/modelsPublicPer-model totals over a window, every served model present, with how each is priced and whether it has capacity.
GET/healthzPublicLiveness.
GET/api/helloPublicClient discovery; HEAD is also supported.
GET/openrouter/v1/modelsPublicThe partner catalog, priced from the current quote, or from a fixed-price model's prices.
GET/v1/limitsPublic308 redirect to /v1/rate-limits.
GET/openapi.jsonPublicThis whole surface as an OpenAPI 3.1 document.