Claude Code → OrcaRouter Lite
August 26, 2026 · View on GitHub
Lite serves the Anthropic Messages API natively (POST /v1/messages), so
Claude Code and the official anthropic SDKs connect without changes.
Claude Code
export ANTHROPIC_BASE_URL=http://localhost:8000 # no /v1 suffix
export ANTHROPIC_API_KEY=sk-orca-... # your Lite key
# optional: pin the model (any catalog model, or "auto")
# export ANTHROPIC_MODEL=claude-3-5-sonnet-latest
claude
Requests route through Lite's normal pipeline: model="auto" works, the
prompt cache works, and every request lands in the local dashboard.
Anthropic Python SDK
from anthropic import Anthropic
client = Anthropic(
base_url="http://localhost:8000", # SDK appends /v1/messages itself
api_key="sk-orca-...",
)
message = client.messages.create(
model="auto", # or any catalog model
max_tokens=1024,
messages=[{"role": "user", "content": "Hello!"}],
)
print(message.content[0].text)
Streaming (client.messages.stream(...)) and tool use work as usual.
Known limitations (v1)
thinking(extended thinking) is accepted but dropped — the request still works, without a thinking budget. Astructlogwarning is emitted.top_kis dropped;temperature/top_ppass through, and values outside the API's own 0–1 range are rejected with a 400 rather than forwarded (an upstream rejection would reach you as a retryable 500).max_tokensmust be >= 1, likewise.stop_sequencesbeyond the OpenAI wire cap of 4 are truncated to the first 4 (astructlogwarning is emitted).- Images inside a
tool_resultare forwarded as a user message following the tool result, since the internal format's tool messages are text-only. Non-text blocks insystem(which the API itself does not allow) are dropped with a warning. - Streaming
message_start.usage.input_tokensis the same estimate/v1/messages/count_tokensreturns — the upstream only reports the exact count at end-of-stream, where it is sent inmessage_delta. - Server-side tools (web search, computer use), PDF
documentblocks, and the Files API return 400. Custom function tools are fully supported. POST /v1/messages/count_tokensreturns an estimate (litellm.token_counter, chars/4 fallback), good enough for Claude Code's context tracking.