Getting Started
Welcome to ChatRoutes API! Our conversation branching platform enables you to create sophisticated AI conversations with branching capabilities, checkpoints, and parallel response generation.
🚀 Quick Start
Get up and running in minutes with our simple API keys and endpoints.
🌳 Branching Conversations
Create conversation trees with multiple paths and parallel AI responses.
⏱️ Checkpoints
Save conversation states and restore them later for time-travel capabilities.
🤖 Multi-LLM Support
Integrate with OpenAI, Anthropic Claude, and other leading AI models.
Base URL
Quick Example
Authentication
ChatRoutes uses API keys for authentication. All API requests must include your API key in the Authorization header.
API Key Format
Authentication Methods
Method 1: Authorization Header (Recommended)
Method 2: X-API-Key Header
Method 3: JWT Bearer Token (User Sessions)
Rate Limits
- Free Plan: 1,000 calls/month
- Starter Plan: 100,000 calls/month
- Pro Plan: 1,000,000 calls/month
- Enterprise: Custom limits
Conversations API
Core conversation management endpoints for creating, retrieving, updating, and deleting conversations.
List all conversations for the authenticated user with full branch data.
Query Parameters
Page number for pagination
Number of conversations per page
Response
Create a new conversation with optional model configuration.
Request Body
Title for the conversation
AI model to use (gpt-4, gpt-4-turbo, claude-3-5-sonnet-20241022, etc.)
System prompt for AI behavior customization
Model temperature (0.0-2.0)
Maximum tokens in response
Get a specific conversation with all branches and main branch messages.
Update conversation metadata (title, model settings, archive status).
Delete a conversation and all associated data.
Messages
Add a message to a conversation and get AI response.
Request Body
The message content
Branch to add message to (defaults to main branch)
Parent message ID for branching from specific point
Send message with streaming response (Server-Sent Events).
Get all messages for conversation (main branch only).
Update message content (for editing).
Delete a specific message.
Branching API
Create and manage conversation branches for exploring multiple conversation paths.
List all branches in a conversation.
Create a new branch from a specific message.
Request Body
Message ID to branch from
Title for the new branch
Context inheritance mode: "FULL" (all ancestor messages), "PARTIAL" (limited context), "NONE" (start fresh)
Get all messages for a specific branch with inherited context.
Update branch metadata (title, archived status).
Delete a branch (main branch cannot be deleted).
Merge a branch back into its parent with specified strategy.
Request Body
Merge strategy: "append", "replace", or "cherry-pick"
Quick fork operation using forkPointMessageId parameter.
Get complete conversation tree structure showing all branches and their relationships.
Checkpoints API
Save and restore conversation states at any point in time for version control and time-travel capabilities.
List all checkpoints for a conversation.
Query Parameters
Filter checkpoints by specific branch
Response
Create a new checkpoint at a specific message.
Request Body
Branch to create checkpoint for
Message to anchor the checkpoint to
Additional metadata for the checkpoint
Restore a conversation to a checkpoint state, creating a new branch with the checkpoint's context.
Response
Returns the restored conversation state with a new branch containing messages up to the checkpoint.
Delete a checkpoint (does not affect conversation data).
Use Cases
- Version Control: Save important conversation states before making experimental changes
- Undo/Redo: Return to previous conversation states
- A/B Testing: Create checkpoints and explore different conversation directions
- Collaboration: Share specific conversation states with team members
Usage Tracking API
Track token usage, costs, and API consumption across your account, conversations, and branches.
Get comprehensive account-level usage overview with timeframes.
Query Parameters
Filter by timeframe: "today", "week", "month", "all"
Quick simplified usage summary for dashboards.
Get token usage for a specific conversation (all branches).
Query Parameters
Filter by specific branch within conversation
Get token usage for a specific branch.
Get token usage for a specific message.
Get model token pricing for frontend cost calculations.
Parallel Responses API
Generate multiple AI responses simultaneously for comparison and selection.
Generate multiple parallel responses from different models or with different parameters.
Request Body
Message content to send
Array of model names to use for parallel generation
Number of parallel responses to generate
Get parallel response session with all generated candidates.
Choose one response candidate to add to the conversation.
Request Body
ID of the response candidate to select
Billing & Plans API
Manage subscription plans and billing information.
Get account billing information and subscription status.
List available subscription plans with features and pricing.
Available Models
Get list of available AI models with streaming capabilities and pricing.
UI & Guest Mode
Information about the web interface and guest mode for UI users.
Guest Mode (UI Only)
Guest mode allows users to try ChatRoutes without creating an account through the web interface. This feature is designed for the UI and provides:
- 24-Hour Sessions: Try the platform without signup
- Limited Usage: 250 tokens, 3 branches, 20 messages per session
- Easy Conversion: Convert guest sessions to full accounts
- Rate Limiting: 3 sessions/hour, 10/day per IP
Web Interface Features
- Interactive conversation builder
- Visual branch exploration
- Checkpoint management UI
- Usage analytics dashboard
- Real-time streaming responses
For API-based integration, use the endpoints documented in the sections above with your API key authentication.
JavaScript SDK
Our JavaScript SDK makes it easy to integrate ChatRoutes into your applications.
Installation
Quick Setup
Advanced Features
Creating Checkpoints
Branching
Usage Tracking
Framework Support
React
Hooks and components for React applications
Vue 3
Composition API utilities for Vue applications
Node.js
Server-side utilities and webhook handling
Support & Resources
Common Issues
Status & Monitoring
Check our system status at status.chatroutes.com
Health Check
Check API health status (no authentication required).
Get detailed service status with all endpoint listings.