Docs menuinvideo Platform docsQuickstartFor AI agentsAPI referenceAuthenticationRequestsFilesErrorsLimitsBilling and balanceCatalogueProvider keys (BYOK)Formats and model IDsChat completionsOpenAI ResponsesAnthropic MessagesGeminiStreaming chat answersTools (function calling)Structured output (JSON)VideoAudioUse your own SDKOpenAI mediaElevenLabsReplicatefalGemini mediaxAIRunwayLumaDeepgram and CartesiaMakers' own APIsVideo provider formatsImage provider formatsAudio provider formatsLLM provider formatsGenerate and edit imagesTest your integrationWorkspaces and membersSecurityService accountsModels
View as markdown

OpenAI media

Generate images, transcribe audio and create speech with the OpenAI SDK, the Vercel AI SDK, LiteLLM or n8n. Change the base URL and the model.

These endpoints take OpenAI's request and answer in OpenAI's shape, so the OpenAI SDK works as it is.

Base URL:

text
https://platform-api.invideo.io/v1
EndpointModels
POST /v1/images/generations, POST /v1/images/editsevery image model
POST /v1/audio/transcriptionsevery speech-to-text model
POST /v1/audio/speechevery text-to-speech model

Images

python
import os, base64
from openai import OpenAI

client = OpenAI(api_key=os.environ["INVIDEO_API_KEY"], base_url="https://platform-api.invideo.io/v1")

result = client.images.generate(model="nano-banana-2-1", prompt="A red fox in fresh snow, golden hour", size="1536x1024")
open("fox.png", "wb").write(base64.b64decode(result.data[0].b64_json))
  • The image comes back as b64_json. With response_format="url" you get a link of ours instead.
  • size becomes the model's closest aspect ratio. quality and background are passed to models that have them.
  • images.edit sends your image (one or several) with the prompt. A mask is not supported.
  • n must be 1: each image is priced and billed as its own request.

Speech to text

python
with open("meeting.mp3", "rb") as audio:
    text = client.audio.transcriptions.create(model=os.environ["INVIDEO_TRANSCRIPTION_MODEL"], file=audio)
print(text.text)

Set INVIDEO_TRANSCRIPTION_MODEL to an enabled speech-to-text model from GET /v1/models?modality=audio. response_format can be json, text, verbose_json (with words), srt or vtt.

Text to speech

python
speech = client.audio.speech.create(
    model="elevenlabs-tts-multilingual-v2",
    voice=os.environ["INVIDEO_TTS_VOICE"],
    input="Welcome to the show.",
)
speech.write_to_file("welcome.mp3")

Set INVIDEO_TTS_VOICE to an ElevenLabs voice ID. You can find the model's voice inputs with GET /v1/models/elevenlabs-tts-multilingual-v2. Read the Content-Type header for the returned audio format.

Model inputs OpenAI has no field for

python
client.images.generate(
    model="nano-banana-2-1",
    prompt="A red fox in fresh snow",
    extra_body={"resolution": "1K"},
)

This example sets Nano Banana 2.1’s image resolution. extra_body takes the selected model’s own input names and values. Look them up with GET /v1/models/{id}. These calls answer when the run ends.