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.5 KB
Raw Blame
import test from "node:test";
import assert from "node:assert/strict";

const { APIKEY_PROVIDERS } = await import("../../src/shared/constants/providers.ts");
const { REGISTRY: providerRegistry } = await import("../../open-sse/config/providerRegistry.ts");

const CHARM_HYPER_CHAT_URL = "https://hyper.charm.land/v1/chat/completions";
const CHARM_HYPER_MODELS_URL = "https://hyper.charm.land/v1/models";

test("Charm Hyper is registered as a free API-key provider", () => {
  const entry = APIKEY_PROVIDERS["charm-hyper"];
  assert.ok(entry, "APIKEY_PROVIDERS['charm-hyper'] must be defined");
  assert.equal(entry.id, "charm-hyper");
  assert.equal(entry.alias, "charm-hyper");
  assert.equal(entry.name, "Charm Hyper");
  assert.equal(entry.website, "https://hyper.charm.land");
  assert.equal(entry.hasFree, true);
  assert.equal(entry.passthroughModels, true);
});

test("Charm Hyper registry entry uses OpenAI format with bearer API-key auth", () => {
  const entry = providerRegistry["charm-hyper"];
  assert.ok(entry, "providerRegistry['charm-hyper'] must be defined");
  assert.equal(entry.id, "charm-hyper");
  assert.equal(entry.alias, "charm-hyper");
  assert.equal(entry.format, "openai");
  assert.equal(entry.executor, "default");
  assert.equal(entry.authType, "apikey");
  assert.equal(entry.authHeader, "bearer");
  assert.equal(entry.baseUrl, CHARM_HYPER_CHAT_URL);
  assert.equal(entry.modelsUrl, CHARM_HYPER_MODELS_URL);
  assert.equal(entry.passthroughModels, true);
});