Skip to content

7.4 billion tokens per month. 34 free LLM providers. 635 free model endpoints. All behind one /v1 endpoint, plus any custom OpenAI-compatible endpoint. Smart routing, automatic failover, encrypted keys. Personal experimentation only.

TypeScript

feat(providers): add AMD Radeon Cloud (#1145)

Tashfeenef9ef34e2472
diff --git a/client/src/components/keys/shared.tsx b/client/src/components/keys/shared.tsx
index 0be6b2d1..cff2db03 100644
--- a/client/src/components/keys/shared.tsx
+++ b/client/src/components/keys/shared.tsx
@@ -31,6 +31,7 @@ export const PLATFORMS: { value: Platform; label: string; url: string; keyless?:
{ value: 'cerebras', label: 'Cerebras', url: 'https://cloud.cerebras.ai' },
{ value: 'sail', label: 'Sail Research ($5 monthly with payment method)', url: 'https://app.sailresearch.com' },
{ value: 'bai', label: 'B.AI (promotional free model)', url: 'https://b.ai' },
+ { value: 'radeon', label: 'AMD Radeon Cloud (free shared models)', url: 'https://developer.amd.com.cn/radeon/tokenfactory' },
{ value: 'nvidia', label: 'NVIDIA NIM', url: 'https://build.nvidia.com/settings/api-keys' },
{ value: 'mistral', label: 'Mistral', url: 'https://console.mistral.ai/api-keys/' },
{ value: 'openrouter', label: 'OpenRouter', url: 'https://openrouter.ai/keys' },
diff --git a/client/src/lib/routing.ts b/client/src/lib/routing.ts
index 68be2db9..1af4dc24 100644
--- a/client/src/lib/routing.ts
+++ b/client/src/lib/routing.ts
@@ -378,6 +378,7 @@ export const platformColors: Record<string, string> = {
cerebras: '#8b5cf6',
sail: '#0ea5e9',
bai: '#111827',
+ radeon: '#ed1c24',
nvidia: '#76b900',
mistral: '#f59e0b',
openrouter: '#ec4899',
diff --git a/docs/providers/01-supported-platforms.md b/docs/providers/01-supported-platforms.md
index 7809d08f..5b134105 100644
--- a/docs/providers/01-supported-platforms.md
+++ b/docs/providers/01-supported-platforms.md
@@ -1,12 +1,12 @@
# Supported platforms
-The `Platform` union in [`shared/types.ts` (line 59)](../../shared/types.ts) is the single source of truth for platform identity; the runtime registry in [`server/src/providers/index.ts`](../../server/src/providers/index.ts) must match it. The union currently declares **42 members**:
+The `Platform` union in [`shared/types.ts` (line 59)](../../shared/types.ts) is the single source of truth for platform identity; the runtime registry in [`server/src/providers/index.ts`](../../server/src/providers/index.ts) must match it. The union currently declares **43 members**:
-- **40 built-in platforms** registered as adapters at startup,
-- plus the **`custom`** placeholder (a real OpenAI-compatible adapter built per API key, since its base URL is user-supplied), giving **41 entries** in the registry map,
+- **41 built-in platforms** registered as adapters at startup,
+- plus the **`custom`** placeholder (a real OpenAI-compatible adapter built per API key, since its base URL is user-supplied), giving **42 entries** in the registry map,
- plus **`sambanova`**, retained in the type union but no longer registered — it was dropped in V23 (June 2026) when its free tier was permanently retired (every chat call returns 402 "payment method required" once the one-time $5 trial credit lapses).
-Of the 40 built-in platforms, **8 use dedicated native adapters** and **32 ride `OpenAICompatProvider`** against a provider-specific base URL. Three platforms are registered keyless (`kilo`, `ovh`, and `aihorde`, which auto-configures with its documented anonymous sentinel key). The public catalog headline in the README counts ~34 free providers / 474 model families / 635 free endpoints (~7.4 billion tokens/month of listed capacity) — fewer than the union because several registered gateways keep their free rosters in the hosted catalog rather than shipping them to every binary.
+Of the 41 built-in platforms, **8 use dedicated native adapters** and **33 ride `OpenAICompatProvider`** against a provider-specific base URL. Three platforms are registered keyless (`kilo`, `ovh`, and `aihorde`, which auto-configures with its documented anonymous sentinel key). The public catalog headline is smaller than the union because several registered gateways keep their free rosters in the hosted catalog rather than shipping them to every binary.
## Catalog
@@ -18,6 +18,7 @@ Of the 40 built-in platforms, **8 use dedicated native adapters** and **32 ride
| `sail` | Sail Research | Keyed (payment method required for recurring credit) | Native (`SailProvider`) | Stable `/v1/responses` integration submits background jobs and polls them to completion; flex-only models use the `flex` completion window. Sail grants $5 in monthly credits while a payment method is attached, then charges usage beyond that credit. |
| `bai` | B.AI | Keyed | OpenAI-compat | Gateway added in #918; only catalog row is a limited-time 0-credit promo, kept in the hosted catalog. |
| `anyapi` | AnyAPI | Keyed | OpenAI-compat | Free tier $0/no card/recurring, capped at 100K tokens/day over "free and basic" models; no RPM/RPD published (#772). Model ids arrive via catalog-sync, never seeded blind. |
+| `radeon` | AMD Radeon Cloud TokenFactory | Keyed | OpenAI-compat | Shared Model API at `developer.amd.com.cn/radeon/api/v1`; public models are free without consuming instance credits and use a rotating experimental roster. Current per-account limits are read from response headers rather than hard-coded. Parallel tool calls are disabled and the adapter allows the documented ten-minute generation window. |
| `nvidia` | NVIDIA NIM | Keyed | OpenAI-compat | `parallel_tool_calls` pinned false (#255); 180s timeout doubles as streaming first-byte grace (#584). |
| `mistral` | Mistral | Keyed | OpenAI-compat | `api.mistral.ai/v1`. |
| `sambanova` | SambaNova | Retired (V23) | Not registered | Free tier permanently gone; kept in the type union for historical key rows. |
diff --git a/docs/providers/03-adding-a-new-provider.md b/docs/providers/03-adding-a-new-provider.md
index f189d16b..58f73270 100644
--- a/docs/providers/03-adding-a-new-provider.md
+++ b/docs/providers/03-adding-a-new-provider.md
@@ -1,6 +1,6 @@
# Adding a new provider
-A contributor walkthrough that mirrors how the existing 40 built-in platforms are wired. Read [`server/src/providers/index.ts`](../../server/src/providers/index.ts) alongside this guide — it is both the registry and the best documentation of per-platform judgment calls.
+A contributor walkthrough that mirrors how the existing 41 built-in platforms are wired. Read [`server/src/providers/index.ts`](../../server/src/providers/index.ts) alongside this guide — it is both the registry and the best documentation of per-platform judgment calls.
## 1. Declare the platform
diff --git a/docs/providers/CHANGELOG.md b/docs/providers/CHANGELOG.md
index 3a45e4ab..b36e0ad9 100644
--- a/docs/providers/CHANGELOG.md
+++ b/docs/providers/CHANGELOG.md
@@ -4,6 +4,7 @@ Revision history for `docs/providers/`, listing the upstream commits that shaped
| Commit | Date | Summary |
| --- | --- | --- |
+| Unreleased | 2026-09-04 | Add AMD Radeon Cloud TokenFactory shared-model adapter and catalog-ready platform wiring. |
| Unreleased | 2026-09-01 | Add the native Sail Research background Responses adapter and catalog-ready platform wiring. |
| `ef4519a` | 2026-08-23 | feat(providers): add xkiro.com as OpenAI-compatible provider (#967) |
| `68ddca4` | 2026-08-23 | feat(providers): add UnoRouter (unorouter.com) as OpenAI-compatible provider (#875) |
diff --git a/server/src/__tests__/lib/key-parser.test.ts b/server/src/__tests__/lib/key-parser.test.ts
index 1744bb68..10e2c42b 100644
--- a/server/src/__tests__/lib/key-parser.test.ts
+++ b/server/src/__tests__/lib/key-parser.test.ts
@@ -65,6 +65,9 @@ describe('key parser', () => {
expect(detectPlatform('ANY_API_')).toBe('anyapi');
expect(detectPlatform('BAI_')).toBe('bai');
expect(detectPlatform('B_AI_')).toBe('bai');
+ expect(detectPlatform('RADEON_')).toBe('radeon');
+ expect(detectPlatform('AMD_RADEON_')).toBe('radeon');
+ expect(detectPlatform('AMD_TOKENFACTORY_')).toBe('radeon');
expect(detectPlatform('SAIL_')).toBe('sail');
expect(detectPlatform('SAIL_RESEARCH_')).toBe('sail');
expect(detectPlatform('SAMBANOVA_')).toBeNull();
@@ -82,6 +85,8 @@ describe('key parser', () => {
expect(AUTH_JSON_PROVIDER_MAP['model-scope']).toBe('modelscope');
expect(AUTH_JSON_PROVIDER_MAP['any-api']).toBe('anyapi');
expect(AUTH_JSON_PROVIDER_MAP['b-ai']).toBe('bai');
+ expect(AUTH_JSON_PROVIDER_MAP['radeon-cloud']).toBe('radeon');
+ expect(AUTH_JSON_PROVIDER_MAP['amd-tokenfactory']).toBe('radeon');
expect(AUTH_JSON_PROVIDER_MAP['sail-research']).toBe('sail');
const result = parseAuthJson(JSON.stringify({
credential_pool: {
diff --git a/server/src/__tests__/lib/log-redaction.test.ts b/server/src/__tests__/lib/log-redaction.test.ts
index 9346bb56..28ebbc59 100644
--- a/server/src/__tests__/lib/log-redaction.test.ts
+++ b/server/src/__tests__/lib/log-redaction.test.ts
@@ -32,6 +32,7 @@ const SPECS: Array<[string, string, number, string]> = [
['HuggingFace', 'hf_', 34, ALNUM],
['OpenRouter', 'sk-or-v1-', 64, HEX],
['Cloudflare', 'cfut_', 44, ALNUM],
+ ['AMD Radeon Cloud', 'rc-', 48, HEX],
['Vercel', 'vck_', 56, ALNUM],
['Aion', 'alv2_', 43, ALNUM],
['Pollinations', 'sk_', 32, ALNUM],
diff --git a/server/src/__tests__/lib/sampling-params.test.ts b/server/src/__tests__/lib/sampling-params.test.ts
index 0c1b23c6..2f5a04d1 100644
--- a/server/src/__tests__/lib/sampling-params.test.ts
+++ b/server/src/__tests__/lib/sampling-params.test.ts
@@ -71,6 +71,23 @@ describe('extendedBodyParams (per-platform policy)', () => {
expect(body.response_format).toEqual({ type: 'json_object' });
});
+ it('radeon: keeps only documented knobs and clamps reasoning to the shared roster', () => {
+ const body = extendedBodyParams('radeon', { ...allSet, reasoning_effort: 'high' });
+ for (const k of ['top_k', 'min_p', 'seed', 'repetition_penalty', 'logit_bias', 'logprobs', 'top_logprobs']) {
+ expect(body).not.toHaveProperty(k);
+ }
+ expect(body.presence_penalty).toBe(1);
+ expect(body.frequency_penalty).toBe(-1);
+ expect(body.response_format).toEqual({ type: 'json_object' });
+ expect(body.reasoning_effort).toBe('medium');
+ });
+
+ it('radeon: downgrades unsupported JSON Schema output to JSON-object mode', () => {
+ const schema = { type: 'json_schema' as const, json_schema: { name: 'answer', schema: { type: 'object' } } };
+ expect(extendedBodyParams('radeon', { response_format: schema }).response_format)
+ .toEqual({ type: 'json_object' });
+ });
+
it('aihorde: drops the entire extended set', () => {
expect(extendedBodyParams('aihorde', allSet)).toEqual({});
});
diff --git a/server/src/__tests__/providers/openai-compat.test.ts b/server/src/__tests__/providers/openai-compat.test.ts
index 78e7aa6f..916c9d15 100644
--- a/server/src/__tests__/providers/openai-compat.test.ts
+++ b/server/src/__tests__/providers/openai-compat.test.ts
@@ -648,6 +648,7 @@ describe('OpenAICompatProvider - platform instances', () => {
{ platform: 'cerebras', name: 'Cerebras', baseUrl: 'https://api.cerebras.ai/v1' },
{ platform: 'bai', name: 'B.AI', baseUrl: 'https://api.b.ai/v1' },
{ platform: 'anyapi', name: 'AnyAPI', baseUrl: 'https://api.anyapi.ai/v1' },
+ { platform: 'radeon', name: 'AMD Radeon Cloud', baseUrl: 'https://developer.amd.com.cn/radeon/api/v1' },
{ platform: 'nvidia', name: 'NVIDIA NIM', baseUrl: 'https://integrate.api.nvidia.com/v1' },
{ platform: 'mistral', name: 'Mistral', baseUrl: 'https://api.mistral.ai/v1' },
{ platform: 'openrouter', name: 'OpenRouter', baseUrl: 'https://openrouter.ai/api/v1' },
diff --git a/server/src/__tests__/providers/radeon.test.ts b/server/src/__tests__/providers/radeon.test.ts
new file mode 100644
index 00000000..fdcb5576
--- /dev/null
+++ b/server/src/__tests__/providers/radeon.test.ts
@@ -0,0 +1,98 @@
+import { afterEach, describe, expect, it, vi } from 'vitest';
+import { getProvider } from '../../providers/index.js';
+
+const completion = {
+ id: 'chatcmpl-radeon',
+ object: 'chat.completion',
+ created: 1,
+ model: 'Qwen3.8-Flash-Next',
+ choices: [{ index: 0, message: { role: 'assistant', content: 'ok' }, finish_reason: 'stop' }],
+ usage: { prompt_tokens: 1, completion_tokens: 1, total_tokens: 2 },
+};
+
+describe('AMD Radeon Cloud provider', () => {
+ afterEach(() => vi.restoreAllMocks());
+
+ it('uses the documented endpoint, bearer auth, safe knobs, and one tool call at a time', async () => {
+ const provider = getProvider('radeon');
+ expect(provider).toBeDefined();
+
+ let url = '';
+ let init: RequestInit | undefined;
+ vi.spyOn(global, 'fetch').mockImplementation(async (input, requestInit) => {
+ url = String(input);
+ init = requestInit;
+ return new Response(JSON.stringify(completion), {
+ status: 200,
+ headers: { 'content-type': 'application/json' },
+ });
+ });
+
+ await provider!.chatCompletion(
+ 'rc-' + 'a'.repeat(48),
+ [{ role: 'user', content: 'hi' }],
+ 'Qwen3.8-Flash-Next',
+ {
+ tools: [{
+ type: 'function',
+ function: { name: 'lookup', description: 'look up a value', parameters: { type: 'object', properties: {} } },
+ }],
+ parallel_tool_calls: true,
+ reasoning_effort: 'high',
+ top_k: 40,
+ },
+ );
+
+ expect(url).toBe('https://developer.amd.com.cn/radeon/api/v1/chat/completions');
+ expect(new Headers(init?.headers).get('authorization')).toMatch(/^Bearer rc-/);
+ const body = JSON.parse(String(init?.body));
+ expect(body.parallel_tool_calls).toBe(false);
+ expect(body.reasoning_effort).toBe('medium');
+ expect(body).not.toHaveProperty('top_k');
+ });
+
+ it('validates credentials against the authenticated models endpoint', async () => {
+ const provider = getProvider('radeon');
+ let url = '';
+ let init: RequestInit | undefined;
+ vi.spyOn(global, 'fetch').mockImplementation(async (input, requestInit) => {
+ url = String(input);
+ init = requestInit;
+ return new Response(JSON.stringify({ data: [] }), {
+ status: 200,
+ headers: { 'content-type': 'application/json' },
+ });
+ });
+
+ await expect(provider!.validateKey('rc-' + 'b'.repeat(48))).resolves.toBe(true);
+ expect(url).toBe('https://developer.amd.com.cn/radeon/api/v1/models');
+ expect(new Headers(init?.headers).get('authorization')).toMatch(/^Bearer rc-/);
+ });
+
+ it('coalesces Qwen system instructions into one leading message', async () => {
+ const provider = getProvider('radeon');
+ let body: any;
+ vi.spyOn(global, 'fetch').mockImplementation(async (_input, init) => {
+ body = JSON.parse(String(init?.body));
+ return new Response(JSON.stringify(completion), {
+ status: 200,
+ headers: { 'content-type': 'application/json' },
+ });
+ });
+
+ await provider!.chatCompletion(
+ 'rc-' + 'c'.repeat(48),
+ [
+ { role: 'user', content: 'question' },
+ { role: 'system', content: 'client instruction' },
+ { role: 'system', content: 'profile instruction' },
+ ],
+ 'Qwen3.8-Flash-Next',
+ );
+
+ expect(body.messages).toEqual([
+ { role: 'system', content: 'client instruction\n\nprofile instruction' },
+ { role: 'user', content: 'question' },
+ ]);
+ });
+});
diff --git a/server/src/__tests__/providers/reasoning-timeouts.test.ts b/server/src/__tests__/providers/reasoning-timeouts.test.ts
index eba33267..04b6dae1 100644
--- a/server/src/__tests__/providers/reasoning-timeouts.test.ts
+++ b/server/src/__tests__/providers/reasoning-timeouts.test.ts
@@ -23,6 +23,8 @@ describe('reasoning-model chat timeouts', () => {
['agnes', 60_000],
['opencode', 60_000],
['ollama', 120_000], // pre-existing bump; keep it from regressing too
+ // Radeon Cloud documents a ten-minute non-streaming and stream-gap limit.
+ ['radeon', 600_000],
// NVIDIA NIM prefills 100k-token prompts for minutes before the first SSE
// byte; this value doubles as the streaming first-byte grace budget (#584).
['nvidia', 180_000],
diff --git a/server/src/__tests__/routes/proxy-stream-integrity.test.ts b/server/src/__tests__/routes/proxy-stream-integrity.test.ts
index 46a8e6bd..6ac73463 100644
--- a/server/src/__tests__/routes/proxy-stream-integrity.test.ts
+++ b/server/src/__tests__/routes/proxy-stream-integrity.test.ts
@@ -55,7 +55,7 @@ function mockUpstream(script: Array<{ body: string; status?: number }>) {
const urlStr = typeof url === 'string' ? url : url.toString();
// Only intercept provider upstreams; the test's own localhost request
// and anything else goes through.
- if (!/api\.groq\.com|openrouter\.ai|api\.cohere|generativelanguage|integrate\.api\.nvidia|api\.cerebras|api\.b\.ai|api\.mistral|router\.huggingface|api\.cloudflare|models\.github|open\.bigmodel|api\.llm7|api\.kilo|gen\.pollinations|ollama\.com|opencode\.ai|api\.aionlabs\.ai|router\.requesty\.ai|api\.navy|router\.bynara\.id/.test(urlStr)) {
+ if (!/api\.groq\.com|openrouter\.ai|api\.cohere|generativelanguage|integrate\.api\.nvidia|api\.cerebras|api\.b\.ai|developer\.amd\.com\.cn|api\.mistral|router\.huggingface|api\.cloudflare|models\.github|open\.bigmodel|api\.llm7|api\.kilo|gen\.pollinations|ollama\.com|opencode\.ai|api\.aionlabs\.ai|router\.requesty\.ai|api\.navy|router\.bynara\.id/.test(urlStr)) {
return origFetch(url as any, init);
}
const reqBody = JSON.parse(String((init as RequestInit).body));
diff --git a/server/src/__tests__/services/provider-quota.test.ts b/server/src/__tests__/services/provider-quota.test.ts
index 147e8f71..cac619db 100644
--- a/server/src/__tests__/services/provider-quota.test.ts
+++ b/server/src/__tests__/services/provider-quota.test.ts
@@ -46,6 +46,8 @@ describe('provider-quota: pool inference', () => {
// the platform shares a single pool.
expect(inferQuotaPoolKey('anyapi')).toBe('anyapi::free');
expect(inferQuotaPoolKey('anyapi', 'qwen/qwen3-coder:free')).toBe('anyapi::free');
+ expect(inferQuotaPoolKey('radeon', 'DeepSeek-V4-Flash')).toBe('radeon::daily-free');
+ expect(inferQuotaPoolKey('radeon', 'Qwen3.8-Flash-Next')).toBe('radeon::daily-free');
// Unknown platform falls back to platform::model or platform::account.
expect(inferQuotaPoolKey('acme' as any, 'x')).toBe('acme::x');
expect(inferQuotaPoolKey('acme' as any)).toBe('acme::account');
@@ -218,6 +220,28 @@ describe('provider-quota: parse from response headers (shared parseRetryAfterMs)
// A 429 always marks the pool as remaining 0.
expect(obs.some(o => o.remaining === 0)).toBe(true);
});
+
+ it('parses Radeon Cloud RPM and recurring daily allowance headers', () => {
+ const resp = new Response(null, {
+ status: 200,
+ headers: {
+ 'x-ratelimit-limit-user-rpm': '30',
+ 'x-ratelimit-remaining-user-rpm': '29',
+ 'x-ratelimit-reset': '60',
+ 'x-ratelimit-limit-user-daily-usd': '10',
+ 'x-ratelimit-used-user-daily-usd': '2.5',
+ 'x-ratelimit-remaining-user-daily-usd': '7.5',
+ 'x-ratelimit-reset-user-daily-usd': '86400',
+ },
+ });
+ const obs = parseQuotaObservationsFromResponse(resp, { platform: 'radeon', keyId: 9 });
+ expect(obs.find(o => o.metric === 'requests')).toMatchObject({
+ quotaPoolKey: 'radeon::daily-free', limit: 30, remaining: 29,
+ });
+ expect(obs.find(o => o.metric === 'credits')).toMatchObject({
+ quotaPoolKey: 'radeon::daily-free', limit: 10, remaining: 7.5,
+ });
+ });
});
describe('provider-quota: reset_at replenishment on read (#453)', () => {
diff --git a/server/src/lib/key-parser.ts b/server/src/lib/key-parser.ts
index 95158d85..26354c55 100644
--- a/server/src/lib/key-parser.ts
+++ b/server/src/lib/key-parser.ts
@@ -47,6 +47,9 @@ export const PREFIX_MAP: Record<string, string> = {
SAIL_RESEARCH_: 'sail',
BAI_: 'bai',
B_AI_: 'bai',
+ RADEON_: 'radeon',
+ AMD_RADEON_: 'radeon',
+ AMD_TOKENFACTORY_: 'radeon',
NVIDIA_: 'nvidia',
MISTRAL_: 'mistral',
OPENROUTER_: 'openrouter',
@@ -110,6 +113,10 @@ export const AUTH_JSON_PROVIDER_MAP: Record<string, string> = {
sailresearch: 'sail',
bai: 'bai',
'b-ai': 'bai',
+ radeon: 'radeon',
+ 'radeon-cloud': 'radeon',
+ 'amd-radeon': 'radeon',
+ 'amd-tokenfactory': 'radeon',
openrouter: 'openrouter',
'ollama-cloud': 'ollama',
ollama: 'ollama',
diff --git a/server/src/lib/log-redaction.ts b/server/src/lib/log-redaction.ts
index 0dbcf499..4e776515 100644
--- a/server/src/lib/log-redaction.ts
+++ b/server/src/lib/log-redaction.ts
@@ -41,6 +41,7 @@ const PATTERNS: Array<[RegExp, string]> = [
[/\bghp_[A-Za-z0-9]{20,}/g, REDACTED], // GitHub classic
[/\bhf_[A-Za-z0-9]{16,}/g, REDACTED], // HuggingFace
[/\bcfut_[A-Za-z0-9]{16,}/g, REDACTED], // Cloudflare
+ [/\brc-[0-9a-f]{48}\b/gi, REDACTED], // AMD Radeon Cloud
[/\bvck_[A-Za-z0-9]{16,}/g, REDACTED], // Vercel
[/\bcpk_[A-Za-z0-9.]{16,}/g, REDACTED], // Chutes
[/\balv2_[A-Za-z0-9]{16,}/g, REDACTED], // Aion Labs
diff --git a/server/src/lib/sampling-params.ts b/server/src/lib/sampling-params.ts
index 1ba4ac8b..5fcf7bd9 100644
--- a/server/src/lib/sampling-params.ts
+++ b/server/src/lib/sampling-params.ts
@@ -204,6 +204,10 @@ export interface PlatformParamPolicy {
// are 'text' and 'json_schema'."). Upgrade json_object to a permissive
// json_schema on the wire instead of dropping structured output entirely.
jsonObjectToSchema?: boolean;
+ // The reverse compatibility shim for providers that support JSON mode but
+ // not schema enforcement. Preserve structured output by requesting a JSON
+ // object instead of sending an unsupported json_schema payload.
+ jsonSchemaToObject?: boolean;
// The effort values this platform's API accepts, when it accepts fewer than
// the full scale. A request outside the set is clamped to the nearest
// supported value instead of being forwarded into a 400 (#619). Omitted =
@@ -287,6 +291,14 @@ export const PLATFORM_PARAM_POLICIES: Partial<Record<Platform, PlatformParamPoli
drop: ['min_p', 'logit_bias', 'logprobs', 'top_logprobs', 'reasoning_effort'],
defaultMaxTokens: 8192,
},
+ // Radeon Cloud silently drops these fields. Keep reasoning_effort within the
+ // common subset of its current shared roster (Qwen: low/medium; DeepSeek is
+ // broader) so either model receives a supported value.
+ radeon: {
+ drop: ['top_k', 'min_p', 'seed', 'repetition_penalty', 'logit_bias', 'logprobs', 'top_logprobs'],
+ reasoningEfforts: ['low', 'medium'],
+ jsonSchemaToObject: true,
+ },
// AI Horde builds its own payload format; none of the extended set maps.
aihorde: { drop: [...EXTENDED_SAMPLING_KEYS] },
// Kilo's anonymous gateway 400s ("Provider returned error") whenever
@@ -326,6 +338,10 @@ export function extendedBodyParams(platform: string, options: ExtendedSamplingOp
&& (value as { type?: string }).type === 'json_object') {
value = ANY_OBJECT_SCHEMA;
}
+ if (key === 'response_format' && policy?.jsonSchemaToObject
+ && (value as { type?: string }).type === 'json_schema') {
+ value = { type: 'json_object' };
+ }
if (key === 'reasoning_effort' && policy?.reasoningEfforts) {
value = clampEffortTo(value as ReasoningEffort, policy.reasoningEfforts);
if (value === undefined) continue;
diff --git a/server/src/providers/index.ts b/server/src/providers/index.ts
index 5b55fc03..5321591c 100644
--- a/server/src/providers/index.ts
+++ b/server/src/providers/index.ts
@@ -72,6 +72,19 @@ register(new OpenAICompatProvider({
baseUrl: 'https://api.anyapi.ai/v1',
}));
+// AMD Radeon Cloud TokenFactory — the shared Model API is OpenAI-compatible
+// and its current public roster is free without consuming GPU-instance
+// credits. Public models are experimental and may rotate, so their ids remain
+// in the hosted catalog rather than migrations. Both current models reject
+// parallel tool calls; long reasoning requests may run for up to ten minutes.
+register(new OpenAICompatProvider({
+ platform: 'radeon',
+ name: 'AMD Radeon Cloud',
+ baseUrl: 'https://developer.amd.com.cn/radeon/api/v1',
+ forceSingleToolCall: true,
+ timeoutMs: 600_000,
+}));
+
// SambaNova was dropped in V23 (June 2026): the free tier is permanently gone.
// The always-free tier was retired in early 2025 for a one-time $5 trial
// credit (expires in 3 months); once it lapses, every chat call 402s
diff --git a/server/src/providers/openai-compat.ts b/server/src/providers/openai-compat.ts
index 6e167fcd..8a6d1fac 100644
--- a/server/src/providers/openai-compat.ts
+++ b/server/src/providers/openai-compat.ts
@@ -14,6 +14,7 @@ import { invalidToolCallReasons, isToolArgumentValidationEnabled } from '../lib/
import { recordQuotaObservationsFromResponse, type QuotaObservationContext } from '../services/provider-quota.js';
import { providerTimeoutMs } from '../lib/provider-timeout.js';
import { isAbortLikeError } from '../lib/error-classify.js';
+import { contentToString } from '../lib/content.js';
/** Hosts that ARE Moonshot's OpenAI-compatible API (api.moonshot.ai,
* api.moonshot.cn, api.kimi.com and their subdomains). */
@@ -176,7 +177,7 @@ export class OpenAICompatProvider extends BaseProvider {
* before sending to these platforms.
*/
private static readonly STRICT_PLATFORMS = new Set(['mistral', 'groq', 'cerebras']);
- private messagesForPlatform(messages: ChatMessage[]): ChatMessage[] {
+ private messagesForPlatform(messages: ChatMessage[], modelId: string): ChatMessage[] {
if (OpenAICompatProvider.STRICT_PLATFORMS.has(this.platform)) {
// Rebuild every message from a whitelist of keys, so `partial` and the
// reasoning extensions never reach these platforms.
@@ -220,14 +221,27 @@ export class OpenAICompatProvider extends BaseProvider {
// the ones that serve Kimi models, like Groq, Cloudflare or OpenRouter —
// gets it stripped, since strict upstreams 400/422 on unknown message keys
// and the rest would ignore it anyway. (#1038)
- if (this.forwardsPartial) return messages;
- return messages.map((m) => {
+ const sanitized = this.forwardsPartial ? messages : messages.map((m) => {
if (m.role === 'assistant' && m.partial !== undefined) {
const { partial: _partial, ...rest } = m;
return rest;
}
return m;
});
+
+ // Qwen3.8-Flash-Next accepts exactly one system message, and only at index
+ // zero. Profiles can prepend a gateway system prompt to a client's own
+ // system message, so coalesce every system instruction before dispatch
+ // instead of letting an otherwise valid request fail upstream.
+ if (this.platform === 'radeon' && modelId === 'Qwen3.8-Flash-Next') {
+ const systems = sanitized.filter(m => m.role === 'system');
+ if (systems.length === 1 && sanitized[0]?.role === 'system') return sanitized;
+ const systemText = systems.map(m => contentToString(m.content)).filter(Boolean).join('\n\n');
+ const rest = sanitized.filter(m => m.role !== 'system');
+ return systemText ? [{ role: 'system', content: systemText }, ...rest] : rest;
+ }
+
+ return sanitized;
}
async chatCompletion(
@@ -247,7 +261,7 @@ export class OpenAICompatProvider extends BaseProvider {
},
body: JSON.stringify({
model: modelId,
- messages: this.messagesForPlatform(messages),
+ messages: this.messagesForPlatform(messages, modelId),
temperature: sampling.temperature,
max_tokens: resolveMaxTokens(this.platform, options?.max_tokens),
top_p: sampling.topP,
@@ -366,7 +380,7 @@ export class OpenAICompatProvider extends BaseProvider {
},
body: JSON.stringify({
model: modelId,
- messages: this.messagesForPlatform(messages),
+ messages: this.messagesForPlatform(messages, modelId),
temperature: sampling.temperature,
max_tokens: resolveMaxTokens(this.platform, options?.max_tokens),
top_p: sampling.topP,
diff --git a/server/src/routes/keys.ts b/server/src/routes/keys.ts
index 8cea9e45..122836db 100644
--- a/server/src/routes/keys.ts
+++ b/server/src/routes/keys.ts
@@ -28,7 +28,7 @@ export const keysRouter = Router();
// was dropped in V4 and re-added in V13 via the router.huggingface.co route.
// SambaNova was dropped in V23 (free tier permanently retired).
const PLATFORMS = [
- 'google', 'groq', 'cerebras', 'sail', 'bai', 'nvidia', 'mistral',
+ 'google', 'groq', 'cerebras', 'sail', 'bai', 'radeon', 'nvidia', 'mistral',
'openrouter', 'github', 'cohere', 'cloudflare', 'zhipu', 'ollama',
'kilo', 'pollinations', 'llm7', 'huggingface', 'opencode', 'ovh', 'agnes', 'reka', 'siliconflow',
'routeway', 'bazaarlink', 'ainative', 'aion', 'anyapi', 'requesty', 'navy', 'nara', 'sealion', 'orcarouter', 'unorouter', 'xkiro', 'modelscope',
diff --git a/server/src/services/provider-quota.ts b/server/src/services/provider-quota.ts
index bf4b1a41..e5a41783 100644
--- a/server/src/services/provider-quota.ts
+++ b/server/src/services/provider-quota.ts
@@ -117,6 +117,7 @@ function inferPoolForPlatform(platform: Platform, modelId?: string | null): stri
if (platform === 'cerebras') return 'cerebras::shared';
if (platform === 'sail') return 'sail::monthly-credit';
if (platform === 'bai') return 'bai::promo';
+ if (platform === 'radeon') return 'radeon::daily-free';
if (platform === 'sambanova') return 'sambanova::shared';
if (platform === 'nvidia') return 'nvidia::credit-pool';
if (platform === 'mistral') return 'mistral::experiment-pool';
@@ -163,7 +164,7 @@ function inferPoolForPlatform(platform: Platform, modelId?: string | null): stri
}
function isSharedPool(platform: Platform): boolean {
- return ['openrouter', 'google', 'groq', 'cerebras', 'sail', 'bai', 'sambanova', 'nvidia', 'mistral', 'github', 'cohere', 'cloudflare', 'zhipu', 'ollama', 'kilo', 'pollinations', 'llm7', 'huggingface', 'opencode', 'routeway', 'bazaarlink', 'ainative', 'aion', 'requesty', 'navy', 'nara', 'sealion', 'orcarouter', 'unorouter', 'xkiro', 'anyapi', 'modelscope', 'aihorde'].includes(platform);
+ return ['openrouter', 'google', 'groq', 'cerebras', 'sail', 'bai', 'radeon', 'sambanova', 'nvidia', 'mistral', 'github', 'cohere', 'cloudflare', 'zhipu', 'ollama', 'kilo', 'pollinations', 'llm7', 'huggingface', 'opencode', 'routeway', 'bazaarlink', 'ainative', 'aion', 'requesty', 'navy', 'nara', 'sealion', 'orcarouter', 'unorouter', 'xkiro', 'anyapi', 'modelscope', 'aihorde'].includes(platform);
}
type HeaderSpec = { metric: QuotaMetric; limit: string; remaining?: string; reset?: string; strategy?: QuotaResetStrategy };
@@ -181,6 +182,10 @@ const HEADER_SPECS: Partial<Record<Platform, HeaderSpec[]>> = {
{ metric: 'requests', limit: 'x-ratelimit-limit-requests', remaining: 'x-ratelimit-remaining-requests', reset: 'x-ratelimit-reset-requests', strategy: 'provider_reported' },
{ metric: 'tokens', limit: 'x-ratelimit-limit-tokens', remaining: 'x-ratelimit-remaining-tokens', reset: 'x-ratelimit-reset-tokens', strategy: 'provider_reported' },
],
+ radeon: [
+ { metric: 'requests', limit: 'x-ratelimit-limit-user-rpm', remaining: 'x-ratelimit-remaining-user-rpm', reset: 'x-ratelimit-reset', strategy: 'provider_reported' },
+ { metric: 'credits', limit: 'x-ratelimit-limit-user-daily-usd', remaining: 'x-ratelimit-remaining-user-daily-usd', reset: 'x-ratelimit-reset-user-daily-usd', strategy: 'provider_reported' },
+ ],
// ModelScope reportedly returns `modelscope-ratelimit-*`-style headers on
// authenticated responses. UNCONFIRMED: no real token exists for this
// platform yet (auth needs an Alibaba Cloud cn-site binding, #581), and the
diff --git a/shared/types.ts b/shared/types.ts
index bfcd7309..59e8f765 100644
--- a/shared/types.ts
+++ b/shared/types.ts
@@ -76,6 +76,10 @@ export type Platform =
// published. Catalog rows live in the hosted catalog (premium now, free after
// 30 days).
| 'anyapi'
+ // AMD Radeon Cloud TokenFactory — OpenAI-compatible shared inference. Its
+ // rotating public-model roster is free without consuming instance credits,
+ // with recurring account-level allowance and request/concurrency controls.
+ | 'radeon'
| 'nvidia'
| 'mistral'
| 'sambanova'