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

# Get Account Usage



## OpenAPI

````yaml get /v1/accounts/{account_id}/billingUsage
openapi: 3.1.0
info:
  title: Gateway REST API
  version: 5.10.0
servers:
  - url: https://api.fireworks.ai
security:
  - BearerAuth: []
tags:
  - name: AccountService
  - name: DeploymentService
  - name: Gateway
  - name: ModelService
  - name: TrainingService
paths:
  /v1/accounts/{account_id}/billingUsage:
    get:
      tags:
        - Gateway
      summary: Get Account Usage
      operationId: Gateway_GetAccountUsage
      parameters:
        - name: startTime
          description: |-
            Costs returned are inclusive of `start_time`.
            start_time must be before end_time.
          in: query
          required: true
          schema:
            type: string
            format: date-time
        - name: endTime
          description: |-
            Costs returned are exclusive of `end_time`.
            end_time must not be more than 31 days after start_time.
          in: query
          required: true
          schema:
            type: string
            format: date-time
        - name: usageType
          description: >-
            Usage type to query usage for

            If not specified, returns all usage types (serverless, dedicated
            deployments, and training).

             - USAGE_TYPE_UNSPECIFIED: Default value. When specified (or when usage_type field is not set),
            returns usage data for all deployment types: serverless requests,
            dedicated deployments,

            and training jobs.
             - SERVERLESS: Returns only serverless usage data.
            Filters the response to include only usage from serverless API
            requests.
             - DEDICATED_DEPLOYMENT: Returns only dedicated deployment usage data.
            Filters the response to include only usage from dedicated
            deployments.
             - TRAINING: Returns only training job usage data (SFT/DPO token usage and RFT / service-mode
            trainer GPU-seconds usage). Inference deployments serving rollouts
            for RFT /

            online RL are reported under DEDICATED_DEPLOYMENT (not TRAINING) to
            avoid

            double counting GPU time.
          in: query
          required: false
          schema:
            type: string
            enum:
              - USAGE_TYPE_UNSPECIFIED
              - SERVERLESS
              - DEDICATED_DEPLOYMENT
              - TRAINING
            default: USAGE_TYPE_UNSPECIFIED
        - name: timezone
          description: >-
            IANA timezone identifier for daily aggregation (e.g.,
            "America/Los_Angeles", "Europe/London").

            When specified, the returned data will be aggregated into daily
            buckets based on this timezone.

            If not specified or empty, defaults to "UTC".

            See: https://en.wikipedia.org/wiki/List_of_tz_database_time_zones
          in: query
          required: false
          schema:
            type: string
        - name: groupBy
          description: >-
            Dimensions to group usage by (multiple values allowed; each is a
            separate GROUP BY column).

            Serverless: "model_name", "api_key_id", "api_key_name", "user_id",
            "session_id", "annotations.team", "annotations.project",
            "annotations.environment".

            Dedicated: "deployment_name", "accelerator_type", and the same
            annotation keys.

            Training: "job_id", "training_session_id", "job_type", "usage_type",
            "accelerator_type", "base_model", and the same annotation keys.

            When usage_type is unspecified, dimensions that apply only to one
            stream are ignored on the others

            (e.g. "deployment_name" is ignored for serverless and training;
            "model_name" / "api_key_id" / "api_key_name" / "user_id" /
            "session_id"

            are ignored for dedicated and training; "job_id" /
            "training_session_id" / "job_type" are ignored for serverless and
            dedicated).

            "session_id" is the opaque client session from billing properties
            (serverless-only, high cardinality):

            prefer filtering by a single session; grouping by it can fan out to
            one row per session.

            Example: ["annotations.team", "model_name"] or ["user_id",
            "model_name"] or ["api_key_id", "api_key_name"].

            If empty: serverless aggregates by model name; dedicated defaults to
            deployment and accelerator type;

            training aggregates by job_id, training_session_id, job_type,
            usage_type, accelerator_type and base_model.
          in: query
          required: false
          explode: true
          schema:
            type: array
            items:
              type: string
        - name: filter
          description: >-
            This is a request variable of the map type. The query format is
            "map_name[key]=value", e.g. If the map name is Age, the key type is
            string, and the value type is integer, the query parameter is
            expressed as Age["bob"]=18
          in: query
          required: false
          schema:
            type: string
        - name: account_id
          in: path
          required: true
          description: The Account Id
          schema:
            type: string
      responses:
        '200':
          description: A successful response.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/gatewayAccountUsage'
