FAQ
Answers about latency, prompts, self-hosting, framework support, cost accuracy, and behaviour during a Capsera outage.
Will this slow down my application?
Capture does not. The work is building a small object and putting it on a queue, well under a millisecond at the median, and nothing in your call path waits for delivery. The evaluation harness enforces a median-overhead threshold on every run.
Budget enforcement does, because it performs a round trip to the backend before each call, and it is on by default. To disable it:
capsera.init(api_key=..., enable_budget_enforcement=False)
What happens if Capsera is unavailable?
Your application continues working. The emitter retries three times, opens a circuit breaker after five consecutive failures, and drops events rather than growing memory. Routing falls back to the original model and budget checks time out and allow the call. See Reliability.
During an outage you lose telemetry rather than throughput.
Do you receive my prompts?
No. Prompt text, completions, tool arguments, and tool results are never transmitted. Exception messages are also excluded, because providers often quote the prompt in them. Optional prompt analysis records structure such as token estimates, message counts, and a one-way hash of the system prompt.
This is enforced by a test that plants canary strings in prompts and fails the build if one appears in any emitted payload. See Privacy.
Can I self-host?
Yes. Set endpoint to your own deployment. The SDK has no hardcoded destination and no
secondary telemetry channel.
Do I need a separate integration for LangChain, CrewAI, or LlamaIndex?
No. Frameworks call the provider clients the SDK patches, so their calls are recorded
with no extra setup. Optional helpers (langgraph_node, crewai_agent, crewai_task)
exist to attach attribution to a node or agent. See
Frameworks.
Does import order matter?
No. The patch is applied to provider classes, so a client constructed before init() is
still recorded. A call that executed before init() ran is not.
Is init() safe to call twice?
Yes. It is idempotent and guarded per class, so it cannot record a call twice. Re-initialising flushes the previous emitter rather than losing queued events.
Why is some spend attributed to unknown?
The call was recorded but had no attribution scope. Set agent_name in init() to give
those calls a name. See
Agents.
How accurate is the cost?
Token counts come from the provider's response and are never estimated. Arithmetic uses
Decimal to avoid drift across large event volumes. Cost is therefore as accurate as
the pricing catalog, which is verified against provider pricing pages.
Expect two differences from an invoice: timing, because Capsera records at call time and providers bill on their own cycle, and failed calls, which are recorded at zero cost but may have consumed billable tokens. A model missing from the catalog is priced with a fallback estimate and logs a warning. See Cost and pricing.
Which Python versions are supported?
3.11 and later. The only runtime dependency is httpx.
Does it work with a gateway such as LiteLLM?
Yes. LiteLLM dispatches through the real provider clients, so its calls are recorded, and caller attribution resolves past LiteLLM's internals to your code. See LiteLLM and gateways.
Can I use a self-hosted or fine-tuned model?
If it is served behind an OpenAI-compatible API, point the OpenAI client at it and calls
are recorded automatically. Otherwise use
record().
Is the SDK open source?
Yes, under Apache-2.0. Install it with pip install capsera.
How do I turn it off?
With the guard pattern, leave CAPSERA_API_KEY unset and the SDK stays inactive.
Otherwise remove the init() call. Every other API is safe without it: @agent(),
tag(), set_session(), and clear_session() all still work with nothing reading
them, and record() logs that it was called before init() and drops the event rather
than raising.