Estimate Credits
Estimate credits from a media model and its current parameters without creating a task or charging credits.
Call this endpoint before creating an image or video task to show the estimated credits for the selected parameters. The quote matches live pricing rules using the current API key's model access, region, and user group.
The quote request uses the same flat parameter shape as POST /v1/generations. For an accurate estimate, send the same pricing-relevant fields and values that you will use when creating the task.
POST /v1/quoteRequest parameters
| Field | Type | Required | Description |
|---|---|---|---|
model | string | Yes | Image or video model ID |
prompt | string | No | Optional for quoting; task creation still follows the selected model schema |
n | integer | No | Output count |
resolution | string | No | Resolution, such as 1K, 2K, or 720p |
aspect_ratio | string | No | Frame ratio, such as 1:1 or 16:9 |
duration | integer | No | Video duration in seconds |
quality | string | No | Send only when declared by the model schema, such as low, medium, or high for gpt-image-2-official |
reference_images | string[] | No | Reference image URLs; send only when declared by the model schema |
reference_videos | string[] | No | Reference video URLs; Seedance 2 models accept up to 3 and may enable video-input pricing |
input_video_duration | number | No | Actual processed input-video seconds; send with reference_videos for an accurate quote |
reference_audios | string[] | No | Reference audio URLs; Seedance 2 models accept up to 3 |
generate_audio | boolean | No | Whether to generate audio; Seedance 2 models default to true |
audio | boolean | No | Kling generated-audio switch; send only when declared by the model schema |
mode | string | No | Kling quality tier, such as std, pro, or 4k |
first_frame_image_url | string | No | First-frame image URL; send only when declared by the model schema |
last_frame_image_url | string | No | Last-frame image URL; send only when declared by the model schema |
Only send parameters supported by the selected model. Do not use the frontend-only /api/playground/quote wrapper { model, family, input } with the public API; both /v1/quote and /v1/generations use the flat shape above.
Final charging is still determined when the task is created and the server matches the live rule again. If n, resolution, quality, duration, reference videos, or input-video duration differ between quote and generation requests, the results may differ.
Kling mode, audio, reference videos, and input-video duration may all affect pricing and must match between quote and generation requests. Gemini Omni Flash currently accepts only duration=10.
Example
curl -X POST https://www.aibubu.ai/v1/quote \
-H "Authorization: Bearer sk_yeehoo_your_api_key" \
-H "Content-Type: application/json" \
-d '{
"model": "gpt-image-2",
"n": 2,
"resolution": "2K",
"aspect_ratio": "1:1"
}'Response
{
"model": "gpt-image-2",
"family": "image",
"estimated_credits": 22.4,
"unit": "image",
"charge_type": "per_image",
"matched_rule_id": "team_gpt_image_2_2k",
"pricing_version": "<sha256>"
}estimated_credits is the total for the request. In this example, 2K costs 11.2 credits per image and n=2 costs 22.4 credits total; do not multiply by n again. Quote and task creation each match the currently active rules.
Do not send quality to models that do not declare it. The regular gpt-image-2 has no quality parameter; gpt-image-2-official supports low, medium, and high.
Video-input quote example:
{
"model": "seedance-2",
"duration": 5,
"resolution": "720p",
"reference_videos": ["https://cdn.example.com/input.mp4"],
"input_video_duration": 8,
"generate_audio": true
}This is a read-only operation: it does not create a task, reserve balance, or write usage.
Billing lifecycle
/v1/quoteis read-only and does not reserve credits./v1/generationsmatches pricing again and authorizes credits for the actual request.- Running work appears in the balance response as
authorized_amount. - Success settles from the authorization snapshot; failure or cancellation releases unsettled authorization.
pricing_version and matched_rule_id are for reconciliation and support. perk_applied=true means a workspace benefit was applied. estimated_credits is always the total estimate for the request.