Skip to content

feat(node): support OpenAI-compatible base URLs#204

Open
jimmyzhuu wants to merge 1 commit into
getomni-ai:mainfrom
jimmyzhuu:feat/openai-compatible-base-url
Open

feat(node): support OpenAI-compatible base URLs#204
jimmyzhuu wants to merge 1 commit into
getomni-ai:mainfrom
jimmyzhuu:feat/openai-compatible-base-url

Conversation

@jimmyzhuu
Copy link
Copy Markdown

Summary

  • Add optional credentials.baseUrl support for OpenAI-compatible chat completions endpoints in the Node OpenAI provider.
  • Apply the custom endpoint to both OCR and extraction requests.
  • Keep existing OpenAI usage unchanged when baseUrl is omitted.

Why

The Node SDK currently hardcodes https://api.openai.com/v1/chat/completions, which blocks OpenAI-compatible vision endpoints, local gateways, and compatible provider APIs.

This addresses the use cases raised in #161 and #171, and provides a complete, backward-compatible version of the base URL support attempted in #178.

Tests

  • npx jest node-zerox/src/models/openAI.test.ts --runInBand
  • npm run build
  • Manual smoke path: run examples/node/qianfan.ts with QIANFAN_API_KEY set locally to verify an OpenAI-compatible vision endpoint can process the first page of the sample PDF and return non-empty Markdown.

Notes

baseUrl is optional, so existing OpenAI usage with only apiKey is unchanged.

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.

1 participant