BentoSDK
Concepts

Two API hosts

You usually only need one host to start. Here's the split, and when to add the second.

Bento runs on two hosts, and the SDK routes each call to the right one. You only need the markets host to start. Add the tournaments host when you reach tournaments.

Markets host: baseUrl

https://internal-server.bento.fun (testnet). Where you start: bets, packs, create-market, and portfolio.

ClientProductsAuth
sdk.publiccatalog, packs, analyticsNone (open reads)
sdk.public.authlogin, registerBuilder API key
sdk.userbets, create market, withdrawBuilder API key + Bearer JWT

Tournaments host: tournamentsBaseUrl

Set PARLAY_TOURNAMENT_URL only when you need bracket tournaments or F1. Testnet default: https://bento-fun-tournaments-backend-3nku.onrender.com. Omit it and sdk.tournaments / sdk.onchain are undefined. Full table: Environments.

ClientProducts
sdk.tournamentsbracket tournaments, F1, LP pool
HTTP /bento/sportmonks/*Sportmonks sports data proxies (Builder key + rate limits; not on the SDK client) — guide

Auth differs per host

  • Builder key: required apiKey on createBentoSdkx-builder-api-key (also required on tournaments sports proxies). Mint one.
  • Markets user: Bearer JWT from eoaLogin / eoaRegister, via walletAuthProvider.
  • Tournaments user: JWT on tournamentsAuth (prefer over legacy x-wallet-* headers).
const sdk = createBentoSdk({
  baseUrl: 'https://internal-server.bento.fun',
  apiKey: process.env.BENTO_BUILDER_API_KEY!,
  tournamentsBaseUrl: process.env.PARLAY_TOURNAMENT_URL, // optional
  auth: walletAuthProvider(() => ({ Authorization: `Bearer ${token}` })),
  tournamentsAuth: jwtAuthProvider({ getAccessToken: () => token }),
});

Building only tournaments? Use createTournamentsSdk({ baseUrl: tournamentsBaseUrl, auth }).

On this page