Get 6% back at Conifer with an ernd card
SectionsQuickstart

Gateway

Conifer Gateway quickstart

From nothing to a first answer: an account, a workspace, funds, a key and one request.

Conifer Gateway is one API for every model in its catalog, in OpenAI’s and Anthropic’s formats. This page takes you from nothing to a first answer in six steps, then shows where the rest of the docs go.

Six steps

  1. Sign up

    Open the console and create an account. If you sign up with an email address, the console mails you a link: open it to confirm the address, then sign in.

  2. Make a workspace

    A new account has no workspace yet: the console says so, and offers New workspace. Give it a name and choose Create workspace; you own the workspaces you make. A workspace holds its own API keys, balance and people.

  3. Add funds

    A request starts only when the workspace has a balance to hold it against. On the Balance page, choose Add funds: Stripe’s page takes a card, and each top-up adds $10 to $10,000 of credit, plus a fee that covers the card’s cost. The workspace’s owner and its editors add funds, and an account can add up to $500 a day until it has a top-up at least 14 days old. Billing has the figures.

  4. Create a key

    On the API keys page, choose Create key and give it a name. The key starts with sk-cg- and is shown once, so put it in an environment variable now.

    terminal
    export CONIFER_API_KEY="sk-cg-…"
  5. Point your client at the gateway

    OpenAI’s SDKs take the API’s address with /v1 on the end. Anthropic’s SDKs take it bare, and add /v1/messages themselves.

    ClientBase URL
    OpenAI SDKshttps://gateway-api.conifer.build/v1
    Anthropic SDKshttps://gateway-api.conifer.build
  6. Send a first request

    Each of these asks claude-haiku-5-5 to say hello. Use whichever client you have.

    curl

    terminal
    curl -i https://gateway-api.conifer.build/v1/chat/completions \
      -H "Authorization: Bearer $CONIFER_API_KEY" \
      -H "Content-Type: application/json" \
      -d '{
        "model": "claude-haiku-5-5",
        "messages": [{"role": "user", "content": "Hi"}]
      }'

    OpenAI SDK

    hello.py
    import os
    from openai import OpenAI
    
    client = OpenAI(
        base_url="https://gateway-api.conifer.build/v1",
        api_key=os.environ["CONIFER_API_KEY"],
    )
    
    reply = client.chat.completions.create(
        model="claude-haiku-5-5",
        messages=[
            {"role": "user", "content": "Hi"},
        ],
    )
    print(reply.model, reply.choices[0].message.content)

    Anthropic SDK

    hello.py
    import os
    from anthropic import Anthropic
    
    client = Anthropic(
        base_url="https://gateway-api.conifer.build",
        api_key=os.environ["CONIFER_API_KEY"],
    )
    
    message = client.messages.create(
        model="claude-haiku-5-5",
        max_tokens=1024,
        messages=[
            {"role": "user", "content": "Hi"},
        ],
    )
    print(message.model, message.content[0].text)

    The SDKs for TypeScript take the same two settings: SDKs and other clients has them.

Read what comes back

The answer is the model’s, in the format you sent, and the gateway adds what it did to the headers and to the body. This is what curl -i prints, cut short; the cost and the id are examples.

response
HTTP/2 200
content-type: application/json
x-conifer-request-id: req_01M8QKG70MK3272G0TP16BF898
x-request-id: req_01M8QKG70MK3272G0TP16BF898
x-conifer-model: claude-haiku-5-5
x-conifer-cost-nanousd: 5800

{"model": "claude-haiku-5-5", "choices": [ … ], "usage": { … },
 "router": {"served": {"model": "claude-haiku-5-5", "provider": "anthropic"},
            "fallback": false, "cost_nanousd": 5800}}
WhereWhat it says
x-conifer-modelThe model that answered, by its catalog id. The body’s model is the same model as its provider names it.
x-conifer-cost-nanousdWhat the request cost, in nanodollars: 5800 is $0.0000058. A streamed answer carries its cost in its last event instead, and so does an answer slow enough that its head went out before it was ready.
x-conifer-request-idThe request’s id, also under x-request-id for OpenAI’s SDKs or request-id for Anthropic’s. Quote it when you write to support.
router in the bodyThe same facts in one field: who served it and what it cost.

Where to go next

For what the product is, see Conifer Gateway and Conifer Router. Every model it serves, with its prices, is in the public catalog, which Models shows how to read, and in the console’s Models section.