GPUtw Docs

Sovereign Models API

OpenAI-compatible chat (Gemma 4, MedGemma), Taiwanese Mandarin speech to text (Breeze ASR 25) and text to speech (BreezyVoice), and MiniMax H3 video, paid from your GPUtw balance.

Overview

Call open models that run on GPUtw's own GPUs in Taiwan, paid by usage, with no instance to rent. The chat and audio endpoints are OpenAI-compatible: any OpenAI SDK or tool works by changing the base URL and the key. Prompts, audio, text and outputs are not stored and stay in Taiwan; only the billable quantity (tokens, audio seconds or characters) and timings are kept for billing.

  • gemma-4-26b-a4b: Google Gemma 4 (26B MoE, 4B active): chat, reasoning, tool calling, image input, 256K-token context shared by prompt and answer.
  • medgemma-1.5-4b: Google MedGemma 1.5 4B: medical text and image understanding, 128K-token context shared by prompt and answer. For research and development, not clinical diagnosis.
  • breeze-asr-25: Breeze ASR 25 (MediaTek Research): speech to text tuned for Taiwanese Mandarin and sentences that mix Mandarin and English, with timestamps and SRT / VTT subtitles.
  • breezyvoice: BreezyVoice (MediaTek Research): Taiwanese Mandarin text to speech with preset voices; numbers, dates and money are read the Taiwanese way.
  • minimax-h3: MiniMax H3 video generation: text or image to video with audio, 480p / 720p / 768p / 1080p / 2K, 1–15 seconds.

Current prices are on API & Models → Sovereign Models.

Keys and billing

Create a key on API & Models → Sovereign Models (gtv_live_…, shown once). Usage is paid from your GPUtw balance and settled about once a minute; each settlement appears in your billing history. When the balance reaches zero the API answers 402 insufficient_balance; a request already running is always finished.

Example
export GPUTW_MODEL_KEY=gtv_live_...
curl https://models.gputw.ai/v1/models -H "Authorization: Bearer $GPUTW_MODEL_KEY"

Chat completions

Example
curl https://models.gputw.ai/v1/chat/completions \
  -H "Authorization: Bearer $GPUTW_MODEL_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "gemma-4-26b-a4b",
    "messages": [{"role": "user", "content": "Describe Taiwan in three sentences."}],
    "max_tokens": 512
  }'

With the OpenAI Python SDK:

Example
from openai import OpenAI

client = OpenAI(base_url="https://models.gputw.ai/v1", api_key="gtv_live_...")
reply = client.chat.completions.create(
    model="gemma-4-26b-a4b",
    messages=[{"role": "user", "content": "Hello"}],
)
print(reply.choices[0].message.content)

Supported fields: messages, max_tokens / max_completion_tokens, temperature, top_p, top_k, min_p, presence_penalty, frequency_penalty, repetition_penalty, stop, seed, n (1–4), response_format, tools, tool_choice, logprobs, chat_template_kwargs. Other fields are ignored. Without max_tokens an answer may run until the context window is full, so it is never cut short by a default limit.

Streaming

Set "stream": true for server-sent events in the OpenAI format. The last chunk carries usage (prompt and completion tokens), which is what you are billed for. If you disconnect early you pay only for the tokens already generated.

Example
stream = client.chat.completions.create(
    model="gemma-4-26b-a4b", stream=True,
    messages=[{"role": "user", "content": "Count to 20."}],
)
for chunk in stream:
    if chunk.choices and chunk.choices[0].delta.content:
        print(chunk.choices[0].delta.content, end="", flush=True)

Images as input

Both chat models accept images. Send them inline as data: URLs (PNG, JPEG, WebP, up to 4 per request); the models run with no internet access, so https:// image links are refused.

Example
{"model": "medgemma-1.5-4b", "messages": [{"role": "user", "content": [
  {"type": "image_url", "image_url": {"url": "data:image/png;base64,iVBORw0..."}},
  {"type": "text", "text": "Describe this X-ray."}
]}]}

Tool calling and JSON

Gemma 4 supports OpenAI-style tools (including a forced tool_choice) and response_format: {"type": "json_object"}. To turn Gemma's step-by-step thinking off for short answers, pass "chat_template_kwargs": {"enable_thinking": false}.

Video generation (MiniMax H3)

Video is asynchronous: submit, poll, then download the MP4 (kept for 3 hours).

Example
# 1. submit
curl https://models.gputw.ai/v1/videos/generations \
  -H "Authorization: Bearer $GPUTW_MODEL_KEY" \
  -H "Content-Type: application/json" \
  -d '{"model": "minimax-h3", "prompt": "A night market in Tainan, slow dolly shot", "resolution": "768p", "seconds": 5, "aspect_ratio": "16:9"}'

# 2. poll until "status": "completed"
curl https://models.gputw.ai/v1/videos/vid_... -H "Authorization: Bearer $GPUTW_MODEL_KEY"

