def __init__(
        self,
        remote_host: str | None = None,
        api_key: str | None = None,
        default_target: str | None = None,
        api_version='v0.3',
        max_retry_seconds: int = 3600,
        job_settings: dict | None = None,
        verbose=False,
    ):
        """Creates the Service to access IonQ's API.

        Args:
            remote_host: The location of the api in the form of an url. If this is None,
                then this instance will use the environment variable `IONQ_REMOTE_HOST`. If that
                variable is not set, then this uses `https://api.ionq.co/{api_version}`, where
                `{api_version}` is the `api_version` specified below.
            api_key: A string key which allows access to the api. If this is None,
                then this instance will use the environment variable  `IONQ_API_KEY`. If that
                variable is not set, then this will raise an `EnvironmentError`.
            default_target: Which target to default to using. If set to None, no default is set
                and target must always be specified in calls. If set, then this default is used,
                unless a target is specified for a given call. Supports either 'qpu' or
                'simulator'.
            api_version: Version of the api. Defaults to 'v0.3'.
            max_retry_seconds: The number of seconds to retry calls for. Defaults to one hour.
            job_settings: A dictionary of settings which can override behavior for circuits when
                run on IonQ hardware.
            verbose: Whether to print to stdio and stderr on retriable errors.

        Raises:
            OSError: If the `api_key` is None and has no corresponding environment variable set.
                This is actually an EnvironmentError which is equal to an OSError.
        """
        self.remote_host = (
            remote_host
            or os.getenv('CIRQ_IONQ_REMOTE_HOST')
            or os.getenv('IONQ_REMOTE_HOST')
            or f'https://api.ionq.co/{api_version}'
        )

        self.job_settings = job_settings or {}
        self.api_key = api_key or os.getenv('CIRQ_IONQ_API_KEY') or os.getenv('IONQ_API_KEY')

        if not self.api_key:
            raise EnvironmentError(
                'Parameter api_key was not specified and the environment variable '
                'IONQ_API_KEY was also not set.'
            )

        self._client = ionq_client._IonQClient(
            remote_host=self.remote_host,
            api_key=self.api_key,
            default_target=default_target,
            api_version=api_version,
            max_retry_seconds=max_retry_seconds,
            verbose=verbose,
        )
Creates the Service to access IonQ's API.

        Args:
            remote_host: The location of the api in the form of an url. If this is None,
                then this instance will use the environment variable `IONQ_REMOTE_HOST`. If that
                variable is not set, then this uses `https://api.ionq.co/{api_version}`, where
                `{api_version}` is the `api_version` specified below.
            api_key: A string key which allows access to the api. If this is None,
                then this instance will use the environment variable  `IONQ_API_KEY`. If that
                variable is not set, then this will raise an `EnvironmentError`.
            default_target: Which target to default to using. If set to None, no default is set
                and target must always be specified in calls. If set, then this default is used,
                unless a target is specified for a given call. Supports either 'qpu' or
                'simulator'.
            api_version: Version of the api. Defaults to 'v0.3'.
            max_retry_seconds: The number of seconds to retry calls for. Defaults to one hour.
            job_settings: A dictionary of settings which can override behavior for circuits when
                run on IonQ hardware.
            verbose: Whether to print to stdio and stderr on retriable errors.

        Raises:
            OSError: If the `api_key` is None and has no corresponding environment variable set.
                This is actually an EnvironmentError which is equal to an OSError.
        
cirq-ionq/cirq_ionq/service.py