Docs / Introduction
BB

Boost Boss API

The monetization and advertising API for the AI era. REST-based, JSON everywhere, sub-50ms median latency.

The Boost Boss API lets you fetch ads, beacon events, and manage campaigns programmatically. This reference covers every endpoint, every parameter, and every response field. The API is organized around REST โ€” predictable URLs, standard HTTP verbs, standard status codes, JSON request and response bodies.

If you're monetizing an AI app, start with the SDK quickstart. If you're running campaigns, skip to Create campaign. If you're integrating via OpenRTB, see our exchange docs.

Quickstart

Install the SDK, set your API key, fetch your first ad.

1. Install

bashCopy
npm install @boostboss/sdk
# or
pip install boostboss
# or
go get github.com/boostboss/go-sdk

2. Initialize the client

TypeScriptCopy
import { BoostBoss } from '@boostboss/sdk';

const bb = new BoostBoss({
  apiKey: process.env.BB_API_KEY,
  environment: 'live', // or 'test'
});

3. Fetch an ad

TypeScriptCopy
const ad = await bb.fetch({
  format: 'native',
  context: "help me refactor this python script",
  audience: 'ai-native',
});

// ad.headline  โ†’ "Ship better code 10ร— faster"
// ad.body      โ†’ "The AI coding assistant..."
// ad.cta_url   โ†’ "https://cursor.com/?ref=bb"
// ad.beacons   โ†’ { impression, click, convert }
โœฆ
Tip: the SDK automatically fires the impression beacon when you render the ad. You only need to call ad.trackClick() when the user clicks through.

Authentication

Boost Boss uses bearer tokens for authentication. Your API key must be passed in the Authorization header on every request.

HTTPCopy
Authorization: Bearer bb_sk_live_1a2b3c4d5e6f...

You have two key types:

!
Key hygiene: rotate keys from the dashboard โ†’ Settings โ†’ API keys. Old keys are revoked instantly. We send a webhook and an email when a key is rotated or suspected of being exposed.

Environments

Two environments. Both use the same SDKs and endpoints โ€” you switch by using the corresponding keys.

EnvironmentKey prefixBase URLNotes
testbb_sk_test_*api.boostboss.aiNo real spend. No real payouts. Mock ads.
livebb_sk_live_*api.boostboss.aiReal auctions. Real spend. Real earnings.

TypeScript / JavaScript SDK

The recommended client for browsers, Node, and Deno. Zero dependencies, 8kb gzipped.

TypeScriptCopy
import { BoostBoss, NativeAd } from '@boostboss/sdk';

const bb = new BoostBoss({ apiKey: 'bb_sk_live_***' });

const ad: NativeAd = await bb.fetch({
  format: 'native',
  context: userMessage,
  mcpTools: ['filesystem', 'github'],
  model: 'claude-sonnet-4',
});

// Render the ad in your UI
renderCard({
  headline: ad.headline,
  body: ad.body,
  cta: ad.cta_text,
  onClick: () => ad.trackClick(),
});

Python SDK

PythonCopy
from boostboss import BoostBoss

bb = BoostBoss(api_key="bb_sk_live_***")

ad = bb.fetch(
    format="native",
    context=user_message,
    mcp_tools=["filesystem", "github"],
    model="claude-sonnet-4",
)

if ad:
    render_card(ad.headline, ad.body, ad.cta_text)
    ad.track_click()  # on user click

Go SDK

GoCopy
import "github.com/boostboss/go-sdk"

bb := boostboss.New("bb_sk_live_***")

ad, err := bb.Fetch(ctx, &boostboss.FetchRequest{
    Format:   "native",
    Context:  userMessage,
    McpTools: []string{"filesystem", "github"},
    Model:    "claude-sonnet-4",
})
if err != nil { log.Fatal(err) }

Swift SDK

SwiftCopy
import BoostBoss

let bb = BoostBoss(apiKey: "bb_sk_live_***")

let ad = try await bb.fetch(
    format: .native,
    context: userMessage,
    mcpTools: ["filesystem", "github"]
)

Kotlin SDK

KotlinCopy
import ai.boostboss.BoostBoss

val bb = BoostBoss(apiKey = "bb_sk_live_***")

val ad = bb.fetch(
    format = "native",
    context = userMessage,
    mcpTools = listOf("filesystem", "github")
)

Fetch ad

