Introduces image-generation models as a first-class [[models]] entry via
a new `modality` field on the model schema ("text" default, "image",
"audio"). When modality != "text", context_window / max_output_tokens
are optional since no conventional context gate exists — OpenAI's
gpt-image-2 docs omit them.
Adds `image_input_cost_per_m` / `image_output_cost_per_m` alongside
existing text token cost fields to cover the 4-price structure OpenAI
uses for image generation (text $5/$10, image $8/$30 per 1M tokens).
Validator updated to:
- accept any modality in {text, image, audio}
- require context_window/max_output_tokens only for modality=text
- range-check the two new cost fields
gpt-image-2 entry added to providers/openai.toml with pricing sourced
from https://developers.openai.com/api/docs/pricing. Snapshot
gpt-image-2-2026-04-21 listed as alias.
258 lines
5.5 KiB
TOML
258 lines
5.5 KiB
TOML
# OpenAI — https://openai.com
|
|
# Models: 18 (including 2 Codex variants + 1 image-generation model)
|
|
|
|
[provider]
|
|
id = "openai"
|
|
display_name = "OpenAI"
|
|
api_key_env = "OPENAI_API_KEY"
|
|
base_url = "https://api.openai.com/v1"
|
|
key_required = true
|
|
media_capabilities = ["image_generation", "text_to_speech"]
|
|
|
|
[[models]]
|
|
id = "gpt-4.1"
|
|
display_name = "GPT-4.1"
|
|
tier = "frontier"
|
|
context_window = 1047576
|
|
max_output_tokens = 32768
|
|
input_cost_per_m = 2.00
|
|
output_cost_per_m = 8.00
|
|
supports_tools = true
|
|
supports_vision = true
|
|
supports_streaming = true
|
|
aliases = []
|
|
|
|
[[models]]
|
|
id = "gpt-4.1-mini"
|
|
display_name = "GPT-4.1 Mini"
|
|
tier = "balanced"
|
|
context_window = 1047576
|
|
max_output_tokens = 32768
|
|
input_cost_per_m = 0.40
|
|
output_cost_per_m = 1.60
|
|
supports_tools = true
|
|
supports_vision = true
|
|
supports_streaming = true
|
|
aliases = []
|
|
|
|
[[models]]
|
|
id = "gpt-4.1-nano"
|
|
display_name = "GPT-4.1 Nano"
|
|
tier = "fast"
|
|
context_window = 1047576
|
|
max_output_tokens = 32768
|
|
input_cost_per_m = 0.10
|
|
output_cost_per_m = 0.40
|
|
supports_tools = true
|
|
supports_vision = false
|
|
supports_streaming = true
|
|
aliases = []
|
|
|
|
[[models]]
|
|
id = "o3"
|
|
display_name = "o3"
|
|
tier = "frontier"
|
|
context_window = 200000
|
|
max_output_tokens = 100000
|
|
input_cost_per_m = 2.0
|
|
output_cost_per_m = 8.0
|
|
supports_tools = true
|
|
supports_vision = true
|
|
supports_streaming = true
|
|
supports_thinking = true
|
|
aliases = []
|
|
|
|
[[models]]
|
|
id = "o4-mini"
|
|
display_name = "o4-mini"
|
|
tier = "smart"
|
|
context_window = 200000
|
|
max_output_tokens = 100000
|
|
input_cost_per_m = 1.1
|
|
output_cost_per_m = 4.4
|
|
supports_tools = true
|
|
supports_vision = true
|
|
supports_streaming = true
|
|
supports_thinking = true
|
|
aliases = []
|
|
|
|
[[models]]
|
|
id = "gpt-5"
|
|
display_name = "GPT-5"
|
|
tier = "frontier"
|
|
context_window = 400000
|
|
max_output_tokens = 128000
|
|
input_cost_per_m = 1.25
|
|
output_cost_per_m = 10.0
|
|
supports_tools = true
|
|
supports_vision = true
|
|
supports_streaming = true
|
|
aliases = []
|
|
|
|
[[models]]
|
|
id = "gpt-5-mini"
|
|
display_name = "GPT-5 Mini"
|
|
tier = "balanced"
|
|
context_window = 400000
|
|
max_output_tokens = 128000
|
|
input_cost_per_m = 0.25
|
|
output_cost_per_m = 2.0
|
|
supports_tools = true
|
|
supports_vision = true
|
|
supports_streaming = true
|
|
aliases = ["gpt5-mini"]
|
|
|
|
[[models]]
|
|
id = "gpt-5-nano"
|
|
display_name = "GPT-5 Nano"
|
|
tier = "fast"
|
|
context_window = 400000
|
|
max_output_tokens = 128000
|
|
input_cost_per_m = 0.05
|
|
output_cost_per_m = 0.40
|
|
supports_tools = true
|
|
supports_vision = false
|
|
supports_streaming = true
|
|
aliases = []
|
|
|
|
[[models]]
|
|
id = "gpt-5.1"
|
|
display_name = "GPT-5.1"
|
|
tier = "frontier"
|
|
context_window = 400000
|
|
max_output_tokens = 128000
|
|
input_cost_per_m = 1.25
|
|
output_cost_per_m = 10.0
|
|
supports_tools = true
|
|
supports_vision = true
|
|
supports_streaming = true
|
|
aliases = []
|
|
|
|
[[models]]
|
|
id = "gpt-5.2"
|
|
display_name = "GPT-5.2"
|
|
tier = "frontier"
|
|
context_window = 400000
|
|
max_output_tokens = 128000
|
|
input_cost_per_m = 1.75
|
|
output_cost_per_m = 14.0
|
|
supports_tools = true
|
|
supports_vision = true
|
|
supports_streaming = true
|
|
aliases = ["gpt5"]
|
|
|
|
[[models]]
|
|
id = "gpt-5.2-pro"
|
|
display_name = "GPT-5.2 Pro"
|
|
tier = "frontier"
|
|
context_window = 400000
|
|
max_output_tokens = 128000
|
|
input_cost_per_m = 21.0
|
|
output_cost_per_m = 168.0
|
|
supports_tools = true
|
|
supports_vision = true
|
|
supports_streaming = true
|
|
aliases = []
|
|
|
|
[[models]]
|
|
id = "gpt-5.4"
|
|
display_name = "GPT-5.4"
|
|
tier = "frontier"
|
|
context_window = 1050000
|
|
max_output_tokens = 128000
|
|
input_cost_per_m = 2.50
|
|
output_cost_per_m = 15.0
|
|
supports_tools = true
|
|
supports_vision = true
|
|
supports_streaming = true
|
|
aliases = []
|
|
|
|
[[models]]
|
|
id = "gpt-5.4-mini"
|
|
display_name = "GPT-5.4 Mini"
|
|
tier = "balanced"
|
|
context_window = 400000
|
|
max_output_tokens = 128000
|
|
input_cost_per_m = 0.75
|
|
output_cost_per_m = 4.50
|
|
supports_tools = true
|
|
supports_vision = true
|
|
supports_streaming = true
|
|
aliases = []
|
|
|
|
# GPT-5.5 — released 2026-04-23.
|
|
# Source: https://openai.com/index/introducing-gpt-5-5/
|
|
# API availability announced as "very soon" at publication; pricing confirmed.
|
|
[[models]]
|
|
id = "gpt-5.5"
|
|
display_name = "GPT-5.5"
|
|
tier = "frontier"
|
|
context_window = 1000000
|
|
max_output_tokens = 128000
|
|
input_cost_per_m = 5.00
|
|
output_cost_per_m = 30.00
|
|
supports_tools = true
|
|
supports_vision = true
|
|
supports_streaming = true
|
|
aliases = []
|
|
|
|
[[models]]
|
|
id = "gpt-5.5-pro"
|
|
display_name = "GPT-5.5 Pro"
|
|
tier = "frontier"
|
|
context_window = 1000000
|
|
max_output_tokens = 128000
|
|
input_cost_per_m = 30.00
|
|
output_cost_per_m = 180.00
|
|
supports_tools = true
|
|
supports_vision = true
|
|
supports_streaming = true
|
|
aliases = []
|
|
|
|
# Codex variants (same OpenAI driver & API key)
|
|
|
|
[[models]]
|
|
id = "codex/gpt-4.1"
|
|
display_name = "GPT-4.1 (Codex)"
|
|
tier = "frontier"
|
|
context_window = 1047576
|
|
max_output_tokens = 32768
|
|
input_cost_per_m = 2.00
|
|
output_cost_per_m = 8.00
|
|
supports_tools = true
|
|
supports_vision = true
|
|
supports_streaming = true
|
|
aliases = ["codex", "codex-4.1"]
|
|
|
|
[[models]]
|
|
id = "codex/o4-mini"
|
|
display_name = "o4-mini (Codex)"
|
|
tier = "smart"
|
|
context_window = 200000
|
|
max_output_tokens = 100000
|
|
input_cost_per_m = 1.10
|
|
output_cost_per_m = 4.40
|
|
supports_tools = true
|
|
supports_vision = true
|
|
supports_streaming = true
|
|
supports_thinking = true
|
|
aliases = ["codex-o4"]
|
|
|
|
# Image generation — priced per token (text + image), no conventional context
|
|
# window. Snapshot gpt-image-2-2026-04-21 released 2026-04-21.
|
|
# Source: https://developers.openai.com/api/docs/models/gpt-image-2
|
|
# Pricing: https://developers.openai.com/api/docs/pricing
|
|
[[models]]
|
|
id = "gpt-image-2"
|
|
display_name = "GPT Image 2"
|
|
tier = "frontier"
|
|
modality = "image"
|
|
input_cost_per_m = 5.00
|
|
output_cost_per_m = 10.00
|
|
image_input_cost_per_m = 8.00
|
|
image_output_cost_per_m = 30.00
|
|
supports_tools = false
|
|
supports_vision = true
|
|
supports_streaming = false
|
|
aliases = ["gpt-image-2-2026-04-21"]
|