登入開始創作

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's api_key). Keys are vca_ 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.

Python
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
JavaScript
// 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
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.

Python (JSON schema)
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).

Python (stream)
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

All chat models and prices →

POST /chat/completions

Supported request fields:

  • model (required): an id from GET /models. Unknown ids answer 404 model_not_found.
  • messages (required, 1 to 2,000): roles system, developer (treated as system), user, assistant, tool. content is a string or a list of text parts {"type": "text", "text": "..."} (joined with newlines). At least one user message is required; an assistant message may have null content. All system / developer messages are joined into one system prompt; consecutive messages with the same role are joined. name is accepted and not used.
  • Images (models with capabilities.vision): in user messages, parts {"type": "image_url", "image_url": {"url": "...", "detail": "auto"}}. The URL is https:// (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 400 unsupported_content.
  • Tools (models with capabilities.tools): tools (up to 128 {"type": "function", "function": {"name", "description", "parameters", "strict"}}), tool_choice (auto, none, required or {"type": "function", "function": {"name": "..."}}), parallel_tool_calls. When the model calls a tool the answer has finish_reason: "tool_calls", content: null and message.tool_calls; send that assistant message back with one {"role": "tool", "tool_call_id": "...", "content": "..."} per call. Other models answer 400 (unsupported_parameter for tools, unsupported_content for tool messages).
  • Reasoning: reasoning_effort (none, minimal, low, medium, high; or {"reasoning": {"effort": "..."}}) on models with capabilities.reasoning_effort: GPT and DeepSeek take it as is (none turns thinking off on DeepSeek and keeps it to a minimum on GPT, about 10 reasoning tokens in our test; DeepSeek treats minimal as low); Claude thinks adaptively at that effort (minimal as low; temperature and top_p are not sent while it thinks) and is off with none or when you omit it, except Claude Opus, which always thinks: omitted means its own adaptive default, none the lowest effort. Omitted on GPT and DeepSeek: the model's default. Elsewhere it is ignored and listed in voicica.ignored_params.
  • temperature (0 to 2), top_p (0 to 1), max_tokens or max_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 in voicica.ignored_params; GET /models lists them per model in unsupported_params. Claude models get max_tokens 4096 when you send none; when you send both temperature and top_p to Claude, top_p is 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, default response; schema up to 64,000 bytes). Models with capabilities.json_native use 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 for json_object, validate against the schema for json_schema, and retry once if it fails; a second failure answers 502 invalid_json_output. So with finish_reason: "stop" the content always parses. With finish_reason: "length" (cut off) it is returned as is, unvalidated.
  • metadata: optional labels project, 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 through extra_body.
  • Streaming (every model): stream: true answers text/event-stream with OpenAI chat.completion.chunk events: the first delta has role: "assistant", then content pieces or tool_calls pieces (the first one with id and function.name, then function.arguments pieces, by index). The last chunk has finish_reason and also usage, credits, cost_usd and voicica; then data: [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 one data: {"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_format with stream: true works only on models with capabilities.json_native (others: 400 unsupported_parameter, param: "stream"). Gemini sends the answer in one or two large pieces rather than word by word.
  • user is accepted and not used. Any other field you send (not null) is ignored and listed in voicica.ignored_params.

Not supported:

  • The legacy functions / function_call → 400 unsupported_parameter (use tools).
  • Image parts other than image_url (input_image, image), images outside user messages and any other non-text part → 400 unsupported_content; a bad image URL → 400 invalid_image.
  • n other than 1 → 400 unsupported_parameter.
Request body (JSON)
{
  "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):

Response (JSON)
{
  "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}
}
  • model is our model id. finish_reason is stop, length, content_filter or tool_calls.
  • usage.prompt_tokens includes cached tokens; usage.completion_tokens includes hidden reasoning tokens; usage.prompt_tokens_details.cached_tokens and usage.completion_tokens_details.reasoning_tokens appear only when the provider reports them; on Claude, prompt_tokens_details.cache_write_tokens counts the prompt tokens written to the cache. After a JSON retry, usage and credits cover 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 charged credits).
  • voicica.ignored_params: the request fields this model did not honour. voicica.json_mode: native, fallback, or null without 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):

GET /models (JSON)
{
  "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-flash
  • anthropic/claude-opus-5.5
  • anthropic/claude-sonnet-5.5
  • anthropic/claude-haiku-5.5
  • openai/gpt-6.2-sol
  • google/gemini-3.8-flash

4. Image generation (async)

All image models and prices →

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.

Python (images)
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 (images)
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 from GET /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's capabilities.max_prompt_chars.
  • n: 1 to 4 images (default 1), each one billed.
  • aspect_ratio, resolution, quality: only the ones the model lists in its params (with their values); omitted = default. A parameter the model does not have answers 400 unsupported_parameter; a value it does not have, 400 invalid_request.
  • image_urls: reference images for editing, up to 10, only on models with capabilities.reference_images (today google/nano-banana-2.1 and minimax/minimax-h3-image). Each must be a public https URL on port 443 (no user name in it) whose host resolves to public internet addresses only: private, local and loopback addresses and names like localhost or *.local are 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 public https URL (port 443, same address rules) that we POST the finished task to; see Callbacks below. Redirects are not followed.
  • metadata: optional labels project, 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.

Finished task (JSON)
{
  "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) or failed (none; error.code says why). An image not ready 20 minutes after the request fails with timeout.
  • data[i]: one entry per image, each with its own status, url (when succeeded) and error (when failed). A task can succeed with some images failed.
  • credits (4 decimals) and cost_usd (the same in USD, for reference): while the task runs, what is held for all n images; 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, url is null and expired is true. Download the images you want to keep.

The error codes of one image:

data[i].error.codewhen
provider_failedThe model provider failed to make this image.
provider_content_policyThe provider refused the prompt (content policy).
provider_copyrightThe provider refused the prompt (copyright).
provider_unavailableThe provider did not accept the task.
provider_rejectedThe provider rejected the request.
rate_limitedThe provider was busy; send a new request later.
empty_resultThe provider returned no image.
timeoutThe 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.succeeded or image.generation.failed.
  • Voicica-Delivery: the task id and the attempt number.
  • Voicica-Signature: t=<unix seconds>,v1=<hex>, where v1 is the HMAC-SHA256 of <t>. followed by the raw body. The HMAC key is the hex SHA-256 of voicica-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.

Python (verify a callback)
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
Node.js (verify a callback)
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)

All video models and prices →

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.

Python (videos)
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 (videos)
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 (video from a first frame)
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.

modelAlso accepted
kuaishou/kling-4.0-flashkling-4.0-flash
kuaishou/kling-3.0kling-3.0
kuaishou/kling-3.0-turbokling-3.0-turbo
kuaishou/kling-2.6kling-2.6
google/veo-3.1veo-3.1-quality
google/veo-3.1-fastveo-3.1-fast
google/veo-3.1-liteveo-3.1-lite
google/gemini-omni-flashgemini-omni-flash
bytedance/seedance-2.5seedance-2.5
bytedance/seedance-2.0seedance-2.0
bytedance/seedance-2.0-fastseedance-2.0-fast
bytedance/seedance-2.0-miniseedance-2.0-mini
alibaba/wan-2.7wan-2.7
alibaba/wan-2.6wan-2.6
alibaba/wan-2.5wan-2.5
minimax/minimax-h3minimax-h3
xai/grok-imagine-videogrok-imagine-video
alibaba/happyhorse-1.1happyhorse-1.1

POST /videos/generations

  • model (required): a video model id from the table above (or GET /models, type: "video"). Unknown: 404 model_not_found.
  • prompt (required): up to the model's capabilities.max_prompt_chars.
  • duration (integer seconds), aspect_ratio, resolution: only the ones the model lists in its params (with their values); omitted = default. A parameter the model does not have answers 400 unsupported_parameter; a value it does not have, 400 invalid_request. 4K needs no subscription on the API (you pay per video).
  • audio (boolean): sound on or off, on models whose capabilities.audio is toggle. On always (every video has sound) and none (silent) models you may omit it or send the matching value; the opposite answers 400 unsupported_parameter.
  • first_frame: an image the video starts from (image to video), on models with capabilities.first_frame. last_frame: an image it ends on, only together with first_frame and on models with capabilities.last_frame. With capabilities.ratio_from_first_frame the video keeps the first frame's shape and aspect_ratio has no effect.
  • reference_images: a list of images to follow (characters, products, style), up to capabilities.max_reference_images. When capabilities.frames_with_references is false, frames and reference images cannot be combined (400 invalid_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 https URL 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 labels project, node, step, as for chat.
  • Not available yet (version 2): reference_videos, reference_audios, shots, multi_shots (reference videos, reference audio, multi-shot) answer 400 unsupported_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 (pending or running). One more answers 429 rate_limited with Retry-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.

Finished video task (JSON)
{
  "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 → succeeded or failed (error.code says why).
  • url: the video (MP4) once it succeeded. duration_seconds: its length, read from the file (the asked duration when it cannot be read). resolution: the resolution made, e.g. 480p (null for 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 of reference_images), never their URLs.
  • credits (4 decimals) and cost_usd (the same in USD, for reference): what is held while the task runs, what it cost once it succeeded, and 0.0000 once it failed (all given back).
  • Videos are kept 30 days. expires_at (Unix seconds) is when the video is deleted; after it, url is null and expired is true. Download the videos you want to keep.
  • callback_status: with a callback_url, pending, delivered or failed; otherwise null.

The error codes of a video task:

error.codewhen
provider_failedThe model provider failed to make this video.
provider_content_policyThe provider refused the request (content policy).
provider_copyrightThe provider refused the request (copyright).
provider_unavailableThe provider did not accept the task.
provider_rejectedThe provider rejected the request.
rate_limitedThe provider was busy; send a new request later.
empty_resultThe provider returned no video.
timeoutThe 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 pricing in GET /models: per: "second" means the price × duration; per: "video" means one price per video. prices lists one price per resolution and audio (null = the price does not depend on it), and per duration for models priced by length. note explains 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_balance and 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:

GET /models, one video model (JSON)
{
  "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.

Python (speech)
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 (speech)
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:

GET /audio/voices (JSON)
{
  "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>, with language set to one of en, es, zh-TW, zh-CN, ja, ko (community.languages in the answer says which are on now). Community voices have no sample URL (sample_url is null). It is checked when you use it: a voice that was taken down, deleted, made private or hidden by us answers 400 voice_unavailable. community is null while 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 in GET /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 404 model_not_found.
  • voice (required): an id from GET /audio/voices (voice_...) or a community voice id as above. Old voice ids keep working (section 13). Unknown: 400 invalid_voice.
  • language: the language to read in, one of the voice's languages. 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: 400 invalid_request, param: "language".
  • input (required): the text. At most 5,000 characters after trimming spaces at both ends (over it: 400 text_too_long); there is no 4,096-character limit as on OpenAI. The text is not stored.
  • speed: by the voice's speed.kind: range (a number from 0.5 to 2.0), preset (slow, normal or fast; 1.0 means normal) or none (omit it or send 1.0). normal and omitting it work on every voice. Anything else answers 400 invalid_request, param: "speed".
  • response_format: mp3 (default) or wav.
  • callback_url: optional, the same rules and signature as for images (see Callbacks below).
  • metadata: optional labels project, 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, in GET /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 /models shows that range for voicica/tts (pricing.min, pricing.max; pricing.price is null). 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.

Finished speech task (JSON)
{
  "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 → succeeded or failed (error.code says why). A task not finished 10 minutes after the request fails with timeout.
  • url: the audio (mp3 or wav, as asked) when it succeeded; duration_seconds: its length. speed: the speed used. characters and billable_characters: what was counted.
  • credits (4 decimals) and cost_usd (the same in USD, for reference): what is held while the task runs, what it cost once it succeeded, and 0.0000 once it failed (all given back).
  • model is always voicica/tts, voice the voice's voice_... id (also when you sent an old id), and language the language it was read in.
  • Audio is kept 30 days. expires_at (Unix seconds) is when it is deleted; after it, url is null and expired is true. 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.codewhen
provider_failedThe voice provider failed to read the text.
provider_content_policyThe provider refused the text (content policy).
provider_copyrightThe provider refused the text (copyright).
provider_unavailableThe provider was unavailable; send a new request later.
provider_rejectedThe provider rejected the request.
rate_limitedThe provider was busy; send a new request later.
voice_unavailableThe voice was withdrawn between the request and the reading (e.g. a community voice taken down).
empty_resultThe provider returned no audio.
conversion_failedThe audio could not be converted to the asked format.
storage_failedThe audio could not be stored; send a new request.
timeoutThe 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_1k in GET /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_usd is the same amount in USD, for reference.
  • Images: the credits of all n images are taken when the task is created; the images that fail are given back when the task finishes, so a finished task's credits is 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) with Retry-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):

ModelCache
deepseek/deepseek-v4.1-flashAutomatic: the second call hit (cached input at about 1/50 of the input price).
openai/gpt-6.2-solNo 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-flashNot 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).

ModelPriced byCredits per imagePer reference image
google/nano-banana-2.1resolution1K: 4 · 2K: 6 · 4K: 9-
openai/gpt-image-2resolution1K: 6 · 2K: 10 · 4K: 16-
bytedance/seedream-4.5resolution2K: 6.5 · 4K: 6.5-
black-forest-labs/flux-2-proresolution1K: 5 · 2K: 7-
xai/grok-imaginequalityspeed: 4 · quality: 5-
minimax/minimax-h3-imageresolution1K: 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.

ModelResolutionCreditsExample
bytedance/seedance-2.0-mini480p3.8 per second4 s video: 15.2 credits
xai/grok-imagine-video480p2.4 per second6 s video: 14.4 credits
google/veo-3.1-fast720p60 per video8 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.

Error (HTTP + JSON)
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"
  }
}
Provider error (JSON)
{
  "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"
  }
}
HTTPcodetyperetryablewhen
400invalid_requestinvalid_request_errornoThe 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.
400unsupported_contentinvalid_request_errornoAn 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.
400unsupported_parameterinvalid_request_errornotools 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).
400invalid_imageinvalid_request_errornoAn image URL that is neither https:// (up to 2,048 characters) nor a base64 data URL (png, jpeg, webp, gif).
400invalid_json_schemainvalid_request_errornoThe 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.
400upstream_rejectedinvalid_request_errornoThe model provider rejected the request (e.g. too long for the model's context; for images and videos, a refused prompt). Not charged.
400invalid_image_urlinvalid_request_errornoImages 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.
400image_too_largeinvalid_request_errornoImages and videos: a reference or input image is larger than 10 MB.
400unsupported_image_typeinvalid_request_errornoImages and videos: a reference or input image is not PNG, JPEG or WebP (we read the bytes, not the extension).
400image_download_failedinvalid_request_errornoImages and videos: a reference or input image could not be downloaded (error status, timeout, more than 3 redirects).
400invalid_callback_urlinvalid_request_errornoImages, videos and speech: callback_url is not a public https URL on port 443 that resolves to public addresses.
400content_blockedinvalid_request_errornoVideos: 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.
400invalid_voiceinvalid_request_errornoSpeech: an unknown voice id, a voice not offered now, or a malformed community voice id; see GET /audio/voices. param is voice.
400voice_unavailableinvalid_request_errornoSpeech: a community voice that was taken down, deleted, made private or hidden by us.
400unsupported_voiceinvalid_request_errornoSpeech: a cloned voice (cloned voices are not available on the API).
400text_too_longinvalid_request_errornoSpeech: input has more than 5,000 characters after trimming. param is input.
401missing_api_keyauthentication_errornoNo Authorization header.
401invalid_api_keyauthentication_errornoNot a Bearer key, a malformed key, an unknown key, or the key's account has not verified its email.
401revoked_api_keyauthentication_errornoThe key was revoked.
402insufficient_balancebilling_errornoThe 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.
404model_not_foundnot_found_errornoUnknown model; see GET /models.
404not_foundnot_found_errornoUnknown endpoint, or an image generation, video generation or speech task id that does not exist or belongs to another account.
405method_not_allowedinvalid_request_errornoWrong HTTP method for the endpoint.
413request_too_largeinvalid_request_errornoThe body is larger than 8 MB (by Content-Length), or the provider answered 413.
429rate_limitedrate_limit_erroryesOur 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.
429quota_exceededrate_limit_errornoThis 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).
500internal_errorapi_erroryesA bug on our side.
502upstream_errorupstream_erroryes / noThe model provider failed (5xx, network, unreadable answer): retryable. The provider refused Voicica's own credentials: not retryable; email support@voicica.ai.
502invalid_json_outputupstream_errornoWith response_format json_object / json_schema, the model's answer was not valid JSON (or did not match the schema) twice.
503service_unavailableapi_erroryesThe platform API (or its video or speech part) is switched off or not configured; or, for speech, the voice cannot be reached right now.
503moderation_unavailableapi_erroryesVideos: the content check is unavailable right now. Not charged; try again later.
503upstream_unavailableapi_errornoThe model is temporarily unavailable on our side. Retry later, or email support@voicica.ai if it lasts.
504upstream_timeouttimeout_erroryesThe 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-After up to 10 s).
  • Retry only when retryable is true, 1 or 2 more times. Wait for Retry-After when it is present, else back off exponentially (e.g. 1 s, 2 s, 4 s with jitter). Do not retry when retryable is false: 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 / maxRetries to 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.
Python (retry)
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) with Retry-After in 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 metadata labels.
  • 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_tokens includes 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 at temperature: 0). DeepSeek and Gemini ignore max_tokens and temperature; GPT ignores temperature (as do OpenAI's own reasoning models). Claude takes both (not temperature while it thinks). To cap spending, set a daily or monthly cap in API credits on the key. Check unsupported_params in GET /models and voicica.ignored_params per call.
  • Reasoning models (capabilities.reasoning) think before answering; the hidden tokens are billed as output. Use reasoning_effort where capabilities.reasoning_effort is 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)

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 idNew id
deepseek-v4.1-flashdeepseek/deepseek-v4.1-flash
claude-opus-5-5anthropic/claude-opus-5.5
claude-sonnet-5-5anthropic/claude-sonnet-5.5
claude-haiku-5-5anthropic/claude-haiku-5.5
gpt-6.2-solopenai/gpt-6.2-sol
gemini-3.8-flashgoogle/gemini-3.8-flash
nano-banana-2-1google/nano-banana-2.1
gpt-image-2openai/gpt-image-2
seedream-4.5bytedance/seedream-4.5
flux-2-problack-forest-labs/flux-2-pro
grok-imaginexai/grok-imagine
minimax-h3-imageminimax/minimax-h3-image
z-imagealibaba/z-image
kling-4.0-flashkuaishou/kling-4.0-flash
kling-3.0kuaishou/kling-3.0
kling-3.0-turbokuaishou/kling-3.0-turbo
kling-2.6kuaishou/kling-2.6
veo-3.1-qualitygoogle/veo-3.1
veo-3.1-fastgoogle/veo-3.1-fast
veo-3.1-litegoogle/veo-3.1-lite
gemini-omni-flashgoogle/gemini-omni-flash
seedance-2.5bytedance/seedance-2.5
seedance-2.0bytedance/seedance-2.0
seedance-2.0-fastbytedance/seedance-2.0-fast
seedance-2.0-minibytedance/seedance-2.0-mini
wan-2.7alibaba/wan-2.7
wan-2.6alibaba/wan-2.6
wan-2.5alibaba/wan-2.5
minimax-h3minimax/minimax-h3
grok-imagine-videoxai/grok-imagine-video
happyhorse-1.1alibaba/happyhorse-1.1
azure-speechvoicica/tts
gemini-3.8-flash-ttsvoicica/tts
elevenlabs-v3voicica/tts
fish-s2.1-provoicica/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, language is 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): language picks 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 language answers 400 invalid_request with param: "language".