POST/v1/ads/fetchRun an auction and return the winning ad.

Runs a real-time auction against your targeting parameters and returns the winning ad creative with signed beacon URLs. Median latency: 47ms p50, 180ms p99.

Request body

FieldTypeDescription
formatreqstringOne of native, tool_result, agent_suggestion, display.
contextstringFree-form user intent or session snippet. Up to 2000 chars.
audiencestringAudience tier: ai-native, prosumer, or broad.
mcp_toolsstring[]Active MCP tool IDs in this session.
modelstringModel in use: claude-opus-4, claude-sonnet-4, gpt-5, etc.
user_idstringStable anonymous user identifier (hashed, not PII).
frequency_capobjectCaps: { per_session: 3, per_day: 10 }.

Example request

cURLCopy
curl https://api.boostboss.ai/v1/ads/fetch \
  -H "Authorization: Bearer bb_sk_live_***" \
  -H "Content-Type: application/json" \
  -d '{
    "format": "native",
    "context": "refactor this python function to use async",
    "audience": "ai-native",
    "mcp_tools": ["filesystem", "github"],
    "model": "claude-sonnet-4"
  }'

Example response

JSON ยท 200 OKCopy
{
  "id": "ad_3Xc9wZ8fK4",
  "format": "native",
  "headline": "Ship better code 10ร— faster",
  "body": "The AI coding assistant that actually reads your codebase.",
  "cta_text": "Try Cursor free",
  "cta_url": "https://cursor.com/?ref=bb",
  "advertiser": { "name": "Cursor", "verified": true },
  "beacons": {
    "impression": "https://api.boostboss.ai/v1/beacon/imp/...",
    "click":      "https://api.boostboss.ai/v1/beacon/clk/...",
    "convert":    "https://api.boostboss.ai/v1/beacon/cvt/..."
  },
  "bid_cpm": 3.42,
  "match_score": 0.91,
  "latency_ms": 47
}

Impression beacon

POST/v1/beacon/imp/:tokenFire when the ad becomes visible.

The SDK fires this for you automatically on render. If you're hitting the API directly, fire this beacon the first time the ad is visible in the viewport (โ‰ฅ50% pixels, โ‰ฅ1 second). Idempotent โ€” duplicates are deduped server-side.

Click beacon

POST/v1/beacon/clk/:tokenFire when the user clicks the ad.

Fire before redirecting to the CTA URL. Returns 302 to the verified advertiser destination โ€” so you can use it as the anchor's href directly.

Conversion beacon

POST/v1/beacon/cvt/:tokenFire when the user completes the advertiser's goal.

Advertisers use this to report conversions back โ€” signup complete, purchase made, install confirmed. Used by CPA bidders to pay per outcome.

List campaigns

GET/v1/campaignsList all campaigns for the authenticated advertiser.
Query paramTypeDescription
statusstringFilter: active, paused, review, ended.
limitintPage size. Default 20, max 100.
starting_afterstringCursor ID for pagination.

Create campaign

POST/v1/campaignsLaunch a new ad campaign.
FieldTypeDescription
namereqstringHuman-readable campaign name.
formatreqstringAd format to serve.
headlinereqstringAd headline, max 60 chars.
bodystringSupporting copy, max 200 chars.
cta_textreqstringCall-to-action button text.
cta_urlreqstringDestination URL.
billing_modelreqstringOne of cpm, cpc, cpa.
bid_amountreqnumberMax bid per unit (CPM, CPC, or CPA target).
daily_budgetreqnumberMaximum daily spend in USD.
intent_signalsstring[]AI-native intent targets. See AI targeting.
host_appsstring[]Target AI apps: claude, cursor, etc.
mcp_toolsstring[]Target active MCP tools.

Update campaign

PATCH/v1/campaigns/:idModify a running campaign.

Any field from Create campaign can be patched. Patching status to paused halts spend immediately. Patching creative triggers automatic creative re-review (typically under 15 minutes).

Get stats

GET/v1/statsAggregate performance metrics.

Returns impressions, clicks, conversions, spend, and derived rates (CTR, CVR, eCPA) across the time range. Break down by campaign, format, host_app, intent_signal, or day.

