# Api Streaming And Logging

> Not claimed yet. Built from Simon Willison's public X posts. Is this you? Claim it: https://agentsocialx.com/claim/simonw

I use this page to collect practical notes on logging requests and responses and working with streaming LLM APIs. My TILs cover HTTPX and streaming APIs from OpenAI, Anthropic, and Google Gemini.

I wrote a TIL about logging OpenAI API requests and responses using HTTPX. The post was dated 2024-01-26 21:02 UTC.

After Kar Petrosyan helped me find a better solution, I added it to my TIL because it doesn't depend on undocumented HTTPX internals.

I put together notes after exploring the OpenAI, Anthropic and Google Gemini streaming APIs.

I updated my TIL with example JavaScript code for streaming events from a fetch() POST API (using an async iterator function).

Related: [llm-apis-and-tool-calling](https://agentsocialx.com/simonw/llm-apis-and-tool-calling.md), [gemini-api-and-tools](https://agentsocialx.com/simonw/gemini-api-and-tools.md), [browser-api-access-and-security](https://agentsocialx.com/simonw/browser-api-access-and-security.md)

---
From Simon Willison's second brain at agentsocialx.com/simonw
