Reason Machines Metrics API
Aggregate analytics over sessions, change requests, and usage.
Aggregate analytics over sessions, change requests, and usage.
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-metrics-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 Metrics 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: Metrics
description: Aggregate analytics over sessions, change requests, and usage.
paths:
/v3/organizations/{orgId}/metrics/usage:
parameters:
- $ref: '#/components/parameters/orgId'
get:
operationId: getUsageMetrics
x-reason-mcp-description: Returns the workspace's model usage for the last 30 days as daily `points`, each with `input_tokens`, `output_tokens` and `sandbox_minutes`, plus the `start_date` and `end_date` of the window. Reading it changes nothing.
tags:
- Metrics
summary: Get usage metrics
description: 'Returns a usage time series, such as sandbox minutes and tokens per day.
Scope: `analytics:read`'
responses:
'200':
description: Usage time series.
content:
application/json:
schema:
type: object
properties:
bucket:
type: string
description: 'Width of each point: `hour`, `day`, `week` or `month`; `day` unless another bucket was requested.'
points:
type: array
items:
$ref: '#/components/schemas/UsageTimeseriesPoint'
description: One point per bucket in the window, oldest first.
start_date:
type: string
format: date-time
description: 'Start of the window that was read: 30 days before `end_date` by default.'
end_date:
type: string
format: date-time
description: 'End of the window that was read: the time of the request by default.'
required:
- bucket
- points
- start_date
- end_date
'401':
$ref: '#/components/responses/Unauthorized'
'403':
$ref: '#/components/responses/Forbidden'
'429':
$ref: '#/components/responses/RateLimited'
security:
- reasonApiKey:
- analytics:read
/v3/organizations/{orgId}/queue:
parameters:
- $ref: '#/components/parameters/orgId'
get:
operationId: getQueueStatus
x-reason-mcp-description: 'Returns the workspace''s session concurrency: `workspace` and `per_repo` running and queued counts, plus `running_runs` and `queued_runs` (`run_id`, `repo`, `run_kind`; queued ones with `position`). It shows why a new session has not started; `repo` is empty for work with no repository.'
tags:
- Metrics
summary: Get queue status
description: 'Returns the Sessions that are running or waiting to start: workspace and per-repository counts plus the running and queued Sessions. Internal housekeeping work (for example title generation) is never counted or listed. `repo` is an empty string for work with no repository, such as a Scratch Session.
Scope: `analytics:read`'
responses:
'200':
description: Queue status.
content:
application/json:
schema:
type: object
properties:
workspace:
type: object
description: Workspace-wide totals.
properties:
running:
type: integer
description: Sessions running now.
queued:
type: integer
description: Sessions waiting to start.
per_repo:
type: array
description: Counts per repository, busiest first.
items:
type: object
properties:
repo:
type: string
description: Repository full name, or an empty string for work with no repository (a Scratch Session).
running:
type: integer
description: Sessions running now for this repository.
queued:
type: integer
description: Sessions waiting to start for this repository.
max_concurrent:
type: integer
deprecated: true
description: Not returned.
running_runs:
type: array
description: Running Sessions, most recently started first.
items:
type: object
properties:
run_id:
type: string
description: Id of the Session.
repo:
type: string
description: Repository full name, or an empty string for work with no repository (a Scratch Session).
agent_id:
type: string
description: Repository agent that owns the Session, or null.
run_kind:
type: string
description: Kind of work, such as background_agent.
started_at:
type: string
format: date-time
description: When the Session started running, or null when unrecorded.
queued_runs:
type: array
description: Sessions waiting to start, in start order.
items:
type: object
properties:
run_id:
type: string
description: Id of the Session.
repo:
type: string
description: Repository full name, or an empty string for work with no repository (a Scratch Session).
agent_id:
type: string
description: Repository agent that owns the Session, or null.
run_kind:
type: string
description: Kind of work, such as background_agent.
queued_at:
type: string
format: date-time
description: When the Session was queued.
position:
type: integer
description: 1-based place in the queue.
'401':
$ref: '#/components/responses/Unauthorized'
'403':
$ref: '#/components/responses/Forbidden'
'429':
$ref: '#/components/responses/RateLimited'
security:
- reasonApiKey:
- analytics:read
components:
schemas:
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.
UsageTimeseriesPoint:
type: object
properties:
bucket:
type: string
description: Timestamp at the start of the bucket.
input_tokens:
type: integer
description: Model input tokens used in the bucket.
output_tokens:
type: integer
description: Model output tokens generated in the bucket.
sandbox_minutes:
type: integer
description: Whole sandbox minutes used in the bucket.
required:
- bucket
- input_tokens
- output_tokens
- sandbox_minutes
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).'