curl --request POST \
--url 'https://api.nsr.stateset.com/api/v1/nsr/train' \
--header "X-API-Key: $STATESET_NSR_API_KEY" \
--header 'Content-Type: application/json' \
--data '{
"epochs": 5,
"examples": [
{
"inputs": [
{
"type": "text",
"value": "walk"
}
],
"output": {
"type": "list",
"value": [
{
"type": "string",
"value": "WALK"
}
]
}
},
{
"inputs": [
{
"type": "text",
"value": "run"
}
],
"output": {
"type": "list",
"value": [
{
"type": "string",
"value": "RUN"
}
]
}
}
]
}'
{
"final_loss": 0.023,
"programs_learned": 3,
"successful_abductions": 8,
"total_examples": 10,
"training_time_ms": 1250
}
Train the NSR Machine on examples
Trains the neural-symbolic system using input-output pairs. The system learns to map inputs to outputs through both neural perception and symbolic program…
POST
/
api
/
v1
/
nsr
/
train
curl --request POST \
--url 'https://api.nsr.stateset.com/api/v1/nsr/train' \
--header "X-API-Key: $STATESET_NSR_API_KEY" \
--header 'Content-Type: application/json' \
--data '{
"epochs": 5,
"examples": [
{
"inputs": [
{
"type": "text",
"value": "walk"
}
],
"output": {
"type": "list",
"value": [
{
"type": "string",
"value": "WALK"
}
]
}
},
{
"inputs": [
{
"type": "text",
"value": "run"
}
],
"output": {
"type": "list",
"value": [
{
"type": "string",
"value": "RUN"
}
]
}
}
]
}'
{
"final_loss": 0.023,
"programs_learned": 3,
"successful_abductions": 8,
"total_examples": 10,
"training_time_ms": 1250
}
Trains the neural-symbolic system using input-output pairs. The system learns
to map inputs to outputs through both neural perception and symbolic program synthesis.
Training Process
Required scope:
- Neural perception maps inputs to symbol distributions
- Parser constructs syntactic structures
- Abductive reasoning synthesizes programs that explain the examples
- Library learning extracts reusable program components Example
curl -X POST 'https://api.nsr.stateset.com/api/v1/nsr/train' \
-H 'X-API-Key: your-api-key' \
-H 'Content-Type: application/json' \
-d '{
'examples': [
{'inputs': [{'type': 'text', 'value': 'walk'}], 'output': {'type': 'list', 'value': [{'type': 'string', 'value': 'WALK'}]}},
{'inputs': [{'type': 'text', 'value': 'run'}], 'output': {'type': 'list', 'value': [{'type': 'string', 'value': 'RUN'}]}}
],
'epochs': 5
}'
models:manage
Request body
NSRTrainRequest
Response
NSRTrainResponse
Status codes
| Code | Meaning |
|---|---|
200 | Training completed successfully |
400 | Invalid request - empty examples or validation failed |
401 | Unauthorized — missing or invalid credentials |
403 | Forbidden — the key/token lacks the required scope |
429 | Rate limited — see Retry-After / X-RateLimit-Reset |
500 | Internal server error - training failed |
504 | Training budget exhausted before completion |
curl --request POST \
--url 'https://api.nsr.stateset.com/api/v1/nsr/train' \
--header "X-API-Key: $STATESET_NSR_API_KEY" \
--header 'Content-Type: application/json' \
--data '{
"epochs": 5,
"examples": [
{
"inputs": [
{
"type": "text",
"value": "walk"
}
],
"output": {
"type": "list",
"value": [
{
"type": "string",
"value": "WALK"
}
]
}
},
{
"inputs": [
{
"type": "text",
"value": "run"
}
],
"output": {
"type": "list",
"value": [
{
"type": "string",
"value": "RUN"
}
]
}
}
]
}'
{
"final_loss": 0.023,
"programs_learned": 3,
"successful_abductions": 8,
"total_examples": 10,
"training_time_ms": 1250
}
Last modified on August 31, 2026