Elon Musk's artificial intelligence (AI) company, xAI , has taken legal action against Apple and OpenAI .