Home › Meta Model API tutorial for beginners

Meta Model API tutorial for beginners

Last checked

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

  1. Open the Model API dashboard at dev.meta.ai and sign up.
  2. Generate an API key (one click in the dashboard).
  3. Export it as an environment variable named MODEL_API_KEY.
  4. Install the OpenAI SDK (pip install openai).
  5. 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

  1. Create a key in the Model API dashboard and export MODEL_API_KEY.
  2. pip install openai
  3. Create the client: OpenAI(base_url="https://api.meta.ai/v1", api_key=os.environ["MODEL_API_KEY"]).
  4. Call client.responses.create(model="muse-spark-1.3", input="…").
  5. Print the text of the reply, then try a harder prompt.

Try it: examples

Good to know

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.

Report an error on this page