Running a Function
Functions API
Running a Function
Run a deployed Sutro Function by name.
POST
Running a Function
Call a deployed Function by name and send the input fields it expects.Documentation Index
Fetch the complete documentation index at: https://docs.sutro.sh/llms.txt
Use this file to discover all available pages before exploring further.
Use the Function name only. Do not include a namespace, owner, or revision. The authenticated API key determines which customer namespace Sutro searches, and the currently published revision is resolved automatically.
Request Body
Name of the Function to execute.
Object containing the input fields for the Function.Include every required field. Extra fields are ignored unless the published Function uses them in its declared input field order.
Headers
Your Sutro API key using the Key authentication scheme.Format:
Key YOUR_API_KEYExample: Authorization: Key sk_abc123...Response
Function responses use one of two shapes.Classification-style response
Returned when the Function has one primary output field, such as a label, verdict, route, or score.Predicted value for the Function’s primary output field.
Calibrated confidence score for
response.Candidate labels and confidence scores, sorted by confidence.
Explanation text when the Function output includes
rationale or reasoning.Optional token usage details. When present, includes
input_tokens, output_tokens, and system_prompt.Structured extraction response
Returned when the Function extracts multiple fields into a structured object.Structured object matching the Function’s output fields.
Explanation text for the structured output. This can be an empty string if the Function does not emit rationale text.
Confidence score for the representative structured output.
Optional token usage details. When present, includes
input_tokens, output_tokens, and system_prompt.run_id in this response. For asynchronous execution over many rows, use the Batch API or batch_run_function().
Code Examples
Replacelead-qualifier and the input fields with your published Function name and schema.