2 ms·
You’re absolutely right, and that’s a fair catch thank you so much. The example code contradicts what I said. The cleaner architecture — and what we should hav
by christalingx 7mo ago
You’re absolutely right, and that’s a fair catch thank you so much. The example code contradicts what I said.
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 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.
- nateb2022 7mo agoThat endpoint https://agentready.cloud/v1/compress https://agentready.cloud/v1/compress endpoint doesn't exist, I get a 404. Your entire response is just hallucinated AI text at this point.
- christalingx 7mo agoI apologize for the confusion. The /v1/compress endpoint hasn’t been deployed yet. We’re pushing it to production asap. Following your suggestion, we’re also moving the compression step closer to the client side to minimize exposure of sensitive data. We’ll update the docs accordingly. Thanks for the sharp eyes :)