Skip to main content
POST
/
api
/
tasks
/
{task_id}
/
runs
Run Task
curl --request POST \
  --url https://api.example.com/api/tasks/{task_id}/runs \
  --header 'Content-Type: application/json' \
  --data '
{
  "prompt": "<string>",
  "model": "<string>",
  "provider": "openai",
  "wait_for_completion": true,
  "webhook_url": "<string>",
  "response_format": "<string>",
  "json_schema": "<string>",
  "use_cached_workflow": true
}
'
{
  "task_id": 123,
  "task_run_id": 123,
  "history": [
    {
      "description": "<string>",
      "actions": [
        {
          "name": "<string>",
          "params": {},
          "is_done": true,
          "success": true,
          "extracted_content": "<string>",
          "error": "<string>",
          "include_in_memory": true
        }
      ]
    }
  ],
  "result": "<unknown>",
  "is_done": true,
  "is_successful": true,
  "status": "in_progress"
}

Path Parameters

task_id
integer
required

Body

application/json

Request model for running an existing task with optional parameter overrides

prompt
string | null

Override task prompt

Minimum string length: 3
model
string | null

Override model

provider
enum<string> | null

Override provider

Available options:
openai,
deepseek,
anthropic,
google,
groq,
mistral,
together
wait_for_completion
boolean | null

Whether to wait for the task to complete before returning the response. If false, the task will be executed in the background and the response will contain only the task ID.

webhook_url
string | null

Override webhook URL

response_format
string | null

Whether to return the result as text or JSON

json_schema

Override JSON schema for the task result

use_cached_workflow
boolean | null

Override whether to use cached workflow instead of AI

Response

Successful Response

Represents the complete response from the agent.

task_id
integer | null

The ID of the task

task_run_id
integer | null

The ID of the task run

history
HistoryItem · object[] | null

List of steps in the history

result
any | null

The final result of the agent's task

is_done
boolean | null

Whether the agent has completed its task

is_successful
boolean | null

Whether the agent was successful in completing its task

status
enum<string>
default:in_progress

The status of the agent's task

Available options:
success,
failure,
in_progress