Chat & Responses

Create Chat Completion

Creates a model response from a conversation. Streaming and tool calling are supported by compatible models.

POST/v1/chat/completions

Parameters

ParameterType / locationDescription
modelRequiredstringbody

Exact model ID from the Models page.

messagesRequiredarraybody

Conversation messages in chronological order.

max_completion_tokensOptionalintegerbody

Maximum number of generated tokens.

reasoning_effortOptionalstringbody

Reasoning effort for supported reasoning models.

noneminimallowmediumhighxhighmax
temperatureOptionalnumberbody

Sampling temperature. Support varies by model.

streamOptionalbooleanbody

Returns Server-Sent Events when true.

toolsOptionalarraybody

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].