Apple Inc. has closed in on an agreement with OpenAI to use the startup's technology on the iPhone, part of…