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.
npx skills add netlify/context-and-tools --skill netlify-ai-gatewaygit clone --depth 1 https://github.com/netlify/context-and-toolsWrote 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.
[](https://agentmods.dev/skills/netlify/context-and-tools/netlify-ai-gateway)<a href="https://agentmods.dev/skills/netlify/context-and-tools/netlify-ai-gateway"><img src="https://agentmods.dev/badge/skills/netlify/context-and-tools/netlify-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.
<a href="https://agentmods.dev/skills/netlify/context-and-tools/netlify-ai-gateway"><img src="https://agentmods.dev/badge/skills/netlify/context-and-tools/netlify-ai-gateway.svg" alt="Reviewed on agentmods" width="80" height="20"></a>- Socket pass
- Snyk pass
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.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.00154 | $0.03559 |
| Opus 5.5 | $0.00062 | $0.01424 |
| Sonnet 5.5 | $0.00031 | $0.00712 |
| Haiku 4.5 | $0.00015 | $0.00356 |
Grade C, and why
netlify-ai-gateway scanned grade C 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 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.
Hidden instructionshighPrompt injection
Directives inside HTML comments, invisible characters or bidirectional overrides are read by the model and not by the person reviewing the file.
<!-- system: agent-context/ai-gateway/system.md — human-owned, merged by ctx-gen; edit system.md, not this section --> Copies of this mod
1 near-identical copy found in the catalogue:
- netlify-ai-gateway — 91% identical, 65 lines differ
How it starts
The opening of the file, as written. The whole thing — 272 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Netlify AI Gateway
Call AI models from Netlify compute using the provider's official SDK. The gateway injects provider credentials automatically — instantiate the SDK with no args and it works.
Use the provider SDK with injected env credentials. Do not hand-roll a raw fetch() against the gateway URL, and do not wire calls to NETLIFY_AI_GATEWAY_KEY / NETLIFY_AI_GATEWAY_URL as your default path — those are for third-party/unsupported libraries only (see below).
Footguns (read first)
- Not browser-callable. Gateway calls belong in Functions or Edge Functions — never in client-side code. The browser has no injected credentials.
- Runtime-only credentials. Never call the gateway from build scripts, prerender/SSG, or build plugins — those get no credentials and fail. Do AI work at request time; cache to Netlify Blobs if output must look precomputed.
- 60-second sync timeout. A gateway call in a synchronous function is bound by the 60s function timeout. Stream long generations (SDK streaming +
ReadableStream), or use a background function that persists output for the client to fetch. Never leave a slow generation unstreamed. - Requires one production deploy. The gateway does not activate until a project has at least one production deploy. Even for local dev, run
netlify deploy --prodonce first. - Don't hardcode model lists. Available models change. Check the live providers endpoint (
https://api.netlify.com/api/v1/ai-gateway/providers/detailed) rather than baking in a static list. That endpoint lists models — it is not where AI requests are sent. - OpenRouter SDK needs 1.2.43+. Earlier versions ignore
OPENROUTER_BASE_URL, call openrouter.ai directly, and fail with401 Missing Authentication header.
Where code goes
Write normal Function/handler code — there is no AI-specific file type. A function at netlify/functions/joke.js exporting config = { path: "/api/joke" } is served at /api/joke under both netlify dev and production.
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.
- 9d ago Changed · +2 lines abaebc8c6e78
- 1mo ago Changed 9eab383d64c9
- 2mo ago Changed · +69 lines · +19 tokens per session 5bb82e44e594
- 3mo ago First seen · 201 lines · 135 tokens per session scan C e848053729b1
netlify-ai-gateway is a skill published in the GitHub repository netlify/context-and-tools (58 stars, last pushed yesterday), licensed MIT. It adds 154 tokens to every session and 3,559 once invoked, about $0.0006 per session on Opus 5.5. A static security scan graded it C with 1 finding (hidden instructions). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.
netlify-ai-gateway compared with skills from other repositories
| Mod | Type | Stars | Last push | Licence | Scan | Tokens | Works with |
|---|---|---|---|---|---|---|---|
| netlify-ai-gatewaynetlify/context-and-tools | Skill | 58 | yesterday | MIT | C | 154 | Claude Code |
| open-sourcebrowser-use/browser-use | Skill | 123k | today | MIT | A | 101 | Claude Code |
| gemini-api-agent-platformdavila7/claude-code-templates | Skill | 35k | today | MIT | A | 61 | Claude Code, Codex |
| prowler-mcpprowler-cloud/prowler | Skill | 15k | today | Apache-2.0 | A | 67 | Claude Code |
| gemini-api-devgoogle-gemini/gemini-skills | Skill | 5.1k | today | Apache-2.0 | A | 96 | Claude Code |
| deepstream-sopNVIDIA/skills | Skill | 4.3k | today | Apache-2.0 | A | 219 | Claude Code |
| tao-run-inference-serviceNVIDIA/skills | Skill | 4.3k | today | Apache-2.0 | A | 92 | Claude Code |