Generate an image
Generate one or more images from a text prompt.
POST /images/generations
Generate one or more images from a text prompt.
Request body
Content Type: application/json
Response
HTTP 200: OK
Content Type: application/json
Content Type: text/event-stream
python
import os
from openai import OpenAI
client = OpenAI(
base_url="https://api.meta.ai/v1",
api_key=os.environ["MODEL_API_KEY"],
)
response = client.images.generate(
model="muse-image-1.0",
prompt="a watercolor painting of a red fox sitting in a snowy pine forest, soft golden morning light",
n=1,
)
print(response.model_dump_json(indent=2))import json
import os
import requests
response = requests.post(
"https://api.meta.ai/v1/images/generations",
headers={
"Authorization": f"Bearer {os.environ['MODEL_API_KEY']}",
"Content-Type": "application/json",
},
json={
"model": "muse-image-1.0",
"prompt": "a watercolor painting of a red fox sitting in a snowy pine forest, soft golden morning light",
"n": 1,
},
)
response.raise_for_status()
print(json.dumps(response.json(), indent=2))curl -X POST "https://api.meta.ai/v1/images/generations" \
-H "Authorization: Bearer $MODEL_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "muse-image-1.0",
"prompt": "a watercolor painting of a red fox sitting in a snowy pine forest, soft golden morning light",
"n": 1
}'For prompts, sizing, and worked examples, see the Image generation feature page.
Mirrored from dev.meta.ai/docs/api-reference/images/create-image (synced Oct 30, 2026). Text and examples © Meta. Live demos run on Muse Muse's key.