AlmondTill/G3N API

Fund the AI wallet and see what the platform costs you

Put a card on file for your group’s kernel wallet, buy kernels when you need them, and read what the platform is charging you — the kernel ledger, the usage day by day, the AI usage by surface, and the platform’s charges.

Pricing & money · a play in 4 steps.

In the office

Where it starts: the office’s Kernel wallet page.

Step 1. Attach the payment method that pays for top-ups. Open Kernel wallet.

Step 2. Buy kernels — one press with the stored card, or a purchase you set up — the balance credits through one recorded purchase. Open Kernel purchases.

Step 3. Read the kernel ledger — every charge, purchase and adjustment on the balance.

Step 4. Read the usage day by day, the AI usage by surface, and the platform’s charges to your group. Open Usage.

For developers — the calls

The steps

  1. Attach the payment method that pays for top-ups. — attachTokenAccountBillingMethod
  2. Buy kernels — one press with the stored card, or a purchase you set up — the balance credits through one recorded purchase. — purchaseTokensNow, createTokenPurchase
  3. Read the kernel ledger — every charge, purchase and adjustment on the balance. — tokenEntries
  4. Read the usage day by day, the AI usage by surface, and the platform’s charges to your group. — usageReport, aiUsage, billingCharges

The calls

Every operation this use case runs, in the order it first appears, with the request and the response its reference page shows.

attachTokenAccountBillingMethod

attachTokenAccountBillingMethod — mutation · Attach a payment method to your group’s kernel wallet — how top-ups get paid.

Example request

graphql
mutation ExampleAttachTokenAccountBillingMethod($input: AttachTokenAccountBillingMethodInput!) {
  attachTokenAccountBillingMethod(input: $input) {
    id
    sysId
    type
    caption
    status
    parentId
    rootId
    createdAt
    updatedAt
    revisionNum
    revision
    balance
    lowBalanceThreshold
    dailyBurnThresholdKernels
    autoTopOffMonth
    autoTopOffSpentUsdCents
    autoTopOffDay
    autoTopOffSpentDayUsdCents
    autoTopOffPendingMethod
    autoTopOffPrimaryFailedDay
    autoTopOffBackupFailedDay
    burn7dKernels
    runwayDays
    microTokenCarry
    lowBalanceSince
    autoTopOffPendingPurchaseId
    topOffCappedSince
    baseFeePaidMonth
    includedMonth
    includedGranted
    includedRemaining
    affiliateCreditCents
    frozenKernels
    storageSnapshotDay
    currency
  }
}

Variables:

json
{
  "input": {
    "methodRef": "<method ref>"
  }
}

Send it with the envelope naming the version: "extensions": {"at": {"version": {"name":"genesis","number":0}}}.

Example response

json
{
  "data": {
    "attachTokenAccountBillingMethod": {
      "id": "01900000-0000-7000-8000-b0839b1d0000",
      "sysId": "TA-EXMP-0000-000F",
      "type": "TokenAccount",
      "caption": "Blue jeans",
      "status": "active",
      "parentId": "01900000-0000-7000-8000-eacdfcfd0000",
      "rootId": "01900000-0000-7000-8000-a1295a650000",
      "createdAt": "2027-01-31T00:00:00.000Z",
      "updatedAt": "2027-01-31T00:00:00.000Z",
      "revisionNum": 1,
      "revision": "01900000-0000-7000-8000-53c6eea90000",
      "balance": 1,
      "lowBalanceThreshold": 1,
      "dailyBurnThresholdKernels": 1,
      "autoTopOffMonth": "<auto top off month>",
      "autoTopOffSpentUsdCents": 1,
      "autoTopOffDay": "2027-01-31",
      "autoTopOffSpentDayUsdCents": 1,
      "autoTopOffPendingMethod": "<auto top off pending method>",
      "autoTopOffPrimaryFailedDay": "2027-01-31",
      "autoTopOffBackupFailedDay": "2027-01-31",
      "burn7dKernels": 1,
      "runwayDays": 1.5,
      "microTokenCarry": 1,
      "lowBalanceSince": "<low balance since>",
      "autoTopOffPendingPurchaseId": "01900000-0000-7000-8000-396e6d060000",
      "topOffCappedSince": "<top off capped since>",
      "baseFeePaidMonth": "<base fee paid month>",
      "includedMonth": "<included month>",
      "includedGranted": 1,
      "includedRemaining": 1,
      "affiliateCreditCents": 1,
      "frozenKernels": 1,
      "storageSnapshotDay": "2027-01-31",
      "currency": "USD"
    }
  },
  "extensions": {
    "at": {
      "callId": "01EXAMPLE-CALL-ID",
      "version": {
        "requested": {
          "name": "genesis",
          "number": 0
        },
        "serviced": {
          "name": "genesis",
          "number": 0
        }
      }
    }
  }
}

