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

# Estimate flow run cost

> Credit-cost range of one run of the given (possibly unsaved) config. `min`/`max` because waterfalls stop at the first success and conditions skip branches. Call this before `POST /v1/flows/{flow_id}/run`.

<Info>
  Credit-cost range of one run of a (possibly unsaved) config. `min` / `max` because waterfalls stop at the first success and conditions skip branches. Call this before `POST /v1/flows/{flow_id}/run`.
</Info>


## OpenAPI

````yaml POST /v1/flows/cost-estimate
openapi: 3.1.0
info:
  title: Databar.ai API
  description: >-

    # Authentication


    Databar uses API keys to allow access to the API. You can find your API key
    in your workspace home page, but to use the REST API you’ll first need to
    schedule a call with us.

    Our API expects the API key to be included in all API requests to the server
    in the Header of your request with the key `x-apikey`.

    To find your API key, head over to your Databar workspace and click
    Integrations.


    **Example:**


    `bash

    curl https://api.databar.ai/v1/user/me -H x-apikey: {YOUR_API_KEY}`
  contact:
    email: info@databar.ai
  version: 0.1.2
servers:
  - url: https://api.databar.ai
    description: Production
security: []
paths:
  /v1/flows/cost-estimate:
    post:
      tags:
        - Flows
      summary: Estimate the credit cost of one flow run
      description: >-
        Credit-cost range of one run of the given (possibly unsaved) config.
        `min`/`max` because waterfalls stop at the first success and conditions
        skip branches. Call this before `POST /v1/flows/{flow_id}/run`.
      operationId: estimate_flow_cost_v1_flows_cost_estimate_post
      parameters:
        - name: x-apikey
          in: header
          required: true
          schema:
            type: string
            title: API Key
            description: API Key for authentication
          description: API Key for authentication
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/FlowConfigIn'
      responses:
        '200':
          description: Credit-cost range of one run
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/FlowCostEstimateOut'
        '400':
          description: The config is not a valid flow; the message lists what is wrong
        '403':
          description: Forbidden
components:
  schemas:
    FlowConfigIn:
      properties:
        config:
          type: object
          title: Config
          description: >-
            Flow definition, possibly unsaved: `{inputs: [...], nodes: [...],
            output: {...}}`. Same shape `POST /v1/flows` and `GET
            /v1/flows/{flow_id}` use.
      type: object
      required:
        - config
      title: FlowConfigIn
    FlowCostEstimateOut:
      properties:
        min:
          type: string
          title: Min
          description: Cheapest one-run cost, in credits.
        max:
          type: string
          title: Max
          description: Most expensive one-run cost, in credits.
        currency:
          type: string
          title: Currency
          default: credits
      type: object
      required:
        - min
        - max
      title: FlowCostEstimateOut

````