tanqoryExtAiCredits
- Query
- Other operations
The store's AI credits: balance, reset date, purchased lots with their expiry, packs, purchases, alerts. Any staff member.
Arguments
None.
Returns
TanqoryExtAiCredits! The store's AI credits, from the cell's copy of the ledger (no central call).
| Field | Type | Description |
|---|---|---|
alerts | [TanqoryExtAiCreditAlert!]! | |
balance | Float! | Credits the store can spend now: included plus purchased (purchased may be below zero after an overrun). |
canManage | Boolean! | Whether the caller may buy credits and change the spend controls (staff permissions |
dailyResetsAt | DateTime | Trial only: when today's grant is replaced by the next one. |
includedCredits | Float! | The plan's credits for the period; for a trial, the period's maximum of the daily grant. |
includedRemaining | Float! | |
lots | [TanqoryExtAiCreditLot!]! | |
packs | [TanqoryExtAiCreditPack!]! | |
periodStartsAt | DateTime | |
purchasedRemaining | Float! | |
purchases | [TanqoryExtAiCreditPurchase!]! | The latest purchases, newest first (at most 20). |
resetsAt | DateTime | When the included credits reset (no rollover). |
trial | Boolean! | True when the store gets the trial's daily grant (20 a day, at most 100 a month) instead of a plan's credits. |
Example request
A starting point: required arguments as variables and a few fields of the result. Replace the placeholders.
Set STORE_ID and TANQORY_ACCESS_TOKEN in your environment first (Make your first API call).
curl -X POST "https://api.tanqory.com/admin/2026-10/stores/$STORE_ID/graphql" \
-H "Authorization: Bearer $TANQORY_ACCESS_TOKEN" \
-H "Content-Type: application/json" \
--data '{"query":"query TanqoryExtAiCredits {\n tanqoryExtAiCredits {\n balance\n canManage\n dailyResetsAt\n includedCredits\n includedRemaining\n lots { id }\n periodStartsAt\n purchasedRemaining\n purchases { id }\n resetsAt\n }\n}","variables":{}}'// Node.js 18 or later (fetch is built in). Save as request.mjs and run: node request.mjs
const query = `query TanqoryExtAiCredits {
tanqoryExtAiCredits {
balance
canManage
dailyResetsAt
includedCredits
includedRemaining
lots { id }
periodStartsAt
purchasedRemaining
purchases { id }
resetsAt
}
}`;
const variables = {};
const res = await fetch(`https://api.tanqory.com/admin/2026-10/stores/${process.env.STORE_ID}/graphql`, {
method: 'POST',
headers: {
'Authorization': 'Bearer ' + process.env.TANQORY_ACCESS_TOKEN,
'Content-Type': 'application/json',
},
body: JSON.stringify({ query, variables }),
});
console.log(res.status, JSON.stringify(await res.json(), null, 2));# Python 3, standard library only. Save as request.py and run: python3 request.py
import json, os, urllib.request
query = """query TanqoryExtAiCredits {
tanqoryExtAiCredits {
balance
canManage
dailyResetsAt
includedCredits
includedRemaining
lots { id }
periodStartsAt
purchasedRemaining
purchases { id }
resetsAt
}
}"""
variables = json.loads("""{}""")
req = urllib.request.Request(
"https://api.tanqory.com/admin/2026-10/stores/" + os.environ["STORE_ID"] + "/graphql",
data=json.dumps({"query": query, "variables": variables}).encode(),
headers={
"Authorization": "Bearer " + os.environ["TANQORY_ACCESS_TOKEN"],
"Content-Type": "application/json",
},
)
with urllib.request.urlopen(req) as res:
print(res.status, json.dumps(json.load(res), indent=2))