Skip to main content
Command reference

codespar paywalls

Gate paywalls: create one in front of an API or MCP server, read it, change it, remove it, read its stats

2 min read
View MarkdownEdit on GitHub

Gate paywalls: create one in front of an API or MCP server, read it, change it, remove it, read its stats

6 commands in @codespar/cli 0.20.0.

Each one prints what its operation answered. What a command prints has the rule, and Configuration has the exit codes and the shape of a failure.

codespar paywalls list

List paywalls

codespar paywalls list
optionwhat it does
-q, --query <key=value>Query parameter (repeatable) (default: [])
--timeout <ms>Per-request timeout in milliseconds

GET /v1/paywalls · parameters, responses and refusals

codespar paywalls create

Create a paywall

codespar paywalls create --input-file body.json
body.json
{
  "slug": "example",
  "name": "Example",
  "upstream_url": "https://example.com/hook",
  "price": "string",
  "currency": "BRL",
  "consumer_id": "csm_0000000000000000",
  "description": "string",
  "category": "string",
  "methods": [
    "string"
  ],
  "pricing_model": "string",
  "pricing_tiers": [
    {
      "up_to": 0,
      "price_atomic": "string"
    }
  ],
  "dynamic_price_url": "https://example.com/hook",
  "metered_config": {
    "basis": "string",
    "base_atomic": "string",
    "min_mult": 1,
    "max_mult": 1,
    "units_header": "string"
  },
  "payto": {
    "kind": "byo",
    "address": "string"
  }
}
optionwhat it does
-q, --query <key=value>Query parameter (repeatable) (default: [])
--timeout <ms>Per-request timeout in milliseconds
-i, --input <json>Request body as a JSON string
-f, --input-file <path>Request body from a JSON file

POST /v1/paywalls · parameters, responses and refusals

codespar paywalls get

Read one paywall

codespar paywalls get obj_0000000000000000
argumentwhat it is
<id>String.
optionwhat it does
-q, --query <key=value>Query parameter (repeatable) (default: [])
--timeout <ms>Per-request timeout in milliseconds

GET /v1/paywalls/{id} · parameters, responses and refusals

codespar paywalls delete

Delete a paywall

codespar paywalls delete obj_0000000000000000
argumentwhat it is
<id>String.
optionwhat it does
-q, --query <key=value>Query parameter (repeatable) (default: [])
--timeout <ms>Per-request timeout in milliseconds

DELETE /v1/paywalls/{id} · parameters, responses and refusals

codespar paywalls update

Update a paywall

codespar paywalls update obj_0000000000000000 --input '{"name":"Example","upstream_url":"https://example.com/hook","price":"string","active":true}'
argumentwhat it is
<id>String.
optionwhat it does
-q, --query <key=value>Query parameter (repeatable) (default: [])
--timeout <ms>Per-request timeout in milliseconds
-i, --input <json>Request body as a JSON string
-f, --input-file <path>Request body from a JSON file

PATCH /v1/paywalls/{id} · parameters, responses and refusals

codespar paywalls stats

Earnings for one paywall

codespar paywalls stats obj_0000000000000000
argumentwhat it is
<id>String.
optionwhat it does
-q, --query <key=value>Query parameter (repeatable) (default: [])
--timeout <ms>Per-request timeout in milliseconds

GET /v1/paywalls/{id}/stats · parameters, responses and refusals

codespar paywalls | CodeSpar