复制
1. claude mcp add runapi -s user -- npx -y @runapi.ai/mcp
2. 重启 Claude Code
3. 粘贴这个 prompt:生成一张图像:"{ "resolution": "8K", "aspect_ratio": "3:4", "image_type": "photorealistic commercial product render", "scene_description": { "main_subject": "A vertically centered ice cream bar on a wooden stick", "orientation": "upright, front-facing, slightly elevated perspective", "composition": "single product centered with surrounding ingredient callouts and curved arrows" }, "background": { "color": "warm golden-yellow gradient", "texture": "smooth, matte, evenly lit", "lighting_falloff": "subtle vignette, darker towards edges" }, "lighting": { "type": "studio lighting", "key_light": "soft frontal light highlighting chocolate gloss", "fill_light": "balanced fill to preserve texture detail", "specular_highlights": "visible on melted chocolate coating", "shadows": "soft shadow beneath ice cream stick" }, "ice_cream_bar": { "shape": "rounded rectangular bar", "surface": "smooth with visible embedded inclusions", "layers": [ { "layer_position": "top coating", "material": "milk chocolate", "state": "melted and dripping", "texture": "glossy, thick, fluid", "details": [ "multiple chocolate drips flowing downward", "irregular almond pieces embedded in coating", "rounded drip edges with gravity pull" ] }, { "layer_position": "left interior", "material": "chocolate ice cream", "texture": "dense, creamy", "details": [ "small dark brownie chunks evenly dispersed", "matte finish compared to outer chocolate" ] }, { "layer_position": "right interior", "material": "vanilla ice cream", "texture": "smooth and creamy", "details": [ "visible caramel pieces", "light beige caramel chunks with rounded edges" ] } ] }, "stick": { "material": "light natural wood", "texture": "smooth with subtle grain", "shape": "rounded edges, flat profile", "visibility": "fully visible below ice cream bar" }, "ingredient_callouts": { "style": { "arrows": "curved, thick, dark brown", "text_color": "dark brown", "font_style": "clean sans-serif", "layout": "balanced around product" }, "labels": [ { "text": "Chocolate with almonds", "position": "top-left", "visual_aid": [ "whole almonds", "small chocolate squares" ] }, { "text": "Chocolate ice cream with brownies", "position": "left-middle", "visual_aid": [ "brownie chunks" ] }, { "text": "Chocolate ice cream with brownies", "position": "right-middle", "visual_aid": [ "brownie chunks" ] }, { "text": "Vanilla ice cream with caramel pieces", "position": "bottom-right", "visual_aid": [ "caramel cubes", "white vanilla pieces" ] } ] }, "color_palette": { "primary_colors": [ "milk chocolate brown", "golden yellow", "cream white" ], "secondary_colors": [ "dark brownie brown", "light caramel orange", "almond beige" ] }, "render_quality": { "sharpness": "extreme micro-detail visibility", "texture_fidelity": "high realism", "noise": "none", "depth_of_field": "moderate, product fully in focus" }, "style_tags": [ "luxury dessert advertising", "hyper-realistic food photography", "commercial product render", "clean studio composition" ] }"
复制
1. codex plugin install runapi-mcp@agents
2. 重启 Codex
3. 粘贴这个 prompt:生成一张图像:"{ "resolution": "8K", "aspect_ratio": "3:4", "image_type": "photorealistic commercial product render", "scene_description": { "main_subject": "A vertically centered ice cream bar on a wooden stick", "orientation": "upright, front-facing, slightly elevated perspective", "composition": "single product centered with surrounding ingredient callouts and curved arrows" }, "background": { "color": "warm golden-yellow gradient", "texture": "smooth, matte, evenly lit", "lighting_falloff": "subtle vignette, darker towards edges" }, "lighting": { "type": "studio lighting", "key_light": "soft frontal light highlighting chocolate gloss", "fill_light": "balanced fill to preserve texture detail", "specular_highlights": "visible on melted chocolate coating", "shadows": "soft shadow beneath ice cream stick" }, "ice_cream_bar": { "shape": "rounded rectangular bar", "surface": "smooth with visible embedded inclusions", "layers": [ { "layer_position": "top coating", "material": "milk chocolate", "state": "melted and dripping", "texture": "glossy, thick, fluid", "details": [ "multiple chocolate drips flowing downward", "irregular almond pieces embedded in coating", "rounded drip edges with gravity pull" ] }, { "layer_position": "left interior", "material": "chocolate ice cream", "texture": "dense, creamy", "details": [ "small dark brownie chunks evenly dispersed", "matte finish compared to outer chocolate" ] }, { "layer_position": "right interior", "material": "vanilla ice cream", "texture": "smooth and creamy", "details": [ "visible caramel pieces", "light beige caramel chunks with rounded edges" ] } ] }, "stick": { "material": "light natural wood", "texture": "smooth with subtle grain", "shape": "rounded edges, flat profile", "visibility": "fully visible below ice cream bar" }, "ingredient_callouts": { "style": { "arrows": "curved, thick, dark brown", "text_color": "dark brown", "font_style": "clean sans-serif", "layout": "balanced around product" }, "labels": [ { "text": "Chocolate with almonds", "position": "top-left", "visual_aid": [ "whole almonds", "small chocolate squares" ] }, { "text": "Chocolate ice cream with brownies", "position": "left-middle", "visual_aid": [ "brownie chunks" ] }, { "text": "Chocolate ice cream with brownies", "position": "right-middle", "visual_aid": [ "brownie chunks" ] }, { "text": "Vanilla ice cream with caramel pieces", "position": "bottom-right", "visual_aid": [ "caramel cubes", "white vanilla pieces" ] } ] }, "color_palette": { "primary_colors": [ "milk chocolate brown", "golden yellow", "cream white" ], "secondary_colors": [ "dark brownie brown", "light caramel orange", "almond beige" ] }, "render_quality": { "sharpness": "extreme micro-detail visibility", "texture_fidelity": "high realism", "noise": "none", "depth_of_field": "moderate, product fully in focus" }, "style_tags": [ "luxury dessert advertising", "hyper-realistic food photography", "commercial product render", "clean studio composition" ] }"
复制
1. npx @runapi.ai/mcp init cursor
2. 重启 Cursor
3. 粘贴这个 prompt:生成一张图像:"{ "resolution": "8K", "aspect_ratio": "3:4", "image_type": "photorealistic commercial product render", "scene_description": { "main_subject": "A vertically centered ice cream bar on a wooden stick", "orientation": "upright, front-facing, slightly elevated perspective", "composition": "single product centered with surrounding ingredient callouts and curved arrows" }, "background": { "color": "warm golden-yellow gradient", "texture": "smooth, matte, evenly lit", "lighting_falloff": "subtle vignette, darker towards edges" }, "lighting": { "type": "studio lighting", "key_light": "soft frontal light highlighting chocolate gloss", "fill_light": "balanced fill to preserve texture detail", "specular_highlights": "visible on melted chocolate coating", "shadows": "soft shadow beneath ice cream stick" }, "ice_cream_bar": { "shape": "rounded rectangular bar", "surface": "smooth with visible embedded inclusions", "layers": [ { "layer_position": "top coating", "material": "milk chocolate", "state": "melted and dripping", "texture": "glossy, thick, fluid", "details": [ "multiple chocolate drips flowing downward", "irregular almond pieces embedded in coating", "rounded drip edges with gravity pull" ] }, { "layer_position": "left interior", "material": "chocolate ice cream", "texture": "dense, creamy", "details": [ "small dark brownie chunks evenly dispersed", "matte finish compared to outer chocolate" ] }, { "layer_position": "right interior", "material": "vanilla ice cream", "texture": "smooth and creamy", "details": [ "visible caramel pieces", "light beige caramel chunks with rounded edges" ] } ] }, "stick": { "material": "light natural wood", "texture": "smooth with subtle grain", "shape": "rounded edges, flat profile", "visibility": "fully visible below ice cream bar" }, "ingredient_callouts": { "style": { "arrows": "curved, thick, dark brown", "text_color": "dark brown", "font_style": "clean sans-serif", "layout": "balanced around product" }, "labels": [ { "text": "Chocolate with almonds", "position": "top-left", "visual_aid": [ "whole almonds", "small chocolate squares" ] }, { "text": "Chocolate ice cream with brownies", "position": "left-middle", "visual_aid": [ "brownie chunks" ] }, { "text": "Chocolate ice cream with brownies", "position": "right-middle", "visual_aid": [ "brownie chunks" ] }, { "text": "Vanilla ice cream with caramel pieces", "position": "bottom-right", "visual_aid": [ "caramel cubes", "white vanilla pieces" ] } ] }, "color_palette": { "primary_colors": [ "milk chocolate brown", "golden yellow", "cream white" ], "secondary_colors": [ "dark brownie brown", "light caramel orange", "almond beige" ] }, "render_quality": { "sharpness": "extreme micro-detail visibility", "texture_fidelity": "high realism", "noise": "none", "depth_of_field": "moderate, product fully in focus" }, "style_tags": [ "luxury dessert advertising", "hyper-realistic food photography", "commercial product render", "clean studio composition" ] }"
复制
1. npx @runapi.ai/mcp init windsurf
2. 重启 Windsurf
3. 粘贴这个 prompt:生成一张图像:"{ "resolution": "8K", "aspect_ratio": "3:4", "image_type": "photorealistic commercial product render", "scene_description": { "main_subject": "A vertically centered ice cream bar on a wooden stick", "orientation": "upright, front-facing, slightly elevated perspective", "composition": "single product centered with surrounding ingredient callouts and curved arrows" }, "background": { "color": "warm golden-yellow gradient", "texture": "smooth, matte, evenly lit", "lighting_falloff": "subtle vignette, darker towards edges" }, "lighting": { "type": "studio lighting", "key_light": "soft frontal light highlighting chocolate gloss", "fill_light": "balanced fill to preserve texture detail", "specular_highlights": "visible on melted chocolate coating", "shadows": "soft shadow beneath ice cream stick" }, "ice_cream_bar": { "shape": "rounded rectangular bar", "surface": "smooth with visible embedded inclusions", "layers": [ { "layer_position": "top coating", "material": "milk chocolate", "state": "melted and dripping", "texture": "glossy, thick, fluid", "details": [ "multiple chocolate drips flowing downward", "irregular almond pieces embedded in coating", "rounded drip edges with gravity pull" ] }, { "layer_position": "left interior", "material": "chocolate ice cream", "texture": "dense, creamy", "details": [ "small dark brownie chunks evenly dispersed", "matte finish compared to outer chocolate" ] }, { "layer_position": "right interior", "material": "vanilla ice cream", "texture": "smooth and creamy", "details": [ "visible caramel pieces", "light beige caramel chunks with rounded edges" ] } ] }, "stick": { "material": "light natural wood", "texture": "smooth with subtle grain", "shape": "rounded edges, flat profile", "visibility": "fully visible below ice cream bar" }, "ingredient_callouts": { "style": { "arrows": "curved, thick, dark brown", "text_color": "dark brown", "font_style": "clean sans-serif", "layout": "balanced around product" }, "labels": [ { "text": "Chocolate with almonds", "position": "top-left", "visual_aid": [ "whole almonds", "small chocolate squares" ] }, { "text": "Chocolate ice cream with brownies", "position": "left-middle", "visual_aid": [ "brownie chunks" ] }, { "text": "Chocolate ice cream with brownies", "position": "right-middle", "visual_aid": [ "brownie chunks" ] }, { "text": "Vanilla ice cream with caramel pieces", "position": "bottom-right", "visual_aid": [ "caramel cubes", "white vanilla pieces" ] } ] }, "color_palette": { "primary_colors": [ "milk chocolate brown", "golden yellow", "cream white" ], "secondary_colors": [ "dark brownie brown", "light caramel orange", "almond beige" ] }, "render_quality": { "sharpness": "extreme micro-detail visibility", "texture_fidelity": "high realism", "noise": "none", "depth_of_field": "moderate, product fully in focus" }, "style_tags": [ "luxury dessert advertising", "hyper-realistic food photography", "commercial product render", "clean studio composition" ] }"
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\", \"aspect_ratio\": \"3:4\", \"image_type\": \"photorealistic commercial product render\", \"scene_description\": { \"main_subject\": \"A vertically centered ice cream bar on a wooden stick\", \"orientation\": \"upright, front-facing, slightly elevated perspective\", \"composition\": \"single product centered with surrounding ingredient callouts and curved arrows\" }, \"background\": { \"color\": \"warm golden-yellow gradient\", \"texture\": \"smooth, matte, evenly lit\", \"lighting_falloff\": \"subtle vignette, darker towards edges\" }, \"lighting\": { \"type\": \"studio lighting\", \"key_light\": \"soft frontal light highlighting chocolate gloss\", \"fill_light\": \"balanced fill to preserve texture detail\", \"specular_highlights\": \"visible on melted chocolate coating\", \"shadows\": \"soft shadow beneath ice cream stick\" }, \"ice_cream_bar\": { \"shape\": \"rounded rectangular bar\", \"surface\": \"smooth with visible embedded inclusions\", \"layers\": [ { \"layer_position\": \"top coating\", \"material\": \"milk chocolate\", \"state\": \"melted and dripping\", \"texture\": \"glossy, thick, fluid\", \"details\": [ \"multiple chocolate drips flowing downward\", \"irregular almond pieces embedded in coating\", \"rounded drip edges with gravity pull\" ] }, { \"layer_position\": \"left interior\", \"material\": \"chocolate ice cream\", \"texture\": \"dense, creamy\", \"details\": [ \"small dark brownie chunks evenly dispersed\", \"matte finish compared to outer chocolate\" ] }, { \"layer_position\": \"right interior\", \"material\": \"vanilla ice cream\", \"texture\": \"smooth and creamy\", \"details\": [ \"visible caramel pieces\", \"light beige caramel chunks with rounded edges\" ] } ] }, \"stick\": { \"material\": \"light natural wood\", \"texture\": \"smooth with subtle grain\", \"shape\": \"rounded edges, flat profile\", \"visibility\": \"fully visible below ice cream bar\" }, \"ingredient_callouts\": { \"style\": { \"arrows\": \"curved, thick, dark brown\", \"text_color\": \"dark brown\", \"font_style\": \"clean sans-serif\", \"layout\": \"balanced around product\" }, \"labels\": [ { \"text\": \"Chocolate with almonds\", \"position\": \"top-left\", \"visual_aid\": [ \"whole almonds\", \"small chocolate squares\" ] }, { \"text\": \"Chocolate ice cream with brownies\", \"position\": \"left-middle\", \"visual_aid\": [ \"brownie chunks\" ] }, { \"text\": \"Chocolate ice cream with brownies\", \"position\": \"right-middle\", \"visual_aid\": [ \"brownie chunks\" ] }, { \"text\": \"Vanilla ice cream with caramel pieces\", \"position\": \"bottom-right\", \"visual_aid\": [ \"caramel cubes\", \"white vanilla pieces\" ] } ] }, \"color_palette\": { \"primary_colors\": [ \"milk chocolate brown\", \"golden yellow\", \"cream white\" ], \"secondary_colors\": [ \"dark brownie brown\", \"light caramel orange\", \"almond beige\" ] }, \"render_quality\": { \"sharpness\": \"extreme micro-detail visibility\", \"texture_fidelity\": \"high realism\", \"noise\": \"none\", \"depth_of_field\": \"moderate, product fully in focus\" }, \"style_tags\": [ \"luxury dessert advertising\", \"hyper-realistic food photography\", \"commercial product render\", \"clean studio composition\" ] }"
}
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\", \"aspect_ratio\": \"3:4\", \"image_type\": \"photorealistic commercial product render\", \"scene_description\": { \"main_subject\": \"A vertically centered ice cream bar on a wooden stick\", \"orientation\": \"upright, front-facing, slightly elevated perspective\", \"composition\": \"single product centered with surrounding ingredient callouts and curved arrows\" }, \"background\": { \"color\": \"warm golden-yellow gradient\", \"texture\": \"smooth, matte, evenly lit\", \"lighting_falloff\": \"subtle vignette, darker towards edges\" }, \"lighting\": { \"type\": \"studio lighting\", \"key_light\": \"soft frontal light highlighting chocolate gloss\", \"fill_light\": \"balanced fill to preserve texture detail\", \"specular_highlights\": \"visible on melted chocolate coating\", \"shadows\": \"soft shadow beneath ice cream stick\" }, \"ice_cream_bar\": { \"shape\": \"rounded rectangular bar\", \"surface\": \"smooth with visible embedded inclusions\", \"layers\": [ { \"layer_position\": \"top coating\", \"material\": \"milk chocolate\", \"state\": \"melted and dripping\", \"texture\": \"glossy, thick, fluid\", \"details\": [ \"multiple chocolate drips flowing downward\", \"irregular almond pieces embedded in coating\", \"rounded drip edges with gravity pull\" ] }, { \"layer_position\": \"left interior\", \"material\": \"chocolate ice cream\", \"texture\": \"dense, creamy\", \"details\": [ \"small dark brownie chunks evenly dispersed\", \"matte finish compared to outer chocolate\" ] }, { \"layer_position\": \"right interior\", \"material\": \"vanilla ice cream\", \"texture\": \"smooth and creamy\", \"details\": [ \"visible caramel pieces\", \"light beige caramel chunks with rounded edges\" ] } ] }, \"stick\": { \"material\": \"light natural wood\", \"texture\": \"smooth with subtle grain\", \"shape\": \"rounded edges, flat profile\", \"visibility\": \"fully visible below ice cream bar\" }, \"ingredient_callouts\": { \"style\": { \"arrows\": \"curved, thick, dark brown\", \"text_color\": \"dark brown\", \"font_style\": \"clean sans-serif\", \"layout\": \"balanced around product\" }, \"labels\": [ { \"text\": \"Chocolate with almonds\", \"position\": \"top-left\", \"visual_aid\": [ \"whole almonds\", \"small chocolate squares\" ] }, { \"text\": \"Chocolate ice cream with brownies\", \"position\": \"left-middle\", \"visual_aid\": [ \"brownie chunks\" ] }, { \"text\": \"Chocolate ice cream with brownies\", \"position\": \"right-middle\", \"visual_aid\": [ \"brownie chunks\" ] }, { \"text\": \"Vanilla ice cream with caramel pieces\", \"position\": \"bottom-right\", \"visual_aid\": [ \"caramel cubes\", \"white vanilla pieces\" ] } ] }, \"color_palette\": { \"primary_colors\": [ \"milk chocolate brown\", \"golden yellow\", \"cream white\" ], \"secondary_colors\": [ \"dark brownie brown\", \"light caramel orange\", \"almond beige\" ] }, \"render_quality\": { \"sharpness\": \"extreme micro-detail visibility\", \"texture_fidelity\": \"high realism\", \"noise\": \"none\", \"depth_of_field\": \"moderate, product fully in focus\" }, \"style_tags\": [ \"luxury dessert advertising\", \"hyper-realistic food photography\", \"commercial product render\", \"clean studio composition\" ] }"
});
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\", \"aspect_ratio\": \"3:4\", \"image_type\": \"photorealistic commercial product render\", \"scene_description\": { \"main_subject\": \"A vertically centered ice cream bar on a wooden stick\", \"orientation\": \"upright, front-facing, slightly elevated perspective\", \"composition\": \"single product centered with surrounding ingredient callouts and curved arrows\" }, \"background\": { \"color\": \"warm golden-yellow gradient\", \"texture\": \"smooth, matte, evenly lit\", \"lighting_falloff\": \"subtle vignette, darker towards edges\" }, \"lighting\": { \"type\": \"studio lighting\", \"key_light\": \"soft frontal light highlighting chocolate gloss\", \"fill_light\": \"balanced fill to preserve texture detail\", \"specular_highlights\": \"visible on melted chocolate coating\", \"shadows\": \"soft shadow beneath ice cream stick\" }, \"ice_cream_bar\": { \"shape\": \"rounded rectangular bar\", \"surface\": \"smooth with visible embedded inclusions\", \"layers\": [ { \"layer_position\": \"top coating\", \"material\": \"milk chocolate\", \"state\": \"melted and dripping\", \"texture\": \"glossy, thick, fluid\", \"details\": [ \"multiple chocolate drips flowing downward\", \"irregular almond pieces embedded in coating\", \"rounded drip edges with gravity pull\" ] }, { \"layer_position\": \"left interior\", \"material\": \"chocolate ice cream\", \"texture\": \"dense, creamy\", \"details\": [ \"small dark brownie chunks evenly dispersed\", \"matte finish compared to outer chocolate\" ] }, { \"layer_position\": \"right interior\", \"material\": \"vanilla ice cream\", \"texture\": \"smooth and creamy\", \"details\": [ \"visible caramel pieces\", \"light beige caramel chunks with rounded edges\" ] } ] }, \"stick\": { \"material\": \"light natural wood\", \"texture\": \"smooth with subtle grain\", \"shape\": \"rounded edges, flat profile\", \"visibility\": \"fully visible below ice cream bar\" }, \"ingredient_callouts\": { \"style\": { \"arrows\": \"curved, thick, dark brown\", \"text_color\": \"dark brown\", \"font_style\": \"clean sans-serif\", \"layout\": \"balanced around product\" }, \"labels\": [ { \"text\": \"Chocolate with almonds\", \"position\": \"top-left\", \"visual_aid\": [ \"whole almonds\", \"small chocolate squares\" ] }, { \"text\": \"Chocolate ice cream with brownies\", \"position\": \"left-middle\", \"visual_aid\": [ \"brownie chunks\" ] }, { \"text\": \"Chocolate ice cream with brownies\", \"position\": \"right-middle\", \"visual_aid\": [ \"brownie chunks\" ] }, { \"text\": \"Vanilla ice cream with caramel pieces\", \"position\": \"bottom-right\", \"visual_aid\": [ \"caramel cubes\", \"white vanilla pieces\" ] } ] }, \"color_palette\": { \"primary_colors\": [ \"milk chocolate brown\", \"golden yellow\", \"cream white\" ], \"secondary_colors\": [ \"dark brownie brown\", \"light caramel orange\", \"almond beige\" ] }, \"render_quality\": { \"sharpness\": \"extreme micro-detail visibility\", \"texture_fidelity\": \"high realism\", \"noise\": \"none\", \"depth_of_field\": \"moderate, product fully in focus\" }, \"style_tags\": [ \"luxury dessert advertising\", \"hyper-realistic food photography\", \"commercial product render\", \"clean studio composition\" ] }"
)
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\\\", \\\"aspect_ratio\\\": \\\"3:4\\\", \\\"image_type\\\": \\\"photorealistic commercial product render\\\", \\\"scene_description\\\": { \\\"main_subject\\\": \\\"A vertically centered ice cream bar on a wooden stick\\\", \\\"orientation\\\": \\\"upright, front-facing, slightly elevated perspective\\\", \\\"composition\\\": \\\"single product centered with surrounding ingredient callouts and curved arrows\\\" }, \\\"background\\\": { \\\"color\\\": \\\"warm golden-yellow gradient\\\", \\\"texture\\\": \\\"smooth, matte, evenly lit\\\", \\\"lighting_falloff\\\": \\\"subtle vignette, darker towards edges\\\" }, \\\"lighting\\\": { \\\"type\\\": \\\"studio lighting\\\", \\\"key_light\\\": \\\"soft frontal light highlighting chocolate gloss\\\", \\\"fill_light\\\": \\\"balanced fill to preserve texture detail\\\", \\\"specular_highlights\\\": \\\"visible on melted chocolate coating\\\", \\\"shadows\\\": \\\"soft shadow beneath ice cream stick\\\" }, \\\"ice_cream_bar\\\": { \\\"shape\\\": \\\"rounded rectangular bar\\\", \\\"surface\\\": \\\"smooth with visible embedded inclusions\\\", \\\"layers\\\": [ { \\\"layer_position\\\": \\\"top coating\\\", \\\"material\\\": \\\"milk chocolate\\\", \\\"state\\\": \\\"melted and dripping\\\", \\\"texture\\\": \\\"glossy, thick, fluid\\\", \\\"details\\\": [ \\\"multiple chocolate drips flowing downward\\\", \\\"irregular almond pieces embedded in coating\\\", \\\"rounded drip edges with gravity pull\\\" ] }, { \\\"layer_position\\\": \\\"left interior\\\", \\\"material\\\": \\\"chocolate ice cream\\\", \\\"texture\\\": \\\"dense, creamy\\\", \\\"details\\\": [ \\\"small dark brownie chunks evenly dispersed\\\", \\\"matte finish compared to outer chocolate\\\" ] }, { \\\"layer_position\\\": \\\"right interior\\\", \\\"material\\\": \\\"vanilla ice cream\\\", \\\"texture\\\": \\\"smooth and creamy\\\", \\\"details\\\": [ \\\"visible caramel pieces\\\", \\\"light beige caramel chunks with rounded edges\\\" ] } ] }, \\\"stick\\\": { \\\"material\\\": \\\"light natural wood\\\", \\\"texture\\\": \\\"smooth with subtle grain\\\", \\\"shape\\\": \\\"rounded edges, flat profile\\\", \\\"visibility\\\": \\\"fully visible below ice cream bar\\\" }, \\\"ingredient_callouts\\\": { \\\"style\\\": { \\\"arrows\\\": \\\"curved, thick, dark brown\\\", \\\"text_color\\\": \\\"dark brown\\\", \\\"font_style\\\": \\\"clean sans-serif\\\", \\\"layout\\\": \\\"balanced around product\\\" }, \\\"labels\\\": [ { \\\"text\\\": \\\"Chocolate with almonds\\\", \\\"position\\\": \\\"top-left\\\", \\\"visual_aid\\\": [ \\\"whole almonds\\\", \\\"small chocolate squares\\\" ] }, { \\\"text\\\": \\\"Chocolate ice cream with brownies\\\", \\\"position\\\": \\\"left-middle\\\", \\\"visual_aid\\\": [ \\\"brownie chunks\\\" ] }, { \\\"text\\\": \\\"Chocolate ice cream with brownies\\\", \\\"position\\\": \\\"right-middle\\\", \\\"visual_aid\\\": [ \\\"brownie chunks\\\" ] }, { \\\"text\\\": \\\"Vanilla ice cream with caramel pieces\\\", \\\"position\\\": \\\"bottom-right\\\", \\\"visual_aid\\\": [ \\\"caramel cubes\\\", \\\"white vanilla pieces\\\" ] } ] }, \\\"color_palette\\\": { \\\"primary_colors\\\": [ \\\"milk chocolate brown\\\", \\\"golden yellow\\\", \\\"cream white\\\" ], \\\"secondary_colors\\\": [ \\\"dark brownie brown\\\", \\\"light caramel orange\\\", \\\"almond beige\\\" ] }, \\\"render_quality\\\": { \\\"sharpness\\\": \\\"extreme micro-detail visibility\\\", \\\"texture_fidelity\\\": \\\"high realism\\\", \\\"noise\\\": \\\"none\\\", \\\"depth_of_field\\\": \\\"moderate, product fully in focus\\\" }, \\\"style_tags\\\": [ \\\"luxury dessert advertising\\\", \\\"hyper-realistic food photography\\\", \\\"commercial product render\\\", \\\"clean studio composition\\\" ] }\"}")
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)
}