Skip to main content
GET
/
v1
/
tasks
/
runs
/
{run_id}
/
input
Retrieve Task Run Input
import requests

url = "https://api.parallel.ai/v1/tasks/runs/{run_id}/input"

headers = {"x-api-key": "<api-key>"}

response = requests.get(url, headers=headers)

print(response.json())
{
  "processor": "core",
  "metadata": {
    "my_key": "my_value"
  },
  "task_spec": {
    "output_schema": {
      "json_schema": {
        "type": "object",
        "properties": {
          "gdp": {
            "type": "string",
            "description": "GDP in USD for the year, formatted like '$3.1 trillion (2023)'"
          }
        },
        "required": [
          "gdp"
        ],
        "additionalProperties": false
      },
      "type": "json"
    },
    "input_schema": {
      "json_schema": {
        "type": "object",
        "properties": {
          "country": {
            "type": "string"
          },
          "year": {
            "type": "integer"
          }
        },
        "required": [
          "country",
          "year"
        ],
        "additionalProperties": false
      },
      "type": "json"
    }
  },
  "input": {
    "country": "France",
    "year": 2023
  }
}

Authorizations

x-api-key
string
header
required

Path Parameters

run_id
string
required

Response

Successful Response

Request to run a task.

processor
string
required

Processor to use for the task.

Examples:

"base"

input
required

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

Examples:

"What was the GDP of France in 2023?"

"{\"country\": \"France\", \"year\": 2023}"

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.

source_policy
object | null

Optional source policy governing preferred and disallowed domains in web search results. Source policy for web search results.

This policy governs which sources are allowed/disallowed in results.

task_spec
object | null

Task specification. If unspecified, defaults to auto output schema. Specification for a task.

Auto output schemas can be specified by setting output_schema={"type":"auto"}. Not specifying a TaskSpec is the same as setting an auto output schema.

For convenience bare strings are also accepted as input or output schemas.

I