SilentAPI Logo SilentAPI

Media and OCR

Image tools, file tools, OCR, 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.

LimitValue
Decoded input for file tools and OCR20 MB
Image size for image conversion and SilentAPI image OCR12,000 pixels on each side
Selected PDF pages for OCR50 pages
Selected pages for Mistral OCR 4.11,000 pages
Multipart file size25 MB per file
Multipart file count8 files
Multipart total size50 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 ] page or [ 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\"}"
NameTypeDefaultRule
filefile or data URLrequiredJPEG, PNG, WebP, GIF, or HEIC input
formatstringwebpwebp, jpeg, png, or avif
qualityinteger751 to 100
losslessbooleanfalsePNG or WebP only. WebP forces quality 100.
stripMetadatabooleantrueRemove metadata when supported
maxWidthintegernone1 to 12,000 pixels
maxHeightintegernone1 to 12,000 pixels
response_formatstringbinarybinary 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 ] 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\"}"
NameTypeDefaultRule
filefile or data URLrequiredJPEG, PNG, WebP, GIF, or HEIC input
formatstringrequiredwebp, jpeg, png, or avif
qualityinteger82 for WebP, JPEG, and AVIF1 to 100. PNG leaves quality unset by default.
losslessbooleanfalseNot available for jpeg or avif
stripMetadatabooleantrueRemove metadata when supported
maxWidthintegernone1 to 12,000 pixels
maxHeightintegernone1 to 12,000 pixels
response_formatstringbinarybinary 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 ] 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\"}"
NameTypeDefaultRule
filefile or data URLrequiredJPEG, PNG, WebP, GIF, HEIC, PDF, DOCX, XLSX, or PPTX
filenamestringfileName for JSON file input
response_formatstringbinarybinary 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 ] page for current prices.

OCR

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

ModelInputPage limit
silentapi-ocrImages and PDF files. English OCR data.50 selected pages
vision-document-text-detectionOne image per call (Google Cloud Vision Document Text Detection). No PDF input.One image
mistral-ocr-4-1Images and documents1,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.

NameTypeDefaultRule
filefile or data URLrequiredJPEG, PNG, WebP, GIF, HEIC, or PDF
modelstringsilentapi-ocrsilentapi-ocr
outputFormatstringtexttext or blocks
pagesarray or rangeallUp to 50 pages, for example [1,2] or 1-3
Page selectionExampleRule
Range1-3Page 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:

ValueMeaning
text-layerThe PDF page has enough embedded text. SilentAPI returns that text.
ocrThe page is scanned or is an image. SilentAPI reads it with OCR.

Blocks can include these fields:

FieldTypeMeaning
textstringText of the block
bboxobjectBlock box with x0, y0, x1, and y1
confidencenumberRecognition confidence

Charges use pages, OCR pages, and image transforms. See the [ 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}"
NameTypeDefaultRule
filefile or data URLrequiredImage or document input
modelstringsilentapi-ocrSet to mistral-ocr-4-1
pagesarray or rangeallValid pages, with up to 1,000 selected by the API
outputFormatstringtexttext, markdown, or blocks
table_formatstringprovider defaultmarkdown or html
extract_headerbooleanprovider defaultRequest document headers when true
extract_footerbooleanprovider defaultRequest document footers when true
include_image_base64booleanprovider defaultRequest page images when true
confidence_scores_granularitystringnonepage, block, or word
document_annotation_formatobjectnonetype: json_schema, with json_schema.schema
bbox_annotation_formatobjectnonetype: json_schema, with json_schema.schema
document_annotation_promptstringnoneRequires 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:

FieldMeaning
pagePage number, starting at 1
markdownPage text in Markdown. Mistral OCR returns it even when you select text.
blocksText blocks. Select blocks to request them.
tablesTables on the page
imagesImages on the page, with id, bbox, image_base64, and image_annotation when present
headerPage header
footerPage footer
dimensionsPage dimensions
confidence_scoresConfidence 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 ] 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.

