Zhu Jiajun (jz28583)
Trim agents/cliproxyapi surface
701d9c5
"""Generic CLIProxyAPI integration shared by every agent runner.
CLIProxyAPI (github.com/router-for-me/CLIProxyAPI) is a single local proxy
that bridges Anthropic, OpenAI/Codex, and Gemini protocol surfaces on one
port. Pointing every agent at it lets us share OAuth state, credentials, and
rate-limit budget across many harnesses.
Public surface β€” three things:
ProxyEndpoint β†’ where the proxy is + what API key to send
{anthropic,openai,gemini}_env(ep, model=...) β†’ env-var dicts to splice
into subprocess.Popen
openai_yaml_block(ep, model) β†’ snippet for agents whose configs take
base_url/api_key/model directly
Plus `wait_until_ready(ep)` for runners that should fail fast if the proxy
isn't up, and an opt-in `spawn_proxy()` ctx-manager for one-off testing.
"""
from .endpoint import ProxyEndpoint
from .env import anthropic_env, openai_env, openai_yaml_block
from .health import is_ready, wait_until_ready
__all__ = [
"ProxyEndpoint",
"anthropic_env",
"openai_env",
"openai_yaml_block",
"is_ready",
"wait_until_ready",
]