TeamoRouter Manual API Configuration

TeamoRouter provides APIs compatible with Anthropic and OpenAI. Point the official SDK Base URL to TeamoRouter and keep most of your application code unchanged. You can call Claude, Gemini, GPT, and other model families through one gateway.

  • Base URL: https://api.teamorouter.com
  • Authentication: API Key, usually in the sk-teamo-... format
  • Protocols: Anthropic native format (/v1/messages), OpenAI-compatible format (/v1/chat/completions), OpenAI Responses API (/v1/responses), and Gemini native format (/v1beta/models/{model}:generateContent)

Replace sk-teamo-xxxxxx with your own key. Keep the key private and never commit it to a code repository.

1. Authentication

Different protocols use different authentication headers:

Protocol Header
Anthropic x-api-key: sk-teamo-xxxxxx plus anthropic-version: 2023-06-01
OpenAI Authorization: Bearer sk-teamo-xxxxxx
Gemini Authorization: Bearer sk-teamo-xxxxxx

2. Available models

Fetch the complete model list in real time:

bash
curl https://api.teamorouter.com/v1/models \
  -H "Authorization: Bearer sk-teamo-xxxxxx"

Main model examples:

Provider Model ID
Anthropic claude-fable-5, claude-opus-4-8, claude-opus-4-7, claude-opus-4-6, claude-sonnet-4-6, claude-haiku-4-5
OpenAI gpt-5.5, gpt-5.4, gpt-5.4-mini, gpt-5.2
Google gemini-3.1-pro-preview, gemini-3.5-flash

Even when you use the OpenAI format, such as /v1/chat/completions, you can set model to a Claude model ID like claude-opus-4-8. TeamoRouter routes and converts the request for you.

3. Anthropic native format /v1/messages

3.1 Basic request

bash
curl https://api.teamorouter.com/v1/messages \
  -H "x-api-key: sk-teamo-xxxxxx" \
  -H "anthropic-version: 2023-06-01" \
  -H "content-type: application/json" \
  -d '{
    "model": "claude-opus-4-8",
    "max_tokens": 1024,
    "messages": [
      {"role": "user", "content": "Introduce yourself in one sentence"}
    ]
  }'

Example response:

json
{
  "id": "msg_01KxDE...",
  "type": "message",
  "role": "assistant",
  "model": "claude-opus-4-8",
  "content": [
    {
      "type": "text",
      "text": "I am Claude, an AI assistant that can help with writing, coding, and analysis."
    }
  ],
  "stop_reason": "end_turn",
  "usage": {
    "input_tokens": 159,
    "output_tokens": 34
  }
}

3.2 Streaming with SSE

Add "stream": true. The response is text/event-stream:

bash
curl https://api.teamorouter.com/v1/messages \
  -H "x-api-key: sk-teamo-xxxxxx" \
  -H "anthropic-version: 2023-06-01" \
  -H "content-type: application/json" \
  -d '{
    "model": "claude-opus-4-8",
    "max_tokens": 1024,
    "stream": true,
    "messages": [
      {"role": "user", "content": "Write a short poem"}
    ]
  }'

The event sequence is message_start, content_block_start, multiple content_block_delta events, content_block_stop, message_delta, and message_stop.

3.3 Python SDK with anthropic

python
from anthropic import Anthropic

client = Anthropic(
    api_key="sk-teamo-xxxxxx",
    base_url="https://api.teamorouter.com",
)

resp = client.messages.create(
    model="claude-opus-4-8",
    max_tokens=1024,
    messages=[{"role": "user", "content": "Hello"}],
)

print(resp.content[0].text)

4. OpenAI-compatible /v1/chat/completions and /v1/responses

4.1 Basic Chat Completions request

bash
curl https://api.teamorouter.com/v1/chat/completions \
  -H "Authorization: Bearer sk-teamo-xxxxxx" \
  -H "content-type: application/json" \
  -d '{
    "model": "claude-opus-4-8",
    "max_tokens": 1024,
    "messages": [
      {"role": "user", "content": "Hello"}
    ]
  }'

The response follows the standard OpenAI chat.completion structure:

json
{
  "object": "chat.completion",
  "model": "claude-opus-4-8",
  "choices": [
    {
      "index": 0,
      "message": {
        "role": "assistant",
        "content": "Hello!"
      },
      "finish_reason": "stop"
    }
  ],
  "usage": {
    "prompt_tokens": 214,
    "completion_tokens": 3,
    "total_tokens": 217
  }
}

4.2 Python SDK with openai

python
from openai import OpenAI

client = OpenAI(
    api_key="sk-teamo-xxxxxx",
    base_url="https://api.teamorouter.com/v1",
)

resp = client.chat.completions.create(
    model="claude-opus-4-8",
    messages=[{"role": "user", "content": "Hello"}],
)

print(resp.choices[0].message.content)

4.3 Streaming

Add "stream": true. TeamoRouter returns standard OpenAI SSE chunks in the data: {...} format and ends with data: [DONE].

4.4 Basic Responses API request

If your application already uses the OpenAI Responses API, call /v1/responses directly:

bash
curl https://api.teamorouter.com/v1/responses \
  -H "Authorization: Bearer sk-teamo-xxxxxx" \
  -H "content-type: application/json" \
  -d '{
    "model": "gpt-5.4",
    "input": "Introduce TeamoRouter in one sentence"
  }'

You can also use Claude or Gemini model IDs through the Responses API:

bash
curl https://api.teamorouter.com/v1/responses \
  -H "Authorization: Bearer sk-teamo-xxxxxx" \
  -H "content-type: application/json" \
  -d '{
    "model": "claude-opus-4-8",
    "input": [
      {
        "role": "user",
        "content": [
          {
            "type": "input_text",
            "text": "Introduce yourself in one sentence"
          }
        ]
      }
    ]
  }'

4.5 Python SDK with OpenAI Responses

python
from openai import OpenAI

client = OpenAI(
    api_key="sk-teamo-xxxxxx",
    base_url="https://api.teamorouter.com/v1",
)

resp = client.responses.create(
    model="gpt-5.4",
    input="Introduce TeamoRouter in one sentence",
)

print(resp.output_text)

4.6 Responses API streaming

Add "stream": true to receive standard Responses API streaming events:

bash
curl https://api.teamorouter.com/v1/responses \
  -H "Authorization: Bearer sk-teamo-xxxxxx" \
  -H "content-type: application/json" \
  -d '{
    "model": "gpt-5.4",
    "stream": true,
    "input": "Write a short poem"
  }'

5. Gemini native format /v1beta/models/{model}:generateContent

5.1 Basic request

bash
curl https://api.teamorouter.com/v1beta/models/gemini-3.5-flash:generateContent \
  -H "Authorization: Bearer sk-teamo-xxxxxx" \
  -H "content-type: application/json" \
  -d '{
    "contents": [
      {
        "role": "user",
        "parts": [
          {"text": "Introduce yourself in one sentence"}
        ]
      }
    ]
  }'

Example response:

json
{
  "candidates": [
    {
      "content": {
        "role": "model",
        "parts": [
          {
            "text": "I am Gemini, an AI model that can help with writing, coding, analysis, and creative work."
          }
        ]
      },
      "finishReason": "STOP"
    }
  ],
  "usageMetadata": {
    "promptTokenCount": 12,
    "candidatesTokenCount": 22,
    "totalTokenCount": 34
  }
}

5.2 Streaming with SSE

Use streamGenerateContent and add alt=sse:

bash
curl "https://api.teamorouter.com/v1beta/models/gemini-3.5-flash:streamGenerateContent?alt=sse" \
  -H "Authorization: Bearer sk-teamo-xxxxxx" \
  -H "content-type: application/json" \
  -d '{
    "contents": [
      {
        "role": "user",
        "parts": [
          {"text": "Write a short poem"}
        ]
      }
    ]
  }'

5.3 Environment variables

If your tool or SDK supports a custom Gemini Base URL, configure it like this:

bash
export GOOGLE_GEMINI_BASE_URL="https://api.teamorouter.com"
export GEMINI_API_KEY="sk-teamo-xxxxxx"
export GEMINI_API_KEY_AUTH_MECHANISM="bearer"

Different Gemini SDKs use different names for custom endpoints, such as base_url, baseURL, apiEndpoint, or environment variables. The key rule is: set Base URL to https://api.teamorouter.com, and use your TeamoRouter API Key.

6. Use TeamoRouter in Claude Code, Codex, Gemini CLI, and other agent tools

These tools usually use Anthropic or OpenAI SDKs internally. Configure environment variables and the tool will call TeamoRouter.

Claude Code with Anthropic protocol:

bash
export ANTHROPIC_BASE_URL="https://api.teamorouter.com"
export ANTHROPIC_API_KEY="sk-teamo-xxxxxx"

OpenAI-protocol tools:

bash
export OPENAI_BASE_URL="https://api.teamorouter.com/v1"
export OPENAI_API_KEY="sk-teamo-xxxxxx"

Gemini CLI:

bash
export GOOGLE_GEMINI_BASE_URL="https://api.teamorouter.com"
export GEMINI_API_KEY="sk-teamo-xxxxxx"
export GEMINI_API_KEY_AUTH_MECHANISM="bearer"

7. FAQ

  • 401 or authentication failed: check whether the key is correct and whether the header matches the protocol. Anthropic uses x-api-key; OpenAI and Gemini use Authorization: Bearer.
  • Model unavailable: call GET /v1/models first and confirm the model ID spelling.
  • Timeout or slow first token: large Opus-style models may need several seconds for the first token. Use streaming in production for a better experience.
  • Key security: store keys in environment variables or a secret manager. Do not hardcode or commit them.
Ready? Three steps to startLog in to the console · top up · create an API key
Scan to join the WeChat support group
Need help?Scan to join the support group
TeamoRouter Manual API Configuration · Docs