GPT
GPT Image

phatchau036/gpt-image-2

Model ID: phatchau036/gpt-image-2
Family
GPT
Context
Not specified
Per request
0.00184 USD
Requests
2.7K
Success
95.0%
Tokens
1.88M
Uptime 97.32%
24h agoNow
7 days agoNow

Pricing

Per request
0.00184 USD
Supported endpoints
https://api.xah.io/v1/images/generations
https://api.xah.io/v1/images/edits
Method POST · application/json
Auth Bearer token (API key)
API kinds Image

Notes

This model supports both image generation and editing.

Share

curl 'https://api.xah.io/v1/images/generations' \
  -H 'Authorization: Bearer YOUR_API_KEY' \
  -H 'Content-Type: application/json' \
  -d '{
    "model": "gpt-image-2",
    "prompt": "Tạo ảnh con chó",
    "size": "1024x1024",
    "quality": "low"
}'
// Node.js / Browser
const res = await fetch('https://api.xah.io/v1/images/generations', {
  method: 'POST',
  headers: {
    'Authorization': 'Bearer YOUR_API_KEY',
    'Content-Type': 'application/json'
  },
  body: JSON.stringify({
    "model": "gpt-image-2",
    "prompt": "Tạo ảnh con chó",
    "size": "1024x1024",
    "quality": "low"
})
});
const data = await res.json();
console.log(data);
import requests

url = 'https://api.xah.io/v1/images/generations'
headers = {
    'Authorization': 'Bearer YOUR_API_KEY',
    'Content-Type': 'application/json',
}
payload = {
    "model": "gpt-image-2",
    "prompt": "Tạo ảnh con chó",
    "size": "1024x1024",
    "quality": "low"
}

res = requests.post(url, headers=headers, json=payload, timeout=120)
print(res.status_code, res.json())
{
    "model": "gpt-image-2",
    "prompt": "Tạo ảnh con chó",
    "size": "1024x1024",
    "quality": "low"
}
Reviews & comments
5.0 / 1 reviews
Loading reviews...
Contact Support
We are always ready to help you