Prerequisites
- OpenAI API account: platform.openai.com
- API key with appropriate permissions
- Sufficient API credits
Setup
Get API Key
- Log in to OpenAI Platform
- Navigate to API Keys in your account settings
- Click Create new secret key
- Copy the key (starts with
sk-)
Add API Key
- Click Set API Key in the authentication section
- Paste your OpenAI API key
- Click Save
.glyph/app/ai_secrets.json in your space directory.Select Model
Click the Model dropdown. Glyph fetches available models from OpenAI’s API.Popular models:
gpt-4o- Latest GPT-4 Omni (recommended)gpt-4o-mini- Faster, more affordable GPT-4gpt-4-turbo- GPT-4 Turbo with visiongpt-4- Original GPT-4gpt-3.5-turbo- Fast and cost-effective
Configuration
Provider Settings
- Service:
openai - Base URL:
https://api.openai.com/v1(default) - Authentication: Bearer token (API key)
Custom Endpoint
To use a custom OpenAI endpoint (proxy, Azure OpenAI, etc.):- Set Base URL to your endpoint
- Add any required headers in Custom Headers
- Enable Allow Private Hosts if using localhost
- Azure OpenAI
- OpenAI Proxy
Model Selection
Glyph fetches the latest model list from OpenAI’s/v1/models endpoint.
Recommended Models
| Model | Use Case | Context Window |
|---|---|---|
gpt-4o | General purpose, multimodal | 128K tokens |
gpt-4o-mini | Fast, affordable | 128K tokens |
gpt-4-turbo | Advanced reasoning | 128K tokens |
gpt-4 | Original GPT-4 | 8K tokens |
gpt-3.5-turbo | Simple tasks, speed | 16K tokens |
Glyph displays models returned by the API. If a model isn’t listed, type its ID manually in the model field.
Chat Completion Models Only
Glyph uses the/v1/chat/completions endpoint. Ensure your selected model supports chat completions.
Features
Chat Mode
Conversational interaction without tools:- Back-and-forth dialogue
- Faster responses (no tool overhead)
- Best for brainstorming and discussion
Create Mode
AI with workspace access:- File reading via
read_filetool - Search notes with
search_notestool - List files with
list_dirtool - Best for research and knowledge retrieval
Context Attachment
Attach files or folders to ground responses:- Attach via context menu in AI panel
- Mention files with
@filenamesyntax - Context sent in system message
- Token estimates shown before sending
API Usage and Billing
Glyph makes direct API calls to OpenAI:- You are billed by OpenAI based on token usage
- No additional fees from Glyph
- Check usage at platform.openai.com/usage
Cost Estimation
Use the context manifest to estimate costs:- Attach context in AI panel
- View token estimate in manifest
- Calculate cost using OpenAI pricing
- 10K input tokens + 1K output tokens with
gpt-4o - Input: 10,000 × 0.025
- Output: 1,000 × 0.010
- Total: ~$0.035 per request
Rate Limits
OpenAI enforces rate limits based on your usage tier:- Free tier: 3 requests/min, 200 requests/day
- Tier 1+: Higher limits based on usage history
Troubleshooting
”API key not set for this profile”
Solution: Add your OpenAI API key in Settings → AI.”model list failed (401)”
Solution: Your API key is invalid or expired. Generate a new key from OpenAI Platform.”model list failed (429)”
Solution: You’ve hit OpenAI’s rate limit. Wait before retrying.”This model is not chat-completions compatible”
Solution: Select a chat model likegpt-4o, gpt-4-turbo, or gpt-4o-mini.
Model list is empty
Solution: Type the model ID manually (e.g.,gpt-4o). The model will work even if the list fetch failed.
Responses are slow
Possible causes:- Large context (10K+ tokens)
- Complex tool usage in create mode
- OpenAI API latency
gpt-4o-mini or reduce context size.
Security Best Practices
Next Steps
Chat Modes
Learn about chat vs create modes
Context Management
Attach notes to conversations
OpenRouter
Access 100+ models via OpenRouter
Profiles
Manage multiple AI profiles