Scope3 Interchange Storefront API

The seller side of Scope3 Interchange: 269 published operations covering storefronts, inventory sources, ad-server catalog and buyer routing, signals, proposals, approvals, storefront agents and payouts. Publishers register once to reach every buyer agent transacting on AdCP, over REST or a hosted remote MCP endpoint.

OpenAPI Specification

scope3-storefront-openapi-original.yml Raw ↑
# This OpenAPI specification is auto-generated
# DO NOT EDIT THIS FILE MANUALLY
# API Type: STOREFRONT
# API Version: V2

openapi: 3.0.0
info:
  title: Scope3 Storefront API
  version: 2.0.0
  description: |-
    REST API for partners to manage storefronts, inventory sources, and billing.

    ## Authentication

    All endpoints require a Bearer token in the Authorization header:
    ```
    Authorization: Bearer your-api-key
    ```

    ## Base URL

    `https://api.interchange.io/api/v2/storefront`

    ## For AI Agents

    AI agents can use the MCP endpoint at `/mcp/v2/storefront` with three tools:
    - `initialize`: Start an MCP session
    - `api_call`: Make REST API calls
    - `ask_about_capability`: Learn about API features
servers:
  - url: https://api.interchange.io/api/v2/storefront
    description: Production server
tags:
  - name: Account
    description: Account management, service tokens, and preferences
  - name: Asks
    description: What you are waiting on Scope3 for — support, product, and supply asks in one list
  - name: Storefront
    description: Manage storefront and inventory sources
  - name: Storefront Agents
    description: List and manage registered sales, signals, and outcomes agents
  - name: Storefront Activity
    description: Audit log of configuration and inventory changes on the storefront
  - name: Storefront Billing
    description: Payout bank details and billing configuration for storefronts
  - name: AI Usage
    description: Storefront AI token usage visibility by model
  - name: MCP
    description: Model Context Protocol endpoints
