API Endpoints
Aqta provides OpenAI-compatible endpoints for seamless integration with existing applications.
Base URL
https://api.aqta.ai/v1
All endpoints are prefixed with /v1 for versioning.
Chat Completions
POST /v1/chat/completions
Create a chat completion with any supported model.
Supported Providers:
- OpenAI (GPT-4, GPT-3.5)
- Anthropic (Claude 3.5, Claude 3)
- Google (Gemini Pro, Gemini Ultra)
- Perplexity (Sonar, Sonar Pro)
Request
curl https://api.aqta.ai/v1/chat/completions \ -H "Content-Type: application/json" \ -H "Authorisation: Bearer sk-aqta-your-key-here" \ -d '{ "model": "gpt-4", "messages": [ {"role": "system", "content": "You are a helpful assistant."}, {"role": "user", "content": "What is AI governance?"} ], "temperature": 0.7, "max_tokens": 500 }'
Response
{ "id": "chatcmpl-123", "object": "chat.completion", "created": 1677652288, "model": "gpt-4", "choices": [ { "index": 0, "message": { "role": "assistant", "content": "AI governance refers to..." }, "finish_reason": "stop" } ], "usage": { "prompt_tokens": 20, "completion_tokens": 100, "total_tokens": 120 } }
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
model | string | Yes | Model to use (e.g., "gpt-4", "claude-3-5-sonnet") |
messages | array | Yes | Array of message objects |
temperature | number | No | Sampling temperature (0-2) |
max_tokens | integer | No | Maximum tokens to generate |
top_p | number | No | Nucleus sampling parameter |
stream | boolean | No | Enable streaming responses |
Streaming
POST /v1/chat/completions (Streaming)
Stream responses in real-time using Server-Sent Events (SSE).
Request
import openai openai.api_base = "https://api.aqta.ai/v1" openai.api_key = "sk-aqta-your-key-here" response = openai.ChatCompletion.create( model="gpt-4", messages=[ {"role": "user", "content": "Tell me a story"} ], stream=True ) for chunk in response: if chunk.choices[0].delta.get("content"): print(chunk.choices[0].delta.content, end="")
Response (SSE)
data: {"id":"chatcmpl-123","object":"chat.completion.chunk","created":1677652288,"model":"gpt-4","choices":[{"index":0,"delta":{"content":"Once"},"finish_reason":null}]}
data: {"id":"chatcmpl-123","object":"chat.completion.chunk","created":1677652288,"model":"gpt-4","choices":[{"index":0,"delta":{"content":" upon"},"finish_reason":null}]}
data: [DONE]
Models
GET /v1/models
List all available models.
Request
curl https://api.aqta.ai/v1/models \ -H "Authorisation: Bearer sk-aqta-your-key-here"
Response
{ "object": "list", "data": [ { "id": "gpt-4", "object": "model", "created": 1677610602, "owned_by": "openai", "provider": "openai" }, { "id": "claude-3-5-sonnet-20241022", "object": "model", "created": 1677610602, "owned_by": "anthropic", "provider": "anthropic" } ] }
Analytics
GET /v1/analytics/requests
Get analytics for your API requests.
Available in: Starter, Pro, Healthcare tiers
Request
curl https://api.aqta.ai/v1/analytics/requests \ -H "Authorisation: Bearer sk-aqta-your-key-here" \ -G \ -d "start_date=2026-01-01" \ -d "end_date=2026-01-31"
Response
{ "total_requests": 1250, "total_cost": 45.67, "by_model": { "gpt-4": { "requests": 800, "cost": 38.50 }, "gpt-3.5-turbo": { "requests": 450, "cost": 7.17 } }, "by_date": [ { "date": "2026-01-01", "requests": 50, "cost": 1.85 } ] }
Compliance
GET /v1/compliance/audit-trail
Get audit trail for compliance reporting.
Available in: Healthcare tier
Request
curl https://api.aqta.ai/v1/compliance/audit-trail \ -H "Authorisation: Bearer sk-aqta-your-key-here" \ -G \ -d "start_date=2026-01-01" \ -d "end_date=2026-01-31"
Response
{ "audit_trail": [ { "id": "req_123", "timestamp": "2026-01-15T10:30:00Z", "model": "gpt-4", "user_id": "user_456", "prompt_tokens": 20, "completion_tokens": 100, "cost": 0.0385, "metadata": { "patient_id": "redacted", "session_id": "sess_789" } } ] }
Error Responses
All endpoints return standard error responses:
400 Bad Request
{ "error": { "message": "Invalid request: missing 'model' parameter", "type": "invalid_request_error", "code": "missing_parameter" } }
401 Unauthorised
{ "error": { "message": "Invalid API key", "type": "invalid_request_error", "code": "invalid_api_key" } }
429 Too Many Requests
{ "error": { "message": "Rate limit exceeded", "type": "rate_limit_error", "code": "rate_limit_exceeded" } }
500 Internal Server Error
{ "error": { "message": "Internal server error", "type": "server_error", "code": "internal_error" } }
Rate Limits
All endpoints are subject to rate limits based on your tier:
| Tier | Rate Limit |
|---|---|
| Free | 10 requests/min |
| Starter | 100 requests/min |
| Pro | 1,000 requests/min |
| Healthcare | 1,000 requests/min |
See Rate limits for details.
Next Steps
- Authentication - Get your API key
- Rate Limits - Understand rate limits
- Quick Start Guide - Get started in 5 minutes
Questions? Contact us at hello@aqta.ai