skip to content
Start here

Start

Start here

Conifer is one API key and one endpoint in front of every model and every provider. The gateway routes each request, fails over for you, caches, and hands back a cost receipt.

The gateway is api.conifer.build. Point an OpenAI or Anthropic client at it with one key and every model in the catalog is behind it, at the prices the catalog publishes. Name a model and that model answers. Leave the choice to Conifer and it picks one. Either way the gateway chooses the provider, retries elsewhere if one fails, and answers with a receipt saying which model served and what it cost. By the end of this page you will have a key, a first request, and your tools pointed at the gateway.

How it works

  1. Mint a key

    Open conifer.build/console#/keys and mint a key. It is free to hold and spends nothing until it is used. Save it as CONIFER_API_KEY. Every tool and client in these docs reads that one name.

    terminal
    export CONIFER_API_KEY='sk-conifer-…'
  2. Point a client at the gateway

    Set two variables and the official OpenAI package works unchanged against https://api.conifer.build. The Anthropic and Responses wires are on the same host with the same key, so use whichever wire your client already speaks.

    terminal
    export OPENAI_BASE_URL=https://api.conifer.build/v1
    export OPENAI_API_KEY=$CONIFER_API_KEY

    Or try the wire with nothing installed.

    terminal
    curl https://api.conifer.build/v1/chat/completions \
      -H "Authorization: Bearer $CONIFER_API_KEY" \
      -H "Content-Type: application/json" \
      -d '{
        "model": "claude-haiku-4-5",
        "max_tokens": 1024,
        "messages": [{"role": "user", "content": "three names for a build cache"}]
      }'
    1. The OpenAI wire. The Anthropic wire is /v1/messages on the same host.
    2. Your key, sent as the bearer token. One key covers every model.
    3. The id of any chat model in the catalog, from a frontier lab or an open-weights one. It is served as named.
  3. Wire your tools

    Claude Code, Codex, Cursor and VS Code each take a base URL and the key. Name a model and that model answers. Send auto and Conifer picks one for you. For every request the gateway chooses the provider, fails over if that provider is down, manages the prompt cache, and answers with a receipt naming the model and the cost. Routing has the rest.

Pick your road

Let your agent do it

If you use Claude Code, Codex, Cursor, or another coding agent, paste this prompt and let it do the setup.

prompt
Fetch https://conifer.build/llms.txt and follow it: set up Conifer in this project.

/llms.txt is the whole setup in one file, written for a model to read.

Put it inside your editor

Claude Code, Codex, Cursor, and VS Code each have a page with the config to paste. Everything else covers the other terminal agents. The MCP server lets an agent you already run call any model on the gateway mid-task, with the cost of each call in the result. Coming from OpenRouter, Vercel AI Gateway, or Helicone, migrating takes two lines.

Three things people hunt for

The key. Save it as CONIFER_API_KEY. The official OpenAI and Anthropic packages take the same key through their own variables, as in step two. The API key covers minting and the SDK covers calling.

Named vs routed. Name a catalog id and that model answers, or the request is refused with a clear error. Send auto and Conifer chooses. The receipt headers name the id you sent and the model that served, so you can always check. Routing has the details, including failover.

When something breaks. 401 is a bad key, 402 is an empty balance, 404 is a model id the catalog does not carry. The full list is on Errors. For anything else, write to us.

The map

SectionWhat's in it
StartThis page. What the gateway is, the key, one request, and the map.
SetupThe account and card, the API key, replacing a provider key, and teams.
GatewayRouting, the router, the catalog and its prices, turns, billing and caching, and your own Azure or OpenAI-compatible endpoint.
ParallaxReview of your coding agent's work after the fact: other models check it, prove every finding in a sandbox, and open pull requests.
ToolsAny client with a base-URL field, then Claude Code, Codex, Cursor, VS Code, Pi, opencode, Aider, Zed and Open WebUI.
SDK & APIThe open-source Conifer SDK, the official OpenAI and Anthropic clients, install and verify, the MCP server, the wire, and errors.
ReferenceThe CLI, the surfaces, the endpoint contract, reading a model, and the desktop app.
LocalThe CLI's own engine, for running an open-weights model on your hardware instead of through the gateway.

The CLI is optional. It installs with one command and signs in with the same key. On Apple Silicon and Windows it also carries its own engine, so it can run an open-weights model on your hardware. On Linux it is a thin client that talks to the gateway. Local covers that in four short pages.

terminal
curl -fsSL https://conifer.build/setup | bash