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

# Get API Key

> Retrieve API key details

## Path Parameters

<ParamField path="organizationId" type="string" required>
  Organization ID
</ParamField>

<ParamField path="projectId" type="string" required>
  Project ID
</ParamField>

<ParamField path="id" type="string" required>
  API Key ID
</ParamField>

## Response

Returns the API Key object (without the key value).

```json theme={null}
{
  "id": "afd8012b-d81e-41c6-92cd-eed0c6cb3676",
  "projectId": "70093272-90ef-43df-807b-b66dd0a0b322",
  "name": "iOS Production App",
  "status": "active",
  "createdAt": "2024-03-20T10:00:00Z",
  "updatedAt": "2024-03-20T10:00:00Z",
  "lastUsed": "2024-03-21T15:30:00Z",
  "createdBy": "user456"
}
```

<Note>
  The key value is never returned after creation for security reasons. If you need the key value, create a new API key.
</Note>

## Error Responses

### API Key Not Found

```json theme={null}
{
  "error": {
    "code": "NOT_FOUND",
    "message": "API key not found"
  }
}
```

## Code Examples

<CodeGroup>
  ```bash cURL theme={null}
  curl -X GET "https://api.metabind.ai/app/v1/organizations/org123/projects/proj456/api-keys/key123" \
    -H "Authorization: Bearer YOUR_JWT"
  ```

  ```javascript JavaScript theme={null}
  const response = await fetch(
    'https://api.metabind.ai/app/v1/organizations/org123/projects/proj456/api-keys/key123',
    {
      headers: {
        'Authorization': 'Bearer YOUR_JWT'
      }
    }
  );

  const apiKey = await response.json();
  console.log(`API key: ${apiKey.name} (${apiKey.status})`);
  ```

  ```swift Swift theme={null}
  let url = URL(string: "https://api.metabind.ai/app/v1/organizations/org123/projects/proj456/api-keys/key123")!
  var request = URLRequest(url: url)
  request.setValue("Bearer YOUR_JWT", forHTTPHeaderField: "Authorization")

  let (data, _) = try await URLSession.shared.data(for: request)
  let apiKey = try JSONDecoder().decode(APIKey.self, from: data)
  ```

  ```kotlin Kotlin theme={null}
  val response = client.get("https://api.metabind.ai/app/v1/organizations/org123/projects/proj456/api-keys/key123") {
      header("Authorization", "Bearer YOUR_JWT")
  }

  val apiKey = response.body<APIKey>()
  println("API key: ${apiKey.name}")
  ```
</CodeGroup>
