Reason Machines Consumption API
Billing-aligned usage: daily consumption and billing cycles.
Billing-aligned usage: daily consumption and billing cycles.
Every API here is available over the APIs.io API and to AI agents over MCP.
One button, every client — Claude, Cursor, VS Code and the rest.
https://apis.io/mcp
find_apisBrowse and filter every API in the catalog.get_api_artifactsOne API's artifacts, grouped by type.get_openapiThe primary OpenAPI for this API.find_similar_apisAPIs that look like this one.apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.resolveTurn a domain, URL or GitHub org into the provider it belongs to.find_cohortsEvery scored population of providers in the catalog.curl "https://apis.io/api/v1/apis/reasonmachines-com:reasonmachines-com-consumption-api"
curl "https://apis.io/api/v1/apis?limit=25"
Calls without X-API-Key need no key. Calls with it need a paid plan — get a key.
Free tier, no form to fill in. Signing in shares your email address with us — we store it to create your key and to recognise you if you sign in with another provider. By signing up you are subscribing to the APIs.io and API Evangelist newsletters — you can unsubscribe from any issue. See our Privacy Policy and Terms.
A second provider on the same verified email joins the account you already have.
openapi: 3.2.0
info:
title: Reason Consumption API
version: 3.0.0
description: 'The Reason HTTP API. Drive cloud software-engineering agents: open sessions against your repositories, stream their work, and manage the secrets, skills, and automations they run with.
Authenticate with a Reason API key sent as a bearer token. New keys use `reason_`; legacy `ara_` keys remain accepted. Every resource is scoped to an organization; resolve your `org_id` once with `GET /v3/self`.'
servers:
- url: https://api.reasonmachines.com
security:
- reasonApiKey: []
tags:
- name: Consumption
description: 'Billing-aligned usage: daily consumption and billing cycles.'
paths:
/v3/organizations/{orgId}/consumption/daily:
parameters:
- $ref: '#/components/parameters/orgId'
get:
operationId: getDailyConsumption
x-reason-mcp-description: Returns workspace spend, credit and sandbox minutes from `start_date` to `end_date` (the last 30 days by default) as `daily`, one entry per UTC day with activity, plus a window `total`. A date-only `end_date` excludes that day. With `group_by`, `items` holds per-Session or per-user totals.
tags:
- Consumption
summary: Get daily consumption
description: 'Returns usage broken down by day over a date range.
Scope: `analytics:read`'
responses:
'200':
description: Daily consumption.
content:
application/json:
schema:
type: object
properties:
daily:
type: array
items:
$ref: '#/components/schemas/ConsumptionDay'
description: One entry per UTC day with activity, oldest first. Present when `group_by` is not set.
items:
type: array
items:
type: object
properties:
session_id:
type: string
description: 'The Session, when grouped by session: the id `listSessions` and `getSession` use, with every execution Attempt of it (follow-up turns, continuations, Loop runs, hidden helper runs) added up into its one item. Archived Sessions are included. `unattributed` for usage with no Session.'
user_id:
type: string
description: The user, when grouped by user; `unattributed` for usage with no user.
label:
type: string
description: The same id, as a display label.
spend_usd:
type: number
description: Usage charged in the window, in US dollars.
sandbox_minutes:
type: integer
description: Whole sandbox minutes used in the window.
attempts:
type: integer
description: 'When grouped by session: how many execution Attempts (runs) of the Session the window''s usage came from.'
source_session_id:
description: 'When grouped by session: for a helper (subagent) Session, the Session that spawned it; null for any other Session.'
type:
- string
- 'null'
input_tokens:
type: integer
description: 'When grouped by session: model input tokens of the Session''s model calls, cache reads and writes included, counted as `getUsageSummary` counts them: a call through Reason''s gateway when it was made, and a run on a member''s own key or provider sign-in, which records only its whole total, in the window that run started in (a run that crosses `end_date` counts entirely in the window it started in).'
output_tokens:
type: integer
description: 'When grouped by session: model output tokens of the Session''s model calls, counted as `input_tokens` is.'
cached_input_tokens:
description: 'When grouped by session: the part of `input_tokens` read from the provider''s prompt cache. Null when part of the Session''s usage was recorded only as run totals (runs on a member''s own key or provider sign-in), which do not record the cache split.'
type:
- integer
- 'null'
cache_write_input_tokens:
description: 'When grouped by session: the part of `input_tokens` written to the provider''s prompt cache. Null when the cache split was not recorded, as for `cached_input_tokens`.'
type:
- integer
- 'null'
description: Whole-window totals per Session or user, highest spend first. Present instead of `daily` when `group_by` is set.
total:
type: object
properties:
spend_usd:
type: number
description: Usage charged in the window, in US dollars.
credits_usd:
type: number
description: Credit added in the window, in US dollars; absent when grouped.
sandbox_minutes:
type: integer
description: Whole sandbox minutes used in the window.
description: Totals over the whole window.
start_date:
type: string
format: date-time
description: Start of the window that was read.
end_date:
type: string
format: date-time
description: End of the window that was read.
'401':
$ref: '#/components/responses/Unauthorized'
'403':
$ref: '#/components/responses/Forbidden'
'429':
$ref: '#/components/responses/RateLimited'
parameters:
- in: query
name: start_date
schema:
type: string
format: date
description: Beginning of the consumption window, included in the totals. Omit it to start 30 days before `end_date`.
- in: query
name: end_date
schema:
type: string
format: date
description: End of the consumption window. A date is read as the start of that UTC day, so that day is not counted. Omit it to end the window now.
- in: query
name: group_by
schema:
type: string
enum:
- session
- user
description: Groups the window's totals by Session or by user, returned as `items` with the highest spend first, instead of a per-day series. Omit it for the `daily` series.
security:
- reasonApiKey:
- analytics:read
/v3/organizations/{orgId}/usage/quota:
parameters:
- $ref: '#/components/parameters/orgId'
get:
operationId: getUsageQuota
x-reason-mcp-description: 'Returns the workspace''s usage quota: AI usage (model calls) as `label`, `used_percent`, `resets_at` and `exhausted`, and Cloud usage (cloud computers) as `cloud_label`, `cloud_used_percent`, `cloud_resets_at` and `cloud_exhausted`. All but the labels are null when unknown. Requires owner or admin.'
tags:
- Consumption
summary: Get usage quota
description: 'Get how much of the workspace''s current usage quota is used, split into AI usage and Cloud usage. Requires an organization owner or admin.
Returns how much of the workspace''s current usage quota is used, as shown on the Billing page: AI usage (model calls) and Cloud usage (cloud computers) each have their own share. Requires an organization owner or admin.
Scope: `analytics:read`'
responses:
'200':
description: Usage quota.
content:
application/json:
schema:
$ref: '#/components/schemas/UsageQuota'
example:
label: Monthly quota
used_percent: 42
resets_at: '2026-11-01T00:00:00.000Z'
exhausted: false
cloud_label: Monthly quota
cloud_used_percent: 9
cloud_resets_at: '2026-11-01T00:00:00.000Z'
cloud_exhausted: false
'401':
$ref: '#/components/responses/Unauthorized'
'403':
$ref: '#/components/responses/Forbidden'
'429':
$ref: '#/components/responses/RateLimited'
security:
- reasonApiKey:
- analytics:read
/v3/organizations/{orgId}/usage/summary:
parameters:
- $ref: '#/components/parameters/orgId'
get:
operationId: getUsageSummary
x-reason-mcp-description: Returns workspace usage from `start_date` to `end_date` (the last 30 days by default) as `models` per model, `agents` per agent role (`lead` or `helper`) and model, `machines` per size, and `totals`, with tokens and RCU. `user_id` counts one member.
tags:
- Consumption
summary: Get usage summary
description: 'Get a usage summary for a window: model usage per model and per agent, and cloud machine usage per size, with tokens and the RCU charged.
Returns a window''s model usage per model and per agent (a Session''s lead agent, or the helper agents it spawned), and cloud machine usage per size, with tokens and the RCU charged. These are the totals the Usage settings page shows. Every member may read it. Returns 400 `invalid_user_id` when `user_id` is not a UUID.
Scope: `analytics:read`'
responses:
'200':
description: Usage summary.
content:
application/json:
schema:
$ref: '#/components/schemas/UsageSummary'
'401':
$ref: '#/components/responses/Unauthorized'
'403':
$ref: '#/components/responses/Forbidden'
'429':
$ref: '#/components/responses/RateLimited'
parameters:
- in: query
name: start_date
schema:
type: string
format: date-time
description: Beginning of the window. Omit it to start 30 days before `end_date`. A window longer than 92 days is cut to its latest 92 days.
- in: query
name: end_date
schema:
type: string
format: date-time
description: End of the window, excluded. Omit it, or pass a later time, to end the window now.
- in: query
name: user_id
schema:
type: string
format: uuid
description: Counts only this member's usage. Omit it for the whole workspace.
security:
- reasonApiKey:
- analytics:read
components:
schemas:
UsageQuota:
type: object
properties:
label:
type: string
enum:
- Monthly quota
- Purchased usage
- Daily quota
- Available usage
description: Which quota the workspace is measured against.
used_percent:
description: Share of that quota's AI usage (model calls Reason pays for) already used, rounded. Purchased usage is measured against everything issued in its current run. Null when the quota has no known total, or the workspace is not metered.
type:
- integer
- 'null'
minimum: 0
maximum: 100
resets_at:
format: date-time
description: 'When the quota renews: a monthly quota''s renewal, or the end of a daily quota''s 24-hour window. Null when the quota does not renew or its renewal date is not known.'
type:
- string
- 'null'
exhausted:
description: True when the workspace has no AI usage left to start work with. Null when that cannot be determined without starting work.
type:
- boolean
- 'null'
cloud_label:
type: string
description: 'Which quota Cloud usage is measured against, in the same words as `label`. It can differ from `label`: one kind of usage may be on the plan''s allowance while the other is on purchased usage.'
cloud_used_percent:
description: Share of the quota `cloud_label` names that cloud computers have used, rounded. Equal to `used_percent` where the workspace's usage is one pool for both, such as purchased usage or a trial. Null when the quota has no known total, or the workspace is not metered.
type:
- integer
- 'null'
minimum: 0
maximum: 100
cloud_resets_at:
format: date-time
description: When the quota `cloud_label` names renews. Null when it does not renew or its renewal date is not known.
type:
- string
- 'null'
cloud_exhausted:
description: True when the workspace has no Cloud usage left to run a cloud computer with; work can still run on a connected computer. Null when that cannot be determined, or the workspace's plan has no cloud computers.
type:
- boolean
- 'null'
required:
- label
- used_percent
- resets_at
- exhausted
- cloud_label
- cloud_used_percent
- cloud_resets_at
- cloud_exhausted
Error:
type: object
properties:
error:
oneOf:
- type: string
- type: object
required:
- type
- message
properties:
type:
type: string
message:
type: string
request_id:
type:
- string
- 'null'
message:
type: string
required_scope:
type: string
description: The capability required when the request was denied for a missing scope.
UsageSummary:
type: object
properties:
models:
type: array
items:
$ref: '#/components/schemas/UsageModelSummary'
description: Usage per model, billing and provider, most tokens first.
agents:
type: array
items:
$ref: '#/components/schemas/UsageAgentSummary'
description: 'The same usage split by agent role: per role, model, billing and provider. Leads first, then helpers, each most tokens first.'
machines:
type: array
items:
$ref: '#/components/schemas/UsageMachineSummary'
description: Cloud machine usage per rate and provider, longest running first.
totals:
type: object
properties:
total_tokens:
type: number
description: Input plus output tokens across every model.
runtime_seconds:
type: number
description: Cloud machine running time, in seconds.
rcu:
type: number
description: RCU charged for models and machines.
required:
- total_tokens
- runtime_seconds
- rcu
description: Totals over the window.
start_date:
type: string
format: date-time
description: Start of the window that was read.
end_date:
type: string
format: date-time
description: End of the window that was read.
required:
- models
- agents
- machines
- totals
- start_date
- end_date
UsageAgentSummary:
type: object
properties:
agent_role:
type: string
enum:
- lead
- helper
description: '`lead` for a Session''s own agent; `helper` for a subagent another Session''s agent spawned, which runs its own model.'
model:
type: string
description: The model id, without the provider prefix of an own-key model; `unknown` when none was recorded.
billing:
type: string
enum:
- reason
- own_key
- run_total
description: 'Who paid: `reason` for calls through Reason''s gateway (charged in RCU), `own_key` for a member''s own provider key or sign-in, `run_total` for runs recorded only as totals.'
provider:
description: The provider account that served an own-key model, such as `openai` (an API key) or `openai-codex` (a ChatGPT sign-in). Null otherwise.
type:
- string
- 'null'
unit:
type: string
enum:
- requests
- runs
description: 'What `requests` counts: gateway requests (one model call each), or runs (many model calls each).'
requests:
type: number
description: Gateway requests or runs, as `unit` says.
input_tokens:
type: number
description: Input tokens. A run total's input includes its cache reads and writes.
output_tokens:
type: number
description: Output tokens.
cached_input_tokens:
description: Input tokens read from the provider's cache. Null when only run totals were recorded.
type:
- number
- 'null'
cache_write_input_tokens:
description: Input tokens written to the provider's cache. Null when only run totals were recorded.
type:
- number
- 'null'
reasoning_tokens:
description: Reasoning tokens, counted within output. Null when only run totals were recorded.
type:
- number
- 'null'
total_tokens:
type: number
description: Input plus output tokens.
rcu:
description: RCU charged. Null for usage Reason did not charge for (own key or run totals).
type:
- number
- 'null'
runs:
type: number
description: Distinct runs (Session turns) counted. For helpers, about how many were spawned.
required:
- agent_role
- model
- billing
- provider
- unit
- requests
- input_tokens
- output_tokens
- cached_input_tokens
- cache_write_input_tokens
- reasoning_tokens
- total_tokens
- rcu
- runs
ConsumptionDay:
type: object
properties:
date:
type: string
format: date
description: UTC calendar day.
spend_usd:
type: number
description: Usage charged that day, in US dollars.
credits_usd:
type: number
description: Credit added that day (purchases, grants, reloads, refunds), in US dollars.
sandbox_minutes:
type: integer
description: Whole sandbox minutes used that day.
UsageModelSummary:
type: object
properties:
model:
type: string
description: The model id, without the provider prefix of an own-key model; `unknown` when none was recorded.
billing:
type: string
enum:
- reason
- own_key
- run_total
description: 'Who paid: `reason` for calls through Reason''s gateway (charged in RCU), `own_key` for a member''s own provider key or sign-in, `run_total` for runs recorded only as totals.'
provider:
description: The provider account that served an own-key model, such as `openai` (an API key) or `openai-codex` (a ChatGPT sign-in). Null otherwise.
type:
- string
- 'null'
unit:
type: string
enum:
- requests
- runs
description: 'What `requests` counts: gateway requests (one model call each), or runs (many model calls each).'
requests:
type: number
description: Gateway requests or runs, as `unit` says.
input_tokens:
type: number
description: Input tokens. A run total's input includes its cache reads and writes.
output_tokens:
type: number
description: Output tokens.
cached_input_tokens:
description: Input tokens read from the provider's cache. Null when only run totals were recorded.
type:
- number
- 'null'
cache_write_input_tokens:
description: Input tokens written to the provider's cache. Null when only run totals were recorded.
type:
- number
- 'null'
reasoning_tokens:
description: Reasoning tokens, counted within output. Null when only run totals were recorded.
type:
- number
- 'null'
total_tokens:
type: number
description: Input plus output tokens.
rcu:
description: RCU charged. Null for usage Reason did not charge for (own key or run totals).
type:
- number
- 'null'
required:
- model
- billing
- provider
- unit
- requests
- input_tokens
- output_tokens
- cached_input_tokens
- cache_write_input_tokens
- reasoning_tokens
- total_tokens
- rcu
UsageMachineSummary:
type: object
properties:
rate_id:
description: The machine's RCU rate id, naming its OS and size.
type:
- string
- 'null'
provider:
type: string
description: The compute provider that ran it.
os:
description: Operating system of the rate.
type:
- string
- 'null'
size:
description: Size of the rate.
type:
- string
- 'null'
memory_gb:
description: Memory of the rate, in GB.
type:
- number
- 'null'
machines:
type: number
description: Cloud machines started in the window.
runtime_seconds:
type: number
description: Their running time, in seconds.
rcu:
description: RCU charged for them.
type:
- number
- 'null'
required:
- rate_id
- provider
- os
- size
- memory_gb
- machines
- runtime_seconds
- rcu
parameters:
orgId:
name: orgId
in: path
required: true
description: Organization id or slug. Resolve it with `GET /v3/self`.
schema:
type: string
responses:
Unauthorized:
description: Missing, invalid, or expired key.
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
example:
error: missing_bearer
message: Authorization required
Forbidden:
description: The key lacks the required scope or role.
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
example:
error: missing_scope
required_scope: sessions:read
RateLimited:
description: Too many requests. Retry after the number of seconds in the `Retry-After` response header.
headers:
Retry-After:
description: Seconds to wait before retrying.
schema:
type: integer
minimum: 1
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
example:
error:
type: rate_limited
message: This API key exceeded its request-rate limit
securitySchemes:
loopWebhookKey:
type: http
scheme: bearer
description: A Loop's webhook key, returned once by the createReasonLoop or updateReasonLoop call that adds the webhook. It only delivers events to that Loop's webhook; every other operation rejects it.
loopWebhookSignature:
type: apiKey
in: header
name: X-Signature-256
description: 'An HMAC-SHA256 of the exact request body keyed with the Loop''s webhook key or its stored signing secret: hex in `X-Signature-256` (optionally `sha256=`-prefixed), or the sender''s own header (`X-Hub-Signature-256`, `Stripe-Signature`, `Webhook-Signature`, `Svix-Signature`, `Linear-Signature`, `Sentry-Hook-Signature`, `X-Shopify-Hmac-Sha256`).'
reasonMachineToken:
type: http
scheme: bearer
bearerFormat: rmt_<hex>
description: A Machine token from createMachineToken. It can only create enrollment tickets for its own Machine; every other operation rejects it.
reasonUserOAuth:
type: http
scheme: bearer
description: A workspace-bound human user OAuth grant with org:write scope. The user must be an organization owner/admin. API keys and browser sessions are not accepted.
reasonApiKey:
type: http
scheme: bearer
bearerFormat: 'reason_<hex> (legacy: ara_<hex>)'
description: 'Your Reason API key from Settings › API keys. New keys use `reason_`; legacy `ara_` keys remain accepted. Keys are capability-scoped: run, mcp:read, mcp:write, secrets:read, secrets:write, sessions:read, sessions:debug, devices:read, devices:write, devices:use, computers:read, computers:write, ssh:write, knowledge:read, memory:read, memory:write, skills:read, skills:write, pages:read, pages:write, repos:read, repos:write, reviews:read, reviews:write, deployment:read, analytics:read, org:read, org:write, attachments:read, attachments:write, guardrails:read, guardrails:write, network:read, network:write, automations:read, automations:write, agent_auth:read. devices:write, devices:use, computers:read, computers:write, ssh:write, network:read and network:write are opt-in, excluded from default keys. computers:read lists visible cloud and connected computers without waking them or granting execution access. devices:read discovers local Device targets; devices:use separately consents to local execution, so a discover-and-run local workflow needs both. devices:write manages enrollment and device grants; computers:write creates or deletes cloud computers; ssh:write manages retained SSH access. network:read reads the saved workspace network policy; network:write replaces custom allowed hosts and requires a current organization owner/admin. Legacy project PATCH requests containing network_allowed_hosts also require network:write plus their existing run scope and project management permission; saved project hosts do not affect current session egress. Only owners/admins can mint or manage keys with network:write; keys cannot grant themselves more authority. See /docs/network-policies for replacement semantics and runtime applicability. mcp:write manages MCP server configuration only; it does not authorize remote MCP-tool execution. sessions:read reads sessions, including the assistant, reasoning and tool activity in their events. sessions:debug is privileged: only for organization owners/admins, it expands session events to the full diagnostic projection (diagnostic event kinds, status text and raw event metadata).'