diff --git a/core/llm/autodetect.ts b/core/llm/autodetect.ts index c8511554b8b..1b6b49485f9 100644 --- a/core/llm/autodetect.ts +++ b/core/llm/autodetect.ts @@ -74,6 +74,7 @@ const PROVIDER_HANDLES_TEMPLATING: string[] = [ "nous", "zAI", "tensorix", + "api-route", // TODO add these, change to inverted logic so only the ones that need templating are hardcoded // Asksage.ts // Azure.ts @@ -133,6 +134,7 @@ const PROVIDER_SUPPORTS_IMAGES: string[] = [ "watsonx", "zAI", "tensorix", + "api-route", ]; const MODEL_SUPPORTS_IMAGES: RegExp[] = [ @@ -253,6 +255,7 @@ const PARALLEL_PROVIDERS: string[] = [ "scaleway", "minimax", "tensorix", + "api-route", ]; function llmCanGenerateInParallel(provider: string, model: string): boolean { diff --git a/core/llm/llms/ApiRoute.ts b/core/llm/llms/ApiRoute.ts new file mode 100644 index 00000000000..484bb458526 --- /dev/null +++ b/core/llm/llms/ApiRoute.ts @@ -0,0 +1,14 @@ +import OpenAI from "./OpenAI.js"; + +import type { LLMOptions } from "../../index.js"; + +class ApiRoute extends OpenAI { + static providerName = "api-route"; + static defaultOptions: Partial = { + apiBase: "https://global.api-route.com/v1/", + model: "claude-3-7-sonnet-20250219", + useLegacyCompletionsEndpoint: false, + }; +} + +export default ApiRoute; diff --git a/core/llm/llms/index.ts b/core/llm/llms/index.ts index 4978f0617f2..45c6906a3d1 100644 --- a/core/llm/llms/index.ts +++ b/core/llm/llms/index.ts @@ -59,6 +59,7 @@ import SambaNova from "./SambaNova"; import Scaleway from "./Scaleway"; import SiliconFlow from "./SiliconFlow"; import Tensorix from "./Tensorix"; +import ApiRoute from "./ApiRoute"; import TARS from "./TARS"; import TestLLM from "./Test"; import TextGenWebUI from "./TextGenWebUI"; @@ -125,6 +126,7 @@ export const LLMClasses = [ xAI, SiliconFlow, Tensorix, + ApiRoute, Scaleway, Relace, Inception, diff --git a/docs/customize/model-providers/more/apiroute.mdx b/docs/customize/model-providers/more/apiroute.mdx new file mode 100644 index 00000000000..90ca4d3bd5a --- /dev/null +++ b/docs/customize/model-providers/more/apiroute.mdx @@ -0,0 +1,93 @@ +--- +title: "API Route" +description: "Configure API Route with Continue to access Claude, GPT, DeepSeek, Gemini, and other models through an aggregated high-concurrency API gateway" +--- + +[API Route](https://www.api-route.com) is an OpenAI-compatible aggregating API gateway that provides high-availability, low-latency access to Claude, OpenAI, DeepSeek, Google Gemini, and other top-tier models with unified billing and developer tooling. + + + You can obtain your API key from the + [API Route Console](https://www.api-route.com/api-keys). + + +## Chat Model + +We recommend configuring **claude-3-7-sonnet-20250219** or **gpt-4o** as your chat model. + + + + ```yaml title="config.yaml" + name: My Config + version: 0.0.1 + schema: v1 + + models: + - name: Claude 3.7 Sonnet + provider: api-route + model: claude-3-7-sonnet-20250219 + apiKey: + roles: + - chat + ``` + + + ```json title="config.json" + { + "models": [ + { + "title": "Claude 3.7 Sonnet", + "provider": "api-route", + "model": "claude-3-7-sonnet-20250219", + "apiKey": "" + } + ] + } + ``` + + + +## Autocomplete Model + + + + ```yaml title="config.yaml" + name: My Config + version: 0.0.1 + schema: v1 + + models: + - name: DeepSeek V3 + provider: api-route + model: deepseek-chat + apiKey: + roles: + - autocomplete + ``` + + + ```json title="config.json" + { + "models": [ + { + "title": "DeepSeek V3", + "provider": "api-route", + "model": "deepseek-chat", + "apiKey": "" + } + ], + "tabAutocompleteModel": { + "title": "DeepSeek V3", + "provider": "api-route", + "model": "deepseek-chat", + "apiKey": "" + } + } + ``` + + + +## Embeddings Model + +API Route provides access to OpenAI and open-weight embedding models (e.g. `text-embedding-3-small`, `text-embedding-3-large`). + +[View the source](https://github.com/continuedev/continue/blob/main/core/llm/llms/ApiRoute.ts) diff --git a/docs/docs.json b/docs/docs.json index b7a1d83f13a..888de3a692d 100644 --- a/docs/docs.json +++ b/docs/docs.json @@ -105,6 +105,7 @@ { "group": "More Providers", "pages": [ + "customize/model-providers/more/apiroute", "customize/model-providers/more/asksage", "customize/model-providers/more/clawrouter", "customize/model-providers/more/deepseek", diff --git a/extensions/vscode/config_schema.json b/extensions/vscode/config_schema.json index fb3f4c61362..4b29c83dab5 100644 --- a/extensions/vscode/config_schema.json +++ b/extensions/vscode/config_schema.json @@ -236,7 +236,8 @@ "ovhcloud", "venice", "inception", - "tars" + "tars", + "api-route" ], "markdownEnumDescriptions": [ "### OpenAI\nUse gpt-4, gpt-3.5-turbo, or any other OpenAI model. See [here](https://openai.com/product#made-for-developers) to obtain an API key.\n\n> [Reference](https://docs.continue.dev/reference/Model%20Providers/openai)", @@ -289,7 +290,8 @@ "### OVHcloud AI Endpoints is a serverless inference API that provides access to a curated selection of models (e.g., Llama, Mistral, Qwen, Deepseek). It is designed with security and data privacy in mind and is compliant with GDPR. To get started, create an API key on the OVHcloud [AI Endpoints website](https://endpoints.ai.cloud.ovh.net/). For more information, including pricing, visit the OVHcloud [AI Endpoints product page](https://www.ovhcloud.com/en/public-cloud/ai-endpoints/).", "### Venice\n Venice.AI is a privacy-focused generative AI platform, allowing users to interact with open-source LLMs without storing any private user data.\nHosted models support the OpenAI API standard, providing seamless integration for users seeking privacy and flexibility.\nTo get started with the Venice API, either purchase a pro account, stake $VVV for daily inference allotments, or fund your account with USD.\nVisit the [API settings page](https://venice.ai/settings/api) or learn more at the [Venice API documentation](https://venice.ai/api).", "### Inception\n Inception Labs offer a new generation of diffusion-based LLMs.\nVisit the [API settings page](https://platform.inceptionlabs.ai/) or learn more at the [Inception docs](https://platform.inceptionlabs.ai/docs).", - "### TARS\nTARS is an OpenAI-compatible proxy router. To get started, obtain an API key and configure the provider in your config.json." + "### TARS\nTARS is an OpenAI-compatible proxy router. To get started, obtain an API key and configure the provider in your config.json.", + "### API Route\nAPI Route is an enterprise-grade OpenAI-compatible API aggregation platform providing access to Claude 3.7, DeepSeek V3/R1, GPT-4o, Gemini 2.5, Qwen, and more with global routing acceleration.\nTo get started, create an account and get an API key at [api-route.com](https://www.api-route.com).\n> [Models](https://www.api-route.com)" ], "type": "string" }, @@ -2873,7 +2875,8 @@ "tensorix", "function-network", "scaleway", - "ovhcloud" + "ovhcloud", + "api-route" ] }, "model": { @@ -2937,7 +2940,8 @@ "nvidia", "gemini", "siliconflow", - "tensorix" + "tensorix", + "api-route" ] } }, diff --git a/gui/public/logos/apiroute.png b/gui/public/logos/apiroute.png new file mode 100644 index 00000000000..aff30ce518d Binary files /dev/null and b/gui/public/logos/apiroute.png differ diff --git a/gui/src/pages/AddNewModel/configs/providers.ts b/gui/src/pages/AddNewModel/configs/providers.ts index 9e2aba08c5c..f7f7b57a9fb 100644 --- a/gui/src/pages/AddNewModel/configs/providers.ts +++ b/gui/src/pages/AddNewModel/configs/providers.ts @@ -1270,6 +1270,27 @@ To get started, [register](https://dataplatform.cloud.ibm.com/registration/stepo packages: [{ ...models.AUTODETECT }], apiKeyUrl: "https://app.tensorix.ai", }, + apiroute: { + title: "API Route", + provider: "api-route", + icon: "apiroute.png", + description: + "API Route is an OpenAI-compatible API gateway providing access to Claude, GPT, DeepSeek, Gemini, and more.", + longDescription: + "To get started with API Route, create an account and obtain an API key from [API Route](https://www.api-route.com/api-keys).", + tags: [ModelProviderTags.RequiresApiKey, ModelProviderTags.OpenSource], + collectInputFor: [ + { + inputType: "text", + key: "apiKey", + label: "API Key", + placeholder: "Enter your API Route key", + required: true, + }, + ], + packages: [{ ...models.AUTODETECT }], + apiKeyUrl: "https://www.api-route.com/api-keys", + }, venice: { title: "Venice", provider: "venice", diff --git a/packages/openai-adapters/src/index.ts b/packages/openai-adapters/src/index.ts index 52fb2d33a0c..490719aa609 100644 --- a/packages/openai-adapters/src/index.ts +++ b/packages/openai-adapters/src/index.ts @@ -176,6 +176,8 @@ export function constructLlmApi(config: LLMConfig): BaseLlmApi | undefined { return openAICompatible("https://api.function.network/v1/", config); case "tensorix": return openAICompatible("https://api.tensorix.ai/v1/", config); + case "api-route": + return openAICompatible("https://global.api-route.com/v1/", config); case "openrouter": return new OpenRouterApi(config); case "clawrouter": diff --git a/packages/openai-adapters/src/types.ts b/packages/openai-adapters/src/types.ts index 14b9512f75b..ab72ad7c749 100644 --- a/packages/openai-adapters/src/types.ts +++ b/packages/openai-adapters/src/types.ts @@ -60,6 +60,7 @@ export const OpenAIConfigSchema = BasePlusConfig.extend({ z.literal("zAI"), z.literal("scaleway"), z.literal("tensorix"), + z.literal("api-route"), z.literal("ncompass"), z.literal("relace"), z.literal("huggingface-inference-api"),