Developer Documentation

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.pro

Quick 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_xxxxxxxxxxxxxxxxxx

JWT 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

POST
/api/v1/api-keys

Create a new API key

GET
/api/v1/api-keys

List all your API keys

DELETE
/api/v1/api-keys/:keyId

Revoke an API key

Chat & Conversations

Create conversations and send messages to AI models. Supports streaming responses for real-time interactions.

Endpoints

POST
/api/v1/conversations

Create a new conversation

GET
/api/v1/conversations

List all conversations

GET
/api/v1/conversations/:id

Get conversation details with messages

POST
/api/v1/conversations/:id/messages

Send a message and get AI response

POST
/api/v1/conversations/:id/messages/stream

Send a message with streaming response (SSE)

DELETE
/api/v1/conversations/:id

Delete 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.

POST
/api/v1/files/upload

Upload a file (multipart/form-data)

GET
/api/v1/files

List all uploaded files

GET
/api/v1/files/:fileId

Get file metadata

GET
/api/v1/files/:fileId/content

Download file content

DELETE
/api/v1/files/:fileId

Delete 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

POST
/api/v1/tvp/visual/process

Process an image synchronously

POST
/api/v1/tvp/visual/process/async

Process an image asynchronously (for large files)

GET
/api/v1/tvp/visual/jobs/:jobId

Get async job status

Document Processing

POST
/api/v1/tvp/doc/process

Process a document with OCR

POST
/api/v1/tvp/doc/process/async

Process a document asynchronously

Video Processing

POST
/api/v1/tvp/video/process

Process a video file

POST
/api/v1/tvp/video/process-url

Process a video from URL

TVP Cards Management

GET
/api/v1/tvp/cards

List all your TVP cards

GET
/api/v1/tvp/cards/:cardId

Get a specific TVP card

DELETE
/api/v1/tvp/cards/:cardId

Delete 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.

GET
/api/v1/models

List 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.

CodeStatusDescription
400Bad RequestInvalid request parameters or malformed JSON
401UnauthorizedMissing or invalid authentication credentials
403ForbiddenValid credentials but insufficient permissions
404Not FoundRequested resource does not exist
429Too Many RequestsRate limit exceeded, slow down requests
500Internal Server ErrorInternal 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: 1735689600

Ready to Start Building?

Create your free account to get API access and start building AI-powered applications today.

Get Your API Key
API Documentation - Frux