diff --git a/README.md b/README.md index cfda65f..b973195 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ Step-by-step guides for connecting [Eden AI](https://www.edenai.co/) to the tools, agents, and platforms you already use. -Each guide walks through installation, configuration, and model selection so you can route your workflow through **500+ LLMs and AI models** with a single API key — with smart routing, automatic fallbacks, unified billing, and per-request cost visibility. +Each guide walks through installation, configuration, and model selection so you can route your workflow through **700+ LLMs and AI models** with a single API key — with smart routing, automatic fallbacks, unified billing, and per-request cost visibility. > Don't have a key yet? Sign up at [app.edenai.run](https://app.edenai.run/) → **API Keys**. @@ -16,6 +16,23 @@ Each guide walks through installation, configuration, and model selection so you | OpenCode | [opencode.md](./opencode.md) | [YouTube](https://youtu.be/OYHRY5rblz0) | [edenai.co/integrations/opencode](https://www.edenai.co/integrations/opencode) | | Cline | [cline.md](./cline.md) | [YouTube](https://youtu.be/_M8PwHSwgMQ) | [edenai.co/integrations/cline](https://www.edenai.co/integrations/cline) | +## Coding agents (terminal & IDE) + +Connect any of the leading open-source coding agents to Eden AI. All use the OpenAI-compatible endpoint `https://api.edenai.run/v3` with `provider/model` naming. + +| Tool | Guide | Video | Mechanism | +|---|---|---|---| +| OpenCode | [opencode.md](./opencode.md) | [YouTube](https://youtu.be/OYHRY5rblz0) | Custom provider (`opencode.json`) | +| Codex CLI | [codex-cli.md](./codex-cli.md) | [YouTube](https://youtu.be/sVLPbencnnM) | `config.toml` provider (`wire_api = "responses"`) | +| OpenHands | [openhands.md](./openhands.md) | — | LiteLLM (OpenAI-compatible) | +| Cline | [cline.md](./cline.md) | [YouTube](https://youtu.be/_M8PwHSwgMQ) | Built-in Eden AI provider | +| Pi | [pi.md](./pi.md) | — | Custom provider (`~/.pi/agent/models.json`) | +| Goose | [goose.md](./goose.md) | — | Custom provider / env | +| Aider | [aider.md](./aider.md) | — | OpenAI-compatible / LiteLLM | +| Continue | [continue.md](./continue.md) | — | Custom provider (`config.yaml`) | +| Qwen Code | [qwen-code.md](./qwen-code.md) | — | Env (`OPENAI_BASE_URL`) | +| Crush | [crush.md](./crush.md) | — | Custom provider (`crush.json`) | + More integrations are added regularly. Open an issue if there's a tool you'd like us to cover. --- diff --git a/aider.md b/aider.md new file mode 100644 index 0000000..680f862 --- /dev/null +++ b/aider.md @@ -0,0 +1,95 @@ +# Aider + Eden AI + +Connect [Aider](https://aider.chat) to Eden AI and route the original terminal AI pair programmer through **700+ models** with smart routing, automatic fallbacks, and a single API key. + +> Get your Eden AI key at [app.edenai.run](https://app.edenai.run/) → **API Keys**. + +--- + +## 1. System dependencies + +On a fresh Linux machine (Ubuntu / Debian / WSL): + +```bash +sudo apt update +sudo apt install -y curl git python3 python3-venv +``` + +## 2. Install Aider + +```bash +# Recommended — isolated install via uv +curl -LsSf https://astral.sh/uv/install.sh | sh +uv tool install aider-chat + +# Or via pip +python3 -m pip install aider-install && aider-install + +# Verify +aider --version +``` + +## 3. Point Aider at Eden AI + +Aider connects to any OpenAI-compatible endpoint. Export the base URL and your key: + +```bash +export OPENAI_API_BASE="https://api.edenai.run/v3" +export OPENAI_API_KEY="YOUR_EDEN_AI_API_KEY" +``` + +## 4. Run Aider + +Aider runs on top of LiteLLM, so prefix the Eden AI model with `openai/` (this selects the OpenAI-compatible driver; it is stripped before the request): + +```bash +# Fast and cheap +aider --model openai/openai/gpt-4o-mini + +# Claude via Eden AI +aider --model openai/anthropic/claude-haiku-4-5 +``` + +Every edit now flows through Eden AI — with built-in fallbacks, unified billing, and per-request cost visibility. + +--- + +## Using specific models + +The model string is `openai//`: + +| Aider `--model` value | Best for | +|---|---| +| `openai/openai/gpt-4o-mini` | Fast and cheap | +| `openai/anthropic/claude-sonnet-4-5` | Balanced reasoning | +| `openai/anthropic/claude-opus-4-7` | Maximum capability | +| `openai/openai/gpt-5` | OpenAI's frontier model | +| `openai/google/gemini-2.5-pro` | Long context, multimodal | + +> **Note.** Use a concrete `provider/model` with Aider. The smart-router alias `@edenai` is not recommended here — LiteLLM rejects some routed reasoning-model parameters. + +## Troubleshooting + +### `401 Unauthorized` +Verify your Eden AI key — grab a fresh one at [app.edenai.run → API Keys](https://app.edenai.run/). Confirm `OPENAI_API_KEY` and `OPENAI_API_BASE` are exported in the same shell. + +### `NotFoundError` / `model not found` +Keep the double prefix: `openai/` + the Eden AI `provider/model` (e.g. `openai/anthropic/claude-haiku-4-5`). + +### `BadRequestError: Unsupported value` +You're likely targeting a reasoning model or the `@edenai` router. Switch to a concrete chat model such as `openai/openai/gpt-4o-mini`. + +## Uninstall + +```bash +uv tool uninstall aider-chat # or: pip uninstall aider-chat +``` + +--- + +## Next steps + +- [Smart routing](https://www.edenai.co/docs/v3/llms/smart-routing) +- [Fallbacks](https://www.edenai.co/docs/v3/llms/fallback) +- [Eden AI pricing](https://www.edenai.co/pricing) +- [Aider docs](https://aider.chat/docs/) diff --git a/codex-cli.md b/codex-cli.md new file mode 100644 index 0000000..9f0fcdd --- /dev/null +++ b/codex-cli.md @@ -0,0 +1,118 @@ +# Codex CLI + Eden AI + +Connect [OpenAI Codex CLI](https://github.com/openai/codex) to Eden AI and route your terminal agent through **700+ models** with smart routing, automatic fallbacks, and a single API key. + +> Get your Eden AI key at [app.edenai.run](https://app.edenai.run/) → **API Keys**. + +Follow this tuto in the same time with our video tuto on [Youtube](https://youtu.be/sVLPbencnnM) + +--- + +## 1. System dependencies + +On a fresh Linux machine (Ubuntu / Debian / WSL): + +```bash +sudo apt update +sudo apt install -y curl git +``` + +## 2. Install Codex CLI + +```bash +# Option A — via npm +npm install -g @openai/codex + +# Option B — via Homebrew (macOS / Linuxbrew) +brew install codex + +# Verify +codex --version +``` + +## 3. Add Eden AI as a custom provider + +Codex stores its config at `~/.codex/config.toml`. Add Eden AI as a model provider: + +```bash +mkdir -p ~/.codex +nano ~/.codex/config.toml +``` + +```toml +model = "openai/gpt-4o-mini" +model_provider = "edenai" + +[model_providers.edenai] +name = "Eden AI" +base_url = "https://api.edenai.run/v3" +env_key = "EDENAI_API_KEY" +wire_api = "responses" +``` + +Export your key so Codex can read it: + +```bash +export EDENAI_API_KEY="YOUR_EDEN_AI_API_KEY" +``` + +> **`wire_api = "responses"` is required.** Recent Codex CLI (≥ 0.122) removed support for `wire_api = "chat"`. Eden AI implements the OpenAI **Responses API** (`/v3/responses`), so Codex connects directly — no proxy needed. The provider ids `openai`, `ollama`, `lmstudio` are reserved, so keep the id `edenai`. + +## 4. Run Codex + +Interactive: + +```bash +codex +``` + +Non-interactive (one-shot): + +```bash +codex exec "Refactor this function and add tests" +``` + +Every LLM call now flows through Eden AI — with built-in fallbacks, unified billing, and per-request cost visibility. + +--- + +## Using specific models + +Switch model by editing `model` in `config.toml`, keyed by `provider/model`: + +| Model | Best for | +|---|---| +| `openai/gpt-4o-mini` | Fast and cheap (default above) | +| `anthropic/claude-sonnet-4-5` | Balanced reasoning | +| `anthropic/claude-opus-4-7` | Maximum capability | +| `openai/gpt-5` | OpenAI's frontier model | +| `google/gemini-2.5-pro` | Long context, multimodal | + +> Eden AI's smart router `@edenai` also works over the Responses API. If you use it, expect Codex to route to a reasoning-grade model automatically. + +## Troubleshooting + +### `wire_api = "chat" is no longer supported` +Set `wire_api = "responses"` in your provider config (see step 3). + +### `401 Unauthorized` +Verify your Eden AI key — grab a fresh one at [app.edenai.run → API Keys](https://app.edenai.run/). Confirm `EDENAI_API_KEY` is exported in the same shell. + +### `model not found` +Use the `provider/model` format (e.g. `openai/gpt-4o-mini`). No bare model names. + +## Uninstall + +```bash +npm uninstall -g @openai/codex +rm -rf ~/.codex +``` + +--- + +## Next steps + +- [Smart routing](https://www.edenai.co/docs/v3/llms/smart-routing) +- [Fallbacks](https://www.edenai.co/docs/v3/llms/fallback) +- [Eden AI pricing](https://www.edenai.co/pricing) +- [Codex CLI GitHub](https://github.com/openai/codex) diff --git a/continue.md b/continue.md new file mode 100644 index 0000000..35380ef --- /dev/null +++ b/continue.md @@ -0,0 +1,86 @@ +# Continue + Eden AI + +Connect [Continue](https://continue.dev) to Eden AI and route the `cn` agent (and the IDE extension) through **700+ models** with smart routing, automatic fallbacks, and a single API key. + +> Get your Eden AI key at [app.edenai.run](https://app.edenai.run/) → **API Keys**. + +--- + +## 1. Install Continue + +- **IDE:** install the **Continue** extension from the VS Code or JetBrains marketplace. +- **CLI:** install the `cn` terminal agent: + +```bash +npm install -g @continuedev/cli +cn --version +``` + +## 2. Add Eden AI in `config.yaml` + +Continue reads `~/.continue/config.yaml`. Add Eden AI as an OpenAI-compatible provider: + +```bash +nano ~/.continue/config.yaml +``` + +```yaml +models: + - name: GPT-4o mini (Eden AI) + provider: openai + model: openai/gpt-4o-mini + apiBase: https://api.edenai.run/v3 + apiKey: YOUR_EDEN_AI_API_KEY + roles: + - chat + - edit + - name: Claude Haiku 4.5 (Eden AI) + provider: openai + model: anthropic/claude-haiku-4-5 + apiBase: https://api.edenai.run/v3 + apiKey: YOUR_EDEN_AI_API_KEY + roles: + - chat + - edit +``` + +> `provider: openai` selects the OpenAI-compatible driver; `apiBase` points it at Eden AI. Model ids use the `provider/model` format. + +## 3. Run + +Reload your IDE (or start `cn`) and pick an **Eden AI** model from the model selector. Every LLM call now flows through Eden AI — with built-in fallbacks, unified billing, and per-request cost visibility. + +--- + +## Using specific models + +Add more entries under `models`, keyed by `provider/model`: + +| `model` | Best for | +|---|---| +| `openai/gpt-4o-mini` | Fast and cheap | +| `anthropic/claude-sonnet-4-5` | Balanced reasoning | +| `anthropic/claude-opus-4-7` | Maximum capability | +| `openai/gpt-5` | OpenAI's frontier model | +| `google/gemini-2.5-pro` | Long context, multimodal | + +## Troubleshooting + +### `401 Unauthorized` +Verify your Eden AI key at [app.edenai.run → API Keys](https://app.edenai.run/). + +### `model not found` +Use the `provider/model` format for `model`, and set `apiBase` to exactly `https://api.edenai.run/v3`. + +## Uninstall + +Remove the Continue extension from your IDE, or `npm uninstall -g @continuedev/cli`, then delete `~/.continue`. + +--- + +## Next steps + +- [Smart routing](https://www.edenai.co/docs/v3/llms/smart-routing) +- [Fallbacks](https://www.edenai.co/docs/v3/llms/fallback) +- [Eden AI pricing](https://www.edenai.co/pricing) +- [Continue docs](https://docs.continue.dev/) diff --git a/crush.md b/crush.md new file mode 100644 index 0000000..1d7d650 --- /dev/null +++ b/crush.md @@ -0,0 +1,123 @@ +# Crush + Eden AI + +Connect [Crush](https://github.com/charmbracelet/crush) to Eden AI and route Charm's glamourous coding TUI through **700+ models** with smart routing, automatic fallbacks, and a single API key. + +> Get your Eden AI key at [app.edenai.run](https://app.edenai.run/) → **API Keys**. + +--- + +## 1. System dependencies + +On a fresh Linux machine (Ubuntu / Debian / WSL): + +```bash +sudo apt update +sudo apt install -y curl git +``` + +## 2. Install Crush + +```bash +# Option A — via npm +npm install -g @charmland/crush + +# Option B — Homebrew +brew install charmbracelet/tap/crush + +# Verify +crush --version +``` + +## 3. Add Eden AI as a custom provider + +Crush reads `crush.json` from your project directory (or `~/.config/crush/crush.json`). Add Eden AI as an OpenAI-compatible provider: + +```bash +export EDENAI_API_KEY="YOUR_EDEN_AI_API_KEY" +nano crush.json +``` + +```json +{ + "$schema": "https://charm.land/crush.json", + "providers": { + "edenai": { + "type": "openai", + "base_url": "https://api.edenai.run/v3", + "api_key": "$EDENAI_API_KEY", + "models": [ + { + "id": "openai/gpt-4o-mini", + "name": "GPT-4o mini (Eden AI)", + "context_window": 128000, + "default_max_tokens": 4096 + }, + { + "id": "anthropic/claude-haiku-4-5", + "name": "Claude Haiku 4.5 (Eden AI)", + "context_window": 200000, + "default_max_tokens": 8192 + } + ] + } + } +} +``` + +> Use `type: "openai"` with a custom `base_url`. Every model you want to use must be listed under `models` with its `id` in `provider/model` format. + +## 4. Run Crush + +Interactive: + +```bash +crush +``` + +Non-interactive (one-shot): + +```bash +crush run -m edenai/openai/gpt-4o-mini "Explain what this repo does" +``` + +Every LLM call now flows through Eden AI — with built-in fallbacks, unified billing, and per-request cost visibility. + +--- + +## Using specific models + +Add any model to the `models` array, then select it with `-m edenai/`: + +| Model `id` | Best for | +|---|---| +| `openai/gpt-4o-mini` | Fast and cheap | +| `anthropic/claude-sonnet-4-5` | Balanced reasoning | +| `anthropic/claude-opus-4-7` | Maximum capability | +| `openai/gpt-5` | OpenAI's frontier model | +| `google/gemini-2.5-pro` | Long context, multimodal | + +> Crush's default catalog comes from Charm's **Catwalk** registry. Use a concrete `provider/model`; the `@edenai` smart-router alias is not currently supported through Crush's custom-provider path. + +## Troubleshooting + +### `401 Unauthorized` +Verify your Eden AI key at [app.edenai.run → API Keys](https://app.edenai.run/). Confirm `EDENAI_API_KEY` is exported. + +### `model not found` +The model must be listed in the `models` array with its `id` in `provider/model` format, and selected as `edenai/`. + +## Uninstall + +```bash +npm uninstall -g @charmland/crush +rm -rf ~/.config/crush +``` + +--- + +## Next steps + +- [Smart routing](https://www.edenai.co/docs/v3/llms/smart-routing) +- [Fallbacks](https://www.edenai.co/docs/v3/llms/fallback) +- [Eden AI pricing](https://www.edenai.co/pricing) +- [Crush GitHub](https://github.com/charmbracelet/crush) diff --git a/goose.md b/goose.md new file mode 100644 index 0000000..3cf25d0 --- /dev/null +++ b/goose.md @@ -0,0 +1,114 @@ +# Goose + Eden AI + +Connect [Goose](https://block.github.io/goose/) to Eden AI and route Block's open-source agent through **700+ models** with smart routing, automatic fallbacks, and a single API key. + +> Get your Eden AI key at [app.edenai.run](https://app.edenai.run/) → **API Keys**. + +--- + +## 1. System dependencies + +On a fresh Linux machine (Ubuntu / Debian / WSL): + +```bash +sudo apt update +sudo apt install -y curl bzip2 +``` + +## 2. Install Goose + +```bash +curl -fsSL https://github.com/block/goose/releases/download/stable/download_cli.sh | bash + +# Verify +goose --version +``` + +## 3. Configure Eden AI (env variables) + +Goose speaks to any OpenAI-compatible endpoint. The simplest setup uses environment variables: + +```bash +export GOOSE_PROVIDER="openai" +export GOOSE_MODEL="openai/gpt-4o-mini" +export OPENAI_HOST="https://api.edenai.run" +export OPENAI_BASE_PATH="v3/chat/completions" +export OPENAI_API_KEY="YOUR_EDEN_AI_API_KEY" +``` + +> **Split host and path.** Set `OPENAI_HOST` to the root (`https://api.edenai.run`) and `OPENAI_BASE_PATH` to `v3/chat/completions`. This split is what Goose expects for a custom OpenAI-compatible endpoint. + +### Alternative — custom provider file + +Create `~/.config/goose/custom_providers/edenai.json`: + +```json +{ + "name": "edenai", + "display_name": "Eden AI", + "engine": "openai", + "api_key_env": "EDENAI_API_KEY", + "base_url": "https://api.edenai.run", + "base_path": "v3/chat/completions", + "models": ["openai/gpt-4o-mini", "anthropic/claude-haiku-4-5"] +} +``` + +Then run `goose configure` and select **Eden AI**. + +## 4. Run + +Interactive: + +```bash +goose session +``` + +Non-interactive (one-shot): + +```bash +goose run --no-session -t "Summarize the README in this repo" +``` + +Every LLM call now flows through Eden AI — with built-in fallbacks, unified billing, and per-request cost visibility. + +--- + +## Using specific models + +Set `GOOSE_MODEL` (or pick in the wizard), keyed by `provider/model`: + +| Model | Best for | +|---|---| +| `openai/gpt-4o-mini` | Fast and cheap | +| `anthropic/claude-sonnet-4-5` | Balanced reasoning | +| `anthropic/claude-opus-4-7` | Maximum capability | +| `openai/gpt-5` | OpenAI's frontier model | +| `google/gemini-2.5-pro` | Long context, multimodal | + +## Troubleshooting + +### `401 Unauthorized` +Verify your Eden AI key at [app.edenai.run → API Keys](https://app.edenai.run/). + +### `404` / wrong path +Make sure `OPENAI_HOST` is the root and `OPENAI_BASE_PATH` is `v3/chat/completions` — not the full URL in a single variable. + +### Keyring errors on headless machines +Set `GOOSE_DISABLE_KEYRING=1` before running. + +## Uninstall + +```bash +rm -f ~/.local/bin/goose +rm -rf ~/.config/goose +``` + +--- + +## Next steps + +- [Smart routing](https://www.edenai.co/docs/v3/llms/smart-routing) +- [Fallbacks](https://www.edenai.co/docs/v3/llms/fallback) +- [Eden AI pricing](https://www.edenai.co/pricing) +- [Goose docs](https://block.github.io/goose/) diff --git a/openhands.md b/openhands.md new file mode 100644 index 0000000..4975db9 --- /dev/null +++ b/openhands.md @@ -0,0 +1,88 @@ +# OpenHands + Eden AI + +Connect [OpenHands](https://github.com/All-Hands-AI/OpenHands) to Eden AI and route the most autonomous open-source agent through **700+ models** with smart routing, automatic fallbacks, and a single API key. + +> Get your Eden AI key at [app.edenai.run](https://app.edenai.run/) → **API Keys**. + +--- + +## 1. System dependencies + +OpenHands runs in a sandboxed runtime. You need **Docker** (for the runtime) and optionally Python 3.12+ for the CLI: + +```bash +sudo apt update +sudo apt install -y docker.io python3 python3-venv +``` + +## 2. Install OpenHands + +```bash +# CLI (recommended for terminal use) +uvx --python 3.12 --from openhands-ai openhands + +# Or GUI in Docker — see the official quickstart: +# https://docs.all-hands.dev/usage/getting-started +``` + +## 3. Configure Eden AI as the LLM + +OpenHands talks to models through LiteLLM, which supports OpenAI-compatible endpoints. + +**Via the UI:** open **Settings → LLM**, toggle **Advanced**, and set: + +- **Custom Model:** `openai/openai/gpt-4o-mini` +- **Base URL:** `https://api.edenai.run/v3` +- **API Key:** `YOUR_EDEN_AI_API_KEY` + +**Via `config.toml`:** + +```toml +[llm] +model = "openai/openai/gpt-4o-mini" +base_url = "https://api.edenai.run/v3" +api_key = "YOUR_EDEN_AI_API_KEY" +``` + +> **Why the double prefix?** LiteLLM's leading `openai/` selects the OpenAI-compatible driver and is stripped before the request; the remaining `openai/gpt-4o-mini` is the Eden AI model id. For Claude: `openai/anthropic/claude-haiku-4-5`. + +## 4. Run + +Start OpenHands and give it a task. Every LLM call now flows through Eden AI — with built-in fallbacks, unified billing, and per-request cost visibility. + +--- + +## Using specific models + +The model string is `openai//`: + +| Model value | Best for | +|---|---| +| `openai/openai/gpt-4o-mini` | Fast and cheap | +| `openai/anthropic/claude-sonnet-4-5` | Balanced reasoning | +| `openai/anthropic/claude-opus-4-7` | Maximum capability | +| `openai/openai/gpt-5` | OpenAI's frontier model | +| `openai/google/gemini-2.5-pro` | Long context, multimodal | + +> Use a concrete `provider/model`; the `@edenai` smart-router alias is not recommended through LiteLLM. + +## Troubleshooting + +### `401 Unauthorized` +Verify your Eden AI key at [app.edenai.run → API Keys](https://app.edenai.run/). + +### `model not found` / `LLM Provider NOT provided` +Keep the double prefix (`openai/` + Eden AI `provider/model`) and set the Base URL to exactly `https://api.edenai.run/v3`. + +## Uninstall + +Stop and remove the Docker containers/images, or `uv tool uninstall openhands-ai` if you installed the CLI. + +--- + +## Next steps + +- [Smart routing](https://www.edenai.co/docs/v3/llms/smart-routing) +- [Fallbacks](https://www.edenai.co/docs/v3/llms/fallback) +- [Eden AI pricing](https://www.edenai.co/pricing) +- [OpenHands docs](https://docs.all-hands.dev/) diff --git a/pi.md b/pi.md new file mode 100644 index 0000000..23ae256 --- /dev/null +++ b/pi.md @@ -0,0 +1,122 @@ +# Pi + Eden AI + +Connect [Pi](https://github.com/earendil-works/pi) to Eden AI and route the lean, hackable coding agent through **700+ models** with smart routing, automatic fallbacks, and a single API key. + +> Get your Eden AI key at [app.edenai.run](https://app.edenai.run/) → **API Keys**. + +--- + +## 1. Install Node.js + +Pi requires **Node.js 22+**. + +```bash +node --version # must be v22.x or newer +``` + +If it's older, install via [nvm](https://github.com/nvm-sh/nvm): + +```bash +curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.1/install.sh | bash +nvm install 22 && nvm use 22 +``` + +## 2. Install Pi + +```bash +npm install -g @earendil-works/pi-coding-agent + +# Verify +pi --version +``` + +## 3. Add Eden AI as a custom provider + +Pi reads custom providers from `~/.pi/agent/models.json`. Add Eden AI as an OpenAI-compatible provider: + +```bash +export EDENAI_API_KEY="YOUR_EDEN_AI_API_KEY" +mkdir -p ~/.pi/agent +nano ~/.pi/agent/models.json +``` + +```json +{ + "providers": { + "edenai": { + "baseUrl": "https://api.edenai.run/v3", + "api": "openai-completions", + "apiKey": "$EDENAI_API_KEY", + "models": [ + { "id": "openai/gpt-4o-mini", "name": "GPT-4o mini (Eden AI)" }, + { "id": "anthropic/claude-haiku-4-5", "name": "Claude Haiku 4.5 (Eden AI)" } + ] + } + } +} +``` + +The `apiKey` field supports `$ENV_VAR` interpolation, so the key stays out of the file. Confirm the models loaded: + +```bash +pi --list-models edenai +``` + +## 4. Run Pi + +Interactive: + +```bash +pi --provider edenai --model openai/gpt-4o-mini +``` + +Non-interactive (one-shot): + +```bash +pi -p --model edenai/openai/gpt-4o-mini "Explain what this repo does" +``` + +Every LLM call now flows through Eden AI — with built-in fallbacks, unified billing, and per-request cost visibility. + +--- + +## Using specific models + +Add any model to the `models` array, then select it as `edenai/`: + +| Model `id` | Best for | +|---|---| +| `openai/gpt-4o-mini` | Fast and cheap | +| `anthropic/claude-sonnet-4-5` | Balanced reasoning | +| `anthropic/claude-opus-4-7` | Maximum capability | +| `openai/gpt-5` | OpenAI's frontier model | +| `google/gemini-2.5-pro` | Long context, multimodal | + +> Some OpenAI-compatible reasoning models don't accept the `developer` role. If you hit an error with a reasoning model, add `"compat": { "supportsDeveloperRole": false, "supportsReasoningEffort": false }` at the provider or model level in `models.json`. + +## Troubleshooting + +### `No models available` +Check `~/.pi/agent/models.json` is valid JSON and that `EDENAI_API_KEY` is exported, then run `pi --list-models edenai`. + +### `401 Unauthorized` +Verify your Eden AI key at [app.edenai.run → API Keys](https://app.edenai.run/). + +### `model not found` +Use the `edenai//` format (e.g. `edenai/anthropic/claude-haiku-4-5`), and make sure the model is listed under `models`. + +## Uninstall + +```bash +npm uninstall -g @earendil-works/pi-coding-agent +rm -rf ~/.pi +``` + +--- + +## Next steps + +- [Smart routing](https://www.edenai.co/docs/v3/llms/smart-routing) +- [Fallbacks](https://www.edenai.co/docs/v3/llms/fallback) +- [Eden AI pricing](https://www.edenai.co/pricing) +- [Pi GitHub](https://github.com/earendil-works/pi) diff --git a/qwen-code.md b/qwen-code.md new file mode 100644 index 0000000..0cef378 --- /dev/null +++ b/qwen-code.md @@ -0,0 +1,100 @@ +# Qwen Code + Eden AI + +Connect [Qwen Code](https://github.com/QwenLM/qwen-code) to Eden AI and route Alibaba's terminal agent through **700+ models** with smart routing, automatic fallbacks, and a single API key. + +> Get your Eden AI key at [app.edenai.run](https://app.edenai.run/) → **API Keys**. + +--- + +## 1. Install Node.js + +Qwen Code requires **Node.js 22+**. + +```bash +# Check your version +node --version # must be v22.x or newer +``` + +If it's older, install via [nvm](https://github.com/nvm-sh/nvm): + +```bash +curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.1/install.sh | bash +nvm install 22 && nvm use 22 +``` + +## 2. Install Qwen Code + +```bash +npm install -g @qwen-code/qwen-code + +# Verify +qwen --version +``` + +## 3. Configure Eden AI (env variables) + +Qwen Code (a fork of Gemini CLI) reads OpenAI-compatible environment variables: + +```bash +export OPENAI_API_KEY="YOUR_EDEN_AI_API_KEY" +export OPENAI_BASE_URL="https://api.edenai.run/v3" +export OPENAI_MODEL="openai/gpt-4o-mini" +``` + +To make it persistent, add these to a project `.env` file or your shell profile. + +## 4. Run + +Interactive: + +```bash +qwen +``` + +Non-interactive (one-shot): + +```bash +qwen -p "Explain what this project does" +``` + +Every LLM call now flows through Eden AI — with built-in fallbacks, unified billing, and per-request cost visibility. + +--- + +## Using specific models + +Change `OPENAI_MODEL`, keyed by `provider/model`: + +| Model | Best for | +|---|---| +| `openai/gpt-4o-mini` | Fast and cheap | +| `anthropic/claude-sonnet-4-5` | Balanced reasoning | +| `anthropic/claude-opus-4-7` | Maximum capability | +| `openai/gpt-5` | OpenAI's frontier model | +| `google/gemini-2.5-pro` | Long context, multimodal | + +## Troubleshooting + +### `ReferenceError: File is not defined` +Your Node.js is too old. Qwen Code needs **Node 22+** — upgrade via nvm (step 1). + +### `401 Unauthorized` +Verify your Eden AI key at [app.edenai.run → API Keys](https://app.edenai.run/). + +### `model not found` +Use the `provider/model` format for `OPENAI_MODEL`, and set `OPENAI_BASE_URL` to exactly `https://api.edenai.run/v3`. + +## Uninstall + +```bash +npm uninstall -g @qwen-code/qwen-code +``` + +--- + +## Next steps + +- [Smart routing](https://www.edenai.co/docs/v3/llms/smart-routing) +- [Fallbacks](https://www.edenai.co/docs/v3/llms/fallback) +- [Eden AI pricing](https://www.edenai.co/pricing) +- [Qwen Code GitHub](https://github.com/QwenLM/qwen-code)