Metadata-Version: 2.4
Name: proxyllm-client
Version: 1.0.1
Summary: Client helper for ProxyLLM, the OpenAI-compatible LLM gateway: one-line OpenAI client wiring plus the autonomous email-OTP account signup flow.
Author-email: ProxyLLM <support@proxyllm.ai>
License: MIT
Project-URL: Homepage, https://proxyllm.ai/docs/api
Project-URL: Documentation, https://proxyllm.ai/auth.md
Project-URL: OpenAPI, https://proxyllm.ai/openapi.json
Keywords: llm,openai-compatible,gateway,proxyllm,agent,http-402
Classifier: Programming Language :: Python :: 3
Classifier: License :: OSI Approved :: MIT License
Classifier: Intended Audience :: Developers
Classifier: Topic :: Software Development :: Libraries
Requires-Python: >=3.9
Description-Content-Type: text/markdown
Provides-Extra: openai
Requires-Dist: openai>=1.0; extra == "openai"

# proxyllm-client

Client helper for [ProxyLLM](https://proxyllm.ai), the OpenAI-compatible LLM gateway. One routing key rides provider lanes with fallback (a flat-fee ChatGPT/Codex subscription, self-hosted Claude Code bridges, metered API keys), budgets, and request logs.

```bash
pip install proxyllm-client[openai]
```

Point the OpenAI SDK at the gateway:

```python
import proxyllm_client

client = proxyllm_client.OpenAI(api_key="pllm_...")
client.chat.completions.create(model="flagship", messages=[{"role": "user", "content": "hi"}])
```

Or set two environment variables and change nothing else: `OPENAI_BASE_URL=https://api.proxyllm.ai/v1`, `OPENAI_API_KEY=pllm_...`.

Agents can create the account themselves (email OTP, no captcha or browser):

```python
proxyllm_client.signup("operator@example.com")          # code lands in the inbox
r = proxyllm_client.verify("operator@example.com", "123456")
token = r["account_token"]                               # sk_..., returned once

state = proxyllm_client.account(token)                   # 402 payload until a human pays:
print(state["payment"]["checkout_url"])                 # relay this to your operator
# poll account(token) until state["plan"] == "pro", then:
key = proxyllm_client.create_routing_key(token, label="agent")["raw_key"]
```

Unpaid accounts answer HTTP 402 with the checkout link, the flat price ($129/mo), and the 48-hour removal deadline; error bodies are returned as values because they contain the next step. Free helpers: `models()`, `key_info(routing_key)`, `savings(monthly_bill)`.

Full agent flow: <https://proxyllm.ai/auth.md>. OpenAPI: <https://proxyllm.ai/openapi.json>. MCP server: `npx -y proxyllm-mcp`.
