Skip to main content

airmux

airmux is a self-hosted gateway between your agents and their LLM providers. Change the client's base URL and API key and keep using Chat Completions, Responses, or Messages endpoints.

Production workspace usage dashboard showing spend, requests, tokens, cost per request, and a trend chart

Example Production workspace usage in the webapp, using synthetic data

For each request, airmux applies workspace policy, picks a provider credential, calls the model, and records tokens and cost. It replies in the caller's API format.

Quickstart

Run the full platform on one node. You need Docker with Compose 2.24.4+ and an API key for at least one provider.

curl -fsSLO https://github.com/michel-tricot/airmux/releases/latest/download/docker-compose.yml
docker compose up -d --wait

Open localhost:8080 and follow the setup steps. Then create a workspace and try Playground.

Or use the CLI:

docker compose exec app airmux quickstart --url http://localhost:8080

quickstart sets up your account and workspace, prints an inference key, and sends a real model request. Open localhost:8080 for the console, where the request appears with its model, tokens, and estimated cost.

Send an API request

Copy the key printed by the CLI. If you used the web app, create one under Inference Keys in your workspace. The example uses an OpenAI model. If you configured another provider, use one of its model IDs from the web app's Models page or the model reported by quickstart.

export AIRMUX_INFERENCE_KEY='sk-inf-your-key'
curl --fail-with-body http://localhost:8080/inf/v1/chat/completions \
  -H "Authorization: Bearer $AIRMUX_INFERENCE_KEY" \
  -H 'Content-Type: application/json' \
  -d '{"model":"openai/gpt-4o-mini","messages":[{"role":"user","content":"Say hello in five words"}],"max_completion_tokens":64}'

A successful response contains the answer in choices[0].message.content and token counts in usage. The request then appears under Requests in the web app. It calls your provider and is billed by that provider.

Use your existing client

Any client that can target one of airmux's HTTP APIs and send an inference key through Authorization: Bearer or x-api-key can connect. That includes SDKs, agent frameworks, CLIs, services, and raw HTTP integrations.

API Endpoint
Chat Completions POST /inf/v1/chat/completions
Responses POST /inf/v1/responses
Messages POST /inf/v1/messages
Model discovery GET /inf/v1/models and GET /inf/v1/models/{model_id}

For example, the OpenAI SDK just needs to be pointed it at /inf/v1 with an airmux inference key:

import os

from openai import OpenAI

client = OpenAI(
    base_url="http://127.0.0.1:8080/inf/v1",
    api_key=os.environ["AIRMUX_INFERENCE_KEY"],
)

response = client.chat.completions.create(
    model="openai/gpt-4o-mini",
    messages=[{"role": "user", "content": "Why use an LLM gateway?"}],
)

print(response.choices[0].message.content)

A Messages request can target an OpenAI-compatible model, and a Chat Completions request can target a Messages model. airmux translates the request and returns the response and errors in the caller's dialect. See the SDK guide for client examples.

Why airmux

  • Protocol-first clients: connect any SDK, agent framework, CLI, service, or raw HTTP integration
  • Policy at the gateway: compose model and provider allowlists, price ceilings, spending budgets, request limits, credential rules, denials, strict parameters, and fallbacks
  • Full feature translation: translate buffered and streaming requests, including tool calls, structured output, reasoning, images, and PDF inputs when the selected model supports them
  • Inference keys governance: virtualize and monitor inference keys for organizations, workspaces, users or specific agents
  • Agent ready management: manage the configurations with your agent through the CLI and service accounts
  • Predictable failover: retry eligible credentials and route to bounded backup models without escaping workspace policy
  • Outage-tolerant gateways: keep serving inference during a control-plane outage
  • Complete request records: capture tokens, cost, latency, status, credential scope, and every fallback attempt
  • Self-hosted platform: run the webapp, organizations and workspaces, live policy, and persistent usage history on your own infrastructure
  • Built-in observability: export operational metrics through OpenTelemetry (OTLP) or scrape with Prometheus

The shipped catalog includes 9 providers and 243 models across OpenAI, Anthropic, Cerebras, DeepSeek, Fireworks, Groq, Mistral, Together, and xAI. Model IDs, prices, context windows, modalities, capabilities, and parameter support are explicit, inspectable data in the taxonomy.

Gateway-only mode

A secondary path for one inference endpoint managed through local files, with no Docker, Postgres, console, or usage history. You need Python 3.13+, uv, and a provider key:

uv tool install airmux
export OPENAI_API_KEY='your-provider-key'
airmux gateway init
airmux gateway serve

init creates configuration, a model taxonomy, and a private inference key under .airmux/. Continue with the gateway-only guide.

Architecture

airmux separates mutable management work from the inference request path.

flowchart LR
  A[Application] -->|Inference key| G[Data plane]
  U[Operator] --> C[Console or CLI]
  C --> M[Control plane]
  M --> P[(Postgres)]
  M --> S[(Secret store)]
  M -->|Versioned bundles| G
  G -->|Cold secret resolution| S
  G -->|Provider request| L[LLM provider]
  G -->|Usage and health| M

Caller dialects and provider protocols cross through one canonical model, so adding a caller dialect costs one ingress adapter and adding a provider family costs one egress adapter.

Read the architecture guide for the full data flow, failure boundaries, and deployment shapes.

Documentation

I want to... Start here
Run airmux and see it working Quickstart
Connect an application Use an SDK
Control routing, access, and spending Workspace policies
Understand usage and cost Usage and activity
Deploy airmux Deployment overview
Deploy without Docker Linux host deployment
Customize a Docker deployment Docker Compose
Upgrade or roll back a deployment Docker Compose, without Docker, or separate services
Call the management API Management API
Work on the project Contributing and Development guide

The complete management API is generated from lib/api-spec/openapi.yaml.

Metadata

Release files for airmux 0.2.13

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for airmux 0.2.13
File Size Uploaded
airmux-0.2.13.tar.gz 230.9 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for airmux 0.2.13
File Interpreter ABI Platform
airmux-0.2.13-py3-none-any.whl Python 3 none any Details

Total release size: 559.2 kB

Release files / airmux-0.2.13.tar.gz

Download URL airmux-0.2.13.tar.gz
Size 230.9 kB
Tags Source
SHA-256 checksum
How to use checksums
7585d53bc3169e17161ea97c83bf3641806de628fc403fd01d6221872e719471
BLAKE2b-256 checksum
How to use checksums
d81606a9fd5071148d40b65748cc1bd8cfb15a77c68dbfcbb229b612e23d089b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 1, 2026.

Transparency log

Release files / airmux-0.2.13-py3-none-any.whl

Download URL airmux-0.2.13-py3-none-any.whl
Size 328.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
e9110792e80a040d6a9dacd8e04974dd61b49b7bd1f7d024c84bee7e4b53aa60
BLAKE2b-256 checksum
How to use checksums
486d988274438bc296f2040c7a5645a96247c42820fde4ca9674b5344597572f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 1, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

0.2.13 This release

2 release files

0.2.12

2 release files

0.2.11

2 release files

0.2.10

2 release files

0.2.9

2 release files

0.2.8

2 release files

0.2.7

2 release files

0.2.5

2 release files

0.2.3

2 release files

0.2.0

2 release files

0.1.2

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page