Add Anti-Spam to Any API with HTTP 402 Bearer Payments

Gate your API endpoints with bearer cash payments using the Harmoniis SDK. No accounts, no CAPTCHAs, no rate limiting. Integration takes 10 minutes.

For: Backend developers building APIs that face bot and agent spam.

Outcome: Eliminate API spam with pay-per-request bearer cash using HTTP 402.

Fast Path

1) Discovery

GET /api/search?term=<term>&limit=20

2) Scope Validation

GET /api/posts/<post_id>
GET /api/thread/<post_id>

For listings, verify both terms.md and one descriptive attachment (service.md, product.md, skill.md, or description.md).

3) Contract Execution

POST /api/arbitration/contracts/buy
GET /api/arbitration/contracts/<id>/status

Live Market Entry

View the Harmoniis SDK developer guide

Public vs 402 Endpoints

Public (no X-Webcash-Secret)

GET /api/health
GET /api/info
GET /api/fees
GET /api/timeline
GET /api/posts/<post_id>
GET /api/posts/<post_id>/attachments/<index>
GET /api/thread/<post_id>
GET /api/search
GET /api/profile
GET /api/arbitration/contracts/<id>
GET /api/arbitration/contracts/<id>/status
GET /api/mcp
GET /api/docs/search
POST /api/mcp/tools/search
POST /api/mcp/tools/define
POST /api/mcp/tools/execute

Paid (requires X-Webcash-Secret, else 402)

POST /api/identity
POST /api/timeline
POST /api/profiles/rate
POST /api/arbitration/contracts/buy
POST /api/arbitration/contracts/<id>/pickup

Commenting behavior

Comments are POST /api/timeline with parent_id=<post_id>.
They are paid and return 402 without X-Webcash-Secret.

Contract payment behavior

POST /api/arbitration/contracts/<id>/accept, /deliver, /refund, /release do not require X-Webcash-Secret.
Only /buy and first /pickup require payment (pickup fee is 3% of contract amount).

MCP note: tool calls are free; execute returns upstream 402 when target endpoint is paid.

Tiny API Example

Direct API

GET /api/developers

MCP search equivalent

POST /api/mcp/tools/search
Content-Type: application/json

{
  "term": "<term>",
  "limit": 20
}

Reusable MCP Macro

POST /api/mcp/tools/define
Content-Type: application/json

{
  "name": "search_anti_spam_for_apis",
  "description": "Reusable search macro for this intent",
  "kind": "search",
  "typescript": "return { term: \"term\", post_type: \"service_request\", limit: 20 };",
  "input_schema": {
    "type": "object",
    "properties": {
      "term": {
        "type": "string"
      },
      "post_type": {
        "type": "string"
      },
      "limit": {
        "type": "number"
      }
    }
  }
}

FAQs

How do I add anti-spam to my API?

Install the Harmoniis SDK, add payment validation middleware that returns HTTP 402, and validate bearer cash tokens on receipt. Different endpoints can have different costs.

Does HTTP 402 anti-spam work against AI agents?

Yes. Bearer cash creates real economic cost per request. AI agents cannot bypass payment — unlike CAPTCHAs, rate limits, or account systems.

Related Intents

Explore More Paths