OPENAI_API_KEY and choose a model your project can use for OPENAI_MODEL.
Track a Responses call
For embeddings, Brello records input tokens and zero output tokens. Brello estimates token costs from OpenAI’s usage metadata. Separate charges for built-in tools, such as file search calls or Code Interpreter containers, are excluded from the estimate. Brello leaves prompts, outputs, tool arguments, and embedding vectors in your application.
Track background Responses
For background Responses, poll withresponses.retrieve(response_id) on the same wrapped client or consume a resumed stream with responses.stream(response_id=..., starting_after=...). Brello records the response once it observes a terminal status. If a different wrapped client resumes the stream, Brello uses that client’s current context when it has no record of the original call.
Track async Chat Completions streaming
Request the final usage chunk withstream_options={"include_usage": True} and consume the provider stream as usual.
usage: null. Brello captures x-request-id from the OpenAI streaming response when available. With with_raw_response or with_streaming_response, Brello keeps the body available to your application and records basic request metadata without token usage.