# One API for image, video and voice AI models

> Generate images, render 720p video clips, synthesize speech, and transcribe audio using one API key and OpenAI-compatible routes.

**Yes: you can generate images, render video clips, synthesize speech, and transcribe audio using a single API key and one OpenAI-compatible endpoint.** thelastapi provides unified access to multimodal AI models under `/v1/ai`, covering text-to-image, photo editing, text-to-video, image-to-video, text-to-speech, and transcription. You do not need separate accounts, separate billing dashboards, or disparate client libraries to handle media generation in your application.

Every media generation request is metered against your project, reports its exact dollar cost in the response, and automatically saves output files to your project's persistent file storage with permanent public URLs.

## Which image, video, and audio models can you run?

thelastapi organizes visual and audio workloads into tier names that route to specific underlying models. Each tier runs exactly one named model, and the model that runs is always reported in the response via the `served_model` field or `X-Vibiz-Served-Model` audio header. If a provider is down, the request fails with an explicit error (`model_unavailable` or `provider_unavailable`) rather than quietly substituting an unrequested model.

| thelastapi tier | Underlying model | Primary use case | Price (USD) |
| --- | --- | --- | --- |
| `vibiz/image` | Nano Banana 2 (Google) | Fast generation, photo edits, consistent characters | ~$0.067 per image |
| `vibiz/image-pro` | Nano Banana 2.1 (Google) | High-fidelity image generation | ~$0.034 per image |
| `vibiz/image-text` | GPT-5.4 Image 2 (OpenAI) | Complex, long prompts and clear embedded text | ~$0.04 per image |
| `vibiz/video` | LTX-2.5 Fast (Lightricks) | 6-second clips at 720p with sound (16:9 or 9:16) | $0.54 per video |
| `vibiz/voice` | Lab voice model | Natural, real-time text-to-speech | $0.04 per 1,000 characters |
| `vibiz/voice-pro` | Lab voice model | Expressive, nuanced speech synthesis | $0.08 per 1,000 characters |
| `vibiz/voice-lite` | Lab voice model | Fast text-to-speech across 32 languages | $0.04 per 1,000 characters |
| `vibiz/transcribe` | Lab voice model | Speech-to-text across 99 languages | $0.22 per hour of audio |

Beyond these default tiers, you can call specialized media models directly by id. You can query available models using `GET /v1/ai/media-models` over HTTP:

```bash
curl https://thelastapi.dev/v1/ai/media-models?q=kling \
  -H "Authorization: Bearer $VIBIZ_API_KEY"
```

