AIProxySwift is an open-source Swift library that gives iOS and macOS apps typed clients for more than a dozen AI providers, with the option to route requests through the AIProxy backend so API keys never ship inside the app. It is maintained by the AIProxy team on GitHub, has around 450 stars, and is actively updated in 2026.
Embedding an OpenAI or Anthropic key directly in a mobile app is a well-known way to get it extracted and abused. AIProxySwift addresses that with a two-part design: Swift client packages for providers including OpenAI, Gemini, Anthropic, Stability AI, DeepL, Together AI, Replicate, ElevenLabs, Fal, Groq, Perplexity, Mistral, OpenRouter, DeepSeek and Fireworks AI, plus an optional proxy mode. In proxy mode, requests pass through the AIProxy backend, which applies certificate pinning, DeviceCheck verification, split-key encryption and per-user and per-IP rate limits, keeping keys server-side and bills predictable. Developers can start with direct provider calls during prototyping or bring-your-own-key features, then switch the same client code to protected mode for production.
The library is distributed as a Swift package, so integration is a dependency line plus a few initialisation calls per provider. Its documentation walks through the mobile threat model โ extracted binaries, packet sniffing and key scraping โ and explains how the protection layers combine, which makes it as much an education in mobile API security as a client SDK.
The Swift library itself is free and open source under the MIT license. Routing requests through the AIProxy protection backend is a paid service from AIProxy, priced separately on aiproxy.com.
iOS and macOS developers who call AI APIs from their apps and need a safe way to do it in production without exposing provider keys to extraction.