How to Use the Muse Wonder API?
The Muse Wonder API is Meta’s Model API serving muse-wonder-1.0 at https://api.meta.ai/v1, with three request formats: Responses, Chat Completions, and an Anthropic-compatible Messages endpoint. You authenticate with a Bearer [REDACTED] from dev.meta.ai, pay $4 per million input tokens and $20 per million output tokens, and get a 1,048,576-token context window with reasoning effort from minimal to max. Any OpenAI SDK works once you change the base URL.
This guide takes you from API key to a working agentic loop: making the first request, choosing an endpoint, controlling reasoning, preserving multi-turn state, calling tools, streaming, running background jobs, and reading the usage fields that tell you what each call cost. You can also set up every request in Apidog so your team can test the model without sharing the key. For a broader model overview and benchmark context, start with the Muse Wonder explainer.
Muse Wonder API at a Glance
| Item | Value |
|---|---|
| Base URL | https://api.meta.ai/v1 |
| Model ID | muse-wonder-1.0 |
| Authentication | Authorization: Bearer $MODEL_API_KEY |
| Endpoints |
POST /v1/responses, POST /v1/chat/completions, POST /v1/messages
|
| Price per 1M tokens | $4 input, $20 output, $0.20 cached input |
| Context window | 1,048,576 tokens, no long-context premium |
| Reasoning effort |
minimal, low, medium, high, xhigh, max
|
| Rate limits | 3,000 requests and 4M tokens per minute, per team per model |
| Web search tool | $2.50 per 1,000 queries, in addition to token charges |
Muse Wonder Full, the larger model, is not available through the API. It is only available inside Muse Code on the Power and Maximum plans. Setting Wonder’s reasoning effort to max does not turn it into Full.
Step 1: Get a Key and Make the First Call
Create a key in the Model API dashboard under API keys, then store it as MODEL_API_KEY.
curl https://api.meta.ai/v1/responses \
-H "Authorization: Bearer $MODEL_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "muse-wonder-1.0",
"input": "List three risks in a lease clause that lets the landlord enter without notice.",
"reasoning": {"effort": "medium"},
"max_output_tokens": 2048
}'
With the OpenAI SDK, change the base URL and use your Model API key:
from openai import OpenAI
import os
client = OpenAI(
base_url="https://api.meta.ai/v1",
[REDACTED CREDENTIAL]
)
resp = client.responses.create(
model="muse-wonder-1.0",
input="List three risks in a lease clause that lets the landlord enter without notice.",
reasoning={"effort": "medium"},
max_output_tokens=2048,
)
print(resp.output_text)
print(resp.usage)
The response includes the generated text and a usage block. Inspect it on every call:
-
output_tokens_details.reasoning_tokensshows how much of the output budget was spent on reasoning. -
input_tokens_details.cached_tokensshows how much input was billed at the cached rate.
Step 2: Pick an Endpoint
Meta’s quickstart uses the Responses API, which is the right default for multi-step work. It preserves reasoning across turns and can manage conversation history for you. Use Chat Completions when you already have OpenAI-style code and mainly need compatibility. The Messages endpoint at https://api.meta.ai/v1/messages accepts Anthropic-format requests, which is how Claude Code runs on Muse Wonder.
| Need | Use |
|---|---|
| New agents, tool loops, long sessions | Responses |
| Existing OpenAI-style code, single turns | Chat Completions |
| Claude Code or another Anthropic-format harness | Messages |
| Reasoning summaries | Responses only |
The formats use different parameter names:
- Reasoning effort is
reasoning.efforton Responses and top-levelreasoning_efforton Chat Completions. - Output caps are
max_output_tokensandmax_tokens, respectively. - Structured output on Responses uses
text.format, notresponse_format.
Step 3: Set Reasoning Effort
Muse Wonder always reasons. Setting none returns HTTP 400. The accepted levels are:
minimal
low
medium
high
xhigh
max
If you omit the reasoning parameter, the model chooses its own effort level. Meta recommends using the lowest level that produces acceptable results because reasoning tokens are billed at the $20 output rate and count toward the output cap.
Two practical rules follow:
- Set
max_output_tokensgenerously at high effort. Atmax, reasoning can consume a large share of the output, and a tight cap can truncate the final answer. - Log
reasoning_tokensby request type. This shows what each effort level costs on your real traffic rather than on a benchmark.
The Artificial Analysis runs that scored the model at 52 used max effort and about 54,000 output tokens per task.
On the Responses API, request a reasoning summary by setting reasoning.summary to auto, concise, or detailed. Summaries are not guaranteed; the array may be empty. Raw reasoning is never returned.
Step 4: Carry State Across Turns
The Responses API offers two state modes, and they cannot be combined.
Stateless encrypted replay
This is Meta’s recommendation. Send:
{
"store": false,
"include": ["reasoning.encrypted_content"]
}
Keep the reasoning items returned by the response. On the next turn, pass them back with their encrypted_content and a summary field; an empty array is valid. This preserves the model’s reasoning across turns without Meta storing the conversation.
Server-managed history
This mode is simpler: pass previous_response_id and send only the new input. Instructions do not carry over, so resend your system instructions on every request.
first = client.responses.create(
model="muse-wonder-1.0",
input="Summarize this API's auth flow: ...",
instructions="You are an API reviewer."
)
second = client.responses.create(
model="muse-wonder-1.0",
previous_response_id=first.id,
instructions="You are an API reviewer.",
input="Now list the endpoints that need an OAuth scope."
)
Step 5: Tools, Structured Output, and Web Search
Function tools follow the OpenAI request shape on Responses and Chat Completions. Define each tool with a JSON schema, execute the function_call items returned by the model, then send function_call_output items back. Muse Wonder can call tools in parallel and is trained to recover from failed tool calls, which is part of what Meta’s launch post describes as Active Focus.
For machine-parseable answers, set text.format to a JSON schema on Responses.
For current information, add Meta’s hosted search tool:
tools=[{"type": "web_search"}]
Web search bills $2.50 per 1,000 queries in addition to token charges.
If you already test tool calls for other models, the Apidog agent tool-call harness works unchanged here because the request shape matches OpenAI’s.
Step 6: Stream or Run in the Background
Set stream: true and consume the event stream. Important events include:
response.created
response.output_item.added
response.output_text.delta
response.function_call_arguments.delta
response.completed
response.failed
Reasoning summary deltas arrive as response.reasoning_summary_text.delta when requested.
For long jobs, send background: true. The API acknowledges the job with "status": "queued". Poll or stream lifecycle events from:
GET /v1/responses/{id}?stream=true
Background constraints include:
-
backgroundcannot be combined withstream: trueon the POST request. - The request body is capped at 1 MiB.
- Teams can submit up to 600 new background jobs per minute.
Cancel a background run with:
POST /v1/responses/{id}/cancel
Step 7: Cache What Repeats
Cached input costs $0.20 per million tokens—95% less than the $4 uncached input rate. Meta reports cache hits in:
usage.input_tokens_details.cached_tokens
Use the same prefix strategy as with other providers:
- Put stable material first: system instructions, tool definitions, and reference documents.
- Put per-request content last.
- Check
cached_tokensto confirm that repeated prefixes are actually hitting the cache.
The prompt caching guide covers prefix design in more detail. Also monitor cache-write costs: in Artificial Analysis’s run, $1.92 of Wonder’s $4.52 per-task cost came from cache writes, exceeding the $1.44 gained from cache hits.
Test the Muse Wonder API in Apidog
A shared Apidog project keeps the API key out of chat threads and gives everyone the same request definitions.
Create an environment called
Meta Model APIwithbase_urlset tohttps://api.meta.ai/v1. StoreMODEL_API_KEYas a secret variable; secret values are masked in the UI and never exported.Add three requests, one for each endpoint. Give each request this header:
Authorization: Bearer {{MODEL_API_KEY}}
Duplicate the Responses request for low, medium, and max effort so you can compare costs side by side.
- Assert on usage. Add JSONPath assertions for:
$.usage.output_tokens_details.reasoning_tokens
$.usage.input_tokens_details.cached_tokens
A cached-tokens value of zero when you expected a cache hit usually indicates a prefix bug. Catch it before it reaches production.
Mock HTTP 429. Meta recommends exponential backoff with jitter starting around 500 ms and honoring
Retry-After. Point your client at an Apidog mock that returns 429 with that header, and prove that your retry logic works before sharing the team’s 3,000-request-per-minute limit.Run the tests in CI with the Apidog CLI so model, response, or pricing changes fail your pipeline instead of affecting customers.
Download Apidog and import the three endpoints from the examples above.
Frequently Asked Questions
Does the Muse Wonder API have a free tier?
No. Billing is per token with no minimum, so a few test calls may cost only cents, but there are no free credits. The free-access guide covers the cheapest routes.
Is my API data used for training?
Not in the API’s Standard mode. Muse Code subscriptions default to Contributor mode, which does use your data. That setting belongs to Muse Code, not the API.
Can I use Muse Wonder Full through the API?
No. Muse Wonder Full has no callable model ID and no per-token API price. Only Muse Code Power and Maximum subscribers can select it.
What are the rate limits, and can I raise them?
The API allows 3,000 requests and 4 million tokens per minute per model, counted across every key in your team. Meta’s pricing page lists no tiers or increase process. The rate limits post explains how to stay within them.
Next Step
Run the same real task from your product at low, medium, and max effort, then compare reasoning_tokens before choosing a default. That number—not the $4 input-token headline—is what your bill will mostly track.

Top comments (0)