OpenAI Starter

Ship SwiftUI AI features with OpenAI — secure by default

Drop in ChatGPT chat, DALL·E image generation, and Vision analysis with ready-made SwiftUI screens. Every request is proxied through a backend with HMAC-signed requests, so your API keys never ship inside the app. Built on SwiftUI, iOS 17+, and Swift 6.

ChatGPT, DALL·E & Vision

Multi-turn chat plus one-off requests, DALL·E image generation, and Vision image analysis — each with a ready-made SwiftUI screen.

Secure by default

All AI calls are proxied through a backend with HMAC-signed requests. Your API keys stay server-side and never embed in the shipped app.

Dex scanner (new)

A Pokédex-style scan-anything feature: Apple's on-device Vision gives instant offline classification, then a multimodal model returns a rich entry — all saved to a persistent SwiftData Dex with offline fallback.

The Dex scanner

Point your camera at a plant, a fish, a rock — even a Pokémon — and identify it. The Dex scanner is the showcase of on-device and cloud AI working together, built on the Vision template.

  • Apple's on-device Vision framework returns an instant, fully offline, private coarse classification with a confidence score — at zero inference cost.
  • A multimodal model then returns a rich entry: name, scientific name, fun facts, and rarity.
  • Every scan is collected into a persistent, browseable Dex backed by SwiftData, with graceful offline fallback when the network is unavailable.

Code snippet

func sendPrompt(_ prompt: String) async throws -> String {
  // Routed through the signed backend — no API key in the app.
  let service = ChatGPTService()
  return try await service.sendPrompt(prompt)
}

FAQ

What OpenAI use cases does this starter support?

Ready-made SwiftUI screens for ChatGPT (multi-turn conversations plus one-off requests), DALL·E image generation, and Vision image analysis — plus the new Dex scanner that identifies anything you point your camera at.

How does the starter handle API security concerns?

Every AI request is proxied through a secure backend using HMAC-signed requests, so your OpenAI API keys stay server-side and are never embedded in the shipped app.

Can this be combined with auth and subscriptions?

Yes. It pairs with Supabase authentication and RevenueCat subscriptions so you can gate and monetize AI features in the same boilerplate.

Related guides