---
title: Meta: Llama Guard 4 12B API | Text Generation | ModelsLab
description: 12B parameter multimodal LLM safety classifier for text/image content moderation in prompts/responses, 164K context window, MLCommons-aligned.[1][2][4]
url: https://modelslab.com/models/meta-llama/meta-llama-llama-guard-4-12b/api.md
canonical: https://modelslab.com/models/meta-llama/meta-llama-llama-guard-4-12b/api.md
type: product
component: Playground/LLM/Index
generated_at: 2026-04-15T02:10:18.009560Z
---

Meta: Llama Guard 4 12B
---

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

meta-llama-llama-guard-4-12b meta-llama Closed Source Model $0.180000 / call

Meta: Llama Guard 4 12B
---

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

### Meta: Llama Guard 4 12B

meta-llama meta-llama-llama-guard-4-12b

Copy model ID

PricingInput $0.18 / 1M tokens

Output $0.18 / 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)

[MK](https://modelslab.com/models/open_router/moonshotai-kimi-k2)[Open Router](https://modelslab.com/models/open_router)

 [MoonshotAI: Kimi K2 0711

Closed Source Model](https://modelslab.com/models/open_router/moonshotai-kimi-k2)

[MS](https://modelslab.com/models/mistral_ai/mistralai-Mistral-Small-24B-Instruct-2501)[ModelsLab](https://modelslab.com/models/mistral_ai)

 [Mistral Small (24B) Instruct 25.01

Closed Source Model](https://modelslab.com/models/mistral_ai/mistralai-Mistral-Small-24B-Instruct-2501)

[OG](https://modelslab.com/models/open_router/openai-gpt-5.1-codex)[Open Router](https://modelslab.com/models/open_router)

 [OpenAI: GPT-5.1-Codex

Closed Source Model](https://modelslab.com/models/open_router/openai-gpt-5.1-codex)

[L2](https://modelslab.com/models/together_ai/LiquidAI-LFM2-24B-A2B)[Together AI](https://modelslab.com/models/together_ai)

 [LFM2-24B-A2B

Closed Source Model](https://modelslab.com/models/together_ai/LiquidAI-LFM2-24B-A2B)

[L3](https://modelslab.com/models/together_ai/meta-llama-Llama-3.2-1B)[Together AI](https://modelslab.com/models/together_ai)

 [Llama 3.2 1B

Closed Source Model](https://modelslab.com/models/together_ai/meta-llama-Llama-3.2-1B)

[MW](https://modelslab.com/models/open_router/mancer-weaver)[Open Router](https://modelslab.com/models/open_router)

 [Mancer: Weaver (alpha)

Closed Source Model](https://modelslab.com/models/open_router/mancer-weaver)

[GG](https://modelslab.com/models/open_router/google-gemini-2.0-flash-001)[Open Router](https://modelslab.com/models/open_router)

 [Google: Gemini 2.0 Flash

Closed Source Model](https://modelslab.com/models/open_router/google-gemini-2.0-flash-001)

[G3](https://modelslab.com/models/google_deepmind/google-gemma-3n-E4B-it)[ModelsLab](https://modelslab.com/models/google_deepmind)

 [Gemma 3N E4B Instruct

Closed Source Model](https://modelslab.com/models/google_deepmind/google-gemma-3n-E4B-it)

[OG](https://modelslab.com/models/open_router/openai-gpt-4.1-nano)[Open Router](https://modelslab.com/models/open_router)

 [OpenAI: GPT-4.1 Nano

Closed Source Model](https://modelslab.com/models/open_router/openai-gpt-4.1-nano)

[OG](https://modelslab.com/models/open_router/openai-gpt-4o-mini)[Open Router](https://modelslab.com/models/open_router)

 [OpenAI: GPT-4o-mini

Closed Source Model](https://modelslab.com/models/open_router/openai-gpt-4o-mini)

[OG](https://modelslab.com/models/together_ai/openai-gpt-oss-20b)[Together AI](https://modelslab.com/models/together_ai)

 [OpenAI GPT-OSS 20B

Closed Source Model](https://modelslab.com/models/together_ai/openai-gpt-oss-20b)

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

 [Mistral: Mistral Small 4

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

[AA](https://modelslab.com/models/arcee_ai/arcee-ai-coder-large)[ModelsLab](https://modelslab.com/models/arcee_ai)

 [Arcee AI Coder-Large

Closed Source Model](https://modelslab.com/models/arcee_ai/arcee-ai-coder-large)

[![GPT OSS 120b](https://images.stablediffusionapi.com/?Image=https://assets.modelslab.ai/generations/32ccebf4-aaac-46b2-af6a-b19d11fcf8fa.webp)](https://modelslab.com/models/openai/gpt-oss-120b)[Open Ai](https://modelslab.com/models/openai)

 [GPT OSS 120b

Closed Source Model](https://modelslab.com/models/openai/gpt-oss-120b)

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

 [DeepSeek: DeepSeek V3.1

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

[ML](https://modelslab.com/models/together_ai/meta-llama-Meta-Llama-3.1-70B-Instruct-Turbo)[Together AI](https://modelslab.com/models/together_ai)

 [Meta Llama 3.1 70B Instruct Turbo

Closed Source Model](https://modelslab.com/models/together_ai/meta-llama-Meta-Llama-3.1-70B-Instruct-Turbo)

[Q3](https://modelslab.com/models/together_ai/Qwen-Qwen3.5-35B-A3B)[Together AI](https://modelslab.com/models/together_ai)

 [Qwen3.5 35B A3b

Closed Source Model](https://modelslab.com/models/together_ai/Qwen-Qwen3.5-35B-A3B)

[QQ](https://modelslab.com/models/open_router/qwen-qwen3.5-flash-02-23)[Open Router](https://modelslab.com/models/open_router)

 [Qwen: Qwen3.5-Flash

Closed Source Model](https://modelslab.com/models/open_router/qwen-qwen3.5-flash-02-23)

About Meta: Llama Guard 4 12B
---

Llama Guard 4 is a Llama 4 Scout-derived multimodal pretrained model, fine-tuned for content safety classification. Similar to previous versions, it can be used to classify content in both LLM...

### Technical Specifications

Model IDmeta-llama-llama-guard-4-12bCategoryLLM ModelsTaskText GenerationPrice$0.180000 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 Meta: Llama Guard 4 12B 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-4-12b",
        "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-4-12b/api) for SDKs, code examples in Python, JavaScript, and more.

### Pricing

Meta: Llama Guard 4 12B API costs $0.180000 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 Meta: Llama Guard 4 12B](https://modelslab.com/meta-llama-guard-4-12b) [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)

Meta: Llama Guard 4 12B FAQ
---

### What is Meta: Llama Guard 4 12B?

Llama Guard 4 is a Llama 4 Scout-derived multimodal pretrained model, fine-tuned for content safety classification. Similar to previous versions, it can be used to classify content in both LLM...

### How do I use the Meta: Llama Guard 4 12B API?

You can integrate Meta: Llama Guard 4 12B 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-4-12b" in your API requests. We provide SDKs for Python, JavaScript, and cURL examples in the API documentation.

### How much does Meta: Llama Guard 4 12B cost?

Meta: Llama Guard 4 12B costs $0.180000 per million tokens. ModelsLab uses pay-per-use pricing with no minimum commitments. A free tier is available to get started.

### What is the Meta: Llama Guard 4 12B model ID?

The model ID for Meta: Llama Guard 4 12B is "meta-llama-llama-guard-4-12b". Use this ID in your API requests to specify this model.

### Does Meta: Llama Guard 4 12B have a free tier?

Yes, ModelsLab offers a free tier that lets you try Meta: Llama Guard 4 12B 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*