Agent Setup
GuRouter exposes an OpenAI-compatible API. If your tool or SDK already speaks OpenAI, you usually only need to change the base URL and the API key.
Video tutorial
Section titled “Video tutorial”Watch the walkthrough above, then continue with the steps below for the exact values. Direct link: https://www.youtube.com/watch?v=HStwL7-AN10.
Base URL
Section titled “Base URL”The API is served at:
https://gurouter.comAll endpoints below are relative to a base URL, for example
https://gurouter.com/v1/chat/completions.
Authentication
Section titled “Authentication”Send your API key as a bearer token in the Authorization header:
Authorization: Bearer <API_KEY>Replace <API_KEY> with a key issued by GuRouter. Requests without a valid key are
rejected with 401 Unauthorized.
List models
Section titled “List models”curl https://gurouter.com/v1/models \ -H "Authorization: Bearer <API_KEY>"The response is an OpenAI-style object with a data array. Each entry includes:
id— the model name to pass in requests.object,created,owned_by— standard OpenAI fields.supported_endpoint_types— the endpoint types that model can be used with (for example chat or the SystemOne decision endpoint). Check this field before assuming a model works with a given endpoint.
Chat completions
Section titled “Chat completions”POST /v1/chat/completions follows the OpenAI Chat Completions request and response
format.
curl https://gurouter.com/v1/chat/completions \ -H "Authorization: Bearer <API_KEY>" \ -H "Content-Type: application/json" \ -d '{ "model": "gpt-4o-mini", "messages": [ { "role": "user", "content": "Say hello in one sentence." } ] }'from openai import OpenAI
client = OpenAI( api_key="<API_KEY>", base_url="https://gurouter.com/v1",)
response = client.chat.completions.create( model="gpt-4o-mini", messages=[ {"role": "user", "content": "Say hello in one sentence."}, ],)
print(response.choices[0].message.content)const response = await fetch("https://gurouter.com/v1/chat/completions", { method: "POST", headers: { "Authorization": "Bearer <API_KEY>", "Content-Type": "application/json", }, body: JSON.stringify({ model: "gpt-4o-mini", messages: [{ role: "user", content: "Say hello in one sentence." }], }),});
const data = await response.json();console.log(data.choices[0].message.content);Streaming
Section titled “Streaming”Streaming follows the OpenAI SSE conventions. Set "stream": true in the request body and
the endpoint responds with text/event-stream, sending data: chunks that end with
data: [DONE].
curl https://gurouter.com/v1/chat/completions \ -H "Authorization: Bearer <API_KEY>" \ -H "Content-Type: application/json" \ -d '{ "model": "gpt-4o-mini", "stream": true, "messages": [ { "role": "user", "content": "Count to three." } ] }'Point a coding CLI at GuRouter
Section titled “Point a coding CLI at GuRouter”Claude Code, Codex CLI, and Gemini CLI can use GuRouter as their backend. See CLI tools with cc-switch for verified configuration.
Verified routes
Section titled “Verified routes”This page documents the routes verified against the live gateway:
GET /v1/modelsPOST /v1/chat/completionsPOST /v1/systemone(see SystemOne)POST /v1/messages,POST /v1/responses,POST /v1beta/models/{model}:generateContent(see CLI tools with cc-switch)
Other endpoints have not been verified against the live gateway. Do not assume a route exists or a field is supported until it appears on these pages.
