BentoSDK

OpenAPI workflow

How API contracts are pinned, published, and consumed by the SDK and docs site.

Where specs live

LayerLocation
Source of truthNestJS Swagger on backends (packages/backend/bento, packages/backend/tournaments)
Pinned snapshotspackages/documentation/contracts/*.json
Docs site (this UI)Markets API · Tournaments API
SDK method indexSDK API reference (auto-generated)
SDK typesGenerated in packages/sdk/src/openapi/

Pin contracts

# Markets (live /bento/docs-json)
BENTO_API_URL=https://mainnet-server.bento.fun pnpm docs:pin:markets

# Tournaments (local Nest export — prod disables Swagger)
pnpm docs:pin:tournaments

# Sync snapshots to docs site static assets
pnpm docs:sync-contracts

# Regenerate SDK types
pnpm verify:sdk

# Regenerate SDK API reference page (docs site)
pnpm docs:generate:sdk-reference

Live vs pinned on docs.bento.fun

  • Markets API page — tries live GET /bento/docs-json via NEXT_PUBLIC_MARKETS_OPENAPI_URL, falls back to pinned JSON.
  • Tournaments API page — uses pinned snapshot by default (Swagger off in production).

Backends are not moved into the documentation package — only exported JSON and the docs UI live there.

On this page