basic

command
v0.0.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 13, 2026 License: MIT Imports: 20 Imported by: 0

Documentation

Overview

Example_basic demonstrates a basic proxy setup with multiple providers. Providers are configured from standard environment variables.

Usage:

export OPENAI_API_KEY=sk-your-key
export MODELS_DEV_JSON=/path/to/models.json  # optional, for billing
go run main.go

With OpenTelemetry tracing:

otelExporter, _ := otlptracehttp.New(ctx)
tp := tracesdk.NewTracerProvider(tracesdk.WithBatcher(otelExporter))
defer tp.Shutdown(ctx)
otel.SetTracerProvider(tp)
# Then run the example - traces will be propagated upstream

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL