curl --request POST \
--url 'http://localhost:8000/agents' \
--header "Authorization: Bearer $STATESET_AGENTS_API_KEY" \
--header 'Content-Type: application/json' \
--data '{
"enable_planning": true,
"max_new_tokens": 256,
"model_name": "gpt2",
"planning_config": {
"max_steps": 4
},
"system_prompt": "You are a helpful AI assistant.",
"temperature": 0.7,
"top_p": 0.9
}'
{
"agent_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"created_at": "2026-08-31T14:22:05Z",
"config": {
"enable_planning": true,
"max_new_tokens": 256,
"model_name": "gpt2",
"planning_config": {
"max_steps": 4
},
"system_prompt": "You are a helpful AI assistant.",
"temperature": 0.7,
"top_p": 0.9
},
"message": "Agent created successfully"
}
Create Agent
Create a new AI agent with the specified configuration.
POST
/
agents
curl --request POST \
--url 'http://localhost:8000/agents' \
--header "Authorization: Bearer $STATESET_AGENTS_API_KEY" \
--header 'Content-Type: application/json' \
--data '{
"enable_planning": true,
"max_new_tokens": 256,
"model_name": "gpt2",
"planning_config": {
"max_steps": 4
},
"system_prompt": "You are a helpful AI assistant.",
"temperature": 0.7,
"top_p": 0.9
}'
{
"agent_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"created_at": "2026-08-31T14:22:05Z",
"config": {
"enable_planning": true,
"max_new_tokens": 256,
"model_name": "gpt2",
"planning_config": {
"max_steps": 4
},
"system_prompt": "You are a helpful AI assistant.",
"temperature": 0.7,
"top_p": 0.9
},
"message": "Agent created successfully"
}
Create a new AI agent with the specified configuration.
Request body
AgentConfigRequest
string
required
Name of the model to use
integer
Maximum tokens to generate
number
Sampling temperature
number
Top-p sampling parameter
integer
Top-k sampling parameter
string,null
System prompt for the agent
boolean
Whether to use chat template
boolean
Enable long-term planning
object,null
Planning configuration overrides
Response
AgentCreatedResponse
string
required
Unique identifier for the created agent
string (date-time)
Creation timestamp
AgentConfigRequest
required
Agent configuration
Show AgentConfigRequest
Show AgentConfigRequest
string
required
Name of the model to use
integer
Maximum tokens to generate
number
Sampling temperature
number
Top-p sampling parameter
integer
Top-k sampling parameter
string,null
System prompt for the agent
boolean
Whether to use chat template
boolean
Enable long-term planning
object,null
Planning configuration overrides
string
Status message
Status codes
| Code | Meaning |
|---|---|
200 | Successful response |
201 | Agent created successfully |
400 | Invalid configuration |
401 | Authentication required |
422 | Validation Error |
429 | Rate limit exceeded |
500 | Internal server error |
curl --request POST \
--url 'http://localhost:8000/agents' \
--header "Authorization: Bearer $STATESET_AGENTS_API_KEY" \
--header 'Content-Type: application/json' \
--data '{
"enable_planning": true,
"max_new_tokens": 256,
"model_name": "gpt2",
"planning_config": {
"max_steps": 4
},
"system_prompt": "You are a helpful AI assistant.",
"temperature": 0.7,
"top_p": 0.9
}'
{
"agent_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"created_at": "2026-08-31T14:22:05Z",
"config": {
"enable_planning": true,
"max_new_tokens": 256,
"model_name": "gpt2",
"planning_config": {
"max_steps": 4
},
"system_prompt": "You are a helpful AI assistant.",
"temperature": 0.7,
"top_p": 0.9
},
"message": "Agent created successfully"
}
Last modified on August 31, 2026