purchaseTokensNow

purchaseTokensNow — mutation · Buy kernels NOW with the stored card — one press, no checkout.

Example request

graphql
mutation ExamplePurchaseTokensNow($input: NewTokenPurchaseInput!) {
  purchaseTokensNow(input: $input) {
    id
    sysId
    type
    caption
    status
    parentId
    rootId
    createdAt
    updatedAt
    revisionNum
    revision
    usdAmountCents
    tokensPurchased
    volumeTierCode
    rateCardVersion
    stripePaymentIntentId
    settledAt
  }
}

Variables:

json
{
  "input": {
    "caption": "Blue jeans",
    "usdAmountCents": 1
  }
}

Send it with the envelope naming the version: "extensions": {"at": {"version": {"name":"genesis","number":0}}}.

Example response

json
{
  "data": {
    "purchaseTokensNow": {
      "id": "01900000-0000-7000-8000-b3215f990000",
      "sysId": "TP-EXMP-0000-000F",
      "type": "TokenPurchase",
      "caption": "Blue jeans",
      "status": "created",
      "parentId": "01900000-0000-7000-8000-b0839b1d0000",
      "rootId": "01900000-0000-7000-8000-a1295a650000",
      "createdAt": "2027-01-31T00:00:00.000Z",
      "updatedAt": "2027-01-31T00:00:00.000Z",
      "revisionNum": 1,
      "revision": "01900000-0000-7000-8000-53c6eea90000",
      "usdAmountCents": 1,
      "tokensPurchased": 1,
      "volumeTierCode": "BJ-001",
      "rateCardVersion": 1,
      "stripePaymentIntentId": "<stripe payment intent id>",
      "settledAt": "2027-01-31T00:00:00.000Z"
    }
  },
  "extensions": {
    "at": {
      "callId": "01EXAMPLE-CALL-ID",
      "version": {
        "requested": {
          "name": "genesis",
          "number": 0
        },
        "serviced": {
          "name": "genesis",
          "number": 0
        }
      }
    }
  }
}

createTokenPurchase

createTokenPurchase — mutation · Buy kernels — top up your group’s prepaid balance.

Example request

graphql
mutation ExampleCreateTokenPurchase($input: NewTokenPurchaseInput!) {
  createTokenPurchase(input: $input) {
    id
    sysId
    type
    caption
    status
    parentId
    rootId
    createdAt
    updatedAt
    revisionNum
    revision
    usdAmountCents
    tokensPurchased
    volumeTierCode
    rateCardVersion
    stripePaymentIntentId
    settledAt
  }
}

Variables:

json
{
  "input": {
    "caption": "Blue jeans",
    "usdAmountCents": 1
  }
}

Send it with the envelope naming the version: "extensions": {"at": {"version": {"name":"genesis","number":0}}}.

Example response

json
{
  "data": {
    "createTokenPurchase": {
      "id": "01900000-0000-7000-8000-b3215f990000",
      "sysId": "TP-EXMP-0000-000F",
      "type": "TokenPurchase",
      "caption": "Blue jeans",
      "status": "created",
      "parentId": "01900000-0000-7000-8000-b0839b1d0000",
      "rootId": "01900000-0000-7000-8000-a1295a650000",
      "createdAt": "2027-01-31T00:00:00.000Z",
      "updatedAt": "2027-01-31T00:00:00.000Z",
      "revisionNum": 0,
      "revision": "01900000-0000-7000-8000-53c6eea90000",
      "usdAmountCents": 1,
      "tokensPurchased": 1,
      "volumeTierCode": "BJ-001",
      "rateCardVersion": 1,
      "stripePaymentIntentId": "<stripe payment intent id>",
      "settledAt": "2027-01-31T00:00:00.000Z"
    }
  },
  "extensions": {
    "at": {
      "callId": "01EXAMPLE-CALL-ID",
      "version": {
        "requested": {
          "name": "genesis",
          "number": 0
        },
        "serviced": {
          "name": "genesis",
          "number": 0
        }
      }
    }
  }
}

tokenEntries

tokenEntries — query · Your group’s kernel ledger — every charge, purchase, and adjustment on your prepaid balance.

Example request

graphql
query ExampleTokenEntries($limit: Int) {
  tokenEntries(limit: $limit) {
    items {
      id
      type
      caption
      status
      parentId
      rootId
      createdAt
      updatedAt
      revisionNum
      revision
      entryKind
      amountTokens
      reason
      tokenPurchaseId
      billingChargeId
      transferCounterpartRootId
      transferCounterpartEntryId
      carriedInMicroTokens
      carriedOutMicroTokens
      rateCardVersion
    }
    nextToken
  }
}

