ΛXIØM Lens API

ΛXIØM Lens Console issues keys and shows the ledger. The ΛXIØM Kernel handles OpenAI Chat Completions compatibility, Anthropic Messages compatibility, portable theorem-backed evidence, console-backed API keys, and axiom_governance metadata on every text response.

Quickstart

Sign up at axiom-portal-one.vercel.app/sign-up. We create a test key. Use it as a Bearer token and choose the compatibility shape your client already speaks.

Anthropic Messages shape

curl https://creative-smile-production.up.railway.app/v1/messages \
  -H "Authorization: Bearer axm_live_..." \
  -H "Content-Type: application/json" \
  -H "X-Axiom-Operator: oracle" \
  -H "X-Axiom-Tier: throughput" \
  -d '{
    "model": "claude-sonnet-4-6",
    "max_tokens": 256,
    "messages": [
      {
        "role": "user",
        "content": "Summarize: ..."
      }
    ]
  }'

OpenAI Chat Completions shape

curl https://creative-smile-production.up.railway.app/v1/chat/completions \
  -H "Authorization: Bearer axm_live_..." \
  -H "Content-Type: application/json" \
  -d '{
    "model": "claude-sonnet-4-6",
    "max_tokens": 256,
    "messages": [
      {
        "role": "user",
        "content": "Summarize: ..."
      }
    ]
  }'

Portable evidence shape

curl https://creative-smile-production.up.railway.app/process \
  -H "Authorization: Bearer axm_live_..." \
  -H "Content-Type: application/json" \
  -d '{
    "signal": "Use ΛXIØM to check whether this support queue policy is stable, recurrent, and auditable.",
    "context": "New signup onboarding: prove the evidence contract before the first production call.",
    "assumption_witnesses": {
      "noether": {
        "transition": "app.step",
        "quantity": "governance_mass",
        "quantity_trace": [
          1,
          1,
          1
        ]
      },
      "lyapunov": {
        "potential_trace": [
          84,
          70,
          63.5,
          51
        ]
      },
      "poincare": {
        "bounded": true,
        "reaches_boundary": true,
        "cycle_trace": [
          0,
          0.5,
          1,
          0
        ]
      },
      "fixed_point": {
        "regime": "banach",
        "fixed_point_residual": 0,
        "lipschitz_bound": 0.42
      },
      "information_loss": {
        "states": [
          "appeal_pending",
          "sarcastic_quote",
          "policy_violation"
        ],
        "observer_outputs": [
          "allow",
          "allow",
          "block"
        ],
        "closed_under_transition": true,
        "observer_invariant": true
      },
      "empirical": {
        "dataset_uri": "s3://axiom/studies/diminishing_returns.csv",
        "schema_uri": "git:replication/v1/schema/diminishing_returns_v1_schema.json",
        "protocol_uri": "git:replication/v1/PROTOCOL.md",
        "result_uri": "git:replication/v1/results/run_2026_05_06.json",
        "run_hash": "sha256:aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
      }
    }
  }'

TypeScript helper

type Operator = "oracle" | "validator" | "lens" | "governor" | "codex";
type Tier = "throughput" | "judgment";

export async function axiomMessage(input: string, operator: Operator, tier: Tier) {
  const r = await fetch("https://creative-smile-production.up.railway.app/v1/messages", {
    method: "POST",
    headers: {
      "Authorization": `Bearer ${process.env.AXIOM_API_KEY}`,
      "Content-Type": "application/json",
      "X-Axiom-Operator": operator,
      "X-Axiom-Tier": tier,
    },
    body: JSON.stringify({
      // Required by /v1/messages; X-Axiom-* overrides it when the pair is mapped.
      model: "claude-sonnet-4-6",
      max_tokens: 256,
      messages: [{ role: "user", content: input }],
    }),
  });
  if (!r.ok) throw new Error(`ΛXIØM ${r.status}: ${await r.text()}`);
  const data = await r.json();
  return {
    text: data.content?.[0]?.text ?? "",
    modelUsed: data.model,
    governance: data.axiom_governance,
  };
}

