RAG Agent billing

更新时间:
复制 MD 格式

RAG Agent charges are based on the number and type of API calls. This page explains the free quota, pricing tiers, API-to-call-count mapping, and a worked example so you can estimate costs before you start.

Free quota

Each day, the first 1,000 API calls are free. The free quota resets daily. Calls beyond 1,000 in a single day are billed at the rates listed below.

Billing method

RAG Agent uses pay-as-you-go billing. Charges are calculated as:

Total cost = Σ (Unit price of each API billing type × Number of calls)

Charges appear on your bill under the billable item RDS-AI Application Data Service.

API billing types and pricing

APIs are grouped into four billing types based on the underlying AI models they use. Each type has a fixed unit price per call.

API billing typePrimary capabilitiesUnderlying modelsUnit price (CNY/call)
IntermediateEmbedding, Rerankqwen3-embedding-v4, gte-rerank-v20.0006
AdvancedKnowledge graph construction (basic Large Language Models (LLMs)), Retrieved context summarization, Text parsingqwen3-flash, qwen3-vl-flash0.0013
ExpertKnowledge graph construction (basic LLMs), Retrieved context summarizationqwen3-qwq0.0096
MasterMultimodal parsingqwen3-vl-plus0.0210

RAG capabilities and API mapping

Use this table to understand which capabilities each API invokes and roughly how many calls to expect per operation.

Call count key:

SymbolMeaning
-Not applicable
1 call
✓✓A few calls, typically 2–5, depending on the number of datasets
✓✓✓Multiple calls, typically 5–10, depending on the number of document chunks
✓✓✓✓Many calls, typically 10–100+, depending on the number of chunks, entities, and relations
APIText parsingMultimodal parsingEmbeddingKnowledge graph constructionRetrieved context summarizationRerank
documents/upload (Standard)--✓✓✓✓✓✓✓--
documents/upload (Multimodal)✓✓✓✓✓✓✓✓✓--
documents/upload (Audio/Video)--✓✓✓✓✓✓✓--
documents/text--✓✓✓✓✓✓✓--
query---✓✓
query/stream---✓✓
cross-query--✓✓-✓✓✓✓
cross-query/context--✓✓-✓✓
cross-query/stream--✓✓-✓✓✓✓
search-----
For document upload operations, knowledge graph construction dominates the total call count and cost. It can generate 10–100+ calls per upload depending on the number of chunks, entities, and relations extracted.

Billing example

This example estimates the cost of uploading a PDF document with mixed text and images, then running one retrieval query in mix mode with reranking enabled.

Scenario parameters

ParameterValueDescription
Document word count40,000 Chinese charactersApproximately 53,000 tokens (1 Chinese character ≈ 1.3 tokens)
Number of images8-
chunk_token_size1200Maximum tokens per chunk
chunk_overlap_token_size100Overlapping tokens between chunks
entity_extract_max_gleaning1Supplementary extraction rounds for the knowledge graph
Estimated entities80Estimated based on document content and model capabilities
Estimated relations60Estimated based on document content and model capabilities

Step 1: Calculate the number of chunks

The system splits the document into chunks before processing.

  • Effective chunk size: chunk_token_sizechunk_overlap_token_size = 1200 − 100 = 1,100 tokens

  • Estimated chunks: 53,000 ÷ 1,100 ≈ 48.18, rounded up to 49 chunks

Step 2: Upload phase — API calls and cost

Uploading this document via documents/upload (Multimodal) triggers text parsing, multimodal parsing, embedding, and knowledge graph construction.

Call count breakdown:

  • Text parsing: 1 call (parses the PDF structure)

  • Multimodal parsing: 8 calls (1 per image)

  • Embedding: 49 chunks + 80 entities + 60 relations = 189 calls

  • Knowledge graph construction: 49 chunks + 80 entities + 60 relations = 189 calls

Cost summary:

API billing typeIncluded capabilitiesCall countUnit price (CNY/call)Cost (CNY)
IntermediateEmbedding (chunks, entities, relations)1890.00060.1134
AdvancedKnowledge graph construction, Text parsing1900.00130.2470
MasterMultimodal parsing80.02100.1680
Total for upload phase387-0.5284

Step 3: Query phase — API calls and cost

One query in mix mode with reranking enabled triggers embedding, reranking, and retrieved context summarization. In mix mode, the system retrieves from multiple knowledge sources (for example, text chunks and entities), which increases embedding calls.

Call count breakdown:

  • Embedding: 3 calls (mix mode retrieval)

  • Rerank: 1 call

  • Retrieved context summarization: 1 call (Advanced-level model)

  • Total: 5 calls

Cost summary:

API billing typeIncluded capabilitiesCall countUnit price (CNY/call)Cost (CNY)
IntermediateEmbedding, Rerank40.00060.0024
AdvancedRetrieved context summarization10.00130.0013
Total for query phase5-0.0037

Step 4: Total cost

Upload phaseQuery phaseTotal
API calls3875392
Cost (CNY)0.52840.00370.5321

Applying the free quota: 392 calls fall within the daily free quota of 1,000 calls. If this is the first use on a given day, the actual bill is CNY 0. Any calls beyond the remaining 608 free calls on the same day are billed at the rates above.

References