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

# Get a quote

> See eligible channel prices and the maximum credit reservation.

> API preview: generation providers are not connected. An authenticated request can return 503 without creating a task or charging credits.

## Quote the complete input

The server normalizes defaults, filters incompatible channels, and applies each remaining channel’s pricing formula. Duration, resolution, audio, quality, and output\_count may all change the total.

The maximum reservation covers one successful route per result item, not the sum of every possible failed attempt. A quote is an estimate of accepted limits, not a promise that a preview model will run.

## Understand the upper bound

```bash theme={null}
{
  "is_preview": true,
  "model": "prism-image-2",
  "input": {
    "prompt": "A sculptural chair in warm afternoon light",
    "resolution": "1024"
  },
  "output_count": 4,
  "estimated_credits": 80,
  "max_reserved_credits": 240,
  "channel_quotes": [
    {
      "channel_type": "third_party",
      "credits": 80
    },
    {
      "channel_type": "official",
      "credits": 240
    }
  ],
  "price_version": "preview-2026-10-29",
  "live_available": false
}
```

> channel\_quotes\[].credits is the total for the whole batch on that route, not a per-item price. This endpoint returns an unreserved preview estimate, not a quote\_id or a locked purchase offer.

## Set max\_credits

max\_credits is your cap for the entire request. If the server’s maximum reservation is higher, it rejects the whole submission before any generation. It does not silently reduce output\_count or divide a smaller budget between items.


## OpenAPI

````yaml openapi.json POST /v1/quotes
openapi: 3.1.0
info:
  title: APIstable API preview
  version: 0.1.0-preview
  description: >-
    Current implemented HTTP surface. / 当前已实现的 HTTP 接口。 Models and quote prices
    are illustrative. Real providers and paid generation are not connected. POST
    /v1/tasks and /v1/chat/completions return 503 provider_not_configured after
    authentication and applicable validation; no credits are reserved or
    charged. Live 202 acceptance, provider callbacks, SSE, idempotent task
    creation, and full model capability adapters remain future integration work.
    Website login sessions are separate from application API keys.
servers:
  - url: https://apistable.com
    description: APIstable API
security: []
tags:
  - name: Models
  - name: Quotes
  - name: Tasks
  - name: Credits
  - name: LLM
paths:
  /v1/quotes:
    post:
      tags:
        - Quotes
      summary: Validate input and estimate credits / 校验与估价
      description: >-
        Public, nonbinding preview estimate. No credits are reserved, no task is
        created, and no quote_id is issued. Unknown parameters are rejected.
        Inputs are checked against the current illustrative model catalog; full
        live supplier compatibility is not yet active. channel_quotes[].credits
        is the entire batch total for that route.
      operationId: createQuote
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/TaskRequest'
      responses:
        '200':
          description: Preview quote
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Quote'
        '400':
          description: >-
            validation_error, unsupported_parameter, invalid_output_count,
            unsupported_resolution, or unsupported_duration
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '404':
          description: model_not_found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '413':
          description: payload_too_large
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '422':
          description: credit_limit_exceeded
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '503':
          description: model_unavailable or service_unavailable
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
      security: []
components:
  schemas:
    TaskRequest:
      type: object
      additionalProperties: false
      required:
        - model
        - input
      properties:
        model:
          type: string
          minLength: 1
          example: prism-image-2
        input:
          $ref: '#/components/schemas/GenerationInput'
        output_count:
          type: integer
          minimum: 1
          maximum: 4
          default: 1
          description: >-
            Target result count. Images/videos accept 1–4; music and LLM must
            remain 1. Not a concurrency guarantee. / 目标结果数，非同时并发保证。
        fallback:
          type: boolean
          default: false
          description: >-
            Authorizes a higher-priced compatible official fallback after an
            eligible confirmed failure. Live execution is disabled in this
            build.
        max_credits:
          type: integer
          minimum: 0
          description: >-
            Whole-request reservation cap. Reject the entire request when
            max_reserved_credits exceeds it.
    Quote:
      type: object
      required:
        - is_preview
        - model
        - input
        - output_count
        - estimated_credits
        - max_reserved_credits
        - channel_quotes
        - price_version
        - live_available
      properties:
        is_preview:
          const: true
        model:
          type: string
        input:
          $ref: '#/components/schemas/GenerationInput'
        output_count:
          type: integer
          minimum: 1
          maximum: 4
        estimated_credits:
          type: number
          minimum: 0
          description: Credits, not USD. / 积分，非美元。
        max_reserved_credits:
          type: number
          minimum: 0
          description: Credits, not USD. / 积分，非美元。
        channel_quotes:
          type: array
          items:
            type: object
            required:
              - channel_type
              - credits
            properties:
              channel_type:
                type: string
                enum:
                  - third_party
                  - official
              credits:
                type: number
                minimum: 0
                description: Whole-batch total using this channel. / 整批渠道总积分。
        price_version:
          type: string
        live_available:
          const: false
    Error:
      type: object
      required:
        - error
      properties:
        error:
          type: object
          required:
            - code
            - message
          properties:
            code:
              type: string
            message:
              type: string
    GenerationInput:
      type: object
      additionalProperties: false
      required:
        - prompt
      description: >-
        Current preview input. Supported fields vary by modality and exact
        catalog model. No live provider mapping is implied.
      properties:
        prompt:
          type: string
          minLength: 1
          maxLength: 4000
        duration_seconds:
          type: integer
          description: Video-only; must match the model duration list.
        resolution:
          type: string
          description: Must match the model resolution list.
        aspect_ratio:
          type: string
          enum:
            - '16:9'
            - '9:16'
            - '1:1'
            - '4:3'
        seed:
          type: integer
          minimum: 0
        generate_audio:
          type: boolean
          description: Video only, subject to model support.
        instrumental:
          type: boolean
          description: Music only.
        lyrics:
          type: string
          maxLength: 5000
          description: Music only.

````

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