AI quota and token usage

This resource reports what your AI project may still spend. Runs are measured in tokens, counted over a billing cycle, and the figures here are the ones the run endpoint checks before it accepts new work. Read it before launching a batch, and after a 402, to find out when the allowance resets.

Endpoints

MethodPathScope
GET/v1/ai/run-usage/summaryusage:read

The endpoint takes no parameters.

Read the summary

curl
curl https://api.ultineo.com/v1/ai/run-usage/summary \
  -H "Authorization: Bearer sk-project-YOUR_KEY"
application/json
{
  "code": 200,
  "title": "OK",
  "response": {
    "object": "usage",
    "plan": {
      "id": "plan_a1d9ffa770449a65ce8a",
      "name": "essential",
      "priority": "medium",
      "model": "7 to 25B parameters",
      "parallel": 2
    },
    "cycle": {
      "start": 1788220800,
      "end": 1790812800
    },
    "tokens": {
      "bucket_included": 5000000,
      "used": 148320,
      "input": 141908,
      "output": 6412,
      "bucket_remaining": 4851680,
      "purchased_active": 0,
      "purchased_remaining": 0,
      "available": 4851680
    },
    "runs": {
      "total": 217,
      "finished": 203,
      "failed": 6,
      "pending": 8
    }
  }
}

The usage object

FieldTypeDescription
objectstringAlways usage.
planobjectThe plan your project runs on.
cycleobjectThe billing cycle the token figures are measured over.
tokensobjectToken allowance and consumption.
runsobjectRun counts, by status.

plan

FieldTypeDescription
idstringThe plan identifier, prefixed plan_.
namestringThe plan's name.
prioritystringHow your project's work is queued: low, medium or high.
modelstringThe model sizes the plan unlocks, such as 7 to 25B parameters.
parallelintegerHow many runs your project may have in progress at once: 1 for low, 2 for medium, 5 for high.

cycle

FieldTypeDescription
startintegerWhen the current cycle began, in Unix seconds.
endintegerWhen it resets, in Unix seconds.

The cycle is a rolling month that starts on the date your plan was activated, so it does not usually match a calendar month. A project with no activation date runs on the calendar month. At end, used returns to zero.

tokens

FieldTypeDescription
bucket_includedintegerTokens the plan includes per cycle.
usedintegerTokens consumed this cycle, input plus output.
inputintegerThe input part of used.
outputintegerThe output part of used.
bucket_remainingintegerWhat is left of the plan's own allowance, never below zero.
purchased_activeintegerTokens held in extra credit that is currently valid.
purchased_remainingintegerWhat is left of that credit.
availableintegerWhat your project may actually still spend.

available is the figure that matters: it adds what is left of the plan allowance to any remaining extra credit, and it is what the run endpoint tests. When it reaches zero, POST /v1/ai/run/create is refused with 402 and Your reasoning quota is exhausted. Please wait until it resets or upgrade your plan.

Tip — Compare available with the expected size of your batch before you start, rather than finding the limit halfway through. A refused run is never queued, so nothing is partly spent.

runs

FieldTypeDescription
totalintegerEvery run your project has ever launched.
finishedintegerRuns that completed.
failedintegerRuns that ended in an error.
pendingintegerRuns still queued or in progress.

These four are totals over your project's whole life, not figures for the current cycle.

Note — pending is the count to watch against plan.parallel. When it sits at the parallel limit, new runs are still accepted but wait their turn.