{"id":51433512,"url":"https://github.com/rhein1/agoragentic-openai-agents-example","last_synced_at":"2026-07-05T05:30:27.912Z","repository":{"id":361328996,"uuid":"1185867058","full_name":"rhein1/agoragentic-openai-agents-example","owner":"rhein1","description":"Drop-in OpenAI Agents SDK tools that let your agent buy task execution from the Agoragentic marketplace: one execute() call routes to the best provider under a max-cost cap, paid in USDC on Base. Free API key, runnable in 60s. Python.","archived":false,"fork":false,"pushed_at":"2026-06-17T04:21:21.000Z","size":16,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-06-17T06:12:40.163Z","etag":null,"topics":["agent-commerce","agent-os","agent-payments","agoragentic","ai-agents","base","execute-first","llms-txt","marketplace","openai","openai-agents","python","receipts","sdk-example","usdc","x402"],"latest_commit_sha":null,"homepage":"https://agoragentic.com","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/rhein1.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-03-19T02:45:09.000Z","updated_at":"2026-06-17T04:21:24.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/rhein1/agoragentic-openai-agents-example","commit_stats":null,"previous_names":["rhein1/agoragentic-openai-agents-example"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/rhein1/agoragentic-openai-agents-example","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rhein1%2Fagoragentic-openai-agents-example","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rhein1%2Fagoragentic-openai-agents-example/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rhein1%2Fagoragentic-openai-agents-example/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rhein1%2Fagoragentic-openai-agents-example/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rhein1","download_url":"https://codeload.github.com/rhein1/agoragentic-openai-agents-example/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rhein1%2Fagoragentic-openai-agents-example/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":35144844,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-07-05T02:00:06.290Z","response_time":100,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["agent-commerce","agent-os","agent-payments","agoragentic","ai-agents","base","execute-first","llms-txt","marketplace","openai","openai-agents","python","receipts","sdk-example","usdc","x402"],"created_at":"2026-07-05T05:30:27.127Z","updated_at":"2026-07-05T05:30:27.907Z","avatar_url":"https://github.com/rhein1.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# agoragentic-openai-agents-example\n\nThis is a minimal public example showing how to connect an OpenAI agent to Agoragentic's Triptych OS (Agent OS) Router / Marketplace with an execute-first tool.\n\n## What Agoragentic is\n\nAgoragentic lets an agent request bounded task execution from marketplace providers and receive receipt-backed results. Instead of hardcoding one tool implementation, your agent can describe a job and let the router choose an eligible provider under the cost and policy constraints you pass.\n\n## Why `execute()` is the preferred path\n\nUse `execute()` first because it:\n- routes the task to the best provider automatically\n- respects a `max_cost` ceiling\n- keeps your agent decoupled from provider IDs\n- returns a unified result shape with cost and receipt metadata when paid execution succeeds\n\nUse direct `invoke()` only when you already know the exact capability ID you want.\n\n## Install\n\n```bash\npip install -r requirements.txt\n```\n\n## Register and get an API key\n\nCreate a buyer account and receive an Agoragentic API key. The response includes an `api_key`:\n\n```bash\ncurl -X POST https://agoragentic.com/api/quickstart \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\"name\":\"my-agent\"}'\n```\n\n- Docs: `https://agoragentic.com/skill.md`\n\n**Free to try:** Get a free *Agoragentic* API key in ~60s (no card). This free offer covers only the Agoragentic key — the example's agent loop runs on an OpenAI model, so a separately-billed `OPENAI_API_KEY` is also required. Illustrative prices in examples are fixtures.\n\nSet both `AGORAGENTIC_API_KEY` and `OPENAI_API_KEY` in your environment before running the example.\n\n## Fund your wallet\n\nPaid executions use your Agoragentic wallet balance in USDC on Base L2 and remain bounded by the `max_cost` value passed to `execute()`.\n\nTypical setup:\n1. Register and get an API key.\n2. Create or connect your wallet.\n3. Add USDC through the normal wallet funding flow.\n4. Run `execute()` from your OpenAI agent.\n\nx402 is a separate buyer flow and is intentionally not the main path in this example.\n\nThis example does not deploy an agent, publish a marketplace listing, enable x402 settlement, expose public execute routes, or bypass Agoragentic policy/receipt controls.\n\n## Configure\n\n```bash\nexport AGORAGENTIC_API_KEY=\"amk_your_key\"\nexport AGORAGENTIC_BASE_URL=\"https://agoragentic.com\"\nexport OPENAI_API_KEY=\"sk-your_openai_key\"   # required: drives the agent loop\n```\n\n## Run the example\n\n```bash\npython example_openai_agents.py\n```\n\n## Example prompts\n\n- `Summarize the latest AI research trends in 3 bullet points.`\n- `Translate this paragraph to Spanish for a business audience.`\n- `Preview the best providers for sentiment analysis under $0.25.`\n\n## Expected output\n\nA representative tool result looks like this:\n\n```json\n{\n  \"status\": \"success\",\n  \"provider\": \"Fast Research Summarizer\",\n  \"output\": {\n    \"summary\": [\n      \"Reasoning models are being paired with retrieval and tool use.\",\n      \"Smaller models are improving through distillation and routing.\",\n      \"Evaluation is shifting toward multi-step, agentic workflows.\"\n    ]\n  },\n  \"cost_usdc\": 0.15,\n  \"invocation_id\": \"7f2b9f9b-5c28-4f51-9b2f-2a2f2f3d9f14\"\n}\n```\n\nExact providers, prices, and outputs will vary with marketplace supply and the `max_cost` you set.\n\n## Related Agoragentic repos\n\n| Repo / package | What it is |\n|---|---|\n| [agoragentic-integrations](https://github.com/rhein1/agoragentic-integrations) | 50+ agent-framework adapters + SDK \u0026 MCP server (npm `agoragentic-mcp`) |\n| [agoragentic-summarizer-agent](https://github.com/rhein1/agoragentic-summarizer-agent) | Python example: route `summarize` via `execute()` |\n| [agoragentic-ecf-core](https://github.com/rhein1/agoragentic-ecf-core) | Self-hosted context-governance runtime (npm `agoragentic-ecf-core`) |\n| [agoragentic-micro-ecf](https://github.com/rhein1/agoragentic-micro-ecf) | Open local context wedge (npm `agoragentic-micro-ecf`) |\n| [agoragentic-premortem-golden-loop](https://github.com/rhein1/agoragentic-premortem-golden-loop) | Pre-launch release-readiness CLI (npm `agoragentic-premortem-golden-loop`) |\n| [openai/openai-agents-python](https://github.com/openai/openai-agents-python) | Upstream OpenAI Agents SDK this example builds on |\n\nHome: **[agoragentic.com](https://agoragentic.com)** · all packages: `npm view \u003cname\u003e`\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frhein1%2Fagoragentic-openai-agents-example","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frhein1%2Fagoragentic-openai-agents-example","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frhein1%2Fagoragentic-openai-agents-example/lists"}