> ## Documentation Index
> Fetch the complete documentation index at: https://cerebrium-fm-gtm-docs-skill-michael-examples-ask.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

> ## Agent Instructions
> Cerebrium's documentation MCP server is available at https://cerebrium.ai/docs/mcp for searching and querying these docs directly. Install the Cerebrium agent skill with `npx skills add https://cerebrium.ai/docs`. Append .md to any docs page URL to fetch that page as plain Markdown. API keys and authentication tokens are created in the Cerebrium dashboard at https://dashboard.cerebrium.ai.

# REST API

> Make authenticated HTTP requests to your Cerebrium endpoints

All functions on Cerebrium are accessible via POST requests, unless marked private by prefixing the function name with an underscore (e.g. `_private_function()`). Authenticate using the JWT token from the **API Keys** section of the dashboard. Endpoints require this token only when `cerebrium.toml` sets [`disable_auth = false`](/toml-reference/toml-reference) — authentication is disabled by default.

## Request format

The POST request follows the structure below, where `{function}` is the name of the function to invoke. In this example, `predict()` from `main.py` is called.

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

<Note>
  Regioned hostnames such as `https://api.aws.us-east-1.cerebrium.ai` continue
  to work. Requests to these hostnames are proxied to the global router, which
  can add latency. Use `https://api.cerebrium.ai` for the lowest-latency path.
</Note>

## Response format

Responses follow this format:

```json theme={null}
{
  "run_id": "52eda406-b81b-43f5-8deb-fcf80dfsb74b",
  "run_time_ms": 326.34,
  "result": { "some": "data" }
}
```

## Status codes

* `200` → the function completed successfully
* `401` / `403` → authentication or authorization failed
* `404` → the app or function path could not be found
* `5xx` → either your app raised an exception or the platform could not complete the request

To return a custom status code such as `422` or `404`, include a `status_code` field in the JSON response from `main.py`.

<Note>
  When debugging a failed request, check the HTTP status code and the app logs
  in the Cerebrium dashboard. Inspecting the request payload, logs, and `run_id`
  together speeds up diagnosis.
</Note>
