# Delx Ensure Prefix

> Delx Ensure Prefix is a paid API for AI agents from api.delx.ai, paid per call via x402, $0.001/call, status unknown (last checked 2026-09-14).

Ensures a string starts with a required prefix, adding it if missing without duplicating it if already present

## Facts

- Endpoint: POST https://api.delx.ai/api/v1/x402/ensure-prefix
- Price: $0.001/call
- Payment: x402
- Status: unknown
- Last checked: 2026-09-14
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/delx-ensure-prefix-233bd453
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_mqiZJki4u6dQg7HOaOOR8

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 delx-ensure-prefix-233bd453 -d '<json body>'
```

Example prompt: Make sure the string 'example.com' starts with 'https://' — add the prefix if it's missing but don't duplicate it if it's already there.

## When to prefer this

Choose this endpoint when you need a stateless, deterministic, idempotent micro-utility to normalize string prefixes in an agent pipeline without writing inline logic. It is ideal for preflight sanitization of URLs, file paths, namespaced IDs, or tagged strings where you must guarantee exactly-once prefix presence. Prefer it over custom code when you want a machine-readable JSON result for $0.001 USDC with no side effects, no data retention, and no external dependencies.

## Known failure modes

- Missing required 'text' or 'prefix' field returns an error response
- Empty prefix string may produce undefined normalization behavior
- Very long strings may hit payload size limits
- Payment failure via x402 prevents execution and returns 402 status

## How this service works

Ensure a string starts with a required prefix without duplication — first-party local utility for agent preflight and proven micro-utils expansion. Returns deterministic machine-readable JSON for $0.001 USDC via x402 on Base. Execution is first-party, local-only, stateless, and memory-only with no paid upstream, no input retention, no web search, no live RPC, and no mediagen. Results are advisory; the caller owns authorization, budgets, and production controls. Sibling of Delx routes that alrea…

## Output

Returns a deterministic JSON object containing the resulting string that is guaranteed to start with the specified prefix exactly once, regardless of whether the original input already had it or not.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "properties": {
  "text": {
   "type": "string",
   "description": "Input field: text."
  },
  "prefix": {
   "type": "string",
   "description": "Input field: prefix."
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "text": "https://api.delx.ai",
  "prefix": "https://",
  "schema": "delx/util-ensure-prefix/v1",
  "already_present": false
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/delx-ensure-prefix-233bd453/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from api.delx.ai](https://www.zero.xyz/host/api.delx.ai/llms.txt)
