Create a key in API Keys. Copy it once. Add prepaid credits in Credits.
Set your key
export REDROUTER_API_KEY="YOUR_REDROUTER_API_KEY"
Send a request
curl -X POST 'https://redrouter.org/v1/chat/completions' \
-H "Authorization: Bearer $REDROUTER_API_KEY" \
-H 'Content-Type: application/json' \
-d '{
"messages": [
{
"content": "Hello",
"role": "user"
}
],
"model": "glm-5.3-flash-rr"
}'
import os, json
from urllib.request import Request, urlopen
body = json.loads(r'''{
"messages": [
{
"content": "Hello",
"role": "user"
}
],
"model": "glm-5.3-flash-rr"
}''')
request = Request(
"https://redrouter.org/v1/chat/completions",
method="POST",
data=json.dumps(body).encode(),
headers={
"Authorization": "Bearer " + os.environ["REDROUTER_API_KEY"],
"Content-Type": "application/json",
},
)
with urlopen(request) as response:
print(json.load(response))
const key = process.env.REDROUTER_API_KEY;
const response = await fetch("https://redrouter.org/v1/chat/completions", {
method: "POST",
headers: {
Authorization: `Bearer ${key}`,
"Content-Type": "application/json",
},
body: JSON.stringify({
"messages": [
{
"content": "Hello",
"role": "user"
}
],
"model": "glm-5.3-flash-rr"
}),
});
if (!response.ok) throw new Error(await response.text());
console.log(await response.json());
Set base_url
For an OpenAI-compatible SDK, set base_url to https://redrouter.org/v1. Set api_key to your RedRouter key.
from openai import OpenAI
import os
client = OpenAI(base_url="https://redrouter.org/v1", api_key=os.environ["REDROUTER_API_KEY"])
response = client.chat.completions.create(
model="glm-5.3-flash-rr",
messages=[{"role": "user", "content": "Hello"}],
)
print(response.choices[0].message.content)
Clients that add an /api prefix may also use /api/v1 for the existing API operations, with the same authentication, limits, and streaming behavior. The canonical base URL remains https://redrouter.org/v1.