API reference
Chat Completions
Endpoints, request fields and response schemas for calling NeonAPI.
POST /v1/chat/completions
Authentication
Use your NeonAPI API key in Authorization: Bearer YOUR_API_KEY. Keep the key in a trusted application environment.
Availability and compatibility
Check the selected model’s protocol, permissions, price and supported parameters before calling. Unsupported parameters may be rejected. Request examples use placeholders.
Request fields
application/json
| Field | Type | Required | Constraints | Meaning |
|---|---|---|---|---|
model | string | Yes | — | Exact published model ID. |
messages | Message[] | Yes | — | Ordered conversation messages with role and content. |
temperature | number | No | ≥ 0; ≤ 2; default: 1 | Sampling temperature where supported. |
top_p | number | No | ≥ 0; ≤ 1; default: 1 | Nucleus sampling probability. |
n | integer | No | ≥ 1; default: 1 | Number of generated results; model limits apply. |
stream | boolean | No | default: false | Request incremental streaming events. |
stream_options | object | No | — | Stream options, including usage where supported. |
stop | string / string[] | No | — | — |
max_tokens | integer | No | — | Output token limit; model-dependent. |
max_completion_tokens | integer | No | — | Completion token budget for compatible models. |
presence_penalty | number | No | ≥ -2; ≤ 2; default: 0 | — |
frequency_penalty | number | No | ≥ -2; ≤ 2; default: 0 | — |
logit_bias | object | No | — | — |
user | string | No | — | — |
tools | Tool[] | No | — | Tool definitions supplied by your application. |
tool_choice | string / object | No | — | Control whether/how a tool is selected. |
response_format | ResponseFormat | No | — | Desired output format where supported. |
seed | integer | No | — | — |
reasoning_effort | string | No | low, medium, high | — |
modalities | string[] | No | — | — |
audio | object | No | — | — |
Full field definitions, nested objects and referenced schemas are available in the downloadable specification.
Request example
export NEON_API_KEY="YOUR_API_KEY"
curl https://neon-api.com/v1/chat/completions \
-H "Authorization: Bearer $NEON_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "YOUR_MODEL_ID",
"messages": [
{
"role": "user",
"content": "Hello"
}
]
}'Responses
Fields vary by model and protocol. The schema below describes the documented successful response; streams use protocol-specific events.
| Status | Meaning |
|---|---|
| 200 | Successful response |
| 400 | Invalid request |
| 429 | Rate limited |
Response schema
| Field | Type | Required | Constraints | Meaning |
|---|---|---|---|---|
id | string | No | — | Identifier returned for this result or task. |
object | string | No | — | — |
created | integer | No | — | — |
model | string | No | — | Exact published model ID. |
choices | object[] | No | — | Generated completion candidates. |
usage | Usage | No | — | Usage reported by the selected protocol. |
system_fingerprint | string | No | — | — |
Download the user API OpenAPI specification
See errors and streaming & tasks.