Skip to main content
Use Symfony AI with Eden AI to reach 500+ AI models, plus OCR, speech and image models, from one PHP platform.

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/completions and /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.
The bridge landed in Symfony AI v0.14.0. Binary content is uploaded through Eden AI’s upload endpoint for you, and long-running transcriptions come back as a job handle rather than a blocking call.

Installation

Configuration

Store your key in the environment, then declare the platform in your bundle configuration:
Get your key from the Eden AI dashboard.

Quick Start

Outside a Symfony application, build the platform directly from the factory:
Switching provider is a change of model string, nothing else.

Streaming

Pass stream 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:
Point the agent at a different model string to run the same toolbox on another provider.

OCR and Document Parsing

Pass a Document 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:
Plain OCR returns raw text and bounding boxes instead of structured fields. Input parameters such as 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:
Image analysis also covers explicit content, logo detection, face detection, AI detection and deepfake detection.

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:
The bridge never blocks inside 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 the provider/model format: Chat
  • openai/gpt-4o-mini
  • anthropic/claude-sonnet-5
  • mistral/mistral-large-latest
  • google/gemini-2.5-flash
Embeddings
  • openai/text-embedding-3-small
  • mistral/mistral-embed
Expert models use feature/subfeature/provider, and some take the backing model as a fourth segment:
  • ocr/ocr/google
  • ocr/financial_parser/affinda
  • ocr/resume_parser/openai/gpt-4o
  • audio/tts/amazon/neural
  • image/object_detection/google
Browse the full list in the Eden AI models catalog, or call List LLM Models.

Dynamic Model Catalog

The bundled ModelCatalog 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:
Expert subfeatures the bridge has no result converter for stay hidden from that catalog, so an unsupported model fails at lookup time rather than during conversion.

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