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

# API Key Management

> Complete guide to managing ZKScore API keys

## Overview

API keys are required to access the ZKScore API. This guide covers creating, managing, rotating, and securing your API keys.

## Creating API Keys

<CodeGroup>
  ```bash cURL theme={null}
  curl -X POST https://api-mainnet.onzks.com/api/v1/developer/keys \
    -H "Authorization: Bearer YOUR_AUTH_TOKEN" \
    -H "Content-Type: application/json" \
    -d '{
      "name": "Production API Key",
      "permissions": ["read", "write"],
      "rateLimit": 1000
    }'
  ```

  ```javascript JavaScript theme={null}
  const response = await fetch('https://api-mainnet.onzks.com/api/v1/developer/keys', {
    method: 'POST',
    headers: {
      'Authorization': `Bearer ${authToken}`,
      'Content-Type': 'application/json'
    },
    body: JSON.stringify({
      name: 'Production API Key',
      permissions: ['read', 'write'],
      rateLimit: 1000
    })
  });

  const data = await response.json();
  console.log('API Key:', data.apiKey);
  ```

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

  response = requests.post(
      'https://api-mainnet.onzks.com/api/v1/developer/keys',
      headers={
          'Authorization': f'Bearer {auth_token}',
          'Content-Type': 'application/json'
      },
      json={
          'name': 'Production API Key',
          'permissions': ['read', 'write'],
          'rateLimit': 1000
      }
  )

  data = response.json()
  print(f"API Key: {data['apiKey']}")
  ```
</CodeGroup>

## Best Practices

1. **Never Commit Keys**: Keep API keys out of version control
2. **Use Environment Variables**: Store keys in .env files
3. **Rotate Regularly**: Change keys periodically
4. **Monitor Usage**: Track API key usage
5. **Revoke Unused**: Remove unused keys

## Key Security

### Secure Storage

```javascript theme={null}
// .env file
ZKSCORE_API_KEY=zk_prod_abc123xyz789

// Usage
const apiKey = process.env.ZKSCORE_API_KEY;
```

## Related Documentation

* [Create API Key](/api-reference/developer/create-api-key)
* [List API Keys](/api-reference/developer/list-api-keys)
* [Revoke API Key](/api-reference/developer/revoke-api-key)
