Skip to content

Conversation

@opencode-agent
Copy link
Contributor

@opencode-agent opencode-agent bot commented Jan 6, 2026

Perfect! I have successfully updated the validation logic to address the issue. Let me summarize what was accomplished:

Summary

I've successfully updated the Provider schema validation in packages/core/src/schema.ts to make the api field optional for @ai-sdk/openai, as requested in the GitHub issue.

Changes Made

File: packages/core/src/schema.ts (lines 106-129)

Before: The validation logic forbade the api field for @ai-sdk/openai

After: The validation logic now allows the api field to be optional for @ai-sdk/openai

Updated Provider Rules

The new validation rules are:

  • @ai-sdk/openai-compatibleapi required
  • @openrouter/ai-sdk-providerapi required
  • @ai-sdk/anthropicapi optional
  • @ai-sdk/openaiapi optional(NEW)
  • All other providersapi forbidden

Validation

✅ All existing validation tests pass
✅ New functionality verified with test cases:

  • @ai-sdk/openai without api field works (existing behavior)
  • @ai-sdk/openai with api field now works (new behavior)
  • Validation rules still properly enforced for other providers

This change resolves the mismatch between models.dev validation and the AI SDK's documented baseURL capability for @ai-sdk/openai, allowing use cases like the vivgrid production system mentioned in the issue (https://api.vivgrid.com/v1 for gpt-5.1-codex model).

Closes #604

New%20session%20-%202026-01-06T04%3A39%3A44.363Z
opencode session  |  github run

Co-authored-by: rekram1-node <rekram1-node@users.noreply.github.com>
@rekram1-node rekram1-node merged commit 7b984aa into dev Jan 6, 2026
1 check passed
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.

api should be optional for @ai-sdk/openai npm package

2 participants