Python
from parallel import Parallel
client = Parallel()
task_run = client.task_run.create(
input="What was the GDP of France in 2023?",
processor="base",
)
print(task_run.run_id)import Parallel from "parallel-web";
const client = new Parallel();
const taskRun = await client.taskRun.create({
input: 'What was the GDP of France in 2023?',
processor: 'base',
});
console.log(taskRun.run_id);curl --request POST \
--url https://api.parallel.ai/v1/tasks/runs \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"processor": "base",
"input": "What was the GDP of France in 2023?"
}
'{
"run_id": "trun_9907962f83aa4d9d98fd7f4bf745d654",
"interaction_id": "trun_9907962f83aa4d9d98fd7f4bf745d654",
"status": "queued",
"is_active": true,
"processor": "core",
"metadata": {
"my_key": "my_value"
},
"created_at": "2025-04-23T20:21:48.037943Z",
"modified_at": "2025-04-23T20:21:48.037943Z"
}{
"type": "error",
"error": {
"ref_id": "fcb2b4f3-c75e-4186-87bc-caa1a8381331",
"message": "Unauthorized: invalid or missing credentials"
}
}{
"type": "error",
"error": {
"ref_id": "fcb2b4f3-c75e-4186-87bc-caa1a8381331",
"message": "Payment required: insufficient credit in account"
}
}{
"type": "error",
"error": {
"ref_id": "fcb2b4f3-c75e-4186-87bc-caa1a8381331",
"message": "Forbidden: invalid processor in request"
}
}{
"type": "error",
"error": {
"ref_id": "fcb2b4f3-c75e-4186-87bc-caa1a8381331",
"message": "Unprocessable content: request validation error"
}
}{
"type": "error",
"error": {
"ref_id": "fcb2b4f3-c75e-4186-87bc-caa1a8381331",
"message": "Too many requests: quota temporarily exceeded"
}
}Tasks
Create Task Run
Initiates a task run.
Returns immediately with a run object in status ‘queued’.
Beta features can be enabled by setting the ‘parallel-beta’ header.
POST
/
v1
/
tasks
/
runs
Python
from parallel import Parallel
client = Parallel()
task_run = client.task_run.create(
input="What was the GDP of France in 2023?",
processor="base",
)
print(task_run.run_id)import Parallel from "parallel-web";
const client = new Parallel();
const taskRun = await client.taskRun.create({
input: 'What was the GDP of France in 2023?',
processor: 'base',
});
console.log(taskRun.run_id);curl --request POST \
--url https://api.parallel.ai/v1/tasks/runs \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"processor": "base",
"input": "What was the GDP of France in 2023?"
}
'{
"run_id": "trun_9907962f83aa4d9d98fd7f4bf745d654",
"interaction_id": "trun_9907962f83aa4d9d98fd7f4bf745d654",
"status": "queued",
"is_active": true,
"processor": "core",
"metadata": {
"my_key": "my_value"
},
"created_at": "2025-04-23T20:21:48.037943Z",
"modified_at": "2025-04-23T20:21:48.037943Z"
}{
"type": "error",
"error": {
"ref_id": "fcb2b4f3-c75e-4186-87bc-caa1a8381331",
"message": "Unauthorized: invalid or missing credentials"
}
}{
"type": "error",
"error": {
"ref_id": "fcb2b4f3-c75e-4186-87bc-caa1a8381331",
"message": "Payment required: insufficient credit in account"
}
}{
"type": "error",
"error": {
"ref_id": "fcb2b4f3-c75e-4186-87bc-caa1a8381331",
"message": "Forbidden: invalid processor in request"
}
}{
"type": "error",
"error": {
"ref_id": "fcb2b4f3-c75e-4186-87bc-caa1a8381331",
"message": "Unprocessable content: request validation error"
}
}{
"type": "error",
"error": {
"ref_id": "fcb2b4f3-c75e-4186-87bc-caa1a8381331",
"message": "Too many requests: quota temporarily exceeded"
}
}Body
application/json
Request to run a task.
Controls tracking of task run execution progress. When set to true, progress events are recorded and can be accessed via the Task Run events endpoint. When false, no progress events are tracked. Note that progress tracking cannot be enabled after a run has been created. The flag is set to true by default for premium processors (pro and above).
Response
Successful Response
Status of a task run.