Trajectory Billing API

The billing API from Trajectory — 15 operation(s) for billing.

Operations 16

POST /api/v1/billing/purchases Purchase Credits #
GET /api/v1/billing/balance Get Billing Balance #
GET /api/v1/billing/payment-method Get Billing Payment Method #
POST /api/v1/billing/payment-method/portal Open Customer Portal #
GET /api/v1/billing/preferences Get Billing Preferences #
PUT /api/v1/billing/preferences Update Billing Preferences #
PUT /api/v1/billing/preferences/fixed Update Fixed Billing Preferences #
GET /api/v1/billing/usage Get Billing Usage #
GET /api/v1/billing/usage/tokens Get Billing Token Usage #
GET /api/v1/billing/usage/spend Get Billing Spend Series #
GET /api/v1/billing/usage/runs Get Billing Run Costs #
GET /api/v1/billing/notifications Get Billing Notifications #
POST /api/v1/billing/notifications/{notification_id}/dismiss Dismiss Billing Notification #
GET /api/v1/organizations/{organization_id}/billing Get Organization Billing #
POST /api/v1/organizations/{organization_id}/billing/credits Grant Organization Credits #
GET /api/v1/internal-cost/runs Get Internal Run Costs #

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/trajectory:trajectory-billing-api"
All apis
curl "https://apis.io/api/v1/apis?limit=25"

Discovery needs no key. Ratings and market analysis are Pro.

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. See our Privacy Policy and Terms.

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

OpenAPI Specification

trajectory-billing-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  title: Trajectory Billing API
  version: 0.1.0
  x-trajectory-api-version: '2026-10-14'
  description: This contract is API version 2026-10-14. The optional Trajectory-API-Version header pins it, and tmp-contract is accepted as an alias. Requests without the header get this version. Version 2026-10-07 and the pre-launch legacy response formats are retired.
