Skip to main content
Getting Started

Pricing

Pay-as-you-go pricing for API usage

New users get a free quota to try models at no cost. See Free quota for details.
Billing varies by model type: text models charge per token, image generation per image, video generation per second, and speech models per character or per second of audio. Failed API calls are not charged and do not consume free quota.
For featured model pricing and discounts, visit the Pricing page. For the full catalog, see the Model Marketplace.

Text generation

Billed per million tokens. Input and output are priced separately. Tiered pricing: Some models use tiered pricing — the rate depends on the total input tokens in a single request. All tokens in that request are billed at the matched tier.
Suppose a model has two tiers: 0 < tokens ≤ 32K and 32K < tokens ≤ 128K. If a single request contains 100K input tokens, it falls in the second tier (32K < 100K ≤ 128K), so ALL tokens are billed at the second-tier rate — not the first 32K at tier 1 and the remaining 68K at tier 2.
Factors that affect billing:
  • Batch API — Input and output token rates are 50% of real-time pricing. Learn more →
  • Context caching — Cached input tokens receive a discount; the exact discount varies by model. Learn more →
  • Thinking mode — Thinking tokens count as output tokens and are billed at the output rate. Learn more →
  • Batch and cache discounts cannot be combined on the same request.

Image generation

Billed per input image and per successfully generated output image. Models that don't specify an input image price charge output only. Billing formula:
fee = input_image_price × input_count + output_image_price × output_count
Notes:
  • Some models tier output pricing by output image resolution.
  • Text-to-image has no input images, so no input charge applies.
  • Failed requests are not charged.
Suppose a model bills input and output images separately: $0.003/image for input, and output is tiered by resolution — $0.03/image at 1k, $0.075/image at 2k.Example 1: Image-to-image, 1k output, 1 image generated
  • Input fee: $0.003 × 1 = $0.003
  • Output fee: $0.03 × 1 = $0.03
  • Total: $0.033
Example 2: Text-to-image, 2k output, 2 images generatedText-to-image has no input image, so no input charge:
  • Output fee: $0.075 × 2 = $0.15
  • Total: $0.15
Example 3: Request 4 images, only 3 succeedOnly successfully generated images are billed. Failed images incur no charge.

Video generation

Input is not charged. Output is billed per second of generated video. Billing formula:
fee = price_per_second × output_video_duration (seconds)
Notes:
  • Some models price by output resolution (e.g., 720P vs 1080P).
  • Some models price by output mode (e.g., standard vs professional).
  • Some models price by aspect ratio (e.g., 1:1 vs 3:4).
  • Some models use a flat rate regardless of resolution, mode, or aspect ratio.
  • Failed requests are not charged.
Suppose a model charges $0.10/sec at 720P. You generate a 5-second video:
  • Fee: $0.10 × 5 = $0.50
If the same model charges $0.15/sec at 1080P, generating 5 seconds:
  • Fee: $0.15 × 5 = $0.75

Text to speech

Billed per 10,000 input characters. Output is not charged. Character counting rules:
  • One Chinese character (simplified, traditional, Japanese kanji, Korean hanja) counts as 2 characters.
  • All other characters (letters, digits, punctuation, spaces, Japanese kana, Korean letters) count as 1 character.
  • When using SSML, only the text content is counted — SSML tags are excluded.
Example: "Hello" = 5 characters; a single Chinese character = 2 characters.

Speech to text

Billed per second of audio input. Output is not charged. Applies to both real-time recognition and audio file transcription.

Speech to speech

Speech-to-speech models (Qwen-Omni series) handle text, audio, and image/video in a single call. Billed per million tokens, with different rates per modality. Multi-turn billing: Like text models, the model maintains full conversation context. Historical turns are billed as input in subsequent rounds, so input token counts grow with each turn. Token conversion rates vary by model. See Token counting → for details.

Embedding & reranking

Billed per million input tokens. Output is not charged. Factors that affect billing: Models that support Batch API are billed at 50% of real-time input pricing.

Built-in tools

Some built-in tools incur per-call fees in addition to model token costs.
ToolFeeNotes
Web Search$10 / 1K calls
Web ExtractorFREELimited time
Code InterpreterFREELimited time
Image Search$8 / 1K callsText-to-image and image-to-image
Function calling and MCP have no tool fees — tool descriptions count as input tokens.

Save on costs

For worked examples and advanced strategies, see Cost optimization →.

Learn more