Python

import os, requests

r = requests.post(
    "https://creative-smile-production.up.railway.app/v1/chat/completions",
    headers={
        "Authorization": f"Bearer {os.environ['AXIOM_API_KEY']}",
        "Content-Type": "application/json",
    },
    json={
        "model": "claude-sonnet-4-6",
        "max_tokens": 256,
        "messages": [{"role": "user", "content": "Summarize: ..."}],
    },
    timeout=120,
)
r.raise_for_status()
data = r.json()
print(data["choices"][0]["message"]["content"])
print(data["axiom_governance"])

Authentication

Send a ΛXIØM Lens Console API key in Authorization: Bearer. The kernel also accepts x-api-key for Anthropic SDK clients that use that header.

  • axm_live_... — production traffic, billed against your team plan
  • axm_test_... — development traffic; same governance, separate key namespace

Keys validate through the console HTTP contract when the kernel is configured for white-label mode. Revoked keys can remain cached by a kernel instance for roughly 60 seconds.

Endpoints

MethodPathPurpose
POST/v1/chat/completionsOpenAI Chat Completions compatibility
POST/v1/messagesAnthropic Messages compatibility
GET/v1/modelsDefault upstream model list
GET/v1/governance/statusKernel governance status
POST/processPortable ΛXIØM process with theorem-backed evidence
POST/chainPortable multi-cycle process with theorem-backed evidence
GET/proof-registryMachine-readable Lean theorem bridge registry
GET/empirical-provenanceMachine-readable empirical provenance registry

/v1/messages accepts model, max_tokens, messages, optional system, temperature, top_p, and stop_sequences. /v1/chat/completions accepts the standard OpenAI chat fields.

Models & Routing

You can name a concrete model in the request body or ask the kernel to route by X-Axiom-Operator and X-Axiom-Tier. Header routing overrides the body model only when the pair is mapped.

The console also stores weekly model-route selections. The refresh job pulls provider catalogs, scores candidates against Signal Jumping's 8D route lanes, and exposes the active policy at /api/internal/model-routes for kernel consumption. The consensus lane is ΛXIØM's preferred margin-aware route: cheap, high-alignment models that let the product price competitively against frontier defaults. Route signatures are stored as first-class Signal Jumper rows, and a refresh only promotes a new active route when it clears the material-improvement threshold.

Model matchProviderKernel behavior
claude-*AnthropicNative Messages API upstream; kernel translates back to a governed response.
hf/<org>/<model>HuggingFace InferenceThe kernel strips the hf/ prefix before forwarding.
<org>/<model>OpenRouterSlash-qualified model names route to OpenRouter.
<bare-name> or omittedDefault upstreamFalls back to hermes3:latest unless the deployment overrides AXIOM_UPSTREAM_MODEL.

Default operator map

OperatorTierModel
oraclethroughputclaude-sonnet-4-6
oraclejudgmentclaude-opus-4-7
validatorthroughputclaude-sonnet-4-6
validatorjudgmentclaude-opus-4-7
lensthroughputclaude-sonnet-4-6
lensjudgmentclaude-opus-4-7
governorjudgmentclaude-opus-4-7
codexjudgmentclaude-opus-4-7

Governance

In full mode, the kernel decomposes the last user message, injects structural context, calls the upstream model, and governs the output. The governor pipeline reports action, repairs, warnings, blocking governors, and optional quality scores.

A user message beginning with /lens or another operator command activates the kernel's explicit Lens mode. The command is stripped before the prompt is sent upstream.

Evidence Contract

The portable /process and /chain surfaces accept assumption_witnesses. The kernel returns an evidence object that reports pattern matches, theorem backing, assumptions satisfied, assumptions missing, witness discharge results, empirical provenance, confidence, and limitations.

Witness keyWhat the app exposes
noethertransition, conserved quantity, invariant trace
lyapunovpotential, debt, or energy trace
poincareboundedness, boundary reach, return trace
fixed_pointresidual, contraction, order, period, or reset evidence
information_lossstates, observer outputs, closure, invariance
empiricaldataset, schema, protocol, result artifact, run hash

