Python SDK batch create users from CSV timing out

I’m trying to bulk create users from a CSV using the Python SDK. The loop hits platform_client.users.post_users(user_body) inside a for block. It crashes around user 45 with a 502 Bad Gateway. I thought the SDK handled rate limits. Here’s the snippet:

for row in csv_data:
 user_body = UsersPostRequestBody(...)
 api_response = users_api.post_users(user_body)

Should I be using the async client or adding a time.sleep between calls?