Skip to content

feat: add cost and rendering support for gpt-image-1 and gpt-image-1.5#5536

Merged
chitalian merged 3 commits intomainfrom
claude/add-gpt-1.5-image-cost-I3iVx
Jan 21, 2026
Merged

feat: add cost and rendering support for gpt-image-1 and gpt-image-1.5#5536
chitalian merged 3 commits intomainfrom
claude/add-gpt-1.5-image-cost-I3iVx

Conversation

@chitalian
Copy link
Contributor

  • Add mapper type detection for gpt-image-1* models to render as openai-image type
  • Add cost configuration for gpt-image-1 and gpt-image-1.5 models
  • Set ptbEnabled: false for both image models as requested
  • Pricing: gpt-image-1.5 at $5/1M input, $10/1M output
  • Pricing: gpt-image-1 at $6.25/1M input, $12.50/1M output

- Add mapper type detection for gpt-image-1* models to render as openai-image type
- Add cost configuration for gpt-image-1 and gpt-image-1.5 models
- Set ptbEnabled: false for both image models as requested
- Pricing: gpt-image-1.5 at $5/1M input, $10/1M output
- Pricing: gpt-image-1 at $6.25/1M input, $12.50/1M output
@vercel
Copy link

vercel bot commented Jan 21, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Review Updated (UTC)
helicone Ready Ready Preview, Comment Jan 21, 2026 8:12pm
helicone-bifrost Ready Ready Preview, Comment Jan 21, 2026 8:12pm
helicone-eu Ready Ready Preview, Comment Jan 21, 2026 8:12pm

Request Review

Copy link
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Your free trial has ended. If you'd like to continue receiving code reviews, you can add a payment method here.

@supabase
Copy link

supabase bot commented Jan 21, 2026

This pull request has been ignored for the connected project bolqqmqbrciybnypvklh because there are no changes detected in supbase/supabase directory. You can change this behaviour in Project Integrations Settings ↗︎.


Preview Branches by Supabase.
Learn more about Supabase Branching ↗︎.

@supabase
Copy link

supabase bot commented Jan 21, 2026

This pull request has been ignored for the connected project lmahfbbnchpworytrrqk because there are no changes detected in .supabase/supabase directory. You can change this behaviour in Project Integrations Settings ↗︎.


Preview Branches by Supabase.
Learn more about Supabase Branching ↗︎.

@claude
Copy link
Contributor

claude bot commented Jan 21, 2026

Claude finished @chitalian's task —— View job


PR Review - GPT Image Model Support

Todo List:

  • Read and analyze all changed files
  • Review cost configuration implementation
  • Check mapper type detection logic
  • Validate test snapshots
  • Provide comprehensive feedback with confidence score

Score: 7/10 - Minor improvements suggested, generally ready to merge

Analysis Summary

This PR adds support for OpenAI's new gpt-image-1 and gpt-image-1.5 models, implementing cost tracking and proper mapper type detection. The implementation follows existing patterns well.

Issues Found:

1. Pricing Inconsistency (Minor)

The snapshot test shows only gpt-image-1.5 pricing, but both models are defined:

In endpoints.ts:

  • gpt-image-1: $6.25/$12.50 per 1M tokens
  • gpt-image-1.5: $5.00/$10.00 per 1M tokens

In registrySnapshots.test.ts.snap:

"openai/gpt-image-1": {
  "openai": [
    {
      "input": 0.000005,    // This is gpt-image-1.5 pricing
      "output": 0.00001,    // This is gpt-image-1.5 pricing
      "threshold": 0,
    },
  ],
}

Recommendation: The snapshot should include both models' pricing or be regenerated to reflect the actual implementation.

2. Missing Context Information (Minor)

The models have identical specs except pricing:

  • contextLength: 8192
  • maxOutputTokens: 4096
  • rateLimits: { rpm: 500, tpm: 1000000 }

Question: Are these the correct specifications for image generation models? Image models typically have different context/token limitations than chat models.

3. Model Creation Dates (Minor)

In models.ts:

  • gpt-image-1: "2025-04-01T00:00:00.000Z"
  • gpt-image-1.5: "2025-12-01T00:00:00.000Z"

Recommendation: Verify these are the actual release dates from OpenAI.

Positive Aspects:

Proper Architecture: Follows the established pattern with separate models.ts and endpoints.ts files
Correct Mapper Integration: Added to getMapperType.ts with proper pattern matching for gpt-image-1*
Comprehensive Integration: Properly exported in openai/index.ts
Disabled PTB: Correctly set ptbEnabled: false as requested
Type Safety: Uses proper TypeScript types and satisfies constraints

Code Quality:

  • Clean, readable implementation
  • Follows existing patterns and conventions
  • Proper imports and exports
  • Good type definitions

Suggestions:

  1. Regenerate test snapshots to ensure they match the actual pricing configuration
  2. Verify model specifications (context length, rate limits) with OpenAI documentation
  3. Consider adding a comment explaining the different pricing tiers between the two models

Security/Performance:

  • No security concerns identified
  • No performance implications
  • Standard cost calculation patterns used

Ready to merge with minor snapshot validation recommended.

Add snapshot entries for gpt-image-1 and gpt-image-1.5 models:
- endpoint configurations
- model coverage
- pricing
- modelToProviders
- update totalEndpoints/totalModelProviderConfigs to 290
- update openai modelCount to 31
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.

2 participants