Skip to content

feat(provider): add Y-API - #7235

Open
jiweiyeah wants to merge 3 commits into
anomalyco:devfrom
jiweiyeah:feat/provider-y-api
Open

jiweiyeah wants to merge 3 commits into
anomalyco:devfrom
jiweiyeah:feat/provider-y-api

Conversation

@jiweiyeah

@jiweiyeah jiweiyeah commented Sep 16, 2026

Copy link
Copy Markdown

What

Adds Y-API (y-api) as an OpenAI-compatible provider, with the 15 models it currently serves. Every model is a base_model override — Y-API is a relay, not a lab, so no new models/ entries are needed (all 15 lab entries already exist).

Sources for the data

Model list — an authenticated GET /v1/models on 2026-09-16, cross-checked against the public pricing page.

Cost — USD cash price. The public catalog quotes account credit (e.g. DeepSeek V4 Pro at 0.5 / 1.0), and credit is topped up at a promotional 20x rate, so every cost value here is credit / 20 (DeepSeek V4 Pro → 0.025 / 0.05). That makes the figures comparable to other providers' list prices, which is what cost is for.

The 20x rate is stated by the service itself, in two places, both read 2026-09-16:

Both quotes are reproduced in the provider.toml header, with the date, because the conversion is not derivable from the file. Note the rate is advertised as limited-time: when it reverts to 1:10, every cost here doubles. The service quotes no non-USD price, so there is no FX conversion in the chain.

reasoning_options — read off the live API rather than assumed, because this host's supported set differs from the first-party entries for three models:

Model Supported reasoning_effort on this host Notes
openai/gpt-6-astra low, medium, high, xhigh No none, no max. Upstream error text enumerates the supported values.
openai/gpt-5.6-sol / -terra / -luna none, low, medium, high, xhigh max400 Unsupported value: 'reasoning_effort' does not support 'max' with this model. Supported values are: 'none', 'low', 'medium', 'high', and 'xhigh'.
deepseek/deepseek-v4.1-flash low, high, max authored, though medium/xhigh are accepted See below.

So max is omitted for all four OpenAI models here even though providers/openai/models/… lists it — this host's API rejects it, and reasoning_options describes this host's API.

On deepseek-v4.1-flash: the host accepts medium and xhigh without error but does not act on them distinctly, so only the lab baseline set is authored, matching the other Y-API DeepSeek Flash entries. usage.completion_tokens_details.reasoning_tokens, n=3 per level:

low    84/116/78      medium 108/108/104    high   109/139/104
xhigh  131/87/132     max    140/134/128

medium's entire observed range (104-108) sits inside high's (104-139), and xhigh's spread is wider than the gap to either neighbour. As a control, sibling deepseek-v4-flash-0731 on the same host, reasoning_content length, n=5 per level, gives means of low 826 / medium 442 / high 453 / xhigh 648 / max 1801 — not monotonic at all. An effort level a caller cannot observe is worse than not offering it.

Two further request-shape facts, for reviewers:

  • openai/gpt-6-astra also rejects max_tokens and requires max_completion_tokens. I did not model this — I did not find a field in the schema that expresses "this model needs max_completion_tokens", so I am flagging it here instead of inventing one.
  • deepseek/deepseek-v4-flash is a reasoning model here: thinking.type = "disabled" suppresses reasoning_content, and reasoning_effort accepts low|high|max. That is why the DeepSeek family carries toggle + effort rather than effort alone.

interleaved — authored from the field this host actually emits, which is not always the lab's reasoning_content. Each declaration was checked with at least 6 identical calls on 2026-09-16:

Model reasoning_content reasoning_details Authored
deepseek/deepseek-v4-pro 0 / 14 14 / 14 reasoning_details
z-ai/glm-5.2 0 / 10 8 / 10 reasoning_details
moonshotai/kimi-k3 2 / 10 8 / 10 reasoning_details
z-ai/glm-5.3 10 / 10 0 / 10 reasoning_content
z-ai/glm-5.3-flash 10 / 10 0 / 10 reasoning_content
tencent/hy3 6 / 6 0 / 6 reasoning_content
xiaomi/mimo-v2.5 6 / 6 0 / 6 reasoning_content
deepseek/deepseek-v4-flash, -0731, -v4.1-flash consistent reasoning_content

