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

# POST /v1/api-keys — Create API Key

> Generate an additional Bearer token for your RelayOS project. Create separate keys per environment or service so you can revoke them independently.

Use this endpoint to generate an additional API key for your project. Creating separate keys for different environments (e.g., development, staging, production) or services lets you revoke individual access without affecting others.

<Warning>
  The `key` value is returned only once and cannot be retrieved again. Copy it immediately and store it in a secure secrets manager.
</Warning>

## Request

**`POST https://api.relayos.com.br/v1/api-keys`**

<ParamField body="name" type="string" required>
  A descriptive label for the key. Use this to identify which service or environment uses the key (e.g., `production-backend`, `staging-worker`).
</ParamField>

```bash theme={null}
curl -X POST https://api.relayos.com.br/v1/api-keys \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"name": "production-backend"}'
```

## Response

A `200` response returns the new API key along with its metadata.

<ResponseField name="id" type="string">
  Unique identifier for this API key. Use this ID to revoke the key later via `DELETE /v1/api-keys/{id}`.
</ResponseField>

<ResponseField name="name" type="string">
  The descriptive label you provided.
</ResponseField>

<ResponseField name="key" type="string">
  The API key value. **This is shown only once** — store it securely before closing this response.
</ResponseField>

<ResponseField name="createdAt" type="string">
  ISO 8601 timestamp of when the key was created.
</ResponseField>

```json theme={null}
{
  "id": "key_01hwxyz222bbb",
  "name": "production-backend",
  "key": "rly_live_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
  "createdAt": "2026-05-14T12:00:00Z"
}
```
