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

# Get API Key

## Get API Key

Retrieve a specific API key by ID. Users can only access their own API keys.

<ParamField path="path" name="id" type="integer" required>
  API key ID
</ParamField>

<RequestExample>
  ```bash cURL theme={null}
  curl -X GET "https://api.example.com/api/v1/api_keys/1" \
    -H "X-API-Key: your-api-key-here"
  ```

  ```javascript JavaScript theme={null}
  const apiKeyId = 1;
  const response = await fetch(`https://api.example.com/api/v1/api_keys/${apiKeyId}`, {
    method: 'GET',
    headers: {
      'X-API-Key': 'your-api-key-here'
    }
  });

  const data = await response.json();
  ```

  ```python Python theme={null}
  import requests

  api_key_id = 1
  headers = {
      'X-API-Key': 'your-api-key-here'
  }

  response = requests.get(
      f'https://api.example.com/api/v1/api_keys/{api_key_id}',
      headers=headers
  )

  data = response.json()
  ```
</RequestExample>

## Response

<ResponseField name="status" type="object">
  Response status information

  <ResponseField name="code" type="integer">
    HTTP status code (200)
  </ResponseField>

  <ResponseField name="message" type="string">
    Status message
  </ResponseField>
</ResponseField>

<ResponseField name="data" type="object">
  API key object (key\_value is not included)
</ResponseField>

<ResponseExample>
  ```json Success Response theme={null}
  {
    "status": {
      "code": 200,
      "message": "Success"
    },
    "data": {
      "id": 1,
      "key_type": "private",
      "name": "Production API Key",
      "key_value": null,
      "allowed_origins": ["https://example.com"],
      "allowed_assistants": ["123"],
      "transient_assistant": false,
      "user_id": 1,
      "user_email": "user@example.com",
      "created_at": "2024-01-10T08:00:00Z",
      "updated_at": "2024-01-10T08:00:00Z"
    }
  }
  ```
</ResponseExample>

<Note>
  The `key_value` field is always null when retrieving an existing API key. It is only returned when creating a new key.
</Note>

## Error Responses

<ResponseField name="401" type="object">
  Unauthorized - Invalid or missing authentication
</ResponseField>

<ResponseField name="404" type="object">
  API key not found
</ResponseField>
