Meta Model API

Start here

Overview
Quickstart
Authentication
Models
SDKs and libraries
Pricing and rate limits

Capabilities

Tool calling
Tool search
Search grounding
Image understanding
Video understanding
File handling
Reasoning
Structured output
Prompt caching
Token counting

Protocols

Choosing an API
Responses API
Chat Completions API
Messages API

Cookbook

All recipes
API fundamentals
Agent patterns
Use cases
Building with Muse Code

Muse Code

Overview
Authentication and billing
Permissions and safety
Working with the agent
Configuration and context
Extending and automating

Muse Glimmer

Overview
Get the model
Prompting guide
Quantization
Speculative decoding
Run inference
Customization

Agent guides

Coding agents
Agent frameworks
Computer use

API reference

Introduction
Error handling
Status
Responses
Chat completions
Messages
Files
Models

Log in

--- meta: title: Muse Code description: Muse Code is Meta's coding agent for the terminal and CI, built on Muse Spark, with approvals, sandboxing, sessions, and multi-agent orchestration. keywords: Muse Code, coding agent, CLI, terminal, Muse Spark, agent harness cms: alias: /model-api/docs/muse-code target: aidmc --- # Muse Code Muse Code is Meta's coding agent for the terminal and CI, built on [Muse Spark](/docs/models). Run it in a project and it plans, edits, and runs commands to do a task, with approvals and an OS sandbox on from the first run. Muse Code and the [Model API](/docs/overview) are two ways to use the same model. Call the API directly when you build your own agent or app. Run Muse Code when you want a ready-made coding agent at the command line or in a pipeline. ## Install {#install} Install Muse Code with the one-line shell installer. It installs a native binary on your path for macOS and Linux: ```bash curl -fsSL https://dev.meta.ai/install.sh | sh ``` Confirm it's on your path: ```bash muse --version ``` ## First run {#first-run} Run `muse` in any project directory to start an interactive session. On first entry Muse Code asks whether to [trust the workspace](/docs/muse-code/permissions#trust-scopes) and prompts you to authenticate with a browser sign-in or an API key. When you trust the workspace, Muse Code loads the project's skills, rules, and hooks. The default model is `muse-spark-1.2`. ```bash cd /path/to/your/project muse ``` Reopen the sign-in options any time from an interactive session with `/login`. For a non-interactive environment such as [CI](/docs/muse-code/extending#headless), set `META_API_KEY` instead. See [authentication and billing](/docs/muse-code/auth) for the full sign-in and billing setup flows. ## Interactive or headless {#modes} The same binary runs two ways: - **Interactive**: `muse` opens a terminal UI for a back-and-forth session with slash commands, approvals, and live status. See [working with the agent](/docs/muse-code/interactive). - **Headless**: `muse exec "<prompt>"` runs one prompt to completion for scripts and CI. See [headless and CI](/docs/muse-code/extending#headless). ## What to read next {#whats-here} - **[Authentication and billing](/docs/muse-code/auth)**: sign in, API keys, and plans. - **[Permissions and safety](/docs/muse-code/permissions)**: approval modes, staged shell review, and the sandbox. - **[Working with the agent](/docs/muse-code/interactive)**: slash commands to steer a session, manage context, set goals, and more. - **[Configuration and context](/docs/muse-code/configuration)**: settings, project instructions, model selection, and memory. - **[Extending and automating](/docs/muse-code/extending)**: subagents, skills, hooks, MCP, and headless runs. ## Next steps - Sign in and set up billing in [authentication and billing](/docs/muse-code/auth). - Understand the guardrails before your first real task in [permissions and safety](/docs/muse-code/permissions).

Muse Code

Muse Code is Meta's coding agent for the terminal and CI, built on Muse Spark. Run it in a project and it plans, edits, and runs commands to do a task, with approvals and an OS sandbox on from the first run.Muse Code and the Model API are two ways to use the same model. Call the API directly when you build your own agent or app. Run Muse Code when you want a ready-made coding agent at the command line or in a pipeline.

Install

Install Muse Code with the one-line shell installer. It installs a native binary on your path for macOS and Linux:
Bash
Confirm it's on your path:
Bash

First run

Run muse in any project directory to start an interactive session. On first entry Muse Code asks whether to trust the workspace and prompts you to authenticate with a browser sign-in or an API key. When you trust the workspace, Muse Code loads the project's skills, rules, and hooks. The default model is muse-spark-1.2.
Bash
Reopen the sign-in options any time from an interactive session with /login. For a non-interactive environment such as CI, set META_API_KEY instead. See authentication and billing for the full sign-in and billing setup flows.

Interactive or headless

The same binary runs two ways:
  • •Interactive: muse opens a terminal UI for a back-and-forth session with slash commands, approvals, and live status. See working with the agent.
  • •Headless: muse exec "<prompt>" runs one prompt to completion for scripts and CI. See headless and CI.

What to read next

  • •Authentication and billing: sign in, API keys, and plans.
  • •Permissions and safety: approval modes, staged shell review, and the sandbox.
  • •Working with the agent: slash commands to steer a session, manage context, set goals, and more.
  • •Configuration and context: settings, project instructions, model selection, and memory.
  • •Extending and automating: subagents, skills, hooks, MCP, and headless runs.

Next steps

  • •Sign in and set up billing in authentication and billing.
  • •Understand the guardrails before your first real task in permissions and safety.
Was this page helpful?
Install
First run
Interactive or headless
What to read next
Next steps