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

# Get the cost of requests

> Returns the cost in nano-USD (10^-9 USD) of each request id sent, for requests made by the API key's organization. Ids with no usage record are returned with a cost of 0 and the response carries a `warning`. Usage can take a few seconds to appear after a request finishes.



## OpenAPI

````yaml /api-reference/cloud-platform-openapi.json post /v1/billing/costs
openapi: 3.1.0
info:
  description: Account, organization, workspace and billing routes of NEAR AI Cloud.
  title: NEAR AI Cloud Platform API
  version: '5'
servers:
  - url: https://cloud-platform.near.ai
    description: NEAR AI Cloud Platform
security: []
paths:
  /v1/billing/costs:
    post:
      tags:
        - Billing
      summary: Get the cost of requests
      description: >-
        Returns the cost in nano-USD (10^-9 USD) of each request id sent, for
        requests made by the API key's organization. Ids with no usage record
        are returned with a cost of 0 and the response carries a `warning`.
        Usage can take a few seconds to appear after a request finishes.
      operationId: get_billing_costs
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/BillingCostsRequest'
        required: true
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BillingCostsResponse'
          description: The cost of each request id.
        '400':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
          description: More than 10,000 ids were sent, or an id is not a UUID.
        '401':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
          description: Missing or invalid API key.
        '500':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
          description: Internal error.
      security:
        - api_key: []
components:
  schemas:
    BillingCostsRequest:
      description: The request ids to price.
      properties:
        requestIds:
          description: >-
            The request ids to get costs for, at most 10,000. Each is the UUID
            in the `inference-id`

            response header of a chat completions or messages response (not the
            `x-request-id` header).
          items:
            type: string
          maxItems: 10000
          type: array
      required:
        - requestIds
      type: object
    BillingCostsResponse:
      description: The cost of each request id.
      properties:
        requests:
          description: Array of request costs
          items:
            $ref: '#/components/schemas/RequestCost'
          type: array
        warning:
          description: >-
            Present when some request ids matched no usage record for this
            organization (those

            entries report costNanoUsd 0). Explains where the correct request
            ids come from.
          type:
            - string
            - 'null'
      required:
        - requests
      type: object
    ErrorResponse:
      description: The body of every error answer on the user routes.
      properties:
        error:
          $ref: '#/components/schemas/ErrorDetail'
      required:
        - error
      type: object
    RequestCost:
      description: Individual request cost
      properties:
        costNanoUsd:
          description: Cost in nano-USD (10^-9 USD). 0 when no usage record was found.
          format: int64
          type: integer
        requestId:
          description: The request ID
          format: uuid
          type: string
      required:
        - requestId
        - costNanoUsd
      type: object
    ErrorDetail:
      properties:
        code:
          type:
            - string
            - 'null'
        message:
          type: string
        param:
          type:
            - string
            - 'null'
        type:
          type: string
      required:
        - message
        - type
      type: object
  securitySchemes:
    api_key:
      bearerFormat: sk-
      description: 'API key beginning with `sk-`, sent as `Authorization: Bearer <key>`.'
      scheme: bearer
      type: http

````

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