Llama3.1 API Pricing
As of October 10, 2026, Llama3.1 is free to use on Ollama. It has an 8,192-token context window and returns up to 8,192 tokens per response.
- Price
- Free
- Context window
- 8,192 tokens
- Max output
- 8,192 tokens
- Providers
- 1
- Added to LiteLLM
- July 2024
Llama3.1 pricing by provider
1 listing across 1 provider. Token prices are in US dollars per 1M tokens. The highlighted row is the price quoted above.
| Provider | Model name in LiteLLM | Input | Output | Context |
|---|---|---|---|---|
| Ollama | ollama/llama3.1 | $0 | $0 | 8K |
What Llama3.1 costs in practice
1,000 requests with 2,000 input and 500 output tokens each
| Ollama | $0 |
Llama3.1 features
- Function calling
Use Llama3.1 with LiteLLM
Call Llama3.1 through the LiteLLM Python SDK, or put it behind the LiteLLM proxy and send OpenAI-format requests to /v1/chat/completions. LiteLLM tracks the cost of every request at these prices.
from litellm import completion
response = completion(
model="ollama/llama3.1",
messages=[{"role": "user", "content": "Hello!"}],
)model_list:
- model_name: llama3.1
litellm_params:
model: ollama/llama3.1
# credentials: see the provider's LiteLLM docs pagecurl http://0.0.0.0:4000/v1/chat/completions \
-H "Content-Type: application/json" \
-H "Authorization: Bearer sk-1234" \
-d '{
"model": "llama3.1",
"messages": [{"role": "user", "content": "Hello!"}]
}'Llama3.1 FAQ
How much does Llama3.1 cost?
Llama3.1 is free to use on Ollama.
What is the context window of Llama3.1?
Llama3.1 has an 8,192-token context window and returns up to 8,192 tokens per response.
Which providers offer Llama3.1?
Llama3.1 is available from Ollama through LiteLLM, using the model name ollama/llama3.1.
How do I call Llama3.1 with an OpenAI-compatible API?
Use the LiteLLM Python SDK with model="ollama/llama3.1", 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 Llama3.1 support?
Llama3.1 supports function calling.
When did LiteLLM add Llama3.1?
Llama3.1 was added to LiteLLM's model price file in July 2024.
Sources
Prices come from LiteLLM's open-source model_prices_and_context_window.json, which LiteLLM uses to calculate the cost of every request.
LiteLLM docs: Ollama.
Provider pages: Ollama.
