MacPaw/OpenAI

Swift community driven package for OpenAI public API

What it solves

This project provides a community-maintained Swift implementation of the OpenAI public API, allowing Apple developers to integrate AI capabilities into their apps without writing raw REST API requests.

How it works

It acts as a Swift SDK wrapper around the OpenAI REST API. It defines types and methods that closely match the official API documentation, supporting various request patterns including Swift Concurrency (async/await), closure-based calls, and Combine subscriptions. While optimized for OpenAI, it can also work with other OpenAI-compatible providers (such as Gemini, DeepSeek, and Perplexity) by using a relaxed parsing configuration.

Who it’s for

iOS, macOS, and other Apple platform developers who want to integrate LLMs, image generation, and audio processing into their Swift applications.

Highlights

  • Comprehensive API Coverage: Supports chat completions, text responses, image generation/editing/variation, audio transcriptions/translations, and embeddings.
  • Advanced AI Features: Includes support for function calling, structured outputs, and the Assistants API (Beta).
  • **Model Context Protocol (MCP): Integration for MCP tools.
  • Flexible Integration: Compatible with Swift Package Manager and supports multiple asynchronous programming patterns.

Related

  • Project
  • Project
  • Project
  • Project
  • Project