feat: add API Route as an LLM provider - #13264
Open
DennyHo0917 wants to merge 1 commit into
Open
Conversation
Contributor
|
All contributors have signed the CLA ✍️ ✅ |
Author
|
I have read the CLA Document and I hereby sign the CLA |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Hey 👋
I've added API Route as a new provider option. API Route is an OpenAI-compatible API aggregation platform providing access to Claude 3.7, DeepSeek V3/R1, GPT-4o, Gemini 2.5, Qwen, and more via a single API key with global routing acceleration.
What's in the PR
Following the established pattern for OpenAI-compatible providers (e.g. Tensorix, SiliconFlow, Venice):
core/llm/llms/ApiRoute.ts— new provider class extendingOpenAIwith defaultapiBase: "https://global.api-route.com/v1/"core/llm/llms/index.ts— registered inLLMClassescore/llm/autodetect.ts— added to templating, image support, and parallel generationpackages/openai-adapters/— added totypes.tsandindex.tsgui/src/pages/AddNewModel/configs/providers.ts— added to Add Model UI withAUTODETECTgui/public/logos/apiroute.png— provider logodocs/customize/model-providers/more/apiroute.mdx&docs/docs.json— documentation guide for Chat, Autocomplete, and Embeddingsextensions/vscode/config_schema.json— VS Code config schema and descriptionsUsage
{ "models": [ { "title": "Claude 3.7 Sonnet", "provider": "api-route", "model": "claude-3-7-sonnet-20250219", "apiKey": "YOUR_API_ROUTE_KEY" } ] }Or via YAML:
Users can also pick API Route directly from the "Add Model" GUI with auto-detection.
Checklist
Please let me know if any adjustments are needed!