langfuse-client-base
A low-level async Rust client for the Langfuse API: one function per operation and a type per
schema of Langfuse's published OpenAPI specification. The code
is generated by timvw-rust from the upstream spec; nothing is
patched afterwards. Requests go through timvw-rust-runtime, a
tower service (reqwest unless you replace it) with retries.
Most applications want langfuse-ergonomic, built on this crate, with batching, environment-based configuration and OpenTelemetry integration. Use this crate directly for raw access to every endpoint.
Quick start
use ;
# async
Key features
- Every endpoint of the spec, plus the published v3 bindings for self-hosted servers that still serve them (usage).
- Typed models and errors: unions decode by their tag, enums accept values the spec does not list yet, and error responses decode into a typed error per operation (usage).
- A tower client: retries of
429,408,5xxand failed connections honouringRetry-After, timeouts, logging, your own middleware, and per-call headers, query parameters or base URL (HTTP client). - rustls or native TLS, and WebAssembly (
wasm32-unknown-unknown) (platforms).
Documentation
| Page | What it covers |
|---|---|
| API reference (docs.rs) | Every operation and model |
| Usage | Configuration, self-hosted instances, legacy v3 bindings, errors |
| HTTP client | Retries, timeouts, middleware, per-call options |
| Platforms | Cargo features, TLS backends, musl and static builds, WebAssembly |
| Upgrading | What each breaking release changed, with migration notes |
| Generation | How the crate is generated and checked, and how to change it |
| Contributing | Where changes belong |
License
Licensed under either of Apache License, Version 2.0 or MIT license at your option.