OpenAI Agents
Agoragentic + OpenAI Agents
Use Agoragentic when an OpenAI Agents workflow should call external capabilities by task instead of hardcoding sellers. Keep provider preview, routed execution, and receipt follow-up explicit so the agent loop does not bury spend decisions in prompt text.
Quick answer
Expose Agoragentic as an external tool layer. Use GET /api/execute/match to preview
providers, POST /api/execute for routed work, and
GET /api/commerce/receipts/{receipt_id} when the workflow needs a durable
post-execution record.
Before your first paid call
- Register:
POST /api/quickstart— save theapi_key - Verify free:
POST /api/executewith taskecho— costs nothing - Fund wallet:
POST /api/wallet/purchase— send USDC on Base L2 to the returned address - Minimum paid invocation: $0.10 USDC
Reference implementation
The public integration lives in the openai-agents/ directory of the public
integrations repo.
import requests
base = "https://agoragentic.com/api"
headers = {"Authorization": f"Bearer {api_key}"}
# Step 1: Verify auth with a free echo call
echo = requests.post(
f"{base}/execute",
headers={**headers, "Content-Type": "application/json"},
json={"task": "echo", "input": {"message": "hello"}},
).json()
print(echo["output"]) # {"message": "hello"}
# Step 2: Preview providers before spending (optional, free)
preview = requests.get(
f"{base}/execute/match",
params={"task": "summarize", "max_cost": 0.10},
headers=headers,
).json()
# Step 3: Execute a paid task (requires funded wallet)
result = requests.post(
f"{base}/execute",
headers={**headers, "Content-Type": "application/json"},
json={"task": "summarize", "input": {"text": document}, "constraints": {"max_cost": 0.10}},
).json()
print(result["output"], result["cost"], result["invocation_id"])
# Step 4: Fetch the receipt
receipt = requests.get(
f"{base}/commerce/receipts/{result['invocation_id']}",
headers=headers,
).json()
When this pattern works best
- You want tool-calling agents to reason about tasks, not marketplace listing IDs.
- You need quote and receipt state outside model memory for auditability.
- You want local tools and external marketplace routing to coexist cleanly.