OpenAI Swift

OpenAI Swift

โ˜… 3.8 ๐Ÿ”– 1200 saves ๐Ÿ’ฐ Free GitHub

OpenAI Swift is the community-driven Swift package from MacPaw that gives Apple-platform developers first-class access to the OpenAI API. Where OpenAI ships no official Swift SDK, this package fills the gap with modern Swift concurrency, typed models for requests and responses, and streaming built in โ€” and it has become the de-facto standard, with about 3,000 stars on GitHub, frequent appearances on trending lists and active maintenance in 2026.

Overview

The package covers the breadth of the public API: chat completions and the Responses API, embeddings, image generation and edits, text-to-speech and transcription, moderation, assistants and file management. Everything is async/await native, responses stream as Swift sequences, and parameters are strongly typed so mistakes surface at compile time instead of as JSON errors. It also supports compatible endpoints, so the same client can talk to Azure OpenAI or local OpenAI-style servers by changing configuration. Distributed through Swift Package Manager, it drops cleanly into iOS, macOS, watchOS and visionOS projects, and MacPaw maintains it against API changes with a public changelog and thorough tests. Many shipped AI apps on the App Store quietly depend on it. Installation takes a single Swift Package Manager dependency line, and the repository’s examples cover the most common integration patterns for new users.

Key Features

  • Typed Swift client for chat, Responses, embeddings, images and audio APIs
  • Modern async/await design with token-by-token streaming support
  • Structured request/response models that catch errors at compile time
  • Works with OpenAI, Azure OpenAI and OpenAI-compatible endpoints
  • Swift Package Manager distribution for all Apple platforms
  • Actively maintained by MacPaw with tests and timely API updates

๐Ÿ’ณ Pricing

OpenAI Swift is completely free and open source under the MIT license. API usage itself is billed by your OpenAI (or compatible) provider account.

Who Is It For

OpenAI Swift is for iOS and macOS developers who want a reliable, idiomatic way to build OpenAI-powered features into Apple-platform apps without hand-rolling networking and JSON parsing.

๐Ÿš€ Visit OpenAI Swift Official Site

๐Ÿšฉ Report an issue