Dhruvs AI Gateway

v2.0 Active

Connect any *.dhruvs.host website to world-class AI models using a single script tag. Zero API keys required on the client, and no complex backend setup.

🔒 Security Restriction

To prevent abuse, this gateway is strictly locked to domains ending in dhruvs.host. Attempting to run this script from any other domain will result in a use dhruvs.host domain error in your console, and the request will be blocked.

Quick Start

1. Control the AI's Personality

Create a prompt.txt file at the root of your website. This file strictly controls the AI.

prompt.txt
You are a helpful and sarcastic AI assistant. Think step-by-step. Keep your final answers brief.

2. Embed the Script

Add this script tag to your HTML file.

html
<script src="https://gateway.dhruvs.host/widget.js" defer></script>

3. Call the AI

Use the global window.dhruvs() function. It takes four arguments:
(action, message, model_id, showThinking)

javascript
async function runAI() {
  const reply = await window.dhruvs(
    "gateway-call", 
    "Explain quantum physics in one sentence.", 
    "alibaba/qwen3-max", // Provider and Model ID
    true                 // Set to true to output reasoning tokens (if supported)
  );
  console.log(reply);
}

Supported Models

Pass any of the following strings as the third argument to the function. The Gateway automatically routes the request to the correct provider.

Provider Model ID String
Alibaba alibaba/qwen3-max
alibaba/qwen3.5-plus
OpenAI openai/gpt-4o
openai/gpt-4o-mini
Anthropic anthropic/claude-3-5-sonnet-20240620
Google google/gemini-1.5-pro

API Endpoints

POST /api/gateway

The primary data stream endpoint. This is automatically handled by the widget.js script.

GET /health

A diagnostic endpoint to verify the gateway is operational. It bypasses the streaming protocol and uses gpt-5-mini to return a strict JSON status response.

{
  "status": "healthy",
  "model": "openai/gpt-5-mini",
  "response": "OK - Systems Operational"
}