Eden AI supports the OpenAI Responses API — a stateful alternative to chat completions that stores conversation history server-side, so you don’t need to resend the full message history on each turn.
Provider-Dependent Behavior — The Responses API is a passthrough to the underlying provider. Stateful features (server-side storage, response retrieval/deletion, and previous_response_id chaining) are only available when the provider natively supports the Responses API (e.g. OpenAI). For all other providers, responses are not stored and the retrieve/delete endpoints are not functional.
Because responses are stored server-side, you only need to send the new user message and reference the prior response ID:
import requestsurl = "https://api.edenai.run/v3/llm/responses"headers = { "Authorization": "Bearer YOUR_API_KEY", "Content-Type": "application/json"}# First turnres1 = requests.post(url, headers=headers, json={ "model": "openai/gpt-4o", "input": "What is the capital of France?", "store": True}).json()print(res1["output"][0]["content"][0]["text"])# Second turn — no need to resend historyres2 = requests.post(url, headers=headers, json={ "model": "openai/gpt-4o", "input": "What is its population?", "previous_response_id": res1["id"]}).json()print(res2["output"][0]["content"][0]["text"])
previous_response_id chaining only works for providers with native Responses API support. For other providers, responses are not stored server-side — you must manage conversation history client-side (e.g. by resending the full message array, as with chat completions).
Pass store: false if you don’t need persistence and want to keep the conversation stateless, like chat completions.
This endpoint only works for providers with native Responses API support. For other providers, responses are not stored and this endpoint will return an error.
This endpoint only works for providers with native Responses API support. For other providers, responses are not stored and this endpoint will return an error.
Remove a stored response. The response will no longer be retrievable or usable as a previous_response_id:
Use Eden AI’s Responses endpoint directly with the OpenAI Python SDK:
from openai import OpenAIclient = OpenAI( api_key="YOUR_EDEN_AI_API_KEY", base_url="https://api.edenai.run/v3/llm")response = client.responses.create( model="anthropic/claude-sonnet-4-5", input="What is the capital of France?", instructions="You are a helpful assistant.")print(response.output[0].content[0].text)
For multi-turn with the SDK:
from openai import OpenAIclient = OpenAI( api_key="YOUR_EDEN_AI_API_KEY", base_url="https://api.edenai.run/v3/llm")res1 = client.responses.create( model="openai/gpt-4o", input="What is the capital of France?", store=True)res2 = client.responses.create( model="openai/gpt-4o", input="What is its population?", previous_response_id=res1.id)print(res2.output[0].content[0].text)