API reference
Claude Messages
Endpoints, request fields and response schemas for calling NeonAPI.
POST /v1/messages
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.
Path and query parameters
| Field | In | Type | Required |
|---|---|---|---|
anthropic-version | header | string | Yes |
x-api-key | header | string | No |
Request fields
application/json
| Field | Type | Required | Constraints | Meaning |
|---|---|---|---|---|
model | string | Yes | — | Exact published model ID. |
messages | ClaudeMessage[] | Yes | — | Ordered conversation messages with role and content. |
system | string / object[] | No | — | — |
cache_control | object | No | — | — |
inference_geo | string | No | — | — |
max_tokens | integer | Yes | ≥ 1 | Output token limit; model-dependent. |
temperature | number | No | ≥ 0; ≤ 1 | Sampling temperature where supported. |
top_p | number | No | — | Nucleus sampling probability. |
top_k | integer | No | — | — |
stream | boolean | No | — | Request incremental streaming events. |
stop_sequences | string[] | No | — | — |
tools | object[] | No | — | Tool definitions supplied by your application. |
tool_choice | object | No | — | Control whether/how a tool is selected. |
thinking | object | No | — | — |
context_management | object | No | — | — |
output_config | object | No | — | — |
output_format | object | No | — | — |
container | string / object | No | — | — |
mcp_servers | object[] | No | — | — |
metadata | object | No | — | — |
speed | string | No | standard, fast | — |
service_tier | string | No | auto, standard_only | — |
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/messages \
-H "Authorization: Bearer $NEON_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "YOUR_MODEL_ID",
"messages": [
{
"role": "user",
"content": "Hello"
}
],
"max_tokens": 256
}'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 |
Response schema
| Field | Type | Required | Constraints | Meaning |
|---|---|---|---|---|
id | string | No | — | Identifier returned for this result or task. |
type | string | No | — | — |
role | string | No | — | — |
content | object[] | No | — | — |
model | string | No | — | Exact published model ID. |
stop_reason | string | No | end_turn, max_tokens, stop_sequence, tool_use | — |
usage | object | No | — | Usage reported by the selected protocol. |
Download the user API OpenAPI specification
See errors and streaming & tasks.