Rag
Grounded Q&A — answer questions using only your provided documents, with citations
$0.05
per call
POST /rag
AI Processing
Try It
This tool requires an API key. Get one from $1 to try it.
curl Example
curl -X POST https://api.aipaygen.com/rag \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR_API_KEY" \
-d '{
"documents": "text (use --- to separate docs)",
"query": "string"
}'
Python Example
import requests
resp = requests.post(
"https://api.aipaygen.com/rag",
headers={
"Authorization": "Bearer YOUR_API_KEY",
"Content-Type": "application/json",
},
json={
"documents": "text (use --- to separate docs)",
"query": "string"
}
)
print(resp.json())
Response Format
{
"result": "<Rag output>",
"_meta": {
"endpoint": "/rag",
"model": "claude-sonnet-4-20250514",
"cost_usd": 0.05
}
}
Related Tools
Get API Key — From $1
$0.25 trial credits free. ~40 AI calls. No subscription.
Get StartedOr install via MCP: pip install aipaygen-mcp