tags:
- name: Billing
paths:
  /api/v1/billing/purchases:
    post:
      tags:
      - Billing
      summary: Purchase Credits
      operationId: purchaseCredits
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PurchaseRequest'
        required: true
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                type: string
                title: Response Purchasecredits
      x-trajectory-visibility: browser
  /api/v1/billing/balance:
    get:
      tags:
      - Billing
      summary: Get Billing Balance
      operationId: getBillingBalance
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BalanceResponse'
      x-trajectory-visibility: browser
  /api/v1/billing/payment-method:
    get:
      tags:
      - Billing
      summary: Get Billing Payment Method
      operationId: getBillingPaymentMethod
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PaymentMethodResponse'
      x-trajectory-visibility: browser
  /api/v1/billing/payment-method/portal:
    post:
      tags:
      - Billing
      summary: Open Customer Portal
      operationId: openBillingPortal
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                type: string
                title: Response Openbillingportal
      x-trajectory-visibility: browser
  /api/v1/billing/preferences:
    get:
      tags:
      - Billing
      summary: Get Billing Preferences
      operationId: getBillingPreferences
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BillingPreferencesState'
      x-trajectory-visibility: browser
    put:
      tags:
      - Billing
      summary: Update Billing Preferences
      operationId: updateBillingPreferences
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/BillingPreferencesPatch'
        required: true
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BillingPreferencesState'
      x-trajectory-visibility: browser
  /api/v1/billing/preferences/fixed:
    put:
      tags:
      - Billing
      summary: Update Fixed Billing Preferences
      operationId: updateFixedBillingPreferences
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/BillingPreferencesPatch'
        required: true
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BillingPreferencesState'
      x-trajectory-visibility: browser
  /api/v1/billing/usage:
    get:
      tags:
      - Billing
      summary: Get Billing Usage
      operationId: getBillingUsage
      parameters:
      - name: days
        in: query
        required: false
        schema:
          type: integer
          maximum: 90
          minimum: 1
          default: 30
          title: Days
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                type: object
                additionalProperties:
                  type: number
                title: Response Getbillingusage
      x-trajectory-visibility: browser
  /api/v1/billing/usage/tokens:
    get:
      tags:
      - Billing
      summary: Get Billing Token Usage
      operationId: getBillingTokenUsage
      parameters:
      - name: days
        in: query
        required: false
        schema:
          type: integer
          maximum: 30
          minimum: 1
          default: 30
          title: Days
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/BillingTokenUsagePoint'
                title: Response Getbillingtokenusage
      x-trajectory-visibility: browser
  /api/v1/billing/usage/spend:
    get:
      tags:
      - Billing
      summary: Get Billing Spend Series
      operationId: getBillingSpendSeries
      parameters:
      - name: days
        in: query
        required: false
        schema:
          type: integer
          maximum: 30
          minimum: 1
          default: 30
          title: Days
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/BillingSpendPoint'
                title: Response Getbillingspendseries
      x-trajectory-visibility: browser
  /api/v1/billing/usage/runs:
    get:
      tags:
      - Billing
      summary: Get Billing Run Costs
      description: List this organization's cached run costs in USD cents over the last 30 calendar days. Includes training, inference, grading, and sandbox costs; older runs show only costs incurred within that window. Free organizations show usage at list price, not charges.
      operationId: getBillingRunCosts
      parameters:
      - name: offset
        in: query
        required: false
        schema:
          type: integer
          minimum: 0
          default: 0
          title: Offset
      - name: limit
        in: query
        required: false
        schema:
          type: integer
          maximum: 50
          minimum: 1
          default: 20
          title: Limit
      - name: sort
        in: query
        required: false
        schema:
          enum:
          - cents
          - launch_at
          type: string
          default: cents
          title: Sort
      - name: order
        in: query
        required: false
        schema:
          enum:
          - asc
          - desc
          type: string
          default: desc
          title: Order
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BillingRunCostsResponse'
      x-trajectory-visibility: public
  /api/v1/billing/notifications:
    get:
      tags:
      - Billing
      summary: Get Billing Notifications
      operationId: getBillingNotifications
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                items:
                  $ref: '#/components/schemas/BillingNotification'
                type: array
                title: Response Getbillingnotifications
      x-trajectory-visibility: browser
  /api/v1/billing/notifications/{notification_id}/dismiss:
    post:
      tags:
      - Billing
      summary: Dismiss Billing Notification
      operationId: dismissBillingNotification
      parameters:
      - name: notification_id
        in: path
        required: true
        schema:
          type: string
          title: Notification Id
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                type: boolean
                title: Response Dismissbillingnotification
      x-trajectory-visibility: browser
  /api/v1/organizations/{organization_id}/billing:
    get:
      tags:
      - Billing
      summary: Get Organization Billing
      operationId: getOrganizationBilling
      parameters:
      - name: organization_id
        in: path
        required: true
        schema:
          type: string
          title: Organization Id
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/OrganizationBilling'
      x-trajectory-visibility: browser
  /api/v1/organizations/{organization_id}/billing/credits:
    post:
      tags:
      - Billing
      summary: Grant Organization Credits
      operationId: grantOrganizationCredits
      parameters:
      - name: organization_id
        in: path
        required: true
        schema:
          type: string
          title: Organization Id
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreditGrantRequest'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema: {}
      x-trajectory-visibility: browser
  /api/v1/internal-cost/runs:
    get:
      tags:
      - Billing
      summary: Get Internal Run Costs
      operationId: listInternalRunCosts
      parameters:
      - name: start_at
        in: query
        required: false
        schema:
          anyOf:
          - type: string
            format: date-time
          - type: 'null'
          description: Inclusive run launch timestamp
          title: Start At
        description: Inclusive run launch timestamp
      - name: end_at
        in: query
        required: false
        schema:
          anyOf:
          - type: string
            format: date-time
          - type: 'null'
          description: Exclusive run launch timestamp
          title: End At
        description: Exclusive run launch timestamp
      - name: sort
        in: query
        required: false
        schema:
          enum:
          - run_name
          - launched_by
          - run_id
          - type
          - model
          - agent
          - benchmark
          - backend
          - launch_at
          - duration_seconds
          - status
          - public_total_cost
          - public_sandbox_cost
          - public_training_cost
          - public_inference_cost
          - public_grading_cost
          - public_other_cost
          - total_cost
          - sandbox_cost
          - training_cost
          - inference_cost
          - grading_cost
          - other_cost
          - organization_name
          type: string
          default: total_cost
          title: Sort
      - name: order
        in: query
        required: false
        schema:
          enum:
          - asc
          - desc
          type: string
          default: desc
          title: Order
      - name: offset
        in: query
        required: false
        schema:
          type: integer
          minimum: 0
          default: 0
          title: Offset
      - name: limit
        in: query
        required: false
        schema:
          type: integer
          maximum: 20
          minimum: 1
          default: 20
          title: Limit
      - name: search
        in: query
        required: false
        schema:
          type: string
          maxLength: 256
          default: ''
          title: Search
      - name: run_type
        in: query
        required: false
        schema:
          anyOf:
          - enum:
            - training
            - eval
            type: string
          - type: 'null'
          title: Run Type
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/InternalRunCostsResponse'
      x-trajectory-visibility: browser
