Skip to main content

Pure-Python Claude Code routing gateway

Project description

Emissary Router

Emissary Router is a local Claude Code gateway that routes each request to a supported model, keeps provider-specific caching intact, and records lightweight cost/cache telemetry.

Install

pip install emissary-router

With uv: uv pip install emissary-router.

This installs the er command. If a global install is blocked (an "externally-managed environment"), install inside a virtualenv — or use an isolated installer like pipx install emissary-router.

Then set up config and API keys:

er init

er init creates ~/.emissary-router/config.json and prompts for your keys (it skips any already in your environment), writing them to ~/.emissary-router/.env. Run it again any time to change a key. You can also just export the keys instead:

export EMISSARY_ROUTER_API_KEY=...
export ANTHROPIC_API_KEY=...
export OPENROUTER_API_KEY=...

Then run Claude Code through the router:

er code -- [claude args]

er code starts the local gateway automatically if it is not already running. The gateway keeps running after Claude Code exits; stop it with:

er stop

Installing from a clone instead? Run bash install.sh (editable install), then er init.

Dashboard

er code and er start open a local dashboard in your browser showing cost savings, recent requests, and per-session usage — plus a Settings tab to toggle models live:

http://127.0.0.1:8788/dashboard

It stays up while the gateway runs, so reopen the URL any time. See Dashboard.

Supported Models

Toggle models in ~/.emissary-router/config.json:

{
  "models": {
    "claude-sonnet-4.6": { "enabled": true, "provider": "anthropic" },
    "claude-haiku-4.5": { "enabled": true, "provider": "anthropic" },
    "gemini-3.1-flash-lite": { "enabled": true, "provider": "openrouter" }
  },
  "default": "claude-sonnet-4.6",
  "confidence": 0.8
}

Built-in models:

  • claude-sonnet-4.6 — Anthropic or OpenRouter
  • claude-haiku-4.5 — Anthropic or OpenRouter
  • gemini-3.1-flash-lite — OpenRouter

Set enabled: false to drop a model, and provider to choose how it's served. Users cannot add arbitrary upstream models in V1; model id and pricing are owned by the built-in catalog. See Configuration for details.

Docs

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

emissary_router-0.0.2.tar.gz (79.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

emissary_router-0.0.2-py3-none-any.whl (48.4 kB view details)

Uploaded Python 3

File details

Details for the file emissary_router-0.0.2.tar.gz.

File metadata

  • Download URL: emissary_router-0.0.2.tar.gz
  • Upload date:
  • Size: 79.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for emissary_router-0.0.2.tar.gz
Algorithm Hash digest
SHA256 1b2044a131d61f39cc508fdbb78a1439690fed27f3d9ebaf0a4c605d22540bba
MD5 b8880dc24cd5a9803caadf0b0f9913c9
BLAKE2b-256 f41a5183a770d8a6da58784599f17488b7b346fbe2ab9303096f7651f4d25b0d

See more details on using hashes here.

Provenance

The following attestation bundles were made for emissary_router-0.0.2.tar.gz:

Publisher: release.yml on Emissary-Tech/emissary-router

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file emissary_router-0.0.2-py3-none-any.whl.

File metadata

  • Download URL: emissary_router-0.0.2-py3-none-any.whl
  • Upload date:
  • Size: 48.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for emissary_router-0.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 c958334d722bfaaeb42d0e1fa802896da0d7bee1fd3199b9446e63928371f097
MD5 90de08097982b4ff12567825b0765ec7
BLAKE2b-256 a6b21af80392ea289b0dee38cdb8e4d4a423f07a3f818f6f4d15fd61f6ba1b62

See more details on using hashes here.

Provenance

The following attestation bundles were made for emissary_router-0.0.2-py3-none-any.whl:

Publisher: release.yml on Emissary-Tech/emissary-router

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page