Get Agent
GET
/v1/agents/{agent_id}Retrieve an agent. By default returns the latest version; pass version to fetch a specific historical version.
Path Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
agent_id | string | ✅ | The agent ID (agent_...) |
Query Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
version | integer | ❌ | Agent version. Omit for the latest. Must be ≥ 1. |
Request Examples
python
from anthropic import Anthropic
client = Anthropic(
api_key="sk-sb-YOUR_KEY",
base_url="https://api.sandbase.ai"
)
agent = client.beta.agents.retrieve(
agent_id="agent_01HqR2k7..."
)
print(f"{agent.name} v{agent.version}")bash
# Latest version
curl https://api.sandbase.ai/v1/agents/agent_01HqR2k7... \
-H "Authorization: Bearer sk-sb-YOUR_KEY"
# Specific version
curl "https://api.sandbase.ai/v1/agents/agent_01HqR2k7...?version=2" \
-H "Authorization: Bearer sk-sb-YOUR_KEY"Response
Returns an Agent object.
json
{
"id": "agent_01HqR2k7...",
"type": "agent",
"version": 1,
"name": "Research Assistant",
"description": "A general-purpose research agent.",
"model": { "id": "claude-sonnet-4", "speed": "standard" },
"system": "You are a research assistant...",
"tools": [
{
"type": "agent_toolset_20260401",
"default_config": { "enabled": true, "permission_policy": { "type": "always_ask" } },
"configs": [{ "name": "bash", "enabled": true, "permission_policy": { "type": "always_allow" } }]
}
],
"mcp_servers": [
{ "name": "web-search", "type": "url", "url": "https://mcp.sandbase.ai/web-search/sse" }
],
"metadata": {},
"archived_at": null,
"created_at": "2026-05-29T10:00:00Z",
"updated_at": "2026-05-29T10:00:00Z"
}Errors
| Status | Type | Description |
|---|---|---|
| 401 | authentication_error | Invalid or missing API key |
| 404 | not_found | Agent or version not found |

