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: Get started with Meta Model API description: Build with Muse Spark on Meta Model API — start with the Muse Code CLI or call the API directly, then explore capabilities, protocols, guides, and cookbook recipes. keywords: Meta Model API, Muse Spark, Muse Code, coding agent, CLI, overview, quickstart, capabilities, cookbook cms: layout: large alias: /model-api/docs/overview target: aidmc --- # Get started with Meta Model API Meta Model API serves Muse Spark, Meta's model for agentic and coding workflows. You get agent-ready primitives with no extra setup: parallel tool calls, streamed tool-call arguments, reasoning that carries across turns, and a 1M-token context window. There are two ways to start. Run Muse Code, Meta's coding agent for the terminal, for the fastest path from install to shipping code. Or call the API directly — it's drop-in compatible with the OpenAI SDK, the Anthropic SDK, and OpenAI-compatible agent CLIs, so you set your client's base URL, add your key, and keep the rest of your code. ## At a glance {#at-a-glance} Everything you need to make your first call. | | | | --- | --- | | **Base URL** | `https://api.meta.ai/v1` | | **[Standard tier](/docs/pricing-rate-limits#standard-tier) models** | `muse-spark-1.1`, `muse-spark-1.2` | | **[Contributor tier](/docs/pricing-rate-limits#contributor-tier) models** | `muse-spark-1.2-contributor` | | **Context window** | 1,048,576 tokens | | **Auth** | Bearer token (`MODEL_API_KEY`) | | **Pricing** | Pay-as-you-go; see [Pricing and rate limits](/docs/pricing-rate-limits) | ## Get started {#get-started} Pick your path: run Muse Code for a ready-made agent, or connect the coding agent you already use to Model API. ### Start building with Muse Code {#muse-code} Muse Code is Meta's coding agent for the terminal and CI, built on Muse Spark. Install it, sign in, and run it in a project. It plans, edits, and runs commands to do a task, with approvals and an OS sandbox on from the first run. Install the CLI on macOS or Linux: ```bash curl -fsSL https://dev.meta.ai/install.sh | sh ``` Start building: ```bash muse # start Muse Code; on first run, choose a browser sign-in or paste an API key ``` > [!NOTE] > Muse Code and the API are two ways to use the same model. Run Muse Code for a ready-made agent at the command line or in CI; call the API directly when you build your own agent or app. Learn more in the [Muse Code overview](/docs/muse-code), or make your first raw API call in the [quickstart](/docs/quickstart). ### Keep your existing stack {#existing-stack} Already have a coding agent? Connect it to Model API and keep working. Muse Spark drives the same agentic loop of file edits, shell commands, and tool calls over an OpenAI- or Anthropic-compatible surface. :::tabs :::tab OpenCode ```json title="opencode.json" { "provider": { "meta": { "npm": "@ai-sdk/openai", "options": { "baseURL": "https://api.meta.ai/v1" } } } } ``` :::tab Codex ```toml title="~/.codex/config.toml" model_provider = "meta" [model_providers.meta] base_url = "https://api.meta.ai/v1" wire_api = "responses" ``` :::tab Claude Code ```shell export ANTHROPIC_BASE_URL="https://api.meta.ai" export ANTHROPIC_AUTH_TOKEN="$MODEL_API_KEY" ``` ::: Full setup for each: [OpenCode](/docs/coding-agents#setup-opencode), [Codex](/docs/coding-agents#setup-codex), and [Claude Code](/docs/coding-agents#setup-claude-code). New to the API? Walk through your first call in the [quickstart](/docs/quickstart). ## Explore the platform {#explore-the-platform} Jump to the surface you need. <tile-group col="3"> <tile color="elevated" icon="monitor" href="/docs/muse-code" title="Muse Code"> Meta's coding agent for the terminal and CI, built on Muse Spark.</tile> <tile color="elevated" icon="chain" href="/docs/quickstart" title="Quickstart"> Set your key, call the API, and read your first response.</tile> <tile color="elevated" icon="chain" href="/docs/models" title="Models"> Muse Spark specs and the standard vs contributor pricing tiers.</tile> <tile color="elevated" icon="chain" href="/docs/cookbook" title="Cookbook"> Copy-paste recipes for primitives, agent loops, and use cases.</tile> <tile color="elevated" icon="chain" href="/docs/pricing-rate-limits" title="Pricing and rate limits"> Per-token pricing for the standard and contributor tiers, plus rate limits.</tile> <tile color="elevated" icon="chain" href="/docs/api-reference" title="API reference"> Full request and response schemas for every endpoint.</tile> </tile-group> ## Capabilities {#capabilities} Muse Spark ships agent-ready primitives. Each page explains the concept, shows code, and covers constraints. <tile-group col="3"> <tile color="elevated" icon="chain" href="/docs/tool-calling" title="Tool calling"> Connect the model to your APIs with parallel, streamed tool calls.</tile> <tile color="elevated" icon="chain" href="/docs/tool-search" title="Tool search"> Discover and load deferred tools on demand to save tokens.</tile> <tile color="elevated" icon="chain" href="/docs/search-grounding" title="Search grounding"> Real-time answers with inline citations, no retrieval stack to build.</tile> <tile color="elevated" icon="chain" href="/docs/image-understanding" title="Image understanding"> Read photos, charts, documents, and screenshots.</tile> <tile color="elevated" icon="chain" href="/docs/video-understanding" title="Video understanding"> Summarize clips, ask questions about footage, and transcribe speech.</tile> <tile color="elevated" icon="chain" href="/docs/file-handling" title="File handling"> Upload once and reference files by ID across requests.</tile> <tile color="elevated" icon="chain" href="/docs/reasoning" title="Reasoning"> Dial reasoning effort up or down per request.</tile> <tile color="elevated" icon="chain" href="/docs/structured-output" title="Structured output"> Return valid JSON that matches your schema every time.</tile> <tile color="elevated" icon="chain" href="/docs/prompt-caching" title="Prompt caching"> Cache repeated prefixes to cut latency and cost.</tile> <tile color="elevated" icon="chain" href="/docs/token-counting" title="Token counting"> Count input tokens before you send to estimate cost and fit context.</tile> </tile-group> ## Protocols {#protocols} Pick the request format your code already speaks — same models, same auth, same cost per token. See [Choosing an API](/docs/protocols) to compare them. <tile-group col="3"> <tile color="elevated" icon="chain" href="/docs/protocols/responses" title="Responses API"> Agentic, multi-step workloads with reasoning replay and server-managed state.</tile> <tile color="elevated" icon="chain" href="/docs/protocols/chat-completions" title="Chat Completions API"> The OpenAI-compatible messages-array endpoint.</tile> <tile color="elevated" icon="chain" href="/docs/protocols/messages" title="Messages API"> The Anthropic Messages-compatible endpoint.</tile> </tile-group> ## Agent guides {#agent-guides} Go deeper on building agents and integrations. <tile-group col="3"> <tile color="elevated" icon="chain" href="/docs/coding-agents" title="Coding agents"> Wire Muse Spark into OpenCode, Codex, and other coding harnesses.</tile> <tile color="elevated" icon="chain" href="/docs/agent-frameworks" title="Agent frameworks"> Build with LangChain, LlamaIndex, and the Vercel AI SDK.</tile> <tile color="elevated" icon="chain" href="/docs/computer-use" title="Computer use"> Drive a desktop from screenshots with a computer-use agent.</tile> </tile-group> ## Model API Cookbook: Featured recipes {#featured-recipes} Start from working code. Explore the full set in the [Cookbook](/docs/cookbook). <tile-group col="3"> <tile color="elevated" icon="chain" href="/docs/cookbook/computer-use" title="Computer use"> Control a desktop from screenshots with a computer-use agent.</tile> <tile color="elevated" icon="chain" href="/docs/cookbook/iterative-game-dev" title="Iterative game dev"> Build a browser game end-to-end with a coding agent, verified in a real browser.</tile> <tile color="elevated" icon="chain" href="/docs/cookbook/quickstart-chat-completions" title="Quickstart: chat completions"> Point the OpenAI SDK at a new base URL and make your first Muse Spark call.</tile> <tile color="elevated" icon="chain" href="/docs/cookbook/tool-function-calling" title="Tool and function calling"> Detect a tool call, execute it, and feed the result back into the loop.</tile> <tile color="elevated" icon="chain" href="/docs/cookbook/search-grounding" title="Search grounding"> Ground answers in live web search with inline citations.</tile> <tile color="elevated" icon="chain" href="/docs/cookbook/multi-agent-orchestration" title="Multi-agent orchestration"> Orchestrate a team of specialists that coordinate through a shared Kanban board.</tile> </tile-group> ## Get unblocked {#get-unblocked} Browse the [Help Center](/help) for accounts, API keys, billing, and rate-limit questions. For anything it doesn't cover, contact support through the Help Center.

Get started with Meta Model API

Meta Model API serves Muse Spark, Meta's model for agentic and coding workflows. You get agent-ready primitives with no extra setup: parallel tool calls, streamed tool-call arguments, reasoning that carries across turns, and a 1M-token context window.There are two ways to start. Run Muse Code, Meta's coding agent for the terminal, for the fastest path from install to shipping code. Or call the API directly — it's drop-in compatible with the OpenAI SDK, the Anthropic SDK, and OpenAI-compatible agent CLIs, so you set your client's base URL, add your key, and keep the rest of your code.

At a glance

Everything you need to make your first call.
Base URL
https://api.meta.ai/v1
Standard tier models
muse-spark-1.1, muse-spark-1.2
Contributor tier models
muse-spark-1.2-contributor
Context window
1,048,576 tokens
Auth
Bearer token (MODEL_API_KEY)
Pricing
Pay-as-you-go; see Pricing and rate limits

Get started

Pick your path: run Muse Code for a ready-made agent, or connect the coding agent you already use to Model API.

Start building with Muse Code

Muse Code is Meta's coding agent for the terminal and CI, built on Muse Spark. Install it, sign in, and run it in a project. It plans, edits, and runs commands to do a task, with approvals and an OS sandbox on from the first run.Install the CLI on macOS or Linux:
Bash
Start building:
Bash
Muse Code and the API are two ways to use the same model. Run Muse Code for a ready-made agent at the command line or in CI; call the API directly when you build your own agent or app.
Learn more in the Muse Code overview, or make your first raw API call in the quickstart.

