OpenAI
OpenAI offers GPT models - the most recognizable and widely used language models in the world. They are characterized by high-quality responses, excellent context understanding, and broad community support.
When to choose OpenAI
Highest quality responses:
- Tasks requiring precise reasoning
- Complex analysis and inference
- Creative content generation
Simplest configuration:
- Only one API key needed
- No infrastructure requirements (bucket, service account)
- Quick setup in minutes
Proven solution:
- Richest documentation and examples
- Large community and support
- Regular model updates
Function calling:
- Excellent support for function calling
- Integration with external tools
- Structured JSON responses
Requirements
- OpenAI account
- OpenAI API key
Step 1: Get API key
- Log in to OpenAI Platform
- Go to API Keys
- Click Create new secret key
- Assign a name (e.g.,
aiproxy-key) - Copy the key (starts with
sk-)
Important
API key is displayed only once - save it in a secure place!
Step 2: AI Proxy Configuration
Example aiconfiguration.json
{
"ProviderConnections": [
{
"Id": "openai-connection",
"DisplayName": "OpenAI",
"Type": "OpenAi",
"ApiUrl": "https://api.openai.com/v1",
"ApiKey": "sk-your-openai-api-key-here"
}
],
"ProviderModels": [
{
"Name": "gpt-4o-mini",
"ConnectionId": "openai-connection",
"ModelName": "gpt-4o-mini"
},
{
"Name": "gpt-4o",
"ConnectionId": "openai-connection",
"ModelName": "gpt-4o"
}
],
"MethodTypesConfiguration": {
"Chat": {
"DefaultModel": "gpt-4o-mini"
},
"Image": {
"DefaultModel": "gpt-4o"
}
}
}
Plik docker-compose.yml
name: aiproxy_containers
services:
ai-proxy:
image: webconbps/aiproxy:1.0.0.235
container_name: ai-proxy
restart: unless-stopped
ports:
- "5298:8080"
- "7033:8081"
environment:
# AiProxy variables
- ASPNETCORE_ENVIRONMENT=Production
- AppConfiguration__SelfHosted__Certificate__Path=/app/https/certificate.pem
- AppConfiguration__SelfHosted__Certificate__Password=
# Logging
- Logging__LogLevel__Default=Information
- Logging__LogLevel__Microsoft=Warning
volumes:
- ./certificates/certificate.pem:/app/https/certificate.pem:ro
- ./aiconfiguration.json:/app/aiconfiguration.json:ro
Troubleshooting
Error 401 Unauthorized
- Check if API key is correct
- Make sure the key hasn't expired
Error 429 Rate Limit
- Check your OpenAI account limits
- Analyze request frequency
Error "Model not found"
- Check if model name is correct
- Make sure you have access to the given model
Popular models
Chat and Vision Models
- gpt-4o - multimodal next-generation model (text, image support)
- gpt-4o-mini - more efficient version of gpt-4o (lower costs)
- o1-preview - model with advanced reasoning
- o1-mini - model for tasks requiring precise thinking
- gpt-4-turbo - faster GPT-4 with larger context
Note
OpenAI models are regularly updated. The latest versions (like gpt-4o-2024-11-20) are available in the OpenAI Models documentation.
Embedding Models
- text-embedding-3-small - compact embeddings
- text-embedding-3-large - high-quality embeddings
- text-embedding-ada-002 - older standard