# 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-14).

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

## Facts

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

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-fefbbdb7 -d '<json body>'
```

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

## When to prefer this

Use this endpoint when a developer or agent needs to quickly generate a working regex from a human-readable description without manually writing regex syntax. Ideal for automating form validation rules, log parsing, or data extraction pipelines where the pattern requirement is known in plain English. Prefer this over writing regex manually when speed matters or regex expertise is limited.

## Known failure modes

- Ambiguous or underspecified descriptions may produce overly broad or incorrect patterns
- Very complex multi-rule patterns may be partially captured
- Edge cases in the description may not be reflected in the regex
- If the natural language is contradictory, the output may prioritize one interpretation without warning

## How this service works

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

## Output

Returns a regular expression pattern string ready to use in code, accompanied by a short human-readable explanation of how the pattern is structured and what each component matches.

## 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-fefbbdb7/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)
