Trillboards Billing API

Usage-based billing and credit management. Trillboards uses a pay-per-use model with generous free tiers. No subscriptions required. When free tier limits are exceeded, endpoints return 402 Payment Required until billing is set up via Stripe. Credits can be purchased at volume discounts.

GitHub OpenAPI

Operations 5

GET /pricing Get machine-readable pricing #
POST /billing/setup Set up usage-based billing #
GET /billing/usage-summary Get current billing period usage #
POST /billing/credits Purchase committed-use credits #
POST /billing/credits/checkout Create Stripe Checkout session for credits #

Work with this as data

Every API here is available over the APIs.io API and to AI agents over MCP.

MCP server

One button, every client — Claude, Cursor, VS Code and the rest.

https://apis.io/mcp

Tools for apis

7 MCP tools reach this
  • find_apisBrowse and filter every API in the catalog.
  • get_api_artifactsOne API's artifacts, grouped by type.
  • get_openapiThe primary OpenAPI for this API.
  • find_similar_apisAPIs that look like this one.
  • apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.
  • resolveTurn a domain, URL or GitHub org into the provider it belongs to.
  • find_cohortsEvery scored population of providers in the catalog.
All 92 tools →

Call it yourself

curl for this page
This API
curl "https://apis.io/api/v1/apis/trillboards-com:trillboards-com-billing-api"
All apis
curl "https://apis.io/api/v1/apis?limit=25"

Calls without X-API-Key need no key. Calls with it need a paid plan — get a key.

Get an API key

Free tier, no form to fill in. Signing in shares your email address with us — we store it to create your key and to recognise you if you sign in with another provider. By signing up you are subscribing to the APIs.io and API Evangelist newsletters — you can unsubscribe from any issue. See our Privacy Policy and Terms.

A second provider on the same verified email joins the account you already have.

OpenAPI Specification

trillboards-com-billing-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  title: Trillboards Partner Billing API
  version: 1.1.0
  description: 'API for partner integrations with Trillboards digital advertising platform.


    Use this API to integrate ads into your vending machines, kiosks, digital signage,

    and other display devices. Partners receive competitive revenue share on all impressions.


    ## Authentication


    Most endpoints require API key authentication using Bearer token:

    ```

    Authorization: Bearer trb_partner_xxxxx

    ```


    API keys are generated during partner registration and should be stored securely.


    ## Rate Limits


    All endpoints return rate limit headers:

    - `X-RateLimit-Limit`: Maximum requests allowed per window

    - `X-RateLimit-Remaining`: Requests remaining in current window

    - `X-RateLimit-Reset`: Unix timestamp when window resets

    - `RateLimit-Policy`: IETF draft-7 format policy string


    Rate limits by endpoint type:

    | Endpoint Type | Limit | Window |

    |--------------|-------|--------|

    | Registration | 5 | 1 hour |

    | Authenticated API | 1000 | 1 minute |

    | Ad serving | 100 | 1 minute |

    | Impressions | 500 | 1 minute |

    | Programmatic events | 300 | 1 minute |

    | Batch impressions | 100 | 1 minute |

    | Heartbeat | 60 | 1 minute |

    | Venue intelligence | 100 | 1 minute |

    | Audience intelligence | 100 | 1 minute |

    | Bulk device operations | 20 | 1 minute |


    Exceeding rate limits returns HTTP 429 with a `Retry-After` header.


    ## Quick Start


    **Option A: New Partner Registration**

    1. Register as a partner via `POST /register` (returns API key)

    2. Register your devices

    3. Load the `embed_url` in your device''s WebView or use `/device/{id}/ads` in custom UI

    4. Impressions are tracked automatically


    **Option B: Existing Earner Upgrade**

    If you already have a Trillboards earner account:

    1. Call `POST https://api.trillboards.com/v2/earner/upgrade-to-partner` with your user JWT

    2. Receive your Partner API key (one-time display - save it!)

    3. Your existing screens remain visible alongside new API-registered screens


    ## SDK


    Install the official TypeScript SDK for type-safe integration:

    ```

    npm install @trillboards/ads-sdk

    ```


    The SDK provides 4 entry points:

    - `@trillboards/ads-sdk` — Core browser SDK with ad player, events, and caching

    - `@trillboards/ads-sdk/react` — React hooks and components (TrillboardsProvider, TrillboardsAdSlot)

    - `@trillboards/ads-sdk/react-native` — React Native WebView wrapper

    - `@trillboards/ads-sdk/server` — Node.js PartnerClient with audience, analytics, auctions, creatives


    Full documentation: https://trillboards.com/developers/partner-sdk'
  contact:
    name: Trillboards Developer Support
    email: developers@trillboards.com
    url: https://trillboards.com/developers
  license:
    name: Proprietary
    url: https://trillboards.com/terms-of-service
