[{"data":1,"prerenderedAt":193},["ShallowReactive",2],{"navigation":3,"\u002Fdocs\u002Fconcepts\u002Fpricing-database":54,"\u002Fdocs\u002Fconcepts\u002Fpricing-database-surround":188},[4,16,32,47],{"title":5,"path":6,"stem":7,"children":8,"icon":10},"Introduction","\u002Fdocs\u002Fgetting-started","1.docs\u002F1.getting-started\u002F1.index",[9,11],{"title":5,"path":6,"stem":7,"icon":10},"i-lucide-house",{"title":12,"path":13,"stem":14,"icon":15},"Quickstart","\u002Fdocs\u002Fgetting-started\u002Fquickstart","1.docs\u002F1.getting-started\u002F2.quickstart","i-lucide-rocket",{"title":17,"path":18,"stem":19,"children":20,"page":31},"Sdk","\u002Fdocs\u002Fsdk","1.docs\u002F2.sdk",[21,26],{"title":22,"path":23,"stem":24,"icon":25},"TypeScript SDK","\u002Fdocs\u002Fsdk\u002Ftypescript","1.docs\u002F2.sdk\u002F1.typescript","i-simple-icons-typescript",{"title":27,"path":28,"stem":29,"icon":30},"Python SDK","\u002Fdocs\u002Fsdk\u002Fpython","1.docs\u002F2.sdk\u002F2.python","i-simple-icons-python",false,{"title":33,"path":34,"stem":35,"children":36,"page":31},"Concepts","\u002Fdocs\u002Fconcepts","1.docs\u002F3.concepts",[37,42],{"title":38,"path":39,"stem":40,"icon":41},"Pricing database","\u002Fdocs\u002Fconcepts\u002Fpricing-database","1.docs\u002F3.concepts\u002F1.pricing-database","i-lucide-database",{"title":43,"path":44,"stem":45,"icon":46},"Budget guard","\u002Fdocs\u002Fconcepts\u002Fbudgets","1.docs\u002F3.concepts\u002F2.budgets","i-lucide-shield",{"title":48,"path":49,"stem":50,"children":51,"icon":53},"API & MCP","\u002Fdocs\u002Fapi-and-mcp","1.docs\u002F4.api-and-mcp\u002F1.index",[52],{"title":48,"path":49,"stem":50,"icon":53},"i-lucide-plug-zap",{"id":55,"title":38,"body":56,"description":182,"extension":183,"meta":184,"navigation":185,"path":39,"seo":186,"stem":40,"__hash__":187},"docs\u002F1.docs\u002F3.concepts\u002F1.pricing-database.md",{"type":57,"value":58,"toc":175},"minimark",[59,63,74,81,86,97,103,107,123,136,140,161,165,172],[60,61,62],"p",{},"Every cost number Margint shows is computed the same way:",[64,65,70],"pre",{"className":66,"code":68,"language":69},[67],"language-text","cost_microdollars = (input_tokens * input_cost_per_million\n                  + output_tokens * output_cost_per_million) \u002F 1,000,000\n","text",[71,72,68],"code",{"__ignoreMap":73},"",[60,75,76,77,80],{},"The interesting part is where ",[71,78,79],{},"*_cost_per_million"," comes from.",[82,83,85],"h2",{"id":84},"source-of-truth-litellm","Source of truth: LiteLLM",[60,87,88,89,96],{},"We mirror ",[90,91,95],"a",{"href":92,"rel":93},"https:\u002F\u002Fgithub.com\u002FBerriAI\u002Flitellm\u002Fblob\u002Fmain\u002Fmodel_prices_and_context_window.json",[94],"nofollow","LiteLLM's canonical pricing registry"," — the same MIT-licensed file used by 400+ open-source projects and proxy gateways. It covers 400+ models across OpenAI, Anthropic, Google, Mistral, Cohere, Bedrock, Azure, Groq, Fireworks, Perplexity, together.ai, and more.",[60,98,99,100,102],{},"LiteLLM updates it within hours of provider price announcements. We pull it on a schedule and publish snapshots at ",[71,101,39],{}," per release.",[82,104,106],{"id":105},"local-calculation","Local calculation",[60,108,109,110,113,114,117,118,122],{},"Both SDKs bundle a snapshot of the pricing database at install time. When you call ",[71,111,112],{},"track()"," without ",[71,115,116],{},"costMicrodollars",", cost is calculated locally — ",[119,120,121],"strong",{},"no network hop",". This means:",[124,125,126,130,133],"ul",{},[127,128,129],"li",{},"Your ingestion endpoint never blocks on a pricing lookup.",[127,131,132],{},"Offline \u002F airgapped deployments still get accurate cost numbers.",[127,134,135],{},"SDK-only \"local mode\" works without a Margint account (handy for development).",[82,137,139],{"id":138},"keeping-pricing-fresh","Keeping pricing fresh",[124,141,142,145,152],{},[127,143,144],{},"SDKs ship with pricing at build time. Reinstall to pick up new models or price changes.",[127,146,147,148,151],{},"The server uses the latest database on every ingest. If you pass an unknown model, we record token counts with ",[71,149,150],{},"cost_microdollars = 0"," and flag it in the dashboard.",[127,153,154,155,157,158,160],{},"Override locally by passing ",[71,156,116],{}," directly on ",[71,159,112],{},".",[82,162,164],{"id":163},"requesting-a-model","Requesting a model",[60,166,167,168,171],{},"We're happy to add models. Email ",[71,169,170],{},"hi@margint.dev"," with the provider name and a link to their pricing page.",[60,173,174],{},"Most new frontier models are priced by LiteLLM within 48 hours of release — usually we don't have to do anything.",{"title":73,"searchDepth":176,"depth":176,"links":177},2,[178,179,180,181],{"id":84,"depth":176,"text":85},{"id":105,"depth":176,"text":106},{"id":138,"depth":176,"text":139},{"id":163,"depth":176,"text":164},"How Margint computes cost from tokens, and how we stay in sync with provider price changes.","md",{},{"icon":41},{"title":38,"description":182},"3sxr-wNVYI1uUdY0vckqVzlrDzokwt-DdBEXFyPsQsY",[189,191],{"title":27,"path":28,"stem":29,"description":190,"icon":30,"children":-1},"margint — per-customer AI cost tracking for Python 3.10+.",{"title":43,"path":44,"stem":45,"description":192,"icon":46,"children":-1},"Stop a runaway customer from blowing up your AI bill.",1777838730393]