# Cross-Model LLM Pricing API

> Source: <https://www.metergraph.dev/pricing-api/>
> Published: 2026-10-29 21:36:05+00:00

Add per-call LLM costs to this project using Metergraph's free Pricing API. No account, API key or SDK is needed.
Read https://www.metergraph.dev/docs/reference/pricing-api/ for the contract. Find where this project receives model and usage data, including final usage for streamed responses. Keep the existing provider clients.
From server-side code, use POST https://app.metergraph.dev/v1/pricing/calculate with a JSON body containing a trace object. The API has no browser CORS support. For a browser-only project, explain the backend route it needs.
Send model, usage and billing metadata without prompt or response text. Keep the provider's response format or set format as the docs describe. Include billing channel, region and service tier only when known; gateway rates can differ from direct provider rates.
Record the cost and breakdown using this project's conventions. Keep decimal precision and distinguish priced, partial and unpriced results. Never treat missing costs as zero. Use bounded timeouts and respect Retry-After. Pricing failures must not break the LLM call.
Test with synthetic usage and run the relevant project checks. Show what changed and where the costs appear.
