复制
1. claude mcp add runapi -s user -- npx -y @runapi.ai/mcp
2. 重启 Claude Code
3. 粘贴这个 prompt:生成一张图像:"[ { "id": "pineapple_beach_v2", "type": "photorealistic advertising shot", "subject": { "item": "pineapple juice bottle", "label_text": "NFC Pineapple Juice", "pose": "slightly tilted forward" }, "environment": { "location": "tropical beach", "ground": "sunlit wet tropical sand", "background_elements": [ "gently swaying palm trees", "clear turquoise ocean with soft waves", "bright blue sky with thin clouds" ], "interactions": "a small wave splashes lightly against the bottle base" }, "surrounding_elements": [ "fresh pineapple slices with visible texture", "sparkling seawater droplets in mid-air" ], "lighting": { "description": "golden sunlight", "effects": "soft reflections on glass bottle" } }, { "id": "strawberry_mountain_v2", "type": "photorealistic advertising shot", "subject": { "item": "strawberry juice bottle", "label_text": "NFC Strawberry Juice", "details": "heavy condensation with frost accents" }, "environment": { "location": "high-altitude mountains", "ground": "icy rocks with light snow patches", "atmosphere": "crisp cold air with drifting mist" }, "surrounding_elements": [ "fresh strawberries partially resting on ice" ], "lighting": { "description": "soft sunrise light cutting through fog", "effects": "subtle glow around the bottle" }, "style_descriptors": [ "cinematic macro shot", "ultra high detail", "cold-meets-warm contrast", "deep red highlights", "fresh and premium feel", "hyper-realistic surface details" ], "parameters": "--ar 9:16 --stylize 250" }, { "id": "citrus_grove_v2", "type": "photorealistic advertising shot", "subject": { "item": "citrus blend juice bottle", "label_text": "NFC Citrus Mix", "pose": "centered upright" }, "environment": { "location": "lush citrus grove", "background_elements": [ "sunlit yellow and orange fruits hanging above", "soft green leaves framing the bottle" ] }, "action_elements": { "description": "fresh splash of clear water rising around the base", "items": [ "thin lemon slices", "juicy lime wedges", "bright orange segments" ] }, "lighting": { "description": "sun rays filtering through leaves", "tone": "vibrant citrus warmth" }, "parameters": "--ar 9:16 --stylize 250" }, { "id": "tropical_hammock_v2", "type": "photorealistic advertising shot", "subject": { "item": "tropical mixed Nestle juice bottle", "label_text": "NFC Tropical Juice", "pose": "relaxed tilt as if resting" }, "environment": { "location": "sunlit hammock between palm trees", "background": "soft-focus ocean horizon with glowing sunlight" }, "surrounding_elements": [ "fresh pineapple slices", "ripe mango slices", "orange wedges", "dragonfruit cubes" ], "mood_and_style": { "atmosphere": "luxury vacation vibe", "colors": "rich tropical saturation", "lighting": "warm cinematic highlights with soft shadows" }, "parameters": "--ar 9:16 --stylize 250" } ]"
复制
1. codex plugin install runapi-mcp@agents
2. 重启 Codex
3. 粘贴这个 prompt:生成一张图像:"[ { "id": "pineapple_beach_v2", "type": "photorealistic advertising shot", "subject": { "item": "pineapple juice bottle", "label_text": "NFC Pineapple Juice", "pose": "slightly tilted forward" }, "environment": { "location": "tropical beach", "ground": "sunlit wet tropical sand", "background_elements": [ "gently swaying palm trees", "clear turquoise ocean with soft waves", "bright blue sky with thin clouds" ], "interactions": "a small wave splashes lightly against the bottle base" }, "surrounding_elements": [ "fresh pineapple slices with visible texture", "sparkling seawater droplets in mid-air" ], "lighting": { "description": "golden sunlight", "effects": "soft reflections on glass bottle" } }, { "id": "strawberry_mountain_v2", "type": "photorealistic advertising shot", "subject": { "item": "strawberry juice bottle", "label_text": "NFC Strawberry Juice", "details": "heavy condensation with frost accents" }, "environment": { "location": "high-altitude mountains", "ground": "icy rocks with light snow patches", "atmosphere": "crisp cold air with drifting mist" }, "surrounding_elements": [ "fresh strawberries partially resting on ice" ], "lighting": { "description": "soft sunrise light cutting through fog", "effects": "subtle glow around the bottle" }, "style_descriptors": [ "cinematic macro shot", "ultra high detail", "cold-meets-warm contrast", "deep red highlights", "fresh and premium feel", "hyper-realistic surface details" ], "parameters": "--ar 9:16 --stylize 250" }, { "id": "citrus_grove_v2", "type": "photorealistic advertising shot", "subject": { "item": "citrus blend juice bottle", "label_text": "NFC Citrus Mix", "pose": "centered upright" }, "environment": { "location": "lush citrus grove", "background_elements": [ "sunlit yellow and orange fruits hanging above", "soft green leaves framing the bottle" ] }, "action_elements": { "description": "fresh splash of clear water rising around the base", "items": [ "thin lemon slices", "juicy lime wedges", "bright orange segments" ] }, "lighting": { "description": "sun rays filtering through leaves", "tone": "vibrant citrus warmth" }, "parameters": "--ar 9:16 --stylize 250" }, { "id": "tropical_hammock_v2", "type": "photorealistic advertising shot", "subject": { "item": "tropical mixed Nestle juice bottle", "label_text": "NFC Tropical Juice", "pose": "relaxed tilt as if resting" }, "environment": { "location": "sunlit hammock between palm trees", "background": "soft-focus ocean horizon with glowing sunlight" }, "surrounding_elements": [ "fresh pineapple slices", "ripe mango slices", "orange wedges", "dragonfruit cubes" ], "mood_and_style": { "atmosphere": "luxury vacation vibe", "colors": "rich tropical saturation", "lighting": "warm cinematic highlights with soft shadows" }, "parameters": "--ar 9:16 --stylize 250" } ]"
复制
1. npx @runapi.ai/mcp init cursor
2. 重启 Cursor
3. 粘贴这个 prompt:生成一张图像:"[ { "id": "pineapple_beach_v2", "type": "photorealistic advertising shot", "subject": { "item": "pineapple juice bottle", "label_text": "NFC Pineapple Juice", "pose": "slightly tilted forward" }, "environment": { "location": "tropical beach", "ground": "sunlit wet tropical sand", "background_elements": [ "gently swaying palm trees", "clear turquoise ocean with soft waves", "bright blue sky with thin clouds" ], "interactions": "a small wave splashes lightly against the bottle base" }, "surrounding_elements": [ "fresh pineapple slices with visible texture", "sparkling seawater droplets in mid-air" ], "lighting": { "description": "golden sunlight", "effects": "soft reflections on glass bottle" } }, { "id": "strawberry_mountain_v2", "type": "photorealistic advertising shot", "subject": { "item": "strawberry juice bottle", "label_text": "NFC Strawberry Juice", "details": "heavy condensation with frost accents" }, "environment": { "location": "high-altitude mountains", "ground": "icy rocks with light snow patches", "atmosphere": "crisp cold air with drifting mist" }, "surrounding_elements": [ "fresh strawberries partially resting on ice" ], "lighting": { "description": "soft sunrise light cutting through fog", "effects": "subtle glow around the bottle" }, "style_descriptors": [ "cinematic macro shot", "ultra high detail", "cold-meets-warm contrast", "deep red highlights", "fresh and premium feel", "hyper-realistic surface details" ], "parameters": "--ar 9:16 --stylize 250" }, { "id": "citrus_grove_v2", "type": "photorealistic advertising shot", "subject": { "item": "citrus blend juice bottle", "label_text": "NFC Citrus Mix", "pose": "centered upright" }, "environment": { "location": "lush citrus grove", "background_elements": [ "sunlit yellow and orange fruits hanging above", "soft green leaves framing the bottle" ] }, "action_elements": { "description": "fresh splash of clear water rising around the base", "items": [ "thin lemon slices", "juicy lime wedges", "bright orange segments" ] }, "lighting": { "description": "sun rays filtering through leaves", "tone": "vibrant citrus warmth" }, "parameters": "--ar 9:16 --stylize 250" }, { "id": "tropical_hammock_v2", "type": "photorealistic advertising shot", "subject": { "item": "tropical mixed Nestle juice bottle", "label_text": "NFC Tropical Juice", "pose": "relaxed tilt as if resting" }, "environment": { "location": "sunlit hammock between palm trees", "background": "soft-focus ocean horizon with glowing sunlight" }, "surrounding_elements": [ "fresh pineapple slices", "ripe mango slices", "orange wedges", "dragonfruit cubes" ], "mood_and_style": { "atmosphere": "luxury vacation vibe", "colors": "rich tropical saturation", "lighting": "warm cinematic highlights with soft shadows" }, "parameters": "--ar 9:16 --stylize 250" } ]"
复制
1. npx @runapi.ai/mcp init windsurf
2. 重启 Windsurf
3. 粘贴这个 prompt:生成一张图像:"[ { "id": "pineapple_beach_v2", "type": "photorealistic advertising shot", "subject": { "item": "pineapple juice bottle", "label_text": "NFC Pineapple Juice", "pose": "slightly tilted forward" }, "environment": { "location": "tropical beach", "ground": "sunlit wet tropical sand", "background_elements": [ "gently swaying palm trees", "clear turquoise ocean with soft waves", "bright blue sky with thin clouds" ], "interactions": "a small wave splashes lightly against the bottle base" }, "surrounding_elements": [ "fresh pineapple slices with visible texture", "sparkling seawater droplets in mid-air" ], "lighting": { "description": "golden sunlight", "effects": "soft reflections on glass bottle" } }, { "id": "strawberry_mountain_v2", "type": "photorealistic advertising shot", "subject": { "item": "strawberry juice bottle", "label_text": "NFC Strawberry Juice", "details": "heavy condensation with frost accents" }, "environment": { "location": "high-altitude mountains", "ground": "icy rocks with light snow patches", "atmosphere": "crisp cold air with drifting mist" }, "surrounding_elements": [ "fresh strawberries partially resting on ice" ], "lighting": { "description": "soft sunrise light cutting through fog", "effects": "subtle glow around the bottle" }, "style_descriptors": [ "cinematic macro shot", "ultra high detail", "cold-meets-warm contrast", "deep red highlights", "fresh and premium feel", "hyper-realistic surface details" ], "parameters": "--ar 9:16 --stylize 250" }, { "id": "citrus_grove_v2", "type": "photorealistic advertising shot", "subject": { "item": "citrus blend juice bottle", "label_text": "NFC Citrus Mix", "pose": "centered upright" }, "environment": { "location": "lush citrus grove", "background_elements": [ "sunlit yellow and orange fruits hanging above", "soft green leaves framing the bottle" ] }, "action_elements": { "description": "fresh splash of clear water rising around the base", "items": [ "thin lemon slices", "juicy lime wedges", "bright orange segments" ] }, "lighting": { "description": "sun rays filtering through leaves", "tone": "vibrant citrus warmth" }, "parameters": "--ar 9:16 --stylize 250" }, { "id": "tropical_hammock_v2", "type": "photorealistic advertising shot", "subject": { "item": "tropical mixed Nestle juice bottle", "label_text": "NFC Tropical Juice", "pose": "relaxed tilt as if resting" }, "environment": { "location": "sunlit hammock between palm trees", "background": "soft-focus ocean horizon with glowing sunlight" }, "surrounding_elements": [ "fresh pineapple slices", "ripe mango slices", "orange wedges", "dragonfruit cubes" ], "mood_and_style": { "atmosphere": "luxury vacation vibe", "colors": "rich tropical saturation", "lighting": "warm cinematic highlights with soft shadows" }, "parameters": "--ar 9:16 --stylize 250" } ]"
curl
Node.js
Ruby
Go
复制
curl -X POST https://runapi.ai/api/v1/gpt_image_2/text_to_image \
-H "Authorization: Bearer $RUNAPI_KEY" \
-H "Content-Type: application/json" \
--data-binary @- <<'JSON'
{
"model": "gpt-image-2",
"prompt": "[ { \"id\": \"pineapple_beach_v2\", \"type\": \"photorealistic advertising shot\", \"subject\": { \"item\": \"pineapple juice bottle\", \"label_text\": \"NFC Pineapple Juice\", \"pose\": \"slightly tilted forward\" }, \"environment\": { \"location\": \"tropical beach\", \"ground\": \"sunlit wet tropical sand\", \"background_elements\": [ \"gently swaying palm trees\", \"clear turquoise ocean with soft waves\", \"bright blue sky with thin clouds\" ], \"interactions\": \"a small wave splashes lightly against the bottle base\" }, \"surrounding_elements\": [ \"fresh pineapple slices with visible texture\", \"sparkling seawater droplets in mid-air\" ], \"lighting\": { \"description\": \"golden sunlight\", \"effects\": \"soft reflections on glass bottle\" } }, { \"id\": \"strawberry_mountain_v2\", \"type\": \"photorealistic advertising shot\", \"subject\": { \"item\": \"strawberry juice bottle\", \"label_text\": \"NFC Strawberry Juice\", \"details\": \"heavy condensation with frost accents\" }, \"environment\": { \"location\": \"high-altitude mountains\", \"ground\": \"icy rocks with light snow patches\", \"atmosphere\": \"crisp cold air with drifting mist\" }, \"surrounding_elements\": [ \"fresh strawberries partially resting on ice\" ], \"lighting\": { \"description\": \"soft sunrise light cutting through fog\", \"effects\": \"subtle glow around the bottle\" }, \"style_descriptors\": [ \"cinematic macro shot\", \"ultra high detail\", \"cold-meets-warm contrast\", \"deep red highlights\", \"fresh and premium feel\", \"hyper-realistic surface details\" ], \"parameters\": \"--ar 9:16 --stylize 250\" }, { \"id\": \"citrus_grove_v2\", \"type\": \"photorealistic advertising shot\", \"subject\": { \"item\": \"citrus blend juice bottle\", \"label_text\": \"NFC Citrus Mix\", \"pose\": \"centered upright\" }, \"environment\": { \"location\": \"lush citrus grove\", \"background_elements\": [ \"sunlit yellow and orange fruits hanging above\", \"soft green leaves framing the bottle\" ] }, \"action_elements\": { \"description\": \"fresh splash of clear water rising around the base\", \"items\": [ \"thin lemon slices\", \"juicy lime wedges\", \"bright orange segments\" ] }, \"lighting\": { \"description\": \"sun rays filtering through leaves\", \"tone\": \"vibrant citrus warmth\" }, \"parameters\": \"--ar 9:16 --stylize 250\" }, { \"id\": \"tropical_hammock_v2\", \"type\": \"photorealistic advertising shot\", \"subject\": { \"item\": \"tropical mixed Nestle juice bottle\", \"label_text\": \"NFC Tropical Juice\", \"pose\": \"relaxed tilt as if resting\" }, \"environment\": { \"location\": \"sunlit hammock between palm trees\", \"background\": \"soft-focus ocean horizon with glowing sunlight\" }, \"surrounding_elements\": [ \"fresh pineapple slices\", \"ripe mango slices\", \"orange wedges\", \"dragonfruit cubes\" ], \"mood_and_style\": { \"atmosphere\": \"luxury vacation vibe\", \"colors\": \"rich tropical saturation\", \"lighting\": \"warm cinematic highlights with soft shadows\" }, \"parameters\": \"--ar 9:16 --stylize 250\" } ]"
}
JSON
复制
import { GptImage2Client } from "@runapi.ai/gpt-image-2";
const client = new GptImage2Client({
apiKey: process.env.RUNAPI_API_KEY,
});
const result = await client.textToImage.run({
"model": "gpt-image-2",
"prompt": "[ { \"id\": \"pineapple_beach_v2\", \"type\": \"photorealistic advertising shot\", \"subject\": { \"item\": \"pineapple juice bottle\", \"label_text\": \"NFC Pineapple Juice\", \"pose\": \"slightly tilted forward\" }, \"environment\": { \"location\": \"tropical beach\", \"ground\": \"sunlit wet tropical sand\", \"background_elements\": [ \"gently swaying palm trees\", \"clear turquoise ocean with soft waves\", \"bright blue sky with thin clouds\" ], \"interactions\": \"a small wave splashes lightly against the bottle base\" }, \"surrounding_elements\": [ \"fresh pineapple slices with visible texture\", \"sparkling seawater droplets in mid-air\" ], \"lighting\": { \"description\": \"golden sunlight\", \"effects\": \"soft reflections on glass bottle\" } }, { \"id\": \"strawberry_mountain_v2\", \"type\": \"photorealistic advertising shot\", \"subject\": { \"item\": \"strawberry juice bottle\", \"label_text\": \"NFC Strawberry Juice\", \"details\": \"heavy condensation with frost accents\" }, \"environment\": { \"location\": \"high-altitude mountains\", \"ground\": \"icy rocks with light snow patches\", \"atmosphere\": \"crisp cold air with drifting mist\" }, \"surrounding_elements\": [ \"fresh strawberries partially resting on ice\" ], \"lighting\": { \"description\": \"soft sunrise light cutting through fog\", \"effects\": \"subtle glow around the bottle\" }, \"style_descriptors\": [ \"cinematic macro shot\", \"ultra high detail\", \"cold-meets-warm contrast\", \"deep red highlights\", \"fresh and premium feel\", \"hyper-realistic surface details\" ], \"parameters\": \"--ar 9:16 --stylize 250\" }, { \"id\": \"citrus_grove_v2\", \"type\": \"photorealistic advertising shot\", \"subject\": { \"item\": \"citrus blend juice bottle\", \"label_text\": \"NFC Citrus Mix\", \"pose\": \"centered upright\" }, \"environment\": { \"location\": \"lush citrus grove\", \"background_elements\": [ \"sunlit yellow and orange fruits hanging above\", \"soft green leaves framing the bottle\" ] }, \"action_elements\": { \"description\": \"fresh splash of clear water rising around the base\", \"items\": [ \"thin lemon slices\", \"juicy lime wedges\", \"bright orange segments\" ] }, \"lighting\": { \"description\": \"sun rays filtering through leaves\", \"tone\": \"vibrant citrus warmth\" }, \"parameters\": \"--ar 9:16 --stylize 250\" }, { \"id\": \"tropical_hammock_v2\", \"type\": \"photorealistic advertising shot\", \"subject\": { \"item\": \"tropical mixed Nestle juice bottle\", \"label_text\": \"NFC Tropical Juice\", \"pose\": \"relaxed tilt as if resting\" }, \"environment\": { \"location\": \"sunlit hammock between palm trees\", \"background\": \"soft-focus ocean horizon with glowing sunlight\" }, \"surrounding_elements\": [ \"fresh pineapple slices\", \"ripe mango slices\", \"orange wedges\", \"dragonfruit cubes\" ], \"mood_and_style\": { \"atmosphere\": \"luxury vacation vibe\", \"colors\": \"rich tropical saturation\", \"lighting\": \"warm cinematic highlights with soft shadows\" }, \"parameters\": \"--ar 9:16 --stylize 250\" } ]"
});
console.log(result.id);
复制
require "runapi/gpt_image_2"
client = RunApi::GptImage2::Client.new
result = client.text_to_image.run(
model: "gpt-image-2",
prompt: "[ { \"id\": \"pineapple_beach_v2\", \"type\": \"photorealistic advertising shot\", \"subject\": { \"item\": \"pineapple juice bottle\", \"label_text\": \"NFC Pineapple Juice\", \"pose\": \"slightly tilted forward\" }, \"environment\": { \"location\": \"tropical beach\", \"ground\": \"sunlit wet tropical sand\", \"background_elements\": [ \"gently swaying palm trees\", \"clear turquoise ocean with soft waves\", \"bright blue sky with thin clouds\" ], \"interactions\": \"a small wave splashes lightly against the bottle base\" }, \"surrounding_elements\": [ \"fresh pineapple slices with visible texture\", \"sparkling seawater droplets in mid-air\" ], \"lighting\": { \"description\": \"golden sunlight\", \"effects\": \"soft reflections on glass bottle\" } }, { \"id\": \"strawberry_mountain_v2\", \"type\": \"photorealistic advertising shot\", \"subject\": { \"item\": \"strawberry juice bottle\", \"label_text\": \"NFC Strawberry Juice\", \"details\": \"heavy condensation with frost accents\" }, \"environment\": { \"location\": \"high-altitude mountains\", \"ground\": \"icy rocks with light snow patches\", \"atmosphere\": \"crisp cold air with drifting mist\" }, \"surrounding_elements\": [ \"fresh strawberries partially resting on ice\" ], \"lighting\": { \"description\": \"soft sunrise light cutting through fog\", \"effects\": \"subtle glow around the bottle\" }, \"style_descriptors\": [ \"cinematic macro shot\", \"ultra high detail\", \"cold-meets-warm contrast\", \"deep red highlights\", \"fresh and premium feel\", \"hyper-realistic surface details\" ], \"parameters\": \"--ar 9:16 --stylize 250\" }, { \"id\": \"citrus_grove_v2\", \"type\": \"photorealistic advertising shot\", \"subject\": { \"item\": \"citrus blend juice bottle\", \"label_text\": \"NFC Citrus Mix\", \"pose\": \"centered upright\" }, \"environment\": { \"location\": \"lush citrus grove\", \"background_elements\": [ \"sunlit yellow and orange fruits hanging above\", \"soft green leaves framing the bottle\" ] }, \"action_elements\": { \"description\": \"fresh splash of clear water rising around the base\", \"items\": [ \"thin lemon slices\", \"juicy lime wedges\", \"bright orange segments\" ] }, \"lighting\": { \"description\": \"sun rays filtering through leaves\", \"tone\": \"vibrant citrus warmth\" }, \"parameters\": \"--ar 9:16 --stylize 250\" }, { \"id\": \"tropical_hammock_v2\", \"type\": \"photorealistic advertising shot\", \"subject\": { \"item\": \"tropical mixed Nestle juice bottle\", \"label_text\": \"NFC Tropical Juice\", \"pose\": \"relaxed tilt as if resting\" }, \"environment\": { \"location\": \"sunlit hammock between palm trees\", \"background\": \"soft-focus ocean horizon with glowing sunlight\" }, \"surrounding_elements\": [ \"fresh pineapple slices\", \"ripe mango slices\", \"orange wedges\", \"dragonfruit cubes\" ], \"mood_and_style\": { \"atmosphere\": \"luxury vacation vibe\", \"colors\": \"rich tropical saturation\", \"lighting\": \"warm cinematic highlights with soft shadows\" }, \"parameters\": \"--ar 9:16 --stylize 250\" } ]"
)
puts result.id
复制
package main
import (
"context"
"fmt"
"log"
"net/http"
"os"
"strings"
)
func main() {
body := strings.NewReader("{\"model\":\"gpt-image-2\",\"prompt\":\"[ { \\\"id\\\": \\\"pineapple_beach_v2\\\", \\\"type\\\": \\\"photorealistic advertising shot\\\", \\\"subject\\\": { \\\"item\\\": \\\"pineapple juice bottle\\\", \\\"label_text\\\": \\\"NFC Pineapple Juice\\\", \\\"pose\\\": \\\"slightly tilted forward\\\" }, \\\"environment\\\": { \\\"location\\\": \\\"tropical beach\\\", \\\"ground\\\": \\\"sunlit wet tropical sand\\\", \\\"background_elements\\\": [ \\\"gently swaying palm trees\\\", \\\"clear turquoise ocean with soft waves\\\", \\\"bright blue sky with thin clouds\\\" ], \\\"interactions\\\": \\\"a small wave splashes lightly against the bottle base\\\" }, \\\"surrounding_elements\\\": [ \\\"fresh pineapple slices with visible texture\\\", \\\"sparkling seawater droplets in mid-air\\\" ], \\\"lighting\\\": { \\\"description\\\": \\\"golden sunlight\\\", \\\"effects\\\": \\\"soft reflections on glass bottle\\\" } }, { \\\"id\\\": \\\"strawberry_mountain_v2\\\", \\\"type\\\": \\\"photorealistic advertising shot\\\", \\\"subject\\\": { \\\"item\\\": \\\"strawberry juice bottle\\\", \\\"label_text\\\": \\\"NFC Strawberry Juice\\\", \\\"details\\\": \\\"heavy condensation with frost accents\\\" }, \\\"environment\\\": { \\\"location\\\": \\\"high-altitude mountains\\\", \\\"ground\\\": \\\"icy rocks with light snow patches\\\", \\\"atmosphere\\\": \\\"crisp cold air with drifting mist\\\" }, \\\"surrounding_elements\\\": [ \\\"fresh strawberries partially resting on ice\\\" ], \\\"lighting\\\": { \\\"description\\\": \\\"soft sunrise light cutting through fog\\\", \\\"effects\\\": \\\"subtle glow around the bottle\\\" }, \\\"style_descriptors\\\": [ \\\"cinematic macro shot\\\", \\\"ultra high detail\\\", \\\"cold-meets-warm contrast\\\", \\\"deep red highlights\\\", \\\"fresh and premium feel\\\", \\\"hyper-realistic surface details\\\" ], \\\"parameters\\\": \\\"--ar 9:16 --stylize 250\\\" }, { \\\"id\\\": \\\"citrus_grove_v2\\\", \\\"type\\\": \\\"photorealistic advertising shot\\\", \\\"subject\\\": { \\\"item\\\": \\\"citrus blend juice bottle\\\", \\\"label_text\\\": \\\"NFC Citrus Mix\\\", \\\"pose\\\": \\\"centered upright\\\" }, \\\"environment\\\": { \\\"location\\\": \\\"lush citrus grove\\\", \\\"background_elements\\\": [ \\\"sunlit yellow and orange fruits hanging above\\\", \\\"soft green leaves framing the bottle\\\" ] }, \\\"action_elements\\\": { \\\"description\\\": \\\"fresh splash of clear water rising around the base\\\", \\\"items\\\": [ \\\"thin lemon slices\\\", \\\"juicy lime wedges\\\", \\\"bright orange segments\\\" ] }, \\\"lighting\\\": { \\\"description\\\": \\\"sun rays filtering through leaves\\\", \\\"tone\\\": \\\"vibrant citrus warmth\\\" }, \\\"parameters\\\": \\\"--ar 9:16 --stylize 250\\\" }, { \\\"id\\\": \\\"tropical_hammock_v2\\\", \\\"type\\\": \\\"photorealistic advertising shot\\\", \\\"subject\\\": { \\\"item\\\": \\\"tropical mixed Nestle juice bottle\\\", \\\"label_text\\\": \\\"NFC Tropical Juice\\\", \\\"pose\\\": \\\"relaxed tilt as if resting\\\" }, \\\"environment\\\": { \\\"location\\\": \\\"sunlit hammock between palm trees\\\", \\\"background\\\": \\\"soft-focus ocean horizon with glowing sunlight\\\" }, \\\"surrounding_elements\\\": [ \\\"fresh pineapple slices\\\", \\\"ripe mango slices\\\", \\\"orange wedges\\\", \\\"dragonfruit cubes\\\" ], \\\"mood_and_style\\\": { \\\"atmosphere\\\": \\\"luxury vacation vibe\\\", \\\"colors\\\": \\\"rich tropical saturation\\\", \\\"lighting\\\": \\\"warm cinematic highlights with soft shadows\\\" }, \\\"parameters\\\": \\\"--ar 9:16 --stylize 250\\\" } ]\"}")
req, err := http.NewRequestWithContext(context.Background(), http.MethodPost, "https://runapi.ai/api/v1/gpt_image_2/text_to_image", body)
if err != nil {
log.Fatal(err)
}
req.Header.Set("Authorization", "Bearer "+os.Getenv("RUNAPI_API_KEY"))
req.Header.Set("Content-Type", "application/json")
resp, err := http.DefaultClient.Do(req)
if err != nil {
log.Fatal(err)
}
defer resp.Body.Close()
fmt.Println(resp.Status)
}