Skip to main content
POST
https://api.neosantara.xyz
/
v1
/
messages
Create a Message
curl --request POST \
  --url https://api.neosantara.xyz/v1/messages \
  --header 'x-api-key: <api-key>'
{
  "id": "<string>",
  "type": "<string>",
  "role": "<string>",
  "model": "<string>",
  "stop_reason": "<string>",
  "stop_sequence": {},
  "content": {
    "type": "<string>",
    "text": "<string>"
  },
  "usage": {
    "input_tokens": 123,
    "output_tokens": 123,
    "cache_creation_input_tokens": 123,
    "cache_read_input_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
The model ID to use for the request.Example: "garda-beta-mini", "nusantara-base"
messages
array[object]
required
Array of message objects with alternating user/assistant roles.
max_tokens
integer
required
Maximum tokens for the response.Range: β‰₯ 1
system
string | array[object]
System prompt/instructions for the model.
temperature
number
default:"1.0"
Controls randomness. Higher = more random, Lower = more deterministic.Range: 0.0 - 1.0
stream
boolean
default:"false"
Enable streaming responses (Server-Sent Events format).
top_p
number
default:"1.0"
Nucleus sampling - cumulative probability threshold.Range: 0.0 - 1.0
top_k
number
Sample from top K tokens by probability.Range: > 0
stop_sequences
array[string]
default:"[]"
Sequences where generation stops.Max Items: Typically 5 sequences
tools
array[object]
default:"[]"
Array of tool/function definitions.
tool_choice
string
default:"auto"
How to handle tool selection.
thinking
object
Enable extended thinking mode.
metadata
object
default:"{}"
Custom metadata for tracking/logging.
service_tier
string
default:"auto"
Which service tier to use.

Returns

id
string
The unique identifier for the message.
type
string
The type of the response, always "message".
role
string
The role of the responder, always "assistant".
model
string
The model used for the response.
stop_reason
string
The reason generation stopped, e.g., "end_turn".
stop_sequence
string | null
The stop sequence that triggered the end, if any.
content
array[object]
The generated content.
usage
object
Token usage statistics.

Return Examples

Response 200
{
  "id": "msg_01XYZ...",
  "type": "message",
  "role": "assistant",
  "model": "nusantara-base",
  "content": [
    {
      "type": "text",
      "text": "The capital of France is Paris."
    }
  ],
  "stop_reason": "end_turn",
  "usage": {
    "input_tokens": 12,
    "output_tokens": 8
  }
}
Last modified on December 3, 2025