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

# Get an API Key

> Get one API key's details

Returns a key's details and usage. The full key is never returned.

## Path parameters

<ParamField path="id" type="string" required>
  The key's ID.
</ParamField>

## Response

`200 OK`

<ResponseField name="id" type="string">The key's ID.</ResponseField>
<ResponseField name="name" type="string">The key's name.</ResponseField>
<ResponseField name="key_prefix" type="string">The 8 characters after `mpg_`.</ResponseField>
<ResponseField name="scopes" type="string[]">The key's scopes.</ResponseField>
<ResponseField name="last_used_at" type="string | null">When the key was last used, or `null` if never.</ResponseField>
<ResponseField name="usage_count" type="integer">How many requests the key has made.</ResponseField>
<ResponseField name="expires_at" type="string | null">When the key expires, or `null` if it never does.</ResponseField>
<ResponseField name="is_active" type="boolean">`false` once the key is revoked.</ResponseField>
<ResponseField name="created_at" type="string">When the key was created.</ResponseField>

<RequestExample>
  ```bash cURL theme={null}
  curl https://api.sabaothcloud.com/api/v1/api-keys/KEY_ID \
    -H "Authorization: Bearer YOUR_ACCESS_TOKEN"
  ```
</RequestExample>

<ResponseExample>
  ```json 200 theme={null}
  {
    "id": "6f1c2a7e-8a1d-4f53-9b0e-3c1d2e4f5a6b",
    "name": "CI deploy key",
    "key_prefix": "Qw8Rt2Lm",
    "scopes": ["clusters:read", "clusters:write"],
    "last_used_at": "2026-10-13T09:12:44Z",
    "usage_count": 1284,
    "expires_at": "2027-01-11T10:00:00Z",
    "is_active": true,
    "created_at": "2026-10-13T10:00:00Z"
  }
  ```

  ```json 404 theme={null}
  {
    "error": "NotFound",
    "message": "API key not found"
  }
  ```
</ResponseExample>


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