> ## Documentation Index
> Fetch the complete documentation index at: https://conductorone-hunner-patch-1.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Get Inference Usage Attribution

> Returns inference request and token usage for this Edge grouped by the selected attribution dimension.



## OpenAPI

````yaml https://spec.speakeasy.com/conductor-one/conductorone/my-source-with-code-samples get /api/v1/apps/{app_id}/edges/{id}/inference/usage-attribution
openapi: 3.1.0
info:
  description: The C1 API is a HTTP API for managing C1 resources.
  title: C1 API
  version: 0.1.0-alpha
servers:
  - description: The C1 API server for the current tenant.
    url: https://{tenantDomain}.conductor.one
    variables:
      tenantDomain:
        default: example
        description: The domain of the tenant to use for this request.
security:
  - bearerAuth: []
    oauth: []
paths:
  /api/v1/apps/{app_id}/edges/{id}/inference/usage-attribution:
    get:
      tags:
        - Edge
      summary: Get Inference Usage Attribution
      description: >-
        Returns inference request and token usage for this Edge grouped by the
        selected attribution dimension.
      operationId: c1.api.edge.v1.EdgeService.GetInferenceUsageAttribution
      parameters:
        - in: path
          name: app_id
          required: true
          schema:
            description: The appId field.
            type: string
        - in: path
          name: id
          required: true
          schema:
            description: The id field.
            type: string
        - in: query
          name: bucket
          schema:
            description: The bucket field.
            enum:
              - TB_TIME_BUCKET_UNSPECIFIED
              - TB_TIME_BUCKET_HOUR
              - TB_TIME_BUCKET_DAY
            type: string
            x-speakeasy-unknown-values: allow
        - in: query
          name: dimension
          schema:
            description: The dimension field.
            enum:
              - TB_USAGE_ATTRIBUTION_DIMENSION_UNSPECIFIED
              - TB_USAGE_ATTRIBUTION_DIMENSION_TEAM
              - TB_USAGE_ATTRIBUTION_DIMENSION_APPLICATION
              - TB_USAGE_ATTRIBUTION_DIMENSION_AGENT
              - TB_USAGE_ATTRIBUTION_DIMENSION_COST_CENTER
              - TB_USAGE_ATTRIBUTION_DIMENSION_USER
              - TB_USAGE_ATTRIBUTION_DIMENSION_PROVIDER
              - TB_USAGE_ATTRIBUTION_DIMENSION_MODEL
            type: string
            x-speakeasy-unknown-values: allow
        - in: query
          name: page_size
          schema:
            description: The pageSize field.
            format: int32
            type: integer
        - in: query
          name: page_token
          schema:
            description: The pageToken field.
            type: string
        - in: query
          name: since
          schema:
            description: The since field.
            format: int64
            type: string
        - in: query
          name: until
          schema:
            description: The until field.
            format: int64
            type: string
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/c1.api.edge.v1.EdgeServiceGetInferenceUsageAttributionResponse
          description: Successful response
components:
  schemas:
    c1.api.edge.v1.EdgeServiceGetInferenceUsageAttributionResponse:
      description: The EdgeServiceGetInferenceUsageAttributionResponse message.
      properties:
        rows:
          description: |-
            Ordered by (input_tokens + output_tokens) descending, limited to
             page_size.
          items:
            $ref: '#/components/schemas/c1.api.edge.v1.TBUsageAttributionRow'
          type:
            - array
            - 'null'
      title: Edge Service Get Inference Usage Attribution Response
      type: object
      x-speakeasy-name-override: EdgeServiceGetInferenceUsageAttributionResponse
    c1.api.edge.v1.TBUsageAttributionRow:
      description: TBUsageAttributionRow is one attribution-id group.
      properties:
        attributionId:
          description: >-
            Empty string means unattributed for a user-facing attribution
            dimension.
             For PROVIDER it is the raw provider_id, and for MODEL it is the raw
             provider-native served model_name. Blank remains distinct from a literal
             "Unknown" ID; clients label it Unknown provider/model.
          type: string
        cacheReadTokens:
          description: >-
            Observed provider-attempt cache usage, not inferred for missing
            attempts.
          format: uint64
          type: string
        cacheWriteTokens:
          description: The cacheWriteTokens field.
          format: uint64
          type: string
        costNanoUsd:
          description: |-
            List-price estimate for observed usage in this group, in nano-USD.
             Provider/model usage is priced per served model; long-context rates use
             average input per observed attempt. Missing usage or an unpriced model
             makes this a lower bound, not an invoiced amount.
          format: int64
          type: string
        inputTokens:
          description: >-
            PROVIDER and MODEL values include only provider-reported per-attempt
            usage.
          format: uint64
          type: string
        missingUsageCallCount:
          description: |-
            Provider attempts with contact started but no observed token usage.
             Their cost is unknown even when the model has a list price.
          format: uint64
          type: string
        modelBreakdown:
          description: >-
            Complete breakdown of this provider's included models, only for
            PROVIDER.
             Parent counters include these children; do not sum both for scope totals.
          items:
            $ref: '#/components/schemas/c1.api.edge.v1.TBUsageAttributionModelRow'
          type:
            - array
            - 'null'
        outputTokens:
          description: The outputTokens field.
          format: uint64
          type: string
        requestCount:
          description: >-
            Logical root requests except for PROVIDER and MODEL, where this
            counts
             contacted provider attempts.
          format: uint64
          type: string
        unpricedRequestCount:
          description: >-
            Observed requests or provider attempts whose model has no list
            price.
          format: uint64
          type: string
      title: Tb Usage Attribution Row
      type: object
      x-speakeasy-name-override: TBUsageAttributionRow
    c1.api.edge.v1.TBUsageAttributionModelRow:
      description: |-
        One provider-native served model within a PROVIDER attribution group.
         Blank model_name is distinct from a model literally named "Unknown".
      properties:
        cacheReadTokens:
          description: The cacheReadTokens field.
          format: uint64
          type: string
        cacheWriteTokens:
          description: The cacheWriteTokens field.
          format: uint64
          type: string
        costNanoUsd:
          description: The costNanoUsd field.
          format: int64
          type: string
        inputTokens:
          description: The inputTokens field.
          format: uint64
          type: string
        missingUsageCallCount:
          description: The missingUsageCallCount field.
          format: uint64
          type: string
        modelName:
          description: The modelName field.
          type: string
        outputTokens:
          description: The outputTokens field.
          format: uint64
          type: string
        requestCount:
          description: The requestCount field.
          format: uint64
          type: string
        unpricedRequestCount:
          description: The unpricedRequestCount field.
          format: uint64
          type: string
      title: Tb Usage Attribution Model Row
      type: object
      x-speakeasy-name-override: TBUsageAttributionModelRow
  securitySchemes:
    bearerAuth:
      scheme: bearer
      type: http
    oauth:
      description: >-
        This API uses OAuth2 with the Client Credential flow.

        Client Credentials must be sent in the BODY, not the headers.

        For an example of how to implement this, refer to the
        [c1TokenSource.Token()](https://github.com/ConductorOne/conductorone-sdk-go/blob/3375fe7c0126d17e7ec4e711693dee7b791023aa/token_source.go#L101-L187)
        function.
      flows:
        clientCredentials:
          scopes: {}
          tokenUrl: /auth/v1/token
      type: oauth2

````