integrate-ai-gateway

integrate-ai-gateway is a skill for Claude Code, Codex from MacPaw/ai-sdk-typescript. It costs 71 tokens per session (1,101 once invoked), scanned A, original, MIT.

Instructions for connecting applications to MacPaw's AI Gateway through its software library. The gateway provides an application path to AI services and video generation.

In plain words
What is it for?
It is for integrating NestJS, Next.js, Vercel AI SDK, or fetch-based applications with AI Gateway and its video client.
Why use it?
It helps developers choose the right integration method and handle authentication and errors without exposing access tokens in browser code.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one.

Good fit It is for integrating NestJS, Next.js, Vercel AI SDK, or fetch-based applications with AI Gateway and its video client.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/macpaw/ai-sdk-typescript/integrate-ai-gateway
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.

Any agent
npx skills add MacPaw/ai-sdk-typescript --skill integrate-ai-gateway
Clone the repo
git clone --depth 1 https://github.com/MacPaw/ai-sdk-typescript

Made for: Claude Code, Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for integrate-ai-gateway

README.md
[![agentmods](https://agentmods.dev/badge/skills/macpaw/ai-sdk-typescript/integrate-ai-gateway/github.svg)](https://agentmods.dev/skills/macpaw/ai-sdk-typescript/integrate-ai-gateway)
Your own site
<a href="https://agentmods.dev/skills/macpaw/ai-sdk-typescript/integrate-ai-gateway"><img src="https://agentmods.dev/badge/skills/macpaw/ai-sdk-typescript/integrate-ai-gateway/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for integrate-ai-gateway

Your own site · 80×15
<a href="https://agentmods.dev/skills/macpaw/ai-sdk-typescript/integrate-ai-gateway"><img src="https://agentmods.dev/badge/skills/macpaw/ai-sdk-typescript/integrate-ai-gateway.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 71 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,101 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe. Third-party audits
  • NVIDIA SkillSpector warn 7 Sept 2026
SkillSpector: 1 finding, up to medium

These are SkillSpector’s own severities. On a checked sample its high-severity flags on skills were ~96% false positives — a documented command, a public API, a “never do X” rule — so we show them as a caution to read, not a verdict. Why →

  • medium Data Exfiltration · line 60
    Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.
    Fix: Verify the destination URL is trusted and necessary. Remove or replace with documented APIs. Ensure no secrets, tokens, or PII are transmitted.
How audits are shown
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.1 $0.00071 $0.01101
Opus 5 $0.00036 $0.00550
Sonnet 5 $0.00014 $0.00220
Haiku 4.5 $0.00007 $0.00110

Measured 9d ago against content hash 966d9eaaa35e, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-09, from the pricing page.

Security

Grade A, and why

integrate-ai-gateway 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 9d 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.

templates/cursor/skills/integrate-ai-gateway/SKILL.md · 102 lines

How it starts

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

AI Gateway Integration (@macpaw/ai-sdk)

Goal

Detect the app shape, choose one integration path, apply the smallest correct patch, add safe auth/error handling, run verification, and report exact changes.

Package surface

  • Use @macpaw/ai-sdk for createAIGatewayProvider, createGatewayProvider, createGatewayFetch, createVideoClient, GATEWAY_PROVIDERS, errors, and GatewayProviderSettings.
  • Use @macpaw/ai-sdk/provider only as a compatibility alias.
  • Use @macpaw/ai-sdk/nestjs for AIGatewayModule, @InjectAIGateway(), and AIGatewayExceptionFilter.
  • Do not use createAIGatewayClient, @macpaw/ai-sdk/client, runtime, types, or testing; they do not exist.
  • For UI hooks or schema helpers, follow the versioned upstream docs for the installed ai / @ai-sdk/react major version; this package does not redefine those APIs.

Guardrails

  • Do not invent a token source. If server-side token retrieval is unclear, ask one question.
  • Do not place real tokens in browser-only code. Frontend-only apps need a backend/BFF token source.
  • Do not remove direct OpenAI/Anthropic paths unless all usages are migrated or the user asked for it.
  • Use baseURL for staging/custom hosts. env supports only 'production'.
  • createGatewayFetch requires a resolved baseURL; do not pass only env. Prefer resolveGatewayBaseURL() when you want the default production host.

Choose one path

  • NestJS markers: @nestjs/common, *.module.ts, decorators -> use @macpaw/ai-sdk/nestjs + @macpaw/ai-sdk.
  • Next.js / Vercel markers: next, ai, @ai-sdk/* -> keep generation on ai, swap only the model provider.
  • Express/Fastify/Hono/server scripts -> use createGatewayFetch, or ai + provider if already Vercel-shaped.
  • Video generation (create job, poll status, fetch content) -> use createVideoClient.
  • Existing openai, @ai-sdk/openai, or @anthropic-ai/sdk usage -> treat as migration, not greenfield.

Canonical patterns

// Vercel AI SDK
const gateway = createAIGatewayProvider({
  env: 'production',
  getAuthToken: async () => process.env.AI_GATEWAY_TOKEN ?? null,
});
const result = streamText({ model: gateway('openai/gpt-4o'), messages });

Read the full file on GitHub · 102 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. 9d ago First seen · 102 lines · 71 tokens per session scan A 966d9eaaa35e

Subscribe to this mod's changes

integrate-ai-gateway is a skill published in the GitHub repository MacPaw/ai-sdk-typescript (58 stars, last pushed 2d ago), licensed MIT. It adds 71 tokens to every session and 1,101 once invoked, about $0.0004 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

calling-llms

Use when sending chat completions through liter-llm and routing to a specific provider via the provider/model prefix. Covers the chat call shape, provider routing, modelhint, message roles, and error categories.

xberg-io/liter-llm · 49 tokens

running-the-proxy

Use when running the liter-llm api OpenAI-compatible gateway — virtual keys, per-key rate limits, budgets, cost tracking, and model routing. Covers the TOML config and the 22 REST endpoints.

xberg-io/liter-llm · 50 tokens

streaming-responses

Use when streaming tokens incrementally from an LLM via liter-llm over SSE or async iterators. Covers chatstream, delta handling, and null-content chunks.

xberg-io/liter-llm · 39 tokens

fsl-business

Write and verify FSL business-layer specs for consultants, business owners, and PMs explicitly working on business-flow policy. Use for As-Is/To-Be process flows, actors, case stages, business policies, controls, KPIs, goals, and reform/control-preservation checks. Do not use for system requirements, UI/API/data-model…

ymm-oss/fsl · 98 tokens

vercel-ai-sdk-streaming

Build streaming AI features in Next.js with Vercel AI SDK, tool calling, RSC/UI hooks, and edge-safe API routes. Use for TypeScript fullstack AI UX with React Server Components.

vaquarkhan/Fullstack-development-agent-skills · 48 tokens

creating-agents-in-medusa

Use when building an internal admin-facing AI agent in a Medusa project. These agents are operated by merchants and store operators — not customers. Covers data models, module service, agent runtime (tools, system prompt, streamText), streaming API routes (NDJSON), and admin UI chat extensions. Load for any internal…

medusajs/medusa-agent-skills · 109 tokens