Amanai Docs

Media

Image, video, speech, transcription, file, and artifact contracts.

Overview

Media endpoints use the same Amanai Bearer key and https://api.amanai.dev/v1 base URL as chat, but each modality has its own input validation, output delivery, and billing unit. Endpoints share an operation shape; supported controls vary by model. Select a compatible model and send only the fields it supports.

Realtime is separate. Low-latency WebRTC conversations have a dedicated Realtime guide. Text vectors and ranking are documented under Embeddings and Rerank.

Models and endpoints

CapabilityEndpointModels
Image generationPOST /v1/images/generationsPublished image models
Image editingPOST /v1/images/editsGrok Imagine image models
VideoPOST /v1/videosGrok Imagine video models
Speech synthesisPOST /v1/audio/speechSpeech synthesis models
TranscriptionPOST /v1/audio/transcriptionsGrok Voice Transcribe models
FilesPOST /v1/filesOwner-scoped input for media operations

Current rates for every model are centralized in Billing & pricing.

Image generation and editing

ModelOperationsOutput
GPT 5.6 Luna Image amanai/gpt-5.6-luna-image GenerateExactly one verified image artifact
GPT 5.5 Image amanai/gpt-5.5-image GenerateExactly one verified image artifact
GPT 5.6 Terra Image amanai/gpt-5.6-terra-image GenerateExactly one verified image artifact
GPT 5.6 Sol Image amanai/gpt-5.6-sol-image GenerateExactly one verified image artifact
Grok Imagine Image amanai/grok-imagine-image Generate, editExactly one verified image artifact
Grok Imagine Image 2.0 amanai/grok-imagine-image-2.0 Generate, editExactly one verified image artifact

GPT image models support 1024x1024, 1536x1024, or 1024x1536 with auto, low, medium, or high quality. The legacy Grok Imagine model remains fixed at 1024x1024. Grok Imagine Image 2.0 accepts aspect_ratio (auto, 1:1, 16:9, 9:16, 4:3, 3:4, 3:2, 2:3, 2:1, 1:2, 19.5:9, 9:19.5, 20:9, 9:20, 21:9, or 5:2) and resolution (1k or 2k), with auto, low, or medium quality. For Image 2.0, quality=auto uses low for generation and medium for editing. Send aspect_ratio and resolution instead of the legacy square size hint.

bash
curl https://api.amanai.dev/v1/images/generations \
  -H "Authorization: Bearer $AMANAI_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: image-demo-001" \
  -d '{
    "model": "amanai/grok-imagine-image-2.0",
    "prompt": "A cinematic observatory above a sea of clouds",
    "aspect_ratio": "16:9",
    "resolution": "2k",
    "quality": "auto",
    "n": 1,
    "output_format": "png"
  }'

Editing is multipart and accepts exactly one PNG, JPEG, or WebP source image plus a required prompt. Masks are not part of the published editing contract.

bash
curl https://api.amanai.dev/v1/images/edits \
  -H "Authorization: Bearer $AMANAI_API_KEY" \
  -H "Idempotency-Key: image-edit-demo-001" \
  -F "model=amanai/grok-imagine-image-2.0" \
  -F "prompt=Replace the daytime sky with a clear night sky" \
  -F "image=@photo.png" \
  -F "aspect_ratio=3:2" \
  -F "resolution=1k" \
  -F "output_format=png"

output_format=png in these examples is an OpenAI-compatibility hint, not a promise about the delivered encoding. The response reports the verified output_format and exact pixel size of the delivered bytes. Grok may return JPEG, PNG, or WebP; use the response metadata or HTTP content type when naming a download.

Video generation

ModelInputsDurationSize
Grok Imagine Video amanai/grok-imagine-video Text, optional source image4, 8, or 12 seconds720x1280 or 1280x720
Grok Imagine Video 1.5 amanai/grok-imagine-video-1.5 Text, optional source image4, 8, or 12 seconds720x1280 or 1280x720

Video is a durable asynchronous job. Submit once with a unique idempotency key, poll the returned job, then download the artifact URL returned by the completed job.

bash
VIDEO=$(curl -sS https://api.amanai.dev/v1/videos \
  -H "Authorization: Bearer $AMANAI_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: video-demo-001" \
  -d '{
    "model": "amanai/grok-imagine-video-1.5",
    "prompt": "A paper spaceship crossing a watercolor sky",
    "seconds": "4",
    "size": "720x1280"
  }')

VIDEO_ID=$(printf '%s' "$VIDEO" | jq -r .id)
curl https://api.amanai.dev/v1/videos/$VIDEO_ID \
  -H "Authorization: Bearer $AMANAI_API_KEY"

