API Reference
Complete REST API reference for Agent Studio
API Reference
Agent Studio provides a RESTful API for managing tenants, agents, workflows, tools, and calls.
Base URL
https://api.agentstudio.dev/api/v1For local development:
http://localhost:8000/api/v1API Sections
| Section | Description |
|---|---|
| Authentication | JWT tokens, API keys, and auth endpoints |
| Health | Health check endpoints for monitoring |
| Agents | Agent CRUD operations |
| Workflows | Workflow management |
| Tools | Tool definitions and actions |
| Calls | Call initiation and monitoring |
| Analytics | Metrics, statistics, and error logs |
| WebSocket | Real-time event streaming |
Authentication
All API endpoints (except health checks) require authentication via one of two methods:
JWT Bearer Token
For user sessions and dashboard access:
Authorization: Bearer <access_token>API Key
For server-to-server communication:
X-API-Key: as_live_xxxxxxxxxxxxxxxxxxxxxAPI keys are prefixed:
as_live_*- Production keysas_test_*- Testing/staging keys
Error Responses
All errors follow a consistent format:
{
"error": {
"code": "validation_error",
"message": "Invalid request body",
"details": [
{
"field": "config.prompt.system",
"message": "Field is required"
}
]
}
}Error Codes
| Code | HTTP Status | Description |
|---|---|---|
authentication_error | 401 | Invalid or missing credentials |
authorization_error | 403 | Insufficient permissions |
not_found | 404 | Resource not found |
validation_error | 422 | Invalid request body |
rate_limit_exceeded | 429 | Too many requests |
internal_error | 500 | Server error |
Rate Limiting
API requests are rate limited per API key:
- Default: 100 requests/minute
- Custom limits can be set per API key
Rate limit headers are included in responses:
X-RateLimit-Limit: 100
X-RateLimit-Remaining: 95
X-RateLimit-Reset: 1705488600Pagination
List endpoints support pagination:
GET /api/v1/agents?limit=20&offset=40Response includes pagination metadata:
{
"items": [...],
"total": 100,
"limit": 20,
"offset": 40
}OpenAPI Specification
The full OpenAPI 3.0 specification is available at:
GET /openapi.jsonInteractive documentation (Swagger UI):
GET /docsReDoc documentation:
GET /redoc