Set up AI assistance in Glyph by creating profiles, configuring providers, and managing authentication credentials.
Initial Setup
Open AI Settings
Navigate to Settings → AI or press the settings keyboard shortcut and select the AI tab.
Select a Profile
Glyph creates default profiles for all supported providers. Select the profile for your preferred provider (OpenAI, Anthropic, Gemini, etc.).
Configure Provider
Each profile has provider-specific settings:
- Service: The AI provider (OpenAI, Anthropic, Gemini, OpenRouter, Ollama, OpenAI-compatible, Codex)
- Model: Select from available models (fetched from the provider)
- Base URL: Custom endpoint (optional, for OpenAI-compatible or self-hosted)
- Headers: Additional HTTP headers (optional)
- Allow Private Hosts: Enable for local models (Ollama, localhost endpoints)
Add Authentication
Most providers require an API key:
- OpenAI, Anthropic, Gemini, OpenRouter: API key required
- Ollama, OpenAI-compatible: Optional (depends on endpoint)
- Codex: OAuth authentication (no API key needed)
API keys are stored in .glyph/app/ai_secrets.json in your space directory.
Select Model
Click the model dropdown to fetch and select from available models. The list is retrieved from the provider API.
Profile Configuration
Service Selection
Each profile is associated with a single provider. To use multiple providers, create or switch between profiles.
Available services:
openai- OpenAI GPT modelsanthropic- Anthropic Claude modelsgemini- Google Gemini modelsopenrouter- OpenRouter multi-model APIollama- Ollama local modelsopenai_compat- Any OpenAI-compatible endpointcodex_chatgpt- Codex ChatGPT OAuth
Model Selection
Click Model to open the model selector:
- Automatic Model List: Glyph fetches available models from the provider API
- Search Models: Type to filter the model list
- Model Details: Hover over the info icon to view:
- Context length
- Pricing (for OpenRouter)
- Supported parameters
- Input/output modalities
- Manual Entry: If model fetch fails, type the model ID manually
Advanced Options
Base URL
Override the default API endpoint:
- OpenAI:
https://api.openai.com/v1 - Anthropic:
https://api.anthropic.com - Gemini:
https://generativelanguage.googleapis.com - OpenRouter:
https://openrouter.ai/api/v1 - Ollama:
http://localhost:11434/v1 - OpenAI-compatible:
http://localhost:11434/v1(default)
Note
Custom base URLs are validated for SSRF attacks. Enable Allow Private Hosts to use http://localhost or private IP addresses.
Custom Headers
Add additional HTTP headers to requests:
[
{ "key": "X-Custom-Header", "value": "my-value" },
{ "key": "Authorization", "value": "Bearer custom-token" }
]Headers are applied to all requests for this profile.
Reasoning Effort (Codex only)
For models that support reasoning modes (e.g., o1, o3-mini):
- low - Faster responses, less thorough
- medium - Balanced (default)
- high - More thorough, slower
The option appears only when using Codex with a reasoning-capable model.
API Key Management
Setting an API Key
- Select a profile that requires an API key
- Click Set API Key in the authentication section
- Paste your API key
- Click Save
The key is encrypted and stored in .glyph/app/ai_secrets.json.
Create or edit .glyph/app/ai_secrets.json in your space:
{
"<profile-id>": "sk-your-api-key-here"
}Profile IDs are UUIDs visible in the settings UI or ai.json.
Security
- API keys are stored per space, not globally
- Keys are stored in
.glyph/app/ai_secrets.json(add to.gitignore) - File uses atomic writes to prevent corruption
- Keys are never logged or sent to Glyph servers
- Each space has independent API key storage
Clearing an API Key
In Settings → AI, click Clear API Key for the active profile. This removes the key from ai_secrets.json.
Profile Storage
Profile configurations (excluding API keys) are stored in:
~/.config/glyph/ai.json (Linux)
~/Library/Application Support/glyph/ai.json (macOS)
%APPDATA%/glyph/ai.json (Windows)Example ai.json:
{
"profiles": [
{
"id": "uuid-here",
"name": "OpenAI",
"provider": "openai",
"model": "gpt-4o",
"base_url": null,
"headers": [],
"allow_private_hosts": false,
"reasoning_effort": null
}
],
"active_profile_id": "uuid-here"
}Default Profiles
On first launch, Glyph creates these default profiles:
- OpenAI - Empty model, requires API key
- OpenAI-compatible - Points to
http://localhost:11434/v1 - OpenRouter - Empty model, requires API key
- Anthropic - Empty model, requires API key
- Gemini - Empty model, requires API key
- Ollama - Empty model, allows private hosts
- Codex (ChatGPT OAuth) - Model
codex, OAuth authentication
Troubleshooting
”API key not set for this profile”
Add your API key in Settings → AI → Authentication.
”Model list failed”
Check:
- API key is valid and has correct permissions
- Network connectivity
- Base URL is correct (if customized)
- Provider service is operational
”http base_url blocked”
Enable Allow Private Hosts in advanced settings to use http:// URLs.
Model dropdown is empty
Type the model ID manually in the model field. The app will use it even if the model list fetch failed.