curl --request POST \
--url 'https://api.nsr.stateset.com/v1/messages' \
--header "X-API-Key: $STATESET_NSR_API_KEY" \
--header 'Content-Type: application/json' \
--data '{
"model": "string",
"messages": [
{
"role": "string",
"content": "Two-person tent, green — replacement for damaged pole set."
}
],
"system": "string",
"max_tokens": 1,
"tools": [
{}
],
"tool_choice": {
"type": "standard",
"name": "Two-Person Tent"
},
"stop_sequences": [
"string"
],
"temperature": 1.5,
"top_p": 1.5,
"top_k": 1,
"stream": true,
"metadata": {},
"hydrate_org_context": true,
"kb_limits": {},
"facts": [
{}
],
"rules": [
{}
],
"max_depth": 1,
"max_iterations": 8,
"confidence_threshold": 7.5,
"include_nsr_metadata": true
}'
{
"id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"type": "standard",
"role": "string",
"content": [
{
"type": "standard",
"text": "Two-person tent, green — replacement for damaged pole set.",
"id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"name": "Two-Person Tent",
"input": {}
}
],
"model": "string",
"stop_reason": "string",
"stop_sequence": "string",
"usage": {
"input_tokens": 1,
"output_tokens": 1
},
"x_nsr": {}
}
Anthropic-compatible Messages endpoint backed by the recursive NSR solver.
Required scope: write
POST
/
v1
/
messages
curl --request POST \
--url 'https://api.nsr.stateset.com/v1/messages' \
--header "X-API-Key: $STATESET_NSR_API_KEY" \
--header 'Content-Type: application/json' \
--data '{
"model": "string",
"messages": [
{
"role": "string",
"content": "Two-person tent, green — replacement for damaged pole set."
}
],
"system": "string",
"max_tokens": 1,
"tools": [
{}
],
"tool_choice": {
"type": "standard",
"name": "Two-Person Tent"
},
"stop_sequences": [
"string"
],
"temperature": 1.5,
"top_p": 1.5,
"top_k": 1,
"stream": true,
"metadata": {},
"hydrate_org_context": true,
"kb_limits": {},
"facts": [
{}
],
"rules": [
{}
],
"max_depth": 1,
"max_iterations": 8,
"confidence_threshold": 7.5,
"include_nsr_metadata": true
}'
{
"id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"type": "standard",
"role": "string",
"content": [
{
"type": "standard",
"text": "Two-person tent, green — replacement for damaged pole set.",
"id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"name": "Two-Person Tent",
"input": {}
}
],
"model": "string",
"stop_reason": "string",
"stop_sequence": "string",
"usage": {
"input_tokens": 1,
"output_tokens": 1
},
"x_nsr": {}
}
Required scope:
write
Request body
object
string
Model identifier (e.g.
claude-3-5-sonnet, or an nsr-v2-* alias). Used to select the NSR solver mode.object[]
required
Conversation turns.
string
Optional top-level system prompt (string or array of text blocks).
integer
Maximum tokens to generate; honored as a truncation budget on the generated text.
object[]
Tool definitions (Anthropic shape:
{name, description, input_schema}).object
Tool selection:
{'type': 'auto'|'any'|'tool', 'name'?}.string[]
If the generated text contains one, generation reports
stop_reason = 'stop_sequence'.number
Accepted for compatibility; the solver is deterministic so it does not affect output.
number
Accepted for compatibility.
integer
Accepted for compatibility.
boolean
When true, emit the Anthropic SSE event stream.
object
Opaque request metadata (passed through, not interpreted).
boolean
When false, skip org knowledge-base hydration.
object
Optional per-request hydration limits.
object[]
Request-scoped facts injected into the working set.
object[]
Request-scoped rules injected into the working set.
integer
Recursion depth override.
integer
Iteration budget override.
number
Confidence threshold override.
boolean
When true, attach the full recursive payload under
x_nsr.Response
object
string
required
string
required
string
required
object[]
required
string
required
string
required
string
required
object
Full recursive NSR payload. Present only when
include_nsr_metadata is true.Status codes
| Code | Meaning |
|---|---|
200 | Anthropic-compatible message. With stream: true the body is an Anthropic SSE event stream instead. |
401 | Unauthorized — missing or invalid credentials |
403 | Forbidden — the key/token lacks the required scope |
429 | Rate limited — see Retry-After / X-RateLimit-Reset |
curl --request POST \
--url 'https://api.nsr.stateset.com/v1/messages' \
--header "X-API-Key: $STATESET_NSR_API_KEY" \
--header 'Content-Type: application/json' \
--data '{
"model": "string",
"messages": [
{
"role": "string",
"content": "Two-person tent, green — replacement for damaged pole set."
}
],
"system": "string",
"max_tokens": 1,
"tools": [
{}
],
"tool_choice": {
"type": "standard",
"name": "Two-Person Tent"
},
"stop_sequences": [
"string"
],
"temperature": 1.5,
"top_p": 1.5,
"top_k": 1,
"stream": true,
"metadata": {},
"hydrate_org_context": true,
"kb_limits": {},
"facts": [
{}
],
"rules": [
{}
],
"max_depth": 1,
"max_iterations": 8,
"confidence_threshold": 7.5,
"include_nsr_metadata": true
}'
{
"id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"type": "standard",
"role": "string",
"content": [
{
"type": "standard",
"text": "Two-person tent, green — replacement for damaged pole set.",
"id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"name": "Two-Person Tent",
"input": {}
}
],
"model": "string",
"stop_reason": "string",
"stop_sequence": "string",
"usage": {
"input_tokens": 1,
"output_tokens": 1
},
"x_nsr": {}
}
Last modified on August 31, 2026