# Media and OCR

Image tools, file tools, OCR, Google Cloud Vision, moderation, music, and parameter handling

File endpoints accept a multipart file upload or a JSON data URL. Moderation accepts text or chat messages. Music accepts a prompt and an optional image. Authenticate with your SilentAPI API key.

| Limit | Value |
| --- | --- |
| Decoded input for file tools and OCR | 20 MB |
| Image size for image conversion and SilentAPI image OCR | 12,000 pixels on each side |
| Selected PDF pages for OCR | 50 pages |
| Selected pages for Mistral OCR 4.1 | 1,000 pages |
| Multipart file size | 25 MB per file |
| Multipart file count | 8 files |
| Multipart total size | 50 MB |

Response values below are examples, not current prices. Base64 response strings show only part of the output. The `cost` field is in credits. See the [[ Services ]](https://silentapi.com/services) page or [[ Calculator ]](https://silentapi.com/calculator) for current prices.

For JSON file requests, set `file` to a complete data URL. The examples use a variable with a small PNG:

```
IMAGE_DATA='data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR42mP8/x8AAwMCAO+aBZkAAAAASUVORK5CYII='
```

## Image Compress

`POST /v1/images/compress` creates a smaller image and removes metadata by default.

```
curl https://api.silentapi.com/v1/images/compress \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -F "file=@photo.png" \
  -F "format=webp" \
  -F "quality=75" \
  -F "response_format=b64_json"
```

```
curl https://api.silentapi.com/v1/images/compress \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d "{\"file\":\"$IMAGE_DATA\",\"format\":\"webp\",\"quality\":75,\"response_format\":\"b64_json\"}"
```

| Name | Type | Default | Rule |
| --- | --- | --- | --- |
| file | file or data URL | required | JPEG, PNG, WebP, GIF, or HEIC input |
| format | string | webp | webp, jpeg, png, or avif |
| quality | integer | 75 | 1 to 100 |
| lossless | boolean | false | PNG or WebP only. WebP forces quality 100. |
| stripMetadata | boolean | true | Remove metadata when supported |
| maxWidth | integer | none | 1 to 12,000 pixels |
| maxHeight | integer | none | 1 to 12,000 pixels |
| response_format | string | binary | binary or b64_json |

```
{
  "object": "image",
  "data": [{ "b64_json": "UklGRg==", "mime_type": "image/webp" }],
  "width": 1600,
  "height": 900,
  "bytes_in": 842100,
  "bytes_out": 126400,
  "cost": 0.12
}
```

The default response is binary. Use `-o output.webp` with curl to save it. Read `X-SilentAPI-Cost` for the charge. Compression is charged per call. Input must fit the 20 MB and image dimension limits. See the [[ Services ]](https://silentapi.com/services) page for current prices.

## Image Convert

`POST /v1/images/convert` changes an image to a selected format. The request fields and response shape match Image Compress. The `format` field is required.

```
curl https://api.silentapi.com/v1/images/convert \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -F "file=@photo.png" \
  -F "format=jpeg" \
  -F "quality=82" \
  -F "response_format=b64_json"
```

```
curl https://api.silentapi.com/v1/images/convert \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d "{\"file\":\"$IMAGE_DATA\",\"format\":\"jpeg\",\"quality\":70,\"response_format\":\"b64_json\"}"
```

| Name | Type | Default | Rule |
| --- | --- | --- | --- |
| file | file or data URL | required | JPEG, PNG, WebP, GIF, or HEIC input |
| format | string | required | webp, jpeg, png, or avif |
| quality | integer | 82 for WebP, JPEG, and AVIF | 1 to 100. PNG leaves quality unset by default. |
| lossless | boolean | false | Not available for jpeg or avif |
| stripMetadata | boolean | true | Remove metadata when supported |
| maxWidth | integer | none | 1 to 12,000 pixels |
| maxHeight | integer | none | 1 to 12,000 pixels |
| response_format | string | binary | binary or b64_json |

```
{
  "object": "image",
  "data": [{ "b64_json": "/9j/", "mime_type": "image/jpeg" }],
  "width": 1200,
  "height": 800,
  "bytes_in": 520000,
  "bytes_out": 98000,
  "cost": 0.12
}
```

Conversion is charged per call. Input must fit the 20 MB and image dimension limits. See the [[ Services ]](https://silentapi.com/services) page for current prices.

## Remove File Metadata

`POST /v1/files/metadata/remove` removes metadata from images, PDF files, and Office files.

```
curl https://api.silentapi.com/v1/files/metadata/remove \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -F "file=@document.pdf" \
  -F "response_format=b64_json"
```

```
curl https://api.silentapi.com/v1/files/metadata/remove \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d "{\"file\":\"$IMAGE_DATA\",\"response_format\":\"b64_json\"}"
```

| Name | Type | Default | Rule |
| --- | --- | --- | --- |
| file | file or data URL | required | JPEG, PNG, WebP, GIF, HEIC, PDF, DOCX, XLSX, or PPTX |
| filename | string | file | Name for JSON file input |
| response_format | string | binary | binary or b64_json |

```
{
  "object": "file",
  "data": [{ "b64_json": "JVBERi0=", "mime_type": "application/pdf" }],
  "removed": ["document-properties", "xmp"],
  "cost": 0.02
}
```

Input is limited to 20 MB. Encrypted PDF files are not supported. JPEG orientation and image color profiles can remain. HEIC input becomes JPEG. Office processing removes document properties and some author fields. It does not remove document content.

Metadata removal is charged per call. A file conversion can add a transform charge. See the [[ Services ]](https://silentapi.com/services) page for current prices.

## OCR

`POST /v1/ocr` reads text from images and documents. Set `model` to one of these values:

| Model | Input | Page limit |
| --- | --- | --- |
| silentapi-ocr | Images and PDF files. English OCR data. | 50 selected pages |
| vision-document-text-detection | One image per call (Google Cloud Vision Document Text Detection). No PDF input. | One image |
| mistral-ocr-4-1 | Images and documents | 1,000 selected pages |

```
curl https://api.silentapi.com/v1/ocr \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -F "file=@scan.pdf" \
  -F "model=silentapi-ocr" \
  -F "outputFormat=blocks" \
  -F "pages=1-3"
```

```
curl https://api.silentapi.com/v1/ocr \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d "{\"file\":\"$IMAGE_DATA\",\"model\":\"silentapi-ocr\",\"outputFormat\":\"text\"}"
```

### OCR

OCR supports images and PDF files. It uses English OCR data and allows up to 50 selected pages.

| Name | Type | Default | Rule |
| --- | --- | --- | --- |
| file | file or data URL | required | JPEG, PNG, WebP, GIF, HEIC, or PDF |
| model | string | silentapi-ocr | silentapi-ocr |
| outputFormat | string | text | text or blocks |
| pages | array or range | all | Up to 50 pages, for example [1,2] or 1-3 |

| Page selection | Example | Rule |
| --- | --- | --- |
| Range | `1-3` | Page numbers start at 1 |
| Array | `[1,3]` | Each page number must be unique |

Selected pages must exist. Use `output_format` as an alternative to `outputFormat`.

```
{
  "object": "ocr",
  "model": "silentapi-ocr",
  "pages": [{ "page": 1, "text": "Example text", "source": "ocr" }],
  "usage": { "pages": 1, "ocrPages": 1, "cpuMs": 215 },
  "cost": 0.17
}
```

The `source` field shows how SilentAPI read each page:

| Value | Meaning |
| --- | --- |
| text-layer | The PDF page has enough embedded text. SilentAPI returns that text. |
| ocr | The page is scanned or is an image. SilentAPI reads it with OCR. |

Blocks can include these fields:

| Field | Type | Meaning |
| --- | --- | --- |
| text | string | Text of the block |
| bbox | object | Block box with `x0`, `y0`, `x1`, and `y1` |
| confidence | number | Recognition confidence |

Charges use pages, OCR pages, and image transforms. See the [[ Services ]](https://silentapi.com/services) page for current prices.

### Google Cloud Vision Document Text Detection

Document Text Detection is Google Cloud Vision's text reader for dense text and documents. On `POST /v1/ocr`, set `model` to `vision-document-text-detection` to get the same OCR response shape as the other models. It reads one image per call (JPEG, PNG, WebP or GIF, up to 20 MB); PDF input is not supported. The older model name `google-ocr` still works. For the full Google Cloud Vision response, call `POST /v1/google/vision-document-text-detection`, or `vision-text-detection` for short text in photos.

```
curl https://api.silentapi.com/v1/ocr \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -F "file=@scan.png" \
  -F "model=vision-document-text-detection" \
  -F "outputFormat=blocks"
```

### Mistral OCR 4.1

Mistral OCR 4.1 reads images and documents. Input is limited to 20 MB. Page selection uses numbers from 1 to 1,000. Provider limits also apply.

```
curl https://api.silentapi.com/v1/ocr \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -F "file=@scan.pdf" \
  -F "model=mistral-ocr-4-1" \
  -F "pages=1-3" \
  -F "outputFormat=markdown" \
  -F "table_format=markdown"
```

```
curl https://api.silentapi.com/v1/ocr \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d "{\"file\":\"$IMAGE_DATA\",\"model\":\"mistral-ocr-4-1\",\"outputFormat\":\"blocks\",\"include_image_base64\":false}"
```

| Name | Type | Default | Rule |
| --- | --- | --- | --- |
| file | file or data URL | required | Image or document input |
| model | string | silentapi-ocr | Set to mistral-ocr-4-1 |
| pages | array or range | all | Valid pages, with up to 1,000 selected by the API |
| outputFormat | string | text | text, markdown, or blocks |
| table_format | string | provider default | markdown or html |
| extract_header | boolean | provider default | Request document headers when true |
| extract_footer | boolean | provider default | Request document footers when true |
| include_image_base64 | boolean | provider default | Request page images when true |
| confidence_scores_granularity | string | none | page, block, or word |
| document_annotation_format | object | none | type: json_schema, with json_schema.schema |
| bbox_annotation_format | object | none | type: json_schema, with json_schema.schema |
| document_annotation_prompt | string | none | Requires document_annotation_format, maximum 4,000 characters |

```
{
  "object": "ocr",
  "model": "mistral-ocr-4-1",
  "pages": [{ "page": 1, "markdown": "# Example document", "images": [] }],
  "usage": { "pages": 1 },
  "cost": 0.8
}
```

Each page has `page` and `markdown`. The other fields appear when the response includes them:

| Field | Meaning |
| --- | --- |
| page | Page number, starting at 1 |
| markdown | Page text in Markdown. Mistral OCR returns it even when you select `text`. |
| blocks | Text blocks. Select `blocks` to request them. |
| tables | Tables on the page |
| images | Images on the page, with `id`, `bbox`, `image_base64`, and `image_annotation` when present |
| header | Page header |
| footer | Page footer |
| dimensions | Page dimensions |
| confidence_scores | Confidence scores |

A `document_annotation` field can appear at the top level of the response.

Mistral OCR is charged per OCR page. Annotation options use the annotated page rate. See the [[ Services ]](https://silentapi.com/services) page for current prices.

## Google Cloud Vision

`POST /v1/google_cloud/<model>` runs one Google Cloud Vision feature on one image and returns the full Google Cloud Vision result. Send the image as a multipart `image` file, or as JSON with `image` set to a data URL or an image URL. Images can be JPEG, PNG, WebP, or GIF, up to 20 MB.

| Model | What it returns |
| --- | --- |
| vision-label-detection | Labels for objects, scenes, and activities, with scores |
| vision-text-detection | Short text in photos, such as signs and labels, with word boxes |
| vision-document-text-detection | Dense text and documents, with pages, blocks, paragraphs, and words |
| vision-face-detection | Face boxes, landmarks, and likelihoods for expressions. It does not identify people. |
| vision-landmark-detection | Known landmarks, with location coordinates |
| vision-logo-detection | Product and brand logos, with boxes |
| vision-safe-search-detection | Likelihood of adult, violent, medical, spoof, and racy content |
| vision-image-properties | Dominant colors and crop hints |
| vision-object-localization | Objects with names, scores, and normalized boxes |
| vision-web-detection | Web entities, matching images, and pages that use the image |

```
curl https://api.silentapi.com/v1/google_cloud/vision-label-detection \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -F "image=@photo.jpg" \
  -F "maxResults=5"
```

```
curl https://api.silentapi.com/v1/google_cloud/vision-object-localization \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d "{\"image\":\"$IMAGE_DATA\",\"maxResults\":10}"
```

| Name | Type | Default | Rule |
| --- | --- | --- | --- |
| image | file, data URL, or URL | required | One image. `image_url` and `url` are also accepted. |
| maxResults | integer | 10 | 1 to 50 results for features that return a list |

```
{
  "response": {
    "labelAnnotations": [
      { "mid": "/m/01bqvp", "description": "Sky", "score": 0.97, "topicality": 0.97 },
      { "mid": "/m/0838f", "description": "Water", "score": 0.94, "topicality": 0.94 }
    ]
  },
  "cost": 0.15
}
```

The `response` field holds the Google Cloud Vision result for the feature, such as `labelAnnotations`, `textAnnotations`, `fullTextAnnotation`, `faceAnnotations`, `landmarkAnnotations`, `logoAnnotations`, `safeSearchAnnotation`, `imagePropertiesAnnotation`, `localizedObjectAnnotations`, or `webDetection`. Each call is charged once. See the [[ Services ]](https://silentapi.com/services) page for current prices.

## Moderation

`POST /v1/moderations` checks text or chat messages with `mistral-moderation-2603`, also named Mistral Moderation 2.

```
curl https://api.silentapi.com/v1/moderations \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"model":"mistral-moderation-2603","input":["Example text to check"]}'
```

```
curl https://api.silentapi.com/v1/moderations \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -F "model=mistral-moderation-2603" \
  -F "input=Example text to check"
```

Moderation does not accept a file upload or data URL as media input. Use `input` for text, or `messages` for chat. When both exist, `messages` is used.

| Name | Type | Default | Rule |
| --- | --- | --- | --- |
| model | string | mistral-moderation-2603 | mistral-moderation-2603 |
| input | string or array | required without messages | Up to 32 nonempty text values and 400,000 combined characters |
| messages | array | none | Nonempty array. Roles: system, user, assistant, tool. Content must be text. Maximum 400,000 combined characters. |

```
{
  "id": "modr-12345678-1234-4234-8234-123456789012",
  "model": "mistral-moderation-2603",
  "results": [{ "flagged": false, "categories": { "hate": false }, "category_scores": { "hate": 0.01 } }],
  "cost": 0.0203
}
```

Category names depend on the model response. Successful moderation calls have a call charge and an input token charge. Shared service and account media limits apply. See [[ Rate Limits ]](https://silentapi.com/docs/rate-limits) and the [[ Services ]](https://silentapi.com/services) page for current prices.

## Music

`POST /v1/audio/music` creates music with `lyria-3-pro` or `lyria-3-clip`. The default is `lyria-3-clip`.

```
curl https://api.silentapi.com/v1/audio/music \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d "{\"model\":\"lyria-3-clip\",\"prompt\":\"A quiet electronic morning\",\"image\":\"$IMAGE_DATA\",\"response_format\":\"wav\"}"
```

```
curl https://api.silentapi.com/v1/audio/music \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -F "prompt=A quiet electronic morning" \
  -F "model=lyria-3-clip" \
  -F "image=@reference.png"
```

| Name | Type | Default | Rule |
| --- | --- | --- | --- |
| model | string | lyria-3-clip | lyria-3-pro or lyria-3-clip |
| prompt | string | required | Nonempty music description. input is an alternative. |
| image | data URL, HTTPS URL, or file | none | Optional image input |
| image_url | data URL or HTTPS URL | none | Optional image input |
| response_format | string | model default | wav, pcm, flac, mp3, opus, or aac. See [Music options](#music-options). |

```
{
  "object": "music",
  "created": 1770000000,
  "data": [{ "b64_json": "UklGRg==", "mime_type": "audio/wav", "lyrics": null }],
  "silentapi": { "cost": 4, "fallback": null, "model": "lyria-3-clip", "model_name": "Lyria 3 Clip" }
}
```

Music always returns JSON with base64 audio. The output media type can depend on the route that served the request. Lyrics can be `null`. There is no binary response option.

| Limit | Value |
| --- | --- |
| Upload file size | 25 MB per file |
| Upload file count | 8 files. Only the first image file is used. |
| Upload total size | 50 MB |
| JSON data URL input | 50 MB decoded, the standard media limit |

The file tool dimension limit does not apply to this endpoint. Music is charged per generation. See the [[ Services ]](https://silentapi.com/services) page for current prices.

## Parameter Handling

Each model accepts its own set of options. SilentAPI uses supported values, converts output where a conversion is available, or leaves out controls the model does not use. A recoverable option should not stop an otherwise valid request. Corrupt files, missing required input and formats that cannot be read still return an error. SilentAPI does not replace unsupported image or audio content with invented text.

| Action | Meaning |
| --- | --- |
| Convert | SilentAPI changes the output, for example PCM audio to a WAV file. |
| Closest value | SilentAPI uses the nearest supported value, for example 1792x1024 becomes the 16:9 aspect ratio. |
| Ignore | SilentAPI does not send the option, because the model has no such control. |

Audio responses have an `X-SilentAPI-Format` header showing the actual format, such as `wav`. `Content-Type` matches the returned bytes. Common MIME and filename aliases are accepted, including `audio/wav`, `audio/mpeg` and `.MP3`. If a requested format changes, `X-SilentAPI-Notice` says, for example, `Requested opus. Returned mp3.` An unknown format uses the model default and returns a notice. Compressed audio is not renamed to pretend a conversion took place.

### Speech

`POST /v1/audio/speech` accepts `response_format` values `mp3`, `wav`, `opus`, `aac`, `flac`, and `pcm` on every speech model.

| Model | Formats you get | Other requests |
| --- | --- | --- |
| voxtral-mini-tts-3.0 | mp3, wav, pcm | opus and aac return mp3. flac returns wav. |
| gemini-3.8-flash-tts | wav, pcm | mp3, opus, aac, and flac return wav. |
| gemini-3.8-flash-lite-tts | wav, pcm | mp3, opus, aac, and flac return wav. |

When you do not send `response_format`, Voxtral returns mp3 and Gemini returns wav. SilentAPI makes WAV files from PCM audio by adding a WAV header. The audio does not change. PCM output is raw signed 16 bit samples, little endian, mono. The `Content-Type` gives the sample rate, for example `audio/pcm;rate=24000;channels=1`.

```
curl https://api.silentapi.com/v1/audio/speech \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"model":"voxtral-mini-tts-3.0","input":"Your request is ready.","voice":"en_paul_neutral","response_format":"wav"}' \
  -D headers.txt \
  -o speech.wav
```

| Option | Handling |
| --- | --- |
| voice | Voice names match without case. An unknown voice, for example an OpenAI voice name such as `alloy`, uses the model default voice. |
| speed | Sent as a number from 0.25 to 4. SilentAPI changes other values to the nearest end of this range. Models without speed control ignore it. |

| Model | Default voice | Voices |
| --- | --- | --- |
| voxtral-mini-tts-3.0 | en_paul_neutral | en_paul_neutral, en_paul_happy, en_paul_sad, en_paul_frustrated, en_paul_excited, en_paul_confident, en_paul_cheerful, en_paul_angry, gb_oliver_neutral, gb_oliver_sad, gb_oliver_excited, gb_oliver_curious, gb_oliver_confident, gb_oliver_cheerful, gb_oliver_angry, gb_jane_neutral, gb_jane_sarcasm, gb_jane_confused, gb_jane_shameful, gb_jane_sad, gb_jane_jealousy, gb_jane_frustrated, gb_jane_curious, gb_jane_confident, fr_marie_neutral, fr_marie_sad, fr_marie_happy, fr_marie_excited, fr_marie_curious, fr_marie_angry |
| gemini-3.8-flash-tts, gemini-3.8-flash-lite-tts | Kore | Zephyr, Puck, Charon, Kore, Fenrir, Leda, Orus, Aoede, Callirrhoe, Autonoe, Enceladus, Iapetus, Umbriel, Algieba, Despina, Erinome, Algenib, Rasalgethi, Laomedeia, Achernar, Alnilam, Schedar, Gacrux, Pulcherrima, Achird, Zubenelgenubi, Vindemiatrix, Sadachbia, Sadaltager, Sulafat |

### Transcription

Voxtral 3 models are `voxtral-small-transcribe-3.0` and `voxtral-mini-transcribe-3.0`. Voxtral 3 speech and transcription use End-to-end ZDR routes. The earlier Voxtral Mini Transcribe and Mini TTS models have been removed. `gemini-3.5-transcribe` remains available with SilentAPI protected privacy.

`POST /v1/audio/transcriptions` accepts every `response_format` below on every speech to text model. SilentAPI builds the requested shape from the model output.

| response_format | Result |
| --- | --- |
| json | Default. JSON with `text` and the cost fields. |
| text | Plain text |
| verbose_json | JSON with `task`, `language` when known, `duration`, `text`, and `segments`. `words` appears when the model gives word times. |
| srt | SubRip subtitles |
| vtt | WebVTT subtitles |

Segment times are used when the model supplies them. GPT Transcribe gives text only. When the model gives no times, SilentAPI returns one segment or one subtitle for the full audio. Its end time is the audio length. The length is exact for WAV files and estimated from the file size for other formats.

The `text`, `srt`, and `vtt` formats return no JSON. Read the charge in the `X-SilentAPI-Cost` header. An unknown `response_format` returns `json`. SilentAPI sends `language`, `prompt`, and `temperature` to the model when you send them.

```
curl https://api.silentapi.com/v1/audio/transcriptions \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -F "file=@recording.mp3" \
  -F "model=voxtral-mini-transcribe-3.0" \
  -F "response_format=srt"
```

### Image Generation

`POST /v1/images/generations` and `POST /v1/images/edits` change these options to fit the model:

| Option | Handling |
| --- | --- |
| size | SilentAPI uses the closest aspect ratio and image size the model supports. For example, `1792x1024` becomes 16:9 at 1.5K on `grok-imagine-image-2.0`. |
| aspect_ratio | Used when the model supports it. Otherwise SilentAPI uses the closest supported ratio. `aspect_ratio` wins over `size`. |
| image_size or resolution | 0.5K, 1K, 1.5K, 2K, or 4K. SilentAPI uses the closest size the model supports. It wins over the size in `size`. |
| n | 1 to 4. A model that makes one image per call gets one call for each image. If a later call fails, you get the images that were made and pay only for them. |
| response_format | `b64_json` is the default. With `url`, you get a data URL, for example `data:image/png;base64,...`, because the models return image data and not a link. |
| output_format | png, jpeg, or webp. When the model returns another format, SilentAPI converts the image. Each converted image adds the Image Convert price. `output_compression` sets the quality for jpeg and webp. If a conversion fails, you get the original image. `mime_type` shows the real format. |
| quality, background, style | Ignored by models without these controls |

| Model | Aspect ratios | Image sizes |
| --- | --- | --- |
| gemini-nano-banana-2.1 | 1:1, 2:3, 3:2, 3:4, 4:3, 4:5, 5:4, 9:16, 16:9, 21:9 | 1K, 2K, 4K |
| gemini-3.1-flash-image | 1:1, 2:3, 3:2, 3:4, 4:3, 4:5, 5:4, 9:16, 16:9, 21:9, 1:4, 4:1, 1:8, 8:1 | 0.5K, 1K, 2K, 4K |
| gemini-3.1-flash-lite-image | 1:1, 2:3, 3:2, 3:4, 4:3, 4:5, 5:4, 9:16, 16:9, 21:9 | 1K |
| grok-imagine-image-2.0 | 1:1, 3:4, 4:3, 9:16, 16:9, 2:3, 3:2, 9:19.5, 19.5:9, 9:20, 20:9, 1:2, 2:1 | 1K, 1.5K, 2K |

Nano Banana 2.1, Nano Banana 2, and Nano Banana 2 Lite use End-to-end ZDR routes.

Grok Imagine Image 2 defaults to 1K at low quality. It supports low and medium quality. The charge uses the selected quality and resolution. Each input image is charged again for each generated image that succeeds. Failed generations are not charged.

GPT Image models make all `n` images in one call and change these options:

| Option | Handling |
| --- | --- |
| size | A pixel size such as `1536x1024` goes to the model as you send it. The model uses the closest size it supports. A size tier such as `2K` sets the image size. |
| aspect_ratio, image_size, or resolution | When you send one of these with a pixel size, SilentAPI sends the closest aspect ratio and the closest image size (512, 768, 1K, 1.5K, 2K, or 4K) instead of the pixel size. |
| quality | auto, low, medium, or high. `standard` becomes medium. `hd`, `xhigh`, and `max` become high. |
| background | auto, transparent, or opaque. Use png or webp for a transparent background. |
| output_format | The model makes png, jpeg, and webp directly, at no extra cost. Other formats use the conversion above. |
| output_compression | 0 to 100, for jpeg and webp |
| seed | An integer. The same seed and options give a similar image, but the result can change. |
| Input images | Up to 16 images from `image`, `images`, `image_url`, or uploaded files guide the new image. |

### Music

| response_format | Result |
| --- | --- |
| wav | WAV audio |
| pcm | Raw PCM from the WAV output. `mime_type` gives the sample rate and channels. |
| flac | WAV audio, the closest lossless format |
| mp3, opus, aac, or absent | The model default format, usually mp3 |

The `X-SilentAPI-Format` header and `mime_type` show the real format. Music models have no length control, so SilentAPI does not send `duration` or `seconds`. Lyria 3 Clip makes short clips. For Lyria 3 Pro, write the length you want in the prompt.

### Video

`grok-imagine-video-1.5-lite` supports 1 to 15 seconds at 480p, 720p, or 1080p. The earlier `grok-imagine-video` remains available at 480p and 720p. Both are SilentAPI protected. Prices depend on resolution and input images.

Video and audio input files are not supported. Requests containing video or audio inputs return HTTP 400 before the request reaches the model. For supported output options, SilentAPI uses the closest supported value:

- `duration` (or `seconds`) becomes a whole number of seconds inside the model's range, for example 30 becomes 15 on a model that allows 1 to 15 seconds.

- `resolution` (or `size` as `WIDTHxHEIGHT`) uses the nearest supported resolution, for example 1080p becomes 720p on a model that stops at 720p.

- `aspect_ratio` uses the nearest supported ratio; a `size` such as `1080x1920` also sets the ratio.

- The credit hold and the charge use the same adjusted values, so you pay for the video you get.

#### Webhooks

A video job can take several minutes. Instead of polling `GET /v1/videos/{id}`, send `webhook_url` with the job, and we send a `POST` to that address when the job completes or fails. The address must be a public `https` URL. Any other address returns HTTP 400 before the job starts.

The body is the same JSON object that `GET /v1/videos/{id}` returns. The `X-SilentAPI-Event` header is `video.completed` or `video.failed`. Your server has 15 seconds to answer, and a failed delivery is not sent again, so keep polling as a fallback for important jobs.

```
curl https://api.silentapi.com/v1/videos \
  -H "Authorization: Bearer $SILENTAPI_KEY" \
  -H "Content-Type: application/json" \
  -d '{"model": "veo-3.1-fast", "prompt": "A quiet lake at dawn", "duration": 6, "webhook_url": "https://example.com/hooks/video"}'
```

### Embeddings

`POST /v1/embeddings` accepts `encoding_format` `float` (default) or `base64` on every model. SilentAPI gets the float vector and makes the base64 string itself. The string holds 32 bit floats, little endian, the same layout as the OpenAI API.

| Model | Full size | dimensions |
| --- | --- | --- |
| text-embedding-3-small | 1,536 | Sent to the model |
| text-embedding-3-large | 3,072 | Sent to the model |
| gemini-embedding-2 | 3,072 | Sent to the model |
| qwen3-embedding-8b | 4,096 | Sent to the model |
| codestral-embed-2505 | 1,536 | SilentAPI keeps the first values and scales the vector to length 1. This is the shortening method for this model family. |
| mistral-embed-2312 | 1,024 | Not supported. You get the full vector. |

A `dimensions` value that is equal to or larger than the full size returns the full vector. A value that is not a whole number above 0 is ignored.

Source: https://silentapi.com/docs/media
