Skip to main content

Turn your agent CLI into an OpenAI-like service with chat and responses endpoints

Project description

AI Agent Proxy

ai-agent-proxy is a Python package that turns your agent CLI into an OpenAI-like HTTP service.

It exposes both:

  • the traditional chat endpoint: POST /v1/chat/completions
  • the Responses API endpoint: POST /v1/responses

It also includes:

  • the ai-agent-proxy CLI
  • a FastAPI server with a simple browser chat at GET /web
  • persistent local agent workspaces
  • automatic startup of the manager agent

What It Does

ai-agent-proxy runs your local agent backend behind an API shape that OpenAI-style clients can use.

You can use it to:

  • point chatbot clients at an OpenAI-compatible URL
  • expose a manager-backed assistant to Mattermost, Slack, or browser clients
  • keep agent state in persistent local workspaces under ~/.ai_agent_proxy
  • run a simple manager-first service without changing your core CLI workflow

Endpoints

The service supports:

  • GET /
  • GET /web
  • GET /health
  • POST /v1/chat/completions
  • POST /v1/responses
  • POST /agent-reply

GET / redirects to /web.

Installation

From source:

pip install .

For local development:

make install

CLI

Main commands:

  • ai-agent-proxy enable
  • ai-agent-proxy restart
  • ai-agent-proxy init <role>
  • ai-agent-proxy list
  • ai-agent-proxy status
  • ai-agent-proxy connect <agent> [working_dir]
  • ai-agent-proxy stop <role>

The service command is:

ai-agent-proxy daemon

Start The Service

Run from source:

make debug

Install and enable as a system service:

ai-agent-proxy enable --ip 0.0.0.0 --port 7011
ai-agent-proxy restart

By default the service starts the manager agent automatically.

Authentication

If AI_AGENT_PROXY_API_KEY is set, API requests must send:

Authorization: Bearer <your-key>

Traditional Endpoint

OpenAI-compatible chat completions:

curl http://127.0.0.1:7011/v1/chat/completions \
  -H 'Authorization: Bearer YOUR_KEY' \
  -H 'Content-Type: application/json' \
  -d '{
    "model": "manager",
    "messages": [
      {"role": "user", "content": "hello"}
    ]
  }'

Responses Endpoint

OpenAI Responses API style:

curl http://127.0.0.1:7011/v1/responses \
  -H 'Authorization: Bearer YOUR_KEY' \
  -H 'Content-Type: application/json' \
  -d '{
    "model": "manager",
    "input": "hello",
    "stream": false
  }'

Browser UI

Open:

http://127.0.0.1:7011/web

This UI is a simple chatbot routed to the manager agent.

Workspace Layout

Agent state is stored under:

~/.ai_agent_proxy/

Example:

~/.ai_agent_proxy/manager/
~/.ai_agent_proxy/engineer_alice/

Each workspace can include role instructions, memory, notes, control files, and logs.

Notes

  • the Python import package is ai_agent_proxy
  • the CLI command is ai-agent-proxy
  • the default systemd unit name is ai-agent-proxy.service
  • the API is manager-first: inbound requests are routed through the manager agent

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

ai_agent_proxy-0.1.0.tar.gz (20.7 kB view details)

Uploaded Source

Built Distribution

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

ai_agent_proxy-0.1.0-py3-none-any.whl (23.7 kB view details)

Uploaded Python 3

File details

Details for the file ai_agent_proxy-0.1.0.tar.gz.

File metadata

  • Download URL: ai_agent_proxy-0.1.0.tar.gz
  • Upload date:
  • Size: 20.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.14

File hashes

Hashes for ai_agent_proxy-0.1.0.tar.gz
Algorithm Hash digest
SHA256 ea9328e462b914d12309a5af1b8ae24137d955e3fecc9784ed69d751eb6a03b1
MD5 ad41599ef5f50dfc00ae293ddc989d96
BLAKE2b-256 f1ff3496c690296b3681e5ac400970dc8f9ea75d88ea9ccac6cb6b294f65f896

See more details on using hashes here.

File details

Details for the file ai_agent_proxy-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: ai_agent_proxy-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 23.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.14

File hashes

Hashes for ai_agent_proxy-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 f7b79958df562987ffc504a5e79518193248a19b6aa3f647db4a2c437dc514e0
MD5 29e8a8056287deaad3db6f7723bcc01b
BLAKE2b-256 4b22ec9ce724ca232d9fda07ca0a1d5c237f83e1e385feddddf7c4ca044eca2c

See more details on using hashes here.

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