Images, video and voice
Make pictures, video clips and speech, or turn speech into text, with the same key you use for chat. The OpenAI SDK works as it is.
Before you start
Images, video and voice need a top-up first: they work once your account has added credits by card, crypto or an x402 wallet top-up, and the free welcome credit or a referral credit does not count. Until then, a call gets this answer and nothing is charged:
HTTP/1.1 402 Payment Required
{
"error": {
"code": "top_up_required",
"message": "images, video and voice need a top-up first: add credits in the console"
}
}Add credits on the Credits page. Then use any model key, as for chat.
The calls
All of them go to https://api.opencheap.si/v1 with your key as Authorization: Bearer …, in OpenAI's shapes.
- POST /v1/images/generationsMake images from a prompt, or change images you send. Waits for them and answers with links.
- POST /v1/audio/speechRead text out loud. Answers with the audio file.
- POST /v1/audio/transcriptionsTurn speech in an audio file into text.
- POST /v1/videosStart a video. Answers at once with its id; the video takes a minute or two.
- GET /v1/videos/{id}Ask how a video is doing: queued, in_progress, completed or failed.
- GET /v1/videos/{id}/contentDownload a finished video as an MP4.
- GET /v1/media/modelsEvery image, video and voice model with its settings, its price per setting and each provider's price. No key needed.
Images
Send a prompt to POST /v1/images/generations. The call waits until the images are ready (a few seconds, up to a few minutes) and answers with a link to each.
curl https://api.opencheap.si/v1/images/generations \
-H "Authorization: Bearer $OPENCHEAP_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "nano-banana-2.1",
"prompt": "A red fox asleep in fresh snow, soft morning light",
"resolution": "1k",
"aspect_ratio": "1:1"
}'
# The answer: {"data": [{"url": "https://…"}], …}. The link expires: save the image.import os
from openai import OpenAI
client = OpenAI(base_url="https://api.opencheap.si/v1", api_key=os.environ["OPENCHEAP_API_KEY"])
r = client.images.generate(
model="nano-banana-2.1",
prompt="A red fox asleep in fresh snow, soft morning light",
extra_body={"resolution": "1k", "aspect_ratio": "1:1"},
)
print(r.data[0].url) # the link expires: save the imageThe answer:
{
"id": "img_…",
"created": 1763800000,
"model": "nano-banana-2.1",
"data": [{ "url": "https://…/image.png" }],
"usage": { "images": 1, "cost": 0.012 }
}usage.cost is what the call cost, in dollars. Settings beyond OpenAI's own go in extra_body with the SDK:
promptWhat to make.nHow many images. Every model makes one image per call for now: send more calls for more images.resolution1k,2kor4k, where the model offers them. The price can depend on it.aspect_ratio or sizeThe shape, as16:9, or a size such as1024x1024.image_urlsLinks (https) to images to change or follow, for models that take them.response_formaturl(the default) orb64_jsonfor the image itself in the answer.
Speech: text to voice
Send the text as input and pick a voice (each model's page lists its voices). The answer is the audio file itself, an MP3, with its cost in the x-media-cost header. It is billed by the characters of input, as each model's page says: per started 1,000 characters, or in steps of 10 for ElevenLabs v3. GPT-4o mini TTS is billed by the length of the speech it makes plus the tokens of your text, and sends MP3 only.
curl https://api.opencheap.si/v1/audio/speech \
-H "Authorization: Bearer $OPENCHEAP_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "elevenlabs-turbo-2.5",
"voice": "adam",
"input": "Hello! Your order is on its way and should arrive tomorrow."
}' \
-o speech.mp3import os
from openai import OpenAI
client = OpenAI(base_url="https://api.opencheap.si/v1", api_key=os.environ["OPENCHEAP_API_KEY"])
with client.audio.speech.with_streaming_response.create(
model="elevenlabs-turbo-2.5",
voice="adam",
input="Hello! Your order is on its way and should arrive tomorrow.",
) as r:
r.stream_to_file("speech.mp3")Transcription: voice to text
Upload the audio file as file. The answer is the text, as OpenAI sends it: JSON by default, or text, verbose_json, srt or vtt with response_format. It is billed by the length of the audio, to the second, as the provider counts it; the GPT-4o Transcribe models by the provider's own count of the audio and the words, never more than their price per minute.
curl https://api.opencheap.si/v1/audio/transcriptions \
-H "Authorization: Bearer $OPENCHEAP_API_KEY" \
-F model=whisper-1 \
-F file=@meeting.mp3
# The answer: {"text": "…"}import os
from openai import OpenAI
client = OpenAI(base_url="https://api.opencheap.si/v1", api_key=os.environ["OPENCHEAP_API_KEY"])
with open("meeting.mp3", "rb") as f:
t = client.audio.transcriptions.create(model="whisper-1", file=f)
print(t.text)Video
A video takes a minute or two, so it is three calls: start it with POST /v1/videos (the answer comes at once, status queued), ask GET /v1/videos/{id} every few seconds until the status is completed, then download it from GET /v1/videos/{id}/content. A video that fails has status failed and an error, and is not charged.
# 1. Start the video. The answer is at once: {"id": "video_…", "status": "queued", …}
curl https://api.opencheap.si/v1/videos \
-H "Authorization: Bearer $OPENCHEAP_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "veo-3.1-fast",
"prompt": "A paper boat drifting down a rainy street, close up, slow motion",
"seconds": "8",
"resolution": "720p",
"aspect_ratio": "16:9"
}'
# 2. Ask until "status" is "completed" (a minute or two), or "failed" (nothing is charged).
curl https://api.opencheap.si/v1/videos/video_123 -H "Authorization: Bearer $OPENCHEAP_API_KEY"
# 3. Download the MP4.
curl https://api.opencheap.si/v1/videos/video_123/content -H "Authorization: Bearer $OPENCHEAP_API_KEY" -o video.mp4import time
import os
from openai import OpenAI
client = OpenAI(base_url="https://api.opencheap.si/v1", api_key=os.environ["OPENCHEAP_API_KEY"])
video = client.videos.create(
model="veo-3.1-fast",
prompt="A paper boat drifting down a rainy street, close up, slow motion",
seconds="8",
extra_body={"resolution": "720p", "aspect_ratio": "16:9"},
)
while video.status in ("queued", "in_progress"):
time.sleep(10)
video = client.videos.retrieve(video.id)
if video.status == "completed":
client.videos.download_content(video.id).write_to_file("video.mp4")
else:
print(video.error) # a failed video is not chargedA finished video:
{
"id": "video_…",
"object": "video",
"model": "veo-3.1-fast",
"status": "completed",
"progress": 100,
"seconds": "8",
"resolution": "720p",
"cost": 0.14,
"url": "https://…/video.mp4",
"expires_at": 1763886400
}url works until expires_at (a Unix time): download the file before then. The settings:
promptWhat happens in the clip.secondsHow long, where the model offers a choice.resolution and aspect_ratioFor example720pand16:9. Orsize, as1280x720.image_urlA link (https) to the first frame, to start the clip from your picture. Some models also take end_image_url.audiotrue or false, for models where sound is a choice.
Models and prices
Each model has a price per setting, for example per image at 1K, 2K or 4K, or per video at 720p or 4K, and each provider that makes it has its own. A call goes to the cheapest provider that can make it and costs that provider's price, never more than the list shows; a call that fails is not charged. The Media section of the Models page lists every model with its prices and a call to copy. The same list, for code, needs no key:
curl https://api.opencheap.si/v1/media/modelsThese models are not in GET /v1/models: that list is for chat apps, which would break on an image model. Every call shows in your Logs with what it made, such as "1 image" or "8 s video".