OpenAI-Compatible Chat Completions
Build conversational AI applications using Eden AI’s OpenAI-compatible chat completions endpoint.Overview
Eden AI V3 provides full OpenAI API compatibility with multi-provider support. The endpoint follows OpenAI’s exact format, making it a drop-in replacement. Endpoint:Model Format
Use the simplified model string format for LLM:openai/gpt-4anthropic/claude-3-5-sonnet-20241022google/gemini-procohere/command-r-plus
Basic Chat Completion
Multi-Turn Conversations
Build conversations with message history:System Messages
Guide the model’s behavior with system messages:Temperature and Parameters
Control response creativity and behavior:Available Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
model | string | Required | Model string (e.g., openai/gpt-4) |
messages | array | Required | Conversation messages |
stream | boolean | true | Enable streaming (mandatory in V3) |
temperature | float | 1.0 | Randomness (0-2) |
max_tokens | integer | - | Maximum response tokens |
top_p | float | 1.0 | Nucleus sampling threshold |
frequency_penalty | float | 0.0 | Penalize repeated tokens (-2 to 2) |
presence_penalty | float | 0.0 | Penalize topic repetition (-2 to 2) |
Response Format (Streaming)
Server-Sent Events format:Available Models
OpenAI
openai/gpt-4openai/gpt-4-turboopenai/gpt-3.5-turbo
Anthropic
anthropic/claude-3-5-sonnet-20241022anthropic/claude-3-opus-20240229anthropic/claude-3-sonnet-20240229
google/gemini-progoogle/gemini-1.5-pro
Cohere
cohere/command-r-pluscohere/command-r
Meta
meta/llama-3-70bmeta/llama-3-8b
OpenAI Python SDK Integration
Use Eden AI with the OpenAI SDK:Next Steps
- Streaming Responses - Handle Server-Sent Events
- File Attachments - Send images and documents
- Working with Media Files - Send images and files to LLMs