NameTypeDefaultRule
modelstringmistral-moderation-2603mistral-moderation-2603
inputstring or arrayrequired without messagesUp to 32 nonempty text values and 400,000 combined characters
messagesarraynoneNonempty 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 ] and the [ 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"
NameTypeDefaultRule
modelstringlyria-3-cliplyria-3-pro or lyria-3-clip
promptstringrequiredNonempty music description. input is an alternative.
imagedata URL, HTTPS URL, or filenoneOptional image input
image_urldata URL or HTTPS URLnoneOptional image input
response_formatstringmodel defaultwav, pcm, flac, mp3, opus, or aac. See 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.

LimitValue
Upload file size25 MB per file
Upload file count8 files. Only the first image file is used.
Upload total size50 MB
JSON data URL input50 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 ] page for current prices.

Parameter Handling

Each model accepts its own set of options. When you send a valid OpenAI style option that the model does not support, SilentAPI changes it instead of failing the request. It converts the output, uses the closest value the model supports, or leaves out an option that has no effect. SilentAPI does not send a value that the model rejects.

ActionMeaning
ConvertSilentAPI changes the output, for example PCM audio to a WAV file.
Closest valueSilentAPI uses the nearest supported value, for example 1792x1024 becomes the 16:9 aspect ratio.
IgnoreSilentAPI does not send the option, because the model has no such control.

Audio responses have the X-SilentAPI-Format header. It shows the real format of the audio, for example wav. The Content-Type header matches it.

Speech

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

ModelFormats you getOther requests
voxtral-mini-ttsmp3, wav, pcmopus and aac return mp3. flac returns wav.
gemini-3.8-flash-ttswav, pcmmp3, opus, aac, and flac return wav.
gemini-3.8-flash-lite-ttswav, pcmmp3, 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","input":"Your request is ready.","voice":"en_paul_neutral","response_format":"wav"}' \
  -D headers.txt \
  -o speech.wav
OptionHandling
voiceVoice names match without case. An unknown voice, for example an OpenAI voice name such as alloy, uses the model default voice.
speedSent 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.
ModelDefault voiceVoices
voxtral-mini-ttsen_paul_neutralen_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-ttsKoreZephyr, 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

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_formatResult
jsonDefault. JSON with text and the cost fields.
textPlain text
verbose_jsonJSON with task, language when known, duration, text, and segments. words appears when the model gives word times.
srtSubRip subtitles
vttWebVTT subtitles

Voxtral Mini Transcribe gives a time for each segment. Gemini 3.5 Transcribe gives segment times for some requests. 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" \
  -F "response_format=srt"

Image Generation

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

OptionHandling
sizeSilentAPI uses the closest aspect ratio and image size the model supports. For example, 1792x1024 becomes 16:9 at 1K on grok-imagine-image-2.0.
aspect_ratioUsed when the model supports it. Otherwise SilentAPI uses the closest supported ratio. aspect_ratio wins over size.
image_size or resolution0.5K, 1K, 2K, or 4K. SilentAPI uses the closest size the model supports. It wins over the size in size.
n1 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_formatb64_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_formatpng, 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, styleIgnored by models without these controls
ModelAspect ratiosImage sizes
gemini-3.1-flash-image1: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:10.5K, 1K, 2K, 4K
gemini-3.1-flash-lite-image1:1, 2:3, 3:2, 3:4, 4:3, 4:5, 5:4, 9:16, 16:9, 21:91K
grok-imagine-image-2.01: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:11K, 2K

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

OptionHandling
sizeA 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 resolutionWhen 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.
qualityauto, low, medium, or high. standard becomes medium. hd, xhigh, and max become high.
backgroundauto, transparent, or opaque. Use png or webp for a transparent background.
output_formatThe model makes png, jpeg, and webp directly, at no extra cost. Other formats use the conversion above.
output_compression0 to 100, for jpeg and webp
seedAn integer. The same seed and options give a similar image, but the result can change.
Input imagesUp to 16 images from image, images, image_url, or uploaded files guide the new image.

Music

response_formatResult
wavWAV audio
pcmRaw PCM from the WAV output. mime_type gives the sample rate and channels.
flacWAV audio, the closest lossless format
mp3, opus, aac, or absentThe 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

Video requests never fail because an option is outside what a model offers. SilentAPI uses the closest supported value:

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.

ModelFull sizedimensions
text-embedding-3-small1,536Sent to the model
text-embedding-3-large3,072Sent to the model
gemini-embedding-23,072Sent to the model
qwen3-embedding-8b4,096Sent to the model
codestral-embed-25051,536SilentAPI keeps the first values and scales the vector to length 1. This is the shortening method for this model family.
mistral-embed-23121,024Not 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.