Old model endpoints
Call model version
import urllib3
resp = urllib3.request(
"POST",
"https://app.baseten.co/model_versions/VERSION_ID/predict",
headers={"Authorization": "Api-Key YOUR_API_KEY"},
json={}, # JSON-serializable model input
)
print(resp.json())
{
"model_id":"MODEL_ID",
"model_version_id":"VERSION_ID",
"model_output": {
// Output varies by model
}
}
This is an old endpoint. Update to the endpoint for a published deployment and the new model response format based on the migration guide.
Use this endpoint to call any model version (now known as a model deployment).
https://app.baseten.co/model_versions/{version_id}/predict
Parameters
Version ID
string
requiredThe version ID of the model you want to call.
Authorization
string
requiredYour Baseten API key, formatted with prefix Api-Key
(e.g. {"Authorization": "Api-Key abcd1234.abcd1234"}
).
Model input
json
requiredJSON-serializable model input.
import urllib3
resp = urllib3.request(
"POST",
"https://app.baseten.co/model_versions/VERSION_ID/predict",
headers={"Authorization": "Api-Key YOUR_API_KEY"},
json={}, # JSON-serializable model input
)
print(resp.json())
{
"model_id":"MODEL_ID",
"model_version_id":"VERSION_ID",
"model_output": {
// Output varies by model
}
}