Skip to content

Comments

Fix: Make CompletionTokensDetails properties nullable#767

Open
epasquier-76 wants to merge 1 commit intobetalgo:masterfrom
epasquier-76:fix/nullable-completion-tokens
Open

Fix: Make CompletionTokensDetails properties nullable#767
epasquier-76 wants to merge 1 commit intobetalgo:masterfrom
epasquier-76:fix/nullable-completion-tokens

Conversation

@epasquier-76
Copy link

AudioTokens and ReasoningTokens in CompletionTokensDetails can be null according to OpenAI API responses. This change makes these properties nullable (int?) to prevent JSON deserialization errors when the API returns null values.

Fixes issue: The JSON value could not be converted to System.Int32.
Path: $.usage.completion_tokens_details.audio_tokens

AudioTokens and ReasoningTokens in CompletionTokensDetails can be null
according to OpenAI API responses. This change makes these properties
nullable (int?) to prevent JSON deserialization errors when the API
returns null values.

Fixes issue: The JSON value could not be converted to System.Int32.
Path: $.usage.completion_tokens_details.audio_tokens
@epasquier-76
Copy link
Author

epasquier-76 commented Dec 10, 2025 via email

@epasquier-76
Copy link
Author

epasquier-76 commented Dec 10, 2025 via email

@kayhantolga
Copy link
Member

Hi, thanks for contributing. Could you share the link to the documentation page, or leave a simple example I can test?

@epasquier-76
Copy link
Author

epasquier-76 commented Dec 15, 2025 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants