Authentication

All embed APIs require authentication using API keys. This guide covers authentication methods for each API service.

Getting Your API Key

Get your API key from the embed Console. Your console API key starts with mbd- and works across all embed services.


Studio API

Base URL: https://api.mbd.xyz/v3/studio

The Studio API is the recommended way to build custom feed pipelines. It provides composable building-block services — Search, Features, Scoring, Ranking, and Stories — with full control over every stage.

Authentication Method

Include your console API key in the Authorization header using the Bearer scheme:

Authorization: Bearer mbd-{your-api-key}

The same console API key works across all Studio endpoints.

Endpoints

ServiceEndpointDescription
SearchPOST /search/filter_and_sortStructured search with filters and sorting
SearchPOST /search/boostRelevance-tuned search with boost filters
SearchPOST /search/semanticEmbedding-based similarity search
SearchGET /search/frequent_values/{index}/{field}Discover available field values
FeaturesPOST /features/v1Enrich items with ML-computed features
ScoringPOST /scoring/ranking_model/{model}Rerank items using trained ML models
RankingPOST /ranking/feedSort, diversify, and limit the final feed
StoriesPOST /stories/generateGenerate personalized narrative content

Example

Search for trending Polymarket prediction markets:

curl -X POST "https://api.mbd.xyz/v3/studio/search/filter_and_sort" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "index": "polymarket-items",
    "size": 25,
    "sort_by": { "field": "volume_24hr", "order": "desc" },
    "include": [
      { "filter": "term", "field": "active", "value": true },
      { "filter": "numeric", "field": "liquidity_num", "operator": ">=", "value": 10000 }
    ]
  }'

Enrich results with personalization features for a wallet:

curl -X POST "https://api.mbd.xyz/v3/studio/features/v1" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "user": {
      "index": "polymarket-wallets",
      "id": "0xf68a281980f8c13828e84e147e3822381d6e5b1b"
    },
    "items": [
      { "index": "polymarket-items", "id": "1289113" }
    ]
  }'

Code Examples

JavaScript/Node.js:

const MBD_BASE = "https://api.mbd.xyz/v3/studio";
const API_KEY = process.env.MBD_API_KEY; // your mbd- key

const response = await fetch(`${MBD_BASE}/search/filter_and_sort`, {
  method: "POST",
  headers: {
    Authorization: `Bearer ${API_KEY}`,
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    index: "polymarket-items",
    size: 25,
    sort_by: { field: "volume_24hr", order: "desc" },
    include: [
      { filter: "term", field: "active", value: true },
      { filter: "numeric", field: "liquidity_num", operator: ">=", value: 10000 },
    ],
  }),
});

const data = await response.json();
console.log(data.result.hits);

Python:

import requests
import os

MBD_BASE = "https://api.mbd.xyz/v3/studio"
API_KEY = os.environ["MBD_API_KEY"]  # your mbd- key

response = requests.post(
    f"{MBD_BASE}/search/filter_and_sort",
    headers={
        "Authorization": f"Bearer {API_KEY}",
        "Content-Type": "application/json",
    },
    json={
        "index": "polymarket-items",
        "size": 25,
        "sort_by": {"field": "volume_24hr", "order": "desc"},
        "include": [
            {"filter": "term", "field": "active", "value": True},
            {"filter": "numeric", "field": "liquidity_num", "operator": ">=", "value": 10000},
        ],
    },
)

data = response.json()
print(data["result"]["hits"])

Deploy API

Base URL: https://api.mbd.xyz/v3/studio/deploy

The Deploy API manages feed algorithms, configs, and production serving. It uses the same Bearer authentication as the Studio API.

Authentication Method

Authorization: Bearer mbd-{your-api-key}

Endpoints

ServiceEndpointDescription
Algo BuilderPOST /algo/composeGenerate algorithm from natural language
Algo BuilderPOST /algo/validateValidate algorithm syntax and security
Algo RunnerPOST /run/algoTest algorithm in sandbox
AlgorithmsPOST /deploy/algosCreate algorithm
AlgorithmsGET /deploy/algosList algorithms
ConfigsPOST /deploy/configsCreate config
ConfigsGET /deploy/configsList configs
ServePOST /deploy/serveServe feed by config ID
ServeGET /deploy/serve/pagePaginate feed results
ServeGET /deploy/serve/new_itemsGet items since last serve
ServePOST /deploy/previewPreview config without saving
CachePOST /deploy/cache/clearClear cached algorithm results

Example

Serve a deployed feed config:

curl -X POST "https://api.mbd.xyz/v3/studio/deploy/serve" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "config_id": 104,
    "inputs": {
      "farcasterFid": "16085",
      "polymarketWallet": "0xf68a281980f8c13828e84e147e3822381d6e5b1b"
    }
  }'

Alpha API

Base URL: https://api.mbd.xyz/v3/alpha

The Alpha API provides smart money signals, trader leaderboards, and notification delivery. It uses the same Bearer authentication as the Studio and Deploy APIs.

Authentication Method

Authorization: Bearer mbd-{your-api-key}

Endpoints

ServiceEndpointDescription
SignalsGET /signalsGet signal history with filtering and pagination
SignalsGET /signals/performanceGet signal performance metrics
NotificationsGET /notificationsPoll for new smart money notifications
NotificationsDELETE /notificationsReset daily notification budget
LeaderboardGET /leaderboardGet ranked smart money wallets
LeaderboardGET /traderGet single trader profile
ConfigGET /configGet customer notification configuration
ConfigPUT /configUpdate notification configuration

Example

Get recent smart money notifications:

curl "https://api.mbd.xyz/v3/alpha/notifications?since=2026-03-30T00:00:00Z&limit=10" \
  -H "Authorization: Bearer YOUR_API_KEY"

Error Responses

All APIs return standard HTTP status codes for authentication errors:

401 Unauthorized

Returned when:

  • The API key is missing
  • The API key is invalid or expired
  • The authentication format is incorrect

Example Response:

{
  "error": "AuthenticationError",
  "message": "Invalid or expired API key. Please check your credentials at console.mbd.xyz",
  "details": null
}

Common Issues

  1. Missing Authorization Header — Ensure the Authorization header is included in all requests
  2. Incorrect Authentication Format — Use Bearer mbd-{key}, not Basic or a bare key
  3. Invalid API Key — Verify your key at console.mbd.xyz
  4. Wrong Base URL:
    • Studio API: https://api.mbd.xyz/v3/studio
    • Deploy API: https://api.mbd.xyz/v3/studio/deploy
    • Alpha API: https://api.mbd.xyz/v3/alpha

Security Best Practices

  1. Never commit API keys to version control — Store keys in environment variables or a secrets manager

  2. Use environment variables:

    export MBD_API_KEY="mbd-your-key-here"
  3. Rotate API keys regularly — Generate new keys periodically and revoke old ones

  4. Use HTTPS only — All embed APIs require HTTPS. Never send keys over unencrypted connections

  5. Use different keys per environment — Separate keys for development, staging, and production


Quick Reference

APIBase URLAuth Header
Studiohttps://api.mbd.xyz/v3/studioAuthorization: Bearer mbd-{key}
Deployhttps://api.mbd.xyz/v3/studio/deployAuthorization: Bearer mbd-{key}
Alphahttps://api.mbd.xyz/v3/alphaAuthorization: Bearer mbd-{key}

Support

For authentication issues or questions: