Which API Should I Use?
For most chat and vision integrations, start with
https://api.yourouter.ai/v1 and the OpenAI-compatible Chat Completions format.Image Input with Chat Completions
Usemessages[].content as an array of content blocks. Include one text block and one or more image_url blocks.
Base64 Image Input
For private images, send a data URL.Python Example
PDF / Document Input
PDF support depends on the target model and upstream provider. Before sending a request, confirm that the model you selected supports document or vision understanding. Models that do not support PDFs will return an upstream error. For models that support OpenAI-compatible file content blocks, add afile block to messages[].content. The file_data value is the base64-encoded raw PDF bytes; do not include a data:application/pdf;base64, prefix.
- Gemini: use
inlineData.mimeType: "application/pdf"; see Google Generate Content. - Claude: use a
documentcontent block withmedia_type: "application/pdf"; see Anthropic Messages.
Gemini Native Multimodal
Use Google’sgenerateContent format when your integration depends on Gemini-native request fields.
Claude Native Messages
Use Anthropic’s Messages format when you need Claude-native request behavior.Video Generation Tasks
Video generation is task-based: create a task, then poll until the task is finished.id. Query that task until it is complete:
Integration Tips
- Keep model IDs configurable so you can switch vision and multimodal models without code changes.
- Use
vendoronly when you need a provider-specific format or behavior. - Prefer HTTPS URLs or split processing for large files; use base64 for private/local test images and small PDFs.
- PDF support changes by model and upstream capability. Run a real-file test with the target model before shipping.
- Preserve request IDs from responses when troubleshooting provider-specific multimodal issues.