---
title: OpenAI Python SDK v3.6.0 Adds Compute Units to Usage Tracking
description: >-
  The latest OpenAI Python SDK release v3.6.0 introduces compute_units tracking
  in API response usage, enabling developers to monitor computational resource
  consumption alongside token counts.
date: '2026-08-29'
updated: '2026-09-28'
author: Sameer Khan
tags:
  - AI
  - OpenAI
  - Python
  - SDK
  - Developer Tools
category: AI
---

# OpenAI Python SDK v3.6.0 Adds Compute Units to Usage Tracking

The latest OpenAI Python SDK release v3.6.0 introduces compute_units tracking in API response usage, enabling developers to monitor computational resource consumption alongside token counts.

**Published:** August 29, 2026

**Updated:** September 28, 2026
**Author:** Sameer Khan
**Category:** AI
**Reading Time:** 3 min read
**Word Count:** 534

---


OpenAI released version 3.6.0 of their official Python SDK on August 28, 2026. This update adds a new `compute_units` field to usage objects returned by API responses, providing developers with insight into computational resource consumption beyond traditional token counting.

## What's New in v3.6.0

The v3.6.0 release introduces `compute_units` as an optional integer field in the usage statistics for both Chat Completions and Responses API calls. The release notes list it as "add compute_units to Responses and Chat Completions usage"[^1]. The field's docstring, added in commit 52421d1 and generated from OpenAI's OpenAPI spec, reads: "Compute units for the request. Currently null when available."[^2]

[^1]: OpenAI openai-python [release v3.6.0](https://github.com/openai/openai-python/releases/tag/v3.6.0)

## Technical Details

The `compute_units` field appears in three key usage classes:

1. `CompletionUsage` (for chat completions)
2. `ResponseUsage` (for responses API)
3. `BetaResponseUsage` (for beta endpoints)

Each class now includes:

```python
compute_units: Optional[int] = None
"""Compute units for the request. Currently null when available."""
```

The field is typed as `Optional[int]` with a minimum value of 0 when present, reflecting that it may return `null` (None in Python) when compute unit data isn't available for a particular request[^2].

[^2]: OpenAI openai-python [commit 52421d1](https://github.com/openai/openai-python/commit/52421d197e96b4480fcc16e78345578996452c79)

## Usage Example

Here's how to access the new field in your code:

```python
from openai import OpenAI

client = OpenAI()

# Chat Completions example
response = client.chat.completions.create(
    model="gpt-5.2",
    messages=[{"role": "user", "content": "Explain quantum computing"}]
)

usage = response.usage
print(f"Tokens: {usage.total_tokens}")
print(f"Compute units: {usage.compute_units}")  # May be None

# Responses API example
response = client.responses.create(
    model="gpt-5.2",
    input="Explain quantum computing"
)

usage = response.usage
print(f"Tokens: {usage.total_tokens}")
print(f"Compute units: {usage.compute_units}")  # May be None
```

## Why This Matters

While token counts have traditionally been the primary metric for API usage and cost estimation, compute units provide additional insight into the actual computational resources consumed by a request. This can be particularly valuable for:

1. **Cost optimization**: Understanding the computational efficiency of different prompts or model parameters
2. **Performance profiling**: Identifying requests that consume disproportionate computational resources
3. **Capacity planning**: Better estimating infrastructure needs when deploying models that report compute units
4. **Research**: Studying the relationship between token usage and actual computational work

## Current Limitations

The field's docstring says it is "Currently null when available"[^3]. The SDK types it as `Optional[int]`, so code that reads it should handle `None`.

[^3]: The type docstring added in OpenAI openai-python [commit 52421d1](https://github.com/openai/openai-python/commit/52421d197e96b4480fcc16e78345578996452c79), generated from OpenAI's OpenAPI spec. The v3.6.0 release notes do not contain this text.

## Verdict

The v3.6.0 update is a forward-looking addition that prepares developers for future enhancements to OpenAI's usage tracking capabilities. While the docstring describes the field as currently null when available, its inclusion in the SDK allows developers to future-proof their code by accessing the field now, ensuring compatibility when OpenAI activates compute unit reporting.

Developers should update to v3.6.0 to gain access to this new field, and should handle `None` values, since the docstring describes the field as currently null when available. The change is backward-compatible and poses no risk to existing implementations.

---

**Evidence Summary**

- Release version: v3.6.0 (published 2026-08-28)
- Source: GitHub release notes and commit history
- Key change: Addition of compute_units field to usage types
- Current state: docstring reads "Currently null when available."

