Image generation

curl https://your-gateway/v1/images/generations \
  -H "Authorization: Bearer $KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "dall-e-3",
    "prompt": "A serene mountain landscape at sunset",
    "n": 1,
    "size": "1024x1024"
  }'

Response

{
  "created": 1700000000,
  "data": [
    {"url": "https://..."}
  ]
}

Image edits

curl https://your-gateway/v1/images/edits \
  -H "Authorization: Bearer $KEY" \
  -F "image=@photo.png" \
  -F "mask=@mask.png" \
  -F "prompt=Replace the sky with a starry night" \
  -F "model=dall-e-2"

Image variations

curl https://your-gateway/v1/images/variations \
  -H "Authorization: Bearer $KEY" \
  -F "image=@photo.png" \
  -F "model=dall-e-2" \
  -F "n=2"

Text-to-speech

curl https://your-gateway/v1/audio/speech \
  -H "Authorization: Bearer $KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "tts-1",
    "input": "Hello, welcome to ManyLayers.",
    "voice": "alloy"
  }' \
  --output speech.mp3
Available voices: alloy, echo, fable, onyx, nova, shimmer.

Speech-to-text

curl https://your-gateway/v1/audio/transcriptions \
  -H "Authorization: Bearer $KEY" \
  -F "file=@recording.mp3" \
  -F "model=whisper-1"

Response

{"text": "Hello, welcome to ManyLayers."}

Audio translation

Translate audio from any supported language to English text:
curl https://your-gateway/v1/audio/translations \
  -H "Authorization: Bearer $KEY" \
  -F "file=@french_recording.mp3" \
  -F "model=whisper-1"

Media pricing

Configure per-request costs for media endpoints in your model definition:
media_prices:
  image: 0.04                # USD per generated image (multiplied by n)
  speech_per_1k_chars: 0.015 # USD per 1000 input characters
  transcription: 0.006       # USD flat per transcription request