Variables:

json
{
  "limit": 1
}

Example response

json
{
  "data": {
    "tokenEntries": {
      "items": [
        {
          "id": "01900000-0000-7000-8000-37386ae00000",
          "type": "<type>",
          "caption": "Blue jeans",
          "status": "<status>",
          "parentId": "01900000-0000-7000-8000-eacdfcfd0000",
          "rootId": "01900000-0000-7000-8000-a1295a650000",
          "createdAt": "2027-01-31T00:00:00.000Z",
          "updatedAt": "2027-01-31T00:00:00.000Z",
          "revisionNum": 1,
          "revision": "01900000-0000-7000-8000-53c6eea90000",
          "entryKind": "<entry kind>",
          "amountTokens": 1,
          "reason": "Correcting a miscount.",
          "tokenPurchaseId": "01900000-0000-7000-8000-b3215f990000",
          "billingChargeId": "01900000-0000-7000-8000-142a32780000",
          "transferCounterpartRootId": "01900000-0000-7000-8000-daa1e0a30000",
          "transferCounterpartEntryId": "01900000-0000-7000-8000-75703f890000",
          "carriedInMicroTokens": 1,
          "carriedOutMicroTokens": 1,
          "rateCardVersion": 1
        }
      ],
      "nextToken": "<the cursor from the previous page>"
    }
  },
  "extensions": {
    "at": {
      "callId": "01EXAMPLE-CALL-ID",
      "version": {
        "requested": null,
        "serviced": {
          "name": "genesis",
          "number": 0
        }
      }
    }
  }
}

usageReport

usageReport — query · What your group’s use of the platform consumes, day by day, in kernels — with a per-kind breakdown, and a drill to one person or one sitting.

Example request

graphql
query ExampleUsageReport($days: Int) {
  usageReport(days: $days) {
    totalCalls
    totalKernels
  }
}

Variables:

json
{
  "days": 1
}

Example response

json
{
  "data": {
    "usageReport": {
      "totalCalls": 1,
      "totalKernels": 1.5
    }
  },
  "extensions": {
    "at": {
      "callId": "01EXAMPLE-CALL-ID",
      "version": {
        "requested": null,
        "serviced": {
          "name": "genesis",
          "number": 0
        }
      }
    }
  }
}

aiUsage

aiUsage — query · Your group’s AI usage by day — calls, tokens, and what your plan meters for it, with a per-surface breakdown.

Example request

graphql
query ExampleAiUsage($days: Int) {
  aiUsage(days: $days) {
    totalCalls
    totalTokensInput
    totalTokensOutput
    totalBilledKernels
    totalBilledUsd
  }
}

Variables:

json
{
  "days": 1
}

Example response

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

billingCharges

billingCharges — query · The platform’s usage charges to your group — the transparency ledger.

Example request

graphql
query ExampleBillingCharges($filter: FilterInput) {
  billingCharges(filter: $filter) {
    items {
      id
      sysId
      type
      caption
      status
      parentId
      rootId
      createdAt
      updatedAt
      revisionNum
      revision
      chargeKind
      usdAmountCents
      periodMonth
      stripePaymentIntentId
      settledAt
    }
    nextToken
    matchCount
    matchCountExact
  }
}

Variables:

json
{
  "filter": {
    "clauses": [
      {
        "field": "caption",
        "op": "contains",
        "values": [
          "Blue"
        ]
      }
    ]
  }
}

Example response

json
{
  "data": {
    "billingCharges": {
      "items": [
        {
          "id": "01900000-0000-7000-8000-142a32780000",
          "sysId": "BC-EXMP-0000-000F",
          "type": "BillingCharge",
          "caption": "Blue jeans",
          "status": "created",
          "parentId": "01900000-0000-7000-8000-b0839b1d0000",
          "rootId": "01900000-0000-7000-8000-a1295a650000",
          "createdAt": "2027-01-31T00:00:00.000Z",
          "updatedAt": "2027-01-31T00:00:00.000Z",
          "revisionNum": 1,
          "revision": "01900000-0000-7000-8000-53c6eea90000",
          "chargeKind": "<charge kind>",
          "usdAmountCents": 1,
          "periodMonth": "<period month>",
          "stripePaymentIntentId": "<stripe payment intent id>",
          "settledAt": "2027-01-31T00:00:00.000Z"
        }
      ],
      "nextToken": "<the cursor from the previous page>",
      "matchCount": 1,
      "matchCountExact": true
    }
  },
  "extensions": {
    "at": {
      "callId": "01EXAMPLE-CALL-ID",
      "version": {
        "requested": null,
        "serviced": {
          "name": "genesis",
          "number": 0
        }
      }
    }
  }
}