langfuse-client-base 0.2.1

Auto-generated Langfuse API client from OpenAPI specification
Documentation

langfuse-client-base

Crates.io Documentation CI MSRV License

Auto-generated Rust client for the Langfuse API, based on the official OpenAPI specification.

⚠️ Note

This is a low-level, auto-generated client. For a more ergonomic API, use langfuse-ergonomic.

Features

  • Complete API coverage from OpenAPI specification
  • Async/await support with Tokio
  • Choice of TLS backend (rustls or native-tls)
  • Strong typing with serde

Installation

[dependencies]
langfuse-client-base = "0.1"

Usage

This crate provides low-level API bindings. Most users should use the ergonomic wrapper instead.

Basic Configuration

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...

Using Environment Variables

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()
};

Self-Hosted Instances

For self-hosted Langfuse instances:

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()
};

Generation

This client is generated from the OpenAPI specification:

./scripts/generate-openapi-client.sh

License

Licensed under either of:

Contributing

This is auto-generated code. To make changes, please update the generation process or contribute to the main repository.