> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.rasen.ai/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.rasen.ai/_mcp/server.

# Get the rate limits

GET https://api.rasen.ai/v1/limits

The rate limits of the caller, for each minute: the numbers of the key's workspace and of the key. Before the plan switch is on, tier is standard; in announced, pending holds the plan numbers and their start date. After that start date passes, until Rasen turns the switch on, the standard numbers still apply and pending is null. When the switch is on, tier is the plan code and pending holds a later limit version with its date, or null. Counted as a read of the workspace and the key. Needs usage.read.

Reference: https://docs.rasen.ai/api-reference/limits/get

## Authentication

- `Authorization` header (bearer token, required) — Create and manage workspace-owned keys through the existing app session routes, outside this public API. Creator and manager identities are audit actors only. Key validity follows workspace policy, expiry and explicit revocation, independently of creator membership. Do not include a workspace-selection header.

## Response

### 200

The rate limits.

- `tier` (string, required) — standard, or the plan code whose numbers apply now (flex is Pay as you go). Open response vocabulary. Preserve unknown values.
- `switch` (string, required) — The plan switch. off: the standard numbers. announced: the standard numbers, and pending holds the plan numbers until their start date; after it, until Rasen turns the switch on, pending is null. on: the plan numbers. Open response vocabulary.
- `scope` (string, required) — workspace: the numbers of one workspace and of the key in it. organisation: the numbers of the organisation of an organisation key. Open response vocabulary.
- `active` (LimitNumbers, required) — The numbers that are enforced now.
- `pending` (PendingLimits, required, nullable) — Null, or the numbers that will be enforced, with effective_at.

## Errors

### 400 Bad Request Error

Invalid input or cursor. Correct the request.

- `error` (ErrorResponseError, required) — Only code and message are required. Rasen sends details, request_id and retry on every error, but clients must parse an error that lacks them, so a typed error is never lost to a parsing failure.

### 401 Unauthorized Error

Invalid, expired or revoked API key. Creator departure or membership changes do not invalidate a workspace key.

- `error` (ErrorResponseError, required) — Only code and message are required. Rasen sends details, request_id and retry on every error, but clients must parse an error that lacks them, so a typed error is never lost to a parsing failure.

### 403 Forbidden Error

Operation not allowed by current credential or workspace access.

- `error` (ErrorResponseError, required) — Only code and message are required. Rasen sends details, request_id and retry on every error, but clients must parse an error that lacks them, so a typed error is never lost to a parsing failure.

### 404 Not Found Error

Resource absent or not visible in this workspace.

- `error` (ErrorResponseError, required) — Only code and message are required. Rasen sends details, request_id and retry on every error, but clients must parse an error that lacks them, so a typed error is never lost to a parsing failure.

### 429 Too Many Requests Error

Rate limited. Respect Retry-After and retry the same intent where permitted.

- `error` (ErrorResponseError, required) — Only code and message are required. Rasen sends details, request_id and retry on every error, but clients must parse an error that lacks them, so a typed error is never lost to a parsing failure.

### 500 Internal Server Error

Internal error. The effect may have happened. Retry the same request with the same Idempotency-Key; read the resource before creating a new intent. For an operation that takes an Idempotency-Key, a client retry with the same key is safe: the server replays the stored outcome if the first attempt took effect; if the first attempt had no effect, the retry performs the operation once. Never retry with a new key.

- `error` (ErrorResponseError, required) — Only code and message are required. Rasen sends details, request_id and retry on every error, but clients must parse an error that lacks them, so a typed error is never lost to a parsing failure.

### 503 Service Unavailable Error

Service unavailable. Respect Retry-After where present. For an operation that takes an Idempotency-Key, a client retry with the same key is safe: the server replays the stored outcome if the first attempt took effect; if the first attempt had no effect, the retry performs the operation once. Never retry with a new key.

- `error` (ErrorResponseError, required) — Only code and message are required. Rasen sends details, request_id and retry on every error, but clients must parse an error that lacks them, so a typed error is never lost to a parsing failure.

## Types

### LimitNumbers

The numbers for each rate class. Workspace scope: read, authoring, ingest and call_start, each with per_key and per_workspace. Organisation scope: read and change (the organisation operations), each with per_key and per_organisation.

- `call_starts_per_organisation` (integer, required, nullable) — Call starts for each minute for the whole organisation, when that ceiling is enforced (or coming, in pending). Null when there is no ceiling at this level.
- `read` (LimitPair, optional) — The numbers of one rate class.
- `authoring` (LimitPair, optional) — The numbers of one rate class.
- `ingest` (LimitPair, optional) — The numbers of one rate class.
- `call_start` (LimitPair, optional) — The numbers of one rate class.
- `change` (LimitPair, optional) — The numbers of one rate class.

### PendingLimits

