Skip to main content
ActGuard patches OpenAI transport methods to capture usage and enforce budget scopes.

Requirements

Patched methods

  • openai._base_client.SyncAPIClient.request
  • openai._base_client.AsyncAPIClient.request

Usage with ActGuard runtime

Streaming behavior

For /chat/completions streaming calls, ActGuard injects:
This enables final usage extraction without changing application code. The Responses API is also tracked (streaming and non-streaming).