models

package
v1.2.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 17, 2026 License: MIT Imports: 0 Imported by: 0

Documentation

Overview

Package models / embeddings.go contains list and properties of OpenAI embedding models.

Package models / images.go contains list and properties of OpenAI image generation models.

Package models / text.go contains list and properties of OpenAI text generation models.

Package models / tts.go contains list and properties of OpenAI text-to-speech models.

Package models / video.go contains pricing information for OpenAI video models.

Index

Constants

View Source
const (
	DefaultEmbedding = ThreeSmall
	ThreeLarge       = "text-embedding-3-large"
	ThreeSmall       = "text-embedding-3-small"
)
View Source
const (
	DefaultImage       = GPTImage1
	GPTImage1          = "gpt-image-1"
	GPTImage15         = "gpt-image-1.5"
	GPTImage1Mini      = "gpt-image-1-mini"
	ChatGPTImageLatest = "chatgpt-image-latest"
	DALLE2             = "dall-e-2"
	DALLE3             = "dall-e-3"
)
View Source
const (
	Default     = Latest
	DefaultMini = GPT5Mini
	DefaultNano = GPT5Nano
	Latest      = GPT52

	// GPT35Turbo-3.5 family
	GPT35Turbo = "gpt-3.5-turbo"
	GPTSnap    = "gpt-3.5-turbo-0125"
	GPT31106   = "gpt-3.5-turbo-1106"

	// GPT-4 family
	GPT4Turbo0125     = "gpt-4-0125-preview"
	GPT4TurboPreview  = "gpt-4-turbo-preview"
	GPT4Turbo         = "gpt-4-turbo"
	GPT4Turbo20240409 = "gpt-4-turbo-2024-04-09"

	GPT4Quasar             = "gpt-4.1"
	GPT4Quasar20250414     = "gpt-4.1-2025-04-14"
	GPT4QuasarMini         = "gpt-4.1-mini"
	GPT4QuasarMini20250414 = "gpt-4.1-mini-2025-04-14"
	GPT4QuasarNano         = "gpt-4.1-nano"
	GPT4QuasarNano20250414 = "gpt-4.1-nano-2025-04-14"

	// GPT-4o family
	GPT4Omni          = "gpt-4o"
	GPT4oLatest       = "chatgpt-4o-latest"
	GPT4o20240513     = "gpt-4o-2024-05-13"
	GPT4o20240806     = "gpt-4o-2024-08-06"
	GPT4o20241120     = "gpt-4o-2024-11-20"
	GPT4oMini         = "gpt-4o-mini"
	GPT4oMini20240718 = "gpt-4o-mini-2024-07-18"

	GPT4oSearchPreview               = "gpt-4o-search-preview"
	GPT4oSearchPreview20250311       = "gpt-4o-search-preview-2025-03-11"
	GPT4oMiniSearchPreview           = "gpt-4o-mini-search-preview"
	GPT4oMiniSearchPreview20250311   = "gpt-4o-mini-search-preview-2025-03-11"
	GPT4oRealtimePreview             = "gpt-4o-realtime-preview"
	GPT4oRealtimePreview20241217     = "gpt-4o-realtime-preview-2024-12-17"
	GPT4oRealtimePreview20250603     = "gpt-4o-realtime-preview-2025-06-03"
	GPT4oMiniRealtimePreview         = "gpt-4o-mini-realtime-preview"
	GPT4oMiniRealtimePreview20241217 = "gpt-4o-mini-realtime-preview-2024-12-17"
	GPT4oAudioPreview                = "gpt-4o-audio-preview"
	GPT4oAudioPreview20241217        = "gpt-4o-audio-preview-2024-12-17"
	GPT4oAudioPreview20250603        = "gpt-4o-audio-preview-2025-06-03"
	GPT4oMiniAudioPreview            = "gpt-4o-mini-audio-preview"
	GPT4oMiniAudioPreview20241217    = "gpt-4o-mini-audio-preview-2024-12-17"
	GPT4oTranscribe                  = "gpt-4o-transcribe"
	GPT4oTranscribeDiarize           = "gpt-4o-transcribe-diarize"
	GPT4oMiniTranscribe              = "gpt-4o-mini-transcribe"
	GPT4oMiniTranscribe20250320      = "gpt-4o-mini-transcribe-2025-03-20"
	GPT4oMiniTranscribe20251215      = "gpt-4o-mini-transcribe-2025-12-15"
	GPT4oMiniTTS                     = "gpt-4o-mini-tts"

	// GPT-5 family
	GPT5                  = "gpt-5"
	GPT520250807          = "gpt-5-2025-08-07"
	GPT5Mini              = "gpt-5-mini"
	GPT5Mini20250807      = "gpt-5-mini-2025-08-07"
	GPT5Nano              = "gpt-5-nano"
	GPT5Nano20250807      = "gpt-5-nano-2025-08-07"
	GPT5ChatLatest        = "gpt-5-chat-latest"
	GPT5Codex             = "gpt-5-codex"
	GPT5Pro               = "gpt-5-pro"
	GPT5Pro20251006       = "gpt-5-pro-2025-10-06"
	GPT5SearchAPI         = "gpt-5-search-api"
	GPT5SearchAPI20251014 = "gpt-5-search-api-2025-10-14"
	GPT51                 = "gpt-5.1"
	GPT5120251113         = "gpt-5.1-2025-11-13"
	GPT51ChatLatest       = "gpt-5.1-chat-latest"
	GPT51Codex            = "gpt-5.1-codex"
	GPT51CodexMax         = "gpt-5.1-codex-max"
	GPT51CodexMini        = "gpt-5.1-codex-mini"
	GPT52                 = "gpt-5.2"
	GPT5220251113         = "gpt-5.2-2025-12-11"
	GPT52ChatLatest       = "gpt-5.2-chat-latest"
	GPT52Pro              = "gpt-5.2-pro"
	GPT52Pro20251211      = "gpt-5.2-pro-2025-12-11"
	GPT52Codex            = "gpt-5.2-codex"

	// Multimodal realtime & audio
	GPTRealtime             = "gpt-realtime"
	GPTRealtime20250828     = "gpt-realtime-2025-08-28"
	GPTRealtimeMini         = "gpt-realtime-mini"
	GPTRealtimeMini20251006 = "gpt-realtime-mini-2025-10-06"
	GPTRealtimeMini20251215 = "gpt-realtime-mini-2025-12-15"
	GPTAudio                = "gpt-audio"
	GPTAudio20250828        = "gpt-audio-2025-08-28"
	GPTAudioMini            = "gpt-audio-mini"
	GPTAudioMini20251006    = "gpt-audio-mini-2025-10-06"
	GPTAudioMini20251215    = "gpt-audio-mini-2025-12-15"

	// O-series
	GPTO1                         = "o1"
	GPTO120241217                 = "o1-2024-12-17"
	GPTO1Mini                     = "o1-mini"
	GPTO1Mini20240912             = "o1-mini-2024-09-12"
	GPTO1Pro                      = "o1-pro"
	GPTO1Pro20250319              = "o1-pro-2025-03-19"
	GPTO3                         = "o3"
	GPTO320250416                 = "o3-2025-04-16"
	GPTO3Mini                     = "o3-mini"
	GPTO3Mini20250131             = "o3-mini-2025-01-31"
	GPTO3Pro                      = "o3-pro"
	GPTO3Pro20250610              = "o3-pro-2025-06-10"
	GPTO3DeepResearch             = "o3-deep-research"
	GPTO3DeepResearch20250626     = "o3-deep-research-2025-06-26"
	GPTO4Mini                     = "o4-mini"
	GPTO4Mini20250416             = "o4-mini-2025-04-16"
	GPTO4MiniDeepResearch         = "o4-mini-deep-research"
	GPTO4MiniDeepResearch20250626 = "o4-mini-deep-research-2025-06-26"

	// Tooling / moderation
	ComputerUsePreview         = "computer-use-preview"
	ComputerUsePreview20250311 = "computer-use-preview-2025-03-11"
	CodexMiniLatest            = "codex-mini-latest"

	// Completion models
	Curie           = "text-curie-001"
	Davinci3        = "davinci-002"
	Davinci         = "davinci"
	DavinciInstruct = "davinci-instruct-beta"
	GPTInstruct     = "gpt-3.5-turbo-instruct"
	GPTInstruct0914 = "gpt-3.5-turbo-instruct-0914"
	Babbage002      = "babbage-002"

	// Moderation defaults
	DefaultModeration = OmniMod
	OmniMod           = "omni-moderation-latest"
	OmniMod20240926   = "omni-moderation-2024-09-26"
	ModTextLatest     = "text-moderation-latest"
	ModTextStable     = "text-moderation-stable"
)
View Source
const (
	TTS11106             = "tts-1-1106"
	TTS1HD               = "tts-1-hd"
	TTS1HD1106           = "tts-1-hd-1106"
	GPT4oMiniTTS20250320 = "gpt-4o-mini-tts-2025-03-20"
	GPT4oMiniTTS20251215 = "gpt-4o-mini-tts-2025-12-15"
)
View Source
const (
	Sora2    = "sora-2"
	Sora2Pro = "sora-2-pro"
)

