Creating a Batch Inference Job
Batch API
Creating a Batch Inference Job
Run batch inference on inline inputs, a dataset, a download URL, or a published Sutro Function.
POST
Creating a Batch Inference Job
Run batch inference over a list of inputs, a dataset, or an HTTP(S) CSV/Parquet download URL.
Using a Sutro Function as
Set
When
Using a Sutro Function as model
Set model to the published Sutro Function name and send rows whose keys match that Function’s inputs.
Use the Function name only. Do not include a namespace, owner, or revision in
model.Sutro resolves the Function namespace from the authenticated API key’s user account and loads the currently published revision through that Function’s latest.json pointer.model is a Sutro Function name:
- object rows are validated and rendered using the Function’s input fields
- string rows are treated as already-rendered prompts
- HTTP(S) CSV/Parquet download URLs are read as row objects whose columns match the Function inputs
system_promptandjson_schemashould be omitted because they come from the published Function- request-level
sampling_paramsare merged on top of the Function/runtime defaults - dataset IDs such as
dataset-<uuid>are not supported
Request Body
Accepts one of the following input forms:
- Array — an array of strings, or object rows for a Sutro Function/custom model
- Dataset ID — a dataset ID such as
dataset-<uuid> - Download URL — an HTTP(S) CSV or Parquet download URL
model="gpt-oss-20b") expect string rows. Sutro Function runs expect object rows whose keys match the Function inputs, already-rendered string rows, or a CSV/Parquet download URL with matching columns.Column name to use when
inputs is a dataset ID or a download URL for standalone model inference.Dataset IDs require a column_name to be passed indicating which column to use. For pre-signed download URLs, column_name selects the column to run; if omitted, the first column is used.Omit column_name when model is a Sutro Function name. Instead, data sent via download URLs is matched against using the Function’s declared input fields and then templated into the right string format by Sutro.Standalone model ID, custom model name, or published Sutro Function name.If the value is not an available standalone model, Sutro treats it as a Function name and resolves the correct model to use based on the Function’s latest spec.
System prompt for standalone model batch inference.Omit this field when
model is a Sutro Function name.Structured output schema for standalone model batch inference.Omit this field when
model is a Sutro Function name.Sampling parameters for the batch job. See Sampling Parameters.For Sutro Function jobs, most users should omit this and use the published defaults. If provided, these values override the Function/runtime defaults for that job.
Batch priority level. Priorities
0 and 1 are supported.Dataset IDs require priority 1.If True, the API will return cost estimates instead of running full inference. See Cost
Estimates for more information
If
true, generate a random seed per input row.If
true, rows that exceed the selected model’s context window are truncated to fit. Truncation removes the minimal amount of text such that the token count of (input text + prompt text + max output tokens) is less than the model’s context window length. If false, jobs with rows that exceed the context window will be marked as FAILED.Optional job name for metadata and experiment tracking. Maximum length is 45 characters.
Optional job description for metadata and experiment tracking. Maximum length is 512 characters.
Headers
Your Sutro API key using the Key authentication scheme.Format:
Key YOUR_API_KEYExample: Authorization: Key sk_live_abc123...Response
Returns the created job ID in bothmetadata.job_id and results.
Metadata for the created job. Contains
job_id and message.Job ID for the created batch inference job. This is the same value as
metadata.job_id.Code Examples
Standalone model with array inputs
Published Sutro Function with object rows
Replacelead-qualifier and the input field names with your published Function name and schema.
Published Sutro Function with a download URL
The CSV or Parquet file must contain columns matching the Function inputs. For this example, the file containsquery and optionally region.