servers:
- url: https://api.trillboards.com/v1/partner
  description: Production API
- url: http://localhost:4004/v1/partner
  description: Local development
tags:
- name: Billing
  description: 'Usage-based billing and credit management.


    Trillboards uses a pay-per-use model with generous free tiers. No subscriptions required.

    When free tier limits are exceeded, endpoints return 402 Payment Required until billing

    is set up via Stripe. Credits can be purchased at volume discounts.'
paths:
  /pricing:
    get:
      tags:
      - Billing
      summary: Get machine-readable pricing
      description: 'Returns full pricing information for all Trillboards products including

        graduated usage tiers, free tier thresholds, committed-use discounts,

        and billing setup URLs. No authentication required — designed for

        programmatic price discovery by AI agents and DSPs.


        Response is cached for 1 hour (Cache-Control: public, max-age=3600).'
      operationId: getPricing
      security: []
      responses:
        '200':
          description: Pricing information
          headers:
            Cache-Control:
              schema:
                type: string
                example: public, max-age=3600
            Link:
              schema:
                type: string
                example: </.well-known/adagents.json>; rel="adcp-discovery"
          content:
            application/json:
              schema:
                type: object
                properties:
                  object:
                    type: string
                    example: pricing
                  model:
                    type: string
                    example: usage_based
                  currency:
                    type: string
                    example: usd
                  description:
                    type: string
                    example: Pay-per-use with generous free tiers. No subscriptions, no commitments.
                  products:
                    type: object
                    description: Pricing details per product
                    properties:
                      partner_platform:
                        type: object
                        properties:
                          name:
                            type: string
                          description:
                            type: string
                          pricing:
                            type: string
                          revenue_share:
                            type: object
                            properties:
                              earner:
                                type: number
                              platform:
                                type: number
                              distributor:
                                type: number
                      data_api:
                        type: object
                        properties:
                          name:
                            type: string
                          description:
                            type: string
                          unit:
                            type: string
                          tiers:
                            type: array
                            items:
                              type: object
                              properties:
                                up_to:
                                  type:
                                  - integer
                                  - 'null'
                                  description: null means unlimited (final tier)
                                unit_price_usd:
                                  type: number
                          notes:
                            type: string
                      proof_of_play:
                        type: object
                        properties:
                          name:
                            type: string
                          description:
                            type: string
                          unit:
                            type: string
                          tiers:
                            type: array
                            items:
                              type: object
                              properties:
                                up_to:
                                  type:
                                  - integer
                                  - 'null'
                                unit_price_usd:
                                  type: number
                          notes:
                            type: string
                      attribution:
                        type: object
                        properties:
                          name:
                            type: string
                          description:
                            type: string
                          meters:
                            type: object
                            additionalProperties:
                              type: object
                              properties:
                                unit_price_usd:
                                  type: number
                                per_unit:
                                  type: string
                                first_campaign_free:
                                  type: boolean
                      data_marketplace:
                        type: object
                        properties:
                          name:
                            type: string
                          description:
                            type: string
                          meters:
                            type: object
                            additionalProperties:
                              type: object
                              properties:
                                unit_price_usd:
                                  type: number
                                per_unit:
                                  type: string
                                free_quota_per_month:
                                  type: integer
                          revenue_share:
                            type: object
                          notes:
                            type: string
                      programmatic:
                        type: object
                        properties:
                          name:
                            type: string
                          description:
                            type: string
                          pricing:
                            type: string
                      fein_edge_ai:
                        type: object
                        properties:
                          name:
                            type: string
                          description:
                            type: string
                          pricing:
                            type: string
                  committed_use:
                    type: object
                    description: Volume discount tiers for prepaid credits
                    additionalProperties:
                      type: object
                      properties:
                        price_usd:
                          type: number
                        credits_usd:
                          type: number
                        discount_pct:
                          type: number
                  free_tiers:
                    type: object
                    description: Free tier limits per product and meter
                  billing_setup_url:
                    type: string
                    example: /v1/partner/billing/setup
                  agent_register_url:
                    type: string
                    example: /v1/partner/agent/register
                  request_id:
                    type: string
              example:
                object: pricing
                model: usage_based
                currency: usd
                description: Pay-per-use with generous free tiers. No subscriptions, no commitments.
                request_id: req_abc123
  /billing/setup:
    post:
      tags:
      - Billing
      summary: Set up usage-based billing
      description: 'Attaches a Stripe payment method to your partner account and activates

        pay-per-use billing. Required after exceeding free tier limits.


        After setup, usage beyond free tiers is metered and invoiced monthly.

        You can also purchase committed-use credits for volume discounts.'
      operationId: setupBilling
      security:
      - BearerAuth: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
              - payment_method_id
              properties:
                payment_method_id:
                  type: string
                  description: Stripe payment method token obtained from Stripe.js or Stripe Elements
                  example: pm_1OxABC123def456
            example:
              payment_method_id: pm_1OxABC123def456
      responses:
        '201':
          description: Billing activated
          content:
            application/json:
              schema:
                type: object
                properties:
                  object:
                    type: string
                    example: billing_setup
                  stripe_customer_id:
                    type: string
                    example: cus_ABC123
                  billing_status:
                    type: string
                    example: active
                  message:
                    type: string
                    example: Billing is now active. Usage beyond free tiers will be invoiced monthly.
                  request_id:
                    type: string
        '400':
          description: Invalid or missing payment method
        '401':
          $ref: '#/components/responses/Unauthorized'
  /billing/usage-summary:
    get:
      tags:
      - Billing
      summary: Get current billing period usage
      description: 'Returns usage summary for the current billing period including per-product

        breakdown, free tier consumption, paid usage, credit balance, and total cost.'
      operationId: getUsageSummary
      security:
      - BearerAuth: []
      responses:
        '200':
          description: Usage summary
          content:
            application/json:
              schema:
                type: object
                properties:
                  object:
                    type: string
                    example: usage_summary
                  billing_status:
                    type: string
                    enum:
                    - none
                    - active
                    - suspended
                    description: Current billing status
                  credit_balance_cents:
                    type: integer
                    description: Remaining prepaid credit balance in cents
                    example: 62500
                  period_start:
                    type: string
                    format: date-time
                    description: Start of current billing period
                  period_end:
                    type: string
                    format: date-time
                    description: End of current billing period
                  products:
                    type: object
                    description: Per-product usage breakdown
                    additionalProperties:
                      type: object
                      properties:
                        meters:
                          type: object
                          additionalProperties:
                            type: object
                            properties:
                              usage:
                                type: integer
                              free_quota:
                                type: integer
                              billable:
                                type: integer
                              cost_cents:
                                type: integer
                  total_cost_cents:
                    type: integer
                    description: Total cost in cents for current period
                    example: 4500
                  request_id:
                    type: string
        '401':
          $ref: '#/components/responses/Unauthorized'
  /billing/credits:
    post:
      tags:
      - Billing
      summary: Purchase committed-use credits
      description: 'Immediately charges the partner''s payment method and adds credits at a discount.


        Available tiers:

        | Tier | Price | Credits | Discount |

        |------|-------|---------|----------|

        | tier_500 | $500 | $625 | 25% |

        | tier_2000 | $2,000 | $3,100 | 55% |

        | tier_5000 | $5,000 | $10,000 | 100% |


        Requires an active billing setup (payment method attached).'
      operationId: purchaseCredits
      security:
      - BearerAuth: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
              - tier
              properties:
                tier:
                  type: string
                  enum:
                  - tier_500
                  - tier_2000
                  - tier_5000
                  description: Credit purchase tier
            example:
              tier: tier_2000
      responses:
        '201':
          description: Credits purchased
          content:
            application/json:
              schema:
                type: object
                properties:
                  object:
                    type: string
                    example: credit_purchase
                  payment_intent_id:
                    type: string
                    description: Stripe PaymentIntent ID
                    example: pi_ABC123
                  charged_cents:
                    type: integer
                    description: Amount charged in cents
                    example: 200000
                  credits_added_cents:
                    type: integer
                    description: Credits added to balance in cents
                    example: 310000
                  discount_pct:
                    type: number
                    description: Discount percentage applied
                    example: 55
                  request_id:
                    type: string
        '400':
          description: Invalid tier or billing not set up
        '401':
          $ref: '#/components/responses/Unauthorized'
        '402':
          $ref: '#/components/responses/PaymentRequired'
  /billing/credits/checkout:
    post:
      tags:
      - Billing
      summary: Create Stripe Checkout session for credits
      description: 'Creates a Stripe Checkout session for purchasing committed-use credits.

        Redirect the user to the returned checkout_url to complete payment.

        Credits are automatically applied after successful payment via webhook.'
      operationId: createCreditCheckout
      security:
      - BearerAuth: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
              - tier
              properties:
                tier:
                  type: string
                  enum:
                  - tier_500
                  - tier_2000
                  - tier_5000
                success_url:
                  type: string
                  format: uri
                  description: URL to redirect after successful payment
                cancel_url:
                  type: string
                  format: uri
                  description: URL to redirect if payment is cancelled
            example:
              tier: tier_500
              success_url: https://example.com/billing/success
              cancel_url: https://example.com/billing/cancel
      responses:
        '201':
          description: Checkout session created
          content:
            application/json:
              schema:
                type: object
                properties:
                  object:
                    type: string
                    example: checkout_session
                  checkout_url:
                    type: string
                    format: uri
                    description: Stripe Checkout URL — redirect user here
                    example: https://checkout.stripe.com/c/pay/cs_test_abc123
                  session_id:
                    type: string
                    description: Stripe Checkout session ID
                    example: cs_test_abc123
                  message:
                    type: string
                    example: Redirect the user to checkout_url to complete the purchase.
                  request_id:
                    type: string
        '400':
          description: Invalid tier
        '401':
          $ref: '#/components/responses/Unauthorized'
