API documentation
Continue an Agent Task
Send a follow-up prompt to an existing task, continuing the agent’s work with new instructions or additional context.
POST
This endpoint allows you to continue an existing task by sending a follow-up prompt. The agent will pick up where it left off, applying your new instructions to the same repository and branch.Documentation Index
Fetch the complete documentation index at: https://docs.blackbox.ai/llms.txt
Use this file to discover all available pages before exploring further.
Authentication
To use this API, you need a BLACKBOX API Key. Follow these steps to get your API key:- Click on your Profile Image in the top right corner at cloud.blackbox.ai
- Click on “BLACKBOX API Token” from the dropdown menu
- Copy the existing token or click “Generate” if you don’t have one yet
bb_xxxxxxxxxxxxxxxxxxxxxx
GitHub Connection Required
For GitHub-related tasks: Make sure you have connected your GitHub account on https://cloud.blackbox.ai before continuing tasks that work with repositories. This is required for the agent to access and modify your repositories.
Headers
API Key of the form
Bearer <api_key>.Example: Bearer bb_b41b647ffbfed27f61656049d3eaeef3d903cc503345d9eb80080d98bc0Must be set to
application/json.Path Parameters
The unique identifier of the task to continue.Example:
ac2wbk3lXAufdSdIscsirgRequest Parameters
The follow-up instruction or message for the agent. This is appended to the task’s history so the agent has full context of prior work.Examples:
"Also add unit tests for the new payment module""The Stripe webhook handler is missing error handling, please fix it""Summarize what was done so far"
Override the agent for this follow-up. If omitted, the task’s original agent is used.Available agents:
claude, blackbox, codex, gemini, blackbox-grokOverride the model for this follow-up. If omitted, the task’s original model is used.Example:
blackboxai/blackbox-pro, blackboxai/anthropic/claude-sonnet-4.5Maximum execution time in seconds for this follow-up. Defaults to the original task’s
maxDuration.Whether to keep the sandbox alive after this follow-up completes. Defaults to
false.Whether to run dependency installation before executing this follow-up. Defaults to
false.Environment variables to inject into the sandbox for this follow-up, as a newline-separated
KEY=VALUE string.Example: "STRIPE_KEY=sk_test_xxx\nNODE_ENV=production"Additional system-level instructions to prepend to the agent’s context for this follow-up.
Set to
true to run this follow-up across multiple agents in parallel. Requires selectedAgents.Array of agent configurations for multi-agent follow-up mode. Required when
multiLaunch is true.Structure: Each object must contain:agent(string, required): The agent typemodel(string, required): The specific model to use
multiLaunch is trueHow Task Continuation Works
- Follow-up stored: Your
currentPromptis appended to the task’sfollowupMessagesarray - Context rebuilt: The agent receives the full history of prior prompts and outputs as context
- Sandbox resumed: A new sandbox is created (or reused) from the task’s existing branch
- Agent executes: The agent applies your new instructions on top of prior work
- Changes committed: Any new changes are committed to the same branch
- Status updated: The task status returns to
completed(orerror) when done
Polling for Follow-up Completion
After calling continue, the task’sfollowupMessages array is updated with the new follow-up entry. Poll Get Task and inspect the last element of followupMessages:
Follow-up Message Structure
status value | Meaning |
|---|---|
processing | Agent is actively working on the follow-up |
completed | Follow-up finished successfully |
error | Follow-up failed; see statusMessage for details |
Error Codes
| Status Code | Error | Description |
|---|---|---|
| 200 | Success | Follow-up started successfully |
| 400 | Bad Request | Missing currentPrompt or invalid multi-agent configuration |
| 401 | Unauthorized | Invalid or missing API key |
| 402 | Payment Required | Insufficient credits for the selected model |
| 404 | Not Found | Task not found or access denied |
| 500 | Internal Server Error | File upload or sandbox creation failed |
Related Endpoints
- Create an Agent Task — Start a new single-agent task
- Create a Multi-Agent Task — Start a new multi-agent task
- Get Task — Retrieve task details and follow-up statuses
- Stream Logs — Stream real-time execution logs
- Cancel Task — Stop a running task