Overview
Symfony AI ships an official Eden AI bridge for its Platform component. It covers both halves of the Eden AI V3 API:- The OpenAI-compatible endpoints,
/v3/chat/completionsand/v3/embeddings, with streaming and tool calling. - The expert models served by
/v3/universal-ai: OCR, document parsing, text to speech, speech to text, image analysis and image generation.
Installation
Configuration
Store your key in the environment, then declare the platform in your bundle configuration:Quick Start
Outside a Symfony application, build the platform directly from the factory:Streaming
Passstream in the options and iterate the result. Tokens arrive as they are produced:
Agents and Tool Calling
The platform plugs into Symfony’s Agent component, so tools work the same way they do with any other bridge. The agent decides when to call a tool, runs it, and feeds the result back to the model:OCR and Document Parsing
Pass aDocument or an Image for a local file, or a DocumentUrl or ImageUrl for a remote one. A local file is uploaded through /v3/upload before the request, so both forms behave the same from your code:
language go in the options array, or inline in the model name (ocr/ocr/google?language=en):
Not every provider reads an uploaded file.
ocr/financial_parser/openai returns a successful but empty result when its input is a file ID, while it parses the same document handed over as a URL. ocr/financial_parser/affinda reads both. Pass a DocumentUrl to the providers behaving that way.Speech and Image Models
Audio, document and image content is uploaded before the request, so a local file works the same way as a URL:Asynchronous Jobs
Speech to text runs on/v3/universal-ai/async. When a provider answers fast enough, the transcription is in the response and the call is over. Otherwise the invocation returns a JobResult, a handle you can wait on straight away or store and pick up from a worker later:
invoke(). How long to wait, and whether to wait at all, stays your decision. Pass a webhook_receiver option to be notified out of band instead, and resolve the handle when the webhook fires.
Inside a Symfony application the job client is a service, autowirable by name:
Available Models
Chat and embeddings use theprovider/model format:
Chat
openai/gpt-4o-minianthropic/claude-sonnet-5mistral/mistral-large-latestgoogle/gemini-2.5-flash
openai/text-embedding-3-smallmistral/mistral-embed
feature/subfeature/provider, and some take the backing model as a fourth segment:
ocr/ocr/googleocr/financial_parser/affindaocr/resume_parser/openai/gpt-4oaudio/tts/amazon/neuralimage/object_detection/google
Dynamic Model Catalog
The bundledModelCatalog curates a subset of what Eden AI serves. To reach anything else, register it through the $additionalModels argument, or hand the factory a ModelApiCatalog, which discovers the current catalog from Eden AI’s public endpoints:
Runnable Examples
Symfony ships working scripts for every capability above, in examples/edenai: chat, streaming, tool calling, embeddings, OCR, invoice and resume parsing, text to speech, speech to text with and without upload, object detection, logo detection and image generation.Next Steps
- Chat Completions - Core LLM endpoint
- List LLM Models - Browse available providers and models
- Expert Models - OCR, speech, image and text features
- Symfony AI documentation - The bridge reference on symfony.com