OpenAI

Swift community driven package for OpenAI public API

What is OpenAI?

Swift community driven package for OpenAI public API

Overview of OpenAI

What it is

OpenAI is a Swift community-maintained package that provides an implementation over the OpenAI public API. It is developed by MacPaw and hosted on GitHub. The package aims to closely follow the REST API documentation available on platform.openai.com.

Key features

  • Swift community-maintained implementation of the OpenAI public API - Supports text and prompting via Responses and Chat Completions endpoints - Includes function calling and tools, including Model Context Protocol (MCP) tool integration - Covers image creation, editing, and variation endpoints - Provides audio speech synthesis, transcription, and translation endpoints - Supports structured outputs and specialized models like Embeddings and Moderations - Offers Assistants (Beta) functionality with threads, runs, and file management

Use cases

Developers can use this package to integrate OpenAI's capabilities into Swift applications. Common use cases include building chatbots, generating images from text prompts, transcribing or translating audio, creating AI assistants with custom tools, and leveraging embeddings for search or classification tasks. The package also works with other providers that support an OpenAI-compatible API, such as Gemini, DeepSeek, Perplexity, and OpenRouter.

Getting started

Install via Swift Package Manager. In Xcode, go to File > Add Package Dependencies... and enter the repository URL: https://github.com/MacPaw/OpenAI.git Or add to your Package.swift: swift dependencies: [ .package(url: “https://github.com/MacPaw/OpenAI.git”, branch: “main”) ] Initialize the client with an API token: swift let openAI = OpenAI(apiToken: “YOUR_TOKEN_HERE”) For more configuration options, see the OpenAI.Configuration struct.

License and pricing

The package is licensed under the MIT License and is open source (free to use).

Based on the project's public README and repository metadata.

Add this badge to your README

Featured on YunoDB Badge styles & help

Maintain this project? Show that it is featured on YunoDB.

Markdown[![Featured on YunoDB](https://yunodb.com/badge/macpawopenai.svg)](https://yunodb.com/tools/macpawopenai?utm_source=github&utm_medium=badge)
HTML<a href="https://yunodb.com/tools/macpawopenai?utm_source=github&utm_medium=badge"><img src="https://yunodb.com/badge/macpawopenai.svg" alt="Featured on YunoDB" height="20"></a>