Watch how to allocate LLM costs across teams and features
How each provider handles LLM cost allocation
There is no shared standard. Before plumbing anything, it helps to see the mechanism and the easiest practical split per provider.
Two patterns repeat across the table. Per-call labels (Vertex, partly Azure) give the finest granularity but are the most work to wire into every call site. Isolating usage into a separate account, project, key, or workspace per team is coarser but far easier to set up and maintain, and it is what most teams actually ship.
What each provider exposes, and what Costory uses
Attribution starts at the provider. Each one exposes a different signal that ties spend to a team, key, project, or use case, with different granularity and effort. Below is the signal available from each provider and the field Costory ingests to build your per-team split. A developer could wire any of this up internally; what Costory adds is knowing the right field for each provider and keeping the mapping current as keys, projects, and deployments change.Anthropic (Claude)
Available: Anthropic ties usage to the API key and actor (user email or key name), exposed through the Cost and Usage API. Using one API key per app, team, or environment puts the split in the billing data with no code. In Costory: the Anthropic connector ingests the key or actor as Sub account id and Resource name, and the model as Service name, so you group spend by team and by model directly. If you call Claude through Amazon Bedrock instead of the Anthropic API, that spend lands via the AWS connector (billed asClaude ... (Amazon Bedrock Edition)).
OpenAI
Available: OpenAI ties usage to projects, readable through the Usage and Cost API withgroup_by on project_id, line_item, and model. One project (and project key) per team gives isolation and per-project budget caps. For finer per-feature attribution, OpenAI’s guidance is to log application metadata (feature, route, customer) alongside response.usage at call time, since the export carries no per-call labels.
In Costory: GPT models are most often consumed through Azure OpenAI, where the spend already lands via the Azure connector as Azure OpenAI (Cognitive Services) charges, split by deployment and region. OpenAI’s direct platform is not a native connector today, so for direct API usage, attribute it with projects and the Usage and Cost API.
Azure OpenAI / Foundry
Available: Azure has the richest native model. Costs carry resource, deployment, and user-defined tags, you can group cost by model deployment, and Microsoft added project-level chargeback (preview) that auto-tags every Foundry project. Naming a deployment per use case (one for support, one for document processing) makes deployment-level cost equal to cost per feature. In Costory: the Azure connector ingests Azure Cost Management data, including Azure OpenAI (billed under Cognitive Services). Costory detects the deployment and user-defined tags as dimensions for the team or use-case split.AWS Bedrock
Available: Bedrock has no per-call labels. Instead, AWS records the caller identity (IAM role or user) on every Bedrock line in the Cost and Usage Report. Per the AWS guide, you tag your IAM principals, activate those cost allocation tags, and enable caller-identity allocation in a CUR 2.0 export, which adds aline_item_iam_principal column. It breaks when calls route through a shared gateway role, and AWS sub-accounts per team are a heavier alternative than a GCP project.
In Costory: the AWS connector ingests the CUR including line_item_iam_principal and your cost allocation tags, so once the export option is on, the per-team split flows in automatically.
GCP Vertex AI
Available: Vertex recently added custom metadata labels on each API call, the most granular option, though wiring a label into every call through the Python SDK is work to roll out and keep consistent. The simpler path, used by a Costory customer, is one GCP project per team. In Costory: the GCP connector ingests the project and all resource labels from the billing export, so either approach maps onto a team dimension.Mistral
Available: Mistral bills per workspace and scopes API keys to a workspace, with per-workspace usage and spending caps in the admin panel. The natural unit is one workspace per team or environment. In Costory: Mistral is most often run through AWS Bedrock or Azure, and that spend reaches Costory via the AWS and Azure connectors (publisher Mistral AI). Mistral’s direct platform is not a native connector today.Implementation examples per provider
Anthropic: API key per team
Create separate API keys in the Anthropic console, one per team. Name them for clarity (the name shows in billing):Azure OpenAI: Deployment names and resource tags
Create separate deployments per team or feature. The deployment name itself is part of the URL and automatically appears in billing. Follow Azure’s cost management guidance to tag and allocate: Create deployments in Azure:search-gpt4) automatically tags the cost in Azure billing. Resource-level tags (team, environment) appear in Cost Management. Costory ingests the deployment name and tags as dimensions for team-level allocation.
AWS Bedrock: Separate IAM roles per team
Create one IAM role per team. Each application assumes its team’s role to call Bedrock. AWS records which role made the call: Create separate roles:line_item_iam_principal) for every Bedrock call. Costory ingests the ARN and its tags to allocate costs by team.
GCP Vertex AI: Per-call metadata labels
Pass labels on every API call. This is the most granular approach:Mistral: Workspace per team
Create a workspace in Mistral for each team. Each workspace has its own billing and API keys:Track and allocate LLM costs across providers in Costory
Each provider hands you a different key: an API key, a project, a deployment, an IAM principal, a label, or a workspace. On their own they live in separate billing consoles. You can stitch them together yourself by exporting each provider’s cost data, normalizing it, and maintaining the mapping in your own warehouse, but that is a pipeline to build and own. It is easier and more reliable to do it in Costory. Costory has native billing connectors for Anthropic, AWS, Azure, and GCP and normalizes them into one schema. From there, you build a single virtual dimension (call itteam, product, or customer) with one rule per source that maps its native key to the right owner. This unified view becomes your source of truth for chargeback and cost per token attribution.
The result is one
team axis spanning every connected source. Spend re-allocates automatically as new keys, projects, or deployments appear, with no manual updates, and the same dimension feeds chargeback, budgets, and reports.
In practice, most teams consume these models through the clouds: GPT through Azure OpenAI, Claude and Mistral through Bedrock or Azure. That spend already flows into Costory through the AWS, Azure, and GCP connectors, with the cloud’s own attribution (deployment, IAM principal, project, label). The direct OpenAI and Mistral platforms are not native connectors yet; track those with the provider methods above, or contact us about your setup.
Build the cross-provider dashboard with the MCP
Once the data is unified, you do not have to assemble the dashboard by hand. Connect the Costory MCP to Claude, Cursor, or any MCP client and ask for it in plain language:“Build a dashboard of our LLM cost across all connected AI sources (Anthropic, Azure OpenAI, Bedrock, Vertex). Total cost over time by provider, a breakdown by model, and a split by team using our team dimension.”The assistant works out the scope across providers, builds the widgets, and saves the dashboard for you to review and adjust. You can keep asking for the cuts you need (“split the Bedrock cost by IAM principal”, “compare this month to last by team”) and it runs them without you rebuilding queries.
What LLM cost management looks like once spend is allocated
With one cross-provider, team-level view in place, the AI bill becomes something you can manage and report on:Measure adoption
Track which teams and products use AI most, and how fast usage is growing. Rising spend is usually adoption, and now you can show it per team.
Budget per team
Set an AI budget on the team dimension and track burn against it.
Alert on spend
Fire a Slack or email alert when a team’s daily AI cost crosses a threshold, before month-end.
FAQ
How do you allocate OpenAI or Anthropic costs across teams?
How do you allocate OpenAI or Anthropic costs across teams?
Each LLM provider offers a native mechanism: OpenAI uses projects and the Usage and Cost API. Anthropic uses API keys and the Cost and Usage API. The simplest approach is one API key (Anthropic) or project (OpenAI) per team. This isolation puts the split directly in the billing data. For finer attribution (cost per feature or per customer), use Costory’s virtual dimensions to map provider keys and projects to logical owners, then apply cost-allocation rules.
What is LLM cost allocation and why does it matter?
What is LLM cost allocation and why does it matter?
LLM cost allocation is the process of assigning shared AI spend to the teams, products, or customers that generated it. Your LLM provider sends one bill, but multiple teams consume from one API key or account. Without allocation, each team sees only the total company spend, not their contribution. Allocation enables chargeback (billing teams for their usage), budget enforcement (per-team cost caps), and accurate unit economics (cost per token, cost per customer). Costory automates this by ingesting each provider’s billing data and applying your allocation rules across all sources at once.
How do you track LLM costs by team?
How do you track LLM costs by team?
Track LLM costs by team by isolating each team’s usage into its own provider signal, then reading it back from billing: one Anthropic API key, one OpenAI project, one Azure deployment, one Bedrock IAM role, or one Vertex label per team. Each provider stamps the team onto its own billing lines, so the split lands in the data with no per-call code. Costory ingests all of these into a single
team dimension, so you track spend by team across every connected provider in one view instead of stitching consoles together.What is the difference between showback and chargeback?
What is the difference between showback and chargeback?
Showback is visibility: teams see their own costs in a dashboard or report, but no bill is exchanged. Chargeback is billing: each team receives an internal invoice for their share of the AI bill based on allocation rules. Showback is a prerequisite for chargeback and helps teams make cost-conscious decisions even without internal billing. Both require cost allocation; chargeback is a stronger accountability mechanism.
How do you calculate cost per token for each team?
How do you calculate cost per token for each team?
Cost per token combines billing data (total cost per provider and model) with usage data (token counts). Most LLM providers expose token counts in their billing API or usage dashboard. Divide your team’s total cost by their total tokens consumed to get cost per token. This metric shows which teams are getting the most efficiency from their AI spending and helps identify runaway prompts or inefficient model usage. Track this in Costory by building a formula that divides your cost query by a usage metric from your provider’s telemetry.
Can you split per-customer AI cost?
Can you split per-customer AI cost?
Yes. Per-customer attribution follows the same pattern as per-team. If you have one API key shared across customers, instrument your API calls to log customer ID, then ingest those logs into Costory as a usage metric or custom dimension. Map that customer data to your billing costs. Costory then allocates the AI bill by customer, enabling per-customer unit economics (cost per customer request, cost per customer feature). This is especially important for platforms or SaaS products where AI is part of the offering you charge for.
Next steps
- Connect each provider from Billing Data.
- Build your cross-provider allocation virtual dimension.
- Use the Costory MCP to build and investigate your AI cost in natural language.
