Step 1: Get Your API Key
- Visit Crazyrouter and create an account
- Go to the Token Management page
- Click “Create Token” to generate an API Key
Step 2: Make a Request
curl https://crazyrouter.com/v1/chat/completions \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR_API_KEY" \
-d '{
"model": "gpt-4o",
"messages": [
{"role": "user", "content": "Hello"}
]
}'
Step 3: View the Response
Example of a successful response:
{
"id": "chatcmpl-abc123",
"object": "chat.completion",
"created": 1677652288,
"choices": [{
"index": 0,
"message": {
"role": "assistant",
"content": "Hello! How can I help you today?"
},
"finish_reason": "stop"
}],
"usage": {
"prompt_tokens": 9,
"completion_tokens": 12,
"total_tokens": 21
}
}
All OpenAI-compatible clients and frameworks (such as LangChain, LlamaIndex, Cursor, etc.) can be integrated by simply changing the base_url and api_key.