Activation and billing

更新时间:
复制 MD 格式

When using large language model (LLM) APIs, you must check user inputs and model outputs for content safety. This topic describes how to activate the pay-as-you-go service for Guardrails and details the billing rules for each moderation type.

Important

After you activate pay-as-you-go for Guardrails, the Content Compliance feature is enabled by default. To use the Sensitive Content Detection or prompt injection detection features, you must first enable them in the console, as described later in this topic.

Prerequisites

Before you can activate Guardrails, your Alibaba Cloud account must complete identity verification.

Activate Guardrails pay-as-you-go

Activating the pay-as-you-go service for Guardrails is free. The system bills you based on your actual usage. For specific unit prices, see Moderation types and unit prices.

Choose a suitable access method based on your business scenario:

  • API access: Call the moderation service directly using APIs. This method is ideal for using Guardrails as a standalone service.

  • AI Gateway integration: Manage moderation policies for multiple large models centrally through AI Gateway. This method is ideal for scenarios involving mixed-model calls.

  • Model Studio integration: Call Guardrails directly from the Model Studio platform. This method is ideal for existing Model Studio users.

How can I confirm that pay-as-you-go has been activated for my Guardrails account?

You can use either of the following methods to verify the activation status:

  • Log on to the Guardrails console and check whether the service status shows Activated.

  • Log on to the Alibaba Cloud User Center to view your order history and confirm whether a Guardrails activation record exists.

Note

Activating pay-as-you-go for Guardrails is free of charge. You are only billed when your application actively calls the Guardrails API operations. No charges are incurred when the service is idle.

Enable detection features

  1. Log on to the Guardrails console. In the left-side navigation pane, choose Protection Configuration > Model Protection.

  2. In the list of detection configurations, find the target service and click Management in the Actions column to open the service management page.

  3. In the Protection Dimension section, use the toggle on each card to enable or disable the feature:

    • Content compliance: Enabled by default. Detects pornographic, violent, political, and other undesirable content. This feature is billed separately. For pricing details, see Moderation types and unit prices.

    • Sensitive content detection: Detects potential leaks of personal information or sensitive corporate data. This feature is billed separately. For pricing details, see Moderation types and unit prices.

    • Prompt injection detection: Detects malicious prompts designed to bypass the safety limits of large models. This feature is billed separately. For pricing details, see Moderation types and unit prices.

    • Malicious URL (in public preview): Scans content from large models for malicious links. This feature is currently free to use during the public preview.

    • Model Hallucination (in public preview): Detects false or inaccurate information generated by large models. This feature is currently free to use during the public preview.

    • Detection agent: Identifies specific, user-defined risks in large model interactions based on flexible custom configurations. For pricing details, see detection agent billing plans.

Note

After a feature is enabled, its toggle appears in the enabled state.

Differences between AI Guardrails and content moderation

Although both AI Guardrails and Content Moderation support pay-as-you-go and resource plans, they are designed for different use cases and have different billing structures:

  • AI Guardrails: Designed specifically for moderating the input and output of large language model (LLM) APIs. Billing is based on the number of moderation calls. For example, text moderation is priced at CNY 15 per 10,000 calls.

  • Content Moderation: Designed for general content moderation scenarios. Billing is based on content type and business scenario. For example, text moderation starts at CNY 7.5 per 10,000 calls.

Select the appropriate product based on your specific business requirements.

Moderation types and unit prices

Access method

Type

Services

Unit price

API access/AI Gateway integration

Text Moderation - Per Call - Advanced

text_guard_advanced

  • AI input content security check (Pro) (query_security_check_pro)

  • AI-generated content security check (Pro) (response_security_check_pro)

Important

The query_security_check_pro and response_security_check_pro services are now generally available. They provide more granular labels for content compliance protection, with a significantly larger number of labels than the previous version.

  • AI input content security check (query_security_check)

  • AI-generated content security check (response_security_check)

  • AI input content security check (International) (query_security_check_cb)

  • AI-generated content security check (International) (response_security_check_cb)

CNY 15 per 10,000 calls

API access

Image Moderation - Per Call - Advanced

image_guard_advanced

  • AIGC input image security check

    (img_query_security_check)

  • AIGC output image security check

    (img_response_security_check)

CNY 30 per 10,000 calls

API access

Synchronous File Moderation - Per Call - Advanced

file_guard_sync_advanced

  • Real-time file check

    (file_security_sync_check)

  • Real-time multimodal (text file) check

    (text_file_sec_sync_check)

CNY 20 per 10,000 segments

Important

The text content in a file is divided into 2,000-character segments. You are billed based on the number of segments.

API access

Text-Image Moderation - Per Call - Advanced

text_image_guard_advanced

multimodal (text and image) content security check

(text_img_security_check)

CNY 45 per 10,000 calls

API access/AI Gateway integration

Sensitive Content Moderation - Per Call - Advanced

text_sddp_advanced

  • AI input content security check (query_security_check)

  • AI-generated content security check (response_security_check)

  • AI input content security check (International) (query_security_check_cb)

  • AI-generated content security check (International) (response_security_check_cb)

CNY 15 per 10,000 calls

API access/AI Gateway integration

prompt injection moderation

text_guard_prompt_attack

  • AI input content security check (query_security_check)

  • AI-generated content security check (response_security_check)

  • AI input content security check (International) (query_security_check_cb)

  • AI-generated content security check (International) (response_security_check_cb)

CNY 15 per 10,000 calls

Important

This feature will be commercially billed starting January 22, 2026. If you do not require this service, disable it in the Guardrails console to avoid incurring charges.

API access

Malicious File Detection

Real-time file check

(file_security_sync_check)

