{"id":27634696,"url":"https://github.com/cashputation/opensnap","last_synced_at":"2026-04-30T09:34:11.862Z","repository":{"id":289354879,"uuid":"970976865","full_name":"cashputation/OpenSNAP","owner":"cashputation","description":"Official Repository for the Self-Negotiating APIs Protocol (SNAP)","archived":false,"fork":false,"pushed_at":"2025-04-22T20:56:31.000Z","size":31,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-04-22T21:29:31.861Z","etag":null,"topics":["agents","api-protocol","m2m","openapi","opensnap"],"latest_commit_sha":null,"homepage":"","language":null,"has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/cashputation.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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}},"created_at":"2025-04-22T20:27:22.000Z","updated_at":"2025-04-22T20:56:35.000Z","dependencies_parsed_at":"2025-04-22T21:41:43.711Z","dependency_job_id":null,"html_url":"https://github.com/cashputation/OpenSNAP","commit_stats":null,"previous_names":["cashputation/opensnap"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cashputation%2FOpenSNAP","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cashputation%2FOpenSNAP/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cashputation%2FOpenSNAP/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cashputation%2FOpenSNAP/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cashputation","download_url":"https://codeload.github.com/cashputation/OpenSNAP/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250497056,"owners_count":21440250,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["agents","api-protocol","m2m","openapi","opensnap"],"created_at":"2025-04-23T19:20:16.232Z","updated_at":"2026-04-30T09:34:11.821Z","avatar_url":"https://github.com/cashputation.png","language":null,"funding_links":[],"categories":[],"sub_categories":[],"readme":"# OpenSNAP\n**Open Self‑Negotiating API Protocol**\n\n**Version:** 1.0 • **License:** Apache 2.0\n\n---\n\n## Overview  \nOpenSNAP is a minimal, machine‑to‑machine HTTP handshake that lets autonomous agents discover API pricing, negotiate bids, and attach payment vouchers—**independent** of any particular settlement layer. Think of it as the TCP of metered API commerce: a simple “offer‑ack‑pay‑invoke” protocol that any payment rail (blockchain, Interledger, centralized ledger or Stripe) can plug into.\n\n---\n\n## Key Features\n\n- **Protocol‑First**  \n  - Agnostic to payment networks: blockchain, Lightning, Interledger STREAM, or centralized tokens.  \n  - Extends OpenAPI with machine‑readable pricing metadata.\n- **Self‑Negotiating**  \n  - Clients fetch `x-price-base`, `x-pricing-algo`, `x-min-price`, `x-max-price`, compute a bid, and send a `CALL-OFFER`.  \n  - Server responds with `CALL-ACK` (proceed) or `CALL-REJECT` (decline).\n- **Voucher‑Based**  \n  - Payment proof carried as an HTTP header (`X-OpenSNAP-Voucher`), validated per request.  \n  - Settlement layer is pluggable (blockchain channels, ILP STREAM, centralized tokens).\n- **Play‑Money Reference**  \n  - Includes an HMAC “voucher” adapter for zero-barrier prototyping.\n\n---\n\n## Files \u0026 Structure\n\n```\n/\n├── examples/server.py    # Example FastAPI server implementing OpenSNAP\n├── examples/client.py    # Example Python client demonstrating the handshake\n└── rfc.md       # Protocol specification \u0026 message schemas\n```\n\n---\n\n## Protocol at a Glance\n\n1. **Discovery**  \n   ```http\n   GET /openapi.json\n   ```  \n   Returns an OpenAPI spec extended with `x-price-base`, `x-pricing-algo`, `x-min-price`, `x-max-price`.\n\n2. **Negotiation**  \n   - **Client → Server** (`CALL-OFFER`):\n     ```http\n     X-OpenSNAP-Offer: {\"endpoint\":\"/video/generate\",\"bid\":0.002}\n     ```\n   - **Server → Client**:  \n     - `200 OK` (ACK) or `402 Payment Required` (REJECT)\n\n3. **Payment \u0026 Invocation**  \n   - **Client** attaches:`X-OpenSNAP-Voucher: \u003copaque-blob\u003e`  \n   - **Server** verifies voucher, then processes HTTP body.\n\n4. **Settlement**  \n   - Off‑protocol via any adapter: blockchain, ILP, centralized ledger.\n\n---\n\n## Adoption Strategy\n\n1. **Protocol Agnostic**  \n   - Define only the handshake; payment backends are adapters.  \n   - Encourage community to build Solana, Lightning, ILP, or JWT adapters.\n2. **Reference Implementations**  \n   - `server.py` / `client.py` for play‑money prototyping.  \n   - Easy to extend: swap `rfc.md` and adapter code.\n3. **Community‑First**  \n   - Open RFC (`rfc.md`) on GitHub for issues and PRs.  \n   - Target AI/agent ecosystems (LangChain, AutoGPT) with plugins.\n4. **Sandbox \u0026 SDKs**  \n   - Public sandbox for testing without real funds.  \n   - Official client SDK that abstracts voucher plumbing.\n\n---\n\n## Quick Start\n\n1. **Clone Repo**\n   ```bash\n   git clone https://github.com/cashputation/OpenSNAP.git\n   cd protocol\n   ```\n2. **Run Server**\n   ```bash\n   pip install fastapi uvicorn\n   python3 server.py\n   ```\n3. **Run Client**\n   ```bash\n   pip install requests\n   python3 client.py\n   ```\n\n---\n\n## Resources\n\n- **RFC**: `rfc.md` in this repo  \n- **Issues**: https://github.com/cashputation/OpenSNAP/protocol/issues  \n- **Discussions**: https://github.com/cashputation/OpenSNAP/protocol/discussions\n\n---\n\n## License\n\nApache 2.0 © OpenSNAP Contributors\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcashputation%2Fopensnap","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcashputation%2Fopensnap","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcashputation%2Fopensnap/lists"}