Use GPT Image in OpenClaw.
GPT Image 2 is OpenAI's dedicated image generation model — text-to-image and instruction-based image editing with up to 4K output resolution and transparent background support. OpenClaw agents call it through the same RunAPI key and /v1 endpoint used for chat, with no extra skills to install.
Use RunAPI to generate an image with OpenAI GPT Image 2.
Requirements:
- Use the RunAPI API at https://runapi.ai/v1/text_to_image.
- Read the API key from RUNAPI_API_KEY environment variable.
- Set the model to "gpt-image-2-text-to-image".
- Write a descriptive prompt. GPT Image 2 follows natural language instructions closely — describe layout, style, text overlays, and transparency needs.
- Optionally set output_resolution to 1k, 2k, or 4k. Default is 1k.
- The response returns a task_id. Poll the task status endpoint until the task completes, then retrieve the output URL.
curl -X POST https://runapi.ai/v1/text_to_image \
-H "Authorization: Bearer $RUNAPI_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "gpt-image-2-text-to-image",
"prompt": "A product photo of a glass perfume bottle on a marble surface, transparent background, studio lighting, the label reads AURORA in gold serif font",
"output_resolution": "2k",
"aspect_ratio": "3:4"
}'
{
"task_id": "tsk_abc123",
"status": "pending",
"model": "gpt-image-2-text-to-image"
}
Use GPT Image in OpenClaw in three steps
Configure RunAPI
Set the RUNAPI_API_KEY environment variable in your shell profile. If RunAPI is already configured in OpenClaw for chat, the same key works for GPT Image — no additional setup needed.
export RUNAPI_API_KEY=runapi_xxx
Call GPT Image 2
Send a POST request to the text_to_image endpoint with model set to gpt-image-2-text-to-image. Include a descriptive prompt with layout and style instructions. Set output_resolution to 2k or 4k for higher detail. For editing existing images, use the edit_image endpoint with gpt-image-2-image-to-image and provide source_image_urls.
POST /v1/text_to_image
Get the result
The API returns a task_id immediately. Poll the task status endpoint until the status changes to completed, then retrieve the output image URL from the response. GPT Image 2 typically completes within 10–30 seconds depending on resolution.
task_id: tsk_abc123
GPT Image API parameters
| Parameter | Type | Description |
|---|---|---|
model |
string |
Required. gpt-image-2-text-to-image for generation, gpt-image-2-image-to-image for editing. |
prompt |
string |
Required. Natural language description of the desired image. Supports detailed instructions for layout, text overlays, and style. |
output_resolution |
string |
Optional. Output resolution — 1k (default), 2k, or 4k. Higher resolution costs more per image. |
aspect_ratio |
string |
Optional. Defaults to auto. Supports 1:1, 3:2, 2:3, 4:3, 3:4, 16:9, 9:16, and more. |
source_image_urls |
array |
Required for edit_image endpoint. One or more URLs of source images to edit. |
What is GPT Image on OpenClaw?
GPT Image 2 is OpenAI's dedicated image model that works more like a structured design assistant than a keyword-driven generator. You give it a production brief -- layout, text placement, style constraints -- and it follows the instructions closely. Users report strong character consistency, clean text rendering, and readable layouts, though quality can degrade through multiple iterative refinement passes. OpenClaw agents call it through the same RunAPI endpoint used for chat.
GPT Image use cases
UI mockups and app design wireframes
Generate detailed UI mockups from written descriptions, including button layouts, navigation bars, and placeholder content that reads correctly.
Text-heavy posters and presentations
Create exact-text posters, infographics, and presentation slides where the text content is specified in the prompt and rendered with clean, readable layouts.
Character design sheets
Generate character design sheets with turnaround views from a single description, maintaining consistent features across multiple angles.
GPT Image + OpenClaw questions
Yes. OpenClaw agents call GPT Image 2 through the RunAPI text_to_image endpoint. Set the model field to gpt-image-2-text-to-image and send the request with the same RUNAPI_API_KEY you use for chat. No extra skills or plugins required.
GPT Image 2 is OpenAI's dedicated image generation model with higher quality, 4K output, and transparent background support. GPT-4o Image generates images within a chat context but is limited to 1:1, 3:2, or 2:3 aspect ratios. Both are available through RunAPI — use gpt-image-2-text-to-image for standalone generation and gpt-4o-image for chat-integrated image output.
Yes. GPT Image 2 can output images with transparent backgrounds when instructed in the prompt. This is useful for product photos, logos, and UI elements. Specify transparency in your prompt — for example, "product photo with transparent background."
GPT Image 2 is billed per image based on output resolution: 1k is the lowest cost, 2k is mid-range, and 4k is the most expensive. The same rate applies to both text_to_image and edit_image. Check the RunAPI pricing page for current per-image rates. Failed generations are not charged.
Yes. Use the edit_image endpoint with model set to gpt-image-2-image-to-image. Pass the source image URLs in source_image_urls and describe the edit in the prompt — for example, "change the background to a beach sunset" or "add a red hat to the person." GPT Image 2 follows natural language editing instructions.
OpenClaw general setup
Not configured yet? Start with the RunAPI setup guide for OpenClaw.
OpenClaw setup guide →Try GPT Image in OpenClaw today.
Get a free RunAPI key, paste the prompt into OpenClaw, and start generating and editing images with OpenAI GPT Image 2.