Expand description
§spectracost
AI cost observability SDK for Rust. See the crate-level README for usage.
The SDK owns minimal HTTP clients for OpenAI and Anthropic under
openai and anthropic so callers get a one-line setup without
wrestling with a third-party crate’s builder types. Every call is
instrumented: we capture model, token counts, latency, and attribution
tags, then forward a UsageEvent to the Spectracost ingestion endpoint
in a background task.
Modules§
Structs§
- Attribution
- Per-call attribution overrides.
- Options
- Options for constructing a
Spectracostclient. - Spectracost
- The main client. Cheap to clone (inner state is
Arc’d). - Usage
Event - Wire format for a telemetry event. Matches
sdk/SPEC.mdexactly.
Enums§
- Error
- Errors returned by the SDK.
Constants§
- DEFAULT_
ENDPOINT - Default Spectracost ingestion endpoint.