# PrimeAPI Regex Generator

> PrimeAPI Regex Generator is a paid API for AI agents from prime-api-seven.vercel.app, paid per call via x402, $0.199877/call, status unknown (last checked 2026-09-14).

Generates a regular expression (regex) pattern based on a natural language description of the matching requirement

## Facts

- Endpoint: POST https://prime-api-seven.vercel.app/api/tools/regex/generate
- Price: $0.199877/call
- Payment: x402
- Status: unknown
- Last checked: 2026-09-14
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/primeapi-regex-generator-d6fa0504
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_zyR5yhaz3SR-AUjXUptkz

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 primeapi-regex-generator-d6fa0504 -d '<json body>'
```

Example prompt: Generate a regex pattern that matches valid email addresses, including subdomains like user@mail.example.com.

## When to prefer this

Choose this endpoint when you need to programmatically generate a regex from a plain-English description, especially within an AI agent workflow that requires string validation or extraction patterns without a human writing the regex manually. Prefer this over static regex libraries when the pattern requirement is dynamic or user-specified.

## Known failure modes

- Ambiguous natural language description returns an overly broad or narrow pattern
- Complex or contradictory requirements may produce an incorrect regex
- Query too vague (e.g. 'match text') returns a generic or unhelpful pattern
- Service unavailable or payment failure returns a 402 or 5xx error
- Edge cases in the description may not be captured in the generated pattern

## How this service works

Crypto, AI, Social Media, Finance, Weather, Tools &amp; more. Pay per call in USDC on Base. No API keys.

## Output

The agent receives a generated regular expression pattern that matches the described input requirements, ready to use in code for validation or extraction tasks.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "properties": {
  "query": {
   "type": "string",
   "description": "Search query or input parameter"
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "object",
 "description": "API response data"
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/primeapi-regex-generator-d6fa0504/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from prime-api-seven.vercel.app](https://www.zero.xyz/host/prime-api-seven.vercel.app/llms.txt)
