Creer une completion chat
Cree une reponse de modele depuis l historique de conversation.
application/json
gpt-4o, gpt-4.1, gpt-5, o3, o4-mini
curl -X POST https://api.routekey.ai/v1/chat/completions \
-H "Authorization: Bearer sk-your-key" \
-H "Content-Type: application/json" \
-d '{
"model": "gpt-4o",
"messages": [
{
"role": "user",
"content": "Hello from Route Key"
}
],
"stream": false
}'{
"id": "chatcmpl_xxx",
"object": "chat.completion",
"created": 0,
"model": "gpt-4o",
"choices": [
{
"index": 0,
"message": {
"role": "assistant",
"content": "Hello!"
},
"finish_reason": "stop"
}
],
"usage": {
"prompt_tokens": 8,
"completion_tokens": 3,
"total_tokens": 11
}
}curl -X POST 'https://api.routekey.ai/v1/chat/completions' \
-H 'Authorization: Bearer sk-your-key'
-H 'Content-Type: application/json'
-d '{
"model": "gpt-4o",
"messages": [
{
"role": "user",
"content": "Hello from Route Key"
}
],
"stream": false
}'Parametres
| Name | Type | Requis | Description |
|---|---|---|---|
model | string | Oui | Nom du modele |
messages | array<object> | Oui | Chat |
temperature | number | Non | Temperature |
top_p | number | Non | Top P |
stream | boolean | Non | Temps reel |
max_tokens | integer | Non | Max tokens |
tools | array<object> | Non | Tools |
response_format | object | Non | Response format |
Reponse
| Name | Type | Requis | Description |
|---|---|---|---|
id | string | - | ID |
object | string | - | Object |
created | integer | - | Created |
model | string | - | Nom du modele |
choices | array<object> | - | Choices |
usage | object | - | Usage |
Notes
- OpenAI Chat Completions
- Use the same request shape as the matching provider API when the backend channel is enabled.