This feature is in public preview. After you enable it, you can use it for free.

API access

digital watermarking

AIGC output image security check (img_response_security_check)

This feature is in public preview. After you enable it, you can use it for free.

Model Studio integration

Text Compliance Moderation - Per Token - Advanced

text_guard_token_advanced

  • Model Studio input content security guardrail_Qwen3Guard_pro (qwen_query_check_pro)

  • Model Studio output content security guardrail_Qwen3Guard_pro (qwen_response_check_pro)

  • Model Studio input content security guardrail_pro (bl_query_guard_pro)

  • Model Studio output content security guardrail_pro (bl_response_guard_pro)

CNY 0.003 per 1,000 tokens

Model Studio integration

Text Compliance Moderation - Per Token - Standard

text_guard_token_standard

  • Model Studio input content security guardrail_Qwen3Guard

    (qwen_query_check)

  • Model Studio output content security guardrail_Qwen3Guard (qwen_response_check)

  • Model Studio input content security guardrail

    (bl_query_guard)

  • Model Studio output content security guardrail (bl_response_guard)

CNY 0.0004 per 1,000 tokens

Model Studio integration

Sensitive Content Moderation - Per Token - Advanced

text_sddp_token_advanced

  • Model Studio input content security guardrail_Qwen3Guard_pro (qwen_query_check_pro)

  • Model Studio output content safety guardrail: Qwen3Guard Pro (qwen_response_check_pro)

  • Model Studio input content security guardrail_pro (bl_query_guard_pro)

  • Model Studio output content security guardrail_pro (bl_response_guard_pro)

CNY 0.003 per 1,000 tokens

Model Studio integration

Sensitive Content Moderation - Per Token - Standard

text_sddp_token_standard

  • Model Studio Input Content Safety Guardrail_Qwen3Guard Edition

    (qwen_query_check)

  • Model Studio Output Content Safety Guardrail_Qwen3Guard Edition (qwen_response_check)

  • Model Studio Input Security Guardrail

    (bl_query_guard)

  • Model Studio output content security guardrail (bl_response_guard)

CNY 0.0004 per 1,000 tokens

Model Studio integration

prompt injection moderation

  • Model Studio input content security guardrail_Qwen3Guard_pro (qwen_query_check_pro)

  • Model Studio output content security guardrail_Qwen3Guard_pro (qwen_response_check_pro)

  • Model Studio input content security guardrail_Qwen3Guard

    (qwen_query_check)

  • Model Studio output content security guardrail_Qwen3Guard (qwen_response_check)

  • Model Studio input content security guardrail_pro (bl_query_guard_pro)

  • Model Studio output content security guardrail_pro (bl_response_guard_pro)

  • Model Studio input content security guardrail

    (bl_query_guard)

  • Model Studio output content security guardrail (bl_response_guard)

CNY 15 per 10,000 calls

Important

This feature will be commercially billed starting January 22, 2026. If you do not require this service, disable it in the Guardrails console to avoid incurring charges.

Model Studio integration

Image Moderation - Per Call - Advanced

image_guard_advanced

  • Model Studio input image security guardrail

    (bl_img_query_guard)

  • Model Studio output content security guardrail (bl_img_response_guard)

CNY 30 per 10,000 calls

Important

When you use Guardrails through Model Studio integration for a single query or response check, if a text contains fewer than 1,000 tokens, it is billed as 1,000 tokens. If the text contains 1,000 or more tokens, you are billed for the actual number of tokens.

With pay-as-you-go, Guardrails bills you based on the type and volume of content you check.

To check the remaining capacity and usage details of your Guardrails trial package or traffic package, log on to the Alibaba Cloud Management Console and go to Expenses and Costs > Resource Plans (https://billing-cost.console.aliyun.com/ri/summary).

For a complete list of all Guardrails service codes, their display names, historical aliases (old code to current code mappings), and scenario classifications (China, cross-border e-commerce, international), see AI Guardrails ServiceCode Reference.

  1. Go to the Guardrails activation page.

  2. Read and agree to the Terms of Service, then click Buy Now.

  3. After activation, log on to the Guardrails console and confirm that the service status is Activated.

Can I set a call quota limit or stop billing for Guardrails?

  • Quota limits: The pay-as-you-go billing method does not support setting a call quota or usage cap. Bills are generated on a T+1 basis (the day after usage occurs).

  • Stopping billing: Guardrails cannot be directly deactivated or unsubscribed. To stop incurring charges, ensure that your application no longer calls the Alibaba Cloud Content Moderation API operations. Note that "calling the API" refers to your application code actively sending requests — automated tasks in the console do not generate charges. Check your internal systems for any ongoing API calls that may still be running.

Overdue payments and top-ups

The billing cycle window for Guardrails is 5 minutes.

After each billing cycle, Alibaba Cloud generates a bill based on your usage from the previous cycle and automatically deducts the amount from your account balance.

If your account has an overdue payment, your service is suspended. The service resumes within five minutes after you pay the outstanding balance. For instructions on how to add funds to your account, see the Top-up guide.

Why does the system report that the free quota is exhausted or return a 403 error when I only send a small amount of content (such as "hi")?

This issue is typically caused by the Use free tier only switch being enabled in your account. When this switch is turned on and the free quota has expired or been fully consumed, the system blocks all API calls and returns a 403 error regardless of how small the request is.

To resolve this issue:

  1. Log on to the Guardrails console and disable the Use free tier only switch.

  2. Ensure that your account has a sufficient balance or valid quota.

Note

If the issue persists after you disable the Use free tier only switch, check whether your account has an overdue payment. An insufficient cash balance can cause the service to be suspended.