AlmondTill/G3N API

On this page

aiUsage

query · in the family Billing and the wallet

What it does

Your group’s AI usage by day — calls, tokens, and spend, with a per-surface breakdown.

YOUR group's AI usage by UTC day: composed off the daily rollup rows the meter grows with EVERY metered call (calls · tokens · nano-exact spend + the per-surface split), ≤ 92 bounded point-reads — never a scan. SELF-group BY CONSTRUCTION (no target arg exists — the tokenEntries stance); days defaults 30, clamps 1..92; only days WITH usage answer (an empty window is the honest answer). costUsd values are decimal strings (the money-string law). Requires authentication.

What happens

A read over the running usage counters the platform keeps for every AI call; money shows in exact USD. Only days with usage appear.

Who may call it

Capability area: Billing and the wallet — Your platform bill, token purchases and the usage and cost reads.

Arguments

NameTypeRequiredNotes
daysIntnoNo further notes.

Returns

AiUsageWindow AiUsageWindow! — YOUR group's AI-usage window: the days WITH usage, newest first, + the window totals.

Example request

query ExampleAiUsage($days: Int) {
  aiUsage(days: $days) {
    totalCalls
    totalTokensInput
    totalTokensOutput
    totalCostUsd
  }
}

Variables:

{
  "days": 1
}

Example response

{
  "data": {
    "aiUsage": {
      "totalCalls": 1,
      "totalTokensInput": 1,
      "totalTokensOutput": 1,
      "totalCostUsd": "<total cost usd>"
    }
  },
  "extensions": {
    "at": {
      "callId": "01EXAMPLE-CALL-ID",
      "version": {
        "requested": null,
        "serviced": {
          "name": "genesis",
          "number": 0
        }
      }
    }
  }
}

Errors this call can answer

Used in