Skip to main content

Overview

InsForge provisions an OpenRouter API key for Model Gateway projects. New Swift applications should call OpenRouter directly from trusted server-side code, a backend API, or another secure boundary. Do not embed the OpenRouter key in an iOS, macOS, tvOS, or watchOS app binary. The previous InsForge Swift AI SDK methods are deprecated compatibility wrappers. Use the InsForge SDK for database, auth, storage, functions, and realtime; use OpenRouter for model calls.

Server-Side OpenRouter Call

Use the OpenAI SDK or REST from your backend. For TypeScript backends:

Calling Your Backend from Swift

Use an app session token or another user-scoped credential for your backend route. Never send the OpenRouter key from a Swift client.

Legacy InsForge AI Methods

These Swift SDK methods are deprecated for new AI integrations:
  • insforge.ai.chatCompletion(...)
  • insforge.ai.generateEmbeddings(...)
  • insforge.ai.generateImage(...)
  • insforge.ai.listModels()
They target the deprecated InsForge AI proxy. New integrations should use the OpenRouter key from the dashboard and follow OpenRouter’s current API docs for model parameters and capabilities.