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

# Get task billing

> Read the reserved credits and final charge for a task submitted under the same credential authorization. A pending charge is null. OAuth access tokens require `billing:read`.



## OpenAPI

````yaml /openapi.json get /v1/tasks/{task_id}/billing
openapi: 3.1.0
info:
  title: Mouter API
  version: '1.0'
  description: Discover tools, submit tasks, and read results and charges.
servers:
  - url: https://api.mouter.ai
    description: Production
security: []
paths:
  /v1/tasks/{task_id}/billing:
    get:
      tags:
        - Billing
      summary: Get task billing
      description: >-
        Read the reserved credits and final charge for a task submitted under
        the same credential authorization. A pending charge is null. OAuth
        access tokens require `billing:read`.
      operationId: get_task_billing
      parameters:
        - name: task_id
          in: path
          required: true
          description: The task ID returned when the tool was submitted.
          schema:
            type: string
            pattern: ^[A-Za-z0-9_-]{1,40}$
      responses:
        '200':
          description: Get task billing
          content:
            application/json:
              schema:
                type: object
                properties:
                  code:
                    type: integer
                    const: 0
                  message:
                    type: string
                    const: ''
                  data:
                    $ref: '#/components/schemas/TaskBilling'
                  request_id:
                    anyOf:
                      - type: string
                      - type: 'null'
                required:
                  - code
                  - message
                  - data
                  - request_id
        '400':
          $ref: '#/components/responses/Error400'
        '401':
          $ref: '#/components/responses/Error401'
        '403':
          $ref: '#/components/responses/Error403'
        '404':
          $ref: '#/components/responses/Error404'
        '503':
          $ref: '#/components/responses/Error503'
      security:
        - Bearer: []
components:
  schemas:
    TaskBilling:
      type: object
      properties:
        task_id:
          type: string
          pattern: ^[A-Za-z0-9_-]{1,40}$
        tool_key:
          type: string
          pattern: ^[a-z][a-z0-9_]{0,63}$
        task_status:
          type: string
          enum:
            - submitted
            - queued
            - in_progress
            - succeeded
            - failed
            - timed_out
            - canceled
        billing_status:
          type: string
          enum:
            - pending
            - settled
            - not_charged
        unit:
          type: string
          const: credit
        reserved_amount:
          type: number
          minimum: 0
        charged_amount:
          anyOf:
            - type: number
              minimum: 0
            - type: 'null'
        settled_at:
          anyOf:
            - type: integer
              minimum: 0
              description: UTC Unix time in seconds.
            - type: 'null'
      required:
        - task_id
        - tool_key
        - task_status
        - billing_status
        - unit
        - reserved_amount
        - charged_amount
        - settled_at
    Error:
      type: object
      properties:
        code:
          type: string
        message:
          type: string
        data:
          type: 'null'
        request_id:
          anyOf:
            - type: string
            - type: 'null'
      required:
        - code
        - message
        - data
        - request_id
  responses:
    Error400:
      description: Invalid request parameters, headers, or body.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    Error401:
      description: A valid credential is required.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    Error403:
      description: The credential lacks permission.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    Error404:
      description: The resource is unavailable to this caller.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    Error503:
      description: The operation is temporarily unavailable.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
  securitySchemes:
    Bearer:
      type: http
      scheme: bearer
      description: A Mouter API key or OAuth access token.

````

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