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

# Retrieve estimate

> The latest credit estimate for a source created with `require_approval`. `estimate` is `null` until the first upload has produced a run; poll until `estimate.status` is `paused_for_approval`, then call [Approve source](/api-reference/brain/approve-source). `estimated_credits` is rounded up to the nearest 5 and is an estimate, not a quote.




## OpenAPI

````yaml get /brain/sources/{source_id}/estimate
openapi: 3.0.0
info:
  title: Public API
  version: 1.0.0
servers:
  - url: https://api.gumloop.com/api/v1
security: []
paths:
  /brain/sources/{source_id}/estimate:
    get:
      tags:
        - Brain
      summary: Retrieve estimate
      description: >
        The latest credit estimate for a source created with `require_approval`.
        `estimate` is `null` until the first upload has produced a run; poll
        until `estimate.status` is `paused_for_approval`, then call [Approve
        source](/api-reference/brain/approve-source). `estimated_credits` is
        rounded up to the nearest 5 and is an estimate, not a quote.
      operationId: getBrainSourceEstimate
      parameters:
        - $ref: '#/components/parameters/BrainSourceId'
      responses:
        '200':
          description: The source status and its latest estimate.
          content:
            application/json:
              schema:
                type: object
                required:
                  - source_id
                  - status
                properties:
                  source_id:
                    type: string
                  status:
                    type: string
                    enum:
                      - draft
                      - active
                      - paused
                    description: The source's status.
                  estimate:
                    type: object
                    nullable: true
                    properties:
                      sync_run_id:
                        type: string
                      status:
                        type: string
                        description: >-
                          Run status, `paused_for_approval` once the estimate is
                          ready.
                      estimated_tokens:
                        type: integer
                      estimated_credits:
                        type: integer
                      document_count:
                        type: integer
              example:
                source_id: jVustMhHWG43CFQBFMckcn
                status: draft
                estimate:
                  sync_run_id: EEGmBWjtbRzJdixVeSsetY
                  status: paused_for_approval
                  estimated_tokens: 75
                  estimated_credits: 5
                  document_count: 2
        '401':
          description: Unauthorized — missing or invalid Gumloop API credentials.
        '403':
          description: Forbidden — the caller cannot manage this source.
        '404':
          description: Source not found.
      security:
        - bearerAuth: []
      x-codeSamples:
        - lang: bash
          label: cURL
          source: >
            curl
            'https://api.gumloop.com/api/v1/brain/sources/jVustMhHWG43CFQBFMckcn/estimate'
            \
              -H 'Authorization: Bearer YOUR_ACCESS_TOKEN'
        - lang: python
          label: Python
          source: >
            from gumloop import Gumloop


            client = Gumloop(access_token="YOUR_ACCESS_TOKEN")

            estimate =
            client.brain.get_estimate("jVustMhHWG43CFQBFMckcn").estimate

            print(estimate and estimate.estimated_credits)
components:
  parameters:
    BrainSourceId:
      name: source_id
      in: path
      required: true
      schema:
        type: string
      description: The source id.
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: >-
        A personal API key or an [OAuth 2.0](/api-reference/oauth) access token.
        Personal API keys also require the `x-auth-key` header with your user
        ID.

````