If you need to remove sensitive information from a post history, flag the post for moderator attention and explain why you need the history to be altered.
If a moderator agrees, they can redact the history of the post. The revision will still be there, just without the sensitive data.
When a moderator redacts a revision of a post, a second moderator needs to approve the change, so this process is not instant. Flagging your post, a moderator picking up the flag, and a second moderator approving the change all takes time, so if you accidentally left in API tokens or a username and password for a server, change those as soon as possible, because we can't guarantee that the revision has not already been seen by someone with malicious intent.
I've gone ahead and redacted the specific post that prompted your question; the redaction has been approved by another moderator and the old screenshot is no longer present in the post history.