Skip to Content

Agents

The Agent endpoints manage the AI agents your organization runs. You can create, list, fetch, update, archive (soft-delete), and restore agents, and read or update an agent’s generation configuration. To actually run an agent, see Agent Query.

Reads require agents:read; writes require agents:write. Archiving and restoring additionally require the agent-delete permission on the role that minted the key.

The agent shape

Most endpoints return an agent object with this deny-by-default shape:

{ "id": "agt_7c1d8e", "name": "Support Bot", "description": "Answers product questions.", "status": "active", "language": "en", "type": "custom", "configuration": { "temperature": 0.7, "max_tokens": 1500, "system_prompt": "You are a helpful support agent.", "response_format": "conversational", "top_p": 1.0, "frequency_penalty": 0.0, "presence_penalty": 0.0, "streaming_enabled": true, "max_retrieved_chunks": 10, "show_citations": false }, "knowledge_access": { "folder_ids": ["fold_abc123"], "tag_ids": [], "document_ids": [], "access_mode": "inclusive", "document_count_cache": 12 }, "handoff_config": { "enabled": false }, "current_month_usage": { "queries": 134, "tokens_used": 41200, "last_reset_date": "2026-06-01T00:00:00Z" }, "created_at": "2026-05-20T11:00:00Z", "updated_at": "2026-06-07T08:30:00Z" }

The agent object exposes only tenant-facing fields. The underlying LLM provider/model identifier is deliberately not returned in any agent or configuration response — you set the model when you create an agent (a request input), but it is never echoed back. Internal identifiers, cost figures, and version/retry bookkeeping are likewise never present.

The status field is one of active, inactive, testing, or archived.


POST /agents

Create an agent. Returns 201 with the created agent. Accepts an Idempotency-Key so a retried create never produces a second agent.

Scope: agents:write · Success: 201

ParameterInTypeRequiredDescription
namebodystringYesAgent name (1–100 chars).
descriptionbodystringNoA description (≤500 chars).
statusbodystringNoactive, inactive, testing, or archived.
languagebodystringNoA BCP-47 response-language override. Inherits the org default when omitted.
configurationbodyobjectYesThe LLM configuration block (see below).
knowledge_accessbodyobjectNoWhich folders/tags/documents the agent may use.
handoff_configbodyobjectNoHuman-handoff configuration.
Idempotency-KeyheaderstringNoReplay-safe retry key.

The required configuration block carries the model and generation settings. model and system_prompt are required; everything else has a default:

FieldTypeRequiredDescription
modelstringYesThe model the agent should use. Request input only — never returned in any response.
system_promptstringYesThe agent’s system prompt (1–10000 chars).
temperaturenumberNo0.0–2.0. Defaults to 0.7.
max_tokensintegerNo100–4000. Defaults to 1500.
response_formatstringNoconversational or structured.
top_pnumberNo0.0–1.0. Defaults to 1.0.
frequency_penaltynumberNo-2.0–2.0. Defaults to 0.0.
presence_penaltynumberNo-2.0–2.0. Defaults to 0.0.
streaming_enabledbooleanNoDefaults to true.
max_retrieved_chunksintegerNo5–20. Defaults to 10.
show_citationsbooleanNoDefaults to false.
curl -X POST https://cuneiform.chat/api/developer/v1/agents \ -H "Authorization: Bearer cuk_live_xxxxxxxxxxxxxxxx" \ -H "Content-Type: application/json" \ -d '{ "name": "Support Bot", "description": "Answers product questions.", "configuration": { "model": "gpt-4o-mini", "system_prompt": "You are a helpful support agent." } }'
{ "id": "agt_7c1d8e", "name": "Support Bot", "description": "Answers product questions.", "status": "active", "language": null, "type": "custom", "configuration": { "temperature": 0.7, "max_tokens": 1500, "system_prompt": "You are a helpful support agent.", "response_format": "conversational", "top_p": 1.0, "frequency_penalty": 0.0, "presence_penalty": 0.0, "streaming_enabled": true, "max_retrieved_chunks": 10, "show_citations": false }, "knowledge_access": { "folder_ids": [], "tag_ids": [], "document_ids": [], "access_mode": "inclusive", "document_count_cache": 0 }, "handoff_config": { "enabled": false }, "current_month_usage": { "queries": 0, "tokens_used": 0, "last_reset_date": "2026-06-01T00:00:00Z" }, "created_at": "2026-06-07T08:30:00Z", "updated_at": "2026-06-07T08:30:00Z" }

Errors: 400, 401, 403 (scope or tier limit), 429, 500.


GET /agents

List agents, cursor-paginated, with optional status and search filters.

Scope: agents:read · Success: 200

ParameterInTypeRequiredDescription
limitqueryintegerNoPage size, 1–100. Defaults to 20.
cursorquerystringNoThe next_cursor from the previous page.
statusquerystringNoFilter by agent status.
searchquerystringNoFilter by a name/description search term.
curl "https://cuneiform.chat/api/developer/v1/agents?limit=20&status=active" \ -H "Authorization: Bearer cuk_live_xxxxxxxxxxxxxxxx"
{ "data": [ { "id": "agt_7c1d8e", "name": "Support Bot", "description": "Answers product questions.", "status": "active", "language": "en", "type": "custom", "configuration": { "temperature": 0.7, "max_tokens": 1500, "response_format": "conversational", "top_p": 1.0, "frequency_penalty": 0.0, "presence_penalty": 0.0, "streaming_enabled": true, "max_retrieved_chunks": 10, "show_citations": false }, "knowledge_access": { "folder_ids": ["fold_abc123"], "tag_ids": [], "document_ids": [], "access_mode": "inclusive", "document_count_cache": 12 }, "handoff_config": { "enabled": false }, "current_month_usage": { "queries": 134, "tokens_used": 41200, "last_reset_date": "2026-06-01T00:00:00Z" }, "created_at": "2026-05-20T11:00:00Z", "updated_at": "2026-06-07T08:30:00Z" } ], "has_more": false, "next_cursor": null }

