MCP endpoint:
https://aigptimage.com/api/mcp
Local development endpoint:
http://localhost:3000/api/mcp
Transport:
Streamable HTTP / JSON-RPC 2.0
Authentication:
Authorization: Bearer sk_xxxxxxxxxxxxxxxxxxxx
The MCP endpoint uses the same API key system as the existing public API. Users can create API keys from the website API key settings page. MCP calls reuse the existing public API authentication, rate limits, credit deduction, task creation, and task query logic.
Available Tools
The MCP server exposes 4 tools:
| Tool | Description |
|---|---|
list_models | List available image and video generation models |
generate_image | Create an image generation task and return a taskId |
generate_video | Create a video generation task and return a taskId |
get_generation_status | Query task status and result URLs |
Image and video generation tasks are asynchronous. After calling generate_image or generate_video, use the returned taskId with get_generation_status to retrieve the result.
Supported Models
The MCP models are the same as the current public API models:
| Model | Type | Scene | Required Input |
|---|---|---|---|
gpt-image-2-text-to-image | image | Text to image | prompt |
gpt-image-2-image-to-image | image | Image to image | prompt, input_urls or image_urls |
seedance-2.0-text-to-video | video | Text to video | prompt |
seedance-2.0-image-to-video | video | Image to video | prompt, image_urls |
For the most accurate online model list and input fields, call list_models first.
MCP Client Configuration
Different MCP clients may use slightly different configuration field names, but the core configuration is the same:
{
"url": "https://aigptimage.com/api/mcp",
"headers": {
"Authorization": "Bearer sk_xxxxxxxxxxxxxxxxxxxx"
}
}
If your client supports Remote MCP / Streamable HTTP, use the URL and header above directly.
If your client only supports stdio MCP servers, use a remote MCP proxy tool. Example:
npx mcp-remote https://aigptimage.com/api/mcp \
--header "Authorization: Bearer sk_xxxxxxxxxxxxxxxxxxxx"
Example client configuration:
{
"mcpServers": {
"aigptimage": {
"command": "npx",
"args": [
"mcp-remote",
"https://aigptimage.com/api/mcp",
"--header",
"Authorization: Bearer sk_xxxxxxxxxxxxxxxxxxxx"
]
}
}
}
If your MCP client does not support custom request headers, it cannot directly use user API key authentication. In that case, connect through a proxy layer that supports headers.
JSON-RPC Examples
1. Initialize
curl https://aigptimage.com/api/mcp \
-H "Authorization: Bearer sk_xxxxxxxxxxxxxxxxxxxx" \
-H "Content-Type: application/json" \
-d '{
"jsonrpc": "2.0",
"id": 1,
"method": "initialize",
"params": {
"protocolVersion": "2025-06-18",
"capabilities": {},
"clientInfo": {
"name": "example-client",
"version": "1.0.0"
}
}
}'
2. List Tools
curl https://aigptimage.com/api/mcp \
-H "Authorization: Bearer sk_xxxxxxxxxxxxxxxxxxxx" \
-H "Content-Type: application/json" \
-d '{
"jsonrpc": "2.0",
"id": 2,
"method": "tools/list"
}'
3. List Models
curl https://aigptimage.com/api/mcp \
-H "Authorization: Bearer sk_xxxxxxxxxxxxxxxxxxxx" \
-H "Content-Type: application/json" \
-d '{
"jsonrpc": "2.0",
"id": 3,
"method": "tools/call",
"params": {
"name": "list_models",
"arguments": {
"mediaType": "image"
}
}
}'
mediaType is optional:
image
video
If mediaType is omitted, all models are returned.
4. Text to Image
curl https://aigptimage.com/api/mcp \
-H "Authorization: Bearer sk_xxxxxxxxxxxxxxxxxxxx" \
-H "Content-Type: application/json" \
-H "X-Request-Id: demo-image-001" \
-d '{
"jsonrpc": "2.0",
"id": 4,
"method": "tools/call",
"params": {
"name": "generate_image",
"arguments": {
"model": "gpt-image-2-text-to-image",
"prompt": "A cinematic product photo of a futuristic camera on a clean studio table",
"aspect_ratio": "1:1",
"resolution": "1024x1024",
"quality": "high",
"output_format": "png"
}
}
}'
Example response:
{
"jsonrpc": "2.0",
"id": 4,
"result": {
"content": [
{
"type": "text",
"text": "{\n \"taskId\": \"task_xxx\",\n \"model\": \"gpt-image-2-text-to-image\",\n \"state\": \"waiting\"\n}"
}
],
"structuredContent": {
"taskId": "task_xxx",
"model": "gpt-image-2-text-to-image",
"state": "waiting"
},
"isError": false
}
}
5. Image to Image
curl https://aigptimage.com/api/mcp \
-H "Authorization: Bearer sk_xxxxxxxxxxxxxxxxxxxx" \
-H "Content-Type: application/json" \
-d '{
"jsonrpc": "2.0",
"id": 5,
"method": "tools/call",
"params": {
"name": "generate_image",
"arguments": {
"model": "gpt-image-2-image-to-image",
"prompt": "Turn this image into a polished editorial product shot",
"input_urls": [
"https://example.com/input.png"
],
"aspect_ratio": "1:1",
"quality": "high"
}
}
}'
6. Text to Video
curl https://aigptimage.com/api/mcp \
-H "Authorization: Bearer sk_xxxxxxxxxxxxxxxxxxxx" \
-H "Content-Type: application/json" \
-H "X-Request-Id: demo-video-001" \
-d '{
"jsonrpc": "2.0",
"id": 6,
"method": "tools/call",
"params": {
"name": "generate_video",
"arguments": {
"model": "seedance-2.0-text-to-video",
"prompt": "A slow cinematic dolly shot through a neon city street at night",
"aspect_ratio": "16:9",
"resolution": "1080p",
"duration": "5",
"generate_audio": false
}
}
}'
7. Image to Video
curl https://aigptimage.com/api/mcp \
-H "Authorization: Bearer sk_xxxxxxxxxxxxxxxxxxxx" \
-H "Content-Type: application/json" \
-d '{
"jsonrpc": "2.0",
"id": 7,
"method": "tools/call",
"params": {
"name": "generate_video",
"arguments": {
"model": "seedance-2.0-image-to-video",
"prompt": "Animate the subject with a gentle camera push-in and natural lighting",
"image_urls": [
"https://example.com/reference.jpg"
],
"aspect_ratio": "16:9",
"resolution": "1080p",
"duration": "5"
}
}
}'
8. Query Task Result
curl https://aigptimage.com/api/mcp \
-H "Authorization: Bearer sk_xxxxxxxxxxxxxxxxxxxx" \
-H "Content-Type: application/json" \
-d '{
"jsonrpc": "2.0",
"id": 8,
"method": "tools/call",
"params": {
"name": "get_generation_status",
"arguments": {
"taskId": "task_xxx"
}
}
}'
Task states:
| state | Description |
|---|---|
waiting | The task is queued or generating |
success | The task completed successfully; resultJson contains result URLs |
fail | The task failed; check failCode and failMsg |
Successful result example:
{
"taskId": "task_xxx",
"model": "gpt-image-2-text-to-image",
"state": "success",
"resultJson": "{\"resultUrls\":[\"https://...\"]}",
"failCode": null,
"failMsg": null,
"costTime": 18000,
"completeTime": 1760000000000,
"createTime": 1759999982000
}
Argument Formats
generate_image and generate_video support two argument formats.
Pass fields directly:
{
"model": "gpt-image-2-text-to-image",
"prompt": "A clean product photo",
"aspect_ratio": "1:1"
}
Or pass a full input object:
{
"model": "gpt-image-2-text-to-image",
"input": {
"prompt": "A clean product photo",
"aspect_ratio": "1:1"
}
}
Both formats are mapped to the existing public API request structure.
Callback URL
When creating a task, you can pass callBackUrl or callbackUrl:
{
"model": "seedance-2.0-text-to-video",
"prompt": "A cinematic video",
"callBackUrl": "https://your-domain.com/webhooks/aigptimage"
}
Callback handling reuses the existing public API task callback logic.
Idempotent Requests
When creating a task, pass an X-Request-Id request header:
X-Request-Id: your-unique-request-id
For the same API key, the same X-Request-Id will reuse an existing task. This prevents duplicate task creation and duplicate credit charges when clients retry requests.
Credits, Rate Limits, and Billing
MCP uses the same rules as the existing public API:
| MCP Tool | Reused Rate Limit Endpoint |
|---|---|
generate_image | jobs.createTask |
generate_video | jobs.createTask |
get_generation_status | jobs.recordInfo |
Notes:
- Creating a task checks the user's remaining credits.
- Creating a task calculates credit cost from the selected model and parameters.
- Querying a task does not create a new task.
- API key active task limits still apply.
- When rate limited, the tool result returns
isError: trueand includesretryAfter,limit,tier, andwindowSeconds.
Error Handling
MCP has two error categories:
- JSON-RPC protocol errors, such as unknown methods or invalid request format.
- Tool execution errors, such as insufficient credits, invalid parameters, task not found, or rate limits.
Tool execution error example:
{
"jsonrpc": "2.0",
"id": 9,
"result": {
"content": [
{
"type": "text",
"text": "{\n \"error\": \"insufficient credits\"\n}"
}
],
"structuredContent": {
"error": "insufficient credits"
},
"isError": true
}
}
Common errors:
| Error | Cause |
|---|---|
authentication failed | Missing API key, invalid API key format, or disabled API key |
model is not supported | The model ID is not in the public API allowlist |
prompt is required | Missing prompt |
input_urls is required | Image-to-image request is missing input images |
too many active tasks | The API key has reached its active task limit |
rate limit exceeded | The request rate exceeded the current plan limit |
insufficient credits | The user does not have enough credits |
task not found | The task ID does not exist or does not belong to the current API key |
Security Recommendations
- Do not put API keys in frontend code.
- For server-side MCP calls, read API keys from environment variables.
- Create a separate API key for each integration so it can be revoked independently.
- In production, set your own
X-Request-Idto make retries and duplicate task issues easier to debug. - Do not pass private user image URLs to untrusted MCP clients.
Local Verification
Start the project:
pnpm dev
Check MCP metadata:
curl http://localhost:3000/api/mcp
Test the tool list with a local API key:
curl http://localhost:3000/api/mcp \
-H "Authorization: Bearer sk_xxxxxxxxxxxxxxxxxxxx" \
-H "Content-Type: application/json" \
-d '{
"jsonrpc": "2.0",
"id": 1,
"method": "tools/list"
}'
AI GPT Image is an online AI image generator and editor powered by GPT Image 2. It helps users create high-quality AI images from text prompts, transform existing photos with image-to-image AI, edit visuals using natural language, upscale images, and turn creative ideas into professional visual assets.
Unlike traditional AI image tools, AI GPT Image focuses on practical visual creation workflows. Users can generate realistic portraits, social media graphics, product images, posters, UI mockups, diagrams, storyboards, thumbnails, anime-style artwork, game assets, and commercial design concepts in just a few steps.
GPT Image 2 brings major improvements in image quality, prompt understanding, text rendering, multilingual visual design, realistic lighting, material textures, composition control, and style consistency. This makes AI GPT Image especially useful for creators who need images with readable text, strong visual structure, and production-ready design details.
AI GPT Image is suitable for content creators, marketers, designers, e-commerce sellers, startup teams, indie hackers, AI creators, bloggers, YouTubers, social media managers, and anyone who wants to create professional images without complex design software.
Main features include:
- Text-to-image generation with GPT Image 2
- Image-to-image transformation and AI photo editing
- Natural language image editing
- AI image upscaling
- AI video generation workflow
- Prompt examples and AI image prompt resources
- Support for portraits, posters, product photos, thumbnails, UI concepts, infographics, storyboards, and commercial visuals
- Simple online workspace for fast creative production
AI GPT Image is ideal for creating YouTube thumbnails, blog covers, product marketing images, social media posts, ad creatives, brand visuals, character concepts, cinematic storyboards, educational diagrams, and AI-generated design mockups.
Whether you are building content, testing visual ideas, creating marketing assets, or exploring the latest GPT Image 2 model capabilities, AI GPT Image gives you a fast and practical way to generate, edit, and enhance images online.
Server Config
{
"mcpServers": {
"aigptimage": {
"command": "npx",
"args": [
"mcp-remote",
"https://aigptimage.com/api/mcp",
"--header",
"Authorization: Bearer sk_xxxxxxxxxxxxxxxxxxxx"
]
}
}
}