Endpoints Overview

All available API endpoints at a glance

Base URL

https://api.tarqaai.com — paths below are relative to it, e.g. https://api.tarqaai.com/v1/chat/completions. For local development the base is http://localhost:3001/api/v1 (host and /api prefix differ; the rest is identical).

Chat & Inference
POST/v1/chat/completionsPrimary
OpenAI-compatible chat completions — supports system messages, multi-turn, streaming
POST/v1/ask?model=model_name
Simple single-turn ask endpoint — minimal request format
GET/v1/models
The authoritative list of model IDs you can pass as "model". Always resolve model IDs from here rather than hard-coding — examples in these docs may lag.
RAG System
POST/v1/context/conversations/create
Create a RAG conversation (knowledge base container)
POST/v1/rag/index
Index documents into vector DB for semantic search
POST/v1/rag/search
Semantic search across indexed documents with relevance scoring
POST/v1/rag/chat
Chat with AI using indexed documents as context
GET/v1/rag/stats/:conversationId
Get vector collection statistics for a conversation
API Keys & Analytics
GET/v1/keys
List API keys for the current workspace. Pass ?teamId=<id> for a team workspace; omit it for personal.
POST/v1/keys
Create a key. Body: key_name (string), expires_in_days (number, optional), team_id (string, optional — binds the key to that team; omit for a personal key). The plaintext key is returned once.
DELETE/v1/keys/:id
Revoke an API key by ID — takes effect within ~5 minutes
GET/v1/keys/:id/analyticsAnalytics
Get real-time analytics for a specific API key
Webhooks
GET/v1/webhooks
List configured webhook endpoints
POST/v1/webhooks
Register a webhook. Body: name, url, events[]. Returns the signing secret once. See the Webhooks page.
POST/v1/webhooks/:id/test
Send a webhook.test delivery to the endpoint
GET/v1/webhooks/:id/deliveries
Recent delivery attempts for a webhook
System
GET/api/health
Health check — for uptime monitoring and load balancer probes