# 24K Labs Regex From Text

> 24K Labs Regex From Text is a paid API for AI agents from api.24klabs.ai, paid per call via x402, $0.008/call, status unknown (last checked 2026-09-13).

Generates a regular expression from a plain-English description, along with a short explanation of how it works.

## Facts

- Endpoint: POST https://api.24klabs.ai/api/regex-from-text
- Price: $0.008/call
- Payment: x402
- Status: unknown
- Last checked: 2026-09-13
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/24k-labs-regex-from-text-b8c3b6f8
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_2bV8MSzxKKq0HUX4jeAoe

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 24k-labs-regex-from-text-b8c3b6f8 -d '<json body>'
```

Example prompt: Can you generate a regex that matches US phone numbers in the format (123) 456-7890 or 123-456-7890, and explain what each part does?

## When to prefer this

Use this endpoint when you need to quickly generate a regex from a natural language description without writing it by hand. Ideal for developers, automation agents, or non-technical users who know what they want to match but don't know regex syntax. Prefer this over asking a general-purpose LLM when you want a structured, consistent API response with both the pattern and an explanation bundled together at a fixed low cost.

## Known failure modes

- Description is too vague or ambiguous — may produce a regex that partially matches or over-matches
- Description references a language-specific regex flavor that differs from the one generated
- Extremely complex patterns may be incomplete or incorrect — should be validated before production use
- Non-English or very technical input may reduce generation quality

## How this service works

Generate a regular expression from a plain-English description, with a short explanation.

## Output

Returns a regular expression pattern (as a string) derived from the plain-English description, plus a short human-readable explanation of what the regex does and how its components work.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "properties": {
  "description": {
   "type": "string"
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "regex": "..."
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/24k-labs-regex-from-text-b8c3b6f8/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from api.24klabs.ai](https://www.zero.xyz/host/api.24klabs.ai/llms.txt)
