Skip to content

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.

Watch the walkthrough above, then continue with the steps below for the exact values. Direct link: https://www.youtube.com/watch?v=HStwL7-AN10.

The API is served at:

https://gurouter.com

All endpoints below are relative to a base URL, for example https://gurouter.com/v1/chat/completions.

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.

Terminal window
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.

POST /v1/chat/completions follows the OpenAI Chat Completions request and response format.

curl
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." }
]
}'
Python
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)
Node.js
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 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].

Terminal window
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." }
]
}'

Claude Code, Codex CLI, and Gemini CLI can use GuRouter as their backend. See CLI tools with cc-switch for verified configuration.

This page documents the routes verified against the live gateway:

  • GET /v1/models
  • POST /v1/chat/completions
  • POST /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.