OpenAISwift is an open-source Swift client library that wraps the OpenAI and ChatGPT HTTP APIs, giving Apple-platform developers a clean, native way to call OpenAI models from Swift code.
Created by Adam Rushy and released under the MIT license, OpenAISwift hides the raw REST plumbing of the OpenAI API behind a lightweight Swift interface. Rather than hand-building URL requests and parsing JSON, developers configure the client with an API key and call typed methods for endpoints such as chat completions, with results returned as Swift values that drop naturally into SwiftUI views and app logic. The library is distributed as a Swift package, so adding it to an Xcode project takes seconds, and it works across iOS and macOS targets. The repository has earned about 1,700 stars on GitHub and was still receiving updates in 2025, making it one of the longest-standing community Swift wrappers for OpenAI’s API. It is a community project rather than an official OpenAI SDK, which is worth knowing when comparing it against OpenAI’s own offerings.
Because it is a deliberately thin wrapper, OpenAISwift tends to track new OpenAI endpoints quickly, and when an app needs a brand-new API parameter before the library exposes it, the codebase is small enough to patch or fork without a fight.
OpenAISwift is free and open source under the MIT license. You only pay OpenAI itself for API usage, billed under your own OpenAI account and API key.
OpenAISwift is for iOS and macOS developers who want the quickest path to adding OpenAI-powered chat or completion features to a Swift app, without adopting a heavy framework or writing their own networking layer.