Run tasks via the API
A task is a stateless, versioned AI function. Run it by POSTing to its /run endpoint. The request carries your inputs; the response carries the structured output plus token, timing, and credit metrics.
All requests use bearer authentication — see Authentication.
Request body
Send a JSON body with a single task_input object. Its keys match the {placeholder} variables in the task’s prompt.
The field is task_input, not input_params. A request without task_input fails validation.
Attach files
Tasks that accept image, PDF, or other file inputs take files in one of two ways. Whether a task accepts files, and which types, is set by its file_input_mode (none, image, pdf, image_or_pdf, or any).
Base64 in JSON
Multipart form data
Add a task_files array alongside task_input. Each entry has base64 content and a filename.
Query parameters
If neither revision_id nor revision_tag is given, Rightbrain selects an active revision by its configured traffic weights (this is how A/B tests are served). See Versioning & revisions.
Response
A successful run returns the task run object. Your model output is in response; everything else is metadata.
Response headers
Every run response includes:
x-task-run-id— the ID of this run.x-task-revision-id— the revision that served it.
List and fetch runs
List responses are paginated — see Errors & pagination. To download a file a run produced (for image, audio, PDF, or CSV output tasks), take the stored_filename from an entry in the run’s files array (or request its download_url directly).