| Crates.io | langfuse-client-base |
| lib.rs | langfuse-client-base |
| version | 0.3.0 |
| created_at | 2025-08-28 21:28:53.73827+00 |
| updated_at | 2025-09-19 10:59:13.141641+00 |
| description | Auto-generated Langfuse API client from OpenAPI specification |
| homepage | https://github.com/genai-rs/langfuse-client-base |
| repository | https://github.com/genai-rs/langfuse-client-base |
| max_upload_size | |
| id | 1814694 |
| size | 1,282,391 |
Auto-generated Rust client for the Langfuse API, based on the official OpenAPI specification.
[!WARNING] 🚀 Most users should use langfuse-ergonomic instead!
This is a low-level, auto-generated client intended as a building block for higher-level abstractions. The ergonomic wrapper provides:
- ✅ Simplified API with builder patterns
- ✅ Automatic batching and retries
- ✅ Environment-based configuration
- ✅ Better error handling
- ✅ OpenTelemetry integration
Only use this crate directly if you need:
- Raw access to all OpenAPI endpoints
- Custom retry/batching logic
- Minimal dependencies
[dependencies]
langfuse-client-base = "*" # See https://crates.io/crates/langfuse-client-base for latest version
This crate provides low-level API bindings. Most users should use the ergonomic wrapper instead.
use langfuse_client_base::apis::configuration::Configuration;
use langfuse_client_base::apis::ingestion_api;
let config = Configuration {
base_path: "https://cloud.langfuse.com".to_string(),
basic_auth: Some(("your-public-key".to_string(), Some("your-secret-key".to_string()))),
..Default::default()
};
// Use the API...
use std::env;
use langfuse_client_base::apis::configuration::Configuration;
let config = Configuration {
base_path: env::var("LANGFUSE_HOST").unwrap_or_else(|_| "https://cloud.langfuse.com".to_string()),
basic_auth: Some((
env::var("LANGFUSE_PUBLIC_KEY").expect("LANGFUSE_PUBLIC_KEY not set"),
Some(env::var("LANGFUSE_SECRET_KEY").expect("LANGFUSE_SECRET_KEY not set"))
)),
..Default::default()
};
For self-hosted Langfuse instances:
use langfuse_client_base::apis::configuration::Configuration;
let config = Configuration {
base_path: "https://your-domain.com/langfuse".to_string(), // Custom base path
basic_auth: Some(("your-public-key".to_string(), Some("your-secret-key".to_string()))),
..Default::default()
};
By default, this crate uses rustls for TLS, which provides:
For native TLS (OpenSSL on Linux, Schannel on Windows, Security Framework on macOS):
[dependencies]
langfuse-client-base = { version = "*", default-features = false, features = ["native-tls"] }
When building for Alpine Linux or other musl-based systems with native-tls:
RUN apk add --no-cache openssl-dev musl-dev
For fully static binaries with rustls:
RUSTFLAGS="-C target-feature=+crt-static" cargo build --release --target x86_64-unknown-linux-musl
This client is generated from the OpenAPI specification using Docker for reproducible builds.
# Generate client (always uses Docker)
./scripts/generate-openapi-client.sh
# Update to latest OpenAPI spec and regenerate
UPDATE_SPEC=true ./scripts/generate-openapi-client.sh
Licensed under either of:
This is auto-generated code. To make changes, please update the generation process or contribute to the main repository.