Overview
- Type: Cloud provider
- Cost: Pay-per-use (see pricing)
- API Key Required: Yes
- Installation Required: No
- Official Website: https://platform.openai.com/
Prerequisites
Create an OpenAI account
Sign up at platform.openai.com if you don’t have an account yet.
Add billing information
Go to Billing settings and add a payment method. You’ll need to add credits to use the API.
Generate an API key
Navigate to API keys page and click Create new secret key. Copy the key immediately - you won’t be able to see it again!
Setup in AI Providers
Select OpenAI provider
In the AI Providers settings, click Create AI provider and select
OpenAI as the provider type.Enter API key
Paste your API key from the API keys page into the
API key field.Select model
Click the refresh button to fetch available models, then select the model that suits your needs (e.g.,
gpt-4o).Recommended Models
| Model | Description | Best For |
|---|---|---|
gpt-4o | Latest GPT-4 Omni model, multimodal | Complex tasks, vision, best quality |
gpt-4o-mini | Smaller, faster GPT-4 variant | Fast responses, cost-effective |
gpt-4-turbo | High intelligence, lower cost than GPT-4 | Complex reasoning tasks |
gpt-3.5-turbo | Fast and affordable | Simple tasks, high volume |
o1-preview | Advanced reasoning model | Complex problem solving |
o1-mini | Faster reasoning model | Coding, math, science |
GPT-4 models support vision capabilities, allowing you to include images in your prompts.
Embedding Models
For embedding generation (used in RAG and semantic search), OpenAI provides:text-embedding-3-large- Highest quality embeddingstext-embedding-3-small- Fast and cost-effectivetext-embedding-ada-002- Legacy model (still supported)
Troubleshooting
Rate Limit Errors
If you encounter rate limit errors:- Check your usage limits
- Upgrade your account tier by adding more credits
- Implement request throttling in plugins that use AI Providers
Invalid API Key
If you see “Invalid API key” errors:- Verify you copied the entire API key correctly
- Check that the key hasn’t been revoked in your API keys page
- Ensure you’re using an API key (starts with
sk-) not an organization ID
Model Not Available
Insufficient Credits
If requests fail with billing errors:- Check your billing overview
- Add more credits to your account
- Verify your payment method is valid
Pricing Considerations
OpenAI charges based on tokens processed:- Input tokens (what you send)
- Output tokens (what the model generates)
- Use
gpt-4o-minifor simpler tasks instead ofgpt-4o - Use
gpt-3.5-turbofor high-volume, straightforward tasks - Keep prompts concise
- Monitor your usage in the usage dashboard
Advanced Features
Reasoning Models (o1 series)
The o1 models use extended thinking time before responding. They’re designed for complex reasoning but:- Cost more per token
- Have slower response times
- Don’t support streaming
- Don’t support system prompts in the traditional way
Vision Capabilities
GPT-4o and GPT-4 Turbo support image inputs. You can include images in your prompts by passing them as base64-encoded data URLs.Custom Options
You can pass additional parameters to the OpenAI API:temperature- Controls randomness (0.0 to 2.0)max_tokens- Maximum response lengthtop_p- Nucleus sampling parameterstop- Stop sequences