Skip to main content

Overview

InsForge provisions an OpenRouter API key for Model Gateway projects. New Kotlin applications should call OpenRouter from trusted server-side code, a backend API, or another secure boundary. Do not embed the OpenRouter key in Android or desktop client binaries. The previous InsForge Kotlin 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 Kotlin

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

Legacy InsForge AI Methods

These Kotlin SDK methods are deprecated for new AI integrations:
  • client.ai.listModels()
  • client.ai.chatCompletion(...)
  • client.ai.chatCompletionStream(...)
  • client.ai.generateEmbeddings(...)
  • client.ai.generateImage(...)
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.