← Back to PRs

#15742: feat: add Edgee AI Gateway as provider

by manthis open 2026-02-13 20:20 View on GitHub →
docs cli commands agents size: L
## Summary Adds [Edgee](https://www.edgee.ai/) as a new LLM provider in OpenClaw. Edgee is an AI Gateway that exposes 200+ models through a single OpenAI-compatible API, with built-in token compression (up to 50% cost reduction), intelligent routing, automatic failovers, and full observability. ## Why Edgee? - **OpenAI-compatible API** — drop-in replacement, same `provider/model` format as OpenRouter - **Token compression** — automatic, transparent cost savings on prompts - **Multi-provider routing** — access OpenAI, Anthropic, Google, Mistral, etc. through one gateway - **Automatic failovers** — if one provider goes down, Edgee reroutes - **Cost observability** — track usage per model, per app, per environment - **BYOK support** — use Edgee's keys or bring your own ## What's included **Provider integration:** - `buildEdgeeProvider()` with base URL `https://api.edgee.ai/v1`, OpenAI-completions API - `EDGEE_API_KEY` environment variable support - Auth profile + credential management (`setEdgeeApiKey()`) **Onboarding flow:** - `edgee-api-key` auth choice in interactive and non-interactive onboarding - Edgee group in provider selection UI - Default model: `edgee/openai/gpt-4o` - CLI flag `--edgee-api-key` for non-interactive setup **Documentation:** - New `docs/providers/edgee.md` with setup instructions, model format, and features - Added to providers index **Tests:** - 16 dedicated test cases covering: provider builder, auth handler, API routing, auth options, preferred provider mapping, config core, credentials, env mapping, config IO, and non-interactive onboarding - All Edgee tests passing ✅ ## Files changed - **14 files modified** — existing provider/auth/config/onboarding infrastructure - **13 files created** — new Edgee handler, tests, and documentation - **+745 lines** added ## How to test ```bash # Set your Edgee API key export EDGEE_API_KEY="your-key" # Run onboarding with Edgee openclaw setup --auth-choice edgee-api-key --edgee-api-key "your-key" # Or select Edgee interactively during setup openclaw setup ``` ## Notes - Follows the exact same pattern as existing custom providers (Venice, Together, Moonshot) - No changes to upstream `pi-ai` library required - API is fully OpenAI-compatible, no custom headers needed - AI-assisted PR (Claude) — fully tested and reviewed ✅ <!-- greptile_comment --> <h3>Greptile Summary</h3> Adds Edgee AI Gateway as a new OpenClaw provider following the same integration patterns as existing custom providers (Venice, Together, Moonshot). Edgee provides OpenAI-compatible API access to 200+ models through `https://api.edgee.ai/v1` with built-in token compression. **Implementation:** - Provider config with `openai-completions` API and 3 pre-configured models (`openai/gpt-4o`, `anthropic/claude-sonnet-4-20250514`, `google/gemini-2.5-flash`) - Auth handler via `EDGEE_API_KEY` environment variable and auth profiles - Default model: `edgee/openai/gpt-4o` - Interactive and non-interactive onboarding flows with `--edgee-api-key` CLI flag - 16 dedicated test cases covering all integration points - Documentation following provider docs structure **Key changes:** - `buildEdgeeProvider()` in `src/agents/models-config.providers.ts:479-513` - `applyAuthChoiceEdgee()` handler in `src/commands/auth-choice.apply.edgee.ts` - `setEdgeeApiKey()` credential storage in `src/commands/onboard-auth.credentials.ts:110-120` - Config functions `applyEdgeeConfig()` and `applyEdgeeProviderConfig()` in `src/commands/onboard-auth.config-core.ts:141-180` - Environment variable mapping, auth choice options, and preferred provider registration All changes follow the established provider integration pattern. Tests are comprehensive and passing. <h3>Confidence Score: 5/5</h3> - This PR is safe to merge with minimal risk - it follows established patterns exactly and has comprehensive test coverage - The implementation follows the exact same pattern as existing custom providers (Venice, Together, Moonshot) with no deviations. All integration points are covered: provider builder, auth handler, config functions, environment variable mapping, CLI flags, onboarding flows, and 16 dedicated tests. Code is clean, well-structured, and consistent with repository conventions - No files require special attention <sub>Last reviewed commit: e842b80</sub> <!-- greptile_other_comments_section --> <sub>(3/5) Reply to the agent's comments like "Can you suggest a fix for this @greptileai?" or ask follow-up questions!</sub> <!-- /greptile_comment -->

Most Similar PRs