OpenAI Agents SDK
Check a seller with the BotsRated MCP server, then a Desk approval, before the agent pays.
This is a check of measured facts. It is not a rating of the seller. Prices and free limits stay on pricing and the live tool text. This page does not set them.
Install
pip install openai-agents botsrated-openai-agents
The MCP server needs no key. botsrated-openai-agents is the Guard attach package. Guard steps: /docs/guard.
Check with the MCP server
Add https://botsrated.com/mcp as a streamable HTTP MCP server. No auth header. Tell the agent to call preflight and to show the measured facts and the receipt link. Do not pay in this step.
import asyncio
from agents import Agent, Runner
from agents.mcp import MCPServerStreamableHttp
async def main() -> None:
async with MCPServerStreamableHttp(
name="BotsRated",
params={"url": "https://botsrated.com/mcp"},
) as mcp:
agent = Agent(
name="Check before pay",
instructions=(
"Before any payment, call the BotsRated tool preflight for the host. "
"Show the measured facts and the receipt link. "
"This is a check, not a rating. Do not pay."
),
mcp_servers=[mcp],
)
result = await Runner.run(agent, "Check seller.example before paying.")
print(result.final_output)
asyncio.run(main())
Desk approval before paying
An approver records the host and the receipt id from that check. The agent reads the lock and pays only when that receipt is listed. The lock is the approved state. Each entry has a receipt id.
curl -X POST https://botsrated.com/v1/team/$BOTSRATED_ORG/approvals \
-H "Authorization: Bearer $BOTSRATED_TOKEN" \
-H "Content-Type: application/json" \
-d '{"host":"seller.example","kind":"payto","receipt_id":"RECEIPT_ID"}'
kind is payto, tools, or price_above_listing. RECEIPT_ID is the id from the check, unchanged. The caller needs the approver role. Nothing here is an x402 payment.
import json, os, urllib.request
def receipt_approved(host: str, receipt_id: str) -> bool:
org = os.environ["BOTSRATED_ORG"]
token = os.environ["BOTSRATED_TOKEN"]
req = urllib.request.Request(
f"https://botsrated.com/v1/team/{org}/lock",
headers={"Authorization": f"Bearer {token}", "Accept": "application/json"},
)
with urllib.request.urlopen(req) as res:
lock = json.load(res)
return any(
e.get("host") == host and e.get("receipt_id") == receipt_id
for e in (lock.get("entries") or [])
)
Pay only when receipt_approved is true. If it is false, stop. That is the Desk approval step. Then attach Guard the way the OpenAI Agents section of Guard shows, on the x402 client the agent already pays with.
Next: watch this host free, or check again later.