API Documentation
Everything you need to integrate Frux into your applications. Build powerful AI-powered solutions with our comprehensive API.
Getting Started
The Frux API provides programmatic access to our AI platform. Use it to build chatbots, analyze documents, process images, and more - all while benefiting from our Token Value Preservation technology.
Base URL
https://api.frux.proQuick Start Example
curl -X POST "https://api.frux.pro/api/v1/conversations" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"title": "My First Conversation"
}'Save up to 80% with TVP
Our Token Value Preservation technology automatically caches and reuses token patterns. The more you use the API, the more you save!
Authentication
The Frux API supports two authentication methods: API Keys for programmatic access and JWT tokens for user sessions.
API Key Authentication
Use API keys for server-to-server communication. Keys start with th_live_ for production or th_test_ for testing.
Authorization: Bearer th_live_xxxxxxxxxxxxxxxxxxJWT Token Authentication
For user-facing applications, authenticate users and receive a JWT token to make requests on their behalf.
# Login to get JWT token
curl -X POST "https://api.frux.pro/api/v1/auth/login" \
-H "Content-Type: application/json" \
-d '{"email": "user@example.com", "password": "your_password"}'
# Use the token
Authorization: Bearer eyJhbGciOiJIUzI1NiIs...API Key Management
/api/v1/api-keysCreate a new API key
/api/v1/api-keysList all your API keys
/api/v1/api-keys/:keyIdRevoke an API key
Chat & Conversations
Create conversations and send messages to AI models. Supports streaming responses for real-time interactions.
Endpoints
/api/v1/conversationsCreate a new conversation
/api/v1/conversationsList all conversations
/api/v1/conversations/:idGet conversation details with messages
/api/v1/conversations/:id/messagesSend a message and get AI response
/api/v1/conversations/:id/messages/streamSend a message with streaming response (SSE)
/api/v1/conversations/:idDelete a conversation
Example: Send a Message
# Send a message and get AI response
curl -X POST "https://api.frux.pro/api/v1/conversations/conv_123/messages" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"content": "Explain quantum computing in simple terms",
"model": "claude-3-5-sonnet-20241022"
}'File Management
Upload and manage files to use in conversations. Supports PDFs, images, and text files up to 50MB.
/api/v1/files/uploadUpload a file (multipart/form-data)
/api/v1/filesList all uploaded files
/api/v1/files/:fileIdGet file metadata
/api/v1/files/:fileId/contentDownload file content
/api/v1/files/:fileIdDelete a file
Example: Upload a File
# Upload a file
curl -X POST "https://api.frux.pro/api/v1/files/upload" \
-H "Authorization: Bearer YOUR_API_KEY" \
-F "file=@document.pdf"
# Response
{
"success": true,
"data": {
"fileId": "file_abc123",
"filename": "document.pdf",
"size": 1024000,
"mimeType": "application/pdf"
}
}TVP - Token Value Preservation
Process images, documents, and videos with our proprietary TVP technology. Content is cached as TVP Cards for massive savings on repeated use.
How TVP Saves You Money
When you process a document or image, we create a TVP Card that caches the token representation. Future references to the same content use the cached version, reducing tokens sent to the AI provider by up to 80%.
Image Processing
/api/v1/tvp/visual/processProcess an image synchronously
/api/v1/tvp/visual/process/asyncProcess an image asynchronously (for large files)
/api/v1/tvp/visual/jobs/:jobIdGet async job status
Document Processing
/api/v1/tvp/doc/processProcess a document with OCR
/api/v1/tvp/doc/process/asyncProcess a document asynchronously
Video Processing
/api/v1/tvp/video/processProcess a video file
/api/v1/tvp/video/process-urlProcess a video from URL
TVP Cards Management
/api/v1/tvp/cardsList all your TVP cards
/api/v1/tvp/cards/:cardIdGet a specific TVP card
/api/v1/tvp/cards/:cardIdDelete a TVP card
Example: Process an Image
# Analyze an image with TVP
curl -X POST "https://api.frux.pro/api/v1/tvp/visual/process" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"fileId": "file_abc123",
"prompt": "Describe this image in detail"
}'
# Response includes TVP Card for future savings
{
"success": true,
"data": {
"response": "This image shows...",
"tvpCard": {
"cardId": "tvp_xyz789",
"tokensSaved": 0,
"tokensProcessed": 1500
},
"cost": {
"withTVP": 0.02,
"withoutTVP": 0.02,
"savings": 0
}
}
}
# Subsequent calls with same content use cached tokens
# and show significant savings!Available Models
Access multiple AI models through a single API. All models are included in your pricing tier with no additional cost.
/api/v1/modelsList all available models with pricing
Supported Models
Anthropic Claude
- claude-3-5-sonnet-20241022
- claude-3-opus-20240229
- claude-3-haiku-20240307
OpenAI GPT
- gpt-4o
- gpt-4o-mini
- gpt-4-turbo
Google Gemini
- gemini-1.5-pro
- gemini-1.5-flash
Meta Llama
- llama-3.2-90b-vision
- llama-3.1-70b
Errors & Rate Limits
The API uses standard HTTP status codes and returns detailed error messages in JSON format.
| Code | Status | Description |
|---|---|---|
| 400 | Bad Request | Invalid request parameters or malformed JSON |
| 401 | Unauthorized | Missing or invalid authentication credentials |
| 403 | Forbidden | Valid credentials but insufficient permissions |
| 404 | Not Found | Requested resource does not exist |
| 429 | Too Many Requests | Rate limit exceeded, slow down requests |
| 500 | Internal Server Error | Internal server error, please retry or contact support |
Error Response Format
{
"success": false,
"error": "Error message here",
"code": "ERROR_CODE",
"timestamp": "2025-12-31T00:00:00.000Z"
}Rate Limiting
The API includes rate limit information in response headers. Default limit is 100 requests per minute.
# Rate limit headers in response
X-RateLimit-Limit: 100
X-RateLimit-Remaining: 99
X-RateLimit-Reset: 1735689600Ready to Start Building?
Create your free account to get API access and start building AI-powered applications today.
Get Your API Key