revenium-python-sdk 0.10.0__tar.gz → 0.11.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (194) hide show
  1. {revenium_python_sdk-0.10.0/revenium_python_sdk.egg-info → revenium_python_sdk-0.11.0}/PKG-INFO +44 -5
  2. {revenium_python_sdk-0.10.0 → revenium_python_sdk-0.11.0}/README.md +42 -3
  3. {revenium_python_sdk-0.10.0 → revenium_python_sdk-0.11.0}/pyproject.toml +7 -2
  4. {revenium_python_sdk-0.10.0 → revenium_python_sdk-0.11.0}/revenium_middleware/_core/__init__.py +2 -0
  5. {revenium_python_sdk-0.10.0 → revenium_python_sdk-0.11.0}/revenium_middleware/_core/enforcement.py +304 -46
  6. {revenium_python_sdk-0.10.0 → revenium_python_sdk-0.11.0}/revenium_middleware/_core/fields.py +14 -7
  7. {revenium_python_sdk-0.10.0 → revenium_python_sdk-0.11.0}/revenium_middleware/_core/wire_guards.py +20 -1
  8. {revenium_python_sdk-0.10.0 → revenium_python_sdk-0.11.0}/revenium_middleware/_metering/resources/ai.py +25 -4
  9. {revenium_python_sdk-0.10.0 → revenium_python_sdk-0.11.0}/revenium_middleware/_metering/types/ai_create_completion_params.py +8 -0
  10. {revenium_python_sdk-0.10.0 → revenium_python_sdk-0.11.0}/revenium_middleware/litellm/proxy/guardrail.py +61 -3
  11. {revenium_python_sdk-0.10.0 → revenium_python_sdk-0.11.0/revenium_python_sdk.egg-info}/PKG-INFO +44 -5
  12. {revenium_python_sdk-0.10.0 → revenium_python_sdk-0.11.0}/revenium_python_sdk.egg-info/requires.txt +1 -1
  13. {revenium_python_sdk-0.10.0 → revenium_python_sdk-0.11.0}/LICENSE +0 -0
  14. {revenium_python_sdk-0.10.0 → revenium_python_sdk-0.11.0}/revenium_middleware/__init__.py +0 -0
  15. {revenium_python_sdk-0.10.0 → revenium_python_sdk-0.11.0}/revenium_middleware/_core/cache_tokens.py +0 -0
  16. {revenium_python_sdk-0.10.0 → revenium_python_sdk-0.11.0}/revenium_middleware/_core/call_context.py +0 -0
  17. {revenium_python_sdk-0.10.0 → revenium_python_sdk-0.11.0}/revenium_middleware/_core/call_ownership.py +0 -0
  18. {revenium_python_sdk-0.10.0 → revenium_python_sdk-0.11.0}/revenium_middleware/_core/closable_scope.py +0 -0
  19. {revenium_python_sdk-0.10.0 → revenium_python_sdk-0.11.0}/revenium_middleware/_core/config.py +0 -0
  20. {revenium_python_sdk-0.10.0 → revenium_python_sdk-0.11.0}/revenium_middleware/_core/context.py +0 -0
  21. {revenium_python_sdk-0.10.0 → revenium_python_sdk-0.11.0}/revenium_middleware/_core/decorators.py +0 -0
  22. {revenium_python_sdk-0.10.0 → revenium_python_sdk-0.11.0}/revenium_middleware/_core/delivery_circuit.py +0 -0
  23. {revenium_python_sdk-0.10.0 → revenium_python_sdk-0.11.0}/revenium_middleware/_core/error_text.py +0 -0
  24. {revenium_python_sdk-0.10.0 → revenium_python_sdk-0.11.0}/revenium_middleware/_core/exceptions.py +0 -0
  25. {revenium_python_sdk-0.10.0 → revenium_python_sdk-0.11.0}/revenium_middleware/_core/failed_calls.py +0 -0
  26. {revenium_python_sdk-0.10.0 → revenium_python_sdk-0.11.0}/revenium_middleware/_core/json_safe.py +0 -0
  27. {revenium_python_sdk-0.10.0 → revenium_python_sdk-0.11.0}/revenium_middleware/_core/langchain_settings.py +0 -0
  28. {revenium_python_sdk-0.10.0 → revenium_python_sdk-0.11.0}/revenium_middleware/_core/load_diagnostics.py +0 -0
  29. {revenium_python_sdk-0.10.0 → revenium_python_sdk-0.11.0}/revenium_middleware/_core/log_sanitize.py +0 -0
  30. {revenium_python_sdk-0.10.0 → revenium_python_sdk-0.11.0}/revenium_middleware/_core/metering.py +0 -0
  31. {revenium_python_sdk-0.10.0 → revenium_python_sdk-0.11.0}/revenium_middleware/_core/metering_buffer.py +0 -0
  32. {revenium_python_sdk-0.10.0 → revenium_python_sdk-0.11.0}/revenium_middleware/_core/metering_pool.py +0 -0
  33. {revenium_python_sdk-0.10.0 → revenium_python_sdk-0.11.0}/revenium_middleware/_core/metering_status.py +0 -0
  34. {revenium_python_sdk-0.10.0 → revenium_python_sdk-0.11.0}/revenium_middleware/_core/metering_submission.py +0 -0
  35. {revenium_python_sdk-0.10.0 → revenium_python_sdk-0.11.0}/revenium_middleware/_core/outcomes.py +0 -0
  36. {revenium_python_sdk-0.10.0 → revenium_python_sdk-0.11.0}/revenium_middleware/_core/package_versions.py +0 -0
  37. {revenium_python_sdk-0.10.0 → revenium_python_sdk-0.11.0}/revenium_middleware/_core/parse_failures.py +0 -0
  38. {revenium_python_sdk-0.10.0 → revenium_python_sdk-0.11.0}/revenium_middleware/_core/patch_registry.py +0 -0
  39. {revenium_python_sdk-0.10.0 → revenium_python_sdk-0.11.0}/revenium_middleware/_core/perplexity_cost.py +0 -0
  40. {revenium_python_sdk-0.10.0 → revenium_python_sdk-0.11.0}/revenium_middleware/_core/perplexity_usage_metadata.py +0 -0
  41. {revenium_python_sdk-0.10.0 → revenium_python_sdk-0.11.0}/revenium_middleware/_core/prompt_extraction.py +0 -0
  42. {revenium_python_sdk-0.10.0 → revenium_python_sdk-0.11.0}/revenium_middleware/_core/responses_status.py +0 -0
  43. {revenium_python_sdk-0.10.0 → revenium_python_sdk-0.11.0}/revenium_middleware/_core/secret_shapes.py +0 -0
  44. {revenium_python_sdk-0.10.0 → revenium_python_sdk-0.11.0}/revenium_middleware/_core/selective_metering.py +0 -0
  45. {revenium_python_sdk-0.10.0 → revenium_python_sdk-0.11.0}/revenium_middleware/_core/shutdown_signals.py +0 -0
  46. {revenium_python_sdk-0.10.0 → revenium_python_sdk-0.11.0}/revenium_middleware/_core/sse_body_tap.py +0 -0
  47. {revenium_python_sdk-0.10.0 → revenium_python_sdk-0.11.0}/revenium_middleware/_core/subscriber.py +0 -0
  48. {revenium_python_sdk-0.10.0 → revenium_python_sdk-0.11.0}/revenium_middleware/_core/tool_event_transport.py +0 -0
  49. {revenium_python_sdk-0.10.0 → revenium_python_sdk-0.11.0}/revenium_middleware/_core/trace_fields.py +0 -0
  50. {revenium_python_sdk-0.10.0 → revenium_python_sdk-0.11.0}/revenium_middleware/_core/usage_iterations.py +0 -0
  51. {revenium_python_sdk-0.10.0 → revenium_python_sdk-0.11.0}/revenium_middleware/_core/vendor_model_aliases.py +0 -0
  52. {revenium_python_sdk-0.10.0 → revenium_python_sdk-0.11.0}/revenium_middleware/_metering/LICENSE +0 -0
  53. {revenium_python_sdk-0.10.0 → revenium_python_sdk-0.11.0}/revenium_middleware/_metering/__init__.py +0 -0
  54. {revenium_python_sdk-0.10.0 → revenium_python_sdk-0.11.0}/revenium_middleware/_metering/_base_client.py +0 -0
  55. {revenium_python_sdk-0.10.0 → revenium_python_sdk-0.11.0}/revenium_middleware/_metering/_client.py +0 -0
  56. {revenium_python_sdk-0.10.0 → revenium_python_sdk-0.11.0}/revenium_middleware/_metering/_compat.py +0 -0
  57. {revenium_python_sdk-0.10.0 → revenium_python_sdk-0.11.0}/revenium_middleware/_metering/_constants.py +0 -0
  58. {revenium_python_sdk-0.10.0 → revenium_python_sdk-0.11.0}/revenium_middleware/_metering/_exceptions.py +0 -0
  59. {revenium_python_sdk-0.10.0 → revenium_python_sdk-0.11.0}/revenium_middleware/_metering/_files.py +0 -0
  60. {revenium_python_sdk-0.10.0 → revenium_python_sdk-0.11.0}/revenium_middleware/_metering/_models.py +0 -0
  61. {revenium_python_sdk-0.10.0 → revenium_python_sdk-0.11.0}/revenium_middleware/_metering/_qs.py +0 -0
  62. {revenium_python_sdk-0.10.0 → revenium_python_sdk-0.11.0}/revenium_middleware/_metering/_resource.py +0 -0
  63. {revenium_python_sdk-0.10.0 → revenium_python_sdk-0.11.0}/revenium_middleware/_metering/_response.py +0 -0
  64. {revenium_python_sdk-0.10.0 → revenium_python_sdk-0.11.0}/revenium_middleware/_metering/_streaming.py +0 -0
  65. {revenium_python_sdk-0.10.0 → revenium_python_sdk-0.11.0}/revenium_middleware/_metering/_types.py +0 -0
  66. {revenium_python_sdk-0.10.0 → revenium_python_sdk-0.11.0}/revenium_middleware/_metering/_utils/__init__.py +0 -0
  67. {revenium_python_sdk-0.10.0 → revenium_python_sdk-0.11.0}/revenium_middleware/_metering/_utils/_logs.py +0 -0
  68. {revenium_python_sdk-0.10.0 → revenium_python_sdk-0.11.0}/revenium_middleware/_metering/_utils/_proxy.py +0 -0
  69. {revenium_python_sdk-0.10.0 → revenium_python_sdk-0.11.0}/revenium_middleware/_metering/_utils/_reflection.py +0 -0
  70. {revenium_python_sdk-0.10.0 → revenium_python_sdk-0.11.0}/revenium_middleware/_metering/_utils/_resources_proxy.py +0 -0
  71. {revenium_python_sdk-0.10.0 → revenium_python_sdk-0.11.0}/revenium_middleware/_metering/_utils/_streams.py +0 -0
  72. {revenium_python_sdk-0.10.0 → revenium_python_sdk-0.11.0}/revenium_middleware/_metering/_utils/_sync.py +0 -0
  73. {revenium_python_sdk-0.10.0 → revenium_python_sdk-0.11.0}/revenium_middleware/_metering/_utils/_transform.py +0 -0
  74. {revenium_python_sdk-0.10.0 → revenium_python_sdk-0.11.0}/revenium_middleware/_metering/_utils/_typing.py +0 -0
  75. {revenium_python_sdk-0.10.0 → revenium_python_sdk-0.11.0}/revenium_middleware/_metering/_utils/_utils.py +0 -0
  76. {revenium_python_sdk-0.10.0 → revenium_python_sdk-0.11.0}/revenium_middleware/_metering/_version.py +0 -0
  77. {revenium_python_sdk-0.10.0 → revenium_python_sdk-0.11.0}/revenium_middleware/_metering/context.py +0 -0
  78. {revenium_python_sdk-0.10.0 → revenium_python_sdk-0.11.0}/revenium_middleware/_metering/decorator.py +0 -0
  79. {revenium_python_sdk-0.10.0 → revenium_python_sdk-0.11.0}/revenium_middleware/_metering/py.typed +0 -0
  80. {revenium_python_sdk-0.10.0 → revenium_python_sdk-0.11.0}/revenium_middleware/_metering/resources/__init__.py +0 -0
  81. {revenium_python_sdk-0.10.0 → revenium_python_sdk-0.11.0}/revenium_middleware/_metering/resources/apis.py +0 -0
  82. {revenium_python_sdk-0.10.0 → revenium_python_sdk-0.11.0}/revenium_middleware/_metering/resources/events.py +0 -0
  83. {revenium_python_sdk-0.10.0 → revenium_python_sdk-0.11.0}/revenium_middleware/_metering/types/__init__.py +0 -0
  84. {revenium_python_sdk-0.10.0 → revenium_python_sdk-0.11.0}/revenium_middleware/_metering/types/ai_create_audio_params.py +0 -0
  85. {revenium_python_sdk-0.10.0 → revenium_python_sdk-0.11.0}/revenium_middleware/_metering/types/ai_create_image_params.py +0 -0
  86. {revenium_python_sdk-0.10.0 → revenium_python_sdk-0.11.0}/revenium_middleware/_metering/types/ai_create_video_params.py +0 -0
  87. {revenium_python_sdk-0.10.0 → revenium_python_sdk-0.11.0}/revenium_middleware/_metering/types/api_meter_request_params.py +0 -0
  88. {revenium_python_sdk-0.10.0 → revenium_python_sdk-0.11.0}/revenium_middleware/_metering/types/api_meter_response_params.py +0 -0
  89. {revenium_python_sdk-0.10.0 → revenium_python_sdk-0.11.0}/revenium_middleware/_metering/types/event_create_params.py +0 -0
  90. {revenium_python_sdk-0.10.0 → revenium_python_sdk-0.11.0}/revenium_middleware/_metering/types/metering_response_resource.py +0 -0
  91. {revenium_python_sdk-0.10.0 → revenium_python_sdk-0.11.0}/revenium_middleware/agentic_outcomes.py +0 -0
  92. {revenium_python_sdk-0.10.0 → revenium_python_sdk-0.11.0}/revenium_middleware/anthropic/__init__.py +0 -0
  93. {revenium_python_sdk-0.10.0 → revenium_python_sdk-0.11.0}/revenium_middleware/anthropic/bedrock_adapter.py +0 -0
  94. {revenium_python_sdk-0.10.0 → revenium_python_sdk-0.11.0}/revenium_middleware/anthropic/bedrock_model_names.py +0 -0
  95. {revenium_python_sdk-0.10.0 → revenium_python_sdk-0.11.0}/revenium_middleware/anthropic/bedrock_transport.py +0 -0
  96. {revenium_python_sdk-0.10.0 → revenium_python_sdk-0.11.0}/revenium_middleware/anthropic/config.py +0 -0
  97. {revenium_python_sdk-0.10.0 → revenium_python_sdk-0.11.0}/revenium_middleware/anthropic/inference_profiles.py +0 -0
  98. {revenium_python_sdk-0.10.0 → revenium_python_sdk-0.11.0}/revenium_middleware/anthropic/middleware.py +0 -0
  99. {revenium_python_sdk-0.10.0 → revenium_python_sdk-0.11.0}/revenium_middleware/anthropic/prompt_extractor.py +0 -0
  100. {revenium_python_sdk-0.10.0 → revenium_python_sdk-0.11.0}/revenium_middleware/anthropic/provider.py +0 -0
  101. {revenium_python_sdk-0.10.0 → revenium_python_sdk-0.11.0}/revenium_middleware/anthropic/raw_response.py +0 -0
  102. {revenium_python_sdk-0.10.0 → revenium_python_sdk-0.11.0}/revenium_middleware/anthropic/stream_create.py +0 -0
  103. {revenium_python_sdk-0.10.0 → revenium_python_sdk-0.11.0}/revenium_middleware/anthropic/trace_fields.py +0 -0
  104. {revenium_python_sdk-0.10.0 → revenium_python_sdk-0.11.0}/revenium_middleware/fal/__init__.py +0 -0
  105. {revenium_python_sdk-0.10.0 → revenium_python_sdk-0.11.0}/revenium_middleware/fal/_call.py +0 -0
  106. {revenium_python_sdk-0.10.0 → revenium_python_sdk-0.11.0}/revenium_middleware/fal/_metering.py +0 -0
  107. {revenium_python_sdk-0.10.0 → revenium_python_sdk-0.11.0}/revenium_middleware/fal/_queue.py +0 -0
  108. {revenium_python_sdk-0.10.0 → revenium_python_sdk-0.11.0}/revenium_middleware/fal/config.py +0 -0
  109. {revenium_python_sdk-0.10.0 → revenium_python_sdk-0.11.0}/revenium_middleware/fal/middleware.py +0 -0
  110. {revenium_python_sdk-0.10.0 → revenium_python_sdk-0.11.0}/revenium_middleware/fal/trace_fields.py +0 -0
  111. {revenium_python_sdk-0.10.0 → revenium_python_sdk-0.11.0}/revenium_middleware/google/__init__.py +0 -0
  112. {revenium_python_sdk-0.10.0 → revenium_python_sdk-0.11.0}/revenium_middleware/google/common/__init__.py +0 -0
  113. {revenium_python_sdk-0.10.0 → revenium_python_sdk-0.11.0}/revenium_middleware/google/common/exceptions.py +0 -0
  114. {revenium_python_sdk-0.10.0 → revenium_python_sdk-0.11.0}/revenium_middleware/google/common/protocols.py +0 -0
  115. {revenium_python_sdk-0.10.0 → revenium_python_sdk-0.11.0}/revenium_middleware/google/common/trace_fields.py +0 -0
  116. {revenium_python_sdk-0.10.0 → revenium_python_sdk-0.11.0}/revenium_middleware/google/common/types.py +0 -0
  117. {revenium_python_sdk-0.10.0 → revenium_python_sdk-0.11.0}/revenium_middleware/google/common/utils.py +0 -0
  118. {revenium_python_sdk-0.10.0 → revenium_python_sdk-0.11.0}/revenium_middleware/google/config.py +0 -0
  119. {revenium_python_sdk-0.10.0 → revenium_python_sdk-0.11.0}/revenium_middleware/google/google_ai/__init__.py +0 -0
  120. {revenium_python_sdk-0.10.0 → revenium_python_sdk-0.11.0}/revenium_middleware/google/google_ai/middleware.py +0 -0
  121. {revenium_python_sdk-0.10.0 → revenium_python_sdk-0.11.0}/revenium_middleware/google/google_ai/provider.py +0 -0
  122. {revenium_python_sdk-0.10.0 → revenium_python_sdk-0.11.0}/revenium_middleware/google/prompt_extractor.py +0 -0
  123. {revenium_python_sdk-0.10.0 → revenium_python_sdk-0.11.0}/revenium_middleware/google/vertex_ai/__init__.py +0 -0
  124. {revenium_python_sdk-0.10.0 → revenium_python_sdk-0.11.0}/revenium_middleware/google/vertex_ai/middleware.py +0 -0
  125. {revenium_python_sdk-0.10.0 → revenium_python_sdk-0.11.0}/revenium_middleware/google/vertex_ai/provider.py +0 -0
  126. {revenium_python_sdk-0.10.0 → revenium_python_sdk-0.11.0}/revenium_middleware/griptape/__init__.py +0 -0
  127. {revenium_python_sdk-0.10.0 → revenium_python_sdk-0.11.0}/revenium_middleware/griptape/_metadata.py +0 -0
  128. {revenium_python_sdk-0.10.0 → revenium_python_sdk-0.11.0}/revenium_middleware/griptape/_retry.py +0 -0
  129. {revenium_python_sdk-0.10.0 → revenium_python_sdk-0.11.0}/revenium_middleware/griptape/anthropic_driver.py +0 -0
  130. {revenium_python_sdk-0.10.0 → revenium_python_sdk-0.11.0}/revenium_middleware/griptape/budget_errors.py +0 -0
  131. {revenium_python_sdk-0.10.0 → revenium_python_sdk-0.11.0}/revenium_middleware/griptape/litellm_driver.py +0 -0
  132. {revenium_python_sdk-0.10.0 → revenium_python_sdk-0.11.0}/revenium_middleware/griptape/ollama_driver.py +0 -0
  133. {revenium_python_sdk-0.10.0 → revenium_python_sdk-0.11.0}/revenium_middleware/griptape/openai_driver.py +0 -0
  134. {revenium_python_sdk-0.10.0 → revenium_python_sdk-0.11.0}/revenium_middleware/griptape/openai_embedding_driver.py +0 -0
  135. {revenium_python_sdk-0.10.0 → revenium_python_sdk-0.11.0}/revenium_middleware/griptape/universal_driver.py +0 -0
  136. {revenium_python_sdk-0.10.0 → revenium_python_sdk-0.11.0}/revenium_middleware/job_context.py +0 -0
  137. {revenium_python_sdk-0.10.0 → revenium_python_sdk-0.11.0}/revenium_middleware/job_history.py +0 -0
  138. {revenium_python_sdk-0.10.0 → revenium_python_sdk-0.11.0}/revenium_middleware/job_type_economics.py +0 -0
  139. {revenium_python_sdk-0.10.0 → revenium_python_sdk-0.11.0}/revenium_middleware/litellm/__init__.py +0 -0
  140. {revenium_python_sdk-0.10.0 → revenium_python_sdk-0.11.0}/revenium_middleware/litellm/client/__init__.py +0 -0
  141. {revenium_python_sdk-0.10.0 → revenium_python_sdk-0.11.0}/revenium_middleware/litellm/client/config.py +0 -0
  142. {revenium_python_sdk-0.10.0 → revenium_python_sdk-0.11.0}/revenium_middleware/litellm/client/context.py +0 -0
  143. {revenium_python_sdk-0.10.0 → revenium_python_sdk-0.11.0}/revenium_middleware/litellm/client/decorators.py +0 -0
  144. {revenium_python_sdk-0.10.0 → revenium_python_sdk-0.11.0}/revenium_middleware/litellm/client/hooks.py +0 -0
  145. {revenium_python_sdk-0.10.0 → revenium_python_sdk-0.11.0}/revenium_middleware/litellm/client/integrations/__init__.py +0 -0
  146. {revenium_python_sdk-0.10.0 → revenium_python_sdk-0.11.0}/revenium_middleware/litellm/client/integrations/crewai.py +0 -0
  147. {revenium_python_sdk-0.10.0 → revenium_python_sdk-0.11.0}/revenium_middleware/litellm/client/middleware.py +0 -0
  148. {revenium_python_sdk-0.10.0 → revenium_python_sdk-0.11.0}/revenium_middleware/litellm/client/trace_fields.py +0 -0
  149. {revenium_python_sdk-0.10.0 → revenium_python_sdk-0.11.0}/revenium_middleware/litellm/client/validation.py +0 -0
  150. {revenium_python_sdk-0.10.0 → revenium_python_sdk-0.11.0}/revenium_middleware/litellm/proxy/__init__.py +0 -0
  151. {revenium_python_sdk-0.10.0 → revenium_python_sdk-0.11.0}/revenium_middleware/litellm/proxy/_metering_owner.py +0 -0
  152. {revenium_python_sdk-0.10.0 → revenium_python_sdk-0.11.0}/revenium_middleware/litellm/proxy/middleware.py +0 -0
  153. {revenium_python_sdk-0.10.0 → revenium_python_sdk-0.11.0}/revenium_middleware/ollama/__init__.py +0 -0
  154. {revenium_python_sdk-0.10.0 → revenium_python_sdk-0.11.0}/revenium_middleware/ollama/middleware.py +0 -0
  155. {revenium_python_sdk-0.10.0 → revenium_python_sdk-0.11.0}/revenium_middleware/ollama/trace_fields.py +0 -0
  156. {revenium_python_sdk-0.10.0 → revenium_python_sdk-0.11.0}/revenium_middleware/openai/__init__.py +0 -0
  157. {revenium_python_sdk-0.10.0 → revenium_python_sdk-0.11.0}/revenium_middleware/openai/audio.py +0 -0
  158. {revenium_python_sdk-0.10.0 → revenium_python_sdk-0.11.0}/revenium_middleware/openai/azure_config.py +0 -0
  159. {revenium_python_sdk-0.10.0 → revenium_python_sdk-0.11.0}/revenium_middleware/openai/azure_model_resolver.py +0 -0
  160. {revenium_python_sdk-0.10.0 → revenium_python_sdk-0.11.0}/revenium_middleware/openai/config.py +0 -0
  161. {revenium_python_sdk-0.10.0 → revenium_python_sdk-0.11.0}/revenium_middleware/openai/exceptions.py +0 -0
  162. {revenium_python_sdk-0.10.0 → revenium_python_sdk-0.11.0}/revenium_middleware/openai/langchain/__init__.py +0 -0
  163. {revenium_python_sdk-0.10.0 → revenium_python_sdk-0.11.0}/revenium_middleware/openai/langchain/_abandoned_runs.py +0 -0
  164. {revenium_python_sdk-0.10.0 → revenium_python_sdk-0.11.0}/revenium_middleware/openai/langchain/_model_call.py +0 -0
  165. {revenium_python_sdk-0.10.0 → revenium_python_sdk-0.11.0}/revenium_middleware/openai/langchain/_perplexity_cost_capture.py +0 -0
  166. {revenium_python_sdk-0.10.0 → revenium_python_sdk-0.11.0}/revenium_middleware/openai/langchain/_prompt_capture.py +0 -0
  167. {revenium_python_sdk-0.10.0 → revenium_python_sdk-0.11.0}/revenium_middleware/openai/langchain/_text_completion_usage.py +0 -0
  168. {revenium_python_sdk-0.10.0 → revenium_python_sdk-0.11.0}/revenium_middleware/openai/langchain/_utils.py +0 -0
  169. {revenium_python_sdk-0.10.0 → revenium_python_sdk-0.11.0}/revenium_middleware/openai/langchain/unified_handler.py +0 -0
  170. {revenium_python_sdk-0.10.0 → revenium_python_sdk-0.11.0}/revenium_middleware/openai/middleware.py +0 -0
  171. {revenium_python_sdk-0.10.0 → revenium_python_sdk-0.11.0}/revenium_middleware/openai/prompt_extractor.py +0 -0
  172. {revenium_python_sdk-0.10.0 → revenium_python_sdk-0.11.0}/revenium_middleware/openai/provider.py +0 -0
  173. {revenium_python_sdk-0.10.0 → revenium_python_sdk-0.11.0}/revenium_middleware/openai/raw_response.py +0 -0
  174. {revenium_python_sdk-0.10.0 → revenium_python_sdk-0.11.0}/revenium_middleware/openai/trace_fields.py +0 -0
  175. {revenium_python_sdk-0.10.0 → revenium_python_sdk-0.11.0}/revenium_middleware/openai/xai_usage.py +0 -0
  176. {revenium_python_sdk-0.10.0 → revenium_python_sdk-0.11.0}/revenium_middleware/perplexity/__init__.py +0 -0
  177. {revenium_python_sdk-0.10.0 → revenium_python_sdk-0.11.0}/revenium_middleware/perplexity/_metering_scope.py +0 -0
  178. {revenium_python_sdk-0.10.0 → revenium_python_sdk-0.11.0}/revenium_middleware/perplexity/middleware.py +0 -0
  179. {revenium_python_sdk-0.10.0 → revenium_python_sdk-0.11.0}/revenium_middleware/perplexity/patching.py +0 -0
  180. {revenium_python_sdk-0.10.0 → revenium_python_sdk-0.11.0}/revenium_middleware/perplexity/perplexity_sdk.py +0 -0
  181. {revenium_python_sdk-0.10.0 → revenium_python_sdk-0.11.0}/revenium_middleware/perplexity/provider.py +0 -0
  182. {revenium_python_sdk-0.10.0 → revenium_python_sdk-0.11.0}/revenium_middleware/perplexity/raw_response.py +0 -0
  183. {revenium_python_sdk-0.10.0 → revenium_python_sdk-0.11.0}/revenium_middleware/perplexity/streaming.py +0 -0
  184. {revenium_python_sdk-0.10.0 → revenium_python_sdk-0.11.0}/revenium_middleware/perplexity/trace_fields.py +0 -0
  185. {revenium_python_sdk-0.10.0 → revenium_python_sdk-0.11.0}/revenium_middleware/webhooks/__init__.py +0 -0
  186. {revenium_python_sdk-0.10.0 → revenium_python_sdk-0.11.0}/revenium_middleware/webhooks/_verify.py +0 -0
  187. {revenium_python_sdk-0.10.0 → revenium_python_sdk-0.11.0}/revenium_python_sdk.egg-info/SOURCES.txt +0 -0
  188. {revenium_python_sdk-0.10.0 → revenium_python_sdk-0.11.0}/revenium_python_sdk.egg-info/dependency_links.txt +0 -0
  189. {revenium_python_sdk-0.10.0 → revenium_python_sdk-0.11.0}/revenium_python_sdk.egg-info/top_level.txt +0 -0
  190. {revenium_python_sdk-0.10.0 → revenium_python_sdk-0.11.0}/setup.cfg +0 -0
  191. {revenium_python_sdk-0.10.0 → revenium_python_sdk-0.11.0}/tests/test_metering.py +0 -0
  192. {revenium_python_sdk-0.10.0 → revenium_python_sdk-0.11.0}/tests/test_metering_dispatch_timestamps.py +0 -0
  193. {revenium_python_sdk-0.10.0 → revenium_python_sdk-0.11.0}/tests/test_patch_coverage.py +0 -0
  194. {revenium_python_sdk-0.10.0 → revenium_python_sdk-0.11.0}/tests/test_release_verify_ticket.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: revenium-python-sdk
