Code RouterCode Router
User GuideAPI ReferenceAI ApplicationsHelp & SupportBusiness Cooperation

Code Router Documentation

One API key and one base URL to reach many model providers through a unified, OpenAI-compatible gateway.

Welcome to Code Router

Code Router is a unified, OpenAI-compatible AI gateway. Instead of managing a separate key, SDK, and base URL for every upstream provider, you get a single API key and a single base URL that route requests to many models through one consistent interface. Organize models into model groups, control access with token groups, and track quotas and usage from one place.

Code Router is built on a popular open-source AI gateway and customized as its own product. The source is available on GitHub.

Quick Start

Point any OpenAI-compatible client at the gateway by setting two values: the base URL and your Code Router API key.

curl https://ai.sammier.com/v1/chat/completions \
  -H "Authorization: Bearer $CODE_ROUTER_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "your-model-name",
    "messages": [{"role": "user", "content": "Hello!"}]
  }'

The OpenAI-compatible endpoint is https://ai.sammier.com/v1. Most SDKs only require overriding the base URL — for example, set base_url in the OpenAI Python SDK or baseURL in the Node SDK.

Replace https://ai.sammier.com with the base URL of your own deployment, and use a model name that exists in your configured model groups.

Browse the Documentation

Explore guides and references to get the most out of Code Router.

How is this guide?

Last updated on