# fittings Text Character Edit

> fittings Text Character Edit is a paid API for AI agents from fittings.sh, paid per call via x402, $0.0036/call, status unknown (last checked 2026-09-13).

Performs precise character-level operations (insert, delete, replace, extract, find, measure) on text strings using grapheme, code point, or UTF-16 unit counting, returning affected ranges in both chosen unit and UTF-16.

## Facts

- Endpoint: POST https://fittings.sh/v1/text/char-edit
- Price: $0.0036/call
- Payment: x402
- Status: unknown
- Last checked: 2026-09-13
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/fittings-text-character-edit-fd467a0d
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_UZFplH3J-uUYDIHH5iYVg

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 fittings-text-character-edit-fd467a0d -d '<json body>'
```

Example prompt: In the string 'Hello 🌍 world', delete the characters from offset 6 to 8 counting by grapheme, and tell me the resulting text and the affected range in both grapheme units and UTF-16 units.

## When to prefer this

Choose this endpoint when you need to manipulate text at precise character-level offsets with correct Unicode semantics — especially when working with emoji, combining characters, or multilingual text where byte vs code-point vs grapheme distinctions matter. Prefer it over naive string-slicing code when you cannot risk splitting surrogate pairs or grapheme clusters, or when you need the affected range reported in both your chosen unit and UTF-16 for downstream compatibility.

## Known failure modes

- Offset out of bounds returns an error if start/end/index exceeds text length
- Text exceeding 20,000 UTF-16 units is rejected
- Value exceeding 5,000 UTF-16 units for insert/replace is rejected
- Invalid op value returns a validation error
- Missing required parameters for the chosen operation (e.g. missing start/end for delete) return errors
- Invalid unit value returns a validation error

## How this service works

Insert, delete, replace, extract, locate or measure at exact character offsets, counting by grapheme, code point or UTF-16 unit, with the affected range reported in both the chosen unit and UTF-16.

## Output

Returns the result of the requested operation: for insert/delete/replace, the modified text string; for extract, the extracted substring; for find, the starting offset of the match; for measure, the character count. All responses include the affected range reported in both the chosen unit (grapheme, codepoint, or UTF-16) and in UTF-16 units.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "properties": {
  "op": {
   "type": "string",
   "description": "insert | delete | replace | extract | find | measure"
  },
  "end": {
   "type": "number",
   "description": "delete, replace, extract: offset just past the range"
  },
  "find": {
   "type": "string",
   "description": "find: substring to locate"
  },
  "from": {
   "type": "number",
   "description": "find: offset to start searching at, default 0"
  },
  "text": {
   "type": "string",
   "description": "Text to operate on, 20000 UTF-16 units or fewer"
  },
  "unit": {
   "type": "string",
   "description": "grapheme | codepoint (default) | utf16"
  },
  "index": {
   "type": "number",
   "description": "insert: offset to insert before"
  },
  "start": {
   "type": "number",
   "description": "delete, replace, extract: first offset in the range"
  },
  "value": {
   "type": "string",
   "description": "insert, replace: text to put in, 5000 UTF-16 units or fewer"
  }
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/fittings-text-character-edit-fd467a0d/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from fittings.sh](https://www.zero.xyz/host/fittings.sh/llms.txt)
