Back to Research

Experiential’s Open Model Gateway for Agents

Experiential is an open model gateway for agents, with routing, budgets, and one Codex CLI workflow to test it safely.

A Gray, Lowery Day, landscape painting by George Inness (1877).
Rogier MullerAugust 28, 202610 min read

Experiential, from Experiential Labs, is an open source model gateway and router for agent workflows. It deals with the boring but expensive problem of running hosted, bring-your-own-key, local, and custom models behind one API without rewriting every agent. The useful takeaway is simple: a gateway can make model choice observable and repeatable, but only if you test it with the same verification loop you use for code.

Experiential is a control plane for models: it lets agents call many providers through OpenAI-compatible and Anthropic Messages-style APIs while applying identities, permissions, budgets, and routing rules. That matters for OpenAI Codex, OpenAI’s coding agent, because many real Codex CLI workflows already depend on fast model swaps, cost ceilings, and clean receipts after a command runs.

Understand what Experiential is actually shipping

Experiential is not another chat app. It is the layer between an agent and the model provider.

The project’s README describes three jobs: use hosted, BYOK, and local models through one API; control which users and agents can use which models and budgets; and turn production traffic into a custom router or model tuned for quality, speed, and cost. As of August 28, 2026, the GitHub repository showed 660 stars, an Apache-2.0 license, and active work.

The Show HN pitch landed because developers have felt this pain in small, sharp ways. One model streams tools as one shape. Another returns errors differently. A third accepts a reasoning knob with a provider-specific name. Your agent code slowly fills with adapters, retries, and special cases.

Experiential’s bet is that those quirks belong in the gateway, not in every coding agent. The author also claimed very low gateway overhead: under 1 ms for BYOK requests and under 2 ms when Experiential supplies the provider key. Treat those as project claims until you measure them in your own path, but the design goal is clear: keep routing out of the hot path as much as possible.

The trap is thinking “one API” means “all models behave the same.” It does not. Tool calling, context limits, caching, latency, and error recovery still differ. A gateway can normalize the request surface; it cannot make every model equally good at editing a brittle migration file.

Notice why agent developers cared

The HN reaction was not only excitement about another open source router. The practical question was: can this replace the pile of glue code people already maintain around LiteLLM-style gateways, OpenRouter-style provider access, and local inference experiments?

That is a fair question. Experiential’s public framing leans hard into agent workflows rather than general application inference. It talks about command budgets, identities, model aliases, and setup prompts for coding agents such as Claude Code, Codex, Codex, and similar tools.

A concrete example: you might expose a public alias named repair-fast to a coding agent. Behind it, the gateway can point at a cheap model for broad search, a stronger frontier model for final patch synthesis, or a custom router once enough traffic exists. The agent keeps asking for repair-fast; the gateway owns the policy.

That is interesting for Codex CLI users because the CLI workflow already has a natural boundary: prompt, inspect diff, run tests, accept or reject. A model gateway fits best when it sits behind that boundary and gives you better routing data without changing how you review code.

The trap is hiding model changes from reviewers. If a PR was generated through repair-fast, the receipt should say what actually handled the important calls. Alias names are helpful for ergonomics, but they are not enough for debugging.

Take the caching objection seriously

The strongest objection in the thread was about caching. If you stay on one model from one provider, cached input tokens can save real money. If a router bounces the same long context across several models, you may lose that cache benefit and accidentally pay more for “optimization.”

That concern is not theoretical. Coding agents often resend large files, repository maps, test output, and prior tool traces. Cache behavior can dominate cost once prompts get long.

A safe pattern is to separate exploration from expensive context. Let cheaper or local models handle repo search, summarization, and candidate planning. Keep the long, cache-sensitive patch loop on one provider and one model until you have data showing the router wins.

For Codex, that can be as simple as keeping your serious edit command pinned while you experiment elsewhere:

# AGENTS.md

## Model routing rule
- Use the gateway alias `codex-search` only for repository search, issue triage, and summarization.
- Use the pinned editing model configured in Codex CLI for code changes touching migrations, auth, billing, or data deletion.
- After any gateway-routed task, write the model alias, final provider/model if available, estimated spend, and tests run in the handoff note.

This is small, but it prevents a common failure: measuring quality while ignoring cache loss. A model router is most useful when the route is part of the experiment record.

Try it where Codex already has a clean loop

The best first experiment is not “put all agent traffic through the gateway.” It is one repeatable Codex CLI task where model choice is annoying today and verification is cheap.

