Skip to main content
The OpenAI-compatible plugin allows you to connect to OpenAI, xAI (Grok), DeepSeek, and any other service that implements the OpenAI API specification. This gives you maximum flexibility to work with different providers using a consistent interface.

Installation

Supported Providers

OpenAI

Access GPT-4o, o1, o3, DALL-E, Whisper, and more.

xAI (Grok)

Use Grok models from xAI.

DeepSeek

Access DeepSeek’s reasoning models.

Custom OpenAI-Compatible APIs

Connect to any service implementing the OpenAI API:
  • Local inference servers (vLLM, TGI, LocalAI)
  • Cloud providers offering OpenAI-compatible endpoints
  • Self-hosted model APIs

Setup

OpenAI

Get an API Key:
  1. Sign up at OpenAI Platform
  2. Navigate to API Keys
  3. Create a new key
  4. Set environment variable:

xAI (Grok)

DeepSeek

Custom OpenAI-Compatible API

Available Models

OpenAI Models

GPT-5 Series (Latest):
  • gpt-5 - Latest GPT-5 model
  • gpt-5-mini - Smaller, faster GPT-5
  • gpt-5.1 - Enhanced GPT-5
GPT-4.5 Series:
  • gpt-4.5 - Latest GPT-4.5
  • gpt-4.5-preview - Preview version
GPT-4o Series:
  • gpt-4o - Multimodal flagship
  • gpt-4o-mini - Faster, cost-effective
Reasoning Models:
  • o1 - Advanced reasoning
  • o3 - Latest reasoning model
  • o3-mini - Lightweight reasoning
  • o4-mini - Enhanced mini reasoning
GPT-4 Series:
  • gpt-4-turbo - Fast GPT-4
  • gpt-4 - Original GPT-4
  • gpt-4-vision - Vision-enabled
GPT-3.5 Series:
  • gpt-3.5-turbo - Fast and affordable
All GPT models support:
  • Multi-turn conversations
  • Function calling
  • System messages
  • JSON mode (most models)
  • Streaming

OpenAI Modalities

Image Generation:
  • dall-e-3 - Latest DALL-E
  • dall-e-2 - Previous version
Speech-to-Text:
  • whisper-1 - Speech transcription
Text-to-Speech:
  • tts-1 - Standard quality
  • tts-1-hd - High definition
Embeddings:
  • text-embedding-3-large - 3072 dimensions
  • text-embedding-3-small - 1536 dimensions
  • text-embedding-ada-002 - Legacy model

Usage Examples

Basic Text Generation (OpenAI)

Multimodal Input (Vision)

Use visualDetailLevel: 'low' to reduce token usage for simple images.

Function Calling

Streaming Responses

Image Generation (DALL-E)

Text-to-Speech

Speech-to-Text (Whisper)

Text Embeddings

JSON Output Mode

Using Custom Model

Configuration Examples

Using Anthropic via OpenAI-Compatible API

Some providers offer OpenAI-compatible endpoints:

Local Model Server (vLLM, Ollama with OpenAI API)

Model Configuration

Common Parameters

OpenAI-Specific Configuration

Model Selection Guide

When to Use Each Model

gpt-5 / gpt-4.5:
  • Latest capabilities
  • Most advanced reasoning
  • Best for complex tasks
gpt-4o:
  • Multimodal (text + images)
  • Strong general performance
  • Balanced speed and quality
gpt-4o-mini:
  • Fast and affordable
  • Good for most tasks
  • Best value
o1 / o3:
  • Advanced reasoning
  • Mathematical proofs
  • Complex problem solving
  • Longer thinking time
gpt-3.5-turbo:
  • Simple tasks
  • High volume
  • Budget-conscious

Troubleshooting

API Key Not Found

Solution:

Rate Limiting

Solution: Implement exponential backoff:

Model Not Found

Solution: Use a valid model name from the supported models list.

Context Length Exceeded

Solution: Reduce prompt size or use a model with larger context:
  • GPT-4o: 128K tokens
  • GPT-4 Turbo: 128K tokens
  • o1: 200K tokens

Best Practices

  1. Use environment variables for API keys
  2. Choose the right model - use mini models for simple tasks
  3. Implement retry logic for production
  4. Monitor token usage to control costs
  5. Use streaming for better user experience
  6. Set appropriate max tokens to prevent runaway costs
  7. Cache embeddings to avoid redundant API calls

Pricing

OpenAI pricing varies by model. As of latest updates: See OpenAI Pricing for current rates. Cost Optimization:
  • Use gpt-4o-mini for most tasks
  • Set maxOutputTokens to limit costs
  • Use prompt caching when available
  • Batch requests when possible

Next Steps