Pattern detection is not treated as proof. A pattern upgrades to assumption_discharged only when the witness data satisfies the discharge checks for that theorem family.

Evidence response shape

{
  "expression": "...",
  "confidence": 0.71,
  "evidence": {
    "proof_registry_version": "2026-05-06.bridge-1",
    "pattern_matches": [
      {
        "id": "pattern.stability.lyapunov",
        "status": "assumption_discharged",
        "theorem_family": "Lyapunov stability",
        "assumptions_satisfied": [
          "Potential values live in a preorder",
          "The potential is nonincreasing after one transition"
        ],
        "assumptions_missing": []
      }
    ],
    "theorem_backing": [
      {
        "id": "bridge.lyapunov.lyapunov_nonincreasing_iterate",
        "proof_status": "lean_verified",
        "source_file": "AxiomTheorems/Bridge/LyapunovBridge.lean"
      }
    ],
    "assumption_discharge": {
      "results": [{ "id": "discharge.lyapunov", "status": "discharged" }]
    },
    "confidence": 0.82,
    "confidence_level": "high",
    "limitations": [
      "Formal bridge theorems certify theorem-shape under stated assumptions, not every empirical claim."
    ]
  }
}

Signed-in users can run this flow in the Evidence Contract console.

Proof Registry

The proof registry is the machine-readable bridge between ΛXIØM language and known theorem families. Each entry names the theorem ID, Lean symbol, source file, domain, assumptions, external theorem family, proof status, and confidence.

  • GET /proof-registry returns Lean-backed theorem records.
  • GET /empirical-provenance returns empirical records and their limitations.
  • Dashboard decisions store evidence summaries so production traffic can be audited without storing the whole response body.

Responses

Both compatibility shapes include a non-standard axiom_governance field. Clients that ignore unknown fields keep working.

Anthropic Messages response

{
  "id": "msg_4d470ffa1a8f42d69f02aebb",
  "type": "message",
  "role": "assistant",
  "model": "claude-sonnet-4-6",
  "content": [{ "type": "text", "text": "..." }],
  "stop_reason": "end_turn",
  "stop_sequence": null,
  "usage": { "input_tokens": 142, "output_tokens": 87 },
  "axiom_governance": {
    "action": "allow",
    "passed_all": true,
    "total_repairs": 0,
    "total_warnings": 0,
    "blocked_by": [],
    "mode": "full",
    "lens_active": false,
    "duration_seconds": 1.4,
    "structural_perception": {
      "operator": "oracle",
      "dominant_axis": "functional_coherence",
      "signal_type": "analysis"
    }
  }
}

OpenAI Chat Completions response

{
  "id": "axiom-2f8c9a0b4d2e",
  "object": "chat.completion",
  "created": 1777560000,
  "model": "claude-sonnet-4-6",
  "choices": [{
    "index": 0,
    "message": { "role": "assistant", "content": "..." },
    "finish_reason": "stop"
  }],
  "usage": {
    "prompt_tokens": 142,
    "completion_tokens": 87,
    "total_tokens": 229
  },
  "axiom_governance": { "action": "allow", "mode": "full" }
}

Limits

  • Plan quota is checked before keyed calls when the kernel is wired to the console HTTP API. Confirmed over-quota requests return 429.
  • /v1/messages compatibility is text-first today. Image, tool_use, and tool_result blocks are represented as text placeholders.
  • /v1/chat/completions can return governed SSE when stream: true; the kernel sends the governed answer as a complete chunk.
  • Bare model names fall back to the deployment's default upstream model. For predictable production routing, use claude-*, hf/..., or <org>/<model>.

Errors

  • 401 — missing, invalid, or revoked console key
  • 400 — malformed request body
  • 429 — confirmed plan quota exceeded for this billing period
  • 502 — upstream provider error, timeout, or no upstream choices
  • 500 — internal kernel error; inspect the corresponding request in /dashboard/decisions