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.
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.
| Task | Typical app feature | What to check |
|---|---|---|
| Chat and text | Assistants, summaries, extraction and classification | Text input, output format and streaming support. |
| Images | Generate images or interpret uploaded pictures | Generation and image understanding are different capabilities. |
| Video | Generate a clip from supported inputs | Job status, completion and the returned playable file. |
| Speech | Read text aloud or transcribe a recording | Supported audio formats, languages and microphone permission. |
| Music | Generate audio for an app feature | Whether the live catalog provides a suitable model and output. |
| Embeddings | Semantic search over your own content | A compatible model plus storage and retrieval for the vectors. |
Connect safely
- Open your project and describe the AI feature.
- Choose TokenRex AI in the connection card and wait for a successful connection result.
- Open More → AI to check the connection and browse All AI models.
- Let the builder wire the feature through the protected app connection.
- 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.