Tasks
Continue Task
Send a follow-up prompt to an existing task, creating a new agent run on the same chat thread with full conversation history.
POST
This endpoint continues an existing task by spawning a new agent run on the same chat thread (
chatId). The agent receives the full conversation history as context and picks up where the previous run left off. If the original task worked on a GitHub repository, the agent will continue from the branch it created.
Authentication
To use this API, you need a BLACKBOX API Key. Follow these steps to get your API key:- Go to app.blackbox.ai/agent-api and click Get an API Key (requires a Pro subscription)
- Once provisioning completes, you will be redirected to your Dashboard
- From the Dashboard, create an API key to use with all Agent API requests
sk-xxxxxxxxxxxxxxxxxxxxxx
GitHub Connection Required
For GitHub-related tasks: If the original task worked on a repository, the agent will automatically continue from the branch it created. Make sure your GitHub token is still stored via
POST /api/v1/git/config — see Store GitHub Token for details.Headers
API Key of the form
Bearer <api_key>.Example: Bearer sk_b41b647ffbfed27f616560Must be set to
application/json.Path Parameters
The
runId of the previous task run to continue from.Example: a1b2c3d4-e5f6-7890-abcd-ef1234567890Request Body
The follow-up instruction for the agent. The agent will receive the full prior conversation as context.Examples:
"Now add unit tests for the new module""The webhook handler is missing error handling, please fix it""Summarize what was done so far"
Override the model for this follow-up run. If you set
model, you must also set agent (see the inheritance rule below). Omit both to keep the original run’s model.Example: "blackboxai/anthropic/claude-opus-4.7" — see Models for all available IDs.Explicit agent runtime for this turn —
"claude" or "codex". Required whenever you change model (or otherwise override the runtime). Omit — together with model — to inherit the original run’s runtime.Runtime inheritance rule. Continuation is designed so a plain follow-up “just continues” on the same setup:
- Neither
modelnoragentspecified → the follow-up inherits the original run’s model and agent runtime (even an explicit codex+opus override is preserved). modeland/oragentspecified → you are overriding, soagentis required. This prevents a model swap from silently flipping the runtime. Omittingagentwhile settingmodelreturns400.
{ "prompt": "...", "model": "blackboxai/anthropic/claude-opus-4.7", "agent": "codex" }.Response Fields
Unique identifier for the new agent run. Use this to poll status or stream logs.
ID of the assistant message being generated for this follow-up.
UUID of the shared chat thread (same as the original task’s
chatId).The
runId of the task that was continued (the path parameter).How Continuation Works
- Context restored — The agent loads the full message history from the shared
chatId - GitHub context restored — If the original task had a repo, the agent continues from the branch it created (
githubCreatedBranch) - New run created — A fresh agent run is spawned with the follow-up prompt appended to the conversation
- New
runIdreturned — Use the newrunIdto track this follow-up independently
Error Codes
| Status Code | Error | Description |
|---|---|---|
| 200 | Success | Follow-up run started successfully |
| 400 | Bad Request | Missing prompt or invalid JSON |
| 401 | Unauthorized | Invalid or missing API key |
| 403 | Forbidden | Pro subscription required, task belongs to another user, or no API key configured |
| 404 | Not Found | Previous task not found |
| 500 | Internal Server Error | Failed to spawn agent |