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.
This request was merged into another request
Comments2
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
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.