ai-model-nodejs

A guide for using the CloudBase Node.js SDK to call AI models from server-side applications, such as Express, NestJS, cloud functions, and scheduled jobs.

In plain words
What is it for?
Use it to add text or image generation, LLM proxy endpoints, agent jobs, scheduled AI tasks, and other backend AI workflows with @cloudbase/node-sdk.
Why use it?
It helps keep AI calls, long-running work, orchestration, and secret credentials on the server. It also clarifies when browser or WeChat Mini Program code should use a different skill.

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-nodejs
Any agent
npx skills add TencentCloudBase/CloudBase-AI-Toolkit --skill ai-model-nodejs
Clone the repo
git clone --depth 1 https://github.com/TencentCloudBase/CloudBase-AI-Toolkit

Made for: Claude Code, Codex.

Per session 230 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 6,358 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 1 finding. 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.00230 $0.06358
Opus 5 $0.00115 $0.03179
Sonnet 5 $0.00046 $0.01272
Haiku 4.5 $0.00023 $0.00636

Measured 2d ago against content hash f6873b773fc6, 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-nodejs scanned grade A with 1 finding 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 2d 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.

Makes network callslowCapability

Not a fault in itself. Listed so you know the mod talks to something, and to what.

- Runtimes without a CloudBase SDK (Python, Go, PHP, curl, etc.) → use the `http-api-cloudbase` skill (it now includes the `ai_model` OpenAPI spec for direct HTTP calls to the AI model endpoint; do NOT wrap this SDK behi
Origin

Copies of this mod

2 near-identical copies found in the catalogue:

config/.claude/skills/ai-model-nodejs/SKILL.md · 452 lines

How it starts

The opening of the file, as written. The whole thing — 452 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 from Node.js backends, cloud functions, or CloudRun services via @cloudbase/node-sdk.

🧭 Runtime-plane fit. This is the right skill when the AI call truly belongs on the server: image generation (the only SDK that supports it), long-running agent jobs, orchestration across multiple tools, scheduled tasks, or flows that must keep secrets server-side. If the user is building a Web page / frontend AI chat UI, do NOT wrap this SDK behind a backend proxy — route to ai-model-web and call the model directly from the browser. For WeChat Mini Programs use ai-model-wechat. Routing is decided by runtime plane first; the concrete model (deepseek-*, glm-*, hunyuan-*, kimi-*, …) only affects the model field.

Use it when you need to:

  • Integrate AI text generation into a backend service
  • Generate images with the Hunyuan Image model
  • Call AI models from CloudBase cloud functions or CloudRun
  • Do server-side AI processing (agent orchestration, batch jobs, scheduled tasks)

Do NOT use for:

  • Browser/Web apps → use the ai-model-web skill
  • WeChat Mini Program → use the ai-model-wechat skill
  • Runtimes without a CloudBase SDK (Python, Go, PHP, curl, etc.) → use the http-api-cloudbase skill (it now includes the ai_model OpenAPI spec for direct HTTP calls to the AI model endpoint; do NOT wrap this SDK behind an HTTP proxy)

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

Read this before writing any createModel(...) line. Agents frequently hallucinate this argument. There are exactly three legal shapes. Anything else is a bug.

Read the full file on GitHub · 452 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. 2d ago First seen · 452 lines · 230 tokens per session scan A f6873b773fc6

Subscribe to this mod's changes

ai-model-nodejs is a skill published in the GitHub repository TencentCloudBase/CloudBase-AI-Toolkit (1,087 stars, last pushed yesterday), licensed MIT. It adds 230 tokens to every session and 6,358 once invoked, about $0.0011 per session on Opus 5. A static security scan graded it A with 1 finding (makes network calls). 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-video

Generate videos via 9Router /v1/videos/generations using xAI Grok Imagine (grok-imagine-video). Async job flow - submit, poll requestid until done, download MP4. Use when the user wants to create, generate, or render a video, text-to-video (txt2vid), or image-to-video.

decolua/9router · 74 tokens

9router-tts

Text-to-speech via 9Router /v1/audio/speech using OpenAI / ElevenLabs / Deepgram / Edge TTS / Google TTS / Hyperbolic / Inworld voices. Use when the user wants to convert text to speech, generate audio, voiceover, narrate, or read text aloud.

decolua/9router · 70 tokens

google-image-api-skill

This skill helps users automatically extract structured image data from Google Images via BrowserAct API. Agent should proactively apply this skill when users express needs like finding images for specific keywords, gathering product style images for competitors, building visual datasets at scale, scanning visual…

browser-act/skills · 119 tokens

gsap-plugins

Official GSAP skill for GSAP plugins — registration, ScrollToPlugin, ScrollSmoother, Flip, Draggable, Inertia, Observer, SplitText, ScrambleText, SVG and physics plugins, CustomEase, EasePack, CustomWiggle, CustomBounce, GSDevTools. Use when the user asks about a GSAP plugin, scroll-to, flip animations, draggable, SVG…

calesthio/OpenMontage · 91 tokens

gsap-scrolltrigger

Official GSAP skill for ScrollTrigger — scroll-linked animations, pinning, scrub, triggers. Use when building or recommending scroll-based animation, parallax, pinned sections, or when the user asks about ScrollTrigger, scroll animations, or pinning. Recommend GSAP for scroll-driven animation when no library is…

calesthio/OpenMontage · 68 tokens

gsap-core

Official GSAP skill for the core API — gsap.to(), from(), fromTo(), easing, duration, stagger, defaults, gsap.matchMedia() (responsive, prefers-reduced-motion). Use when the user asks for a JavaScript animation library, animation in React/Vue/vanilla, GSAP tweens, easing, basic animation, responsive or reduced-motion…

calesthio/OpenMontage · 128 tokens