components:
  schemas:
    CreditGrantRequest:
      properties:
        grant_id:
          type: string
          format: uuid
          title: Grant Id
        amount_cents:
          type: integer
          maximum: 99999900.0
          minimum: 100.0
          title: Amount Cents
        reason:
          type: string
          maxLength: 500
          minLength: 1
          title: Reason
        expires_at:
          anyOf:
          - type: string
            format: date-time
          - type: 'null'
          title: Expires At
      type: object
      required:
      - grant_id
      - amount_cents
      - reason
      title: CreditGrantRequest
    SavedCard:
      properties:
        brand:
          type: string
          title: Brand
        last4:
          type: string
          title: Last4
        exp_month:
          anyOf:
          - type: integer
          - type: 'null'
          title: Exp Month
        exp_year:
          anyOf:
          - type: integer
          - type: 'null'
          title: Exp Year
      type: object
      required:
      - brand
      - last4
      title: SavedCard
    OrganizationBilling:
      properties:
        billing_policy:
          $ref: '#/components/schemas/BillingPolicy'
        provisioned:
          type: boolean
          title: Provisioned
        metronome_customer_url:
          anyOf:
          - type: string
          - type: 'null'
          title: Metronome Customer Url
        balance_cents:
          anyOf:
          - type: number
          - type: 'null'
          title: Balance Cents
        refreshed_at:
          anyOf:
          - type: string
            format: date-time
          - type: 'null'
          title: Refreshed At
      type: object
      required:
      - billing_policy
      - provisioned
      - metronome_customer_url
      - balance_cents
      - refreshed_at
      title: OrganizationBilling
    BillingRunCost:
      properties:
        run_id:
          type: string
          title: Run Id
        name:
          type: string
          title: Name
        type:
          anyOf:
          - type: string
            enum:
            - training
            - eval
          - type: 'null'
          title: Type
        status:
          anyOf:
          - type: string
          - type: 'null'
          title: Status
        launch_at:
          anyOf:
          - type: string
            format: date-time
          - type: 'null'
          title: Launch At
        cents:
          type: number
          title: Cents
        training_cents:
          type: number
          title: Training Cents
        inference_cents:
          type: number
          title: Inference Cents
        grading_cents:
          type: number
          title: Grading Cents
        sandbox_cents:
          type: number
          title: Sandbox Cents
      type: object
      required:
      - run_id
      - name
      - type
      - status
      - launch_at
      - cents
      - training_cents
      - inference_cents
      - grading_cents
      - sandbox_cents
      title: BillingRunCost
    InternalRunCostRow:
      properties:
        organization_id:
          type: string
          title: Organization Id
        organization_key:
          type: string
          title: Organization Key
        organization_name:
          type: string
          title: Organization Name
        run_id:
          type: string
          title: Run Id
        run_name:
          type: string
          title: Run Name
        launched_by:
          anyOf:
          - type: string
          - type: 'null'
          title: Launched By
        type:
          type: string
          enum:
          - training
          - eval
          title: Type
        model:
          anyOf:
          - type: string
          - type: 'null'
          title: Model
        agent:
          anyOf:
          - type: string
          - type: 'null'
          title: Agent
        benchmark:
          anyOf:
          - type: string
          - type: 'null'
          title: Benchmark
        backend:
          anyOf:
          - type: string
          - type: 'null'
          title: Backend
        launch_at:
          type: string
          format: date-time
          title: Launch At
        duration_seconds:
          anyOf:
          - type: number
          - type: 'null'
          title: Duration Seconds
        status:
          anyOf:
          - type: string
          - type: 'null'
          title: Status
        total_cost:
          anyOf:
          - type: number
          - type: 'null'
          title: Total Cost
        sandbox_cost:
          anyOf:
          - type: number
          - type: 'null'
          title: Sandbox Cost
        training_cost:
          anyOf:
          - type: number
          - type: 'null'
          title: Training Cost
        inference_cost:
          anyOf:
          - type: number
          - type: 'null'
          title: Inference Cost
        grading_cost:
          anyOf:
          - type: number
          - type: 'null'
          title: Grading Cost
        other_cost:
          anyOf:
          - type: number
          - type: 'null'
          title: Other Cost
        public_total_cost:
          anyOf:
          - type: number
          - type: 'null'
          title: Public Total Cost
        public_sandbox_cost:
          anyOf:
          - type: number
          - type: 'null'
          title: Public Sandbox Cost
        public_training_cost:
          anyOf:
          - type: number
          - type: 'null'
          title: Public Training Cost
        public_inference_cost:
          anyOf:
          - type: number
          - type: 'null'
          title: Public Inference Cost
        public_grading_cost:
          anyOf:
          - type: number
          - type: 'null'
          title: Public Grading Cost
        public_other_cost:
          anyOf:
          - type: number
          - type: 'null'
          title: Public Other Cost
        public_unpriced_categories:
          items:
            type: string
          type: array
          title: Public Unpriced Categories
          default: []
        tinker_cost_basis:
          type: string
          enum:
          - provider_reported
          - provider_reported_partial
          - estimate
          title: Tinker Cost Basis
          default: estimate
        unpriced_categories:
          items:
            type: string
          type: array
          title: Unpriced Categories
      type: object
      required:
      - organization_id
      - organization_key
      - organization_name
      - run_id
      - run_name
      - launched_by
      - type
      - model
      - agent
      - benchmark
      - backend
      - launch_at
      - duration_seconds
      - status
      - total_cost
      - sandbox_cost
      - training_cost
      - inference_cost
      - grading_cost
      - other_cost
      - unpriced_categories
      title: InternalRunCostRow
    BillingSpendPoint:
      properties:
        day:
          type: string
          title: Day
        cents:
          type: number
          title: Cents
        costs:
          items:
            $ref: '#/components/schemas/BillingCostItem'
          type: array
          title: Costs
      type: object
      required:
      - day
      - cents
      - costs
      title: BillingSpendPoint
    PurchaseRequest:
      properties:
        amount_cents:
          type: integer
          maximum: 99999999.0
          minimum: 2500.0
          title: Amount Cents
        request_id:
          type: string
          format: uuid
          title: Request Id
      type: object
      required:
      - amount_cents
      - request_id
      title: PurchaseRequest
    BillingCostItem:
      properties:
        service:
          type: string
          title: Service
        model:
          anyOf:
          - type: string
          - type: 'null'
          title: Model
        token_type:
          anyOf:
          - type: string
          - type: 'null'
          title: Token Type
        cents:
          type: number
          title: Cents
      type: object
      required:
      - service
      - model
      - token_type
      - cents
      title: BillingCostItem
    BalanceResponse:
      properties:
        billing_policy:
          $ref: '#/components/schemas/BillingPolicy'
          default: standard
        balance_cents:
          type: number
          title: Balance Cents
        refreshed_at:
          type: string
          format: date-time
          title: Refreshed At
        has_card:
          anyOf:
          - type: boolean
          - type: 'null'
          title: Has Card
        can_manage:
          type: boolean
          title: Can Manage
        spend_alerts:
          anyOf:
          - items:
              type: integer
            type: array
          - type: 'null'
          title: Spend Alerts
        auto_reload_active:
          anyOf:
          - type: boolean
          - type: 'null'
          title: Auto Reload Active
        payment_hold:
          type: boolean
          title: Payment Hold
        usage_refreshed_at:
          anyOf:
          - type: string
            format: date-time
          - type: 'null'
          title: Usage Refreshed At
          description: When the usage and spend shown were last refreshed.
      type: object
      required:
      - balance_cents
      - refreshed_at
      - has_card
      - can_manage
      - spend_alerts
      - auto_reload_active
      - payment_hold
      title: BalanceResponse
    BillingNotification:
      properties:
        notification_id:
          type: string
          maxLength: 128
          minLength: 1
          title: Notification Id
        percentage:
          type: integer
          enum:
          - 50
          - 80
          - 100
          title: Percentage
        threshold_cents:
          type: number
          minimum: 0.0
          title: Threshold Cents
        current_spend_cents:
          type: number
          minimum: 0.0
          title: Current Spend Cents
        created_at:
          type: string
          format: date-time
          title: Created At
      type: object
      required:
      - notification_id
      - percentage
      - threshold_cents
      - current_spend_cents
      - created_at
      title: BillingNotification
    BillingPreferencesState:
      properties:
        auto_reload:
          type: boolean
          title: Auto Reload
          default: false
        reload_mode:
          type: string
          enum:
          - target
          - fixed
          title: Reload Mode
          default: target
        threshold_cents:
          type: integer
          maximum: 100000000.0
          minimum: 500.0
          title: Threshold Cents
          default: 1000
        reload_cents:
          type: integer
          maximum: 100000000.0
          minimum: 2500.0
          title: Reload Cents
          default: 2500
        monthly_limit_cents:
          type: integer
          maximum: 100000000.0
          minimum: 2500.0
          title: Monthly Limit Cents
          default: 10000
        spend_alert_cents:
          type: integer
          maximum: 100000000.0
          minimum: 1.0
          title: Spend Alert Cents
          default: 10000
        sync_pending:
          type: boolean
          title: Sync Pending
          default: false
        sync_delayed:
          type: boolean
          title: Sync Delayed
          description: Pending settings have waited longer than usual to apply.
          default: false
        sync_error:
          anyOf:
          - $ref: '#/components/schemas/PreferencesSyncError'
          - type: 'null'
          description: Why pending settings could not be applied; null unless they failed.
        fixed_reload_supported:
          type: boolean
          const: true
          title: Fixed Reload Supported
          default: true
      type: object
      title: BillingPreferencesState
    PreferencesSyncError:
      type: string
      enum:
      - missing_card
      - provider_error
      title: PreferencesSyncError
    BillingPolicy:
      type: string
      enum:
      - standard
      - free
      title: BillingPolicy
    InternalRunCostsResponse:
      properties:
        items:
          items:
            $ref: '#/components/schemas/InternalRunCostRow'
          type: array
          title: Items
        total:
          type: integer
          title: Total
        observed_at:
          type: string
          format: date-time
          title: Observed At
        tracking_enabled:
          type: boolean
          title: Tracking Enabled
        basis:
          type: string
          const: provider_estimate
          title: Basis
          default: provider_estimate
      type: object
      required:
      - items
      - total
      - observed_at
      - tracking_enabled
      title: InternalRunCostsResponse
    PaymentMethodResponse:
      properties:
        card:
          anyOf:
          - $ref: '#/components/schemas/SavedCard'
          - type: 'null'
      type: object
      title: PaymentMethodResponse
    BillingRunCostsResponse:
      properties:
        snapshot_id:
          type: string
          title: Snapshot Id
        items:
          items:
            $ref: '#/components/schemas/BillingRunCost'
          type: array
          title: Items
        total:
          type: integer
          title: Total
      type: object
      required:
      - snapshot_id
      - items
      - total
      title: BillingRunCostsResponse
    BillingPreferencesPatch:
      properties:
        auto_reload:
          type: boolean
          title: Auto Reload
          default: false
        reload_mode:
          type: string
          enum:
          - target
          - fixed
          title: Reload Mode
          default: target
        threshold_cents:
          type: integer
          maximum: 100000000.0
          minimum: 500.0
          title: Threshold Cents
          default: 1000
        reload_cents:
          type: integer
          maximum: 100000000.0
          minimum: 2500.0
          title: Reload Cents
          default: 2500
        monthly_limit_cents:
          type: integer
          maximum: 100000000.0
          minimum: 2500.0
          title: Monthly Limit Cents
          default: 10000
        spend_alert_cents:
          type: integer
          maximum: 100000000.0
          minimum: 1.0
          title: Spend Alert Cents
          default: 10000
      type: object
      title: BillingPreferencesPatch
    BillingTokenUsagePoint:
      properties:
        day:
          type: string
          title: Day
        service:
          type: string
          title: Service
        model:
          type: string
          title: Model
        token_type:
          type: string
          title: Token Type
        quantity:
          type: number
          title: Quantity
      type: object
      required:
      - day
      - service
      - model
      - token_type
      - quantity
      title: BillingTokenUsagePoint
  securitySchemes:
    TrajectoryAccessToken:
      type: http
      description: Short-lived token scoped to one rollout trajectory
      scheme: bearer
    InferenceAuthorization:
      type: http
      scheme: bearer