Skip to main content
TroopyDocs
Open Troopy
Troopy

API reference / Computer

Get the AI plan's usage

How much of its AI plan the organization has used: the account it is signed in as, each usage window with the share used and when it resets, and whether it is out of usage. Read on the workspace's computer, where the plan's credentials stay, and kept for up to 5 minutes. Plans Troopy can't read yet answer with supported false. Needs a connected plan.

get/api/v1/computer/connection/usage

Authorization

HeaderAuthorization: Bearer <API key>
Or the headerX-API-Key: <API key>
API keyMake one in Troopy under Settings > API keys. It acts as you, in its workspace.

Other ways to call it

CLItroopy ai usage
MCP tooltroopy_get_ai_usage
Rate limit30 calls in 60 seconds, for each key

Query parameters

planstring

Which of the organization's AI plans, by id. The default plan when left out

Response

200 · application/json
data*object
10 properties
plan*string

An AI plan's id, from GET /ai-plans

provider*enum<string>

The AI plan the organization's teammates run on

claudechatgptgeminigrokcopilotopenrouterzaikimiminimaxqwenanthropicopenaicursor

supported*boolean

Whether Troopy can read this plan's usage. When false, only the provider's own site can say

email*string | null

The account the plan is signed in as

tier*string | null

The plan's tier at the provider, like pro

signInExpiresAt*string | null

When the sign-in lapses unless the provider's CLI renews it first

limits*array<object>

Each usage window, shortest first, like a 5-hour and a weekly limit

3 properties
label*string
usedPercent*number
resetsAt*string | null
limitReached*boolean

True while the plan is out of usage: teammates can't run on it until a limit resets

bankedResets*integer | null

Limit resets the account has banked and can spend early

checkedAt*string

When the computer last read these numbers. They are kept for up to 5 minutes

Errors

400 invalid_inputFix the field named in detail. Each operation's schema is in /api/v1/openapi.json.
401 unauthorizedSend an API key as `Authorization: Bearer tr_live_...`. Create one in Troopy under Settings.
403 forbiddenThe key lacks a scope this operation needs, or its owner lacks the role. detail says which; create a key with the scope, or ask an organization owner or admin.
429 rate_limitedWait the number of seconds in Retry-After, then retry.