Run Task
Run a task with the specified inputs and receive structured output.
This endpoint executes the task using its active revision(s) and returns the results. Key features:
1. Automatic revision selection based on traffic weights
2. Structured output matching the task's output_format (JSON, image, or audio)
3. Execution metadata (tokens, timing, credits charged)
4. Support for file uploads when required
5. Automatic fallback to backup model on primary model failures
6. Optional manual fallback model triggering
7. Reporting group tracking for analytics and billing
Required:
- Input parameters as defined in the task's user_prompt
- Image file if task has image_required=true
Optional:
- Specific revision_id or revision_tag for testing or comparison
- reporting_group name for segmented analytics
- use_fallback_model flag to manually trigger fallback
The response includes:
- Structured output matching the task's output_format
- Execution metadata (tokens used, timing, credits charged)
- Fallback model usage information if applicable
- Input data for audit purposes
- References to any processed files
Authentication
AuthorizationBearer
Bearer token authentication using JWT tokens from Ory Kratos/Hydra
Path Parameters
org_id
The unique identifier of the organization.
project_id
The unique identifier of the project.
task_id
The specific Task to reference.
Query Parameters
revision_id
Optional Task Revision ID to use for execution. If not provided, an active revision will be selected based on traffic weights.
revision_tag
Optional Task Revision Tag to use for execution. If not provided, an active revision will be selected based on traffic weights.
reporting_group
Optional reporting group name to associate with this task run
use_fallback_model
If true, immediately use the fallback model instead of the primary model. Requires the task to have a fallback model configured.
Response
Task executed successfully
task_id
The unique identifier of the Task associated with this run.
task_revision_id
The unique identifier of the Task Revision associated with this run.
response
The structured response from the Task execution.
run_data
Additional data about the Task execution, including submitted inputs and processed files.
id
The unique identifier of the Task Run.
created
The timestamp when the Task Run was created.
input_tokens
The number of tokens submit as input to the model.
output_tokens
The number of tokens generated and output by the model.
total_tokens
The total token usage for the TaskRun.
input_processor_timing
The execution time for the TaskRun in seconds.
llm_call_timing
The execution time for the TaskRun in seconds.
charged_credits
The total credits charged for the TaskRun.
is_error
llm_retries
Number of retry attempts made during LLM execution.
used_fallback_model
Whether the fallback model was used
primary_failure_reason
Reason the primary model failed
fallback_llm_model_id
Fallback model that was used
user_id
The unique identifier of the User who executed the task.
reporting_group_id
The ID of the reporting group to associate with this task run
reporting_group
The reporting group associated with this task run
