# finmath Text Stats

> finmath Text Stats is a paid API for AI agents from finmath.qzqh5rrbkz.workers.dev, paid per call via x402, $0.001/call, status unknown (last checked 2026-10-12).

Computes text statistics for a given string using the finmath deterministic computation service

## Facts

- Endpoint: POST https://finmath.qzqh5rrbkz.workers.dev/v1/text_stats?utm_source=zero.xyz
- Price: $0.001/call
- Payment: x402
- Status: unknown
- Last checked: 2026-10-12
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/finmath-text-stats-d0710ba2
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_R9gJd-3ylmKubkudUf1m8

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 finmath-text-stats-d0710ba2 -d '<json body>'
```

Example prompt: Can you run text stats on this passage: 'The quick brown fox jumps over the lazy dog. Pack my box with five dozen liquor jugs.' — I want to know things like word count and character count.

## When to prefer this

Use this endpoint when you need deterministic, exact text statistics computed server-side rather than relying on an LLM's approximate counting. Useful when you need reliable word or character counts for billing, truncation, or validation purposes and want a paid-per-call microservice with x402 USDC payment.

## Known failure modes

- Missing required 'text' field returns validation error
- Empty string may return zero-value stats or an error
- Payment not included or insufficient USDC returns 402 Payment Required
- Extremely long text strings may be rejected or time out
- Malformed JSON body returns 400 error

## How this service works

Deterministic finance and crypto math for AI agents: TradFi (NPV, IRR, XIRR, Black-Scholes + Greeks, bonds, VaR, Sharpe) and DeFi (impermanent loss, perp liquidation, funding, Uniswap v3, health factor, cost basis). Exact, model-free arithmetic that LLMs get wrong — priced per call in USDC.

## Output

Returns a result object with computed text statistics (such as word count, character count, or other string metrics) plus a meta object with call metadata.

## Example request

```json
{
 "text": "The quick brown fox jumps over the lazy dog. Pack my box with five dozen liquor jugs."
}
```

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "required": [
  "text"
 ],
 "properties": {
  "text": {
   "type": "string",
   "description": "text"
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "object",
 "required": [
  "result",
  "meta"
 ],
 "properties": {
  "meta": {
   "type": "object"
  },
  "result": {}
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/finmath-text-stats-d0710ba2/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from finmath.qzqh5rrbkz.workers.dev](https://www.zero.xyz/host/finmath.qzqh5rrbkz.workers.dev/llms.txt)
