Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 31 additions & 0 deletions packages/cost/models/authors/openai/gpt-image-2/endpoints.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
import { ModelProviderName } from "../../../providers";
import type { ModelProviderConfig } from "../../../types";
import { GPTImage2ModelName } from "./models";

export const endpoints = {
"gpt-image-2:openai": {
providerModelId: "gpt-image-2",
provider: "openai",
author: "openai",
pricing: [
{
threshold: 0,
input: 0.00001, // $10.00 per 1M tokens
output: 0.00004, // $40.00 per 1M tokens
},
],
contextLength: 8192,
maxCompletionTokens: 4096,
rateLimits: {
rpm: 500,
tpm: 1000000,
},
supportedParameters: ["n"],
ptbEnabled: false,
endpointConfigs: {
"*": {},
},
},
} satisfies Partial<
Record<`${GPTImage2ModelName}:${ModelProviderName}`, ModelProviderConfig>
>;
17 changes: 17 additions & 0 deletions packages/cost/models/authors/openai/gpt-image-2/models.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import type { ModelConfig } from "../../../types";

export const models = {
"gpt-image-2": {
name: "OpenAI GPT Image 2",
author: "openai",
description:
"GPT Image 2 is OpenAI's advanced image generation model with superior text rendering, instruction following, and image editing capabilities. It supports text and image inputs to produce high-fidelity images.",
contextLength: 8192,
maxOutputTokens: 4096,
created: "2025-03-25T00:00:00.000Z",
modality: { inputs: ["text", "image"], outputs: ["image", "text"] },
tokenizer: "GPT",
},
} satisfies Record<string, ModelConfig>;

export type GPTImage2ModelName = keyof typeof models;
4 changes: 4 additions & 0 deletions packages/cost/models/authors/openai/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ import { models as gpt52Models } from "./gpt-5.2/models";
import { models as gpt54Models } from "./gpt-5.4/models";
import { models as ossModels } from "./oss/models";
import { models as gptImage1Models } from "./gpt-image-1/models";
import { models as gptImage2Models } from "./gpt-image-2/models";

// Import endpoints
import { endpoints as gpt4oEndpoints } from "./gpt-4o/endpoints";
Expand All @@ -30,6 +31,7 @@ import { endpoints as gpt52Endpoints } from "./gpt-5.2/endpoints";
import { endpoints as gpt54Endpoints } from "./gpt-5.4/endpoints";
import { endpoints as ossEndpoints } from "./oss/endpoints";
import { endpoints as gptImage1Endpoints } from "./gpt-image-1/endpoints";
import { endpoints as gptImage2Endpoints } from "./gpt-image-2/endpoints";

// Aggregate models
export const openaiModels = {
Expand All @@ -44,6 +46,7 @@ export const openaiModels = {
...gpt54Models,
...ossModels,
...gptImage1Models,
...gptImage2Models,
} satisfies Record<string, ModelConfig>;

// Aggregate endpoints
Expand All @@ -59,4 +62,5 @@ export const openaiEndpointConfig = {
...gpt54Endpoints,
...ossEndpoints,
...gptImage1Endpoints,
...gptImage2Endpoints,
} satisfies Record<string, ModelProviderConfig>;