Skip to content

feat: add support for openai models#27

Open
aayushpurplesectors wants to merge 1 commit intobug0inc:mainfrom
aayushpurplesectors:feature/openai-models
Open

feat: add support for openai models#27
aayushpurplesectors wants to merge 1 commit intobug0inc:mainfrom
aayushpurplesectors:feature/openai-models

Conversation

@aayushpurplesectors
Copy link
Copy Markdown

Description

This PR adds support for integrating direct OpenAI models into Passmark. It follows the existing architectural patterns set by the direct Anthropic and Google integrations. Users can now pass models using the openai/ prefix (e.g., openai/gpt-4o) directly to configuration.

What Changed

  • Imported and configured createOpenAI in src/models.ts.
  • Added the _openai lazy singleton in src/models.ts with graceful missing-key error handling mapping to ConfigurationError.
  • Updated the switch case in resolveModel() to correctly route "openai" string prefixes.
  • Updated README.md to document the new OPENAI_API_KEY environment variable.
  • Added an entry to CHANGELOG.md under the [Unreleased] section detailing the change.

Why It's Needed

Although users can use Vercel AI Gateway or OpenRouter for OpenAI routing, native support for @ai-sdk/openai enables developers bypassing those systems to utilize models like GPT-4o or o3-mini cleanly and directly using their OPENAI_API_KEY.

Checklist

  • Fast passing npm run build locally
  • No type errors or linting flags raised
  • Documentation affected by the changes has been updated (README.md)
  • Added CHANGELOG.md notes to the [Unreleased] section
  • Simple, focused, and un-bloated

@panda-sandeep
Copy link
Copy Markdown
Contributor

panda-sandeep commented Apr 21, 2026

Hi @aayushpurplesectors sorry about the delay here, but I am reviewing it now. Do you mind resolving the merge conflict please?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants