API Docs
OpenAI Images API compatible. Plug into Claude Code, OpenClaw, Dify, and other tools.
Base URL
https://aigc-pic.com/v1Authentication
Two authentication methods are supported:
- x-api-keyheader — create an API Key in your account settings
- Authorization: Bearer <token>header — JWT token obtained after login
# Option 1: x-api-key header
curl -H "x-api-key: aigc_xxxxxxxxxxxx" https://aigc-pic.com/v1/models
# Option 2: Bearer token
curl -H "Authorization: Bearer YOUR_JWT_TOKEN" https://aigc-pic.com/v1/modelsEndpoints
Generate images (synchronous, waits for result)
Request Parameters (JSON Body)
promptstring (required)Image description, max 8000 characters
modelstringModel name, default gpt-image-2-all
nintegerNumber of images 1-4, default 1 (1 credit each)
sizestringSize, e.g. 1024x1024, 2048x2048
qualitystringQuality: standard / hd
response_formatstringResponse format: url (default) / b64_json
Request Example
curl -X POST https://aigc-pic.com/v1/images/generations \
-H "x-api-key: aigc_xxxxxxxxxxxx" \
-H "Content-Type: application/json" \
-d '{
"prompt": "A cute orange tabby cat sitting on a windowsill watching the sunset, golden hour lighting, 4K",
"model": "gpt-image-2-all",
"n": 1,
"size": "1024x1024"
}'Success Response
{
"created": 1711234567,
"data": [
{
"url": "https://aigc-pic.com/uploads/xxx_0.png",
"revised_prompt": "An orange tabby cat lounging on a windowsill, golden sunlight streaming through..."
}
]
}Retrieve a previous generation
curl https://aigc-pic.com/v1/images/generations/PASTE_IMAGE_ID \
-H "x-api-key: aigc_xxxxxxxxxxxx"List available models (no auth required)
curl https://aigc-pic.com/v1/modelsResponse
{
"object": "list",
"data": [
{ "id": "gpt-image-2-all", "object": "model", "owned_by": "aigc-pic" },
{ "id": "gpt-image-2-vip", "object": "model", "owned_by": "aigc-pic" }
]
}Check credit balance
curl https://aigc-pic.com/v1/credits \
-H "x-api-key: aigc_xxxxxxxxxxxx"Response
{
"object": "credits",
"credits": 100,
"email": "[email protected]",
"email_verified": true
}Available Models
gpt-image-2-all
Full-featured model. Automatically selects optimal size from your prompt. Fast, ideal for daily use.
1 credit per generation
gpt-image-2-vip
High quality model with precise size control. Best for fine-tuned results.
1 credit per generation
Error Handling
All errors return OpenAI-compatible format:
{
"error": {
"message": "Human-readable error description",
"type": "invalid_request_error | authentication_error | server_error",
"code": "Error code"
}
}400Invalid request parameters
401API Key missing or invalid
402Insufficient credits
403Email not verified
500Server error (credits auto-refunded)
How to Get an API Key
- Sign up and log in at aigc-pic.com
- Go to Account → API Keys
- Click "Create API Key" and copy the generated key
- Set the header: x-api-key: aigc_xxxxxxxx
Questions? Contact support or email us.