Skip to content

Create Agent

POST/v1/agents

Create a reusable, versioned agent. An agent bundles a model, system prompt, tools, and MCP servers into a configuration you reference by ID when creating sessions.

Claude API compatibility

SandBase implements a subset of the Claude Managed Agents Agent API. The fields below are supported today. Claude's skills and multiagent fields are accepted for forward compatibility but not yet active.

Request Parameters

ParameterTypeRequiredDescription
modelstring | objectModel identifier. A model string (e.g. "claude-sonnet-4", "gpt-4o") or a { "id", "speed" } object.
namestringHuman-readable name. 1–256 characters.
descriptionstringWhat the agent does. Up to 2048 characters.
systemstringSystem prompt. Up to 100,000 characters.
toolsarrayTool configurations. Max 128 tools across all toolsets.
mcp_serversarrayMCP servers to connect. Max 20. Names must be unique.
metadataobjectArbitrary key-value metadata. Max 16 pairs, keys ≤ 64 chars, values ≤ 512 chars.

Model

SandBase is multi-model — model accepts any model identifier from the SandBase catalog, not only Claude models.

jsonc
// String form
"claude-sonnet-4"

// Object form
{ "id": "claude-sonnet-4", "speed": "standard" }
FieldTypeDescription
idstringModel identifier
speedstring"standard" (default) or "fast". Not all models support fast.

Tools

The tools array can contain three tool types.

Built-in Agent Toolset

json
{
  "type": "agent_toolset_20260401",
  "default_config": {
    "enabled": true,
    "permission_policy": { "type": "always_ask" }
  },
  "configs": [
    { "name": "bash", "enabled": true, "permission_policy": { "type": "always_allow" } }
  ]
}

Built-in tool names: bash, edit, read, write, glob, grep, web_fetch, web_search.

permission_policy.type is always_allow (auto-approved) or always_ask (requires user.tool_confirmation).

MCP Toolset

json
{
  "type": "mcp_toolset",
  "mcp_server_name": "web-search",
  "default_config": { "enabled": true, "permission_policy": { "type": "always_allow" } },
  "configs": [
    { "name": "search", "enabled": true, "permission_policy": { "type": "always_allow" } }
  ]
}

mcp_server_name must match a server in the mcp_servers array.

Custom Tool

Executed by your client, not the agent. The agent emits agent.custom_tool_use and the session goes idle awaiting user.custom_tool_result.

json
{
  "type": "custom",
  "name": "query_database",
  "description": "Execute a read-only SQL query",
  "input_schema": {
    "type": "object",
    "properties": { "query": { "type": "string" } },
    "required": ["query"]
  }
}

MCP Servers

json
[
  { "name": "web-search", "type": "url", "url": "https://mcp.sandbase.ai/web-search/sse" }
]
FieldTypeDescription
namestringUnique name, referenced by mcp_toolset configs. 1–255 chars.
typestring"url"
urlstringEndpoint URL for the MCP server.

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.create(
    model="claude-sonnet-4",
    name="Research Assistant",
    system="You are a research assistant. Search the web to answer questions.",
    tools=[{"type": "agent_toolset_20260401"}],
    mcp_servers=[
        {"name": "web-search", "type": "url", "url": "https://mcp.sandbase.ai/web-search/sse"}
    ]
)
print(agent.id)
typescript
import Anthropic from '@anthropic-ai/sdk';

const client = new Anthropic({
  apiKey: 'sk-sb-YOUR_KEY',
  baseURL: 'https://api.sandbase.ai',
});

const agent = await client.beta.agents.create({
  model: 'claude-sonnet-4',
  name: 'Research Assistant',
  system: 'You are a research assistant.',
  tools: [{ type: 'agent_toolset_20260401' }],
});
console.log(agent.id);
bash
curl -X POST https://api.sandbase.ai/v1/agents \
  -H "Authorization: Bearer sk-sb-YOUR_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "claude-sonnet-4",
    "name": "Research Assistant",
    "system": "You are a research assistant.",
    "tools": [{"type": "agent_toolset_20260401"}]
  }'

Response

Returns an Agent object.

json
{
  "id": "agent_01HqR2k7vXbZ9mNpL3wYcT8f",
  "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. Search the web to answer questions.",
  "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"
}

Agent Object

FieldTypeDescription
idstringUnique agent identifier (agent_...)
typestringAlways "agent"
versionintegerStarts at 1, increments on each modification
namestringAgent name
descriptionstring | nullAgent description
modelobjectModel configuration (id, speed)
systemstring | nullSystem prompt
toolsarrayResolved tool configurations
mcp_serversarrayConnected MCP servers
metadataobjectUser-defined key-value pairs
archived_atstring | nullRFC 3339 timestamp when archived
created_atstringRFC 3339 timestamp
updated_atstringRFC 3339 timestamp

Roadmap

Claude's Agent object also includes skills (Anthropic/custom skills) and multiagent (coordinator topology). These are accepted for compatibility but not yet active in SandBase.

Errors

StatusTypeDescription
400invalid_requestMissing required fields or invalid format
401authentication_errorInvalid or missing API key