Skip to content

Never stop coding. Free MIT AI gateway: one endpoint, 375 providers (150+ free), 1,400+ models Kimi, Claude, GPT, Gemini, GLM, DeepSeek, MiniMax. Works with Claude Code, Codex, Cursor, OpenCode, Cline & Copilot. Quota-aware auto-fallback, RTK+Caveman compression saves 15-95% tokens, MCP/A2A, Desktop/PWA. Built by 900+ contributors

1.1 KB
Raw Blame
import type { RegistryEntry } from "../../shared.ts";

export const sparkdeskProvider: RegistryEntry = {
  id: "sparkdesk",
  alias: "sparkdesk",
  format: "openai",
  executor: "default",
  baseUrl: "https://spark-api-open.xf-yun.com/v1/chat/completions",
  authType: "apikey",
  authHeader: "bearer",
  // `spark-api-open.xf-yun.com` is Spark's OpenAI-compatible HTTP endpoint (Bearer
  // APIPassword). `spark-api.xf-yun.com` is the WebSocket host — `wss://.../v3.1/chat`
  // etc., authenticated with an HMAC-SHA256 signature, not a bearer token — so it
  // cannot serve this `format: "openai"` / `authHeader: "bearer"` entry.
  // Model ids are the `domain` values accepted by the HTTP endpoint. `spark-x` is
  // rejected: it lives on separate /v2 (X1.5) and /x2 (X2) endpoints.
  models: [
    { id: "4.0Ultra", name: "Spark 4.0 Ultra", contextLength: 32768 },
    { id: "generalv3", name: "Spark Pro", contextLength: 8192 },
    { id: "pro-128k", name: "Spark Pro 128K", contextLength: 131072 },
    { id: "lite", name: "Spark Lite", contextLength: 4096 },
  ],
};