reasoning_details entries are [{type: "reasoning.text", text: "…"}]; reasoning (a plain string) also accompanies it but is not a schema-valid interleaved.field, so it is not what gets authored.

The four OpenAI models are omitted rather than guessed at: across 6 calls each, none of reasoning_content, reasoning, or reasoning_details was present. Their leading comments say so, so the omission is explicit rather than an oversight.

qwen/qwen3.8-flash (added in a follow-up commit)

This model was left out of the first commit. On 2026-09-16 it was advertised on the pricing page but absent from GET /v1/models, and calling it returned:

503 No available channel for model qwen/qwen3.8-flash under group y-api (distributor)

It has since come back — 5/5 200 on 2026-09-17, and the catalog is now 15 models — so it is included. Listing a model that cannot be called would be worse than omitting it; so would continuing to omit one that can.

Three of its fields are authored from this host's behaviour rather than inherited from the Alibaba Cloud entry:

  • reasoning_options — an unlisted effort returns the supported set verbatim, so the set is read off the wire rather than from Alibaba's docs:

    Unexpected reasoning effort minimal. Supported types are xhigh (default), medium, and low.
    

    So low|medium|xhigh. none also answered 200 5/5, but it is not in that enumeration, and I could not resolve the discrepancy before hitting the request cap described below — so it is not authored.

  • [limit] context = 262144 — the only limit override in this PR. The Alibaba Cloud entry advertises 1M, but this host rejects anything longer:

    The input (2000052 tokens) is longer than the model's context length (262144 tokens).
    

    Inheriting the base value would overstate the window by ~4x. The other 14 models inherit, and I checked that their base limits are within rounding of what this host actually serves (1,000,000 / 1,048,576 against a measured 1,048,544).

  • No [interleaved] — this host returns the trace as a plain reasoning string (message keys are content/reasoning/role/tool_calls), which is not a schema-valid interleaved.field. Same reason the four OpenAI models omit it.

Limit on the effort sweep

The remaining effort values (high, xhigh, max, no_think) could not be re-checked. The key hit this host's trial-tier cap of 500 requests / 1440 minutes partway through the sweep (您已达到请求数限制:1440分钟内最多请求500次), so those probes returned the cap error rather than an effort rejection and carry no signal. low and medium were confirmed 200 before the cap; minimal produced the enumeration above. Flagging this rather than presenting an incomplete sweep as a complete one.

Validation

  • bun validatepasses. Resolves to 15 models under y-api. All inherit name, modalities etc. from their base models; only qwen/qwen3.8-flash overrides limit, for the reason above.
  • bun run test — 337 pass, 7 fail. All 7 are pre-existing and unrelated to this change: I reproduced the identical 7 failures on a clean tree (git stash -u), with the same names:
    • catalog generation > repository open-weight model metadata includes weights links
    • inherits Hyper reasoning when API omits reasoning metadata
    • DeepInfra preserves live modalities for new base models
    • syncs the last LLM Gateway case variant without mixing source records
    • missing reasoning controls open issues without deleting existing models or blocking valid ones
    • snapshot exports providers, models, generatedAt, and a default catalog
    • snapshot entrypoint is self-contained
  • Diff is additive only: providers/y-api/ (17 files), no changes to models/, models.json, or labs/.

Logo

Square 24×24 viewBox, currentColor only, no fixed dimensions — the site's brand mark (the seal with the Y, plus the accent bar) with the colour dropped, since currentColor cannot express the two-tone original.

Measurement note

All probes above go through curl with a browser User-Agent. Python's urllib is blocked at the edge with 403 error code: 1010, so the numbers in this PR come from curl, not from a scripted HTTP client.

Adds the Y-API OpenAI-compatible gateway with the 14 models it currently
serves, all as base_model overrides.

- Model list: authenticated GET /v1/models (2026-09-16)
- Pricing: https://y-api.bestvirtualgoods.com/pricing
- Costs are USD cash price (credit price / promotional 20x top-up rate)
- reasoning_options and interleaved verified against the live API
@github-actions

