Conversation
Y-API (https://y-api.bestvirtualgoods.com) is an OpenAI-compatible gateway fronting DeepSeek, GLM, Kimi, Qwen, Tencent Hunyuan, Xiaomi MiMo, and OpenAI models behind one key and one balance. Its model IDs are namespaced (`deepseek/deepseek-v4-pro`, `z-ai/glm-5.3`, ...), so they pass through unchanged and no model-name translation is needed. Follows the CONTRIBUTING checklist for a new LLM provider: - `core/llm/llms/YApi.ts` extends `OpenAI`, default `apiBase` set to the gateway, default model `deepseek/deepseek-v4-flash` (free on the service, and the model the service's own docs use in their examples). - Registered in the `LLMClasses` array. - Documentation page at `docs/customize/model-providers/more/y-api.mdx`. - Provider added to `packages/openai-adapters` so the CLI path resolves it. - Coverage via the shared `createOpenAISubclassTests` helper. `PROVIDER_TOOL_SUPPORT` is populated because the default for an unlisted provider is `false`, which would silently disable agent mode. Support was measured against the live API rather than assumed, one request per model with a single function tool, checking for a `tool_calls` response: - Tools work: the four DeepSeek models, the three GLM models, `moonshotai/kimi-k3`, `tencent/hy3`, `xiaomi/mimo-v2.5`. - The four `openai/*` models accept tools only when `reasoning_effort` is set explicitly. With the parameter absent the upstream returns `Function tools with reasoning_effort are not supported` (3/3 calls); with it present the tool call succeeds (3/3 at each of low/none/high). Continue has no way to send `reasoning_effort`, so these four report no native tool support rather than advertising a capability that 400s in agent mode. Verified locally: - `core`: `tsc -p ./ --noEmit` clean; `vitest run llm/llms/OpenAI-compatible.vitest.ts` 218 passed, including the seven generated `y-api` cases (provider name, default API base, chat / streamChat / complete / streamComplete request shape, embeddings). - `packages/openai-adapters`: `npm run build` (tsc) clean. - Prettier clean on all changed files. The jest suite could not be run in this environment (its global setup hits a sandbox bulk-delete guard, and `test/jest.setup-after-env.js` fails to load `node-fetch` under this Node build), so `llm/toolSupport.test.ts` is typechecked but not executed here.
|
I have read the CLA Document and I hereby sign the CLA |
|
All contributors have signed the CLA ✍️ ✅ |
|
A note on the three non-green checks, since none of them come from this change.
The job dies in setup, before any Continue code runs — the third-party
Everything this change actually touches is green: |
What
Adds Y-API (
y-api) as an OpenAI-compatible provider.https://api.y-api.bestvirtualgoods.com/v1/It is a gateway that fronts DeepSeek, GLM, Kimi, Qwen, Tencent Hunyuan, Xiaomi MiMo, and OpenAI models behind one key and one balance. Model IDs are namespaced (
deepseek/deepseek-v4-pro,z-ai/glm-5.3,moonshotai/kimi-k3, …), so they pass through unchanged — no model-name translation is needed for this provider.Changes
Follows the CONTRIBUTING checklist for adding an LLM provider:
core/llm/llms/YApi.tsOpenAI;apiBaseand default model set.core/llm/llms/index.tsLLMClasses.core/llm/llms/OpenAI-compatible.vitest.tscreateOpenAISubclassTestshelper.core/llm/toolSupport.tsPROVIDER_TOOL_SUPPORT["y-api"]— see below.packages/openai-adapters/src/types.ts,.../index.tsconstructLlmApicase, so the CLI path resolves it.docs/customize/model-providers/more/y-api.mdxThe default model is
deepseek/deepseek-v4-flash: it is free of charge on the service (no credit is deducted), and it is the model the service's own documentation uses in its examples.Tool support
PROVIDER_TOOL_SUPPORTis populated deliberately: the default for an unlisted provider isfalse, which would silently disable agent mode for every Y-API model.Support was measured against the live API rather than assumed — one request per model with a single function tool, checking for a
tool_callsresponse:moonshotai/kimi-k3,tencent/hy3, andxiaomi/mimo-v2.5.openai/*models accept tools only whenreasoning_effortis set explicitly. With the parameter absent the upstream returnsFunction tools with reasoning_effort are not supported(3/3 calls); with it present the tool call succeeds (3/3 at each oflow,none, andhigh). The error text reads as if the two are mutually exclusive, but the behaviour is the opposite — the rejection fires on absence, not presence. Continue has no way to sendreasoning_effort, so these four report no native tool support rather than advertising a capability that would 400 in agent mode.Two related facts, for anyone touching this provider later:
openai/gpt-6-astrarequiresmax_completion_tokensrather thanmax_tokens.OpenAI.isOSeriesOrGpt5PlusModelalready matchesgpt-[5-9], so Continue handles this automatically — no provider-specific code was needed.qwen/qwen3.8-flashis advertised on the service's pricing page but is absent fromGET /v1/modelsand returns503 No available channel for model qwen/qwen3.8-flash under group y-api (distributor). It is not referenced anywhere in this PR.Verification
Run locally on Node 22.22.2:
core:tsc -p ./ --noEmit— clean.core:vitest run llm/llms/OpenAI-compatible.vitest.ts— 218 passed. The seven generatedy-apicases all pass:packages/openai-adapters:npm run build(tsc) — clean.Prettier — clean on every changed file.
Not run: the jest suite. Its global setup calls
fs.rmSynconcore/test/.continue-test, which this sandbox blocks, andtest/jest.setup-after-env.jsfails to loadnode-fetch(SyntaxError: Cannot use import statement outside a module) under this Node build. Sollm/toolSupport.test.tsis typechecked but not executed here; I'd expect CI to cover it.CLA
I'll post the CLA signature comment on this PR.