build

build is a command for Claude Code from Azure/ai-gateway. It costs 0 tokens per session (814 once invoked), scanned A, original, MIT.

A command that takes an existing AI Gateway from resource discovery to working application code. It can connect to models, MCP tool servers, or a standalone agent.

In plain words
What is it for?
Use it when building an app that needs to call a gateway model, connect gateway tools, or use the GitHub Copilot SDK to create an agent.
Why use it?
It combines selecting available resources, getting the required API key, and choosing a suitable integration path.

Command for Claude Code ✓ vendor

Written for Claude Code: argument-hint in frontmatter.

Part of the ai-gateway plugin — 1 skill, 2 commands shipped together

Good fit Use it when building an app that needs to call a gateway model, connect gateway tools, or use the GitHub Copilot SDK to create an agent.

Compare 6 commands from other repositories ↓
Install with agentmods
npx agentmods add commands/azure/ai-gateway/build
About the project

Azure AI Gateway is an Azure API Management tier that gives applications one governed way to call AI model APIs and MCP tools while platform teams apply security, policy, networking, and observability controls. It is used by developers and platform teams working with models and tools from multiple providers, and the repository's coding-agent plugin discovers registered models and MCP servers to help build applications on an existing gateway.

Azure/ai-gateway · 5 stars · on GitHub · ai.gateway.azure.com

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.

Clone the repo
git clone --depth 1 https://github.com/Azure/ai-gateway

Made for: Claude Code.

Or install ai-gateway, the plugin that ships this one along with the rest of its 1 skill, 2 commands.

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 build

README.md
[![agentmods](https://agentmods.dev/badge/commands/azure/ai-gateway/build/github.svg)](https://agentmods.dev/commands/azure/ai-gateway/build)
Your own site
<a href="https://agentmods.dev/commands/azure/ai-gateway/build"><img src="https://agentmods.dev/badge/commands/azure/ai-gateway/build/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 build

Your own site · 80×15
<a href="https://agentmods.dev/commands/azure/ai-gateway/build"><img src="https://agentmods.dev/badge/commands/azure/ai-gateway/build.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 0 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 814 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.
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.00000 $0.00814
Opus 5.5 $0.00000 $0.00326
Sonnet 5.5 $0.00000 $0.00163
Haiku 4.5 $0.00000 $0.00081

Measured 1mo ago against content hash 6e3033a55215, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

build 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 1mo 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.

commands/build.md · 53 lines

How it starts

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

/ai-gateway:build

Take the user all the way from discovery to working code that uses an existing AI Gateway's models and/or MCP tools — in whatever they're building. This command runs the full workflow in the bundled skill skills/use-ai-gateway/SKILL.md end to end:

  1. Discover & select the models and MCP tool servers in the gateway (Part 1 of the skill). Use $ARGUMENTS for the target gateway (ARM gatewayResourceId — required to list assets; a host alone is not enough, so resolve or ask for the id if only a host is given) and, if present, the desired use case. Ask the user to confirm the selected assets before continuing.
  2. Retrieve a credential — list the gateway API keys and read the secret of the chosen key. The same gateway key authenticates both the model passthrough and the MCP tool servers, passed in the Api-Key header.
  3. Integrate (Part 2 of the skill). Ask what the user is building and pick the path:
    • Call a model over the gateway's OpenAI-compatible passthrough (any language or raw HTTP).
    • Connect MCP tools from an MCP-capable client/app.
    • Scaffold a standalone agent with the GitHub Copilot SDK (github-copilot-sdk >= 1.0.0) if the user wants a ready-to-run agent project — default to Python unless they ask for TypeScript. Produce a complete, self-contained project: agent code, .env / .env.example, .gitignore (must ignore .env), requirements.txt (or package.json), and a README.md. Integrate into the user's existing project when they have one, respecting its language and conventions.
  4. Run and verify the integration once and report the outcome, distinguishing genuine wiring bugs (unknown_model, 401/403, missing env var) from benign backend conditions (429/quota).

Guardrails

  • Consumption only. This is strictly read-only against the gateway. Never issue ARM PUT/PATCH/DELETE calls and never create, provision, or delete gateways, models, tools, connections, or products. If the user asks to provision anything, tell them that is an administrator task done in the AI Gateway Portal.
  • Never hardcode secrets. Read the gateway key from an environment variable and keep .env out of source control. Warn the user that the written .env holds a live key and to rotate it in the portal if it is ever exposed.
  • Use properties.deployment.modelName (exact dots/casing) as the model identifier — prefer it over the ARM name or displayName (which some gateways reject with unknown_model). Runtime calls use the gateway's properties.gatewayUrl host and the /default/ workspace segment: <host>/default/models/openai/v1/... and <host>/default/toolservers/<name>/mcp (omitting /default/ returns 404).
  • Authenticate models and MCP tool servers with the Api-Key header — not Authorization: Bearer (bearer-only auth is rejected, typically with a 401 or a misleading unknown_model).

Read the full file on GitHub · 53 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. 1mo ago First seen · 53 lines · 0 tokens per session scan A 6e3033a55215

Subscribe to this mod's changes

build is a command published in the GitHub repository Azure/ai-gateway (5 stars, last pushed 20d ago), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 814 tokens. 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-31.