Copy
1. claude mcp add runapi -s user -- npx -y @runapi.ai/mcp
2. Restart Claude Code
3. Paste this prompt: Generate an image: "{ "image_type": "studio fashion portrait", "resolution_target": "8K ultra high definition", "orientation": "vertical", "framing": { "shot_type": "full body shot", "camera_angle": "straight-on, eye-level", "subject_position": "centered", "cropping": "head to feet fully visible" }, "subject": { "count": 1, "gender_presentation": "female-presenting", "pose": { "body_orientation": "facing forward", "weight_distribution": "weight shifted to one leg", "legs": { "front_leg": "slightly bent at the knee", "back_leg": "extended, supporting balance", "visibility": "one leg partially exposed through dress slit" }, "arms": { "left_arm": "bent with hand resting on hip", "right_arm": "raised with hand touching hair near head" }, "posture": "upright, relaxed, confident stance" }, "facial_features": { "expression": "neutral to soft confident expression", "eyes": "open, looking directly at camera", "eyebrows": "well-defined", "lips": "full, slightly parted", "makeup": { "foundation": "smooth, even-toned", "blush": "subtle", "lip_color": "soft pink", "eye_makeup": "defined lashes, neutral tones" } }, "hair": { "color": "dark brown", "length": "long", "texture": "slightly wavy", "styling": "loose, flowing", "bangs": "short fringe across forehead" }, "skin": { "tone": "light to medium", "texture": "smooth, evenly lit" } }, "clothing": { "dress": { "type": "evening gown", "length": "floor length", "fit": "fitted bodice, flowing skirt", "neckline": "asymmetrical single-strap", "strap": { "count": 1, "placement": "over one shoulder" }, "pattern": "snake-skin inspired geometric pattern", "primary_color": "green", "secondary_colors": ["white", "light mint green"], "fabric": { "bodice": "structured, patterned fabric", "skirt": "sheer, lightweight, flowing fabric" }, "slit": { "presence": true, "location": "front side", "height": "upper thigh" }, "hemline": "uneven, flowing with layered folds" }, "footwear": { "type": "high-heeled sandals", "color": "matching green", "heel_style": "thin heel", "details": "decorative floral or bow-like embellishment on front strap", "toe_style": "open-toe" }, "accessories": { "visible_jewelry": "none clearly visible", "other_accessories": "none visible" } }, "background": { "type": "studio backdrop", "color_palette": ["teal", "green"], "texture": "soft, cloudy gradient", "pattern": "non-uniform, painterly", "depth": "flat backdrop with subtle tonal variation" }, "lighting": { "style": "studio lighting", "key_light": "soft frontal light", "fill_light": "even fill reducing harsh shadows", "shadows": "minimal, soft", "highlights": "gentle highlights on face and dress texture", "overall_exposure": "balanced" }, "color_balance": { "dominant_colors": ["green", "teal"], "contrast": "moderate", "saturation": "medium to slightly high", "color_harmony": "monochromatic green tones" }, "image_quality": { "sharpness": "high", "clarity": "clean and crisp", "noise": "none visible", "focus": "sharp across entire subject" }, "style_tags": ["fashion photography", "studio portrait", "elegant", "glamour", "high fashion", "editorial"], "ai_generation_notes": { "do_not_add": ["extra jewelry", "additional subjects", "background objects", "props", "text", "logos"] } }"
Copy
1. codex plugin install runapi-mcp@agents
2. Restart Codex
3. Paste this prompt: Generate an image: "{ "image_type": "studio fashion portrait", "resolution_target": "8K ultra high definition", "orientation": "vertical", "framing": { "shot_type": "full body shot", "camera_angle": "straight-on, eye-level", "subject_position": "centered", "cropping": "head to feet fully visible" }, "subject": { "count": 1, "gender_presentation": "female-presenting", "pose": { "body_orientation": "facing forward", "weight_distribution": "weight shifted to one leg", "legs": { "front_leg": "slightly bent at the knee", "back_leg": "extended, supporting balance", "visibility": "one leg partially exposed through dress slit" }, "arms": { "left_arm": "bent with hand resting on hip", "right_arm": "raised with hand touching hair near head" }, "posture": "upright, relaxed, confident stance" }, "facial_features": { "expression": "neutral to soft confident expression", "eyes": "open, looking directly at camera", "eyebrows": "well-defined", "lips": "full, slightly parted", "makeup": { "foundation": "smooth, even-toned", "blush": "subtle", "lip_color": "soft pink", "eye_makeup": "defined lashes, neutral tones" } }, "hair": { "color": "dark brown", "length": "long", "texture": "slightly wavy", "styling": "loose, flowing", "bangs": "short fringe across forehead" }, "skin": { "tone": "light to medium", "texture": "smooth, evenly lit" } }, "clothing": { "dress": { "type": "evening gown", "length": "floor length", "fit": "fitted bodice, flowing skirt", "neckline": "asymmetrical single-strap", "strap": { "count": 1, "placement": "over one shoulder" }, "pattern": "snake-skin inspired geometric pattern", "primary_color": "green", "secondary_colors": ["white", "light mint green"], "fabric": { "bodice": "structured, patterned fabric", "skirt": "sheer, lightweight, flowing fabric" }, "slit": { "presence": true, "location": "front side", "height": "upper thigh" }, "hemline": "uneven, flowing with layered folds" }, "footwear": { "type": "high-heeled sandals", "color": "matching green", "heel_style": "thin heel", "details": "decorative floral or bow-like embellishment on front strap", "toe_style": "open-toe" }, "accessories": { "visible_jewelry": "none clearly visible", "other_accessories": "none visible" } }, "background": { "type": "studio backdrop", "color_palette": ["teal", "green"], "texture": "soft, cloudy gradient", "pattern": "non-uniform, painterly", "depth": "flat backdrop with subtle tonal variation" }, "lighting": { "style": "studio lighting", "key_light": "soft frontal light", "fill_light": "even fill reducing harsh shadows", "shadows": "minimal, soft", "highlights": "gentle highlights on face and dress texture", "overall_exposure": "balanced" }, "color_balance": { "dominant_colors": ["green", "teal"], "contrast": "moderate", "saturation": "medium to slightly high", "color_harmony": "monochromatic green tones" }, "image_quality": { "sharpness": "high", "clarity": "clean and crisp", "noise": "none visible", "focus": "sharp across entire subject" }, "style_tags": ["fashion photography", "studio portrait", "elegant", "glamour", "high fashion", "editorial"], "ai_generation_notes": { "do_not_add": ["extra jewelry", "additional subjects", "background objects", "props", "text", "logos"] } }"
Copy
1. npx @runapi.ai/mcp init cursor
2. Restart Cursor
3. Paste this prompt: Generate an image: "{ "image_type": "studio fashion portrait", "resolution_target": "8K ultra high definition", "orientation": "vertical", "framing": { "shot_type": "full body shot", "camera_angle": "straight-on, eye-level", "subject_position": "centered", "cropping": "head to feet fully visible" }, "subject": { "count": 1, "gender_presentation": "female-presenting", "pose": { "body_orientation": "facing forward", "weight_distribution": "weight shifted to one leg", "legs": { "front_leg": "slightly bent at the knee", "back_leg": "extended, supporting balance", "visibility": "one leg partially exposed through dress slit" }, "arms": { "left_arm": "bent with hand resting on hip", "right_arm": "raised with hand touching hair near head" }, "posture": "upright, relaxed, confident stance" }, "facial_features": { "expression": "neutral to soft confident expression", "eyes": "open, looking directly at camera", "eyebrows": "well-defined", "lips": "full, slightly parted", "makeup": { "foundation": "smooth, even-toned", "blush": "subtle", "lip_color": "soft pink", "eye_makeup": "defined lashes, neutral tones" } }, "hair": { "color": "dark brown", "length": "long", "texture": "slightly wavy", "styling": "loose, flowing", "bangs": "short fringe across forehead" }, "skin": { "tone": "light to medium", "texture": "smooth, evenly lit" } }, "clothing": { "dress": { "type": "evening gown", "length": "floor length", "fit": "fitted bodice, flowing skirt", "neckline": "asymmetrical single-strap", "strap": { "count": 1, "placement": "over one shoulder" }, "pattern": "snake-skin inspired geometric pattern", "primary_color": "green", "secondary_colors": ["white", "light mint green"], "fabric": { "bodice": "structured, patterned fabric", "skirt": "sheer, lightweight, flowing fabric" }, "slit": { "presence": true, "location": "front side", "height": "upper thigh" }, "hemline": "uneven, flowing with layered folds" }, "footwear": { "type": "high-heeled sandals", "color": "matching green", "heel_style": "thin heel", "details": "decorative floral or bow-like embellishment on front strap", "toe_style": "open-toe" }, "accessories": { "visible_jewelry": "none clearly visible", "other_accessories": "none visible" } }, "background": { "type": "studio backdrop", "color_palette": ["teal", "green"], "texture": "soft, cloudy gradient", "pattern": "non-uniform, painterly", "depth": "flat backdrop with subtle tonal variation" }, "lighting": { "style": "studio lighting", "key_light": "soft frontal light", "fill_light": "even fill reducing harsh shadows", "shadows": "minimal, soft", "highlights": "gentle highlights on face and dress texture", "overall_exposure": "balanced" }, "color_balance": { "dominant_colors": ["green", "teal"], "contrast": "moderate", "saturation": "medium to slightly high", "color_harmony": "monochromatic green tones" }, "image_quality": { "sharpness": "high", "clarity": "clean and crisp", "noise": "none visible", "focus": "sharp across entire subject" }, "style_tags": ["fashion photography", "studio portrait", "elegant", "glamour", "high fashion", "editorial"], "ai_generation_notes": { "do_not_add": ["extra jewelry", "additional subjects", "background objects", "props", "text", "logos"] } }"
Copy
1. npx @runapi.ai/mcp init windsurf
2. Restart Windsurf
3. Paste this prompt: Generate an image: "{ "image_type": "studio fashion portrait", "resolution_target": "8K ultra high definition", "orientation": "vertical", "framing": { "shot_type": "full body shot", "camera_angle": "straight-on, eye-level", "subject_position": "centered", "cropping": "head to feet fully visible" }, "subject": { "count": 1, "gender_presentation": "female-presenting", "pose": { "body_orientation": "facing forward", "weight_distribution": "weight shifted to one leg", "legs": { "front_leg": "slightly bent at the knee", "back_leg": "extended, supporting balance", "visibility": "one leg partially exposed through dress slit" }, "arms": { "left_arm": "bent with hand resting on hip", "right_arm": "raised with hand touching hair near head" }, "posture": "upright, relaxed, confident stance" }, "facial_features": { "expression": "neutral to soft confident expression", "eyes": "open, looking directly at camera", "eyebrows": "well-defined", "lips": "full, slightly parted", "makeup": { "foundation": "smooth, even-toned", "blush": "subtle", "lip_color": "soft pink", "eye_makeup": "defined lashes, neutral tones" } }, "hair": { "color": "dark brown", "length": "long", "texture": "slightly wavy", "styling": "loose, flowing", "bangs": "short fringe across forehead" }, "skin": { "tone": "light to medium", "texture": "smooth, evenly lit" } }, "clothing": { "dress": { "type": "evening gown", "length": "floor length", "fit": "fitted bodice, flowing skirt", "neckline": "asymmetrical single-strap", "strap": { "count": 1, "placement": "over one shoulder" }, "pattern": "snake-skin inspired geometric pattern", "primary_color": "green", "secondary_colors": ["white", "light mint green"], "fabric": { "bodice": "structured, patterned fabric", "skirt": "sheer, lightweight, flowing fabric" }, "slit": { "presence": true, "location": "front side", "height": "upper thigh" }, "hemline": "uneven, flowing with layered folds" }, "footwear": { "type": "high-heeled sandals", "color": "matching green", "heel_style": "thin heel", "details": "decorative floral or bow-like embellishment on front strap", "toe_style": "open-toe" }, "accessories": { "visible_jewelry": "none clearly visible", "other_accessories": "none visible" } }, "background": { "type": "studio backdrop", "color_palette": ["teal", "green"], "texture": "soft, cloudy gradient", "pattern": "non-uniform, painterly", "depth": "flat backdrop with subtle tonal variation" }, "lighting": { "style": "studio lighting", "key_light": "soft frontal light", "fill_light": "even fill reducing harsh shadows", "shadows": "minimal, soft", "highlights": "gentle highlights on face and dress texture", "overall_exposure": "balanced" }, "color_balance": { "dominant_colors": ["green", "teal"], "contrast": "moderate", "saturation": "medium to slightly high", "color_harmony": "monochromatic green tones" }, "image_quality": { "sharpness": "high", "clarity": "clean and crisp", "noise": "none visible", "focus": "sharp across entire subject" }, "style_tags": ["fashion photography", "studio portrait", "elegant", "glamour", "high fashion", "editorial"], "ai_generation_notes": { "do_not_add": ["extra jewelry", "additional subjects", "background objects", "props", "text", "logos"] } }"
curl
Node.js
Ruby
Go
Copy
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": "{ \"image_type\": \"studio fashion portrait\", \"resolution_target\": \"8K ultra high definition\", \"orientation\": \"vertical\", \"framing\": { \"shot_type\": \"full body shot\", \"camera_angle\": \"straight-on, eye-level\", \"subject_position\": \"centered\", \"cropping\": \"head to feet fully visible\" }, \"subject\": { \"count\": 1, \"gender_presentation\": \"female-presenting\", \"pose\": { \"body_orientation\": \"facing forward\", \"weight_distribution\": \"weight shifted to one leg\", \"legs\": { \"front_leg\": \"slightly bent at the knee\", \"back_leg\": \"extended, supporting balance\", \"visibility\": \"one leg partially exposed through dress slit\" }, \"arms\": { \"left_arm\": \"bent with hand resting on hip\", \"right_arm\": \"raised with hand touching hair near head\" }, \"posture\": \"upright, relaxed, confident stance\" }, \"facial_features\": { \"expression\": \"neutral to soft confident expression\", \"eyes\": \"open, looking directly at camera\", \"eyebrows\": \"well-defined\", \"lips\": \"full, slightly parted\", \"makeup\": { \"foundation\": \"smooth, even-toned\", \"blush\": \"subtle\", \"lip_color\": \"soft pink\", \"eye_makeup\": \"defined lashes, neutral tones\" } }, \"hair\": { \"color\": \"dark brown\", \"length\": \"long\", \"texture\": \"slightly wavy\", \"styling\": \"loose, flowing\", \"bangs\": \"short fringe across forehead\" }, \"skin\": { \"tone\": \"light to medium\", \"texture\": \"smooth, evenly lit\" } }, \"clothing\": { \"dress\": { \"type\": \"evening gown\", \"length\": \"floor length\", \"fit\": \"fitted bodice, flowing skirt\", \"neckline\": \"asymmetrical single-strap\", \"strap\": { \"count\": 1, \"placement\": \"over one shoulder\" }, \"pattern\": \"snake-skin inspired geometric pattern\", \"primary_color\": \"green\", \"secondary_colors\": [\"white\", \"light mint green\"], \"fabric\": { \"bodice\": \"structured, patterned fabric\", \"skirt\": \"sheer, lightweight, flowing fabric\" }, \"slit\": { \"presence\": true, \"location\": \"front side\", \"height\": \"upper thigh\" }, \"hemline\": \"uneven, flowing with layered folds\" }, \"footwear\": { \"type\": \"high-heeled sandals\", \"color\": \"matching green\", \"heel_style\": \"thin heel\", \"details\": \"decorative floral or bow-like embellishment on front strap\", \"toe_style\": \"open-toe\" }, \"accessories\": { \"visible_jewelry\": \"none clearly visible\", \"other_accessories\": \"none visible\" } }, \"background\": { \"type\": \"studio backdrop\", \"color_palette\": [\"teal\", \"green\"], \"texture\": \"soft, cloudy gradient\", \"pattern\": \"non-uniform, painterly\", \"depth\": \"flat backdrop with subtle tonal variation\" }, \"lighting\": { \"style\": \"studio lighting\", \"key_light\": \"soft frontal light\", \"fill_light\": \"even fill reducing harsh shadows\", \"shadows\": \"minimal, soft\", \"highlights\": \"gentle highlights on face and dress texture\", \"overall_exposure\": \"balanced\" }, \"color_balance\": { \"dominant_colors\": [\"green\", \"teal\"], \"contrast\": \"moderate\", \"saturation\": \"medium to slightly high\", \"color_harmony\": \"monochromatic green tones\" }, \"image_quality\": { \"sharpness\": \"high\", \"clarity\": \"clean and crisp\", \"noise\": \"none visible\", \"focus\": \"sharp across entire subject\" }, \"style_tags\": [\"fashion photography\", \"studio portrait\", \"elegant\", \"glamour\", \"high fashion\", \"editorial\"], \"ai_generation_notes\": { \"do_not_add\": [\"extra jewelry\", \"additional subjects\", \"background objects\", \"props\", \"text\", \"logos\"] } }"
}
JSON
Copy
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": "{ \"image_type\": \"studio fashion portrait\", \"resolution_target\": \"8K ultra high definition\", \"orientation\": \"vertical\", \"framing\": { \"shot_type\": \"full body shot\", \"camera_angle\": \"straight-on, eye-level\", \"subject_position\": \"centered\", \"cropping\": \"head to feet fully visible\" }, \"subject\": { \"count\": 1, \"gender_presentation\": \"female-presenting\", \"pose\": { \"body_orientation\": \"facing forward\", \"weight_distribution\": \"weight shifted to one leg\", \"legs\": { \"front_leg\": \"slightly bent at the knee\", \"back_leg\": \"extended, supporting balance\", \"visibility\": \"one leg partially exposed through dress slit\" }, \"arms\": { \"left_arm\": \"bent with hand resting on hip\", \"right_arm\": \"raised with hand touching hair near head\" }, \"posture\": \"upright, relaxed, confident stance\" }, \"facial_features\": { \"expression\": \"neutral to soft confident expression\", \"eyes\": \"open, looking directly at camera\", \"eyebrows\": \"well-defined\", \"lips\": \"full, slightly parted\", \"makeup\": { \"foundation\": \"smooth, even-toned\", \"blush\": \"subtle\", \"lip_color\": \"soft pink\", \"eye_makeup\": \"defined lashes, neutral tones\" } }, \"hair\": { \"color\": \"dark brown\", \"length\": \"long\", \"texture\": \"slightly wavy\", \"styling\": \"loose, flowing\", \"bangs\": \"short fringe across forehead\" }, \"skin\": { \"tone\": \"light to medium\", \"texture\": \"smooth, evenly lit\" } }, \"clothing\": { \"dress\": { \"type\": \"evening gown\", \"length\": \"floor length\", \"fit\": \"fitted bodice, flowing skirt\", \"neckline\": \"asymmetrical single-strap\", \"strap\": { \"count\": 1, \"placement\": \"over one shoulder\" }, \"pattern\": \"snake-skin inspired geometric pattern\", \"primary_color\": \"green\", \"secondary_colors\": [\"white\", \"light mint green\"], \"fabric\": { \"bodice\": \"structured, patterned fabric\", \"skirt\": \"sheer, lightweight, flowing fabric\" }, \"slit\": { \"presence\": true, \"location\": \"front side\", \"height\": \"upper thigh\" }, \"hemline\": \"uneven, flowing with layered folds\" }, \"footwear\": { \"type\": \"high-heeled sandals\", \"color\": \"matching green\", \"heel_style\": \"thin heel\", \"details\": \"decorative floral or bow-like embellishment on front strap\", \"toe_style\": \"open-toe\" }, \"accessories\": { \"visible_jewelry\": \"none clearly visible\", \"other_accessories\": \"none visible\" } }, \"background\": { \"type\": \"studio backdrop\", \"color_palette\": [\"teal\", \"green\"], \"texture\": \"soft, cloudy gradient\", \"pattern\": \"non-uniform, painterly\", \"depth\": \"flat backdrop with subtle tonal variation\" }, \"lighting\": { \"style\": \"studio lighting\", \"key_light\": \"soft frontal light\", \"fill_light\": \"even fill reducing harsh shadows\", \"shadows\": \"minimal, soft\", \"highlights\": \"gentle highlights on face and dress texture\", \"overall_exposure\": \"balanced\" }, \"color_balance\": { \"dominant_colors\": [\"green\", \"teal\"], \"contrast\": \"moderate\", \"saturation\": \"medium to slightly high\", \"color_harmony\": \"monochromatic green tones\" }, \"image_quality\": { \"sharpness\": \"high\", \"clarity\": \"clean and crisp\", \"noise\": \"none visible\", \"focus\": \"sharp across entire subject\" }, \"style_tags\": [\"fashion photography\", \"studio portrait\", \"elegant\", \"glamour\", \"high fashion\", \"editorial\"], \"ai_generation_notes\": { \"do_not_add\": [\"extra jewelry\", \"additional subjects\", \"background objects\", \"props\", \"text\", \"logos\"] } }"
});
console.log(result.id);
Copy
require "runapi/gpt_image_2"
client = RunApi::GptImage2::Client.new
result = client.text_to_image.run(
model: "gpt-image-2",
prompt: "{ \"image_type\": \"studio fashion portrait\", \"resolution_target\": \"8K ultra high definition\", \"orientation\": \"vertical\", \"framing\": { \"shot_type\": \"full body shot\", \"camera_angle\": \"straight-on, eye-level\", \"subject_position\": \"centered\", \"cropping\": \"head to feet fully visible\" }, \"subject\": { \"count\": 1, \"gender_presentation\": \"female-presenting\", \"pose\": { \"body_orientation\": \"facing forward\", \"weight_distribution\": \"weight shifted to one leg\", \"legs\": { \"front_leg\": \"slightly bent at the knee\", \"back_leg\": \"extended, supporting balance\", \"visibility\": \"one leg partially exposed through dress slit\" }, \"arms\": { \"left_arm\": \"bent with hand resting on hip\", \"right_arm\": \"raised with hand touching hair near head\" }, \"posture\": \"upright, relaxed, confident stance\" }, \"facial_features\": { \"expression\": \"neutral to soft confident expression\", \"eyes\": \"open, looking directly at camera\", \"eyebrows\": \"well-defined\", \"lips\": \"full, slightly parted\", \"makeup\": { \"foundation\": \"smooth, even-toned\", \"blush\": \"subtle\", \"lip_color\": \"soft pink\", \"eye_makeup\": \"defined lashes, neutral tones\" } }, \"hair\": { \"color\": \"dark brown\", \"length\": \"long\", \"texture\": \"slightly wavy\", \"styling\": \"loose, flowing\", \"bangs\": \"short fringe across forehead\" }, \"skin\": { \"tone\": \"light to medium\", \"texture\": \"smooth, evenly lit\" } }, \"clothing\": { \"dress\": { \"type\": \"evening gown\", \"length\": \"floor length\", \"fit\": \"fitted bodice, flowing skirt\", \"neckline\": \"asymmetrical single-strap\", \"strap\": { \"count\": 1, \"placement\": \"over one shoulder\" }, \"pattern\": \"snake-skin inspired geometric pattern\", \"primary_color\": \"green\", \"secondary_colors\": [\"white\", \"light mint green\"], \"fabric\": { \"bodice\": \"structured, patterned fabric\", \"skirt\": \"sheer, lightweight, flowing fabric\" }, \"slit\": { \"presence\": true, \"location\": \"front side\", \"height\": \"upper thigh\" }, \"hemline\": \"uneven, flowing with layered folds\" }, \"footwear\": { \"type\": \"high-heeled sandals\", \"color\": \"matching green\", \"heel_style\": \"thin heel\", \"details\": \"decorative floral or bow-like embellishment on front strap\", \"toe_style\": \"open-toe\" }, \"accessories\": { \"visible_jewelry\": \"none clearly visible\", \"other_accessories\": \"none visible\" } }, \"background\": { \"type\": \"studio backdrop\", \"color_palette\": [\"teal\", \"green\"], \"texture\": \"soft, cloudy gradient\", \"pattern\": \"non-uniform, painterly\", \"depth\": \"flat backdrop with subtle tonal variation\" }, \"lighting\": { \"style\": \"studio lighting\", \"key_light\": \"soft frontal light\", \"fill_light\": \"even fill reducing harsh shadows\", \"shadows\": \"minimal, soft\", \"highlights\": \"gentle highlights on face and dress texture\", \"overall_exposure\": \"balanced\" }, \"color_balance\": { \"dominant_colors\": [\"green\", \"teal\"], \"contrast\": \"moderate\", \"saturation\": \"medium to slightly high\", \"color_harmony\": \"monochromatic green tones\" }, \"image_quality\": { \"sharpness\": \"high\", \"clarity\": \"clean and crisp\", \"noise\": \"none visible\", \"focus\": \"sharp across entire subject\" }, \"style_tags\": [\"fashion photography\", \"studio portrait\", \"elegant\", \"glamour\", \"high fashion\", \"editorial\"], \"ai_generation_notes\": { \"do_not_add\": [\"extra jewelry\", \"additional subjects\", \"background objects\", \"props\", \"text\", \"logos\"] } }"
)
puts result.id
Copy
package main
import (
"context"
"fmt"
"log"
"net/http"
"os"
"strings"
)
func main() {
body := strings.NewReader("{\"model\":\"gpt-image-2\",\"prompt\":\"{ \\\"image_type\\\": \\\"studio fashion portrait\\\", \\\"resolution_target\\\": \\\"8K ultra high definition\\\", \\\"orientation\\\": \\\"vertical\\\", \\\"framing\\\": { \\\"shot_type\\\": \\\"full body shot\\\", \\\"camera_angle\\\": \\\"straight-on, eye-level\\\", \\\"subject_position\\\": \\\"centered\\\", \\\"cropping\\\": \\\"head to feet fully visible\\\" }, \\\"subject\\\": { \\\"count\\\": 1, \\\"gender_presentation\\\": \\\"female-presenting\\\", \\\"pose\\\": { \\\"body_orientation\\\": \\\"facing forward\\\", \\\"weight_distribution\\\": \\\"weight shifted to one leg\\\", \\\"legs\\\": { \\\"front_leg\\\": \\\"slightly bent at the knee\\\", \\\"back_leg\\\": \\\"extended, supporting balance\\\", \\\"visibility\\\": \\\"one leg partially exposed through dress slit\\\" }, \\\"arms\\\": { \\\"left_arm\\\": \\\"bent with hand resting on hip\\\", \\\"right_arm\\\": \\\"raised with hand touching hair near head\\\" }, \\\"posture\\\": \\\"upright, relaxed, confident stance\\\" }, \\\"facial_features\\\": { \\\"expression\\\": \\\"neutral to soft confident expression\\\", \\\"eyes\\\": \\\"open, looking directly at camera\\\", \\\"eyebrows\\\": \\\"well-defined\\\", \\\"lips\\\": \\\"full, slightly parted\\\", \\\"makeup\\\": { \\\"foundation\\\": \\\"smooth, even-toned\\\", \\\"blush\\\": \\\"subtle\\\", \\\"lip_color\\\": \\\"soft pink\\\", \\\"eye_makeup\\\": \\\"defined lashes, neutral tones\\\" } }, \\\"hair\\\": { \\\"color\\\": \\\"dark brown\\\", \\\"length\\\": \\\"long\\\", \\\"texture\\\": \\\"slightly wavy\\\", \\\"styling\\\": \\\"loose, flowing\\\", \\\"bangs\\\": \\\"short fringe across forehead\\\" }, \\\"skin\\\": { \\\"tone\\\": \\\"light to medium\\\", \\\"texture\\\": \\\"smooth, evenly lit\\\" } }, \\\"clothing\\\": { \\\"dress\\\": { \\\"type\\\": \\\"evening gown\\\", \\\"length\\\": \\\"floor length\\\", \\\"fit\\\": \\\"fitted bodice, flowing skirt\\\", \\\"neckline\\\": \\\"asymmetrical single-strap\\\", \\\"strap\\\": { \\\"count\\\": 1, \\\"placement\\\": \\\"over one shoulder\\\" }, \\\"pattern\\\": \\\"snake-skin inspired geometric pattern\\\", \\\"primary_color\\\": \\\"green\\\", \\\"secondary_colors\\\": [\\\"white\\\", \\\"light mint green\\\"], \\\"fabric\\\": { \\\"bodice\\\": \\\"structured, patterned fabric\\\", \\\"skirt\\\": \\\"sheer, lightweight, flowing fabric\\\" }, \\\"slit\\\": { \\\"presence\\\": true, \\\"location\\\": \\\"front side\\\", \\\"height\\\": \\\"upper thigh\\\" }, \\\"hemline\\\": \\\"uneven, flowing with layered folds\\\" }, \\\"footwear\\\": { \\\"type\\\": \\\"high-heeled sandals\\\", \\\"color\\\": \\\"matching green\\\", \\\"heel_style\\\": \\\"thin heel\\\", \\\"details\\\": \\\"decorative floral or bow-like embellishment on front strap\\\", \\\"toe_style\\\": \\\"open-toe\\\" }, \\\"accessories\\\": { \\\"visible_jewelry\\\": \\\"none clearly visible\\\", \\\"other_accessories\\\": \\\"none visible\\\" } }, \\\"background\\\": { \\\"type\\\": \\\"studio backdrop\\\", \\\"color_palette\\\": [\\\"teal\\\", \\\"green\\\"], \\\"texture\\\": \\\"soft, cloudy gradient\\\", \\\"pattern\\\": \\\"non-uniform, painterly\\\", \\\"depth\\\": \\\"flat backdrop with subtle tonal variation\\\" }, \\\"lighting\\\": { \\\"style\\\": \\\"studio lighting\\\", \\\"key_light\\\": \\\"soft frontal light\\\", \\\"fill_light\\\": \\\"even fill reducing harsh shadows\\\", \\\"shadows\\\": \\\"minimal, soft\\\", \\\"highlights\\\": \\\"gentle highlights on face and dress texture\\\", \\\"overall_exposure\\\": \\\"balanced\\\" }, \\\"color_balance\\\": { \\\"dominant_colors\\\": [\\\"green\\\", \\\"teal\\\"], \\\"contrast\\\": \\\"moderate\\\", \\\"saturation\\\": \\\"medium to slightly high\\\", \\\"color_harmony\\\": \\\"monochromatic green tones\\\" }, \\\"image_quality\\\": { \\\"sharpness\\\": \\\"high\\\", \\\"clarity\\\": \\\"clean and crisp\\\", \\\"noise\\\": \\\"none visible\\\", \\\"focus\\\": \\\"sharp across entire subject\\\" }, \\\"style_tags\\\": [\\\"fashion photography\\\", \\\"studio portrait\\\", \\\"elegant\\\", \\\"glamour\\\", \\\"high fashion\\\", \\\"editorial\\\"], \\\"ai_generation_notes\\\": { \\\"do_not_add\\\": [\\\"extra jewelry\\\", \\\"additional subjects\\\", \\\"background objects\\\", \\\"props\\\", \\\"text\\\", \\\"logos\\\"] } }\"}")
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)
}