By default, all deployments on Cerebrium are a REST API that are accessible through an authenticated POST request. Authentication is done using your JWT token from your API Keys section on your dashboard.

Typically, a POST requests take the form below where the final word is the name of your function you would like to call. ie: in this case, the function in our main.py we are calling is predict()

curl --location --request POST 'https://api.cortex.cerebrium.ai/v4/p-xxxxx/{app-name}/{function}' \
--header 'Authorization: Bearer <JWT_TOKEN>' \
--header 'Content-Type: application/json' \
--data '{
  "function_param": "data"
}'

Responses then take the form:

{
    "run_id": "52eda406-b81b-43f5-8deb-fcf80dfsb74b",
    "run_time_ms": 326.34
    "result": {<data>}
}

All responses, if successful, will return a 200 on success and a 500 on error. If you would like to return custom status codes based on certain functionality such as 422, 404 etc, return the json parameter status_code from your *main.py**.