Skip to content
API Reference

Estimate cost

POST /v1/models/{model}/estimate — know the price before you run anything.

Find out exactly what a generation will cost in credits — without running it and without spending anything.

Playground

POST
/v1/models/{model}/estimate
Authorization<token>

API-ключ в заголовке Authorization со схемой Bearer:

Authorization: Bearer clipia_live_xxxxxxxxxxxxxxxxxxxxxx

Передавайте полную строку, включая префикс схемы Bearer и пробел. Также принимаются Authorization: Key <ключ> и заголовок X-Api-Key: <ключ> — выбирайте удобную схему. Ключ создаётся в личном кабинете (Настройки → API-ключи) и показывается один раз. Формат: clipia_live_… (боевой), clipia_test_… (песочница).

Sandbox / тестовый режим. Ключ с префиксом clipia_test_… работает в песочнице: submit не списывает кредиты и не запускает реальную генерацию — он мгновенно возвращает status: COMPLETED с детерминированным mock-результатом (фиксированный sample-ассет на media.clipia.ai). Поле cost показывает расчётную стоимость, но она не списывается. Вебхуки приходят тем же подписанным механизмом (HMAC-SHA256). Режим предназначен для отладки интеграции до подключения боевого ключа.

In: header

Path Parameters

modelstringrequired

Slug модели, напр. nano-banana-2, seedance-2-fast-i2v. Список — GET /v1/models.

inputobjectrequired

Параметры генерации, для которых считается стоимость. Тот же формат, что и input в POST /v1/models/{model} — см. input_schema модели.

Empty Object

Response Body

curl -X POST "https://api.clipia.ai/v1/models/nano-banana-2/estimate" \  -H "Content-Type: application/json" \  -d '{    "input": {      "prompt": "a sunset over mountains, cinematic",      "aspect_ratio": "16:9"    }  }'

{
  "credits": 40
}

{
  "error": {
    "type": "invalid_request_error",
    "code": "invalid_api_key",
    "message": "API-ключ отсутствует, неверный или отозван."
  }
}

{
  "error": {
    "type": "invalid_request_error",
    "code": "not_found",
    "message": "Запрос с таким идентификатором не найден."
  }
}

{
  "error": {
    "type": "invalid_request_error",
    "code": "model_input_invalid",
    "message": "Параметр `resolution` не поддерживается этой моделью."
  }
}

{
  "error": {
    "type": "invalid_request_error",
    "code": "rate_limit_exceeded",
    "message": "Превышен лимит запросов. Повторите позже."
  }
}

POST /v1/models/:model/estimate returns the deterministic cost of the given input on the selected model. Nothing is queued, no credits are reserved or charged. The endpoint is available to any valid key — no scope required.

POST/v1/models/:model/estimate

Request

Prop

Type

curl -X POST https://api.clipia.ai/v1/models/seedance-2-fast-i2v/estimate \
  -H "Authorization: Bearer $CLIPIA_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "input": {
      "prompt": "aerial shot over a neon city",
      "duration": 8,
      "resolution": "1080p"
    }
  }'
const { credits } = await clipia.models.estimate('seedance-2-fast-i2v', {
  prompt: 'aerial shot over a neon city',
  duration: 8,
  resolution: '1080p',
});
console.log(`This generation costs ${credits} credits`);
estimate = client.models.estimate(
    "seedance-2-fast-i2v",
    {"prompt": "aerial shot over a neon city", "duration": 8, "resolution": "1080p"},
)
print(f"This generation costs {estimate.credits} credits")

Response 200

{
  "credits": 40
}

Prop

Type

Why it exists

Cost is deterministic: it is derived from the model and its parameters, not from how long the job actually ran. That means the price can be known upfront and shown to the user before anything starts.

Typical uses:

  • confirming the price before an expensive high-resolution video generation;
  • comparing parameter trade-offs (4s vs 8s, 720p vs 1080p);
  • checking the budget inside an automation, where generations run with nobody watching.

The estimate matches the charge

The credits value returned here equals the cost field of the submit response for the same parameters. Credits are reserved at submit and settled on success; on FAILED they are refunded in full.

Errors

HTTPcodeWhen
404not_foundunknown model slug
422model_input_invalidparameters are not supported by this model
429rate_limit_exceededrate limit exceeded