| Crates.io | toast-api |
| lib.rs | toast-api |
| version | 0.1.5 |
| created_at | 2025-05-19 07:57:07.932222+00 |
| updated_at | 2025-06-03 03:57:56.374517+00 |
| description | An unofficial CLI client and API server for Claude/Deepseek |
| homepage | |
| repository | |
| max_upload_size | |
| id | 1679418 |
| size | 266,305 |
An unofficial CLI client and API server for Claude and DeepSeek that provides both a command-line interface and OpenAI-compatible API endpoints.
Toast is a versatile tool that provides multiple interfaces for working with LLMs:
# Clone the repository
git clone https://github.com/yourusername/toast.git
cd toast
# Build the project
cargo build --release
By default, Toast runs in CLI mode with Claude. You can switch between providers:
# Use Claude (default)
./target/release/toast
# Use DeepSeek
./target/release/toast --deepseek
CLI options:
# Use Claude Opus model (claude-opus-4-20250514)
./target/release/toast --opus
# Use Claude Haiku model (claude-3-5-haiku-20241022)
./target/release/toast --haiku
# Use DeepSeek with R1 reasoning model (default for DeepSeek)
./target/release/toast --deepseek
# Use DeepSeek lite model
./target/release/toast --deepseek --haiku
Toast includes a built-in coding agent that can execute commands and read files. These features work with both Claude and DeepSeek:
/exit or exit or x to quit# exec <command> to execute shell commands# read_file <filename> to read filesRun Toast as an OpenAI-compatible API server:
# Start the API server
./target/release/toast --serve
# Custom port
./target/release/toast --serve --port 8080
# Custom model
./target/release/toast --serve --model claude-sonnet-4-20250514-claude-ai
# Custom host address
./target/release/toast --serve --host 127.0.0.1
The server exposes the following OpenAI-compatible endpoints:
POST /v1/chat/completions - Chat completions APIPOST /chat/completions - Alternative endpointPOST / - Root endpoint (same as chat completions)GET /health - Health check endpointPOST /v1/chat/completions
Request body:
{
"model": "gpt-4.1",
"messages": [
{
"role": "developer",
"content": "You are a helpful assistant."
},
{
"role": "user",
"content": "Hello!"
}
]
}
Response:
{
"id": "f52a7702-6588-4b68-a057-bc2630d223b8",
"object": "chat.completion",
"created": 1683989000,
"model": "claude-opus-4-20250514",
"choices": [
{
"index": 0,
"message": {
"role": "assistant",
"content": "Hello! I'm Claude, a helpful AI assistant. How can I assist you today?"
}
}
]
}
The API supports various content formats:
The server maps OpenAI model names to Claude models:
gpt-3.5-turbo → Claude Haiku (claude-3-5-haiku-20241022)gpt-4, gpt-4-turbo → Claude Sonnet (claude-sonnet-4-20250514-claude-ai)gpt-4o, gpt-4.1 → Claude Opus (claude-opus-4-20250514)You can also specify a Claude model directly in the model field.
The API server currently doesn't require authentication tokens from clients. However, you need to configure credentials for the underlying LLM providers (see Configuration section).
Toast requires authentication credentials for each LLM provider stored in the config directory:
~/Library/Application Support/toast/~/.config/toast/C:\Users\{USERNAME}\AppData\Roaming\toast\Required files:
cookie: Contains your Claude session cookieorg_id: Your Claude organization ID (automatically extracted from cookie if not present)~/Library/Application Support/toast/deepseek/~/.config/toast/deepseek/C:\Users\{USERNAME}\AppData\Roaming\toast\deepseek\Required files:
auth_token: Your DeepSeek authentication token (from Authorization header)cookies.json: DeepSeek cookies including Cloudflare verificationTo get your DeepSeek auth token:
cargo build
cargo test
Key dependencies include:
rquest: HTTP client with browser emulationaxum: Web framework for the API servertokio: Async runtimeclap: Command-line argument parsingwasmtime: WebAssembly runtime for DeepSeek POWsha3: Cryptographic hashing for DeepSeek verificationdashmap: Concurrent hashmap for conversation trackingMIT