> 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.

# Read the usage of the organisation

GET https://api.rasen.ai/v1/organisations/{organisation_id}/usage/summary

Minutes, calls and metered quantities over every workspace of the organisation, for a UTC [start, end) range of at most 93 days (by default the trailing 30 days). An archived workspace counts; one that is being deleted does not. No cost, currency or invoice. Only an organisation key (ra_org_…) with organisation operations on; a workspace key gets 403 forbidden, and a key of another organisation gets 404 not_found. The workspace list of the key does not limit it: it covers every workspace of the organisation. Rasen-Workspace is ignored.

Reference: https://docs.rasen.ai/enterprise/api-reference/organisations/get-usage-summary

## Authentication

- `Authorization` header (bearer token, required) — An organisation-owned key whose secret starts ra_org_. The Owner or an Admin of an organisation that Rasen has invited makes it in the app; no API operation makes, changes, rotates or revokes a key. On a workspace operation send the workspace ID in the Rasen-Workspace header; without it the answer is 400 invalid_request with details.field Rasen-Workspace. A workspace outside the organisation or outside the key's workspace list is 404 not_found. An organisation that is not invited gets 403 organisation_api_not_enabled.

## Request

### Path parameters

- `organisation_id` (string, required) — The organisation of the key. Another organisation answers the hidden not_found.

### Query parameters

- `start` (datetime, optional) — Inclusive UTC timestamp. Range must be at most 93 days.
- `end` (datetime, optional) — Exclusive UTC timestamp. Default range is trailing 30 days.

## Response

### 200

The usage of the organisation.

- `state` (string, required) — Open response vocabulary. Preserve unknown values; never assume they mean success.
- `range` (OrganisationUsageSummaryRange, required) — The resolved UTC [start, end) range, including defaults (trailing 30 days).
- `totals` (OrganisationUsageSummaryTotals, required)
- `agents` (list of OrganisationUsageAgent, required)
- `workspaces` (list of OrganisationUsageWorkspace, required)
- `components` (list of OrganisationUsageComponent, required)

## 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

### OrganisationUsageSummaryRange

The resolved UTC [start, end) range, including defaults (trailing 30 days).

- `start` (datetime, required)
- `end` (datetime, required)

### OrganisationUsageSummaryTotals

- `minutes` (double, required, nullable)
- `calls` (integer, required)

### OrganisationUsageAgent

- `workspace_id` (string, required)
- `workspace_name` (string, required)
- `agent_id` (string, required)
- `agent_name` (string, required, nullable)
- `agent_state` (string, required) — Open response vocabulary. Preserve unknown values; never assume they mean success.
- `minutes` (double, required, nullable)
- `minute_share` (double, required, nullable)
- `calls` (integer, required)

### OrganisationUsageWorkspace

- `workspace_id` (string, required)
- `workspace_name` (string, required)
- `minutes` (double, required, nullable)
- `minute_share` (double, required, nullable)
- `calls` (integer, required)

### OrganisationUsageComponent

- `component` (string, required)
- `operation` (string, required)
- `unit` (string, required)
- `quantity` (double, required)
- `events` (integer, required)
- `calls` (integer, required)

### 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.

## Examples

**Response**

```json
{
  "state": "string",
  "range": {
    "start": "2024-01-15T09:30:00Z",
    "end": "2024-01-15T09:30:00Z"
  },
  "totals": {
    "minutes": 1.1,
    "calls": 1
  },
  "agents": [
    {
      "workspace_id": "string",
      "workspace_name": "string",
      "agent_id": "string",
      "agent_name": "string",
      "agent_state": "string",
      "minutes": 1.1,
      "minute_share": 1.1,
      "calls": 1
    }
  ],
  "workspaces": [
    {
      "workspace_id": "string",
      "workspace_name": "string",
      "minutes": 1.1,
      "minute_share": 1.1,
      "calls": 1
    }
  ],
  "components": [
    {
      "component": "string",
      "operation": "string",
      "unit": "string",
      "quantity": 1.1,
      "events": 1,
      "calls": 1
    }
  ]
}
```

**SDK Code**

```python
import requests

url = "https://api.rasen.ai/v1/organisations/organisation_id/usage/summary"

querystring = {"start":"2026-09-01T00:00:00Z","end":"2026-09-25T00:00:00Z"}

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

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

print(response.json())
```

```javascript
const url = 'https://api.rasen.ai/v1/organisations/organisation_id/usage/summary?start=2026-09-01T00%3A00%3A00Z&end=2026-09-25T00%3A00%3A00Z';
const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};

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/organisations/organisation_id/usage/summary?start=2026-09-01T00%3A00%3A00Z&end=2026-09-25T00%3A00%3A00Z")

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

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

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/organisations/organisation_id/usage/summary?start=2026-09-01T00%3A00%3A00Z&end=2026-09-25T00%3A00%3A00Z")
  .header("Authorization", "Bearer <token>")
  .asString();
```

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

$client = new \GuzzleHttp\Client();

$response = $client->request('GET', 'https://api.rasen.ai/v1/organisations/organisation_id/usage/summary?start=2026-09-01T00%3A00%3A00Z&end=2026-09-25T00%3A00%3A00Z', [
  'headers' => [
    'Authorization' => 'Bearer <token>',
  ],
]);

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

```csharp
using RestSharp;

var client = new RestClient("https://api.rasen.ai/v1/organisations/organisation_id/usage/summary?start=2026-09-01T00%3A00%3A00Z&end=2026-09-25T00%3A00%3A00Z");
var request = new RestRequest(Method.GET);
request.AddHeader("Authorization", "Bearer <token>");
IRestResponse response = client.Execute(request);
```

```swift
import Foundation

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

let request = NSMutableURLRequest(url: NSURL(string: "https://api.rasen.ai/v1/organisations/organisation_id/usage/summary?start=2026-09-01T00%3A00%3A00Z&end=2026-09-25T00%3A00%3A00Z")! 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()
```