Get to know Cadenya
We’re developers who love to build. We set out to create a yes-code platform that makes building agents feel like the best parts of building software.
LiteLLM is an open-source (MIT) Python SDK and a proxy you run yourself that puts 100+ LLM providers behind one OpenAI-compatible API, and OpenRouter is a hosted router with 600+ models on one key, list prices, and a 5.5% fee when you buy credits. Both expose an Anthropic Messages API endpoint (/v1/messages) that takes prompt caching with cache_control, extended thinking, and context_management for compaction, so an Anthropic SDK or Claude Code can point at either one.
So pick the LiteLLM Python SDK when your agent is Python and you want to change the model per request with a string. Pick the LiteLLM proxy when apps in several languages need one gateway with virtual keys, budgets, and fallbacks that you run yourself. Pick OpenRouter when you’d rather run nothing and pay provider list prices plus the credit fee. And if you want the model to be a setting instead of code, Cadenya is a hosted agent loop: the model sits on an agent variation, a model swap takes effect without a deploy, and the loop calls OpenRouter, Anthropic, OpenAI, and other providers on your own keys. A coding agent can set it up with no account, in a temporary workspace you claim later. What it offers is at the end.
Every price and limit below comes from each vendor’s own pages, checked on November 11, 2026.
LiteLLM vs OpenRouter vs Pydantic AI for AI agents
Pydantic AI often shows up in the same search, and it can use either one as its provider:
| LiteLLM Python SDK | LiteLLM proxy (AI Gateway) | OpenRouter | Pydantic AI | Cadenya | |
|---|---|---|---|---|---|
| What it is | A Python library, pip install litellm | A server you run. Apps in any language change their base URL | A hosted API: 600+ models from 80+ providers | A Python agent framework, “AI Agent Framework, the Pydantic way” | A hosted agent loop with tool sets, approvals, conversation state, and resume |
| How you pick the model | A string per call, such as anthropic/claude-sonnet-5 | A model_name from your config.yaml | A model ID, or openrouter/auto for the Auto Router | ”by changing one string” | A setting on an agent variation, changed without a deploy |
| Fallbacks and routing | The Router: retries, fallbacks, and load balancing in one process | fallbacks from one model group to another | A models array in priority order. Failed attempts aren’t billed | The ModelFallback capability | Weighted variations favor the variation that scores well |
| What it costs | MIT, “no markup on model spend” | MIT. An Enterprise license key adds SSO past 5 users, audit logs, and admin roles | Provider list price, plus 5.5% when you buy credits on Standard | MIT | Free: 1,000 loops a month and $5 of inference once at signup. Growth: $49 a month for 50,000 loops |
| Your own provider keys | Environment variables such as ANTHROPIC_API_KEY | Stored on your gateway, behind virtual keys | BYOK: $25,000 of list-price inference a month with no fee, then 5% | Each provider’s key, or OpenRouter or LiteLLM as the provider | Keys for OpenRouter, OpenAI, Anthropic, Gemini, Vertex, Bedrock, or an OpenAI-compatible base URL. You pay the provider directly |
| Anthropic Messages API | litellm.anthropic.messages.acreate | /v1/messages, plus passthrough at /anthropic/v1/messages | https://openrouter.ai/api/v1/messages | An Anthropic model with “prompt caching, task budgets and compaction” | Connect an Anthropic key, and the loop makes each model call for you |
| Compaction | Forwards Anthropic’s context_management payload | The passthrough sends the native request “no translation” | context_management edits, including compact_20260112 | Provider-native compaction for OpenAI and Anthropic | A compaction config on the variation, plus the Compact an objective endpoint |
| Latest version | 1.109.0, released November 11, 2026 | The same 1.109.0 release | A hosted API, with nothing to install | 2.67.0, released November 11, 2026 | SDKs at 1.9.0 for TypeScript, Python, Ruby, and Go, Apache-2.0 |
The two also stack: LiteLLM lists OpenRouter as a provider (openrouter/), so a LiteLLM proxy can send some models through OpenRouter. For Vercel AI Gateway, Portkey, and Cloudflare AI Gateway, see switching model providers for AI agents, and for the framework side, Pydantic AI agents in production.
LiteLLM proxy vs LiteLLM Python SDK: model per request and routing fallbacks
The SDK is a library inside your Python process. The proxy is a server with virtual keys, budgets, spend tracking, routing and fallbacks, guardrails, and an MCP gateway. Same package, two jobs.
With the SDK, sending each step to a different model is a different string. Every call names its provider and model, and the response always comes back in the OpenAI Chat Completions shape:
from litellm import completion
response = completion(
model="anthropic/claude-sonnet-5", # "openai/gpt-6.1-sol" for the next step
messages=[{"role": "user", "content": "Summarize this ticket"}],
)
The SDK’s Router adds “retries, fallbacks, and load balancing across deployments inside one process.” It needs Python 3.10 through 3.15.
The proxy moves that config into a config.yaml that every app shares. Fallbacks go “from one model_name to another model_name”:
router_settings:
fallbacks: [{"gpt-6-luna": ["gpt-6.1-sol"]}]
Add context_window_fallbacks for prompts that outgrow a model and content_policy_fallbacks for refusals. A TypeScript or Go service reaches the proxy with its own SDK and a new base URL.
The open-source gateway is free. Enterprise is “a license key on the same Gateway image,” and it adds SSO past 5 users (up to 5 is free), audit logs, and admin roles. Pricing goes through sales, with a 30-day trial.
OpenRouter pricing: 5.5% credit fee, BYOK fee, and model fallbacks
OpenRouter bills inference “at the provider’s list price on every plan.” Its own fee is “charged when you buy credits, 5.5% on Standard and 8% on Business, never on individual requests.”
Bring your own keys (BYOK), and the provider bills you for inference directly. Standard and Business include $25,000 of list-price inference a month through BYOK with no OpenRouter fee. Above that, OpenRouter charges 5% of what the same request would cost at list price, taken from your credits. So a month with $40,000 of BYOK traffic at list price pays 5% on $15,000: $750.
For fallbacks, the models parameter takes an array of model IDs in priority order, and OpenRouter tries the next one when a model returns an error. “An attempt that errors is not charged for its model tokens, so with fallback you pay only for the run that answers.”
OpenRouter can also pick the model for you. The Auto Router “picks a model and reasoning effort for every request,” and “Routing through openrouter/auto adds no fee.”
Anthropic /v1/messages passthrough: LiteLLM proxy and OpenRouter Messages API
LiteLLM has two Anthropic routes, and they do different things.
/v1/messageslets you “call all your LLM APIs in the Anthropicv1/messagesformat,” across “All LiteLLM supported providers,” with fallbacks and load balancing. Use it when an Anthropic-shaped client needs to reach an OpenAI or Gemini model./anthropic/v1/messagesis the passthrough: “call provider-specific endpoint, in native format (no translation).” It “Supports ALL Anthropic Endpoints (including streaming).” Use it when Anthropic’s request has to reach Anthropic unchanged.
If your agent depends on Anthropic-only fields, pick the passthrough, because it sends the request in native format.
OpenRouter’s Messages API lives at https://openrouter.ai/api/v1/messages. It “Creates a message using the Anthropic Messages API format” and “Supports text, images, PDFs, tools, and extended thinking.” To point the Claude Agent SDK or Claude Code at it, OpenRouter’s docs set three variables:
export ANTHROPIC_BASE_URL="https://openrouter.ai/api"
export ANTHROPIC_AUTH_TOKEN="$OPENROUTER_API_KEY"
export ANTHROPIC_API_KEY="" # Important: Must be explicitly empty
The LiteLLM version is ANTHROPIC_BASE_URL=http://localhost:4000 plus a virtual key in ANTHROPIC_AUTH_TOKEN.
Anthropic prompt caching (cache_control), thinking, and compaction
Both pass Anthropic’s cache_control through, and Anthropic’s cache prices apply on both.
In LiteLLM, you mark a block with "cache_control": {"type": "ephemeral"}, and “Anthropic charges for cache writes.” One trap: “Prompt caching is silently skipped when the input is below the provider’s minimum, and no error is returned.” Check cache_creation_input_tokens in the response. LiteLLM can also auto-inject the checkpoints for you, which its docs say can “Reduce costs by up to 90%.”
On OpenRouter, Claude cache writes cost 1.25x the input price with a 5-minute TTL (2x for 1 hour), and cache reads cost 0.1x. You can add one top-level cache_control field (automatic caching) or up to four explicit breakpoints. To raise cache hit rates, OpenRouter uses “provider sticky routing” to send later requests to the same provider endpoint.
Extended thinking works on both, through a thinking object.
Compaction is where they differ. LiteLLM “forwards the native context_management payload when you call Anthropic models, and automatically attaches the required context-management-2025-06-27 beta header.” It also wraps OpenAI’s /responses/compact. OpenRouter’s Messages API accepts context_management edits for clear_tool_uses_20250919, clear_thinking_20251015, and compact_20260112, with a token trigger and pause_after_compaction. Either way, the compaction settings travel with each request your agent sends. Agent memory and context windows covers the strategies.
LiteLLM latest release, PyPI, license, and supply chain security
The latest LiteLLM release is v1.109.0, published on GitHub and PyPI on November 11, 2026. LiteLLM also tags LTS releases, and 1.108.5 (LTS) came out on November 10.
The license is MIT for everything outside the enterprise/ folder, which has its own license. PyPI lists the package as MIT.
LiteLLM’s own blog on docs.litellm.ai reports two supply chain incidents in 2026 that pulled three PyPI releases (1.82.7 and 1.82.8 on March 24, and 1.107.0 on October 21), and each post lists the affected artifacts and what to check if you installed them.
What does Cadenya add to LiteLLM and OpenRouter?
LiteLLM and OpenRouter route each model call. Cadenya runs the agent around those calls: the loop, the tools, the approvals, the conversation state, and the model as a setting. Here’s what that covers:
- The model is a setting on an agent variation. Change it on the variation, and the model swap takes effect without a deploy. The Swap models endpoint moves many variations from one model to another in a single call.
- Your own provider keys, billed by the provider. Connect a key for OpenRouter, OpenAI, Anthropic, Gemini, Vertex, Bedrock, or any OpenAI-compatible base URL, and pay that provider directly. On your own keys you can override model prices, or define models where the provider has no catalog.
- Several models side by side, ranked by results. Give one agent several variations, each with its own model. Set selection to weighted, and Cadenya uses Thompson sampling on feedback scores to favor the variation that scores well.
- Different models for different steps. Assign a sub-agent to a variation. The parent objective spawns a sub-objective on that agent, and the sub-agent’s variation holds its own model.
- Compaction on the variation, and on demand. The variation holds a compaction config. The Compact an objective endpoint compacts when you ask: a waiting objective starts at once, and a busy one compacts before its next assistant turn.
- Tools and approvals, built in. Tool sets come from an OpenAPI 3 spec, an MCP server, HTTP endpoints you define, or Bare tools your app answers. Mark a tool as needing approval, the objective emits
toolApprovalRequested, and your backend approves or denies with a memo the agent reads. - A durable event log you can resume. Every objective records its agent loop as events. List them, or stream new ones over server-sent events and resume from the last event ID.
- A price in one line. Free is 1,000 loops a month, with $5 of inference included once at signup. Growth is $49 a month for 50,000 loops, then $0.0015 a loop. A loop is one LLM request.
Agents and variations shows where the model setting lives, and the free plan needs no card.
No account yet? A coding agent can create a temporary workspace with cadenya workspaces create --temporary, run its first objectives there, and hand you a link to claim it, as auth.md explains. To create an account, sign up at app.cadenya.com/signup, then copy your API key from the API keys page at app.cadenya.com/account/apiKeys.
Related articles
- Switching model providers for AI agents (2026)Model routing
- AI gateways for AI agents (2026)AI gateway
- Blaxel sandboxes for AI agents (2026)Blaxel
Grow wherever AI goes next.
Start shipping agents that are equipped to evolve.