API Reference
index

API Reference

Routify exposes an OpenAI-compatible API at https://routify.bytedance.city/v1.

Endpoints

Anthropic-compatible mirror

Routify also exposes an Anthropic Messages API at https://routify.bytedance.city/v1/anthropic. The protocol is forwarded verbatim — cache_control, anthropic-version, anthropic-beta headers all pass through. This is the recommended endpoint for Claude Code / any Anthropic SDK consumer.

Cost transparency headers

Every response from /v1/chat/completions carries:

  • X-Routify-Cost-USD — exact dollars spent on this request
  • X-Routify-Cost-CNY — exact RMB equivalent at current rate
  • X-Routify-Model-Id — the upstream model that actually served (after smart-router fallback, may differ from requested)
  • X-Routify-Latency-Ms — wall-clock latency
  • X-Routify-Provider — upstream channel (e.g. deepseek-direct, kimi-aliyun)

SDKs

Use any OpenAI-compatible SDK. Just override the base URL.

from openai import OpenAI
client = OpenAI(base_url="https://routify.bytedance.city/v1", api_key="rtf_...")
import OpenAI from "openai";
const client = new OpenAI({ baseURL: "https://routify.bytedance.city/v1", apiKey: "rtf_..." });
curl https://routify.bytedance.city/v1/chat/completions \
  -H "Authorization: Bearer rtf_..." \
  -H "Content-Type: application/json" \
  -d '{
    "model": "deepseek-chat",
    "messages": [{"role": "user", "content": "Hello!"}]
  }'