# Llama 3.1 8B API Pricing

As of October 10, 2026, Llama 3.1 8B costs $0.03 per 1M input tokens and $0.05 per 1M output tokens from LlamaGate, the lowest of 5 providers. It has a 131,072-token context window and returns up to 8,192 tokens per response.

- Page: https://models.litellm.ai/models/llama-3.1-8b
- Lab: Meta
- LiteLLM model name: `llamagate/llama-3.1-8b`
- Context window: 131,072 tokens
- Max output: 8,192 tokens
- Added to LiteLLM: September 2024
- Prices updated: October 10, 2026

## Pricing by provider

Token prices in USD per 1M tokens.

| Provider | Model name | Input | Output | Cache read | Per image | Per second | Context |
|---|---|---|---|---|---|---|---|
| LlamaGate | `llamagate/llama-3.1-8b` | $0.03 | $0.05 | – | – | – | 128K |
| Cerebras | `cerebras/llama3.1-8b` | $0.10 | $0.10 | – | – | – | 128K |
| Snowflake Cortex | `snowflake/llama3.1-8b` | $0.24 | $0.24 | – | – | – | 128K |
| Together AI | `together_ai/meta-llama/Meta-Llama-3.1-8B` | $0.20 | $0.20 | – | – | – | 16K |
| Vercel AI Gateway | `vercel_ai_gateway/meta/llama-3.1-8b` | $0.05 | $0.08 | – | – | – | 131K |

## Cost examples

1,000 requests with 2,000 input and 500 output tokens each:

- LlamaGate: $0.085
- Vercel AI Gateway: $0.14
- Cerebras: $0.25
- Together AI: $0.50

100 long-document requests with 100,000 input and 2,000 output tokens each:

- LlamaGate: $0.31
- Vercel AI Gateway: $0.516
- Cerebras: $1.02
- Together AI: $2.04

## Features

Supported: Function calling, Structured output.

## Use it with LiteLLM

```python
from litellm import completion

response = completion(
    model="llamagate/llama-3.1-8b",
    messages=[{"role": "user", "content": "Hello!"}],
)
```

## FAQ

### How much does Llama 3.1 8B cost?

Llama 3.1 8B costs $0.03 per 1M input tokens and $0.05 per 1M output tokens from LlamaGate, the lowest of 5 providers.

### What is the context window of Llama 3.1 8B?

Llama 3.1 8B has a 131,072-token context window and returns up to 8,192 tokens per response.

### Which providers offer Llama 3.1 8B?

Llama 3.1 8B is available from 5 providers through LiteLLM: LlamaGate, Cerebras, Snowflake Cortex, Together AI and Vercel AI Gateway. The lowest price is on LlamaGate.

### How do I call Llama 3.1 8B with an OpenAI-compatible API?

Use the LiteLLM Python SDK with model="llamagate/llama-3.1-8b", or add the model to the LiteLLM proxy's config.yaml and send requests to /v1/chat/completions from any OpenAI client. LiteLLM tracks the cost of every request at the prices on this page.

### What features does Llama 3.1 8B support?

Llama 3.1 8B supports function calling and structured output.

### When did LiteLLM add Llama 3.1 8B?

Llama 3.1 8B was added to LiteLLM's model price file in September 2024.

Source: LiteLLM model price file, https://github.com/BerriAI/litellm/blob/main/model_prices_and_context_window.json
