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 custom model to execute
Input data as required by the specific model. Refer to instructions from the Sutro team or your the Sutro web app for the specific input parameters required for your model.
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 model’s most confidenct response. Depending on model 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 model.
A calibrated confidence score for the returned value of the model.
An array containing objects that represent all possible model 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={
'model': '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.