Skip to main content
POST
https://api.neosantara.xyz
/
v1
/
chat
/
completions
Create Chat Completion
curl --request POST \
  --url https://api.neosantara.xyz/v1/chat/completions \
  --header 'x-api-key: <api-key>'
{
  "id": "<string>",
  "object": "<string>",
  "created": 123,
  "model": "<string>",
  "choices": [
    {
      "index": 123,
      "message": {
        "role": "<string>",
        "content": "<string>",
        "tool_calls": [
          {}
        ]
      },
      "finish_reason": "<string>"
    }
  ],
  "usage": {
    "prompt_tokens": 123,
    "completion_tokens": 123,
    "total_tokens": 123
  }
}

Get your free API key

Start with 10,000 Monthly Token Limit on our Free Plan. No credit card required. Your tokens automatically reset on the 1st of each month.
model
string
required
ID of the model to use (e.g., garda-beta-mini, nusantara-base). See /v1/models.
messages
array
required
A list of messages comprising the conversation so far.
max_tokens
integer
The maximum number of tokens to generate in the chat completion.
temperature
number
default:"1"
What sampling temperature to use, between 0 and 2. Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic.
top_p
number
default:"1"
An alternative to sampling with temperature, called nucleus sampling, where the model considers the results of the tokens with top_p probability mass.
stream
boolean
default:"false"
If set, partial message deltas will be sent. Tokens will be sent as data-only server-sent events as they become available.
stop
string or array
Up to 4 sequences where the API will stop generating further tokens.
tools
array
A list of tools the model may call. Currently, only functions are supported as a tool. Use this to provide a list of functions the model may generate JSON inputs for.
tool_choice
string or object
Controls which (if any) tool is called by the model. Can be none, auto, required, or a specific tool object.
reasoning
object
Enable reasoning capabilities for supported models (e.g., nusantara-base, garda-beta-mini).
web_search_options
object
Configuration for web search capabilities on supported models.
response_format
object
An object specifying the format that the model must output.
user
string
A unique identifier representing your end-user, which can help Neosantara AI to monitor and detect abuse.

Returns

id
string
A unique identifier for the chat completion.
object
string
The object type, which is always chat.completion.
created
integer
The Unix timestamp (in seconds) of when the chat completion was created.
model
string
The model used for the chat completion.
choices
array
A list of chat completion choices.
usage
object
Usage statistics for the completion request.

Return Examples

Response 200
{
  "id": "chatcmpl-123",
  "object": "chat.completion",
  "created": 1677652288,
  "model": "nusantara-base",
  "choices": [
    {
      "index": 0,
      "message": {
        "role": "assistant",
        "content": "Hello there, how may I assist you today?"
      },
      "finish_reason": "stop"
    }
  ],
  "usage": {
    "prompt_tokens": 9,
    "completion_tokens": 12,
    "total_tokens": 21
  }
}
Last modified on December 7, 2025