AI API PricesMeta (Llama) › Llama 3.1 8B

Llama 3.1 8B pricing

Llama 3.1 8B API cost from Meta (Llama) — $0.200 per 1M input tokens and $0.200 per 1M output tokens. Open weights. Estimate your real monthly bill below, then compare it against every other model.

Input price
$0.200
per 1M input tokens
Output price
$0.200
per 1M output tokens
Context window
128K
tokens per request
Reference call
$0.0004
1K in + 1K out

Open weights open weights 128K context · all prices USD per 1M tokens, list price last verified 2026-06-27.

Llama 3.1 8B capabilities & limits

Representative specs for this tier — confirm exact limits in the Meta (Llama) docs.

Context window128K
Max output16K
Knowledge cutoff2025
API formatOpenAI-compatible
✓ Vision✓ Tools / functions✓ JSON / structured✓ Batch API✓ Open weights

API acting up? Check Meta (Llama) status ↗ · all AI API status

Call Llama 3.1 8B from your code

The exact model string and endpoint to use. Works with the OpenAI SDK — just point base_url at the URL below.

Model stringmeta-llama/Llama-3.1-8B-Instruct-Turbo
Base URLhttps://api.together.xyz/v1
API key envTOGETHER_API_KEY
curl https://api.together.xyz/v1/chat/completions \
  -H "Authorization: Bearer $TOGETHER_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "meta-llama/Llama-3.1-8B-Instruct-Turbo",
    "messages": [{"role": "user", "content": "Hello"}]
  }'

Model strings follow each provider's naming convention; confirm the current id in the Meta (Llama) docs before relying on it.

What a Llama 3.1 8B API call actually costs

Blended input + output cost at Llama 3.1 8B's list rates — useful yardsticks before you commit to volume.

$0.0004
Short call
1K in · 1K out
$0.0007
Chat turn
3K in · 500 out
$0.0042
RAG / long prompt
20K in · 1K out
$0.400
1M in + 1M out
bulk job

Llama 3.1 8B cost calculator

Enter your monthly volume to estimate the Llama 3.1 8B bill. Runs entirely in your browser.

Estimated monthly cost

For the full multi-model breakdown, use the cost calculator.

Meta (Llama) models — Llama 3.1 8B in context

How Llama 3.1 8B prices against its siblings. Cheapest reference cost first.

Model Input /1M Output /1M Cost / call* Context Type
Llama 3.1 8B
Open weights
$0.200 $0.200 $0.0004 128K Open weights open
Llama 4 Scout
Open weights (Groq)
$0.110 $0.340 $0.0005 128K Open weights open
Llama 4 Maverick
Open weights (Together AI)
$0.270 $0.850 $0.0011 500K Open weights open
Llama 3.3 70B
Open weights
$1.04 $1.04 $0.0021 128K Open weights open

*Reference cost of one call with 1,000 input + 1,000 output tokens — a neutral yardstick. Use the calculator for your real usage. Cheapest row highlighted.

How Llama 3.1 8B pricing works

Llama 3.1 8B is billed per token: a lower input price of $0.200 per million tokens for everything you send, and a higher output price of $0.200 per million for everything the model generates. To turn that into a real Llama 3.1 8B bill, multiply by your monthly request volume and average prompt/response length — the calculator above does exactly that.

Llama 3.1 8B does not list a separate cached-input rate, so every input token bills at $0.200 per million. If repeated context is a big part of your prompts, a model with prompt caching may end up cheaper in practice.

List prices move fast — always confirm the current numbers on the official Meta (Llama) pricing page before relying on them for budgeting.

Llama 3.1 8B pricing FAQ

How much does the Llama 3.1 8B API cost?

Llama 3.1 8B costs $0.200 per 1M input tokens and $0.200 per 1M output tokens. A typical 3K-input / 500-output call works out to about $0.0007.

What is Llama 3.1 8B's context window?

Llama 3.1 8B has a 128K-token context window. Tokens you put in the prompt are billed at the $0.200 per 1M input rate.

Does Llama 3.1 8B charge extra for output tokens?

Llama 3.1 8B bills input and output at the same $0.200 per 1M rate — common for open-weight models on flat per-token hosting.

Is Llama 3.1 8B a cheap model?

Llama 3.1 8B is already among the lowest-priced models tracked here. Compare it against every model on the full price table.

Is Llama 3.1 8B open weights?

Yes — Llama 3.1 8B is released as open weights, so you can self-host it instead of paying per-token API rates. The prices here are a representative hosted endpoint.

Compare Llama 3.1 8B with other models