Skip to content

SandBase Agents overview

Pre-built, configurable agent harness that runs in managed infrastructure. Best for long-running tasks and asynchronous work.

SandBase offers multiple ways to build with AI, each suited to different use cases:

LLM GatewayAgents
What it isDirect model prompting access (OpenAI/Anthropic compatible)Pre-built, configurable agent harness that runs in managed infrastructure
Best forCustom agent loops and fine-grained controlLong-running tasks and asynchronous work
Learn moreLLM Gateway docsAgents docs

SandBase Agents provides the harness and infrastructure for running AI as an autonomous agent. Instead of building your own agent loop, tool execution, and runtime, you get a fully managed environment where the agent can read files, run commands, browse the web, and execute code securely.

Core concepts

SandBase Agents is built around four concepts:

ConceptDescription
AgentThe model, system prompt, tools, MCP servers, and skills. A reusable, versioned configuration.
EnvironmentConfiguration for where sessions run: cloud containers with configurable resources.
SessionA running agent instance within an environment, performing a specific task and generating outputs.
EventsMessages exchanged between your application and the agent (user turns, tool results, status updates).

How it works

1. Create an agent

Define the model, system prompt, tools, MCP servers, and skills. Create the agent once and reference it by ID across sessions.

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"}]
)

2. Create an environment

Configure where the agent runs: a cloud container with CPU, memory, and timeout settings.

python
env = client.beta.environments.create(
    name="Cloud Default",
    config={"type": "cloud", "base_template": "code_interpreter", "resources": {"cpu": 2, "memory_mb": 4096, "timeout": 600}}
)

3. Start a session

Launch a session that references your agent and environment configuration.

python
session = client.beta.sessions.create(
    agent=agent.id,
    environment_id=env.id
)

4. Send events and get responses

Send user messages as events. The agent autonomously executes tools and returns results.

python
result = client.beta.sessions.events.create(
    session_id=session.id,
    events=[{"type": "user.message", "content": "What are the latest AI research papers on reasoning?"}]
)

5. Steer or interrupt

Send additional user events to guide the agent mid-execution, or interrupt it to change direction.

python
# Interrupt a running agent
client.beta.sessions.events.create(
    session_id=session.id,
    events=[{"type": "user.interrupt"}]
)

When to use Agents

Agents is best for workloads that need:

  • Long-running execution: Tasks that run for minutes with multiple tool calls
  • Cloud infrastructure: Secure containers with pre-installed packages and network access
  • Minimal infrastructure: No need to build your own agent loop, sandbox, or tool execution layer
  • Stateful sessions: Persistent filesystems and conversation history across multiple interactions
  • Multi-model flexibility: Use any of 1400+ models (not limited to Claude)

Supported tools

Agents gives the agent access to built-in tools:

  • Bash: Run shell commands in the container
  • File operations: Read, write, edit, glob, and grep files
  • Web search and fetch: Search the web and retrieve content from URLs
  • MCP servers: Connect to 2000+ external tool providers
  • Code execution: Run Python, JavaScript, and other languages

See MCP Tools for the full catalog and configuration options.

Multi-model support

Unlike Claude Managed Agents (which only supports Claude models), SandBase Agents supports any model from any provider:

ProviderModels
AnthropicClaude Sonnet 4, Claude Haiku 3.5
OpenAIGPT-4o, o3, o3-mini
GoogleGemini 2.5 Pro, Gemini 2.5 Flash
DeepSeekDeepSeek V3, DeepSeek Reasoner
MetaLlama 4 Maverick
+ 50 moreBrowse all 1400+ models →

SDK compatibility

SandBase Agents is fully compatible with the Anthropic SDK. Just change the base_url:

python
from anthropic import Anthropic

client = Anthropic(
    api_key="sk-sb-YOUR_KEY",
    base_url="https://api.sandbase.ai"
)

# Use exactly like Claude Managed Agents
agent = client.beta.agents.create(model="claude-sonnet-4", name="My Agent")
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: 'My Agent' });

Rate limits

Agents endpoints are rate-limited per organization:

Endpoint typeLimit
Create endpoints (agents, sessions, environments)300 requests per minute
Read endpoints (retrieve, list, stream)600 requests per minute

Organization-level spend limits and rate limits also apply.

Next steps