venice-billing
Venice billing and usage analytics - GET /billing/balance, GET /billing/usage-history (keyset-paginated per-request ledger, JSON or CSV), GET /billing/usage (deprecated predecessor), and GET /billing/usage-analytics (aggregated by date/model/key). Covers the DIEM/USD/BUNDLED_CREDITS consumption priority and building dashboards. (Beta)
veniceai · 已有 AI 审核记录
安装与使用
运行命令前先阅读来源与依赖说明。复制命令不会自动安装或执行。
npx skills add veniceai/skills --skill venice-billing技能说明
name: venice-billing description: Venice billing and usage analytics - GET /billing/balance, GET /billing/usage-history (keyset-paginated per-request ledger, JSON or CSV), GET /billing/usage (deprecated predecessor), and GET /billing/usage-analytics (aggregated by date/model/key). Covers the DIEM/USD/BUNDLED_CREDITS consumption priority and building dashboards. (Beta)
Venice Billing
Four read-only endpoints for account-level billing and analytics. All are under a Beta tag — schema/behavior may change.
| Endpoint | Purpose |
|---|---|
GET /billing/balance | Current canConsume flag, remaining DIEM & USD, epoch allocation. |
GET /billing/usage-history | Per-request ledger with keyset pagination. JSON or CSV. Use this one. |
GET /billing/usage | Deprecated offset-paginated ledger. See the warning below. |
GET /billing/usage-analytics | Aggregated breakdowns: by date, model, API key. |
All require Bearer auth (not x402 — for wallet balances, use venice-x402). GET /billing/balance, GET /billing/usage-history, and GET /billing/usage require an ADMIN key — an INFERENCE key gets 401. GET /billing/usage-analytics works on any authenticated key (scoped to the account behind the key).
GET /billing/usageis deprecated and mostly closed. It is rate limited to 1 request per minute per user, and accounts created on or after 2026-07-07 are rejected outright with410 Gone. Every response carriesDeprecation: @1783555200andLink: </api/v1/billing/usage-history>; rel="successor-version". Write new integrations againstGET /billing/usage-history, which returns the same data with keyset pagination.
Currency / priority
Venice debits from, in order:
DIEM— staked credits (reset per epoch).BUNDLED_CREDITS— included in some Pro plans.USD— prepaid fiat balance.- (
VCU) — deprecated legacy DIEM.
consumptionCurrency on /billing/balance reports the current currency being consumed.
GET /billing/balance
curl https://api.venice.ai/api/v1/billing/balance \
-H "Authorization: Bearer $VENICE_API_KEY"
{
"canConsume": true,
"consumptionCurrency": "DIEM",
"balances": { "diem": 90.5, "usd": 25 },
"diemEpochAllocation": 100
}
canConsume: falsemeans both DIEM and USD buckets are empty on this endpoint —canConsumehere ishasPositiveDiemBalance || usdBalance > 0and does not factor in bundled credits (which are consulted during the actual request ingetConsumableBalanceForRequest).consumptionCurrencyis"DIEM","USD", ornull(when neither applies).balances.diemisnullif not staking.diemEpochAllocationis the ceiling for the current epoch —balances.diem / diemEpochAllocation= remaining fraction.
GET /billing/usage-history
Per-request ledger with keyset (cursor) pagination. This is the supported way to walk billing history.
curl "https://api.venice.ai/api/v1/billing/usage-history?startTimestamp=2026-06-01T00:00:00Z&endTimestamp=2026-07-01T00:00:00Z&pageSize=1000¤cy=USD" \
-H "Authorization: Bearer $VENICE_ADMIN_KEY" \
-H "Accept: application/json"
Query parameters
A request is either a filtered first page or a bare continuation. Sending
cursor alongside any filter is a 400, and so is any unknown parameter — the
validator is strict rather than lenient.
| Param | Notes |
|---|---|
startTimestamp | Inclusive lower bound, ISO 8601 UTC with a Z suffix. First page only. |
endTimestamp | Exclusive upper bound, ISO 8601 UTC. Must be later than startTimestamp. Consecutive windows that share a boundary walk the history with no gaps and no overlaps. |
currency | USD / DIEM / BUNDLED_CREDITS. |
pageSize | 10–1000. Default 1000. |
cursor | Opaque continuation token from a previous nextCursor. Carries the filters of the walk it continues, so send it alone. |
Response (JSON)
{
"data": [
{
"timestamp": "2026-06-15T19:05:10.504Z",
"sku": "zai-org-glm-5-1-llm-output-mtoken",
"units": 0.000227,
"pricePerUnitUsd": 2.8,
"amount": -0.06356,
"currency": "DIEM",
"notes": "API Inference",
"inferenceDetails": {
"requestId": "chatcmpl-4007fd29f42b7d3c4107f4345e8d174a",
"promptTokens": 339,
"completionTokens": 227,
"inferenceExecutionTime": 2964
}
}
],
"nextCursor": "AZq3fK9tXhIVDm2j4vN8cQwYt1sB6uEoLxRgPzKaJdHfM5nC7yW0K3w"
}
Entries come back in ascending timestamp order. nextCursor is null on the
last page. Set Accept: text/csv for CSV, in which case Content-Disposition
stamps the export time into the filename (each page of a walk downloads under a
unique, sort-ordered name) and nextCursor moves to the x-next-cursor
response header.
Entry fields match /billing/usage (see below), with inferenceDetails
sub-fields nullable when a count or timing was not recorded.
Walking the full history
let url = `${base}/billing/usage-history?startTimestamp=${start}&endTimestamp=${end}`
for (;;) {
const page = await fetch(url, { headers }).then(r => r.json())
handle(page.data)
if (page.nextCursor === null) break
url = `${base}/billing/usage-history?cursor=${encodeURIComponent(page.nextCursor)}`
}
GET /billing/usage (deprecated)
Offset-paginated per-request ledger. Kept alive for grandfathered accounts only; see the deprecation warning at the top of this skill before using it.
curl "https://api.venice.ai/api/v1/billing/usage?limit=200&page=1&sortOrder=desc¤cy=USD&startDate=2026-04-01T00:00:00Z&endDate=2026-04-21T23:59:59Z" \
-H "Authorization: Bearer $VENICE_API_KEY" \
-H "Accept: application/json"
Query parameters
| Param | Notes |
|---|---|
currency | USD / VCU / DIEM / BUNDLED_CREDITS. |
startDate / endDate |