> ## Documentation Index
> Fetch the complete documentation index at: https://docs.levanto.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Authentication

> Authenticate /decide and /decide/batch calls with a Levanto API key.

**A valid Levanto API key is always required for decision calls.** Every `POST` to `/decide` and `/decide/batch` must carry a key; requests without one are rejected with **HTTP 401**.

## Sending the key

Send the key in the Authorization header:

```text theme={null}
Authorization: Bearer lv_live_...
```

Keys look like `lv_live_...`. If you don't have one yet, create it in the dashboard under **Intelligence → API Keys**.

Only `/decide` and `/decide/batch` require a key. `GET /ready` does not — use it to check model readiness before you have a key.

## Error responses

| Status | Meaning                                     |
| ------ | ------------------------------------------- |
| `401`  | Missing or invalid API key                  |
| `402`  | Key is valid but account balance is too low |

```json theme={null}
{"detail": "API key required. Provide a valid Levanto API key."}
```

## Handling keys safely

<Warning>
  Never hardcode, log, echo, or commit your API key. Read it from an environment variable (for example `SAGE_API_KEY`) and pass it only in the request header.
</Warning>

```bash theme={null}
curl -s -H "Authorization: Bearer $SAGE_API_KEY" \
  -H 'Content-Type: application/json' \
  "https://sage.levanto.ai/decide" -d '{
  "content": "Marketing email draft promotes '\''guaranteed 40% returns'\'' and describes the product as '\''risk-free'\'' for accredited investors.",
  "question": {"id": "needs_compliance_review", "kind": "yesno", "instructions": "Does this copy require compliance review before send?"}
}'
```

See [Errors](/decision-model/errors) for the full status code and error body reference.
