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

# Get API Key

> Returns one API key

```
GET /openapi/memorylake/admin/v1/api-keys/{id}
```

Returns one API key. Keys belonging to other teams are reported as not found.

<Note>
  **Permission required:** `service_account:read` (your own keys only) or `service_account:read` (all keys)
</Note>

### Path Parameters

<ParamField path="id" type="string" required>
  Identifier of the API key
</ParamField>

<RequestExample>
  ```bash cURL theme={null}
  curl -X GET 'https://app.memorylake.ai/openapi/memorylake/admin/v1/api-keys/9d971b8b5813eb1ecceec31354c101b4' \
    -H 'Authorization: Bearer sk_xxxxxx'
  ```
</RequestExample>

### Response

<ResponseField name="data" type="object">
  <Expandable title="API Key object">
    <ResponseField name="allowed_ips" type="array">Client IPs or CIDR ranges this key may be used from. Empty array = no restriction.</ResponseField>
    <ResponseField name="created_at" type="integer">Creation time, Unix seconds</ResponseField>
    <ResponseField name="id" type="string">Stable identifier of this API key</ResponseField>
    <ResponseField name="is_system" type="boolean">true for keys the platform created for its own use (for example the console playground)</ResponseField>
    <ResponseField name="key_prefix" type="string">First 8 characters of the key body. The full key is never returned by read endpoints.</ResponseField>
    <ResponseField name="name" type="string">Display name</ResponseField>
    <ResponseField name="status" type="string">Current state of the key. One of: `enabled`, `disabled`, `expired`.</ResponseField>
    <ResponseField name="backup_group" type="string">Fallback model-routing group. Omitted = none.</ResponseField>
    <ResponseField name="expires_at" type="integer">Expiry time, Unix seconds. Omitted when the key never expires.</ResponseField>
    <ResponseField name="group" type="string">Model-routing group the key's requests use. Omitted = the owner's own group.</ResponseField>
    <ResponseField name="key_suffix" type="string">Last 4 characters of the key, to match a key someone holds without returning it. Omitted for keys whose plaintext is not retained.</ResponseField>
    <ResponseField name="last_used_at" type="integer">Time this key was last used, Unix seconds. APPROXIMATE — updates are throttled and may lag by up to one hour. Omitted when the key has never been used.</ResponseField>

    <ResponseField name="owner" type="object">
      Member this key acts as — its requests carry this member's permissions and usage is attributed to them. For a key issued to a virtual member, that member. Omitted when the account no longer exists.

      <Expandable title="API Key Owner object">
        <ResponseField name="display_name" type="string">Display name of the member</ResponseField>
        <ResponseField name="member_type" type="string">human = joined via invitation, virtual = managed identity created by an owner/admin</ResponseField>
        <ResponseField name="principal_id" type="string">principal\_id of the member (see GET /members)</ResponseField>
      </Expandable>
    </ResponseField>
  </Expandable>
</ResponseField>

<ResponseExample>
  ```json Success (200) theme={null}
  {
    "success": true,
    "message": "Operation completed successfully",
    "data": {
      "allowed_ips": [
        "example"
      ],
      "created_at": 1760000000,
      "id": "40c8c8eba1dca6d1ba4bd63384a16d3c",
      "is_system": true,
      "key_prefix": "f6e5d4c3",
      "name": "Example name",
      "status": "enabled",
      "backup_group": "example",
      "expires_at": 1760000000,
      "group": "example",
      "key_suffix": "b2a1",
      "last_used_at": 1760000000,
      "owner": {
        "display_name": "Alice",
        "member_type": "human",
        "principal_id": "61083f9552ae2ae6bd9105e4e2763c7b"
      }
    }
  }
  ```
</ResponseExample>

### Errors

Errors answer with `success: false`, a `message` and an `error_code`. See [Error Codes](/features/memorylake/api-reference/errors) for every code.

| Status | Meaning |
| - | - |
| `401` | The API key is missing, invalid, disabled or expired |
| `403` | The key is not allowed to do this |
| `404` | The resource does not exist |
| `422` | The body or a parameter failed validation |
| `429` | Too many requests. Wait for the time in `Retry-After` |
| `500` | Server-side error |


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