API

This section provides an overview of the PRISM MEV Platform API and how to consume the OpenAPI specification.

Health

  • GET /api/v1/providers/health — Returns providers health status.

OpenAPI

  • The OpenAPI spec is generated via utoipa from Rust types and handlers.

Generate the spec locally

You can produce fresh OpenAPI specs (JSON/YAML) into docs/api/ without building the full workspace:

make openapi-spec
# outputs:
#  - docs/api/openapi.yaml
#  - docs/api/openapi.json

Alternatively, call the binary directly (same effect):

cargo run --bin generate_frontend_clients -- --write-spec-only

Serve interactive docs (Swagger UI)

Run the lightweight docs server locally (no on-chain features needed):

make docs-server
# Swagger UI: http://localhost:8081/swagger-ui

Docs server endpoints for frontend consumption:

  • GET /api-docs/openapi.json
  • GET /api-docs/openapi.yaml
  • GET /api-docs/spec-version
  • GET /swagger-ui — Interactive UI

Local Testing

curl http://localhost:8080/api/v1/providers/health

Frontend Clients

Generate and sync TypeScript/JavaScript clients from the OpenAPI spec:

make clients-generate
FRONTEND_PATH=../your-frontend make clients-sync