Skip to content

feat: native OpenAI provider - #19

Merged
prashar32 merged 1 commit into
mainfrom
feat/openai-provider
May 30, 2026
Merged

feat: native OpenAI provider#19
prashar32 merged 1 commit into
mainfrom
feat/openai-provider

Conversation

@prashar32

Copy link
Copy Markdown
Owner

Implements the OpenAI Chat Completions API in internal/provider/openai.go (previously a stub returning ErrNotImplemented), mirroring the Anthropic provider:

  • Maps provider.Request → OpenAI body (the system prompt becomes a leading system message), parses the response into provider.Response with token usage, honors ctx for cancellation (kill switch / time budget reach in-flight calls), reads OPENAI_API_KEY.
  • The proxy already routes gpt-* / o1 / o3 models here, so those calls now work end to end. Pricing entries for common OpenAI models already exist.
  • Removes the OpenAI stub and refreshes the now-stale "OpenAI is a stub" comments.

Fixes #15

Tests: success (auth header + system-prepend + usage parsing), API error, missing key, context-cancel. go test -race ./... green.

Implements the OpenAI Chat Completions API in internal/provider/openai.go
(previously a stub), mirroring the Anthropic provider: maps provider.Request →
OpenAI body (system prompt as a leading system message), parses the response
into provider.Response with token usage, honors ctx for cancellation, and reads
OPENAI_API_KEY. The proxy already routes gpt-*/o1/o3 models here, so those calls
now work end to end. Removes the OpenAI stub and refreshes the now-stale
"OpenAI is a stub" comments.

Tests: success (auth header + system-prepend + usage), API error, missing key,
context cancel. Pricing entries for common OpenAI models already exist.

Fixes #15
@prashar32
prashar32 merged commit 8f823ea into main May 30, 2026
5 checks 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.

Implement the OpenAI provider natively

1 participant