Skip to content

Support multiple AI providers (OpenAI, Minimax, OpenAI-compatible APIs) #3

@aliciapaz

Description

@aliciapaz

Problem

The gem is hardcoded to OpenAI's SDK and Responses API, making it impossible to use with other AI providers like Minimax, Ollama, or any OpenAI-compatible API.

Specifically:

  1. config.js — imports openai and creates a client with OPENAI_API_KEY only
  2. ai.js — calls client.responses.create(), which is OpenAI's Responses API (not the standard Chat Completions API that compatible providers implement)
  3. package.json — only includes the openai dependency
  4. README.md and install_generator.rb — reference OpenAI exclusively

Desired Behavior

Users should be able to configure any OpenAI-compatible provider by setting environment variables:

Variable Default Description
AI_API_KEY (required) API key for the AI provider
AI_MODEL gpt-4o Model to use
AI_BASE_URL https://api.openai.com/v1 Base URL for the API (change for Minimax, Ollama, etc.)

This way users can point the agent at any provider that implements the OpenAI Chat Completions API:

  • OpenAI: default, no extra config needed
  • Minimax: set AI_BASE_URL=https://api.minimax.chat/v1 and AI_API_KEY
  • Ollama: set AI_BASE_URL=http://localhost:11434/v1 and any AI_API_KEY
  • Azure OpenAI, Together AI, Groq, etc.

Required Changes

  1. Switch from client.responses.create() (Responses API) to client.chat.completions.create() (Chat Completions API) — this is the universal standard
  2. Make the API key env var provider-agnostic (AI_API_KEY, with OPENAI_API_KEY as fallback)
  3. Add AI_BASE_URL config to point at any compatible endpoint
  4. Update README and generator instructions

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions