Quickstart
Send an ordinary OpenAI or Anthropic request to the exchange. Providers compete to answer it. You pay for the tokens that the job used, and never more than a price cap that the exchange fixes before the first token.
This page is for buyers. To sell inference, start with Become a provider.
To make your first request, follow steps 1 and 2. They need a key and one curl command.
1. Get a key
- Sign up. Sign-up creates a workspace. A workspace holds your balance, your API keys and your receipts.
- Open the API keys page and choose Create key.
- Copy the key. The page shows it one time only.
A new workspace gets a starting credit, so you can send your first requests without a card. Your first top-up of $10 or more adds $2 of free credit. The Credits page shows your balance.
A key looks like sk-liquid-<key-id>-<secret>. See API keys for scopes and spending limits.
2. Send a request
curl https://router.inference.ai.exchange/v1/chat/completions \
-H "Authorization: Bearer $LIQUID_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "gpt-oss-120b",
"messages": [{"role": "user", "content": "Say hello."}]
}'
The response is a normal chat completion with one more field, exchange. It tells you what the job cost.
3. Read what you paid
Each provider posts standing offers: a price for each model. The exchange picks the best offer for your request, holds the price cap from your balance, and charges the tokens that the job used. It returns the rest of the cap to your balance.
| Where | What it shows |
|---|---|
x-liquid-cap-usd response header |
The price cap. The exchange sends it before the output starts. |
x-liquid-job-id response header |
The job id. |
exchange.charge.total_usd in the body |
The charge. It is never more than the cap. |
exchange.provider_slug in the body |
The provider that served the job. |
A receipt records each settled job. It does not change after settlement. The Overview and Credits pages list your receipts.
To read a receipt in code, use a key with the read scope or higher:
curl https://router.inference.ai.exchange/v1/exchange/jobs/<job_id> \
-H "Authorization: Bearer $LIQUID_API_KEY"
The exchange writes the receipt just after it answers. A call at once can return 404. Try again after a moment.
To set your own price cap, add "exchange": {"cap_usd": 0.05} to the request body. To choose models, regions or a ranking, see Purchasing rules.
4. Point your tool at the exchange
A tool needs a base URL and your key. The two formats use different base URLs, because each client adds its own path.
The Connection guides give the steps for Claude Code, Codex, Cursor, Cline, the official SDKs and many other tools. If your code now sends requests to another product, use its guide: OpenRouter, LiteLLM, the OpenAI API, the Anthropic API or Portkey. To start a coding agent from the terminal, use the Liquid CLI.
Next steps
- API keys: scopes, spending limits and expiry.
- Purchasing rules: choose the models, the ranking and the limits for each request.
- Market data: read the book, the list of current offers, before you send a request.
- Modalities: send an image, an audio clip or a document.
- Errors: the error format and the error codes.
Reference
Endpoints
| Method | Path | Description |
|---|---|---|
POST |
/v1/chat/completions |
OpenAI Chat Completions. |
POST |
/v1/responses |
OpenAI Responses, without stored state. See OpenAI SDK. |
POST |
/v1/messages |
Anthropic Messages. |
POST |
/v1/messages/count_tokens |
Anthropic token count estimate. |
GET |
/v1/models |
The models that have offers now. The format is OpenAI, or Anthropic when the request has an anthropic-version header. |
GET |
/v1/anthropic/models |
The same list, always in the Anthropic format. |
GET |
/v1/codex/models |
The models that Codex can use. See Codex. |
The exchange also serves images, speech, video and embeddings. See Modalities and Embeddings. The API reference lists every endpoint.
Choose a model
The model field accepts these kinds of name:
| Name | Example | What competes |
|---|---|---|
| A model | gpt-oss-120b |
Each provider that has an offer for that model. |
| A router model | liquid.auto |
Each model that the router model covers. See Auto Router. |
| A basket | architect.basket |
The models in exchange.candidates.models.allow, ranked by exchange.rank.strategy. See Purchasing rules. |
| A preset | fast |
The saved models, strategy and limits that the name refers to. See Purchasing rules. |
To rank the offers, add :smartest, :fastest or :cheapest to the name, for example liquid.auto:cheapest.
See Axis routing. To let the exchange choose the model by score and estimated charge, send
liquid.auto:balanced. See Auto Router.
The exchange refuses any other name with 404 model_not_found. It never uses a different model in its place. The
message shows the name that you sent and suggests other names.
GET /v1/models returns each name that you can use now. The list includes your presets when the request has a key
of the workspace that saved them. Each entry lists the request parameters that at least one offer supports. If a
parameter is not in the list, the exchange refuses a request that includes it. It does not ignore the parameter.
Streaming
Set stream: true to receive text/event-stream. The last chunk has the exchange block with the settled
charge. In the OpenAI format, set stream_options: {"include_usage": true} to receive token usage. The
OpenAI SDK guide shows how to read the cap header from a stream.
Web access
Beta. :web is a beta feature. Its price, its search services and its behavior can change without notice.
A model knows only its training data, up to the cutoff date that its creator publishes. A question about recent events can get an old or wrong answer.
To give a model current information, add :web to the model name, for example deepseek-v4.1-flash:web or
liquid.auto:smartest+web. The exchange searches the web for the last user message before it ranks the offers. It
puts the results in the prompt, before that message. See Axis routing.
The search costs a fixed fee and the cost of the search service. The fee is part of the fee_usd of the receipt. The
receipt also has a web_search object with the service, the number of results and the charge. The search is paid
from your cap. A job that fails pays nothing for it.
The exchange sends the text of your last message to a search service, TinyFish first and Exa if TinyFish fails. Do not
use :web for text that must not leave the exchange.
Without :web, the exchange runs no search. It removes the hosted web_search tool of the Responses API from the
request and sends the header x-liquid-notice: web_search_dropped. It refuses the hosted web search tool of the
Messages API.
OpenAPI document
An OpenAPI 3.1 document describes the public API. The exchange serves it without authentication:
https://router.inference.ai.exchange/v1/openapi.json
You can load it into a client generator, Postman, Insomnia or Bruno. The API reference page shows it.