Overview
TextQL exposes usage data through several channels. Each answers a different question — pick the right one before building.Data Sources Reference
Usage API — GET /v1/billing/usage
ACU consumption aggregated by user × time bucket. Use for billing dashboards and spend tracking across teams.
Contains: organization, email, category (llm_tokens, compute_hours, cell_executions), acu, cost_center, start_datetime, end_datetime
Does not contain: per-conversation breakdown, raw token counts, cost in dollars
TextQL Console connector
The broadest of the usage surfaces: a connector so ACU spend, raw token counts, and the sandbox billing rate can all be queried interactively inside Ana instead of polled over REST. Requires thebilling:read permission; see Role-Based Access Control (RBAC) for how to grant it.
emailandrolesare dropped from the tables entirely for members without the org-widechat:read_privatepermission, not nulled, so queries referencing them error with an unknown column.acu_usageloses both;token_usagelosesemail.- Rows cover every organization in your org’s tenant, falling back to your org alone when it has no tenant assigned; filter on
organizationfor one. organizationis the org name;deploymentis the deployment’s display name, empty when it cannot be resolved.- Rows are hourly buckets in UTC, keyed on
start_datetime, withend_datetimeexclusive. Roll up to days or months in SQL. - No data before 2025-01-01 UTC. Querying earlier does not error; those rows simply do not exist.
acu_rate_per_1000_usdis the org’s current rate in USD per 1000 ACUs, denormalized onto every row rather than the rate at that bucket; dollars =acu * acu_rate_per_1000_usd / 1000. That is an estimate, not an invoice amount: usage before a tenant’s billing start date is billed at $0 but priced here at today’s rate, and the billing start date is not exposed to filter it out.- Unlike the Token Usage API,
token_usageis simply empty on a non-BYOK deployment, never an error.
Chat List API — POST /v1/chat/list
Returns all conversations in the org across every source. Requires an admin API key — a member-scoped key silently returns only that member’s chats.
chat_id, title, source (Slack, UI, playbook), creator (email), created_at, updated_at
Does not contain: token counts, cost, message content
Key parameters:
GetLlmUsage — per-conversation tokens and cost
Returns token breakdown and estimated cost for a specific chat. Requires an admin API key forinclude_costs.
input_tokens, output_tokens, cache_creation_input_tokens, cache_read_input_tokens, model_name, timestamp, and estimated_cost (admin only). Sum across the array for conversation totals.
Does not contain: ACU values, message content
Typical pattern: call POST /v1/chat/list to get all chat_ids, then call GetLlmUsage for each.
Chat API — GET /v2/chats/{id}
Returns the full content of a single conversation including messages.

https://app.textql.com/v1/billing
Authentication
All requests require a Bearer token. Your token is a Base64-encoded string in the format{member_id}:{api_token}, created in Settings → Developers → API Keys.
Pass it in one of two ways:
Your First Request
Fetch the last 90 days of usage for your organization with a single call:Parameters
All parameters are optional query parameters onGET /usage. Unrecognized query parameters are rejected with 400 invalid_parameter — in particular, the response fields start_datetime / end_datetime are not valid request filters; use start_date / end_date.
Date Range
Timezones are expressed through the RFC 3339 UTC offset (e.g.
2026-07-04T20:00:00-04:00). The offset of start_date (or of end_date when start_date is omitted) also controls:
- Alignment of
dayandmonthbuckets (days start at local midnight for that offset) - The offset used to render
start_datetime/end_datetimein the response
+ in positive offsets as %2B (e.g. 2026-07-01T00:00:00%2B05:30).
Granularity
Controls the size of each time bucket. Defaults today.
Filtering
By organization — useful for tenants with multiple orgs:cost_center is only set when its usage came from a source with one attached (e.g. a playbook), so most usage has no cost center to filter by:
Sorting
Use thesort parameter to control result order. Prefix with - for descending.
Pagination
pagination.total_count in the response to calculate how many pages exist.
Code Examples
Python — fetch all records across pages:Response Fields
Error Reference
Troubleshooting & Support
If you’re still running into issues, contact support at support@textql.com and include the full request URL and response body.