api_key and base_url on an existing OpenAI client and switch model ids to a model name or ~ alias from /v3/models; 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
Use a model name or~ alias from GET /v3/models, such as ~claude-sonnet-latest; a provider/model id pins one provider.
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