Your first request in two minutes.
Create a key, point your client at one base URL, and call any model with curl, Python or Node.
Create a key
Sign in and create a key under Dashboard, API keys. The secret is shown once and stored only as a hash, so copy it then. The free models work with a zero balance; every other model draws on prepaid credits.
Create an API keyPoint your client at Rapid Router
Every endpoint lives under one base URL, https://rapidrouter.ai/api/v1. Keep the key in an environment variable rather than in code.
export RAPIDROUTER_API_KEY="sk-rr-v1-..."Send your first request
Name any model in the catalog by its vendor/model id. Here, Claude Sonnet 5:
curl https://rapidrouter.ai/api/v1/chat/completions \
-H "Authorization: Bearer $RAPIDROUTER_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "anthropic/claude-sonnet-5",
"messages": [
{
"role": "user",
"content": "Hi"
}
]
}'Read the reply
The standard chat completion, with two additions: provider says which upstream served it, and usage.cost is what the request billed, in US dollars. Swap the model string and the same code calls GPT, Gemini or any of the others.
{
"id": "msg_011CeHkp77djK1hiHwaAy22u",
"object": "chat.completion",
"model": "anthropic/claude-sonnet-5",
"provider": "anthropic",
"choices": [
{ "index": 0, "message": { "role": "assistant", "content": "..." }, "finish_reason": "stop" }
],
"usage": { "prompt_tokens": 18, "completion_tokens": 96, "total_tokens": 114, "cost": 0.000996 }
}Change two values and nothing else: the base URL, and the model string, which is namespaced (anthropic/claude-haiku-4-5, not gpt-4). That is all the OpenAI SDKs above needed, and the same holds for Anthropic's SDK, the Vercel AI SDK, LangChain and any tool that takes a custom base URL; see frameworks and SDKs.
# pip install anthropic (works because Rapid Router also speaks /v1/messages)
# The base URL has no /v1 here: the Anthropic SDK adds /v1/messages itself.
import os
from anthropic import Anthropic
client = Anthropic(base_url="https://rapidrouter.ai/api", api_key=os.environ["RAPIDROUTER_API_KEY"])
m = client.messages.create(
model="anthropic/claude-sonnet-5",
max_tokens=1024,
messages=[{"role":"user","content":"Hi"}],
)
print(m.content[0].text)