> ## 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}
{
  "data": {
    "id": "afd8012b-d81e-41c6-92cd-eed0c6cb3676",
    "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 { data: apiKey } = await response.json();
  console.log(`API key: ${apiKey.name} (${apiKey.status})`);
  ```

  ```swift Swift theme={null}
  struct APIKeyResponse: Decodable { let data: APIKey }

  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(APIKeyResponse.self, from: data).data
  ```

  ```kotlin Kotlin theme={null}
  @Serializable data class APIKeyResponse(val data: APIKey)

  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<APIKeyResponse>().data
  println("API key: ${apiKey.name}")
  ```
</CodeGroup>


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