from openai import OpenAI
client = OpenAI(
base_url="https://agentready.cloud/v1", # ← only change
api_key="ak_...", # AgentReady key
default_headers={
"X-Upstream-API-Key": "sk-..." # your OpenAI key
}
)
# Every call is now compressed automatically
response = client.chat.completions.create(
model="gpt-4o",
messages=[{"role": "user", "content": your_long_prompt}]
)
provide you our OpenAI key (via the X-Upstream-API-Key header)?The cleaner architecture — and what we should have shown — is a two-step approach where our API only handles compression, and your key never leaves your environment:
# Step 1: call AgentReady only to compress import requests
compressed = requests.post("https://agentready.cloud/v1/compress", headers={"Authorization": "ak_..."}, json={"messages": [{"role": "user", "content": your_long_prompt}]} ).json()
# Step 2: call OpenAI directly with YOUR key — we never see it from openai import OpenAI client = OpenAI(api_key="sk-...") response = client.chat.completions.create( model="gpt-4o", messages=compressed["messages"] )
This way AgentReady only touches the text for compression — never your LLM API key. We’ll update the docs and example code accordingly ASAP. Thanks for pushing on this.
No. You only need our API key for the compression step. Your LLM keys and usage stay entirely in your own app — we never see them. We receive text, compress it, and return it. Your LLM (local, OpenAI, Claude, or any other) then processes it with your own keys. We don't even know your app's name.
It uses a deterministic rule-based engine (not another LLM call): removes filler words, simplifies verbose constructions, strips redundant connectors. ~5ms overhead.
Works with any OpenAI-compatible SDK: Python, Node, LangChain, LlamaIndex, CrewAI, Vercel AI SDK.
Free during beta, no credit card: https://agentready.cloud/hn
Python: pip install agentready-sdk && agentready init
Happy to answer any technical questions.