Documentation Index
Fetch the complete documentation index at: https://docs.apigo.ai/llms.txt
Use this file to discover all available pages before exploring further.
推荐 endpoint
最小请求
{
"model": "gpt-image-1",
"prompt": "一张简洁的 ApiGo 产品海报",
"size": "1024x1024",
"n": 1
}
cURL 示例
curl https://maas.apigo.ai/v1/images/generations \
-H "Authorization: Bearer $YOUR API KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "gpt-image-1",
"prompt": "一张简洁的 ApiGo 产品海报",
"size": "1024x1024",
"n": 1
}'
Python 示例
from openai import OpenAI
client = OpenAI(
base_url="https://maas.apigo.ai/v1",
api_key="<YOUR API KEY>",
)
response = client.images.generate(
model="gpt-image-1",
prompt="一张简洁的 ApiGo 产品海报",
size="1024x1024",
)
print(response.data[0].url or response.data[0].b64_json[:80])
Node.js 示例
import OpenAI from "openai";
const client = new OpenAI({
baseURL: "https://maas.apigo.ai/v1",
apiKey: process.env.YOUR API KEY,
});
const response = await client.images.generate({
model: "gpt-image-1",
prompt: "一张简洁的 ApiGo 产品海报",
size: "1024x1024"
});
console.log(response.data[0].url ?? response.data[0].b64_json?.slice(0, 80));
最佳实践
- 文生图和图片编辑分开走不同 endpoint
- 如果是多轮编辑,服务端保留原图 ID、临时 URL 或上一轮结果
- 返回体可能是 URL 或 base64,统一转存层放到服务端