The situation:

On Python 3.13, pip install ai21 (or uv add ai21) failed because one of the SDK's pinned dependencies, sentencepiece==0.2.0, did not support Python 3.13 yet. The reporter hit this on Windows 11, but the dependency pin was the cause regardless of OS. The AI21 maintainers shipped Python 3.13 support in SDK v4.0.0.

What actually fixes it (verified in the thread):

This was fixed upstream. The blocker was the sentencepiece==0.2.0 pin, which had no Python 3.13 support. Upgrade to ai21 SDK v4.0.0 or later, which added Python 3.13 support, per the maintainers. Source: https://github.com/AI21Labs/ai21-python/issues/293