Skip to content

Improve openai image model cost calculationΒ #2349

@reynaldichernando

Description

@reynaldichernando

this is similar to gemini issue #2348

openai also charge based on input and output tokens

input tokens:

  • the text prompt length

output tokens:

  • actual image
  • reasoning tokens

note:

  • i didn't put image as input here, because our txt2img API doesn't allow yet for image input
  • although this is supported in their API, maybe in another issue if we want to do this
  • https://platform.openai.com/docs/api-reference/images/createEdit
  • gpt-image-1.5 is multimodal, which allows it to output text, so same concern if it outputs text token, and it is unnaccounted

https://openai.com/api/pricing/

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions