Agent Wire Proxy
A lightweight compatibility proxy that lets OpenAI Responses, OpenAI Chat Completions, and Anthropic Messages clients share OpenAI-compatible backends.
Use it when Codex expects /v1/responses, Claude Code expects Anthropic
Messages, or several model IDs need to route through one local proxy.
Install
python3 -m pip install agent-wire-proxy
Python 3.11 or newer is required.
Quick start
Create models.toml:
[proxy]
default_model = "example-model"
[[models]]
id = "example-model"
target = "http://127.0.0.1:8000"
upstream_api = "chat_completions"
api_key_env = "UPSTREAM_API_KEY"
aliases = ["claude-example-model"]
Provide upstream credentials outside version control:
export UPSTREAM_API_KEY="<your-upstream-api-key>"
Start the proxy:
agent-wire-proxy \
--listen 127.0.0.1:18009 \
--config models.toml
Check it:
curl -fsS http://127.0.0.1:18009/health
curl -fsS http://127.0.0.1:18009/v1/models
The package also exposes a reentrant Python API:
from agent_wire_proxy import serve
proxy = serve(config="models.toml", listen=("127.0.0.1", 0), block=False)
print(proxy.server_port)
# Later:
proxy.shutdown()
proxy.server_close()
Launch Codex or Claude Code
Choose an agent and model interactively:
agent-wire-tui
Or select them directly:
agent-wire-tui --agent codex --model example-model
agent-wire-tui --agent claude --model claude-example-model
Automation can request a secret-free launch contract without starting the agent:
agent-wire-tui \
--agent codex \
--model example-model \
--config /absolute/path/to/models.toml \
--launch-json
Run agent-wire-proxy --help or agent-wire-tui --help for all options.
Supported endpoints
| Method | Path | Purpose |
|---|---|---|
GET |
/health |
Health check |
GET |
/v1/models |
Model discovery |
POST |
/v1/responses |
OpenAI Responses |
POST |
/v1/chat/completions |
OpenAI Chat Completions |
POST |
/v1/messages |
Anthropic Messages |
POST |
/v1/messages/count_tokens |
Approximate token count |
Upstreams must expose OpenAI Responses or Chat Completions. Anthropic is supported as a client-facing API, not as an upstream API. Compatibility covers text, multi-turn messages, function tools, parallel tool calls, tool results, streaming events, and usage information. Provider-specific features are best effort.
Security
- Set
AGENT_WIRE_PROXY_CLIENT_API_KEYto authenticate non-health requests. - Keep upstream credentials in environment variables.
- Prompt and response content is omitted from logs unless
--log-contentis explicitly enabled. - Prefer a localhost binding; use an authenticated TLS reverse proxy for network exposure.
License
MIT License.
Metadata
Release files for agent-wire-proxy 0.2.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| agent_wire_proxy-0.2.0.tar.gz | 58.8 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| agent_wire_proxy-0.2.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 106.7 kB
Release files / agent_wire_proxy-0.2.0.tar.gz
| Download URL | agent_wire_proxy-0.2.0.tar.gz |
|---|---|
| Size | 58.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
57a7ab7f2636ac3fc1318ae89a5bb99672fbbe0912d8a487581ab74322e744c2
|
|
BLAKE2b-256 checksum How to use checksums |
c64c50ab13b4e1023bc4b47af44274b9ba3893fd388e7bd1f0b099612e5cff03
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.11.10
|
Release files / agent_wire_proxy-0.2.0-py3-none-any.whl
| Download URL | agent_wire_proxy-0.2.0-py3-none-any.whl |
|---|---|
| Size | 47.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
e6a12c3ee5ce52ebb4fb688344a49b1f5c098d073cf5ca15e31947ec9b53efeb
|
|
BLAKE2b-256 checksum How to use checksums |
8d823f9a7f919cb90286e05b09a5c9977ac45f6949d2a99451e9f245105f976f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.11.10
|