Master the FreeToken Swift client and unlock the ultimate AI powers for your iOS and macOS games. Level up with local processing, cloud connectivity, and totally rad features! đšī¸
Boot up your development rig and get FreeToken running in your game in just a few minutes!
Enter Game âComplete arsenal of methods, classes, and abilities to dominate the AI realm.
View Arsenal âEpic quests showing how to build chat NPCs, AI companions, and totally rad game features!
Start Quest âSmart routing between local device AI and cloud servers for maximum performance
Persistent chat threads with full context memory for epic NPC interactions
Vector-powered document storage for building intelligent Q&A systems
Build custom tools and integrate web search for ultimate AI capabilities
End-to-end encryption and private data stores keep your players' info secure
AI-powered image analysis for multi-modal gaming experiences
// Boot up your AI arcade machine! đšī¸ let arcadeClient = FreeToken.shared.configure(appToken: "player-one-token") await arcadeClient.registerDeviceSession(scope: "retro-game") { // Spawn a new conversation thread await arcadeClient.createMessageThread { gameThread in let playerMessage = Message(role: .user, content: "Hey AI, ready to play?") await arcadeClient.addMessageToThread(id: gameThread.id, message: playerMessage) { _ in await arcadeClient.runMessageThread(id: gameThread.id) { aiResponse in print("đ¤ AI Player: \(aiResponse.content)") // Game on! Your AI companion is ready! } error: { gameError in print("đĨ Game Over: \(gameError.localizedDescription)") } } } }