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

# Create API Key

> Creates a new API key. The full key is returned only once.

Requires the `admin` scope.

<Warning>
  The `raw_key` field is returned **only in this response**. Store it securely
  \-- it cannot be retrieved again. If you lose the key, revoke it and create a
  new one.
</Warning>

<RequestExample>
  ```bash cURL theme={null}
  curl -X POST "https://api.chatgrid.ai/v1/me/api-keys" \
    -H "Authorization: Bearer cgk_live_a1b2c3d4e5f6g7h8i9j0k1l2m3n4o5p6" \
    -H "Content-Type: application/json" \
    -d '{"name": "CI/CD Pipeline", "scopes": ["read", "write"]}'
  ```
</RequestExample>

<ResponseExample>
  ```json 201 theme={null}
  {
    "object": "api_key",
    "data": {
      "raw_key": "cgk_live_a1b2c3d4e5f6g7h8i9j0k1l2m3n4o5p6q7r8s9t0",
      "id": "ee112233-4455-6677-8899-aabbccddeeff",
      "key_prefix": "cgk_live_a1b2",
      "name": "CI/CD Pipeline",
      "scopes": ["read", "write"],
      "created_at": "2026-03-15T14:00:00.000Z"
    }
  }
  ```
</ResponseExample>
