图片 API 概览
curl --request POST \
--url https://api.mixroute.ai/v1/images/generationsimport requests
url = "https://api.mixroute.ai/v1/images/generations"
response = requests.post(url)
print(response.text)const options = {method: 'POST'};
fetch('https://api.mixroute.ai/v1/images/generations', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.mixroute.ai/v1/images/generations",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.mixroute.ai/v1/images/generations"
req, _ := http.NewRequest("POST", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.mixroute.ai/v1/images/generations")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.mixroute.ai/v1/images/generations")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
response = http.request(request)
puts response.read_body图像系列
图片 API 概览
选择受支持的图片模型系列,使用对应的生成或编辑请求格式。
图片 API 概览
curl --request POST \
--url https://api.mixroute.ai/v1/images/generationsimport requests
url = "https://api.mixroute.ai/v1/images/generations"
response = requests.post(url)
print(response.text)const options = {method: 'POST'};
fetch('https://api.mixroute.ai/v1/images/generations', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.mixroute.ai/v1/images/generations",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.mixroute.ai/v1/images/generations"
req, _ := http.NewRequest("POST", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.mixroute.ai/v1/images/generations")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.mixroute.ai/v1/images/generations")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
response = http.request(request)
puts response.read_body构造请求前先选择图片模型系列,按对应接口页面使用该模型的请求格式与字段。
Gemini 流式请求
账号可见模型通过
使用账号返回的完整模型 ID。可用性和计费取决于所选路由,账号信息以模型广场为准。不要跨系列复用 size、quality、输入图片或响应格式字段。
图片接口
| 系列 | 生成 | 编辑 | 请求格式 |
|---|---|---|---|
| GPT Image | GPT Image | 图片编辑 | 生成使用 JSON,编辑使用 multipart/form-data。 |
| Grok Imagine | Grok Imagine | 图片编辑 | 生成、编辑均使用 JSON,图片引用使用原生对象。 |
| Qwen Image | Qwen Image | 图片编辑 | 基础生成使用 input.prompt,多模态生成/编辑使用 input.messages;均包含 model 与 parameters。 |
| Gemini | Gemini | 原生图片编辑 | contents, generationConfig |
可用模型 ID
| 系列 | 模型 ID |
|---|---|
| GPT Image | gpt-image-2, gpt-image-1.5, gpt-image-1 |
| Grok Imagine | grok-imagine-image-2.0, grok-imagine-image-quality, grok-imagine-image |
| Qwen Image | qwen-image-2.0-pro, qwen-image-2.0, qwen-image-max, qwen-image-plus, qwen-image, qwen-image-edit-max, qwen-image-edit-plus, qwen-image-edit |
| Gemini | gemini-3.1-flash-image, gemini-3.1-flash-image-preview, gemini-3-pro-image, gemini-3-pro-image-preview, gemini-3.1-flash-lite-image, gemini-2.5-flash-image |
GET /v1/models 获取。能接收图片输入的模型不一定能生成图片,请按系列页面选择支持图片输出的型号及请求格式。
认证
curl "https://api.mixroute.ai/v1/models" \
--header "Authorization: Bearer $MIXROUTE_API_KEY"