# meta-llama/Llama-3.1-8B-Instruct

Llama 3.1 8B Instruct is an 8-billion-parameter instruction-tuned text model from Meta's Llama 3.1 family. It is built for chat and text generation, and it is set up for conversational use with transformers tooling.

- **Model id:** `opencheap/llama-3.1-8b`
- **Price per 1M tokens:** $0.02 input / $0.04 output
- **Context:** 131K tokens, 117K max output

## Providers

7 providers. Prices are per 1M tokens. As of 2026-12-04 11:57 UTC.

| Provider | Input price | Cache price | Output price | Latency | Speed | Uptime | Context | Max output |
| --- | --- | --- | --- | --- | --- | --- | --- | --- |
| Hugging Face · deepinfra · fp8 | $0.02 | $0.02* | $0.04 | 0.45 s | 124 tok/s | 83.3 % (success rate) | 131K | — |
| NanoGPT · quantization unknown | $0.02 | $0.01 | $0.04 | 1.13 s | 115 tok/s | 100 % (success rate) | 131K | 16K |
| DeepInfra · fp8 | $0.021 | $0.021* | $0.042 | 0.55 s | 91 tok/s | 100 % | 131K | 16K |
| Groq · quantization unknown | $0.052 | $0.026 | $0.084 | 0.10 s | 525 tok/s | 100 % | 131K | 117K |
| Amazon Bedrock · quantization unknown | $0.23 | $0.23* | $0.23 | 0.47 s | 138 tok/s | 99.6 % | 131K | 8.1K |
| CoreWeave · bf16 | $0.23 | $0.23 | $0.23 | 0.25 s | 121 tok/s | 100 % | 131K | 117K |

\* No cache discount from this provider: cached tokens cost the input price.

1 more provider through partner hosts · from $0.021 in · $0.042 out

