Server402 marketplace

Paid API service

Word Count

Count Unicode characters, whitespace-delimited words, and lines in a text string.

Invocation

Service ID
word-count
Method
POST
Endpoint
/api/tools/word-count
Legacy Endpoint
none
MCP Tool
word_count
Price
USD 0.05

Payment

Call the endpoint without payment to receive HTTP 402 metadata. After payment is complete, retry with X-Payment-Token, an x402 payment signature, or MCP paymentToken.

Call POST /api/tools/word-count once to receive HTTP 402 with accepts[] requirements, or create a payment with POST /api/payments using serviceId="word-count". Pay Base USDC with PAYMENT-SIGNATURE or pay XIAO with X402-Guarantee, then retry the same request.

Schema And Examples

{
  "exampleRequest": {
    "text": "hello paid api"
  },
  "exampleResponse": {
    "characters": 14,
    "lines": 1,
    "words": 3
  },
  "inputSchema": {
    "properties": {
      "text": {
        "type": "string"
      }
    },
    "required": [
      "text"
    ],
    "type": "object"
  },
  "outputSchema": {
    "properties": {
      "characters": {
        "type": "integer"
      },
      "lines": {
        "type": "integer"
      },
      "words": {
        "type": "integer"
      }
    },
    "type": "object"
  }
}