---
title: "Generate text (chat) — estimate"
method: POST
path: "/v1/ai/text/estimate"
tags: ["Text"]
---

# Generate text (chat) — estimate

`POST /v1/ai/text/estimate`

## Request

- Base URL: `https://apihub.co.il`
- URL: `https://apihub.co.il/v1/ai/text/estimate`
- Auth: HTTP bearer

Price the request without executing it. Same body as `POST /v1/ai/text`.

## Request body

- object
  - `json` boolean: Ask for a JSON answer
  - `media` object[]: Files the model sees and hears together with the prompt: a video (what happens on screen and when, with its sound — ask for timestamps), images, audio, PDFs. Up to 1 GB each (big videos take a few minutes to upload — send x-wait-ms or poll). A public YouTube link works too (no download; use start/end for one part of a long video)
    - `end` number: Video / audio: look only until this second
    - `fps` number: Video: frames per second the model looks at (default 1; 2–4 for fast action or timing to the frame)
    - `url` string, uri, required: Public URL of the file — e.g. an upload from POST /v1/studio/uploads or a render — or a public YouTube link (watch / shorts / youtu.be): the model watches it directly, nothing is downloaded; one YouTube link per request
    - `type` 'video' | 'image' | 'audio' | 'pdf': Detected from the file when omitted
    - `start` number: Video / audio: look only from this second
  - `model` 'auto' | 'gemini-3.8-flash' | 'gemini-3.5-flash' | 'gemini-3.5-flash-lite' | 'gemini-3.1-pro-preview' | 'gemini-3.1-flash-lite': A model id (GET /v1/ai/models) or "auto" — then `quality` decides: fast=gemini-3.1-flash-lite, balanced=gemini-3.5-flash, best=gemini-3.1-pro-preview
  - `prompt` string: Single-turn prompt (or use messages)
  - `system` string
  - `quality` 'fast' | 'balanced' | 'best': Which model auto picks: fast (cheapest) · balanced (default) · best (strongest, costs more)
  - `messages` object[]
    - `role` 'user' | 'assistant', required
    - `content` string, required
  - `max_tokens` integer: The longest answer, in tokens. A model that thinks first (Gemini 3.5 Flash, 3.8 Flash, 3.1 Pro) gets room to think on top of it — up to 8,192 tokens, billed as output like the answer — so the thinking never cuts the answer short
  - `temperature` number

## Response `200`

Estimate

- Estimate
  - `operation` string
  - `estimated_credits` number
  - `credits_to_reserve` number
  - `estimated_usage` object
  - `note` string, nullable
  - `balance` object
    - `available` number
  - `sufficient` boolean

---

[API](https://skmtc.dev/apihub/apis/apihub-one-api-for-chat-image-video-ai.md) · [All operations](https://skmtc.dev/apihub/apis/apihub-one-api-for-chat-image-video-ai/llms.txt) · [OpenAPI document](https://skmtc.dev/apihub/apis/apihub-one-api-for-chat-image-video-ai/revisions/a8caa42835ce?raw)
