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

# Authentication

> Every request carries a workspace API key as a bearer token.

## Create a key

API keys belong to a workspace. Create one in the app under
[Settings → API Keys](https://app.loice.ai/settings/account?tab=api). The key is shown once, when
it is created: copy it into your secret store straight away.

A key looks like `loice_sk_` followed by 48 hexadecimal characters. Treat it like a password:
anyone who holds it can spend your workspace's points.

## Send it on every request

Pass the key in the `Authorization` header on every request (the API description,
`GET /api/v1/openapi.json`, is the only exception):

```bash theme={null}
curl https://app.loice.ai/api/v1/points \
  -H "Authorization: Bearer loice_sk_…"
```

A request with a missing, invalid or expired key is refused with `401` and the code
`unauthenticated`:

```json theme={null}
{
  "error": {
    "code": "unauthenticated",
    "message": "Missing API key. Pass it as: Authorization: Bearer <key>"
  }
}
```

## One key, one workspace

A key acts for the workspace that created it: it spends that workspace's points, sees that
workspace's runs and is limited by that workspace's request budgets. There is nothing else to
select in a request.

## Keys in this site's playground

The **Try it** panel on the reference pages sends requests from your browser straight to
`https://app.loice.ai`. They do not pass through a proxy. Paste a key only on a device you
trust. Billable operations run for real and are billed as usual.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.