API reference
Chat Completions
POST https://api.flyrouter.ai/v1/chat/completions
The OpenAI-compatible chat completions endpoint. It can call every text model (Claude, GPT, Gemini, Grok, DeepSeek and more), with requests and responses in exactly OpenAI's format.
Example request
Terminal
curl https://api.flyrouter.ai/v1/chat/completions \
-H "Authorization: Bearer $FLYROUTER_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "gpt-6.1-sol",
"messages": [
{"role": "system", "content": "You are a concise assistant."},
{"role": "user", "content": "What is a vector database?"}
],
"max_tokens": 1024
}'Request parameters
| Parameter | Type | Description |
|---|---|---|
model | string | Required. Model ID; see Models |
messages | array | Required. Conversation messages with role of system, user, assistant or tool |
stream | boolean | Stream the response; see Streaming |
stream_options | object | With streaming, {"include_usage": true} returns usage in the last chunk |
max_tokens / max_completion_tokens | integer | Maximum tokens to generate |
temperature / top_p | number | Sampling parameters. Some newer models (such as newer Claude and reasoning models) don't support them and may reject or ignore them |
stop | string / array | Stop generating at these strings |
tools / tool_choice | array / string | Tool calling |
response_format | object | Structured output |
reasoning_effort | string | GPT reasoning depth: low, medium, high; see Reasoning |
Message content can be a string or an array of content blocks (text and image_url images); see Vision.
Response
json
{
"id": "chatcmpl-...",
"object": "chat.completion",
"created": 1761800000,
"model": "gpt-6.1-sol",
"choices": [
{
"index": 0,
"message": { "role": "assistant", "content": "A vector database is..." },
"finish_reason": "stop"
}
],
"usage": {
"prompt_tokens": 26,
"completion_tokens": 182,
"total_tokens": 208,
"prompt_tokens_details": { "cached_tokens": 0 }
}
}Common finish_reason values: stop (finished normally), length (cut off at max_tokens) and tool_calls (the model wants to call a tool).
Calling Claude through Chat Completions
It works, but it's best for simple chat. Claude-specific features such as prompt caching and reasoning may be unavailable or weaker in the OpenAI format. If you need them, use Messages instead.