Custom OAuth

how do I connect my API to discourse using OAuth