OpenAI compatibility

Routic's API is fully compatible with OpenAI's request and response format. If you're already using the OpenAI SDK or any OpenAI-format tool, just change base_url and api_key to switch to Routic.

Quick switch

from openai import OpenAI

# Before
client = OpenAI(
    api_key="sk-openai-xxx",
)

# Switch to Routic — only two lines change
client = OpenAI(
    base_url="https://api.routic.ai/v1",
    api_key="sk-xxxxxxxx",
)

All subsequent code (client.chat.completions.create, client.models.list, etc.) stays the same.

Compatible endpoints

EndpointPathCompatibility
Chat completionsPOST /v1/chat/completions✅ Fully compatible
ModelsGET /v1/models✅ Fully compatible
StreamingPOST /v1/chat/completions + stream: true✅ Fully compatible
Function callingtools / tool_choice params✅ Fully compatible
JSON moderesponse_format: { type: "json_object" }✅ Fully compatible
Thinking modethinking param (extension)🔶 Routic extension, not in OpenAI
Smart routingmodel: "auto/*" format (extension)🔶 Routic extension, not in OpenAI

Compatible parameters

Chat completions parameters

ParameterOpenAIRouticNotes
modelRoutic also supports auto/* smart routing names
messagesIdentical format
temperatureRange 0–2
top_p
max_tokens
stream
stopUp to 4 stop sequences
frequency_penaltyRange -2–2
presence_penaltyRange -2–2
tools
tool_choice
response_format
logprobs
top_logprobs
thinkingRoutic extension: enables thinking mode
nNot supported — always returns 1 choice
seedNot supported yet
logit_biasNot supported yet

Response fields

FieldOpenAIRouticNotes
id
object"chat.completion"
choices
usage.prompt_tokens
usage.completion_tokens
usage.total_tokens
usage.prompt_cache_hit_tokensCached tokens billed at a lower rate
usage.prompt_cache_miss_tokensNon-cached tokens
choices[].message.reasoning_contentThinking chain content (when thinking mode is enabled)

Incompatibilities

Different model names

OpenAI model names (gpt-4o, gpt-4o-mini) are not available on Routic. Use Routic's model names instead:

Use caseOpenAI modelRoutic alternative
General chatgpt-4o-minideepseek-v3 or auto/chat
Complex reasoningo1 / o3-minideepseek-r1 or auto/reasoning
Code generationgpt-4odeepseek-v3 or deepseek-r1

See the Model catalog for the full list.

Embeddings and Images not available

Routic currently supports text generation only (Chat Completions). The following OpenAI endpoints are not supported:

  • POST /v1/embeddings
  • POST /v1/images/generations
  • POST /v1/audio/*

Authentication

OpenAI uses Authorization: Bearer sk-xxx — same as Routic. The only difference is the key prefix:

  • OpenAI: sk-proj-...
  • Routic: sk-...

Compatible tools and frameworks

Because Routic is fully OpenAI-compatible, these tools work out of the box:

ToolHow to connect
CursorChange OpenAI Base URL → see guide
Claude CodeChange Anthropic Base URL → see guide
AiderChange --openai-api-base → see guide
LangChainChatOpenAI(base_url=..., api_key=...)
LlamaIndexSame config as LangChain
Continue.devChange API Base URL in settings
Cline / Roo CodeChange API Base URL in settings

Any tool that supports a custom OpenAI Base URL works with Routic.

See also