Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions core/llm/llms/OpenAI-compatible.vitest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ import NCompass from "./NCompass.js";
import LlamaStack from "./LlamaStack.js";
import Nebius from "./Nebius.js";
import OVHcloud from "./OVHcloud.js";
import YApi from "./YApi.js";

// Base OpenAI tests
import { afterEach, describe, expect, test, vi } from "vitest";
Expand Down Expand Up @@ -457,3 +458,8 @@ createOpenAISubclassTests(OVHcloud, {
providerName: "ovhcloud",
defaultApiBase: "https://oai.endpoints.kepler.ai.cloud.ovh.net/v1/",
});

createOpenAISubclassTests(YApi, {
providerName: "y-api",
defaultApiBase: "https://api.y-api.bestvirtualgoods.com/v1/",
});
14 changes: 14 additions & 0 deletions core/llm/llms/YApi.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import OpenAI from "./OpenAI.js";

import type { LLMOptions } from "../../index.js";

class YApi extends OpenAI {
static providerName = "y-api";
static defaultOptions: Partial<LLMOptions> = {
apiBase: "https://api.y-api.bestvirtualgoods.com/v1/",
model: "deepseek/deepseek-v4-flash",
useLegacyCompletionsEndpoint: false,
};
}

export default YApi;
2 changes: 2 additions & 0 deletions core/llm/llms/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ import Vllm from "./Vllm";
import Voyage from "./Voyage";
import WatsonX from "./WatsonX";
import xAI from "./xAI";
import YApi from "./YApi";
import zAI from "./zAI";
export const LLMClasses = [
Anthropic,
Expand Down Expand Up @@ -132,6 +133,7 @@ export const LLMClasses = [
LlamaStack,
TARS,
zAI,
YApi,
];

export async function llmFromDescription(
Expand Down
20 changes: 20 additions & 0 deletions core/llm/toolSupport.ts
Original file line number Diff line number Diff line change
Expand Up @@ -485,6 +485,26 @@ export const PROVIDER_TOOL_SUPPORT: Record<string, (model: string) => boolean> =

return false;
},
"y-api": (model) => {
// Y-API relays to several labs, so support is per-model. Verified against
// the live API on 2026-09-16 by sending one request with a single
// function tool and checking for a tool_calls response.
//
// The openai/* models do accept tools, but only when reasoning_effort is
// set explicitly -- with the parameter absent the upstream rejects the
// request ("Function tools with reasoning_effort are not supported",
// 3/3 calls), and with it present the tool call succeeds (3/3 at
// low/none/high). Continue has no way to send reasoning_effort, so
// advertising tools for them would only produce a 400 in agent mode.
const unsupported = [
"openai/gpt-6-astra",
"openai/gpt-5.6-sol",
"openai/gpt-5.6-terra",
"openai/gpt-5.6-luna",
];

return !unsupported.includes(model.toLowerCase());
},
};

export function isRecommendedAgentModel(modelName: string): boolean {
Expand Down
108 changes: 108 additions & 0 deletions docs/customize/model-providers/more/y-api.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,108 @@
---
title: "Y-API"
description: "Configure Y-API with Continue to access DeepSeek, GLM, Kimi, Qwen, GPT, and other models through a single OpenAI-compatible endpoint"
---

[Y-API](https://y-api.bestvirtualgoods.com) is an OpenAI-compatible API gateway that provides access to DeepSeek, GLM, Kimi, Qwen, Tencent Hunyuan, Xiaomi MiMo, and OpenAI models. One balance and one API key cover every model, with no subscription and no monthly minimum.

<Info>
You can get an API key from
[y-api.bestvirtualgoods.com](https://y-api.bestvirtualgoods.com). The full
model list and per-model prices are on the
[pricing page](https://y-api.bestvirtualgoods.com/pricing).
</Info>

## Chat Model

We recommend configuring **deepseek/deepseek-v4-pro** as your chat model.

<Tabs>
<Tab title="YAML">
```yaml title="config.yaml"
name: My Config
version: 0.0.1
schema: v1

models:
- name: DeepSeek V4 Pro
provider: y-api
model: deepseek/deepseek-v4-pro
apiKey: <YOUR_Y_API_API_KEY>
roles:
- chat
- edit
- apply
```
</Tab>
<Tab title="JSON">
```json title="config.json"
{
"models": [
{
"title": "DeepSeek V4 Pro",
"provider": "y-api",
"model": "deepseek/deepseek-v4-pro",
"apiKey": "<YOUR_Y_API_API_KEY>"
}
]
}
```
</Tab>
</Tabs>

## Autocomplete Model

**deepseek/deepseek-v4-flash** is free of charge on Y-API, which makes it a good default for autocomplete.

<Tabs>
<Tab title="YAML">
```yaml title="config.yaml"
name: My Config
version: 0.0.1
schema: v1

models:
- name: DeepSeek V4 Flash
provider: y-api
model: deepseek/deepseek-v4-flash
apiKey: <YOUR_Y_API_API_KEY>
roles:
- autocomplete
```
</Tab>
<Tab title="JSON">
```json title="config.json"
{
"models": [
{
"title": "DeepSeek V4 Flash",
"provider": "y-api",
"model": "deepseek/deepseek-v4-flash",
"apiKey": "<YOUR_Y_API_API_KEY>"
}
],
"tabAutocompleteModel": {
"title": "DeepSeek V4 Flash",
"provider": "y-api",
"model": "deepseek/deepseek-v4-flash",
"apiKey": "<YOUR_Y_API_API_KEY>"
}
}
```
</Tab>
</Tabs>

## Agent Mode

Y-API passes function tools through to the upstream model. Verified against the live API on 2026-09-16 by sending one request with a single function tool and checking for a `tool_calls` response:

- **Works**: `deepseek/deepseek-v4-flash`, `deepseek/deepseek-v4-flash-0731`, `deepseek/deepseek-v4-pro`, `deepseek/deepseek-v4.1-flash`, `z-ai/glm-5.2`, `z-ai/glm-5.3`, `z-ai/glm-5.3-flash`, `moonshotai/kimi-k3`, `tencent/hy3`, `xiaomi/mimo-v2.5`.
- **Not usable for tools**: `openai/gpt-6-astra`, `openai/gpt-5.6-sol`, `openai/gpt-5.6-terra`, `openai/gpt-5.6-luna`. These accept tools only when `reasoning_effort` is set explicitly — with the parameter absent the upstream rejects the request with `Function tools with reasoning_effort are not supported`, and with it present the tool call succeeds. Continue does not send `reasoning_effort`, so these four are reported as not supporting native tools.

The `openai/gpt-*` models also require `max_completion_tokens` instead of `max_tokens`; Continue handles that automatically.

## Embeddings Model

Y-API serves chat models only, so there is no embeddings model to configure.

[View the source](https://github.com/continuedev/continue/blob/main/core/llm/llms/YApi.ts)
5 changes: 5 additions & 0 deletions packages/openai-adapters/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,11 @@ 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 "y-api":
return openAICompatible(
"https://api.y-api.bestvirtualgoods.com/v1/",
config,
);
case "openrouter":
return new OpenRouterApi(config);
case "clawrouter":
Expand Down
1 change: 1 addition & 0 deletions packages/openai-adapters/src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ export const OpenAIConfigSchema = BasePlusConfig.extend({
z.literal("ncompass"),
z.literal("relace"),
z.literal("huggingface-inference-api"),
z.literal("y-api"),
]),
});
export type OpenAIConfig = z.infer<typeof OpenAIConfigSchema>;
Expand Down
Loading