SilentAPI 標誌 SilentAPI

媒體與 OCR

圖片工具、檔案工具、OCR、Google Cloud Vision、審核、音樂與參數處理

檔案端點接受 multipart 檔案上傳或 JSON data URL。審核接受文字或聊天訊息。音樂接受提示詞與選填圖片。請以你的 SilentAPI API 金鑰驗證。

上限值
檔案工具與 OCR 的解碼後輸入20 MB
圖片轉換與 SilentAPI 圖片 OCR 的圖片大小每邊 12,000 像素
OCR 選取的 PDF 頁面50 頁
Mistral OCR 4.1 選取的頁面1,000 頁
Multipart 檔案大小每個檔案 25 MB
Multipart 檔案數量8 個檔案
Multipart 總大小50 MB

以下回應值僅為範例,並非現行價格。Base64 回應字串僅顯示部分輸出。cost 欄位以額度計。現行價格請見 [ Services ] 頁面或 [ 計算機 ]。

JSON 檔案請求請將 file 設為完整的 data URL。範例使用含小型 PNG 的變數:

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

圖片壓縮

POST /v1/images/compress 會產生較小的圖片,預設並移除詮釋資料。

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\"}"
名稱類型預設值規則
file檔案或 data URL必填JPEG、PNG、WebP、GIF 或 HEIC 輸入
formatstringwebpwebp、jpeg、png 或 avif
qualityinteger751 至 100
losslessbooleanfalse僅限 PNG 或 WebP。WebP 會強制 quality 為 100。
stripMetadatabooleantrue在支援時移除詮釋資料
maxWidthintegernone1 至 12,000 像素
maxHeightintegernone1 至 12,000 像素
response_formatstringbinarybinary 或 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
}

預設回應為 binary。搭配 curl 使用 -o output.webp 儲存。費用請看 X-SilentAPI-Cost。壓縮按次計費。輸入須符合 20 MB 與圖片尺寸上限。現行價格請見 [ Services ] 頁面。

圖片轉換

POST /v1/images/convert 可將圖片轉為所選格式。請求欄位與回應結構與圖片壓縮相同。format 欄位為必填。

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\"}"
名稱類型預設值規則
file檔案或 data URL必填JPEG、PNG、WebP、GIF 或 HEIC 輸入
formatstring必填webp、jpeg、png 或 avif
qualityintegerWebP、JPEG 與 AVIF 適用 821 至 100。PNG 預設不設定 quality。
losslessbooleanfalsejpeg 或 avif 不適用
stripMetadatabooleantrue在支援時移除詮釋資料
maxWidthintegernone1 至 12,000 像素
maxHeightintegernone1 至 12,000 像素
response_formatstringbinarybinary 或 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
}

轉換按次計費。輸入須符合 20 MB 與圖片尺寸上限。現行價格請見 [ Services ] 頁面。

移除檔案詮釋資料

POST /v1/files/metadata/remove 可移除圖片、PDF 檔案與 Office 檔案的詮釋資料。

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\"}"
名稱類型預設值規則
file檔案或 data URL必填JPEG、PNG、WebP、GIF、HEIC、PDF、DOCX、XLSX 或 PPTX
filenamestringfileJSON 檔案輸入的名稱
response_formatstringbinarybinary 或 b64_json
{
  "object": "file",
  "data": [{ "b64_json": "JVBERi0=", "mime_type": "application/pdf" }],
  "removed": ["document-properties", "xmp"],
  "cost": 0.02
}

輸入上限為 20 MB。不支援加密的 PDF 檔案。JPEG 方位與圖片色彩描述檔可能保留。HEIC 輸入會轉為 JPEG。Office 處理會移除文件屬性與部分作者欄位,不會移除文件內容。

詮釋資料移除按次計費。檔案轉換可能加收轉換費用。現行價格請見 [ Services ] 頁面。

OCR

POST /v1/ocr 可從圖片與文件讀取文字。將 model 設為以下其中一個值:

