from typing import Optional


def parse_key(headers) -> Optional[str]:
    """
    Parses the header for an API key, and returns it if found.
    The authorization header must be in the following format: ``Token <api key>``.

    :param headers: A dictionary of request headers
    :return:        If present, the key parsed from header
    """
    auth = headers.get('Authorization')
    if auth:
        parts = auth.split()
        if len(parts) == 2 and parts[0] == 'Token':
            return parts[1]
    return None