
Llama (Meta) API: Access, Rate Limits & SDKs 2026
Meta's Llama API is a Meta-hosted, OpenAI-compatible preview. The same open weights also run on any cloud, self-hosted, or via Llama Stack.
Llama (Meta) API verdict
Meta's Llama API is a Meta-hosted, OpenAI-compatible service in preview.
A bearer LLAMA_API_KEY plus the base URL https://api.llama.com/v1, or /compat/v1 for the OpenAI client, reaches Llama-4-Maverick and Scout, which take text and image at a 128k context, and the Llama-3.3 models. It covers chat completion, image understanding, JSON structured output, tool calling, a moderation safety model and fine-tuning, with Meta-maintained Python and TypeScript SDKs alongside the OpenAI client.
Llama's API story is openness with options. Meta's own preview Llama API is the quickest start, with a bearer key, an OpenAI-compatible base URL and Meta SDKs. The real advantage is broader: the same open weights also run on every major cloud provider, self-hosted, or behind Llama Stack. You are never locked to one endpoint. Build against the OpenAI compatibility endpoint to keep your client and port with light changes, use Llama model names, and test which parameters are silently ignored. Budget around the preview limits, at 10 RPM and 250,000 TPM per team, and the 128k API context, and lean on the no-training data commitment for privacy-sensitive workloads. For volume or full control, move to a cloud provider or self-host the weights.
- The API is a preview release. Endpoints, parameters and models are still changing, and access is via waitlist.
- Preview rate limits are modest and per team, at 10 RPM and 250,000 TPM per model, aggregated across all API keys, with 429s over the limit.
- The Llama API serves Maverick at a 128k context even though the model supports up to 1M, so plan context budgets to the API limit.
- On the OpenAI compatibility endpoint, use Llama model names, expect some parameters to be ignored or 400, and note moderation responses differ from OpenAI's.
- Auth
- Bearer LLAMA_API_KEY
- Base URL
- api.llama.com/v1 (+/compat/v1)
- Status
- Preview (waitlist)
- Rate limit
- 10 RPM / 250k TPM per team
- Data
- No training on your content
Build with the Llama (Meta) API
from openai import OpenAI
client = OpenAI(
api_key="<LLAMA_API_KEY>",
base_url="https://api.llama.com/compat/v1",
)
response = client.chat.completions.create(
model="Llama-4-Maverick-17B-128E-Instruct-FP8",
messages=[{"role": "user", "content": "Hello, world!"}],
)
print(response.choices[0].message.content){
"choices": [{
"message": { "role": "assistant", "content": "Hello! How can I help?" },
"finish_reason": "stop"
}]
}- Tier-1 limits (Llama API preview (per team)): 10 RPM, 250,000 ITPM.
- Cost levers: self-host the open weights (infrastructure cost only); cloud providers for volume; smaller Llama-3.3-8B for cheap text-only calls.
- Handle: 400 (Unsupported OpenAI-compat parameter), 429 (Rate limit (per team RPM/TPM)).
Real Llama (Meta) code from the official docs. The raw cURL hello-world is the code block above; full limits and endpoints are in the tables on this page.
Your first Llama (Meta) API request
curl https://api.llama.com/v1/chat/completions \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${LLAMA_API_KEY}" \
-d '{
"model": "Llama-4-Maverick-17B-128E-Instruct-FP8",
"messages": [{"role": "user", "content": "Hello, world!"}]
}'How to authenticate with the Llama (Meta) API
| Aspect | Detail | Notes |
|---|---|---|
| Auth | Bearer LLAMA_API_KEY | Create a key in the API platform dashboard |
| Base URL | https://api.llama.com/v1 (chat completions) | OpenAI-compat base path: /compat/v1 |
| Status | Preview release (waitlist) | Endpoints, parameters and models still changing |
| Models | Llama-4-Maverick / Scout, Llama-3.3-70B / 8B | Maverick & Scout: text + image; 128k context |
| SDKs | Meta Python & TypeScript SDKs, or OpenAI client | OpenAI compatibility endpoint |
| Data commitment | No training on your inputs or outputs | Encryption at rest and in transit; not used for ads |
| Other ways | Cloud providers, self-host, Llama Stack | Open weights run anywhere |
Llama (Meta) core endpoints and features
| Capability | How | Purpose |
|---|---|---|
| Chat completion | POST /v1/chat/completions | Text generation; response in completion_message.content.text |
| Image understanding | Multimodal messages (Maverick / Scout) | Analyze images, charts and visual data |
| Structured output | JSON schema | Responses that follow a predefined JSON schema |
| Tool calling | tools[] definitions | Call developer-defined tools during generation |
| Moderation | POST /compat/v1/moderations | Safety model checks user and model text |
| Fine-tuning | Fine-tuning & evaluation | Adapt a Llama model on specialized datasets |
| OpenAI compat | /compat/v1/chat/completions, /compat/v1/models | Use OpenAI clients against Llama API |
| Streaming | OpenAI client streaming | Stream chat completions chunk by chunk |
Rate limits and OpenAI-compat rules
| Limit | Detail | Notes |
|---|---|---|
| Per-model limit | 10 RPM / 250,000 TPM | Same across Maverick, Scout, 3.3-70B, 3.3-8B |
| Scope | Per team, aggregated across API keys | Not per key |
| Over-limit | HTTP 429 too many requests | Resumes once RPM/TPM falls below limit |
| Rate-limit headers | x-ratelimit-limit/remaining-tokens & -requests | On every chat completion response |
| API context | 128k tokens on Llama API | Model supports up to 1M; API serves 128k |
| Compat model names | Use Llama model names, not OpenAI names | List via /compat/v1/models |
| Unsupported params | Silently ignored or 400 | Test before migrating from OpenAI |
SDKs, compatibility and developer fit
| Aspect | Detail | Notes |
|---|---|---|
| Compat feature support | Chat, streaming, vision, JSON mode, tools | Moderation supported with response differences |
| Compat endpoints | /compat/v1 chat, models, moderations | Maps to OpenAI client functions |
| Structured output | Pydantic models (OpenAI client) | Generate schema-conforming JSON |
| Moderation difference | category_scores & applied_input_types not supported | Categories match Llama moderations endpoint |
| Playground | Chat completion playground with your key | Test prompts before coding |
| Self-host & Stack | Llama Everywhere guide; Llama Stack REST layer | Run your own or finetuned models |
| API pricing (median) | $0.35/1M in, $0.85/1M out | Independent cross-reference; varies by provider |
Llama (Meta) API FAQ
How do I authenticate with the Llama API?
Create an API key in the Llama API platform dashboard, store it in the LLAMA_API_KEY environment variable, and send it as a bearer token in the Authorization header. The chat completion endpoint is https://api.llama.com/v1/chat/completions, and for OpenAI clients you use the /compat/v1 base path. The API is a preview release, so access is via waitlist and the surface is still changing.
Can I use the OpenAI SDK with the Llama API?
Yes. Llama API supports the OpenAI Python and TypeScript client libraries through the /compat/v1 base path, covering chat completions, streaming, image understanding, structured output through JSON mode, and function calling. Use Llama model names rather than OpenAI names, and list them with client.models.list(). Test your code, since some unsupported parameters are silently ignored, others return a 400, and moderation responses differ from OpenAI's.
Which models does the Llama API serve, and what context?
Llama-4-Maverick-17B-128E-Instruct-FP8 and Llama-4-Scout-17B-16E-Instruct-FP8, both taking text and image input, plus the text-only Llama-3.3-70B-Instruct and Llama-3.3-8B-Instruct. All are served with a 128k-token context on the Llama API, even though Maverick supports up to 1M as a model, so plan context budgets to the API limit.
What are the Llama API rate limits?
In preview the limits are modest and applied per team, not per API key and aggregated across all keys: 10 requests per minute and 250,000 tokens per minute for each model. Exceeding either returns an HTTP 429, and every chat completion response carries x-ratelimit-limit-remaining-tokens and -requests headers, so you can track usage.
What are the other ways to run Llama besides the API?
Because the weights are open, Llama runs three other ways. Cloud providers offer Llama inference, listed under Meta Llama in the Cloud. You can self-host it on your own infrastructure, which the Llama Everywhere guide covers for desktop and Linux. You can also use Llama Stack, a REST-like server and client layer you host yourself with Meta or your own fine-tuned models. Meta also commits not to train on your API inputs or outputs.
Sources & verification
| Source | What was checked | Last checked |
|---|---|---|
| Llama Official | Official product page | July 10, 2026 |
| Artificial Analysis | Independent reference | July 10, 2026 |
| Meta Features Compatibility | Features Compatibility | July 10, 2026 |
| Meta Models | Models | July 10, 2026 |
| Meta Overview | Overview | July 10, 2026 |
| Meta Quickstart | Quickstart | July 10, 2026 |
| Meta Rate Limits | Rate Limits | July 10, 2026 |
Every fact on this Llama (Meta) page is tied to a named source and a verification date. Freshness-sensitive figures trace to the sources above; verify against the vendor before relying on them.
Explore Llama (Meta)
Every page on Llama (Meta) in one place, you are on api.
