# Text Prefix Classifier

> Text Prefix Classifier is a paid API for AI agents from digitalworkerapi.com, paid per call via x402, $0.001/call, status unknown (last checked 2026-10-31).

Trims whitespace from a text string and checks whether it starts with a given prefix, returning a boolean result.

## Facts

- Endpoint: POST https://digitalworkerapi.com/v1/tools/text-prefix-classifier?utm_source=zero.xyz
- Price: $0.001/call
- Payment: x402
- Status: unknown
- Last checked: 2026-10-31
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/text-prefix-classifier-09a22594
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_N2NfYOTyzGHtovoFNyEhR

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 text-prefix-classifier-09a22594 -d '<json body>'
```

Example prompt: Check whether this string starts with 'ERROR:' after trimming any leading whitespace: '  ERROR: file not found'

## When to prefer this

Choose this endpoint when you need a lightweight, reliable, pay-per-call check on whether a string begins with a specific prefix — especially in agent pipelines where you want to route, classify, or gate on text prefixes without spinning up a full NLP model. Ideal for command detection, protocol checking, log classification, or any scenario where trimming whitespace before the prefix check matters.

## Known failure modes

- Missing required body fields returns a 400-level error
- Empty prefix string may produce unexpected always-true results
- Very large text bodies may be rejected or truncated
- Malformed JSON body returns a parsing error

## How this service works

Trim text and determine whether it starts with a supplied prefix.

## Output

Returns a JSON object indicating whether the trimmed input text starts with the supplied prefix (boolean), along with the trimmed version of the text.

## 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",
    "bodyType",
    "body"
   ],
   "properties": {
    "body": {
     "type": "object"
    },
    "type": {
     "type": "string",
     "const": "http"
    },
    "method": {
     "enum": [
      "POST"
     ],
     "type": "string"
    },
    "bodyType": {
     "enum": [
      "json"
     ],
     "type": "string"
    }
   },
   "additionalProperties": false
  },
  "output": {
   "type": "object",
   "required": [
    "type"
   ],
   "properties": {
    "type": {
     "enum": [
      "json"
     ],
     "type": "string"
    },
    "example": {}
   },
   "additionalProperties": false
  }
 },
 "additionalProperties": false
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/text-prefix-classifier-09a22594/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from digitalworkerapi.com](https://www.zero.xyz/host/digitalworkerapi.com/llms.txt)