components:
  schemas:
    Error:
      type: object
      properties:
        success:
          type: boolean
          example: false
        message:
          type: string
        error:
          type: string
  responses:
    Unauthorized:
      description: Unauthorized - Invalid or missing API key
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            success: false
            message: API key required
    PaymentRequired:
      description: Free tier exhausted — add a payment method to continue
      content:
        application/json:
          schema:
            type: object
            properties:
              error:
                type: object
                properties:
                  message:
                    type: string
                    example: Free tier exhausted for data_api. Add a payment method to continue.
                  code:
                    type: string
                    enum:
                    - payment_required
                  type:
                    type: string
                    enum:
                    - billing_error
                  product:
                    type: string
                    description: Product that exhausted its free tier
                    enum:
                    - data_api
                    - proof_of_play
                    - attribution
                    - data_marketplace
                  usage:
                    type: object
                    properties:
                      current:
                        type: integer
                        description: Current usage count this billing period
                        example: 12000
                      free_limit:
                        type: integer
                        description: Free tier limit per month
                        example: 10000
                      exceeded_by:
                        type: integer
                        description: How many units over the free limit
                        example: 2000
                  pricing:
                    type:
                    - object
                    - 'null'
                    description: Graduated pricing tiers for this product
                  billing_setup_url:
                    type: string
                    example: /v1/partner/billing/setup
                  pricing_url:
                    type: string
                    example: /v1/partner/pricing
                  help:
                    type: string
                    example: POST /v1/partner/billing/setup with a Stripe payment method token to enable pay-per-use billing.
              request_id:
                type: string
                example: req_abc123
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      description: 'API key authentication. Include your API key as a Bearer token:

        ```

        Authorization: Bearer trb_partner_xxxxx

        ```

        '
    UserJWT:
      type: http
      scheme: bearer
      description: 'User JWT authentication for earner-to-partner upgrade.

        Used only for the `/v2/earner/upgrade-to-partner` endpoint.

        This is the same JWT token used for the Earner Portal.

        '