Your first SDK call
Drop a script tag on any page and make your first ai.run() translate call — paste it, run it, see a translation.
This is the fastest path from zero to a working AI call — a script tag and a few lines of JavaScript. It uses a shared dev key so you can try it before finishing Get your API key.
1. Add the script tag
<script src="https://js.quravin.com/v1.js"></script>
2. Create the client and call ai.run()
<button id="go">Translate</button>
<div id="out"></div>
<script>
const ai = new Quravin.Quravin({
endpoint: "https://api.example.com/ai-pipeline",
apiKey: "dev-replace-me", // ← swap for your own key, see "Get your API key"
});
document.getElementById("go").onclick = async () => {
const out = await ai.run({
pipeline: "translate-string",
inputs: { text: "Hello", target_language: "German" },
});
document.getElementById("out").textContent = out.translation;
};
</script>
Click the button — out holds { translation: "Hallo" }. That’s a full round trip: submit, poll,
done.
3. Swap in your own key
dev-replace-me only works against the dev environment. Once you’ve completed Get your API
key, replace apiKey with your real key — but never ship a
real key in browser code. See Choose your auth mode for the
safe way to do this in production.
Next: read Choose your auth mode before you ship anything to production.