Quick Start
Get your API key
Sign up at OpenAI Platform and create an API key.
Configuration
Basic Configuration
Available Models
Response API
OpenAI’s Response API provides enhanced conversation management with stateful interactions. Avante automatically uses it for compatible models.Automatic Detection
Features
- Stateful conversations: Previous interactions tracked via
previous_response_id - Encrypted reasoning: Reasoning content is encrypted for privacy
- Function calling: Enhanced tool use with better state management
Environment Variables
| Variable | Scoped Version | Purpose |
|---|---|---|
OPENAI_API_KEY | AVANTE_OPENAI_API_KEY | API authentication |
Reasoning Models
Configuration
Reasoning models (o1, o3-mini) have special requirements:Reasoning Effort Levels
| Level | Speed | Quality | Use Case |
|---|---|---|---|
low | Fastest | Good | Simple tasks, quick iterations |
medium | Balanced | Better | General use, balanced performance |
high | Slowest | Best | Complex problems, maximum quality |
Response API Format
When using Response API with reasoning models:Azure OpenAI
Configuration
Environment Variables
API Version
Azure uses specific API versions. Current recommended version:Advanced Configuration
Custom Endpoint
OpenRouter
Use OpenAI-compatible providers like OpenRouter:Proxy Configuration
Parameter Compatibility
Chat Completions API vs Response API
| Parameter | Chat API | Response API |
|---|---|---|
| Temperature | ✅ | ❌ (reasoning models) |
| Max tokens | max_tokens or max_completion_tokens | max_output_tokens |
| Reasoning effort | reasoning_effort | reasoning.effort |
| Top P | ✅ | ❌ |
| Frequency penalty | ✅ | ❌ |
| Presence penalty | ✅ | ❌ |
Tool Calling
Standard Format
Response API Format
With Response API, tools use a flattened structure:Troubleshooting
API Key Not Found
API Key Not Found
Ensure your API key is set:Restart Neovim after setting the variable.
Rate Limit Errors
Rate Limit Errors
OpenAI has different rate limits per tier:
- Check your limits at OpenAI Platform
- Increase timeout:
timeout = 60000 - Consider upgrading your tier
Reasoning Model Timeout
Reasoning Model Timeout
Reasoning models take longer:
Azure Deployment Not Found
Azure Deployment Not Found
Ensure the deployment name matches your Azure resource:
Best Practices
Model Selection
- GPT-4o: Best for general use
- GPT-4o-mini: Cost-effective option
- o1/o3-mini: Complex reasoning tasks
Token Management
- Set
max_completion_tokensappropriately - Reasoning models need more tokens
- Monitor usage in OpenAI dashboard
Timeouts
- Standard models: 30s
- Reasoning models: 60-120s
- Adjust based on complexity
Temperature
0.0-0.3: Focused, deterministic0.4-0.7: Balanced (recommended)0.8-1.0: Creative- Reasoning models: Always 1.0