build

build is a command for coding agents from Azure/ai-gateway. It costs 35 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

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

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 commands/azure/ai-gateway/build
Clone the repo
git clone --depth 1 https://github.com/Azure/ai-gateway

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.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.svg" alt="Measured on agentmods" height="20"></a>
Per session 35 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. 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.00035 $0.00814
Opus 5 $0.00017 $0.00407
Sonnet 5 $0.00007 $0.00163
Haiku 4.5 $0.00003 $0.00081

Measured 3d ago against content hash 6e3033a55215, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, 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 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.

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. 3d 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 (2 stars, last pushed 7d ago), licensed MIT. It adds 35 tokens to every session and 814 once invoked, about $0.0002 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-31.