AlmondTill/G3N API

aiCalls

query · in the family Billing and the wallet

What it does

Your group’s AI calls with the words — what was asked, what the assistant said it understood, and what it answered — newest first, one page at a time.

Your group's AI calls with the words, newest first: the backwards month walk from this month to the 13-month floor (the rows live 13 months hot; the event lake keeps them forever). limit: 1..200, default 50. nextToken: the prior page's cursor verbatim (opaque, group-bound — a foreign or garbled token refuses VALIDATION/INVALID). month: one yyyy-mm bucket — the walk stays in it (nextToken null when it is exhausted). surface: one of the at.ai.call.v1 roster (e.g. office.report_draft) — a filter in the walk (a rare surface over a dense month may answer a short page with a cursor: keep walking). day pins ONE calendar day of ONE bucket — the sk prefix, a bounded key read; with month they must agree. A16_BILLING by override; excluded from the consult tools and the read-only integration key.

Before you call

A bearer session from an API key (see Authentication and key hygiene) or a signed-in user.

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

Roles that may call it:

What happens

A read over the ledger the platform keeps for every AI call your group makes (thirteen months; nothing changes). Each row carries the person’s own words, what the model said it understood, the answer as the feature received it, what your plan meters for it — kernels, and the USD at the standard rate — and the surface — the same facts the usage page totals by day, opened to the call. Owners and billing-plane roles read it; it is never offered to the AI as a tool and never granted to a read-only integration key.

Arguments

NameTypeRequiredNotes
limitIntnoHow many records to answer at most; a page may hold fewer.
nextTokenStringnoThe cursor from the previous page, passed back exactly as received.
monthStringno
surfaceStringno
dayStringno

Returns

AiCallPage AiCallPage! — One page of your group's AI calls, newest first (the OrgBusEntryPage grammar).

This is a page: items holds the records and nextToken the cursor for the next page — pass it back verbatim until it is null. See paging.

Example request

graphql
query ExampleAiCalls($limit: Int) {
  aiCalls(limit: $limit) {
    items {
      id
      at
      requestId
      op
      surface
      model
      effort
      schemaName
      status
      providerErrorCode
      billedKernels
      billedUsd
      latencyMs
      bytesIn
      bytesOut
      prompt
      context
      contextTruncated
      understood
      answer
      answerTruncated
      userId
      sessionId
      organizationId
    }
    nextToken
  }
}

Variables:

json
{
  "limit": 1
}

Example response

json
{
  "data": {
    "aiCalls": {
      "items": [
        {
          "id": "01900000-0000-7000-8000-37386ae00000",
          "at": "<at>",
          "requestId": "01900000-0000-7000-8000-824541520000",
          "op": "<op>",
          "surface": "<surface>",
          "model": "<model>",
          "effort": "<effort>",
          "schemaName": "Blue jeans",
          "status": "<status>",
          "providerErrorCode": "BJ-001",
          "billedKernels": 1.5,
          "billedUsd": "<billed usd>",
          "latencyMs": 1,
          "bytesIn": 1,
          "bytesOut": 1,
          "prompt": "<prompt>",
          "context": "<context>",
          "contextTruncated": true,
          "understood": "<understood>",
          "answer": "<answer>",
          "answerTruncated": true,
          "userId": "01900000-0000-7000-8000-e0a63e120000",
          "sessionId": "01900000-0000-7000-8000-2048cc970000",
          "organizationId": "01900000-0000-7000-8000-1971e30a0000"
        }
      ],
      "nextToken": "<the cursor from the previous page>"
    }
  },
  "extensions": {
    "at": {
      "callId": "01EXAMPLE-CALL-ID",
      "version": {
        "requested": null,
        "serviced": {
          "name": "genesis",
          "number": 0
        }
      }
    }
  }
}

Errors this call can answer