paths:
  /activity/calls:
    servers:
      - url: /api/v2
        description: Shared customer API base URL
    get:
      operationId: listActivityCalls
      summary: List API calls
      description: List normalized customer API calls with stable workload, run, outcome, latency, and correlation metadata.
      tags:
        - Activity
      security:
        - bearerAuth: []
      parameters:
        - in: query
          name: startTime
          schema:
            type: string
            format: date-time
            pattern: >-
              ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:\.\d+)?)?(?:Z))$
        - in: query
          name: endTime
          schema:
            type: string
            format: date-time
            pattern: >-
              ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:\.\d+)?)?(?:Z))$
        - in: query
          name: workloadUid
          schema:
            type: string
            format: uuid
            pattern: >-
              ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$
        - in: query
          name: runUid
          schema:
            type: string
            format: uuid
            pattern: >-
              ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$
        - in: query
          name: clientRunId
          schema:
            description: >-
              Caller-supplied correlation identifier. Cross-check workloadUid, runUid, apiVersion, and time bounds for
              provenance.
            type: string
            pattern: ^[A-Za-z0-9._:-]{1,128}$
        - in: query
          name: advertiserId
          schema:
            type: string
            pattern: ^\d+$
        - in: query
          name: environment
          schema:
            type: string
            enum:
              - production
              - sandbox
              - unknown
              - not_applicable
        - in: query
          name: outcome
          schema:
            type: string
            enum:
              - succeeded
              - accepted
              - denied
              - failed
              - cancelled
              - unknown
        - in: query
          name: operation
          schema:
            type: string
            minLength: 1
            maxLength: 240
        - in: query
          name: surface
          schema:
            type: string
            enum:
              - rest
              - mcp
              - a2a
        - in: query
          name: includeDiagnostics
          schema:
            default: 'false'
            type: string
            enum:
              - 'true'
              - 'false'
        - in: query
          name: includeProtocol
          schema:
            default: 'false'
            type: string
            enum:
              - 'true'
              - 'false'
        - in: query
          name: limit
          schema:
            default: 50
            type: integer
            maximum: 200
            minimum: 1
        - in: query
          name: cursor
          schema:
            type: string
            minLength: 1
            maxLength: 2000
      responses:
        '200':
          description: List API calls
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ListActivityCallsResponse'
        '400':
          description: Bad request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '500':
          description: Internal server error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
  /activity/calls/{activityUid}:
    servers:
      - url: /api/v2
        description: Shared customer API base URL
    get:
      operationId: getActivityCall
      summary: Get API call detail
      description: Get one authorized customer API call and its safe timing and diagnostic detail.
      tags:
        - Activity
      security:
        - bearerAuth: []
      parameters:
        - in: path
          name: activityUid
          schema:
            type: string
            format: uuid
            pattern: >-
              ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$
          required: true
      responses:
        '200':
          description: Get API call detail
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ActivityCallDetailResponse'
        '400':
          description: Bad request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '500':
          description: Internal server error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
  /reporting/metrics:
    get:
      operationId: getStorefrontReportingMetrics
      summary: Get storefront reporting
      description: >-
        Get reporting metrics for every media buy the Merchandising Agent participates in through the Storefront
        inventory sources. The Storefront does not own the underlying media buys; reporting is visible because the
        Merchandising Agent is the ADCP party to those transactions. The response is hierarchical for view=summary,
        source-aware flat leaf-by-day rows for view=timeseries, or a signed CSV download descriptor when download=true.
      tags:
        - Reporting
      security:
        - bearerAuth: []
      parameters:
        - in: query
          name: inventorySourceId
          schema:
            description: >-
              Filter to media buys flowing through a single inventory source (storefront_inventory_source.source_id).
              When omitted, includes every inventory source on the storefront.
            type: string
          description: >-
            Filter to media buys flowing through a single inventory source (storefront_inventory_source.source_id). When
            omitted, includes every inventory source on the storefront.
        - in: query
          name: startDate
          schema:
            description: Start date in ISO format (YYYY-MM-DD)
            example: '2026-01-01'
            type: string
            pattern: ^\d{4}-\d{2}-\d{2}$
          description: Start date in ISO format (YYYY-MM-DD)
        - in: query
          name: endDate
          schema:
            description: End date in ISO format (YYYY-MM-DD)
            example: '2026-01-31'
            type: string
            pattern: ^\d{4}-\d{2}-\d{2}$
          description: End date in ISO format (YYYY-MM-DD)
        - in: query
          name: days
          schema:
            description: 'Number of days to include (default: 7, min: 1, max: 90).'
            example: 7
            default: 7
            type: integer
            minimum: 1
            maximum: 90
          description: 'Number of days to include (default: 7, min: 1, max: 90).'
        - in: query
          name: view
          schema:
            description: >-
              Response format: "summary" for hierarchical advertiser/media-buy/package breakdown, "timeseries" for flat
              per-day rows.
            default: summary
            type: string
            enum:
              - summary
              - timeseries
          description: >-
            Response format: "summary" for hierarchical advertiser/media-buy/package breakdown, "timeseries" for flat
            per-day rows.
        - in: query
          name: download
          schema:
            description: When true, generates a CSV file and returns a signed download URL instead of JSON data
            default: false
            type: boolean
          description: When true, generates a CSV file and returns a signed download URL instead of JSON data
        - in: query
          name: demo
          schema:
            description: When true, returns auto-generated demo data instead of querying real data sources
            default: false
            type: boolean
          description: When true, returns auto-generated demo data instead of querying real data sources
        - in: query
          name: sourceBreakdown
          schema:
            description: >-
              When true, timeseries rows are split by each contributing inventory source. The default preserves the
              legacy media-buy/package/date row grain.
            default: 'false'
            type: string
            enum:
              - 'true'
              - 'false'
          description: >-
            When true, timeseries rows are split by each contributing inventory source. The default preserves the legacy
            media-buy/package/date row grain.
      responses:
        '200':
          description: Get storefront reporting
          content:
            application/json:
              schema:
                anyOf:
                  - $ref: '#/components/schemas/StorefrontReportingMetricsResponse'
                  - $ref: '#/components/schemas/StorefrontReportingMetricsTimeseriesResponse'
                  - $ref: '#/components/schemas/ReportingMetricsExportResponse'
        '400':
          description: Bad request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '500':
          description: Internal server error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
  /reporting/margin:
    get:
      operationId: getStorefrontMarginReporting
      summary: Get storefront margin (P&L) reporting
      description: >-
        The curator's resale P&L from the spread ledger: booked vs realized buy/sell/spread and margin %, rolled up
        buyer → media buy → package → source leg. Sourced from the storefront spread ledger (not BigQuery delivery);
        amounts are signed and never summed across settlement currencies. Cumulative as-of snapshot — there is no
        per-day timeseries.
      tags:
        - Reporting
      security:
        - bearerAuth: []
      parameters:
        - in: query
          name: inventorySourceId
          schema:
            description: >-
              Narrow to the buy legs sourced from a single inventory source (storefront_spread_ledger.source_id). When
              omitted, includes every source on the storefront.
            type: string
          description: >-
            Narrow to the buy legs sourced from a single inventory source (storefront_spread_ledger.source_id). When
            omitted, includes every source on the storefront.
        - in: query
          name: buyerCustomerId
          schema:
            description: Narrow to a single buyer customer. Can only narrow within the calling storefront — it never widens scope.
            type: integer
            maximum: 9007199254740991
            minimum: 1
          description: Narrow to a single buyer customer. Can only narrow within the calling storefront — it never widens scope.
      responses:
        '200':
          description: Get storefront margin (P&L) reporting
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/StorefrontMarginReportingResponse'
        '400':
          description: Bad request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '500':
          description: Internal server error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
  /account-mappings/summary:
    get:
      operationId: getSellerAccountMappingSummary
      summary: Get seller account mapping summary
      description: Get seller-owned relationship and active inventory-source coverage counts for the Buyer Account Mapping Page.
      tags:
        - Storefront
      security:
        - bearerAuth: []
      responses:
        '200':
          description: Get seller account mapping summary
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SellerAccountMappingSummary'
        '400':
          description: Bad request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '500':
          description: Internal server error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
  /account-mappings:
    get:
      operationId: listSellerAccountRelationships
      summary: List seller account relationships
      description: >-
        List the seller-owned operator-and-brand relationships and their private coverage across active inventory
        sources.
      tags:
        - Storefront
      security:
        - bearerAuth: []
      parameters:
        - in: query
          name: offset
          schema:
            default: 0
            type: integer
            minimum: 0
            maximum: 9007199254740991
        - in: query
          name: limit
          schema:
            default: 50
            type: integer
            minimum: 1
            maximum: 100
        - in: query
          name: search
          schema:
            type: string
            maxLength: 200
      responses:
        '200':
          description: List seller account relationships
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SellerAccountMappingList'
        '400':
          description: Bad request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '500':
          description: Internal server error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
  /account-mappings/export:
    get:
      operationId: exportSellerAccountMappings
      summary: Export seller account mappings
      description: >-
        Export the normalized source-mapping template, current healthy mappings, and active source-account choices as
        formula-safe, byte-bounded CSV documents.
      tags:
        - Storefront
      security:
        - bearerAuth: []
      responses:
        '200':
          description: Export seller account mappings
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SellerAccountMappingExport'
        '400':
          description: Bad request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '500':
          description: Internal server error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
  /account-mappings/reviews:
    get:
      operationId: listSellerAccountGrantReviews
      summary: List pending buyer account requests
      description: >-
        List buyer account requests awaiting a seller decision, including the optimistic-lock version required for each
        decision.
      tags:
        - Storefront
      security:
        - bearerAuth: []
      parameters:
        - in: query
          name: offset
          schema:
            default: 0
            type: integer
            minimum: 0
            maximum: 9007199254740991
        - in: query
          name: limit
          schema:
            default: 50
            type: integer
            minimum: 1
            maximum: 100
      responses:
        '200':
          description: List pending buyer account requests
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SellerAccountGrantReviewList'
        '400':
          description: Bad request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '500':
          description: Internal server error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
  /account-mappings/reviews/{grantId}/decision:
    post:
      operationId: decideSellerAccountGrantReview
      summary: Decide a pending buyer account request
      description: >-
        Approve a pending buyer account request for Interchange-cleared billing, or reject it with a required reason.
        The expected version prevents decisions against stale review state.
      tags:
        - Storefront
      security:
        - bearerAuth: []
      parameters:
        - in: path
          name: grantId
          schema:
            anyOf:
              - type: integer
                format: int64
              - type: string
              - type: number
          required: true
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/DecideSellerAccountGrantReviewBody'
      responses:
        '200':
          description: Decide a pending buyer account request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SellerAccountGrantReviewDecision'
        '400':
          description: Bad request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '500':
          description: Internal server error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
  /account-mappings/sources/{inventorySourceId}/refresh:
    post:
      operationId: refreshSellerAccountSourceAccounts
      summary: Refresh managed ad-server account choices
      description: >-
        Refresh the authenticated, bounded advertiser roster for one managed Google Ad Manager or FreeWheel inventory
        source. Other managed providers and modular sources fail closed.
      tags:
        - Storefront
      security:
        - bearerAuth: []
      parameters:
        - in: path
          name: inventorySourceId
          schema:
            anyOf:
              - type: integer
                format: int64
              - type: string
              - type: number
          required: true
      responses:
        '200':
          description: Refresh managed ad-server account choices
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ManagedSourceAccountRefreshResult'
        '400':
          description: Bad request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '404':
          description: Inventory source not found for this storefront.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '500':
          description: Internal server error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
  /account-mappings/imports/prepare:
    post:
      operationId: prepareSellerAccountBindingFeed
      summary: Prepare a private seller account mapping feed upload
      description: >-
        ADMIN-only. Reserve an immutable feed revision and return a short-lived signed PUT capability for exactly one
        source_account_bindings.csv. The upload bucket is private and lifecycle-deleted.
      tags:
        - Storefront
      security:
        - bearerAuth: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PrepareSellerAccountBindingFeed'
      responses:
        '200':
          description: Prepare a private seller account mapping feed upload
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SellerAccountBindingFeedPrepareResult'
        '400':
          description: Bad request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '403':
          description: Admin role required.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '500':
          description: Internal server error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
  /account-mappings/imports/{revisionId}/preview:
    post:
      operationId: previewSellerAccountBindingFeed
      summary: Validate and preview a seller account mapping feed
      description: >-
        ADMIN-only. Verify the immutable uploaded object, quarantine invalid rows, and issue a short-lived preview token
        tied to the exact mapping state and impact.
      tags:
        - Storefront
      security:
        - bearerAuth: []
      parameters:
        - in: path
          name: revisionId
          schema:
            type: string
            format: uuid
            pattern: >-
              ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$
          required: true
      responses:
        '200':
          description: Validate and preview a seller account mapping feed
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SellerAccountBindingFeedPreviewResult'
        '400':
          description: Bad request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '403':
          description: Admin role required.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '500':
          description: Internal server error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
  /account-mappings/imports/{revisionId}/commit:
    post:
      operationId: commitSellerAccountBindingFeed
      summary: Atomically commit a seller account mapping feed
      description: >-
        ADMIN-only. Apply the exact reviewed mapping set with compare-and-swap guards. Manual mappings and mappings
        owned by another feed are never overwritten; snapshot omissions affect only mappings owned by this feed.
      tags:
        - Storefront
      security:
        - bearerAuth: []
      parameters:
        - in: path
          name: revisionId
          schema:
            type: string
            format: uuid
            pattern: >-
              ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$
          required: true
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CommitSellerAccountBindingFeed'
      responses:
        '200':
          description: Atomically commit a seller account mapping feed
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SellerAccountBindingFeedCommitResult'
        '400':
          description: Bad request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '403':
          description: Admin role required.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '500':
          description: Internal server error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
  /account-mappings/imports/{revisionId}:
    get:
      operationId: getSellerAccountBindingFeedRevision
      summary: Get seller account mapping feed revision status
      description: >-
        ADMIN-only. Read the tenant-scoped lifecycle, diagnostics, and impact of one source-account mapping feed
        revision.
      tags:
        - Storefront
      security:
        - bearerAuth: []
      parameters:
        - in: path
          name: revisionId
          schema:
            type: string
            format: uuid
            pattern: >-
              ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$
          required: true
      responses:
        '200':
          description: Get seller account mapping feed revision status
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SellerAccountBindingFeedRevision'
        '400':
          description: Bad request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '403':
          description: Admin role required.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '500':
          description: Internal server error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
  /usage/by-model:
    get:
      operationId: getStorefrontAiUsageByModel
      summary: Get storefront AI usage by model over time
      description: >-
        Get customer-borne storefront AI token usage grouped by day and model. Customer scope is always derived from the
        authenticated organization.
      tags:
        - AI Usage
      security:
        - bearerAuth: []
      parameters:
        - in: query
          name: since
          schema:
            type: string
            format: date-time
            pattern: >-
              ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:\.\d+)?)?(?:Z))$
      responses:
        '200':
          description: Get storefront AI usage by model over time
          content:
            application/json:
              schema:
                type: object
                properties:
                  rows:
                    type: array
                    items:
                      type: object
                      properties:
                        model:
                          type: string
                        inputTokens:
                          type: integer
                          minimum: 0
                          maximum: 9007199254740991
                        outputTokens:
                          type: integer
                          minimum: 0
                          maximum: 9007199254740991
                        cacheCreationInputTokens:
                          type: integer
                          minimum: 0
                          maximum: 9007199254740991
                        cacheReadInputTokens:
       

# --- truncated at 32 KB (3081 KB total) ---
# Full source: https://raw.githubusercontent.com/api-evangelist/scope3/refs/heads/main/openapi/_original/scope3-storefront-openapi-original.yml