API Docs

OpenAI Images API compatible. Plug into Claude Code, OpenClaw, Dify, and other tools.

Base URL

Base URL
https://aigc-pic.com/v1

Authentication

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
Example
# 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/models

Endpoints

POST/v1/images/generations

Generate images (synchronous, waits for result)

Request Parameters (JSON Body)

promptstring (required)

Image description, max 8000 characters

modelstring

Model name, default gpt-image-2-all

ninteger

Number of images 1-4, default 1 (1 credit each)

sizestring

Size, e.g. 1024x1024, 2048x2048

qualitystring

Quality: standard / hd

response_formatstring

Response format: url (default) / b64_json

Request Example

curl
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

JSON
{
  "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..."
    }
  ]
}
GET/v1/images/generations/:id

Retrieve a previous generation

curl
curl https://aigc-pic.com/v1/images/generations/PASTE_IMAGE_ID \
  -H "x-api-key: aigc_xxxxxxxxxxxx"
GET/v1/models

List available models (no auth required)

curl
curl https://aigc-pic.com/v1/models

Response

JSON
{
  "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" }
  ]
}
GET/v1/credits

Check credit balance

curl
curl https://aigc-pic.com/v1/credits \
  -H "x-api-key: aigc_xxxxxxxxxxxx"

Response

JSON
{
  "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 Format
{
  "error": {
    "message": "Human-readable error description",
    "type": "invalid_request_error | authentication_error | server_error",
    "code": "Error code"
  }
}
400

Invalid request parameters

401

API Key missing or invalid

402

Insufficient credits

403

Email not verified

500

Server error (credits auto-refunded)

How to Get an API Key

  1. Sign up and log in at aigc-pic.com
  2. Go to Account → API Keys
  3. Click "Create API Key" and copy the generated key
  4. Set the header: x-api-key: aigc_xxxxxxxx

Questions? Contact support or email us.