A request picks by price (`:floor`) or by speed (`provider.sort`, `:nitro`), or sets a floor on tokens per second. [How routing works](https://docs.opencheap.si/speed)

### Supported parameters

The parameters each provider supports on this model, from its published list and our own tests of whether answers show the parameter taking effect. A test is a snapshot, not a guarantee; `provider.require_parameters` sends a request only to providers that support every parameter it sets. [Required parameters](https://docs.opencheap.si/speed#require-parameters)

- **Hugging Face · deepinfra:** `temperature`, `top_p`, `top_k`, `seed`, `logit_bias`, `frequency_penalty`, `presence_penalty`, `stop`, `response_format` (tools not confirmed)
- **NanoGPT:** `temperature`, `top_p`, `seed`, `logit_bias`, `presence_penalty`, `stop`, `response_format`, `tools`, `tool_choice`
- **DeepInfra:** `temperature`, `top_p`, `top_k`, `min_p`, `seed`, `logit_bias`, `repetition_penalty`, `frequency_penalty`, `presence_penalty`, `stop`, `response_format` (tools not confirmed)
- **Groq:** `temperature`, `top_p`, `seed`, `stop`, `response_format`, `tools`, `tool_choice`
- **Amazon Bedrock:** `temperature`, `top_p`, `top_k`, `stop` (tools not confirmed)
- **CoreWeave:** `temperature`, `top_p`, `top_k`, `seed`, `repetition_penalty`, `frequency_penalty`, `presence_penalty`, `stop`, `response_format`, `structured_outputs`, `logprobs`, `top_logprobs`, `tools`, `tool_choice`

## Price history

Each provider's price over the last 24 hours, 7 days and 30 days is charted on [the page](https://opencheap.si/models/llama-3.1-8b#price-history).

## API

Point the OpenAI SDK at OpenCheap and pass the model id `opencheap/llama-3.1-8b`; the rest of your code stays the same.

```bash
curl https://api.opencheap.si/v1/chat/completions \
  -H "Authorization: Bearer $OPENCHEAP_API_KEY" -H "Content-Type: application/json" \
  -d '{ "model": "opencheap/llama-3.1-8b", "messages": [{ "role": "user", "content": "Hi" }] }'
```

```python
import os
from openai import OpenAI
client = OpenAI(base_url="https://api.opencheap.si/v1", api_key=os.environ["OPENCHEAP_API_KEY"])
r = client.chat.completions.create(model="opencheap/llama-3.1-8b",
    messages=[{"role": "user", "content": "Hi"}])
print(r.choices[0].message.content)
```

```javascript
import OpenAI from "openai";
const client = new OpenAI({ baseURL: "https://api.opencheap.si/v1", apiKey: process.env.OPENCHEAP_API_KEY });
const r = await client.chat.completions.create({ model: "opencheap/llama-3.1-8b",
  messages: [{ role: "user", content: "Hi" }] });
console.log(r.choices[0].message.content);
```

## About meta-llama/Llama-3.1-8B-Instruct

meta-llama/Llama-3.1-8B-Instruct costs from $0.02 per 1M input tokens and $0.04 per 1M output tokens on OpenCheap. Its list price is $0.05 per 1M input tokens and $0.08 per 1M output tokens, so on a typical 1 : 3 input-to-output mix it costs 52 % less here. At that price, a request with 10,000 input tokens and 1,000 output tokens costs about $0.00024, and 1,000 such requests about $0.24. Prices as of 2026-12-04 11:48 UTC.

7 providers serve meta-llama/Llama-3.1-8B-Instruct on OpenCheap. Each request goes to the cheapest healthy provider of the model, and every answer reports what it cost in `usage.cost`. Its context window is 131K tokens (131,072), room for roughly 98,000 words of English in one request.

meta-llama/Llama-3.1-8B-Instruct is one of [25 Meta models](https://opencheap.si/models/lab/meta) on OpenCheap. Every model on OpenCheap is called with one key at the same OpenAI-compatible endpoint, `https://api.opencheap.si/v1`.

## Pricing questions

### How much does the meta-llama/Llama-3.1-8B-Instruct API cost per 1M tokens?

meta-llama/Llama-3.1-8B-Instruct costs from $0.02 per 1M input tokens and $0.04 per 1M output tokens on OpenCheap. Prices as of 2026-12-04 11:48 UTC.

### What does one meta-llama/Llama-3.1-8B-Instruct request cost?

A request with 10,000 input tokens and 1,000 output tokens costs about $0.00024, and 1,000 such requests about $0.24. Every answer reports its own cost in usage.cost.

### Is meta-llama/Llama-3.1-8B-Instruct cheaper on OpenCheap than its list price?

Its list price is $0.05 per 1M input tokens and $0.08 per 1M output tokens, so on a typical 1 : 3 input-to-output mix it costs 52 % less here.

### Which providers serve meta-llama/Llama-3.1-8B-Instruct?

7 providers serve meta-llama/Llama-3.1-8B-Instruct on OpenCheap. Each request goes to the cheapest healthy provider of the model; the table on this page lists every provider with its price, speed and uptime.

### What is the context window of meta-llama/Llama-3.1-8B-Instruct?

Its context window is 131K tokens (131,072), room for roughly 98,000 words of English in one request.

### How do I call the meta-llama/Llama-3.1-8B-Instruct API?

Point the OpenAI SDK at https://api.opencheap.si/v1 and pass the model id opencheap/llama-3.1-8b. One OpenCheap key works for every model; the rest of your code stays the same.

## More from Meta

- [meta-llama/Llama-3.3-70B-Instruct](https://opencheap.si/models/llama-3.3-70b) (`llama-3.3-70b`): $0.015 / $0.047 per 1M · 131K context
- [Llama 4 Maverick](https://opencheap.si/models/llama-4-maverick) (`llama-4-maverick`): $0.20 / $0.20 per 1M · 1M context
- [Llama 4 Scout](https://opencheap.si/models/llama-4-scout) (`llama-4-scout`): $0.10 / $0.32 per 1M · 328K context
- [Llama 3.1 8B (decentralized)](https://opencheap.si/models/3.1-8b-fp8) (`3.1-8b-fp8`): $0.02 / $0.03 per 1M · 128K context
- [meta-llama/Llama-3.1-70B-Instruct](https://opencheap.si/models/llama-3.1-70b) (`llama-3.1-70b`): $0.42 / $0.42 per 1M · 131K context
- [meta-llama/Llama-3.2-3B-Instruct](https://opencheap.si/models/llama-3.2-3b) (`llama-3.2-3b`): $0.047 / $0.31 per 1M · 131K context
- [Llama 3.3 70B Instruct abliterated](https://opencheap.si/models/llama-3.3-70b-abliterated) (`llama-3.3-70b-abliterated`): $0.70 / $0.70 per 1M · 32K context
- [meta-llama/Llama-4-Maverick-17B-128E-Instruct](https://opencheap.si/models/llama-4-maverick-17b-128e) (`llama-4-maverick-17b-128e`): $0.35 / $1.00 per 1M · 524K context

[All 25 Meta models](https://opencheap.si/models/lab/meta)

## Similar models

- [google/gemma-3-27b-it](https://opencheap.si/models/gemma-3-27b): Google · 131K context · $0.02 / $0.05 per 1M · [Compare with meta-llama/Llama-3.1-8B-Instruct](https://opencheap.si/compare/llama-3.1-8b-vs-gemma-3-27b)
- [Qwen/Qwen3-32B](https://opencheap.si/models/qwen3-32b): Qwen · 131K context · $0.0096 / $0.032 per 1M, 25 % cheaper · [Compare with meta-llama/Llama-3.1-8B-Instruct](https://opencheap.si/compare/llama-3.1-8b-vs-qwen3-32b)
- [Gemma 4 26B A4B It](https://opencheap.si/models/gemma-4-26b-a4b): Google · 262K context · $0.01 / $0.03 per 1M, 29 % cheaper · [Compare with meta-llama/Llama-3.1-8B-Instruct](https://opencheap.si/compare/llama-3.1-8b-vs-gemma-4-26b-a4b)
- [DeepSeek V4.1 Flash](https://opencheap.si/models/deepseek-v4.1-flash): DeepSeek · 1M context · $0.0073 / $0.029 per 1M, 32 % cheaper · [Compare with meta-llama/Llama-3.1-8B-Instruct](https://opencheap.si/compare/llama-3.1-8b-vs-deepseek-v4.1-flash)
- [Ling 3.0 Tiny](https://opencheap.si/models/ling-3.0-tiny): inclusionAI · 262K context · $0.015 / $0.045 per 1M · [Compare with meta-llama/Llama-3.1-8B-Instruct](https://opencheap.si/compare/llama-3.1-8b-vs-ling-3.0-tiny)
- [Ministral 14B 3.0](https://opencheap.si/models/ministral-3-14b): Mistral · 128K context · $0.024 / $0.024 per 1M, 31 % cheaper · [Compare with meta-llama/Llama-3.1-8B-Instruct](https://opencheap.si/compare/llama-3.1-8b-vs-ministral-3-14b)

[Compare meta-llama/Llama-3.1-8B-Instruct with any model](https://opencheap.si/compare)

---

Source: https://opencheap.si/models/llama-3.1-8b · All models: https://opencheap.si/models · Prices as JSON: https://api.opencheap.si/v1/prices · Index for agents: https://opencheap.si/llms.txt
