Retrieve agent

Updated at:

Return the complete agent configuration for an agent ID.

Endpoint

Returns 200 and the complete Agent object.

GET/agents/{agent_id}

Path parameters

agent_idstringRequired

Agent 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.

idstring

Agent ID. Treat it as an opaque string

objectstring

Agent object type, fixed as agent

created_atinteger

Creation time as a Unix timestamp in seconds

updated_atinteger

Last modification time as a Unix timestamp in seconds; not a version number

namestring / null

Display name

metadataobject / null

Metadata, saved string key-value pairs

modelstring

Saved model ID

reasoningobject / null

Reasoning configuration. Either subfield can be null.

Properties

effortstring / null

Reasoning effort: none, minimal, low, medium, high, xhigh, max

summarystring / null

Reasoning summary: concise, detailed, auto

textobject / null

Text output configuration.

Properties

formatobject

Output format.

Properties

typestring / null

Output format type, fixed as text

verbositystring / null

Output verbosity, low, medium, high

instructionsstring / null

Saved custom instructions

toolsarray / null

Saved tool configuration; each branch returns only its own fields

Properties

functionobject

Function tool configuration; returns name, description, and parameters

mcpobject

MCP tool configuration; returns server_label, transport, allowed_tools, required, and connection_origin; transport is http or stdio

web_searchobject

Web search tool configuration; returns type and the saved configuration

multi_agentobject / null

Subagent configuration.

Properties

enabledboolean

Whether subagent tools are enabled

max_concurrent_subagentsinteger / null

Maximum 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 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