# pagos.andreax.dev Token Counter

> pagos.andreax.dev Token Counter is a paid API for AI agents from pagos.andreax.dev, paid per call via x402, $0.001/call, status unknown (last checked 2026-09-14).

Estimates the token count of a text string to help budget LLM API calls before making them

## Facts

- Endpoint: GET https://pagos.andreax.dev/api/taller/peaje/contar-tokens
- Price: $0.001/call
- Payment: x402
- Status: unknown
- Last checked: 2026-09-14
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/pagos-andreax-dev-token-counter-70f0f2c1
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_Z66FsMEvx8_Rgk0zTk46t

Status and success rate cover calls made through Zero and Zero's own probes. Third-party monitors may report differently.

## How to call it through Zero

Zero handles the 402 payment challenge and records the run. With the Zero CLI installed (`npm i -g @zeroxyz/cli`):

```sh
zero fetch --capability pagos-andreax-dev-token-counter-70f0f2c1
```

Example prompt: How many tokens is this text: 'The quick brown fox jumps over the lazy dog. In machine learning, tokenization is the process of splitting text into discrete units.'? I need to know before sending it to an LLM.

## When to prefer this

Choose this endpoint when you need a lightweight, cheap ($0.001 USDC) token count estimate before making an LLM call — especially useful in high-volume pipelines where you want to pre-screen text size, route to the right model tier, or budget inference costs without actually running inference. Prefer this over counting tokens client-side if you don't have a local tokenizer available or need a consistent server-side count.

## Known failure modes

- Missing 'input' query parameter returns a validation error
- Empty string input may return 0 tokens or an error
- Very large texts may hit request size limits
- Service unavailability returns a non-200 HTTP status
- Payment failure via x402 protocol blocks the request

## How this service works

Estima los tokens de un texto (para presupuestar llamadas LLM). Alto volumen. input=texto.

## Output

Returns a numeric token count estimate for the submitted text, enabling the caller to predict LLM inference cost, verify context window fit, or route requests based on size before committing to an LLM call.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "$schema": "https://json-schema.org/draft/2020-12/schema",
 "required": [
  "input"
 ],
 "properties": {
  "input": {
   "type": "object",
   "required": [
    "type",
    "method"
   ],
   "properties": {
    "type": {
     "type": "string",
     "const": "http"
    },
    "method": {
     "enum": [
      "GET",
      "HEAD",
      "DELETE"
     ],
     "type": "string"
    },
    "queryParams": {
     "type": "object",
     "required": [
      "input"
     ],
     "properties": {
      "input": {
       "type": "string",
       "description": "texto a medir"
      }
     }
    }
   },
   "additionalProperties": false
  },
  "output": {
   "type": "object",
   "required": [
    "type"
   ],
   "properties": {
    "type": {
     "type": "string"
    },
    "example": {
     "type": "object"
    }
   }
  }
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/pagos-andreax-dev-token-counter-70f0f2c1/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from pagos.andreax.dev](https://www.zero.xyz/host/pagos.andreax.dev/llms.txt)
