AI Gateway
Add Gemini and GPT features without storing provider keys in your project
AI Gateway gives each Swarmz project a server-side model endpoint. Model usage is charged to the workspace's Swarmz credits, and provider keys never enter project code.
Use AI Gateway
AI Gateway is built into every project. In chat, describe the server-side AI feature and the data it may receive. For example:
Add a support assistant that answers from the signed-in user's saved articles. Use AI Gateway and stream the response.
The agent adds the project gateway key as a server secret and calls the OpenAI-compatible endpoint from an Edge Function. Do not move that key into browser code or a VITE_ variable.
Verify the integration
- Run the feature with non-sensitive test input.
- Confirm the response streams or completes as designed.
- Open project usage and confirm the model request appears against the correct workspace.
- Confirm the browser network panel and generated client bundle do not contain the gateway key.
If a request reports insufficient credits, add credits or lower the model cost before retrying. The AI Gateway connection cannot be removed because it is project infrastructure; an administrator can disable new AI Gateway work with the platform control.