模型輸入頁面上限
silentapi-ocr圖片與 PDF 檔案。英文 OCR 資料。選取 50 頁
vision-document-text-detection每次呼叫一張圖片(Google Cloud Vision 文件文字偵測)。不接受 PDF 輸入。一張圖片
mistral-ocr-4-1圖片與文件選取 1,000 頁
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 支援圖片與 PDF 檔案,使用英文 OCR 資料,最多允許選取 50 頁。

名稱類型預設值規則
file檔案或 data URL必填JPEG、PNG、WebP、GIF、HEIC 或 PDF
modelstringsilentapi-ocrsilentapi-ocr
outputFormatstringtexttext 或 blocks
pages陣列或範圍all最多 50 頁,例如 [1,2] 或 1-3
頁面選取範例規則
範圍1-3頁碼從 1 開始
陣列[1,3]每個頁碼必須不重複

所選頁面必須存在。可使用 output_format 替代 outputFormat。

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

source 欄位顯示 SilentAPI 讀取各頁的方式:

值意義
text-layerPDF 頁面內嵌了足夠的文字,SilentAPI 會回傳該文字。
ocr該頁為掃描頁或圖片,SilentAPI 會以 OCR 讀取。

區塊可包含以下欄位:

欄位類型意義
textstring區塊文字
bboxobject含 x0、y0、x1 與 y1 的區塊方框
confidencenumber辨識信賴度

費用按頁數、OCR 頁數與圖片轉換計算。現行價格請見 [ Services ] 頁面。

Google Cloud Vision 文件文字偵測

文件文字偵測是 Google Cloud Vision 的文字讀取器,適用於密集文字與文件。在 POST /v1/ocr 上將 model 設為 vision-document-text-detection,即可取得與其他模型相同的 OCR 回應結構。每次呼叫讀取一張圖片(JPEG、PNG、WebP 或 GIF,最多 20 MB),不支援 PDF 輸入。舊版模型名稱 google-ocr 仍可使用。若要取得完整的 Google Cloud Vision 回應,請呼叫 POST /v1/google/vision-document-text-detection,或使用 vision-text-detection 讀取照片中的短文字。

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 可讀取圖片與文件。輸入上限為 20 MB。頁面選取使用 1 至 1,000 的編號。供應商上限亦適用。

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}"
名稱類型預設值規則
file檔案或 data URL必填圖片或文件輸入
modelstringsilentapi-ocr設為 mistral-ocr-4-1
pages陣列或範圍all有效頁面,API 最多選取 1,000 頁
outputFormatstringtexttext、markdown 或 blocks
table_formatstring供應商預設值markdown 或 html
extract_headerboolean供應商預設值為 true 時請求文件頁首
extract_footerboolean供應商預設值為 true 時請求文件頁尾
include_image_base64boolean供應商預設值為 true 時請求頁面圖片
confidence_scores_granularitystringnonepage、block 或 word
document_annotation_formatobjectnonetype:json_schema,附 json_schema.schema
bbox_annotation_formatobjectnonetype:json_schema,附 json_schema.schema
document_annotation_promptstringnone必須提供 document_annotation_format,最多 4,000 個字元
{
  "object": "ocr",
  "model": "mistral-ocr-4-1",
  "pages": [{ "page": 1, "markdown": "# Example document", "images": [] }],
  "usage": { "pages": 1 },
  "cost": 0.8
}

每頁都有 page 與 markdown,其他欄位在回應包含時出現:

欄位意義
page頁碼,從 1 開始
markdownMarkdown 格式的頁面文字。Mistral OCR 即使在你選擇 text 時仍會回傳。
blocks文字區塊。請選擇 blocks 以請求。
tables頁面上的表格
images頁面上的圖片,存在時含 id、bbox、image_base64 與 image_annotation
header頁面頁首
footer頁面頁尾
dimensions頁面尺寸
confidence_scores信賴度分數

回應頂層可能出現 document_annotation 欄位。

Mistral OCR 按 OCR 頁數計費。註解選項按註解頁面費率計費。現行價格請見 [ Services ] 頁面。

Google Cloud Vision

