Skip to main content

Multi-provider ACP to OpenAI-compatible proxy CLI

Project description

acp-to-api

PyPI version CI License: MIT

Multi-provider ACP proxy CLI that exposes OpenAI-compatible REST APIs backed by Agent Client Protocol subprocess providers.

Features

  • OpenAI-compatible API -- /chat/completions, Responses API, and Anthropic /v1/messages
  • Multiple providers -- Cursor, Kiro, Codex (via codex-acp), Claude Code (via claude-code-acp)
  • Runtime management -- add, remove, and reload providers without restarting
  • Daemon mode -- run as a background service with start/stop/status/restart
  • Auto-start -- install as a macOS launchd or Linux systemd service
  • Web dashboard -- embedded real-time trace viewer at /dashboard
  • Config hot-reload -- watches config file for changes and applies them automatically
  • XDG directories -- follows XDG Base Directory spec for config and state

Install

uv add acp-to-api

Or with pip:

pip install acp-to-api

For development:

git clone https://github.com/pingu1m/acp-to-api.git
cd acp-to-api
uv sync --dev

Requirements

  • Python 3.10 to 3.14
  • At least one ACP provider CLI installed (e.g. Cursor agent, kiro-cli, codex-acp, claude-code-acp)

This project uses the official ACP Python SDK.

Quick start

acp-to-api serve --config acp-to-api.toml

Or with inline provider JSON:

acp-to-api serve --provider '{"name":"cursor","command":"agent","args":["acp"]}'

Configuration

Example acp-to-api.toml:

port = 11434
host = "127.0.0.1"

[providers.cursor]
command = "agent"
args = ["acp"]

[providers.kiro]
command = "kiro-cli"
args = ["acp", "--trust-all-tools"]

If no config file exists, acp-to-api creates a starter config at ~/.config/acp-to-api/config.toml on first run.

OpenAI client example

from openai import OpenAI

client = OpenAI(
    base_url="http://127.0.0.1:11434/api/v1/cursor/openai",
    api_key="unused",
)

resp = client.chat.completions.create(
    model="cursor",
    messages=[{"role": "user", "content": "Say hello in one sentence."}],
)

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

Daemon mode

acp-to-api start --config acp-to-api.toml   # background
acp-to-api status
acp-to-api stop
acp-to-api restart --config acp-to-api.toml

Install as a system service (auto-start on boot):

acp-to-api setup --config acp-to-api.toml   # macOS launchd / Linux systemd
acp-to-api setup --uninstall

Dashboard

Open http://127.0.0.1:11434/dashboard to see live trace events, manage providers, and inspect request/response payloads.

Raw logging

  • --raw-acp -- logs ACP JSON-RPC traffic
  • --raw-rest -- logs REST requests and responses

Limitations

  • Tuning parameters (temperature, max_tokens) are accepted for API compatibility but not forwarded to the ACP agent.
  • Token usage in responses is estimated from text length, not measured by the agent.
  • Only one prompt runs per provider at a time (serialized via prompt lock).

Security

acp-to-api is designed for local/trusted-network use only. The API has no authentication; anyone who can reach the server can invoke providers, which spawn subprocesses.

  • The default bind address is 127.0.0.1 (localhost only). Use --host 0.0.0.0 only if you trust your network.
  • If you need network access, place the server behind a reverse proxy with authentication.
  • The dashboard and trace logs capture full request/response bodies (prompts, completions, tool calls). Be aware of this if you pipe sensitive data through the proxy.

Run tests

uv run pytest -q

Lint and format

uv run ruff check .
uv run ruff format .

Build and publish

uv build
uv publish

License

MIT

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

acp_to_api-0.1.0.tar.gz (53.3 kB view details)

Uploaded Source

Built Distribution

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

acp_to_api-0.1.0-py3-none-any.whl (32.9 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: acp_to_api-0.1.0.tar.gz
  • Upload date:
  • Size: 53.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.8 {"installer":{"name":"uv","version":"0.11.8","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for acp_to_api-0.1.0.tar.gz
Algorithm Hash digest
SHA256 f11b0f89a6dc4a4957d8c528f386908032e67c740f2ec8e0118f1eb6d0cf9854
MD5 759242e5ff5fc6ab2d666ce3bd6f6267
BLAKE2b-256 a9aa9cca67f6be78494fdf9e1f1c37046c121a7f20dc7a7d86f54720aeab3b77

See more details on using hashes here.

File details

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

File metadata

  • Download URL: acp_to_api-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 32.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.8 {"installer":{"name":"uv","version":"0.11.8","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for acp_to_api-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 cb3d6a838343a595f9e484960811cc47d063cfef74af107c44484ea3de0bb0d0
MD5 8054d45212e44697c6d887d8434346fd
BLAKE2b-256 2f69e25bc882cdc44c6b25ab6a8cae78ada4fa4d12b598a1a03f6c3bb5ebc633

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