跳转到主要内容
POST
Generate or edit an image with AI (chatimg.ai)

授权

Authorization
string
header
必填

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

请求体

application/json
imageUrl
string
必填

URL of the source image to process. Supports http URLs and base64 encoded images (with or without data:image/... prefix)

Minimum string length: 1
prompt
string

Prompt describing the desired transformation (default: ghibli style)

model
enum<string>
默认值:nanobanana-2-lite

AI model to use (default: nanobanana-2-lite). Pricing per image: openai: 25 credits, gpt-image-2: 50 credits, gpt-image-2.5-flare: 50 credits, gpt-image-2.5-sunburst: 50 credits, gpt-image-2.6-flare: 50 credits, gpt-image-2.6-sunburst: 50 credits, mai-image-2.6-flash: 20 credits, flux: 12 credits, gemini: 10 credits, nanobanana-pro: 30 credits, nanobanana-2-lite: 12 credits, nanobanana-2: 20 credits, nanobanana-2.1: 20 credits, grok: 30 credits, ideogram-4.5: 35 credits, seedream: 15 credits, seedream-5-flash: 12 credits, flux3: 18 credits, flux3-klein: 12 credits, krea-3: 15 credits, hy-image-3.5: 12 credits, qwen: 8 credits, qwen-image-2.1: 8 credits, qwen-image-2.1-turbo: 8 credits, qwen-image-2.1-pro: 15 credits, qwen-image-3.0: 18 credits, qwen-image-3.0-pro: 25 credits, z-image-turbo: 5 credits, flux-2-flex: 25 credits

可用选项:
openai,
gpt-image-2,
gpt-image-2.5-flare,
gpt-image-2.5-sunburst,
gpt-image-2.6-flare,
gpt-image-2.6-sunburst,
mai-image-2.6-flash,
flux,
gemini,
nanobanana-pro,
nanobanana-2-lite,
nanobanana-2,
nanobanana-2.1,
grok,
ideogram-4.5,
seedream,
seedream-5-flash,
flux3,
flux3-klein,
krea-3,
hy-image-3.5,
qwen,
qwen-image-2.1,
qwen-image-2.1-turbo,
qwen-image-2.1-pro,
qwen-image-3.0,
qwen-image-3.0-pro,
z-image-turbo,
flux-2-flex
resolution
enum<string>

Output resolution tier: 1K (default), 2K or 4K. Only models that support tiers honor it; 2K costs 2.5x, 4K costs 5x. Others keep their default size and price.

可用选项:
1K,
2K,
4K

响应

Successful response

taskId
string
必填

Unique identifier for the generation task

status
enum<string>
必填

Initial status of the generation task (pending)

可用选项:
pending,
completed,
error,
unknown
imageUrl
string
必填

The source image URL, used as the key when polling /v1/imageStatus

timestamp
number
必填

Timestamp when the task was created

costCredits
number
必填

Credits charged for this generation

balanceRemaining
number
必填

Remaining credits balance after this charge