Documentation
POST /v1/chat/completions in the NexoRouter documentation.
POST /v1/chat/completions
Status: Stable public endpoint.
Creates one OpenAI-compatible chat completion.
Endpoint
POST https://api.nexorouter.com/v1/chat/completions
Authorization: Bearer YOUR_NEXOROUTER_API_KEY
Content-Type: application/json
Request body
| Field | Type | Required | Notes |
|---|---|---|---|
model | string | yes | Copy the exact ID from Models or GET /v1/models. |
messages | array | yes | Non-empty OpenAI-compatible message list. |
temperature | number | no | 0 to 2. |
top_p | number | no | 0 to 1. |
max_tokens | integer | no | Positive integer. |
Minimal curl
curl https://api.nexorouter.com/v1/chat/completions \
-H "Authorization: Bearer $NEXOROUTER_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "deepseek-v4-flash",
"messages": [
{ "role": "user", "content": "Write one short launch checklist." }
],
"max_tokens": 256
}'
Response shape
{
"id": "chatcmpl_example",
"object": "chat.completion",
"choices": [
{
"index": 0,
"message": {
"role": "assistant",
"content": "Create an API key, choose a model, test in Playground, and monitor usage logs."
},
"finish_reason": "stop"
}
],
"usage": {
"prompt_tokens": 20,
"completion_tokens": 18,
"total_tokens": 38
}
}
Verify in Usage Logs
After a request succeeds or fails, confirm the log entry includes the API key name, model ID, status, token counts, cost, latency, and request ID.