https://api.edenai.run/v3. GoModel routes chat completions, streaming, model
listing, embeddings, and passthrough through the shared OpenAI adapter, so one
Eden key reaches models from OpenAI, Anthropic, Google, Mistral, Cohere,
DeepInfra, and others.
Configure
Create an API key in the Eden AI console and set:EDENAI_BASE_URL is optional — the provider defaults to
https://api.edenai.run/v3. Set it only to reach a different Eden-compatible
endpoint:
config.yaml:
Models
GoModel discovers Eden’s catalog from Eden’s ownGET /v3/models on startup
and on every registry refresh. There is no built-in model list: a model
Eden adds is routable as soon as the catalog refreshes, with no GoModel
upgrade and no configuration change.
Model IDs use provider/model notation and are forwarded unchanged:
edenai/anthropic/claude-sonnet-latest. GoModel strips only the outer
edenai/ routing qualifier before forwarding.
Optionally pin a configured subset:
Discovered metadata
Each catalog entry contributes metadata thatGET /v1/models returns and that
the router, filters, and cost strategies use:
Output modalities also decide what GoModel advertises: a model whose only
output is audio or images is left out of
/v1/models, because Eden here
serves chat, embeddings, and passthrough only. In practice Eden’s catalog
publishes text output for every model, including the handful that also return
images, so nothing is currently filtered.
Pricing
Eden publishes per-token USD rates per model, and GoModel converts them to its per-million-token representation (input_cost_per_token: 6e-8 → $0.06 / MTok).
Rates come from Eden’s pricing block, which is what the account is actually
charged — the undiscounted list_pricing with any account discount already
applied. Each rate is resolved on its own: a usable account rate always wins,
and list_pricing supplies only the individual rates pricing does not carry.
Eden currently publishes the same rates in both blocks, so in practice
everything resolves from pricing; the per-rate fallback is what keeps a
partially priced model from losing the rates it is missing, which would
otherwise bill those token types at $0.
A rate Eden reports as 0 is treated as genuinely free rather than missing,
and a rate neither block publishes usably is left unset rather than invented.
These rates cover input, output, cache reads, and cache writes. Eden’s
context-length-tiered rates (input_cost_per_token_above_200k_tokens), its
tiered_pricing list, and its per-query search fees have no GoModel
equivalent and are not read.
Eden’s reasoning and audio rates (output_cost_per_reasoning_token,
input_cost_per_audio_token) are also left unread. GoModel would price those
token types by subtracting the base rate, which assumes the counts are already
part of the base totals — and Eden’s usage object reports only
prompt_tokens, completion_tokens, and total_tokens, so there is no
breakdown to confirm that against. Those token types fall back to the base
input/output rates instead.
Pricing is read live from Eden — nothing is hard-coded, and Eden models do not
need to be present in GoModel’s central model catalog. This makes
EDENAI_MODEL_FILTER_MAX_PRICE_PER_MTOK, cost-based load balancing, and
price display work for Eden models.
This discovered pricing is what model metadata shows, and what cost accounting
falls back to when a response carries no exact charge. The exact per-request
cost Eden returns takes precedence whenever it is available (see below).
Request cost
Eden returns the exact USD charge for each request as a top-levelcost
member — on chat completions and on embeddings alike — and GoModel
records that figure as the request’s cost instead of recomputing it from token
counts. Eden reprices its upstreams automatically and applies account-level
discounts, so its own number is authoritative in a way a rate-card
reconstruction is not.
This makes Eden spend visible to usage records, budgets, cost dashboards, and
observability, and the usage entry is labelled with the cost source
edenai_cost. If a response carries no usable cost, GoModel falls back to the
discovered per-model pricing above.
The
provider member Eden returns ("openai", "deepinfra") names the
upstream Eden routed to. GoModel reports edenai as the executing provider —
that is the provider it called — and re-exposes Eden’s value on the response
as edenai_upstream_provider so clients can still see which upstream served
the request.Responses API
GoModel serves/v1/responses for Eden by translating the request to Eden’s
chat-completions endpoint.
Eden-specific request fields
Eden accepts extra top-level fields on chat completions —routing,
fallbacks, session_id, pre_hooks, and post_hooks. GoModel preserves
unknown top-level JSON fields on chat requests, so these reach Eden unchanged:
Embeddings
Eden’s/embeddings route is OpenAI-compatible and uses the same
provider/model IDs:
cost Eden reports is recorded for them too. Eden’s LLM catalog
(GET /v3/models) does not list embedding models, so embedding IDs are
forwarded without discovered metadata; pin them under models: if you want
them advertised on /v1/models.
Passthrough
edenai is in the default ENABLED_PASSTHROUGH_PROVIDERS allowlist, so
/p/edenai/... routes work without operator opt-in. Passthrough is a generic
forwarder: it sends any path you give it to Eden unchanged, under the
gateway’s own credential.