API Documentation
Use the AIGPTImage API to create image and video generation tasks from your backend.
The API is asynchronous by default. A successful create request returns a taskId; your server then polls the task status endpoint until the result is ready.
What you can do
- Create image generation tasks.
- Create video generation tasks.
- Query task status and final result URLs.
- Reuse the same credit balance and pricing rules as the web app.
Base URL
https://aigptimage.comUse https://aigptimage.com as the production API base URL.
Authentication
Create an API key from the API Keys page, then click Create API Key.
Send it with every request:
Authorization: Bearer sk-your-api-keyCore endpoints
| Endpoint | Method | Purpose |
|---|---|---|
/api/v1/jobs/createTask | POST | Create an image or video generation task |
/api/v1/jobs/recordInfo | GET | Query a task by taskId |
Supported models
| Model ID | Type | Scene | Required input | Market path | Docs |
|---|---|---|---|---|---|
| gpt-image-2-text-to-image | image | Text to image | prompt | /market/gpt/gpt-image-2-text-to-image.md | Open |
| gpt-image-2-image-to-image | image | Image to image | prompt, image_urls | /market/gpt/gpt-image-2-image-to-image.md | Open |
| seedance-2.0-text-to-video | video | Text to video | prompt | /market/seedance/seedance-2.0-text-to-video.md | Open |
| seedance-2.0-image-to-video | video | Image to video | prompt, image_urls | /market/seedance/seedance-2.0-image-to-video.md | Open |
Credit consumption rules
Public API calls use the same credit balance and pricing engine as the web app.
Current public models
| Public model | Media type | Billing rule | Current credit cost |
|---|---|---|---|
gpt-image-2-text-to-image | Image | Fixed credits per output, based on resolution | 1K = 3 credits, 2K = 5 credits, 4K = 8 credits |
gpt-image-2-image-to-image | Image | Fixed credits per output, based on resolution | 1K = 3 credits, 2K = 5 credits, 4K = 8 credits |
seedance-2.0-text-to-video | Video | Credits per second, based on resolution and duration | 480p = 20/s, 720p = 40/s, 1080p = 80/s |
seedance-2.0-image-to-video | Video | Credits per second, based on resolution and duration | 480p = 20/s, 720p = 40/s, 1080p = 80/s |
GPT Image 2 pricing
GPT Image 2 image generation uses a fixed-per-output pricing rule:
1K: 3 credits per image2K: 5 credits per image4K: 8 credits per image
This applies to both:
gpt-image-2-text-to-imagegpt-image-2-image-to-image
Seedance 2.0 pricing
Seedance 2.0 video generation uses a per-second pricing rule. Total credits depend on:
resolutionduration
| Resolution | Credits per second |
|---|---|
480p | 20 |
720p | 40 |
1080p | 80 |
This default mapping currently applies to both:
seedance-2.0-text-to-videoseedance-2.0-image-to-video
Default calculation examples
seedance-2.0-text-to-video,720p,5s:40 x 5 = 200creditsseedance-2.0-image-to-video,1080p,5s:80 x 5 = 400credits
Important notes
- API pricing is shared with the web app. There is no separate API-only credit wallet.
- The final credit cost is calculated when the task is created.
- If a request is invalid and the task is not created, credits are not consumed.
- If a task fails after credit reservation, the existing refund logic is applied.
Response format
All public API responses use the same shape:
{
"code": 200,
"msg": "success",
"data": {}
}Errors use the same format with a non-200 code and HTTP status.
Next step
Start with Getting Started, then integrate Create Task and Query Task.