Introduction
Programmatically create, monitor, and manage AI agent tasks using the BLACKBOX Agent API.
The BLACKBOX Agent API gives you full programmatic control over AI agent tasks — from creating and monitoring runs to streaming live logs, managing sandbox files, and continuing conversations.
Base URL
https://agent.blackbox.ai/api/v1Authentication
All endpoints require a BLACKBOX API key passed as a Bearer token. See the Authentication page for full details on getting your API key and using it in requests.
Endpoints Overview
POST /api/v1/tasks — Launch an agent task with a prompt
GET /api/v1/tasks — Retrieve your task history with filters
GET /api/v1/tasks/:id — Full task details including messages
GET /api/v1/tasks/:id/status — Lightweight status poll
POST /api/v1/tasks/:id/continue — Send a follow-up prompt
PATCH /api/v1/tasks/:id — Cancel a running task
GET /api/v1/tasks/:id/logs — Fetch parsed execution events
GET /api/v1/tasks/:id/logs/stream — Live SSE log stream
GET /api/v1/agent/status — Check a run's status by runId
GET /api/v1/agent/stream — SSE stream for a specific runId
GET /api/v1/tasks/:id/files — List, read, write, delete sandbox files
GET /api/v1/git/status — Check GitHub connection status
GET /api/v1/git/config — Get connected GitHub account info
POST /api/v1/git/config — Validate and store a GitHub PAT
GET /api/v1/git/repos — List accessible GitHub repositories
GET /api/v1/git/branches — List branches for a repository
Task Status Values
| Status | Description |
|---|---|
queued |
Task is waiting to start |
running |
Agent is actively executing |
completed |
Task finished successfully |
failed |
Task encountered an error |
cancelled |
Task was cancelled by user |
interrupted |
Task was interrupted (e.g. server restart) |
Error Codes
| Status Code | Description |
|---|---|
| 400 | Bad Request — invalid parameters or body |
| 401 | Unauthorized — missing or invalid API key |
| 403 | Forbidden — insufficient plan or access denied |
| 404 | Not Found — task or resource does not exist |
| 500 | Internal Server Error |