import urllib3

resp = urllib3.request(
    "POST",
    "https://app.baseten.co/models/MODEL_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 production deployment and the new model response format based on the migration guide.

Use this endpoint to call the primary version of a model (now known as the production deployment).

https://app.baseten.co/models/{model_id}/predict

Parameters

Model ID
string
required

The ID of the model you want to call.

Authorization
string
required

Your Baseten API key, formatted with prefix Api-Key (e.g. {"Authorization": "Api-Key abcd1234.abcd1234"}).

Model input
json
required

JSON-serializable model input.