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.6 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");

test("Nube.sh is registered as an API-key provider with the canonical identity", () => {
  const nube = APIKEY_PROVIDERS.nube;
  assert.ok(nube, "APIKEY_PROVIDERS.nube must be defined");
  assert.equal(nube.id, "nube");
  assert.equal(nube.alias, "nube");
  assert.equal(nube.name, "Nube.sh");
  assert.equal(nube.website, "https://nube.sh");
  assert.equal(typeof nube.textIcon, "string");
});

test("Nube.sh registry entry uses OpenAI format with bearer apikey auth", () => {
  const entry = providerRegistry.nube;
  assert.ok(entry, "providerRegistry.nube must be defined");
  assert.equal(entry.id, "nube");
  assert.equal(entry.format, "openai");
  assert.equal(entry.executor, "default");
  assert.equal(entry.authType, "apikey");
  assert.equal(entry.authHeader, "bearer");
  assert.equal(entry.baseUrl, "https://ai.nube.sh/api/v1/chat/completions");
});

test("Nube.sh ships no fabricated model IDs and relies on passthrough enumeration", () => {
  const entry = providerRegistry.nube;
  // The live catalog is only reachable with a valid key (401 unauthenticated), so we do
  // NOT hardcode unverifiable model IDs — models pass through and are enumerated live.
  assert.equal(entry.passthroughModels, true);
  assert.deepEqual(entry.models, []);
  assert.equal(entry.modelsUrl, "https://ai.nube.sh/api/v1/models");
});