Productivity Tools 2026-08-06

How to Use Meta Muse Code in 2026: Installation, Beta Access, API Integration, and AI Coding Tutorial

If you want to try Muse Code, your first step is not an install command—it is confirming whether your account already has Muse Code or Meta Model API access. Once you have permission, the learning curve drops sharply: Muse Code is built as an AI coding agent that can grow from simple code generation into testing, debugging, tool use, and multi-step development tasks.

2026 Meta Muse Code tutorial: installation, Beta access, and API integration

Bottom line first

As of August 6, 2026, the Muse Code onboarding path should run on two parallel tracks: confirm Beta eligibility and Meta Model API permissions first, then run a minimal request locally via the official install script or an SDK-compatible call, and only then test repo-level tasks. Muse Code is Meta's terminal AI coding agent (currently in Beta), powered by Muse Spark 1.2; the same model is also available through the Meta Model API in OpenAI- and Anthropic-compatible formats, so you can plug it into Cursor, Claude Code, or OpenCode without abandoning your existing workflow.

In one sentence: Permissions → API Key → minimal request validation → three small tasks (single-file generation, test fix, small issue). Do not submit unsanitized private code to the contributor discount tier.

Confirm access before you install

Muse Code is labeled Beta, and the Meta Model API is in public preview. Both share the same account and billing system, but the entry points differ: use Muse Code for a terminal agent, and use the Model API to build your own agent or wire into an existing IDE.

Work through this checklist in order. Each row includes a pass criterion and what to check when something fails:

Check Entry / action Pass criteria If it fails
Meta Model API account Register and sign in at ai.developer.meta.com Console opens to the API Keys page Region unavailable, account unverified, or waitlist pending
API Key creation Console → API keys → Create API key You receive a MODEL_API_KEY string Billing not linked, org policy restriction, or preview quota full
Muse Code Beta See the Muse Code product page and official docs After install, muse completes browser login or API Key auth Beta not open in your region; try another Meta account or wait for rollout
Model availability Confirm access to muse-spark-1.2 (Muse Code default) or muse-spark-1.1 (some API examples) Minimal API request returns HTTP 200 with text output Wrong model ID, quota exhausted, or rate limit hit

Meta has expanded global access to Muse Spark 1.2, but country availability still depends on what your console shows. Do not trust third-party "Beta unlock" services.

Prepare your local environment

Before running any install command, get your local stack in order. The official Muse Code install script supports macOS and Linux and places a native binary on your PATH. Windows users can start with WSL or skip the CLI entirely and connect via the Meta Model API plus an OpenAI-compatible client.

Recommended setup

  • Terminal: macOS Terminal / iTerm2, or a standard Linux shell
  • Git: clone test repos, review diffs, commit patches
  • Node.js 18+ or Python 3.9+: run SDK samples and project tests (pick what matches your stack)
  • Environment variables: MODEL_API_KEY (API calls), META_API_KEY (Muse Code CI/headless mode)

Pass criteria: git --version, node -v, or python3 --version all return normal output. If they fail: fix PATH and your package manager (Homebrew / apt) before installing Muse Code—a broken environment doubles your debugging cost later.

Apply for access and create an API Key

The Meta Model API bills per token and offers a free-tier direction (exact quotas are on the official pricing page). After creating a key, store it in environment variables—never commit it to a repository.

1
Register a Model API account Complete email verification and billing setup in the console if required. Pass: Dashboard loads. Fail: check region restrictions and waitlist status.
2
Create an API Key API keys → Create API key; copy immediately—it is shown only once. Pass: you have the key string. Fail: org permissions or billing not ready.
3
Write it to environment variables macOS / Linux: export MODEL_API_KEY="your-key", then persist in ~/.zshrc. Pass: echo $MODEL_API_KEY returns a value. Fail: confirm your shell config is sourced.
4
Set a spending cap (strongly recommended) Configure monthly budget alerts in the console; agent tasks burn tokens fast across long contexts and multi-turn tool calls. Pass: alert email or dashboard limit shows. Fail: check billing notification email and payment method.
Model tier Data use Input / output (per M tokens, official list price)
muse-spark-1.2-contributor Used to improve Meta products (discounted) $0.10 / $0.20
muse-spark-1.2 Not used to improve products (standard price) $1.25 / $4.25

Privacy note: if you handle client code, unpublished patents, or repos with PII, prefer the non-contributor tier and avoid putting production keys, .env files, or unsanitized logs into prompts. Official docs spell out contributor data use—have legal review it for enterprise scenarios.

Install Muse Code and run your first request

Muse Code and the Meta Model API are two ways to use the same model: the former is a ready-made terminal agent; the latter fits SDK or IDE plugin integration you already run. Below are three paths.

Path A: Install Muse Code (terminal agent)

Meta publishes a one-line install script (follow the dev.meta.ai docs; if domains or flags change, trust the quickstart page):

curl -fsSL https://dev.meta.ai/install.sh | sh
muse --version

Start an interactive session in your project directory:

cd /path/to/your/project
muse

On first launch you will be asked to trust the current workspace, then sign in via browser or paste an API Key. The default model is muse-spark-1.2. Use /login inside a session to reopen auth options; for CI or headless runs, set META_API_KEY and run muse exec "your task description". Pass criteria: muse --version prints a version number and the interactive UI accepts tasks. If it fails: check network, confirm the install script came from an official domain, and verify PATH includes the muse binary.

Path B: Meta Model API + OpenAI SDK compatibility

If you already use the OpenAI SDK, change only the base URL and model ID—you do not need to wait for the Muse Code CLI:

