Create a new agent configuration.
Request headers
|
Header |
Required |
Description |
|
|
Yes |
|
|
|
Yes |
|
|
|
No |
Idempotency key that prevents duplicate creation. |
Request body
|
Field |
Type |
Required |
Description |
|
|
string |
Yes |
Agent name, 1-256 characters. |
|
|
string|object |
Yes |
Model identifier. Either a string such as |
|
|
string |
No |
System prompt. |
|
|
string |
No |
Agent description. |
|
|
array |
No |
Tool configuration list. See the |
|
|
array |
No |
MCP server configuration list, in the form |
|
|
array |
No |
Skill bindings, in the form |
|
|
object |
No |
Custom metadata key-value pairs. |
tools element structure
{
"type": "agent_toolset_20260401",
"enabled_tools": ["Bash", "Read", "Write", "Edit", "Glob", "Grep", "WebFetch", "WebSearch"]
}
|
Field |
Type |
Required |
Description |
|
|
string |
Yes |
Toolset type identifier. |
|
|
array |
No |
Allowlist of atomic tools to enable. Omitting the field or passing an empty array |
Example request
curl -X POST "https://api.qoder.com.cn/api/v1/cloud/agents" \
-H "Authorization: Bearer $QODER_PAT" \
-H "Content-Type: application/json" \
-d '{
"name": "doc-test-agent",
"model": "ultimate",
"instructions": "You are a documentation test assistant.",
"tools": [
{
"type": "agent_toolset_20260401",
"enabled_tools": ["Bash", "Read", "Write", "Edit", "Glob", "Grep", "WebFetch", "WebSearch"]
}
],
"mcp_servers": [
{
"type": "url",
"name": "weather-service",
"url": "https://mcp.example.com/sse"
}
]
}'
Example response
HTTP 201 Created
{
"type": "agent",
"id": "agent_019eXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
"name": "doc-test-agent",
"description": "",
"model": "ultimate",
"system": "You are a documentation test assistant.",
"instructions": "You are a documentation test assistant.",
"tools": [
{
"type": "agent_toolset_20260401",
"enabled_tools": ["Bash", "Read", "Write", "Edit", "Glob", "Grep", "WebFetch", "WebSearch"]
}
],
"mcp_servers": [
{
"type": "url",
"name": "weather-service",
"url": "https://mcp.example.com/sse"
}
],
"default_environment": "",
"version": 1,
"archived": false,
"archived_at": null,
"created_at": "2026-05-18T15:26:39.61669Z",
"updated_at": "2026-05-18T15:26:39.61669Z"
}
Response fields
|
Field |
Type |
Description |
|
|
string |
Always |
|
|
string |
Unique agent identifier, prefixed with |
|
|
string |
Agent name. |
|
|
string |
Agent description. |
|
|
string |
Model identifier. |
|
|
string |
System prompt. |
|
|
string |
Alias of |
|
|
array |
Tool configuration list. |
|
|
array |
MCP server configuration. |
|
|
string |
Default runtime environment. |
|
|
integer |
Current version number, starting at 1. |
|
|
boolean |
Whether the agent is archived. |
|
|
string | null |
Archive time (ISO 8601). |
|
|
string |
Creation time (ISO 8601). |
|
|
string |
Last update time (ISO 8601). |
Errors
|
HTTP |
Type |
Trigger |
|
400 |
|
Missing required field |
|
400 |
|
|
|
400 |
|
Missing required field |
|
400 |
|
|
|
400 |
|
|
|
401 |
|
PAT is invalid or has expired. |
|
403 |
|
Caller is not authorized for this operation. |
Error response example:
{
"type": "error",
"error": {
"type": "invalid_request_error",
"message": "name must be between 1 and 256 characters"
}
}
For the full error envelope, see Errors.