Skip to main content

Base URL

Health check

GET /health

Check API status. No authentication required.
Response:

Verification endpoints

POST /verify/natural_language

Main entry point for verifying natural language queries. Routes through the QWED Control Plane with multi-tenancy support. Request:
Response: The response follows the VerificationResult schema. For math queries, the top-level status is INCONCLUSIVE because the LLM translation step is not formally verified — see Trust boundary for details.
Status values for natural language math verification:
Previous versions set the status field to the inner engine result (e.g., VERIFIED). It now returns INCONCLUSIVE when the inner engine returns VERIFIED or CORRECTION_NEEDED, because the natural language pipeline involves a non-deterministic LLM translation step. Use the trust_boundary object to inspect the detailed verification breakdown. For fully deterministic results, use POST /verify/math directly.
trust_boundary fields:

POST /verify/math

Updated in v5.1.0: verify_identity() numerical sampling fallback now returns BLOCKED with is_equivalent: false instead of UNKNOWN. This fail-closed behavior ensures that sampling-only agreement is never mistaken for a verified identity.
Verify mathematical expressions or equations using SymPy symbolic computation. Request:
Response (equation):
Response (expression):
Symbolic expressions that cannot be evaluated to a numeric value include is_symbolic: true. Expressions involving complex numbers include is_complex: true. Ambiguous expressions: Expressions with implicit multiplication after division (e.g., 1/2(3+1)) are rejected with is_valid: false, result: false, and status: "BLOCKED". The response includes warning: "ambiguous" and a message explaining why. Rewrite the expression with explicit parentheses or a * operator to remove the ambiguity.
Error cases: Division by zero, log(0), and square root of negative numbers in the real domain return is_valid: false with a descriptive error and message. Tolerance bounding: When verifying an expression against an expected value with a tolerance parameter, the engine enforces a deterministic upper bound on the tolerance. The maximum allowed tolerance is max(0.01, abs(calculated_value) * 0.01). If the requested tolerance exceeds this bound, the request returns a BLOCKED status. Invalid tolerance values (negative, NaN, Infinity, or non-numeric) are also rejected with BLOCKED. Response (tolerance exceeded):

POST /verify/logic

Verify logical constraints. Routes through the QWED Control Plane. Request:
Response:
The provider_used field indicates which LLM provider handled the translation step. This field is included in both success and error responses, which helps with debugging provider routing issues. Error response:

POST /verify/code

Check code for security vulnerabilities using AST analysis. Request:
Response:

POST /verify/sql

Validate SQL queries against a provided schema. Request:
Response:

POST /verify/fact

Verify a factual claim against a provided context. Request:
Response:

POST /verify/consensus

New in v4.0.0 · Updated in v5.0.0
Multi-engine consensus verification. Runs the query through multiple verification engines and requires agreement above a confidence threshold. This endpoint is rate-limited per API key. Mathematical expressions are parsed and compared using Decimal arithmetic internally, which avoids floating-point drift when engines cross-check results.
The fact engine is excluded from automatic engine selection during consensus verification. Fact-based verification requires external context and will return an error if invoked without it, preventing self-referential consensus loops.
Request:
Verification modes: Response:

POST /verify/image

Verify claims about image content. Accepts multipart form data with an image file (max 10 MB). Supported formats: PNG, JPEG, GIF, WebP. Request:
Response:

POST /verify/stats

Verify statistical claims against CSV data. Accepts multipart form data with a CSV file. Statistical code execution requires the secure Docker sandbox. If Docker is unavailable, the endpoint returns HTTP 503. If the verification is blocked by a security policy, it returns HTTP 403. Request:
Response:
Statistical verification requires a running Docker daemon. If Docker is unavailable, the endpoint returns HTTP 503 instead of falling back to in-process execution. See the Stats engine page for details.

POST /verify/process

New in v4.0.1
Verify the structural integrity of LLM reasoning traces. Supports IRAC structural compliance checking and custom milestone validation with decimal scoring. Request (IRAC mode):
Request (milestones mode):
Response (IRAC mode):
Response (milestones mode):

POST /verify/rag

New in v4.0.1
Verify that retrieved RAG chunks originate from the expected source document. Prevents Document-Level Retrieval Mismatch (DRM) hallucinations in RAG pipelines. Request:
max_drm_rate accepts only string values for symbolic precision. Use fraction notation like "1/10" instead of 0.1.
Response:

POST /verify/batch

Verify multiple items in a single request. Processes all items concurrently and returns aggregated results. Maximum 100 items per batch. Request:
Response:

Math items: proof vs. simplification

