Skip to content

Providers ​

tldr supports seven summarization providers.

Comparison ​

Claude Code (default)Anthropic APIOpenAI-compatibleGeminiCodex CLIOllamaxAI / Grok
Cost$0 (subscription)~$0.005/summaryVariesVariesSubscriptionFREE (local)Varies
Speed~5s~2sVaries~2s~5sVaries~2s
RequiresClaude Code + subANTHROPIC_API_KEYOPENAI_API_KEYGEMINI_API_KEYCodex CLI installedOllama runningXAI_API_KEY
How it worksShells out to claude -pAnthropic APIOpenAI-compatible APIGoogle GenAI SDKShells out to codexLocal REST APIOpenAI-compatible API

Claude Code Provider (Default) ​

tldr uses Claude Code by default. If you have it installed and authenticated, no setup is needed:

bash
tldr "https://example.com/article"

On first run, the setup wizard asks you to pick a provider. If the chosen provider needs an API key, the wizard shows which environment variable to set.

Installing Claude Code ​

bash
npm install -g @anthropic-ai/claude-code
claude    # Authenticate

Anthropic API Provider ​

bash
# Set your API key (one of these methods)
export ANTHROPIC_API_KEY=sk-ant-...        # Environment variable
tldr config set apiKey sk-ant-...          # Save to config file

# Switch to Anthropic API provider
tldr config set provider anthropic

OpenAI-compatible Provider ​

Works with any endpoint that implements the OpenAI chat completions API: OpenAI, Groq, Together, Fireworks, and more.

bash
# Set provider and API key
tldr config set provider openai
tldr config set apiKey sk-...

# Or use environment variables
export OPENAI_API_KEY=sk-...
export OPENAI_BASE_URL=https://api.openai.com/v1   # optional, defaults to OpenAI

Set a model that your provider supports:

bash
tldr config set model gpt-4o

Provider examples ​

ProviderBase URLExample model
OpenAI(default)gpt-4o
Groqhttps://api.groq.com/openai/v1llama-3.3-70b-versatile
Togetherhttps://api.together.xyz/v1meta-llama/Llama-3.3-70B-Instruct-Turbo
Fireworkshttps://api.fireworks.ai/inference/v1accounts/fireworks/models/llama-v3p3-70b-instruct

Gemini Provider ​

Uses the Google Gemini API via the @google/genai SDK.

bash
# Set your API key
export GEMINI_API_KEY=...
# Or save to config
tldr config set apiKey ...

# Switch to Gemini
tldr config set provider gemini
tldr config set model gemini-2.0-flash

Gemini models ​

ModelNotes
gemini-2.0-flashFast, good for quick summaries
gemini-2.5-proMost capable, best for detailed analysis
gemini-2.5-flashBalanced speed and quality

Codex CLI Provider ​

Shells out to OpenAI's Codex CLI, similar to how claude-code shells out to Claude.

bash
# Install Codex CLI
npm install -g @openai/codex

# Switch to Codex
tldr config set provider codex
tldr config set model o4-mini

Codex CLI must be installed and authenticated. If not found, tldr shows an install hint.

Ollama Provider (Native) ​

Talks directly to Ollama's REST API — no extra dependency needed. Ollama must be running locally.

bash
# Start Ollama
ollama serve

# Pull a model
ollama pull llama3.3

# Switch to Ollama
tldr config set provider ollama
tldr config set model llama3.3

By default, tldr connects to http://localhost:11434. Override with:

bash
export OLLAMA_BASE_URL=http://my-server:11434

No API key needed — Ollama runs locally.

Ollama models ​

ModelNotes
llama3.3Meta's latest, good all-around
mistralFast, good for quick summaries
gemma2Google's open model
qwen2.5Strong multilingual support

xAI / Grok Provider ​

Uses xAI's OpenAI-compatible API at https://api.x.ai/v1.

bash
# Set your API key
export XAI_API_KEY=...
# Or save to config
tldr config set apiKey ...

# Switch to xAI
tldr config set provider xai
tldr config set model grok-3-mini-fast

xAI models ​

ModelNotes
grok-3Most capable
grok-3-miniBalanced speed and quality
grok-3-mini-fastFastest

Model Selection in the Interactive Editor ​

The preset editor (tldr preset edit / /config) uses a free-text input for the model field. Enter any model ID your provider supports — the value is passed through as-is. Anthropic aliases (haiku, sonnet, opus) are resolved automatically.

Audio ​

The same provider you use for summarization also rewrites summaries as spoken scripts for audio playback. See the Audio guide for TTS providers, voices, and models.

Released under the MIT License.