api_key and base_url on an existing OpenAI client and switch model ids to the provider/model format; your client.chat.completions calls and their response objects stay the same.
Overview
Eden AI’s V3 chat completions endpoint is OpenAI-compatible. Models from OpenAI, Anthropic, Google, Cohere and other providers use the same call. The other OpenAI APIs (Files, Assistants, Batches) are not served under/v3; uploads go through /v3/upload. For streaming, see Streaming.
Installation
Quick Start
Configure the OpenAI client to use Eden AI:Model naming
Models use theprovider/model format, for example openai/gpt-latest, anthropic/claude-sonnet-latest and vertex/gemini-flash-latest. Browse the catalog in List LLM Models.
Multi-Turn Conversations
Build conversational applications with message history:Vision Capabilities
Send images to a model that accepts them: itscapabilities.input_modalities in List LLM Models includes image.
Error Handling
The SDK raises a subclass ofopenai.APIStatusError for most statuses; 402 and 451 have none. These are the statuses specific to Eden AI:
An unknown model id answers 400
Model(s) not found or inactive, an invalid request 422, and a provider failure 5xx. The APIStatusError handler below catches them with the others.
Environment Variables
Next Steps
- Chat Completions - Core LLM endpoint
- Streaming - Stream tokens as they are generated
- File Attachments - Working with images and documents
- List LLM Models - Browse available providers and models