paperclipai/paperclip · error

Enter the Kimi API model name.

Error message

Enter the Kimi API model name.

What it means

When the hermes_gateway connection is configured to use the Kimi API (usingKimiApi is true), preparedConfig() requires a non-empty kimiModel value and throws "Enter the Kimi API model name." otherwise. The Kimi model name is passed through to the gateway, so a blank value would produce an unusable connection config.

Source

Thrown at ui/src/components/new-agent/NewAgentSetup.tsx:400

      ["cursor_cloud", "hermes_gateway"].includes(adapterType) &&
      !apiKey.trim() &&
      !selectedBinding
    )
      throw new Error(
        adapterType === "cursor_cloud"
          ? "Enter a Cursor API key."
          : `Enter ${envKey} or select an organization secret.`,
      );
    if (adapterType === "hermes_gateway") {
      try {
        const url = new URL(gatewayUrl.trim());
        if (!["https:", "http:"].includes(url.protocol)) throw new Error();
      } catch {
        throw new Error("Enter the Hermes API base URL.");
      }
    }
    if (usingKimiApi && !kimiModel.trim())
      throw new Error("Enter the Kimi API model name.");
    return buildConfig(nextConnection);
  }
  function pendingCredentials(nextConnection = connection) {
    return {
      ...nextConnection?.credentials,
      ...(hasCredentialField && apiKey.trim()
        ? { [envKey]: apiKey.trim() }
        : {}),
    };
  }

  async function runTest(nextConnection = connection): Promise<boolean> {
    if (!ready) return false;
    const run = ++generation.current;
    setTestState("running");
    setResult(null);
    setError(null);
    try {

View on GitHub (pinned to 01ad858492)

Solutions

  1. Enter the Kimi API model name (e.g. moonshot-v1-32k) in the Kimi model field.
  2. If Kimi is not needed, disable the Kimi API option so the field is not required.
  3. Re-check the field after toggling the Kimi option on — it starts empty.
  4. Ensure the value is not just whitespace.

Example fix

// before
usingKimiApi: true,
kimiModel: ""

// after
usingKimiApi: true,
kimiModel: "moonshot-v1-32k"
Defensive patterns

Strategy: validation

Validate before calling

const kimiOk = !usingKimiApi || kimiModel.trim().length > 0;
if (!kimiOk) showError("Enter the Kimi API model name.");

Type guard

const kimiModelRequired = (opts: { usingKimiApi: boolean; kimiModel: string }): boolean =>
  opts.usingKimiApi && opts.kimiModel.trim().length === 0;

Try / catch

try {
  const cfg = preparedConfig();
  submit(cfg);
} catch (e) {
  if (e instanceof Error && e.message.includes("Kimi API model")) {
    setKimiFieldError(e.message);
  } else throw e;
}

Prevention

When it happens

Trigger: Submitting setup with adapterType "hermes_gateway", the Kimi API option enabled, and the Kimi model field empty or whitespace-only.

Common situations: Toggling the Kimi API switch but not filling the dependent model field; copying a config where Kimi was disabled; whitespace-only paste that passes the visual check but fails trim().

Understand the failure class

Background: "is required", "must be set", "missing required field": configuration validation errors across open-source libraries — this error's family across 36 libraries.

Related errors


AI-assisted analysis of paperclipai/paperclip@01ad858492 (2026-09-10). Data as JSON: /api/errors/9712ae4b1a4b9b27. Report an issue: GitHub.