Home › Meta Model API tutorial for beginners
Meta Model API tutorial for beginners
Meta Model API speaks the same Responses API format as the OpenAI SDK, so your first call is a few lines once the base URL and key are set.
Sign up and log in
- Open the Model API dashboard at dev.meta.ai and sign up.
- Generate an API key (one click in the dashboard).
- Export it as an environment variable named MODEL_API_KEY.
- Install the OpenAI SDK (pip install openai).
- Point it at base_url="https://api.meta.ai/v1" and pass your key; the OpenAI SDK doesn't read MODEL_API_KEY by itself.
Step by step
- Create a key in the Model API dashboard and export MODEL_API_KEY.
- pip install openai
- Create the client: OpenAI(base_url="https://api.meta.ai/v1", api_key=os.environ["MODEL_API_KEY"]).
- Call client.responses.create(model="muse-spark-1.3", input="…").
- Print the text of the reply, then try a harder prompt.
Try it: examples
- First input
Explain the difference between a list and a tuple in Python with one example each.
Good to know
- Models ending in “-contributor” are much cheaper but Meta says they are used to improve its products; the standard models are not.
- Muse Spark and Muse Wonder have a 1M-token context window.
- Coding agents such as OpenCode, Codex and Claude Code can also be pointed at the API (see the coding agents guide).
Prices (US$)
Per million tokens on the Meta Model API page: muse-spark-1.3 US$1.25 input / US$4.25 output, muse-wonder-1.0 US$4.00 / US$20.00, and contributor models US$0.10 / US$0.20 (these are used to improve Meta's products). Muse Image is US$0.01 per image.
Sources (official pages, read Nov 8, 2026)
Written from Meta's official documentation and product pages; we don't run hands-on tests. Features and limits vary by plan and country.
New model: Muse Ember (muse-ember-1.0), $0.10 / $0.50 per 1M tokens.