Docs

Get started with CodeRoute

CodeRoute uses the OpenAI-compatible protocol, so you can reuse the OpenAI SDK or any compatible client. Just swap the base URL and API key.

Quickstart

Three steps to integrate:

  1. Create an account and generate an API key in the dashboard
  2. Point your base URL at https://api.coderoute.cc/v1
  3. Send a request to Kimi, GLM, Qwen or another model

Base URL and API key

  • Base URLhttps://api.coderoute.cc/v1
  • API keysk-xxx (created under API Key management in the dashboard)
  • AuthenticationAuthorization: Bearer <API Key>

curl example

bash
curl https://api.coderoute.cc/v1/chat/completions \
  -H "Authorization: Bearer $CODEROUTE_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"model":"kimi-k2.7-code","messages":[{"role":"user","content":"Write a quicksort in Python"}]}'

Python example

Requires pip install openai

python
from openai import OpenAI

client = OpenAI(
    base_url="https://api.coderoute.cc/v1",
    api_key="sk-xxx",  # from the dashboard
)

resp = client.chat.completions.create(
    model="kimi-k2.7-code",
    messages=[{"role": "user", "content": "Write a quicksort in Python"}],
)
print(resp.choices[0].message.content)

Node example

Requires npm install openai

javascript
import OpenAI from "openai";

const client = new OpenAI({
  baseURL: "https://api.coderoute.cc/v1",
  apiKey: process.env.CODEROUTE_API_KEY,
});

const resp = await client.chat.completions.create({
  model: "kimi-k2.7-code",
  messages: [{ role: "user", content: "Write a quicksort in Python" }],
});
console.log(resp.choices[0].message.content);

Cursor setup

Cursor → Settings → Models → OpenAI API:

  1. Base URL: https://api.coderoute.cc/v1
  2. API Key: the key from your dashboard
  3. Add CodeRoute model names to the model list (e.g. kimi-k2.7-code)
  4. Click Verify to test the connection

Codex setup

The Codex CLI supports a custom model provider. Add this to ~/.codex/config.toml:

toml
# ~/.codex/config.toml
[model_providers.coderoute]
name = "CodeRoute"
base_url = "https://api.coderoute.cc/v1"
env_key = "CODEROUTE_API_KEY"

Then set the CODEROUTE_API_KEY environment variable. Codex config options may change between versions, so refer to the official Codex docs.

About supported clients

CodeRoute offers OpenAI-compatible coding models such as Kimi, GLM and Qwen, so any client that speaks the OpenAI-compatible protocol works (OpenAI SDK, Cursor, Codex custom provider, Continue, Cline, and others).

Tools that use their own protocols and require their own model accounts, such as Claude Code and Gemini CLI, will get setup guides once CodeRoute adds those models.