Voicica Platform API v1
Last updated
Overview, all models and prices: Voicica API
OpenAPI spec: https://api.voicica.ai/platform/v1/openapi.json
One OpenAI-compatible API for several top chat models, plus asynchronous image generation, video generation and text to speech, billed in API credits (1 API credit = $0.006) from a separate balance. For chat, use the official OpenAI SDKs and change only base_url and api_key. This page is exact for v1; when it and the generated OpenAPI disagree, the OpenAPI wins (section 12).
1. Overview
- Compatible with OpenAI Chat Completions, streaming included. Image generation (section 4), video generation (section 5) and text to speech (section 6) are our own asynchronous endpoints.
- Base URL:
https://api.voicica.ai/platform/v1 - Endpoints:
POST /chat/completions,GET /models,POST /images/generations,GET /images/generations/{id},POST /videos/generations,GET /videos/generations/{id},POST /audio/speech,GET /audio/speech/{id},GET /audio/voices. - Auth:
Authorization: Bearer vca_...on every request (the OpenAI SDK'sapi_key). Keys arevca_followed by 43 URL-safe characters. Bodies are JSON (Content-Type: application/json). - Staging (testing only, separate keys and balance):
https://api-staging.voicica.ai/platform/v1
Getting a key
- Sign in to Voicica and open the studio's API page (Me → API for developers) to create keys, set caps, top up and see your usage.
- A key belongs to a normal Voicica account (one account per calling project) and every call is paid from that account's balance of API credits (section 7). The balance must be topped up before the first call.
- The key is shown once. Keep it in your own uncommitted
.env; never put it in code, URLs, logs or issues. A key can be revoked; to rotate, create a new key, switch, then revoke the old one. A key can have a daily and a monthly cap in API credits (section 7).
Reporting a problem
Email support@voicica.ai from your account's address. Include the time (UTC), the model, the HTTP status, the error code, its request_id (also the X-Request-Id header) and the completion or task id if you got one. Never paste your API key; include prompt text only if it is needed to reproduce the problem.
2. Quickstart
Replace vca_your_key_here with your key. The Voicica extras (credits, cost_usd, voicica) are extra fields on the normal response. Images: section 4; videos: section 5; text to speech: section 6.
import os
from openai import OpenAI # pip install openai
client = OpenAI(
base_url="https://api.voicica.ai/platform/v1",
api_key="vca_your_key_here", # better: os.environ["VOICICA_API_KEY"]
timeout=360, # the server may take up to ~330 s
max_retries=0, # retry yourself on error.retryable (see "Errors")
)
resp = client.chat.completions.create(
model="deepseek/deepseek-v4.1-flash",
messages=[
{"role": "system", "content": "You are a concise assistant."},
{"role": "user", "content": "Give me three titles for a video about night markets."},
],
extra_body={"metadata": {"project": "my-project", "node": "titles", "step": "draft"}},
)
print(resp.choices[0].message.content)
print(resp.usage) # prompt_tokens, completion_tokens, total_tokens
print(resp.model_extra["credits"]) # API credits taken from your balance, e.g. "0.0174"
print(resp.model_extra["cost_usd"]) # the same in USD at $0.006 per credit (reference)
print(resp.model_extra["voicica"]) # ignored_params, json_mode
// npm install openai (ES module, Node 18+)
import OpenAI from "openai";
const client = new OpenAI({
baseURL: "https://api.voicica.ai/platform/v1",
apiKey: "vca_your_key_here", // better: process.env.VOICICA_API_KEY
timeout: 360_000, // ms; the server may take up to ~330 s
maxRetries: 0, // retry yourself on error.retryable (see "Errors")
});
const completion = await client.chat.completions.create({
model: "openai/gpt-6.2-sol",
messages: [
{ role: "system", content: "You are a concise assistant." },
{ role: "user", content: "Give me three titles for a video about night markets." },
],
metadata: { project: "my-project", node: "titles", step: "draft" },
});
console.log(completion.choices[0].message.content);
console.log(completion.usage);
console.log(completion.credits); // Voicica extra: API credits this call cost, a string
console.log(completion.cost_usd); // Voicica extra: the same in USD (reference)
console.log(completion.voicica); // Voicica extra: ignored_params, json_mode
curl https://api.voicica.ai/platform/v1/chat/completions \
--max-time 360 \
-H "Authorization: Bearer vca_your_key_here" \
-H "Content-Type: application/json" \
-d '{
"model": "deepseek/deepseek-v4.1-flash",
"messages": [{"role": "user", "content": "Say hello in Thai."}]
}'
curl https://api.voicica.ai/platform/v1/models \
-H "Authorization: Bearer vca_your_key_here"
JSON output with a schema
Works on every model. Continues the Python client above.
import json
schema = {
"type": "object",
"properties": {
"titles": {
"type": "array",
"items": {"type": "string"},
"minItems": 3,
"maxItems": 3,
}
},
"required": ["titles"],
"additionalProperties": False,
}
resp = client.chat.completions.create(
model="anthropic/claude-sonnet-5.5",
messages=[{"role": "user", "content": "Three titles for a video about night markets."}],
response_format={
"type": "json_schema",
"json_schema": {"name": "titles", "schema": schema, "strict": True},
},
)
choice = resp.choices[0]
if choice.finish_reason == "length":
raise RuntimeError("cut off: the content is returned as is and may not be valid JSON")
data = json.loads(choice.message.content) # already validated against the schema
print(data["titles"], resp.model_extra["voicica"]["json_mode"]) # "native" or "fallback"
Streaming
The usage and the cost come in the last chunk (the one with finish_reason).
stream = client.chat.completions.create(
model="openai/gpt-6.2-sol",
messages=[{"role": "user", "content": "Write a four-line poem about rain."}],
stream=True,
)
for chunk in stream:
if chunk.choices and chunk.choices[0].delta.content:
print(chunk.choices[0].delta.content, end="", flush=True)
if chunk.choices and chunk.choices[0].finish_reason:
print()
print(chunk.usage, chunk.model_extra["credits"]) # on the last chunk
3. Chat completions and models
POST /chat/completions
Supported request fields:
model(required): an id fromGET /models. Unknown ids answer 404model_not_found.messages(required, 1 to 2,000): rolessystem,developer(treated as system),user,assistant,tool.contentis a string or a list of text parts{"type": "text", "text": "..."}(joined with newlines). At least oneusermessage is required; anassistantmessage may have null content. All system / developer messages are joined into one system prompt; consecutive messages with the same role are joined.nameis accepted and not used.- Images (models with
capabilities.vision): inusermessages, parts{"type": "image_url", "image_url": {"url": "...", "detail": "auto"}}. The URL ishttps://(up to 2,048 characters) or a base64 data URL (data:image/png|jpeg|webp|gif;base64,...); up to 20 images per request, within the 8 MB request limit. Image tokens are billed as input tokens. Other models answer 400unsupported_content. - Tools (models with
capabilities.tools):tools(up to 128{"type": "function", "function": {"name", "description", "parameters", "strict"}}),tool_choice(auto,none,requiredor{"type": "function", "function": {"name": "..."}}),parallel_tool_calls. When the model calls a tool the answer hasfinish_reason: "tool_calls",content: nullandmessage.tool_calls; send that assistant message back with one{"role": "tool", "tool_call_id": "...", "content": "..."}per call. Other models answer 400 (unsupported_parameterfortools,unsupported_contentfor tool messages). - Reasoning:
reasoning_effort(none,minimal,low,medium,high; or{"reasoning": {"effort": "..."}}) on models withcapabilities.reasoning_effort: GPT and DeepSeek take it as is (noneturns thinking off on DeepSeek and keeps it to a minimum on GPT, about 10 reasoning tokens in our test; DeepSeek treatsminimalaslow); Claude thinks adaptively at that effort (minimalaslow;temperatureandtop_pare not sent while it thinks) and is off withnoneor when you omit it, except Claude Opus, which always thinks: omitted means its own adaptive default,nonethe lowest effort. Omitted on GPT and DeepSeek: the model's default. Elsewhere it is ignored and listed invoicica.ignored_params. temperature(0 to 2),top_p(0 to 1),max_tokensormax_completion_tokens(1 to 1,000,000; the latter wins if both are sent),stop(a string or up to 4 strings). Each model honours only some of them: the others are dropped without an error and listed invoicica.ignored_params;GET /modelslists them per model inunsupported_params. Claude models getmax_tokens4096 when you send none; when you send bothtemperatureandtop_pto Claude,top_pis dropped.response_format:{"type": "text"},{"type": "json_object"}or{"type": "json_schema", "json_schema": {"name", "schema", "description", "strict"}}(name: letters, digits,_and-, up to 64, defaultresponse;schemaup to 64,000 bytes). Models withcapabilities.json_nativeuse the provider's structured output; the others (Claude) get an instruction in the system prompt. On every model we parse the answer, strip Markdown code fences, require an object forjson_object, validate against the schema forjson_schema, and retry once if it fails; a second failure answers 502invalid_json_output. So withfinish_reason: "stop"thecontentalways parses. Withfinish_reason: "length"(cut off) it is returned as is, unvalidated.metadata: optional labelsproject,node,step(strings), recorded with the call's usage (first 64 characters each) for billing and debugging. Other keys are ignored. In the Python SDK pass it throughextra_body.- Streaming (every model):
stream: trueanswerstext/event-streamwith OpenAIchat.completion.chunkevents: the first delta hasrole: "assistant", thencontentpieces ortool_callspieces (the first one withidandfunction.name, thenfunction.argumentspieces, byindex). The last chunk hasfinish_reasonand alsousage,credits,cost_usdandvoicica; thendata: [DONE].stream_options: {"include_usage": true}adds OpenAI's usage-only chunk (choices: []) before[DONE]. Comment lines (: keep-alive) come every 15 s while the model is quiet. Errors before the model starts answering are normal HTTP errors; an error after that comes as onedata: {"error": {...}}event (same shape as below) with no[DONE], and that call is not charged. JSON output is not checked or retried while streaming:response_formatwithstream: trueworks only on models withcapabilities.json_native(others: 400unsupported_parameter,param: "stream"). Gemini sends the answer in one or two large pieces rather than word by word. useris accepted and not used. Any other field you send (not null) is ignored and listed invoicica.ignored_params.
Not supported:
- The legacy
functions/function_call→ 400unsupported_parameter(usetools). - Image parts other than
image_url(input_image,image), images outsideusermessages and any other non-text part → 400unsupported_content; a bad image URL → 400invalid_image. nother than 1 → 400unsupported_parameter.
{
"model": "anthropic/claude-haiku-5.5",
"messages": [
{"role": "system", "content": "You are a script editor."},
{"role": "user", "content": [{"type": "text", "text": "Shorten this line: ..."}]},
{"role": "assistant", "content": "..."},
{"role": "user", "content": "Now make it funnier."}
],
"temperature": 0.8,
"max_tokens": 800,
"stop": ["\n\n\n"],
"response_format": {"type": "json_object"},
"metadata": {"project": "my-project", "node": "edit", "step": "punch-up"}
}
The response is a standard chat.completion plus three Voicica fields (values below are illustrative):
{
"id": "chatcmpl-6b1f0c2e9d8a4f37b5e2c1a0d9f8e7b6",
"object": "chat.completion",
"created": 1796000000,
"model": "deepseek/deepseek-v4.1-flash",
"choices": [
{
"index": 0,
"message": {"role": "assistant", "content": "สวัสดี (sawasdee)", "refusal": null},
"finish_reason": "stop",
"logprobs": null
}
],
"usage": {"prompt_tokens": 12, "completion_tokens": 180, "total_tokens": 192},
"credits": "0.0174",
"cost_usd": "0.000104",
"voicica": {"ignored_params": [], "json_mode": null}
}
modelis our model id.finish_reasonisstop,length,content_filterortool_calls.usage.prompt_tokensincludes cached tokens;usage.completion_tokensincludes hidden reasoning tokens;usage.prompt_tokens_details.cached_tokensandusage.completion_tokens_details.reasoning_tokensappear only when the provider reports them; on Claude,prompt_tokens_details.cache_write_tokenscounts the prompt tokens written to the cache. After a JSON retry,usageandcreditscover both attempts.credits: what this call cost in API credits, taken from your balance, as a string with 4 decimals (e.g."0.0174"), not a JSON number. Rounded up to the next 0.0001 credit, once per call (the JSON retry included).cost_usd: the same amount in USD at $0.006 per credit, 6 decimals, for reference only (you are chargedcredits).voicica.ignored_params: the request fields this model did not honour.voicica.json_mode:native,fallback, ornullwithout a JSON response format.
GET /models
Lists every model with its capabilities, prices and parameters: chat models have type: "chat", image models type: "image" (section 4), video models type: "video" (section 5), and the one speech model voicica/tts has type: "speech" (section 6; the voice sets its price). A model id is maker/model: the company that made the model, then the model, lower case, versions with dots (e.g. google/gemini-3.8-flash). The ids used before 2026-12-04 still work (section 13). Read capabilities and prices from this endpoint; do not hand-copy them. A chat model's pricing is in API credits per 1 million tokens, as decimal strings (exact): input, cached_input, output and cache_write (Claude prompt-cache writes; null = the input price). Claude also has fallback: the price when our backup route answers a text-only request. context_length and max_output_tokens are null when not known. Shape (one entry of each type shown):
{
"object": "list",
"data": [
{
"id": "google/gemini-3.8-flash",
"object": "model",
"type": "chat",
"created": 1795910400,
"owned_by": "google",
"name": "Gemini 3.8 Flash",
"vendor": "google",
"context_length": null,
"max_output_tokens": null,
"capabilities": {
"json_object": true,
"json_schema": true,
"json_native": true,
"tools": false,
"vision": false,
"streaming": true,
"reasoning": true,
"reasoning_effort": false
},
"pricing": {
"currency": "credits",
"per": "1M tokens",
"input": "45",
"cached_input": "45",
"output": "225",
"cache_write": null,
"note": null,
"fallback": null
},
"unsupported_params": ["temperature", "top_p", "max_tokens", "stop"]
},
{
"id": "minimax/minimax-h3-image",
"object": "model",
"type": "image",
"created": 1795910400,
"owned_by": "MiniMax",
"name": "MiniMax H3 Image",
"vendor": "MiniMax",
"capabilities": {
"max_n": 4,
"reference_images": true,
"max_reference_images": 10,
"max_prompt_chars": 5000
},
"params": [
{
"name": "aspect_ratio",
"values": ["9:16", "1:1", "16:9", "3:4", "4:3", "2:3", "3:2", "4:5", "21:9"],
"default": "9:16"
},
{"name": "resolution", "values": ["1K", "2K", "4K"], "default": "2K"}
],
"pricing": {
"currency": "credits",
"per": "image",
"by": "resolution",
"prices": {"1K": "1.8", "2K": "1.8", "4K": "5.5"},
"per_reference_image": "0.5",
"status": "1 API credit = USD 0.006 (ADR 0053)"
}
},
{
"id": "voicica/tts",
"object": "model",
"type": "speech",
"created": 1795910400,
"owned_by": "voicica",
"name": "Voicica TTS",
"vendor": "voicica",
"capabilities": {
"max_characters": 5000,
"cjk_weight": 2,
"response_formats": ["mp3", "wav"],
"speed": "voice"
},
"pricing": {
"currency": "credits",
"per": "1K billable characters",
"price": null,
"min": "4.1",
"max": "16",
"status": "1 API credit = USD 0.006 (ADR 0053, 0054)"
}
}
]
}
The chat model ids of v1 (GET /models is authoritative and may add more):
deepseek/deepseek-v4.1-flashanthropic/claude-opus-5.5anthropic/claude-sonnet-5.5anthropic/claude-haiku-5.5openai/gpt-6.2-solgoogle/gemini-3.8-flash
4. Image generation (async)
Image generation is asynchronous only: POST answers at once with a task (HTTP 202), and you poll GET (or receive a callback) until it has finished. Some models take about 4 minutes per image, longer than an HTTP request should wait.
import time
import httpx # pip install httpx
BASE = "https://api.voicica.ai/platform/v1"
HEADERS = {"Authorization": "Bearer vca_your_key_here"} # better: os.environ["VOICICA_API_KEY"]
task = httpx.post(f"{BASE}/images/generations", headers=HEADERS, timeout=60, json={
"model": "google/nano-banana-2.1",
"prompt": "A night market in Bangkok, neon signs, light rain, 35 mm photo",
"n": 2,
"aspect_ratio": "16:9",
"resolution": "2K",
# "image_urls": ["https://example.com/ref.png"], # google/nano-banana-2.1 and minimax/minimax-h3-image only
# "callback_url": "https://example.com/hooks/voicica",
"metadata": {"project": "my-project", "node": "thumbnails"},
})
task.raise_for_status() # 202 Accepted
task = task.json() # {"id": "imggen_...", "status": "pending", "credits": "12.0000", ...}
while task["status"] in ("pending", "running"):
time.sleep(5) # 5 s or more; some models take about 4 minutes
task = httpx.get(f"{BASE}/images/generations/{task['id']}", headers=HEADERS, timeout=60).json()
for image in task["data"]:
if image["status"] == "succeeded":
print(image["url"]) # download it: deleted after expires_at (30 days)
else:
print(image["index"], image["error"]["code"])
print(task["credits"]) # final charge: the succeeded images only
curl https://api.voicica.ai/platform/v1/images/generations \
-H "Authorization: Bearer vca_your_key_here" \
-H "Content-Type: application/json" \
-d '{"model": "alibaba/z-image", "prompt": "A red bicycle on a beach at sunset", "aspect_ratio": "1:1"}'
# then, every 5 s or more, with the id from the answer:
curl https://api.voicica.ai/platform/v1/images/generations/imggen_0123456789abcdef0123456789abcdef \
-H "Authorization: Bearer vca_your_key_here"
POST /images/generations
model(required): an image model id fromGET /models:google/nano-banana-2.1,openai/gpt-image-2,bytedance/seedream-4.5,black-forest-labs/flux-2-pro,xai/grok-imagine,minimax/minimax-h3-image,alibaba/z-image.prompt(required): up to the model'scapabilities.max_prompt_chars.n: 1 to 4 images (default 1), each one billed.aspect_ratio,resolution,quality: only the ones the model lists in itsparams(with theirvalues); omitted =default. A parameter the model does not have answers 400unsupported_parameter; a value it does not have, 400invalid_request.image_urls: reference images for editing, up to 10, only on models withcapabilities.reference_images(todaygoogle/nano-banana-2.1andminimax/minimax-h3-image). Each must be a publichttpsURL on port 443 (no user name in it) whose host resolves to public internet addresses only: private, local and loopback addresses and names likelocalhostor*.localare refused. We follow at most 3 redirects, each one checked the same way. The image must be PNG, JPEG or WebP (we check the bytes) and at most 10 MB. We download it during the POST and keep a copy with the task, so the URL only has to work at that moment.callback_url: optional publichttpsURL (port 443, same address rules) that we POST the finished task to; see Callbacks below. Redirects are not followed.metadata: optional labelsproject,node,step, as for chat.- Any other field answers 400 (unknown fields are refused here).
Request problems, the key's caps and an empty balance are answered at once with the errors of section 8, and nothing is charged. When the provider accepts none of the images, the POST answers 429 rate_limited, 502 upstream_error, 503 upstream_unavailable or 400 upstream_rejected, also not charged.
GET /images/generations/{id}
The task, with the same shape as the POST answer. Any key of the same account can read it; other accounts get 404 not_found. Poll every 5 seconds or more. Seedream and Z-Image take seconds, Nano Banana about half a minute, GPT Image 2 and MiniMax H3 about 4 minutes.
{
"id": "imggen_0123456789abcdef0123456789abcdef",
"object": "image.generation",
"created": 1796000000,
"model": "google/nano-banana-2.1",
"status": "succeeded",
"n": 2,
"params": {"aspect_ratio": "16:9", "resolution": "2K"},
"reference_images": 0,
"data": [
{
"index": 0,
"status": "succeeded",
"url": "https://media.voicica.ai/api/img/.../0.png",
"error": null
},
{
"index": 1,
"status": "failed",
"url": null,
"error": {"code": "provider_failed", "message": "The model provider failed to make this image"}
}
],
"credits": "6.0000",
"cost_usd": "0.036000",
"error": null,
"finished_at": 1796000034,
"expires_at": 1798592034,
"expired": false,
"callback_status": null
}
status:pending(waiting at the provider) →running→succeeded(at least one image made) orfailed(none;error.codesays why). An image not ready 20 minutes after the request fails withtimeout.data[i]: one entry per image, each with its ownstatus,url(when succeeded) anderror(when failed). A task can succeed with some images failed.credits(4 decimals) andcost_usd(the same in USD, for reference): while the task runs, what is held for allnimages; once it has finished, what the succeeded images cost.params: the options used, defaults filled in.reference_images: how many you sent.- Images are kept 30 days.
expires_at(Unix seconds) is when they are deleted; after it,urlisnullandexpiredistrue. Download the images you want to keep.
The error codes of one image:
| data[i].error.code | when |
|---|---|
provider_failed | The model provider failed to make this image. |
provider_content_policy | The provider refused the prompt (content policy). |
provider_copyright | The provider refused the prompt (copyright). |
provider_unavailable | The provider did not accept the task. |
provider_rejected | The provider rejected the request. |
rate_limited | The provider was busy; send a new request later. |
empty_result | The provider returned no image. |
timeout | The image was not ready within about 20 minutes of the request. |
Callbacks
With callback_url, when the task has finished we POST its JSON (the same as GET answers) once, with these headers:
Voicica-Event:image.generation.succeededorimage.generation.failed.Voicica-Delivery: the task id and the attempt number.Voicica-Signature:t=<unix seconds>,v1=<hex>, wherev1is the HMAC-SHA256 of<t>.followed by the raw body. The HMAC key is the hex SHA-256 ofvoicica-callback:followed by the API key that created the task (compute it yourself from your key).
Verify the signature on the raw body bytes, before parsing the JSON. Answer 2xx within 10 s; otherwise we try again after 30 s, 2 minutes and 10 minutes, then give up (GET shows callback_status: delivered or failed). A task can be delivered more than once: de-duplicate by id. The callback is a notification; GET is the source of truth.
import hashlib
import hmac
import time
def verify_voicica(raw_body: bytes, signature: str, api_key: str, max_age: int = 300) -> bool:
"""signature = the Voicica-Signature header; api_key = the key that created the task."""
secret = hashlib.sha256(b"voicica-callback:" + api_key.encode()).hexdigest()
parts = dict(p.split("=", 1) for p in signature.split(",") if "=" in p)
t, v1 = parts.get("t", ""), parts.get("v1", "")
expected = hmac.new(secret.encode(), f"{t}.".encode() + raw_body, hashlib.sha256).hexdigest()
if not t.isdigit() or not hmac.compare_digest(v1, expected):
return False
return abs(time.time() - int(t)) <= max_age # optional: refuse old deliveries
import { createHash, createHmac, timingSafeEqual } from "node:crypto";
// rawBody: the request body as a Buffer, before any JSON parsing.
// signature: the Voicica-Signature header; apiKey: the key that created the task.
export function verifyVoicica(rawBody, signature, apiKey, maxAgeSeconds = 300) {
const secret = createHash("sha256").update("voicica-callback:" + apiKey).digest("hex");
const parts = Object.fromEntries(
signature.split(",").map((p) => [p.slice(0, p.indexOf("=")), p.slice(p.indexOf("=") + 1)]),
);
if (!/^\d+$/.test(parts.t ?? "")) return false;
const expected = createHmac("sha256", secret).update(parts.t + ".").update(rawBody).digest("hex");
const a = Buffer.from(expected);
const b = Buffer.from(parts.v1 ?? "");
if (a.length !== b.length || !timingSafeEqual(a, b)) return false;
return Math.abs(Date.now() / 1000 - Number(parts.t)) <= maxAgeSeconds;
}
5. Video generation (async)
Video generation is asynchronous only, like images: POST answers at once with a task videogen_... (HTTP 202), and you poll GET (or receive a callback) until the video is ready. A video takes from about a minute to several minutes. Text to video, image to video (first frame, first and last frame) and reference images are available today.
import time
import httpx # pip install httpx
BASE = "https://api.voicica.ai/platform/v1"
HEADERS = {"Authorization": "Bearer vca_your_key_here"} # better: os.environ["VOICICA_API_KEY"]
# 1. Start the task: 480p, 4 seconds, no sound = 4 x 3.8 = 15.2 credits.
task = httpx.post(f"{BASE}/videos/generations", headers=HEADERS, timeout=60, json={
"model": "bytedance/seedance-2.0-mini",
"prompt": "A night market in Bangkok, slow dolly shot, neon signs, light rain",
"duration": 4, # integer seconds, one of the model's params values
"aspect_ratio": "16:9",
"resolution": "480p",
"audio": False, # models with capabilities.audio == "toggle"
# "first_frame": "https://example.com/start.png",
# "last_frame": "https://example.com/end.png", # needs first_frame
# "reference_images": ["https://example.com/ref.png"],
# "callback_url": "https://example.com/hooks/voicica",
"metadata": {"project": "my-project", "node": "clip"},
})
task.raise_for_status() # 202 Accepted
task = task.json() # {"id": "videogen_...", "status": "pending", "credits": "15.2000", ...}
# 2. Poll every 10 s or more (a video takes minutes).
while task["status"] in ("pending", "running"):
time.sleep(10)
task = httpx.get(f"{BASE}/videos/generations/{task['id']}", headers=HEADERS, timeout=60).json()
# 3. Download it: deleted after expires_at (30 days).
if task["status"] == "succeeded":
with httpx.stream("GET", task["url"], timeout=300) as r, open("clip.mp4", "wb") as f:
for chunk in r.iter_bytes():
f.write(chunk)
print(task["duration_seconds"], task["resolution"], task["has_audio"], task["credits"])
else:
print(task["error"]["code"], task["credits"]) # "0.0000": a failed video is not charged
curl https://api.voicica.ai/platform/v1/videos/generations \
-H "Authorization: Bearer vca_your_key_here" \
-H "Content-Type: application/json" \
-d '{"model": "bytedance/seedance-2.0-mini", "prompt": "A red bicycle on a beach at sunset", "duration": 4, "resolution": "480p", "aspect_ratio": "16:9", "audio": false}'
# then, every 10 s or more, with the id from the answer:
curl https://api.voicica.ai/platform/v1/videos/generations/videogen_0123456789abcdef0123456789abcdef \
-H "Authorization: Bearer vca_your_key_here"
# when it has succeeded, download the url (deleted after expires_at):
curl -o clip.mp4 "https://media.voicica.ai/api/vid/.../video.mp4"
Image to video, starting from your own picture:
curl https://api.voicica.ai/platform/v1/videos/generations \
-H "Authorization: Bearer vca_your_key_here" \
-H "Content-Type: application/json" \
-d '{"model": "xai/grok-imagine-video", "prompt": "She turns to the camera and smiles", "first_frame": "https://example.com/portrait.png", "duration": 6, "resolution": "480p", "aspect_ratio": "9:16"}'
Models
The 18 video models of the Voicica studio. Each one also accepts its studio key as model (no end date); answers always show the public id. GET /models is authoritative for their options and prices.
| model | Also accepted |
|---|---|
kuaishou/kling-4.0-flash | kling-4.0-flash |
kuaishou/kling-3.0 | kling-3.0 |
kuaishou/kling-3.0-turbo | kling-3.0-turbo |
kuaishou/kling-2.6 | kling-2.6 |
google/veo-3.1 | veo-3.1-quality |
google/veo-3.1-fast | veo-3.1-fast |
google/veo-3.1-lite | veo-3.1-lite |
google/gemini-omni-flash | gemini-omni-flash |
bytedance/seedance-2.5 | seedance-2.5 |
bytedance/seedance-2.0 | seedance-2.0 |
bytedance/seedance-2.0-fast | seedance-2.0-fast |
bytedance/seedance-2.0-mini | seedance-2.0-mini |
alibaba/wan-2.7 | wan-2.7 |
alibaba/wan-2.6 | wan-2.6 |
alibaba/wan-2.5 | wan-2.5 |
minimax/minimax-h3 | minimax-h3 |
xai/grok-imagine-video | grok-imagine-video |
alibaba/happyhorse-1.1 | happyhorse-1.1 |
POST /videos/generations
model(required): a video model id from the table above (orGET /models,type: "video"). Unknown: 404model_not_found.prompt(required): up to the model'scapabilities.max_prompt_chars.duration(integer seconds),aspect_ratio,resolution: only the ones the model lists in itsparams(with theirvalues); omitted =default. A parameter the model does not have answers 400unsupported_parameter; a value it does not have, 400invalid_request. 4K needs no subscription on the API (you pay per video).audio(boolean): sound on or off, on models whosecapabilities.audioistoggle. Onalways(every video has sound) andnone(silent) models you may omit it or send the matching value; the opposite answers 400unsupported_parameter.first_frame: an image the video starts from (image to video), on models withcapabilities.first_frame.last_frame: an image it ends on, only together withfirst_frameand on models withcapabilities.last_frame. Withcapabilities.ratio_from_first_framethe video keeps the first frame's shape andaspect_ratiohas no effect.reference_images: a list of images to follow (characters, products, style), up tocapabilities.max_reference_images. Whencapabilities.frames_with_referencesisfalse, frames and reference images cannot be combined (400invalid_request). Some models have their own rules, e.g. Veo takes reference images only at 8 seconds.- Every input image follows the image rules of section 4: a public
httpsURL on port 443 resolving to public addresses only, at most 3 redirects, PNG, JPEG or WebP, at most 10 MB. We download it during the POST and keep a copy with the task, so the URL only has to work at that moment. callback_url: optional, the same rules and signature as for images (see Callbacks below).metadata: optional labelsproject,node,step, as for chat.- Not available yet (version 2):
reference_videos,reference_audios,shots,multi_shots(reference videos, reference audio, multi-shot) answer 400unsupported_parameter. Any other unknown field answers 400.
Request problems, the key's caps, a balance that does not cover the video and blocked content are answered at once with the errors of section 8, and nothing is charged. When the provider does not accept the video, the POST answers 429 rate_limited, 502 upstream_error, 503 upstream_unavailable or 400 upstream_rejected, also not charged.
Content check
Every request is checked before anything is charged or stored: first the input images, then the prompt (only clear red lines are refused, the same rules as the Voicica studio; the prompt is judged more strictly when an input image shows a minor). Blocked: 400 content_blocked (param is prompt, or the image's field when you sent one image). The check unavailable: 503 moderation_unavailable (retryable). Neither is charged.
Limits and deadlines
- At most 5 videos in progress per API key (
pendingorrunning). One more answers 429rate_limitedwithRetry-After: 30; send it again when one has finished. Another key of the same account counts separately. The per-key request limits of section 9 apply too. - A video not ready 20 minutes after the request fails with
timeout; Seedance 2.5, Seedance 2.0, 4K and videos longer than 15 seconds get 40 minutes. Not charged.
GET /videos/generations/{id}
The task, with the same shape as the POST answer. Any key of the same account can read it; other accounts get 404 not_found. Poll every 10 seconds or more. Each model's capabilities.typical_seconds is a rough idea of how long it takes.
{
"id": "videogen_0123456789abcdef0123456789abcdef",
"object": "video.generation",
"created": 1796000000,
"model": "bytedance/seedance-2.0-mini",
"status": "succeeded",
"params": {"duration": "4", "aspect_ratio": "16:9", "resolution": "480p", "audio": "off"},
"inputs": {"first_frame": false, "last_frame": false, "reference_images": 0},
"url": "https://media.voicica.ai/api/vid/.../video.mp4",
"duration_seconds": 4.04,
"resolution": "480p",
"width": 854,
"height": 480,
"has_audio": false,
"credits": "15.2000",
"cost_usd": "0.091200",
"error": null,
"finished_at": 1796000095,
"expires_at": 1798592095,
"expired": false,
"callback_status": null
}
status:pending(waiting at the provider) →running→succeededorfailed(error.codesays why).url: the video (MP4) once it succeeded.duration_seconds: its length, read from the file (the askeddurationwhen it cannot be read).resolution: the resolution made, e.g.480p(nullfor Kling 2.6, which has no resolution option).width/height: its size in pixels.has_audio: whether it has sound.params: the options used, defaults filled in.inputs: which inputs you sent (first_frame,last_frame, the number ofreference_images), never their URLs.credits(4 decimals) andcost_usd(the same in USD, for reference): what is held while the task runs, what it cost once it succeeded, and0.0000once it failed (all given back).- Videos are kept 30 days.
expires_at(Unix seconds) is when the video is deleted; after it,urlisnullandexpiredistrue. Download the videos you want to keep. callback_status: with acallback_url,pending,deliveredorfailed; otherwisenull.
The error codes of a video task:
| error.code | when |
|---|---|
provider_failed | The model provider failed to make this video. |
provider_content_policy | The provider refused the request (content policy). |
provider_copyright | The provider refused the request (copyright). |
provider_unavailable | The provider did not accept the task. |
provider_rejected | The provider rejected the request. |
rate_limited | The provider was busy; send a new request later. |
empty_result | The provider returned no video. |
timeout | The video was not ready within 20 minutes of the request (40 minutes for Seedance 2.5 / 2.0, 4K and videos over 15 seconds). |
Price
- A video costs the same credits as the same options on the Voicica website, paid in API credits (1 API credit = $0.006).
- Read the price from the model's
pricinginGET /models:per: "second"means the price ×duration;per: "video"means one price per video.priceslists one price perresolutionandaudio(null= the price does not depend on it), and perdurationfor models priced by length.noteexplains special cases (Veo 3.1: 4 and 6 second videos cost the 8 second price). Examples in section 7. - The balance must cover the whole video (unlike chat, images and speech, where a balance above 0 is enough); otherwise 402
insufficient_balanceand nothing is taken. - The price is taken up front when the task is created and given back in full if the video fails, times out or is refused by the provider. Blocked requests (
content_blocked) are never charged.
Video models in GET /models
Each video model has type: "video", its capabilities (inputs, sound, prompt limit), its params (the values and the default of duration, aspect_ratio, resolution and audio; audio is listed only when it can be switched) and its pricing. One entry:
{
"id": "bytedance/seedance-2.0-mini",
"object": "model",
"type": "video",
"created": 1795910400,
"owned_by": "ByteDance",
"name": "Seedance 2.0 Mini",
"vendor": "ByteDance",
"capabilities": {
"max_prompt_chars": 20000,
"first_frame": true,
"last_frame": true,
"max_reference_images": 9,
"frames_with_references": false,
"audio": "toggle",
"ratio_from_first_frame": false,
"typical_seconds": 120
},
"params": [
{
"name": "duration",
"values": ["4", "5", "6", "7", "8", "9", "10", "11", "12", "13", "14", "15"],
"default": "5"
},
{"name": "aspect_ratio", "values": ["9:16", "16:9", "1:1", "4:3", "3:4", "21:9"], "default": "9:16"},
{"name": "resolution", "values": ["480p", "720p"], "default": "720p"},
{"name": "audio", "values": ["on", "off"], "default": "on"}
],
"pricing": {
"currency": "credits",
"per": "second",
"prices": [
{"resolution": "480p", "audio": "on", "duration": null, "price": "3.8"},
{"resolution": "480p", "audio": "off", "duration": null, "price": "3.8"},
{"resolution": "720p", "audio": "on", "duration": null, "price": "8.2"},
{"resolution": "720p", "audio": "off", "duration": null, "price": "8.2"}
],
"note": null,
"status": "1 API credit = USD 0.006 (ADR 0053)"
}
}
Callbacks
Exactly as for images (section 4): the same Voicica-Signature header and verification code, the same Voicica-Delivery header and the same retries. The body is the video task (as GET answers) and Voicica-Event is video.generation.succeeded or video.generation.failed.
6. Text to speech (async)
Text to speech is asynchronous only, like images: POST answers at once with a task (HTTP 202), and you poll GET (or receive a callback) until the audio is ready. Pick a voice first with GET /audio/voices; the voice decides how the text is read and what it costs.
import time
import httpx # pip install httpx
BASE = "https://api.voicica.ai/platform/v1"
HEADERS = {"Authorization": "Bearer vca_your_key_here"} # better: os.environ["VOICICA_API_KEY"]
# 1. Pick a voice (filters: language, gender); each one has free samples and its own price.
voices = httpx.get(f"{BASE}/audio/voices", headers=HEADERS, timeout=60,
params={"language": "en", "gender": "female"}).json()
voice = voices["data"][0]
# e.g. {"id": "voice_njmg5alw72", "languages": ["th", "zh-TW", "en", ...], "credits_per_1k": "4.1", ...}
# 2. Start the task. The voice decides the price; "language" picks one of its languages.
task = httpx.post(f"{BASE}/audio/speech", headers=HEADERS, timeout=60, json={
"model": "voicica/tts", # optional
"voice": voice["id"],
"language": "en",
"input": "Welcome to the night market. Follow me, and mind the puddles.",
"speed": "normal", # see voice["speed"]: a number (range), slow / normal / fast (preset)
"response_format": "mp3", # or "wav"
# "callback_url": "https://example.com/hooks/voicica",
"metadata": {"project": "my-project", "node": "voice-over"},
})
task.raise_for_status() # 202 Accepted
task = task.json() # {"id": "speech_...", "status": "pending", "credits": "0.2501", ...}
# 3. Poll every 2 s.
while task["status"] in ("pending", "running"):
time.sleep(2)
task = httpx.get(f"{BASE}/audio/speech/{task['id']}", headers=HEADERS, timeout=60).json()
if task["status"] == "succeeded":
audio = httpx.get(task["url"], timeout=120).content # download it: deleted after expires_at
with open("speech.mp3", "wb") as f:
f.write(audio)
print(task["duration_seconds"], task["credits"])
else:
print(task["error"]["code"], task["credits"]) # "0.0000": a failed task is not charged
curl "https://api.voicica.ai/platform/v1/audio/voices?language=zh-TW&gender=female" \
-H "Authorization: Bearer vca_your_key_here"
curl https://api.voicica.ai/platform/v1/audio/speech \
-H "Authorization: Bearer vca_your_key_here" \
-H "Content-Type: application/json" \
-d '{"model": "voicica/tts", "voice": "voice_njmg5alw72", "language": "zh-TW", "input": "今天的第一場戲,在海邊。", "response_format": "wav"}'
# then, every 2 s, with the id from the answer:
curl https://api.voicica.ai/platform/v1/audio/speech/speech_0123456789abcdef0123456789abcdef \
-H "Authorization: Bearer vca_your_key_here"
GET /audio/voices
The voices you can use: built-in voices plus our recommended community voices, one entry per voice. Optional query filters: language (e.g. en, zh-TW) and gender (female, male, neutral). Each voice has its id (voice_ and 10 letters or digits, the same in every language: what POST /audio/speech takes as voice), name, gender (or null), languages (what POST /audio/speech takes as language), samples (one per language: its locale and a free sample_url to listen to), tags, its speed rule and its price, credits_per_1k (API credits per 1,000 billable characters). Listing voices is free. Values below are illustrative:
{
"object": "list",
"data": [
{
"id": "voice_njmg5alw72",
"object": "voice",
"name": "Kore",
"gender": "female",
"languages": ["th", "zh-TW", "en", "zh-CN", "es", "ja", "ko"],
"samples": [
{"language": "th", "locale": "th", "sample_url": "https://media.voicica.ai/tts-samples/.../Kore-2f312c9741.mp3"},
{"language": "zh-TW", "locale": "zh-TW", "sample_url": "https://media.voicica.ai/tts-samples/.../Kore-864edd2927.mp3"},
{"language": "en", "locale": "en", "sample_url": "https://media.voicica.ai/tts-samples/.../Kore-a262d0299e.mp3"},
{"language": "zh-CN", "locale": "zh-CN", "sample_url": "https://media.voicica.ai/tts-samples/.../Kore-f3b54cac5f.mp3"},
{"language": "es", "locale": "es", "sample_url": "https://media.voicica.ai/tts-samples/.../Kore-4709c2fd34.mp3"},
{"language": "ja", "locale": "ja", "sample_url": "https://media.voicica.ai/tts-samples/.../Kore-a893d97e5f.mp3"},
{"language": "ko", "locale": "ko", "sample_url": "https://media.voicica.ai/tts-samples/.../Kore-d2a2bcc63e.mp3"}
],
"tags": ["expressive"],
"speed": {
"kind": "preset",
"min": null,
"max": null,
"presets": ["slow", "normal", "fast"],
"default": "normal"
},
"credits_per_1k": "4.1",
"community": false
},
{
"id": "voice_0123456789abcdef0123456789abcdef",
"object": "voice",
"name": "Calm Narrator",
"gender": "male",
"languages": ["en"],
"samples": [{"language": "en", "locale": "en", "sample_url": null}],
"tags": ["community", "middle_aged", "narration", "calm"],
"speed": {"kind": "range", "min": 0.5, "max": 2.0, "presets": [], "default": "1.0"},
"credits_per_1k": "4.5",
"community": true
}
],
"languages": ["en", "th", "zh-TW", "zh-CN", "es", "ja", "ko"],
"community": {
"languages": ["en", "es", "zh-TW", "zh-CN", "ja", "ko"],
"id_format": "voice_<32-hex community voice id>",
"note": "Listed here: our recommended community voices. Any public community voice in these languages can be used by its id (with `language`); it is checked when used."
}
}
- Any public community voice can be used by id, not only the listed ones:
voice_<32-hex community voice id>, withlanguageset to one ofen,es,zh-TW,zh-CN,ja,ko(community.languagesin the answer says which are on now). Community voices have no sample URL (sample_urlisnull). It is checked when you use it: a voice that was taken down, deleted, made private or hidden by us answers 400voice_unavailable.communityisnullwhile community voices are unavailable. - Cloned voices are not available on the API (400
unsupported_voice).
POST /audio/speech
model(optional):voicica/tts, the one speech model inGET /models. The voice decides how the text is read and what it costs; the old speech model ids are still accepted (section 13) and change nothing. Any other model answers 404model_not_found.voice(required): anidfromGET /audio/voices(voice_...) or a community voice id as above. Old voice ids keep working (section 13). Unknown: 400invalid_voice.language: the language to read in, one of the voice'slanguages. Optional when the voice has only one; required for a voice with several languages and for a community voice (one of the community languages above). Missing when required, or not one of them: 400invalid_request,param: "language".input(required): the text. At most 5,000 characters after trimming spaces at both ends (over it: 400text_too_long); there is no 4,096-character limit as on OpenAI. The text is not stored.speed: by the voice'sspeed.kind:range(a number from 0.5 to 2.0),preset(slow,normalorfast;1.0meansnormal) ornone(omit it or send1.0).normaland omitting it work on every voice. Anything else answers 400invalid_request,param: "speed".response_format:mp3(default) orwav.callback_url: optional, the same rules and signature as for images (see Callbacks below).metadata: optional labelsproject,node,step, as for chat.- Any other field answers 400 (unknown fields are refused here).
Request problems, the key's caps and an empty balance are answered at once with the errors of section 8, and nothing is charged. Otherwise the price is taken up front when the task is created, and given back in full if the task fails.
Billable characters and price
- Characters are counted on the trimmed text (Unicode code points). Billable characters count every Chinese, Japanese or Korean character (Han, kana, hangul) 2 times and every other character (Latin, Thai, spaces, punctuation, sound tags such as
[laughs]) once. Example:Hello 你好is 8 characters and 10 billable characters. - Price = billable characters × the voice's
credits_per_1k(API credits per 1,000 billable characters, inGET /audio/voices) ÷ 1,000, rounded up to the next 0.0001 credit. Voice prices are from 4.1 to 16 credits per 1,000 billable characters today;GET /modelsshows that range forvoicica/tts(pricing.min,pricing.max;pricing.priceisnull). The API is authoritative.
GET /audio/speech/{id}
The task, with the same shape as the POST answer. Any key of the same account can read it; other accounts get 404 not_found. Poll about every 2 seconds. Polling is not counted in the per-key request limit.
{
"id": "speech_0123456789abcdef0123456789abcdef",
"object": "audio.speech",
"created": 1796000000,
"model": "voicica/tts",
"voice": "voice_njmg5alw72",
"language": "en",
"status": "succeeded",
"response_format": "mp3",
"speed": "normal",
"characters": 61,
"billable_characters": 61,
"url": "https://media.voicica.ai/api/tts/.../speech.mp3",
"duration_seconds": 4.32,
"credits": "0.2501",
"cost_usd": "0.001501",
"error": null,
"finished_at": 1796000006,
"expires_at": 1798592006,
"expired": false,
"callback_status": null
}
status:pending(accepted) →running→succeededorfailed(error.codesays why). A task not finished 10 minutes after the request fails withtimeout.url: the audio (mp3orwav, as asked) when it succeeded;duration_seconds: its length.speed: the speed used.charactersandbillable_characters: what was counted.credits(4 decimals) andcost_usd(the same in USD, for reference): what is held while the task runs, what it cost once it succeeded, and0.0000once it failed (all given back).modelis alwaysvoicica/tts,voicethe voice'svoice_...id (also when you sent an old id), andlanguagethe language it was read in.- Audio is kept 30 days.
expires_at(Unix seconds) is when it is deleted; after it,urlisnullandexpiredistrue. Download the audio you want to keep. - Some voices have a backup route: if their usual route fails, the same task is sent once to a backup provider with the same voice, at the same price. You see one task either way.
The error codes of a speech task:
| error.code | when |
|---|---|
provider_failed | The voice provider failed to read the text. |
provider_content_policy | The provider refused the text (content policy). |
provider_copyright | The provider refused the text (copyright). |
provider_unavailable | The provider was unavailable; send a new request later. |
provider_rejected | The provider rejected the request. |
rate_limited | The provider was busy; send a new request later. |
voice_unavailable | The voice was withdrawn between the request and the reading (e.g. a community voice taken down). |
empty_result | The provider returned no audio. |
conversion_failed | The audio could not be converted to the asked format. |
storage_failed | The audio could not be stored; send a new request. |
timeout | The audio was not ready within about 10 minutes of the request. |
Callbacks
Exactly as for images (section 4): the same Voicica-Signature header and verification code, the same Voicica-Delivery header and the same retries. The body is the speech task (as GET answers) and Voicica-Event is audio.speech.succeeded or audio.speech.failed.
7. Billing and prices (API credits)
- Every call (chat, images, videos and speech) is paid in API credits from the account's API balance. 1 API credit = $0.006. Amounts are decimal strings with up to 4 decimals. API credits are separate from Voicica studio credits: studio credits (sign-up bonus, plan, credit packs) cannot pay for API calls, and API credits cannot be spent in the studio.
- Prices come from
GET /models, per model: chat in API credits per 1 million tokens (uncached input, cached input, output with hidden reasoning tokens, and Claude cache writes, each priced separately), images in API credits per image, videos in API credits per second of video or per video, speech in API credits per 1,000 billable characters (each voice's price,credits_per_1kinGET /audio/voices). Prices follow our own price table: when it changes we tell callers first. - Chat: tokens × the model's prices, for every upstream request of the call (the JSON retry included), rounded up to the next 0.0001 credit once and returned as
credits.cost_usdis the same amount in USD, for reference. - Images: the credits of all
nimages are taken when the task is created; the images that fail are given back when the task finishes, so a finished task'screditsis what its succeeded images cost (section 4). - Videos: the same credits as the same options on the Voicica website, taken when the task is created and given back in full if the video fails or times out (section 5). The balance must cover the whole video, not just be above 0.
- Speech: billable characters × the voice's price per 1,000, rounded up to the next 0.0001 credit, taken when the task is created and given back in full if it fails (section 6).
- The balance must be above 0 credits before a call (videos: enough for the whole video), otherwise 402
insufficient_balance(also when the account was never topped up). A call that costs more than what is left still completes and can take the balance slightly below zero; then calls are refused until a top-up brings it above zero. Parallel calls can each pass the check, so together they can go slightly further below zero. - Failed calls are not charged (including a JSON answer that stays invalid after the retry, and timeouts).
- Per-key caps (optional, in API credits, set on the studio's API page): when this key's credits charged today (UTC) or this month have reached its daily or monthly cap, calls answer 429
quota_exceeded(not retryable) withRetry-After= seconds until the reset (00:00 UTC, or the 1st of the month 00:00 UTC). The cap is checked before each call, so the last call (and parallel calls) can go slightly over it. - Top up, create and revoke keys, set caps and see the last 30 days of usage on the studio's API page (Me → API for developers): card payments through Stripe in USD ($5, $20, $50 or $200), turned into API credits at $0.006 each (rounded down to 0.0001; the page shows what each amount buys) and added a few seconds after the payment. Not refundable, including unused credits.
Prompt caching
A long, unchanged beginning (system prompt, reference material) can be cached by the provider; cached input tokens show in usage.prompt_tokens_details.cached_tokens and are billed at the cached price. Put the fixed part first and keep it byte-for-byte identical. What we measured (2026-12-01, a 3–5k token prefix sent twice):
| Model | Cache |
|---|---|
deepseek/deepseek-v4.1-flash | Automatic: the second call hit (cached input at about 1/50 of the input price). |
openai/gpt-6.2-sol | No hits through our provider (0 cached tokens, with or without prompt_cache_key): every input token is billed at the input price. |
google/gemini-3.8-flash | Not reported by our provider: every input token is billed at the input price. |
anthropic/claude-* | Automatic for a system prompt of about 1,000+ tokens (4,000+ characters); or mark any message part with Anthropic's cache_control: {"type": "ephemeral"} (at most 4 marks; the last ones are kept). Writes cost the Cache write price (1.25 x input), reads the cached price; a cached prefix lives 5 minutes after its last use. prompt_tokens_details.cache_write_tokens shows the writes. |
Example: image prices on 2026-12-03
API credits per image, as listed on 2026-12-03. Prices can change: read them from GET /models (pricing.prices by pricing.by, plus pricing.per_reference_image per reference image).
| Model | Priced by | Credits per image | Per reference image |
|---|---|---|---|
google/nano-banana-2.1 | resolution | 1K: 4 · 2K: 6 · 4K: 9 | - |
openai/gpt-image-2 | resolution | 1K: 6 · 2K: 10 · 4K: 16 | - |
bytedance/seedream-4.5 | resolution | 2K: 6.5 · 4K: 6.5 | - |
black-forest-labs/flux-2-pro | resolution | 1K: 5 · 2K: 7 | - |
xai/grok-imagine | quality | speed: 4 · quality: 5 | - |
minimax/minimax-h3-image | resolution | 1K: 1.8 · 2K: 1.8 · 4K: 5.5 | +0.5 |
alibaba/z-image | - | 0.8 | - |
Example: video prices on 2026-12-04
A few examples in API credits, as listed on 2026-12-04. Every model and option: read pricing in GET /models (section 5); prices can change.
| Model | Resolution | Credits | Example |
|---|---|---|---|
bytedance/seedance-2.0-mini | 480p | 3.8 per second | 4 s video: 15.2 credits |
xai/grok-imagine-video | 480p | 2.4 per second | 6 s video: 14.4 credits |
google/veo-3.1-fast | 720p | 60 per video | 8 s video: 60 credits |
Speech prices
Each voice has its own price: credits_per_1k in GET /audio/voices, in API credits per 1,000 billable characters (section 6), from 4.1 to 16 today. Prices can change: the API is authoritative.
8. Errors and retries
Errors use real HTTP statuses and an OpenAI-style body. retryable tells you whether to try again. param names the request field at fault, if any. provider is null unless the model provider answered with an error; then it holds the provider's HTTP status and a short machine code, and provider.message is always null (we never pass on the provider's text). request_id is this request's id, also sent as the X-Request-Id header on every response (errors and successes): quote it when you report a failed call.
HTTP/1.1 404 Not Found
Content-Type: application/json
X-Request-Id: req_6f1c0d2e9a8b4c7d8e9f0a1b2c3d4e5f
{
"error": {
"message": "Unknown model; see GET /models",
"type": "not_found_error",
"code": "model_not_found",
"param": "model",
"retryable": false,
"provider": null,
"request_id": "req_6f1c0d2e9a8b4c7d8e9f0a1b2c3d4e5f"
}
}
{
"error": {
"message": "The model provider failed",
"type": "upstream_error",
"code": "upstream_error",
"param": null,
"retryable": true,
"provider": {"status": 500, "code": "500", "message": null},
"request_id": "req_0a9b8c7d6e5f4a3b2c1d0e9f8a7b6c5d"
}
}
| HTTP | code | type | retryable | when |
|---|---|---|---|---|
| 400 | invalid_request | invalid_request_error | no | The body fails validation (wrong type, out of range, missing field), an unknown role, no user message, more than 4 stop sequences, stream_options without stream: true, or json_schema missing with type json_schema. Images: a prompt over the model's limit, an option value the model does not have, more reference images than it takes, or an unknown field. Videos: a prompt over the model's limit, an option value the model does not have (message lists the values), audio that is not true / false, inputs the model cannot combine (e.g. last_frame without first_frame, frames with reference images, too many reference images, reference images on Veo with a duration other than 8 s), or an unknown field. Speech: an empty input, a language that is not one of the voice's languages (or none for a voice with several languages or for a community voice; param is language), a speed the voice does not take, a response_format other than mp3 / wav, or an unknown field. param names the field, e.g. messages.0.role. |
| 400 | unsupported_content | invalid_request_error | no | An image part to a model without capabilities.vision, an image outside a user message, a part other than text / image_url, a tool message or tool_calls to a model without capabilities.tools, or a legacy function message. |
| 400 | unsupported_parameter | invalid_request_error | no | tools to a model without capabilities.tools; functions or function_call (use tools); n other than 1; stream: true with response_format on a model without capabilities.json_native. Images: an option the model does not have (see its params), or image_urls to a model without capabilities.reference_images. Videos: an option the model does not have (see its params), an input it does not take (see its capabilities), audio against a model's fixed sound (capabilities.audio always / none), or a version 2 field (reference_videos, reference_audios, shots, multi_shots). |
| 400 | invalid_image | invalid_request_error | no | An image URL that is neither https:// (up to 2,048 characters) nor a base64 data URL (png, jpeg, webp, gif). |
| 400 | invalid_json_schema | invalid_request_error | no | The json_schema.schema is not a valid JSON Schema or is larger than 64,000 bytes, or a tool's parameters is not a valid JSON Schema. |
| 400 | upstream_rejected | invalid_request_error | no | The model provider rejected the request (e.g. too long for the model's context; for images and videos, a refused prompt). Not charged. |
| 400 | invalid_image_url | invalid_request_error | no | Images and videos: a reference or input image URL that is not a public https URL on port 443 (or a redirect to one). param is e.g. image_urls.0, first_frame or reference_images.2. |
| 400 | image_too_large | invalid_request_error | no | Images and videos: a reference or input image is larger than 10 MB. |
| 400 | unsupported_image_type | invalid_request_error | no | Images and videos: a reference or input image is not PNG, JPEG or WebP (we read the bytes, not the extension). |
| 400 | image_download_failed | invalid_request_error | no | Images and videos: a reference or input image could not be downloaded (error status, timeout, more than 3 redirects). |
| 400 | invalid_callback_url | invalid_request_error | no | Images, videos and speech: callback_url is not a public https URL on port 443 that resolves to public addresses. |
| 400 | content_blocked | invalid_request_error | no | Videos: the content check blocked the prompt (param is prompt) or an input image (param is that image's field when you sent one image). Not charged, nothing stored. |
| 400 | invalid_voice | invalid_request_error | no | Speech: an unknown voice id, a voice not offered now, or a malformed community voice id; see GET /audio/voices. param is voice. |
| 400 | voice_unavailable | invalid_request_error | no | Speech: a community voice that was taken down, deleted, made private or hidden by us. |
| 400 | unsupported_voice | invalid_request_error | no | Speech: a cloned voice (cloned voices are not available on the API). |
| 400 | text_too_long | invalid_request_error | no | Speech: input has more than 5,000 characters after trimming. param is input. |
| 401 | missing_api_key | authentication_error | no | No Authorization header. |
| 401 | invalid_api_key | authentication_error | no | Not a Bearer key, a malformed key, an unknown key, or the key's account has not verified its email. |
| 401 | revoked_api_key | authentication_error | no | The key was revoked. |
| 402 | insufficient_balance | billing_error | no | The account's balance of API credits is zero or below, or it was never topped up (top up on the studio's API page). Videos: the balance does not cover the whole video. Studio credits do not count. |
| 404 | model_not_found | not_found_error | no | Unknown model; see GET /models. |
| 404 | not_found | not_found_error | no | Unknown endpoint, or an image generation, video generation or speech task id that does not exist or belongs to another account. |
| 405 | method_not_allowed | invalid_request_error | no | Wrong HTTP method for the endpoint. |
| 413 | request_too_large | invalid_request_error | no | The body is larger than 8 MB (by Content-Length), or the provider answered 413. |
| 429 | rate_limited | rate_limit_error | yes | Our limiter is full after queueing, the provider kept rate limiting after our retries, or (videos) this key already has 5 videos in progress. Has Retry-After. |
| 429 | quota_exceeded | rate_limit_error | no | This key reached its daily or monthly cap in API credits. Retry-After = seconds until the reset (00:00 UTC, or the 1st of the month 00:00 UTC). |
| 500 | internal_error | api_error | yes | A bug on our side. |
| 502 | upstream_error | upstream_error | yes / no | The model provider failed (5xx, network, unreadable answer): retryable. The provider refused Voicica's own credentials: not retryable; email support@voicica.ai. |
| 502 | invalid_json_output | upstream_error | no | With response_format json_object / json_schema, the model's answer was not valid JSON (or did not match the schema) twice. |
| 503 | service_unavailable | api_error | yes | The platform API (or its video or speech part) is switched off or not configured; or, for speech, the voice cannot be reached right now. |
| 503 | moderation_unavailable | api_error | yes | Videos: the content check is unavailable right now. Not charged; try again later. |
| 503 | upstream_unavailable | api_error | no | The model is temporarily unavailable on our side. Retry later, or email support@voicica.ai if it lasts. |
| 504 | upstream_timeout | timeout_error | yes | The model did not answer within the request deadline (about 330 s). |
The provider sometimes answers HTTP 200 with an error inside the body; we detect those and answer the matching error above. A 200 from us is always a real completion. Validation errors are 400 invalid_request, never 422.
Retries and timeouts
- The server already retries retryable provider failures (429, 5xx, timeouts, network) up to 2 times with exponential backoff (1 s, 2 s, plus jitter; honouring the provider's
Retry-Afterup to 10 s). - Retry only when
retryableistrue, 1 or 2 more times. Wait forRetry-Afterwhen it is present, else back off exponentially (e.g. 1 s, 2 s, 4 s with jitter). Do not retry whenretryableisfalse: fix the request, top up, or wait for the cap reset. - One request may take up to about 330 s in total (queueing, server retries and the JSON retry included); the server then answers 504
upstream_timeout. Set your client timeout to at least 330 s (we suggest 360 s). - Set the SDK's
max_retries/maxRetriesto 0 and retry yourself as below: the SDK's own retries also repeat non-retryable 429s (quota_exceeded) and 5xx (invalid_json_output,upstream_unavailable). - A call cut off on your side (network, your own timeout, closing a stream) may still finish on ours and be charged.
import random
import time
import openai
# Not retried (retryable false): e.g. 402 insufficient_balance (top up first) and
# 429 quota_exceeded (the key's credit cap; wait for Retry-After or raise the cap).
def create_with_retry(attempts=3, **kwargs):
for attempt in range(attempts):
try:
return client.chat.completions.create(**kwargs)
except openai.APIStatusError as e:
body = e.body if isinstance(e.body, dict) else {}
error = body.get("error", body) # the SDK may already unwrap "error"
if not error.get("retryable") or attempt == attempts - 1:
raise
retry_after = e.response.headers.get("retry-after")
delay = float(retry_after) if retry_after else 2**attempt + random.random()
time.sleep(min(delay, 60))
except openai.APIConnectionError: # includes APITimeoutError
if attempt == attempts - 1:
raise
time.sleep(2**attempt + random.random())
9. Rate limits
Per API key (current defaults, they may change): at most 30 requests per minute and 2 calls running at once (a stream counts until it ends). Over either, the call answers 429 rate_limited (retryable) at once, with Retry-After. Need more? Email support@voicica.ai and tell us about your use. Videos also have at most 5 in progress per key (section 5).
The API also shares one provider account with the Voicica app, so all platform calls go through a shared limiter:
- at most 8 provider requests at the same time;
- at most 14 provider requests per 10 seconds;
- over the limit, a request waits in a queue up to 15 s, then answers 429
rate_limited(retryable) withRetry-Afterin seconds.
The limits are shared by all API keys and count every provider request, including our server-side retries and the JSON retry. Bursts of parallel calls queue first, so expect added latency before a 429. Speech goes to the voice providers directly and passes this limiter only on its backup route. Request bodies are limited to 8 MB.
10. Privacy
- Prompts and replies are not stored and not written to our logs (JSON schemas neither).
- Per call we keep metadata only: key, model, status, error code, token counts, cost, latency, number of provider attempts, and your
metadatalabels. - To produce the answer your messages are sent to our AI providers and the model's maker (DeepSeek, Anthropic, OpenAI, Google). Our privacy policy lists every provider.
- Images: the prompt goes to our AI provider and the model's maker and is not stored. Reference images and results are kept with the task for 30 days, then deleted (also when the account is deleted). They never appear in the Voicica studio or its public galleries.
- Videos: the prompt and the input images go to our AI provider and the model's maker to make the video; the prompt and the input URLs are not stored or logged. Our copies of the input images and the video are kept with the task for 30 days, then deleted (also when the account is deleted). They never appear in the Voicica studio or its public galleries.
- Speech: the text goes to the speech provider of the voice (and to a backup provider when the backup route is used) and is not stored or logged. The audio is kept with the task for 30 days, then deleted (also when the account is deleted), and never appears in the Voicica studio.
11. Known limitations and roadmap
Known limitations (v1)
- Chat: no
n> 1. - Images: asynchronous only (no waiting request, no streaming); reference images only on the models that list
capabilities.reference_images. - Videos: asynchronous only; no reference videos, reference audio or multi-shot yet; at most 5 videos in progress per key; Kling 2.5 Turbo is not offered.
- Speech: asynchronous only (no waiting request, no streaming audio, no SSML); no cloned voices; at most 5,000 characters per request (split longer texts yourself).
- No images or tools on Gemini 3.8 Flash (our provider fails on them), and Gemini ignores
reasoning_effort. - Claude has a backup route. If the main route fails, a text request is retried at once on the backup route, at the same price. On the backup route a conversation with earlier assistant turns is sent as a transcript in one user message, and requests with images or tools do not fail over (they are retried on the main route instead).
- Gemini has a backup route. If the main route for Gemini 3.8 Flash fails (5xx, timeout), the request is retried at once on the backup route, at the same price. The answer can come from either;
usage.completion_tokensincludes Gemini's thinking tokens on both. - Claude JSON output is a fallback (instruction + validation + one retry,
json_mode: "fallback"), not the provider's structured output. - Sampling parameters are ignored on many models: our provider does not apply them (we tested it: DeepSeek and Gemini wrote 450–630 tokens with
max_tokens: 40, and gave different answers attemperature: 0). DeepSeek and Gemini ignoremax_tokensandtemperature; GPT ignorestemperature(as do OpenAI's own reasoning models). Claude takes both (nottemperaturewhile it thinks). To cap spending, set a daily or monthly cap in API credits on the key. Checkunsupported_paramsinGET /modelsandvoicica.ignored_paramsper call. - Reasoning models (
capabilities.reasoning) think before answering; the hidden tokens are billed as output. Usereasoning_effortwherecapabilities.reasoning_effortis true. - GPT calls can take several minutes (stream them to see progress). A deploy can cut a running call: retry 5xx and connection errors.
- Context length and maximum output are mostly not published yet (
null).
Roadmap (v2, planned, no dates)
- A second batch of models (they appear in
GET /models). - Videos, version 2: reference videos (
reference_videos), reference audio (reference_audios) and multi-shot (shots,multi_shots).
12. API reference (OpenAPI)
- OpenAPI document (generated from the code, the exact field reference): https://api.voicica.ai/platform/v1/openapi.json
- Interactive reference (Swagger UI): https://api.voicica.ai/platform/v1/docs
Both are public (no key needed to read them); calling the endpoints needs a key.
13. Old ids still work
Model and voice ids changed on 2026-12-04. The old ids still work in requests, with no end date, and mean the same model or voice. GET /models, GET /audio/voices and every response show only the new ids (a response's model is the new id even when you sent an old one). Switch to the new ids when convenient. Video models (section 5) started with the new ids; their Voicica studio keys are accepted the same way and are listed below too.
| Old id | New id |
|---|---|
deepseek-v4.1-flash | deepseek/deepseek-v4.1-flash |
claude-opus-5-5 | anthropic/claude-opus-5.5 |
claude-sonnet-5-5 | anthropic/claude-sonnet-5.5 |
claude-haiku-5-5 | anthropic/claude-haiku-5.5 |
gpt-6.2-sol | openai/gpt-6.2-sol |
gemini-3.8-flash | google/gemini-3.8-flash |
nano-banana-2-1 | google/nano-banana-2.1 |
gpt-image-2 | openai/gpt-image-2 |
seedream-4.5 | bytedance/seedream-4.5 |
flux-2-pro | black-forest-labs/flux-2-pro |
grok-imagine | xai/grok-imagine |
minimax-h3-image | minimax/minimax-h3-image |
z-image | alibaba/z-image |
kling-4.0-flash | kuaishou/kling-4.0-flash |
kling-3.0 | kuaishou/kling-3.0 |
kling-3.0-turbo | kuaishou/kling-3.0-turbo |
kling-2.6 | kuaishou/kling-2.6 |
veo-3.1-quality | google/veo-3.1 |
veo-3.1-fast | google/veo-3.1-fast |
veo-3.1-lite | google/veo-3.1-lite |
gemini-omni-flash | google/gemini-omni-flash |
seedance-2.5 | bytedance/seedance-2.5 |
seedance-2.0 | bytedance/seedance-2.0 |
seedance-2.0-fast | bytedance/seedance-2.0-fast |
seedance-2.0-mini | bytedance/seedance-2.0-mini |
wan-2.7 | alibaba/wan-2.7 |
wan-2.6 | alibaba/wan-2.6 |
wan-2.5 | alibaba/wan-2.5 |
minimax-h3 | minimax/minimax-h3 |
grok-imagine-video | xai/grok-imagine-video |
happyhorse-1.1 | alibaba/happyhorse-1.1 |
azure-speech | voicica/tts |
gemini-3.8-flash-tts | voicica/tts |
elevenlabs-v3 | voicica/tts |
fish-s2.1-pro | voicica/tts |
- Old voice ids (
<provider>:<language>:<voice>, the old community voice ids included) keep working forever and read in the language of the id. With an old id,languageis optional; if you send it, it must be the id's language. - A new voice id has no language in it (one id per voice):
languagepicks it. It is optional when the voice has only one language and required for a voice with several and for a community voice. - A missing or wrong
languageanswers 400invalid_requestwithparam: "language".