OpenAI
OpenAI offers the GPT family of models — some of the most widely recognized and commonly used language models in the world. They are known for high-quality responses, strong contextual understanding, and a broad ecosystem of documentation, tools, and community support.
When to choose OpenAI
High-quality responses:
- tasks that require precise reasoning
- complex analysis and inference,
- creative content generation.
Simple configuration:
- only a single API key is required,
- no additional infrastructure components are needed, such as a bucket or service account,
- quick setup that can be completed in just a few minutes.
Proven and mature solution:
- extensive documentation and many usage examples,
- broad community support,
- regularly updated models.
Function calling:
- strong support for function calling,
- easy integration with external tools,
- ability to generate structured JSON responses.
Requirements
- an OpenAI account,
- an OpenAI API key.
Step 1: Get an API key
- Log in to OpenAI Platform.
- Go to API Keys.
- Click Create new secret key.
- Enter a name (e.g.,
aiproxy-key). - Copy the genereated API key. It typically starts with
sk-.
Important
The API key is shown only once, so make sure to store it in a secure location.
Step 2: Configure AI Proxy
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"
}
}
}
File 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
- verify that the correct API key is being used in the configuration,
- make sure the key is still active.
Error 429 Rate Limit
- check the rate limits for your OpenAI account,
- review the frequency of requests and reduce it if necessary.
Error: Model not found
- verify that the model name is spelled correctly,
- make sure your account has access to the specified model.
Popular models
Chat and vision models
- gpt-4o - a next-generation multimodal model that supports text and images,
- gpt-4o-mini - a more efficient and lower-cost variant of gpt-4o,
- o1-preview - a model designed for tasks that require advanced reasoning,
- o1-mini - a lighter model for tasks that require precise thinking,
- gpt-4-turbo - a faster GPT-4 variant with a larger context window.
Note
OpenAI models are updated regularly. Information about the latest model versions, such as gpt-4o-2024-11-20, is available in the OpenAI Models documentation.
Embedding models
- text-embedding-3-small - a compact model for generating embeddings,
- text-embedding-3-large - a model designed for higher-quality embeddings,
- text-embedding-ada-002 - an older embedding model that is still commonly encountered.