tokenAuthMiddleware from src/auth/api-tokens.ts).
POST /api/gateway
Submit a request to the gateway.| Field | Type | Required | Description |
|---|---|---|---|
task | object | Yes | Task definition (see CreateTaskSchema) |
workflow | string | No | Named workflow type to execute |
options.synchronous | boolean | No | Wait for completion (default: false) |
options.notifyUrl | string | No | Webhook URL for completion notification |
options.timeout | number | No | Max wait time in ms (synchronous mode) |
202 (async)
200 (synchronous, options.synchronous: true)
GET /api/gateway/:requestId/status
Poll the status of a gateway request.200
Workflow Types
workflow | Description |
|---|---|
code-review | Analyze code changes, check for issues |
ticket-resolve | Work a ticket end-to-end |
test-generation | Generate tests for specified code |
refactor | Apply a refactoring pattern |
summarize | Summarize a document or conversation |
custom | Free-form task, no workflow scaffolding |
API Token Management
API tokens are scoped to the gateway and integration webhooks. Generate tokens in the settings UI or via:201
Rate Limits
Gateway requests are rate-limited per token:- Default: 60 requests / minute
- Burst: 10 requests / second
GATEWAY_RATE_LIMIT_RPM environment variable.
Gateway Context
TheGatewayContext type (src/gateway/types.ts) carries metadata through the request pipeline:
Related
- Tasks API - Direct task creation without workflow routing
- Agents API - View available agent adapters
- Chat Streaming - SSE streaming for interactive execution
- Webhooks API - Configure callback URLs for task completion