Copy link
Copy Markdown
Contributor

Action items

  • [medium] [possible mistake] providers/y-api/models/deepseek/deepseek-v4.1-flash.toml:126 - Check: Relay reasoning_options must follow the lab/same-surface baseline for the underlying model, and extra effort levels need host evidence of a real distinct effect (AGENTS.md Reasoning options; audit skill evidence bar). Why: First-party DeepSeek V4.1 Flash is toggle + low|high|max (providers/deepseek/models/deepseek-flash.toml, deepseek-v4-flash.toml), and this PR’s own sibling Flash entries use that same set. This file adds medium and xhigh without the kind of rejection/meaningfulness evidence the PR body gives for the OpenAI models, so callers may be offered non-distinct or mapped-away levels. Action: Re-verify on this host that medium and xhigh are accepted and change reasoning depth relative to low/high/max; if not, align to ["low", "high", "max"] like the lab and the other Y-API DeepSeek Flash files.
  • [medium] [possible mistake] providers/y-api/models/deepseek/deepseek-v4-pro.toml:106 - Check: Provider-specific interleaved should be authored when this host exposes a reasoning side channel. Why: Lab and most peers set [interleaved] field = "reasoning_content" for DeepSeek V4 Pro, and every other Y-API DeepSeek Flash entry in this PR does the same, but Pro omits it with no comment that reasoning text is absent (unlike the OpenAI files). That risks under-describing the response shape if reasoning_content is present. Action: Confirm the live Pro response: if reasoning text is returned, add the matching [interleaved] field; if not, document that explicitly in the leading comment so the omission is intentional.
  • [low] [possible mistake] providers/y-api/provider.toml:301 - Check: Costs must be USD/MTok with conversion basis clear enough to review. Why: All paid costs are credit / 20 from a promotional top-up rate. That is a material transform (e.g. Pro 0.025/0.05) and will drift or be wrong if the public page is already cash USD or the promo rate changes. Action: In the PR body (or leading comment), point to the specific pricing/top-up text that establishes the 20× cash→credit rate and state the access date so reviewers can confirm the conversion.

Addresses the review on anomalyco#7235.

- deepseek/deepseek-v4-pro: author `[interleaved] field = "reasoning_details"`.
  The review was right that reasoning text is returned. Re-probed at n=14:
  reasoning_content appeared 0/14 times, reasoning_details
  ({type: "reasoning.text"}) 14/14. The earlier "unstable across 3 samples"
  note was an artefact of the sample size. The lab uses reasoning_content;
  this host does not, so the override describes the host.

- deepseek/deepseek-v4.1-flash: drop medium and xhigh, matching the lab
  baseline and the sibling Y-API DeepSeek Flash entries. The host accepts
  both without error but does not act on them distinctly: medium's full
  observed range (104-108 reasoning tokens) sits inside high's (104-139),
  and the sibling flash-0731 is non-monotonic across the same set.

- z-ai/glm-5.2: field was reasoning_content, which this host returned on
  0 of 10 calls. It returns reasoning_details on 8 of 10. Corrected. Found
  by re-checking every [interleaved] declaration at n>=6, not only the one
  flagged.

- provider.toml: cite the two pages that state the 20x credit rate, with the
  access date, so the cost transform is reviewable. Also note the rate is
  advertised as limited-time (reverts to 1:10, doubling every cost).

Re-verified: bun validate passes; bun run test still 337 pass / 7 fail, the
same 7 pre-existing failures. All other [interleaved] declarations
re-confirmed at n>=6: hy3 and mimo-v2.5 reasoning_content 6/6; glm-5.3 and
glm-5.3-flash reasoning_content 10/10; kimi-k3 reasoning_details 8/10; the
four OpenAI models expose no side channel (0/6), so omitting the field there
is correct.
@jiweiyeah

Copy link
Copy Markdown
Author

All three items addressed in 5c101ec. Thank you — the second one caught a real bug in a file the review didn't flag.

