Developers

Lev-Al Prose API for developers

A paid-plan API built on the same editing, MeaningLock verification and Passport signing that Workspace uses. Submitted and edited text are not stored in the application database or application-authored logs. Gateway and provider non-retention has not been independently verified; see our Privacy and Data Handling policy.

Download OpenAPI 3.1 (openapi.json)

Authentication

  1. With an active paid plan, create an integration key in your account. It is shown once; we store only a hash.
  2. Give the key only the scopes it needs. Revoked keys stop working immediately.
  3. Send it as Authorization: Bearer lvp_…. Never put a key in a URL — such requests are refused.

Scopes: contract:createedit:runverify:rundocument:runpassport:createpassport:verify

Base URL: https://levalprose.com/api/v1. All endpoints accept POST with a JSON body. Rate limit: 30 requests per minute per key.

Endpoints

EndpointScopeWhat it does
POST /contractscontract:createBuild a MeaningLock contract. No words deducted.
POST /editsedit:runEdit one passage (1–500 words) into three revisions, each verified.
POST /verificationsverify:runVerify a revision against its source. No words deducted.
POST /documentsdocument:runEdit pasted text up to 5,000 words in 500-word sections. Pasted text only — no .docx.
POST /passportspassport:createSign a Fidelity Passport from a server receipt for a fully verified revision. No words deducted.
POST /passports/verifypassport:verifyCheck a Passport's Ed25519 signature. No words deducted.

Modes

  • faithful (default) — natural length; no padding toward the source count.
  • exact_length — exact target_words (defaults to the input count), or Review required.
  • tighten — shorter (max_words or reduction_percent) without removing locked meaning, or Review required.

Accounting

  • Only /edits and /documents use words. Both need an Idempotency-Key header.
  • The original input word count is deducted once, only after success. Failed runs are refunded in full.
  • Reusing an Idempotency-Key never deducts twice; results are not stored in the application database, so use a new key to run again.
  • Monthly words are used before Extra Words. The free passage cannot be used through the API.

Verification and Passports

  • /verifications uses the same independent meaning review as Workspace. If that review is unavailable, the verdict is Review required, never Preserved.
  • Every /edits, /verifications and /documents revision carries a server receipt. To sign, send the source, the revision and that receipt to /passports; the server re-checks everything and never signs self-declared statuses. An edited revision needs a fresh /verifications call first.
  • Only revisions where every check is verified can be signed. Failed or Review required revisions are never signed.
  • A valid signature confirms the Passport is authentic and unaltered. It does not prove the source facts are true or prove authorship.
  • A Passport holds counts, statuses and salted digests — no passage text. Public key: /.well-known/lev-al-passport-key.json.

Integrations: what is available

  • REST API — available now on paid plans, as documented on this page.
  • MCP server — available now at https://levalprose.com/mcp (JSON-RPC over HTTP). Send your integration key as Authorization: Bearer lvp_…; it uses the same scopes, limits and accounting as the REST API.
  • Microsoft Word, Google Docs and Overleaf — development builds only. They are not listed in Microsoft AppSource, Google Workspace Marketplace or the Chrome Web Store, and are not publicly installable yet. Until they are, use the REST API or MCP, or paste text into the Workspace.

Errors

Errors return { "error": { "code": "…", "message": "…" } } with no prompts, stack traces or secrets.

401unauthenticatedMissing, malformed, invalid or revoked key.
400key_in_urlA key was sent in the URL. Revoke it and create a new one.
403insufficient_scopeThe key lacks this endpoint's scope.
402plan_inactiveNo active paid plan. The free passage cannot use the API.
402insufficient_allowanceNot enough words left. Nothing was deducted.
429rate_limitedMore than 30 requests per minute for this key.
400invalid_input / invalid_json / idempotency_key_requiredThe request is malformed.
422too_long / invalid_document / not_verifiedInput over the limit, or a revision that cannot be signed.
415pasted_text_onlyThe documents endpoint needs a JSON "text" field.
409idempotency_replayed / request_in_progressSame Idempotency-Key reused. Nothing was deducted again.

Examples (synthetic text)

Requests only. Responses follow the schemas in openapi.json.

Edit a passage

curl -X POST https://levalprose.com/api/v1/edits \
  -H "Authorization: Bearer $LEVAL_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: edit-2026-10-22-0001" \
  -d '{
    "mode": "faithful",
    "text": "The pilot program may reduce wait times by 12% (Rivera, 2024), but the sample was small."
  }'

Verify a revision

curl -X POST https://levalprose.com/api/v1/verifications \
  -H "Authorization: Bearer $LEVAL_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "mode": "exact_length",
    "source": "The results do not support a causal link.",
    "revision": "The findings do not establish a causal link."
  }'

Edit pasted document text

curl -X POST https://levalprose.com/api/v1/documents \
  -H "Authorization: Bearer $LEVAL_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: doc-2026-10-22-0001" \
  -d '{ "mode": "tighten", "reduction_percent": 15, "text": "First paragraph...\n\nSecond paragraph..." }'

Verify a Passport

curl -X POST https://levalprose.com/api/v1/passports/verify \
  -H "Authorization: Bearer $LEVAL_API_KEY" \
  -H "Content-Type: application/json" \
  -d @passport.json