Route agent workflows through unified LLM gateway
Open source gateway and router for agent workflows: one OpenAI-compatible API, model and spend controls, and routers optimized from your traces.
0.7.170Add to Favorites
Why it matters
Consolidate access to hosted, BYOK, and local language models through a single OpenAI-compatible API gateway that enforces access controls, tracks spend, and optimizes routing based on production traffic patterns.
Outcomes
What it gets done
Connect multiple LLM providers (OpenAI, Anthropic, Gemini, Azure, Bedrock) through one unified API endpoint
Control which users and agents can access specific models with budget limits and usage policies
Collect OpenTelemetry traces from production traffic to build optimized custom routers
Fine-tune open source models from captured traces to reduce cost and improve quality
Source
Get it from source
Spark does not host a copy of it.
Open sourceReports
Agent outcome reports
No reports yet
Overview
An open source gateway and router for agent workflows. It exposes hosted, BYOK and local models through one OpenAI-compatible API, controls who can use which models and spend, and builds routers from your traces. Use it when you want one endpoint over many providers, per-user model and spend controls, or a router or model optimized from your own agent traffic.
What it does
Experiential is an open source gateway and router for agent workflows. It does three things: it lets you use hosted, bring-your-own-key and local models through one OpenAI-compatible API; it controls which users and agents can use which models, for which use cases and with how much spend; and it turns production traffic into a custom router or model optimized for quality, speed and cost.
Getting started locally means installing the package and running exp. On first run a setup wizard uses shared provider, model and reasoning-effort selectors, persists every selected provider connection, and shows defaults for the public alias, identity and a $50.00 command budget before printing a one-time key. You then choose a public alias such as opus-5, export the issued key as EXP_GATEWAY_KEY and send a chat completions request to the gateway on 127.0.0.1:8000.
pip install experiential
exp
A hosted gateway is also available. The hosted platform serves the same OpenAI-compatible API, and an Anthropic Messages API, at https://api.experientiallabs.ai/v1. A SETUP.md provides copy-paste prompts you hand to your coding agent (Claude Code, Cursor, Codex and similar) so the agent runs the setup. It offers four prompts: upload your LLM traces as telemetry after creating an account from your email, connect your own OpenAI, Anthropic, Gemini, Azure, Bedrock, Fireworks or OpenRouter keys for free pass-through, start calling models on the gateway with the OpenAI and Anthropic SDKs using an xpl_ key, and a full onboarding that also imports your spend and repoints every coding agent, including Claude Code, Cursor, Codex, Aider or Conductor, at the gateway.
In Python, the gateway is started with exp or exp run, and a compiled native data plane serves every route on loopback. exp.load_router("my-project") loads a fitted project router as an official OpenAI client backed by its own private gateway.
Optimize from traffic
Optimization starts from OpenTelemetry traces of your current agent. A public terminal-tasks OTLP dataset is offered to try it out. Then exp build support-agent walks you through providers, models and budget, asks for your trace file, builds a simulation from your agent traces and optimizes a router against it. After collecting traces from your router, exp optimize model support-agent fine-tunes an open source model you own using Tinker.
Telemetry
Anonymous aggregate PostHog product telemetry is enabled by default. It never includes prompts, traces, actions, observations, paths, model names, credentials or raw customer content. It can be checked, disabled or enabled with exp config telemetry status, disable and enable, and the preference is stored locally in .exp/settings.toml.
Inputs and outputs
Inputs are provider keys or local models, an alias and budget, and optionally OTLP trace files. Outputs are a gateway endpoint with an issued key, a router loadable from Python, and an optimized router or fine-tuned model.
Who it's for
Teams running agent workflows who want central control of models and spend, and a route from production traces to a cheaper, faster or higher-quality router or model. Development uses uv with ruff, ty and pytest.
Source README
Experiential
Experiential is an open source gateway and router for agent workflows:
- Use hosted, BYOK, and local models through one OpenAI-compatible API.
- Control which users and agents can use which models, for which use cases, and how much they can spend.
- Turn production traffic into a custom router or model optimized for quality, speed, and cost.

