def _create_openai_client(api_key_name="OPENAI_API_KEY"):
    """Helper function to create an OpenAI client with the specified API key."""
    api_key = Configuration.get(api_key_name)
    if not api_key:
        return None, {"status_code": 401, "detail": f"No API key provided. Please set {api_key_name} in your configuration."}
    
    client = AsyncOpenAI(api_key=api_key)
    return client, None
Helper function to create an OpenAI client with the specified API key.
src/upsonic/server/level_utilized/utility.py