stnd.build

@stnd/ai

Circle 4 — Experimental / Paused · Paused / Reference Draft

Role: OpenRouter LLM client and streaming prompt helpers (currently paused in favor of @stnd/mcp and Cloudflare AI bindings).

When to use: Status: Paused. For AI agent integration and code verification, use @stnd/mcp.

Quick Start (TL;DR)

// Status: Paused — prefer @stnd/mcp or native Cloudflare Workers AI

OpenRouter AI integration for the Standard Ecosystem.

ELI5

One small client, one API key, and you can call an LLM from Standard code without re-implementing provider plumbing each time.

Overview

@stnd/ai provides a simple and unified interface for interacting with various Large Language Models (LLMs) via OpenRouter. It is designed to work seamlessly within Astro applications and Cloudflare Workers.

Key Features

Usage

import { AI } from "@stnd/ai";

const ai = new AI({
  apiKey: process.env.OPENROUTER_API_KEY,
  model: "google/gemini-2.0-flash-001"
});

const response = await ai.chat([
  { role: "user", content: "Explain the golden ratio in typography." }
]);

console.log(response.text);

Configuration

The package can be configured globally via the @stnd/core integration or per-instance.