REST API documentation for ADO orchestrator.
http://localhost:8080/api
Production:
https://ado.example.com/api
Currently, ADO uses local authentication. Future versions will support:
- API Keys
- JWT tokens
- OAuth2
Get dashboard statistics.
Response:
{
"activeTasks": 5,
"completedToday": 23,
"apiCost24h": 12.45,
"avgDuration": 42.5,
"recentAlerts": [
{
"message": "Rate limit reached for claude-code",
"time": "2025-11-26T14:30:00Z"
}
]
}Get usage history for charts.
Query Parameters:
period-7d(default),30d,90d
Response:
{
"taskVolume": [
{ "date": "2025-11-20", "count": 45 },
{ "date": "2025-11-21", "count": 52 }
],
"providerUsage": [
{ "provider": "claude-code", "count": 120 },
{ "provider": "gemini-cli", "count": 85 }
],
"costTrend": [
{ "date": "2025-11-20", "subscription": 0, "api": 2.45 },
{ "date": "2025-11-21", "subscription": 0, "api": 3.12 }
]
}List all tasks.
Query Parameters:
status- Filter by status:running,completed,failed,pendingprovider- Filter by provider IDlimit- Max results (default: 50)offset- Pagination offset
Response:
[
{
"id": "task-123",
"prompt": "Implement user authentication",
"provider": "claude-code",
"status": "completed",
"startedAt": "2025-11-26T14:00:00Z",
"completedAt": "2025-11-26T14:05:30Z",
"duration": 330,
"cost": 0.05,
"accessMode": "subscription"
}
]Get task details.
Response:
{
"id": "task-123",
"prompt": "Implement user authentication",
"provider": "claude-code",
"status": "completed",
"startedAt": "2025-11-26T14:00:00Z",
"completedAt": "2025-11-26T14:05:30Z",
"duration": 330,
"cost": 0.05,
"accessMode": "subscription",
"events": [
{
"type": "task.started",
"timestamp": "2025-11-26T14:00:00Z",
"data": { "provider": "claude-code" }
},
{
"type": "task.completed",
"timestamp": "2025-11-26T14:05:30Z",
"data": { "duration": 330 }
}
]
}Create a new task.
Request:
{
"prompt": "Add unit tests for auth module",
"projectKey": "my-project",
"repositoryPath": "/path/to/repo",
"preferredProviders": ["claude-code"],
"allowApiFailover": true,
"maxApiCostUsd": 5.0
}Response:
{
"id": "task-456",
"status": "pending",
"createdAt": "2025-11-26T15:00:00Z"
}Pause a running task.
Response:
{
"id": "task-123",
"status": "paused"
}Resume a paused task.
Request:
{
"humanInput": {
"decision": "approve",
"message": "Looks good, continue"
}
}Response:
{
"id": "task-123",
"status": "running"
}Cancel a task.
Response:
{
"id": "task-123",
"status": "cancelled"
}List all providers.
Response:
[
{
"id": "claude-code",
"name": "Claude Code",
"enabled": true,
"accessModes": [
{
"mode": "subscription",
"enabled": true,
"priority": 1
},
{
"mode": "api",
"enabled": true,
"priority": 10
}
],
"rateLimits": {
"requestsPerDay": 500,
"tokensPerDay": 5000000
},
"capabilities": {
"codeGeneration": true,
"codeReview": true,
"refactoring": true,
"testing": true,
"documentation": true,
"debugging": true
},
"usage": {
"requestsToday": 127,
"tokensToday": 450000
}
}
]Get provider details.
Response:
{
"id": "claude-code",
"name": "Claude Code",
"enabled": true,
"status": "available",
"rateLimitStatus": {
"isLimited": false,
"remainingRequests": 373,
"remainingTokens": 4550000,
"resetsAt": "2025-11-27T00:00:00Z"
}
}Update provider configuration.
Request:
{
"enabled": false
}Response:
{
"id": "claude-code",
"enabled": false
}Get cost report.
Query Parameters:
period-today,week,month,yearprovider- Filter by provider IDaccessMode- Filter by access mode
Response:
{
"period": "week",
"totalCost": 45.23,
"breakdown": [
{
"provider": "claude-code",
"accessMode": "api",
"cost": 25.50,
"requestCount": 450,
"inputTokens": 1200000,
"outputTokens": 850000
},
{
"provider": "gemini-cli",
"accessMode": "api",
"cost": 19.73,
"requestCount": 320,
"inputTokens": 980000,
"outputTokens": 650000
}
]
}Get usage report.
Query Parameters:
period-today,week,month,year
Response:
{
"period": "week",
"totalTasks": 145,
"completedTasks": 132,
"failedTasks": 13,
"avgDuration": 42.5,
"providerBreakdown": [
{
"provider": "claude-code",
"taskCount": 89,
"avgDuration": 38.2,
"successRate": 0.95
}
]
}Get current configuration.
Response:
{
"version": "1.1",
"project": {
"id": "my-project"
},
"routing": {
"strategy": "subscription-first",
"apiFallback": {
"enabled": true,
"maxCostPerTask": 10.0
}
}
}Update configuration.
Request:
{
"routing": {
"apiFallback": {
"maxCostPerTask": 25.0
}
}
}Connect to receive real-time task events.
Endpoint:
ws://localhost:8080/api/tasks/:taskId/events
Events:
{
"type": "task.started",
"taskId": "task-123",
"timestamp": "2025-11-26T14:00:00Z",
"data": { "provider": "claude-code" }
}
{
"type": "task.progress",
"taskId": "task-123",
"timestamp": "2025-11-26T14:02:00Z",
"data": { "message": "Analyzing codebase..." }
}
{
"type": "task.completed",
"taskId": "task-123",
"timestamp": "2025-11-26T14:05:30Z",
"data": { "duration": 330, "cost": 0.05 }
}All errors follow this format:
{
"error": {
"code": "RATE_LIMIT_EXCEEDED",
"message": "Provider has reached rate limit",
"details": {
"provider": "claude-code",
"resetsAt": "2025-11-27T00:00:00Z"
}
}
}INVALID_REQUEST- Malformed requestNOT_FOUND- Resource not foundRATE_LIMIT_EXCEEDED- Rate limit hitPROVIDER_UNAVAILABLE- Provider not availableCOST_LIMIT_EXCEEDED- Cost limit exceededTASK_FAILED- Task execution failedINTERNAL_ERROR- Server error
API endpoints are rate limited:
- 1000 requests per minute per IP
- Rate limit headers included in responses:
X-RateLimit-Limit: 1000
X-RateLimit-Remaining: 987
X-RateLimit-Reset: 1732636800
List endpoints support pagination:
GET /api/tasks?limit=50&offset=100
Response includes pagination info:
{
"data": [...],
"pagination": {
"limit": 50,
"offset": 100,
"total": 523,
"hasMore": true
}
}