AgentReady — Python SDK
Cut AI token costs by 40-60%. Drop-in proxy for OpenAI, LangChain, LlamaIndex, CrewAI.
Install & Setup (30 seconds)
pip install agentready-sdk
agentready init
This opens your browser → create a free account → API key is saved to .env automatically.
Quick Start — Drop-in Proxy (Recommended)
Just swap your base_url. Zero code changes to your existing OpenAI calls:
from openai import OpenAI
client = OpenAI(
base_url="https://agentready.cloud/v1", # ← only change needed
api_key="ak_...", # your AgentReady key
default_headers={
"X-Upstream-API-Key": "sk-...", # your OpenAI key
},
)
# Everything works exactly like before — but 40-60% cheaper
response = client.chat.completions.create(
model="gpt-4o",
messages=[{"role": "user", "content": your_long_prompt}],
)
One-liner Helper
import agentready
client = agentready.openai("ak_...", upstream_key="sk-...")
response = client.chat.completions.create(
model="gpt-4o",
messages=[{"role": "user", "content": "Hello!"}],
)
Async Client
client = agentready.create_client("ak_...", upstream_key="sk-...", async_client=True)
response = await client.chat.completions.create(...)
Method 2 — Monkey-Patch
Patch all OpenAI/Anthropic calls globally with two lines:
from agentready import patch_openai
patch_openai(api_key="ak_...")
# All existing OpenAI code is now compressed automatically
from openai import OpenAI
client = OpenAI()
response = client.chat.completions.create(
model="gpt-4o",
messages=[{"role": "user", "content": your_long_prompt}],
)
Or patch everything at once:
import agentready
agentready.api_key = "ak_..."
agentready.auto() # patches OpenAI + Anthropic
Method 3 — Manual Compression
For fine-grained control:
import agentready
agentready.api_key = "ak_..."
result = agentready.compress("Your long prompt text here...")
print(result.text) # compressed text
print(result.tokens_saved) # 1,247
print(result.reduction_percent) # 52.3
print(result.savings_usd) # 0.0374
Framework Integrations
LangChain
from agentready.integrations.langchain import TokenCutCallbackHandler
from langchain_openai import ChatOpenAI
handler = TokenCutCallbackHandler(api_key="ak_...")
llm = ChatOpenAI(model="gpt-4o", callbacks=[handler])
response = llm.invoke("Your very long prompt here...")
LlamaIndex
from agentready.integrations.llamaindex import TokenCutPostprocessor
postprocessor = TokenCutPostprocessor(api_key="ak_...")
query_engine = index.as_query_engine(
node_postprocessors=[postprocessor]
)
CrewAI
from agentready.integrations.crewai import create_crewai_llm
from crewai import Agent, Task, Crew
llm = create_crewai_llm(
agentready_key="ak_...",
upstream_key="sk-...",
model="gpt-4o",
)
agent = Agent(
role="Researcher",
goal="Research AI trends",
backstory="Expert AI researcher.",
llm=llm,
)
How It Works
AgentReady's proxy sits between your code and OpenAI. Every request is:
- Compressed — redundant phrasing removed, verbose text condensed
- Forwarded — sent to OpenAI with your upstream key
- Returned — response comes back unchanged
Code blocks, URLs, numbers, and key terms are always preserved.
Configuration
# Proxy mode — compression level via header
client = agentready.openai(
"ak_...",
upstream_key="sk-...",
compression_level="aggressive", # "light", "standard", "aggressive"
)
# Patch mode — configuration via arguments
agentready.auto(
level="medium",
preserve_code=True,
min_tokens=100,
)
Pricing
Beta — Free unlimited usage. After beta: pay-per-token, ~60% less than direct API costs.
Get your API key at agentready.cloud
License
MIT — AgentReady
Metadata
Release files for agentready-sdk 0.4.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 | Provenance | Actions |
|---|---|---|---|---|
| agentready_sdk-0.4.0.tar.gz | 14.7 kB | Without provenance | Details for agentready_sdk-0.4.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| agentready_sdk-0.4.0-py3-none-any.whl | Python 3 | none | any | Details for agentready_sdk-0.4.0-py3-none-any.whl |
Total release size: 31.8 kB
Release files / agentready_sdk-0.4.0.tar.gz
| Download URL | agentready_sdk-0.4.0.tar.gz |
|---|---|
| Size | 14.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
12d4e09d673f4540bdf02d37bc71f63a0418ba9d253e9327521e5c4c061d9cca
|
|
BLAKE2b-256 checksum How to use checksums |
d6dee0e3efe2c08a6a186f6945099c928ba74289ba1fc17c0b96982f53e3d306
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.14.2
|
Release files / agentready_sdk-0.4.0-py3-none-any.whl
| Download URL | agentready_sdk-0.4.0-py3-none-any.whl |
|---|---|
| Size | 17.1 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
6412be9687bb4d9fb57ae1458d860d476f9de9faa8ec5450fd48e47794d1a116
|
|
BLAKE2b-256 checksum How to use checksums |
1d24c6e60feaa6d2b7e5b31b81cd1f64201ee66a68944367a047c6b232c7c39a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.14.2
|
Security for agentready-sdk 0.4.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.