deepseek-v4-pro — reasoning text is returned; added [interleaved].
You were right, and my "unstable across 3 samples" note was an artefact of n=3. Re-probed at n=14, one prompt, reasoning_effort: high:

field present
reasoning_content 0 / 14
reasoning 14 / 14 (string)
reasoning_details 14 / 14 ([{type: "reasoning.text"}])

So the field is authored, but as reasoning_details rather than the lab's reasoning_content — this host does not emit reasoning_content for this model at all. Per "classify the host, not the npm package", the override describes the host. Both values are in the schema enum, so this validates.

deepseek-v4.1-flash — aligned to ["low", "high", "max"].
The host accepts medium and xhigh without error, but does not act on them distinctly. usage.completion_tokens_details.reasoning_tokens, n=3 per level:

low    84/116/78      medium 108/108/104    high   109/139/104
xhigh  131/87/132     max    140/134/128

medium's entire range (104-108) sits inside high's (104-139), and xhigh's spread is wider than the gap to either neighbour — nothing separates them. As a control, sibling deepseek-v4-flash-0731 on the same host, reasoning_content length, n=5 per level: means low 826 / medium 442 / high 453 / xhigh 648 / max 1801, which is not monotonic at all. So the file now carries the lab baseline set, same as its siblings.

I also tried to get upstream to enumerate the supported set by sending an invalid value, but this host does not forward the upstream error text — it returns an opaque openai_error (or Inference request failed.), so there was nothing to quote. That is why the evidence above is behavioural rather than error-text.

provider.toml — conversion basis now cited.
The 20x rate is stated by the service in two places, both read 2026-09-16:

Both now appear verbatim in the header comment, along with the access date and the consequence: the rate is advertised as limited-time, so when it reverts to 1:10 every cost in this PR doubles. The service quotes no non-USD price, so there is no FX conversion in the chain.


One more bug, found by re-checking every [interleaved] in the PR rather than only the flagged one: z-ai/glm-5.2 declared reasoning_content, which this host returned on 0 of 10 calls. It returns reasoning_details on 8 of 10 (the other 2 carry no side channel). Corrected to reasoning_details.

Re-confirmed at n>=6 after the change: tencent/hy3 and xiaomi/mimo-v2.5reasoning_content 6/6; z-ai/glm-5.3 and glm-5.3-flashreasoning_content 10/10; moonshotai/kimi-k3reasoning_details 8/10. The four OpenAI models expose no side channel at all (0/6 across all three candidate fields), so omitting [interleaved] there is correct and their leading comments already say so.

bun validate passes. bun run test is unchanged at 337 pass / 7 fail — the same 7 pre-existing failures listed in the PR description.

@github-actions

Copy link
Copy Markdown
Contributor

No actionable findings.

@github-actions github-actions Bot added the reviewer: ready Automated review found no actionable items label Sep 16, 2026
The model is back in service: 5/5 200 on 2026-09-17, and it now appears in
GET /v1/models (the catalog is 15 models, up from 14).

Three things are authored from the wire rather than inherited from the lab
entry, and each is commented in the file:

- reasoning_options: an unlisted effort returns the supported set verbatim
  ("Unexpected reasoning effort minimal. Supported types are xhigh (default),
  medium, and low."), so the set is low|medium|xhigh. `none` also answered 200
  but is not in that enumeration, so it is not authored.
- [limit] context = 262144. The Alibaba Cloud entry advertises 1M, but this host
  rejects anything longer with "The input (2000052 tokens) is longer than the
  model's context length (262144 tokens)" — a ~4x overstatement if inherited.
- No [interleaved]: this host returns the trace as a plain `reasoning` string,
  which is not a schema-valid interleaved.field.

Cost is the USD cash price (credit / 20), per the provider.toml header.

`bun validate` passes and resolves 15 models under y-api.
@github-actions github-actions Bot removed the reviewer: ready Automated review found no actionable items label Sep 17, 2026
@github-actions

Copy link
Copy Markdown
Contributor

No actionable findings.

@github-actions github-actions Bot added the reviewer: ready Automated review found no actionable items label Sep 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

reviewer: ready Automated review found no actionable items

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant