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

# Authentication

> How to authenticate against the OpenHive Cloud API.

The API supports two credential types.

## API keys

For programmatic access, use an API key. Pass it either as a bearer token or in an
`x-api-key` header — both are accepted:

<CodeGroup>
  ```bash Authorization header theme={null}
  curl https://api.open-hive.com/v1/me \
    -H "Authorization: Bearer $OPENHIVE_API_KEY"
  ```

  ```bash x-api-key header theme={null}
  curl https://api.open-hive.com/v1/me \
    -H "x-api-key: $OPENHIVE_API_KEY"
  ```
</CodeGroup>

A request with neither header is rejected with a message noting the missing
`x-api-key` or `Authorization` header.

## Session tokens

The desktop app authenticates with a JWT obtained at sign-in. Key-management endpoints
themselves require this session token rather than an API key — you can't use an API key
to mint more API keys.

## Managing keys

| Method   | Path                   | Description          |
| -------- | ---------------------- | -------------------- |
| `POST`   | `/v1/api-keys`         | Create a new API key |
| `GET`    | `/v1/api-keys`         | List your keys       |
| `GET`    | `/v1/api-keys/{keyId}` | Retrieve one key     |
| `DELETE` | `/v1/api-keys/{keyId}` | Revoke a key         |

<Warning>
  A newly created key is shown once, at creation. Store it somewhere safe — if you lose
  it, revoke it and create another.
</Warning>

## Workspaces

Requests are scoped to the team or workspace the credential belongs to. A key created
in one workspace cannot read another's data.
