Chat & Responses
Create Chat Completion
Creates a model response from a conversation. Streaming and tool calling are supported by compatible models.
POST
/v1/chat/completionsParameters
| Parameter | Type / location | Description |
|---|---|---|
modelRequired | stringbody | Exact model ID from the Models page. |
messagesRequired | arraybody | Conversation messages in chronological order. |
max_completion_tokensOptional | integerbody | Maximum number of generated tokens. |
reasoning_effortOptional | stringbody | Reasoning effort for supported reasoning models. noneminimallowmediumhighxhighmax |
temperatureOptional | numberbody | Sampling temperature. Support varies by model. |
streamOptional | booleanbody | Returns Server-Sent Events when true. |
toolsOptional | arraybody | Tools or functions available to the model. |
Request examples
cURL
curl --request POST \
--url 'https://api.juhenextvip.com/v1/chat/completions' \
--header 'Authorization: Bearer <YOUR_API_KEY>' \
--header 'Content-Type: application/json' \
--data '{
"model": "gpt-5.6-luna",
"messages": [
{
"role": "developer",
"content": "You are a helpful assistant."
},
{
"role": "user",
"content": "Hello!"
}
]
}'Response examples
JSON
{
"id": "chatcmpl_...",
"object": "chat.completion",
"choices": [
{
"index": 0,
"message": {
"role": "assistant",
"content": "Hello! How can I help?"
},
"finish_reason": "stop"
}
],
"usage": {
"prompt_tokens": 24,
"completion_tokens": 9,
"total_tokens": 33
}
}Usage notes
- For streaming, set stream to true and read events until [DONE].