Variables

View Source
var Data = map[string]struct {
	PriceIn       float64
	PriceCachedIn float64
	PriceOut      float64
	LimitContext  int
	LimitOutput   int

}{}/* 105 elements not displayed */

Data contains price per 1 token for each model, separately for input and output, and token limits. Note that pricing page https://openai.com/pricing lists price per 1k tokens and here it's per 1 token. The "" denotes default values.

View Source
var DataEmbedding = map[string]float64{
	ThreeLarge: 0.00000013,
	ThreeSmall: 0.00000002,
}

DataEmbedding contains price per 1 token for each embedding model.

View Source
var DataTTS = map[string]TTSPricing{
	TTS11106: {
		PricePerCharacter:  0.00001500,
		ApproxUSDPerMinute: 0.01500,
		LimitCharacters:    16384,
	},
	TTS1HD: {
		PricePerCharacter:  0.00003000,
		ApproxUSDPerMinute: 0.03000,
		LimitCharacters:    16384,
	},
	TTS1HD1106: {
		PricePerCharacter:  0.00003000,
		ApproxUSDPerMinute: 0.03000,
		LimitCharacters:    16384,
	},
	GPT4oMiniTTS20250320: {
		PricePerCharacter:  0.00001500,
		ApproxUSDPerMinute: 0.01500,
		LimitCharacters:    16384,
	},
	GPT4oMiniTTS20251215: {
		PricePerCharacter:  0.00001500,
		ApproxUSDPerMinute: 0.01500,
		LimitCharacters:    16384,
	},
}

