Tokelix API
Integration Guide

Tokelix supports OpenAI and Anthropic compatible API formats. Point the official SDK base URL to Tokelix and connect GPT, Claude and DeepSeek through one gateway. Available models, prices and protocols depend on configured channels.

  • Base URL: https://router2.mvu.app
  • Authentication: API Key (sk-…)
  • Protocols: Anthropic (/v1/messages), OpenAI (/v1/chat/completions), Responses (/v1/responses)
Use your own API key. Keep it private and out of repositories and browser code. Protocol support depends on configured channels.

1. Authentication

Choose the compatible format according to the model you use:

https://router2.mvu.app/v1

Different formats use different authentication headers:

ProtocolHeader
Anthropicx-api-key: $TOKELIX_API_KEY
anthropic-version: 2023-06-01
OpenAIAuthorization: Bearer $TOKELIX_API_KEY

2. Available models

Fetch the complete model list in real time with GET /v1/models:

BASH
curl https://router2.mvu.app/v1/models \
  -H "Authorization: Bearer $TOKELIX_API_KEY"
ProviderModel ID
OpenAIgpt-5-6-luna gpt-5-6-terra gpt-5-2 gpt-5-5 gpt-5-6-sol gpt-6-astra
DeepSeekdeepseek-v4-1-flash
Googlegemini-3-8-flash-openai gemini-3-7-flash-openai gemini-3-6-flash-openai gemini-3-5-flash-openai gemini-3-1-pro
Anthropicclaude-haiku-4-5 claude-sonnet-4-6 claude-sonnet-5 claude-opus-4-7 claude-opus-4-6 claude-opus-4-5 claude-fable-5 claude-opus-5 claude-opus-4-8

3. Anthropic native format

Endpoint: POST /v1/messages

3.1 Basic request

BASH
curl https://router2.mvu.app/v1/messages \
  -H "x-api-key: $TOKELIX_API_KEY" \
  -H "anthropic-version: 2023-06-01" \
  -H "Content-Type: application/json" \
  -d '{
  "model": "claude-haiku-4-5",
  "messages": [
    {
      "role": "user",
      "content": "Hello"
    }
  ],
  "max_tokens": 1024
}'

Example response structure (placeholder content):

JSON
{
  "id": "msg_example",
  "type": "message",
  "role": "assistant",
  "model": "claude-haiku-4-5",
  "content": [
    {
      "type": "text",
      "text": "Hello!"
    }
  ],
  "stop_reason": "end_turn",
  "usage": {
    "input_tokens": 12,
    "output_tokens": 3
  }
}

3.2 Streaming with SSE

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

BASH
curl https://router2.mvu.app/v1/messages \
  -H "x-api-key: $TOKELIX_API_KEY" \
  -H "anthropic-version: 2023-06-01" \
  -H "Content-Type: application/json" \
  -d '{
  "model": "claude-haiku-4-5",
  "messages": [
    {
      "role": "user",
      "content": "Hello"
    }
  ],
  "max_tokens": 1024,
  "stream": true
}'

3.3 Python SDK

PYTHON
from anthropic import Anthropic
import os

client = Anthropic(
    api_key=os.environ["TOKELIX_API_KEY"],
    base_url="https://router2.mvu.app",
)
response = client.messages.create(
    model="claude-haiku-4-5",
    max_tokens=1024,
    messages=[{"role": "user", "content": "Hello"}],
)
print(response.content[0].text)

4. OpenAI-compatible format

Endpoints: POST /v1/chat/completions · POST /v1/responses

4.1 Chat Completions

BASH
curl https://router2.mvu.app/v1/chat/completions \
  -H "Authorization: Bearer $TOKELIX_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "model": "gpt-5-6-luna",
  "messages": [
    {
      "role": "user",
      "content": "Hello"
    }
  ]
}'

Example response structure (placeholder content):

JSON
{
  "object": "chat.completion",
  "model": "gpt-5-6-luna",
  "choices": [
    {
      "index": 0,
      "message": {
        "role": "assistant",
        "content": "Hello!"
      },
      "finish_reason": "stop"
    }
  ],
  "usage": {
    "prompt_tokens": 12,
    "completion_tokens": 3,
    "total_tokens": 15
  }
}

4.2 Python SDK

PYTHON
from openai import OpenAI

client = OpenAI(
    base_url="https://router2.mvu.app/v1",
    api_key="<TOKELIX_API_KEY>",
)
response = client.chat.completions.create(
    model="gpt-5-6-luna",
    messages=[{"role": "user", "content": "Hello"}],
)
print(response.choices[0].message.content)

4.3 Streaming

BASH
curl https://router2.mvu.app/v1/chat/completions \
  -H "Authorization: Bearer $TOKELIX_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "model": "gpt-5-6-luna",
  "messages": [
    {
      "role": "user",
      "content": "Hello"
    }
  ],
  "stream": true
}'

Chat Completions uses data: {...} SSE chunks and ends with data: [DONE].

4.4 Responses API

BASH
curl https://router2.mvu.app/v1/responses \
  -H "Authorization: Bearer $TOKELIX_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "model": "gpt-5-6-luna",
  "input": "Hello"
}'

4.5 Responses streaming

BASH
curl https://router2.mvu.app/v1/responses \
  -H "Authorization: Bearer $TOKELIX_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "model": "gpt-5-6-luna",
  "input": "Hello",
  "stream": true
}'

5. Connect agent tools

Claude Code uses Anthropic; Codex uses Responses.

BASH
export ANTHROPIC_BASE_URL="https://router2.mvu.app"
export ANTHROPIC_AUTH_TOKEN="$TOKELIX_API_KEY"
export ANTHROPIC_MODEL="claude-haiku-4-5"
claude

Codex CLI · Claude Code · DeepSeek

6. FAQ

Authentication failed?

Check headers, base URL and whether your key is valid without extra spaces. OpenAI SDKs need /v1; Anthropic SDKs do not.

Model unavailable?

Check model IDs using /v1/models, then review routing limits, wallet balance and budgets.

Slow first token?

Enable stream: true and allow sufficient read timeout. Keep the request ID on failure and avoid unbounded retries.

Ready? Three steps to start

Sign in · ask your administrator for credits · create an API key

Get API key
Get API key