SwiftOpenAI is an open-source Swift package that gives Apple-platform developers native access to OpenAI’s public API. Maintained by James Rochabrun and released under the MIT license, it describes itself as the most complete open-source Swift client for OpenAI, covering everything from chat completions to assistants. The project has about 665 stars on GitHub and was still actively updated in October 2026.
The package is distributed through Swift Package Manager, so it drops into iOS and macOS projects as a single dependency. It wraps OpenAI’s API endpoints in idiomatic Swift, with typed request and response models instead of hand-built JSON, so calls read like ordinary Swift code. Newer versions also add support for Azure OpenAI endpoints and proxy services such as AIProxy, which helps teams that need to route traffic through their own backend or protect their keys. The same project family now includes a companion command-line tool and an MCP server variant, so the client logic can be reused outside SwiftUI apps. The documentation walks through getting an API key, installation and everyday usage, making it a practical starting point for ChatGPT-powered features in native apps.
SwiftOpenAI is completely free and open source under the MIT license. There is no paid tier; you only pay OpenAI for API usage through your own API key.
SwiftOpenAI is for iOS and macOS developers who want to build ChatGPT-powered chat, assistant or content features into native Swift apps without maintaining their own networking layer for the OpenAI API.