Skip to main content
Secure your API requests with API keys.

API Keys

Atlas uses API keys to authenticate requests. You can view and manage your API keys in the Dashboard.
Key TypePrefixDescription
Testsk_test_...Use for development. No real charges.
Livesk_live_...Use in production. Real charges processed.

Making Authenticated Requests

Include your API key in the Authorization header as a Bearer token:
curl -X POST https://api.atlas.co/functions/v1/create-session \
  -H "Authorization: Bearer sk_test_your_secret_key" \
  -H "Content-Type: application/json" \
  -d '{"amount": 4990, "currency": "USD"}'
const response = await fetch('https://api.atlas.co/functions/v1/create-session', {
  method: 'POST',
  headers: {
    'Authorization': 'Bearer sk_test_your_secret_key',
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({
    amount: 4990,
    currency: 'USD'
  })
});
import requests

response = requests.post(
    'https://api.atlas.co/functions/v1/create-session',
    headers={'Authorization': 'Bearer sk_test_your_secret_key'},
    json={'amount': 4990, 'currency': 'USD'}
)
Warning: Never expose your secret key in client-side code, public repositories, or client-side JavaScript. Use environment variables and server-side code to make API calls.

Idempotency

Use idempotency keys to safely retry requests without accidentally performing the same operation twice. Include the Idempotency-Key header with a unique value (e.g., order ID or UUID).
curl -X POST https://api.atlas.co/functions/v1/create-session \
  -H "Authorization: Bearer sk_test_xxx" \
  -H "Idempotency-Key: order_12345" \
  -H "Content-Type: application/json" \
  -d '{"amount": 4990, "currency": "USD"}'
Idempotency keys expire after 24 hours.

Rate Limits

The API is rate limited to ensure fair usage:
LimitValue
Requests per minute1,000
Requests per day100,000
Concurrent requests50
Rate limit headers are included in every response:
  • X-RateLimit-Limit - Maximum requests allowed
  • X-RateLimit-Remaining - Requests remaining in current window
  • X-RateLimit-Reset - Unix timestamp when the limit resets