DataTTS lists pricing information for text-to-speech models.

View Source
var ImageData = map[string]struct {
	PriceInText      float64
	PriceInImage     float64
	PriceOut         float64
	PricePerImage    PricePerImage
	LimitPrompt      int
	LimitInImages    int
	LimitInImageSize int // in bytes
	LimitOutImages   int
}{
	GPTImage1:     {0.00000500, 0.00001000, 0.00004000, PricePerImageData[GPTImage1], 32000, 16, 25 * 1024 * 1024, 10},
	GPTImage1Mini: {0.00000200, 0.00000250, 0.00000800, PricePerImageData[GPTImage1Mini], 32000, 16, 25 * 1024 * 1024, 10},
	DALLE2:        {0.00000000, 0.00000000, 0.00000000, PricePerImageData[DALLE2], 1000, 1, 4 * 1024 * 1024, 1},
	DALLE3:        {0.00000000, 0.00000000, 0.00000000, PricePerImageData[DALLE3], 4000, 1, 4 * 1024 * 1024, 1},
}

ImageData contains pricing and limits for image generation models. Prompt size limit is in characters here, not in tokens.

View Source
var PricePerImageData = map[string]PricePerImage{
	ChatGPTImageLatest: {
		"low": {
			"1024x1024": 0.009,
			"1024x1536": 0.013,
			"1536x1024": 0.013,
		},
		"medium": {
			"1024x1024": 0.034,
			"1024x1536": 0.05,
			"1536x1024": 0.05,
		},
		"high": {
			"1024x1024": 0.133,
			"1024x1536": 0.2,
			"1536x1024": 0.2,
		},
	},
	GPTImage1: {
		"low": {
			"1024x1024": 0.011,
			"1024x1536": 0.016,
			"1536x1024": 0.016,
		},
		"medium": {
			"1024x1024": 0.042,
			"1024x1536": 0.063,
			"1536x1024": 0.063,
		},
		"high": {
			"1024x1024": 0.167,
			"1024x1536": 0.25,
			"1536x1024": 0.25,
		},
	},
	GPTImage15: {
		"low": {
			"1024x1024": 0.009,
			"1024x1536": 0.013,
			"1536x1024": 0.013,
		},
		"medium": {
			"1024x1024": 0.034,
			"1024x1536": 0.05,
			"1536x1024": 0.05,
		},
		"high": {
			"1024x1024": 0.133,
			"1024x1536": 0.2,
			"1536x1024": 0.2,
		},
	},
	GPTImage1Mini: {
		"low": {
			"1024x1024": 0.005,
			"1024x1536": 0.006,
			"1536x1024": 0.006,
		},
		"medium": {
			"1024x1024": 0.011,
			"1024x1536": 0.015,
			"1536x1024": 0.015,
		},
		"high": {
			"1024x1024": 0.036,
			"1024x1536": 0.052,
			"1536x1024": 0.052,
		},
	},
	DALLE2: {
		"standard": {
			"256x256":   0.016,
			"512x512":   0.018,
			"1024x1024": 0.02,
		},
	},
	DALLE3: {
		"standard": {
			"1024x1024": 0.04,
			"1024x1792": 0.08,
			"1792x1024": 0.08,
		},
		"hd": {
			"1024x1024": 0.08,
			"1024x1792": 0.12,
			"1792x1024": 0.12,
		},
	},
}

PricePerImageData contains pricing of generated images for image generation models. For newer models, same pricing can be calculated based on token usage data.

View Source
var VideoData = map[string]PricePerSecond{
	Sora2: {
		"720x1280": 0.10,
		"1280x720": 0.10,
	},
	Sora2Pro: {
		"720x1280":  0.30,
		"1280x720":  0.30,
		"1024x1792": 0.50,
		"1792x1024": 0.50,
	},
}

VideoData contains pricing of video generation models per rendered second.

Functions

This section is empty.

Types

type PricePerImage

type PricePerImage map[string]map[string]float64

PricePerImageData contains pricing in USD per generated image depending on (1) quality and (2) size.

type PricePerSecond added in v1.0.3

type PricePerSecond map[string]float64

PricePerSecond stores pricing data in USD per generated second indexed by the output resolution.

type TTSPricing added in v1.0.3

type TTSPricing struct {
	PricePerCharacter  float64
	ApproxUSDPerMinute float64
	LimitCharacters    int
}

TTSPricing captures pricing and limits specific to text-to-speech models.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL