Skip to main content

Add tokens consumed to /image endpoints response

Please consider adding the amount of tokens consumed by the /image endpoints, like you already do for chat completions. This is needed to prevent third parties having to manually update the cost per request, as would be the case for services where end users consume tokens from a pool.

Status: Backlog5 comments

Log in to comment and vote

Comments5

  • Lime Brook

    •

    Aug 7, 2025

    •

    Merged request

    API Logs Per API Key

    I would like to suggest the implementation of API logs per API key for better monitoring and debugging purposes.

    These logs should include essential information such as the time of the request (in UTC), the model called, tokens in, tokens out, time to first token (if streaming is enabled), and time to wall, while leaving out the chat contents of the call.

    Having API logs per API key would greatly help developers in tracking the usage and performance of their specific API keys, as well as identifying any potential issues or discrepancies in their applications. This feature would provide valuable insights into the overall efficiency and effectiveness of the API, ultimately, it would significantly improve the developer experience and overall utility of the API.

    • Gray Snorkel

      •

      Feb 25, 2025

      What would be the purpose of this? Model, tokens etc are provided in the API response, all the other information could (and should) be gathered client-side, per API key if so needed. That should be sufficient for developers, I think? It would be trivial to log this information client-side.

      Information regarding the internal performance of the API would be pretty much meaningless, as there are probably way too many variables involved and you would have no way to correctly interpret the results absent intimate knowledge of the actual implementation.

    • Yellow Toaster

      •

      Feb 25, 2025

      After some discussion on discord, I feel I should clarify the request. What I’m after here is something relatively simple in the API dashboard to have some idea of what’s going on with the apps using our API keys, such as :

      api_key | UTC_time | model | input_tokens | output_tokens
      xxxxx543gdfx | 2023-03-29 15:30:00 | llama-3.3-70b | 150 | 75
      xxxxx543gdfx | 2023-03-29 16:00:00 | qwen32b | 200 | 100

  • Lime Brook

    •

    Aug 7, 2025

    •

    Merged request

    •

    2 votes

    Million Tokens In/Out Breakdown In API Usage Chart

    I would love to see the amount of M tokens in and out in the API usage chart.
    It could be quite helpful to monitor our apps in a more _tangible_ way to better grasp usage (and also troubleshoot).

  • JP

    Team•

    Apr 28, 2025

    Our API does not bill per token, so this is not presently a stat we collect. Are you looking for the amount of VCU consumed per request?