An OpenAI-compatible API: one endpoint and one key for GPT, Claude, Gemini, DeepSeek and other chat models, plus image and video generation. Every example below runs as-is.
Quick Start
Just swap in the Base URL and API Key, and your existing OpenAI SDK works out of the box.
https://kovapi.com/v1
curl https://kovapi.com/v1/chat/completions -H "Authorization: Bearer YOUR_API_KEY" -H "Content-Type: application/json" -d '{"model": "gpt-5.5", "messages": [{"role": "user", "content": "Write a short product intro for an AI API"}], "stream": false}'
Full request parameters, examples and async usage for each model live in that model's own doc — open it from the Models & pricing table below.
More runnable examples (Python / Node / curl, including the async image and video flow): github.com/gaoorange/kovapi-api-examples
Authentication
All API calls require a Bearer Token.
Authorization: Bearer YOUR_API_KEY Content-Type: application/json
Models & Pricing
Full request parameters, examples and async usage for each model live in that model's own doc — open it from the Models & pricing table below.
| Model | Capability | Endpoint | Price | |
|---|---|---|---|---|
| gpt-5.6-sol | Frontier reasoning, agentic coding, long-horizon tasks, structured output | /chat/completions | Input $1.2/1M · Output $6.0/1M | API Docs → |
| gpt-5.6-terra | Everyday chat, agentic coding, reasoning, structured output | /chat/completions | Input $0.6/1M · Output $3.6/1M | API Docs → |
| gpt-5.6-luna | High-speed chat, agentic coding, high-volume low-latency, structured output | /chat/completions | Input $0.07/1M · Output $0.4/1M | API Docs → |
| gpt-6-astra | Deep reasoning, agentic coding, very long context, image input, structured output | /chat/completions | Input $3.0/1M · Output $15.0/1M | API Docs → |
| gpt-6.2-astra | Complex reasoning, agentic coding, long-document analysis, very long context, image input, tool calling, structured output | /chat/completions | Input $2.4/1M · Output $12.0/1M | API Docs → |
| gpt-6.2-sol | Agentic coding, complex coding, professional documents and analysis, reasoning, very long context, image input, tool calling, structured output | /chat/completions | Input $0.6/1M · Output $3.0/1M | API Docs → |
| gpt-6.1-sol | Agentic coding, complex coding, professional document and analysis work, reasoning, very long context, image input, structured output | /chat/completions | Input $0.6/1M · Output $3.0/1M | API Docs → |
| gpt-6-sol | Complex coding, agentic workflows, reasoning, very long context, image input, structured output | /chat/completions | Input $0.6/1M · Output $3.0/1M | API Docs → |
| gpt-6-luna | High-volume chat, low-latency agent steps, classification and extraction, very long context, structured output | /chat/completions | Input $0.07/1M · Output $0.4/1M | API Docs → |
| gpt-image-2 | Text-to-image, image-to-image, covers, posters, illustrations | /images/generations | 1K $0.005 · 2K $0.025 · 4K $0.04 | API Docs → |
| gpt-image-2.5-flare | Text-to-image, image-to-image, covers, posters, illustration, typography | /images/generations | 1K $0.025 · 2K $0.045 · 4K $0.07 | API Docs → |
| gpt-image-2.5-sunburst | Text-to-image, image-to-image, covers, posters, illustration, typography | /images/generations | 1K $0.025 · 2K $0.045 · 4K $0.07 | API Docs → |
| gpt-image-2.5-flare-ext | Text-to-image, image-to-image, 1K only, made in the web app | /images/generations | 1K $0.005 · 2K $0.0 · 4K $0.0 | API Docs → |
| gpt-image-2.5-sunburst-ext | Text-to-image, image-to-image, 1K only, made in the web app | /images/generations | 1K $0.005 · 2K $0.0 · 4K $0.0 | API Docs → |
| gpt-image-2.6-flare | Text-to-image, image-to-image, covers, posters, illustration, typography | /images/generations | 1K $0.04 · 2K $0.065 · 4K $0.09 | API Docs → |
| gpt-image-2.6-sunburst | Text-to-image, image-to-image, covers, posters, illustration, typography | /images/generations | 1K $0.04 · 2K $0.065 · 4K $0.09 | API Docs → |
| gpt-image-2.6-ext | Text-to-image, image-to-image (up to 10 references), 15 aspect ratios, 1K only | /images/generations | 1K $0.0 · 2K $0.0 · 4K $0.0 | API Docs → |
| nano-banana-2 | Text-to-image, image-to-image, covers, posters, illustrations | /images/generations | 1K $0.015 · 2K $0.025 · 4K $0.04 | API Docs → |
| nano-banana-pro | Text-to-image, image-to-image, covers, posters, illustrations, infographics | /images/generations | 1K $0.02 · 2K $0.03 · 4K $0.05 | API Docs → |
| nano-banana-2.1 | Text-to-image, image editing, multi-image composition, posters and infographics, product shots, wide banners | /images/generations | 1K $0.015 · 2K $0.025 · 4K $0.04 | API Docs → |
| nano-banana-2-lite | Text-to-image, multi-image composition, social visuals, product shots, ad variants, batch drafts, wide banners | /images/generations | 1K $0.01 · 2K $0.0 · 4K $0.0 | API Docs → |
| grok-imagine-image | Text-to-image, image editing, posters, product shots, social visuals, Chinese and English lettering | /images/generations | 1K $0.005 · 2K $0.005 · 4K $0.0 | API Docs → |
| grok-imagine-image-2.0 | Posters, infographics, text-heavy design, product shots and editing | /images/generations | 1K $0.015 · 2K $0.02 · 4K $0.0 | API Docs → |
| grok-imagine-image-quality | Covers, posters, product shots, illustration, text-to-image and image editing | /images/generations | 1K $0.015 · 2K $0.02 · 4K $0.0 | API Docs → |
| seedream-5.0-pro | Text-to-image, image editing, multi-image fusion (up to 8 references), posters and in-image text, product shots, 21:9 wide banners | /images/generations | 1K $0.025 · 2K $0.045 · 4K $0.0 | API Docs → |
| seedream-5.5 | Text-to-image, image editing, multi-image fusion (up to 10 references), edits over many rounds, posters and in-image text, 21:9 / 9:21 long formats | /images/generations | 1K $0.02 · 2K $0.03 · 4K $0.0 | API Docs → |
| kling-image-4.0 | Text-to-image, image-to-image with up to 10 references, in-image text and poster layouts, photoreal shots, 2K / 4K, 8 ratios (21:9 included) | /images/generations | 1K $0.0 · 2K $0.06 · 4K $0.09 | API Docs → |
| kling-image-4.0-long | E-commerce detail pages from 1-3 product photos (short, medium or long), web page designs from text alone or with a subject / style reference, 1K / 2K | /images/generations | 1K $0.235 · 2K $0.28 · 4K $0.0 | API Docs → |
| midjourney | Text-to-image (V8.2 / 8.1 / 7 / 6.1 / 6, Niji 8 / 7 / 6), image prompts (up to 5), upscale, vary, remix, reroll, zoom, pan, inpaint, blend, edit, with parameters written as on midjourney.com | /images/generations | 1K $0.045 · 2K $0.0 · 4K $0.0 | API Docs → |
| muse-image | Text-to-image, image-to-image and edits with up to 4 references, 7 aspect ratios, original image (usually WebP with a Meta C2PA content credential) | /images/generations | 1K $0.0 · 2K $0.015 · 4K $0.0 | API Docs → |
| nai-diffusion-5-full | Text-to-image, image-to-image (one reference, adjustable strength and noise), 15 ratios or a custom size, 1K | /images/generations | 1K $0.01 · 2K $0.0 · 4K $0.0 | API Docs → |
| nai-diffusion-5-curated | Text-to-image, image-to-image (one reference, adjustable strength and noise), 15 ratios or a custom size, 1K | /images/generations | 1K $0.01 · 2K $0.0 · 4K $0.0 | API Docs → |
| nai-diffusion-5-full-inpainting | Inpainting: one image plus one mask, only the masked area is redrawn, 1K | /images/generations | 1K $0.01 · 2K $0.0 · 4K $0.0 | API Docs → |
| nai-diffusion-4-5-full | Text-to-image, 15 ratios or a custom size, negative prompt, 1K | /images/generations | 1K $0.0 · 2K $0.0 · 4K $0.0 | API Docs → |
| claude-sonnet-4-6 | Chat, code, reasoning, long context | /chat/completions | Input $1.5/1M · Output $7.5/1M | API Docs → |
| claude-opus-5 | Deep reasoning, code, agents, long context, image understanding | /chat/completions | Input $4.0/1M · Output $20.0/1M | API Docs → |
| claude-fable-5 | Chinese writing, narrative creation, long-form generation, chat, code, image understanding | /chat/completions | Input $8.0/1M · Output $40.0/1M | API Docs → |
| claude-opus-5-5 | Complex reasoning, long-horizon agentic coding, code engineering, tool calling, image and PDF understanding | /chat/completions | Input $2.5/1M · Output $12.5/1M | API Docs → |
| claude-sonnet-5-5 | Everyday coding and agents, long context, tool calling, image and PDF understanding, production traffic at scale | /chat/completions | Input $1.5/1M · Output $7.5/1M | API Docs → |
| gemini-4-argon | Beta · reasoning · long context | /chat/completions | Input $0.5/1M · Output $3.0/1M | API Docs → |
| gemini-4-neon | Beta · reasoning · coding · long context | /chat/completions | Input $0.9/1M · Output $4.5/1M | API Docs → |
| gemini-4-hydrogen | Beta · reasoning · long context | /chat/completions | Input $0.45/1M · Output $2.25/1M | API Docs → |
| gemini-3.8-flash | Chat, reasoning, adaptive thinking, image input, very long context | /chat/completions | Input $0.6/1M · Output $3.6/1M | API Docs → |
| deepseek-v4.1-flash | Chat, reasoning, coding, tool calling, switchable thinking mode | /chat/completions | Input $0.11/1M · Output $0.44/1M | API Docs → |
| glm-5.3 | Chat, coding, agentic workflows, reasoning, Chinese and English writing, tool calling | /chat/completions | Input $1.12/1M · Output $3.52/1M | API Docs → |
| qwen3.8-max | Reasoning, coding, agents and tool calling, Chinese and English writing, image understanding | /chat/completions | Input $1.4/1M · Output $4.2/1M | API Docs → |
| grok-4.7 | Complex reasoning, coding, long-document analysis, tool calling, structured output, image understanding | /chat/completions | Input $0.3/1M · Output $0.9/1M | API Docs → |
| veo-3.1 | Short clips, product motion, first/last-frame transitions, commercial footage | /videos/generations | $0.2 /clip+ | API Docs → |
| gemini-omni-1.2-flash | Multi-shot clips, first-to-last-frame transitions, character references, editing existing videos | /videos/generations | $0.035 /s | API Docs → |
| gemini-omni-flash | Multi-shot clips, storyboard narratives, first/last-frame transitions | /videos/generations | $0.035 /s | API Docs → |
| kling-4.0 | Character action and dialogue, multi-shot shorts, video edits and motion transfer | /videos/generations | $0.09 /s | API Docs → |
| kling-4.0-flash | Frequent drafts, short videos in bulk, social clips | /videos/generations | $0.06 /s | API Docs → |
| seedance-2.5 | Long-take short films, multi-reference input, commercial footage | /videos/generations | $0.2 /s | API Docs → |
| seedance-2.5-flash | Clips in bulk, product videos, footage driven by reference material | /videos/generations | $0.135 /s | API Docs → |
| seedance-2.0 | Short clips, commercial assets | /videos/generations | $0.13 /s | API Docs → |
| seedance-2.0-fast | Bulk assets, quick concept checks | /videos/generations | $0.075 /s | API Docs → |
| seedance-2.0-mini | High-volume drafts, low-cost iteration | /videos/generations | $0.052 /s | API Docs → |
| seedance-2.0-clip | Short clips featuring real people, product videos, batch production | /videos/generations | $1.0 /clip+ | API Docs → |
| seedance-2.5-30s | Long-take storytelling, long-form product videos | /videos/generations | $2.0 /clip+ | API Docs → |
| wan3.0-video | Long-take storytelling, multi-asset composition, video rewriting | /videos/generations | $0.065 /s | API Docs → |
| wan3.0-video-prime | Deadline footage, batch test shoots | /videos/generations | $0.12 /s | API Docs → |
| minimax-h3 | HD clips with sound, first-frame and first + last frame animation, multi-image reference with reference audio and video | /videos/generations | $0.036 /s | API Docs → |
| minimax-h3-lite | Bulk clips, quick prompt tests, video from reference images | /videos/generations | $0.0125 /s | API Docs → |
| magi-2 | Dialogue scenes with lip-sync, multi-shot clips from a shot list, video from reference images, video and audio | /videos/generations | $0.06 /s | API Docs → |
| grok-imagine-video-1.5 | Bulk short videos, quick concept checks | /videos/generations | $0.04 /s | API Docs → |
| muse-video | Text-to-video, first-frame image-to-video, 16:9 / 9:16, sound in every clip, original MP4 (most with a Meta C2PA content credential) | /videos/generations | $0.02 /s | API Docs → |
| claude-fable-5-1 | Long-document analysis and reasoning | /chat/completions | Input $6.0/1M · Output $30.0/1M | API Docs → |
| claude-fable-5-2 | Long-document analysis and reasoning | /chat/completions | Input $4.8/1M · Output $24.0/1M | API Docs → |
| claude-haiku-5-5 | High-volume classification and routing, extraction, summaries, live support, subagents in coding agents, image and PDF understanding | /chat/completions | Input $0.06/1M · Output $0.3/1M | API Docs → |
Use it in an app (no code)
In any app that speaks the OpenAI API, fill in these three fields — no programming needed:
| API base URL | https://kovapi.com/v1 |
| API key | the key you create in the console (Console → API Keys → Copy) |
| Model name | gpt-5.6-sol gpt-5.6-terra gpt-5.6-luna gpt-6-astra gpt-6.2-astra gpt-6.2-sol gpt-6.1-sol gpt-6-sol gpt-6-luna gpt-image-2 gpt-image-2.5-flare gpt-image-2.5-sunburst gpt-image-2.5-flare-ext gpt-image-2.5-sunburst-ext gpt-image-2.6-flare gpt-image-2.6-sunburst gpt-image-2.6-ext nano-banana-2 nano-banana-pro nano-banana-2.1 nano-banana-2-lite grok-imagine-image grok-imagine-image-2.0 grok-imagine-image-quality seedream-5.0-pro seedream-5.5 kling-image-4.0 kling-image-4.0-long midjourney muse-image nai-diffusion-5-full nai-diffusion-5-curated nai-diffusion-5-full-inpainting nai-diffusion-4-5-full claude-sonnet-4-6 claude-opus-5 claude-fable-5 claude-opus-5-5 claude-sonnet-5-5 gemini-4-argon gemini-4-neon gemini-4-hydrogen gemini-3.8-flash deepseek-v4.1-flash glm-5.3 qwen3.8-max grok-4.7 veo-3.1 gemini-omni-1.2-flash gemini-omni-flash kling-4.0 kling-4.0-flash seedance-2.5 seedance-2.5-flash seedance-2.0 seedance-2.0-fast seedance-2.0-mini seedance-2.0-clip seedance-2.5-30s wan3.0-video wan3.0-video-prime minimax-h3 minimax-h3-lite magi-2 grok-imagine-video-1.5 muse-video claude-fable-5-1 claude-fable-5-2 claude-haiku-5-5 |
Verified with ChatBox, Cherry Studio, NextChat, LobeChat, Immersive Translate, Open WebUI, etc.
Step-by-step client guides: SillyTavern · Cherry Studio · Cline
Native Anthropic API (Claude Code)
Beyond the OpenAI-compatible route, Claude models also expose the native Anthropic Messages API. Point Claude Code (or any Anthropic SDK) at the base URL below and use your gateway key as x-api-key — thinking, tool use and prompt caching are all preserved natively.
export ANTHROPIC_BASE_URL=https://kovapi.com/anthropic export ANTHROPIC_API_KEY=YOUR_API_KEY # claude-sonnet-4-6 / claude-opus-5 / claude-fable-5 / claude-opus-5-5 / claude-sonnet-5-5 / claude-fable-5-1 / claude-fable-5-2 / claude-haiku-5-5
curl https://kovapi.com/anthropic/v1/messages -H "x-api-key: YOUR_API_KEY" -H "anthropic-version: 2023-06-01" -H "Content-Type: application/json" -d '{"model": "claude-sonnet-4-6", "max_tokens": 1024, "messages": [{"role": "user", "content": "Hello"}]}'
Models: claude-opus-5-5, claude-sonnet-5-5, claude-opus-5, claude-sonnet-5, claude-fable-5, claude-sonnet-4-6. Billed exactly like /v1, per token.
Prompt-cache billing: cache hits (cache read) are billed at 1/10 (0.1×) of the input rate, cache writes at 1.25× (per-model rates on the pricing page). A hit needs a stable, long-enough prefix (Claude Opus ≥ 4096 tokens, Sonnet ≥ 2048) repeated within a short window — Claude Code with a large CLAUDE.md / system prompt over a real codebase hits every turn, cutting input cost to ~1/10. Short Playground chats are too small to cache.
Video Generation (async)
Text-to-video / image-to-video are async jobs: the call returns HTTP 202 + a job id immediately ({"id":"img_...","object":"video.generation.job","status":"queued"}); poll GET /v1/videos/jobs/{id} until status=succeeded, result in data[0].url (a re-hosted mp4). 1-12 min per clip. Two billing modes: Veo 3.1 is billed per clip; Seedance 2.x and MiniMax H3 are billed per second (rate x duration). Both hold exactly what they settle and refund in full on failure. Set the aspect ratio via size (16:9 landscape is the default); for image-to-video pass a first-frame reference in image.
curl https://kovapi.com/v1/videos/generations -H 'Authorization: Bearer YOUR_API_KEY' -H 'Content-Type: application/json' -d '{"model": "veo-3.1", "prompt": "a cat surfing at sunset", "tier": "fast", "resolution": "1080p", "size": "16:9"}'curl https://kovapi.com/v1/videos/jobs/img_3f9a...c2 -H 'Authorization: Bearer YOUR_API_KEY'
Video models: veo-3.1 gemini-omni-1.2-flash gemini-omni-flash kling-4.0 kling-4.0-flash seedance-2.5 seedance-2.5-flash seedance-2.0 seedance-2.0-fast seedance-2.0-mini seedance-2.0-clip seedance-2.5-30s wan3.0-video wan3.0-video-prime minimax-h3 minimax-h3-lite magi-2 grok-imagine-video-1.5 muse-video
Webhooks: get notified when a job finishes
Video and image generation are asynchronous: you submit, get a job ID, and the result arrives a little later. Instead of polling, let us push the result to your server when the job ends, and warn you when your balance runs low.
Rather not poll? Add callback_url when you submit and we push the result to your server when the job ends, or set a default endpoint in the console. Webhook docs →
Agent Skills: make a video in one sentence from your coding agent
Install the KovAPI skill in Claude Code, Codex, Cursor or another skill-aware agent, then just ask: "turn this image into an 8-second video with seedance-2.5 and save it to ./out". The agent picks the model, uploads your files, waits for the render and saves the result. Available now: the Seedance 2.5 / 2.0 video skill.
npx skills add https://kovapi.com
export KOVAPI_API_KEY=YOUR_API_KEY
github.com/gaoorange/kovapi-skills · Demo clip (8 s, one request)
Integration Notes to Copy for AI
Send the whole block below to Codex / Claude Code / Cursor and it will know how to integrate. You can also use “Copy Page” in the top right to copy the entire doc.
Integrate KovAPI through its OpenAI-compatible API.
Base URL: https://kovapi.com/v1
API Key: read it from the environment variable KOVAPI_API_KEY.
Claude models can also use the native Anthropic protocol (for Claude Code / the Anthropic SDK): ANTHROPIC_BASE_URL=https://kovapi.com/anthropic, headers x-api-key=API Key and anthropic-version: 2023-06-01, POST /anthropic/v1/messages (max_tokens is required), models claude-sonnet-4-6 / claude-opus-5 / claude-fable-5 / claude-opus-5-5 / claude-sonnet-5-5 / claude-fable-5-1 / claude-fable-5-2 / claude-haiku-5-5.
Chat models (/chat/completions): gpt-5.6-sol / gpt-5.6-terra / gpt-5.6-luna / gpt-6-astra / gpt-6.2-astra / gpt-6.2-sol / gpt-6.1-sol / gpt-6-sol / gpt-6-luna / claude-sonnet-4-6 / claude-opus-5 / claude-fable-5 / claude-opus-5-5 / claude-sonnet-5-5 / gemini-4-argon / gemini-4-neon / gemini-4-hydrogen / gemini-3.8-flash / deepseek-v4.1-flash / glm-5.3 / qwen3.8-max / grok-4.7 / claude-fable-5-1 / claude-fable-5-2 / claude-haiku-5-5
Image models (text-to-image /images/generations; image-to-image /images/edits or add an image parameter): gpt-image-2 / gpt-image-2.5-flare / gpt-image-2.5-sunburst / gpt-image-2.5-flare-ext / gpt-image-2.5-sunburst-ext / gpt-image-2.6-flare / gpt-image-2.6-sunburst / gpt-image-2.6-ext / nano-banana-2 / nano-banana-pro / nano-banana-2.1 / nano-banana-2-lite / grok-imagine-image / grok-imagine-image-2.0 / grok-imagine-image-quality / seedream-5.0-pro / seedream-5.5 / kling-image-4.0 / kling-image-4.0-long / midjourney / muse-image / nai-diffusion-5-full / nai-diffusion-5-curated / nai-diffusion-5-full-inpainting / nai-diffusion-4-5-full
Video models (/videos/generations, async jobs; add reference images for image-to-video; how each model uses them is in its own doc): veo-3.1 / gemini-omni-1.2-flash / gemini-omni-flash / kling-4.0 / kling-4.0-flash / seedance-2.5 / seedance-2.5-flash / seedance-2.0 / seedance-2.0-fast / seedance-2.0-mini / seedance-2.0-clip / seedance-2.5-30s / wan3.0-video / wan3.0-video-prime / minimax-h3 / minimax-h3-lite / magi-2 / grok-imagine-video-1.5 / muse-video
Auth: Authorization: Bearer YOUR_API_KEY
Requirements (chat): return choices[0].message.content; on 401 check the key, 402 means insufficient balance, 429/5xx can be retried.
Requirements (images, async): POST /images/generations or /images/edits returns HTTP 202 with a job id right away ({"id":"img_...","object":"image.generation.job","status":"queued"}); then poll GET /v1/images/jobs/{id} until status=succeeded and read data[0].url (an img.kovapi.com link kept for 7 days; download it or copy it to your own storage). Do not read data right after submitting.
Requirements (video, async): POST /videos/generations returns HTTP 202 with a job id (object=video.generation.job); then poll GET /v1/videos/jobs/{id} until status=succeeded and read data[0].url (a re-hosted mp4 link kept for 7 days). Render time varies by model (from a minute or two to over an hour); failed jobs are refunded in full.
Check balance & usage
Use any API key to read the account remaining balance and spend — no dashboard login needed. Simplest: GET /v1/usage. Also OpenAI-compatible: /v1/dashboard/billing/credit_grants (balance = total_available).
curl https://kovapi.com/v1/usage -H "Authorization: Bearer YOUR_API_KEY"
curl https://kovapi.com/v1/dashboard/billing/credit_grants -H "Authorization: Bearer YOUR_API_KEY"
Error Codes
Errors from the /v1 endpoints share the shape below (the /anthropic endpoints use Anthropic's own format). code is a stable, machine-readable identifier: branch on code, never on the message text.
{
"error": {
"message": "human readable",
"type": "invalid_request_error | authentication_error | permission_error | insufficient_quota | rate_limit_error | server_error",
"code": "stable_snake_case",
"param": "field_name_or_null"
}
}
| HTTP | Meaning |
|---|---|
| 400 | A bad parameter or an unknown model (such as model_not_found); error.param names the field. |
| 401 | No key, or the key is invalid or disabled (missing_api_key, invalid_api_key). |
| 402 | Not enough balance, or the key has reached its budget (insufficient_quota). |
| 403 | The model is not on this key's model allowlist, or the request comes from outside the key's IP allowlist (permission_denied). |
| 404 | The path does not exist; or the job id is unknown, past its 3-day record, or was submitted by another account (job_not_found). |
| 429 | Over the per-minute limit set on this key or a free model's daily quota, or the model is at capacity (rate_limit_exceeded). Wait the seconds in Retry-After when it is there, otherwise a few seconds, then retry. |
| 502 | The upstream failed or timed out and the automatic retries did not help; code says why, e.g. upstream_timeout or upstream_unavailable. Not billed; safe to retry. |
| 503 | The model is under maintenance (model_maintenance), or something failed on our side for a moment (service_unavailable). Not billed; retry later. |
max_tokens on thinking models — Gemini 3.x Flash (3-flash-preview / 3.6 / 3.7 / 3.8, every tier) spend the budget on hidden reasoning before writing the visible answer, so a small budget is consumed before the answer starts: measured, max_tokens=16 fails outright and 32 / 64 return a plausible-looking wrong value with finish_reason=length. The gateway raises the output budget for those models to at least 512 (you are billed only for tokens actually used), but send >=512 yourself; treat any finish_reason=length as possibly truncated and retry with a larger max_tokens.
Common questions on access, billing, models and safety. KovAPI FAQ →