Skip to main content
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:
  1. Go to app.blackbox.ai/agent-api and click Get an API Key (requires a Pro subscription)
  2. Once provisioning completes, you will be redirected to your Dashboard
  3. From the Dashboard, create an API key to use with all Agent API requests
Your API key will be in the format: 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

string
required
API Key of the form Bearer <api_key>.Example: Bearer sk_b41b647ffbfed27f616560
string
required
Must be set to application/json.

Path Parameters

string
required
The runId of the previous task run to continue from.Example: a1b2c3d4-e5f6-7890-abcd-ef1234567890

Request Body

string
required
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"
string
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.
string
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 model nor agent specified → the follow-up inherits the original run’s model and agent runtime (even an explicit codex+opus override is preserved).
  • model and/or agent specified → you are overriding, so agent is required. This prevents a model swap from silently flipping the runtime. Omitting agent while setting model returns 400.
Example — continue on Codex with an Opus model: { "prompt": "...", "model": "blackboxai/anthropic/claude-opus-4.7", "agent": "codex" }.

Response Fields

string
Unique identifier for the new agent run. Use this to poll status or stream logs.
string
ID of the assistant message being generated for this follow-up.
string
UUID of the shared chat thread (same as the original task’s chatId).
string
The runId of the task that was continued (the path parameter).

How Continuation Works

  1. Context restored — The agent loads the full message history from the shared chatId
  2. GitHub context restored — If the original task had a repo, the agent continues from the branch it created (githubCreatedBranch)
  3. New run created — A fresh agent run is spawned with the follow-up prompt appended to the conversation
  4. New runId returned — Use the new runId to track this follow-up independently

Error Codes