Pick something like documentation fixes, failing unit test repair, or dependency upgrade notes. Avoid high-risk edits first: auth, payment code, destructive migrations, or anything that touches production data. You want quick feedback on routing behavior, not a dramatic incident report.

A simple Codex CLI verification loop looks like this:

# create a small branch for the experiment
git checkout -b try-experiential-doc-fix

# run your normal Codex CLI task against a narrow target
codex "Fix the broken docs examples in docs/cli.md. Keep changes minimal."

# inspect the patch before running anything expensive
git diff -- docs/cli.md

# run the repo's normal verification
npm test -- --runInBand
npm run lint

# write down the receipt
git status --short

If your Codex setup uses a gateway-compatible base URL or key, the exact wiring depends on your local configuration and the gateway setup path. The official Codex quickstart and Codex CLI docs are still the right place to verify the OpenAI side of the command flow.

The trap is testing routing with a task that has no crisp pass/fail. “Improve this module” is too vague. “Fix this failing test without changing the public API” gives the router a fair shot and gives you a real result.

For more Codex-specific workflow context, keep this experiment close to the related training topic. If you want the adjacent story about agent harnesses and repeatable runs, see Codex Opens Its Agent Harness.

Try it safely: a small fit table

Use Experiential when you need one place to observe and shape model traffic. Skip it when the gateway would add more moving parts than the project needs.

Situation Fit? Why
You run Codex CLI against one model and costs are predictable Not yet A direct setup is simpler and easier to debug.
You compare hosted, BYOK, and local models for the same agent tasks Yes A gateway gives you one API surface and better experiment records.
You need per-agent budgets or model permissions Yes Experiential explicitly targets identities, use cases, and spend limits.
You depend heavily on provider prompt caching Be careful Routing can erase cache savings unless you pin cache-sensitive loops.
You need maximum reliability for production code edits today Start narrow Test on low-risk Codex workflows before touching critical paths.

A tiny handoff receipt is enough for the first pass:

## Agent run receipt
- Task:
- Gateway alias:
- Final provider/model, if visible:
- Files changed:
- Verification run:
- Estimated spend or budget hit:
- Reviewer note:

The receipt matters because gateways make model behavior easier to change. That is power. It is also how mystery enters a repo.

Common questions

  • Is Experiential basically OpenRouter?

    Experiential is an open source gateway with OpenRouter-like goals, but its public pitch is more agent-workflow specific. The README emphasizes one API across hosted, BYOK, local, and custom models, plus identities, budgets, permissions, and turning production traffic into better routing or custom models.

  • How is Experiential different from LiteLLM?

    The honest answer is that overlap exists, and the best comparison needs hands-on testing. Experiential’s differentiators, based on its own description, are its agent workflow framing, command budgets, daily refreshed model catalog claims, and focus on using traffic to improve routing or model quality over time.

  • Will routing across models break prompt caching savings?

    Yes, it can. If a long Codex prompt benefits from cached input tokens on one provider, moving that same loop across models may raise cost even if each individual call looks cheaper. Pin cache-heavy edit loops first, then route lower-context search or summary tasks.

  • Should I put every Codex command behind a model gateway?

    No. Start with one low-risk, repeatable Codex CLI workflow where you can inspect the diff and run tests locally. A gateway is overkill when one model, one provider, and one bill already work cleanly.

  • What should I record from a gateway-routed agent run?

    Record the alias, actual provider and model if available, files changed, verification commands, and spend or budget impact. Those five fields turn a model-routing experiment into something you can compare later instead of a vague memory that one run “felt faster.”

Best ways to use this research

  • Best for: Developers already running agentic coding tasks across more than one model provider, especially when Codex CLI commands need repeatable budgets and receipts.
  • Best first artifact: Add a short AGENTS.md routing note and a handoff receipt before changing any gateway settings in critical repositories.
  • Best comparison angle: Compare one pinned-model Codex run against one gateway-routed run on the same failing test or docs repair, then inspect quality, latency, cache behavior, and total cost.
  • Best reason to wait: If your current OpenAI Codex setup is simple, cheap, and reliable, keep it boring until model choice becomes a real bottleneck.

Further reading

Next step

Try Experiential on one narrow Codex CLI task with a clear test command and a written receipt. If the router cannot beat your pinned setup on quality, cost, or debugging clarity, keep the simpler path.

One methodology lens

One useful way to read this through our methodology is the Plan step: delegate first-pass decomposition and dependency mapping, review the sequencing and assumptions, and keep ownership of scope and priorities. If that split is still fuzzy, the workflow usually is too.

Related training topics

Related research

Ready to start?

Transform how your team builds software.

Book a 15-minute sync