You can limit the number of calls by implementing a counter that increments with each call and breaks the recursive loop when a certain limit is reached. Here's an example:

let count = 0;
const limit = 10;

function reloadResource(){
    fetch('https://example.com/api/resource', {
        method: 'GET',
        headers: {
            'Content-Type': 'application/json',
        },
    })
    .then(response => response.json())
    .then(data => {
        console.log('Success:', data);
        if (++count < limit) {
            setInterval(reloadResource, 1000);
        }
    })
    .catch((error) => {
        console.error('Error:', error);
    });
}
spam fails_task lang_mismatch pii not_appropriate hate_speech sexual_content quality toxicity humor helpfulness creativity violence