# 3. download
curl -o out.mp4 https://models.gputw.ai/v1/videos/vid_.../content -H "Authorization: Bearer $GPUTW_MODEL_KEY"
  • resolution: 480p, 720p, 768p, 1080p or 2k (billed per second of video at that resolution; 768p clips run up to 12 s, 2k up to 10 s)
  • seconds: 1–15
  • aspect_ratio: 16:9, 9:16, 1:1, 4:3, 3:4
  • image_url: optional first frame (https:// or data: URL); last_frame and reference_images are also accepted
  • generate_audio: true by default

A queued job can be withdrawn with POST /videos/<id>/cancel and is never billed.

Speech to text (Breeze ASR 25)

POST /audio/transcriptions takes a multipart upload and answers in the same response. Breeze ASR 25 is tuned for Taiwanese Mandarin: Taiwanese accents, and English words inside Mandarin sentences (instance, checkpoint, training) come out in English rather than forced into Chinese.

Example
curl https://models.gputw.ai/v1/audio/transcriptions \
  -H "Authorization: Bearer $GPUTW_MODEL_KEY" \
  -F [email protected] \
  -F model=breeze-asr-25 \
  -F response_format=srt \
  -o meeting.srt

With the OpenAI Python SDK:

Example
from openai import OpenAI
import os

client = OpenAI(base_url="https://models.gputw.ai/v1", api_key=os.environ["GPUTW_MODEL_KEY"])

with open("meeting.mp3", "rb") as f:
    t = client.audio.transcriptions.create(
        model="breeze-asr-25",
        file=f,
        response_format="verbose_json",
    )
print(t.text)
for seg in t.segments:
    print(seg.start, seg.end, seg.text)
  • file: the audio, up to 25 MB and 30 minutes; any common format (mp3, m4a, wav, webm, ogg, flac, mp4 …)
  • model: breeze-asr-25
  • language: optional, zh by default; en and other language codes are also accepted
  • prompt: optional vocabulary or context hint, e.g. product names, people, jargon
  • temperature: optional, 0–1
  • response_format: json (default, {"text": "…"}), text, verbose_json (segments with start and end seconds), srt or vtt (subtitles)

A verbose_json answer:

Example
{
  "task": "transcribe",
  "language": "zh",
  "duration": 12.48,
  "text": "我們今天把 checkpoint 存到 vault,下午再開始 training。",
  "segments": [
    {"id": 0, "start": 0.0, "end": 5.2, "text": "我們今天把 checkpoint 存到 vault,"},
    {"id": 1, "start": 5.2, "end": 12.48, "text": "下午再開始 training。"}
  ]
}

Billing. Per second of audio, rounded up, at least 1 second per request, at the per-minute price shown on API & Models → Sovereign Models. Failed requests are not billed.

Text to speech (BreezyVoice)

POST /audio/speech takes JSON and returns the audio bytes. Numbers, dates, times, money, percentages and units are read the Taiwanese way (兩百, 二零二六年, 新台幣 …), and Traditional characters stay Traditional.

Example
curl https://models.gputw.ai/v1/audio/speech \
  -H "Authorization: Bearer $GPUTW_MODEL_KEY" \
  -H "Content-Type: application/json" \
  -d '{"model": "breezyvoice", "voice": "tw-female-1", "input": "您好,歡迎使用 GPUtw。", "response_format": "mp3"}' \
  -o hello.mp3

With the OpenAI Python SDK:

Example
from openai import OpenAI
import os

client = OpenAI(base_url="https://models.gputw.ai/v1", api_key=os.environ["GPUTW_MODEL_KEY"])

resp = client.audio.speech.create(
    model="breezyvoice",
    voice="tw-female-1",
    input="您好,歡迎使用 GPUtw。",
)
resp.write_to_file("hello.mp3")

# or stream it to disk:
# with client.audio.speech.with_streaming_response.create(
#     model="breezyvoice", voice="tw-female-1", input="您好,歡迎使用 GPUtw。",
# ) as r:
#     r.stream_to_file("hello.mp3")
  • model: breezyvoice
  • input: the text, up to 2,000 characters; longer text is split into sentences and read in order
  • voice: a preset voice (see below)
  • response_format: mp3 (default), wav, opus or pcm (raw 16-bit, 24 kHz, mono)
  • speed: optional, 0.25–4.0

Voices.

  • tw-female-1: Taiwanese Mandarin, female
Info

Only preset voices are offered. Cloning a voice from your own recording is not available, because it can be used to impersonate real people. Custom voices may come later as a reviewed feature.

Billing. Per input character after trimming leading and trailing whitespace, at least 1 per request, at the per-1,000-character price shown on API & Models → Sovereign Models. Failed requests are not billed.

Errors and limits

Errors are {"error": {"code", "message", "retry_after"?}}. Branch on code.

  • 401 invalid_api_key: missing, revoked or unknown key
  • 401 key_expired: the key passed its expiry date; extend it or create a new one
  • 402 insufficient_balance: top up your GPUtw balance
  • 403 model_not_allowed: the key is limited to other models; change its allowed models on the keys page
  • 429 key_budget_exceeded: the key reached its monthly or total spending limit; raise the limit or wait for next month (Asia/Taipei)
  • 400 model_not_found / invalid_request / invalid_image: fix the request
  • 429 concurrency_limit / rate_limited: too many requests at once; wait retry_after seconds
  • 503 model_not_available: the model is starting or at capacity; retry after retry_after seconds
  • 400 invalid_audio: the audio file could not be decoded
  • 400 audio_too_long: the audio is longer than 30 minutes (60 seconds on a test key)
  • 413 file_too_large: the upload is larger than 25 MB
  • 400 input_too_long: the text is longer than 2,000 characters (200 on a test key)
  • 400 invalid_voice: the voice is not one of the preset voices

Test keys. Speech requests with a gtv_test_ key are not billed and are capped at 60 seconds of audio (speech to text) and 200 characters (text to speech). Per-key allowed models, monthly and total limits and expiry apply to the speech models like to every other model.

Context and parallelism. Both models run with their full context window: 256K tokens for Gemma 4 and 128K tokens for MedGemma. Each GPU serves up to 32 requests at once; they share the GPU's memory, so a few very long documents (100K+ tokens) run side by side while ordinary chats run in parallel up to that limit. When every GPU of a model is full, new requests wait briefly or get 503 model_not_available with retry_after. Each account may run 8 chat requests at once by default.