Quickstart
This guide will get you from zero to making your first AI model call in under 5 minutes.Prerequisites
Paid t3.chat Account
You need an active paid subscription to t3.chat. Free accounts are not supported.If you don’t have one, visit t3.chat to subscribe.
Rust Toolchain
Make sure you have Rust installed. If not, install it from rustup.rs:
Installation
Add Dependencies
Add T3Router to your
Cargo.toml:Cargo.toml
The library requires tokio for async runtime and dotenv for environment variable management.
Get Your Credentials
You need two pieces of information from your t3.chat session:
- Open t3.chat in your browser
- Press F12 to open Developer Tools
- Go to the Application tab (Chrome) or Storage tab (Firefox)
- Click on Cookies →
https://t3.chat - Copy the entire cookie string (see Authentication for detailed instructions)
- Find and copy the value of
convex-session-id
Your First Request
Createsrc/main.rs with this complete working example:
src/main.rs
Run Your Code
Execute your program:Expected Output
Try Different Models
T3Router supports 50+ models. Try switching to a different one:Common Issues
Error: COOKIES not set
Error: COOKIES not set
Error: Failed to parse response
Error: Failed to parse response
Your cookies may have expired. Go back to t3.chat in your browser and extract fresh credentials.
Request succeeds but returns empty content
Request succeeds but returns empty content
Check that:
- Your t3.chat subscription is active
- You’re using a valid model name
- The
convex-session-idis properly formatted with quotes:format!("\"{}\"\, session_id)
Next Steps
Authentication Guide
Learn the detailed process for extracting and managing your credentials.
API Reference
Explore all available methods, types, and configuration options.
Pro tip: The
Client automatically manages conversation threads. Each message you send is added to the conversation history, allowing for multi-turn interactions.