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

# Rate Limits & Pricing

> Plans, pricing, request quotas, and rate limits

## Pricing

|                                 | **Free**    | **Pro**                             | **Enterprise**                                         |
| ------------------------------- | ----------- | ----------------------------------- | ------------------------------------------------------ |
| **Price**                       | \$0         | \$28/month                          | Custom — [contact sales](mailto:raymond@raysurfer.com) |
| **Namespace**                   | Single user | Dedicated (per org + per workspace) | Dedicated (per org + per workspace)                    |
| **Max members**                 | 1           | 10                                  | 100                                                    |
| **Max workspaces**              | 0           | 10                                  | 50                                                     |
| **Stored embeddings**           | 500         | Unlimited                           | Unlimited                                              |
| **Self-service key management** | —           | —                                   | Yes                                                    |

All paid plans include priority support and access to the analytics dashboard.

<Tip>
  Start free, upgrade when you need a private namespace or team access. [See pricing →](https://www.raysurfer.com/pricing)
</Tip>

***

## Request Quotas

Each plan tier has a maximum number of API requests per billing period. Once exceeded, the API returns `429 Too Many Requests` until the period resets.

| Tier           | Quota           | Period  | Reset             |
| -------------- | --------------- | ------- | ----------------- |
| **Free**       | 500 requests    | Monthly | 1st of each month |
| **Pro**        | 10,000 requests | Daily   | Midnight UTC      |
| **Enterprise** | Custom          | Custom  | Custom            |

### Quota Exceeded Response

When you exceed your quota, the API returns:

```json theme={null}
{
  "error": "quota_exceeded",
  "message": "You have used 500/500 requests this month. Upgrade your plan for higher limits.",
  "tier": "free",
  "limit": 500,
  "period": "monthly",
  "usage": 500
}
```

## HTTP Rate Limits

Independent of quotas, all tiers share per-minute rate limits on API endpoints. These prevent burst abuse and ensure fair access.

| Endpoint Category | Limit      | Endpoints                                                                                                                                                                                              |
| ----------------- | ---------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| **Retrieve**      | 200/minute | `/api/retrieve/code-blocks`, `/api/retrieve/best-for-task`, `/api/retrieve/executions`, `/api/retrieve/few-shot-examples`, `/api/retrieve/task-patterns`, `/api/retrieve/code-files`                   |
| **Store**         | 30/minute  | `/api/store/code-block`, `/api/store/execution`, `/api/store/execution-result`, `/api/store/bulk-execution-result`, `/api/store/auto-review`, `/api/store/cache-usage`, `/api/store/synthetic-queries` |
| **Default**       | 100/minute | All other endpoints                                                                                                                                                                                    |

## Plan Limits

Each tier also sets limits on organization resources.

| Tier           | Max Members | Max Workspaces | Namespace                           |
| -------------- | ----------- | -------------- | ----------------------------------- |
| **Free**       | 1           | 0              | Shared                              |
| **Pro**        | 10          | 10             | Dedicated (per org + per workspace) |
| **Enterprise** | 100         | 50             | Dedicated (per org + per workspace) |

## Handling Rate Limits

Both SDKs include built-in retry logic with exponential backoff. When a `429` response is received, the SDK automatically retries up to 3 times before raising an error.

If all retries are exhausted, a `RateLimitError` is raised:

<CodeGroup>
  ```python Python theme={null}
  from raysurfer import RaySurfer
  from raysurfer.exceptions import RateLimitError

  client = RaySurfer(api_key="your_api_key")

  try:
      result = client.search(task="Fetch GitHub repos")
  except RateLimitError as e:
      print(f"Rate limited after retries: {e}")
      if e.retry_after:
          print(f"Try again in {e.retry_after}s")
  ```

  ```typescript TypeScript theme={null}
  import { RaySurfer, RateLimitError } from "raysurfer";

  const client = new RaySurfer({ apiKey: "your_api_key" });

  try {
    const result = await client.search({ task: "Fetch GitHub repos" });
  } catch (e) {
    if (e instanceof RateLimitError) {
      console.log(`Rate limited after retries: ${e.message}`);
      if (e.retryAfter) {
        console.log(`Try again in ${e.retryAfter}ms`);
      }
    }
  }
  ```
</CodeGroup>

<Note>
  Need higher limits? [Contact us](mailto:raymond@raysurfer.com) to discuss Enterprise plans with custom quotas and self-service key management.
</Note>
