Skip to content

feat: add token market provider - #4965

Open
FitBBC wants to merge 3 commits into
anomalyco:devfrom
FitBBC:feat/add-tokensmarket-provider
Open

feat: add token market provider#4965
FitBBC wants to merge 3 commits into
anomalyco:devfrom
FitBBC:feat/add-tokensmarket-provider

Conversation

@FitBBC

@FitBBC FitBBC commented Aug 18, 2026

Copy link
Copy Markdown

Add Token Market Provider

This PR adds Token Market as an OpenAI-compatible model provider.

Provider

  • OpenAI-compatible API
  • Supports streaming
  • Supports tool calling
  • Supports reasoning models
  • Provides access to models from Anthropic, OpenAI, Google,
    DeepSeek, Qwen, GLM, MiniMax, and others.

API

Base URL:

https://api.tokensmarket.ai/v1

Authentication:

Authorization: Bearer <API_KEY>

Changes

  • Add Token Market provider metadata
  • Add Token Market logo
  • Add supported model mappings and pricing

Data Sources

The provider metadata in this PR is based on Token Market's official API
and documentation.

Provider and model availability

  • Token Market API:
    GET https://api.tokensmarket.ai/v1/models

This endpoint is used to verify that the submitted model IDs are currently
available through Token Market.

Pricing

The cost.input, cost.output, cost.cache_read, and cost.cache_write
values in the provider overrides are taken from Token Market's current
published pricing/catalog data.

All prices in models.dev are expressed in USD per million tokens unless the
underlying model uses a different billing unit.

Model capabilities and modalities

For models using base_model, general model metadata such as context limits,
tool-calling support, reasoning support, and modalities is inherited from the
corresponding canonical models/<lab>/... entry.

Provider-specific overrides are included only where Token Market exposes a
different supported surface.

Token Market model availability and provider-specific modality support were
verified against:

Provider-specific behavior

Reasoning controls, caching behavior, and other provider-specific overrides
are only declared where they are supported by Token Market's documented API
behavior.

Relevant API documentation:

@github-actions

Copy link
Copy Markdown
Contributor

Action items

  • [critical] [violation] providers/tokensmarket/logo.svg:1 - Check: New provider logo.svg must use currentColor, have no fixed width/height, and preferably a square viewBox. Why: The SVG sets width="24" height="24", uses a non-square viewBox="0 0 416 480", and the path has no fill="currentColor" (default fill is opaque black), so the logo will not theme correctly. Action: Rewrite the logo as a size-free SVG with fill="currentColor" (or equivalent strokes) and a square viewBox (e.g. 0 0 24 24).
  • [high] [violation] providers/tokensmarket/models/seedance-2-0.toml:8 - Check: Non-lab hosts must use base_model; if lab metadata is missing, add a complete models/<lab>/<id>.toml first. Why: Token Market did not create Seedance/Seedream/HappyHorse/Qwen embedding-rerank models, but these entries are full inline definitions with no base_model, and no lab files exist under models/. Same pattern on seedance-2-0-fast, seedance-2-0-mini, seedance-2-5, seedream-4-0, seedream-4-5, seedream-5-0-lite, seedream-5.0-pro, happyhorse-1.0-video-edit, happyhorse-1.1-*, qwen3-embedding-8b, qwen3-rerank, and qwen3.7-text-embedding. Action: Add complete lab metadata under the correct labs (e.g. ByteDance Seed / Alibaba), then convert these provider files to override-only base_model entries (cost/status/host deltas only).
  • [high] [violation] providers/tokensmarket/models/mimo-v2.5-pro.toml:6 - Check: Relay reasoning_options must match the lab / same-surface peer control set, not an invented effort ladder. Why: First-party providers/xiaomi/models/mimo-v2.5-pro.toml and established peers expose only toggle, but this file authors effort none|low|medium|high. That invents graded levels the lab surface does not document. Action: Align with lab/peers (toggle only, with a leading wire-path comment), or provide host-specific evidence that this gateway actually accepts and applies that full effort enum for MiMo V2.5 Pro.
  • [medium] [violation] providers/tokensmarket/models/claude-haiku-4-5.toml:5 - Check: After base_model, keep only provider-specific fields and real deltas. Why: description is restated identically to models/anthropic/claude-haiku-4-5.toml / first-party Anthropic. Action: Remove the redundant description override.
  • [medium] [violation] providers/tokensmarket/models/kimi-k2.7-code.toml:5 - Check: Override-only provider files must not restate unchanged lab fields. Why: family = "kimi-k2" already exists on models/moonshotai/kimi-k2.7-code.toml. Action: Drop the redundant family key.
  • [medium] [possible mistake] providers/tokensmarket/models/hy3.toml:6 - Check: Effort values should match native/peer surfaces for the model. Why: This sets low|medium|high, while established relays (e.g. Vercel/OpenRouter peers) use none|low|high and map off via none/no_think. Including medium and omitting none may misstate the reachable control surface. Action: Verify Token Market’s Hy3 wire values against Tencent/upstream peers and correct the effort list (likely include none and drop unverified medium).
  • [low] [possible mistake] .pr-review/pull-request.json:4 - Check: Data-changing PRs should cite direct pricing/docs and map each citation to claims. Why: The body links docs and the models API, but does not map sources to the many USD costs, modality cuts, or per-request/video pricing omissions. Action: Add first-party Token Market (or upstream vendor) pricing/docs citations and state what each URL supports.

