Skip to content

feat: Add usage field to image generation responses #570

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed

Conversation

the-fermi-paradox
Copy link
Contributor

What:

  • New Feature

Description:

Adds the 'usage' field which is supplied by OpenAI in Image creation responses.

Related:

#569

@abikali
Copy link
Contributor

abikali commented Apr 30, 2025

We worked on this together #571

I've included the usage for the variation and edit as well

@the-fermi-paradox
Copy link
Contributor Author

We certainly did not work on this together. I'm not sure what you mean.

@abikali
Copy link
Contributor

abikali commented Apr 30, 2025

You misunderstood me.

I meant we worked on the same feature at the same time.
We created the same feature PR in a 20 mins difference, which technically means we worked on the same feature together.

Apologies for the wording/misunderstanding, getting late here, heading to sleep.

Copy link
Collaborator

@iBotPeaches iBotPeaches left a comment

Choose a reason for hiding this comment

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

looks good! Will merge in the morning.

@SeriousOne
Copy link

Will we get a new version today (v0.10.4)?

@abikali
Copy link
Contributor

abikali commented Apr 30, 2025

This PR only returns usage on the Create image endpoint, whereas OpenAI returns the usage on the Create, Edit and Variation endpoint. see https://platform.openai.com/docs/api-reference/images/object

I already handled these endpoints in my PR #571

If you want to merge this PR, I can push my changes here, but don't really see the reason for it.
@iBotPeaches

@iBotPeaches
Copy link
Collaborator

Probably first time I've ever seen the same-ish PR worked on by two different people around the same time. Should free up in an hour to take a look at all of this again and do some merging.

@the-fermi-paradox
Copy link
Contributor Author

@iBotPeaches Haha, yeah, it was bizarre to me too.

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.

4 participants