Connect an app

Any tool that uses the OpenAI or Anthropic API can use the exchange. Change two settings: the base URL and the API key. For each request, the exchange picks the best standing offer for the model that you named. It sets a price cap before the first token and charges for the tokens used.

Each guide gives the steps for one tool, a check, and fixes for common errors.

Connect in three steps

  1. Issue a key. Create a spend key in your workspace. The format is sk-liquid-<key-id>-<secret>. The console shows it one time only. See API keys.

  2. Keep the key out of config files. Each guide reads it from LIQUID_API_KEY.

    export LIQUID_API_KEY=sk-liquid-...
    
  3. Set the base URL and pick a guide. If your tool is not listed, follow the OpenAI SDK or Anthropic SDK guide for its format.

A new workspace has a starting balance, shown on the Credits page. If the balance is less than the price cap of a job, the exchange refuses the request.

Start with the Liquid CLI

The Liquid CLI starts the coding agent that you already use with the exchange as its provider. It sets the base URL, key and model for that process only, and writes none of your files.

curl -fsSL https://inference.ai.exchange/cli/install.sh | bash
liquid login
liquid claude

liquid tools lists every tool. liquid connect <tool> prints the setup for a tool that the CLI cannot start, such as an app or an SDK. The guides show the same setup by hand.

Which guide to use

The full list is under All guides.

Test a request

To test a key and a base URL, send one request with curl. The exchange accepts the key as a bearer token, or as x-api-key.

curl

curl https://router.inference.ai.exchange/v1/chat/completions \
  -H "Authorization: Bearer $LIQUID_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "liquid.auto",
    "messages": [{"role": "user", "content": "hello"}]
  }'

curl (images)

curl https://router.inference.ai.exchange/v1/images/generations \
  -H "Authorization: Bearer $LIQUID_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "liquid.auto",
    "prompt": "A red bicycle leaning on a brick wall",
    "n": 1
  }'

The x-liquid-cap-usd response header is the maximum charge for the job. The actual charge is usually less.

Name a model

Each guide uses liquid.auto. The model field accepts these names:

Name Example Behaviour
A model gpt-oss-120b Every provider that quotes that model competes.
A router model liquid.auto Every listed model competes, ranked by price or by Auto.
Auto liquid.auto:balanced The exchange chooses by published score and estimated charge. See Auto Router.
A basket architect.basket The models in exchange.candidates.models.allow compete. See Purchasing rules.
A preset fast Saved models, strategy and limits. See Purchasing rules.

A client that sets only model can add a suffix:

A creator name, such as deepseek, is valid with a suffix. See Axis routing. The exchange refuses any other name and never uses a different model. GET /v1/models lists the names you can use. See Market data.

Read the result

Each response has an exchange block with job_id, provider_slug, charge.cap_usd (the maximum cost) and charge.total_usd (the actual cost). Two headers arrive before the first token, so a streaming client has them from the start:

Header Meaning
x-liquid-job-id The job id. Use it to read the receipt.
x-liquid-cap-usd The most this job can be charged.

To choose the models, strategy or limits, send an exchange block in the body. A client that can send only headers can send the cap and the first-token limit as x-liquid-* headers, or name a preset. See Purchasing rules.

Reference

Base URL and format

One origin and one key serve both formats. Both formats accept both auth headers.

Format Base URL Auth header
OpenAI https://router.inference.ai.exchange/v1 Authorization: Bearer sk-liquid-…
Anthropic https://router.inference.ai.exchange x-api-key: sk-liquid-…

An OpenAI client adds a path such as /chat/completions. An Anthropic client adds /v1/messages, so a base URL that ends in /v1 gets a 404.

All guides

Tool Format Configured through Guide
Claude Code Anthropic Environment Claude Code
Codex OpenAI Config file Codex
GitHub Copilot CLI OpenAI Environment GitHub Copilot CLI
DeepSeek Harness Anthropic Environment DeepSeek Harness
Grok Build OpenAI Config file Grok Build
Pi OpenAI Config file Pi
Factory Droid OpenAI Config file Factory Droid
Oh My Pi OpenAI Liquid Inference profile Oh My Pi
Reason OpenAI In the app Reason
Goose OpenAI Custom provider file Goose
Crush OpenAI crushrc provider Crush
Hermes Agent OpenAI Provider plugin Hermes Agent
OpenClaw OpenAI Config file OpenClaw
OpenCode OpenAI Config file OpenCode
Paperclip OpenAI Adapter environment Paperclip
Cursor OpenAI In the app Cursor
Cline OpenAI In the app Cline
Z Code OpenAI Provider file or in the app Z Code
RikkaHub OpenAI In the app RikkaHub
Roo Code OpenAI In the app Roo Code
Kilo Code OpenAI In the app Kilo Code
Open WebUI OpenAI In the app Open WebUI
Cherry Studio OpenAI In the app Cherry Studio
n8n OpenAI In the app n8n
Dify OpenAI In the app Dify
LobeHub OpenAI In the app LobeHub
OpenAI SDK OpenAI In code OpenAI SDK
Anthropic SDK Anthropic In code Anthropic SDK
Claude Agent SDK Anthropic In code Claude Agent SDK
OpenAI Agents SDK OpenAI In code OpenAI Agents SDK
Vercel AI SDK OpenAI In code Vercel AI SDK
LiteLLM OpenAI In code LiteLLM
LangChain OpenAI In code LangChain
LlamaIndex OpenAI In code LlamaIndex
pgvector OpenAI In code pgvector
Qdrant OpenAI In code Qdrant
Pinecone OpenAI In code Pinecone
RAGFlow OpenAI In the app RAGFlow
OpenHands SDK OpenAI In code OpenHands SDK
OpenHands CLI OpenAI Config file and environment OpenHands CLI

A Verified label with a release number, such as "Verified 2.1.287", means the setup passed a test run with that release in the last 14 days. Hold the pointer over it to see the date.