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:
POST /v3/chat/completions
Note: Streaming is optional. When enabled, responses are delivered via Server-Sent Events (SSE). See Streaming for streaming examples.
import requestsurl = "https://api.edenai.run/v3/chat/completions"headers = { "Authorization": "Bearer YOUR_API_KEY", "Content-Type": "application/json"}payload = { "model": "anthropic/claude-sonnet-4-5", "messages": [ {"role": "user", "content": "What is the capital of France?"}, {"role": "assistant", "content": "The capital of France is Paris."}, {"role": "user", "content": "What's the population?"} ]}response = requests.post(url, headers=headers, json=payload)result = response.json()print(result["choices"][0]["message"]["content"])
For Anthropic Claude models, the thinking parameter enables extended reasoning: the model produces internal thinking content before its final answer, which can improve quality on complex tasks.
from openai import OpenAI# Point to Eden AI endpointclient = OpenAI( api_key="YOUR_EDEN_AI_API_KEY", base_url="https://api.edenai.run/v3")# Use any provider through OpenAI SDKresponse = client.chat.completions.create( model="anthropic/claude-sonnet-4-5", messages=[{"role": "user", "content": "Hello!"}])print(response.choices[0].message.content)