Configuration

Configuration

Keys are read from the environment when not passed explicitly, matching the Anthropic and OpenAI SDK conventions.

Environment variables

VariablePurpose
ANTHROPIC_API_KEYAnthropic provider key
OPENAI_API_KEYOpenAI provider key
FLUXCOMPUTE_KEYFluxCompute key: enables telemetry
FLUX_TELEMETRY_URLOverride the telemetry endpoint
FLUX_GRAPH_EVENTS_URLOverride the graph-events endpoint

Client options

All FluxClient arguments are keyword-only:

OptionDefaultPurpose
anthropic_keyNoneAnthropic API key. Required for Anthropic models
openai_keyNoneOpenAI API key. Required for OpenAI models
fluxcompute_keyNoneEnables telemetry and the dashboard
baseline_modelmost expensiveThe model savings are compared against
telemetryTrueSet False to disable both channels entirely
content_captureFalseAlso ship response content. Requires telemetry and a key
providerauto-detectedForce "anthropic" or "openai"

The provider is auto-detected when only one key is given; if both are set, Anthropic is used unless you pass provider explicitly.

python
client = FluxClient(
    fluxcompute_key="flx_...",          # or FLUXCOMPUTE_KEY
    baseline_model="claude-opus-4-8",  # what savings are measured against
    provider="anthropic",
)

Close the client when you're done so buffered telemetry is flushed:

python
await client.close()

Wire contract

The format the SDK sends is documented and versioned in docs/telemetry-contract.md. See Telemetry & privacy for what is and isn't included.