Numbers that will be enforced, and their date.

- `call_starts_per_organisation` (integer, required, nullable) — Call starts for each minute for the whole organisation, when that ceiling is enforced (or coming, in pending). Null when there is no ceiling at this level.
- `effective_at` (datetime, required) — When these numbers are enforced: the start date of the plan switch, or of a limit version.
- `read` (LimitPair, optional) — The numbers of one rate class.
- `authoring` (LimitPair, optional) — The numbers of one rate class.
- `ingest` (LimitPair, optional) — The numbers of one rate class.
- `call_start` (LimitPair, optional) — The numbers of one rate class.
- `change` (LimitPair, optional) — The numbers of one rate class.

### ErrorResponseError

Only code and message are required. Rasen sends details, request_id and retry on every error, but clients must parse an error that lacks them, so a typed error is never lost to a parsing failure.

- `code` (string, required) — Stable code. Branch on code (and details.reason for conflict), never on message. Each code has one HTTP status; see components.x-error-catalog.
- `message` (string, required) — Safe description; no provider payload or submitted secrets.
- `details` (map from string to any, optional) — Safe code-specific details. The public fields for each code are listed in components.x-error-catalog. Details never contain a request fingerprint, a hash of a request, secret material or another tenant's data. forbidden may include required_capabilities (a list).
- `request_id` (string, optional) — Same value as the X-Request-Id header. Quote it to support.
- `retry` (string, optional) — Retry class of this code: no (fix the request or state first), yes (retry the same request and the same Idempotency-Key), retry_after (wait for Retry-After, then retry the same request). Open response vocabulary. Preserve unknown values; never assume they mean success.

### LimitPair

The numbers of one rate class.

- `per_key` (integer, required) — Requests for each minute for each key. For an organisation key in a workspace, for each pair of key and workspace.
- `per_workspace` (integer, optional) — Requests for each minute for the workspace, shared by every key. Only in the workspace scope.
- `per_organisation` (integer, optional) — Requests for each minute for the organisation, shared by every organisation key. Only in the organisation scope.

## Examples

**Response**

```json
{
  "tier": "string",
  "switch": "string",
  "scope": "string",
  "active": {
    "call_starts_per_organisation": 1,
    "read": {
      "per_key": 1,
      "per_workspace": 1,
      "per_organisation": 1
    },
    "authoring": {
      "per_key": 1,
      "per_workspace": 1,
      "per_organisation": 1
    },
    "ingest": {
      "per_key": 1,
      "per_workspace": 1,
      "per_organisation": 1
    },
    "call_start": {
      "per_key": 1,
      "per_workspace": 1,
      "per_organisation": 1
    },
    "change": {
      "per_key": 1,
      "per_workspace": 1,
      "per_organisation": 1
    }
  },
  "pending": {
    "call_starts_per_organisation": 1,
    "effective_at": "2024-01-15T09:30:00Z",
    "read": {
      "per_key": 1,
      "per_workspace": 1,
      "per_organisation": 1
    },
    "authoring": {
      "per_key": 1,
      "per_workspace": 1,
      "per_organisation": 1
    },
    "ingest": {
      "per_key": 1,
      "per_workspace": 1,
      "per_organisation": 1
    },
    "call_start": {
      "per_key": 1,
      "per_workspace": 1,
      "per_organisation": 1
    },
    "change": {
      "per_key": 1,
      "per_workspace": 1,
      "per_organisation": 1
    }
  }
}
```

**SDK Code**

```python
import requests

url = "https://api.rasen.ai/v1/limits"

headers = {"Authorization": "Bearer <api_key>"}

response = requests.get(url, headers=headers)

print(response.json())
```

```javascript
const url = 'https://api.rasen.ai/v1/limits';
const options = {method: 'GET', headers: {Authorization: 'Bearer <api_key>'}};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```ruby
require 'uri'
require 'net/http'

url = URI("https://api.rasen.ai/v1/limits")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <api_key>'

response = http.request(request)
puts response.read_body
```

```java
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.get("https://api.rasen.ai/v1/limits")
  .header("Authorization", "Bearer <api_key>")
  .asString();
```

```php
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('GET', 'https://api.rasen.ai/v1/limits', [
  'headers' => [
    'Authorization' => 'Bearer <api_key>',
  ],
]);

echo $response->getBody();
```

```csharp
using RestSharp;

var client = new RestClient("https://api.rasen.ai/v1/limits");
var request = new RestRequest(Method.GET);
request.AddHeader("Authorization", "Bearer <api_key>");
IRestResponse response = client.Execute(request);
```

```swift
import Foundation

let headers = ["Authorization": "Bearer <api_key>"]

let request = NSMutableURLRequest(url: NSURL(string: "https://api.rasen.ai/v1/limits")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "GET"
request.allHTTPHeaderFields = headers

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```