Skip to main content
By the end of this page, an edenai provider shows up in Pi’s /model picker, and you can run Pi on any Eden AI chat model that supports function calling.

Overview

Pi is an MIT-licensed coding agent that runs in your terminal. The pi-edenai extension adds Eden AI as a Pi provider:
  • Live catalog: the models are read from Eden AI’s model list when Pi starts, with their pricing, context window, vision and reasoning support. /edenai-sync refreshes them without a restart.
  • Sessions: every call carries Pi’s session id, so Monitoring and Trace Export group a Pi session’s calls under Pi’s own id. Pi leaves it out when prompt caching is off (cacheRetention: "none"), and Eden AI then groups those calls as an inferred session.
  • EU endpoint: one variable routes Pi through Eden AI’s EU endpoint.
Pi sends tool definitions with every request, so choose models that support function calling.

Prerequisites

  • Node.js 22.19 or newer (Pi’s installers can install it for you)
  • An Eden AI API key from app.edenai.run

Setup

Step 1: Install Pi

Step 2: Install the Eden AI extension

Add -l to install it for the current project only (in .pi/settings.json). To try it for one run without installing it, start Pi with pi -e npm:pi-edenai.

Step 3: Export your key

Pi reads the key from the environment of the shell that starts it. It does not read a .env file.
The extension also reads EDEN_AI_API_KEY. The MCP and models.json configurations below name $EDENAI_API_KEY, so they need that exact variable: Pi resolves each reference by its name.

Step 4: Pick a model

Start Pi and run /model. The Eden AI models are listed with [edenai] next to them.

Model naming

Use a model name or ~ alias from GET /v3/models, such as ~claude-sonnet-latest; a provider/model id pins one provider. The extension lists each model once, by its name. Start Pi on one with --model, after the edenai/ prefix:
A pinned id takes the same prefix, such as edenai/anthropic/claude-sonnet-latest. Run /model in Pi, or press Ctrl+P, to switch models during a session.

EU data residency

Expert Models as Tools (MCP)

Pi connects to MCP servers, so Eden AI’s MCP server can give it OCR, web search, speech and translation tools. Add it to ~/.pi/agent/mcp.json, where credentials belong:
Pi selects streamable HTTP from the url. Run pi mcp list to check the connection, and see the MCP server page for the tool catalog.

Without the extension

Pi also reads custom providers from ~/.pi/agent/models.json (Pi looks for it in its agent directory, which you can move with PI_CODING_AGENT_DIR). You list the models yourself:
Only id is required for each model. Pi assumes text input, no reasoning, a 128,000-token context window and 16,384 output tokens unless you set input, reasoning, contextWindow or maxTokens on the model. Opening /model reloads the file.Keep the compat block: it makes Pi send its session id with each call as the x-session-id header. Without it, or when prompt caching is off (cacheRetention: "none"), Eden AI groups a Pi session’s calls on its own, as an inferred session.

Troubleshooting

Eden AI is missing from /model

The picker shows only models whose provider has a key. Check that EDENAI_API_KEY is exported in the shell you start Pi from, then open /model again. pi --list-models edenai lists what Pi found, and pi list shows whether pi-edenai is installed.

Only a few models are listed

The extension could not reach Eden AI when Pi started, so it registered a short built-in list. Run /edenai-sync to load the full catalog.

Authentication errors (401)

Confirm the key at app.edenai.run under API Keys, and that it has no leading or trailing spaces. A 401 with Invalid API key means the sk-eden-... key is wrong or revoked; Invalid token means the credential is not an Eden AI key at all.

The agent fails when it tries to use tools

Use a model that supports function calling.

Next Steps