---
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-frontend-v2-927501783998.us-east4.run.app/models/meta-llama/meta-llama-llama-guard-4-12b/api.md
canonical: https://modelslab-frontend-v2-927501783998.us-east4.run.app/models/meta-llama/meta-llama-llama-guard-4-12b/api.md
type: product
component: Playground/LLM/Index
generated_at: 2026-05-13T10:38:09.546184Z
---

Meta: Llama Guard 4 12B
---

 [LLMs.txt](https://modelslab-frontend-v2-927501783998.us-east4.run.app/models/open_router/meta-llama-llama-guard-4-12b/llms.txt) [.md](https://modelslab-frontend-v2-927501783998.us-east4.run.app/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-frontend-v2-927501783998.us-east4.run.app/models?feature=llmaster)

[TD](https://modelslab-frontend-v2-927501783998.us-east4.run.app/models/open_router/alibaba-tongyi-deepresearch-30b-a3b)[Open Router](https://modelslab-frontend-v2-927501783998.us-east4.run.app/models/open_router)

 [Tongyi DeepResearch 30B A3B

Closed Source Model](https://modelslab-frontend-v2-927501783998.us-east4.run.app/models/open_router/alibaba-tongyi-deepresearch-30b-a3b)

[N8](https://modelslab-frontend-v2-927501783998.us-east4.run.app/models/together_ai/nim-mistralai-mixtral-8x22b-instruct-v01)[Together AI](https://modelslab-frontend-v2-927501783998.us-east4.run.app/models/together_ai)

 [nim/mistralai/mixtral-8x22b-instruct-v01

Closed Source Model](https://modelslab-frontend-v2-927501783998.us-east4.run.app/models/together_ai/nim-mistralai-mixtral-8x22b-instruct-v01)

[Q7](https://modelslab-frontend-v2-927501783998.us-east4.run.app/models/together_ai/Qwen-Qwen2.5-72B)[Together AI](https://modelslab-frontend-v2-927501783998.us-east4.run.app/models/together_ai)

 [Qwen2.5 72B

Closed Source Model](https://modelslab-frontend-v2-927501783998.us-east4.run.app/models/together_ai/Qwen-Qwen2.5-72B)

[Q1](https://modelslab-frontend-v2-927501783998.us-east4.run.app/models/together_ai/Qwen-Qwen2.5-1.5B-Instruct)[Together AI](https://modelslab-frontend-v2-927501783998.us-east4.run.app/models/together_ai)

 [Qwen2.5 1.5B Instruct

Closed Source Model](https://modelslab-frontend-v2-927501783998.us-east4.run.app/models/together_ai/Qwen-Qwen2.5-1.5B-Instruct)

[N3](https://modelslab-frontend-v2-927501783998.us-east4.run.app/models/together_ai/nvidia-nemotron-3-nano-omni-30b-a3b-reasoning-fp8)[Together AI](https://modelslab-frontend-v2-927501783998.us-east4.run.app/models/together_ai)

 [Nemotron 3 Nano Omni 30B A3b Reasoning Fp8

Closed Source Model](https://modelslab-frontend-v2-927501783998.us-east4.run.app/models/together_ai/nvidia-nemotron-3-nano-omni-30b-a3b-reasoning-fp8)

[KK](https://modelslab-frontend-v2-927501783998.us-east4.run.app/models/open_router/kwaipilot-kat-coder-pro-v2)[Open Router](https://modelslab-frontend-v2-927501783998.us-east4.run.app/models/open_router)

 [Kwaipilot: KAT-Coder-Pro V2

Closed Source Model](https://modelslab-frontend-v2-927501783998.us-east4.run.app/models/open_router/kwaipilot-kat-coder-pro-v2)

[GG](https://modelslab-frontend-v2-927501783998.us-east4.run.app/models/open_router/google-gemini-3.1-pro-preview)[Open Router](https://modelslab-frontend-v2-927501783998.us-east4.run.app/models/open_router)

 [Google: Gemini 3.1 Pro Preview

Closed Source Model](https://modelslab-frontend-v2-927501783998.us-east4.run.app/models/open_router/google-gemini-3.1-pro-preview)

[IM](https://modelslab-frontend-v2-927501783998.us-east4.run.app/models/open_router/inception-mercury-2)[Open Router](https://modelslab-frontend-v2-927501783998.us-east4.run.app/models/open_router)

 [Inception: Mercury 2

Closed Source Model](https://modelslab-frontend-v2-927501783998.us-east4.run.app/models/open_router/inception-mercury-2)

[AO](https://modelslab-frontend-v2-927501783998.us-east4.run.app/models/open_router/allenai-olmo-3-32b-think)[Open Router](https://modelslab-frontend-v2-927501783998.us-east4.run.app/models/open_router)

 [AllenAI: Olmo 3 32B Think

Closed Source Model](https://modelslab-frontend-v2-927501783998.us-east4.run.app/models/open_router/allenai-olmo-3-32b-think)

[GG](https://modelslab-frontend-v2-927501783998.us-east4.run.app/models/open_router/google-gemini-2.5-flash)[Open Router](https://modelslab-frontend-v2-927501783998.us-east4.run.app/models/open_router)

 [Google: Gemini 2.5 Flash

Closed Source Model](https://modelslab-frontend-v2-927501783998.us-east4.run.app/models/open_router/google-gemini-2.5-flash)

[ML](https://modelslab-frontend-v2-927501783998.us-east4.run.app/models/meta/meta-llama-Meta-Llama-3.1-70B-Instruct-Turbo)[ModelsLab](https://modelslab-frontend-v2-927501783998.us-east4.run.app/models/meta)

 [Meta Llama 3.1 70B Instruct Turbo

Closed Source Model](https://modelslab-frontend-v2-927501783998.us-east4.run.app/models/meta/meta-llama-Meta-Llama-3.1-70B-Instruct-Turbo)

[![gpt-oss-20b](https://images.stablediffusionapi.com/?Image=https://assets.modelslab.ai/generations/8b2f0440-52cc-4f41-93eb-d31006ad71e2.webp)](https://modelslab-frontend-v2-927501783998.us-east4.run.app/models/openai/gpt-oss-20b)[Open Ai](https://modelslab-frontend-v2-927501783998.us-east4.run.app/models/openai)

 [gpt-oss-20b

Closed Source Model](https://modelslab-frontend-v2-927501783998.us-east4.run.app/models/openai/gpt-oss-20b)

[LL](https://modelslab-frontend-v2-927501783998.us-east4.run.app/models/open_router/liquid-lfm-2.5-1.2b-instruct-free)[Open Router](https://modelslab-frontend-v2-927501783998.us-east4.run.app/models/open_router)

 [LiquidAI: LFM2.5-1.2B-Instruct (free)

Closed Source Model](https://modelslab-frontend-v2-927501783998.us-east4.run.app/models/open_router/liquid-lfm-2.5-1.2b-instruct-free)

[AC](https://modelslab-frontend-v2-927501783998.us-east4.run.app/models/open_router/anthropic-claude-opus-4.7)[Open Router](https://modelslab-frontend-v2-927501783998.us-east4.run.app/models/open_router)

 [Anthropic: Claude Opus 4.7

Closed Source Model](https://modelslab-frontend-v2-927501783998.us-east4.run.app/models/open_router/anthropic-claude-opus-4.7)

[ZG](https://modelslab-frontend-v2-927501783998.us-east4.run.app/models/open_router/z-ai-glm-4.5)[Open Router](https://modelslab-frontend-v2-927501783998.us-east4.run.app/models/open_router)

 [Z.ai: GLM 4.5

Closed Source Model](https://modelslab-frontend-v2-927501783998.us-east4.run.app/models/open_router/z-ai-glm-4.5)

[QQ](https://modelslab-frontend-v2-927501783998.us-east4.run.app/models/open_router/qwen-qwen3-30b-a3b)[Open Router](https://modelslab-frontend-v2-927501783998.us-east4.run.app/models/open_router)

 [Qwen: Qwen3 30B A3B

Closed Source Model](https://modelslab-frontend-v2-927501783998.us-east4.run.app/models/open_router/qwen-qwen3-30b-a3b)

[N3](https://modelslab-frontend-v2-927501783998.us-east4.run.app/models/together_ai/nim-meta-llama-3.1-8b-instruct)[Together AI](https://modelslab-frontend-v2-927501783998.us-east4.run.app/models/together_ai)

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

Closed Source Model](https://modelslab-frontend-v2-927501783998.us-east4.run.app/models/together_ai/nim-meta-llama-3.1-8b-instruct)

[IL](https://modelslab-frontend-v2-927501783998.us-east4.run.app/models/open_router/inclusionai-ling-2.6-flash)[Open Router](https://modelslab-frontend-v2-927501783998.us-east4.run.app/models/open_router)

 [inclusionAI: Ling-2.6-flash

Closed Source Model](https://modelslab-frontend-v2-927501783998.us-east4.run.app/models/open_router/inclusionai-ling-2.6-flash)

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-frontend-v2-927501783998.us-east4.run.app/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-frontend-v2-927501783998.us-east4.run.app/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-frontend-v2-927501783998.us-east4.run.app/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-frontend-v2-927501783998.us-east4.run.app/meta-llama-guard-4-12b) [Browse LLM Models](https://modelslab-frontend-v2-927501783998.us-east4.run.app/models?feature=llmaster) [More from Meta Llama](https://modelslab-frontend-v2-927501783998.us-east4.run.app/models/open_router) [View Pricing](https://modelslab-frontend-v2-927501783998.us-east4.run.app/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-05-13*