Media Understanding & Generation

Stravia provides two complementary media modules under Advanced Features: Media understanding (/media-understanding, Beta) and Media generation (/media-generation, Beta).

Prerequisites

  • For Media understanding: At least one enabled inference route that supports image input (for Image & Document understanding) and/or audio input (for Audio understanding).
  • For Media generation: At least one enabled Model Route with Purpose: Image Generation (image_generation), backed by a capable upstream target (OpenAI Codex, Antigravity, MiniMax, Alibaba Bailian, Volcengine Ark, or BytePlus ModelArk).

Steps

1. Configure Media Understanding (/media-understanding)

Media understanding configuration page showing Image/Document and Audio sections

Media understanding maintains two separate configurations (GET /api/v1/media-understanding, saved independently via PUT /api/v1/media-understanding/{kind}):

  • Image & Document understanding: Supports static JPEG, PNG, WebP images and Office documents (DOCX, XLSX, PPTX, DOC, XLS, PPT—converted to Markdown with normalized embedded images). PDF and video files are not supported here.
  • Audio understanding: Supports WAV, MP3, FLAC, OGG, AAC (ADTS), and AIFF. Stravia validates MIME type and container headers without transcoding, so the selected upstream target must accept that audio format natively. Audio uses its own enable switch, logical model, and thinking level and never mixes into an image/document call.

2. Configure Media Generation (/media-generation)

Media generation configuration page selecting an image_generation route

  1. Open Advanced Features → Media generation and select an eligible image_generation route.
  2. Save and enable the feature. Note that turning the toggle off keeps your bound route reference (which prevents switching that route back to inference until you explicitly select No route selected and save).
  3. Reference-image editing & vendor rules:
    • The unified generate tool accepts up to 5 ordered reference images (user-owned bare artifact paths or public HTTP(S) image URLs); aspect ratio and resolution act as preferences rather than guaranteed pixel dimensions.
    • Reference-image editing requires targets registered as supporting image input; pure prompt-to-image generation works on any image-generation target.
    • Alibaba Bailian: alibaba, alibaba-cn, alibaba-token-plan, and alibaba-token-plan-cn support image generation/editing (Alibaba Coding Plan is excluded).
    • Volcengine Ark & BytePlus: Coding Plan profiles exclude non-callable image models automatically.

3. Artifact uploads & 15-minute downloads

  • Single-step upload: Clients upload raw file bytes to POST /v1/artifacts with the file MIME in Content-Type (no multipart/form-data), receiving { path, mime_type, size }.
  • Signed downloads: Generated images return a stable stravia://artifacts/<id> path, MIME, size, dimensions, and a 15-minute bearer download_url served via client_base_url (with deployment path prefix preserved). After the URL expires, retrieve the image via StraviaRead with :download rather than regenerating.

Verify

Authorize media_understanding and/or media_generation on an API key (via transparent injection or MCP) and test inspecting an image/audio file or generating an image. Check Monitor → Request history for the completed execution and returned stravia://artifacts/<id> path.

Troubleshooting

  • Route missing from Media generation dropdown: Ensure the route's Purpose is set to Image Generation (image_generation), not inference.
  • Audio understanding rejects file: Confirm the file uses a supported non-transcoded container (WAV, MP3, FLAC, OGG, AAC, AIFF) and your chosen target accepts it.
  • Generated image preview fails after 15 minutes: The bearer download_url expired; fetch the retained artifact via StraviaRead (<artifact-path>:download) or check client_base_url under Settings.

Next