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

# Estimate a generation's cost

> Price a run in credits WITHOUT starting it. Takes the same body as the create call and runs it through the same function the debit uses, so an estimate can never disagree with the charge. Free, and available to `read` keys.



## OpenAPI

````yaml /openapi.json post /v1/generations/cost
openapi: 3.1.0
info:
  title: Creatorline API
  version: 1.0.0
  description: >-
    Generate AI influencer photos and videos, and publish them to your creators'
    social

    accounts — from your own backend, your scripts, or a coding agent.


    Every request authenticates with an organization-scoped API key and is
    charged against

    that organization's credits, at the same prices the studio shows.
servers:
  - url: https://api.creatorline.io
    description: Production
  - url: http://localhost:3000/api
    description: Local development (the same routes, under the app's own /api prefix)
security:
  - bearerAuth: []
  - apiKeyHeader: []
tags:
  - name: Account
    description: Who the key belongs to, and what it can spend.
  - name: Catalog
    description: The live tool and model catalog. Read it, do not hardcode it.
  - name: Creators
    description: The AI creators a generation or post belongs to.
  - name: Generations
    description: Start, price and poll image and video runs.
  - name: Assets
    description: The media library, and uploading your own files.
  - name: Posts
    description: Turn media into a post and publish it to social platforms.
  - name: Credits
    description: Balance and the consumption ledger.
paths:
  /v1/generations/cost:
    post:
      tags:
        - Generations
      summary: Estimate a generation's cost
      description: >-
        Price a run in credits WITHOUT starting it. Takes the same body as the
        create call and runs it through the same function the debit uses, so an
        estimate can never disagree with the charge. Free, and available to
        `read` keys.
      operationId: estimateGenerationCost
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateGenerationRequest'
            example:
              tool: ugc-video
              params:
                duration: '10'
      responses:
        '200':
          description: The estimate.
          headers:
            x-request-id:
              description: >-
                Correlation id for this request. Quote it in any support
                question.
              schema:
                type: string
            x-ratelimit-limit:
              description: Requests allowed per minute.
              schema:
                type: integer
            x-ratelimit-remaining:
              description: Requests left in the current window.
              schema:
                type: integer
            x-ratelimit-reset:
              description: Unix seconds when the window resets.
              schema:
                type: integer
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CostEstimate'
              example:
                object: cost_estimate
                model: bytedance-seedance-2-0-reference-to-video-fast
                stage: video-ref
                count: 1
                credits: 48
                credit_balance: 4433
                sufficient: true
        '400':
          description: Invalid request. `param` names the offending field.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                error:
                  type: invalid_request_error
                  code: invalid_parameter
                  message: >-
                    Unknown tool "video". Available tools: ugc-video,
                    short-clip, scene-video, motion-control, hook-captions,
                    photo-edit, text-to-photo, add-audio, lipsync, change-voice,
                    text-to-speech, dialogue
                  param: tool
                request_id: req_8fQ2mRxK1pLd
        '401':
          description: Missing, malformed, revoked or expired key.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                error:
                  type: authentication_error
                  code: invalid_api_key
                  message: Missing or invalid API key.
                request_id: req_8fQ2mRxK1pLd
components:
  schemas:
    CreateGenerationRequest:
      type: object
      properties:
        tool:
          type: string
          enum:
            - ugc-video
            - short-clip
            - scene-video
            - motion-control
            - hook-captions
            - photo-edit
            - text-to-photo
            - add-audio
            - lipsync
            - change-voice
            - text-to-speech
            - dialogue
          description: The tool to run. Preferred over `stage`.
        stage:
          type: string
          description: Lower-level escape hatch when you want to address a stage directly.
        model:
          type: string
          enum:
            - nano-banana-pro
            - nano-banana-2-text-to-image
            - gpt-image-v2-text-to-image
            - nano-banana-pro-edit
            - nano-banana-2-edit
            - bytedance-seedream-v4-5-edit
            - gpt-image-v2-edit
            - bytedance-seedance-2-0-image-to-video
            - bytedance-seedance-2-0-image-to-video-fast
            - xai-grok-imagine-video-1-5-preview-image-to-video
            - google-gemini-omni-flash-image-to-video
            - bytedance-seedance-2-0-reference-to-video
            - bytedance-seedance-2-0-mini-reference-to-video
            - bytedance-seedance-2-0-reference-to-video-fast
            - xai-grok-imagine-reference-to-video
            - google-gemini-omni-flash-reference-to-video
            - kling-v3-standard-motion-control
            - hook-write
            - caption-burn
            - short-clip
            - bytedance-seedance-2-0-text-to-video
            - sync-3-lipsync
            - sync-lipsync-v2-pro
            - ffmpeg-api-merge-audio-video
            - elevenlabs-zrm-text-to-speech
            - elevenlabs-zrm-text-to-dialogue
            - change-voice
            - scene-seedance-2-0
            - scene-seedance-2-0-mini
            - scene-kling-o3-pro-reference
            - scene-seedance-2-0-fast
            - scene-kling-o3-standard-reference
            - scene-kling-o3-pro-edit
            - scene-kling-o3-standard-edit
          description: Override the tool's default model. Must belong to the tool's stage.
        prompt:
          type: string
          description: What to create. Required by most models.
        account_id:
          type: string
          format: uuid
          description: Generate as this creator — inherits their look, voice and persona.
        inputs:
          type: object
          description: >-
            Slot key → asset id(s) or public https URL(s), per the model's
            `inputs`. A URL is adopted as an asset automatically.
          additionalProperties:
            oneOf:
              - type: string
              - type: array
                items:
                  type: string
        params:
          type: object
          description: >-
            Model parameters. Validated against the model's schema — an unknown
            key is a 400.
          additionalProperties:
            oneOf:
              - type: string
              - type: number
              - type: boolean
        count:
          type: integer
          minimum: 1
          maximum: 4
          description: >-
            Alternatives to produce. Image models only; video is always one
            take.
    CostEstimate:
      type: object
      properties:
        object:
          type: string
          enum:
            - cost_estimate
        model:
          type: string
        stage:
          type: string
        count:
          type: integer
        credits:
          type: number
        credit_balance:
          type: number
        sufficient:
          type: boolean
    Error:
      type: object
      description: >-
        Every failure has this shape. `param` names the offending field when
        there is one.
      properties:
        error:
          type: object
          properties:
            type:
              type: string
              enum:
                - invalid_request_error
                - authentication_error
                - permission_error
                - not_found_error
                - rate_limit_error
                - insufficient_credits_error
                - api_error
            code:
              type: string
            message:
              type: string
            param:
              type: string
          required:
            - type
            - code
            - message
        request_id:
          type: string
        required_credits:
          type: number
          description: 402 only.
        credit_balance:
          type: number
          description: 402 only.
      required:
        - error
        - request_id
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: >-
        Your organization's API key, from Settings → API. `Authorization: Bearer
        crl_sk_live_…`
    apiKeyHeader:
      type: apiKey
      in: header
      name: X-API-Key
      description: Alternative to the Authorization header, for tooling that prefers it.

````

## Related topics

- [MCP server](/mcp.md)
- [Authentication](/authentication.md)
- [Generating media](/generations.md)
- [Errors and idempotency](/errors.md)
- [Creatorline API](/index.md)
