> ## Documentation Index
> Fetch the complete documentation index at: https://docs.costgraph.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Push AI gateway usage

> Accepts FOCUS 1.2 shaped rows with the cost columns left unpopulated. CostGraph prices them and writes conformant FOCUS records. Rows that already carry cost belong on POST /tenant/billing/focus and are rejected here. charge_period_start must be a UTC day on or after 2010-01-01 and not in the future.



## OpenAPI

````yaml /api-reference/costgraph/openapi.json post /tenant/billing/focus/usage
openapi: 3.0.0
info:
  description: Read and manage your CostGraph organization, spend, alerts, and settings.
  title: CostGraph API
  contact: {}
  version: '1.0'
servers:
  - url: https://api.costgraph.ai
security: []
tags:
  - name: ai
    x-group: AI
  - name: ai-serving
    x-group: AI serving
  - name: anomalies
    x-group: Anomalies
  - name: auth
    x-group: Auth
  - name: billing
    x-group: Billing
  - name: billing-export
    x-group: Billing export
  - name: budgets
    x-group: Budgets
  - name: ci
    x-group: CI
  - name: compute-recommendations
    x-group: Compute recommendations
  - name: config
    x-group: Config
  - name: cost
    x-group: Cost
  - name: gpus
    x-group: GPUs
  - name: graphai
    x-group: Graph AI
  - name: infracost
    x-group: Infracost
  - name: integrations
    x-group: Integrations
  - name: invitations
    x-group: Invitations
  - name: kubernetes-clusters
    x-group: Kubernetes clusters
  - name: marketplace
    x-group: Marketplace
  - name: network-requests
    x-group: Network requests
  - name: notifications
    x-group: Notifications
  - name: oauth
    x-group: OAuth
  - name: oauth-clients
    x-group: OAuth clients
  - name: opencost
    x-group: OpenCost
  - name: organization
    x-group: Audit log
  - name: organizations
    x-group: Organizations
  - name: placement-alternatives
    x-group: Placement alternatives
  - name: reports
    x-group: Reports
  - name: service-map
    x-group: Service map
  - name: settings
    x-group: Settings
  - name: sso
    x-group: Single sign-on
  - name: tenants
    x-group: Tenants
  - name: user
    x-group: Users
  - name: virtual-machines
    x-group: Virtual machines
  - name: virtual-tags
    x-group: Virtual tags
  - name: workflows
    x-group: Workflows
paths:
  /tenant/billing/focus/usage:
    post:
      tags:
        - integrations
      summary: Push AI gateway usage
      description: >-
        Accepts FOCUS 1.2 shaped rows with the cost columns left unpopulated.
        CostGraph prices them and writes conformant FOCUS records. Rows that
        already carry cost belong on POST /tenant/billing/focus and are rejected
        here. charge_period_start must be a UTC day on or after 2010-01-01 and
        not in the future.
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/focus.usagePushRequest'
        description: Usage rows
        required: true
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/responses.SuccessResponse'
        '422':
          description: Unprocessable Entity
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/responses.ErrorResponse'
components:
  schemas:
    focus.usagePushRequest:
      type: object
      properties:
        batch_id:
          type: string
        charge_period_end:
          type: string
        charge_period_start:
          type: string
        connection_id:
          type: string
        final:
          type: boolean
        focus_version:
          type: string
        overwrite:
          type: boolean
        row_offset:
          type: integer
        rows:
          type: array
          items:
            $ref: '#/components/schemas/focus.Record'
    responses.SuccessResponse:
      type: object
      required:
        - message
        - status
      properties:
        data: {}
        message:
          type: string
          example: some message
        status:
          type: string
          example: success
    responses.ErrorResponse:
      type: object
      required:
        - message
        - status
      properties:
        message:
          type: string
          example: some message
        status:
          type: string
          example: error
    focus.Record:
      type: object
      properties:
        AvailabilityZone:
          type: string
        BilledCost:
          type: string
        BillingAccountId:
          type: string
        BillingAccountName:
          type: string
        BillingAccountType:
          type: string
        BillingCurrency:
          type: string
        BillingPeriodEnd:
          type: string
        BillingPeriodStart:
          type: string
        CapacityReservationId:
          type: string
        CapacityReservationStatus:
          type: string
        ChargeCategory:
          type: string
        ChargeClass:
          type: string
        ChargeDescription:
          type: string
        ChargeFrequency:
          type: string
        ChargePeriodEnd:
          type: string
        ChargePeriodStart:
          type: string
        CommitmentDiscountCategory:
          type: string
        CommitmentDiscountId:
          type: string
        CommitmentDiscountName:
          type: string
        CommitmentDiscountQuantity:
          type: string
        CommitmentDiscountStatus:
          type: string
        CommitmentDiscountType:
          type: string
        CommitmentDiscountUnit:
          type: string
        ConsumedQuantity:
          type: string
        ConsumedUnit:
          type: string
        ContractedCost:
          type: string
        ContractedUnitPrice:
          type: string
        EffectiveCost:
          type: string
        InvoiceId:
          type: string
        InvoiceIssuer:
          type: string
        ListCost:
          type: string
        ListUnitPrice:
          type: string
        PricingCategory:
          type: string
        PricingCurrency:
          type: string
        PricingCurrencyContractedUnitPrice:
          type: string
        PricingCurrencyEffectiveCost:
          type: string
        PricingCurrencyListUnitPrice:
          type: string
        PricingQuantity:
          type: string
        PricingUnit:
          type: string
        Provider:
          type: string
        Publisher:
          type: string
        RegionId:
          type: string
        RegionName:
          type: string
        ResourceId:
          type: string
        ResourceName:
          type: string
        ResourceType:
          type: string
        ServiceCategory:
          type: string
        ServiceName:
          type: string
        ServiceSubcategory:
          type: string
        SkuId:
          type: string
        SkuMeter:
          type: string
        SkuPriceDetails:
          type: array
          items:
            type: integer
        SkuPriceId:
          type: string
        SubAccountId:
          type: string
        SubAccountName:
          type: string
        SubAccountType:
          type: string
        Tags:
          type: array
          items:
            type: integer

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.