ai-model-web

A guide for calling AI models directly from browser-based web applications through the CloudBase JavaScript SDK.

In plain words
What is it for?
Use it in React, Vue, Angular, Next.js, Nuxt, static sites, dashboards, or chat interfaces that need text generation or streamed text.
Why use it?
It helps web projects add AI without automatically inserting a separate server proxy between the page and the model.

Skill for Claude CodeCodex

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add skills/tencentcloudbase/cloudbase-ai-toolkit/ai-model-web
Any agent
npx skills add TencentCloudBase/CloudBase-AI-Toolkit --skill ai-model-web
Clone the repo
git clone --depth 1 https://github.com/TencentCloudBase/CloudBase-AI-Toolkit

Made for: Claude Code, Codex.

Per session 247 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 6,138 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00247 $0.06138
Opus 5 $0.00123 $0.03069
Sonnet 5 $0.00049 $0.01228
Haiku 4.5 $0.00025 $0.00614

Measured 3d ago against content hash 62f4f0656b8a, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

ai-model-web scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 3d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

Origin

Copies of this mod

2 near-identical copies found in the catalogue:

config/.claude/skills/ai-model-web/SKILL.md · 387 lines

How it starts

The opening of the file, as written. The whole thing — 387 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Sibling skills (local only)

Sibling CloudBase skills ship beside this skill. Use local relative paths such as ../auth-tool-cloudbase/SKILL.md.

If a referenced sibling skill file is missing from this environment, ask the user to install the full CloudBase plugin (or the missing skill). Do not HTTP-fetch remote skill or protocol markdown into the agent context.

When to use this skill

Use this skill for calling AI models in browser/Web applications via @cloudbase/js-sdk.

🧭 Runtime-plane default for Web. Any time the user's request is framed around a page, a Web app, the frontend, React/Vue/Next/Nuxt, a dashboard UI, or "add AI to my H5", this skill is the default routing target. Do NOT first propose a Node.js / cloud-function / CloudRun proxy; @cloudbase/js-sdk can call the model from the browser directly. Only switch to ai-model-nodejs if the user explicitly asks for a backend/server call, image generation, or a scenario that truly needs server-side keys or long-running work. This decision is independent of which concrete model the user picks — model names (deepseek-*, glm-*, hunyuan-*, kimi-*, …) only affect the model field, not the routing plane.

Use it when you need to:

  • Integrate AI text generation into a frontend Web app
  • Stream AI responses for a better UX
  • Call Hunyuan / DeepSeek / GLM / Kimi / MiniMax models from the browser

Do NOT use for:

  • Node.js backend or cloud functions → use the ai-model-nodejs skill
  • WeChat Mini Program → use the ai-model-wechat skill
  • Image generation → use the ai-model-nodejs skill (Node SDK only)
  • Runtimes without a CloudBase SDK (native apps, Python, Go, etc.) → use the http-api-cloudbase skill (it now includes the ai_model OpenAPI spec for direct HTTP calls; do NOT build a custom HTTP proxy)

⛔ STOP — ai.createModel(...) argument is not a vendor / model name

Read this before writing any createModel(...) line. The single most common mistake when agents generate code for this SDK is hallucinating the argument. There are exactly three legal shapes. Anything else is a bug.

Read the full file on GitHub · 387 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 3d ago First seen · 387 lines · 247 tokens per session scan A 62f4f0656b8a

Subscribe to this mod's changes

ai-model-web is a skill published in the GitHub repository TencentCloudBase/CloudBase-AI-Toolkit (1,087 stars, last pushed 2d ago), licensed MIT. It adds 247 tokens to every session and 6,138 once invoked, about $0.0012 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

Other skills, from other repositories

9router-chat

Chat / code generation via 9Router using OpenAI /v1/chat/completions or Anthropic /v1/messages format with streaming + auto-fallback combos. Use when the user wants to ask an LLM, generate code, summarize text, or run prompts through 9Router.

decolua/9router · 63 tokens

9router-embeddings

Generate vector embeddings via 9Router /v1/embeddings using OpenAI / Gemini / Mistral / Voyage / Nvidia / GitHub embedding models for RAG, semantic search, similarity. Use when the user wants embeddings, vectors, RAG, semantic search, or to embed text.

decolua/9router · 66 tokens

9router

Entry point for 9Router — local/remote AI gateway with OpenAI-compatible REST for chat, image, TTS, embeddings, web search, web fetch. Use when the user mentions 9Router, NINEROUTERURL, or wants AI without writing provider boilerplate. This skill covers setup + indexes capability skills; fetch the relevant capability…

decolua/9router · 84 tokens

best-practices

Transforms vague prompts into optimized Claude Code prompts. Adds verification, specific context, constraints, and proper phasing. Invoke with /best-practices.

MoizIbnYousaf/Ai-Agent-Skills · 35 tokens

dashscope

DashScope (Alibaba Cloud Bailian / 阿里云百炼) integration — image generation (qwen-image-2.0-pro), text-to-speech (qwen3-tts-flash), and ASR with word-level timestamps (qwen3-asr-flash-filetrans). Use when generating images via Qwen-Image, narrating via Qwen-TTS, or transcribing with word-level timestamps via Qwen-ASR.

calesthio/OpenMontage · 93 tokens

llm-application-dev

Building applications with Large Language Models - prompt engineering, RAG patterns, and LLM integration. Use for AI-powered features, chatbots, or LLM-based automation.

MoizIbnYousaf/Ai-Agent-Skills · 40 tokens