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

# Manage API Keys

> Create API keys to manage your access to Antryk resources

## Creating API Keys

### Step 1: Navigate to API Keys

1. Go to workspace in your Antryk dashboard .
2. Click on "API Keys" section under workspace heading.
3. Click "Create New Key"

### Step 2: Configure Key

* **Name**: Give your key a descriptive name
* **Permissions**: Select appropriate permissions
* **Expiration**: Set expiration date (optional)

### Step 3: Generate Key

* Click "Generate Key"
* you will get Access key that will be used as public api key
* you will Secret key , copy it and store it as that will not be shown again.

## Using API Keys

### Authentication

<CodeGroup>
  ```bash cURL theme={null}
  # Bash/cURL - Set your API credentials
  export ANTRYK_ACCESS_KEY="your-access-key-here"
  export ANTRYK_SECRET_KEY="your-secret-key-here"

  # Use in API calls

  curl -H "x-access-key: $ANTRYK_ACCESS_KEY" \
   -H "x-secret-key: $ANTRYK_SECRET_KEY" \
   https://api.antryk.com/v1/services

  ```

  ```javascript JS theme={null}
  // JavaScript - Using fetch API
  const accessKey = "your-access-key-here";
  const secretKey = "your-secret-key-here";

  fetch("https://api.antryk.com/v1/services", {
    headers: {
      "x-access-key": accessKey,
      "x-secret-key": secretKey
    }
  })
    .then(response => response.json())
    .then(data => console.log(data))
    .catch(error => console.error("Error:", error));
  ```

  ```python Python theme={null}
  # Python - Using requests library
  import requests

  access_key = "your-access-key-here"
  secret_key = "your-secret-key-here"

  headers = {
      "x-access-key": access_key,
      "x-secret-key": secret_key
  }

  response = requests.get(
      "https://api.antryk.com/v1/services",
      headers=headers
  )

  print(response.json())
  ```
</CodeGroup>

### Best Practices

* **Rotate regularly** - Change keys periodically
* **Use environment variables** - Don't hardcode keys
* **Limit permissions** - Use least privilege principle
* **Monitor usage** - Track key usage and activity

## Key Management

### Viewing Keys

* **Active keys** - See all active API keys
* **Usage statistics** - View usage per key
* **Last used** - See when each key was last used

### Revoking Keys

* **Individual revocation** - Revoke specific keys
* **Bulk revocation** - Revoke multiple keys
* **Emergency revocation** - Revoke all keys at once

<Card title="API Docs" icon="book" href="/api-reference">
  Learn about API endpoints and usage
</Card>
