Using the API directly is not recommended for most users. Instead, we recommend using the
Python SDK.
Execute privately served custom models that have been created via Sutro Functions.
Request Body
The name of the function to execute
Input data as required by the specific function. Refer to instructions from the Sutro team or your the Sutro web app for the specific input parameters required for your function.
Your Sutro API key using Key authentication scheme.Format: Key YOUR_API_KEYExample: Authorization: Key sk_abc123...
Response
response
string|array|object
required
The value of the function’s most confident response. Depending on function type, may return a string, array, or object depending on function type. Refer to the Sutro web app for the expected return type of your function.
A calibrated confidence score for the returned value of the function.
An array containing objects that represent all possible function values, along with their confidence scores.
The ID of the function run.
{
"response": "true",
"confidence": 0.8847174048423767,
"predictions": [
{
"label": "true",
"confidence": 0.8847174048423767
},
{
"label": "false",
"confidence": 0.1152825877070427
}
]
}
Code Examples
import requests
response = requests.post(
'https://serve.sutro.sh/functions/run',
headers={
'Authorization': 'Key YOUR_SUTRO_API_KEY',
'Content-Type': 'application/json'
},
json={
'name': 'is-hotdog',
'input_data': {'brand': 'Oscar Meyer', 'description': 'Classic frankfurter, 8-pack'}
}
)
result = response.json()
print(result)
This API is currently in development and subject to change.