编辑图像(OpenAI 兼容)
接受 multipart/form-data(带参考图)或 JSON。计费单位取决于模型,以模型目录页标注为准。
xai/grok-imagine-image-2.0:源图用 JSON image({"url": ...},https URL 或 data URL)传一张,或用 JSON images 传最多 3 张,也可用 multipart 的 image / image[]。多张图时在提示词里用 <IMAGE_0>、<IMAGE_1> 依次指代。编辑时 quality 缺省为 medium(auto 即 medium);resolution 与 n 同生成接口,不支持 mask。按输出张数、随质量 × 分辨率计费,每张源图每次请求另收一次。源图超过 3 张在计费前返回 400。
Authorization
bearerAuth Authorization: Bearer <your RouteMux API key>.
Create keys at https://routemux.com/console/keys. New keys use the sk- prefix;
the legacy rmx_live_ prefix is still accepted.
The Anthropic SDK's x-api-key and the Google SDK's x-goog-api-key are accepted too.
Sending several key headers with different values returns 400 AUTH_AMBIGUOUS_API_KEY.
In: header
TypeScript Definitions
Use the request body type in TypeScript.
Request and response bodies match the upstream provider's official format verbatim —
RouteMux passes them through untouched. See the provider's own docs for field definitions;
the gateway itself only reads model and stream.
Response Body
application/json
application/json
application/json
curl -X POST "https://example.com/v1/images/edits" \ -H "Content-Type: application/json" \ -d '{}'{ "model": "string", "stream": true}