Core concepts

Coco Router is a small set of composable ideas: one endpoint, keys that carry routing behavior, complexity tiers with model pools, and consoles to watch and control all of it.

The gateway

Every application talks to one URL — https://router.cocolevio.com/dash/v1 — using the OpenAI API shape (/chat/completions, /embeddings, /audio/transcriptions, /models). Behind that URL the gateway holds credentials for many providers (OpenAI, Google, OpenRouter's 343-model catalog, Amazon Bedrock, and more) and routes each request to the right one. Applications never hold provider keys and never name providers.

Virtual keys

A virtual key is an API key minted by the gateway (Virtual Keys page). Keys carry their own budget, expiry, model allow-list, and spend tracking. Rotating or revoking a key never touches provider credentials.

Auto keys

A virtual key whose alias starts with auto (or whose metadata contains auto_route: true) is a universal auto-routing key. Every chat request made with it is auto-switched by complexity — the model name the caller sends is ignored. This is what makes the gateway drop-in for third-party tools: give the tool an auto key and any model it asks for is transparently upgraded to Cocolevio's routing.

Tiers

Auto-Switch classifies every prompt into one of four complexity tiers:

TierTypical prompts
SIMPLEGreetings, chit-chat, basic facts, trivial one-liners
MEDIUMEveryday writing, emails, summaries, boilerplate code
COMPLEXNon-trivial coding, debugging, SQL, system design, technical analysis
REASONINGMath and proofs, multi-step logic, planning, careful step-by-step thought

Each tier maps to a priority list of models — the router uses the first model in the list and falls back down the list if a model errors or rate-limits. This makes it safe to put free models first and paid models behind them.

The classifier

A small, cheap judge model (default gpt-4o-mini) reads each prompt and outputs a tier. The classification costs roughly $0.00002 per request and adds ~200–400 ms. It judges by actual cognitive difficulty, not keywords — "explain this like I'm five" is SIMPLE even if the topic is quantum physics.

Live configuration

Tier model pools and the classifier are stored in a config file (tiers.json) that the router hot-reloads. Changing them in the Control Panel applies to the very next request — no restart, no deploy.

Consoles

Three Cocolevio consoles are embedded in the admin sidebar: the Usage Dashboard (costs and key management), the AI Console (interactive testing with a routing log), and the Lead Agent (an applied AI agent that uses the gateway).