Retrieve agent
Return the complete agent configuration for an agent ID.
Endpoint
Returns 200 and the complete Agent object.
/agents/{agent_id}Path parameters
agent_idstringRequiredAgent ID. Treat it as an opaque string
This endpoint has no query parameters. If agent_id is malformed, does not exist, has been deleted, or belongs to another workspace, the API returns 404.
Request example
curl -sS "$BASE_URL/agents/agent_xxx" \
-H "Authorization: Bearer $DASHSCOPE_API_KEY" \
-H "OpenAI-Beta: agents=v1"
agent = client.beta.agents.retrieve("agent_xxx")
print(agent.id, agent.model)
Response fields
Omitted optional fields can be null.
idstringAgent ID. Treat it as an opaque string
objectstringAgent object type, fixed as agent
created_atintegerCreation time as a Unix timestamp in seconds
updated_atintegerLast modification time as a Unix timestamp in seconds; not a version number
namestring / nullDisplay name
metadataobject / nullMetadata, saved string key-value pairs
modelstringSaved model ID
reasoningobject / nullReasoning configuration. Either subfield can be null.
Properties
effortstring / nullReasoning effort: none, minimal, low, medium, high, xhigh, max
summarystring / nullReasoning summary: concise, detailed, auto
textobject / nullText output configuration.
Properties
formatobjectOutput format.
Properties
typestring / nullOutput format type, fixed as text
verbositystring / nullOutput verbosity, low, medium, high
instructionsstring / nullSaved custom instructions
toolsarray / nullSaved tool configuration; each branch returns only its own fields
Properties
functionobjectFunction tool configuration; returns name, description, and parameters
mcpobjectMCP tool configuration; returns server_label, transport, allowed_tools, required, and connection_origin; transport is http or stdio
web_searchobjectWeb search tool configuration; returns type and the saved configuration
multi_agentobject / nullSubagent configuration.
Properties
enabledbooleanWhether subagent tools are enabled
max_concurrent_subagentsinteger / nullMaximum number of concurrent subagents; no default is applied
Response example
{
"id": "agent_xxx",
"object": "agent",
"created_at": 1794117521,
"updated_at": 1794117521,
"name": "quickstart-agent",
"metadata": null,
"model": "qwen3.8-max",
"reasoning": null,
"text": null,
"instructions": "Answer briefly.",
"tools": null,
"multi_agent": null
}
Error codes
Business errors return an error object with type, code, message, and param. Common errors:
| HTTP status | Error type / code | Solution |
|---|---|---|
401 | authentication_error / invalid_api_key | Send a valid Authorization: Bearer $DASHSCOPE_API_KEY header |
404 | not_found_error / not_found_error | Use an agent ID that exists and has not been deleted in the current workspace |
500 | server_error / server_error | Retry later. If it keeps failing, submit a ticket with x-request-id |