# Authentication and credentials

Create an API key in your account, use it as a bearer token, and keep it private.

## Create an API key.

In your account, open API keys and select “Create key.” Enter a name, create the key, and copy it when it appears.

The complete key is shown only once. Store it securely. Blaschke API keys begin with `blsk_`.

## Authenticate your requests.

Use your API key on `/v1/models` and `/v1/chat/completions`. Send `Content-Type: application/json` when sending a JSON body.

### Request headers

```http
Authorization: Bearer $BLASCHKE_API_KEY
Content-Type: application/json
```

Keep the two settings separate: `BLASCHKE_BASE_URL` selects the endpoint, and `BLASCHKE_API_KEY` authenticates the request. Your account session is not an API key; never send your password or session cookie as the bearer token.

## Keep the key private.

Store the key in a private server environment or secret manager.

- Do not expose it in browser JavaScript or a `NEXT_PUBLIC_` variable.
- Keep it out of source control, logs, screenshots, and chat prompts.
- If it is exposed, revoke it in your account, create a replacement, and update your application.

## Resolve a 401 response.

Check that you sent the complete, active key for the correct Blaschke deployment.

- Use `Authorization: Bearer` followed by the complete key.
- Do not paste or print the key while debugging. Redact it from error output.
- Revoke and replace a key if you suspect it was exposed.

## Related guides

- [Quickstart](https://beta.blaschkelabs.com/docs/quickstart): Send your first authenticated request.
- [Errors and retries](https://beta.blaschkelabs.com/docs/errors): Resolve other API failures.

Source: https://beta.blaschkelabs.com/docs/authentication

Markdown: https://beta.blaschkelabs.com/docs/md/authentication.md
