Skip to main content

Retrieve agent

Return the complete agent configuration for an agent ID.

Endpoint

GET /agents/{agent_id} Returns 200 and the complete Agent object.

Path parameters

FieldRequiredTypeDescription
agent_idYesstringAgent 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"

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
}

Response fields

Omitted optional fields can be null.
FieldTypeDescription
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.
reasoning.effortstring / nullReasoning effort: none, minimal, low, medium, high, xhigh, max
reasoning.summarystring / nullReasoning summary: concise, detailed, auto
textobject / nullText output configuration.
text.formatobjectOutput format.
text.format.typestring / nullOutput format type, fixed as text
text.verbositystring / nullOutput verbosity, low, medium, high
instructionsstring / nullSaved custom instructions
toolsarray / nullSaved tool configuration; each branch returns only its own fields
tools[].functionobjectFunction tool configuration; returns name, description, and parameters
tools[].mcpobjectMCP tool configuration; returns server_label, transport, allowed_tools, required, and connection_origin; transport is http or stdio
tools[].web_searchobjectWeb search tool configuration; returns type and the saved configuration
multi_agentobject / nullSubagent configuration.
multi_agent.enabledbooleanWhether subagent tools are enabled
multi_agent.max_concurrent_subagentsinteger / nullMaximum number of concurrent subagents; no default is applied

Error codes

Business errors return an error object with type, code, message, and param. Common errors:
HTTP statusError type / codeSolution
401authentication_error / invalid_api_keySend a valid Authorization: Bearer $DASHSCOPE_API_KEY header
404not_found_error / not_found_errorUse an agent ID that exists and has not been deleted in the current workspace
500server_error / server_errorRetry later. If it keeps failing, submit a ticket with x-request-id