Skip to main content
Symfony AI’s Eden AI bridge sends chat, embeddings and expert-model calls through one Factory::createPlatform() call, or through the ai.platform.edenai service in a Symfony application. This page targets Symfony AI v0.15.0.

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

Every setup needs the bridge. The Symfony bundle, agents and the Wikipedia tool used below are separate packages:

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, there is no bundle to read the key for you. Plain PHP does not load the .env file above, so export EDEN_AI_API_KEY in your shell first: getenv() returns false when it is unset, and the key then becomes an empty string and the request answers 401. Build the platform from the factory:
Switching provider is a change of model string, nothing else.

Model naming

Chat and embeddings models use the provider/model format. The platform looks each name up in a model catalog before it sends anything, and the catalog you pass decides which names work:
  • The bundled ModelCatalog, which is the default, lists exact ids such as openai/gpt-4o-mini, anthropic/claude-sonnet-5 and google/gemini-2.5-flash. It has none of Eden AI’s *-latest aliases, so an alias such as openai/gpt-latest throws a ModelNotFoundException with it.
  • ModelApiCatalog reads the live catalog from Eden AI, so it also accepts aliases. See Dynamic Model Catalog.
Embeddings in the bundled catalog include openai/text-embedding-3-small, openai/text-embedding-3-large and openai/text-embedding-ada-002. 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. With it, aliases work too:
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.

Streaming

Pass stream in the options and iterate the text deltas. 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. toString() turns a handle into a string for storage, and JobHandle::fromString() rebuilds it:
A worker, possibly in another process, picks the handle up and waits for it:
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, ai.platform.job_client.edenai, and the bundle registers JobRunner as a service too:

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