77trust / 100

Micro Citation Locator Conversion

by Citation locator conversion in Documents & files

x402 APIPassing, checked 2 h ago

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.

POST https://www.mahastrategies.com/api/v1/micro/citation-locator-conversion

Last 30 days

All checks passedSome failedAll failedNot checked
Uptime
100%
Response time
375 ms typical, 691 ms slowest 5%
Last check
2 h ago
Next check
any minute now

How to call it

# bash or zsh: see the payment challenge (nothing is charged)
curl -g -i -X POST 'https://www.mahastrategies.com/api/v1/micro/citation-locator-conversion' \
  -H 'content-type: application/json' \
  --data-raw '{"dataClass":"synthetic","locators":[{"end":7,"locatorId":"l1","sourceId":"s1","start":1,"unit":"utf8"}],"sources":[{"sourceId":"s1","text":"A\ud83d\ude00\u00e9Z"}]}'
import { wrapFetchWithPayment } from "@x402/fetch";
import { x402Client } from "@x402/core/client";
import { ExactEvmScheme } from "@x402/evm/exact/client";
import { privateKeyToAccount } from "viem/accounts";

const client = new x402Client().register(
  "eip155:8453",
  new ExactEvmScheme(privateKeyToAccount(process.env.AGENT_KEY)),
);
const pay = wrapFetchWithPayment(fetch, client);

// Not sure it's safe to pay? Preflight it first for $0.005:
// GET https://toolvet.app/api/v1/check?url=https%3A%2F%2Fwww.mahastrategies.com%2Fapi%2Fv1%2Fmicro%2Fcitation-locator-conversion
const res = await pay("https://www.mahastrategies.com/api/v1/micro/citation-locator-conversion", {
  method: "POST",
  headers: { "content-type": "application/json" },
  body: "{\"dataClass\":\"synthetic\",\"locators\":[{\"end\":7,\"locatorId\":\"l1\",\"sourceId\":\"s1\",\"start\":1,\"unit\":\"utf8\"}],\"sources\":[{\"sourceId\":\"s1\",\"text\":\"A\ud83d\ude00\u00e9Z\"}]}",
});
console.log(await res.json());

Example input

{
  "dataClass": "synthetic",
  "locators": [
    {
      "end": 7,
      "locatorId": "l1",
      "sourceId": "s1",
      "start": 1,
      "unit": "utf8"
    }
  ],
  "sources": [
    {
      "sourceId": "s1",
      "text": "A😀éZ"
    }
  ]
}

Example output

{
  "amountBaseUnits": "24000",
  "boundaries": [
    "Public or synthetic inputs only. Caller labels are declarations,…"
  ],
  "inputDigest": "sha256:f3b482e3206c27c1528abd63ae53f6266d4eb358cc3cfd89c12f81abe…",
  "offerId": "citation-locator-conversion",
  "receiptDigest": "sha256:881d9521afe4758167f3be8bf6f93cf16378c2586497c2f6812c86928…",
  "result": {
    "dataClass": "synthetic",
    "inputSha256": "sha256:f3b482e3206c27c1528abd63ae53f6266d4eb358cc3cfd89c12f81abe…",
    "limits": [
      "Public/synthetic is a caller declaration, not content inspection…"
    ],
    "locators": [
      {
        "codepointEnd": 3,
        "codepointStart": 1,
        "excerptSha256": "sha256:71b897d47640bd5e39412fb2d81c5d04b1195fc5524663a7704b6bfe2…",
        "locatorId": "l1",
        "sourceId": "s1",
        "utf16End": 4,
        "utf16Start": 1,
        "utf8End": 7,
        "utf8Start": 1
      }
    ],
    "offsetConvention": "zero-based-half-open",
    "resultSha256": "sha256:2cd724f8198f25ee297716e3646f5d9e7106e515b4ac31fdfa05e48be…",
    "sourcesVerified": false
  },
  "version": "maha-microproducts/0.1"
}

Security scan

  • No findings. We scan names, descriptions and tool definitions for hidden instructions and other prompt-injection patterns.

Recent checks

WhenResultHTTPTimePrice
2 h agoPassed402691 ms$0.024
6 h agoPassed402445 ms$0.024
10 h agoPassed402303 ms$0.024
14 h agoPassed402341 ms$0.024
18 h agoPassed402472 ms$0.024
21 h agoPassed402375 ms$0.024
25 h agoPassed402343 ms$0.024
28 h agoPassed402765 ms$0.024
32 h agoPassed402633 ms$0.024
36 h agoPassed402338 ms$0.024
39 h agoPassed402405 ms$0.024
42 h agoPassed402468 ms$0.024
46 h agoPassed402524 ms$0.024
2 days agoPassed402553 ms$0.024
2 days agoPassed402370 ms$0.024