code: def _call_api(
      prompt: Union[str, list[str]],
      model_name: OpenAIModel,
      api_params: Optional[APIParameters] = None,
  ) -> requests.Response:
      """This function makes the actual API call, and since we have a rate limit of 60 calls per minute,
      I will add rate limiting here (ideally we could increase the rate limit though)
      """
      if api_params is None:
          api_params = APIParameters()
      # OpenAI gave my (Ian's) account the top 100 logprobs,
      # not just the top 5
      data = {
          "prompt": prompt,
          **asdict(api_params),
      }
  
      headers = {
          "Authorization": f"Bearer {OPENAI_API_KEY}",
          "Content-Type": "application/json",
      }
  
      url = os.path.join(OPENAI_API_BASE_URL, model_name, "completions")
      response = requests.post(url, json=data, headers=headers)
      return response
  
imports: from __future__ import annotations
  from abc import ABC, abstractmethod
  from dataclasses import asdict, dataclass
  import logging
  import os
  from typing_extensions import Literal
  import requests
  from datetime import timedelta
  from typing import Optional, Union
  from ratelimit import sleep_and_retry, limits
label_desc: Use image node_id 2 for calling a global function with example usage: _call_api(prompt, model_name, api_params) and returns: response