The list view omits the system_prompt from each agent’s configuration for brevity; fetch a single agent to see it.

Errors: 400 invalid_cursor, 401, 403, 429, 500.


GET /agents/{agent_id}

Fetch a single agent by id.

Scope: agents:read · Success: 200

ParameterInTypeRequiredDescription
agent_idpathstringYesThe agent id.
curl https://cuneiform.chat/api/developer/v1/agents/agt_7c1d8e \ -H "Authorization: Bearer cuk_live_xxxxxxxxxxxxxxxx"

The response is a single agent object (see the agent shape).

Errors: 401, 403, 404 agent_not_found, 429, 500.


PATCH /agents/{agent_id}

Update an agent’s basic fields. All body fields are optional; omitted fields are left unchanged. Generation settings live on the configuration endpoint, not here.

Scope: agents:write · Success: 200

ParameterInTypeRequiredDescription
agent_idpathstringYesThe agent id.
namebodystringNoNew name (1–100 chars).
descriptionbodystringNoNew description (≤500 chars).
statusbodystringNoNew status.
languagebodystringNoNew BCP-47 language override.
handoff_configbodyobjectNoNew human-handoff configuration.
curl -X PATCH https://cuneiform.chat/api/developer/v1/agents/agt_7c1d8e \ -H "Authorization: Bearer cuk_live_xxxxxxxxxxxxxxxx" \ -H "Content-Type: application/json" \ -d '{ "status": "inactive" }'

The response is the updated agent object.

Errors: 400, 401, 403, 404, 429, 500.


DELETE /agents/{agent_id}

Archive (soft-delete) an agent. The agent is recoverable for 30 days via the restore endpoint. Returns 200 with an archive body carrying the restore deadline.

Scope: agents:write (the minting role must also hold the agent-delete permission) · Success: 200

ParameterInTypeRequiredDescription
agent_idpathstringYesThe agent id.
curl -X DELETE https://cuneiform.chat/api/developer/v1/agents/agt_7c1d8e \ -H "Authorization: Bearer cuk_live_xxxxxxxxxxxxxxxx"
{ "id": "agt_7c1d8e", "archived": true, "restore_before": "2026-07-07T08:30:00Z" }

Errors: 401, 403, 404, 429, 500.


POST /agents/{agent_id}/restore

Restore an archived agent within its 30-day recovery window. Returns the restored agent. An expired window or a not-archived agent returns 400.

Scope: agents:write (the minting role must also hold the agent-delete permission) · Success: 200

ParameterInTypeRequiredDescription
agent_idpathstringYesThe agent id.
curl -X POST https://cuneiform.chat/api/developer/v1/agents/agt_7c1d8e/restore \ -H "Authorization: Bearer cuk_live_xxxxxxxxxxxxxxxx"

The response is the restored agent object.

Errors: 400, 401, 403, 404, 429, 500.


GET /agents/{agent_id}/configuration

Fetch an agent’s configuration. Exposes only the tenant-facing generation settings; the underlying LLM provider/model identifier is not returned.

Scope: agents:read · Success: 200

ParameterInTypeRequiredDescription
agent_idpathstringYesThe agent id.
curl https://cuneiform.chat/api/developer/v1/agents/agt_7c1d8e/configuration \ -H "Authorization: Bearer cuk_live_xxxxxxxxxxxxxxxx"
{ "id": "agt_7c1d8e", "configuration": { "temperature": 0.7, "max_tokens": 1500, "system_prompt": "You are a helpful support agent.", "response_format": "conversational", "top_p": 1.0, "frequency_penalty": 0.0, "presence_penalty": 0.0, "streaming_enabled": true, "max_retrieved_chunks": 10, "show_citations": false }, "unsaved_changes": false }

Errors: 401, 403, 404, 429, 500.


PATCH /agents/{agent_id}/configuration

Update an agent’s generation settings. All body fields are optional. A setting that breaches your plan’s limits returns 403.

Scope: agents:write · Success: 200

ParameterInTypeRequiredDescription
agent_idpathstringYesThe agent id.
system_promptbodystringNoNew system prompt (1–10000 chars).
temperaturebodynumberNo0.0–2.0.
max_tokensbodyintegerNo100–4000.
response_formatbodystringNoconversational or structured.
top_pbodynumberNo0.0–1.0.
frequency_penaltybodynumberNo-2.0–2.0.
presence_penaltybodynumberNo-2.0–2.0.
streaming_enabledbodybooleanNoWhether streaming is enabled.
max_retrieved_chunksbodyintegerNo5–20.
show_citationsbodybooleanNoWhether to show citations.
save_as_draftbodybooleanNoSave without publishing a new version. Defaults to false.
curl -X PATCH https://cuneiform.chat/api/developer/v1/agents/agt_7c1d8e/configuration \ -H "Authorization: Bearer cuk_live_xxxxxxxxxxxxxxxx" \ -H "Content-Type: application/json" \ -d '{ "temperature": 0.4, "max_tokens": 2000 }'
{ "id": "agt_7c1d8e", "configuration": { "temperature": 0.4, "max_tokens": 2000, "system_prompt": "You are a helpful support agent.", "response_format": "conversational", "top_p": 1.0, "frequency_penalty": 0.0, "presence_penalty": 0.0, "streaming_enabled": true, "max_retrieved_chunks": 10, "show_citations": false } }

Errors: 400, 401, 403 (scope or tier limit), 404, 429, 500.

Last updated on