Skip to content
TAO$188.10
BTC0.002929
MCap$2.22B
Vol$86.25M

API reference / Runtimes and storage

What changed between two runtimes

GET/api/v2/runtimes/{spec_version}/diff
Status
Stable
Auth
API key or OAuth access token
Scope
data:read
Rate limit
plan

What changed from runtime from (default: the previous runtime) to {spec_version}: pallets added, removed or moved (data.pallets; a moved pallet re-encodes every call) and every item added, removed or changed (data.items, by pallet, kind and name, with the item before and after).

Full description

What changed from runtime from (default: the previous runtime) to {spec_version}: pallets added, removed or moved (data.pallets; a moved pallet re-encodes every call) and every item added, removed or changed (data.items, by pallet, kind and name, with the item before and after). A changed item says what changed: index_changed (the encoding byte moved), signature_changed (the shape: sig_hash), value_changed (a constant's value), and with include=docs docs_changed (docs-only changes are listed only then). include=docs adds the docs to before / after, include=types the type trees: large (301 -> 470 is ~500 KB, ~2.2 MB with both). from may be any other runtime, older or newer. meta.counts are the items by change; meta.from_spec / meta.from_metadata_version name the other side. Compare items across runtimes on sig_hash, never on the signature text: two signatures can render identically while the type tree differs (runtime 432 changed 22 items whose text stayed the same). meta.spec_version is the runtime and meta.metadata_version the metadata its items were decoded from (15 from spec 149, else 14). A runtime's decoded metadata never changes, so the answer is cached as settled with an ETag that does not follow the head (meta.at is that of when it was computed). Errors are application/problem+json: INVALID_FROM (400: not a runtime, the same runtime, or nothing before the first runtime), INVALID_INCLUDE, INVALID_SPEC_VERSION, RUNTIME_NOT_FOUND (404), NOT_READY (503, never cached: a new runtime is still being decoded), UNKNOWN_PARAMETER, SOURCE_TIMEOUT (503), SOURCE_NOT_READY (503).

Path parameters

spec_versionpath, required· integer · 0 to 2147483647

The runtime's spec_version (e.g. 470).

Query parameters

fromquery· string

The runtime to compare against (a spec_version); default: the previous runtime. 400 INVALID_FROM unless a spec_version of another runtime.

includequery· string

Comma list: docs (add docs and docs_changed), types (add the type trees). Anything else is a 400 INVALID_INCLUDE.

Response

data is an object with these fields. Amounts are integer strings in their base unit, and null means unknown, never zero (see Units and formats). meta.at names the block the answer was read at.

Pallets and items that differ.

palletsarray of objects

Pallets added, removed or moved.

4 fields in pallets (each item)
namestring

The pallet's name.

changestring

added, removed, or index_changed (a moved pallet re-encodes every call). New values may be added; show an unknown value as is (or generically).

before_indexinteger · unit id · can be null

Its index in the from runtime; null when added.

after_indexinteger · unit id · can be null

Its index in this runtime; null when removed.

itemsarray of objects

Items added, removed or changed, by pallet, kind, name.

10 fields in items (each item)
palletstring

The pallet (for a runtime API method: the trait).

kindstring

What the item is. Known values: call, event, storage, constant, error, runtime_api. New values may be added; show an unknown value as is (or generically).

namestring

The item's name.

changestring

What happened to it. Known values: added, removed, changed. New values may be added; show an unknown value as is (or generically).

index_changedboolean · optional

changed rows only (absent otherwise): the call / event / error index moved (re-encodes).

signature_changedboolean · optional

changed rows only (absent otherwise): the shape changed (sig_hash differs).

value_changedboolean · optional

changed rows only (absent otherwise): a constant's value changed (same type).

docs_changedboolean · optional

changed rows with include=docs only (absent otherwise): the docs changed. A docs-only change is listed only with include=docs.

beforeobject · can be null

The item in the from runtime; null when added.

6 fields in before
indexinteger · unit id · can be null

A call's, event's or error's variant index (the encoding byte); a storage item's, constant's or runtime API method's position. Null when the metadata gives none.

signaturestring

The readable signature: type names, newtypes over primitives as NetUid(u16); a storage item as Map(hasher key, ...) -> value [modifier, default], a constant as type = value, a runtime API method as (inputs) -> output. For display only: compare on sig_hash.

sig_hashstring

sha256 of the item's shape (its structured types; docs excluded), 64 lower-case hex: equal across runtimes when the item did not change. Compare items on sig_hash, never on signature: two signatures can render identically while the type tree differs (runtime 432 changed 22 items whose text stayed the same, e.g. SubtensorModule.set_root_claim_type).

Pattern: ^[0-9a-f]{64}$
first_specinteger · unit id · can be null

The earliest runtime with this item in this shape (this sig_hash). Null when not known.

docsarray of string · optional

Only with include=docs (absent otherwise): the documentation lines.

typesobject · optional

Only with include=types (absent otherwise): the structured form. Fields with their type text and tree; a storage item's keys (hasher, type, tree), value, modifier and default; a constant's type, tree, value and raw bytes; a runtime API method's inputs and output. Trees stop at the runtime's outer enums (RuntimeCall, ...) and at recursion ({ref}).

afterobject · can be null

The item in this runtime; null when removed.

6 fields in after
indexinteger · unit id · can be null

A call's, event's or error's variant index (the encoding byte); a storage item's, constant's or runtime API method's position. Null when the metadata gives none.

signaturestring

The readable signature: type names, newtypes over primitives as NetUid(u16); a storage item as Map(hasher key, ...) -> value [modifier, default], a constant as type = value, a runtime API method as (inputs) -> output. For display only: compare on sig_hash.

sig_hashstring

sha256 of the item's shape (its structured types; docs excluded), 64 lower-case hex: equal across runtimes when the item did not change. Compare items on sig_hash, never on signature: two signatures can render identically while the type tree differs (runtime 432 changed 22 items whose text stayed the same, e.g. SubtensorModule.set_root_claim_type).

Pattern: ^[0-9a-f]{64}$
first_specinteger · unit id · can be null

The earliest runtime with this item in this shape (this sig_hash). Null when not known.

docsarray of string · optional

Only with include=docs (absent otherwise): the documentation lines.

typesobject · optional

Only with include=types (absent otherwise): the structured form. Fields with their type text and tree; a storage item's keys (hasher, type, tree), value, modifier and default; a constant's type, tree, value and raw bytes; a runtime API method's inputs and output. Trees stop at the runtime's outer enums (RuntimeCall, ...) and at recursion ({ref}).

Response headers

10 headers: ETag, Cache-Control, CDN-Cache-Control, X-BTAI-Stale, X-BTAI-Stale-As-Of, RateLimit-Policy, RateLimit, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset
ETag

Strong validator of this answer. Send it back as If-None-Match: an unchanged answer is a 304 Not Modified without a body. A settled answer's validator leaves the chain head out, so it stays valid as the head moves.

Cache-Control

One of three classes: settled public, max-age=3600, stale-while-revalidate=86400 (pinned to a block that cannot move), slow public, max-age=300, stale-while-revalidate=600 (state that moves in minutes or days) or tip public, max-age=6, stale-while-revalidate=12 (follows the chain head); the label routes are cached until the next nightly copy (public, max-age=<seconds>, stale-while-revalidate=60). Never immutable. no-store on an earlier answer served because the data source failed (X-BTAI-Stale).

CDN-Cache-Control

The same class for shared caches (RFC 9213; browsers ignore it): settled 24 h, slow 300 s, tip 6 s, each with stale-while-revalidate and stale-if-error; no-store with X-BTAI-Stale.

X-BTAI-Stale

Present only when the data source failed to answer (it timed out or was unavailable) and an earlier answer to the same request is served instead of a 503 (stale if error, RFC 5861). Then if-error, with X-BTAI-Stale-As-Of, Age (its seconds since then) and Warning: 110 - "Response is Stale", and Cache-Control: no-store: the answer is never kept as fresh, and a later request reads again. Prices and quotes are never served this way.

X-BTAI-Stale-As-Of

With X-BTAI-Stale: when the earlier answer served was produced, an RFC 3339 UTC time (2026-10-21T12:00:00Z).

RateLimit-Policy

The tier's request quota of the current window (IETF draft), e.g. "tier";q=600.

RateLimit

Requests left in the current window and the seconds until it resets (IETF draft), e.g. "tier";r=597;t=42.

X-RateLimit-Limit

The tier's request quota of the current window.

X-RateLimit-Remaining

Requests left in the current window.

X-RateLimit-Reset

When the current window resets, Unix seconds.

Status codes

200 · 304 · 400 · 401 · 402 · 403 · 404 · 429 · 500 · 502 · 503

304 Not Modified: the If-None-Match validator still matches; no body.

Error codes

The codes this endpoint can return. Each links to what it means and what to do.

From the API's published specification, version 1.165.0.