
Openai GPT Image 1 Edit API by OpenAI
OpenAI's gpt-image-1 enables image generation and image editing via OpenAI's image API, ideal for creating and refining images. Ready-to-use REST inference API, best performance, no coldstarts, affordable pricing.
コード例
import requests
import time
# Step 1: Start image generation
generate_url = "https://api.atlascloud.ai/api/v1/model/generateImage"
headers = {
"Content-Type": "application/json",
"Authorization": "Bearer $ATLASCLOUD_API_KEY"
}
data = {
"model": "openai/gpt-image-1/edit",
"prompt": "A beautiful landscape with mountains and lake",
"width": 512,
"height": 512,
"steps": 20,
"guidance_scale": 7.5,
}
generate_response = requests.post(generate_url, headers=headers, json=data)
generate_result = generate_response.json()
prediction_id = generate_result["data"]["id"]
# Step 2: Poll for result
poll_url = f"https://api.atlascloud.ai/api/v1/model/prediction/{prediction_id}"
def check_status():
while True:
response = requests.get(poll_url, headers={"Authorization": "Bearer $ATLASCLOUD_API_KEY"})
result = response.json()
if result["data"]["status"] == "completed":
print("Generated image:", result["data"]["outputs"][0])
return result["data"]["outputs"][0]
elif result["data"]["status"] == "failed":
raise Exception(result["data"]["error"] or "Generation failed")
else:
# Still processing, wait 2 seconds
time.sleep(2)
image_url = check_status()インストール
お使いの言語に必要なパッケージをインストールしてください。
pip install requests認証
すべての API リクエストには API キーによる認証が必要です。API キーは Atlas Cloud ダッシュボードから取得できます。
export ATLASCLOUD_API_KEY="your-api-key-here"HTTP ヘッダー
import os
API_KEY = os.environ.get("ATLASCLOUD_API_KEY")
headers = {
"Content-Type": "application/json",
"Authorization": f"Bearer {API_KEY}"
}API キーをクライアントサイドのコードや公開リポジトリに公開しないでください。代わりに環境変数またはバックエンドプロキシを使用してください。
リクエストを送信
import requests
url = "https://api.atlascloud.ai/api/v1/model/generateImage"
headers = {
"Content-Type": "application/json",
"Authorization": "Bearer $ATLASCLOUD_API_KEY"
}
data = {
"model": "your-model",
"prompt": "A beautiful landscape"
}
response = requests.post(url, headers=headers, json=data)
print(response.json())リクエストを送信
非同期生成リクエストを送信します。API は予測 ID を返し、それを使用してステータスの確認や結果の取得ができます。
/api/v1/model/generateImageリクエストボディ
import requests
url = "https://api.atlascloud.ai/api/v1/model/generateImage"
headers = {
"Content-Type": "application/json",
"Authorization": "Bearer $ATLASCLOUD_API_KEY"
}
data = {
"model": "openai/gpt-image-1/edit",
"input": {
"prompt": "A beautiful landscape with mountains and lake"
}
}
response = requests.post(url, headers=headers, json=data)
result = response.json()
print(f"Prediction ID: {result['id']}")
print(f"Status: {result['status']}")レスポンス
{
"id": "pred_abc123",
"status": "processing",
"model": "model-name",
"created_at": "2025-01-01T00:00:00Z"
}ステータスを確認
予測エンドポイントをポーリングして、リクエストの現在のステータスを確認します。
/api/v1/model/prediction/{prediction_id}ポーリング例
import requests
import time
prediction_id = "pred_abc123"
url = f"https://api.atlascloud.ai/api/v1/model/prediction/{prediction_id}"
headers = { "Authorization": "Bearer $ATLASCLOUD_API_KEY" }
while True:
response = requests.get(url, headers=headers)
result = response.json()
status = result["data"]["status"]
print(f"Status: {status}")
if status in ["completed", "succeeded"]:
output_url = result["data"]["outputs"][0]
print(f"Output URL: {output_url}")
break
elif status == "failed":
print(f"Error: {result['data'].get('error', 'Unknown')}")
break
time.sleep(3)ステータス値
processingリクエストはまだ処理中です。completed生成が完了しました。出力が利用可能です。succeeded生成が成功しました。出力が利用可能です。failed生成に失敗しました。エラーフィールドを確認してください。完了レスポンス
{
"data": {
"id": "pred_abc123",
"status": "completed",
"outputs": [
"https://storage.atlascloud.ai/outputs/result.png"
],
"metrics": {
"predict_time": 8.3
},
"created_at": "2025-01-01T00:00:00Z",
"completed_at": "2025-01-01T00:00:10Z"
}
}ファイルをアップロード
Atlas Cloud ストレージにファイルをアップロードし、API リクエストで使用できる URL を取得します。multipart/form-data を使用してアップロードします。
/api/v1/model/uploadMediaアップロード例
import requests
url = "https://api.atlascloud.ai/api/v1/model/uploadMedia"
headers = { "Authorization": "Bearer $ATLASCLOUD_API_KEY" }
with open("image.png", "rb") as f:
files = {"file": ("image.png", f, "image/png")}
response = requests.post(url, headers=headers, files=files)
result = response.json()
download_url = result["data"]["download_url"]
print(f"File URL: {download_url}")レスポンス
{
"data": {
"download_url": "https://storage.atlascloud.ai/uploads/abc123/image.png",
"file_name": "image.png",
"content_type": "image/png",
"size": 1024000
}
}入力 Schema
以下のパラメータがリクエストボディで使用できます。
利用可能なパラメータはありません。
リクエストボディの例
{
"model": "openai/gpt-image-1/edit"
}出力 Schema
API は生成された出力 URL を含む予測レスポンスを返します。
レスポンス例
{
"id": "pred_abc123",
"status": "completed",
"model": "model-name",
"outputs": [
"https://storage.atlascloud.ai/outputs/result.png"
],
"metrics": {
"predict_time": 8.3
},
"created_at": "2025-01-01T00:00:00Z",
"completed_at": "2025-01-01T00:00:10Z"
}Atlas Cloud Skills
Atlas Cloud Skills は 300 以上の AI モデルを AI コーディングアシスタントに直接統合します。ワンコマンドでインストールし、自然言語で画像・動画生成や LLM との対話が可能です。
対応クライアント
インストール
npx skills add AtlasCloudAI/atlas-cloud-skillsAPI キーの設定
Atlas Cloud ダッシュボードから API キーを取得し、環境変数として設定してください。
export ATLASCLOUD_API_KEY="your-api-key-here"機能
インストール後、AI アシスタントで自然言語を使用してすべての Atlas Cloud モデルにアクセスできます。
MCP Server
Atlas Cloud MCP Server は Model Context Protocol を通じて IDE と 300 以上の AI モデルを接続します。MCP 対応のあらゆるクライアントで動作します。
対応クライアント
インストール
npx -y atlascloud-mcp設定
以下の設定を IDE の MCP 設定ファイルに追加してください。
{
"mcpServers": {
"atlascloud": {
"command": "npx",
"args": [
"-y",
"atlascloud-mcp"
],
"env": {
"ATLASCLOUD_API_KEY": "your-api-key-here"
}
}
}
}利用可能なツール
APIスキーマ
スキーマが利用できません利用可能な例がありません
OpenAI GPT-Image-1-Edit
Edit and transform images with natural language using OpenAI's GPT-Image-1-Edit. This versatile model understands your instructions to apply style changes, modifications, and creative transformations — with optional mask support for precise regional editing and multiple quality tiers to match your needs and budget.
Why It Looks Great
- Natural language editing: Describe transformations in plain text — style changes, modifications, enhancements.
- Mask support: Use mask images for precise control over which areas to edit.
- Quality tiers: Choose from
low,medium, orhighquality based on your needs. - Multiple sizes: Output in square (
1024x1024) or rectangular (1024x1536,1536x1024) formats. - Style transformation: Excels at converting images to different artistic styles.
- OpenAI quality: Powered by advanced vision-language understanding.
Parameters
| Parameter | Required | Description |
|---|---|---|
prompt | Yes | Text instruction describing the edit or transformation you want. |
image | Yes | Source image to edit (upload or public URL). |
quality | No | Output quality: low, medium, or high. Default: medium. |
mask_image | No | Optional mask to specify edit regions (upload or URL). |
size | No | Output dimensions: 1024x1024, 1024x1536, or 1536x1024. |
enable_sync_mode | No | API only: Waits for result and returns it directly. |
enable_base64_output | No | API only: Returns base64 string instead of URL. |
How to Use
- Write your edit instruction — describe the transformation you want (e.g.
"Become a comic style"). - Upload your image — drag and drop or paste a public URL.
- Choose quality — select
low,medium, orhighbased on your needs. - Add mask (optional) — upload a mask image to limit edits to specific areas.
- Select size — choose your desired output dimensions.
- Run — click the button to apply the edit.
- Download — preview and save your transformed image.
Quick Reference
| Quality | 1024x1024 | 1024x1536 / 1536x1024 |
|---|---|---|
| Low | $0.011 | $0.016 |
| Medium | $0.042 | $0.063 |
| High | $0.167 | $0.250 |
Best Use Cases
- Style Transfer — Convert photos to comic, cartoon, painting, or other artistic styles.
- Creative Transformation — Reimagine images with different aesthetics or themes.
- Regional Editing — Use masks to edit specific areas while preserving the rest.
- Content Enhancement — Improve or modify specific aspects of images.
- Artistic Interpretation — Transform photos into various art forms.
Example Prompts
"Become a comic style"
"Transform into a watercolor painting"
"Make it look like a vintage photograph from the 1950s"
"Convert to anime style illustration"
"Apply a cyberpunk neon aesthetic"
"Turn into a pencil sketch"
Quality Guide
| Quality | Best For | Trade-off |
|---|---|---|
| Low | Quick previews, testing concepts, high-volume processing | Fastest, most affordable, lower detail |
| Medium | General use, social media, balanced needs | Good quality/cost balance |
| High | Professional work, final deliverables, maximum detail | Highest quality, premium price |
Pro Tips for Best Results
- Start with
mediumquality to test your prompt, then upgrade tohighfor final output. - Use masks when you want to preserve specific areas untouched.
- Be specific about the target style —
"comic style","oil painting","anime". - For style transfers, simpler source images often produce cleaner results.
- Rectangular sizes work well for portraits (
1024x1536) or landscapes (1536x1024). - The model interprets style instructions creatively — embrace the artistic interpretation.
Notes
- If using URLs for images or masks, ensure they are publicly accessible.
- The
enable_sync_modeandenable_base64_outputoptions are only available through the API. - Mask images should be black and white, where white indicates areas to edit.
- Processing time varies by quality level — higher quality takes longer.






