---
title: Llama Guard 3 8B API | Text Generation | ModelsLab
description: Build with Llama Guard 3 8B API by Meta Llama. Text generation, chat, code, and reasoning. Pay-per-use. Free tier.
url: https://modelslab.com/models/meta-llama/meta-llama-llama-guard-3-8b/api.md
canonical: https://modelslab.com/models/meta-llama/meta-llama-llama-guard-3-8b/api.md
type: product
component: Playground/LLM/Index
generated_at: 2026-04-15T02:09:14.331531Z
---

Llama Guard 3 8B
---

 [LLMs.txt](https://modelslab.com/models/open_router/meta-llama-llama-guard-3-8b/llms.txt) [.md](https://modelslab.com/models/meta-llama/meta-llama-llama-guard-3-8b.md)

meta-llama-llama-guard-3-8b meta-llama Closed Source Model $0.255000 / call

Llama Guard 3 8B
---

Choose a prompt below to get started or type your own message

 Explain quantum computing in simple terms

 Write a Python function to sort a list

 Create a marketing email for a SaaS product

 Compare REST vs GraphQL APIs

Send

### Llama Guard 3 8B

meta-llama meta-llama-llama-guard-3-8b

Copy model ID

PricingInput $0.48 / 1M tokens

Output $0.03 / 1M tokens

API EndpointsOpenAI Compatible

`https://modelslab.com/api/v7/llm/chat/completions`Endpoint

Anthropic Compatible

`https://modelslab.com/api/v7/llm/v1/messages`Messages

`https://modelslab.com/api/v7/llm/v1/messages/count_tokens`Count Tokens

`https://modelslab.com/api/v7/llm/v1/models`Models

Use with Claude Code

cURL Example

ParametersSystem MessageYou are a helpful AI assistant specialized in providing accurate and detailed responses.

Temperature0.7

Max Tokens1000

Top P0.9

Frequency Penalty0

Presence Penalty0

Model Info

Support

Related Models
---

Discover similar models you might be interested in

 [View all LLM Models](https://modelslab.com/models?feature=llmaster)

[MM](https://modelslab.com/models/open_router/mistralai-mistral-large-2512)[Open Router](https://modelslab.com/models/open_router)

 [Mistral: Mistral Large 3 2512

Closed Source Model](https://modelslab.com/models/open_router/mistralai-mistral-large-2512)

[GG](https://modelslab.com/models/open_router/google-gemma-3-4b-it)[Open Router](https://modelslab.com/models/open_router)

 [Google: Gemma 3 4B

Closed Source Model](https://modelslab.com/models/open_router/google-gemma-3-4b-it)

[GG](https://modelslab.com/models/open_router/google-gemini-2.5-pro-preview-05-06)[Open Router](https://modelslab.com/models/open_router)

 [Google: Gemini 2.5 Pro Preview 05-06

Closed Source Model](https://modelslab.com/models/open_router/google-gemini-2.5-pro-preview-05-06)

[RL](https://modelslab.com/models/refuel_ai/togethercomputer-Refuel-Llm-V2)[ModelsLab](https://modelslab.com/models/refuel_ai)

 [Refuel LLM V2

Closed Source Model](https://modelslab.com/models/refuel_ai/togethercomputer-Refuel-Llm-V2)

[AO](https://modelslab.com/models/open_router/allenai-olmo-2-0325-32b-instruct)[Open Router](https://modelslab.com/models/open_router)

 [AllenAI: Olmo 2 32B Instruct

Closed Source Model](https://modelslab.com/models/open_router/allenai-olmo-2-0325-32b-instruct)

[QV](https://modelslab.com/models/qwen/Qwen-Qwen2-VL-72B-Instruct)[ModelsLab](https://modelslab.com/models/qwen)

 [Qwen2-VL (72B) Instruct

Closed Source Model](https://modelslab.com/models/qwen/Qwen-Qwen2-VL-72B-Instruct)

[![Gemini 2.5 Pro](https://images.stablediffusionapi.com/?Image=https://assets.modelslab.ai/generations/ede9a278-de62-47fb-a53d-99ee4c7b7abc.png)](https://modelslab.com/models/google/gemini-2.5-pro)[Google](https://modelslab.com/models/google)

 [Gemini 2.5 Pro

Closed Source Model](https://modelslab.com/models/google/gemini-2.5-pro)

[PI](https://modelslab.com/models/open_router/prime-intellect-intellect-3)[Open Router](https://modelslab.com/models/open_router)

 [Prime Intellect: INTELLECT-3

Closed Source Model](https://modelslab.com/models/open_router/prime-intellect-intellect-3)

[US](https://modelslab.com/models/open_router/upstage-solar-pro-3)[Open Router](https://modelslab.com/models/open_router)

 [Upstage: Solar Pro 3

Closed Source Model](https://modelslab.com/models/open_router/upstage-solar-pro-3)

[ML](https://modelslab.com/models/open_router/mistralai-mistral-large-2407)[Open Router](https://modelslab.com/models/open_router)

 [Mistral Large 2407

Closed Source Model](https://modelslab.com/models/open_router/mistralai-mistral-large-2407)

[N3](https://modelslab.com/models/together_ai/nim-nvidia-llama-3.3-nemotron-super-49b-v1)[Together AI](https://modelslab.com/models/together_ai)

 [nim/nvidia/llama-3.3-nemotron-super-49b-v1

Closed Source Model](https://modelslab.com/models/together_ai/nim-nvidia-llama-3.3-nemotron-super-49b-v1)

[AA](https://modelslab.com/models/open_router/aion-labs-aion-rp-llama-3.1-8b)[Open Router](https://modelslab.com/models/open_router)

 [AionLabs: Aion-RP 1.0 (8B)

Closed Source Model](https://modelslab.com/models/open_router/aion-labs-aion-rp-llama-3.1-8b)

[Q2](https://modelslab.com/models/together_ai/Qwen-Qwen3-235B-A22B-Thinking-2507)[Together AI](https://modelslab.com/models/together_ai)

 [Qwen3 235B A22B Thinking 2507 FP8

Closed Source Model](https://modelslab.com/models/together_ai/Qwen-Qwen3-235B-A22B-Thinking-2507)

[DD](https://modelslab.com/models/open_router/deepseek-deepseek-v3.2)[Open Router](https://modelslab.com/models/open_router)

 [DeepSeek: DeepSeek V3.2

Closed Source Model](https://modelslab.com/models/open_router/deepseek-deepseek-v3.2)

[AC](https://modelslab.com/models/open_router/anthropic-claude-sonnet-4)[Open Router](https://modelslab.com/models/open_router)

 [Anthropic: Claude Sonnet 4

Closed Source Model](https://modelslab.com/models/open_router/anthropic-claude-sonnet-4)

[![Anthropic: Claude Sonnet 4.5](https://images.stablediffusionapi.com/?Image=https://assets.modelslab.ai/generations/aae18a61-9b88-43f7-83f5-4ec4ead6d4b6.png)](https://modelslab.com/models/open_router/anthropic-claude-sonnet-4.5)[Open Router](https://modelslab.com/models/open_router)

 [Anthropic: Claude Sonnet 4.5

Closed Source Model](https://modelslab.com/models/open_router/anthropic-claude-sonnet-4.5)

[QQ](https://modelslab.com/models/open_router/qwen-qwen3-vl-235b-a22b-thinking)[Open Router](https://modelslab.com/models/open_router)

 [Qwen: Qwen3 VL 235B A22B Thinking

Closed Source Model](https://modelslab.com/models/open_router/qwen-qwen3-vl-235b-a22b-thinking)

[N3](https://modelslab.com/models/together_ai/nim-meta-llama-3.1-8b-instruct)[Together AI](https://modelslab.com/models/together_ai)

 [nim/meta/llama-3.1-8b-instruct

Closed Source Model](https://modelslab.com/models/together_ai/nim-meta-llama-3.1-8b-instruct)

About Llama Guard 3 8B
---

Llama Guard 3 is a Llama-3.1-8B pretrained model, fine-tuned for content safety classification. Similar to previous versions, it can be used to classify content in both LLM inputs (prompt classification)...

### Technical Specifications

Model IDmeta-llama-llama-guard-3-8bCategoryLLM ModelsTaskText GenerationPrice$0.255000 per million tokensAddedFebruary 20, 2026

### Key Features

- Chat completion and multi-turn conversation API
- Streaming response with token-by-token output
- Function calling and tool use support
- System prompts and role-based messaging
- JSON mode and structured output

### Quick Start

Integrate Llama Guard 3 8B into your application with a single API call. Get your API key from the [pricing page](https://modelslab.com/pricing) to get started.

PythonJavaScriptcURLPHP

```
<code>import requests
import json

url = "https://modelslab.com/api/v7/llm/chat/completions"

headers = {
    "Content-Type": "application/json"
}

data = {
        "model_id": "meta-llama-llama-guard-3-8b",
        "messages": [
            {
                "role": "user",
                "content": "Hello!"
            }
        ],
        "max_tokens": 1000,
        "key": "YOUR_API_KEY"
    }

try:
    response = requests.post(url, headers=headers, json=data)
    response.raise_for_status()  # Raises an HTTPError for bad responses (4XX or 5XX)
    result = response.json()
    print("API Response:")
    print(json.dumps(result, indent=2))
except requests.exceptions.HTTPError as http_err:
    print(f"HTTP error occurred: {http_err} - {response.text}")
except Exception as err:
    print(f"Other error occurred: {err}")</code>
```

View the [full API documentation](https://modelslab.com/models/meta-llama/meta-llama-llama-guard-3-8b/api) for SDKs, code examples in Python, JavaScript, and more.

### Pricing

Llama Guard 3 8B API costs $0.255000 per million tokens. Pay only for what you use with no minimum commitments. [View pricing plans](https://modelslab.com/pricing)

### Use Cases

- AI chatbots and virtual assistants
- Code generation and developer tools
- Content writing and copywriting automation
- Data analysis, summarization, and extraction

[Learn more about Llama Guard 3 8B](https://modelslab.com/llama-guard-3-8b) [Browse LLM Models](https://modelslab.com/models?feature=llmaster) [More from Meta Llama](https://modelslab.com/models/open_router) [View Pricing](https://modelslab.com/pricing)

Llama Guard 3 8B FAQ
---

### What is Llama Guard 3 8B?

Llama Guard 3 is a Llama-3.1-8B pretrained model, fine-tuned for content safety classification. Similar to previous versions, it can be used to classify content in both LLM inputs (prompt classification)...

### How do I use the Llama Guard 3 8B API?

You can integrate Llama Guard 3 8B into your application with a single API call. Sign up on ModelsLab to get your API key, then use the model ID "meta-llama-llama-guard-3-8b" in your API requests. We provide SDKs for Python, JavaScript, and cURL examples in the API documentation.

### How much does Llama Guard 3 8B cost?

Llama Guard 3 8B costs $0.255000 per million tokens. ModelsLab uses pay-per-use pricing with no minimum commitments. A free tier is available to get started.

### What is the Llama Guard 3 8B model ID?

The model ID for Llama Guard 3 8B is "meta-llama-llama-guard-3-8b". Use this ID in your API requests to specify this model.

### Does Llama Guard 3 8B have a free tier?

Yes, ModelsLab offers a free tier that lets you try Llama Guard 3 8B and other AI models. Sign up to get free API credits and start building immediately.

---

*This markdown version is optimized for AI agents and LLMs.*

**Links:**
- [Website](https://modelslab.com)
- [API Documentation](https://docs.modelslab.com)
- [Blog](https://modelslab.com/blog)

---
*Generated by ModelsLab - 2026-04-15*