def connect_to_api(backend=None, **kwargs):
    """Returns an API instance connected to the annotation backend.

    Some annotation backends may not expose this functionality.

    Args:
        backend (None): the annotation backend to use. The supported values are
            ``fiftyone.annotation_config.backends.keys()`` and the default
            is ``fiftyone.annotation_config.default_backend``
        **kwargs: keyword arguments for the :class:`AnnotationBackendConfig`
            subclass of the backend being used

    Returns:
        an :class:`AnnotationAPI`
    """
    if backend is None:
        backend = fo.annotation_config.default_backend

    config = _parse_config(backend, None, **kwargs)
    anno_backend = config.build()

    api = anno_backend.connect_to_api()
    if api is None:
        raise ValueError("The '%s' backend does not expose an API" % backend)

    return api
Returns an API instance connected to the annotation backend.

    Some annotation backends may not expose this functionality.

    Args:
        backend (None): the annotation backend to use. The supported values are
            ``fiftyone.annotation_config.backends.keys()`` and the default
            is ``fiftyone.annotation_config.default_backend``
        **kwargs: keyword arguments for the :class:`AnnotationBackendConfig`
            subclass of the backend being used

    Returns:
        an :class:`AnnotationAPI`
    
fiftyone/utils/annotations.py