Skip to content
Reference · Cost and pricing

AI Billing APIs: A Reference

How FinOps and platform teams can pull AI cost data from model providers, hyperscalers and coding tools, what is missing, and a minimal aggregation pipeline.

Published Updated Reviewed 6 min read

Topic hub: FinOps for AI

In short: most AI providers now expose cost and usage through an API, at very different depths. Cloud-hosted models are the easiest to bring into existing FinOps tooling and coding tools the patchiest. The hard part is not access. It is mapping provider cost to a team, product and outcome.

Providers at a glance

Checked against each provider's published documentation on 6 October 2026 where the page could be read. Rows marked "not re-verified" are as previously published. Endpoints and schemas change often, so confirm against the current reference before building.

ProviderWhere the cost data isSplit byMain gapLast verified
OpenAICosts API (GET /organization/costs) and Usage API (GET /organization/usage), with an admin keyProject, model, API key, user, dateNo webhooks: poll on a scheduleNot re-verified
AnthropicUsage and Cost Admin API: GET /v1/organizations/usage_report/messages plus a cost report endpointAPI key, workspace, model, service tier, context window, data residency. Uncached, cached, cache-creation and output tokens are separateNeeds an admin key. Not available for individual accounts or for Claude Platform on AWS6 October 2026
Google Vertex AI and Gemini APIGoogle Cloud Billing, with BigQuery billing exportProject, labels, resource tags, SKUNo Gemini-specific cost endpointNot re-verified
AWS BedrockCost Explorer GetCostAndUsageService, region, account, cost allocation tags, model ID, inference type, featureTags must be activated for cost allocation and take 24 hours to appearNot re-verified
Azure OpenAIAzure Cost Management and Consumption APIs (/usageDetails), or scheduled exportSubscription, resource group, resource tagsOne resource shared by several teams needs application-level instrumentation to splitNot re-verified
Microsoft 365 CopilotMicrosoft 365 billing, not Azure Cost Management. Usage through the Graph Reports APIUser activity and feature adoptionCost in pounds or dollars needs the Admin Center or Partner CenterNot re-verified
GitHub CopilotCopilot Billing API (GET /orgs/{org}/copilot/billing) and the usage metrics endpointsSeat, user, teamPriced per seat, so no token-level cost. The question is seat utilisation6 October 2026
Amazon Q DeveloperAWS billing and Cost Explorer, as service Amazon Q DeveloperAccount and cost allocation tagsNone beyond AWS taggingNot re-verified
CursorAdmin API for team accounts: daily usage, spending, usage events, per-user spend limitsUserAvailability depends on plan6 October 2026
Devin Desktop (formerly Windsurf)No public billing API found at the last review. Admin console only-Cognition took over Windsurf in July 2025 and renamed it on 2 June 2026. Check current documentationNot re-verified
JetBrains AI AssistantLicence management API through Toolbox for BusinessSeat and licence statusAI usage is not reported separatelyNot re-verified

Three patterns follow. Cloud-hosted models are the easiest: Bedrock, Azure OpenAI and Vertex AI arrive through billing systems a FinOps team already uses. Direct model providers need an admin credential set up at the start, separate from inference keys. Coding tools are mostly seats: treat those without a usage API as fixed subscriptions and manage utilisation.

Why pull the data programmatically

Logging into consoles and reconciling exports stops working once an estate has more than a handful of AI services. Programmatic access gives four things: reporting that refreshes daily without manual work; anomaly alerts within hours of a runaway workflow; structured data that can be joined to teams, products and initiatives; and one total across providers.

Plan for maintenance. Providers change billing endpoints, schemas and authentication, so version the integration code and watch the changelogs.

Two example pulls

A daily cost pull from OpenAI's Costs API. Time parameters are Unix timestamps; check the current reference for parameter names.

curl "https://api.openai.com/v1/organization/costs?start_time=1780272000&bucket_width=1d" \
  -H "Authorization: Bearer $OPENAI_ADMIN_KEY"

