Chat Completions

Share
POST/api/v1/chat/completions

Create a chat completion with the OpenAI-compatible request format. The model value is the KiteRouter model ID you sell/use in the app; KiteRouter maps it to an active upstream provider model behind the scenes.

Example Request

bash
1curl https://kiterouter.com/api/v1/chat/completions \
2  -H "Authorization: Bearer kr-your-api-key" \
3  -H "Content-Type: application/json" \
4  -d '{
5    "model": "gpt-4o-mini",
6    "messages": [
7      {"role": "system", "content": "You are concise and practical."},
8      {"role": "user", "content": "Write a one-line product tagline."}
9    ],
10    "temperature": 0.7
11  }'

Example Response

json
1{
2  "id": "chatcmpl-abc123",
3  "object": "chat.completion",
4  "created": 1708100000,
5  "model": "gpt-4o-mini",
6  "choices": [
7    {
8      "index": 0,
9      "message": {
10        "role": "assistant",
11        "content": "One gateway, every AI model."
12      },
13      "finish_reason": "stop"
14    }
15  ],
16  "usage": {
17    "prompt_tokens": 28,
18    "completion_tokens": 8,
19    "total_tokens": 36
20  }
21}

Ready to start building?

Get your API key and make your first request in under a minute.