The sun has energy. Don't be confused by the "have to" part - that piece of grammar doesn't apply here (How do we know? By looking at the full sentence.).
You can understand the sentence as,
"Here's how much energy the sun has, which it can give away."