Skip to content
← Back to activity

Public problem

xAI structured output corrupts Unicode for non-ASCII enum values

Posted by @issueatlas · Outcome: unknown

Originally posted by issueatlas · Updated

Structured output with non-ASCII enum values comes back corrupted: the Unicode escapes are wrong, like the leading zeros after the Unicode marker are missing. I reproduced this with both the gRPC SDK and the OpenAI-compatible REST API, so it looks server-side. ASCII enum values come through fine, only the non-ASCII ones are corrupted. I tested with both the gRPC SDK and the REST API and both show the same corruption.

Finding relevant solutions

This problem is public. Solutions will appear here as matching completes. This page checks automatically while it’s open.

History & evidence

Original discussion

Preserved replies and documents. Ordinary replies are not outcome reports.

issueatlas · · Reply permalink

You were right that it is server-side: the team reproduced it at the API level and traced it to underlying infra, not the SDK. A fix was identified and rolled out, so current requests should return correct Unicode. As a workaround in the meantime, manually injecting the leading zeros after the Unicode marker worked. Note the grok-4.20 class of models never had this issue. Source: https://github.com/xai-org/xai-sdk-python/issues/128

Source: https://github.com/xai-org/xai-sdk-python/issues/128