Keep your existing stack

Already have a coding agent? Connect it to Model API and keep working. Muse Spark drives the same agentic loop of file edits, shell commands, and tool calls over an OpenAI- or Anthropic-compatible surface.
OpenCode
Codex
Claude Code
opencode.json
Full setup for each: OpenCode, Codex, and Claude Code.New to the API? Walk through your first call in the quickstart.

Explore the platform

Jump to the surface you need.
Muse Code Meta's coding agent for the terminal and CI, built on Muse Spark.
Quickstart Set your key, call the API, and read your first response.
Models Muse Spark specs and the standard vs contributor pricing tiers.
Cookbook Copy-paste recipes for primitives, agent loops, and use cases.
Pricing and rate limits Per-token pricing for the standard and contributor tiers, plus rate limits.
API reference Full request and response schemas for every endpoint.

Capabilities

Muse Spark ships agent-ready primitives. Each page explains the concept, shows code, and covers constraints.
Tool calling Connect the model to your APIs with parallel, streamed tool calls.
Tool search Discover and load deferred tools on demand to save tokens.
Search grounding Real-time answers with inline citations, no retrieval stack to build.
Image understanding Read photos, charts, documents, and screenshots.
Video understanding Summarize clips, ask questions about footage, and transcribe speech.
File handling Upload once and reference files by ID across requests.
Reasoning Dial reasoning effort up or down per request.
Structured output Return valid JSON that matches your schema every time.
Prompt caching Cache repeated prefixes to cut latency and cost.
Token counting Count input tokens before you send to estimate cost and fit context.

Protocols

Pick the request format your code already speaks — same models, same auth, same cost per token. See Choosing an API to compare them.
Responses API Agentic, multi-step workloads with reasoning replay and server-managed state.
Chat Completions API The OpenAI-compatible messages-array endpoint.
Messages API The Anthropic Messages-compatible endpoint.

Agent guides

Go deeper on building agents and integrations.
Coding agents Wire Muse Spark into OpenCode, Codex, and other coding harnesses.
Agent frameworks Build with LangChain, LlamaIndex, and the Vercel AI SDK.
Computer use Drive a desktop from screenshots with a computer-use agent.

Model API Cookbook: Featured recipes

Start from working code. Explore the full set in the Cookbook.
Computer use Control a desktop from screenshots with a computer-use agent.
Iterative game dev Build a browser game end-to-end with a coding agent, verified in a real browser.
Quickstart: chat completions Point the OpenAI SDK at a new base URL and make your first Muse Spark call.
Tool and function calling Detect a tool call, execute it, and feed the result back into the loop.
Search grounding Ground answers in live web search with inline citations.
Multi-agent orchestration Orchestrate a team of specialists that coordinate through a shared Kanban board.

Get unblocked

Browse the Help Center for accounts, API keys, billing, and rate-limit questions. For anything it doesn't cover, contact support through the Help Center.
Was this page helpful?
At a glance
Get started
Explore the platform
Capabilities
Protocols
Agent guides
Model API Cookbook: Featured recipes
Get unblocked