TARQAAI
DOCUMENTATION
One API. Every Model. Unified AI access for developers & enterprises.
One unified API key to access multiple cutting-edge AI models (Gemini 2.5 Pro, Flash, 2.0, and many more) with built-in analytics, real-time streaming, and seamless model switching — no juggling multiple providers.
Quick Start
Get started in minutes
Generate API Key
Navigate to the API Keys tab in your dashboard and create a new key. Save it securely — you'll only see it once!
Go to DashboardMake Your First Request
Use curl or your favourite HTTP client to test the API with your authentication key.
Start Building
Explore our endpoints, integrate with your application, and monitor usage in real-time.
Authentication
Secure your API requests
Recommended
Alternative
Endpoints Overview
All available API endpoints at a glance
/api/v1/ask?model=model_namePopularSimple way to ask a question with a single request
/api/v1/chat/completionsOpenAI-compatible chat completions (advanced — supports system messages, multi-turn)
/api/v1/chat/completionsStreaming AI chat endpoint for real-time responses — set `"stream": true` in request body
/api/v1/context/conversations/createRAGCreate conversation for RAG knowledge base
/api/v1/rag/indexRAGIndex documents into vector database for semantic search
/api/v1/rag/searchRAGSemantic search across indexed documents with relevance scoring
/api/v1/rag/chatRAGChat with AI using indexed documents as context
/api/v1/rag/stats/:conversationIdRAGGet statistics for RAG collection
/api/v1/keys/:id/analyticsNewGet detailed analytics for a specific API key
/api/v1/keysList all API keys for authenticated user
/api/v1/keysGenerate a new API key
/api/v1/keys/:idDelete an API key
/api/healthHealth check endpoint for monitoring
Chat API
Stream conversational AI responses with support for multiple models
Available Models
Fastest with advanced multimodal capabilities
Most advanced model for complex reasoning
Fast Gemini 2.0 for general tasks
RAG System
BetaRetrieval-Augmented Generation — AI that talks to your data
How RAG Works
Upload and chunk your documents into searchable segments with vector embeddings.
Find relevant information using meaning-based search with relevance scoring.
AI generates responses using retrieved context from your documents.
RAG Workflow
API Key Analytics
Track real-time usage metrics
Code Generation
Generate production-ready code using AI
Example: Generate React Component
Supported Languages
Document Q&A
Ask questions about your documents using RAG
Use Cases
Extract key terms from contracts, analyze legal documents, find specific clauses.
Summarize findings, extract methodology, compare multiple papers.
Build searchable documentation, internal wikis, customer support systems.
Extract diagnoses, medications, treatment plans from medical documents.
Complete Workflow
Create Conversation
Index Your Document
Ask Questions
Code Examples
Real-world integration examples for common use cases
Customer Support Chatbot
Real-time streaming chat with message history
Document Analysis Tool
Upload PDFs and ask questions using RAG
Multi-Language Translator
Real-time translation using streaming responses
Use Chat API with system prompt for translationSales Email Generator
Generate personalized sales emails at scale
Batch requests with different contextsContent Moderation
Automatically flag inappropriate content
Classification with structured promptsData Extraction
Extract structured data from unstructured text
JSON output formatting with promptsSDKs & Libraries
Official SDKs for seamless integration
JavaScript / TypeScript SDK
For Node.js, React, Vue, Next.js, and more
Python SDK
For Flask, FastAPI, Django, and data science
Framework Integration Guides
Rate Limits
Understand and handle API rate limits
Rate Limit Tiers
| Plan | Requests/Min | Requests/Day | Concurrent |
|---|---|---|---|
Free | 20 | 1,000 | 2 |
Pro | 100 | 10,000 | 10 |
Enterprise | Custom | Unlimited | Unlimited |
Rate Limit Headers
Every API response includes rate limit information:
Handling Rate Limits
Error Handling
Understand and handle API errors gracefully
Error Response Format
Common Error Codes
INVALID_API_KEYAPI key is missing, malformed, or invalid
RATE_LIMIT_EXCEEDEDToo many requests — see rate limits section
INSUFFICIENT_CREDITSAccount has run out of credits
MODEL_NOT_AVAILABLERequested model is temporarily unavailable
INVALID_REQUESTRequest body is malformed or missing required fields
CONTEXT_LENGTH_EXCEEDEDMessage exceeds model context window
CONVERSATION_NOT_FOUNDRAG conversation ID does not exist
INTERNAL_ERRORInternal server error — please retry
