Skip to content

AI-Friendly API Overview ​

Session contract

session_id is the public identity for persistent Agent interaction. Direct Session creation and Service invocation create or continue that Session. Every Schedule (Deployment) trigger creates a separate public drun_* DeploymentRun and attempts to create one new Session. Runtime instances remain internal and are never returned.

A concise reference for both humans and AI agents. For plain-text versions optimized for LLM ingestion, see llms.txt.

What is SandBase? ​

SandBase is an AI agent infrastructure platform. One API key can access enabled Models and APIs across language, image, video, audio, search, and data, plus Agent workflows. Discover the current catalog instead of relying on a fixed count.

API Base URL ​

https://api.sandbase.ai/v1

Authentication ​

All requests require a Bearer token:

Authorization: Bearer sk-YOUR_KEY

Get your key at Console → API Keys.

Quick Example ​

bash
curl https://api.sandbase.ai/v1/chat/completions \
  -H "Authorization: Bearer sk-YOUR_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "openai/gpt-5.6-luna",
    "messages": [{"role": "user", "content": "Hello!"}]
  }'

Core APIs ​

MethodRouteDescription
POST/v1/chat/completionsOpenAI-compatible chat; optional capabilities depend on the selected model
POST/v1/messagesAnthropic-compatible messages API
POST/v1/runSubmit a model generation using its model-specific schema
GET/v1/run/{id}Poll async generation status and retrieve results
GET/v1/modelsList enabled logical models; defaults to the LLM type
GET/v1/models/{id_or_name}Get model details, schema, capabilities, and pricing
GET/v1/tasks/{task_id}/costGet task cost and usage

Additional API Groups ​

Beyond the core generation APIs, SandBase provides APIs for agent lifecycle management. See the AI API Guide for common workflows and the OpenAPI specification for the complete contract.

GroupKey routesPurpose
AgentsPOST /v1/agents, GET /v1/agents, POST /v1/agents/{id}Create and manage agent definitions
ServicesPOST /v1/endpoints/{id}/runInvoke a Service and create or continue a Session
SessionsPOST /v1/sessions, POST /v1/sessions/{id}/eventsCreate persistent Agent Sessions and send messages
SchedulesPOST /v1/deploymentsDefine manual or cron triggers; each creates a DeploymentRun compatibility record
SkillsGET /v1/skillsExtend agent capabilities with reusable instruction and resource bundles

Pricing Model ​

Pay per use. Pricing is model-specific and may change independently of this page:

  • Model pricing: read the selected model's current formula and units from model_card
  • Token pricing: can include input, output, cache, or reasoning components when declared by that model
  • Media and other operations: can use per-request, duration, resolution, or other model-specific units

Discover the current model ID with GET /v1/models, then inspect GET /v1/models/{id_or_name} before sending a request. Do not assume that pricing or cache discounts are shared across providers.

When an operation returns a task ID, inspect its recorded cost:

bash
curl https://api.sandbase.ai/v1/tasks/{task_id}/cost \
  -H "Authorization: Bearer sk-YOUR_KEY"

Rate Limits ​

There is no published universal numeric default. Requests are subject to an optional per-key RPM cap and the current platform-wide RPM protection. A 429 response does not include quota or Retry-After headers; use bounded exponential backoff with jitter. See the Error Guide.


Further Reading ​

  • AI API Guide — core workflows, request/response shapes, and curl examples
  • Models & Pricing — live model discovery, pricing, and capability guidance
  • Error Guide — documented response shapes, HTTP handling, and retry safety
  • OpenAPI Spec — machine-readable OpenAPI 3.1

Plain-Text Versions (for AI agents) ​

FileURLContent
llms.txt/docs/llms.txtCompact summary (~60 lines)
llms-full.txt/docs/llms-full.txtExpanded AI-oriented API guide
openapi.yaml/docs/openapi.yamlOpenAPI 3.1 machine-readable spec