Llama (Meta) API: endpoints, authentication, models and limits

Connection details

Base URLvaries by host
AuthBearer token via LLAMA_API_KEY
OpenAI SDK compatibleYes
SDKsOpenAI SDK against any host, provider-specific SDKs

Models and token pricing

ModelModel IDContextIn / 1MOut / 1M
Llama 4 Maverickllama-4-maverick-17b-128e1000K$0.200$0.600
Llama 4 Scoutllama-4-scout-17b-16e10000K$0.150$0.400

What is distinctive about this API

  • Llama is a set of open weights rather than a single hosted service, so "the Llama API" in practice means whichever host you route to — Together, Fireworks, Groq, Bedrock, or your own vLLM deployment.
  • That portability is the point: the same model ID can be served from several vendors, which makes price and latency competitive in a way single-vendor models are not.
  • Self-hosting is a first-class option, and the licence permits commercial use subject to its scale threshold.

Constraints worth knowing first

  • Quality varies between hosts running the same nominal model, because quantisation and serving configuration differ — benchmark your own prompts per host rather than assuming parity.
  • Model naming is inconsistent across hosts; the same weights appear under several IDs.

Frequently asked

What is the Llama (Meta) API base URL?
varies by host. Authenticate with a bearer token, conventionally read from the LLAMA_API_KEY environment variable.
Is the Llama (Meta) API compatible with the OpenAI SDK?
Yes. The chat completions surface is wire-compatible, so the official OpenAI client libraries work by pointing base_url at varies by host and supplying a LLAMA_API_KEY. No client library change is needed.
How do I get a Llama (Meta) API key?
Create an account with the provider and generate a key from the developer console, then expose it to your application as LLAMA_API_KEY. Keys are secrets: keep them server-side, never in client bundles or committed config.
Which models does the Llama (Meta) API expose?
Llama 4 Maverick, Llama 4 Scout. Context windows run to 10000K tokens.

Other provider APIs

Meta publishes official documentation at https://www.llama.com/docs. Pricing and limits change; verify against the provider before committing to a budget.

Deploy a model with Swfte Connect

One gateway, every provider, per-token cost visibility. Swap models without touching your code.