Skip to main content
POST
/
v1
/
chat
/
completions
curl --request POST \
  --url https://api.naga.ac/v1/chat/completions \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "model": "gpt-4o-mini",
  "messages": [
    {
      "role": "user",
      "content": "Write a two-line summary of Tokyo."
    }
  ]
}
'
{
  "id": "<string>",
  "created": 123,
  "model": "<string>",
  "choices": [
    {
      "message": {
        "role": "<string>",
        "content": "<string>",
        "refusal": "<string>",
        "tool_calls": [
          {
            "function": {
              "name": "<string>",
              "arguments": ""
            },
            "id": "<string>",
            "type": "function"
          }
        ],
        "annotations": [
          {}
        ],
        "reasoning_content": "<string>",
        "reasoning_details": [
          {}
        ],
        "images": [
          {}
        ],
        "name": "<string>",
        "tool_call_id": "<string>"
      },
      "index": 0,
      "finish_reason": "<string>",
      "logprobs": {}
    }
  ],
  "object": "chat.completion",
  "usage": {
    "prompt_tokens": 123,
    "completion_tokens": 123,
    "total_tokens": 123,
    "prompt_tokens_details": {
      "cached_tokens": 123
    },
    "completion_tokens_details": {
      "image_tokens": 123
    }
  }
}

Authorizations

Authorization
string
header
required

Primary authentication for inference endpoints. Send your Naga API key as Authorization: Bearer <api-key>.

Body

application/json
model
string
required

Model identifier to route the request to.

Example:

"gpt-4o-mini"

messages
ChatMessage · object[]
required

Conversation history in OpenAI Chat Completions format.

Minimum array length: 1
tools
Tool · object[] | null
tool_choice
response_format
TextResponseFormat · object
temperature
number | null
Required range: 0 <= x <= 2
top_p
number | null
Required range: 0 <= x <= 1
stream
boolean | null
default:false
stream_options
StreamOptions · object
stop
max_completion_tokens
integer | null
Required range: x >= 1
reasoning_effort
enum<string>
Available options:
none,
minimal,
low,
medium,
high,
xhigh
presence_penalty
number | null
Required range: -2 <= x <= 2
frequency_penalty
number | null
Required range: -2 <= x <= 2
logit_bias
Logit Bias · object
parallel_tool_calls
boolean
prediction
Prediction · object
web_search_options
Web Search Options · object
image_config
ImageConfig · object

Response

JSON response when stream=false, or Server-Sent Events when stream=true.

id
string
required
created
integer
required
model
string
required
choices
ChatCompletionChoiceResponse · object[]
required
object
string
default:chat.completion
Allowed value: "chat.completion"
usage
ChatCompletionUsageResponse · object