POST
/v1/chat/completions/v1/chat/completions
Use this endpoint with any OpenAI SDK client. The request body follows OpenAI's chat completions schema unchanged. The model field must be a value returned by GET /v1/models.
Request#
Replace MODEL_ID with a model id from GET /v1/models.
curl https://api.atptoken.ai/v1/chat/completions \
-H "Authorization: Bearer $ATP_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "MODEL_ID",
"messages": [{"role": "user", "content": "hi"}]
}'Parameters#
Response#
{
"id": "chatcmpl-...",
"object": "chat.completion",
"model": "<model>",
"choices": [
{
"index": 0,
"message": { "role": "assistant", "content": "..." },
"finish_reason": "stop"
}
],
"usage": { "prompt_tokens": 9, "completion_tokens": 12, "total_tokens": 21 }
}Next steps
Was this page helpful?