# How to track LLM cost in Python > Culpa's Python SDK reports the raw provider response to a local server. Your API key never travels, only a fingerprint, and capture adds no tokens. URL: https://getculpa.com/track-llm-cost-python Last reviewed: 2026-08-02 ## Answer Culpa's Python SDK reports the raw request and response to a Culpa server on your own machine, which prices them exactly as it prices a call captured on the request path. Your provider key never travels, because the SDK sends a local fingerprint instead. Culpa, a local-first LLM cost, margin, and forecast ledger, meters every reported call without adding a single token to your bill. ## Why this happens Measuring an AI product usually means one of two trades: route your traffic through something, or send your data somewhere. In-process reporting avoids both. Your application still calls the provider directly, so nothing sits in the request path and nothing changes about latency or failure modes. What travels is a report to a server on your own machine, and the credential that authorised the call is reduced to a fingerprint before it leaves the process. Capture itself makes no model calls, so measuring costs nothing. ## What this usually looks like - A measurement plan stalled because nobody would approve traffic leaving the network. - Your team wants attribution but the request path is considered untouchable. - Cost tooling was rejected on the basis that it needs a copy of your API key. - Nobody can say what the measurement layer itself costs per month. ## Common mistakes - Assuming any cost tool needs your provider key. Why it hurts: It rules out measurement on the basis of a requirement that doesn't apply here. Do instead: Check what the tool actually sends. A fingerprint identifies a key without being one. - Letting the measurement layer make its own model calls. Why it hurts: You then pay tokens to find out what you're paying in tokens, and the cost scales with traffic. Do instead: Prefer capture that reads what already happened over anything that asks a model about it. - Wiring capture into a path where a failure blocks the call. Why it hurts: A measurement outage becomes a product outage, which is how measurement gets removed. Do instead: Use a reporter that returns a value on failure instead of raising, and confirm that in a test. ## Self-check - Confirm what leaves your process during capture, field by field. - Check that your provider key is fingerprinted rather than forwarded. - Count the model calls your measurement layer makes. It should be none. - Force a capture failure in staging and confirm the host call still succeeds. - Compare a call captured in-process against the same call captured on the request path. ## What measurement costs, and what a key looks like when it doesn't travel (illustrative) A service making 1.5 million calls a month on GPT-5.4 at real rates of $0.0025 per 1k input and $0.015 output, each sending 3,000 input tokens and returning 500. Volumes are modelled. Per call: (3 x $0.0025) + (0.5 x $0.015) = $0.0075 + $0.0075 = $0.015 Monthly provider spend: 1,500,000 x $0.015 = $22,500 Model calls added by capture: 0, because the SDK reports rather than asks Cost of measurement in provider tokens: 0 x $0.015 = $0.00 The same call captured on the request path prices identically, so the two paths reconcile to the cent Measurement adds nothing to the bill it measures, which is the property that lets you capture 100% of traffic rather than sampling it. A sampled ledger can't name your most expensive conversation. ## Cost figures Every figure carries its confidence and its source. No figure on this site is provider-reported. - $0.00 — provider tokens added by capture itself, at any traffic volume [calculated] Source: The SDK reports an already-completed call and makes no model call of its own, so the token count it adds is zero. - $22,500 — modelled monthly provider spend the capture layer measures without adding to [calculated] Source: 1,500,000 calls x $0.015, using real GPT-5.4 rates per 1k from the price book, effective 2026-07-02. Call volume and token counts are modelled. ## FAQ Q: Does the Python SDK send my provider API key anywhere? A: No. It computes a fingerprint locally, a short hash of the key rather than the key itself, and sends that. The fingerprint matches the format the request path uses, so calls captured either way group under the same credential. Q: Does capture add cost or latency? A: It adds no model calls, so it adds nothing to your provider bill. Your application still calls the provider directly, so the request path is unchanged and the report happens alongside it rather than in front of it. Q: What happens if Culpa is down when a call is reported? A: The reporter returns a failure value rather than raising, so your application carries on. That's a contract rather than a best effort, and it's the reason capture can be enabled everywhere instead of on a sample. ## Sources - OpenAI API pricing: https://developers.openai.com/api/docs/pricing Run the free Cost Leak Scan: https://app.getculpa.com/scan?source=pseo&slug=track-llm-cost-python&cluster=integration Machine-readable index of every guide: https://getculpa.com/api/pages Human-readable index of every guide: https://getculpa.com/guides Site overview: https://app.getculpa.com/llms.txt Privacy: Culpa runs on your infrastructure. Your prompts and responses never leave it. Culpa counts calls to run your plan, and it fails open, so if it ever breaks your app keeps running.