For image-to-video, submit multipart data with exactly one optional PNG, JPEG, or WebP input image. The job state is queued, in_progress, completed, or failed. Poll no faster than OpenAI-Poll-After-Ms.

Speech synthesis

ModelVoicesFormatsSpeed
Grok Voice TTS amanai/grok-voice-tts 28 built-in voicesMP3, WAVFixed at 1.0

Speech synthesis defaults to eve. Built-in voices are carina, zagan, helix, orion, luna, iris, altair, zenith, perseus, helios, lux, kepler, rigel, cosmo, celeste, ursa, sirius, lumen, castor, naksh, atlas, aurora, liora, ara, eve, leo, rex, sal. Language accepts auto, one of the published presets, or another bounded BCP-47 tag. Indonesian uses id-ID; Malay uses ms-MY.

bash
curl https://api.amanai.dev/v1/audio/speech \
  -H "Authorization: Bearer $AMANAI_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: speech-demo-001" \
  -d '{
    "model": "amanai/grok-voice-tts",
    "input": "Welcome to Amanai.",
    "voice": "eve",
    "language": "en-US",
    "response_format": "mp3",
    "speed": 1.0
  }' --output speech.mp3

Published presets: Auto detect (auto), English (US) (en-US), English (UK) (en-GB), Indonesian (id-ID), Malay (ms-MY), Arabic (ar-SA), Czech (cs-CZ), Danish (da-DK), Dutch (nl-NL), Filipino (fil-PH), Chinese (Simplified) (zh-CN), Japanese (ja-JP), Korean (ko-KR), Spanish (es-ES), French (fr-FR), German (de-DE), Italian (it-IT), Macedonian (mk-MK), Persian (fa-IR), Polish (pl-PL), Portuguese (Brazil) (pt-BR), Romanian (ro-RO), Russian (ru-RU), Swedish (sv-SE), Thai (th-TH), Turkish (tr-TR), Vietnamese (vi-VN), Hindi (hi-IN).

Speech transcription

ModelInputResponse formats
Grok Voice Transcribe 1.0 amanai/grok-voice-transcribe-1.0 One audio file up to 20 MiBjson, text, verbose_json
Grok Voice Transcribe 2.0 amanai/grok-voice-transcribe-2.0 One audio file up to 20 MiBjson, text, verbose_json

Accepted formats are MP3, MP4/M4A, WAV, OGG, FLAC, AAC, and Opus. The optional language hint uses a short code such as id or ms. Prompt, temperature, translation, streaming, diarization, and timestamp-granularity controls are not part of the current public route.

bash
curl https://api.amanai.dev/v1/audio/transcriptions \
  -H "Authorization: Bearer $AMANAI_API_KEY" \
  -H "Idempotency-Key: transcript-demo-001" \
  -F "file=@recording.wav" \
  -F "model=amanai/grok-voice-transcribe-2.0" \
  -F "language=id" \
  -F "response_format=verbose_json"

Language hints: Auto detect, Arabic (ar), Czech (cs), Danish (da), Dutch (nl), English (en), Filipino (fil), French (fr), German (de), Hindi (hi), Indonesian (id), Italian (it), Japanese (ja), Korean (ko), Macedonian (mk), Malay (ms), Persian (fa), Polish (pl), Portuguese (pt), Romanian (ro), Russian (ru), Spanish (es), Swedish (sv), Thai (th), Turkish (tr), Vietnamese (vi).

Files and artifacts

Multipart image edits, video inputs, and transcription requests automatically stage their inputs. Use POST /v1/files when you need a reusable private file ID. Files are scoped to the authenticated owner and limited to 100 MiB.

bash
curl https://api.amanai.dev/v1/files \
  -H "Authorization: Bearer $AMANAI_API_KEY" \
  -H "Idempotency-Key: file-demo-001" \
  -F "purpose=user_data" \
  -F "file=@recording.wav"

Inspect, download, or delete with GET /v1/files/{id}, GET /v1/files/{id}/content, and DELETE /v1/files/{id}. Generated artifacts use expiring /v1/artifacts/download/{token} URLs; download results you intend to keep.

Retries and ownership

✓Use one unique Idempotency-Key for each logical media operation.
✓Retry the exact same body with the same key after a network failure.
✓Reusing a key for different input returns 409 idempotency_conflict.
✓Files, jobs, and artifacts are owner-bound and cannot cross accounts.
✓A failure before usable output is delivered is refunded; durable jobs settle or refund exactly once.