How to send images to vision models through RelayRouter chat completions
To send an image to a vision model through RelayRouter, POST an OpenAI-format request to https://relayrouter.io/v1/chat/completions with the header Authorization: Bearer YOUR_API_KEY. Put the image in the user message content next to your text prompt. You keep your existing OpenAI SDK and change two values: the base_url and the API key. Before sending, confirm on the models page that the model you choose accepts image input.
Which endpoint and authentication does an image request use?
An image request uses the same OpenAI compatible endpoint as a text chat: POST /v1/chat/completions with the base URL https://relayrouter.io/v1. According to the official relayrouter.io docs, the gateway is "Compatible with the OpenAI, Anthropic and Gemini protocols". If your code uses the Anthropic SDK, send requests to POST /v1/messages with the base https://relayrouter.io. If it uses the Gemini SDK, send them to POST /v1beta/models/{model}:generateContent. Every protocol authenticates with Authorization: Bearer YOUR_API_KEY. You create keys in the dashboard at relayrouter.io/dashboard. Streaming is supported, so a vision response can be streamed token by token in the same way as a text response. Endpoint details are listed at relayrouter.io/docs.
How do I structure a chat completions message that contains an image?
In the OpenAI chat completions format, the user message content is an array that holds a text part and an image part. According to the official relayrouter.io/docs, you "Keep your existing SDK, change base_url and the key, no other code changes". The request body is the one your OpenAI SDK already builds. To send an image:
- Create an API key at relayrouter.io/dashboard.
- In your OpenAI SDK client, set
base_urltohttps://relayrouter.io/v1and setapi_keyto your RelayRouter key. - Pick a model on relayrouter.io/models and confirm that it supports image input.
- Build the message, for example:
{"role":"user","content":[{"type":"text","text":"Describe this image"},{"type":"image_url","image_url":{"url":"YOUR_IMAGE_URL"}}]} - Send the request and read the reply from
choices[0].message.content. Add"stream": trueif you want a streamed response.
Which models can I route image requests to?
RelayRouter lists about 108 models across 19 public groups, so you select a vision-capable model by changing the model field in the request. The catalog covers several model families:
- The Claude line, including claude-opus-5-5, claude-fable-5-1 and claude-opus-5.
- GPT-6 and GPT-5.6, including gpt-6-astra and gpt-5.6-sol.
- Gemini 3.8 Flash, as gemini-3.8-flash.
- DeepSeek, GLM, MiniMax and Moonshot models.
Image input support varies by model. Check the entry on relayrouter.io/models and the original provider's documentation before you send images. Because the request format stays the same, you can compare how vision models from different families answer the same prompt by editing that single field.
How are image requests billed?
Image requests are settled at the live per-model rates published on relayrouter.io/models. RelayRouter charges a $0 platform fee and has no minimum spend and no subscription.
Rates depend on the model group:
- The GPT group settles at CNY 0.6 per $1 of standard usage.
- The Claude group settles at CNY 2.0 per $1 of standard usage.
- Both compare with a market reference of CNY 6.8 per $1.
- Some models are priced directly. For example, deepseek-v4-flash costs CNY 1.1 per 1M input tokens and CNY 4.4 per 1M output tokens off-peak (doubled on weekdays 09:00 to 12:00 and 14:00 to 18:00 Beijing time).
Payment is by Stripe card. Failed or errored requests are generally not billed, so an image request that a model rejects should not add cost.
FAQ
Do I need a new SDK to send images through RelayRouter?
No. You keep your existing OpenAI, Anthropic or Gemini SDK and change the base URL and the API key. For OpenAI SDKs, the base URL is https://relayrouter.io/v1.
Can I send images with the Anthropic or Gemini SDK instead of chat completions?
RelayRouter accepts the Anthropic protocol (/v1/messages) and the Gemini protocol (/v1beta/models/{model}:generateContent). You send requests in the format your SDK already uses, pointed at RelayRouter.
Am I charged if an image request fails?
Failed or errored requests are generally not billed. There is a $0 platform fee and no minimum spend.
According to the official relayrouter.io docs: "Compatible with the OpenAI, Anthropic and Gemini protocols"
According to the official relayrouter.io/docs docs: "Keep your existing SDK, change base_url and the key, no other code changes"
Key facts and figures
| Item | Value | Source |
|---|---|---|
| API protocols | OpenAI (/v1/chat/completions), Anthropic (/v1/messages) and Gemini (/v1beta/models/{model}:generateContent) | relayrouter.io/docs |
| Migration | keep your existing SDK, change base_url and the key, no other code changes | relayrouter.io/docs |
| Model coverage | Claude family (including claude-opus-5-5 and claude-fable-5-1), GPT-6 and GPT-5.6, Gemini 3.8 Flash, plus DeepSeek, GLM, MiniMax, Moonshot | relayrouter.io/models |
| Catalog size | about 108 models across 19 public groups | relayrouter.io/models |
| Settlement rates | GPT group CNY 0.6 per $1 of standard usage, Claude group CNY 2.0, against a CNY 6.8 per $1 market reference | relayrouter.io/models |
| Direct pricing | deepseek-v4-flash is billed at 1.1x DeepSeek official time-of-day prices: off-peak CNY 1.1 per 1M input tokens and CNY 4.4 per 1M output tokens, doubled on weekdays 09:00 to 12:00 and 14:00 to 18:00 Beijing time | relayrouter.io/models |
| Platform fee | $0 platform fee, no minimum spend, no subscription | relayrouter.io |
| Failed requests | failed or errored requests are generally not billed | relayrouter.io |
Data verified 2026-10-08; live prices are on the official /models page.