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

# Cost

> Get cost details for the team.

Get cost details for the team.

If `X-Friendli-Team` is omitted, this endpoint uses the default team configured in Friendli Suite.

There may be a slight delay between usage and when it shows up in cost. If you need to call this endpoint repeatedly, wait at least 5 minutes between calls.

To request successfully, it is mandatory to enter a **Personal API Key** (e.g. flp\_XXX) value in the **Bearer Token** field.
Refer to the [authentication section](/openapi/introduction#authentication) on our introduction page to learn how to acquire this variable and [visit here](https://friendli.ai/suite/~/setting/keys) to generate your API Key.


## OpenAPI

````yaml https://github.com/friendliai/friendli-openapi/raw/refs/heads/main/openapi.yaml get /v1/team/cost
openapi: 3.1.0
info:
  title: Friendli Suite API Reference
  description: This is an OpenAPI reference of Friendli Suite API.
  termsOfService: https://friendli.ai/terms-of-service
  contact:
    name: FriendliAI Support Team
    email: support@friendli.ai
  version: 0.1.0
servers:
  - url: https://api.friendli.ai
security: []
tags:
  - name: Serverless.Chat
  - name: Serverless.ToolAssistedChat
  - name: Serverless.Messages
  - name: Serverless.ChatRender
  - name: Serverless.Completions
  - name: Serverless.Token
  - name: Serverless.Audio
  - name: Serverless.Model
  - name: Serverless.Knowledge
  - name: Dedicated.Chat
  - name: Dedicated.Messages
  - name: Dedicated.ChatRender
  - name: Dedicated.Completions
  - name: Dedicated.Embeddings
  - name: Dedicated.TextClassification
  - name: Dedicated.Token
  - name: Dedicated.Image
  - name: Dedicated.Audio
  - name: Dedicated.Endpoint
  - name: Container.Chat
  - name: Container.Messages
  - name: Container.Completions
  - name: Container.TextClassification
  - name: Container.Token
  - name: Container.Image
  - name: Container.Audio
  - name: Cost
  - name: Dataset
  - name: File
paths:
  /v1/team/cost:
    get:
      tags:
        - Cost
      summary: Get cost details for the team.
      operationId: getCost
      parameters:
        - name: start_time
          in: query
          required: true
          schema:
            type: string
            format: date-time
            description: >-
              RFC 3339 timestamp in UTC. The time portion must be zeroed out
              (e.g., 2026-01-01T00:00:00Z). Must be no earlier than one year
              ago.
            title: Start Time
          description: >-
            RFC 3339 timestamp in UTC. The time portion must be zeroed out
            (e.g., 2026-01-01T00:00:00Z). Must be no earlier than one year ago.
        - name: bucket_width
          in: query
          required: false
          schema:
            anyOf:
              - $ref: '#/components/schemas/CostBucketWidth'
              - type: 'null'
            description: >-
              Width of each time bucket in response. Currently only `1d` is
              supported, default to `1d`.
            default: 1d
            title: Bucket Width
          description: >-
            Width of each time bucket in response. Currently only `1d` is
            supported, default to `1d`.
        - name: end_time
          in: query
          required: true
          schema:
            type: string
            format: date-time
            description: >-
              RFC 3339 timestamp in UTC. The time portion must be zeroed out
              (e.g., 2026-01-02T00:00:00Z).
            title: End Time
          description: >-
            RFC 3339 timestamp in UTC. The time portion must be zeroed out
            (e.g., 2026-01-02T00:00:00Z).
        - name: limit
          in: query
          required: false
          schema:
            anyOf:
              - type: integer
                maximum: 35
                minimum: 1
              - type: 'null'
            description: >-
              A limit on the number of buckets to be returned. Limit can range
              between 1 and 35, and the default is 7.
            default: 7
            title: Limit
          description: >-
            A limit on the number of buckets to be returned. Limit can range
            between 1 and 35, and the default is 7.
        - name: page
          in: query
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            description: >-
              A cursor for use in pagination. Corresponding to the `next_page`
              field from the previous response.
            title: Page
          description: >-
            A cursor for use in pagination. Corresponding to the `next_page`
            field from the previous response.
        - name: group_by
          in: query
          required: false
          schema:
            anyOf:
              - $ref: '#/components/schemas/CostGroupBy'
              - type: 'null'
            description: >-
              Group the costs by the specified fields. Currently only
              `line_item` is supported.
            title: Group By
          description: >-
            Group the costs by the specified fields. Currently only `line_item`
            is supported.
        - name: X-Friendli-Team
          in: header
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            description: ID of team to run requests as (optional parameter).
            title: X-Friendli-Team
          description: ID of team to run requests as (optional parameter).
      responses:
        '200':
          description: Team cost response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CostResponse'
        '422':
          description: Unprocessable Entity
        '429':
          description: Rate limit exceeded
      security:
        - token: []
components:
  schemas:
    CostBucketWidth:
      type: string
      enum:
        - 1d
      title: CostBucketWidth
    CostGroupBy:
      type: string
      enum:
        - line_item
      title: CostGroupBy
    CostResponse:
      properties:
        has_more:
          type: boolean
          title: Has More
          examples:
            - false
        next_page:
          anyOf:
            - type: string
            - type: 'null'
          title: Next Page
          examples:
            - null
        data:
          items:
            $ref: '#/components/schemas/CostBucket'
          type: array
          title: Data
      type: object
      required:
        - has_more
        - data
      title: CostResponse
    CostBucket:
      properties:
        start_time:
          type: string
          format: date-time
          title: Start Time
        end_time:
          type: string
          format: date-time
          title: End Time
        results:
          items:
            $ref: '#/components/schemas/CostResult'
          type: array
          title: Results
      type: object
      required:
        - start_time
        - end_time
        - results
      title: CostBucket
    CostResult:
      properties:
        total:
          type: number
          title: Total
          description: The numeric value of the cost. In USD.
          examples:
            - 2.709083
        quantity:
          anyOf:
            - type: number
            - type: 'null'
          title: Quantity
          description: >-
            When `group_by=line_item`, this field provides quantity of the line
            item.
          examples:
            - 0.934167
        unit_price:
          anyOf:
            - type: number
            - type: 'null'
          title: Unit Price
          description: >-
            When `group_by=line_item`, this field provides unit price of the
            line item in USD Cents.
          examples:
            - 290
        line_item:
          anyOf:
            - type: string
            - type: 'null'
          title: Line Item
          description: >-
            When `group_by=line_item`, this field provides line item name of the
            grouped costs result.
          examples:
            - h100, gpu_time
            - zai-org/GLM-5.1, output_tokens
      type: object
      required:
        - total
      title: CostResult
  securitySchemes:
    token:
      type: http
      description: >-
        When using Friendli Suite API for inference requests, you need to
        provide a **Personal API Key** for authentication and authorization
        purposes.


        For more detailed information, please refer
        [here](https://friendli.ai/docs/openapi/introduction#authentication).
      scheme: bearer

````