OpenAI has released a new API feature implemented as functions and function_call here
functions
function_call