The OpenAI guide can be found here OpenAI Platform
Basically you define a function in your code and then you use a new parameter in the function call to explain the structure of that function and the model can reply with a json object containing the function call parameters if it detects that the function call is needed.