API Keys
API keys authenticate your requests to the Autoken API. Learn how to create, manage, and use API keys securely.
Creating an API Key
- Navigate to Settings → API Keys in your dashboard
- Click "Create New Key"
- Give your key a descriptive name (e.g., "Production Server", "Development")
- Copy your API key immediately - it will only be shown once
Important
API keys are only shown once when created. Store your key securely - if you lose it, you'll need to create a new one.
Using Your API Key
API keys can be provided in two ways:
1. Environment Variable (Recommended)
Set the AUTOKEN_API_KEY environment variable:
export AUTOKEN_API_KEY="sk_your_api_key_here"Client libraries automatically use this environment variable.
2. Direct Initialization
Pass the API key when creating a client:
Python:
from autoken import Autoken
client = Autoken(api_key="sk_your_api_key")TypeScript:
import { Autoken } from 'autoken';
const client = new Autoken({
apiKey: 'sk_your_api_key'
});3. HTTP Authorization Header
For direct API calls, include the key in the Authorization header:
curl -X POST https://autoken.devrupt.io/api/v1/execute \
-H "Authorization: Bearer sk_your_api_key" \
-H "Content-Type: application/json" \
-d '{"task": "translate-text", "input": {"text": "Hello", "language": "es"}}'Security Best Practices
- •Never commit API keys to version control. Use environment variables or secret managers.
- •Use separate keys for development, staging, and production environments.
- •Rotate keys regularly and immediately if you suspect a key has been compromised.
- •Limit key scope - create keys with minimal required permissions when possible.
- •Monitor usage - check your dashboard for unusual activity patterns.
Managing API Keys
From your dashboard, you can:
- •View all your API keys and their creation dates
- •See the last time each key was used
- •Delete keys that are no longer needed