OpenAPI is a specification format for REST APIs. This format is supported by several tools, such as Swagger UI which allows you to browse a specification and perform API calls from your browser. Several code generators also exist to generate API libraries for various programming languages.
The Rest API served by Octez on the RPC port is described by several OpenAPI specifications.
The full RPC served by a node is a union of:
For each protocol in use:
$PROTOCOL-openapi.json(served under the prefix:
$PROTOCOL-mempool-openapi.json(served under the prefix:
For instance, for an RPC listed as
GET /filter in
$PROTOCOL-mempool-openapi.json, its real endpoint is
These OpenAPI specifications, detailed below, can be generated by running the Octez node as shown in section How to Generate.
The links below to the different OpenAPI specifications are opened using the Swagger UI integrated in GitLab. This UI can be used for browsing the OpenAPIs (no need to install Swagger UI for that). However, the interactive use suggested in this UI does not currently work because:
the UI does not allow one to specify a server (which should correspond to a runnning Tezos node), and
browsers may block some of the generated requests or responses for security issues.
The node provide some RPCs which are independent of the protocol. Their OpenAPI specification can be found at:
The OpenAPI specification for RPCs which are specific to the Kathmandu (
protocol can be found at:
The OpenAPI specification for RPCs which are related to the mempool and specific to the Kathmandu protocol can be found at:
The OpenAPI specification for RPCs which are specific to the Lima (
protocol can be found at:
The OpenAPI specification for RPCs which are related to the mempool and specific to the Lima protocol can be found at:
How to Generate¶
To generate the above files, run the
from the root of the Tezos repository.
It will start a sandbox node, activate the protocol,
get the RPC specifications from this node and convert them to OpenAPI specifications.
To generate the OpenAPI specification for the RPCs provided by a specific protocol, update the following variables in src/bin_openapi/generate.sh:
protocol_hash, use the value defined in
How to Test¶
You can test OpenAPI specifications using Swagger Editor
to check for syntax issues (just copy-paste
rpc-openapi.json into it or open
it from menu
File > Import file).
You can run Swagger UI to get an interface
to browse the API (replace
xxxxxx with the directory where
rpc-openapi.json by the file you want to browse):
docker pull swaggerapi/swagger-ui docker run -p 8080:8080 -e SWAGGER_JSON=/mnt/rpc-openapi.json -v xxxxxx:/mnt swaggerapi/swagger-ui
Then open it in your browser.