Auto-Rename
Automatically generate descriptive chat titles using an LLM after the first agent reply.
Opengram can automatically generate descriptive titles for chats using an LLM. When an agent completes a reply in a chat that still has the default title, the auto-rename feature calls the configured LLM to produce a short, relevant title based on the conversation content.
Supported Providers
| Provider | Config value | Environment variable |
|---|---|---|
| Anthropic | anthropic | ANTHROPIC_API_KEY |
| OpenAI | openai | OPENAI_API_KEY |
google | GEMINI_API_KEY or GOOGLE_API_KEY | |
| xAI | xai | XAI_API_KEY |
| OpenRouter | openrouter | OPENROUTER_API_KEY |
Setup
There are three ways to configure auto-rename:
- Init wizard — run
opengram initand follow the prompts to select a provider, enter an API key, and choose a model. - Web UI — open the Settings page in the Opengram web interface (
/settings) and configure auto-rename from the browser. - Config file — edit
opengram.config.jsondirectly:
{
"autoRename": {
"enabled": true,
"provider": "anthropic",
"modelId": "claude-haiku-4-5",
"apiKey": "sk-ant-..."
}
}API Key Resolution
The API key can be provided in two ways:
- In the config file -- set the
apiKeyfield in theautoRenamesection - Via environment variable -- set the provider's environment variable (see table above)
If both are set, the config file value takes precedence.
How it works
- An agent completes a reply in a chat that still has the default title (e.g. "New Chat").
- Opengram checks that user messages total at least 30 characters of content.
- Opengram sends up to the first 6 messages (each truncated to 300 characters) to the configured LLM.
- The LLM returns a short title (3--7 words), trimmed to 48 characters.
- The chat title is updated and marked as auto-renamed.
Auto-rename only triggers once per chat -- when the title source is still default. If a user or agent has already set a custom title, auto-rename is skipped.
Configuration Options
| Option | Type | Description |
|---|---|---|
enabled | boolean | Whether auto-rename is active |
provider | string | One of anthropic, openai, google, xai, openrouter |
modelId | string | The model ID to use (e.g. claude-haiku-4-5, gpt-5-mini) |
apiKey | string | API key for the provider (optional if set via environment variable) |