Image generation returns 400 on RelayRouter /v1/images/generations: size and parameter errors
The documented RelayRouter endpoints do not include /v1/images/generations, so a 400 on that path should be treated as an endpoint and model mismatch before you change size or other parameters. RelayRouter documents three protocols: OpenAI (/v1/chat/completions), Anthropic (/v1/messages) and Gemini (/v1beta/models/{model}:generateContent). Confirm current endpoint and model support at relayrouter.io/docs and relayrouter.io/models before you retry the request.
Which endpoints does RelayRouter document?
RelayRouter documents three request endpoints, and /v1/images/generations is not one of them. According to the official relayrouter.io docs, the gateway is “Compatible with the OpenAI, Anthropic and Gemini protocols”, and each protocol maps to one path. The catalog lists about 108 models across 19 public groups. It covers the 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 and Moonshot. The documentation does not name a dedicated image generation model or image size parameters. Check relayrouter.io/models for current availability.
| Protocol | Method and path | Base URL |
|---|---|---|
| OpenAI compatible | POST /v1/chat/completions | https://relayrouter.io/v1 |
| Anthropic compatible | POST /v1/messages | https://relayrouter.io |
| Gemini compatible | POST /v1beta/models/{model}:generateContent | See relayrouter.io/docs |
How do you troubleshoot a 400 on an image request?
Check the endpoint, base URL, key and model name against the documentation before you adjust size or other parameters. According to the official relayrouter.io docs, you should “Keep your existing SDK, change base_url and the key, no other code changes”. This means that a correctly configured SDK call to a documented path should not need extra code changes.
- Confirm that the path you call is listed in relayrouter.io/docs. /v1/images/generations does not appear among the three documented protocols.
- Verify that the base URL matches the protocol, for example
https://relayrouter.io/v1for the OpenAI SDK. - Send the header
Authorization: Bearer YOUR_API_KEYwith a key created at relayrouter.io/dashboard. - Use a model ID exactly as it appears on relayrouter.io/models, such as
gemini-3.8-flash.
Are failed 400 requests billed?
Failed or errored requests are generally not billed, so a 400 returned while you troubleshoot should not add usage charges. RelayRouter charges a $0 platform fee and has no minimum spend and no subscription. The GPT group settles at CNY 0.6 per $1 of standard usage and the Claude group settles at CNY 2.0 per $1. The market reference is CNY 6.8 per $1. Some models use direct pricing. 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). Rates can change, so check live per-model rates at relayrouter.io/models before you plan large test runs. Payment is by Stripe card.
FAQ
Does RelayRouter document an image generation endpoint? No. The three documented paths are /v1/chat/completions, /v1/messages and /v1beta/models/{model}:generateContent. Check relayrouter.io/docs for any updates.
Do I need a new SDK to use RelayRouter? No. You keep your existing OpenAI, Anthropic or Gemini SDK, point the base URL at RelayRouter and replace the API key. Streaming is supported.
Where can I see which models are available? The catalog at relayrouter.io/models lists about 108 models across 19 public groups, along with live per-model rates.
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.