跳至主要内容

Grok Imagine

grok-imagine-imagegrok-imagine-image-quality 透過 PopGo OpenAI Images 相容端點提供同步生成與編輯。PopGo 會把標準 sizeresolutionaspect_ratio 轉換為模型欄位。

Endpoint 與規格

POST https://api.popgo.site/v1/images/generations
POST https://api.popgo.site/v1/images/edits
Authorization: Bearer YOUR_API_KEY
模型解析度長寬比
grok-imagine-image1K2K1:116:99:164:33:43:22:3
grok-imagine-image-quality目前按 2K 級別配置,請看即時頁同上七種

例如 2048x1152 會轉成 2K16:9。同時傳多個規格欄位時,必須保持一致。

欄位與範例

欄位類型說明
modelstring必填,公開模型 ID
promptstring必填,生成或編輯描述
resolutionstring1K2K
aspect_ratiostring上表七種長寬比之一
sizestringWIDTHxHEIGHT,由 PopGo 轉換
ninteger選填,通常為 1
response_formatstringurlb64_json
imagefile/edits 的 multipart 參考檔案
curl https://api.popgo.site/v1/images/generations \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"model":"YOUR_MODEL","prompt":"A neon city street in the rain, realistic photography","resolution":"2K","aspect_ratio":"16:9","n":1}'

限制與錯誤

resolution 不可傳 4K,長寬比必須使用列出的七種值,尺寸不可超過 2K 範圍。模型 ID 中的 quality 不是請求欄位;未列出的 qualitystyle 不要傳。編輯使用 multipart 檔案。回應可為 data[].url 或不含前綴的 data[].b64_json,計費依即時配置。