跳至正文
OpenAgentSkill
浏览已开放 · 目录记录日期 2026-11-21 · 自动更新和账户服务暂时关闭。
数据与分析

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.

EndpointPurpose
GET /billing/balanceCurrent canConsume flag, remaining DIEM & USD, epoch allocation.
GET /billing/usage-historyPer-request ledger with keyset pagination. JSON or CSV. Use this one.
GET /billing/usageDeprecated offset-paginated ledger. See the warning below.
GET /billing/usage-analyticsAggregated 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/usage is 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 with 410 Gone. Every response carries Deprecation: @1783555200 and Link: </api/v1/billing/usage-history>; rel="successor-version". Write new integrations against GET /billing/usage-history, which returns the same data with keyset pagination.

Currency / priority

Venice debits from, in order:

  1. DIEM — staked credits (reset per epoch).
  2. BUNDLED_CREDITS — included in some Pro plans.
  3. USD — prepaid fiat balance.
  4. (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: false means both DIEM and USD buckets are empty on this endpoint — canConsume here is hasPositiveDiemBalance || usdBalance > 0 and does not factor in bundled credits (which are consulted during the actual request in getConsumableBalanceForRequest).
  • consumptionCurrency is "DIEM", "USD", or null (when neither applies).
  • balances.diem is null if not staking.
  • diemEpochAllocation is 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&currency=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.

ParamNotes
startTimestampInclusive lower bound, ISO 8601 UTC with a Z suffix. First page only.
endTimestampExclusive 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.
currencyUSD / DIEM / BUNDLED_CREDITS.
pageSize10–1000. Default 1000.
cursorOpaque 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&currency=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

ParamNotes
currencyUSD / VCU / DIEM / BUNDLED_CREDITS.
startDate / endDate
阅读完整来源 ↗