def validate_api_key_format()

in yourbench/main.py [0:0]


def validate_api_key_format(api_key: str) -> tuple[bool, str]:
    """Validate API key format - should be env variable or empty."""
    if not api_key:
        return True, ""

    if api_key.startswith("$"):
        return True, api_key

    # Check if it looks like a real API key
    if len(api_key) > 10 and any(c in api_key for c in ["sk-", "key-", "api-", "hf_"]):
        return False, "Please use environment variable format (e.g., $OPENAI_API_KEY)"

    return True, api_key