POST /v1/google_cloud/ 可在單張圖片上執行一項 Google Cloud Vision 功能,並回傳完整的 Google Cloud Vision 結果。圖片請以 multipart image 檔案傳送,或以 JSON 將 image 設為 data URL 或圖片 URL。圖片可為 JPEG、PNG、WebP 或 GIF,最多 20 MB。

模型回傳內容
vision-label-detection物件、場景與活動的標籤,附分數
vision-text-detection照片中的短文字(如招牌與標籤),附單詞方框
vision-document-text-detection密集文字與文件,含頁面、區塊、段落與單詞
vision-face-detection臉部方框、地標與表情可能性。不會辨識人物身分。
vision-landmark-detection知名地標,附位置座標
vision-logo-detection產品與品牌標誌,附方框
vision-safe-search-detection成人、暴力、醫療、仿冒與煽情內容的可能性
vision-image-properties主色與裁剪提示
vision-object-localization物件,含名稱、分數與正規化方框
vision-web-detection網頁實體、相符圖片與使用該圖片的頁面
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}"
名稱類型預設值規則
image檔案、data URL 或 URL必填一張圖片。image_url 與 url 亦可接受。
maxResultsinteger10回傳清單的功能適用 1 至 50 個結果
{
  "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
}

response 欄位存放該功能的 Google Cloud Vision 結果,如 labelAnnotations、textAnnotations、fullTextAnnotation、faceAnnotations、landmarkAnnotations、logoAnnotations、safeSearchAnnotation、imagePropertiesAnnotation、localizedObjectAnnotations 或 webDetection。每次呼叫計費一次。現行價格請見 [ Services ] 頁面。

內容審核

POST /v1/moderations 以 mistral-moderation-2603(亦稱 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"

審核不接受檔案上傳或 data URL 作為媒體輸入。文字請用 input,聊天請用 messages。兩者並存時使用 messages。

名稱類型預設值規則
modelstringmistral-moderation-2603mistral-moderation-2603
input字串或陣列無 messages 時必填最多 32 個非空文字值,合計 400,000 個字元
messagesarraynone非空陣列。角色:system、user、assistant、tool。內容須為文字。合計最多 400,000 個字元。
{
  "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
}

類別名稱視模型回應而定。成功的審核呼叫收取呼叫費與輸入 詞元 費,並適用共用服務與帳號媒體上限。現行價格請見 [ Rate Limits ] 與 [ Services ] 頁面。

音樂

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"
名稱類型預設值規則
modelstringlyria-3-cliplyria-3-pro 或 lyria-3-clip
promptstring必填音樂描述,不可留空。也可使用 input。
imagedata URL, HTTPS URL, or filenone選填的圖片輸入
image_urldata URL 或 HTTPS URLnone選填的圖片輸入
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" }
}

音樂一律以 JSON 傳回,其中包含 base64 編碼的音訊。輸出媒體類型取決於處理請求的路由。歌詞可能為 null。不支援二進位回應。

上限值
上傳檔案大小每個檔案 25 MB
上傳檔案數量8 個檔案。僅使用第一個圖片檔。
上傳總大小50 MB
JSON 中的 data URL 輸入解碼後為 50 MB,即標準媒體大小限制

檔案工具的圖片尺寸限制不適用於此端點。音樂依產生次數計費,目前價格請見[ 服務 ]頁面。

參數處理

各模型接受各自的選項組合。SilentAPI 會使用支援的值、在可轉換時轉換輸出,或略去模型不用的控制項。可復原的選項不應阻擋其他有效的請求。損毀的檔案、缺少必要輸入與無法讀取的格式仍會回傳錯誤。SilentAPI 不會以編造的文字取代不支援的圖片或音訊內容。

動作意義
轉換SilentAPI 會改變輸出,例如將 PCM 音訊轉為 WAV 檔。
最接近的值SilentAPI 會使用最接近的支援值,例如 1792x1024 會變為 16:9 長寬比。
忽略SilentAPI 不會傳送該選項,因為模型沒有此控制項。