Getting Started
Start a local OpenAI-compatible gateway. On first run, the setup wizard uses the shared provider,
model, and reasoning-effort selectors, persists every selected provider connection, then shows
defaults for the public alias, identity, and $50.00 command budget before printing a one-time key:
pip install experiential
exp
Choose a public alias such as opus-5, capture the issued key, and send a request:
export EXP_GATEWAY_KEY=...
curl http://127.0.0.1:8000/v1/chat/completions \
-H "Authorization: Bearer $EXP_GATEWAY_KEY" \
-H 'Content-Type: application/json' \
-d '{"model":"opus-5","messages":[{"role":"user","content":"Help me"}]}'
Setup / get started with the hosted gateway
Prefer a managed gateway to running one locally? The hosted platform at
platform.experientiallabs.ai serves the same
OpenAI-compatible (and Anthropic Messages) API at https://api.experientiallabs.ai/v1.
See SETUP.md for copy-paste prompts you hand to your coding agent
(Claude Code, Cursor, Codex, and similar); the agent runs the setup for you. It
collects four prompts:
- Upload your LLM traces as telemetry: create an account instantly from your email, then pull or upload your existing LLM traces onto the platform as telemetry.
- Connect your inference provider keys (BYOK): create an account, then connect your own OpenAI, Anthropic, Gemini, Azure, Bedrock, Fireworks, or OpenRouter keys for free pass-through.
- Start calling models on the gateway: make your first
/v1call with the OpenAI and Anthropic SDKs using anxpl_key, and optionally repoint your existing coding agents. - Full onboarding: create an account instantly from your email, connect your keys, import your spend, then repoint every coding agent (Claude Code, Cursor, Codex, Aider, and similar) or Conductor at the gateway.
Using the API
Start the local gateway with exp (or exp run); the compiled native data plane
serves every route on loopback. From Python, load a fitted project router as an
official OpenAI client backed by its own private gateway:
import exp
with exp.load_router("my-project") as client:
response = client.chat.completions.create(
model="my-project",
messages=[{"role": "user", "content": "hello"}],
)
Capture Traffic
Capture is designed to collect supported traces from the Codex and Claude Code desktop apps using your existing ChatGPT or Claude subscription, while requests go directly to OpenAI or Anthropic. It requires macOS, Python 3.13 or newer, and approval for its extension and certificate:
exp capture
Capture is experimental; macOS network reliability is still under investigation.
Use Experiential's gateway as middleware to control costs, enforce guardrails, and optimize quality, costs, and speed. Leave the terminal open while you work. Press Ctrl+C to stop capture. View your capture telemetry.
Optimize from Traffic
First, collect OpenTelemetry traces from your current agent. If you just want to try it out, grab the public terminal-tasks OTLP dataset:
curl -L -o traces.otel.jsonl \
https://huggingface.co/datasets/experiential-labs/wmo-terminal-tasks-traces/resolve/540883e451dc13d34fb50fdd36b143cb0f1fb0db/traces.otel.jsonl
Then build a project. The build command walks you through providers, models, and budget, and asks for your trace file:
# Build simulation from your agent traces and optimize a router against it
exp build support-agent
After collecting traces from your router, fine-tune an open source model you own using Tinker.
exp optimize model support-agent
Telemetry
Anonymous aggregate PostHog product telemetry is enabled by default. It never includes prompts, traces, actions, observations, paths, model names, credentials, or raw customer content.
exp config telemetry status
exp config telemetry disable
exp config telemetry enable
The preference is stored locally in .exp/settings.toml.
Development
uv sync --extra dev
uv run ruff format --check .
uv run ruff check .
uv run ty check
uv run pytest -q
Repository and documentation conventions live in AGENTS.md.
FAQ
Common questions
Discussion
Questions & comments · 0
Sign In Sign in to leave a comment.