Automatic generation of a chat bot from an API specification to carry out a dialog with a user and invoke an API call described in the API specification. Based on input API specification, a conversational bot specification representing a dialog flow is constructed. A natural language expression is received and transformed into instructions based on the conversational bot specification. Based on the instructions, a natural language prompt to the user and executable computer code for invoking the API call may be generated.