This returns video and visual models such as Kling, Seedance, Veo, Hailuo, and Wan, as well as face swap and lip sync tools, complete with their live per-second, per-megapixel, or per-image prices. For a deeper breakdown of visual model selection, see [an image generation API for developers: Nano Banana and GPT Image on one key](https://thelastapi.dev/blog/image-generation-api-developers).

## How to generate images and edit existing photos

Image generation uses the standard `POST /v1/ai/images/generations` route. You can request raw base64 data or a hosted URL. Request dimensions can range from 256 to 2,048 pixels per side, with a maximum of 4 images per single request.

From your terminal using the CLI:

```bash
vibiz image "a croissant on a marble table" -o hero.png --model vibiz/image
```

Using Node.js with the official OpenAI SDK:

```ts
import OpenAI from 'openai';

const openai = new OpenAI({
  baseURL: process.env.VIBIZ_AI_BASE_URL,
  apiKey: process.env.VIBIZ_AI_API_KEY,
});

const response = await openai.images.generate({
  model: 'vibiz/image-text',
  prompt: 'A minimalist coffee shop banner with the bold text "Acme Roast"',
  response_format: 'url',
});

console.log('Image URL:', response.data[0].url);
```

You can also edit existing photos by supplying an `image_url` (or up to 8 links via `image_urls` to combine elements) alongside your prompt. This allows you to alter backgrounds, change outfits, or combine a person with a product:

```ts
const edited = await openai.images.generate({
  model: 'vibiz/image',
  prompt: 'change the background from a studio to a sunlit park',
  image_url: 'https://thelastapi.dev/f/Qm9x.../product.png',
} as never);
```

If you submit a source photo to a model that only draws from a text prompt, the gateway returns a `400` status with `details.reason: "model_takes_no_photo"` rather than ignoring your image. When orchestrating visual tasks inside developer agent workflows, review our guide on how to [generate images and video from Claude Code](https://thelastapi.dev/blog/ai-video-from-claude-code).

## How to generate video clips from text and images

Video rendering is an asynchronous process handled by the jobs endpoint (`POST /v1/ai/jobs`). The default video tier, `vibiz/video`, produces 6-second clips at 720p resolution with sound. It supports both `16:9` and `9:16` aspect ratios (requesting `1:1` returns a `16:9` render).

To generate a clip from a text prompt in your terminal:

```bash
vibiz video "ocean waves crashing against dark volcanic rocks at sunset" -o waves.mp4 --aspect 16:9
```

To animate an existing static graphic or product shot into motion, pass `--from-image` or set `image_url` in the input body:

```bash
vibiz video "camera slowly pans around the bottle on the table" -o product.mp4 --from-image https://thelastapi.dev/f/Qm9x.../product.png
```

Programmatically, you submit the job, receive a `202 Accepted` status with a job ID, and poll `GET /v1/ai/jobs/:id` until the status transitions to complete:

```bash
curl -X POST https://thelastapi.dev/v1/ai/jobs \
  -H "Authorization: Bearer $VIBIZ_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "type": "video",
    "model": "vibiz/video",
    "input": {
      "prompt": "amber streetlights reflecting in rain puddles on city asphalt",
      "aspect_ratio": "16:9"
    }
  }'
```

Once finished, the job payload returns `file_id` and `file_url` inside `output.data[i]`. For step-by-step implementations and prompt advice, read [a text-to-video API: a six-second clip from a prompt](https://thelastapi.dev/blog/text-to-video-api) and [an image-to-video API to animate a product photo](https://thelastapi.dev/blog/image-to-video-api-product-animation).

## How to stream speech and transcribe recordings

Audio capabilities sit directly on the same `/v1/ai` router. You can convert text to audio with `POST /v1/ai/audio/speech` or process voice files with `POST /v1/ai/audio/transcriptions`.

Text-to-speech supports nine built-in voices: `alloy`, `ash`, `coral`, `echo`, `fable`, `nova`, `onyx`, `sage`, and `shimmer`. Inputs can contain up to 4,096 characters per request, streamed as `mp3` or raw `pcm`.

CLI synthesis:

```bash
vibiz say "Your order has been packaged and is ready for pickup." -o pickup.mp3 --voice alloy
```

Direct HTTP request:

```bash
curl https://thelastapi.dev/v1/ai/audio/speech \
  -H "Authorization: Bearer $VIBIZ_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "vibiz/voice",
    "input": "System check complete. All services operating normally.",
    "voice": "nova"
  }' \
  --output alert.mp3
```

For incoming audio, speech-to-text accepts multipart file uploads up to 25 MB across 99 languages:

```bash
vibiz transcribe interview.m4a --language en
```

Using cURL against the transcription endpoint:

```bash
curl https://thelastapi.dev/v1/ai/audio/transcriptions \
  -H "Authorization: Bearer $VIBIZ_API_KEY" \
  -F file="@meeting.m4a" \
  -F model="vibiz/transcribe" \
  -F language="en"
```

The server returns a JSON response containing the full transcribed text alongside the exact `cost_micro_usd` charged to your balance.

## How generated media is stored and served

When you generate media using a project key, the output is saved directly into your project's storage bucket on [Files](https://thelastapi.dev/docs/files). You do not need an auxiliary storage service or custom upload script.

- **Permanent links:** Public project files receive permanent links under `https://thelastapi.dev/f/<key>/<name>`. The 32-character random key prevents guessing or unauthorized listing while remaining directly embeddable in HTML `<img>` and `<video>` tags.
- **Automatic naming:** Files are automatically labeled by creation date and prompt excerpt (for example, `2026-10-28-cold-email-cover.png`). Duplicate names receive numbered suffixes.
- **Metadata tracking:** Each file object retains the originating prompt, the specific model id that rendered it, the execution cost in `cost_usd`, and source tags.
- **Environment separation:** Generation requests made with development credentials store assets in your project's development bucket; calls made with production keys write to production.
- **Account key fallback:** If you make a generation call using an account-level key without specifying a project via `X-Vibiz-Project`, assets are not saved to Files and generated links expire after 24 hours.

Inspect the latest image created in your project using the CLI:

```bash
vibiz files latest --type image --source ai
```

You can read more about file retrieval, tags, and signed links in the [Files documentation](https://thelastapi.dev/docs/files).

## How to manage budgets and monitor costs

Unified multimedia generation can incur unexpected costs if left unmonitored. thelastapi enforces guardrails at both the account and project level:

- **Daily spend ceiling:** Accounts begin with a default spend ceiling of $5 per UTC day across all AI and action workloads. Account owners can raise this ceiling in Billing settings.
- **Daily project budget:** Projects default to a $1 daily AI budget. When a project reaches its cap, subsequent requests receive a `429 Rate Limited` response with `details.reason: "project_budget"`.
- **Pre-execution credit checks:** Before executing an image, video, or speech call, the gateway calculates the worst-case cost against your credit balance. If your balance is insufficient, the call halts immediately with a `402 payment_required` error.
- **Cost attribution:** Every JSON payload includes `cost_micro_usd`, allowing you to log the exact dollar fraction spent per interaction. Passing an end-user identifier via the `user` field or `X-Vibiz-User` header allows you to track and cap consumption per end user.

If your team maintains an existing Gemini API key, you can link it with `vibiz ai keys set google`. All Google-powered media tiers (such as `vibiz/image` and `vibiz/image-pro`) will then bill directly to your Google account at zero markup on thelastapi, while other lab models continue running through your standard project balance.

To explore the complete parameter list, request headers, and gateway schemas, visit the comprehensive [AI documentation](https://thelastapi.dev/docs/ai).

## Frequently asked questions

### Do I need separate SDKs to generate images, video, and audio?

No. You can run language, image, and audio models using the standard OpenAI SDK by setting `baseURL` to `VIBIZ_AI_BASE_URL` and `apiKey` to `VIBIZ_AI_API_KEY`. Asynchronous video renders and catalog lookups can be called through plain HTTP requests or the `vibiz` CLI.

### Where are generated images and video files hosted?

Every media asset generated with a project key is automatically saved in your project's Files storage. The API returns a permanent, non-expiring public URL suitable for use in websites, applications, and emails without requiring secondary cloud storage.

### What happens if an image or video model is temporarily down?

The gateway returns an explicit `503` status with error code `model_unavailable` or `provider_unavailable` and a retry recommendation. thelastapi never silently switches your generation request to an unrequested model.

### Can I use my own provider credentials for media models?

Yes. You can register your own Google Gemini API key using `vibiz ai keys set google`. Eligible models like `vibiz/image` (Nano Banana 2) will then run against your Google account at no charge on thelastapi, while other models continue billing to your thelastapi balance.

---

Published 2026-11-15 · https://thelastapi.dev/blog/one-api-image-video-voice-models