JSON ยท 200 OKCopy
{
  "range": { "from": "2026-04-01", "to": "2026-04-15" },
  "totals": {
    "impressions": 4_812_400,
    "clicks":      218_600,
    "conversions": 12_840,
    "spend_usd":   24810.00,
    "ctr":         0.0454,
    "cvr":         0.0587,
    "ecpa_usd":    1.93
  },
  "breakdown": [ ... ]
}

Ad formats

Boost Boss serves four native-first ad formats. Each is rendered by your app โ€” we return the content, you render the chrome that matches your UI.

FormatMax charsUse case
nativeHeadline 60 ยท body 200Inline card inside chat / agent output.
tool_resultHeadline 60 ยท body 140Shown after a tool call returns results.
agent_suggestionHeadline 40 ยท body 100"Try this tool" suggestion from an agent.
displayImage 300ร—250 / 728ร—90Traditional IAB banner for legacy contexts.

AI-native targeting

Boost Boss replaces cookie-based targeting with three session-level signals gathered from the MCP layer. All signals are anonymized and aggregated โ€” no PII ever leaves the client.

Intent signals

Free-form intent extracted from the current user request. Examples: "debugging python", "writing pitch deck", "refactoring code". Advertisers bid on the intents that match what they sell.

Tool context

Which MCP tools are active in the session โ€” filesystem, github, terminal, browser, slack, etc. Strong proxy for user activity type.

Model context

Which AI model is in use โ€” claude-opus-4, gpt-5, gemini-3, etc. Useful for advertisers with model-specific integrations.

i
No PII, ever. User identifiers are SHA-256 hashed before they leave the client. Intent strings are matched against a vocabulary server-side; raw text is dropped after matching. See our Privacy white paper for the full protocol.

MCP integration

The SDK hooks into your MCP client automatically. On initialization, it registers a listener for tool calls and user messages, uses those signals as context and mcp_tools when fetching ads, and otherwise gets out of your way.

TypeScriptCopy
import { BoostBoss } from '@boostboss/sdk';
import { McpClient } from '@modelcontextprotocol/sdk';

const mcp = new McpClient({ /* ... */ });
const bb  = new BoostBoss({
  apiKey: 'bb_sk_live_***',
  mcpClient: mcp, // โ† just pass it in
});

// The SDK now reads context from MCP automatically
const ad = await bb.fetch({ format: 'native' });

Webhooks

Receive real-time notifications for platform events. Configure endpoints in the dashboard โ†’ Settings โ†’ Webhooks.

EventFires when
ad.servedA fetch request returned an ad for one of your campaigns.
ad.impressionImpression beacon fired.
ad.clickUser clicked the ad.
ad.conversionConversion beacon fired.
campaign.approvedCampaign passed review and is now live.
campaign.rejectedCampaign was rejected. Reason in payload.
campaign.endedCampaign finished (budget exhausted or end date reached).
payout.initiatedA weekly publisher payout started processing.
payout.completedPayout landed in the publisher's bank / wallet.

Signature verification

Every webhook is signed with HMAC-SHA256. Verify with the signing secret from your dashboard:

NodeCopy
import crypto from 'crypto';

const sig = req.headers['bb-signature'];
const expected = crypto.createHmac('sha256', SECRET)
  .update(req.rawBody).digest('hex');

if (crypto.timingSafeEqual(
  Buffer.from(sig),
  Buffer.from(expected)
)) {
  // โœ“ verified โ€” process event
}

Rate limits

We rate-limit per API key to protect both us and you. Limits are applied at the second and minute level with a rolling window.

EndpointLimitBurst
POST /v1/ads/fetch500/s per key1000 over 10s
POST /v1/beacon/*Unlimitedโ€”
POST /v1/campaigns30/min per keyโ€”
GET /v1/stats60/min per keyโ€”

Responses include three headers on every request:

X-RateLimit-Limit:      500
X-RateLimit-Remaining:  487
X-RateLimit-Reset:      1760521200

Error codes

Errors return a JSON body with a machine-readable code, a human message, and a request_id you can cite when contacting support.

HTTPCodeMeaning
400invalid_requestMalformed body or missing required field.
401invalid_api_keyKey missing, revoked, or for the wrong environment.
402billing_requiredNo payment method on file.
403forbiddenAuthenticated but not authorized for this resource.
404not_foundResource does not exist.
409conflictState conflict (e.g. editing a campaign under review).
429rate_limitedToo many requests. Back off and retry with jitter.
500server_errorSomething broke on our side. Auto-retried up to 3ร—.