Quickstart

Quickstart

Get a Routify request returning in under 5 minutes.

1. Create an account

Sign up at routify.bytedance.city/signup (opens in a new tab). New accounts include $5 in free credits — enough for ~30M tokens on DeepSeek V3.2.

2. Generate an API key

Dashboard → API KeysNew key. Keys are prefixed rtf_ and shown only once at creation. Copy it immediately.

⚠️

Keys are sensitive. Don't commit to git. Use environment variables or a secret manager.

3. Send your first request

from openai import OpenAI
 
client = OpenAI(
    base_url="https://routify.bytedance.city/v1",
    api_key="rtf_xxx",
)
 
resp = client.chat.completions.create(
    model="deepseek-v3.2",
    messages=[{"role": "user", "content": "Why is the sky blue?"}],
)
print(resp.choices[0].message.content)

4. Streaming

Add stream: true to receive SSE chunks:

stream = client.chat.completions.create(
    model="deepseek-v3.2",
    messages=[{"role": "user", "content": "Tell me a story"}],
    stream=True,
)
for chunk in stream:
    print(chunk.choices[0].delta.content or "", end="", flush=True)

5. Tool calling

Routify supports function calling on all capable models (DeepSeek V3.2, Kimi K2.5, GLM-4.6, Qwen3 Max, Claude, GPT-4o).

tools = [{
    "type": "function",
    "function": {
        "name": "get_weather",
        "description": "Get weather for a location",
        "parameters": {
            "type": "object",
            "properties": {"location": {"type": "string"}},
            "required": ["location"]
        }
    }
}]
 
resp = client.chat.completions.create(
    model="kimi-k2.5",
    messages=[{"role": "user", "content": "What's the weather in Shanghai?"}],
    tools=tools,
)

Done

Continue to: