def test_api_key_authentication(client: R2RClient, user_with_api_key):
    """Test using an API key for authentication."""
    user_id, api_key, _ = user_with_api_key

    # Create new client with API key
    api_client = R2RClient(client.base_url)
    api_client.set_api_key(api_key)

    # Test API key authentication
    me_id = api_client.users.me().results.id
    assert me_id == user_id, "API key authentication failed"
Test using an API key for authentication.
py/tests/integration/test_users.py