Run a Function in Batch
API
Run a Function in Batch
Execute a published Function asynchronously over inline or remote inputs.
POST
Run a Function in Batch
Use the Batch API to execute a published Function over production data. The
Function supplies its optimized prompt, model, output schema, and runtime
defaults. You may also call an available model ID directly when you do not need
a Function.
See Authentication for the required
For remote input, use a sufficiently long-lived presigned HTTPS GET URL. Sutro performs one full-object download without resume or retry. Set
Authorization: Key ... header.
Headers
string
required
Deployment API key in the form
Key YOUR_SUTRO_API_KEY.Body
string[] | object[] | string
required
Function input objects, already-rendered strings, or an HTTPS CSV/Parquet download URL. Object keys or remote columns must match the Function inputs. Direct model calls require strings.
s3:// URIs are not accepted.string
default:"gpt-oss-20b"
The published Function name. Sutro resolves it within the API key owner’s account to the currently published revision. An available model ID may be supplied instead to run that model directly.
string | null
default:"null"
Input column for a standalone-model URL. Defaults to the first column. Omit for Functions.
string | null
default:"null"
Remote-input column to preserve in every result format. It must exist, differ from inference columns, and not use
SKYSIGHT_, inputs, outputs, confidence_score, or cumulative_logprobs.string | null
default:"null"
System prompt for a standalone model. Functions use their published prompt.
object | null
default:"null"
JSON Schema for standalone-model structured output. Functions use their published schema.
object | null
default:"null"
Generation settings. For Functions, request values override published runtime defaults.
integer
default:"0"
0 for prototyping or 1 for the one-hour production SLA.boolean
default:"false"
Create an estimate job instead of a full job. After it succeeds, read
cost_estimate from the job record. See Production Batch.boolean
default:"false"
Generate a random seed for each row.
boolean
default:"true"
Trim oversized rows to the model context window. If
false, an oversized row fails the job.string | null
default:"null"
Optional job name, up to 45 characters.
string | null
default:"null"
Optional description, up to 512 characters.
column_name explicitly for standalone models; for Functions, omit it and provide columns matching the Function inputs. Null Function values become empty strings, and extra fields are ignored.
Run a published Function
Call a model ID directly
For generation without a published Function, setmodel to an available model
ID and provide rendered string inputs. In this mode you may set
system_prompt, json_schema, and sampling_params directly.
Response
results and metadata.job_id are the same job ID. Creation is asynchronous and not idempotent: input download and quota validation can fail later, and retrying an ambiguous submission can create duplicate work. Monitor the returned ID with job status.