Muse Image API: Generation, Editing & Pricing
Use Meta’s Muse Image API with the correct model ID, generation and editing endpoints, output formats, and pricing. Includes a complete Python example.
Meta’s Muse Image API uses the model ID muse-image-1.0 and the base URL https://api.meta.ai/v1. Use /images/generations for a new image, /images/edits for a one-off edit, or the Responses API when you want to continue refining an image across turns. These interfaces are documented in Meta’s image-generation guide.
This tutorial keeps the first request small: one prompt, one PNG image, and a local file. It then explains how the request shape changes for editing, which output settings matter, and how to interpret the price. It is an integration guide based on documentation, not a live performance review.
If you first need to identify the model or find a consumer interface, read the Muse Image overview. The preview workspace on this website is a separate tool that uses sample photos; it is not the API endpoint described below.
Choose the interface that matches the task
| Task | Official endpoint | Input and result |
|---|---|---|
| Generate an image from text | POST https://api.meta.ai/v1/images/generations | A prompt and settings; image entries in data |
| Edit or combine existing images | POST https://api.meta.ai/v1/images/edits | A prompt plus reference images; image entries in data |
| Continue an image conversation | POST https://api.meta.ai/v1/responses | Interleaved text/images or a follow-up instruction; typed items in output |
The Images endpoints suit a task with a defined start and finish. For example, an application receives a product brief and needs one background concept. The Responses interface is useful when a user wants to refine the result over several turns without rebuilding the whole interaction each time.
Do not choose by URL shape alone. You will need to parse a different response envelope and decide where conversation state should live. Meta’s overview identifies the common base URL and authentication, but that does not make every request parameter interchangeable between endpoint families.
Prepare the account and key
Use your own Meta developer account and follow its current authentication flow. The model documentation explains how to list the models available to a team. A model appearing on a public marketing page does not prove that a particular team or key can call it.
Set MODEL_API_KEY in the environment of the machine or server that will run the example. Keep the value out of browser JavaScript, source control, screenshots, and shared logs. The example below reads it from the environment rather than putting a credential in the source file.
For an application, put this request behind your backend. The browser should send the user’s authorized image task to your server; the server should validate the input and call the provider with its stored credential. Also decide who is allowed to spend generation credits and what counts as a completed job. Those are application responsibilities, not features created by changing the API’s base URL.
Generate one PNG with Python
The following script uses Python’s standard library, so it needs no SDK installation. Save it as generate_image.py, set MODEL_API_KEY, and run it only when you intend to make a billable request. The prompt is an original example brief; it is not a result we generated during this research.
import base64
import json
import os
from pathlib import Path
from urllib.request import Request, urlopen
api_key = os.environ["MODEL_API_KEY"]
body = {
"model": "muse-image-1.0",
"prompt": (
"A ceramic mug on a pale stone tabletop, soft window light "
"from the left, realistic glaze texture, a short contact "
"shadow, and empty space on the right for a headline. "
"Do not add lettering or a logo."
),
"n": 1,
"output_format": "png",
"response_format": "b64_json",
}
request = Request(
"https://api.meta.ai/v1/images/generations",
data=json.dumps(body).encode("utf-8"),
headers={
"Authorization": f"Bearer {api_key}",
"Content-Type": "application/json",
},
method="POST",
)
with urlopen(request, timeout=180) as response:
payload = json.load(response)
images = payload.get("data", [])
if not images or not images[0].get("b64_json"):
raise RuntimeError("The response did not contain a base64 image.")
output = Path("muse-image.png")
output.write_bytes(base64.b64decode(images[0]["b64_json"], validate=True))
print(f"Saved {output}")
The endpoint and request fields follow Meta’s generation reference. We explicitly request PNG and base64 so the file extension and decoding path agree. The timeout is a client setting, not a claim that the model will take that long or complete within that time.
This example intentionally requests one image. After you verify access and understand the result, you can add application-level job tracking and concurrency. Do not begin a production integration by launching a large batch before checking the shape and cost of a single response.
Read the output rather than assuming a file type
The Images API returns an object containing a data array. Meta documents b64_json as the default response format; response_format: "url" returns a temporary signed URL instead. The image output formats listed in the guide are WebP, PNG, and JPEG, with WebP as the default.
These are separate choices. Response format controls how the bytes are delivered. Output format controls how the image is encoded. Renaming a WebP file to .png does not convert it. Either request the format you need, as the example does, or inspect the returned output_format and use a matching file extension.
When using URL delivery, treat the signed URL as temporary. Meta’s guide does not establish a permanent asset URL, and this article does not invent an expiry duration. If your product needs to keep a permitted output, download it and store it under your own retention and access rules. Avoid logging signed asset URLs where people outside the intended audience can retrieve them.
The size parameter specifies a shape
A common integration mistake is treating size: "1792x1024" as a promise of those exact pixel dimensions. Meta’s guide says a WxH value sets the aspect ratio and that the generator produces the image at its own resolution.
Choose the framing you need, then inspect the actual dimensions after receiving the image. Make a separate resized or cropped copy for a card, social post, or product page. Keep the original if your workflow requires it. Do not build a layout that depends on an exact width and height merely because those numbers appeared in the request.
The same guide documents n from 1 to 10, with a default of 1. The four-sample control in this website’s preview is an interface choice for its sample collection; it is not Meta’s batch limit.
Editing uses a different input shape
For an edit, the model needs both an instruction and one or more reference images. Meta’s editing reference documents two submission forms:
- Raw HTTP can send JSON with an
imagesarray. Each image item identifies animage_urlor afile_id. - The compatible SDK editing method sends image files as multipart form data. It does not send that JSON array simply because a generation example used JSON.
Choose one of the documented forms and keep its field names intact. A base64 image in raw JSON belongs inside a data URL, including the media type. An existing uploaded file can instead be referenced by its file ID. Check the Files API before assuming an arbitrary local path can be resolved by a remote server.
The edit instruction should name the intended change and the details to preserve. For example:
Keep the mug’s shape, handle, glaze color, and position. Replace the background with a softly lit kitchen counter. Keep the contact shadow plausible and do not add text or extra objects.
That instruction is an untested example. A result still needs visual review. For products, compare labels, proportions, and materials against the source rather than approving the output because the background looks convincing. The product-photography guide develops that review process.
Continuing an image conversation
On the Responses API, use input for the prompt and inspect the typed items in output. Meta documents image results as image_generation_call items with base64 content in result. The response can also contain message or reasoning-summary items. Select the image item by its type rather than assuming it is always the first array element.
For server-managed state, the guide documents sending the previous response’s id as previous_response_id with the next instruction. It states that store defaults to true. If you choose store: false, follow the documented state-replay flow instead; omitting persistence does not make the previous image available by magic.
This is also a product decision. Decide which conversation identifiers belong to which user, how long your application retains them, and how a user starts over. Keep one person’s ongoing edit separate from another person’s job. This tutorial has not tested Meta’s retention implementation or an account-specific privacy arrangement; read the provider’s current terms for those questions.
Built-in tools and reasoning controls
Muse Image’s search behavior differs from a text model that requires you to add a separate web_search tool. Meta’s guide says image and web search are built in and enabled by default. Sending the text model’s web_search tool to Muse Image can return an unsupported-tool error.
The documentation provides controls for image search, web search, shell use, and reasoning_strength. The Responses API puts supported settings on its image_generation tool, while the Images endpoints have their own parameter shape. Copy the version appropriate to your endpoint; do not mix examples from the two interfaces.
Meta describes high reasoning as allowing refinement over multiple passes and low as returning after a single pass. These are provider descriptions, not a latency comparison we measured. If timing matters, run your own small, repeatable test with the same permitted prompt and save the outputs as well as the timings.
Pricing and rate limits
As checked on September 25, 2026, Meta lists $0.01 per successfully generated and returned image. The page says the price does not change with prompt length, reasoning strength, or built-in search use. It also says failed or safety-filtered images that are not returned are not counted as generated images for this charge.
A simple estimate for 1,000 successfully returned images is therefore:
1,000 images × $0.01 per image = $10 in Meta image-generation charges
That calculation excludes your storage, transfer, application infrastructure, and any separate service charges. It is not an OmniAKey price quote or a guarantee about a future rate. Count the images returned, not just the number of HTTP requests, because one request can ask for more than one image.
Meta’s page lists a separate 150 requests per minute per team limit for Muse Image at this review date. It says multiple keys in one team share the relevant quota. A production queue should respect the current account limit rather than assuming another key gives it an independent allowance.
Handle failures without creating duplicate work
Separate validation errors, access failures, rate limits, transport failures, and responses without an image. A malformed field needs a corrected request. Missing access needs an account or credential fix. Rate limiting calls for slower submission and bounded backoff, following the provider’s current guidance.
A timeout is different: it does not necessarily tell you whether the provider completed the generation. Do not blindly repeat a paid POST request until an image appears. Record your own job identifier and request state, retain safe diagnostic information, and decide how your application handles an uncertain outcome. This article does not claim an idempotency feature for the Images endpoint that we have not verified.
Finally, a successful HTTP status does not establish that the image is suitable for the user’s task. Check the presence of image data and perform the appropriate content, rights, and visual review before publishing it in a product.
Next steps
- Check this site’s preview scope before using its sample workspace as a planning tool.
- Adapt a prompt from the library and try one small request through your authorized provider account.
- Recheck the official image-generation guide when changing endpoints or parameters.
- If you are comparing other image APIs, inspect OmniAKey’s current image-model catalog. This site promotes that destination; its credentials, listed models, and prices are separate from Meta’s API described here.
Questions this guide answers
What is the Muse Image API model ID?
Meta documents muse-image-1.0 at the base URL https://api.meta.ai/v1. Verify that the model is enabled for your team before making a billable request.
Why does the output size differ from the size parameter?
Meta’s guide says the WxH size string sets an aspect ratio, not an exact output pixel size. Inspect the returned image and resize or crop a copy for your final layout.
Can I use an OmniAKey key against Meta’s endpoint?
Do not mix credentials and endpoints. This tutorial describes Meta’s own API and key. A third-party gateway has its own base URL, supported model list, authentication, and pricing.