OPENAI COST TRACKING
OpenAI API Cost Tracking by Project
An OpenAI invoice tells you total usage; engineering teams often need to know which product, workload or release caused it. CostNerve is built around that attribution problem.
What problem does it solve?
- Cost by project and model
- Exact versus estimated labels
- Anomaly and budget signals
- Cross-provider project totals
What to check first
- Establish current spend, previous-period spend and forecast using the same scope.
- Use Input and output tokens by model and project as the first provider-specific check, then attribute spend by project or service. Leave uncertain cost unallocated instead of guessing.
- Rank the top cost drivers by absolute money and growth rate, then investigate the first few deeply.
- Attach every saving or budget action to an owner, expected impact and a verification date.
Metrics and signals that matter
- Input and output tokens by model and project
- Request count, retries and failed/repeated generations
- Usage by project/API key and the smallest available time interval
- Model mix changes, context growth, batch/background jobs and cache behavior
Likely causes
Deployment or configuration regression
A release can change request fan-out, runtime, memory, model choice, logging volume or cache behavior without obvious user-facing breakage.
Traffic, retries or loops
Legitimate growth, bots, retry storms and recursive/background loops can all multiply a normally cheap unit of work.
Billing dimension changed
For OpenAI, investigate Input and output tokens by model and project and Request count, retries and failed/repeated generations before assuming the total moved for a single reason.
How it works
From model usage to project cost
Usage is normalized into the same cost model as the rest of the stack, preserving provider evidence and confidence instead of mixing estimates with exact charges.
Investigate a spike
Explain My Bill is designed to surface the technical signals behind a change, including token volume and correlated project activity, without presenting correlation as causation.
Worked example with explicit assumptions
Illustrative alert: a project normally spends 20 USD/day. A reading of 35 USD is 15 USD and 75% above baseline. Check both the absolute increase and the percentage, and exclude incomplete days before escalating.
OpenAI project cost: reconcile usage before assigning money
Two applications share an OpenAI organization. A model-level usage total does not establish which application generated every request.
- Compare usage and cost records for the same UTC period, project identifier, model and currency; note the last complete interval.
- Attribute requests with reliable project keys or server-side tags; keep shared or unidentified usage in an unallocated bucket.
- Investigate token changes alongside request count, context size, cache behavior and retries; do not equate a token spike with a confirmed invoice increase.
Illustrative calculation: Hypothetical $100 usage estimate: $55 tied to project A, $25 to B and $20 with no reliable key. Attribution coverage is 80%; do not distribute the remaining $20 merely to make the chart total 100%.
Evidence boundary: The illustration is not an OpenAI price quote, an authenticated bill or evidence that a provider API exposed every project. API permissions and reporting delays can limit coverage.
Next decision: Improve project-key coverage before automating budget decisions based on per-project spend.
Frequently asked questions
Which OpenAI signals should I inspect first?
Start with Input and output tokens by model and project, Request count, retries and failed/repeated generations, Usage by project/API key and the smallest available time interval. Compare the same time window before and after the change so volume and unit-cost effects do not get mixed.
Does a budget alert stop spending?
No. A notification is not a spending cap. Verify delivery, data freshness and escalation separately. Any supported control must be explicitly enabled and its effect checked; read-only monitoring does not change infrastructure.
Should uncertain cost be forced into a project?
No. Keep it unallocated until tags, project IDs, resource IDs or another reliable signal justify attribution. False precision produces worse decisions than visible uncertainty.