TokenRex AI Gateway

Add AI inside your app with TokenRex: choose capabilities, keep keys private, test your feature and monitor its usage in Apirex.

By Apirex Team · Updated

On this page

TokenRex AI Gateway powers AI features inside apps you build with Apirex. Your visitors can ask an assistant a question, summarize a document or use another supported AI feature. This is separate from the builder that creates and edits your project.

Start with what your app needs

Describe the result you want in project chat. Include who can use the feature, what they submit and what a successful answer should look like. The builder shows the AI connection choice when your app needs AI. Choose TokenRex AI or supply your own service key through the secure key interface; TokenRex is not enabled without your choice.

Text
Add a support assistant to my website using TokenRex AI.
Answer questions about the help articles I provide.
Use an available low-cost chat model and stream the answer if supported.
If the answer is not in the articles, say you do not know.
Show a clear message if AI is unavailable, and prevent duplicate submissions.

Capabilities

Choose a model for the task, not just its name. The available models and their supported inputs come from TokenRex’s current catalog. An integration still needs the right request format, permissions and a real test; a model appearing in the catalog is not proof that every feature is configured in your app.

TaskTypical app featureWhat to check
Chat and textAssistants, summaries, extraction and classificationText input, output format and streaming support.
ImagesGenerate images or interpret uploaded picturesGeneration and image understanding are different capabilities.
VideoGenerate a clip from supported inputsJob status, completion and the returned playable file.
SpeechRead text aloud or transcribe a recordingSupported audio formats, languages and microphone permission.
MusicGenerate audio for an app featureWhether the live catalog provides a suitable model and output.
EmbeddingsSemantic search over your own contentA compatible model plus storage and retrieval for the vectors.

Connect safely

  1. Open your project and describe the AI feature.
  2. Choose TokenRex AI in the connection card and wait for a successful connection result.
  3. Open More → AI to check the connection and browse All AI models.
  4. Let the builder wire the feature through the protected app connection.
  5. Test the running app with real input before publishing the change.

Apirex keeps the app’s private TokenRex credential on the server. Hosted web apps do not need a separate backend just to store that key. Native and externally hosted apps need a protected server connection; never put a private key in browser code, an installed app, a prompt or a screenshot.

Preview and published apps

Test AI through the project’s preview address, then publish and test the live version too. On the paired computer, the current helper can forward local-preview AI calls through the protected project connection. If your own local server bypasses that connection, a page can load while its AI calls fail. Keep credentials private rather than copying a key into local source to work around it.

Usage and failures

The app owner pays for visitors’ AI usage. More → AI shows activity, request status and recorded credit costs. Treat connection errors, an unavailable model and an exhausted balance as different problems. Your app should keep the user’s input, explain the failure and let them retry without sending duplicate requests.