Vertex AI costs from the BigQuery billing export. The same pattern works for any Google Cloud AI service.

SELECT
  DATE(usage_start_time) as date,
  service.description as service,
  sku.description as sku,
  SUM(cost) as total_cost
FROM `project.dataset.gcp_billing_export_v1_XXXXXX`
WHERE service.description = 'Vertex AI'
  AND DATE(usage_start_time) >= '2026-06-01'
GROUP BY date, service, sku
ORDER BY date DESC;

On Anthropic, prompt caching shows as separate token categories, because cache writes, cache reads and standard input are billed at different rates. Model them separately if caching is material.

Building a minimal AI cost aggregation pipeline

For FinOps teams building programmatic AI cost visibility from scratch, the practical minimal architecture looks like this. Interpretation

Step 1: Enumerate all AI cost sources. Create an inventory of every service that generates AI cost: model APIs, hyperscaler AI services, SaaS AI subscriptions, and coding tools. Categorise each by billing model (token-based, seat-based, subscription) and by whether a billing API exists.

Step 2: Implement scheduled pulls from billing APIs. For each source with a billing API (OpenAI, Anthropic, AWS, Azure, Google, GitHub Copilot), implement a scheduled job that pulls usage and cost data daily into a central data store. Prefer the billing/cost APIs over the usage APIs when dollar amounts are needed - usage APIs typically return token counts that require a separate rate lookup to convert to cost.

Step 3: Normalise to a common schema. Different providers return cost data in different formats. Normalise to a common schema that includes at minimum: date, provider, service, cost (USD), consumption unit (tokens, seats, API calls), and any available allocation dimensions (project, workspace, account, tag).

Step 4: Enrich with business context. Join provider-level cost data to organisational metadata: team, product, initiative, cost centre. This join requires a mapping layer - typically API key → team, workspace → product, or account → cost centre - that must be maintained by the FinOps function.

Step 5: Build reporting and alerting. With normalised, enriched data in a central store, standard FinOps reporting (daily cost by team, cost by model, week-over-week trends) and alerting (costs exceed X threshold, anomaly detected versus rolling average) become straightforward.

Step 6: Close the gaps. For sources without billing APIs (for example Devin Desktop, formerly Windsurf, at our last check, and most SaaS AI tools), implement a manual process: monthly export from admin console, import to the central store. Flag these sources explicitly in reporting so consumers understand their data is on a monthly lag rather than daily.

The most common failure in this architecture is not the technical integration - it is step 4, the organisational metadata layer. Maintaining accurate API key → team mappings as teams change, products merge, and keys are rotated is an ongoing governance discipline, not a one-time setup task. Without it, the cost data is accurate but unattributed, which limits its usefulness for portfolio-level decisions.


Six steps of a minimal AI cost pipeline: enumerate, pull, normalise, enrich, report and alert, close the gaps, with the enrichment step highlighted
The six steps above. Step 4, mapping keys and workspaces to teams and products, is where most pipelines fail.
Six steps of a minimal AI cost pipeline: enumerate, pull, normalise, enrich, report and alert, close the gaps, with the enrichment step highlighted

The six steps above. Step 4, mapping keys and workspaces to teams and products, is where most pipelines fail.

What this enables

With daily cost data mapped to business context, anomalies are caught in hours, portfolio reviews compare initiatives on current figures, and showback becomes routine. The pipeline is the technical base for the disciplines in the AI TCO Framework and FinOps & AI, not a substitute for them. The join to outcomes is covered in the instrumentation blueprint.

References and further reading

Related reading

One next step

Topics
  • FinOps
  • Billing APIs
  • AI cost management
  • Engineering

This piece is part of the FinOps for AI hub, which brings together the site’s guides on FinOps, TBM and ITFM for AI.

By Ed Epstein, who works at IBM. The postings on this site are my own and don't necessarily represent IBM's positions, strategies or opinions. About and disclosure · Methodology