POST
/
v1
/
tasks
/
runs
curl --request POST \
  --url https://api.parallel.ai/v1/tasks/runs \
  --header 'Content-Type: application/json' \
  --header 'x-api-key: <api-key>' \
  --data '{
  "task_spec": {
    "output_schema": {
      "json_schema": {
        "additionalProperties": false,
        "properties": {
          "gdp": {
            "description": "GDP in USD for the year, formatted like '\''$3.1 trillion (2023)'\''",
            "type": "string"
          }
        },
        "required": [
          "gdp"
        ],
        "type": "object"
      },
      "type": "json"
    },
    "input_schema": {
      "json_schema": {
        "additionalProperties": false,
        "properties": {
          "gdp": {
            "description": "GDP in USD for the year, formatted like '\''$3.1 trillion (2023)'\''",
            "type": "string"
          }
        },
        "required": [
          "gdp"
        ],
        "type": "object"
      },
      "type": "json"
    }
  },
  "input": "France (2023)",
  "processor": "<string>",
  "metadata": {}
}'
{
  "run_id": "<string>",
  "status": "queued",
  "is_active": true,
  "warnings": [
    {
      "type": "spec_validation",
      "message": "<string>",
      "detail": {}
    }
  ],
  "processor": "<string>",
  "metadata": {},
  "created_at": "<string>",
  "modified_at": "<string>"
}

Authorizations

x-api-key
string
header
required

Body

application/json

Request to run a task.

input
required

Input to the task, either text or a JSON object.

Example:

"France (2023)"

processor
string
required

Processor to use for the task.

task_spec
object | null

Task specification.

metadata
object | null

User-provided metadata stored with the run. Keys and values must be strings with a maximum length of 16 and 512 characters respectively.

Response

200
application/json
Successful Response

Status of a task.

run_id
string
required

ID of the task run.

status
enum<string>
required

Status of the run.

Available options:
queued,
action_required,
running,
completed,
failed,
cancelling,
cancelled
Example:

"queued"

is_active
boolean
required

Whether the run is currently active; i.e. status is one of {'running', 'queued', 'cancelling'}.

processor
string
required

Processor used for the run.

created_at
string | null
required

Timestamp of the creation of the task, as an RFC 3339 string.

modified_at
string | null
required

Timestamp of the last modification to the task, as an RFC 3339 string.

warnings
object[] | null

Warnings for the run.

Human-readable message for a task.

metadata
object | null

User-provided metadata stored with the run.