# Citation Locator Conversion

> Citation Locator Conversion is a paid API for AI agents from www.mahastrategies.com, paid per call via x402, $0.024/call, status unknown (last checked 2026-10-24).

Converts text span offsets between UTF-8 byte positions, UTF-16 code-unit positions, and Unicode code-point positions, rejecting invalid mid-codepoint offsets.

## Facts

- Endpoint: POST https://www.mahastrategies.com/api/v1/micro/citation-locator-conversion?utm_source=zero.xyz
- Price: $0.024/call
- Payment: x402
- Status: unknown
- Last checked: 2026-10-24
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/citation-locator-conversion-f680c611
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_Ukb2rEjBl-Irp-YQHk1-k

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 citation-locator-conversion-f680c611 -d '<json body>'
```

Example prompt: I have a text snippet and a set of half-open spans in UTF-8 byte positions — can you convert those locators into all three formats: UTF-8 bytes, UTF-16 code units, and Unicode code points? The data class is synthetic.

## When to prefer this

Use this endpoint when you need to accurately convert text span offsets between UTF-8 byte positions, UTF-16 code-unit positions, and Unicode code-point positions, especially for multilingual or emoji-containing text where encoding boundaries differ. It is ideal for citation tracking, NLP annotation pipelines, and cross-platform text editor synchronization where encoding mismatches cause bugs. It does not do PDF parsing, page inference, or any external lookups — it is a pure, deterministic conversion utility.

## Known failure modes

- Offset falls inside a multi-byte code point — endpoint rejects the locator with an error
- Input text is not valid UTF-8 — parsing fails
- Locator array exceeds 64 items — request rejected
- Sources array exceeds 16 items — request rejected
- Invalid dataClass value — request rejected with schema validation error
- Malformed body or missing required fields — 400-level error returned

## How this service works

Convert half-open UTF-8 byte, UTF-16 code-unit, or Unicode code-point spans into all three units for supplied text. Reject offsets inside a code point. No PDF parsing, page inference, or external source lookup.

## Output

Returns a result object containing converted offset spans in all three encoding formats (UTF-8 bytes, UTF-16 code units, Unicode code points) for each input locator, a boundaries array, an inputDigest, a receiptDigest, an offerId, a version, and an amountBaseUnits field. Invalid offsets that fall inside a code point are rejected with an error.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "$schema": "https://json-schema.org/draft/2020-12/schema",
 "required": [
  "input"
 ],
 "properties": {
  "input": {
   "type": "object",
   "required": [
    "type",
    "method",
    "bodyType",
    "body"
   ],
   "properties": {
    "body": {
     "type": "object",
     "required": [
      "dataClass",
      "sources",
      "locators"
     ],
     "properties": {
      "sources": {
       "type": "array",
       "maxItems": 16,
       "minItems": 1
      },
      "locators": {
       "type": "array",
       "maxItems": 64,
       "minItems": 1
      },
      "dataClass": {
       "enum": [
        "public",
        "synthetic"
       ],
       "type": "string"
      }
     },
     "additionalProperties": false
    },
    "type": {
     "type": "string",
     "const": "http"
    },
    "method": {
     "enum": [
      "POST"
     ],
     "type": "string"
    },
    "bodyType": {
     "enum": [
      "json",
      "form-data",
      "text"
     ],
     "type": "string"
    }
   },
   "additionalProperties": false
  },
  "output": {
   "type": "object",
   "required": [
    "type"
   ],
   "properties": {
    "type": {
     "type": "string"
    },
    "example": {
     "type": "object",
     "required": [
      "version",
      "offerId",
      "amountBaseUnits",
      "inputDigest",
      "result",
      "boundaries",
      "receiptDigest"
     ],
     "properties": {
      "result": {
       "type": "object"
      },
      "offerId": {
       "enum": [
        "citation-locator-conversion"
       ],
       "type": "string"
      },
      "version": {
       "enum": [
        "maha-microproducts/0.1"
       ],
       "type": "string"
      },
      "boundaries": {
       "type": "array",
       "maxItems": 128,
       "minItems": 0
      },
      "inputDigest": {
       "type": "string",
       "maxLength": 71
      },
      "receiptDigest": {
       "type": "string",
       "maxLength": 71
      },
      "amountBaseUnits": {
       "enum": [
        "24000"
       ],
       "type": "string"
      }
     },
     "additionalProperties": false
    }
   }
  }
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/citation-locator-conversion-f680c611/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from www.mahastrategies.com](https://www.zero.xyz/host/www.mahastrategies.com/llms.txt)
