← all repositories
MacPaw/OpenAI

Community Swift SDK wraps OpenAI’s full API surface

Gives Swift developers typed access to chat, images, audio, assistants, and even MCP tools without hand-rolling JSON.

OpenAI
Not currently ranked — collecting fresh signals.
star history

What it does MacPaw/OpenAI is a community-maintained Swift package that wraps OpenAI’s public REST API. It exposes typed structs and protocols for endpoints ranging from chat completions and image generation to audio transcription, embeddings, and the Assistants beta. The library also covers newer additions like the Responses API and Model Context Protocol (MCP) tool integration.

The interesting bit The SDK models the API surface closely enough that its own README warns you not to blindly index output[0].content[0].text from a Responses result—tool calls and reasoning tokens may share that same array. It also supports third-party providers (Gemini, DeepSeek, Perplexity, OpenRouter) through a .relaxed parsing mode, and offers cancellation across Swift Concurrency, closure-based callbacks, and Combine.

Key highlights

  • Covers the full API surface: chat, responses, images, audio, embeddings, moderations, assistants, files, and models
  • Supports MCP tool integration for Model Context Protocol workflows
  • Works with OpenAI-compatible providers via a relaxed JSON parsing option
  • Request cancellation is wired into Swift Concurrency, Combine, and legacy closure APIs
  • Configurable base URL, headers, timeouts, and organization ID for custom deployments

Verdict Swift developers building iOS, macOS, or server-side features that need comprehensive OpenAI integration should start here; if you only need basic chat completions, a thin URLSession wrapper might be lighter.

Frequently asked

What is MacPaw/OpenAI?
Gives Swift developers typed access to chat, images, audio, assistants, and even MCP tools without hand-rolling JSON.
Is OpenAI open source?
Yes — MacPaw/OpenAI is open source, released under the MIT license.
What language is OpenAI written in?
MacPaw/OpenAI is primarily written in Swift.
How popular is OpenAI?
MacPaw/OpenAI has 2.9k stars on GitHub.
Where can I find OpenAI?
MacPaw/OpenAI is on GitHub at https://github.com/MacPaw/OpenAI.

heatdrop uses Google Analytics to see which pages get read — nothing else. Your call. How we handle data.