Muse Ember API Setup: A Step-by-Step Guide with the OpenAI SDK



0850 840 08 23

Setting up the Muse Ember API takes four steps: create an API key in the Meta Model API dashboard, store it in the MODEL_API_KEY environment variable, install the OpenAI Python SDK with pip install openai, and point the client's base_url at https://api.meta.ai/v1 with muse-ember-1.0 as the model. Released by Meta on November 9, 2026, Muse Ember is a low-cost model with a 1M-token context, priced at $0.10 per million input tokens and built for repeated work such as classification, routing and tool calls. The most important setting after setup is the reasoning level: it defaults to max, so short tasks can run slower and cost more than expected.
Muse Ember is the most economical language model Meta offers through its Model API. According to the official model page, Muse Ember is an "execution" model built for repeated, high-volume work: sub-agent tasks, tool calls, routing each request to the right handler, and running the same task over thousands of records. Muse Ember has a context window of 1,048,576 tokens and a maximum output of 524,288 tokens. It takes text, image, video, audio and PDF input and produces text. It works on all three endpoints: Responses, Chat Completions and Messages.
Google Cloud's model page gives Muse Ember's release date as November 9, 2026; the same page lists the model as Preview on Google Cloud, on the global endpoint only. As reported by TestingCatalog, Meta puts Muse Ember at 35.8 on the Artificial Analysis index against 36.2 for Claude Haiku 5.5, with an estimated cost per task of $0.136 for Ember and $0.411 for Haiku. That comparison is Meta's own chart, not an independent test.
You need four things to use Muse Ember through the API:
npm install openai.export on macOS and Linux, or with the PowerShell line on Windows; both are below.Setting up Muse Ember follows Meta's official quickstart; the code blocks below are taken unchanged from the official documentation.
Step 1 — Store the key in an environment variable. The examples read the key from MODEL_API_KEY. Replace the quoted value with your own key. On macOS and Linux:
export MODEL_API_KEY="your-api-key-here"On Windows PowerShell:
$env:MODEL_API_KEY = "your-api-key-here"Step 2 — Install the OpenAI SDK. This command installs the OpenAI package for Python:
pip install openaiStep 3 — Point the client at the Meta endpoint. The Meta-specific settings are the base_url line and passing the key explicitly:
import os
from openai import OpenAI
client = OpenAI(
base_url="https://api.meta.ai/v1",
api_key=os.environ["MODEL_API_KEY"],
)Step 4 — Send the first request. The official Python example uses the Responses API and is written for Muse Spark. Because Muse Ember accepts the same request body as Muse Spark, the only change is the model line: replace muse-spark-1.3 with muse-ember-1.0. Add this below the client in the same file and run the file with Python:
response = client.responses.create(
model="muse-spark-1.3",
input="What is the capital of France?",
)
print(response.model_dump_json(indent=2))Step 5 — Choose the reasoning level. Reasoning cannot be turned off on Muse Ember; the value "none" returns HTTP 400. According to the reasoning documentation, you set the level with reasoning.effort on the Responses API or reasoning_effort on Chat Completions, using minimal, low, medium, high, xhigh or max. Ember defaults to max. Reasoning tokens are billed at the same rate as visible output, so for short tasks like message classification, compare minimal and low on your own examples.
The quickest way to verify the Muse Ember setup independently of Python is the official curl request on the Muse Ember page. It calls muse-ember-1.0 directly and classifies a support ticket:
curl -X POST "https://api.meta.ai/v1/responses" \
-H "Authorization: Bearer $MODEL_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "muse-ember-1.0",
"input": "Classify this support ticket as billing, bug, or feature request, and give a one-sentence reason: \"I was charged twice for my October invoice.\""
}'You should see the ticket placed in the "billing" class with a short reason. The output_tokens_details.reasoning_tokens field in the usage section shows how many tokens went into reasoning; it is the easiest way to check whether your level setting works. If curl works but Python does not, the key is the most likely cause: the OpenAI SDK does not read MODEL_API_KEY automatically, so api_key must be passed to the client explicitly.
Most errors with Muse Ember come from moving code written for OpenAI over unchanged. Based on the limits in the Chat Completions documentation and the reasoning documentation, the main cases are:
| Symptom | Cause | Fix |
|---|---|---|
| The request returns HTTP 400 | A "none" reasoning level or an unsupported parameter such as stop, logit_bias or logprobs | Set the level to minimal and remove unsupported parameters |
| The visible reply is cut off | Reasoning tokens count toward the output limit | Raise max_output_tokens or lower the reasoning level |
| The model forgets earlier reasoning in a multi-turn chat | Chat Completions does not carry reasoning across turns for external keys | Switch to the Responses API and chain turns with previous_response_id |
| You get HTTP 429 | The team limit was exceeded: 3,000 requests and 4,000,000 tokens per minute for Ember | Retry with exponential backoff and jitter; remember the limit is per team, not per key |
HTTP 504 gateway_timeout | A long non-streaming request timed out | Use stream=True for long generations |
| The bill is higher than expected | A request over 200K input tokens bills all its tokens at long-context rates | Split long documents; calculate cost at your real input sizes |
| A JSON schema does not work on the Responses API | The Responses API expects text.format, not response_format | Use the field that matches the endpoint |
Muse Ember is not built to be the whole brain of an assistant on its own; it is designed as the executor next to a larger model. We compiled the table below from Meta's model selection guide and pricing page:
| Model | Model ID | Default reasoning | When to choose it | When not to |
|---|---|---|---|---|
| Muse Wonder | muse-wonder-1.0 | max | Long-running agent work, multi-file code changes, planning | Thousands of short, repeated tasks |
| Muse Spark | muse-spark-1.3 | high | A cheaper main loop, knowledge-heavy questions | Bulk jobs where cost per token matters |
| Muse Ember | muse-ember-1.0 | max | Classification, routing, tool calls, bulk record processing | Hard single-shot coding and knowledge-heavy questions |
In the setup Meta recommends, the larger model plans and Muse Ember handles the volume. Because each request picks its model in the model field, using two models in one application needs no extra setup.
In the example below, an AI assistant handling 10,000 customer conversations a month costs $11.5 in Muse Ember model usage. We used the Standard mode figures from Meta's pricing page: up to 200K input tokens, $0.10 per million input tokens and $0.50 per million output tokens. We assume 4,000 input tokens and 1,500 output tokens including reasoning per conversation; these are our example figures, not numbers published by Meta.
The math covers model usage only; WhatsApp or phone channel fees, integration and maintenance are not included. Cached input is billed at $0.004, so repeated system prompts can lower the bill further.
Before taking Muse Ember live, settle four points:
The steps in this guide are written for the model ID muse-ember-1.0 and the https://api.meta.ai/v1 endpoint. According to the official page, the context window is 1,048,576 tokens and the maximum output is 524,288 tokens. Because the SDK is installed with pip install openai and no version, you get the current OpenAI release on that day; pin the version you use in production in your own dependency file. If Meta releases a new Ember version, the model line is the only place you need to change.
For businesses that handle large numbers of short, similar messages every day, setting up Muse Ember is a chance to cut model costs noticeably. Take an online retailer that receives hundreds of return, shipping and invoice questions a day. It can classify each incoming message with Muse Ember as "return", "shipping", "invoice" or "other" and route it to the right team, passing only complex requests to a stronger model or a person. In the math above, the model cost for 10,000 conversations comes to $11.5; the real work is measuring accuracy in your customers' languages, tuning the reasoning level and settling the data processing terms.
Who it suits, and who it does not:
Three steps you can take this week:
minimal and max; record accuracy, response time and the reasoning_tokens count.To build a similar classification layer on another model, see our Claude Haiku 5.5 API setup guide; for a model built for long documents, our Kimi K3.1 Pro API setup guide; to add an assistant to your website, our AI assistant installation guide. For multi-step flows that turn a classified message into a CRM record, see our AI agent service; to receive customer messages on WhatsApp, our WhatsApp automation service. You can try ready-made scenarios on our demos page.
Last checked: November 12, 2026.
To adapt Muse Ember or another model to your own workflow, visit our AI assistant service page, request a short discovery call through our contact form, or call +90 850 840 08 23 and talk live with Azra, our voice assistant.
Yes. Model API is billed pay-as-you-go, with no minimums or upfront commitment. According to Meta's pricing page, up to 200K input tokens it costs $0.10 per million input tokens, $0.004 for cached input and $0.50 for output. For requests over 200K, all tokens are billed at $0.30, $0.012 and $1.50.
Meta's and Google Cloud's model pages do not list supported languages. Test answer and classification quality in each language you serve with real customer messages before going live, and state the response language explicitly in the prompt.
No. Muse Ember is offered only through Meta Model API, Muse Code and cloud partners such as Google Cloud. Meta's open-weight models that you can run yourself are Muse Spark Open and Muse Glimmer; those are not called over the API.
Yes. Model API follows the OpenAI format, so changing the base_url, the key and the model ID is enough. In addition, remove unsupported parameters such as stop, logit_bias and logprobs, and use the Responses API for multi-turn work.