Skip to content

Get a price quote

POSThttps://gptunnel.ru/api/v2/media/price

Send { model, prompt, params, inputs } to get the generation price. A quote is free and does not start a task. The API calculates the quote the same way it calculates the charge when you create the task.

For kling-v3, include prompt at the top level, alongside model. If you omit it or put it only inside params, the API returns 400 ERR_EMPTY_PROMPT.

For text-to-speech models, pricing depends on the voice and the length of the text. Send the same prompt and params.voice that you will use for the task. The API checks the voice just as it does when creating a task. An unknown or unavailable voice returns HTTP 400.

Use the full text you plan to submit. Quotes and task creation use the same rules for required prompts and length limits. For models that charge per prompt token, the text also affects the price. Check the model catalog for each model’s requirements.

Request body

ParameterTypeRequired?Description
model#stringRequiredModel identifier.
prompt#stringFor some modelsText to use for generation. The prompt field in the model catalog specifies whether it is required. If specified, max_length limits the number of characters and max_bytes limits the number of UTF-8 bytes.
params#objectOptionalGeneration settings, such as duration and resolution. These may affect the price.
inputs#objectOptionalInput files grouped by role, in the same format as for task creation. The API counts attachments and may read linked files to measure their dimensions or duration and check limits. Send the same inputs that you will use for generation.

For image-based generation with kling-image-v4-product, include both the text in prompt and the image URL in the inputs.image array. Without an image, the method returns HTTP 400 with details[].key: "image". If you supply an image but omit the text, the error points to prompt and contains ERR_EMPTY_PROMPT.

The examples read the key from the GPTUNNEL_API_KEY environment variable. Choose 5 or 10 seconds. The copied request uses that value for params.duration.

import json
import os
from urllib.request import Request, urlopen
body = {
'model': 'kling-v3',
'prompt': "A blue sky above the city's skyline.",
'params': {'resolution': '1080p', 'duration': 5, 'aspect_ratio': '16:9'},
}
request = Request(
'https://gptunnel.ru/api/v2/media/price',
method='POST',
headers={
'Authorization': os.environ['GPTUNNEL_API_KEY'],
'Content-Type': 'application/json',
},
data=json.dumps(body).encode('utf-8'),
)
with urlopen(request, timeout=30) as response:
print(json.load(response))

This five-second quote returned 210 RUB. Check price and currency in your own response for the amount that applies to your key. Kling returns params.duration as a string.

{
"code": 0,
"model": "kling-v3",
"price": 210,
"currency": "RUB",
"params": { "resolution": "1080p", "duration": "5", "aspect_ratio": "16:9" },
"breakdown": ["42 × 5 = 210.0000"]
}