GPT Image 2 画像編集
curl --request POST \
--url https://api.highwayapi.ai/v3/gpt-image-2-edit \
--header 'Authorization: <authorization>' \
--header 'Content-Type: <content-type>' \
--data '
{
"n": 123,
"mask": "<string>",
"size": "<string>",
"image": "<string>",
"prompt": "<string>",
"quality": "<string>",
"background": "<string>",
"output_format": "<string>"
}
'import requests
url = "https://api.highwayapi.ai/v3/gpt-image-2-edit"
payload = {
"n": 123,
"mask": "<string>",
"size": "<string>",
"image": "<string>",
"prompt": "<string>",
"quality": "<string>",
"background": "<string>",
"output_format": "<string>"
}
headers = {
"Content-Type": "<content-type>",
"Authorization": "<authorization>"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': '<content-type>', Authorization: '<authorization>'},
body: JSON.stringify({
n: 123,
mask: '<string>',
size: '<string>',
image: '<string>',
prompt: '<string>',
quality: '<string>',
background: '<string>',
output_format: '<string>'
})
};
fetch('https://api.highwayapi.ai/v3/gpt-image-2-edit', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.highwayapi.ai/v3/gpt-image-2-edit",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'n' => 123,
'mask' => '<string>',
'size' => '<string>',
'image' => '<string>',
'prompt' => '<string>',
'quality' => '<string>',
'background' => '<string>',
'output_format' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: <authorization>",
"Content-Type: <content-type>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.highwayapi.ai/v3/gpt-image-2-edit"
payload := strings.NewReader("{\n \"n\": 123,\n \"mask\": \"<string>\",\n \"size\": \"<string>\",\n \"image\": \"<string>\",\n \"prompt\": \"<string>\",\n \"quality\": \"<string>\",\n \"background\": \"<string>\",\n \"output_format\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Content-Type", "<content-type>")
req.Header.Add("Authorization", "<authorization>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.highwayapi.ai/v3/gpt-image-2-edit")
.header("Content-Type", "<content-type>")
.header("Authorization", "<authorization>")
.body("{\n \"n\": 123,\n \"mask\": \"<string>\",\n \"size\": \"<string>\",\n \"image\": \"<string>\",\n \"prompt\": \"<string>\",\n \"quality\": \"<string>\",\n \"background\": \"<string>\",\n \"output_format\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.highwayapi.ai/v3/gpt-image-2-edit")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = '<content-type>'
request["Authorization"] = '<authorization>'
request.body = "{\n \"n\": 123,\n \"mask\": \"<string>\",\n \"size\": \"<string>\",\n \"image\": \"<string>\",\n \"prompt\": \"<string>\",\n \"quality\": \"<string>\",\n \"background\": \"<string>\",\n \"output_format\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"images": [
"<string>"
]
}画像
GPT Image 2 画像編集
POST
/
v3
/
gpt-image-2-edit
GPT Image 2 画像編集
curl --request POST \
--url https://api.highwayapi.ai/v3/gpt-image-2-edit \
--header 'Authorization: <authorization>' \
--header 'Content-Type: <content-type>' \
--data '
{
"n": 123,
"mask": "<string>",
"size": "<string>",
"image": "<string>",
"prompt": "<string>",
"quality": "<string>",
"background": "<string>",
"output_format": "<string>"
}
'import requests
url = "https://api.highwayapi.ai/v3/gpt-image-2-edit"
payload = {
"n": 123,
"mask": "<string>",
"size": "<string>",
"image": "<string>",
"prompt": "<string>",
"quality": "<string>",
"background": "<string>",
"output_format": "<string>"
}
headers = {
"Content-Type": "<content-type>",
"Authorization": "<authorization>"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': '<content-type>', Authorization: '<authorization>'},
body: JSON.stringify({
n: 123,
mask: '<string>',
size: '<string>',
image: '<string>',
prompt: '<string>',
quality: '<string>',
background: '<string>',
output_format: '<string>'
})
};
fetch('https://api.highwayapi.ai/v3/gpt-image-2-edit', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.highwayapi.ai/v3/gpt-image-2-edit",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'n' => 123,
'mask' => '<string>',
'size' => '<string>',
'image' => '<string>',
'prompt' => '<string>',
'quality' => '<string>',
'background' => '<string>',
'output_format' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: <authorization>",
"Content-Type: <content-type>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.highwayapi.ai/v3/gpt-image-2-edit"
payload := strings.NewReader("{\n \"n\": 123,\n \"mask\": \"<string>\",\n \"size\": \"<string>\",\n \"image\": \"<string>\",\n \"prompt\": \"<string>\",\n \"quality\": \"<string>\",\n \"background\": \"<string>\",\n \"output_format\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Content-Type", "<content-type>")
req.Header.Add("Authorization", "<authorization>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.highwayapi.ai/v3/gpt-image-2-edit")
.header("Content-Type", "<content-type>")
.header("Authorization", "<authorization>")
.body("{\n \"n\": 123,\n \"mask\": \"<string>\",\n \"size\": \"<string>\",\n \"image\": \"<string>\",\n \"prompt\": \"<string>\",\n \"quality\": \"<string>\",\n \"background\": \"<string>\",\n \"output_format\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.highwayapi.ai/v3/gpt-image-2-edit")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = '<content-type>'
request["Authorization"] = '<authorization>'
request.body = "{\n \"n\": 123,\n \"mask\": \"<string>\",\n \"size\": \"<string>\",\n \"image\": \"<string>\",\n \"prompt\": \"<string>\",\n \"quality\": \"<string>\",\n \"background\": \"<string>\",\n \"output_format\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"images": [
"<string>"
]
}OpenAI GPT Image 2 画像編集 API。テキストプロンプトに基づいて画像を編集し、マスク修復、透明背景、およびさまざまな品質/サイズオプションに対応しています。
リクエストヘッダー
string
必須
列挙値:
application/jsonstring
必須
Bearer 認証形式: Bearer {{API Key}}。
リクエストボディ
integer
デフォルト:1
生成する画像の数。実際に返される数はリクエスト数より少ない場合があります。値の範囲:[1, 10]
string
追加画像。その完全に透明な領域が編集対象の位置を示します。alpha チャンネル付きの PNG 形式である必要があります。
string
デフォルト:"1024x1024"
生成画像のサイズ。選択可能な値:
auto, 688x2048, 880x2048, 1024x1024, 1024x1536, 1024x2048, 1152x2048, 1360x2048, 1536x1024, 1536x2048, 2048x688, 2048x880, 2048x1024, 2048x1152, 2048x1360, 2048x1536, 2048x2048, 2160x3840, 3840x2160string
必須
編集する画像。単一の画像 URL/base64、または画像配列を指定できます。対応形式:PNG、JPEG、GIF、WebP。
string
必須
必要な編集効果を説明するテキストプロンプト。最大長は 32000 文字です。長さ制限:0 - 32000
string
デフォルト:"low"
生成画像の品質。品質が高いほど時間がかかり、コストも高くなります。選択可能な値:
low, medium, highstring
デフォルト:"auto"
背景を不透明にするか、自動検出するか。選択可能な値:
opaque, autostring
デフォルト:"png"
出力画像形式。選択可能な値:
png, jpegレスポンス情報
string[]
生成された画像 URL の配列。
⌘I