Skip to content

feat: Add native OpenAI (GPT) direct provider #4

@mukund-gohil-atos

Description

@mukund-gohil-atos

Summary

OpenAI GPT models work today via --provider openai-compatible by pointing --base-url
to https://api.openai.com/v1, but there is no named openai provider shorthand. This
causes confusion since users expect to type --provider openai the same way they can
type --provider anthropic.

Problem

  • Users must know to set --base-url https://api.openai.com/v1 manually
  • No clear provider-specific validation or defaults for OpenAI
  • gpt-4o, o3, o1 models require max_completion_tokens instead of max_tokens
    — this is handled internally but never surfaced to users

Proposed Solution

Add an explicit openai provider option:

  • codewiki config set --provider openai --api-key YOUR_OPENAI_KEY --main-model gpt-4o
  • Auto-sets base_url to https://api.openai.com/v1
  • Documents the max_completion_tokens behaviour for o-series models

Files Affected

  • codewiki/src/be/llm_services.py — add openai provider routing
  • codewiki/src/config.py — add openai to provider list with sensible defaults
  • README.md — add OpenAI example

Acceptance Criteria

  • --provider openai accepted, base URL auto-set
  • Works with gpt-4o, o3, o1 models out of the box
  • README updated

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