音訊回應帶有顯示實際格式的 X-SilentAPI-Format 標頭,如 wav。Content-Type 與回傳的位元組相符。常見的 MIME 與檔名別名皆可接受,包括 audio/wav、audio/mpeg 與 .MP3。若請求的格式改變,X-SilentAPI-Notice 會說明,例如 Requested opus. Returned mp3.。未知格式會使用模型預設值並回傳通知。壓縮音訊不會假裝已轉換而重新命名。

語音

POST /v1/audio/speech 在每個語音模型上接受 response_format 的值 mp3、wav、opus、aac、flac 與 pcm。

模型你會取得的格式其他請求
voxtral-mini-tts-3.0mp3, wav, pcmopus and aac return mp3. flac returns wav.
gemini-3.8-flash-ttswav, pcmmp3、opus、aac 與 flac 會回傳 wav。
gemini-3.8-flash-lite-ttswav, pcmmp3、opus、aac 與 flac 會回傳 wav。

未傳送 response_format 時,Voxtral 回傳 mp3,Gemini 回傳 wav。SilentAPI 會為 PCM 音訊加上 WAV 標頭製成 WAV 檔,音訊本身不變。PCM 輸出為原始有號 16 位元取樣,小端序,單聲道。Content-Type 會給出取樣率,例如 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
選項處理方式
voice語音名稱比對不分大小寫。未知語音(例如 OpenAI 語音名稱 alloy)會使用模型預設語音。
speed以 0.25 至 4 的數字傳送。SilentAPI 會將其他值改為此範圍最接近的一端。無語速控制的模型會忽略它。
模型預設語音語音
voxtral-mini-tts-3.0en_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

轉錄

Voxtral 3 模型為 voxtral-small-transcribe-3.0 與 voxtral-mini-transcribe-3.0。Voxtral 3 語音與轉錄使用端對端 ZDR 路由。較早的 Voxtral Mini Transcribe 與 Mini TTS 模型已移除。gemini-3.5-transcribe 仍可使用,具 SilentAPI 受保護的隱私。

POST /v1/audio/transcriptions 在每個語音轉文字模型上接受以下所有 response_format,SilentAPI 會依模型輸出組出請求的結構。

response_format結果
json預設值。含 text 與費用欄位的 JSON。
text純文字
verbose_jsonJSON,包含 task、已知時的 language、duration、text 和 segments。模型提供字詞時間時會出現 words。
srtSubRip 字幕
vttWebVTT 字幕

模型有提供分段時間即會採用。GPT 轉錄僅提供文字。模型未提供時間時,SilentAPI 會為整段音訊回傳一個分段或一條字幕,結束時間即音訊長度;WAV 檔的長度精確,其他格式由檔案大小估算。

text、srt 與 vtt 格式不回傳 JSON,請在 X-SilentAPI-Cost 標頭中查看費用。未知的 response_format 會回傳 json;當您傳送 language、prompt 與 temperature 時,SilentAPI 會將其轉交給模型。

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"

圖片產生

POST /v1/images/generations 與 POST /v1/images/edits 會調整以下選項以符合模型:

選項處理方式
sizeSilentAPI 會使用模型支援的最接近長寬比與圖片大小,例如 1792x1024 會變為 16:9(1.5K,於 grok-imagine-image-2.0 上)。
aspect_ratio模型支援時使用,否則 SilentAPI 使用最接近的支援比例。aspect_ratio 優先於 size。
image_size 或解析度0.5K、1K、1.5K、2K 或 4K。SilentAPI 會使用模型支援的最接近大小,優先於 size 中的大小。
n1 至 4。每次呼叫產生一張圖片的模型,每張圖片各呼叫一次。若後續呼叫失敗,你會取得已產生的圖片,且僅支付這些圖片的費用。
response_formatb64_json 為預設值。使用 url 會取得 data URL,例如 data:image/png;base64,...,因為模型回傳的是圖片資料而非連結。
output_formatpng、jpeg 或 webp。模型回傳其他格式時,SilentAPI 會轉換圖片,每張轉換的圖片加收圖片轉換費用。output_compression 設定 jpeg 與 webp 的品質。轉換失敗時你會取得原始圖片,mime_type 顯示實際格式。
品質、背景、樣式不支援這些控制的模型會忽略此選項。
模型長寬比圖像尺寸
gemini-nano-banana-2.11:1, 2:3, 3:2, 3:4, 4:3, 4:5, 5:4, 9:16, 16:9, 21:91K, 2K, 4K
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, 1.5K, 2K

Nano Banana 2.1、Nano Banana 2 與 Nano Banana 2 Lite 使用端到端零資料保留路由。

Grok Imagine Image 2 在低品質下預設為 1K,僅支援低與中品質,費用依所選品質與解析度計算,每張成功生成的圖像會再次計收各輸入圖像的費用,失敗的生成不收費。

GPT 圖像模型會在一次呼叫中產生全部 n 張圖像,並調整以下選項:

選項處理方式
size像素尺寸(例如 1536x1024)會原樣傳送至模型,模型會採用其支援的最接近尺寸;尺寸等級(例如 2K)則直接設定圖像尺寸。
aspect_ratio、image_size 或 resolution若同時傳送其中之一與像素尺寸,SilentAPI 會傳送最接近的長寬比與最接近的圖像尺寸(512、768、1K、1.5K、2K 或 4K),而非像素尺寸。
qualityauto, low, medium, or high. standard becomes medium. hd, xhigh, and max become high.
background自動、透明或不透明。透明背景請使用 png 或 webp。
output_format模型可直接產生 png、jpeg 與 webp,不另收費,其他格式則使用上述轉換流程。
output_compression0 至 100,適用於 jpeg 與 webp
seed整數;相同的 seed 與選項會產生相似的圖像,但結果仍可能變化。
輸入圖像最多 16 張圖像,可來自 image、images、image_url 或上傳的檔案,用以引導新圖像的產生。

音樂

response_format結果
wavWAV audio
pcm從 WAV 輸出擷取的原始 PCM。mime_type 提供取樣率與聲道資訊。
flacWAV 音訊,最接近的無損格式
mp3, opus, aac, or absent模型預設格式,通常為 mp3

X-SilentAPI-Format 標頭與 mime_type 會顯示實際格式。音樂模型不支援控制長度,因此 SilentAPI 不會傳送 duration 或 seconds。Lyria 3 Clip 會產生短片段。使用 Lyria 3 Pro 時,請在提示詞中註明所需長度。

影片

grok-imagine-video-1.5-lite 在 480p、720p 或 1080p 下支援 1 至 15 秒,較早的 grok-imagine-video 仍可在 480p 與 720p 使用,兩者均受 SilentAPI 保護,價格依解析度與輸入圖像而定。

不支援影片與音訊輸入檔案;包含影片或音訊輸入的請求會在送達模型前傳回 HTTP 400。對於支援的輸出選項,SilentAPI 會採用最接近的支援值:

Webhook

影片任務可能需要數分鐘;與其輪詢 GET /v1/videos/{id},不如在送出任務時一併傳送 webhook_url,任務完成或失敗時我們會向該位址傳送 POST。該位址必須是公開的 https 網址,其他位址會在任務開始前傳回 HTTP 400。

內文與 GET /v1/videos/{id} 傳回的 JSON 物件相同;X-SilentAPI-Event 標頭為 video.completed 或 video.failed。您的伺服器有 15 秒 的時間回應,傳送失敗不會重試,因此重要任務仍請以輪詢作為備援。

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"}'

嵌入

POST /v1/embeddings 在所有模型上接受 encoding_format 的 float(預設)或 base64 格式;SilentAPI 會取得 float 向量並自行產生 base64 字串,該字串包含 32 位元浮點數,採小端序,與 OpenAI API 的排列方式相同。

模型完整尺寸dimensions
text-embedding-3-small1,536原樣傳送至模型
text-embedding-3-large3,072原樣傳送至模型
gemini-embedding-23,072原樣傳送至模型
qwen3-embedding-8b4,096原樣傳送至模型
codestral-embed-25051,536SilentAPI 保留前面的數值並將向量縮放至長度 1,此為該模型家族的縮短方式。
mistral-embed-23121,024不支援,您將取得完整向量。

dimensions 等於或大於完整尺寸時會傳回完整向量;非大於 0 的整數的值會被忽略。