Work with this as data
Every API here is available over the APIs.io API and to AI agents over MCP.
MCP server
One button, every client — Claude, Cursor, VS Code and the rest.
https://apis.io/mcp
Tools for apis
7 MCP tools reach this
find_apisBrowse and filter every API in the catalog.get_api_artifactsOne API's artifacts, grouped by type.get_openapiThe primary OpenAPI for this API.find_similar_apisAPIs that look like this one.apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.resolveTurn a domain, URL or GitHub org into the provider it belongs to.find_cohortsEvery scored population of providers in the catalog.
Call it yourself
curl for this page
This API
curl "https://apis.io/api/v1/apis/mnemom-ai:mnemom-ai-on-chain-api"
All apis
curl "https://apis.io/api/v1/apis?limit=25"
Calls without X-API-Key need no key. Calls with it need a paid plan — get a key.
Get an API key
Free tier, no form to fill in. Signing in shares your email address with us — we store it to create your key and to recognise you if you sign in with another provider. By signing up you are subscribing to the APIs.io and API Evangelist newsletters — you can unsubscribe from any issue. See our Privacy Policy and Terms.
A second provider on the same verified email joins the account you already have.
OpenAPI Specification
openapi: 3.2.0
info:
title: Mnemom On Chain API
description: Trust infrastructure for AI agents. Transparent alignment verification, behavioral drift detection, and accountability primitives.
version: 1.0.0
contact:
name: Mnemom
url: https://mnemom.ai
email: support@mnemom.ai
license:
name: Apache 2.0
url: https://www.apache.org/licenses/LICENSE-2.0
servers:
- url: https://api.mnemom.ai/v1
description: Production
security:
- BearerAuth: []
- ApiKeyAuth: []
tags:
- name: On Chain
description: On-chain verification and proofs.
paths:
/on-chain/history:
get:
operationId: getOnChainHistory
summary: Get on-chain history
description: Retrieve the history of on-chain Merkle root anchoring events. Returns a paginated list of all anchors with their transaction details, included agents, and verification status.
tags:
- On Chain
security: []
parameters:
- name: chain
in: query
schema:
type: string
enum:
- base-sepolia
- base
description: Filter by blockchain network (matches on_chain_anchors.chain CHECK constraint)
- name: agent_id
in: query
schema:
type: string
description: Filter anchors that include this agent
- name: from
in: query
schema:
type: string
format: date-time
description: Start of time range
- name: to
in: query
schema:
type: string
format: date-time
description: End of time range
- name: limit
in: query
schema:
type: integer
default: 50
minimum: 1
maximum: 100
description: Maximum number of records to return (handler default 50; values above 100 are clamped to 100).
- name: offset
in: query
schema:
type: integer
default: 0
minimum: 0
description: Number of records to skip for pagination
responses:
'200':
description: 'On-chain anchoring history: the page of anchor rows plus the effective `limit`/`offset` echoed back by the handler (handleGetAnchoringHistory in src/on-chain/handlers.ts).'
content:
application/json:
schema:
type: object
required:
- anchors
properties:
anchors:
type: array
items:
$ref: '#/components/schemas/OnChainAnchorResult'
limit:
type: integer
description: Effective page size applied to this response.
offset:
type: integer
description: Effective offset applied to this response.
'400':
$ref: '#/components/responses/BadRequest'
'401':
$ref: '#/components/responses/Unauthorized'
'403':
$ref: '#/components/responses/Forbidden'
'404':
$ref: '#/components/responses/NotFound'
'429':
$ref: '#/components/responses/TooManyRequests'
'500':
$ref: '#/components/responses/InternalServerError'
/on-chain/status/{agent_id}:
get:
operationId: getOnChainStatus
summary: Get on-chain status
description: Get the current on-chain anchoring status for an agent. Returns the most recent anchor, pending publications, and overall on-chain coverage statistics.
tags:
- On Chain
security: []
parameters:
- $ref: '#/components/parameters/AgentId'
responses:
'200':
description: 'On-chain status for the agent, as assembled by the get_on_chain_status RPC (migrations 057/058): the agent''s latest score publication, the latest confirmed anchor, and the agent''s current Merkle-tree summary. Each of the three nested objects is `null` when no matching row exists.'
content:
application/json:
schema:
type: object
required:
- agent_id
properties:
agent_id:
type: string
latest_score_publication:
description: The agent's most recent row in score_publications, or `null` when the agent has never been published.
anyOf:
- type: object
additionalProperties: true
properties:
id:
type: string
score:
type: integer
grade:
type: string
tx_hash:
type:
- string
- 'null'
block_number:
type:
- integer
- 'null'
chain:
type: string
enum:
- base-sepolia
- base
status:
type: string
enum:
- pending
- confirmed
- failed
published_at:
type: string
format: date-time
- type: 'null'
latest_anchor:
description: The most recent `confirmed` on-chain anchor, or `null` when none is confirmed yet. (The RPC filters to status='confirmed' and omits gas_used/created_at.)
anyOf:
- $ref: '#/components/schemas/OnChainAnchorResult'
- type: 'null'
merkle_tree:
description: Summary of the agent's current Merkle tree (from agent_merkle_trees), or `null` when the agent has no tree.
anyOf:
- type: object
additionalProperties: true
properties:
merkle_root:
type:
- string
- 'null'
leaf_count:
type:
- integer
- 'null'
tree_depth:
type:
- integer
- 'null'
updated_at:
type:
- string
- 'null'
format: date-time
- type: 'null'
'400':
$ref: '#/components/responses/BadRequest'
'401':
$ref: '#/components/responses/Unauthorized'
'403':
$ref: '#/components/responses/Forbidden'
'404':
$ref: '#/components/responses/NotFound'
'429':
$ref: '#/components/responses/TooManyRequests'
'500':
$ref: '#/components/responses/InternalServerError'
/on-chain/verify-proof/{agent_id}:
get:
operationId: verifyOnChainProof
summary: Verify on-chain proof
description: 'Verify an agent''s Merkle commitment. The agent''s stored root is **recomputed from its stored leaf hashes**, the stored `leaf_count` is checked against the actual number of leaves, and — when `leaf_index` is supplied — a real inclusion proof for that leaf is generated and verified against the recomputed root and returned so the caller can re-derive it independently. The confirming anchor is then looked up by the **recomputed** root, so an anchor row can never vouch for a root nobody can rebuild.
**Scope limit, stated rather than hidden:** the anchored root is read from Mnemom''s own anchor record, not from a Base RPC call. A `verified: true` therefore means "this tree is internally consistent and matches the root we recorded as anchored" — it does not by itself prove the chain agrees. `verification.anchored_root_source` reports this.'
tags:
- On Chain
security: []
parameters:
- $ref: '#/components/parameters/AgentId'
- name: leaf_index
in: query
schema:
type: integer
minimum: 0
description: Optional. Zero-based index of a single leaf to prove inclusion for. When supplied, the response carries an `inclusion_proof` (leaf hash + sibling path) that has been verified against the recomputed root; the caller can replay it without trusting this endpoint. When omitted, only the root recomputation and leaf-count checks are performed.
responses:
'200':
description: 'Proof verification result. `verified: true` requires ALL of: the root recomputes from the stored leaf hashes, `leaf_count` agrees with the leaf array, any requested inclusion proof verifies, and a `confirmed` anchor exists for the recomputed root. Any failed step returns `verified: false` with a `reason` — never a bare true. (handleVerifyProof in src/on-chain/handlers.ts.)'
content:
application/json:
schema:
type: object
required:
- verified
- agent_id
properties:
verified:
type: boolean
description: True only when the agent's root was successfully recomputed from its stored leaves AND a confirmed on-chain anchor exists for that recomputed root (and, if `leaf_index` was supplied, its inclusion proof verified).
agent_id:
type: string
reason:
type: string
enum:
- no_merkle_tree
- no_checkpoint
- no_leaf_hashes
- root_mismatch
- leaf_count_mismatch
- leaf_index_out_of_range
- inclusion_proof_failed
- not_anchored
description: 'Present only when `verified` is false. `no_merkle_tree`: the agent has no merkle tree row; `no_checkpoint`: the tree has no merkle_root yet; `no_leaf_hashes`: a root is stored but no leaves are, so it cannot be rebuilt; `root_mismatch`: the root recomputed from the stored leaves does not equal the stored root (tampering or corruption); `leaf_count_mismatch`: the stored leaf_count disagrees with the number of stored leaves (silent truncation); `leaf_index_out_of_range`: the requested leaf_index exceeds the tree; `inclusion_proof_failed`: the proof for the requested leaf does not reconstruct the root; `not_anchored`: the tree verifies but has no confirmed anchor.'
merkle_root:
type: string
description: The agent's stored Merkle root. Present when a checkpoint exists (i.e. absent for the `no_merkle_tree`/`no_checkpoint` cases).
recomputed_root:
type: string
description: The root recomputed from the stored leaf hashes. Returned only on `root_mismatch`, so the discrepancy is inspectable.
leaf_count:
type: integer
description: Leaf count, included on the `leaf_count_mismatch` and `leaf_index_out_of_range` failures for diagnosis.
leaf_hashes_length:
type: integer
description: Actual number of stored leaf hashes. Returned only on `leaf_count_mismatch`.
inclusion_proof:
type:
- object
- 'null'
description: The verified inclusion proof for the requested leaf. Null when `leaf_index` was not supplied. The caller can recompute the root from `leaf_hash` plus the sibling path without trusting this endpoint.
properties:
leaf_hash:
type: string
leaf_index:
type: integer
tree_size:
type: integer
siblings:
type: array
items:
type: object
properties:
hash:
type: string
position:
type: string
enum:
- left
- right
verification:
type: object
description: What was actually checked, so a caller never has to infer it from `verified` alone.
properties:
root_recomputed_from_leaves:
type: boolean
description: True when the stored root was successfully rebuilt from the stored leaves.
leaf_count:
type: integer
leaf_count_checked:
type: boolean
description: Whether the stored `leaf_count` was available to compare against the leaf array. False when the row carries no usable count, in which case the silent-truncation check could not run — reported rather than skipped silently.
inclusion_proof_verified:
type:
- boolean
- 'null'
description: True when a requested inclusion proof verified; null when no `leaf_index` was supplied (not checked, as distinct from checked-and-failed).
anchored_root_source:
type:
- string
- 'null'
enum:
- mnemom_database
- null
description: Where the anchored root was read from. `mnemom_database` means Mnemom's own anchor record, NOT a Base RPC read — the residual trust assumption, disclosed rather than hidden. Null when no confirmed anchor was found.
anchor:
type: object
description: The confirming anchor. Present only when `verified` is true.
properties:
tx_hash:
type:
- string
- 'null'
block_number:
type:
- integer
- 'null'
chain:
type: string
enum:
- base-sepolia
- base
anchored_at:
type: string
format: date-time
'400':
$ref: '#/components/responses/BadRequest'
'401':
$ref: '#/components/responses/Unauthorized'
'403':
$ref: '#/components/responses/Forbidden'
'404':
$ref: '#/components/responses/NotFound'
'429':
$ref: '#/components/responses/TooManyRequests'
'500':
$ref: '#/components/responses/InternalServerError'
components:
responses:
Unauthorized:
description: Authentication required
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
InternalServerError:
description: Server error — request was well-formed but the server failed to fulfill it. Typically a downstream dependency (DB / RPC / external API) returned an unexpected error.
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
TooManyRequests:
description: Rate-limit exceeded. The global per-IP limiter (100 requests/minute, applied to every `/v1/*` route) rejected this request. Back off until the window resets — `Retry-After` carries the cooldown in seconds and `X-RateLimit-Reset` the absolute reset time.
headers:
Retry-After:
description: Seconds to wait before retrying.
schema:
type: integer
minimum: 1
X-RateLimit-Limit:
description: Requests permitted per window.
schema:
type: integer
X-RateLimit-Remaining:
description: Requests remaining in the current window (0 on a 429).
schema:
type: integer
minimum: 0
X-RateLimit-Reset:
description: Unix epoch seconds at which the current window resets.
schema:
type: integer
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
Forbidden:
description: Forbidden
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
BadRequest:
description: Bad request
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
NotFound:
description: Resource not found
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
schemas:
OnChainAnchorResult:
type: object
description: An on-chain Merkle-root anchoring record — a row from the `on_chain_anchors` table (migration 057). Returned by GET /on-chain/history (raw row, all columns) and embedded as `latest_anchor` in GET /on-chain/status (subset via the get_on_chain_status RPC, which omits gas_used/created_at).
properties:
id:
type: string
description: Anchor record identifier (`oca-<uuid>`).
merkle_root:
type: string
description: Hex-encoded Merkle root hash that was anchored
tx_hash:
type:
- string
- 'null'
description: Blockchain transaction hash. Null while the anchor is pending (recorded before the transaction is broadcast).
block_number:
type:
- integer
- 'null'
description: Block number in which the transaction was included. Null until the anchor is confirmed on-chain.
leaf_count:
type: integer
description: Number of leaves covered by this anchor.
tree_depth:
type: integer
description: Depth of the Merkle tree.
gas_used:
type:
- integer
- 'null'
description: Gas consumed by the anchoring transaction. Null until the transaction is broadcast/confirmed.
chain:
type: string
enum:
- base-sepolia
- base
description: Blockchain network where the anchor was created. Matches the on_chain_anchors.chain CHECK constraint; defaults to `base-sepolia`.
status:
type: string
enum:
- pending
- confirmed
- failed
description: Lifecycle status of the anchor record.
anchored_at:
type: string
format: date-time
description: Timestamp when the anchor was created
created_at:
type: string
format: date-time
description: Row creation timestamp (present on raw history rows).
Error:
type: object
description: Canonical error envelope (ADR-API-001 conv 1). `error` is always an object — never a bare string. Every 4xx/5xx response across the API conforms to this shape; the runtime helper is `src/http-errors.ts::buildErrorBody`.
required:
- error
properties:
error:
type: object
required:
- code
- message
properties:
code:
type: string
pattern: ^[a-z][a-z0-9_]*$
description: 'Stable, machine-matchable failure identifier (lowercase snake_case). Clients may branch on this; the string is part of the contract.
**Status-class defaults** — emitted when no caller code is supplied (`errorCodeForStatus(status)`): `bad_request` (400), `unauthorized` (401), `forbidden` (403), `not_found` (404), `method_not_allowed` (405), `conflict` (409), `gone` (410), `precondition_failed` (412), `payload_too_large` (413), `unsupported_media_type` (415), `unprocessable_entity` (422), `precondition_required` (428), `rate_limited` (429), `internal_error` (500), `not_implemented` (501), `bad_gateway` (502), `service_unavailable` (503), `gateway_timeout` (504). Fallback `error` for unmapped statuses.
**Caller-supplied codes** — handlers may pass an explicit `code` for a specific failure class. Examples: `agent_not_found`, `invalid_hash_proof`, `already_linked`, `idempotency_conflict`, `feature_gated`, `schema_validation_failed`, `no_token`, `bad_canonical_payload`.
**Care-framed sub-resource codes** — the cards-as-primitive surface passes its stable care code-string straight through as `error.code`. Examples: `if_match_absent`, `if_match_stale`, `if_match_malformed`, `primitive_validation_failed`.'
message:
type: string
description: Human-readable, care-framed explanation of the failure.
details:
description: 'Optional structured context for the failure (any JSON value: object, array, or primitive). Common shapes: validation findings list, idempotency-conflict diff, `{presented_etag, current_etag}` on a stale `If-Match`, etc. Mirrors the helper''s `details?: unknown`.'
parameters:
AgentId:
name: agent_id
in: path
required: true
schema:
type: string
description: Agent identifier (e.g. smolt-abc123)
securitySchemes:
BearerAuth:
type: http
scheme: bearer
bearerFormat: JWT
description: 'Supabase JWT token in Authorization: Bearer header'
ApiKeyAuth:
type: apiKey
in: header
name: X-Mnemom-Api-Key
description: Mnemom API key (mnm_... format)
ServiceRole:
type: http
scheme: bearer
bearerFormat: JWT
description: Supabase service role bearer JWT. Used by /blog admin operations that talk directly to Supabase. NOT used by /internal/* or /v1/arena/internal/* — those use the custom-header schemes below.
InternalKeyAuth:
type: apiKey
in: header
name: X-Internal-Key
description: Internal service-to-service shared secret, timing-safe compared against INTERNAL_API_KEY. Used by /internal/* gateway routes (compose, agents, webhooks emit).
ServiceKeyAuth:
type: apiKey
in: header
name: X-Service-Key
description: Service-to-service shared secret, timing-safe compared against MNEMOM_SERVICE_KEY. Used by /v1/arena/internal/*, /v1/on-chain/*, and the /v1/internal/* readers consumed by the reputation cron.
CoherenceTokenAuth:
type: http
scheme: bearer
description: Per-cell coherence bearer token. Provisioned in 1Password vault `mnemom-coherence` (one item per receiver). Value compared against COHERENCE_<NAME>_SERVICE_TOKEN_EXPECTED. Used by /v1/internal/coherence/* and /v1/internal/governance/dispatch.
ArenaCandidateTokenAuth:
type: http
scheme: bearer
description: Dedicated arena writer token (ADR-004 §"Arena dedicated writer token"). Compared against ARENA_RECIPE_CANDIDATE_TOKEN. The token's only capability is writing recipe candidates with writer_identity='arena-bypass' (stamped server-side). Used by POST /v1/internal/recipe-candidates.
CustomerVoiceTokenAuth:
type: http
scheme: bearer
description: Customer Voice API bearer token. Timing-safe compared against CUSTOMER_VOICE_API_TOKEN. Grants access to all /v1/internal/feedback/* endpoints (MNE-1876). No customer-facing or reporter-read capability.
CookieAuth:
type: apiKey
in: cookie
name: mnemom_session
description: 'HttpOnly, Secure, SameSite=Lax cookie issued by /v1/auth/sign-in (or the SSO / email-callback flows). The value is an AES-256-GCM-encrypted blob of {access_token, refresh_token, issued_at, auth_method}. Browser clients include this automatically with `credentials: "include"`.'
LicenseJwtAuth:
type: http
scheme: bearer
bearerFormat: JWT
description: License JWT (HS256, HMAC-signed with LICENSE_SIGNING_SECRET). Used by self-hosted deployment instances to authenticate `/v1/deployments/heartbeat`. Not interchangeable with the Supabase user JWT.
AgentAuth:
type: apiKey
in: header
name: X-Mnemom-Agent-Proof
description: 'Agent possession proof: the full SHA-256 hex digest of `${apiKey}|${agentName}` (or `${apiKey}` for an unnamed singleton agent) — the same `hash_proof` primitive used by POST /v1/agents claim, link-agent, and verify-binding. The server resolves the agent by `agent_hash = proof[:16]`. The agent''s *own* identity (ADR-API-001 third auth class) — distinct from ApiKeyAuth (`X-Mnemom-Api-Key`, which resolves a user/account, not an agent).'