AI token usage and pricing
This resource reports what your AI project used in the current billing week and what it amounts to. Runs are measured in tokens and priced per token: there is no plan, no allowance and no pack, so a run is never refused for usage.
Endpoints
| Method | Path | Scope |
|---|---|---|
| GET | /v1/ai/run-usage/summary | usage: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",
"period": { "start": 1794182400, "end": 1794787199 },
"price": { "currency": "EUR", "unit": 1000000, "input": 1, "output": 5 },
"tokens": { "input": 842000, "output": 311500, "used": 1153500, "available": 2000000000 },
"amount": 2.4,
"runs": { "total": 1840, "finished": 1795, "failed": 31, "pending": 14 }
}
} The usage object
| Field | Type | Description |
|---|---|---|
object | string | Always usage. |
period | object | The billing week the figures cover. |
price | object | The price per token. |
tokens | object | The tokens used in the period. |
amount | number | The tokens of the period at the price, in the price's currency. |
runs | object | Run totals of your project. |
period
| Field | Type | Description |
|---|---|---|
start | integer | Monday 00:00:00 UTC of the current week, in Unix seconds. |
end | integer | Sunday 23:59:59 UTC of the current week, in Unix seconds. |
price
| Field | Type | Description |
|---|---|---|
currency | string | EUR. Prices exclude VAT. |
unit | integer | The number of tokens the two prices apply to: 1000000. |
input | number | Price of unit input tokens. |
output | number | Price of unit output tokens. |
tokens
| Field | Type | Description |
|---|---|---|
input | integer | Input tokens of the period's runs. |
output | integer | Output tokens of the period's runs. |
used | integer | input plus output. |
available | integer | A constant, far above any usage. Kept for clients written when an allowance existed; do not build on it. |
Runs that ended in an error are left out of the three counts and of amount.
runs
| Field | Type | Description |
|---|---|---|
total | integer | Every run your project has ever launched. |
finished | integer | Runs that completed. |
failed | integer | Runs that ended in an error. |
pending | integer | Runs still queued or in progress. |
These four are totals over your project's whole life, not figures for the current week.