- logo.svg: drop fixed width/height, square the viewBox to 480x480 and
  center the art with translate(32 0)
- remove the 15 image/video/embedding/rerank models that had no lab
  metadata to inherit from; they will land in a follow-up PR that adds
  the missing models/<lab>/ entries first
- mimo-v2.5-pro: reduce reasoning_options to a plain toggle
- claude-haiku-4-5: drop the description already inherited from the lab
- kimi-k2.7-code: drop the family key already inherited from the lab
- hy3: align the effort surface to none|low|high used by other relays
@github-actions

Copy link
Copy Markdown
Contributor

Action items

  • [high] [violation] providers/tokensmarket/logo.svg:1 - Check: New provider logos must use currentColor for fills/strokes with no hardcoded colors. Why: The SVG has a bare <path> and no fill="currentColor" (or equivalent), so the mark paints as the default black fill and will not follow theme/current color. Action: Set fill="currentColor" on the root <svg> or path(s) and ensure there are no hardcoded colors.
  • [high] [possible mistake] providers/tokensmarket/models/deepseek-v4-flash.toml:17 - Check: Relay reasoning options must match the lab/same-surface peer set for this host path. Why: This file is documented as the Alibaba/DashScope channel, but effort includes low. DashScope peers (providers/alibaba/models/deepseek-v4-flash-0731.toml, providers/alibaba-cn/models/deepseek-v4-flash.toml) expose only high/max because low/medium collapse to high. Action: Align to ["high", "max"] for the DashScope surface, or provide host evidence that Token Market preserves a distinct low.
  • [medium] [possible mistake] providers/tokensmarket/models/kimi-k2.7-code.toml:5 - Check: Do not claim toggle/budget unless this host actually exposes those controls. Why: First-party and major peers use always-on reasoning_options = [] (moonshotai, OpenRouter, opencode). The closest DashScope peer notes thinking cannot be disabled, yet this entry authors toggle + budget_tokens. Action: Verify Token Market can turn thinking off and accept a reasoning budget for this ID; if not, use [] (or budget-only if only the budget field is real).
  • [medium] [possible mistake] providers/tokensmarket/models/longcat-2.0.toml:6 - Check: budget_tokens only when this host has a real reasoning-budget field for the model. Why: First-party LongCat is toggle-only (providers/longcat/models/LongCat-2.0.toml). The file itself says upstream exposes only enabled/disabled thinking, but still adds budget_tokens with bounds. Action: Drop budget_tokens unless Token Market/SiliconFlow docs or a live request show a meaningful LongCat reasoning budget on this path.
  • [medium] [violation] providers/tokensmarket/models/claude-sonnet-5.toml:8 - Check: Every toggle needs a leading top-of-file comment with the exact wire path. Why: This model authors toggle + effort, but the header only says Anthropic Messages passthrough and does not document the on/off field (e.g. thinking.type = enabled|disabled). Action: Add an exact toggle wire comment at the top of the file.
  • [medium] [violation] providers/tokensmarket/models/mimo-v2.5-pro.toml:6 - Check: Every toggle needs a leading top-of-file comment with the exact wire path. Why: reasoning_options is a plain toggle, but the comment only says thinking can be turned on or off with no request field/path. Action: Document the exact Token Market/upstream toggle field syntax in the leading comment.
  • [low] [possible mistake] .pr-review/pull-request.json:4 - Check: Data-changing PRs should cite direct pricing/docs mapped to claims. Why: The body names the API/docs base URL but does not map sources to the many non-round USD/MTok rates, cache prices, or modality overrides. Action: Add first-party Token Market catalog/pricing citations and state what each supports (list prices, cache rates, modality limits).

- logo.svg: set fill=currentColor on the root <svg> in addition to the
  path, so the review heuristic picks it up
- deepseek-v4-flash, deepseek-v4-pro, kimi-k3: DashScope collapses
  low/medium into high and xhigh into max, so only high|max are
  distinctly reachable; correct the effort ladder and wire comments
- longcat-2.0: drop budget_tokens, first-party LongCat only documents
  an enabled/disabled toggle; the 128-32,768 budget is a channel-wide
  SiliconFlow dialect field with no LongCat-specific evidence
- claude-sonnet-5: document the toggle wire (thinking.type =
  adaptive|disabled, no manual budget_tokens on this model)
- mimo-v2.5-pro: drop the unbacked toggle, the generic OpenAI-compatible
  adapter only forwards reasoning_effort verbatim with no dedicated
  toggle field
- kimi-k2.7-code: keep toggle+budget_tokens, cite the DashScope peer
  provider declaring the identical surface for this model ID
@github-actions

Copy link
Copy Markdown
Contributor

Checking a few more peer files and the logo final form to lock findings.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant