Media overview
Image generation, speech synthesis, transcription, and video generation.
Swift AI exposes a small protocol and one top-level function for each media capability. Pick the capability you need; provider-specific model types plug into the same call.
Image generation
Generate and edit images with OpenAI, fal, Luma, or Replicate.
Speech generation
Synthesize audio with OpenAI, ElevenLabs, LMNT, Hume, Deepgram, or Sarvam.
Transcription
Transcribe audio with seven built-in provider models.
Video generation
Create video with xAI or Luma, including image-to-video.
All four functions are async throws, retry transient failures by default,
and accept providerOptions for native settings that do not belong in the
shared API.
let image = try await generateImage(model: imageModel, prompt: prompt)
let audio = try await generateSpeech(model: speechModel, text: text)
let text = try await transcribe(model: transcriptionModel, audio: data, mediaType: "audio/mpeg")
let video = try await generateVideo(model: videoModel, prompt: prompt)See media providers for the provider-by-provider view.