Skip to main content

T3Router - Rust Client for t3.chat

T3Router is a Rust library that gives you programmatic access to 50+ AI models through t3.chat - including Claude, GPT-4, Gemini, DeepSeek, and more. Built for developers who want to integrate powerful AI capabilities into their Rust applications without managing multiple API keys.
Requires a paid t3.chat subscription - This library uses your t3.chat cookies for authentication and only works with paid accounts.

Why T3Router?

If you’re already paying for t3.chat, you have access to dozens of cutting-edge AI models in one place. T3Router lets you leverage that subscription programmatically:
  • One subscription, many models - Access Claude 4, GPT-4o, Gemini 2.5, DeepSeek R1, and 50+ others
  • No additional API costs - Use your existing t3.chat subscription
  • Built for Rust - Async/await support with tokio, proper error handling, type-safe APIs
  • Multi-turn conversations - Maintain context across multiple messages
  • Image generation - Create images with DALL-E through the same interface

Key Features

50+ AI Models

Access Claude, GPT-4, Gemini, DeepSeek, Llama, Qwen, Grok, and more through a unified interface.

Conversation Management

Built-in support for multi-turn conversations with automatic thread management.

Image Generation

Generate images with DALL-E and automatically download them to your filesystem.

Type-Safe API

Fully typed Rust API with proper error handling and async/await support.

Available Models

T3Router provides access to the latest AI models available on t3.chat: Language Models:
  • Claude: claude-3.5, claude-3.7, claude-4-opus, claude-4-sonnet
  • GPT: gpt-4o, gpt-4o-mini, gpt-o3-mini, o3-full, o3-pro
  • Gemini: gemini-2.0-flash, gemini-2.5-pro, gemini-2.5-flash-lite
  • DeepSeek: deepseek-v3, deepseek-r1
  • Open Source: llama-3.3-70b, qwen3-32b, grok-v3, grok-v4
Image Generation:
  • gpt-image-1: OpenAI’s DALL-E model

Quick Example

Here’s how simple it is to get started:
use t3router::t3::{client::Client, message::{Message, Type}, config::Config};

#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
    let cookies = std::env::var("COOKIES")?;
    let session_id = format!("\"{}\"", std::env::var("CONVEX_SESSION_ID")?);
    
    let mut client = Client::new(cookies, session_id);
    client.init().await?;
    
    let response = client.send(
        "claude-3.7",
        Some(Message::new(Type::User, "What is Rust?".to_string())),
        Some(Config::new())
    ).await?;
    
    println!("Assistant: {}", response.content);
    Ok(())
}

Next Steps

Quickstart

Get T3Router installed and make your first API call in under 5 minutes.

Authentication

Learn how to extract your credentials from t3.chat and set up secure authentication.

Important Notes

This library is intended for legitimate use with your paid t3.chat subscription. The author takes no responsibility for any actions taken against your account. Use responsibly and follow t3.chat’s terms of service.
  • Cookies expire periodically - You’ll need to refresh them from your browser
  • Rate limits apply - Don’t send too many requests in quick succession
  • Paid subscription required - Free t3.chat accounts are not supported

Build docs developers (and LLMs) love