Prerequisites
- Anthropic API account: console.anthropic.com
- API key with appropriate permissions
- Sufficient API credits
Setup
Get API Key
- Log in to Anthropic Console
- Navigate to API Keys
- Click Create Key
- Copy the key (starts with
sk-ant-)
Add API Key
- Click Set API Key in the authentication section
- Paste your Anthropic API key
- Click Save
.glyph/app/ai_secrets.json in your space directory.Select Model
Click the Model dropdown. Glyph fetches available models from Anthropic’s API.Popular models:
claude-3-5-sonnet-20241022- Latest Claude 3.5 Sonnet (recommended)claude-3-opus-20240229- Most capable, best for complex tasksclaude-3-sonnet-20240229- Balanced performance and speedclaude-3-haiku-20240307- Fastest, most affordable
Configuration
Provider Settings
- Service:
anthropic - Base URL:
https://api.anthropic.com(default) - Authentication:
x-api-keyheader - API Version:
2023-06-01(automatically set)
Custom Endpoint
To use a custom Anthropic endpoint (proxy, self-hosted):- Set Base URL to your endpoint (e.g.,
https://your-proxy.com) - Add any required headers in Custom Headers
- Enable Allow Private Hosts if using localhost
Model Selection
Glyph fetches the latest model list from Anthropic’s/v1/models endpoint.
Recommended Models
| Model | Use Case | Context Window | Max Output |
|---|---|---|---|
claude-3-5-sonnet-20241022 | General purpose, coding | 200K tokens | 8K tokens |
claude-3-opus-20240229 | Complex reasoning, analysis | 200K tokens | 4K tokens |
claude-3-sonnet-20240229 | Balanced tasks | 200K tokens | 4K tokens |
claude-3-haiku-20240307 | Fast, simple tasks | 200K tokens | 4K tokens |
Claude models have a 200K token context window, allowing you to attach large amounts of context from your notes.
Max Tokens Requirement
Anthropic requires themax_tokens parameter for all requests. Glyph automatically sets this to 2048 tokens for Anthropic models.
If you need longer responses, this value is hardcoded in src-tauri/src/ai_rig/runtime.rs:73.
Features
Chat Mode
Conversational interaction without tools:- Back-and-forth dialogue with Claude
- No file system access
- Faster responses
- Best for discussion and brainstorming
Create Mode
Claude with workspace tools:- read_file - Read files from your space
- search_notes - Search note content
- list_dir - List directory contents
- Tool usage shown in timeline view
- Best for research, summarization, and analysis
Context Attachment
Attach notes to leverage Claude’s 200K context window:- Attach files or folders via context menu
- Mention with
@filenamesyntax - Configure character budget (up to 250K chars)
- View token estimates before sending
API Usage and Billing
Glyph makes direct API calls to Anthropic:- You are billed by Anthropic based on token usage
- No additional fees from Glyph
- Check usage at console.anthropic.com
Cost Estimation
| Model | Input (per 1M tokens) | Output (per 1M tokens) |
|---|---|---|
| Claude 3.5 Sonnet | $3.00 | $15.00 |
| Claude 3 Opus | $15.00 | $75.00 |
| Claude 3 Sonnet | $3.00 | $15.00 |
| Claude 3 Haiku | $0.25 | $1.25 |
Rate Limits
Anthropic enforces rate limits based on your usage tier:- Limits vary by model and tier
- Check your tier at console.anthropic.com
- Rate limit errors include retry-after headers
Troubleshooting
”API key not set for this profile”
Solution: Add your Anthropic API key in Settings → AI.”model list failed (401)”
Solution: Your API key is invalid or expired. Generate a new key from Anthropic Console.”model list failed (403)”
Solution: Your API key doesn’t have permission to list models. This is non-fatal; type the model ID manually.”model list failed (429)”
Solution: You’ve hit Anthropic’s rate limit. Wait before retrying.Model list is empty
Solution: Type the model ID manually:claude-3-5-sonnet-20241022claude-3-opus-20240229claude-3-haiku-20240307
Responses are truncated
Cause: Anthropic’smax_tokens parameter (default 2048) limits output length.
Solution: To increase output length, modify src-tauri/src/ai_rig/runtime.rs:73 and rebuild:
“context length exceeded”
Cause: Total tokens (context + conversation) exceeds 200K. Solution: Reduce attached context or use a smaller character budget.Security Best Practices
Claude-Specific Tips
Extended Thinking
Claude models excel at reasoning tasks. In create mode, Claude can:- Read multiple files to synthesize information
- Search your notes for relevant context
- Chain multiple tool calls to answer complex questions
System Prompts
Claude respects system prompts well. In create mode, Glyph adds:Markdown and Code
Claude generates well-formatted markdown and code. Responses render beautifully in Glyph’s AI panel.Next Steps
Chat Modes
Learn about chat vs create modes
Context Management
Attach notes to leverage Claude’s 200K context
OpenAI
Compare with OpenAI GPT models
Profiles
Manage multiple AI profiles