Skip to content

[BUG] kagent install hard-requires OPENAI_API_KEY even when not using OpenAI #1622

Closed

Description

@whtssub

📋 Prerequisites

  • I have searched the existing issues to avoid creating a duplicate
  • By submitting this issue, you agree to follow our Code of Conduct
  • I am using the latest version of the software
  • I have tried to clear cache/cookies or used incognito mode (if ui-related)
  • I can consistently reproduce this issue

🎯 Affected Service(s)

Not Sure

🚦 Impact/Severity

Minor inconvenience

🐛 Bug Description

The kagent install CLI currently enforces the presence of OPENAI_API_KEY, even when the user intends to use a non-OpenAI provider (e.g. Ollama, local models, or other supported providers).

This creates a misleading and blocking setup experience for users who are not using OpenAI at all.

According to the quickstart documentation, an OpenAI API key is required as part of the setup flow, but this requirement is not universally valid, since kagent supports multiple providers and OpenAI is optional.

🔄 Steps To Reproduce

kagent install --profile minimal

Without setting:

export OPENAI_API_KEY=...

🤔 Expected Behavior

The CLI exits with:

OPENAI_API_KEY is not set
Please set the OPENAI_API_KEY environment variable

This blocks installation entirely.

📱 Actual Behavior

Installation should succeed without requiring OPENAI_API_KEY when:

  • user is not configuring OpenAI
  • user intends to use another provider (e.g. Ollama)
  • or no model is configured at install time

💻 Environment

  • kagent CLI version: (0.8.4)
  • Kubernetes: Kind (local)
  • Provider: Ollama (in-cluster)

🔧 CLI Bug Report

Workaround

Users can bypass this by setting a dummy value:

export OPENAI_API_KEY=dummy

However, this is unintuitive and not documented.

🔍 Additional Context

The installer currently assumes OpenAI as a mandatory dependency, which contradicts the multi-provider design of kagent. This should be relaxed to support non-OpenAI workflows cleanly.

📋 Logs

📷 Screenshots

No response

🙋 Are you willing to contribute?

  • I am willing to submit a PR to fix this issue

Activity

  1. added theissue type on Apr 5, 2026
  2. tmohanvamsi commented on Apr 23, 2026

    @tmohanvamsi

    Hi, I've been looking into this issue and have a fix ready.
    I've changed InstallCmd and InteractiveInstallCmd to emit a warning
    instead of hard-exiting when the API key is not set, allowing users
    on non-OpenAI providers to complete installation.

    PR coming shortly — would love to get this assigned.

  3. added a commit that references this issue on Apr 30, 2026
    6da271a
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions