Skip to content
PreviewFix
Tenders, planning, escrow & API integration8 min readReviewed

Stateless micro-API calls with predictable metering.

How our 25 HTTP engine endpoints separate zero-LLM deterministic checks from optional AI operations, how Bring-Your-Own-Key (BYOK) vs prepaid credits prevent surprise overage bills, and how AKL1 Ed25519 tokens verify offline.

  • 25 HTTP operations
  • Ed25519 AKL1 / AKR1
  • Idempotency-Key
  • BYOK / HTTP 402

Key engineering takeaways

Summary
  • 22 of our 25 POST /api/v1/engines/* endpoints are purely deterministic (0–5 credit units, zero LLM calls) — including pdf.convert, wcag.scan, einvoice.build, dmarc.analyse, vat.validate and omnibus.lowest-price.
  • Only 3 endpoints invoke a language/vision model (tenders.readiness, alt-text.generate, translate.batch). Passing byok: { provider, apiKey } routes model inference onto your own Anthropic, OpenAI or Gemini account and charges only base units.
  • Without BYOK, AI calls require a positive prepaid credit balance and fail upfront with HTTP 402 (insufficient_credits) before any model runs — never generating surprise post-paid overages.
  • Plugin entitlements (AKL1.<payload>.<sig>) are signed with Ed25519 and include an offline grace window after exp, ensuring transient network or server maintenance never locks out a paying customer.

Published by MeWeBe Limited · Factual engineering reference

1. Bearer API keys, plugin headers and idempotent POST metering

Automation scripts, Make scenarios, n8n workflows, GitHub Actions and marketplace plugins call the exact same stateless engine endpoints (POST /api/v1/engines/<path>). Callers authenticate using either a server-side Bearer key (Authorization: Bearer ak_live_<40 chars>) or an activated plugin triple (X-License-Key, X-License-Sku, X-License-Fingerprint).

Every mutating or metered request accepts Idempotency-Key: <8–128 chars>. If your HTTP client retries after a proxy drop or 5xx timeout with fetchWithBackoff, supplying the same Idempotency-Key returns the cached { ok: true, data, usage } envelope and deducts units once only.

Calling an AI-assisted endpoint with BYOK + Idempotency-KeySpecimen
curl -sS -X POST "$BASE_URL/api/v1/engines/alt-text/generate" \
  -H "Authorization: Bearer ak_live_example_key_replace_me_0000000000" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: sku-4419-hero-img-v1" \
  -d '{
    "imageUrl": "https://cdn.example.co.uk/products/sku-4419.jpg",
    "context": "Brushed stainless steel 2-gang switched socket with USB-C",
    "lang": "en-GB",
    "byok": {
      "provider": "anthropic",
      "apiKey": "sk-ant-..."
    }
  }'
# Response: { "ok": true, "data": { "alt": "..." }, "usage": { "operation": "alt-text.generate", "units": 1, "balance": 500, "byok": true } }

2. Choosing between Bring-Your-Own-Key (BYOK) and prepaid credit packs

Flat-price SaaS subscriptions that promise 'unlimited AI' inevitably impose hidden throttling or sudden plan hikes, while uncapped post-paid token billing exposes engineering teams to runaway loop bills. Our commercial contract enforces a clean split:

  • Zero-unit inspection & validation endpoints (0 units): pdf.preview, dpp.qr, dpp.validate, einvoice.validate, vat.validate, omnibus.lowest-price and llms.validate run deterministically at 0 units on an active key (protected by standard X-RateLimit-* headers).
  • Prepaid credits (HTTP 402 fail-fast floor): Ideal for agencies, storefronts and ops teams that do not want to manage separate OpenAI, Anthropic or Google Cloud billing accounts. If a batch call exceeds remaining credits, the server returns 402 { ok: false, error: { code: "insufficient_credits", retryable: false } } before invoking any upstream API.
  • Bring Your Own Key (BYOK): Ideal for engineering teams with existing enterprise model agreements (anthropic, openai or gemini). In plugins, @repo/plugin-kit's createByokVault seals your provider key locally, sends it per call over HTTPS, never persists it in server logs, and bills only the base orchestration unit.

3. Offline-capable Ed25519 AKL1 entitlement tokens and AKR1 signed updates

A WordPress, WooCommerce, Shopware or desktop IDE plugin must never break a customer's storefront or build pipeline because a licence server is unreachable for ten minutes. When a plugin calls /api/v1/licenses/activate or /validate, our server issues a compact signed token: AKL1.<base64url(JSON)>.<base64url(Ed25519 signature)>.

Every plugin embeds our 32-byte Ed25519 public key (never the private key) and verifies the signature locally (@noble/ed25519 in TypeScript, sodium_crypto_sign_verify_detached in PHP, java.security Ed25519 on the JVM). Tokens carry a 7-day exp plus an offline grace window: if a background refresh hits a 5xx or network error (retryable: true — not in TERMINAL_ERROR_CODES), verifyLicenseToken continues returning { ok: true, inGrace: true }. Only the five genuine terminal codes (invalid_key, wrong_sku, revoked, expired, trial_ended) deactivate access. Likewise, self-hosted plugin update packages verify AKR1\n<sku>\n<version>\n<sha256> Ed25519 signatures before installing.

SPEC · API-BYOK-12 · Reviewed 18 November 2026

Authentication, metering & resilience quick-reference

Wire rules shared across all 25 micro-API operations and 20 plugin suites

Engineering checklist
MechanismWire format / headerBehaviour on failureWhen to use
Server API keyAuthorization: Bearer ak_live_<40>401 invalid_key (terminal)CI, Make, n8n, backend
Plugin activationX-License-Key + X-License-Sku + X-License-Fingerprint409 activation_limit when seats full; deactivate old host firstCMS & IDE plugins
Ed25519 token (AKL1)AKL1.<payload>.<64-byte sig>Verifies offline; inGrace: true shields transient 5xx outagesZero outage lockouts
Credit floor vs BYOKPrepaid balance or body.byok402 insufficient_credits before model invocationZero surprise overages

Production integration checklist for client developers

  • Generate a deterministic Idempotency-Key (8–128 chars, e.g. order-<id>-<op>) on every POST /api/v1/engines/* request.
  • Honour Retry-After and X-RateLimit-Reset with jittered exponential backoff on HTTP 429 (rate_limited).
  • Treat non-JSON proxy pages, DNS blips and 5xx envelopes (retryable: true) as transient — never wipe cached AKL1 or OAuth tokens on a transient error.
  • Ignore unknown fields inside data so additive response properties never break strict client parsers.

Complete request/response schemas and runnable curl, Node fetch and PHP snippets are published at /developers.

Technical questions

Common edge cases & boundaries

Is there a permanent free tier on marketplace plugins?
No. Eligible plugin SKUs include a 14-day full-feature trial so you can evaluate the real engine in your own workspace, followed by a straightforward monthly or annual subscription.
Does an OAuth glitch from Shopify, HubSpot or Google disconnect our plugin?
No. createOAuthTokenManager uses a single-flight refresh lock and only marks an account revoked after confirmed consecutive invalid_grant responses from the provider — never on a 502/503 timeout.
Can we buy a single one-off deliverable without writing code or subscribing to a plugin?
Yes. Every core engine is also available as a self-serve one-off service under /services and /tools, with a free preview before checkout.

Continue reading

Related technical guides.

7 min read

llms.txt & @id-linked JSON-LD for AI search

How the llmstxt.org specification works in strict validators, how robots.txt rules govern AI retrieval vs training bots, and how to link Organization, WebSite, Service, Product and Article JSON-LD nodes via @id without inventing facts.

7 min read

DMARC, SPF, DKIM & BIMI staged rollout

How to audit DNS TXT records against RFC 7208's 10-lookup SPF ceiling, align DKIM selectors across third-party senders, advance DMARC enforcement in safe stages, and meet mailbox-provider bulk-sender rules.

7 min read

Wholesale PDF to ERP & storefront CSVs

How multi-page PDF table geometry, multilingual column header normalisation and integer minor-unit arithmetic work together so wholesale catalogues and supplier bills import cleanly into Shopify, WooCommerce, Xero and NetSuite.

Test before checkout

Inspect a free preview first.

Run our deterministic checks or live quote tool on your own file, URL, domain or postcode before paying a penny.