Authentication
API Keys
Section titled “API Keys”Every request to the Acme API requires authentication. The simplest method is an API key.
Creating an API Key
Section titled “Creating an API Key”- Log in to your Acme Dashboard
- Navigate to Settings → API Keys
- Click Create New Key
- Copy the key — it will only be shown once
Using Your Key
Section titled “Using Your Key”ACME_API_KEY=sk_live_abc123...const client = new AcmeClient({ apiKey: process.env.ACME_API_KEY,});// Only for testing — don't hardcode keys in productionconst client = new AcmeClient({ apiKey: "sk_test_abc123...",});Key Types
Section titled “Key Types”| Key Prefix | Environment | Permissions |
|---|---|---|
sk_live_ | Production | Full access |
sk_test_ | Sandbox | Full access |
pk_live_ | Production | Read-only |
pk_test_ | Sandbox | Read-only |
Token-Based Auth
Section titled “Token-Based Auth”For user-scoped operations, use OAuth 2.0 tokens:
const client = new AcmeClient({ accessToken: userToken,});Rate Limits
Section titled “Rate Limits”| Plan | Requests/min | Burst |
|---|---|---|
| Free | 60 | 10 |
| Pro | 600 | 100 |
| Enterprise | 6,000 | 1,000 |
When you exceed the rate limit, the SDK automatically retries with exponential backoff. You can customize this behavior:
const client = new AcmeClient({ apiKey: process.env.ACME_API_KEY, maxRetries: 3, retryDelay: 1000, // ms});