Math items are split into two distinct outcomes so that symbolic transformation is never mistaken for a verified claim:
  • Equality or proof claims (e.g., x**2 + 2*x + 1 = (x+1)**2) take the proof path. Verified identities return is_valid: true with message: "Identity verified". Non-identities return is_valid: false with message: "Not equal".
  • Non-equality expressions (e.g., x + x) are simplified only. They are returned as explicit simplification results, not as valid proofs.
Simplification-only results include: Example response for "x + x":
A successfully simplified expression is not a verified claim. Treat status: "SIMPLIFIED" results as transformed input, not as proof. To get a VERIFIED outcome from a math item, submit an equality (e.g., x + x = 2*x).

GET /verify/batch/

Get the status and results of a batch verification job. Use this to poll results when processing large batches. Response:

Agent endpoints

POST /agents/register

Register a new AI agent with QWED for verified agentic workflows. Request:
Agent types: Response:
Store the agent_token immediately — it cannot be retrieved again after registration.

POST /agents//verify

Updated in v5.0.0
Verify a claim using an agent token. Creates an auditable record tied to the agent. Security checks are enforced server-side — exfiltration detection always runs, and MCP poisoning detection runs automatically when a tool_schema is provided.
Breaking change (v5.0.0): The security_checks request field has been removed. Security checks are now mandatory and enforced server-side. You no longer need to (or can) opt in to exfiltration or MCP poison checks.
Breaking change (v5.0.0): The context field with conversation_id and step_number is now required for all agent action verification requests. Requests without these fields are rejected with error code QWED-AGENT-CTX-001. See conversation controls for details.
Request:
Headers:
Security behavior:
  • Exfiltration check: Always runs on every agent verification request. If the query payload is flagged, the request is rejected with a 403.
  • MCP poison check: Runs automatically when tool_schema is present. If the tool definition is flagged, the request is rejected with a 403.
Error responses:

POST /agents//tools/

Submit an agent tool call for risk evaluation before execution. Unknown tools (not on the safe or dangerous operations list) are denied by default, regardless of risk score. See tool approval policy for details. Request:
Possible outcomes:

GET /agents//activity

Retrieve the audit log for a specific agent. Provides a full audit trail of all agent actions. Headers:
Query params: Response:

Attestation endpoints

GET /attestation/

Get an attestation by ID.

POST /attestation/verify

Verify an attestation JWT. Request:

Observability endpoints

GET /metrics

Returns global system metrics and per-tenant breakdowns. Requires admin authentication. Provide either a JWT token for an active user with the owner or admin role, or an API key linked to an active owner or admin user. Headers (one of):
Response:

GET /metrics/

Returns metrics scoped to a specific organization. Tenants can only view their own metrics.

GET /metrics/prometheus

Returns metrics in Prometheus text format for scraping by monitoring infrastructure. Requires the same admin authentication as GET /metrics. Headers (one of):

GET /logs

Returns verification logs for the authenticated tenant, ordered by most recent first. Query params: Response:

Admin endpoints

New in v4.0.0
These endpoints require the admin:all API key scope.

GET /admin/compliance/export/csv

Export the full audit trail as a CSV file.

GET /admin/compliance/verify/

Cryptographically verify a specific audit log entry using HMAC-SHA256 and hash-chain validation. The response reports three independent checks: payload hash, HMAC signature (compared in constant time), and chain linkage to the prior entry within the same organization. Genesis entries must have a null previous_hash; non-genesis entries must link to a non-empty prior entry hash. Entries with malformed stored result payloads cause verification to fail closed with SecurityError instead of returning "valid": true. Hash matching accepts either the current canonical payload (which includes raw_llm_output) or the legacy canonical payload, so entries written before that field was covered remain verifiable after the upgrade. Response:
AuditLogger requires QWED_AUDIT_SECRET_KEY to be set. If the key is missing or persisted chain continuity cannot be loaded, initialization raises SecurityError and verification endpoints fail closed.

GET /admin/compliance/report/soc2/

Generate a SOC 2 Type II compliance report for an organization.

GET /admin/security/threats/

Returns a real-time threat summary for an organization, including blocked injection attempts and anomalous patterns.

POST /admin/keys/rotate

Rotate an API key. Available to admin and member roles. Request:

Badge endpoints

All badge endpoints return SVG images (image/svg+xml). You can embed them directly in Markdown or HTML.

GET /badge/verified

Get a verified or failed badge SVG.

GET /badge/status/

Get a badge for any verification status (e.g., VERIFIED, FAILED, CORRECTED, BLOCKED, PENDING, ERROR).

GET /badge/attestation/

Get a badge for a specific attestation by ID.

GET /badge/engine/

Get a badge for a specific verification engine.

GET /badge/custom

Generate a custom badge with configurable label, message, color, and logo.