openclaw/openclaw · error · Error

DeepInfra API key missing

Error message

DeepInfra API key missing

What it means

Thrown in generateVideo (extensions/deepinfra/video-generation-provider.ts:221) after resolveApiKeyForProvider returns an empty apiKey. The provider resolves the key from the auth store, agent config, and environment; if none yields a usable key, no request is sent. This mirrors the image provider's missingApiKeyError behavior.

Source

Thrown at extensions/deepinfra/video-generation-provider.ts:221

      videoToVideo: {
        enabled: false,
      },
    },
    async generateVideo(req) {
      if ((req.inputImages?.length ?? 0) > 0) {
        throw new Error("DeepInfra video generation currently supports text-to-video only.");
      }
      if ((req.inputVideos?.length ?? 0) > 0) {
        throw new Error("DeepInfra video generation does not support video reference inputs.");
      }
      const auth = await resolveApiKeyForProvider({
        provider: "deepinfra",
        cfg: req.cfg,
        agentDir: req.agentDir,
        store: req.authStore,
      });
      if (!auth.apiKey) {
        throw new Error("DeepInfra API key missing");
      }

      const model = normalizeDeepInfraModelRef(req.model, defaultModel);
      const deadline = createProviderOperationDeadline({
        timeoutMs: req.timeoutMs,
        label: "DeepInfra video generation",
      });
      const { baseUrl, allowPrivateNetwork, headers, dispatcherPolicy } =
        resolveProviderHttpRequestConfig({
          baseUrl: resolveDeepInfraVideoBaseUrl(req),
          defaultBaseUrl: DEEPINFRA_BASE_URL,
          allowPrivateNetwork: false,
          defaultHeaders: {
            Authorization: `Bearer ${auth.apiKey}`,
            "Content-Type": "application/json",
          },
          provider: "deepinfra",
          capability: "video",

View on GitHub (pinned to 01804a7531)

Solutions

  1. Set the DeepInfra API key via 'openclaw configure' or the credentials store.
  2. Run 'openclaw doctor' to verify DeepInfra credential discovery.
  3. Confirm the key is associated with the 'deepinfra' provider id.
  4. Validate the key is active in the DeepInfra console.
Defensive patterns

Strategy: validation

Validate before calling

const auth = await resolveApiKeyForProvider({ provider: "deepinfra", cfg, agentDir, store });
if (!auth.apiKey) throw new Error("Configure the DeepInfra API key before video generation");

Type guard

async function isDeepInfraVideoKeyAvailable(ctx: { cfg: unknown; agentDir: unknown; store: unknown }): Promise<boolean> {
  const auth = await resolveApiKeyForProvider({ provider: "deepinfra", ...ctx });
  return typeof auth.apiKey === "string" && auth.apiKey.length > 0;
}

Prevention

When it happens

Trigger: A video generation request is made to DeepInfra, and resolveApiKeyForProvider({ provider: 'deepinfra', cfg, agentDir, store }) returns { apiKey: undefined }.

Common situations: DeepInfra API key not configured in credentials; running in an environment without the key; key stored under a different provider id; auth store not initialized; first run without onboarding.

Related errors


AI-assisted analysis of openclaw/openclaw@01804a7531 (2026-08-12). Data as JSON: /api/errors/972c7c9e8ed3a768. Report an issue: GitHub.