Skip to content

Provider OpenAI

Muhammet Şafak edited this page May 27, 2026 · 1 revision

Provider: OpenAI

Direct HTTPS API integration with api.openai.com.

Configuration

provider: openai
providers:
  openai:
    api_key: sk-...
    model: gpt-4o

Equivalent CLI / env:

commitbrief config set provider openai
commitbrief config set providers.openai.api_key sk-...
commitbrief config set providers.openai.model gpt-4o

export OPENAI_API_KEY=sk-...

Get an API key from https://platform.openai.com/.

Supported models

Model ID Default?
gpt-4o
gpt-4o-mini

The setup wizard offers the same two. The OpenAI client uses strict structured-output mode where supported.

Pricing (per 1M tokens)

Model Input Output Cached input
gpt-4o $2.50 $10.00 $1.25
gpt-4o-mini $0.15 $0.60 $0.075

OpenAI applies automatic prompt-caching at ≥1024-token repeated prefixes; cached tokens are reported under usage.prompt_tokens_details.cached_tokens and shown in the verbose footer.

Rates from https://openai.com/api/pricing; the binary's table is in internal/provider/openai/pricing.go.

Context window

Both models: 128,000 tokens.

Structured findings

OpenAI's strict JSON mode rejects optional properties, so the required-vs-optional split for the v1 schema is enforced at the provider boundary: severity, file, line, title, description, and suggestion are required; line_end, language, snippet are optional and prompt-driven. See ADR-0014 §1 for the full contract.

See also

Clone this wiki locally