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

# Rate Limits

> Rate limit tiers, response headers, and strategies for handling 429 errors gracefully.

NAWA enforces per-minute rate limits on each API key to ensure fair usage and platform stability.

## Tier table

| Tier            | Requests/min | How you get it                                        |
| --------------- | ------------ | ----------------------------------------------------- |
| **Free**        | 10           | Free keys (`nawa_test_sk_`)                           |
| **Growth**      | 120          | Live keys (`nawa_live_sk_`) with credits              |
| **Enterprise**  | 300          | Contact [sales@trynawa.com](mailto:sales@trynawa.com) |
| **Enterprise+** | 1,000        | Contact [sales@trynawa.com](mailto:sales@trynawa.com) |

<Note>
  Free keys are rate-limited to 10 requests/minute and have a hard cap of 100 lifetime requests. Live keys start at the Growth tier (120/min). Enterprise tiers are available on request -- contact [sales@trynawa.com](mailto:sales@trynawa.com).
</Note>

## Rate limit headers

Every API response includes rate limit headers:

| Header                  | Description                                       | Example                |
| ----------------------- | ------------------------------------------------- | ---------------------- |
| `X-RateLimit-Limit`     | Maximum requests allowed per minute for your tier | `120`                  |
| `X-RateLimit-Remaining` | Requests remaining in the current window          | `42`                   |
| `X-RateLimit-Reset`     | When the current window resets (RFC 3339)         | `2025-01-15T12:01:00Z` |

On `429` responses, additional headers are included:

| Header                    | Description                     | Example                               |
| ------------------------- | ------------------------------- | ------------------------------------- |
| `Retry-After`             | Seconds to wait before retrying | `8`                                   |
| `X-NAWA-RateLimit-Reason` | Which limit was hit             | `minute_limit` or `sandbox_exhausted` |

## Semantic cache and rate limits

<Tip>
  Semantic cache hits (`X-NAWA-Cache: HIT`) do **not** count toward your rate limits. If you're classifying similar comments repeatedly, caching effectively increases your throughput.
</Tip>

## Handling 429 errors

Use exponential backoff with jitter to retry rate-limited requests:

<CodeGroup>
  ```typescript TypeScript theme={null}
  async function classifyWithRetry(
    nawa: Nawa,
    params: ClassifyParams,
    maxRetries = 3
  ) {
    for (let attempt = 0; attempt <= maxRetries; attempt++) {
      const { data, error } = await nawa.classify(params)

      if (!error) return data

      if (error.type === 'rate_limit_error' && attempt < maxRetries) {
        const baseDelay = Math.pow(2, attempt) * 1000
        const jitter = Math.random() * 1000
        await new Promise(resolve => setTimeout(resolve, baseDelay + jitter))
        continue
      }

      throw error
    }
  }
  ```

  ```python Python theme={null}
  import time
  import random
  from nawa import Nawa

  def classify_with_retry(nawa: Nawa, text: str, platform: str, max_retries: int = 3):
      for attempt in range(max_retries + 1):
          result = nawa.classify(text=text, platform=platform)

          if not result.error:
              return result.data

          if result.error.type == "rate_limit_error" and attempt < max_retries:
              base_delay = (2 ** attempt)
              jitter = random.uniform(0, 1)
              time.sleep(base_delay + jitter)
              continue

          raise Exception(result.error.message)
  ```
</CodeGroup>

<Warning>
  Do not retry in a tight loop without backoff. This will extend your rate limit window and may result in longer delays.
</Warning>