components:
  schemas:
    gatewayAccountUsage:
      type: object
      properties:
        serverlessCosts:
          type: array
          items:
            $ref: '#/components/schemas/AccountUsageServerlessUsage'
            type: object
          title: List of serverless cost data
        dedicatedCosts:
          type: array
          items:
            $ref: '#/components/schemas/AccountUsageDedicatedDeploymentUsage'
            type: object
          title: List of dedicated deployment cost data
        trainingCosts:
          type: array
          items:
            $ref: '#/components/schemas/AccountUsageTrainingUsage'
            type: object
          description: >-
            List of training costs (SFT / DPO token usage and RFT / service-mode

            accelerator-second usage). Empty when training usage was not
            requested or

            when the account has training usage hidden.
      title: Response with model costs by deployment type
    AccountUsageServerlessUsage:
      type: object
      properties:
        modelName:
          type: string
          description: 'Deprecated: use group["model_name"] instead.'
        promptTokens:
          type: string
          format: int64
          title: Number of prompt tokens (for text inference)
        completionTokens:
          type: string
          format: int64
          title: Number of completion tokens (for text inference)
        cachedPromptTokens:
          type: string
          format: int64
          description: >-
            Number of prompt tokens served from cache (for text inference).
            Subset of prompt_tokens.
        uncachedPromptTokens:
          type: string
          format: int64
          description: >-
            Number of prompt tokens not served from cache (for text inference).
            prompt_tokens - cached_prompt_tokens.
        startTime:
          type: string
          format: date-time
          title: >-
            Start timestamp of the usage.

            Note: Serverless usage events are aggregated daily. Only the date
            portion (YYYY-MM-DD) is used;
        endTime:
          type: string
          format: date-time
          title: >-
            End timestamp of the usage.

            Note: Serverless usage events are aggregated daily. Only the date
            portion (YYYY-MM-DD) is used;
        audioInputSeconds:
          type: number
          format: double
          title: Audio input seconds (for audio inference)
        usageType:
          type: string
          title: Usage type to distinguish between different inference types
        apiKeyId:
          type: string
          description: 'Deprecated: use group["api_key_id"] instead.'
        group:
          type: object
          additionalProperties:
            type: string
          description: >-
            Group-by dimension key-values (model_name, api_key_id, api_key_name,
            user_id, session_id, team, project, environment).

            session_id is present only for buckets that had an opaque client
            session; no-session usage

            omits the key (all such usage collapses into a single "no session"
            bucket).
        costNanoUsd:
          type: number
          format: double
          description: >-
            Cost in nano-USD (1e-9 USD), summed from properties.cost. 0 when
            absent

            (not "free"). Only huggingface currently stamps authoritative cost.
      description: One serverless usage aggregation bucket.
    AccountUsageDedicatedDeploymentUsage:
      type: object
      properties:
        deploymentId:
          type: string
          title: The deployment ID
        acceleratorType:
          type: string
          title: GPU type / accelerator type
        acceleratorSeconds:
          type: string
          format: int64
          title: Accelerator seconds
        startTime:
          type: string
          format: date-time
          description: >-
            Start timestamp of the usage.

            Note: Dedicated deployment usage events are aggregated daily. Only
            the date portion (YYYY-MM-DD) is used;

            the time portion is ignored.
        endTime:
          type: string
          format: date-time
          description: >-
            End timestamp of the usage.

            Note: Dedicated deployment usage events are aggregated daily. Only
            the date portion (YYYY-MM-DD) is used;

            the time portion is ignored.
        baseModel:
          type: string
          title: Base model of the deployment
        usageType:
          type: string
          title: Usage type to distinguish between different deployment types
        placement:
          type: string
          description: >-
            Deployment placement as a string (e.g. US_IOWA_1, GLOBAL, US,
            EUROPE).

            Set to REGION_UNSPECIFIED when unknown.
        group:
          type: object
          additionalProperties:
            type: string
          description: >-
            Group-by dimension key-values (deployment_name, accelerator_type,
            team, project, environment).
      description: One dedicated deployment usage aggregation bucket.
    AccountUsageTrainingUsage:
      type: object
      properties:
        jobId:
          type: string
          description: >-
            The managed training job id (e.g. supervised_fine_tuning_job id,

            rlor_trainer_job id). Empty for serverless training token rows; use

            `training_session_id` for those.

            Best-effort: extracted from billing event_id for legacy records that
            did

            not emit it as an explicit property.
        trainingSessionId:
          type: string
          description: >-
            The serverless training session id. Populated for
            SERVERLESS_TRAINING_TOKENS

            rows and empty for managed training jobs.
        jobType:
          type: string
          description: |-
            High-level training job kind: "sft", "dpo", "rft", "trainer", etc.
            Best-effort for legacy records.
        usageType:
          type: string
          description: >-
            The underlying billing usage_type as emitted to the billing
            pipeline,

            e.g. "SUPERVISED_FINE_TUNING_USAGE",
            "REINFORCEMENT_FINE_TUNING_GPU_SECONDS",

            "FULL_PARAM_FINE_TUNING_GPU_HOURS". Frontends can use this to pick
            the

            right metric to display (tokens vs. accelerator_seconds).
        tokens:
          type: string
          format: int64
          description: |-
            Total tokens billed for this bucket. Populated for SFT / DPO usage;
            0 for accelerator-second usage types.
        acceleratorType:
          type: string
          description: >-
            Accelerator type for accelerator-second usage (e.g.
            "NVIDIA_H100_80GB").

            Empty for token-based usage.
        acceleratorSeconds:
          type: string
          format: int64
          description: >-
            Total accelerator seconds billed for this bucket. Frontends
            typically

            display this as GPU hours (seconds / 3600). 0 for token-based usage.
        baseModel:
          type: string
          description: Base model for the training job, when known.
        startTime:
          type: string
          format: date-time
          description: >-
            Start timestamp of the usage bucket.

            Note: Training usage events are aggregated daily. Only the date
            portion

            (YYYY-MM-DD) is used; the time portion is ignored.
        endTime:
          type: string
          format: date-time
          description: >-
            End timestamp of the usage bucket.

            Note: Training usage events are aggregated daily. Only the date
            portion

            (YYYY-MM-DD) is used; the time portion is ignored.
        group:
          type: object
          additionalProperties:
            type: string
          description: >-
            Group-by dimension key-values for the requested group_by. May
            include any

            of: job_id, training_session_id, job_type, usage_type,
            accelerator_type,

            base_model, annotations.team, annotations.project,
            annotations.environment.

            Empty values are omitted. Annotation values will typically be empty
            for

            training usage until billing emitters propagate annotations.
        annotations:
          type: object
          additionalProperties:
            type: string
          description: |-
            Annotation key-values associated with this bucket (team, project,
            environment). Mirrors the annotation entries in `group` for API
            symmetry with future per-stream consumers. Typically empty for
            training usage today until trainer-side billing emitters populate
            properties.annotation_* on every record.
      description: >-
        One training usage aggregation bucket.


        Training usage is emitted by the trainer-side billing pipeline. SFT /
        DPO

        usage is metered in tokens; RFT and full-param (service-mode) trainer

        usage is metered in accelerator-seconds. Both metrics are returned on
        the

        same message; consumers should use `usage_type` to disambiguate which

        metric is meaningful for a given row.


        Some legacy training billing events did not populate every metadata

        field. Missing values are returned as the proto default (empty string /

        0) rather than as an error.
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      description: >-
        Bearer authentication using your Fireworks API key. Format: Bearer
        <API_KEY>
      bearerFormat: API_KEY

````