复制
1. claude mcp add runapi -s user -- npx -y @runapi.ai/mcp
2. 重启 Claude Code
3. 粘贴这个 prompt:生成一张图像:"{ "resolution": "8K UHD", "aspect_ratio": "3:4", "image_style": "hyper-realistic commercial food photography", "global_settings": { "quality": "Ultra-high detail, sharp focus, studio-grade clarity", "lighting": "Soft but controlled studio lighting with visible highlights and splash definition", "motion": "Frozen mid-air action, ingredients suspended", "background_style": "Solid or smooth gradient background, color varies per module", "camera": "High-speed photography look, shallow to medium depth of field", "post_processing": "Balanced contrast, natural saturation, no artificial glow" }, "modules": { "module_1_berry_smoothie_explosion": { "scene_description": "A vibrant smoothie bowl exploding with fruit and liquid splashes", "bowl": { "color": "Deep blue ceramic bowl", "finish": "Glossy", "position": "Centered, floating mid-air" }, "base_contents": { "type": "Thick berry smoothie", "color": "Deep purple-magenta", "texture": "Creamy with visible swirl marks" }, "ingredients": { "fruits": [ "Banana slices (round, pale yellow)", "Blueberries (whole, dark blue)", "Raspberries (whole, red)" ], "herbs": [ "Fresh mint leaves (bright green)" ] }, "motion_effects": { "liquid": "Berry smoothie splashing upward and outward", "particles": "Small droplets suspended in air" }, "background": { "color": "Bright pink", "texture": "Smooth, seamless" } }, "module_2_minimal_pink_smoothie_bowl": { "scene_description": "Minimalist floating smoothie bowl with granola and berries", "bowl": { "color": "Light pink ceramic bowl with dark speckles", "finish": "Matte", "position": "Floating centrally" }, "base_contents": { "type": "Smoothie", "color": "Soft pink with purple undertones", "texture": "Thick and smooth" }, "toppings": { "granola": "Golden-brown oat clusters", "seeds": "Small black seeds scattered", "fruits": [ "Strawberries (halved)", "Raspberries (whole)", "Blackberries (whole)" ] }, "motion_effects": { "ingredients": "Granola flakes, seeds, and berries floating gently" }, "background": { "color": "Pastel lavender", "gradient": "Subtle, soft gradient" } }, "module_3_cereal_milk_honey_splash": { "scene_description": "Dynamic cereal stack with milk splash and honey drizzle", "bowl": { "color": "Blue ceramic bowl", "finish": "Glossy", "position": "Centered, resting visually but surrounded by motion" }, "contents": { "cereal": "Golden cornflakes stacked vertically", "milk": "White milk splashing and dripping over flakes", "fruits": [ "Raspberries", "Blueberries" ] }, "additional_elements": { "honey": { "source": "Wooden honey dipper", "state": "Honey dripping mid-air" } }, "motion_effects": { "splashes": "Milk splashes frozen in dramatic arcs", "particles": "Floating flakes and droplets" }, "background": { "color": "Deep blue", "tone": "High contrast" } }, }"
复制
1. codex plugin install runapi-mcp@agents
2. 重启 Codex
3. 粘贴这个 prompt:生成一张图像:"{ "resolution": "8K UHD", "aspect_ratio": "3:4", "image_style": "hyper-realistic commercial food photography", "global_settings": { "quality": "Ultra-high detail, sharp focus, studio-grade clarity", "lighting": "Soft but controlled studio lighting with visible highlights and splash definition", "motion": "Frozen mid-air action, ingredients suspended", "background_style": "Solid or smooth gradient background, color varies per module", "camera": "High-speed photography look, shallow to medium depth of field", "post_processing": "Balanced contrast, natural saturation, no artificial glow" }, "modules": { "module_1_berry_smoothie_explosion": { "scene_description": "A vibrant smoothie bowl exploding with fruit and liquid splashes", "bowl": { "color": "Deep blue ceramic bowl", "finish": "Glossy", "position": "Centered, floating mid-air" }, "base_contents": { "type": "Thick berry smoothie", "color": "Deep purple-magenta", "texture": "Creamy with visible swirl marks" }, "ingredients": { "fruits": [ "Banana slices (round, pale yellow)", "Blueberries (whole, dark blue)", "Raspberries (whole, red)" ], "herbs": [ "Fresh mint leaves (bright green)" ] }, "motion_effects": { "liquid": "Berry smoothie splashing upward and outward", "particles": "Small droplets suspended in air" }, "background": { "color": "Bright pink", "texture": "Smooth, seamless" } }, "module_2_minimal_pink_smoothie_bowl": { "scene_description": "Minimalist floating smoothie bowl with granola and berries", "bowl": { "color": "Light pink ceramic bowl with dark speckles", "finish": "Matte", "position": "Floating centrally" }, "base_contents": { "type": "Smoothie", "color": "Soft pink with purple undertones", "texture": "Thick and smooth" }, "toppings": { "granola": "Golden-brown oat clusters", "seeds": "Small black seeds scattered", "fruits": [ "Strawberries (halved)", "Raspberries (whole)", "Blackberries (whole)" ] }, "motion_effects": { "ingredients": "Granola flakes, seeds, and berries floating gently" }, "background": { "color": "Pastel lavender", "gradient": "Subtle, soft gradient" } }, "module_3_cereal_milk_honey_splash": { "scene_description": "Dynamic cereal stack with milk splash and honey drizzle", "bowl": { "color": "Blue ceramic bowl", "finish": "Glossy", "position": "Centered, resting visually but surrounded by motion" }, "contents": { "cereal": "Golden cornflakes stacked vertically", "milk": "White milk splashing and dripping over flakes", "fruits": [ "Raspberries", "Blueberries" ] }, "additional_elements": { "honey": { "source": "Wooden honey dipper", "state": "Honey dripping mid-air" } }, "motion_effects": { "splashes": "Milk splashes frozen in dramatic arcs", "particles": "Floating flakes and droplets" }, "background": { "color": "Deep blue", "tone": "High contrast" } }, }"
复制
1. npx @runapi.ai/mcp init cursor
2. 重启 Cursor
3. 粘贴这个 prompt:生成一张图像:"{ "resolution": "8K UHD", "aspect_ratio": "3:4", "image_style": "hyper-realistic commercial food photography", "global_settings": { "quality": "Ultra-high detail, sharp focus, studio-grade clarity", "lighting": "Soft but controlled studio lighting with visible highlights and splash definition", "motion": "Frozen mid-air action, ingredients suspended", "background_style": "Solid or smooth gradient background, color varies per module", "camera": "High-speed photography look, shallow to medium depth of field", "post_processing": "Balanced contrast, natural saturation, no artificial glow" }, "modules": { "module_1_berry_smoothie_explosion": { "scene_description": "A vibrant smoothie bowl exploding with fruit and liquid splashes", "bowl": { "color": "Deep blue ceramic bowl", "finish": "Glossy", "position": "Centered, floating mid-air" }, "base_contents": { "type": "Thick berry smoothie", "color": "Deep purple-magenta", "texture": "Creamy with visible swirl marks" }, "ingredients": { "fruits": [ "Banana slices (round, pale yellow)", "Blueberries (whole, dark blue)", "Raspberries (whole, red)" ], "herbs": [ "Fresh mint leaves (bright green)" ] }, "motion_effects": { "liquid": "Berry smoothie splashing upward and outward", "particles": "Small droplets suspended in air" }, "background": { "color": "Bright pink", "texture": "Smooth, seamless" } }, "module_2_minimal_pink_smoothie_bowl": { "scene_description": "Minimalist floating smoothie bowl with granola and berries", "bowl": { "color": "Light pink ceramic bowl with dark speckles", "finish": "Matte", "position": "Floating centrally" }, "base_contents": { "type": "Smoothie", "color": "Soft pink with purple undertones", "texture": "Thick and smooth" }, "toppings": { "granola": "Golden-brown oat clusters", "seeds": "Small black seeds scattered", "fruits": [ "Strawberries (halved)", "Raspberries (whole)", "Blackberries (whole)" ] }, "motion_effects": { "ingredients": "Granola flakes, seeds, and berries floating gently" }, "background": { "color": "Pastel lavender", "gradient": "Subtle, soft gradient" } }, "module_3_cereal_milk_honey_splash": { "scene_description": "Dynamic cereal stack with milk splash and honey drizzle", "bowl": { "color": "Blue ceramic bowl", "finish": "Glossy", "position": "Centered, resting visually but surrounded by motion" }, "contents": { "cereal": "Golden cornflakes stacked vertically", "milk": "White milk splashing and dripping over flakes", "fruits": [ "Raspberries", "Blueberries" ] }, "additional_elements": { "honey": { "source": "Wooden honey dipper", "state": "Honey dripping mid-air" } }, "motion_effects": { "splashes": "Milk splashes frozen in dramatic arcs", "particles": "Floating flakes and droplets" }, "background": { "color": "Deep blue", "tone": "High contrast" } }, }"
复制
1. npx @runapi.ai/mcp init windsurf
2. 重启 Windsurf
3. 粘贴这个 prompt:生成一张图像:"{ "resolution": "8K UHD", "aspect_ratio": "3:4", "image_style": "hyper-realistic commercial food photography", "global_settings": { "quality": "Ultra-high detail, sharp focus, studio-grade clarity", "lighting": "Soft but controlled studio lighting with visible highlights and splash definition", "motion": "Frozen mid-air action, ingredients suspended", "background_style": "Solid or smooth gradient background, color varies per module", "camera": "High-speed photography look, shallow to medium depth of field", "post_processing": "Balanced contrast, natural saturation, no artificial glow" }, "modules": { "module_1_berry_smoothie_explosion": { "scene_description": "A vibrant smoothie bowl exploding with fruit and liquid splashes", "bowl": { "color": "Deep blue ceramic bowl", "finish": "Glossy", "position": "Centered, floating mid-air" }, "base_contents": { "type": "Thick berry smoothie", "color": "Deep purple-magenta", "texture": "Creamy with visible swirl marks" }, "ingredients": { "fruits": [ "Banana slices (round, pale yellow)", "Blueberries (whole, dark blue)", "Raspberries (whole, red)" ], "herbs": [ "Fresh mint leaves (bright green)" ] }, "motion_effects": { "liquid": "Berry smoothie splashing upward and outward", "particles": "Small droplets suspended in air" }, "background": { "color": "Bright pink", "texture": "Smooth, seamless" } }, "module_2_minimal_pink_smoothie_bowl": { "scene_description": "Minimalist floating smoothie bowl with granola and berries", "bowl": { "color": "Light pink ceramic bowl with dark speckles", "finish": "Matte", "position": "Floating centrally" }, "base_contents": { "type": "Smoothie", "color": "Soft pink with purple undertones", "texture": "Thick and smooth" }, "toppings": { "granola": "Golden-brown oat clusters", "seeds": "Small black seeds scattered", "fruits": [ "Strawberries (halved)", "Raspberries (whole)", "Blackberries (whole)" ] }, "motion_effects": { "ingredients": "Granola flakes, seeds, and berries floating gently" }, "background": { "color": "Pastel lavender", "gradient": "Subtle, soft gradient" } }, "module_3_cereal_milk_honey_splash": { "scene_description": "Dynamic cereal stack with milk splash and honey drizzle", "bowl": { "color": "Blue ceramic bowl", "finish": "Glossy", "position": "Centered, resting visually but surrounded by motion" }, "contents": { "cereal": "Golden cornflakes stacked vertically", "milk": "White milk splashing and dripping over flakes", "fruits": [ "Raspberries", "Blueberries" ] }, "additional_elements": { "honey": { "source": "Wooden honey dipper", "state": "Honey dripping mid-air" } }, "motion_effects": { "splashes": "Milk splashes frozen in dramatic arcs", "particles": "Floating flakes and droplets" }, "background": { "color": "Deep blue", "tone": "High contrast" } }, }"
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": "{ \"resolution\": \"8K UHD\", \"aspect_ratio\": \"3:4\", \"image_style\": \"hyper-realistic commercial food photography\", \"global_settings\": { \"quality\": \"Ultra-high detail, sharp focus, studio-grade clarity\", \"lighting\": \"Soft but controlled studio lighting with visible highlights and splash definition\", \"motion\": \"Frozen mid-air action, ingredients suspended\", \"background_style\": \"Solid or smooth gradient background, color varies per module\", \"camera\": \"High-speed photography look, shallow to medium depth of field\", \"post_processing\": \"Balanced contrast, natural saturation, no artificial glow\" }, \"modules\": { \"module_1_berry_smoothie_explosion\": { \"scene_description\": \"A vibrant smoothie bowl exploding with fruit and liquid splashes\", \"bowl\": { \"color\": \"Deep blue ceramic bowl\", \"finish\": \"Glossy\", \"position\": \"Centered, floating mid-air\" }, \"base_contents\": { \"type\": \"Thick berry smoothie\", \"color\": \"Deep purple-magenta\", \"texture\": \"Creamy with visible swirl marks\" }, \"ingredients\": { \"fruits\": [ \"Banana slices (round, pale yellow)\", \"Blueberries (whole, dark blue)\", \"Raspberries (whole, red)\" ], \"herbs\": [ \"Fresh mint leaves (bright green)\" ] }, \"motion_effects\": { \"liquid\": \"Berry smoothie splashing upward and outward\", \"particles\": \"Small droplets suspended in air\" }, \"background\": { \"color\": \"Bright pink\", \"texture\": \"Smooth, seamless\" } }, \"module_2_minimal_pink_smoothie_bowl\": { \"scene_description\": \"Minimalist floating smoothie bowl with granola and berries\", \"bowl\": { \"color\": \"Light pink ceramic bowl with dark speckles\", \"finish\": \"Matte\", \"position\": \"Floating centrally\" }, \"base_contents\": { \"type\": \"Smoothie\", \"color\": \"Soft pink with purple undertones\", \"texture\": \"Thick and smooth\" }, \"toppings\": { \"granola\": \"Golden-brown oat clusters\", \"seeds\": \"Small black seeds scattered\", \"fruits\": [ \"Strawberries (halved)\", \"Raspberries (whole)\", \"Blackberries (whole)\" ] }, \"motion_effects\": { \"ingredients\": \"Granola flakes, seeds, and berries floating gently\" }, \"background\": { \"color\": \"Pastel lavender\", \"gradient\": \"Subtle, soft gradient\" } }, \"module_3_cereal_milk_honey_splash\": { \"scene_description\": \"Dynamic cereal stack with milk splash and honey drizzle\", \"bowl\": { \"color\": \"Blue ceramic bowl\", \"finish\": \"Glossy\", \"position\": \"Centered, resting visually but surrounded by motion\" }, \"contents\": { \"cereal\": \"Golden cornflakes stacked vertically\", \"milk\": \"White milk splashing and dripping over flakes\", \"fruits\": [ \"Raspberries\", \"Blueberries\" ] }, \"additional_elements\": { \"honey\": { \"source\": \"Wooden honey dipper\", \"state\": \"Honey dripping mid-air\" } }, \"motion_effects\": { \"splashes\": \"Milk splashes frozen in dramatic arcs\", \"particles\": \"Floating flakes and droplets\" }, \"background\": { \"color\": \"Deep blue\", \"tone\": \"High contrast\" } }, }"
}
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": "{ \"resolution\": \"8K UHD\", \"aspect_ratio\": \"3:4\", \"image_style\": \"hyper-realistic commercial food photography\", \"global_settings\": { \"quality\": \"Ultra-high detail, sharp focus, studio-grade clarity\", \"lighting\": \"Soft but controlled studio lighting with visible highlights and splash definition\", \"motion\": \"Frozen mid-air action, ingredients suspended\", \"background_style\": \"Solid or smooth gradient background, color varies per module\", \"camera\": \"High-speed photography look, shallow to medium depth of field\", \"post_processing\": \"Balanced contrast, natural saturation, no artificial glow\" }, \"modules\": { \"module_1_berry_smoothie_explosion\": { \"scene_description\": \"A vibrant smoothie bowl exploding with fruit and liquid splashes\", \"bowl\": { \"color\": \"Deep blue ceramic bowl\", \"finish\": \"Glossy\", \"position\": \"Centered, floating mid-air\" }, \"base_contents\": { \"type\": \"Thick berry smoothie\", \"color\": \"Deep purple-magenta\", \"texture\": \"Creamy with visible swirl marks\" }, \"ingredients\": { \"fruits\": [ \"Banana slices (round, pale yellow)\", \"Blueberries (whole, dark blue)\", \"Raspberries (whole, red)\" ], \"herbs\": [ \"Fresh mint leaves (bright green)\" ] }, \"motion_effects\": { \"liquid\": \"Berry smoothie splashing upward and outward\", \"particles\": \"Small droplets suspended in air\" }, \"background\": { \"color\": \"Bright pink\", \"texture\": \"Smooth, seamless\" } }, \"module_2_minimal_pink_smoothie_bowl\": { \"scene_description\": \"Minimalist floating smoothie bowl with granola and berries\", \"bowl\": { \"color\": \"Light pink ceramic bowl with dark speckles\", \"finish\": \"Matte\", \"position\": \"Floating centrally\" }, \"base_contents\": { \"type\": \"Smoothie\", \"color\": \"Soft pink with purple undertones\", \"texture\": \"Thick and smooth\" }, \"toppings\": { \"granola\": \"Golden-brown oat clusters\", \"seeds\": \"Small black seeds scattered\", \"fruits\": [ \"Strawberries (halved)\", \"Raspberries (whole)\", \"Blackberries (whole)\" ] }, \"motion_effects\": { \"ingredients\": \"Granola flakes, seeds, and berries floating gently\" }, \"background\": { \"color\": \"Pastel lavender\", \"gradient\": \"Subtle, soft gradient\" } }, \"module_3_cereal_milk_honey_splash\": { \"scene_description\": \"Dynamic cereal stack with milk splash and honey drizzle\", \"bowl\": { \"color\": \"Blue ceramic bowl\", \"finish\": \"Glossy\", \"position\": \"Centered, resting visually but surrounded by motion\" }, \"contents\": { \"cereal\": \"Golden cornflakes stacked vertically\", \"milk\": \"White milk splashing and dripping over flakes\", \"fruits\": [ \"Raspberries\", \"Blueberries\" ] }, \"additional_elements\": { \"honey\": { \"source\": \"Wooden honey dipper\", \"state\": \"Honey dripping mid-air\" } }, \"motion_effects\": { \"splashes\": \"Milk splashes frozen in dramatic arcs\", \"particles\": \"Floating flakes and droplets\" }, \"background\": { \"color\": \"Deep blue\", \"tone\": \"High contrast\" } }, }"
});
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: "{ \"resolution\": \"8K UHD\", \"aspect_ratio\": \"3:4\", \"image_style\": \"hyper-realistic commercial food photography\", \"global_settings\": { \"quality\": \"Ultra-high detail, sharp focus, studio-grade clarity\", \"lighting\": \"Soft but controlled studio lighting with visible highlights and splash definition\", \"motion\": \"Frozen mid-air action, ingredients suspended\", \"background_style\": \"Solid or smooth gradient background, color varies per module\", \"camera\": \"High-speed photography look, shallow to medium depth of field\", \"post_processing\": \"Balanced contrast, natural saturation, no artificial glow\" }, \"modules\": { \"module_1_berry_smoothie_explosion\": { \"scene_description\": \"A vibrant smoothie bowl exploding with fruit and liquid splashes\", \"bowl\": { \"color\": \"Deep blue ceramic bowl\", \"finish\": \"Glossy\", \"position\": \"Centered, floating mid-air\" }, \"base_contents\": { \"type\": \"Thick berry smoothie\", \"color\": \"Deep purple-magenta\", \"texture\": \"Creamy with visible swirl marks\" }, \"ingredients\": { \"fruits\": [ \"Banana slices (round, pale yellow)\", \"Blueberries (whole, dark blue)\", \"Raspberries (whole, red)\" ], \"herbs\": [ \"Fresh mint leaves (bright green)\" ] }, \"motion_effects\": { \"liquid\": \"Berry smoothie splashing upward and outward\", \"particles\": \"Small droplets suspended in air\" }, \"background\": { \"color\": \"Bright pink\", \"texture\": \"Smooth, seamless\" } }, \"module_2_minimal_pink_smoothie_bowl\": { \"scene_description\": \"Minimalist floating smoothie bowl with granola and berries\", \"bowl\": { \"color\": \"Light pink ceramic bowl with dark speckles\", \"finish\": \"Matte\", \"position\": \"Floating centrally\" }, \"base_contents\": { \"type\": \"Smoothie\", \"color\": \"Soft pink with purple undertones\", \"texture\": \"Thick and smooth\" }, \"toppings\": { \"granola\": \"Golden-brown oat clusters\", \"seeds\": \"Small black seeds scattered\", \"fruits\": [ \"Strawberries (halved)\", \"Raspberries (whole)\", \"Blackberries (whole)\" ] }, \"motion_effects\": { \"ingredients\": \"Granola flakes, seeds, and berries floating gently\" }, \"background\": { \"color\": \"Pastel lavender\", \"gradient\": \"Subtle, soft gradient\" } }, \"module_3_cereal_milk_honey_splash\": { \"scene_description\": \"Dynamic cereal stack with milk splash and honey drizzle\", \"bowl\": { \"color\": \"Blue ceramic bowl\", \"finish\": \"Glossy\", \"position\": \"Centered, resting visually but surrounded by motion\" }, \"contents\": { \"cereal\": \"Golden cornflakes stacked vertically\", \"milk\": \"White milk splashing and dripping over flakes\", \"fruits\": [ \"Raspberries\", \"Blueberries\" ] }, \"additional_elements\": { \"honey\": { \"source\": \"Wooden honey dipper\", \"state\": \"Honey dripping mid-air\" } }, \"motion_effects\": { \"splashes\": \"Milk splashes frozen in dramatic arcs\", \"particles\": \"Floating flakes and droplets\" }, \"background\": { \"color\": \"Deep blue\", \"tone\": \"High contrast\" } }, }"
)
puts result.id
复制
package main
import (
"context"
"fmt"
"log"
"net/http"
"os"
"strings"
)
func main() {
body := strings.NewReader("{\"model\":\"gpt-image-2\",\"prompt\":\"{ \\\"resolution\\\": \\\"8K UHD\\\", \\\"aspect_ratio\\\": \\\"3:4\\\", \\\"image_style\\\": \\\"hyper-realistic commercial food photography\\\", \\\"global_settings\\\": { \\\"quality\\\": \\\"Ultra-high detail, sharp focus, studio-grade clarity\\\", \\\"lighting\\\": \\\"Soft but controlled studio lighting with visible highlights and splash definition\\\", \\\"motion\\\": \\\"Frozen mid-air action, ingredients suspended\\\", \\\"background_style\\\": \\\"Solid or smooth gradient background, color varies per module\\\", \\\"camera\\\": \\\"High-speed photography look, shallow to medium depth of field\\\", \\\"post_processing\\\": \\\"Balanced contrast, natural saturation, no artificial glow\\\" }, \\\"modules\\\": { \\\"module_1_berry_smoothie_explosion\\\": { \\\"scene_description\\\": \\\"A vibrant smoothie bowl exploding with fruit and liquid splashes\\\", \\\"bowl\\\": { \\\"color\\\": \\\"Deep blue ceramic bowl\\\", \\\"finish\\\": \\\"Glossy\\\", \\\"position\\\": \\\"Centered, floating mid-air\\\" }, \\\"base_contents\\\": { \\\"type\\\": \\\"Thick berry smoothie\\\", \\\"color\\\": \\\"Deep purple-magenta\\\", \\\"texture\\\": \\\"Creamy with visible swirl marks\\\" }, \\\"ingredients\\\": { \\\"fruits\\\": [ \\\"Banana slices (round, pale yellow)\\\", \\\"Blueberries (whole, dark blue)\\\", \\\"Raspberries (whole, red)\\\" ], \\\"herbs\\\": [ \\\"Fresh mint leaves (bright green)\\\" ] }, \\\"motion_effects\\\": { \\\"liquid\\\": \\\"Berry smoothie splashing upward and outward\\\", \\\"particles\\\": \\\"Small droplets suspended in air\\\" }, \\\"background\\\": { \\\"color\\\": \\\"Bright pink\\\", \\\"texture\\\": \\\"Smooth, seamless\\\" } }, \\\"module_2_minimal_pink_smoothie_bowl\\\": { \\\"scene_description\\\": \\\"Minimalist floating smoothie bowl with granola and berries\\\", \\\"bowl\\\": { \\\"color\\\": \\\"Light pink ceramic bowl with dark speckles\\\", \\\"finish\\\": \\\"Matte\\\", \\\"position\\\": \\\"Floating centrally\\\" }, \\\"base_contents\\\": { \\\"type\\\": \\\"Smoothie\\\", \\\"color\\\": \\\"Soft pink with purple undertones\\\", \\\"texture\\\": \\\"Thick and smooth\\\" }, \\\"toppings\\\": { \\\"granola\\\": \\\"Golden-brown oat clusters\\\", \\\"seeds\\\": \\\"Small black seeds scattered\\\", \\\"fruits\\\": [ \\\"Strawberries (halved)\\\", \\\"Raspberries (whole)\\\", \\\"Blackberries (whole)\\\" ] }, \\\"motion_effects\\\": { \\\"ingredients\\\": \\\"Granola flakes, seeds, and berries floating gently\\\" }, \\\"background\\\": { \\\"color\\\": \\\"Pastel lavender\\\", \\\"gradient\\\": \\\"Subtle, soft gradient\\\" } }, \\\"module_3_cereal_milk_honey_splash\\\": { \\\"scene_description\\\": \\\"Dynamic cereal stack with milk splash and honey drizzle\\\", \\\"bowl\\\": { \\\"color\\\": \\\"Blue ceramic bowl\\\", \\\"finish\\\": \\\"Glossy\\\", \\\"position\\\": \\\"Centered, resting visually but surrounded by motion\\\" }, \\\"contents\\\": { \\\"cereal\\\": \\\"Golden cornflakes stacked vertically\\\", \\\"milk\\\": \\\"White milk splashing and dripping over flakes\\\", \\\"fruits\\\": [ \\\"Raspberries\\\", \\\"Blueberries\\\" ] }, \\\"additional_elements\\\": { \\\"honey\\\": { \\\"source\\\": \\\"Wooden honey dipper\\\", \\\"state\\\": \\\"Honey dripping mid-air\\\" } }, \\\"motion_effects\\\": { \\\"splashes\\\": \\\"Milk splashes frozen in dramatic arcs\\\", \\\"particles\\\": \\\"Floating flakes and droplets\\\" }, \\\"background\\\": { \\\"color\\\": \\\"Deep blue\\\", \\\"tone\\\": \\\"High contrast\\\" } }, }\"}")
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)
}