3
- Version: 0.10.0
3
+ Version: 0.11.0
4
4
  Summary: The official Revenium Python SDK — unified AI metering middleware for OpenAI, Anthropic, Google, Ollama, LiteLLM, Perplexity, and fal.ai.
5
5
  Author-email: Revenium <support@revenium.io>
6
6
  License: MIT
@@ -105,7 +105,7 @@ Requires-Dist: langchain-perplexity; python_version >= "3.10" and extra == "dev"
105
105
  Requires-Dist: langchain-cohere; python_version >= "3.10" and extra == "dev"
106
106
  Requires-Dist: langchain-huggingface; python_version >= "3.10" and extra == "dev"
107
107
  Requires-Dist: openai>=1.0.0; extra == "dev"
108
- Requires-Dist: litellm>=1.40.0; extra == "dev"
108
+ Requires-Dist: litellm<1.106,>=1.40.0; extra == "dev"
109
109
  Requires-Dist: fal-client>=0.13.0; extra == "dev"
110
110
  Requires-Dist: perplexityai>=0.1.0; extra == "dev"
111
111
  Requires-Dist: google-genai>=0.1.0; extra == "dev"
@@ -192,12 +192,12 @@ Some billable provider calls are not metered at all: see [Calls the SDK does not
192
192
  The calls below are billed by the provider (some, such as batch and fine-tuning jobs, when the job runs rather than when you call them), but the SDK records no usage for them: nothing reaches Revenium and nothing is logged. On every build a test compares this list with the SDK's inventory of the public calls of the OpenAI, Anthropic, Perplexity, Gemini, Ollama, LiteLLM and fal clients, boto3's Bedrock Runtime client, and the Vertex AI model, session, batch prediction, tuning and context-cache classes, on the provider versions the SDK is tested on. Calls reached another way, for example LangChain classes that call their own vendor SDK, are outside that check, except LangChain embeddings, listed by hand below; wrapping one with `wrap()` logs a warning. Sync and async forms are folded into one name, and the `with_raw_response` and `with_streaming_response` forms of a listed call are not metered either. To record any of these calls, wrap it with `@meter_tool` (see [Tool Metering](#tool-metering)).
193
193
 
194
194
  <!-- not-metered:start -->
195
- - **OpenAI** (`OpenAI` and `AsyncOpenAI` clients): `batches.create`, `beta.agents.sessions.create`, `beta.agents.sessions.events.create`, `beta.agents.sessions.events.stream`, `beta.agents.sessions.stream`, `beta.agents.sessions.update`, `beta.chatkit.sessions.create`, `beta.realtime.connect`, `beta.responses.compact`, `beta.responses.connect`, `beta.responses.create`, `beta.threads.create_and_run`, `beta.threads.create_and_run_poll`, `beta.threads.create_and_run_stream`, `beta.threads.runs.create`, `beta.threads.runs.create_and_poll`, `beta.threads.runs.create_and_stream`, `beta.threads.runs.stream`, `beta.threads.runs.submit_tool_outputs`, `beta.threads.runs.submit_tool_outputs_and_poll`, `beta.threads.runs.submit_tool_outputs_stream`, `completions.create`, `decisions.create`, `evals.runs.create`, `fine_tuning.alpha.graders.run`, `fine_tuning.jobs.create`, `images.create_variation`, `images.edit`, `images.generate`, `live.connect`, `live.create`, `live.forks.connect`, `live.sessions.accept`, `live.sessions.fork`, `live.sideband.connect`, `realtime.calls.accept`, `realtime.calls.create`, `realtime.connect`, `responses.compact`, `responses.connect`, `videos.create`, `videos.create_and_poll`, `videos.create_character`, `videos.edit`, `videos.extend`, `videos.remix`
195
+ - **OpenAI** (`OpenAI` and `AsyncOpenAI` clients): `batches.create`, `beta.agents.sessions.create`, `beta.agents.sessions.events.create`, `beta.agents.sessions.events.stream`, `beta.agents.sessions.stream`, `beta.agents.sessions.update`, `beta.chatkit.sessions.create`, `beta.realtime.connect`, `beta.responses.compact`, `beta.responses.connect`, `beta.responses.create`, `beta.threads.create_and_run`, `beta.threads.create_and_run_poll`, `beta.threads.create_and_run_stream`, `beta.threads.runs.create`, `beta.threads.runs.create_and_poll`, `beta.threads.runs.create_and_stream`, `beta.threads.runs.stream`, `beta.threads.runs.submit_tool_outputs`, `beta.threads.runs.submit_tool_outputs_and_poll`, `beta.threads.runs.submit_tool_outputs_stream`, `completions.create`, `decisions.create`, `evals.runs.create`, `fine_tuning.alpha.graders.run`, `fine_tuning.jobs.create`, `images.create_variation`, `images.edit`, `images.generate`, `live.connect`, `live.create`, `live.forks.connect`, `live.sessions.accept`, `live.sessions.fork`, `live.sideband.connect`, `realtime.calls.accept`, `realtime.calls.create`, `realtime.connect`, `realtime.translations.connect`, `responses.compact`, `responses.connect`, `videos.create`, `videos.create_and_poll`, `videos.create_character`, `videos.edit`, `videos.extend`, `videos.remix`
196
196
  - **Anthropic** (`Anthropic` and `AsyncAnthropic` clients): `beta.deployments.run`, `beta.dreams.create`, `beta.environments.work.poller`, `beta.environments.work.worker`, `beta.messages.batches.create`, `beta.sessions.create`, `beta.sessions.events.send`, `beta.sessions.events.stream`, `beta.sessions.events.tool_runner`, `beta.sessions.threads.events.stream`, `messages.batches.create`
197
197
  - **Google Gemini** (`google.genai` `Client` and `Client.aio`): `batches.create`, `batches.create_embeddings`, `caches.create`, `caches.update`, `file_search_stores.import_file`, `file_search_stores.upload_to_file_search_store`, `interactions.create`, `live.connect`, `live.music.connect`, `models.edit_image`, `models.recontext_image`, `models.segment_image`, `models.upscale_image`, `triggers.run`, `tunings.tune`
198
198
  - **Google Vertex AI** (`vertexai` classes): `batch_prediction.BatchPredictionJob.submit`, `caching.CachedContent.create`, `caching.CachedContent.update`, `language_models.ChatModel.tune_model`, `language_models.ChatModel.tune_model_rlhf`, `language_models.ChatSession.send_message`, `language_models.ChatSession.send_message_async`, `language_models.ChatSession.send_message_streaming`, `language_models.ChatSession.send_message_streaming_async`, `language_models.CodeChatModel.tune_model`, `language_models.CodeChatSession.send_message`, `language_models.CodeChatSession.send_message_async`, `language_models.CodeChatSession.send_message_streaming`, `language_models.CodeChatSession.send_message_streaming_async`, `language_models.CodeGenerationModel.batch_predict`, `language_models.CodeGenerationModel.predict`, `language_models.CodeGenerationModel.predict_async`, `language_models.CodeGenerationModel.predict_streaming`, `language_models.CodeGenerationModel.predict_streaming_async`, `language_models.CodeGenerationModel.tune_model`, `language_models.TextEmbeddingModel.batch_predict`, `language_models.TextEmbeddingModel.deploy_tuned_model`, `language_models.TextEmbeddingModel.tune_model`, `language_models.TextGenerationModel.batch_predict`, `language_models.TextGenerationModel.predict`, `language_models.TextGenerationModel.predict_async`, `language_models.TextGenerationModel.predict_streaming`, `language_models.TextGenerationModel.predict_streaming_async`, `language_models.TextGenerationModel.tune_model`, `language_models.TextGenerationModel.tune_model_rlhf`, `preview.caching.CachedContent.create`, `preview.caching.CachedContent.update`, `preview.vision_models.ImageCaptioningModel.get_captions`, `preview.vision_models.ImageGenerationModel.upscale_image`, `preview.vision_models.ImageQnAModel.ask_question`, `preview.vision_models.ImageSegmentationModel.segment_image`, `preview.vision_models.ImageTextModel.ask_question`, `preview.vision_models.ImageTextModel.get_captions`, `preview.vision_models.MultiModalEmbeddingModel.get_embeddings`, `preview.vision_models.WatermarkVerificationModel.verify_image`, `tuning.sft.train`, `vision_models.ImageCaptioningModel.get_captions`, `vision_models.ImageGenerationModel.upscale_image`, `vision_models.ImageQnAModel.ask_question`, `vision_models.ImageTextModel.ask_question`, `vision_models.ImageTextModel.get_captions`, `vision_models.MultiModalEmbeddingModel.get_embeddings`
199
199
  - **AWS Bedrock** (boto3 bedrock-runtime client; Claude models are metered when REVENIUM_BEDROCK_TRANSPORT is on): `apply_guardrail`, `converse`, `converse_stream`, `invoke_guardrail_checks`, `invoke_model`, `invoke_model_with_response_stream`, `start_async_invoke`
200
- - **Perplexity** (`Perplexity` and `AsyncPerplexity` clients): `async_.chat.completions.create`, `browser.sessions.create`, `contextualized_embeddings.create`, `embeddings.create`, `responses.create`, `search.create`
200
+ - **Perplexity** (`Perplexity` and `AsyncPerplexity` clients): `async_.chat.completions.create`, `batches.create`, `browser.sessions.create`, `contextualized_embeddings.create`, `decisions.create`, `embeddings.create`, `responses.create`, `search.create`
201
201
  - **LiteLLM** (the `litellm` module): `aadapter_completion`, `aadapter_generate_content`, `acode_interpreter_tool`, `acompact_responses`, `acreate_batch`, `acreate_fine_tuning_job`, `acreate_run`, `acreate_sandbox`, `adapter_completion`, `adecisions`, `agenerate_content`, `aimage_edit`, `aimage_generation`, `aimage_variation`, `aingest`, `anthropic_interface.messages.acreate`, `anthropic_interface.messages.create`, `anthropic_messages`, `anthropic_messages_handler`, `aocr`, `aquery`, `arealtime_calls`, `arerank`, `aresponses`, `aresponses_api_with_mcp`, `aresponses_with_retries`, `arun_code`, `arun_thread`, `arun_thread_stream`, `asearch`, `aspeech`, `asystemone`, `atranscription`, `avideo_create_character`, `avideo_edit`, `avideo_extension`, `avideo_generation`, `avideo_remix`, `compact_responses`, `config_completion`, `create_batch`, `create_fine_tuning_job`, `create_run`, `decisions`, `image_edit`, `image_generation`, `image_variation`, `ingest`, `nlp_cloud_chat_completion`, `ocr`, `query`, `replicate_chat_completion`, `rerank`, `responses`, `responses_with_retries`, `run_thread`, `run_thread_stream`, `search`, `speech`, `systemone`, `transcription`, `video_create_character`, `video_edit`, `video_extension`, `video_generation`, `video_remix`
202
202
  - **Ollama** (`Client`, `AsyncClient` and the `ollama` module): `systemone`, `web_fetch`, `web_search`
203
203
  - **fal.ai** (`SyncClient`, `AsyncClient` and the `fal_client` module): `realtime`, `realtime_async`, `ws_connect`, `ws_connect_async`
@@ -1197,6 +1197,18 @@ the others to be recorded. A malformed header value, such as a quality score of
1197
1197
  `high` or an effort of `very high`, is left off the record with a WARNING in the
1198
1198
  gateway log; the call is still recorded.
1199
1199
 
1200
+ **Trace id.** The guardrail takes a record's trace id from `x-revenium-trace-id`.
1201
+ Without that header it takes the LiteLLM session id the caller sent: the
1202
+ `x-litellm-session-id` or `x-litellm-trace-id` header, or `litellm_session_id` or
1203
+ `metadata.session_id` in the request body (`litellm_metadata.session_id` on
1204
+ `/v1/messages`). Calls a customer groups into one LiteLLM session therefore read
1205
+ as one trace in Revenium. Failing both, it uses Claude Code's
1206
+ `x-claude-code-session-id`, so one Claude Code session is one trace. A call with
1207
+ none of these has no trace id. The id LiteLLM generates for every request is never
1208
+ used, because it would make each call a trace of its own, and neither is a session
1209
+ id LiteLLM minted itself under its `missing_session_id: generate` policy. The
1210
+ deprecated callback reads only `x-revenium-trace-id` and `x-claude-code-session-id`.
1211
+
1200
1212
  **Organization caps and the organization header.** By default the
1201
1213
  `x-revenium-organization-name` header (and the retired `x-revenium-organization-id`)
1202
1214
  wins over the calling virtual key's team alias, for the budget check and the record
@@ -1781,6 +1793,7 @@ characters, and `product_name` at 224. Other text fields are sent as given.
1781
1793
  | `agent` | AI agent or bot identifier | Distinguish between multiple AI agents or automation workflows |
1782
1794
  | `response_quality_score` | Custom quality rating (0.0-1.0) | Track user satisfaction or automated quality metrics for model performance analysis |
1783
1795
  | `effort` | Reasoning effort level requested of the model (free-form string, max 16 chars, `^[A-Za-z0-9_-]+$`) | Report what share of AI spend is high-effort reasoning, and compare cost per effort level |
1796
+ | `entrypoint` | How the coding assistant that made the call was launched, such as `cli`, `sdk-py` or `claude-vscode` (completions only, 1 to 64 chars, `^[A-Za-z0-9._-]+$`) | Split coding-assistant spend between the terminal, the SDKs and the editor or chat integrations |
1784
1797
 
1785
1798
  **Example:**
1786
1799
 
@@ -1815,7 +1828,7 @@ string, not an enum -- vendor vocabularies differ and drift, so `low`, `medium`,
1815
1828
  `high`, `xhigh` and `ultra` are all real values, and a level this SDK release has
1816
1829
  never heard of is passed through untouched rather than rejected or rewritten. The
1817
1830
  Revenium backend rule is at most 16 characters, matching `^[A-Za-z0-9_-]+$`; a
1818
- value outside it is left off the record with a WARNING, and the call is still
1831
+ value outside it, an empty one included, is left off the record with a WARNING, and the call is still
1819
1832
  recorded with its tokens and cost. It is distinct from the reported reasoning token count,
1820
1833
  which measures the tokens actually spent rather than the level requested.
1821
1834
 
@@ -1823,6 +1836,15 @@ Set it per call in `usage_metadata` on any provider integration. In LiteLLM prox
1823
1836
  mode, where per-call attribution travels as request headers rather than
1824
1837
  `usage_metadata`, send `x-revenium-effort` instead.
1825
1838
 
1839
+ **Coding-assistant entrypoint:** `entrypoint` records how the coding assistant
1840
+ that made a completion was launched. Claude Code sends `cli`, `sdk-cli`,
1841
+ `sdk-ts`, `sdk-py`, `claude-vscode` or `claude-in-slack`; any other value of
1842
+ the same shape is sent as given, not rewritten. A value that is empty, longer
1843
+ than 64 characters or holds anything but letters, digits, dots, hyphens and
1844
+ underscores is left off the record with a WARNING, and the call is still
1845
+ recorded. It is sent on completions only; image, video and audio calls ignore
1846
+ it, and the LiteLLM proxy does not read it.
1847
+
1826
1848
  **Deprecation notice:** The legacy field aliases `organizationId`, `organization_id`, `productId`, and `product_id` are accepted by this SDK only as an input-layer convenience and emit a `DeprecationWarning`. The Revenium backend no longer accepts them — they are translated to `organizationName` / `productName` before the wire call. Migrate to `organization_name` / `organizationName` and `product_name` / `productName` now; the input-layer aliases will be removed in the next major release.
1827
1849
 
1828
1850
  **API Reference:** [Complete metadata field documentation](https://revenium.readme.io/reference/meter_ai_completion)
@@ -2345,6 +2367,23 @@ if roster:
2345
2367
 
2346
2368
  `fetch_enforcement_rule_roster` takes `page`, `size`, `search` and `band` (`BLOCKED`, `WARNED`, `UNDER`, `ALL`); the server does the filtering, sorting, banding and paging, and the three band counts always describe the whole roster rather than the page you asked for. Both calls return `None` rather than raising when the team has no such compiled rule, the rule has no reading yet, or the enforcement API cannot be reached — the same fail-open posture as the rest of the circuit breaker. An empty `rule_id` raises `ValueError`.
2347
2369
 
2370
+ ### Reading Advisory Budgets
2371
+
2372
+ Notify-only per-person budgets (alerts) never block a call, so the cost-limit cache does not carry them. `fetch_advisory_budgets()` reads them on demand, like the two calls above: it sends `include=advisory` on the team-wide enforcement read, which the API serves from 2.25.0, and returns only the advisory rows.
2373
+
2374
+ ```python
2375
+ from revenium_middleware._core import fetch_advisory_budgets
2376
+
2377
+ budgets = fetch_advisory_budgets() # list of advisory rows, [] if none, None on failure
2378
+
2379
+ for budget in budgets or []:
2380
+ print(f"{budget['name']} (reading at {budget.get('readingAt')})")
2381
+ for person in budget.get("groupBreakdown") or []:
2382
+ print(f" {person['groupValue']}: ${person['currentValue']}")
2383
+ ```
2384
+
2385
+ Each row has `source` `ANOMALY` and `action` `NOTIFY`, groups by `SUBSCRIBER` with a per-person `groupBreakdown`, and carries `readingAt` when the current window has a reading. The call returns `[]` when the team has no advisory budgets and `None` when the enforcement API cannot be reached.
2386
+
2348
2387
  The background poller is unaffected: it keeps reading the **whole team's** rules every `REVENIUM_CB_POLL_INTERVAL_SECONDS`. That is deliberate. The server computes the department-budget maps team-wide and attaches them to the team-wide read, so a poll narrowed to a single rule would stop receiving them and department budgets would quietly stop blocking anyone. Narrowing is an explicit, opt-in inspection call and never the refresh.
2349
2388
 
2350
2389
  ### End-to-End Example
@@ -76,12 +76,12 @@ Some billable provider calls are not metered at all: see [Calls the SDK does not
76
76
  The calls below are billed by the provider (some, such as batch and fine-tuning jobs, when the job runs rather than when you call them), but the SDK records no usage for them: nothing reaches Revenium and nothing is logged. On every build a test compares this list with the SDK's inventory of the public calls of the OpenAI, Anthropic, Perplexity, Gemini, Ollama, LiteLLM and fal clients, boto3's Bedrock Runtime client, and the Vertex AI model, session, batch prediction, tuning and context-cache classes, on the provider versions the SDK is tested on. Calls reached another way, for example LangChain classes that call their own vendor SDK, are outside that check, except LangChain embeddings, listed by hand below; wrapping one with `wrap()` logs a warning. Sync and async forms are folded into one name, and the `with_raw_response` and `with_streaming_response` forms of a listed call are not metered either. To record any of these calls, wrap it with `@meter_tool` (see [Tool Metering](#tool-metering)).
77
77
 
78
78
  <!-- not-metered:start -->
79
- - **OpenAI** (`OpenAI` and `AsyncOpenAI` clients): `batches.create`, `beta.agents.sessions.create`, `beta.agents.sessions.events.create`, `beta.agents.sessions.events.stream`, `beta.agents.sessions.stream`, `beta.agents.sessions.update`, `beta.chatkit.sessions.create`, `beta.realtime.connect`, `beta.responses.compact`, `beta.responses.connect`, `beta.responses.create`, `beta.threads.create_and_run`, `beta.threads.create_and_run_poll`, `beta.threads.create_and_run_stream`, `beta.threads.runs.create`, `beta.threads.runs.create_and_poll`, `beta.threads.runs.create_and_stream`, `beta.threads.runs.stream`, `beta.threads.runs.submit_tool_outputs`, `beta.threads.runs.submit_tool_outputs_and_poll`, `beta.threads.runs.submit_tool_outputs_stream`, `completions.create`, `decisions.create`, `evals.runs.create`, `fine_tuning.alpha.graders.run`, `fine_tuning.jobs.create`, `images.create_variation`, `images.edit`, `images.generate`, `live.connect`, `live.create`, `live.forks.connect`, `live.sessions.accept`, `live.sessions.fork`, `live.sideband.connect`, `realtime.calls.accept`, `realtime.calls.create`, `realtime.connect`, `responses.compact`, `responses.connect`, `videos.create`, `videos.create_and_poll`, `videos.create_character`, `videos.edit`, `videos.extend`, `videos.remix`
79
+ - **OpenAI** (`OpenAI` and `AsyncOpenAI` clients): `batches.create`, `beta.agents.sessions.create`, `beta.agents.sessions.events.create`, `beta.agents.sessions.events.stream`, `beta.agents.sessions.stream`, `beta.agents.sessions.update`, `beta.chatkit.sessions.create`, `beta.realtime.connect`, `beta.responses.compact`, `beta.responses.connect`, `beta.responses.create`, `beta.threads.create_and_run`, `beta.threads.create_and_run_poll`, `beta.threads.create_and_run_stream`, `beta.threads.runs.create`, `beta.threads.runs.create_and_poll`, `beta.threads.runs.create_and_stream`, `beta.threads.runs.stream`, `beta.threads.runs.submit_tool_outputs`, `beta.threads.runs.submit_tool_outputs_and_poll`, `beta.threads.runs.submit_tool_outputs_stream`, `completions.create`, `decisions.create`, `evals.runs.create`, `fine_tuning.alpha.graders.run`, `fine_tuning.jobs.create`, `images.create_variation`, `images.edit`, `images.generate`, `live.connect`, `live.create`, `live.forks.connect`, `live.sessions.accept`, `live.sessions.fork`, `live.sideband.connect`, `realtime.calls.accept`, `realtime.calls.create`, `realtime.connect`, `realtime.translations.connect`, `responses.compact`, `responses.connect`, `videos.create`, `videos.create_and_poll`, `videos.create_character`, `videos.edit`, `videos.extend`, `videos.remix`
80
80
  - **Anthropic** (`Anthropic` and `AsyncAnthropic` clients): `beta.deployments.run`, `beta.dreams.create`, `beta.environments.work.poller`, `beta.environments.work.worker`, `beta.messages.batches.create`, `beta.sessions.create`, `beta.sessions.events.send`, `beta.sessions.events.stream`, `beta.sessions.events.tool_runner`, `beta.sessions.threads.events.stream`, `messages.batches.create`
81
81
  - **Google Gemini** (`google.genai` `Client` and `Client.aio`): `batches.create`, `batches.create_embeddings`, `caches.create`, `caches.update`, `file_search_stores.import_file`, `file_search_stores.upload_to_file_search_store`, `interactions.create`, `live.connect`, `live.music.connect`, `models.edit_image`, `models.recontext_image`, `models.segment_image`, `models.upscale_image`, `triggers.run`, `tunings.tune`
82
82
  - **Google Vertex AI** (`vertexai` classes): `batch_prediction.BatchPredictionJob.submit`, `caching.CachedContent.create`, `caching.CachedContent.update`, `language_models.ChatModel.tune_model`, `language_models.ChatModel.tune_model_rlhf`, `language_models.ChatSession.send_message`, `language_models.ChatSession.send_message_async`, `language_models.ChatSession.send_message_streaming`, `language_models.ChatSession.send_message_streaming_async`, `language_models.CodeChatModel.tune_model`, `language_models.CodeChatSession.send_message`, `language_models.CodeChatSession.send_message_async`, `language_models.CodeChatSession.send_message_streaming`, `language_models.CodeChatSession.send_message_streaming_async`, `language_models.CodeGenerationModel.batch_predict`, `language_models.CodeGenerationModel.predict`, `language_models.CodeGenerationModel.predict_async`, `language_models.CodeGenerationModel.predict_streaming`, `language_models.CodeGenerationModel.predict_streaming_async`, `language_models.CodeGenerationModel.tune_model`, `language_models.TextEmbeddingModel.batch_predict`, `language_models.TextEmbeddingModel.deploy_tuned_model`, `language_models.TextEmbeddingModel.tune_model`, `language_models.TextGenerationModel.batch_predict`, `language_models.TextGenerationModel.predict`, `language_models.TextGenerationModel.predict_async`, `language_models.TextGenerationModel.predict_streaming`, `language_models.TextGenerationModel.predict_streaming_async`, `language_models.TextGenerationModel.tune_model`, `language_models.TextGenerationModel.tune_model_rlhf`, `preview.caching.CachedContent.create`, `preview.caching.CachedContent.update`, `preview.vision_models.ImageCaptioningModel.get_captions`, `preview.vision_models.ImageGenerationModel.upscale_image`, `preview.vision_models.ImageQnAModel.ask_question`, `preview.vision_models.ImageSegmentationModel.segment_image`, `preview.vision_models.ImageTextModel.ask_question`, `preview.vision_models.ImageTextModel.get_captions`, `preview.vision_models.MultiModalEmbeddingModel.get_embeddings`, `preview.vision_models.WatermarkVerificationModel.verify_image`, `tuning.sft.train`, `vision_models.ImageCaptioningModel.get_captions`, `vision_models.ImageGenerationModel.upscale_image`, `vision_models.ImageQnAModel.ask_question`, `vision_models.ImageTextModel.ask_question`, `vision_models.ImageTextModel.get_captions`, `vision_models.MultiModalEmbeddingModel.get_embeddings`
83
83
  - **AWS Bedrock** (boto3 bedrock-runtime client; Claude models are metered when REVENIUM_BEDROCK_TRANSPORT is on): `apply_guardrail`, `converse`, `converse_stream`, `invoke_guardrail_checks`, `invoke_model`, `invoke_model_with_response_stream`, `start_async_invoke`
84
- - **Perplexity** (`Perplexity` and `AsyncPerplexity` clients): `async_.chat.completions.create`, `browser.sessions.create`, `contextualized_embeddings.create`, `embeddings.create`, `responses.create`, `search.create`
84
+ - **Perplexity** (`Perplexity` and `AsyncPerplexity` clients): `async_.chat.completions.create`, `batches.create`, `browser.sessions.create`, `contextualized_embeddings.create`, `decisions.create`, `embeddings.create`, `responses.create`, `search.create`
85
85
  - **LiteLLM** (the `litellm` module): `aadapter_completion`, `aadapter_generate_content`, `acode_interpreter_tool`, `acompact_responses`, `acreate_batch`, `acreate_fine_tuning_job`, `acreate_run`, `acreate_sandbox`, `adapter_completion`, `adecisions`, `agenerate_content`, `aimage_edit`, `aimage_generation`, `aimage_variation`, `aingest`, `anthropic_interface.messages.acreate`, `anthropic_interface.messages.create`, `anthropic_messages`, `anthropic_messages_handler`, `aocr`, `aquery`, `arealtime_calls`, `arerank`, `aresponses`, `aresponses_api_with_mcp`, `aresponses_with_retries`, `arun_code`, `arun_thread`, `arun_thread_stream`, `asearch`, `aspeech`, `asystemone`, `atranscription`, `avideo_create_character`, `avideo_edit`, `avideo_extension`, `avideo_generation`, `avideo_remix`, `compact_responses`, `config_completion`, `create_batch`, `create_fine_tuning_job`, `create_run`, `decisions`, `image_edit`, `image_generation`, `image_variation`, `ingest`, `nlp_cloud_chat_completion`, `ocr`, `query`, `replicate_chat_completion`, `rerank`, `responses`, `responses_with_retries`, `run_thread`, `run_thread_stream`, `search`, `speech`, `systemone`, `transcription`, `video_create_character`, `video_edit`, `video_extension`, `video_generation`, `video_remix`
86
86
  - **Ollama** (`Client`, `AsyncClient` and the `ollama` module): `systemone`, `web_fetch`, `web_search`
87
87
  - **fal.ai** (`SyncClient`, `AsyncClient` and the `fal_client` module): `realtime`, `realtime_async`, `ws_connect`, `ws_connect_async`
@@ -1081,6 +1081,18 @@ the others to be recorded. A malformed header value, such as a quality score of
1081
1081
  `high` or an effort of `very high`, is left off the record with a WARNING in the
1082
1082
  gateway log; the call is still recorded.
1083
1083
 
1084
+ **Trace id.** The guardrail takes a record's trace id from `x-revenium-trace-id`.
1085
+ Without that header it takes the LiteLLM session id the caller sent: the
1086
+ `x-litellm-session-id` or `x-litellm-trace-id` header, or `litellm_session_id` or
1087
+ `metadata.session_id` in the request body (`litellm_metadata.session_id` on
1088
+ `/v1/messages`). Calls a customer groups into one LiteLLM session therefore read
1089
+ as one trace in Revenium. Failing both, it uses Claude Code's
1090
+ `x-claude-code-session-id`, so one Claude Code session is one trace. A call with
1091
+ none of these has no trace id. The id LiteLLM generates for every request is never
1092
+ used, because it would make each call a trace of its own, and neither is a session
1093
+ id LiteLLM minted itself under its `missing_session_id: generate` policy. The
1094
+ deprecated callback reads only `x-revenium-trace-id` and `x-claude-code-session-id`.
1095
+
1084
1096
  **Organization caps and the organization header.** By default the
1085
1097
  `x-revenium-organization-name` header (and the retired `x-revenium-organization-id`)
1086
1098
  wins over the calling virtual key's team alias, for the budget check and the record
@@ -1665,6 +1677,7 @@ characters, and `product_name` at 224. Other text fields are sent as given.
1665
1677
  | `agent` | AI agent or bot identifier | Distinguish between multiple AI agents or automation workflows |
1666
1678
  | `response_quality_score` | Custom quality rating (0.0-1.0) | Track user satisfaction or automated quality metrics for model performance analysis |
1667
1679
  | `effort` | Reasoning effort level requested of the model (free-form string, max 16 chars, `^[A-Za-z0-9_-]+$`) | Report what share of AI spend is high-effort reasoning, and compare cost per effort level |
1680
+ | `entrypoint` | How the coding assistant that made the call was launched, such as `cli`, `sdk-py` or `claude-vscode` (completions only, 1 to 64 chars, `^[A-Za-z0-9._-]+$`) | Split coding-assistant spend between the terminal, the SDKs and the editor or chat integrations |
1668
1681
 
1669
1682
  **Example:**
1670
1683
 
@@ -1699,7 +1712,7 @@ string, not an enum -- vendor vocabularies differ and drift, so `low`, `medium`,
1699
1712
  `high`, `xhigh` and `ultra` are all real values, and a level this SDK release has
1700
1713
  never heard of is passed through untouched rather than rejected or rewritten. The
1701
1714
  Revenium backend rule is at most 16 characters, matching `^[A-Za-z0-9_-]+$`; a
1702
- value outside it is left off the record with a WARNING, and the call is still
1715
+ value outside it, an empty one included, is left off the record with a WARNING, and the call is still
1703
1716
  recorded with its tokens and cost. It is distinct from the reported reasoning token count,
1704
1717
  which measures the tokens actually spent rather than the level requested.
1705
1718
 
@@ -1707,6 +1720,15 @@ Set it per call in `usage_metadata` on any provider integration. In LiteLLM prox
1707
1720
  mode, where per-call attribution travels as request headers rather than
1708
1721
  `usage_metadata`, send `x-revenium-effort` instead.
1709
1722
 
1723
+ **Coding-assistant entrypoint:** `entrypoint` records how the coding assistant
1724
+ that made a completion was launched. Claude Code sends `cli`, `sdk-cli`,
1725
+ `sdk-ts`, `sdk-py`, `claude-vscode` or `claude-in-slack`; any other value of
1726
+ the same shape is sent as given, not rewritten. A value that is empty, longer
1727
+ than 64 characters or holds anything but letters, digits, dots, hyphens and
1728
+ underscores is left off the record with a WARNING, and the call is still
1729
+ recorded. It is sent on completions only; image, video and audio calls ignore
1730
+ it, and the LiteLLM proxy does not read it.
1731
+
1710
1732
  **Deprecation notice:** The legacy field aliases `organizationId`, `organization_id`, `productId`, and `product_id` are accepted by this SDK only as an input-layer convenience and emit a `DeprecationWarning`. The Revenium backend no longer accepts them — they are translated to `organizationName` / `productName` before the wire call. Migrate to `organization_name` / `organizationName` and `product_name` / `productName` now; the input-layer aliases will be removed in the next major release.
1711
1733
 
1712
1734
  **API Reference:** [Complete metadata field documentation](https://revenium.readme.io/reference/meter_ai_completion)
@@ -2229,6 +2251,23 @@ if roster:
2229
2251
 
2230
2252
  `fetch_enforcement_rule_roster` takes `page`, `size`, `search` and `band` (`BLOCKED`, `WARNED`, `UNDER`, `ALL`); the server does the filtering, sorting, banding and paging, and the three band counts always describe the whole roster rather than the page you asked for. Both calls return `None` rather than raising when the team has no such compiled rule, the rule has no reading yet, or the enforcement API cannot be reached — the same fail-open posture as the rest of the circuit breaker. An empty `rule_id` raises `ValueError`.
2231
2253
 
2254
+ ### Reading Advisory Budgets
2255
+
2256
+ Notify-only per-person budgets (alerts) never block a call, so the cost-limit cache does not carry them. `fetch_advisory_budgets()` reads them on demand, like the two calls above: it sends `include=advisory` on the team-wide enforcement read, which the API serves from 2.25.0, and returns only the advisory rows.
2257
+
2258
+ ```python
2259
+ from revenium_middleware._core import fetch_advisory_budgets
2260
+
2261
+ budgets = fetch_advisory_budgets() # list of advisory rows, [] if none, None on failure
2262
+
2263
+ for budget in budgets or []:
2264
+ print(f"{budget['name']} (reading at {budget.get('readingAt')})")
2265
+ for person in budget.get("groupBreakdown") or []:
2266
+ print(f" {person['groupValue']}: ${person['currentValue']}")
2267
+ ```
2268
+
2269
+ Each row has `source` `ANOMALY` and `action` `NOTIFY`, groups by `SUBSCRIBER` with a per-person `groupBreakdown`, and carries `readingAt` when the current window has a reading. The call returns `[]` when the team has no advisory budgets and `None` when the enforcement API cannot be reached.
2270
+
2232
2271
  The background poller is unaffected: it keeps reading the **whole team's** rules every `REVENIUM_CB_POLL_INTERVAL_SECONDS`. That is deliberate. The server computes the department-budget maps team-wide and attaches them to the team-wide read, so a poll narrowed to a single rule would stop receiving them and department budgets would quietly stop blocking anyone. Narrowing is an explicit, opt-in inspection call and never the refresh.
2233
2272
 
2234
2273
  ### End-to-End Example
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "revenium-python-sdk"
7
- version = "0.10.0"
7
+ version = "0.11.0"
8
8
  description = "The official Revenium Python SDK — unified AI metering middleware for OpenAI, Anthropic, Google, Ollama, LiteLLM, Perplexity, and fal.ai."
9
9
  readme = "README.md"
10
10
  requires-python = ">=3.8"
@@ -141,7 +141,12 @@ dev = [
141
141
  # tests/test_patch_coverage.py and tests/entry_points import every provider
142
142
  # SDK unconditionally, so a missing one fails the run instead of skipping.
143
143
  "openai>=1.0.0",
144
- "litellm>=1.40.0",
144
+ # Below 1.106: litellm 1.106.0 imports mcp inside completion() for any call
145
+ # that carries tools but declares mcp only under its proxy and mcp extras
146
+ # (mcp>=2.2), while crewai 1.15 pins mcp~=1.28, so installing mcp here
147
+ # makes pip resolve crewai back to 1.6. Lift the bound when litellm ships
148
+ # the import behind its extra again or declares mcp as a core dependency.
149
+ "litellm>=1.40.0,<1.106",
145
150
  "fal-client>=0.13.0",
146
151
  "perplexityai>=0.1.0",
147
152
  "google-genai>=0.1.0",
@@ -13,6 +13,7 @@ from .metering_submission import submit_ai_event
13
13
  from .exceptions import BudgetExceededError
14
14
  from .enforcement import (
15
15
  check_enforcement,
16
+ fetch_advisory_budgets,
16
17
  fetch_enforcement_rule,
17
18
  fetch_enforcement_rule_roster,
18
19
  is_circuit_breaker_enabled,
@@ -71,6 +72,7 @@ __all__ = [
71
72
  # Enforcement / circuit breaker
72
73
  "BudgetExceededError",
73
74
  "check_enforcement",
75
+ "fetch_advisory_budgets",
74
76
  "fetch_enforcement_rule",
75
77
  "fetch_enforcement_rule_roster",
76
78
  "is_circuit_breaker_enabled",