You can use the Literal platform to instrument OpenAI API calls. This allows you to track and monitor the usage of the OpenAI API in your application and replay them in the Prompt Playground.

The OpenAI instrumentation supports sync, async, streamed and regular responses!

Instrumenting OpenAI API calls

With Threads and Steps

You can use Threads and Steps on top of the OpenAI API to create structured and organized logs.

Which will produce the following logs in the Threads page:

OpenAI thread