curl -X POST "https://api.meta.ai/v1/responses" \
  -H "Authorization: Bearer $MODEL_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"model": "muse-spark-1.2", "input": "Write a Python quicksort with a one-line comment on time complexity"}'

Python example (OpenAI SDK):

import os
from openai import OpenAI

client = OpenAI(
    base_url="https://api.meta.ai/v1",
    api_key=os.environ["MODEL_API_KEY"],
)

response = client.responses.create(
    model="muse-spark-1.2",
    input="Explain the time complexity of this code: def fib(n): return n if n < 2 else fib(n-1)+fib(n-2)",
)
print(response.model_dump_json(indent=2))

Pass criteria: HTTP 200 with generated text and a usage field in the response. If it fails: 401 → invalid key; 404 → wrong model ID; 429 → rate limit; region unavailable → check console message.

Path C: Plug into Claude Code, Cursor, and other tools

The Meta Model API is compatible with the Anthropic Messages API and OpenAI Chat Completions. For Claude Code, point the base URL to https://api.meta.ai, use MODEL_API_KEY as the Bearer token, and select muse-spark-1.2 or another ID listed in the docs. OpenCode, LangChain, and Vercel AI SDK need the same three changes: base URL, API key, model ID. See the coding agents guide for full configuration details.

Your first AI coding task: a three-step validation ladder

Do not grant Muse Code full-repo write access on day one. Use a dedicated test repository and climb this ladder to verify the read → edit → run → deliver diff loop.

1
Single-file generation Task: "Add an ISO date parser in src/utils.py with type annotations." Acceptance: file exists and python -c "import ..." runs without error.
2
Unit test fix Task: "pytest tests/test_auth.py has one failure—locate and apply the smallest fix." Acceptance: same command goes green; diff stays small.
3
Small issue handling Task: "Issue #12: login should return 400 on empty password, not 500—add a test and fix the handler." Acceptance: tests pass, manual curl reproduces the fix, change summary included.

Muse Code's multi-agent architecture (parallel workers plus a background reviewer) fits these verifiable tasks well. At each step, require the model to state a plan first, edit code second, then run your acceptance command. If output drifts, narrow context (reference only relevant files) or break the task into smaller pieces.

Move into a real project: read local code, generate tests, submit diffs

After the three-step ladder passes, connect your daily repository. Recommended workflow:

  • Trust scope: on first use, enable workspace trust for a single subdirectory—not the monorepo root by default.
  • Approval mode: use Muse Code's built-in shell approval and OS sandbox; manually confirm dangerous commands (rm, outbound curl, global config changes).
  • Project instructions: add AGENTS.md or supported rules/skills describing stack, test commands, and off-limits paths.
  • Deliverables: require git diff + test logs + risk notes; human review before merge—the same best practice as Cursor or Claude Code.

Muse Spark 1.2 improves over 1.1 on code generation, complex debugging, codebase understanding, and end-to-end development flows; Muse Code is a co-trained harness where tool calls and retries typically beat a generic "wrap the API" agent. If your team is already deep in Cursor, you can treat the Model API as a new model backend without forcing a CLI migration.

Common issues

No permission / login failure

Confirm your Meta account completed Model API registration; run /login inside Muse Code to retry. In CI, use META_API_KEY instead of interactive login.

Region unavailable

Meta is expanding global access, but some countries may still be restricted. If the console shows unavailable, wait for official rollout or evaluate compliant regional deployment—do not bypass restrictions with unauthorized proxies.

Token costs too high

Long context plus multi-turn tool calls burn budget fast. Narrow referenced files, set a monthly cap, use lower reasoning effort for simple tasks, and reserve high effort for complex ones.

Context too large / unstable output

Although Muse Spark supports roughly 1M-token context, agent work should stay at submodule scope. When output drifts, ask for a plan first, cap files per diff, and rerun your acceptance command.

How do Muse Code, Muse Spark, and the Model API relate?

Muse Spark is the underlying multimodal reasoning model (Muse Code defaults to 1.2). Muse Code is the terminal coding agent product. Meta Model API is the HTTP interface for developers calling the same model directly. All three share billing and authentication—the choice is terminal agent vs. custom integration.

Summary

The Muse Code onboarding order is: confirm permissions → set environment variables and API Key → validate with a minimal API call or muse session → run three small tasks → connect a real repo under controlled trust. It is not exclusive with Cursor or Claude Code—you can plug Muse Spark 1.2 into an existing workflow via the Model API, or use Muse Code directly for multi-agent terminal coding. Either way, testing, approval gates, and code review stay non-negotiable.

Run Muse Code more smoothly on Mac mini

Everything in this guide—the Muse Code install script, Git, Node.js/Python test chains, and terminal agent sessions—runs natively on macOS without WSL or driver wrangling. A Unix environment and Homebrew make dependency installs and environment variable management straightforward; Gatekeeper and SIP also give clearer boundaries around API key storage and repository access than most desktop setups.

Mac mini M4's unified memory and roughly 4W idle power make it a strong always-on AI coding node: run tests locally, hold Muse Code interactive sessions, and keep CI pre-checks running quietly in the background. Muse Spark's 1M-token context is memory-bandwidth hungry during multi-turn agent calls—Apple Silicon's unified architecture handles that more comfortably than many same-price discrete-memory PCs.

If you want the most stable, quietest hardware for Muse Code and Meta Model API workflows, Mac mini M4 is one of the best value starting points—get one now and make every step from Beta access to your first PR smoother.

AI Coding

Ready to speed up your development with Muse Code?

No need to buy expensive hardware upfront. Try Mac mini cloud rental and run terminal agents, tests, and API integration workflows in native macOS.