[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill-azure-use-ai-gateway":3,"mdc--tsgpwf-key":34,"related-org-azure-use-ai-gateway":7086,"related-repo-azure-use-ai-gateway":7265},{"slug":4,"name":4,"fn":5,"description":6,"org":7,"tags":12,"stars":24,"repoUrl":25,"updatedAt":26,"license":27,"forks":24,"topics":28,"repo":29,"sourceUrl":32,"mdContent":33},"use-ai-gateway","integrate AI Gateway models and tools","Discover the models and MCP tool servers registered in an AI Gateway, retrieve a credential, and integrate them into any application — call a model over its exact runtime protocol (OpenAI Chat Completions, OpenAI Responses, or Anthropic Messages), connect to MCP tool servers, or scaffold a standalone agent. Use this whenever a developer wants to use an AI Gateway's models and\u002For tools from the app they are building.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":11},"azure","Azure (Microsoft)","https:\u002F\u002Fpexgzepcugksgbtrxkhf.supabase.co\u002Fstorage\u002Fv1\u002Fobject\u002Fpublic\u002Forg-logos\u002Fazure.png","Azure",[13,15,18,21],{"name":11,"slug":8,"type":14},"tag",{"name":16,"slug":17,"type":14},"MCP","mcp",{"name":19,"slug":20,"type":14},"AI Infrastructure","ai-infrastructure",{"name":22,"slug":23,"type":14},"API Development","api-development",0,"https:\u002F\u002Fgithub.com\u002FAzure\u002Fai-gateway","2026-07-25T05:56:28.50857",null,[],{"repoUrl":25,"stars":24,"forks":24,"topics":30,"description":31},[],"AI Gateway tier in Azure API Management is the AI-focused tier of Azure API Management.","https:\u002F\u002Fgithub.com\u002FAzure\u002Fai-gateway\u002Ftree\u002FHEAD\u002Fskills\u002Fuse-ai-gateway","---\nname: use-ai-gateway\nversion: 2.2.0\nupdated: 2026-07-21\ndescription: Discover the models and MCP tool servers registered in an AI Gateway, retrieve a credential, and integrate them into any application — call a model over its exact runtime protocol (OpenAI Chat Completions, OpenAI Responses, or Anthropic Messages), connect to MCP tool servers, or scaffold a standalone agent. Use this whenever a developer wants to use an AI Gateway's models and\u002For tools from the app they are building.\n---\n\n# Use an AI Gateway (models & MCP tools)\n\n\u003C!-- Skill version 2.2.0 (2026-07-21). Canonical copy shipped by the `ai-gateway` plugin. Works with any coding agent that can read this file. -->\n\u003C!-- 2.2.0: select the model's exact runtime protocol from properties.supportedEndpoints (Chat Completions \u002F Responses \u002F Anthropic Messages) instead of assuming OpenAI chat; robust listSecrets key parsing; skip non-agent (embeddings\u002Fimage) models; native Claude Code \u002F Codex MCP config; managed-identity vs runtime-key clarification. -->\n\n> Invoked as `\u002Fai-gateway:use-ai-gateway` when installed via the plugin. It is also invoked automatically by the `\u002Fai-gateway:discover` and `\u002Fai-gateway:build` commands.\n\n> This skill is coding-agent–agnostic: any assistant that can read this file and run shell commands can follow it.\n\nUse this skill when a developer wants to **use the models and\u002For MCP tools registered in an existing AI Gateway from their application** — whatever they are building (a web app, backend service, script, notebook, data pipeline, or a standalone agent). This single skill takes the user all the way from discovery to working, integrated code:\n\n1. **Discover** the models and MCP tools registered in the gateway.\n2. **Select** the ones that match the user's intent (and confirm with them).\n3. **Retrieve** the credential needed to call them.\n4. **Integrate** them into the user's application, choosing the path that fits what they're building:\n   - **Call a model** over the gateway's OpenAI-compatible passthrough (any language, framework, or raw HTTP).\n   - **Connect MCP tools** from an MCP-capable client\u002Fapp.\n   - **Scaffold a standalone agent** (GitHub Copilot SDK) if the user wants a ready-to-run agent project.\n\n## Scope (consumption only)\n\nThis skill is **strictly for developers consuming an existing AI Gateway**. It is **read-only** against the gateway and only generates client code that calls already-registered models and tools.\n\n- ✅ Allowed: list models, list tools\u002FMCP servers, read an existing API key, generate integration\u002Fclient\u002Fagent code.\n- ❌ Not allowed: creating, provisioning, updating, or deleting gateways, models, tools, connections, products, or any other resource. Never issue ARM `PUT`\u002F`PATCH`\u002F`DELETE` calls. If a user asks to create or provision a gateway or model, tell them that is an administrator task done in the [AI Gateway Portal](https:\u002F\u002Fai.gateway.azure.com) and is out of scope for this skill.\n\n---\n\n## Part 1 — Discover & select assets\n\n### Parameters\n\nAsk the user for (or confirm) these before calling the API:\n\n- **gatewayResourceId** — the ARM resource ID of the user's gateway. It is one of two APIM resource types:\n  `\u002Fsubscriptions\u002F\u003Csub>\u002FresourceGroups\u002F\u003Crg>\u002Fproviders\u002FMicrosoft.ApiManagement\u002Fservice\u002F\u003Cgateway-name>` **or** `...\u002FMicrosoft.ApiManagement\u002Faigateways\u002F\u003Cgateway-name>`. Both expose the same sub-resources (`workspaces\u002Fdefault\u002Fmodels`, `workspaces\u002Fdefault\u002FtoolServers`, and `apiKeys` at the resource root), so every template below works for either type. Keep the **leading `\u002F`** exactly as ARM returns the `id`. The URL templates append it directly to `https:\u002F\u002Fmanagement.azure.com` (no slash in between), so the full URL resolves to `https:\u002F\u002Fmanagement.azure.com\u002Fsubscriptions\u002F...`. Don't add a slash before a leading-slash id — that produces a doubled `\u002F\u002Fsubscriptions\u002F...` and the call fails.\n  > **Discovery needs the resource id, not just a host.** Listing models\u002Ftools\u002Fkeys goes through the ARM control plane, which is keyed by `gatewayResourceId`. If the user gives you only a runtime host, resolve the id first (e.g. `az resource list --name \u003Cname>` or the Azure Portal) or ask for it — you cannot list assets from a host alone.\n- **apiVersion** — `2025-09-01-preview`\n\nEvery ARM call must be authenticated with an Azure Resource Manager bearer token:\n\n```\nAuthorization: Bearer \u003Ctoken>\n```\n\nRetrieve the token with:\n\n```\naz account get-access-token --query accessToken -o tsv\n```\n\n### 0. Resolve the runtime host\n\nDiscovery uses the ARM control plane (keyed by `gatewayResourceId`), but the model passthrough and MCP endpoints are called on the gateway's **runtime host**. Read the host from the resource itself rather than guessing it from the name:\n\n```\nGET https:\u002F\u002Fmanagement.azure.com{gatewayResourceId}?api-version={apiVersion}\n```\n\nUse `properties.gatewayUrl` (e.g. `https:\u002F\u002F\u003Cname>.\u003Cregion>.ai.gateway-current.azure.com`) as `\u003Cai-gateway-host>` for every runtime URL below. If `properties.gatewayUrl` is empty, fall back to `https:\u002F\u002F\u003Cproperties.frontend.defaultHostname>`; never fabricate `\u003Cname>.azure-api.net` from the resource name. **All runtime paths are served under the workspace segment `\u002Fdefault\u002F`** (the Default workspace — the only one today). So the model runtime base is `\u003Cai-gateway-host>\u002Fdefault\u002Fmodels` and each MCP endpoint is `\u003Cai-gateway-host>\u002Fdefault\u002Ftoolservers\u002F\u003Ctool-server-name>\u002Fmcp`. Omitting the `\u002Fdefault\u002F` segment returns `404 Resource not found`.\n\nThe exact suffix after `\u002Fdefault\u002Fmodels` depends on the **model's protocol**, which you read from each model's `properties.supportedEndpoints` (see §1) — most commonly the OpenAI-compatible `\u002Fopenai\u002Fv1\u002Fchat\u002Fcompletions`, but a model may instead expose `\u002Fopenai\u002Fv1\u002Fresponses` (OpenAI Responses) or `\u002Fanthropic\u002Fv1\u002Fmessages` (Anthropic Messages). Build the runtime URL as `\u003Cai-gateway-host>\u002Fdefault\u002Fmodels{supportedEndpoint}` — don't assume every model is OpenAI Chat Completions.\n\n### One-shot discovery (copy-paste)\n\nThis performs the whole of Part 1 in one block. Set `RID` to the `gatewayResourceId` (keep its leading `\u002F`); requires `az` and `jq`:\n\n```bash\nRID=\"\u002Fsubscriptions\u002F\u003Csub>\u002FresourceGroups\u002F\u003Crg>\u002Fproviders\u002FMicrosoft.ApiManagement\u002Fservice\u002F\u003Cname>\"\nVER=\"2025-09-01-preview\"\nTOKEN=$(az account get-access-token --resource https:\u002F\u002Fmanagement.azure.com --query accessToken -o tsv)\nB=\"https:\u002F\u002Fmanagement.azure.com$RID\"\nAUTH=(-H \"Authorization: Bearer $TOKEN\")\n\n# Runtime host (used for every model\u002FMCP call below)\nHOST=$(curl -s \"${AUTH[@]}\" \"$B?api-version=$VER\" | jq -r '.properties.gatewayUrl')\n\n# Models -> use .properties.deployment.modelName as the model id (exact dots\u002Fcasing)\ncurl -s \"${AUTH[@]}\" \"$B\u002Fworkspaces\u002Fdefault\u002Fmodels?api-version=$VER\" \\\n  | jq -r '.value[] | \"\\(.properties.deployment.modelName)\\t\\(.properties.supportedEndpoints | join(\",\"))\"'\n\n# MCP tool servers\ncurl -s \"${AUTH[@]}\" \"$B\u002Fworkspaces\u002Fdefault\u002FtoolServers?api-version=$VER\" | jq -r '.value[].name'\n\n# API key: list keys, then read the first active key's secret (name is commonly \"master\" or \"default\")\nKEYNAME=$(curl -s \"${AUTH[@]}\" \"$B\u002FapiKeys?api-version=$VER\" | jq -r '.value[0].name')\nKEY=$(curl -s -X POST \"${AUTH[@]}\" -H \"Content-Length: 0\" \\\n  \"$B\u002FapiKeys\u002F$KEYNAME\u002FlistSecrets?api-version=$VER\" \\\n  | jq -r '.primaryKey \u002F\u002F .properties.primaryKey \u002F\u002F .primaryValue \u002F\u002F .properties.primaryValue \u002F\u002F .value')\n\n# Smoke-test a model over the passthrough — note the \u002Fdefault\u002F workspace segment and the Api-Key header\ncurl -s \"$HOST\u002Fdefault\u002Fmodels\u002Fopenai\u002Fv1\u002Fchat\u002Fcompletions\" \\\n  -H \"Api-Key: $KEY\" -H \"Content-Type: application\u002Fjson\" \\\n  -d '{\"model\":\"\u003CmodelName>\",\"messages\":[{\"role\":\"user\",\"content\":\"ping\"}],\"max_tokens\":5}'\n```\n\nThe individual steps and their gotchas are documented below.\n\n### 1. Discover models\n\nList the models registered in the gateway workspace:\n\n```\nGET https:\u002F\u002Fmanagement.azure.com{gatewayResourceId}\u002Fworkspaces\u002Fdefault\u002Fmodels?api-version={apiVersion}\n```\n\n**Use `properties.deployment.modelName` as the model identifier** in every gateway call — **not** the ARM resource `name` and **not** `properties.displayName`. This is the single most common cause of failures, so get it right:\n\n- `properties.deployment.modelName` is the exact string the OpenAI passthrough accepts in the request body, e.g. `gpt-5.4-nano` or `DeepSeek-V3.2`. It preserves dots and original casing.\n- The ARM resource `name` is a **sanitized** version of that value with dots and other characters replaced by dashes (e.g. `gpt-5-4-nano`). Some gateways accept the sanitized `name` too, but others reject it with a misleading **`unknown_model`** error — so always send `properties.deployment.modelName` to be safe, and don't \"correct\" a working call back to the ARM `name`.\n- `properties.displayName` is a human-friendly label and is also rejected by the passthrough.\n\nFor each model, read `properties.deployment.modelName` and carry that exact string (same dots, same casing, same punctuation) through to the agent's `model=` parameter. If `properties.deployment.modelName` is missing for some reason, fall back to confirming the accepted ID by probing `POST {gateway-host}\u002Fdefault\u002Fmodels\u002Fopenai\u002Fv1\u002Fchat\u002Fcompletions` with a tiny payload rather than guessing from the ARM `name`.\n\nMatch models to the user's use case based on the model name\u002Fdescription (e.g. a GPT-class model for chat, an embedding model for RAG). Suggest the best match as the default but let the user pick another.\n\n**Read each model's protocol from `properties.supportedEndpoints`** — don't assume every model is OpenAI Chat Completions. This array holds the exact runtime operation path(s) the model accepts; select the one matching your integration and build the runtime URL as `\u003Cai-gateway-host>\u002Fdefault\u002Fmodels{supportedEndpoint}` (preserve the returned value exactly, including any provider prefix like `\u002Fopenai\u002Fv1` or `\u002Fanthropic\u002Fv1`). The recognized agent\u002Fchat protocols are:\n\n| Endpoint suffix     | Protocol                | Client                                            |\n| ------------------- | ----------------------- | ------------------------------------------------- |\n| `\u002Fchat\u002Fcompletions` | OpenAI Chat Completions | OpenAI-compatible client (Chat Completions mode)  |\n| `\u002Fresponses`        | OpenAI Responses        | OpenAI-compatible client (Responses mode)         |\n| `\u002Fmessages`         | Anthropic Messages      | Anthropic-compatible client (Messages mode)       |\n\nMost gateways today expose `\u002Fopenai\u002Fv1\u002Fchat\u002Fcompletions`, which is why the examples below default to it — but if the selected model's `supportedEndpoints` shows `\u002Fresponses` or `\u002Fmessages` instead, use that protocol's client and request shape (see _Path A_). If a model exposes **only** non-agent endpoints (embeddings, images, audio, etc.), don't scaffold a chat agent against it — explain the mismatch and let the user pick a different model.\n\n### 2. Discover tools (MCP tool servers)\n\nTools are registered as **tool servers** in the gateway workspace. Each tool server is a federated MCP host exposed at a single MCP endpoint on the gateway. List them:\n\n```\nGET https:\u002F\u002Fmanagement.azure.com{gatewayResourceId}\u002Fworkspaces\u002Fdefault\u002FtoolServers?api-version={apiVersion}\n```\n\nEach item's `name` is the tool server name. Build its MCP endpoint URL as `https:\u002F\u002F{gateway-host}\u002Fdefault\u002Ftoolservers\u002F{toolServerName}\u002Fmcp` (note the `\u002Fdefault\u002F` workspace segment — without it the gateway returns `404`). **`properties.mcpEndpointUrl` is frequently empty** in the ARM response, so do not rely on it — construct the URL from the host and tool server name, and only use `properties.mcpEndpointUrl` if it is non-empty. Filter to the tools relevant to the user's request (examine names and descriptions for keywords — e.g. for shipping, look for a \"calculator\" tool). Then **stop and ask the user**: \"I found these tools for your use case. Which would you like to use?\" List them clearly with brief descriptions and endpoints, and allow selecting all, some, or none.\n\n> **Verify the tool server actually exposes tools before wiring it in.** A tool server can be registered but expose **zero** tools (e.g. a federated OpenAPI\u002FMCP source that failed to sync). Confirm with an MCP handshake against the constructed URL, using the `Api-Key` header and `Accept: application\u002Fjson, text\u002Fevent-stream` on every request: `POST` an `initialize` request, capture the **`Mcp-Session-Id`** response header, `POST` a `notifications\u002Finitialized` message with that session id, then `POST` a `tools\u002Flist` request (also carrying the session id). If `tools\u002Flist` returns an empty array, tell the user that server has no usable tools right now (a gateway-side configuration issue, not a client bug) and let them pick a different one rather than scaffolding an agent that can't call anything.\n\n### 3. Retrieve a credential\n\nThe model passthrough and MCP tool servers are called with a gateway **API key** — the **same key works for both**.\n\n1. List the available keys (keys live at the gateway level, not the workspace):\n   ```\n   GET https:\u002F\u002Fmanagement.azure.com{gatewayResourceId}\u002FapiKeys?api-version={apiVersion}\n   ```\n2. Pick a key — use the first key whose `properties.state` is `active`. The name is commonly `master` or `default`; don't hardcode it, read it from the list response.\n3. Retrieve the secret:\n   ```\n   POST https:\u002F\u002Fmanagement.azure.com{gatewayResourceId}\u002FapiKeys\u002F{keyName}\u002FlistSecrets?api-version={apiVersion}\n   ```\n   The key is normally in `primaryKey`:\n   ```json\n   { \"primaryKey\": \"2e41...\", \"secondaryKey\": \"365...\" }\n   ```\n   Backend versions have returned a few response shapes, so read the first non-empty value from, in order: `primaryKey`, `properties.primaryKey`, `primaryValue`, `properties.primaryValue`, then `value` (when `target == \"Primary\"`), falling back to the equivalent `secondary*` fields. If none is present, the caller likely isn't authorized to `listSecrets` — stop and direct them to an administrator rather than creating or rotating a key.\n\nThe credential is passed in the **`Api-Key`** header for both the model passthrough and the MCP tool servers.\n\n> **Discovery-only path:** If the user only wants to explore and select assets (models\u002Ftools) and does **not** want to integrate them yet, you can stop here. Present the discovered assets and selected credential, and skip Part 2. Code generation is optional.\n\n---\n\n## Part 2 — Integrate into your application\n\nBy now you have (a) the selected model(s) and\u002For MCP tool server(s) and (b) the gateway API key. Now wire them into whatever the user is building.\n\n**First, pick the integration path** — ask the user what they're building if it isn't already clear, then follow the matching path (they can combine A and B):\n\n- **Path A — Call a model.** The user wants their app\u002Fscript\u002Fservice to send prompts to a model. Works from any language or raw HTTP via the gateway's OpenAI-compatible passthrough. _Most common for existing apps._\n- **Path B — Connect MCP tools.** The user wants their app or MCP-capable client to call the gateway's registered MCP tool servers.\n- **Path C — Scaffold a standalone agent.** The user wants a ready-to-run agent project (GitHub Copilot SDK) that combines models and tools.\n\nWhichever path you take, integrate into the user's **existing** project when they have one (respect its language, framework, and conventions) rather than forcing a new scaffold. Path C's scaffold is only for users who explicitly want a fresh standalone agent.\n\n**Shared rules (all paths):**\n\n- Read every credential from environment variables (e.g. `AI_GATEWAY_API_KEY`) — never hardcode secrets. See _Shared: credentials & project hygiene_ below.\n- The gateway authenticates **both** models and MCP tool servers with the same key, passed in the **`Api-Key`** request header.\n- **Client key vs. backend managed identity are different things.** A model provider or tool server may use the gateway's managed identity to authenticate to *its* upstream (that's gateway-to-backend auth, transparent to your app). Don't try to fetch or supply that upstream credential, and don't replace your `Api-Key` header with a managed-identity\u002Fbearer token — your app always authenticates to the gateway runtime with the gateway `Api-Key`.\n\n---\n\n### Path A — Call a model\n\nMost AI Gateway models expose an **OpenAI-compatible** endpoint, so the examples below default to it. First confirm the selected model's protocol from its `properties.supportedEndpoints` (see §1) and derive the client **base URL** from the exact endpoint by stripping the operation suffix:\n\n| Protocol (endpoint suffix)         | Client base URL = `\u003Cai-gateway-host>\u002Fdefault\u002Fmodels` + …          | Client appends       |\n| ---------------------------------- | ----------------------------------------------------------------- | -------------------- |\n| OpenAI Chat Completions (`\u002Fchat\u002Fcompletions`) | `\u002Fopenai\u002Fv1` (drop `\u002Fchat\u002Fcompletions`)                | `\u002Fchat\u002Fcompletions`  |\n| OpenAI Responses (`\u002Fresponses`)    | `\u002Fopenai\u002Fv1` (drop `\u002Fresponses`)                                  | `\u002Fresponses`         |\n| Anthropic Messages (`\u002Fv1\u002Fmessages`)| the endpoint with `\u002Fv1\u002Fmessages` removed (Anthropic SDK re-adds it) | `\u002Fv1\u002Fmessages`     |\n\nCommon case — OpenAI-compatible. Point any OpenAI-style client (or plain HTTP) at it:\n\n- **Base URL:** `\u003Cai-gateway-host>\u002Fdefault\u002Fmodels\u002Fopenai\u002Fv1` — e.g. `https:\u002F\u002Fmy-gateway.westus2-01.ai.gateway-current.azure.com\u002Fdefault\u002Fmodels\u002Fopenai\u002Fv1`. This is the same endpoint the [AI Gateway Portal](https:\u002F\u002Fai.gateway.azure.com) advertises to consumers; clients append `\u002Fchat\u002Fcompletions` (or `\u002Fresponses` for a Responses model). The `\u002Fdefault\u002F` segment (the workspace) is required — dropping it returns `404`.\n- **Auth header:** `Api-Key: \u003Cgateway key>`. **Do not** rely on `Authorization: Bearer` — the gateway model passthrough rejects bearer-only auth, typically with a `401` (\"missing subscription key\") or a misleading **`unknown_model`** error. If your client insists on an `api_key` field (many do), still set the `Api-Key` header explicitly.\n- **Model identifier:** use the selected model's **`properties.deployment.modelName`** (e.g. `gpt-5.4-nano`) exactly — same dots, casing, and punctuation. Prefer it over the ARM resource `name` (e.g. `gpt-5-4-nano`) or `displayName`, which may be rejected with `unknown_model` on some gateways.\n\n#### curl\n\n```bash\ncurl \"$AI_GATEWAY_HOST\u002Fdefault\u002Fmodels\u002Fopenai\u002Fv1\u002Fchat\u002Fcompletions\" \\\n  -H \"Content-Type: application\u002Fjson\" \\\n  -H \"Api-Key: $AI_GATEWAY_API_KEY\" \\\n  -d '{\n    \"model\": \"\u003Cproperties.deployment.modelName>\",\n    \"messages\": [{ \"role\": \"user\", \"content\": \"Hello!\" }]\n  }'\n```\n\n#### Python (openai SDK)\n\n```python\nimport os\nfrom openai import OpenAI\n\nclient = OpenAI(\n    base_url=f\"{os.environ['AI_GATEWAY_HOST']}\u002Fdefault\u002Fmodels\u002Fopenai\u002Fv1\",\n    api_key=os.environ[\"AI_GATEWAY_API_KEY\"],\n    # The gateway authenticates via the Api-Key header, not Authorization: Bearer.\n    default_headers={\"Api-Key\": os.environ[\"AI_GATEWAY_API_KEY\"]},\n)\n\nresp = client.chat.completions.create(\n    model=\"\u003Cproperties.deployment.modelName>\",  # e.g. \"gpt-5.4-nano\"\n    messages=[{\"role\": \"user\", \"content\": \"Hello!\"}],\n)\nprint(resp.choices[0].message.content)\n```\n\n#### TypeScript \u002F JavaScript (openai SDK)\n\n```ts\nimport OpenAI from \"openai\";\n\nconst client = new OpenAI({\n  baseURL: `${process.env.AI_GATEWAY_HOST}\u002Fdefault\u002Fmodels\u002Fopenai\u002Fv1`,\n  apiKey: process.env.AI_GATEWAY_API_KEY!,\n  \u002F\u002F The gateway authenticates via the Api-Key header, not Authorization: Bearer.\n  defaultHeaders: { \"Api-Key\": process.env.AI_GATEWAY_API_KEY! },\n});\n\nconst resp = await client.chat.completions.create({\n  model: \"\u003Cproperties.deployment.modelName>\", \u002F\u002F e.g. \"gpt-5.4-nano\"\n  messages: [{ role: \"user\", content: \"Hello!\" }],\n});\nconsole.log(resp.choices[0].message.content);\n```\n\n> The passthrough is OpenAI-compatible, so streaming, tools\u002Ffunction-calling, and other OpenAI request fields work as usual — just keep the `Api-Key` header and the exact `modelName`.\n\n#### Other protocols (only when the model's `supportedEndpoints` says so)\n\nIf the selected model exposes `\u002Fresponses` or `\u002Fanthropic\u002Fv1\u002Fmessages` instead of `\u002Fchat\u002Fcompletions`, use that protocol's request shape (same `Api-Key` header, same exact `modelName`, same `\u002Fdefault\u002Fmodels` prefix):\n\n```bash\n# OpenAI Responses model (supportedEndpoints contains \u002Fopenai\u002Fv1\u002Fresponses)\ncurl \"$AI_GATEWAY_HOST\u002Fdefault\u002Fmodels\u002Fopenai\u002Fv1\u002Fresponses\" \\\n  -H \"Content-Type: application\u002Fjson\" -H \"Api-Key: $AI_GATEWAY_API_KEY\" \\\n  -d '{\"model\":\"\u003Cproperties.deployment.modelName>\",\"input\":\"Hello!\"}'\n\n# Anthropic Messages model (supportedEndpoints contains \u002Fanthropic\u002Fv1\u002Fmessages)\ncurl \"$AI_GATEWAY_HOST\u002Fdefault\u002Fmodels\u002Fanthropic\u002Fv1\u002Fmessages\" \\\n  -H \"Content-Type: application\u002Fjson\" -H \"Api-Key: $AI_GATEWAY_API_KEY\" \\\n  -H \"anthropic-version: 2023-06-01\" \\\n  -d '{\"model\":\"\u003Cproperties.deployment.modelName>\",\"max_tokens\":16,\"messages\":[{\"role\":\"user\",\"content\":\"Hello!\"}]}'\n```\n\nFor SDKs, set the base URL per the derivation table above and keep the `Api-Key` header: the OpenAI SDK's `responses.create(...)` targets a Responses model, and the Anthropic SDK with `base_url = \u003Cmessages endpoint minus \u002Fv1\u002Fmessages>` plus `default_headers={\"Api-Key\": ...}` targets a Messages model. Don't point an OpenAI Chat Completions client at a `\u002Fresponses`- or `\u002Fmessages`-only model (and vice versa) — the protocol must match the endpoint.\n\n---\n\n### Path B — Connect to MCP tool servers\n\nEach registered MCP tool server is reachable at its own MCP endpoint (captured during discovery), authenticated with the same gateway key via the **`Api-Key`** header. Use it from any MCP client:\n\n- **Endpoint:** the tool server's MCP URL from discovery (e.g. `\u003Cai-gateway-host>\u002Fdefault\u002Ftoolservers\u002F\u003Cname>\u002Fmcp`).\n- **Transport:** streamable HTTP (`type: \"http\"`).\n- **Auth header:** `Api-Key: \u003Cgateway key>`.\n\nTo sanity-check a tool server manually, run the full MCP handshake — `initialize`, then `notifications\u002Finitialized`, then `tools\u002Flist` — carrying the `Mcp-Session-Id` returned by `initialize` on the follow-up calls:\n\n```bash\n# 1. initialize — capture the Mcp-Session-Id response header\nSID=$(curl -s -D - -o \u002Fdev\u002Fnull \"$TOOL_ENDPOINT\" \\\n  -H \"Content-Type: application\u002Fjson\" -H \"Accept: application\u002Fjson, text\u002Fevent-stream\" \\\n  -H \"Api-Key: $AI_GATEWAY_API_KEY\" \\\n  -d '{\"jsonrpc\":\"2.0\",\"id\":1,\"method\":\"initialize\",\"params\":{\"protocolVersion\":\"2024-11-05\",\"capabilities\":{},\"clientInfo\":{\"name\":\"probe\",\"version\":\"1.0\"}}}' \\\n  | awk -F': ' 'tolower($1)==\"mcp-session-id\"{print $2}' | tr -d '\\r')\n\n# 2. notifications\u002Finitialized\ncurl -s \"$TOOL_ENDPOINT\" -H \"Content-Type: application\u002Fjson\" \\\n  -H \"Accept: application\u002Fjson, text\u002Fevent-stream\" -H \"Api-Key: $AI_GATEWAY_API_KEY\" \\\n  ${SID:+-H \"Mcp-Session-Id: $SID\"} \\\n  -d '{\"jsonrpc\":\"2.0\",\"method\":\"notifications\u002Finitialized\"}' >\u002Fdev\u002Fnull\n\n# 3. tools\u002Flist — an empty \"tools\" array means the server exposes no usable tools\ncurl -s \"$TOOL_ENDPOINT\" -H \"Content-Type: application\u002Fjson\" \\\n  -H \"Accept: application\u002Fjson, text\u002Fevent-stream\" -H \"Api-Key: $AI_GATEWAY_API_KEY\" \\\n  ${SID:+-H \"Mcp-Session-Id: $SID\"} \\\n  -d '{\"jsonrpc\":\"2.0\",\"id\":2,\"method\":\"tools\u002Flist\",\"params\":{}}'\n```\n\nTo wire it into an application, configure your MCP client with the endpoint URL, `http` transport, and the `Api-Key` header — for example, in a client that reads an `mcp.json`\u002F`mcpServers` map:\n\n```json\n{\n  \"mcpServers\": {\n    \"\u003Ctool-name>\": {\n      \"type\": \"http\",\n      \"url\": \"\u003Ctool-endpoint>\",\n      \"headers\": { \"Api-Key\": \"${AI_GATEWAY_API_KEY}\" }\n    }\n  }\n}\n```\n\nAdapt the exact shape to whatever MCP client\u002Flibrary the user's app uses (the essentials are always: endpoint URL, HTTP transport, and the `Api-Key` header). Native config locations for common coding agents:\n\n- **Claude Code** — the `mcpServers` JSON above is exactly the shape of a project-scoped `.mcp.json`. Claude Code expands `${AI_GATEWAY_API_KEY}` from the environment in HTTP `headers`. Run `claude mcp list` (or `\u002Fmcp`) and approve the project server when prompted.\n- **OpenAI Codex** — add to `~\u002F.codex\u002Fconfig.toml` (or a trusted project `.codex\u002Fconfig.toml`), passing the key by env-var reference so the secret isn't written into config:\n  ```toml\n  [mcp_servers.\u003Ctool-server-name>]\n  url = \"\u003Cai-gateway-host>\u002Fdefault\u002Ftoolservers\u002F\u003Ctool-server-name>\u002Fmcp\"\n  env_http_headers = { \"Api-Key\" = \"AI_GATEWAY_API_KEY\" }\n  ```\n  Verify with `codex mcp list` or `\u002Fmcp`.\n- **Other MCP-capable agents** — consult the agent's current CLI help or config schema for its remote\u002FHTTP MCP entry rather than guessing field names; the essentials are the same three: endpoint URL, HTTP transport, `Api-Key` header.\n\nIf the user is building an agent that needs these tools, prefer **Path C**, which wires models and MCP tools together.\n\n---\n\n### Path C — Scaffold a standalone agent (GitHub Copilot SDK)\n\nUse this path when the user explicitly wants a runnable standalone **agent** project that combines the selected model and MCP tools.\n\n#### C.1 Choose language\n\nAsk the user which language they prefer. **Default to Python** if not specified. Supported:\n\n- Python (default)\n- TypeScript\u002FJavaScript\n\n#### C.2 Generate agent code\n\nGenerate the agent code using the **GitHub Copilot SDK** (code, docs, examples: https:\u002F\u002Fgithub.com\u002Fgithub\u002Fcopilot-sdk).\n\n> **Required SDK version: `github-copilot-sdk >= 1.0.0`.** The agent authenticates the BYOK model and the MCP tool servers by passing the gateway key in custom request headers (`Api-Key`). SDK versions older than 1.0.0 silently drop provider\u002Fcustom headers, so the gateway rejects the call with a misleading `unknown_model` error. Always pin `>= 1.0.0` in `requirements.txt` \u002F `package.json` and in any install command.\n\nThe generated code must:\n\n- Use the GitHub Copilot SDK correctly for the chosen language (default to Python, unless the user specifies otherwise). Require **`github-copilot-sdk >= 1.0.0`** — older versions drop the custom headers used to authenticate the gateway model and tools\n- Configure MCP tool connections to the selected AI Gateway tool servers via `mcp_servers` in the session config, using `type: \"http\"` with the tool server's MCP endpoint URL\n- Authenticate tool servers with the gateway API key passed in the **`Api-Key`** header via the `headers` config\n- Configure model access through a BYOK `provider` in the session config\n- Authenticate models with the **same** gateway API key passed in the **`Api-Key`** header via the provider's `headers` config — **not** the `api_key` field alone. The SDK sends `api_key` as an `Authorization: Bearer` header, which the AI Gateway model passthrough rejects with a misleading **`unknown_model`** error. Set the `Api-Key` header explicitly (keep `api_key` too, since the SDK requires a non-empty value)\n- Use model provider `type: \"openai\"` (the AI Gateway exposes an OpenAI-compatible passthrough, where the model is selected by name in the request body)\n- Construct the model `base_url` as the AI Gateway's unified model passthrough: `\u003Cai-gateway-host>\u002Fdefault\u002Fmodels\u002Fopenai\u002Fv1` — for example `https:\u002F\u002Fmy-gateway.westus2-01.ai.gateway-current.azure.com\u002Fdefault\u002Fmodels\u002Fopenai\u002Fv1`. This is the same endpoint the [AI Gateway Portal](https:\u002F\u002Fai.gateway.azure.com) advertises to consumers (the SDK appends `\u002Fchat\u002Fcompletions`). The `\u002Fdefault\u002F` workspace segment is required — dropping it returns `404`\n- Precisely specify the model parameter and match it exactly to the selected model's **`properties.deployment.modelName`** (e.g. `gpt-5.4-nano`) — same dots, same casing, same punctuation. Prefer it over the ARM resource `name` (e.g. `gpt-5-4-nano`) or `displayName`, which may be rejected with `unknown_model` on some gateways\n- Include `\"on_permission_request\": PermissionHandler.approve_all` in the session config (import `PermissionHandler` from `copilot`)\n- Pass the session config to `create_session` as keyword arguments (e.g. `create_session(model=..., provider=..., mcp_servers=...)`), like in the example below\n- Read all credentials from environment variables — never hardcode secrets\n- Load environment variables from a `.env` file using `python-dotenv` (Python) or `dotenv` (TypeScript)\n- Use `send_and_wait()` with the prompt as a positional string to get the agent's response, then **always print the response content or the error** — the user must see output\n- Handle errors gracefully with full tracebacks for debugging\n- Include a clear main entry point and example usage\n- Match the code example below as closely as possible\n\n##### Python Example Structure\n\n```python\nimport asyncio\nimport os\nfrom dotenv import load_dotenv\nfrom copilot import CopilotClient, PermissionHandler\n\nload_dotenv()\n\nasync def main():\n    client = CopilotClient()\n    await client.start()\n\n    try:\n        session = await client.create_session(\n            on_permission_request=PermissionHandler.approve_all,\n            model=\"\u003Cselected-model>\",  # e.g. \"gpt-4o\"\n            # BYOK provider — points to the AI Gateway unified model passthrough.\n            # The gateway authenticates the model passthrough via the `Api-Key`\n            # header, so pass the key in `headers`. The `api_key` field alone is\n            # sent as `Authorization: Bearer`, which the gateway rejects with\n            # `unknown_model`.\n            provider={\n                \"type\": \"openai\",\n                \"base_url\": \"\u003Cai-gateway-host>\u002Fdefault\u002Fmodels\u002Fopenai\u002Fv1\",\n                \"api_key\": os.environ[\"AI_GATEWAY_API_KEY\"],\n                \"headers\": {\n                    \"Api-Key\": os.environ[\"AI_GATEWAY_API_KEY\"],\n                },\n            },\n            # MCP tool servers from AI Gateway\n            mcp_servers={\n                \"\u003Ctool-name>\": {\n                    \"type\": \"http\",\n                    \"url\": \"\u003Ctool-endpoint>\",\n                    \"headers\": {\n                        \"Api-Key\": os.environ[\"AI_GATEWAY_API_KEY\"],\n                    },\n                    \"tools\": [\"*\"],\n                },\n                # Add more tools as needed\n            },\n        )\n\n        def on_event(event):\n            event_type = event.type.value\n            if event_type == \"tool.execution_start\":\n                print(f\"  [tool call: {event.data.tool_name}]\")\n            elif event_type == \"error\":\n                msg = getattr(event.data, \"message\", str(event))\n                print(f\"  [error: {msg}]\")\n\n        session.on(on_event)\n\n        reply = await session.send_and_wait(\"\u003Cuser prompt>\")\n\n        if reply:\n            print(\"\\n=== Agent Response ===\")\n            print(reply.data.content if reply.data.content else \"(empty response)\")\n        else:\n            print(\"\\n=== No response received from agent ===\")\n\n        await session.disconnect()\n\n    except Exception as e:\n        print(f\"\\nFailed to run agent: {e}\")\n        import traceback\n        traceback.print_exc()\n    finally:\n        await client.stop()\n\nif __name__ == \"__main__\":\n    asyncio.run(main())\n```\n\n#### C.3 Create project files\n\nAfter generating the agent code, create a complete, self-contained project the user can download and run as-is. See _Shared: credentials & project hygiene_ below for `.env`, `.env.example`, and `.gitignore`, plus:\n\n4. **`requirements.txt`** (Python) — pin the agent's dependencies so the project installs in one command:\n\n   ```\n   github-copilot-sdk>=1.0.0\n   python-dotenv\n   ```\n\n   (For TypeScript, generate a `package.json` with the equivalent dependencies — `github-copilot-sdk` at `>=1.0.0` — and a `start` script.)\n\n5. **`README.md`** — a short, self-contained guide so the downloaded project runs without this chat. Include:\n   - what the agent does and which gateway model + tool servers it uses (by name)\n   - prerequisites (Python 3.10+, the Copilot CLI, `github-copilot-sdk >= 1.0.0`)\n   - install steps (`pip install -r requirements.txt`)\n   - how to set credentials (copy `.env.example` to `.env`, or use the pre-filled `.env`)\n   - the run command and the expected output\n\n#### C.4 Provide setup instructions\n\nAfter generating the code, provide:\n\n- Required package installation commands: `pip install \"github-copilot-sdk>=1.0.0\" python-dotenv` (the `>= 1.0.0` pin is mandatory — older SDKs drop the custom `Api-Key` headers and the gateway returns `unknown_model`)\n- Copilot CLI must be installed separately (the SDK communicates with it via JSON-RPC)\n- Environment variable setup:\n  - `AI_GATEWAY_API_KEY` — the gateway API key from discovery (passed via the `Api-Key` header for tool servers and via the BYOK provider `api_key` for the model)\n- How to run the agent\n\n#### C.5 Run and verify\n\nDon't stop at \"here's the code.\" Run the agent once and confirm the wiring actually works, then report the outcome to the user:\n\n- **Run it** (e.g. `python agent.py`) and read the output.\n- **Distinguish config failures from benign backend conditions.** Treat these as a **healthy** end-to-end wiring (the gateway accepted the request) — report success and move on:\n  - `429 ... exceeded rate limit` or quota errors from the model\n  - empty\u002Fslow responses caused by the upstream model, not the client\n- **Treat these as real bugs to fix before handing off:**\n  - `unknown_model` → wrong model identifier (used ARM `name`\u002F`displayName` instead of `properties.deployment.modelName`), a protocol mismatch (e.g. a Chat Completions client pointed at a `\u002Fresponses`- or `\u002Fmessages`-only model), **or** an SDK older than `1.0.0` dropping the `Api-Key` header\n  - `KeyError: 'AI_GATEWAY_API_KEY'` → `.env` not loaded, usually a BOM (see the `.env` note below)\n  - `401`\u002F`403` → wrong or missing `Api-Key` header\n- If you can't get a clean model response because of a backend `429`\u002Fquota, say so explicitly and note that everything up to the model was validated, rather than implying the full round-trip succeeded.\n\n---\n\n### Shared: credentials & project hygiene\n\nWhenever you write credentials or scaffold files into the user's project (any path), keep secrets safe:\n\n1. **`.env`** — populated with the actual key retrieved during discovery:\n\n   ```\n   AI_GATEWAY_API_KEY=\u003Cactual gateway API key from discovery>\n   ```\n\n   > **Security note:** this writes a **live gateway secret in cleartext** to disk. The `.gitignore` (below) keeps it out of source control, but warn the user that the file holds a real key and to **rotate it in the [AI Gateway Portal](https:\u002F\u002Fai.gateway.azure.com) if it is ever exposed or shared**.\n\n   > **Write `.env` as UTF-8 _without_ a BOM.** `python-dotenv` (and `dotenv` for Node) does **not** strip a leading byte-order mark, so a BOM makes the first variable load as `\\ufeffAI_GATEWAY_API_KEY` and the app crashes with `KeyError: 'AI_GATEWAY_API_KEY'`. This bites on Windows specifically: PowerShell's `Set-Content -Encoding utf8` and `Out-File` **add a BOM**. Write the file with a BOM-free encoder instead, e.g.:\n   >\n   > ```powershell\n   > [System.IO.File]::WriteAllText(\"$PWD\\.env\", \"AI_GATEWAY_API_KEY=$key`n\", (New-Object System.Text.UTF8Encoding($false)))\n   > ```\n   >\n   > or simply create the file through your editor\u002Fagent file-write tool, which does not add a BOM. After writing, sanity-check that the first byte is not `0xEF`.\n\n2. **`.env.example`** — a template with a placeholder value for documentation:\n\n   ```\n   AI_GATEWAY_API_KEY=your-gateway-api-key-here\n   ```\n\n3. **`.gitignore`** — must include `.env` to prevent committing secrets:\n\n   ```\n   .env\n   __pycache__\u002F\n   *.pyc\n   .venv\u002F\n   ```\n",{"data":35,"body":38},{"name":4,"version":36,"updated":37,"description":6},"2.2.0","2026-07-21",{"type":39,"children":40},"root",[41,50,85,93,106,185,192,211,258,262,268,275,280,427,432,444,449,458,464,483,492,588,648,654,696,1557,1562,1568,1573,1582,1626,1723,1764,1769,1806,1905,1953,1959,1971,1980,2042,2141,2147,2165,2391,2406,2425,2428,2434,2439,2449,2487,2499,2507,2582,2585,2591,2617,2762,2767,2948,2953,3083,3089,3214,3220,3758,3780,3793,3839,4075,4125,4128,4134,4149,4201,4239,4816,4851,5069,5081,5228,5240,5243,5249,5261,5267,5279,5292,5298,5317,5375,5380,5761,5768,6375,6381,6413,6550,6556,6561,6639,6645,6650,6841,6844,6849,6854,7080],{"type":42,"tag":43,"props":44,"children":46},"element","h1",{"id":45},"use-an-ai-gateway-models-mcp-tools",[47],{"type":48,"value":49},"text","Use an AI Gateway (models & MCP tools)",{"type":42,"tag":51,"props":52,"children":53},"blockquote",{},[54],{"type":42,"tag":55,"props":56,"children":57},"p",{},[58,60,67,69,75,77,83],{"type":48,"value":59},"Invoked as ",{"type":42,"tag":61,"props":62,"children":64},"code",{"className":63},[],[65],{"type":48,"value":66},"\u002Fai-gateway:use-ai-gateway",{"type":48,"value":68}," when installed via the plugin. It is also invoked automatically by the ",{"type":42,"tag":61,"props":70,"children":72},{"className":71},[],[73],{"type":48,"value":74},"\u002Fai-gateway:discover",{"type":48,"value":76}," and ",{"type":42,"tag":61,"props":78,"children":80},{"className":79},[],[81],{"type":48,"value":82},"\u002Fai-gateway:build",{"type":48,"value":84}," commands.",{"type":42,"tag":51,"props":86,"children":87},{},[88],{"type":42,"tag":55,"props":89,"children":90},{},[91],{"type":48,"value":92},"This skill is coding-agent–agnostic: any assistant that can read this file and run shell commands can follow it.",{"type":42,"tag":55,"props":94,"children":95},{},[96,98,104],{"type":48,"value":97},"Use this skill when a developer wants to ",{"type":42,"tag":99,"props":100,"children":101},"strong",{},[102],{"type":48,"value":103},"use the models and\u002For MCP tools registered in an existing AI Gateway from their application",{"type":48,"value":105}," — whatever they are building (a web app, backend service, script, notebook, data pipeline, or a standalone agent). This single skill takes the user all the way from discovery to working, integrated code:",{"type":42,"tag":107,"props":108,"children":109},"ol",{},[110,121,131,141],{"type":42,"tag":111,"props":112,"children":113},"li",{},[114,119],{"type":42,"tag":99,"props":115,"children":116},{},[117],{"type":48,"value":118},"Discover",{"type":48,"value":120}," the models and MCP tools registered in the gateway.",{"type":42,"tag":111,"props":122,"children":123},{},[124,129],{"type":42,"tag":99,"props":125,"children":126},{},[127],{"type":48,"value":128},"Select",{"type":48,"value":130}," the ones that match the user's intent (and confirm with them).",{"type":42,"tag":111,"props":132,"children":133},{},[134,139],{"type":42,"tag":99,"props":135,"children":136},{},[137],{"type":48,"value":138},"Retrieve",{"type":48,"value":140}," the credential needed to call them.",{"type":42,"tag":111,"props":142,"children":143},{},[144,149,151],{"type":42,"tag":99,"props":145,"children":146},{},[147],{"type":48,"value":148},"Integrate",{"type":48,"value":150}," them into the user's application, choosing the path that fits what they're building:\n",{"type":42,"tag":152,"props":153,"children":154},"ul",{},[155,165,175],{"type":42,"tag":111,"props":156,"children":157},{},[158,163],{"type":42,"tag":99,"props":159,"children":160},{},[161],{"type":48,"value":162},"Call a model",{"type":48,"value":164}," over the gateway's OpenAI-compatible passthrough (any language, framework, or raw HTTP).",{"type":42,"tag":111,"props":166,"children":167},{},[168,173],{"type":42,"tag":99,"props":169,"children":170},{},[171],{"type":48,"value":172},"Connect MCP tools",{"type":48,"value":174}," from an MCP-capable client\u002Fapp.",{"type":42,"tag":111,"props":176,"children":177},{},[178,183],{"type":42,"tag":99,"props":179,"children":180},{},[181],{"type":48,"value":182},"Scaffold a standalone agent",{"type":48,"value":184}," (GitHub Copilot SDK) if the user wants a ready-to-run agent project.",{"type":42,"tag":186,"props":187,"children":189},"h2",{"id":188},"scope-consumption-only",[190],{"type":48,"value":191},"Scope (consumption only)",{"type":42,"tag":55,"props":193,"children":194},{},[195,197,202,204,209],{"type":48,"value":196},"This skill is ",{"type":42,"tag":99,"props":198,"children":199},{},[200],{"type":48,"value":201},"strictly for developers consuming an existing AI Gateway",{"type":48,"value":203},". It is ",{"type":42,"tag":99,"props":205,"children":206},{},[207],{"type":48,"value":208},"read-only",{"type":48,"value":210}," against the gateway and only generates client code that calls already-registered models and tools.",{"type":42,"tag":152,"props":212,"children":213},{},[214,219],{"type":42,"tag":111,"props":215,"children":216},{},[217],{"type":48,"value":218},"✅ Allowed: list models, list tools\u002FMCP servers, read an existing API key, generate integration\u002Fclient\u002Fagent code.",{"type":42,"tag":111,"props":220,"children":221},{},[222,224,230,232,238,239,245,247,256],{"type":48,"value":223},"❌ Not allowed: creating, provisioning, updating, or deleting gateways, models, tools, connections, products, or any other resource. Never issue ARM ",{"type":42,"tag":61,"props":225,"children":227},{"className":226},[],[228],{"type":48,"value":229},"PUT",{"type":48,"value":231},"\u002F",{"type":42,"tag":61,"props":233,"children":235},{"className":234},[],[236],{"type":48,"value":237},"PATCH",{"type":48,"value":231},{"type":42,"tag":61,"props":240,"children":242},{"className":241},[],[243],{"type":48,"value":244},"DELETE",{"type":48,"value":246}," calls. If a user asks to create or provision a gateway or model, tell them that is an administrator task done in the ",{"type":42,"tag":248,"props":249,"children":253},"a",{"href":250,"rel":251},"https:\u002F\u002Fai.gateway.azure.com",[252],"nofollow",[254],{"type":48,"value":255},"AI Gateway Portal",{"type":48,"value":257}," and is out of scope for this skill.",{"type":42,"tag":259,"props":260,"children":261},"hr",{},[],{"type":42,"tag":186,"props":263,"children":265},{"id":264},"part-1-discover-select-assets",[266],{"type":48,"value":267},"Part 1 — Discover & select assets",{"type":42,"tag":269,"props":270,"children":272},"h3",{"id":271},"parameters",[273],{"type":48,"value":274},"Parameters",{"type":42,"tag":55,"props":276,"children":277},{},[278],{"type":48,"value":279},"Ask the user for (or confirm) these before calling the API:",{"type":42,"tag":152,"props":281,"children":282},{},[283,411],{"type":42,"tag":111,"props":284,"children":285},{},[286,291,293,299,301,306,307,313,315,321,323,329,331,337,339,349,351,357,359,365,367,373,375,381,383],{"type":42,"tag":99,"props":287,"children":288},{},[289],{"type":48,"value":290},"gatewayResourceId",{"type":48,"value":292}," — the ARM resource ID of the user's gateway. It is one of two APIM resource types:\n",{"type":42,"tag":61,"props":294,"children":296},{"className":295},[],[297],{"type":48,"value":298},"\u002Fsubscriptions\u002F\u003Csub>\u002FresourceGroups\u002F\u003Crg>\u002Fproviders\u002FMicrosoft.ApiManagement\u002Fservice\u002F\u003Cgateway-name>",{"type":48,"value":300}," ",{"type":42,"tag":99,"props":302,"children":303},{},[304],{"type":48,"value":305},"or",{"type":48,"value":300},{"type":42,"tag":61,"props":308,"children":310},{"className":309},[],[311],{"type":48,"value":312},"...\u002FMicrosoft.ApiManagement\u002Faigateways\u002F\u003Cgateway-name>",{"type":48,"value":314},". Both expose the same sub-resources (",{"type":42,"tag":61,"props":316,"children":318},{"className":317},[],[319],{"type":48,"value":320},"workspaces\u002Fdefault\u002Fmodels",{"type":48,"value":322},", ",{"type":42,"tag":61,"props":324,"children":326},{"className":325},[],[327],{"type":48,"value":328},"workspaces\u002Fdefault\u002FtoolServers",{"type":48,"value":330},", and ",{"type":42,"tag":61,"props":332,"children":334},{"className":333},[],[335],{"type":48,"value":336},"apiKeys",{"type":48,"value":338}," at the resource root), so every template below works for either type. Keep the ",{"type":42,"tag":99,"props":340,"children":341},{},[342,344],{"type":48,"value":343},"leading ",{"type":42,"tag":61,"props":345,"children":347},{"className":346},[],[348],{"type":48,"value":231},{"type":48,"value":350}," exactly as ARM returns the ",{"type":42,"tag":61,"props":352,"children":354},{"className":353},[],[355],{"type":48,"value":356},"id",{"type":48,"value":358},". The URL templates append it directly to ",{"type":42,"tag":61,"props":360,"children":362},{"className":361},[],[363],{"type":48,"value":364},"https:\u002F\u002Fmanagement.azure.com",{"type":48,"value":366}," (no slash in between), so the full URL resolves to ",{"type":42,"tag":61,"props":368,"children":370},{"className":369},[],[371],{"type":48,"value":372},"https:\u002F\u002Fmanagement.azure.com\u002Fsubscriptions\u002F...",{"type":48,"value":374},". Don't add a slash before a leading-slash id — that produces a doubled ",{"type":42,"tag":61,"props":376,"children":378},{"className":377},[],[379],{"type":48,"value":380},"\u002F\u002Fsubscriptions\u002F...",{"type":48,"value":382}," and the call fails.\n",{"type":42,"tag":51,"props":384,"children":385},{},[386],{"type":42,"tag":55,"props":387,"children":388},{},[389,394,396,401,403,409],{"type":42,"tag":99,"props":390,"children":391},{},[392],{"type":48,"value":393},"Discovery needs the resource id, not just a host.",{"type":48,"value":395}," Listing models\u002Ftools\u002Fkeys goes through the ARM control plane, which is keyed by ",{"type":42,"tag":61,"props":397,"children":399},{"className":398},[],[400],{"type":48,"value":290},{"type":48,"value":402},". If the user gives you only a runtime host, resolve the id first (e.g. ",{"type":42,"tag":61,"props":404,"children":406},{"className":405},[],[407],{"type":48,"value":408},"az resource list --name \u003Cname>",{"type":48,"value":410}," or the Azure Portal) or ask for it — you cannot list assets from a host alone.",{"type":42,"tag":111,"props":412,"children":413},{},[414,419,421],{"type":42,"tag":99,"props":415,"children":416},{},[417],{"type":48,"value":418},"apiVersion",{"type":48,"value":420}," — ",{"type":42,"tag":61,"props":422,"children":424},{"className":423},[],[425],{"type":48,"value":426},"2025-09-01-preview",{"type":42,"tag":55,"props":428,"children":429},{},[430],{"type":48,"value":431},"Every ARM call must be authenticated with an Azure Resource Manager bearer token:",{"type":42,"tag":433,"props":434,"children":438},"pre",{"className":435,"code":437,"language":48},[436],"language-text","Authorization: Bearer \u003Ctoken>\n",[439],{"type":42,"tag":61,"props":440,"children":442},{"__ignoreMap":441},"",[443],{"type":48,"value":437},{"type":42,"tag":55,"props":445,"children":446},{},[447],{"type":48,"value":448},"Retrieve the token with:",{"type":42,"tag":433,"props":450,"children":453},{"className":451,"code":452,"language":48},[436],"az account get-access-token --query accessToken -o tsv\n",[454],{"type":42,"tag":61,"props":455,"children":456},{"__ignoreMap":441},[457],{"type":48,"value":452},{"type":42,"tag":269,"props":459,"children":461},{"id":460},"_0-resolve-the-runtime-host",[462],{"type":48,"value":463},"0. Resolve the runtime host",{"type":42,"tag":55,"props":465,"children":466},{},[467,469,474,476,481],{"type":48,"value":468},"Discovery uses the ARM control plane (keyed by ",{"type":42,"tag":61,"props":470,"children":472},{"className":471},[],[473],{"type":48,"value":290},{"type":48,"value":475},"), but the model passthrough and MCP endpoints are called on the gateway's ",{"type":42,"tag":99,"props":477,"children":478},{},[479],{"type":48,"value":480},"runtime host",{"type":48,"value":482},". Read the host from the resource itself rather than guessing it from the name:",{"type":42,"tag":433,"props":484,"children":487},{"className":485,"code":486,"language":48},[436],"GET https:\u002F\u002Fmanagement.azure.com{gatewayResourceId}?api-version={apiVersion}\n",[488],{"type":42,"tag":61,"props":489,"children":490},{"__ignoreMap":441},[491],{"type":48,"value":486},{"type":42,"tag":55,"props":493,"children":494},{},[495,497,503,505,511,513,519,521,526,528,534,536,542,544,555,557,563,565,571,573,578,580,586],{"type":48,"value":496},"Use ",{"type":42,"tag":61,"props":498,"children":500},{"className":499},[],[501],{"type":48,"value":502},"properties.gatewayUrl",{"type":48,"value":504}," (e.g. ",{"type":42,"tag":61,"props":506,"children":508},{"className":507},[],[509],{"type":48,"value":510},"https:\u002F\u002F\u003Cname>.\u003Cregion>.ai.gateway-current.azure.com",{"type":48,"value":512},") as ",{"type":42,"tag":61,"props":514,"children":516},{"className":515},[],[517],{"type":48,"value":518},"\u003Cai-gateway-host>",{"type":48,"value":520}," for every runtime URL below. If ",{"type":42,"tag":61,"props":522,"children":524},{"className":523},[],[525],{"type":48,"value":502},{"type":48,"value":527}," is empty, fall back to ",{"type":42,"tag":61,"props":529,"children":531},{"className":530},[],[532],{"type":48,"value":533},"https:\u002F\u002F\u003Cproperties.frontend.defaultHostname>",{"type":48,"value":535},"; never fabricate ",{"type":42,"tag":61,"props":537,"children":539},{"className":538},[],[540],{"type":48,"value":541},"\u003Cname>.azure-api.net",{"type":48,"value":543}," from the resource name. ",{"type":42,"tag":99,"props":545,"children":546},{},[547,549],{"type":48,"value":548},"All runtime paths are served under the workspace segment ",{"type":42,"tag":61,"props":550,"children":552},{"className":551},[],[553],{"type":48,"value":554},"\u002Fdefault\u002F",{"type":48,"value":556}," (the Default workspace — the only one today). So the model runtime base is ",{"type":42,"tag":61,"props":558,"children":560},{"className":559},[],[561],{"type":48,"value":562},"\u003Cai-gateway-host>\u002Fdefault\u002Fmodels",{"type":48,"value":564}," and each MCP endpoint is ",{"type":42,"tag":61,"props":566,"children":568},{"className":567},[],[569],{"type":48,"value":570},"\u003Cai-gateway-host>\u002Fdefault\u002Ftoolservers\u002F\u003Ctool-server-name>\u002Fmcp",{"type":48,"value":572},". Omitting the ",{"type":42,"tag":61,"props":574,"children":576},{"className":575},[],[577],{"type":48,"value":554},{"type":48,"value":579}," segment returns ",{"type":42,"tag":61,"props":581,"children":583},{"className":582},[],[584],{"type":48,"value":585},"404 Resource not found",{"type":48,"value":587},".",{"type":42,"tag":55,"props":589,"children":590},{},[591,593,599,601,606,608,614,616,622,624,630,632,638,640,646],{"type":48,"value":592},"The exact suffix after ",{"type":42,"tag":61,"props":594,"children":596},{"className":595},[],[597],{"type":48,"value":598},"\u002Fdefault\u002Fmodels",{"type":48,"value":600}," depends on the ",{"type":42,"tag":99,"props":602,"children":603},{},[604],{"type":48,"value":605},"model's protocol",{"type":48,"value":607},", which you read from each model's ",{"type":42,"tag":61,"props":609,"children":611},{"className":610},[],[612],{"type":48,"value":613},"properties.supportedEndpoints",{"type":48,"value":615}," (see §1) — most commonly the OpenAI-compatible ",{"type":42,"tag":61,"props":617,"children":619},{"className":618},[],[620],{"type":48,"value":621},"\u002Fopenai\u002Fv1\u002Fchat\u002Fcompletions",{"type":48,"value":623},", but a model may instead expose ",{"type":42,"tag":61,"props":625,"children":627},{"className":626},[],[628],{"type":48,"value":629},"\u002Fopenai\u002Fv1\u002Fresponses",{"type":48,"value":631}," (OpenAI Responses) or ",{"type":42,"tag":61,"props":633,"children":635},{"className":634},[],[636],{"type":48,"value":637},"\u002Fanthropic\u002Fv1\u002Fmessages",{"type":48,"value":639}," (Anthropic Messages). Build the runtime URL as ",{"type":42,"tag":61,"props":641,"children":643},{"className":642},[],[644],{"type":48,"value":645},"\u003Cai-gateway-host>\u002Fdefault\u002Fmodels{supportedEndpoint}",{"type":48,"value":647}," — don't assume every model is OpenAI Chat Completions.",{"type":42,"tag":269,"props":649,"children":651},{"id":650},"one-shot-discovery-copy-paste",[652],{"type":48,"value":653},"One-shot discovery (copy-paste)",{"type":42,"tag":55,"props":655,"children":656},{},[657,659,665,667,672,674,679,681,687,688,694],{"type":48,"value":658},"This performs the whole of Part 1 in one block. Set ",{"type":42,"tag":61,"props":660,"children":662},{"className":661},[],[663],{"type":48,"value":664},"RID",{"type":48,"value":666}," to the ",{"type":42,"tag":61,"props":668,"children":670},{"className":669},[],[671],{"type":48,"value":290},{"type":48,"value":673}," (keep its leading ",{"type":42,"tag":61,"props":675,"children":677},{"className":676},[],[678],{"type":48,"value":231},{"type":48,"value":680},"); requires ",{"type":42,"tag":61,"props":682,"children":684},{"className":683},[],[685],{"type":48,"value":686},"az",{"type":48,"value":76},{"type":42,"tag":61,"props":689,"children":691},{"className":690},[],[692],{"type":48,"value":693},"jq",{"type":48,"value":695},":",{"type":42,"tag":433,"props":697,"children":701},{"className":698,"code":699,"language":700,"meta":441,"style":441},"language-bash shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","RID=\"\u002Fsubscriptions\u002F\u003Csub>\u002FresourceGroups\u002F\u003Crg>\u002Fproviders\u002FMicrosoft.ApiManagement\u002Fservice\u002F\u003Cname>\"\nVER=\"2025-09-01-preview\"\nTOKEN=$(az account get-access-token --resource https:\u002F\u002Fmanagement.azure.com --query accessToken -o tsv)\nB=\"https:\u002F\u002Fmanagement.azure.com$RID\"\nAUTH=(-H \"Authorization: Bearer $TOKEN\")\n\n# Runtime host (used for every model\u002FMCP call below)\nHOST=$(curl -s \"${AUTH[@]}\" \"$B?api-version=$VER\" | jq -r '.properties.gatewayUrl')\n\n# Models -> use .properties.deployment.modelName as the model id (exact dots\u002Fcasing)\ncurl -s \"${AUTH[@]}\" \"$B\u002Fworkspaces\u002Fdefault\u002Fmodels?api-version=$VER\" \\\n  | jq -r '.value[] | \"\\(.properties.deployment.modelName)\\t\\(.properties.supportedEndpoints | join(\",\"))\"'\n\n# MCP tool servers\ncurl -s \"${AUTH[@]}\" \"$B\u002Fworkspaces\u002Fdefault\u002FtoolServers?api-version=$VER\" | jq -r '.value[].name'\n\n# API key: list keys, then read the first active key's secret (name is commonly \"master\" or \"default\")\nKEYNAME=$(curl -s \"${AUTH[@]}\" \"$B\u002FapiKeys?api-version=$VER\" | jq -r '.value[0].name')\nKEY=$(curl -s -X POST \"${AUTH[@]}\" -H \"Content-Length: 0\" \\\n  \"$B\u002FapiKeys\u002F$KEYNAME\u002FlistSecrets?api-version=$VER\" \\\n  | jq -r '.primaryKey \u002F\u002F .properties.primaryKey \u002F\u002F .primaryValue \u002F\u002F .properties.primaryValue \u002F\u002F .value')\n\n# Smoke-test a model over the passthrough — note the \u002Fdefault\u002F workspace segment and the Api-Key header\ncurl -s \"$HOST\u002Fdefault\u002Fmodels\u002Fopenai\u002Fv1\u002Fchat\u002Fcompletions\" \\\n  -H \"Api-Key: $KEY\" -H \"Content-Type: application\u002Fjson\" \\\n  -d '{\"model\":\"\u003CmodelName>\",\"messages\":[{\"role\":\"user\",\"content\":\"ping\"}],\"max_tokens\":5}'\n","bash",[702],{"type":42,"tag":61,"props":703,"children":704},{"__ignoreMap":441},[705,738,763,827,857,899,909,919,1013,1021,1030,1080,1111,1119,1128,1198,1206,1215,1298,1363,1403,1436,1444,1453,1487,1535],{"type":42,"tag":706,"props":707,"children":710},"span",{"class":708,"line":709},"line",1,[711,716,722,727,733],{"type":42,"tag":706,"props":712,"children":714},{"style":713},"--shiki-light:#90A4AE;--shiki-default:#EEFFFF;--shiki-dark:#BABED8",[715],{"type":48,"value":664},{"type":42,"tag":706,"props":717,"children":719},{"style":718},"--shiki-light:#39ADB5;--shiki-default:#89DDFF;--shiki-dark:#89DDFF",[720],{"type":48,"value":721},"=",{"type":42,"tag":706,"props":723,"children":724},{"style":718},[725],{"type":48,"value":726},"\"",{"type":42,"tag":706,"props":728,"children":730},{"style":729},"--shiki-light:#91B859;--shiki-default:#C3E88D;--shiki-dark:#C3E88D",[731],{"type":48,"value":732},"\u002Fsubscriptions\u002F\u003Csub>\u002FresourceGroups\u002F\u003Crg>\u002Fproviders\u002FMicrosoft.ApiManagement\u002Fservice\u002F\u003Cname>",{"type":42,"tag":706,"props":734,"children":735},{"style":718},[736],{"type":48,"value":737},"\"\n",{"type":42,"tag":706,"props":739,"children":741},{"class":708,"line":740},2,[742,747,751,755,759],{"type":42,"tag":706,"props":743,"children":744},{"style":713},[745],{"type":48,"value":746},"VER",{"type":42,"tag":706,"props":748,"children":749},{"style":718},[750],{"type":48,"value":721},{"type":42,"tag":706,"props":752,"children":753},{"style":718},[754],{"type":48,"value":726},{"type":42,"tag":706,"props":756,"children":757},{"style":729},[758],{"type":48,"value":426},{"type":42,"tag":706,"props":760,"children":761},{"style":718},[762],{"type":48,"value":737},{"type":42,"tag":706,"props":764,"children":766},{"class":708,"line":765},3,[767,772,777,782,787,792,797,802,807,812,817,822],{"type":42,"tag":706,"props":768,"children":769},{"style":713},[770],{"type":48,"value":771},"TOKEN",{"type":42,"tag":706,"props":773,"children":774},{"style":718},[775],{"type":48,"value":776},"=$(",{"type":42,"tag":706,"props":778,"children":780},{"style":779},"--shiki-light:#E2931D;--shiki-default:#FFCB6B;--shiki-dark:#FFCB6B",[781],{"type":48,"value":686},{"type":42,"tag":706,"props":783,"children":784},{"style":729},[785],{"type":48,"value":786}," account",{"type":42,"tag":706,"props":788,"children":789},{"style":729},[790],{"type":48,"value":791}," get-access-token",{"type":42,"tag":706,"props":793,"children":794},{"style":729},[795],{"type":48,"value":796}," --resource",{"type":42,"tag":706,"props":798,"children":799},{"style":729},[800],{"type":48,"value":801}," https:\u002F\u002Fmanagement.azure.com",{"type":42,"tag":706,"props":803,"children":804},{"style":729},[805],{"type":48,"value":806}," --query",{"type":42,"tag":706,"props":808,"children":809},{"style":729},[810],{"type":48,"value":811}," accessToken",{"type":42,"tag":706,"props":813,"children":814},{"style":729},[815],{"type":48,"value":816}," -o",{"type":42,"tag":706,"props":818,"children":819},{"style":729},[820],{"type":48,"value":821}," tsv",{"type":42,"tag":706,"props":823,"children":824},{"style":718},[825],{"type":48,"value":826},")\n",{"type":42,"tag":706,"props":828,"children":830},{"class":708,"line":829},4,[831,836,840,844,848,853],{"type":42,"tag":706,"props":832,"children":833},{"style":713},[834],{"type":48,"value":835},"B",{"type":42,"tag":706,"props":837,"children":838},{"style":718},[839],{"type":48,"value":721},{"type":42,"tag":706,"props":841,"children":842},{"style":718},[843],{"type":48,"value":726},{"type":42,"tag":706,"props":845,"children":846},{"style":729},[847],{"type":48,"value":364},{"type":42,"tag":706,"props":849,"children":850},{"style":713},[851],{"type":48,"value":852},"$RID",{"type":42,"tag":706,"props":854,"children":855},{"style":718},[856],{"type":48,"value":737},{"type":42,"tag":706,"props":858,"children":860},{"class":708,"line":859},5,[861,866,871,876,881,886,891,895],{"type":42,"tag":706,"props":862,"children":863},{"style":713},[864],{"type":48,"value":865},"AUTH",{"type":42,"tag":706,"props":867,"children":868},{"style":718},[869],{"type":48,"value":870},"=(",{"type":42,"tag":706,"props":872,"children":873},{"style":729},[874],{"type":48,"value":875},"-H",{"type":42,"tag":706,"props":877,"children":878},{"style":718},[879],{"type":48,"value":880}," \"",{"type":42,"tag":706,"props":882,"children":883},{"style":729},[884],{"type":48,"value":885},"Authorization: Bearer ",{"type":42,"tag":706,"props":887,"children":888},{"style":713},[889],{"type":48,"value":890},"$TOKEN",{"type":42,"tag":706,"props":892,"children":893},{"style":718},[894],{"type":48,"value":726},{"type":42,"tag":706,"props":896,"children":897},{"style":718},[898],{"type":48,"value":826},{"type":42,"tag":706,"props":900,"children":902},{"class":708,"line":901},6,[903],{"type":42,"tag":706,"props":904,"children":906},{"emptyLinePlaceholder":905},true,[907],{"type":48,"value":908},"\n",{"type":42,"tag":706,"props":910,"children":912},{"class":708,"line":911},7,[913],{"type":42,"tag":706,"props":914,"children":916},{"style":915},"--shiki-light:#90A4AE;--shiki-light-font-style:italic;--shiki-default:#546E7A;--shiki-default-font-style:italic;--shiki-dark:#676E95;--shiki-dark-font-style:italic",[917],{"type":48,"value":918},"# Runtime host (used for every model\u002FMCP call below)\n",{"type":42,"tag":706,"props":920,"children":922},{"class":708,"line":921},8,[923,928,932,937,942,947,951,956,960,965,970,975,979,984,989,994,999,1004,1009],{"type":42,"tag":706,"props":924,"children":925},{"style":713},[926],{"type":48,"value":927},"HOST",{"type":42,"tag":706,"props":929,"children":930},{"style":718},[931],{"type":48,"value":776},{"type":42,"tag":706,"props":933,"children":934},{"style":779},[935],{"type":48,"value":936},"curl",{"type":42,"tag":706,"props":938,"children":939},{"style":729},[940],{"type":48,"value":941}," -s",{"type":42,"tag":706,"props":943,"children":944},{"style":718},[945],{"type":48,"value":946}," \"${",{"type":42,"tag":706,"props":948,"children":949},{"style":713},[950],{"type":48,"value":865},{"type":42,"tag":706,"props":952,"children":953},{"style":718},[954],{"type":48,"value":955},"[@]}\"",{"type":42,"tag":706,"props":957,"children":958},{"style":718},[959],{"type":48,"value":880},{"type":42,"tag":706,"props":961,"children":962},{"style":713},[963],{"type":48,"value":964},"$B",{"type":42,"tag":706,"props":966,"children":967},{"style":729},[968],{"type":48,"value":969},"?api-version=",{"type":42,"tag":706,"props":971,"children":972},{"style":713},[973],{"type":48,"value":974},"$VER",{"type":42,"tag":706,"props":976,"children":977},{"style":718},[978],{"type":48,"value":726},{"type":42,"tag":706,"props":980,"children":981},{"style":718},[982],{"type":48,"value":983}," |",{"type":42,"tag":706,"props":985,"children":986},{"style":779},[987],{"type":48,"value":988}," jq",{"type":42,"tag":706,"props":990,"children":991},{"style":729},[992],{"type":48,"value":993}," -r",{"type":42,"tag":706,"props":995,"children":996},{"style":718},[997],{"type":48,"value":998}," '",{"type":42,"tag":706,"props":1000,"children":1001},{"style":729},[1002],{"type":48,"value":1003},".properties.gatewayUrl",{"type":42,"tag":706,"props":1005,"children":1006},{"style":718},[1007],{"type":48,"value":1008},"'",{"type":42,"tag":706,"props":1010,"children":1011},{"style":718},[1012],{"type":48,"value":826},{"type":42,"tag":706,"props":1014,"children":1016},{"class":708,"line":1015},9,[1017],{"type":42,"tag":706,"props":1018,"children":1019},{"emptyLinePlaceholder":905},[1020],{"type":48,"value":908},{"type":42,"tag":706,"props":1022,"children":1024},{"class":708,"line":1023},10,[1025],{"type":42,"tag":706,"props":1026,"children":1027},{"style":915},[1028],{"type":48,"value":1029},"# Models -> use .properties.deployment.modelName as the model id (exact dots\u002Fcasing)\n",{"type":42,"tag":706,"props":1031,"children":1033},{"class":708,"line":1032},11,[1034,1038,1042,1046,1050,1054,1058,1062,1067,1071,1075],{"type":42,"tag":706,"props":1035,"children":1036},{"style":779},[1037],{"type":48,"value":936},{"type":42,"tag":706,"props":1039,"children":1040},{"style":729},[1041],{"type":48,"value":941},{"type":42,"tag":706,"props":1043,"children":1044},{"style":718},[1045],{"type":48,"value":946},{"type":42,"tag":706,"props":1047,"children":1048},{"style":713},[1049],{"type":48,"value":865},{"type":42,"tag":706,"props":1051,"children":1052},{"style":718},[1053],{"type":48,"value":955},{"type":42,"tag":706,"props":1055,"children":1056},{"style":718},[1057],{"type":48,"value":880},{"type":42,"tag":706,"props":1059,"children":1060},{"style":713},[1061],{"type":48,"value":964},{"type":42,"tag":706,"props":1063,"children":1064},{"style":729},[1065],{"type":48,"value":1066},"\u002Fworkspaces\u002Fdefault\u002Fmodels?api-version=",{"type":42,"tag":706,"props":1068,"children":1069},{"style":713},[1070],{"type":48,"value":974},{"type":42,"tag":706,"props":1072,"children":1073},{"style":718},[1074],{"type":48,"value":726},{"type":42,"tag":706,"props":1076,"children":1077},{"style":713},[1078],{"type":48,"value":1079}," \\\n",{"type":42,"tag":706,"props":1081,"children":1083},{"class":708,"line":1082},12,[1084,1089,1093,1097,1101,1106],{"type":42,"tag":706,"props":1085,"children":1086},{"style":718},[1087],{"type":48,"value":1088},"  |",{"type":42,"tag":706,"props":1090,"children":1091},{"style":779},[1092],{"type":48,"value":988},{"type":42,"tag":706,"props":1094,"children":1095},{"style":729},[1096],{"type":48,"value":993},{"type":42,"tag":706,"props":1098,"children":1099},{"style":718},[1100],{"type":48,"value":998},{"type":42,"tag":706,"props":1102,"children":1103},{"style":729},[1104],{"type":48,"value":1105},".value[] | \"\\(.properties.deployment.modelName)\\t\\(.properties.supportedEndpoints | join(\",\"))\"",{"type":42,"tag":706,"props":1107,"children":1108},{"style":718},[1109],{"type":48,"value":1110},"'\n",{"type":42,"tag":706,"props":1112,"children":1114},{"class":708,"line":1113},13,[1115],{"type":42,"tag":706,"props":1116,"children":1117},{"emptyLinePlaceholder":905},[1118],{"type":48,"value":908},{"type":42,"tag":706,"props":1120,"children":1122},{"class":708,"line":1121},14,[1123],{"type":42,"tag":706,"props":1124,"children":1125},{"style":915},[1126],{"type":48,"value":1127},"# MCP tool servers\n",{"type":42,"tag":706,"props":1129,"children":1131},{"class":708,"line":1130},15,[1132,1136,1140,1144,1148,1152,1156,1160,1165,1169,1173,1177,1181,1185,1189,1194],{"type":42,"tag":706,"props":1133,"children":1134},{"style":779},[1135],{"type":48,"value":936},{"type":42,"tag":706,"props":1137,"children":1138},{"style":729},[1139],{"type":48,"value":941},{"type":42,"tag":706,"props":1141,"children":1142},{"style":718},[1143],{"type":48,"value":946},{"type":42,"tag":706,"props":1145,"children":1146},{"style":713},[1147],{"type":48,"value":865},{"type":42,"tag":706,"props":1149,"children":1150},{"style":718},[1151],{"type":48,"value":955},{"type":42,"tag":706,"props":1153,"children":1154},{"style":718},[1155],{"type":48,"value":880},{"type":42,"tag":706,"props":1157,"children":1158},{"style":713},[1159],{"type":48,"value":964},{"type":42,"tag":706,"props":1161,"children":1162},{"style":729},[1163],{"type":48,"value":1164},"\u002Fworkspaces\u002Fdefault\u002FtoolServers?api-version=",{"type":42,"tag":706,"props":1166,"children":1167},{"style":713},[1168],{"type":48,"value":974},{"type":42,"tag":706,"props":1170,"children":1171},{"style":718},[1172],{"type":48,"value":726},{"type":42,"tag":706,"props":1174,"children":1175},{"style":718},[1176],{"type":48,"value":983},{"type":42,"tag":706,"props":1178,"children":1179},{"style":779},[1180],{"type":48,"value":988},{"type":42,"tag":706,"props":1182,"children":1183},{"style":729},[1184],{"type":48,"value":993},{"type":42,"tag":706,"props":1186,"children":1187},{"style":718},[1188],{"type":48,"value":998},{"type":42,"tag":706,"props":1190,"children":1191},{"style":729},[1192],{"type":48,"value":1193},".value[].name",{"type":42,"tag":706,"props":1195,"children":1196},{"style":718},[1197],{"type":48,"value":1110},{"type":42,"tag":706,"props":1199,"children":1201},{"class":708,"line":1200},16,[1202],{"type":42,"tag":706,"props":1203,"children":1204},{"emptyLinePlaceholder":905},[1205],{"type":48,"value":908},{"type":42,"tag":706,"props":1207,"children":1209},{"class":708,"line":1208},17,[1210],{"type":42,"tag":706,"props":1211,"children":1212},{"style":915},[1213],{"type":48,"value":1214},"# API key: list keys, then read the first active key's secret (name is commonly \"master\" or \"default\")\n",{"type":42,"tag":706,"props":1216,"children":1218},{"class":708,"line":1217},18,[1219,1224,1228,1232,1236,1240,1244,1248,1252,1256,1261,1265,1269,1273,1277,1281,1285,1290,1294],{"type":42,"tag":706,"props":1220,"children":1221},{"style":713},[1222],{"type":48,"value":1223},"KEYNAME",{"type":42,"tag":706,"props":1225,"children":1226},{"style":718},[1227],{"type":48,"value":776},{"type":42,"tag":706,"props":1229,"children":1230},{"style":779},[1231],{"type":48,"value":936},{"type":42,"tag":706,"props":1233,"children":1234},{"style":729},[1235],{"type":48,"value":941},{"type":42,"tag":706,"props":1237,"children":1238},{"style":718},[1239],{"type":48,"value":946},{"type":42,"tag":706,"props":1241,"children":1242},{"style":713},[1243],{"type":48,"value":865},{"type":42,"tag":706,"props":1245,"children":1246},{"style":718},[1247],{"type":48,"value":955},{"type":42,"tag":706,"props":1249,"children":1250},{"style":718},[1251],{"type":48,"value":880},{"type":42,"tag":706,"props":1253,"children":1254},{"style":713},[1255],{"type":48,"value":964},{"type":42,"tag":706,"props":1257,"children":1258},{"style":729},[1259],{"type":48,"value":1260},"\u002FapiKeys?api-version=",{"type":42,"tag":706,"props":1262,"children":1263},{"style":713},[1264],{"type":48,"value":974},{"type":42,"tag":706,"props":1266,"children":1267},{"style":718},[1268],{"type":48,"value":726},{"type":42,"tag":706,"props":1270,"children":1271},{"style":718},[1272],{"type":48,"value":983},{"type":42,"tag":706,"props":1274,"children":1275},{"style":779},[1276],{"type":48,"value":988},{"type":42,"tag":706,"props":1278,"children":1279},{"style":729},[1280],{"type":48,"value":993},{"type":42,"tag":706,"props":1282,"children":1283},{"style":718},[1284],{"type":48,"value":998},{"type":42,"tag":706,"props":1286,"children":1287},{"style":729},[1288],{"type":48,"value":1289},".value[0].name",{"type":42,"tag":706,"props":1291,"children":1292},{"style":718},[1293],{"type":48,"value":1008},{"type":42,"tag":706,"props":1295,"children":1296},{"style":718},[1297],{"type":48,"value":826},{"type":42,"tag":706,"props":1299,"children":1301},{"class":708,"line":1300},19,[1302,1307,1311,1315,1319,1324,1329,1333,1337,1341,1346,1350,1355,1359],{"type":42,"tag":706,"props":1303,"children":1304},{"style":713},[1305],{"type":48,"value":1306},"KEY",{"type":42,"tag":706,"props":1308,"children":1309},{"style":718},[1310],{"type":48,"value":776},{"type":42,"tag":706,"props":1312,"children":1313},{"style":779},[1314],{"type":48,"value":936},{"type":42,"tag":706,"props":1316,"children":1317},{"style":729},[1318],{"type":48,"value":941},{"type":42,"tag":706,"props":1320,"children":1321},{"style":729},[1322],{"type":48,"value":1323}," -X",{"type":42,"tag":706,"props":1325,"children":1326},{"style":729},[1327],{"type":48,"value":1328}," POST",{"type":42,"tag":706,"props":1330,"children":1331},{"style":718},[1332],{"type":48,"value":946},{"type":42,"tag":706,"props":1334,"children":1335},{"style":713},[1336],{"type":48,"value":865},{"type":42,"tag":706,"props":1338,"children":1339},{"style":718},[1340],{"type":48,"value":955},{"type":42,"tag":706,"props":1342,"children":1343},{"style":729},[1344],{"type":48,"value":1345}," -H",{"type":42,"tag":706,"props":1347,"children":1348},{"style":718},[1349],{"type":48,"value":880},{"type":42,"tag":706,"props":1351,"children":1352},{"style":729},[1353],{"type":48,"value":1354},"Content-Length: 0",{"type":42,"tag":706,"props":1356,"children":1357},{"style":718},[1358],{"type":48,"value":726},{"type":42,"tag":706,"props":1360,"children":1361},{"style":713},[1362],{"type":48,"value":1079},{"type":42,"tag":706,"props":1364,"children":1366},{"class":708,"line":1365},20,[1367,1372,1376,1381,1386,1391,1395,1399],{"type":42,"tag":706,"props":1368,"children":1369},{"style":718},[1370],{"type":48,"value":1371},"  \"",{"type":42,"tag":706,"props":1373,"children":1374},{"style":713},[1375],{"type":48,"value":964},{"type":42,"tag":706,"props":1377,"children":1378},{"style":729},[1379],{"type":48,"value":1380},"\u002FapiKeys\u002F",{"type":42,"tag":706,"props":1382,"children":1383},{"style":713},[1384],{"type":48,"value":1385},"$KEYNAME",{"type":42,"tag":706,"props":1387,"children":1388},{"style":729},[1389],{"type":48,"value":1390},"\u002FlistSecrets?api-version=",{"type":42,"tag":706,"props":1392,"children":1393},{"style":713},[1394],{"type":48,"value":974},{"type":42,"tag":706,"props":1396,"children":1397},{"style":718},[1398],{"type":48,"value":726},{"type":42,"tag":706,"props":1400,"children":1401},{"style":713},[1402],{"type":48,"value":1079},{"type":42,"tag":706,"props":1404,"children":1406},{"class":708,"line":1405},21,[1407,1411,1415,1419,1423,1428,1432],{"type":42,"tag":706,"props":1408,"children":1409},{"style":718},[1410],{"type":48,"value":1088},{"type":42,"tag":706,"props":1412,"children":1413},{"style":779},[1414],{"type":48,"value":988},{"type":42,"tag":706,"props":1416,"children":1417},{"style":729},[1418],{"type":48,"value":993},{"type":42,"tag":706,"props":1420,"children":1421},{"style":718},[1422],{"type":48,"value":998},{"type":42,"tag":706,"props":1424,"children":1425},{"style":729},[1426],{"type":48,"value":1427},".primaryKey \u002F\u002F .properties.primaryKey \u002F\u002F .primaryValue \u002F\u002F .properties.primaryValue \u002F\u002F .value",{"type":42,"tag":706,"props":1429,"children":1430},{"style":718},[1431],{"type":48,"value":1008},{"type":42,"tag":706,"props":1433,"children":1434},{"style":718},[1435],{"type":48,"value":826},{"type":42,"tag":706,"props":1437,"children":1439},{"class":708,"line":1438},22,[1440],{"type":42,"tag":706,"props":1441,"children":1442},{"emptyLinePlaceholder":905},[1443],{"type":48,"value":908},{"type":42,"tag":706,"props":1445,"children":1447},{"class":708,"line":1446},23,[1448],{"type":42,"tag":706,"props":1449,"children":1450},{"style":915},[1451],{"type":48,"value":1452},"# Smoke-test a model over the passthrough — note the \u002Fdefault\u002F workspace segment and the Api-Key header\n",{"type":42,"tag":706,"props":1454,"children":1456},{"class":708,"line":1455},24,[1457,1461,1465,1469,1474,1479,1483],{"type":42,"tag":706,"props":1458,"children":1459},{"style":779},[1460],{"type":48,"value":936},{"type":42,"tag":706,"props":1462,"children":1463},{"style":729},[1464],{"type":48,"value":941},{"type":42,"tag":706,"props":1466,"children":1467},{"style":718},[1468],{"type":48,"value":880},{"type":42,"tag":706,"props":1470,"children":1471},{"style":713},[1472],{"type":48,"value":1473},"$HOST",{"type":42,"tag":706,"props":1475,"children":1476},{"style":729},[1477],{"type":48,"value":1478},"\u002Fdefault\u002Fmodels\u002Fopenai\u002Fv1\u002Fchat\u002Fcompletions",{"type":42,"tag":706,"props":1480,"children":1481},{"style":718},[1482],{"type":48,"value":726},{"type":42,"tag":706,"props":1484,"children":1485},{"style":713},[1486],{"type":48,"value":1079},{"type":42,"tag":706,"props":1488,"children":1490},{"class":708,"line":1489},25,[1491,1496,1500,1505,1510,1514,1518,1522,1527,1531],{"type":42,"tag":706,"props":1492,"children":1493},{"style":729},[1494],{"type":48,"value":1495},"  -H",{"type":42,"tag":706,"props":1497,"children":1498},{"style":718},[1499],{"type":48,"value":880},{"type":42,"tag":706,"props":1501,"children":1502},{"style":729},[1503],{"type":48,"value":1504},"Api-Key: ",{"type":42,"tag":706,"props":1506,"children":1507},{"style":713},[1508],{"type":48,"value":1509},"$KEY",{"type":42,"tag":706,"props":1511,"children":1512},{"style":718},[1513],{"type":48,"value":726},{"type":42,"tag":706,"props":1515,"children":1516},{"style":729},[1517],{"type":48,"value":1345},{"type":42,"tag":706,"props":1519,"children":1520},{"style":718},[1521],{"type":48,"value":880},{"type":42,"tag":706,"props":1523,"children":1524},{"style":729},[1525],{"type":48,"value":1526},"Content-Type: application\u002Fjson",{"type":42,"tag":706,"props":1528,"children":1529},{"style":718},[1530],{"type":48,"value":726},{"type":42,"tag":706,"props":1532,"children":1533},{"style":713},[1534],{"type":48,"value":1079},{"type":42,"tag":706,"props":1536,"children":1538},{"class":708,"line":1537},26,[1539,1544,1548,1553],{"type":42,"tag":706,"props":1540,"children":1541},{"style":729},[1542],{"type":48,"value":1543},"  -d",{"type":42,"tag":706,"props":1545,"children":1546},{"style":718},[1547],{"type":48,"value":998},{"type":42,"tag":706,"props":1549,"children":1550},{"style":729},[1551],{"type":48,"value":1552},"{\"model\":\"\u003CmodelName>\",\"messages\":[{\"role\":\"user\",\"content\":\"ping\"}],\"max_tokens\":5}",{"type":42,"tag":706,"props":1554,"children":1555},{"style":718},[1556],{"type":48,"value":1110},{"type":42,"tag":55,"props":1558,"children":1559},{},[1560],{"type":48,"value":1561},"The individual steps and their gotchas are documented below.",{"type":42,"tag":269,"props":1563,"children":1565},{"id":1564},"_1-discover-models",[1566],{"type":48,"value":1567},"1. Discover models",{"type":42,"tag":55,"props":1569,"children":1570},{},[1571],{"type":48,"value":1572},"List the models registered in the gateway workspace:",{"type":42,"tag":433,"props":1574,"children":1577},{"className":1575,"code":1576,"language":48},[436],"GET https:\u002F\u002Fmanagement.azure.com{gatewayResourceId}\u002Fworkspaces\u002Fdefault\u002Fmodels?api-version={apiVersion}\n",[1578],{"type":42,"tag":61,"props":1579,"children":1580},{"__ignoreMap":441},[1581],{"type":48,"value":1576},{"type":42,"tag":55,"props":1583,"children":1584},{},[1585,1597,1599,1604,1606,1612,1613,1617,1618,1624],{"type":42,"tag":99,"props":1586,"children":1587},{},[1588,1589,1595],{"type":48,"value":496},{"type":42,"tag":61,"props":1590,"children":1592},{"className":1591},[],[1593],{"type":48,"value":1594},"properties.deployment.modelName",{"type":48,"value":1596}," as the model identifier",{"type":48,"value":1598}," in every gateway call — ",{"type":42,"tag":99,"props":1600,"children":1601},{},[1602],{"type":48,"value":1603},"not",{"type":48,"value":1605}," the ARM resource ",{"type":42,"tag":61,"props":1607,"children":1609},{"className":1608},[],[1610],{"type":48,"value":1611},"name",{"type":48,"value":76},{"type":42,"tag":99,"props":1614,"children":1615},{},[1616],{"type":48,"value":1603},{"type":48,"value":300},{"type":42,"tag":61,"props":1619,"children":1621},{"className":1620},[],[1622],{"type":48,"value":1623},"properties.displayName",{"type":48,"value":1625},". This is the single most common cause of failures, so get it right:",{"type":42,"tag":152,"props":1627,"children":1628},{},[1629,1655,1713],{"type":42,"tag":111,"props":1630,"children":1631},{},[1632,1637,1639,1645,1647,1653],{"type":42,"tag":61,"props":1633,"children":1635},{"className":1634},[],[1636],{"type":48,"value":1594},{"type":48,"value":1638}," is the exact string the OpenAI passthrough accepts in the request body, e.g. ",{"type":42,"tag":61,"props":1640,"children":1642},{"className":1641},[],[1643],{"type":48,"value":1644},"gpt-5.4-nano",{"type":48,"value":1646}," or ",{"type":42,"tag":61,"props":1648,"children":1650},{"className":1649},[],[1651],{"type":48,"value":1652},"DeepSeek-V3.2",{"type":48,"value":1654},". It preserves dots and original casing.",{"type":42,"tag":111,"props":1656,"children":1657},{},[1658,1660,1665,1667,1672,1674,1680,1682,1687,1689,1698,1700,1705,1707,1712],{"type":48,"value":1659},"The ARM resource ",{"type":42,"tag":61,"props":1661,"children":1663},{"className":1662},[],[1664],{"type":48,"value":1611},{"type":48,"value":1666}," is a ",{"type":42,"tag":99,"props":1668,"children":1669},{},[1670],{"type":48,"value":1671},"sanitized",{"type":48,"value":1673}," version of that value with dots and other characters replaced by dashes (e.g. ",{"type":42,"tag":61,"props":1675,"children":1677},{"className":1676},[],[1678],{"type":48,"value":1679},"gpt-5-4-nano",{"type":48,"value":1681},"). Some gateways accept the sanitized ",{"type":42,"tag":61,"props":1683,"children":1685},{"className":1684},[],[1686],{"type":48,"value":1611},{"type":48,"value":1688}," too, but others reject it with a misleading ",{"type":42,"tag":99,"props":1690,"children":1691},{},[1692],{"type":42,"tag":61,"props":1693,"children":1695},{"className":1694},[],[1696],{"type":48,"value":1697},"unknown_model",{"type":48,"value":1699}," error — so always send ",{"type":42,"tag":61,"props":1701,"children":1703},{"className":1702},[],[1704],{"type":48,"value":1594},{"type":48,"value":1706}," to be safe, and don't \"correct\" a working call back to the ARM ",{"type":42,"tag":61,"props":1708,"children":1710},{"className":1709},[],[1711],{"type":48,"value":1611},{"type":48,"value":587},{"type":42,"tag":111,"props":1714,"children":1715},{},[1716,1721],{"type":42,"tag":61,"props":1717,"children":1719},{"className":1718},[],[1720],{"type":48,"value":1623},{"type":48,"value":1722}," is a human-friendly label and is also rejected by the passthrough.",{"type":42,"tag":55,"props":1724,"children":1725},{},[1726,1728,1733,1735,1741,1743,1748,1750,1756,1758,1763],{"type":48,"value":1727},"For each model, read ",{"type":42,"tag":61,"props":1729,"children":1731},{"className":1730},[],[1732],{"type":48,"value":1594},{"type":48,"value":1734}," and carry that exact string (same dots, same casing, same punctuation) through to the agent's ",{"type":42,"tag":61,"props":1736,"children":1738},{"className":1737},[],[1739],{"type":48,"value":1740},"model=",{"type":48,"value":1742}," parameter. If ",{"type":42,"tag":61,"props":1744,"children":1746},{"className":1745},[],[1747],{"type":48,"value":1594},{"type":48,"value":1749}," is missing for some reason, fall back to confirming the accepted ID by probing ",{"type":42,"tag":61,"props":1751,"children":1753},{"className":1752},[],[1754],{"type":48,"value":1755},"POST {gateway-host}\u002Fdefault\u002Fmodels\u002Fopenai\u002Fv1\u002Fchat\u002Fcompletions",{"type":48,"value":1757}," with a tiny payload rather than guessing from the ARM ",{"type":42,"tag":61,"props":1759,"children":1761},{"className":1760},[],[1762],{"type":48,"value":1611},{"type":48,"value":587},{"type":42,"tag":55,"props":1765,"children":1766},{},[1767],{"type":48,"value":1768},"Match models to the user's use case based on the model name\u002Fdescription (e.g. a GPT-class model for chat, an embedding model for RAG). Suggest the best match as the default but let the user pick another.",{"type":42,"tag":55,"props":1770,"children":1771},{},[1772,1782,1784,1789,1791,1797,1798,1804],{"type":42,"tag":99,"props":1773,"children":1774},{},[1775,1777],{"type":48,"value":1776},"Read each model's protocol from ",{"type":42,"tag":61,"props":1778,"children":1780},{"className":1779},[],[1781],{"type":48,"value":613},{"type":48,"value":1783}," — don't assume every model is OpenAI Chat Completions. This array holds the exact runtime operation path(s) the model accepts; select the one matching your integration and build the runtime URL as ",{"type":42,"tag":61,"props":1785,"children":1787},{"className":1786},[],[1788],{"type":48,"value":645},{"type":48,"value":1790}," (preserve the returned value exactly, including any provider prefix like ",{"type":42,"tag":61,"props":1792,"children":1794},{"className":1793},[],[1795],{"type":48,"value":1796},"\u002Fopenai\u002Fv1",{"type":48,"value":1646},{"type":42,"tag":61,"props":1799,"children":1801},{"className":1800},[],[1802],{"type":48,"value":1803},"\u002Fanthropic\u002Fv1",{"type":48,"value":1805},"). The recognized agent\u002Fchat protocols are:",{"type":42,"tag":1807,"props":1808,"children":1809},"table",{},[1810,1834],{"type":42,"tag":1811,"props":1812,"children":1813},"thead",{},[1814],{"type":42,"tag":1815,"props":1816,"children":1817},"tr",{},[1818,1824,1829],{"type":42,"tag":1819,"props":1820,"children":1821},"th",{},[1822],{"type":48,"value":1823},"Endpoint suffix",{"type":42,"tag":1819,"props":1825,"children":1826},{},[1827],{"type":48,"value":1828},"Protocol",{"type":42,"tag":1819,"props":1830,"children":1831},{},[1832],{"type":48,"value":1833},"Client",{"type":42,"tag":1835,"props":1836,"children":1837},"tbody",{},[1838,1861,1883],{"type":42,"tag":1815,"props":1839,"children":1840},{},[1841,1851,1856],{"type":42,"tag":1842,"props":1843,"children":1844},"td",{},[1845],{"type":42,"tag":61,"props":1846,"children":1848},{"className":1847},[],[1849],{"type":48,"value":1850},"\u002Fchat\u002Fcompletions",{"type":42,"tag":1842,"props":1852,"children":1853},{},[1854],{"type":48,"value":1855},"OpenAI Chat Completions",{"type":42,"tag":1842,"props":1857,"children":1858},{},[1859],{"type":48,"value":1860},"OpenAI-compatible client (Chat Completions mode)",{"type":42,"tag":1815,"props":1862,"children":1863},{},[1864,1873,1878],{"type":42,"tag":1842,"props":1865,"children":1866},{},[1867],{"type":42,"tag":61,"props":1868,"children":1870},{"className":1869},[],[1871],{"type":48,"value":1872},"\u002Fresponses",{"type":42,"tag":1842,"props":1874,"children":1875},{},[1876],{"type":48,"value":1877},"OpenAI Responses",{"type":42,"tag":1842,"props":1879,"children":1880},{},[1881],{"type":48,"value":1882},"OpenAI-compatible client (Responses mode)",{"type":42,"tag":1815,"props":1884,"children":1885},{},[1886,1895,1900],{"type":42,"tag":1842,"props":1887,"children":1888},{},[1889],{"type":42,"tag":61,"props":1890,"children":1892},{"className":1891},[],[1893],{"type":48,"value":1894},"\u002Fmessages",{"type":42,"tag":1842,"props":1896,"children":1897},{},[1898],{"type":48,"value":1899},"Anthropic Messages",{"type":42,"tag":1842,"props":1901,"children":1902},{},[1903],{"type":48,"value":1904},"Anthropic-compatible client (Messages mode)",{"type":42,"tag":55,"props":1906,"children":1907},{},[1908,1910,1915,1917,1923,1925,1930,1931,1936,1938,1944,1946,1951],{"type":48,"value":1909},"Most gateways today expose ",{"type":42,"tag":61,"props":1911,"children":1913},{"className":1912},[],[1914],{"type":48,"value":621},{"type":48,"value":1916},", which is why the examples below default to it — but if the selected model's ",{"type":42,"tag":61,"props":1918,"children":1920},{"className":1919},[],[1921],{"type":48,"value":1922},"supportedEndpoints",{"type":48,"value":1924}," shows ",{"type":42,"tag":61,"props":1926,"children":1928},{"className":1927},[],[1929],{"type":48,"value":1872},{"type":48,"value":1646},{"type":42,"tag":61,"props":1932,"children":1934},{"className":1933},[],[1935],{"type":48,"value":1894},{"type":48,"value":1937}," instead, use that protocol's client and request shape (see ",{"type":42,"tag":1939,"props":1940,"children":1941},"em",{},[1942],{"type":48,"value":1943},"Path A",{"type":48,"value":1945},"). If a model exposes ",{"type":42,"tag":99,"props":1947,"children":1948},{},[1949],{"type":48,"value":1950},"only",{"type":48,"value":1952}," non-agent endpoints (embeddings, images, audio, etc.), don't scaffold a chat agent against it — explain the mismatch and let the user pick a different model.",{"type":42,"tag":269,"props":1954,"children":1956},{"id":1955},"_2-discover-tools-mcp-tool-servers",[1957],{"type":48,"value":1958},"2. Discover tools (MCP tool servers)",{"type":42,"tag":55,"props":1960,"children":1961},{},[1962,1964,1969],{"type":48,"value":1963},"Tools are registered as ",{"type":42,"tag":99,"props":1965,"children":1966},{},[1967],{"type":48,"value":1968},"tool servers",{"type":48,"value":1970}," in the gateway workspace. Each tool server is a federated MCP host exposed at a single MCP endpoint on the gateway. List them:",{"type":42,"tag":433,"props":1972,"children":1975},{"className":1973,"code":1974,"language":48},[436],"GET https:\u002F\u002Fmanagement.azure.com{gatewayResourceId}\u002Fworkspaces\u002Fdefault\u002FtoolServers?api-version={apiVersion}\n",[1976],{"type":42,"tag":61,"props":1977,"children":1978},{"__ignoreMap":441},[1979],{"type":48,"value":1974},{"type":42,"tag":55,"props":1981,"children":1982},{},[1983,1985,1990,1992,1998,2000,2005,2007,2013,2015,2026,2028,2033,2035,2040],{"type":48,"value":1984},"Each item's ",{"type":42,"tag":61,"props":1986,"children":1988},{"className":1987},[],[1989],{"type":48,"value":1611},{"type":48,"value":1991}," is the tool server name. Build its MCP endpoint URL as ",{"type":42,"tag":61,"props":1993,"children":1995},{"className":1994},[],[1996],{"type":48,"value":1997},"https:\u002F\u002F{gateway-host}\u002Fdefault\u002Ftoolservers\u002F{toolServerName}\u002Fmcp",{"type":48,"value":1999}," (note the ",{"type":42,"tag":61,"props":2001,"children":2003},{"className":2002},[],[2004],{"type":48,"value":554},{"type":48,"value":2006}," workspace segment — without it the gateway returns ",{"type":42,"tag":61,"props":2008,"children":2010},{"className":2009},[],[2011],{"type":48,"value":2012},"404",{"type":48,"value":2014},"). ",{"type":42,"tag":99,"props":2016,"children":2017},{},[2018,2024],{"type":42,"tag":61,"props":2019,"children":2021},{"className":2020},[],[2022],{"type":48,"value":2023},"properties.mcpEndpointUrl",{"type":48,"value":2025}," is frequently empty",{"type":48,"value":2027}," in the ARM response, so do not rely on it — construct the URL from the host and tool server name, and only use ",{"type":42,"tag":61,"props":2029,"children":2031},{"className":2030},[],[2032],{"type":48,"value":2023},{"type":48,"value":2034}," if it is non-empty. Filter to the tools relevant to the user's request (examine names and descriptions for keywords — e.g. for shipping, look for a \"calculator\" tool). Then ",{"type":42,"tag":99,"props":2036,"children":2037},{},[2038],{"type":48,"value":2039},"stop and ask the user",{"type":48,"value":2041},": \"I found these tools for your use case. Which would you like to use?\" List them clearly with brief descriptions and endpoints, and allow selecting all, some, or none.",{"type":42,"tag":51,"props":2043,"children":2044},{},[2045],{"type":42,"tag":55,"props":2046,"children":2047},{},[2048,2053,2055,2060,2062,2068,2070,2076,2078,2084,2086,2092,2094,2103,2105,2110,2112,2118,2120,2125,2126,2132,2134,2139],{"type":42,"tag":99,"props":2049,"children":2050},{},[2051],{"type":48,"value":2052},"Verify the tool server actually exposes tools before wiring it in.",{"type":48,"value":2054}," A tool server can be registered but expose ",{"type":42,"tag":99,"props":2056,"children":2057},{},[2058],{"type":48,"value":2059},"zero",{"type":48,"value":2061}," tools (e.g. a federated OpenAPI\u002FMCP source that failed to sync). Confirm with an MCP handshake against the constructed URL, using the ",{"type":42,"tag":61,"props":2063,"children":2065},{"className":2064},[],[2066],{"type":48,"value":2067},"Api-Key",{"type":48,"value":2069}," header and ",{"type":42,"tag":61,"props":2071,"children":2073},{"className":2072},[],[2074],{"type":48,"value":2075},"Accept: application\u002Fjson, text\u002Fevent-stream",{"type":48,"value":2077}," on every request: ",{"type":42,"tag":61,"props":2079,"children":2081},{"className":2080},[],[2082],{"type":48,"value":2083},"POST",{"type":48,"value":2085}," an ",{"type":42,"tag":61,"props":2087,"children":2089},{"className":2088},[],[2090],{"type":48,"value":2091},"initialize",{"type":48,"value":2093}," request, capture the ",{"type":42,"tag":99,"props":2095,"children":2096},{},[2097],{"type":42,"tag":61,"props":2098,"children":2100},{"className":2099},[],[2101],{"type":48,"value":2102},"Mcp-Session-Id",{"type":48,"value":2104}," response header, ",{"type":42,"tag":61,"props":2106,"children":2108},{"className":2107},[],[2109],{"type":48,"value":2083},{"type":48,"value":2111}," a ",{"type":42,"tag":61,"props":2113,"children":2115},{"className":2114},[],[2116],{"type":48,"value":2117},"notifications\u002Finitialized",{"type":48,"value":2119}," message with that session id, then ",{"type":42,"tag":61,"props":2121,"children":2123},{"className":2122},[],[2124],{"type":48,"value":2083},{"type":48,"value":2111},{"type":42,"tag":61,"props":2127,"children":2129},{"className":2128},[],[2130],{"type":48,"value":2131},"tools\u002Flist",{"type":48,"value":2133}," request (also carrying the session id). If ",{"type":42,"tag":61,"props":2135,"children":2137},{"className":2136},[],[2138],{"type":48,"value":2131},{"type":48,"value":2140}," returns an empty array, tell the user that server has no usable tools right now (a gateway-side configuration issue, not a client bug) and let them pick a different one rather than scaffolding an agent that can't call anything.",{"type":42,"tag":269,"props":2142,"children":2144},{"id":2143},"_3-retrieve-a-credential",[2145],{"type":48,"value":2146},"3. Retrieve a credential",{"type":42,"tag":55,"props":2148,"children":2149},{},[2150,2152,2157,2159,2164],{"type":48,"value":2151},"The model passthrough and MCP tool servers are called with a gateway ",{"type":42,"tag":99,"props":2153,"children":2154},{},[2155],{"type":48,"value":2156},"API key",{"type":48,"value":2158}," — the ",{"type":42,"tag":99,"props":2160,"children":2161},{},[2162],{"type":48,"value":2163},"same key works for both",{"type":48,"value":587},{"type":42,"tag":107,"props":2166,"children":2167},{},[2168,2182,2218],{"type":42,"tag":111,"props":2169,"children":2170},{},[2171,2173],{"type":48,"value":2172},"List the available keys (keys live at the gateway level, not the workspace):\n",{"type":42,"tag":433,"props":2174,"children":2177},{"className":2175,"code":2176,"language":48},[436],"GET https:\u002F\u002Fmanagement.azure.com{gatewayResourceId}\u002FapiKeys?api-version={apiVersion}\n",[2178],{"type":42,"tag":61,"props":2179,"children":2180},{"__ignoreMap":441},[2181],{"type":48,"value":2176},{"type":42,"tag":111,"props":2183,"children":2184},{},[2185,2187,2193,2195,2201,2203,2209,2210,2216],{"type":48,"value":2186},"Pick a key — use the first key whose ",{"type":42,"tag":61,"props":2188,"children":2190},{"className":2189},[],[2191],{"type":48,"value":2192},"properties.state",{"type":48,"value":2194}," is ",{"type":42,"tag":61,"props":2196,"children":2198},{"className":2197},[],[2199],{"type":48,"value":2200},"active",{"type":48,"value":2202},". The name is commonly ",{"type":42,"tag":61,"props":2204,"children":2206},{"className":2205},[],[2207],{"type":48,"value":2208},"master",{"type":48,"value":1646},{"type":42,"tag":61,"props":2211,"children":2213},{"className":2212},[],[2214],{"type":48,"value":2215},"default",{"type":48,"value":2217},"; don't hardcode it, read it from the list response.",{"type":42,"tag":111,"props":2219,"children":2220},{},[2221,2223,2232,2234,2240,2242,2329,2331,2336,2337,2343,2344,2350,2351,2357,2359,2365,2367,2373,2375,2381,2383,2389],{"type":48,"value":2222},"Retrieve the secret:\n",{"type":42,"tag":433,"props":2224,"children":2227},{"className":2225,"code":2226,"language":48},[436],"POST https:\u002F\u002Fmanagement.azure.com{gatewayResourceId}\u002FapiKeys\u002F{keyName}\u002FlistSecrets?api-version={apiVersion}\n",[2228],{"type":42,"tag":61,"props":2229,"children":2230},{"__ignoreMap":441},[2231],{"type":48,"value":2226},{"type":48,"value":2233},"\nThe key is normally in ",{"type":42,"tag":61,"props":2235,"children":2237},{"className":2236},[],[2238],{"type":48,"value":2239},"primaryKey",{"type":48,"value":2241},":\n",{"type":42,"tag":433,"props":2243,"children":2247},{"className":2244,"code":2245,"language":2246,"meta":441,"style":441},"language-json shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","{ \"primaryKey\": \"2e41...\", \"secondaryKey\": \"365...\" }\n","json",[2248],{"type":42,"tag":61,"props":2249,"children":2250},{"__ignoreMap":441},[2251],{"type":42,"tag":706,"props":2252,"children":2253},{"class":708,"line":709},[2254,2259,2263,2268,2272,2276,2280,2285,2289,2294,2298,2303,2307,2311,2315,2320,2324],{"type":42,"tag":706,"props":2255,"children":2256},{"style":718},[2257],{"type":48,"value":2258},"{",{"type":42,"tag":706,"props":2260,"children":2261},{"style":718},[2262],{"type":48,"value":880},{"type":42,"tag":706,"props":2264,"children":2266},{"style":2265},"--shiki-light:#9C3EDA;--shiki-default:#C792EA;--shiki-dark:#C792EA",[2267],{"type":48,"value":2239},{"type":42,"tag":706,"props":2269,"children":2270},{"style":718},[2271],{"type":48,"value":726},{"type":42,"tag":706,"props":2273,"children":2274},{"style":718},[2275],{"type":48,"value":695},{"type":42,"tag":706,"props":2277,"children":2278},{"style":718},[2279],{"type":48,"value":880},{"type":42,"tag":706,"props":2281,"children":2282},{"style":729},[2283],{"type":48,"value":2284},"2e41...",{"type":42,"tag":706,"props":2286,"children":2287},{"style":718},[2288],{"type":48,"value":726},{"type":42,"tag":706,"props":2290,"children":2291},{"style":718},[2292],{"type":48,"value":2293},",",{"type":42,"tag":706,"props":2295,"children":2296},{"style":718},[2297],{"type":48,"value":880},{"type":42,"tag":706,"props":2299,"children":2300},{"style":2265},[2301],{"type":48,"value":2302},"secondaryKey",{"type":42,"tag":706,"props":2304,"children":2305},{"style":718},[2306],{"type":48,"value":726},{"type":42,"tag":706,"props":2308,"children":2309},{"style":718},[2310],{"type":48,"value":695},{"type":42,"tag":706,"props":2312,"children":2313},{"style":718},[2314],{"type":48,"value":880},{"type":42,"tag":706,"props":2316,"children":2317},{"style":729},[2318],{"type":48,"value":2319},"365...",{"type":42,"tag":706,"props":2321,"children":2322},{"style":718},[2323],{"type":48,"value":726},{"type":42,"tag":706,"props":2325,"children":2326},{"style":718},[2327],{"type":48,"value":2328}," }\n",{"type":48,"value":2330},"\nBackend versions have returned a few response shapes, so read the first non-empty value from, in order: ",{"type":42,"tag":61,"props":2332,"children":2334},{"className":2333},[],[2335],{"type":48,"value":2239},{"type":48,"value":322},{"type":42,"tag":61,"props":2338,"children":2340},{"className":2339},[],[2341],{"type":48,"value":2342},"properties.primaryKey",{"type":48,"value":322},{"type":42,"tag":61,"props":2345,"children":2347},{"className":2346},[],[2348],{"type":48,"value":2349},"primaryValue",{"type":48,"value":322},{"type":42,"tag":61,"props":2352,"children":2354},{"className":2353},[],[2355],{"type":48,"value":2356},"properties.primaryValue",{"type":48,"value":2358},", then ",{"type":42,"tag":61,"props":2360,"children":2362},{"className":2361},[],[2363],{"type":48,"value":2364},"value",{"type":48,"value":2366}," (when ",{"type":42,"tag":61,"props":2368,"children":2370},{"className":2369},[],[2371],{"type":48,"value":2372},"target == \"Primary\"",{"type":48,"value":2374},"), falling back to the equivalent ",{"type":42,"tag":61,"props":2376,"children":2378},{"className":2377},[],[2379],{"type":48,"value":2380},"secondary*",{"type":48,"value":2382}," fields. If none is present, the caller likely isn't authorized to ",{"type":42,"tag":61,"props":2384,"children":2386},{"className":2385},[],[2387],{"type":48,"value":2388},"listSecrets",{"type":48,"value":2390}," — stop and direct them to an administrator rather than creating or rotating a key.",{"type":42,"tag":55,"props":2392,"children":2393},{},[2394,2396,2404],{"type":48,"value":2395},"The credential is passed in the ",{"type":42,"tag":99,"props":2397,"children":2398},{},[2399],{"type":42,"tag":61,"props":2400,"children":2402},{"className":2401},[],[2403],{"type":48,"value":2067},{"type":48,"value":2405}," header for both the model passthrough and the MCP tool servers.",{"type":42,"tag":51,"props":2407,"children":2408},{},[2409],{"type":42,"tag":55,"props":2410,"children":2411},{},[2412,2417,2419,2423],{"type":42,"tag":99,"props":2413,"children":2414},{},[2415],{"type":48,"value":2416},"Discovery-only path:",{"type":48,"value":2418}," If the user only wants to explore and select assets (models\u002Ftools) and does ",{"type":42,"tag":99,"props":2420,"children":2421},{},[2422],{"type":48,"value":1603},{"type":48,"value":2424}," want to integrate them yet, you can stop here. Present the discovered assets and selected credential, and skip Part 2. Code generation is optional.",{"type":42,"tag":259,"props":2426,"children":2427},{},[],{"type":42,"tag":186,"props":2429,"children":2431},{"id":2430},"part-2-integrate-into-your-application",[2432],{"type":48,"value":2433},"Part 2 — Integrate into your application",{"type":42,"tag":55,"props":2435,"children":2436},{},[2437],{"type":48,"value":2438},"By now you have (a) the selected model(s) and\u002For MCP tool server(s) and (b) the gateway API key. Now wire them into whatever the user is building.",{"type":42,"tag":55,"props":2440,"children":2441},{},[2442,2447],{"type":42,"tag":99,"props":2443,"children":2444},{},[2445],{"type":48,"value":2446},"First, pick the integration path",{"type":48,"value":2448}," — ask the user what they're building if it isn't already clear, then follow the matching path (they can combine A and B):",{"type":42,"tag":152,"props":2450,"children":2451},{},[2452,2467,2477],{"type":42,"tag":111,"props":2453,"children":2454},{},[2455,2460,2462],{"type":42,"tag":99,"props":2456,"children":2457},{},[2458],{"type":48,"value":2459},"Path A — Call a model.",{"type":48,"value":2461}," The user wants their app\u002Fscript\u002Fservice to send prompts to a model. Works from any language or raw HTTP via the gateway's OpenAI-compatible passthrough. ",{"type":42,"tag":1939,"props":2463,"children":2464},{},[2465],{"type":48,"value":2466},"Most common for existing apps.",{"type":42,"tag":111,"props":2468,"children":2469},{},[2470,2475],{"type":42,"tag":99,"props":2471,"children":2472},{},[2473],{"type":48,"value":2474},"Path B — Connect MCP tools.",{"type":48,"value":2476}," The user wants their app or MCP-capable client to call the gateway's registered MCP tool servers.",{"type":42,"tag":111,"props":2478,"children":2479},{},[2480,2485],{"type":42,"tag":99,"props":2481,"children":2482},{},[2483],{"type":48,"value":2484},"Path C — Scaffold a standalone agent.",{"type":48,"value":2486}," The user wants a ready-to-run agent project (GitHub Copilot SDK) that combines models and tools.",{"type":42,"tag":55,"props":2488,"children":2489},{},[2490,2492,2497],{"type":48,"value":2491},"Whichever path you take, integrate into the user's ",{"type":42,"tag":99,"props":2493,"children":2494},{},[2495],{"type":48,"value":2496},"existing",{"type":48,"value":2498}," project when they have one (respect its language, framework, and conventions) rather than forcing a new scaffold. Path C's scaffold is only for users who explicitly want a fresh standalone agent.",{"type":42,"tag":55,"props":2500,"children":2501},{},[2502],{"type":42,"tag":99,"props":2503,"children":2504},{},[2505],{"type":48,"value":2506},"Shared rules (all paths):",{"type":42,"tag":152,"props":2508,"children":2509},{},[2510,2530,2552],{"type":42,"tag":111,"props":2511,"children":2512},{},[2513,2515,2521,2523,2528],{"type":48,"value":2514},"Read every credential from environment variables (e.g. ",{"type":42,"tag":61,"props":2516,"children":2518},{"className":2517},[],[2519],{"type":48,"value":2520},"AI_GATEWAY_API_KEY",{"type":48,"value":2522},") — never hardcode secrets. See ",{"type":42,"tag":1939,"props":2524,"children":2525},{},[2526],{"type":48,"value":2527},"Shared: credentials & project hygiene",{"type":48,"value":2529}," below.",{"type":42,"tag":111,"props":2531,"children":2532},{},[2533,2535,2540,2542,2550],{"type":48,"value":2534},"The gateway authenticates ",{"type":42,"tag":99,"props":2536,"children":2537},{},[2538],{"type":48,"value":2539},"both",{"type":48,"value":2541}," models and MCP tool servers with the same key, passed in the ",{"type":42,"tag":99,"props":2543,"children":2544},{},[2545],{"type":42,"tag":61,"props":2546,"children":2548},{"className":2547},[],[2549],{"type":48,"value":2067},{"type":48,"value":2551}," request header.",{"type":42,"tag":111,"props":2553,"children":2554},{},[2555,2560,2562,2567,2569,2574,2576,2581],{"type":42,"tag":99,"props":2556,"children":2557},{},[2558],{"type":48,"value":2559},"Client key vs. backend managed identity are different things.",{"type":48,"value":2561}," A model provider or tool server may use the gateway's managed identity to authenticate to ",{"type":42,"tag":1939,"props":2563,"children":2564},{},[2565],{"type":48,"value":2566},"its",{"type":48,"value":2568}," upstream (that's gateway-to-backend auth, transparent to your app). Don't try to fetch or supply that upstream credential, and don't replace your ",{"type":42,"tag":61,"props":2570,"children":2572},{"className":2571},[],[2573],{"type":48,"value":2067},{"type":48,"value":2575}," header with a managed-identity\u002Fbearer token — your app always authenticates to the gateway runtime with the gateway ",{"type":42,"tag":61,"props":2577,"children":2579},{"className":2578},[],[2580],{"type":48,"value":2067},{"type":48,"value":587},{"type":42,"tag":259,"props":2583,"children":2584},{},[],{"type":42,"tag":269,"props":2586,"children":2588},{"id":2587},"path-a-call-a-model",[2589],{"type":48,"value":2590},"Path A — Call a model",{"type":42,"tag":55,"props":2592,"children":2593},{},[2594,2596,2601,2603,2608,2610,2615],{"type":48,"value":2595},"Most AI Gateway models expose an ",{"type":42,"tag":99,"props":2597,"children":2598},{},[2599],{"type":48,"value":2600},"OpenAI-compatible",{"type":48,"value":2602}," endpoint, so the examples below default to it. First confirm the selected model's protocol from its ",{"type":42,"tag":61,"props":2604,"children":2606},{"className":2605},[],[2607],{"type":48,"value":613},{"type":48,"value":2609}," (see §1) and derive the client ",{"type":42,"tag":99,"props":2611,"children":2612},{},[2613],{"type":48,"value":2614},"base URL",{"type":48,"value":2616}," from the exact endpoint by stripping the operation suffix:",{"type":42,"tag":1807,"props":2618,"children":2619},{},[2620,2648],{"type":42,"tag":1811,"props":2621,"children":2622},{},[2623],{"type":42,"tag":1815,"props":2624,"children":2625},{},[2626,2631,2643],{"type":42,"tag":1819,"props":2627,"children":2628},{},[2629],{"type":48,"value":2630},"Protocol (endpoint suffix)",{"type":42,"tag":1819,"props":2632,"children":2633},{},[2634,2636,2641],{"type":48,"value":2635},"Client base URL = ",{"type":42,"tag":61,"props":2637,"children":2639},{"className":2638},[],[2640],{"type":48,"value":562},{"type":48,"value":2642}," + …",{"type":42,"tag":1819,"props":2644,"children":2645},{},[2646],{"type":48,"value":2647},"Client appends",{"type":42,"tag":1835,"props":2649,"children":2650},{},[2651,2690,2727],{"type":42,"tag":1815,"props":2652,"children":2653},{},[2654,2666,2682],{"type":42,"tag":1842,"props":2655,"children":2656},{},[2657,2659,2664],{"type":48,"value":2658},"OpenAI Chat Completions (",{"type":42,"tag":61,"props":2660,"children":2662},{"className":2661},[],[2663],{"type":48,"value":1850},{"type":48,"value":2665},")",{"type":42,"tag":1842,"props":2667,"children":2668},{},[2669,2674,2676,2681],{"type":42,"tag":61,"props":2670,"children":2672},{"className":2671},[],[2673],{"type":48,"value":1796},{"type":48,"value":2675}," (drop ",{"type":42,"tag":61,"props":2677,"children":2679},{"className":2678},[],[2680],{"type":48,"value":1850},{"type":48,"value":2665},{"type":42,"tag":1842,"props":2683,"children":2684},{},[2685],{"type":42,"tag":61,"props":2686,"children":2688},{"className":2687},[],[2689],{"type":48,"value":1850},{"type":42,"tag":1815,"props":2691,"children":2692},{},[2693,2704,2719],{"type":42,"tag":1842,"props":2694,"children":2695},{},[2696,2698,2703],{"type":48,"value":2697},"OpenAI Responses (",{"type":42,"tag":61,"props":2699,"children":2701},{"className":2700},[],[2702],{"type":48,"value":1872},{"type":48,"value":2665},{"type":42,"tag":1842,"props":2705,"children":2706},{},[2707,2712,2713,2718],{"type":42,"tag":61,"props":2708,"children":2710},{"className":2709},[],[2711],{"type":48,"value":1796},{"type":48,"value":2675},{"type":42,"tag":61,"props":2714,"children":2716},{"className":2715},[],[2717],{"type":48,"value":1872},{"type":48,"value":2665},{"type":42,"tag":1842,"props":2720,"children":2721},{},[2722],{"type":42,"tag":61,"props":2723,"children":2725},{"className":2724},[],[2726],{"type":48,"value":1872},{"type":42,"tag":1815,"props":2728,"children":2729},{},[2730,2742,2754],{"type":42,"tag":1842,"props":2731,"children":2732},{},[2733,2735,2741],{"type":48,"value":2734},"Anthropic Messages (",{"type":42,"tag":61,"props":2736,"children":2738},{"className":2737},[],[2739],{"type":48,"value":2740},"\u002Fv1\u002Fmessages",{"type":48,"value":2665},{"type":42,"tag":1842,"props":2743,"children":2744},{},[2745,2747,2752],{"type":48,"value":2746},"the endpoint with ",{"type":42,"tag":61,"props":2748,"children":2750},{"className":2749},[],[2751],{"type":48,"value":2740},{"type":48,"value":2753}," removed (Anthropic SDK re-adds it)",{"type":42,"tag":1842,"props":2755,"children":2756},{},[2757],{"type":42,"tag":61,"props":2758,"children":2760},{"className":2759},[],[2761],{"type":48,"value":2740},{"type":42,"tag":55,"props":2763,"children":2764},{},[2765],{"type":48,"value":2766},"Common case — OpenAI-compatible. Point any OpenAI-style client (or plain HTTP) at it:",{"type":42,"tag":152,"props":2768,"children":2769},{},[2770,2829,2894],{"type":42,"tag":111,"props":2771,"children":2772},{},[2773,2778,2779,2785,2787,2793,2795,2800,2802,2807,2809,2814,2816,2821,2823,2828],{"type":42,"tag":99,"props":2774,"children":2775},{},[2776],{"type":48,"value":2777},"Base URL:",{"type":48,"value":300},{"type":42,"tag":61,"props":2780,"children":2782},{"className":2781},[],[2783],{"type":48,"value":2784},"\u003Cai-gateway-host>\u002Fdefault\u002Fmodels\u002Fopenai\u002Fv1",{"type":48,"value":2786}," — e.g. ",{"type":42,"tag":61,"props":2788,"children":2790},{"className":2789},[],[2791],{"type":48,"value":2792},"https:\u002F\u002Fmy-gateway.westus2-01.ai.gateway-current.azure.com\u002Fdefault\u002Fmodels\u002Fopenai\u002Fv1",{"type":48,"value":2794},". This is the same endpoint the ",{"type":42,"tag":248,"props":2796,"children":2798},{"href":250,"rel":2797},[252],[2799],{"type":48,"value":255},{"type":48,"value":2801}," advertises to consumers; clients append ",{"type":42,"tag":61,"props":2803,"children":2805},{"className":2804},[],[2806],{"type":48,"value":1850},{"type":48,"value":2808}," (or ",{"type":42,"tag":61,"props":2810,"children":2812},{"className":2811},[],[2813],{"type":48,"value":1872},{"type":48,"value":2815}," for a Responses model). The ",{"type":42,"tag":61,"props":2817,"children":2819},{"className":2818},[],[2820],{"type":48,"value":554},{"type":48,"value":2822}," segment (the workspace) is required — dropping it returns ",{"type":42,"tag":61,"props":2824,"children":2826},{"className":2825},[],[2827],{"type":48,"value":2012},{"type":48,"value":587},{"type":42,"tag":111,"props":2830,"children":2831},{},[2832,2837,2838,2844,2846,2851,2853,2859,2861,2867,2869,2877,2879,2885,2887,2892],{"type":42,"tag":99,"props":2833,"children":2834},{},[2835],{"type":48,"value":2836},"Auth header:",{"type":48,"value":300},{"type":42,"tag":61,"props":2839,"children":2841},{"className":2840},[],[2842],{"type":48,"value":2843},"Api-Key: \u003Cgateway key>",{"type":48,"value":2845},". ",{"type":42,"tag":99,"props":2847,"children":2848},{},[2849],{"type":48,"value":2850},"Do not",{"type":48,"value":2852}," rely on ",{"type":42,"tag":61,"props":2854,"children":2856},{"className":2855},[],[2857],{"type":48,"value":2858},"Authorization: Bearer",{"type":48,"value":2860}," — the gateway model passthrough rejects bearer-only auth, typically with a ",{"type":42,"tag":61,"props":2862,"children":2864},{"className":2863},[],[2865],{"type":48,"value":2866},"401",{"type":48,"value":2868}," (\"missing subscription key\") or a misleading ",{"type":42,"tag":99,"props":2870,"children":2871},{},[2872],{"type":42,"tag":61,"props":2873,"children":2875},{"className":2874},[],[2876],{"type":48,"value":1697},{"type":48,"value":2878}," error. If your client insists on an ",{"type":42,"tag":61,"props":2880,"children":2882},{"className":2881},[],[2883],{"type":48,"value":2884},"api_key",{"type":48,"value":2886}," field (many do), still set the ",{"type":42,"tag":61,"props":2888,"children":2890},{"className":2889},[],[2891],{"type":48,"value":2067},{"type":48,"value":2893}," header explicitly.",{"type":42,"tag":111,"props":2895,"children":2896},{},[2897,2902,2904,2912,2913,2918,2920,2925,2926,2931,2933,2939,2941,2946],{"type":42,"tag":99,"props":2898,"children":2899},{},[2900],{"type":48,"value":2901},"Model identifier:",{"type":48,"value":2903}," use the selected model's ",{"type":42,"tag":99,"props":2905,"children":2906},{},[2907],{"type":42,"tag":61,"props":2908,"children":2910},{"className":2909},[],[2911],{"type":48,"value":1594},{"type":48,"value":504},{"type":42,"tag":61,"props":2914,"children":2916},{"className":2915},[],[2917],{"type":48,"value":1644},{"type":48,"value":2919},") exactly — same dots, casing, and punctuation. Prefer it over the ARM resource ",{"type":42,"tag":61,"props":2921,"children":2923},{"className":2922},[],[2924],{"type":48,"value":1611},{"type":48,"value":504},{"type":42,"tag":61,"props":2927,"children":2929},{"className":2928},[],[2930],{"type":48,"value":1679},{"type":48,"value":2932},") or ",{"type":42,"tag":61,"props":2934,"children":2936},{"className":2935},[],[2937],{"type":48,"value":2938},"displayName",{"type":48,"value":2940},", which may be rejected with ",{"type":42,"tag":61,"props":2942,"children":2944},{"className":2943},[],[2945],{"type":48,"value":1697},{"type":48,"value":2947}," on some gateways.",{"type":42,"tag":2949,"props":2950,"children":2951},"h4",{"id":936},[2952],{"type":48,"value":936},{"type":42,"tag":433,"props":2954,"children":2956},{"className":698,"code":2955,"language":700,"meta":441,"style":441},"curl \"$AI_GATEWAY_HOST\u002Fdefault\u002Fmodels\u002Fopenai\u002Fv1\u002Fchat\u002Fcompletions\" \\\n  -H \"Content-Type: application\u002Fjson\" \\\n  -H \"Api-Key: $AI_GATEWAY_API_KEY\" \\\n  -d '{\n    \"model\": \"\u003Cproperties.deployment.modelName>\",\n    \"messages\": [{ \"role\": \"user\", \"content\": \"Hello!\" }]\n  }'\n",[2957],{"type":42,"tag":61,"props":2958,"children":2959},{"__ignoreMap":441},[2960,2988,3011,3039,3055,3063,3071],{"type":42,"tag":706,"props":2961,"children":2962},{"class":708,"line":709},[2963,2967,2971,2976,2980,2984],{"type":42,"tag":706,"props":2964,"children":2965},{"style":779},[2966],{"type":48,"value":936},{"type":42,"tag":706,"props":2968,"children":2969},{"style":718},[2970],{"type":48,"value":880},{"type":42,"tag":706,"props":2972,"children":2973},{"style":713},[2974],{"type":48,"value":2975},"$AI_GATEWAY_HOST",{"type":42,"tag":706,"props":2977,"children":2978},{"style":729},[2979],{"type":48,"value":1478},{"type":42,"tag":706,"props":2981,"children":2982},{"style":718},[2983],{"type":48,"value":726},{"type":42,"tag":706,"props":2985,"children":2986},{"style":713},[2987],{"type":48,"value":1079},{"type":42,"tag":706,"props":2989,"children":2990},{"class":708,"line":740},[2991,2995,2999,3003,3007],{"type":42,"tag":706,"props":2992,"children":2993},{"style":729},[2994],{"type":48,"value":1495},{"type":42,"tag":706,"props":2996,"children":2997},{"style":718},[2998],{"type":48,"value":880},{"type":42,"tag":706,"props":3000,"children":3001},{"style":729},[3002],{"type":48,"value":1526},{"type":42,"tag":706,"props":3004,"children":3005},{"style":718},[3006],{"type":48,"value":726},{"type":42,"tag":706,"props":3008,"children":3009},{"style":713},[3010],{"type":48,"value":1079},{"type":42,"tag":706,"props":3012,"children":3013},{"class":708,"line":765},[3014,3018,3022,3026,3031,3035],{"type":42,"tag":706,"props":3015,"children":3016},{"style":729},[3017],{"type":48,"value":1495},{"type":42,"tag":706,"props":3019,"children":3020},{"style":718},[3021],{"type":48,"value":880},{"type":42,"tag":706,"props":3023,"children":3024},{"style":729},[3025],{"type":48,"value":1504},{"type":42,"tag":706,"props":3027,"children":3028},{"style":713},[3029],{"type":48,"value":3030},"$AI_GATEWAY_API_KEY",{"type":42,"tag":706,"props":3032,"children":3033},{"style":718},[3034],{"type":48,"value":726},{"type":42,"tag":706,"props":3036,"children":3037},{"style":713},[3038],{"type":48,"value":1079},{"type":42,"tag":706,"props":3040,"children":3041},{"class":708,"line":829},[3042,3046,3050],{"type":42,"tag":706,"props":3043,"children":3044},{"style":729},[3045],{"type":48,"value":1543},{"type":42,"tag":706,"props":3047,"children":3048},{"style":718},[3049],{"type":48,"value":998},{"type":42,"tag":706,"props":3051,"children":3052},{"style":729},[3053],{"type":48,"value":3054},"{\n",{"type":42,"tag":706,"props":3056,"children":3057},{"class":708,"line":859},[3058],{"type":42,"tag":706,"props":3059,"children":3060},{"style":729},[3061],{"type":48,"value":3062},"    \"model\": \"\u003Cproperties.deployment.modelName>\",\n",{"type":42,"tag":706,"props":3064,"children":3065},{"class":708,"line":901},[3066],{"type":42,"tag":706,"props":3067,"children":3068},{"style":729},[3069],{"type":48,"value":3070},"    \"messages\": [{ \"role\": \"user\", \"content\": \"Hello!\" }]\n",{"type":42,"tag":706,"props":3072,"children":3073},{"class":708,"line":911},[3074,3079],{"type":42,"tag":706,"props":3075,"children":3076},{"style":729},[3077],{"type":48,"value":3078},"  }",{"type":42,"tag":706,"props":3080,"children":3081},{"style":718},[3082],{"type":48,"value":1110},{"type":42,"tag":2949,"props":3084,"children":3086},{"id":3085},"python-openai-sdk",[3087],{"type":48,"value":3088},"Python (openai SDK)",{"type":42,"tag":433,"props":3090,"children":3094},{"className":3091,"code":3092,"language":3093,"meta":441,"style":441},"language-python shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","import os\nfrom openai import OpenAI\n\nclient = OpenAI(\n    base_url=f\"{os.environ['AI_GATEWAY_HOST']}\u002Fdefault\u002Fmodels\u002Fopenai\u002Fv1\",\n    api_key=os.environ[\"AI_GATEWAY_API_KEY\"],\n    # The gateway authenticates via the Api-Key header, not Authorization: Bearer.\n    default_headers={\"Api-Key\": os.environ[\"AI_GATEWAY_API_KEY\"]},\n)\n\nresp = client.chat.completions.create(\n    model=\"\u003Cproperties.deployment.modelName>\",  # e.g. \"gpt-5.4-nano\"\n    messages=[{\"role\": \"user\", \"content\": \"Hello!\"}],\n)\nprint(resp.choices[0].message.content)\n","python",[3095],{"type":42,"tag":61,"props":3096,"children":3097},{"__ignoreMap":441},[3098,3106,3114,3121,3129,3137,3145,3153,3161,3168,3175,3183,3191,3199,3206],{"type":42,"tag":706,"props":3099,"children":3100},{"class":708,"line":709},[3101],{"type":42,"tag":706,"props":3102,"children":3103},{},[3104],{"type":48,"value":3105},"import os\n",{"type":42,"tag":706,"props":3107,"children":3108},{"class":708,"line":740},[3109],{"type":42,"tag":706,"props":3110,"children":3111},{},[3112],{"type":48,"value":3113},"from openai import OpenAI\n",{"type":42,"tag":706,"props":3115,"children":3116},{"class":708,"line":765},[3117],{"type":42,"tag":706,"props":3118,"children":3119},{"emptyLinePlaceholder":905},[3120],{"type":48,"value":908},{"type":42,"tag":706,"props":3122,"children":3123},{"class":708,"line":829},[3124],{"type":42,"tag":706,"props":3125,"children":3126},{},[3127],{"type":48,"value":3128},"client = OpenAI(\n",{"type":42,"tag":706,"props":3130,"children":3131},{"class":708,"line":859},[3132],{"type":42,"tag":706,"props":3133,"children":3134},{},[3135],{"type":48,"value":3136},"    base_url=f\"{os.environ['AI_GATEWAY_HOST']}\u002Fdefault\u002Fmodels\u002Fopenai\u002Fv1\",\n",{"type":42,"tag":706,"props":3138,"children":3139},{"class":708,"line":901},[3140],{"type":42,"tag":706,"props":3141,"children":3142},{},[3143],{"type":48,"value":3144},"    api_key=os.environ[\"AI_GATEWAY_API_KEY\"],\n",{"type":42,"tag":706,"props":3146,"children":3147},{"class":708,"line":911},[3148],{"type":42,"tag":706,"props":3149,"children":3150},{},[3151],{"type":48,"value":3152},"    # The gateway authenticates via the Api-Key header, not Authorization: Bearer.\n",{"type":42,"tag":706,"props":3154,"children":3155},{"class":708,"line":921},[3156],{"type":42,"tag":706,"props":3157,"children":3158},{},[3159],{"type":48,"value":3160},"    default_headers={\"Api-Key\": os.environ[\"AI_GATEWAY_API_KEY\"]},\n",{"type":42,"tag":706,"props":3162,"children":3163},{"class":708,"line":1015},[3164],{"type":42,"tag":706,"props":3165,"children":3166},{},[3167],{"type":48,"value":826},{"type":42,"tag":706,"props":3169,"children":3170},{"class":708,"line":1023},[3171],{"type":42,"tag":706,"props":3172,"children":3173},{"emptyLinePlaceholder":905},[3174],{"type":48,"value":908},{"type":42,"tag":706,"props":3176,"children":3177},{"class":708,"line":1032},[3178],{"type":42,"tag":706,"props":3179,"children":3180},{},[3181],{"type":48,"value":3182},"resp = client.chat.completions.create(\n",{"type":42,"tag":706,"props":3184,"children":3185},{"class":708,"line":1082},[3186],{"type":42,"tag":706,"props":3187,"children":3188},{},[3189],{"type":48,"value":3190},"    model=\"\u003Cproperties.deployment.modelName>\",  # e.g. \"gpt-5.4-nano\"\n",{"type":42,"tag":706,"props":3192,"children":3193},{"class":708,"line":1113},[3194],{"type":42,"tag":706,"props":3195,"children":3196},{},[3197],{"type":48,"value":3198},"    messages=[{\"role\": \"user\", \"content\": \"Hello!\"}],\n",{"type":42,"tag":706,"props":3200,"children":3201},{"class":708,"line":1121},[3202],{"type":42,"tag":706,"props":3203,"children":3204},{},[3205],{"type":48,"value":826},{"type":42,"tag":706,"props":3207,"children":3208},{"class":708,"line":1130},[3209],{"type":42,"tag":706,"props":3210,"children":3211},{},[3212],{"type":48,"value":3213},"print(resp.choices[0].message.content)\n",{"type":42,"tag":2949,"props":3215,"children":3217},{"id":3216},"typescript-javascript-openai-sdk",[3218],{"type":48,"value":3219},"TypeScript \u002F JavaScript (openai SDK)",{"type":42,"tag":433,"props":3221,"children":3225},{"className":3222,"code":3223,"language":3224,"meta":441,"style":441},"language-ts shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","import OpenAI from \"openai\";\n\nconst client = new OpenAI({\n  baseURL: `${process.env.AI_GATEWAY_HOST}\u002Fdefault\u002Fmodels\u002Fopenai\u002Fv1`,\n  apiKey: process.env.AI_GATEWAY_API_KEY!,\n  \u002F\u002F The gateway authenticates via the Api-Key header, not Authorization: Bearer.\n  defaultHeaders: { \"Api-Key\": process.env.AI_GATEWAY_API_KEY! },\n});\n\nconst resp = await client.chat.completions.create({\n  model: \"\u003Cproperties.deployment.modelName>\", \u002F\u002F e.g. \"gpt-5.4-nano\"\n  messages: [{ role: \"user\", content: \"Hello!\" }],\n});\nconsole.log(resp.choices[0].message.content);\n","ts",[3226],{"type":42,"tag":61,"props":3227,"children":3228},{"__ignoreMap":441},[3229,3266,3273,3310,3371,3409,3417,3480,3495,3502,3563,3597,3680,3695],{"type":42,"tag":706,"props":3230,"children":3231},{"class":708,"line":709},[3232,3238,3243,3248,3252,3257,3261],{"type":42,"tag":706,"props":3233,"children":3235},{"style":3234},"--shiki-light:#39ADB5;--shiki-light-font-style:italic;--shiki-default:#89DDFF;--shiki-default-font-style:italic;--shiki-dark:#89DDFF;--shiki-dark-font-style:italic",[3236],{"type":48,"value":3237},"import",{"type":42,"tag":706,"props":3239,"children":3240},{"style":713},[3241],{"type":48,"value":3242}," OpenAI ",{"type":42,"tag":706,"props":3244,"children":3245},{"style":3234},[3246],{"type":48,"value":3247},"from",{"type":42,"tag":706,"props":3249,"children":3250},{"style":718},[3251],{"type":48,"value":880},{"type":42,"tag":706,"props":3253,"children":3254},{"style":729},[3255],{"type":48,"value":3256},"openai",{"type":42,"tag":706,"props":3258,"children":3259},{"style":718},[3260],{"type":48,"value":726},{"type":42,"tag":706,"props":3262,"children":3263},{"style":718},[3264],{"type":48,"value":3265},";\n",{"type":42,"tag":706,"props":3267,"children":3268},{"class":708,"line":740},[3269],{"type":42,"tag":706,"props":3270,"children":3271},{"emptyLinePlaceholder":905},[3272],{"type":48,"value":908},{"type":42,"tag":706,"props":3274,"children":3275},{"class":708,"line":765},[3276,3281,3286,3290,3295,3301,3306],{"type":42,"tag":706,"props":3277,"children":3278},{"style":2265},[3279],{"type":48,"value":3280},"const",{"type":42,"tag":706,"props":3282,"children":3283},{"style":713},[3284],{"type":48,"value":3285}," client ",{"type":42,"tag":706,"props":3287,"children":3288},{"style":718},[3289],{"type":48,"value":721},{"type":42,"tag":706,"props":3291,"children":3292},{"style":718},[3293],{"type":48,"value":3294}," new",{"type":42,"tag":706,"props":3296,"children":3298},{"style":3297},"--shiki-light:#6182B8;--shiki-default:#82AAFF;--shiki-dark:#82AAFF",[3299],{"type":48,"value":3300}," OpenAI",{"type":42,"tag":706,"props":3302,"children":3303},{"style":713},[3304],{"type":48,"value":3305},"(",{"type":42,"tag":706,"props":3307,"children":3308},{"style":718},[3309],{"type":48,"value":3054},{"type":42,"tag":706,"props":3311,"children":3312},{"class":708,"line":829},[3313,3319,3323,3328,3333,3337,3342,3346,3351,3356,3361,3366],{"type":42,"tag":706,"props":3314,"children":3316},{"style":3315},"--shiki-light:#E53935;--shiki-default:#F07178;--shiki-dark:#F07178",[3317],{"type":48,"value":3318},"  baseURL",{"type":42,"tag":706,"props":3320,"children":3321},{"style":718},[3322],{"type":48,"value":695},{"type":42,"tag":706,"props":3324,"children":3325},{"style":718},[3326],{"type":48,"value":3327}," `${",{"type":42,"tag":706,"props":3329,"children":3330},{"style":713},[3331],{"type":48,"value":3332},"process",{"type":42,"tag":706,"props":3334,"children":3335},{"style":718},[3336],{"type":48,"value":587},{"type":42,"tag":706,"props":3338,"children":3339},{"style":713},[3340],{"type":48,"value":3341},"env",{"type":42,"tag":706,"props":3343,"children":3344},{"style":718},[3345],{"type":48,"value":587},{"type":42,"tag":706,"props":3347,"children":3348},{"style":713},[3349],{"type":48,"value":3350},"AI_GATEWAY_HOST",{"type":42,"tag":706,"props":3352,"children":3353},{"style":718},[3354],{"type":48,"value":3355},"}",{"type":42,"tag":706,"props":3357,"children":3358},{"style":729},[3359],{"type":48,"value":3360},"\u002Fdefault\u002Fmodels\u002Fopenai\u002Fv1",{"type":42,"tag":706,"props":3362,"children":3363},{"style":718},[3364],{"type":48,"value":3365},"`",{"type":42,"tag":706,"props":3367,"children":3368},{"style":718},[3369],{"type":48,"value":3370},",\n",{"type":42,"tag":706,"props":3372,"children":3373},{"class":708,"line":859},[3374,3379,3383,3388,3392,3396,3400,3404],{"type":42,"tag":706,"props":3375,"children":3376},{"style":3315},[3377],{"type":48,"value":3378},"  apiKey",{"type":42,"tag":706,"props":3380,"children":3381},{"style":718},[3382],{"type":48,"value":695},{"type":42,"tag":706,"props":3384,"children":3385},{"style":713},[3386],{"type":48,"value":3387}," process",{"type":42,"tag":706,"props":3389,"children":3390},{"style":718},[3391],{"type":48,"value":587},{"type":42,"tag":706,"props":3393,"children":3394},{"style":713},[3395],{"type":48,"value":3341},{"type":42,"tag":706,"props":3397,"children":3398},{"style":718},[3399],{"type":48,"value":587},{"type":42,"tag":706,"props":3401,"children":3402},{"style":713},[3403],{"type":48,"value":2520},{"type":42,"tag":706,"props":3405,"children":3406},{"style":718},[3407],{"type":48,"value":3408},"!,\n",{"type":42,"tag":706,"props":3410,"children":3411},{"class":708,"line":901},[3412],{"type":42,"tag":706,"props":3413,"children":3414},{"style":915},[3415],{"type":48,"value":3416},"  \u002F\u002F The gateway authenticates via the Api-Key header, not Authorization: Bearer.\n",{"type":42,"tag":706,"props":3418,"children":3419},{"class":708,"line":911},[3420,3425,3429,3434,3438,3442,3446,3450,3454,3458,3462,3466,3470,3475],{"type":42,"tag":706,"props":3421,"children":3422},{"style":3315},[3423],{"type":48,"value":3424},"  defaultHeaders",{"type":42,"tag":706,"props":3426,"children":3427},{"style":718},[3428],{"type":48,"value":695},{"type":42,"tag":706,"props":3430,"children":3431},{"style":718},[3432],{"type":48,"value":3433}," {",{"type":42,"tag":706,"props":3435,"children":3436},{"style":718},[3437],{"type":48,"value":880},{"type":42,"tag":706,"props":3439,"children":3440},{"style":3315},[3441],{"type":48,"value":2067},{"type":42,"tag":706,"props":3443,"children":3444},{"style":718},[3445],{"type":48,"value":726},{"type":42,"tag":706,"props":3447,"children":3448},{"style":718},[3449],{"type":48,"value":695},{"type":42,"tag":706,"props":3451,"children":3452},{"style":713},[3453],{"type":48,"value":3387},{"type":42,"tag":706,"props":3455,"children":3456},{"style":718},[3457],{"type":48,"value":587},{"type":42,"tag":706,"props":3459,"children":3460},{"style":713},[3461],{"type":48,"value":3341},{"type":42,"tag":706,"props":3463,"children":3464},{"style":718},[3465],{"type":48,"value":587},{"type":42,"tag":706,"props":3467,"children":3468},{"style":713},[3469],{"type":48,"value":2520},{"type":42,"tag":706,"props":3471,"children":3472},{"style":718},[3473],{"type":48,"value":3474},"!",{"type":42,"tag":706,"props":3476,"children":3477},{"style":718},[3478],{"type":48,"value":3479}," },\n",{"type":42,"tag":706,"props":3481,"children":3482},{"class":708,"line":921},[3483,3487,3491],{"type":42,"tag":706,"props":3484,"children":3485},{"style":718},[3486],{"type":48,"value":3355},{"type":42,"tag":706,"props":3488,"children":3489},{"style":713},[3490],{"type":48,"value":2665},{"type":42,"tag":706,"props":3492,"children":3493},{"style":718},[3494],{"type":48,"value":3265},{"type":42,"tag":706,"props":3496,"children":3497},{"class":708,"line":1015},[3498],{"type":42,"tag":706,"props":3499,"children":3500},{"emptyLinePlaceholder":905},[3501],{"type":48,"value":908},{"type":42,"tag":706,"props":3503,"children":3504},{"class":708,"line":1023},[3505,3509,3514,3518,3523,3528,3532,3537,3541,3546,3550,3555,3559],{"type":42,"tag":706,"props":3506,"children":3507},{"style":2265},[3508],{"type":48,"value":3280},{"type":42,"tag":706,"props":3510,"children":3511},{"style":713},[3512],{"type":48,"value":3513}," resp ",{"type":42,"tag":706,"props":3515,"children":3516},{"style":718},[3517],{"type":48,"value":721},{"type":42,"tag":706,"props":3519,"children":3520},{"style":3234},[3521],{"type":48,"value":3522}," await",{"type":42,"tag":706,"props":3524,"children":3525},{"style":713},[3526],{"type":48,"value":3527}," client",{"type":42,"tag":706,"props":3529,"children":3530},{"style":718},[3531],{"type":48,"value":587},{"type":42,"tag":706,"props":3533,"children":3534},{"style":713},[3535],{"type":48,"value":3536},"chat",{"type":42,"tag":706,"props":3538,"children":3539},{"style":718},[3540],{"type":48,"value":587},{"type":42,"tag":706,"props":3542,"children":3543},{"style":713},[3544],{"type":48,"value":3545},"completions",{"type":42,"tag":706,"props":3547,"children":3548},{"style":718},[3549],{"type":48,"value":587},{"type":42,"tag":706,"props":3551,"children":3552},{"style":3297},[3553],{"type":48,"value":3554},"create",{"type":42,"tag":706,"props":3556,"children":3557},{"style":713},[3558],{"type":48,"value":3305},{"type":42,"tag":706,"props":3560,"children":3561},{"style":718},[3562],{"type":48,"value":3054},{"type":42,"tag":706,"props":3564,"children":3565},{"class":708,"line":1032},[3566,3571,3575,3579,3584,3588,3592],{"type":42,"tag":706,"props":3567,"children":3568},{"style":3315},[3569],{"type":48,"value":3570},"  model",{"type":42,"tag":706,"props":3572,"children":3573},{"style":718},[3574],{"type":48,"value":695},{"type":42,"tag":706,"props":3576,"children":3577},{"style":718},[3578],{"type":48,"value":880},{"type":42,"tag":706,"props":3580,"children":3581},{"style":729},[3582],{"type":48,"value":3583},"\u003Cproperties.deployment.modelName>",{"type":42,"tag":706,"props":3585,"children":3586},{"style":718},[3587],{"type":48,"value":726},{"type":42,"tag":706,"props":3589,"children":3590},{"style":718},[3591],{"type":48,"value":2293},{"type":42,"tag":706,"props":3593,"children":3594},{"style":915},[3595],{"type":48,"value":3596}," \u002F\u002F e.g. \"gpt-5.4-nano\"\n",{"type":42,"tag":706,"props":3598,"children":3599},{"class":708,"line":1082},[3600,3605,3609,3614,3618,3623,3627,3631,3636,3640,3644,3649,3653,3657,3662,3666,3671,3676],{"type":42,"tag":706,"props":3601,"children":3602},{"style":3315},[3603],{"type":48,"value":3604},"  messages",{"type":42,"tag":706,"props":3606,"children":3607},{"style":718},[3608],{"type":48,"value":695},{"type":42,"tag":706,"props":3610,"children":3611},{"style":713},[3612],{"type":48,"value":3613}," [",{"type":42,"tag":706,"props":3615,"children":3616},{"style":718},[3617],{"type":48,"value":2258},{"type":42,"tag":706,"props":3619,"children":3620},{"style":3315},[3621],{"type":48,"value":3622}," role",{"type":42,"tag":706,"props":3624,"children":3625},{"style":718},[3626],{"type":48,"value":695},{"type":42,"tag":706,"props":3628,"children":3629},{"style":718},[3630],{"type":48,"value":880},{"type":42,"tag":706,"props":3632,"children":3633},{"style":729},[3634],{"type":48,"value":3635},"user",{"type":42,"tag":706,"props":3637,"children":3638},{"style":718},[3639],{"type":48,"value":726},{"type":42,"tag":706,"props":3641,"children":3642},{"style":718},[3643],{"type":48,"value":2293},{"type":42,"tag":706,"props":3645,"children":3646},{"style":3315},[3647],{"type":48,"value":3648}," content",{"type":42,"tag":706,"props":3650,"children":3651},{"style":718},[3652],{"type":48,"value":695},{"type":42,"tag":706,"props":3654,"children":3655},{"style":718},[3656],{"type":48,"value":880},{"type":42,"tag":706,"props":3658,"children":3659},{"style":729},[3660],{"type":48,"value":3661},"Hello!",{"type":42,"tag":706,"props":3663,"children":3664},{"style":718},[3665],{"type":48,"value":726},{"type":42,"tag":706,"props":3667,"children":3668},{"style":718},[3669],{"type":48,"value":3670}," }",{"type":42,"tag":706,"props":3672,"children":3673},{"style":713},[3674],{"type":48,"value":3675},"]",{"type":42,"tag":706,"props":3677,"children":3678},{"style":718},[3679],{"type":48,"value":3370},{"type":42,"tag":706,"props":3681,"children":3682},{"class":708,"line":1113},[3683,3687,3691],{"type":42,"tag":706,"props":3684,"children":3685},{"style":718},[3686],{"type":48,"value":3355},{"type":42,"tag":706,"props":3688,"children":3689},{"style":713},[3690],{"type":48,"value":2665},{"type":42,"tag":706,"props":3692,"children":3693},{"style":718},[3694],{"type":48,"value":3265},{"type":42,"tag":706,"props":3696,"children":3697},{"class":708,"line":1121},[3698,3703,3707,3712,3717,3721,3726,3732,3736,3740,3745,3749,3754],{"type":42,"tag":706,"props":3699,"children":3700},{"style":713},[3701],{"type":48,"value":3702},"console",{"type":42,"tag":706,"props":3704,"children":3705},{"style":718},[3706],{"type":48,"value":587},{"type":42,"tag":706,"props":3708,"children":3709},{"style":3297},[3710],{"type":48,"value":3711},"log",{"type":42,"tag":706,"props":3713,"children":3714},{"style":713},[3715],{"type":48,"value":3716},"(resp",{"type":42,"tag":706,"props":3718,"children":3719},{"style":718},[3720],{"type":48,"value":587},{"type":42,"tag":706,"props":3722,"children":3723},{"style":713},[3724],{"type":48,"value":3725},"choices[",{"type":42,"tag":706,"props":3727,"children":3729},{"style":3728},"--shiki-light:#F76D47;--shiki-default:#F78C6C;--shiki-dark:#F78C6C",[3730],{"type":48,"value":3731},"0",{"type":42,"tag":706,"props":3733,"children":3734},{"style":713},[3735],{"type":48,"value":3675},{"type":42,"tag":706,"props":3737,"children":3738},{"style":718},[3739],{"type":48,"value":587},{"type":42,"tag":706,"props":3741,"children":3742},{"style":713},[3743],{"type":48,"value":3744},"message",{"type":42,"tag":706,"props":3746,"children":3747},{"style":718},[3748],{"type":48,"value":587},{"type":42,"tag":706,"props":3750,"children":3751},{"style":713},[3752],{"type":48,"value":3753},"content)",{"type":42,"tag":706,"props":3755,"children":3756},{"style":718},[3757],{"type":48,"value":3265},{"type":42,"tag":51,"props":3759,"children":3760},{},[3761],{"type":42,"tag":55,"props":3762,"children":3763},{},[3764,3766,3771,3773,3779],{"type":48,"value":3765},"The passthrough is OpenAI-compatible, so streaming, tools\u002Ffunction-calling, and other OpenAI request fields work as usual — just keep the ",{"type":42,"tag":61,"props":3767,"children":3769},{"className":3768},[],[3770],{"type":48,"value":2067},{"type":48,"value":3772}," header and the exact ",{"type":42,"tag":61,"props":3774,"children":3776},{"className":3775},[],[3777],{"type":48,"value":3778},"modelName",{"type":48,"value":587},{"type":42,"tag":2949,"props":3781,"children":3783},{"id":3782},"other-protocols-only-when-the-models-supportedendpoints-says-so",[3784,3786,3791],{"type":48,"value":3785},"Other protocols (only when the model's ",{"type":42,"tag":61,"props":3787,"children":3789},{"className":3788},[],[3790],{"type":48,"value":1922},{"type":48,"value":3792}," says so)",{"type":42,"tag":55,"props":3794,"children":3795},{},[3796,3798,3803,3804,3809,3811,3816,3818,3823,3825,3830,3832,3837],{"type":48,"value":3797},"If the selected model exposes ",{"type":42,"tag":61,"props":3799,"children":3801},{"className":3800},[],[3802],{"type":48,"value":1872},{"type":48,"value":1646},{"type":42,"tag":61,"props":3805,"children":3807},{"className":3806},[],[3808],{"type":48,"value":637},{"type":48,"value":3810}," instead of ",{"type":42,"tag":61,"props":3812,"children":3814},{"className":3813},[],[3815],{"type":48,"value":1850},{"type":48,"value":3817},", use that protocol's request shape (same ",{"type":42,"tag":61,"props":3819,"children":3821},{"className":3820},[],[3822],{"type":48,"value":2067},{"type":48,"value":3824}," header, same exact ",{"type":42,"tag":61,"props":3826,"children":3828},{"className":3827},[],[3829],{"type":48,"value":3778},{"type":48,"value":3831},", same ",{"type":42,"tag":61,"props":3833,"children":3835},{"className":3834},[],[3836],{"type":48,"value":598},{"type":48,"value":3838}," prefix):",{"type":42,"tag":433,"props":3840,"children":3842},{"className":698,"code":3841,"language":700,"meta":441,"style":441},"# OpenAI Responses model (supportedEndpoints contains \u002Fopenai\u002Fv1\u002Fresponses)\ncurl \"$AI_GATEWAY_HOST\u002Fdefault\u002Fmodels\u002Fopenai\u002Fv1\u002Fresponses\" \\\n  -H \"Content-Type: application\u002Fjson\" -H \"Api-Key: $AI_GATEWAY_API_KEY\" \\\n  -d '{\"model\":\"\u003Cproperties.deployment.modelName>\",\"input\":\"Hello!\"}'\n\n# Anthropic Messages model (supportedEndpoints contains \u002Fanthropic\u002Fv1\u002Fmessages)\ncurl \"$AI_GATEWAY_HOST\u002Fdefault\u002Fmodels\u002Fanthropic\u002Fv1\u002Fmessages\" \\\n  -H \"Content-Type: application\u002Fjson\" -H \"Api-Key: $AI_GATEWAY_API_KEY\" \\\n  -H \"anthropic-version: 2023-06-01\" \\\n  -d '{\"model\":\"\u003Cproperties.deployment.modelName>\",\"max_tokens\":16,\"messages\":[{\"role\":\"user\",\"content\":\"Hello!\"}]}'\n",[3843],{"type":42,"tag":61,"props":3844,"children":3845},{"__ignoreMap":441},[3846,3854,3882,3925,3945,3952,3960,3988,4031,4055],{"type":42,"tag":706,"props":3847,"children":3848},{"class":708,"line":709},[3849],{"type":42,"tag":706,"props":3850,"children":3851},{"style":915},[3852],{"type":48,"value":3853},"# OpenAI Responses model (supportedEndpoints contains \u002Fopenai\u002Fv1\u002Fresponses)\n",{"type":42,"tag":706,"props":3855,"children":3856},{"class":708,"line":740},[3857,3861,3865,3869,3874,3878],{"type":42,"tag":706,"props":3858,"children":3859},{"style":779},[3860],{"type":48,"value":936},{"type":42,"tag":706,"props":3862,"children":3863},{"style":718},[3864],{"type":48,"value":880},{"type":42,"tag":706,"props":3866,"children":3867},{"style":713},[3868],{"type":48,"value":2975},{"type":42,"tag":706,"props":3870,"children":3871},{"style":729},[3872],{"type":48,"value":3873},"\u002Fdefault\u002Fmodels\u002Fopenai\u002Fv1\u002Fresponses",{"type":42,"tag":706,"props":3875,"children":3876},{"style":718},[3877],{"type":48,"value":726},{"type":42,"tag":706,"props":3879,"children":3880},{"style":713},[3881],{"type":48,"value":1079},{"type":42,"tag":706,"props":3883,"children":3884},{"class":708,"line":765},[3885,3889,3893,3897,3901,3905,3909,3913,3917,3921],{"type":42,"tag":706,"props":3886,"children":3887},{"style":729},[3888],{"type":48,"value":1495},{"type":42,"tag":706,"props":3890,"children":3891},{"style":718},[3892],{"type":48,"value":880},{"type":42,"tag":706,"props":3894,"children":3895},{"style":729},[3896],{"type":48,"value":1526},{"type":42,"tag":706,"props":3898,"children":3899},{"style":718},[3900],{"type":48,"value":726},{"type":42,"tag":706,"props":3902,"children":3903},{"style":729},[3904],{"type":48,"value":1345},{"type":42,"tag":706,"props":3906,"children":3907},{"style":718},[3908],{"type":48,"value":880},{"type":42,"tag":706,"props":3910,"children":3911},{"style":729},[3912],{"type":48,"value":1504},{"type":42,"tag":706,"props":3914,"children":3915},{"style":713},[3916],{"type":48,"value":3030},{"type":42,"tag":706,"props":3918,"children":3919},{"style":718},[3920],{"type":48,"value":726},{"type":42,"tag":706,"props":3922,"children":3923},{"style":713},[3924],{"type":48,"value":1079},{"type":42,"tag":706,"props":3926,"children":3927},{"class":708,"line":829},[3928,3932,3936,3941],{"type":42,"tag":706,"props":3929,"children":3930},{"style":729},[3931],{"type":48,"value":1543},{"type":42,"tag":706,"props":3933,"children":3934},{"style":718},[3935],{"type":48,"value":998},{"type":42,"tag":706,"props":3937,"children":3938},{"style":729},[3939],{"type":48,"value":3940},"{\"model\":\"\u003Cproperties.deployment.modelName>\",\"input\":\"Hello!\"}",{"type":42,"tag":706,"props":3942,"children":3943},{"style":718},[3944],{"type":48,"value":1110},{"type":42,"tag":706,"props":3946,"children":3947},{"class":708,"line":859},[3948],{"type":42,"tag":706,"props":3949,"children":3950},{"emptyLinePlaceholder":905},[3951],{"type":48,"value":908},{"type":42,"tag":706,"props":3953,"children":3954},{"class":708,"line":901},[3955],{"type":42,"tag":706,"props":3956,"children":3957},{"style":915},[3958],{"type":48,"value":3959},"# Anthropic Messages model (supportedEndpoints contains \u002Fanthropic\u002Fv1\u002Fmessages)\n",{"type":42,"tag":706,"props":3961,"children":3962},{"class":708,"line":911},[3963,3967,3971,3975,3980,3984],{"type":42,"tag":706,"props":3964,"children":3965},{"style":779},[3966],{"type":48,"value":936},{"type":42,"tag":706,"props":3968,"children":3969},{"style":718},[3970],{"type":48,"value":880},{"type":42,"tag":706,"props":3972,"children":3973},{"style":713},[3974],{"type":48,"value":2975},{"type":42,"tag":706,"props":3976,"children":3977},{"style":729},[3978],{"type":48,"value":3979},"\u002Fdefault\u002Fmodels\u002Fanthropic\u002Fv1\u002Fmessages",{"type":42,"tag":706,"props":3981,"children":3982},{"style":718},[3983],{"type":48,"value":726},{"type":42,"tag":706,"props":3985,"children":3986},{"style":713},[3987],{"type":48,"value":1079},{"type":42,"tag":706,"props":3989,"children":3990},{"class":708,"line":921},[3991,3995,3999,4003,4007,4011,4015,4019,4023,4027],{"type":42,"tag":706,"props":3992,"children":3993},{"style":729},[3994],{"type":48,"value":1495},{"type":42,"tag":706,"props":3996,"children":3997},{"style":718},[3998],{"type":48,"value":880},{"type":42,"tag":706,"props":4000,"children":4001},{"style":729},[4002],{"type":48,"value":1526},{"type":42,"tag":706,"props":4004,"children":4005},{"style":718},[4006],{"type":48,"value":726},{"type":42,"tag":706,"props":4008,"children":4009},{"style":729},[4010],{"type":48,"value":1345},{"type":42,"tag":706,"props":4012,"children":4013},{"style":718},[4014],{"type":48,"value":880},{"type":42,"tag":706,"props":4016,"children":4017},{"style":729},[4018],{"type":48,"value":1504},{"type":42,"tag":706,"props":4020,"children":4021},{"style":713},[4022],{"type":48,"value":3030},{"type":42,"tag":706,"props":4024,"children":4025},{"style":718},[4026],{"type":48,"value":726},{"type":42,"tag":706,"props":4028,"children":4029},{"style":713},[4030],{"type":48,"value":1079},{"type":42,"tag":706,"props":4032,"children":4033},{"class":708,"line":1015},[4034,4038,4042,4047,4051],{"type":42,"tag":706,"props":4035,"children":4036},{"style":729},[4037],{"type":48,"value":1495},{"type":42,"tag":706,"props":4039,"children":4040},{"style":718},[4041],{"type":48,"value":880},{"type":42,"tag":706,"props":4043,"children":4044},{"style":729},[4045],{"type":48,"value":4046},"anthropic-version: 2023-06-01",{"type":42,"tag":706,"props":4048,"children":4049},{"style":718},[4050],{"type":48,"value":726},{"type":42,"tag":706,"props":4052,"children":4053},{"style":713},[4054],{"type":48,"value":1079},{"type":42,"tag":706,"props":4056,"children":4057},{"class":708,"line":1023},[4058,4062,4066,4071],{"type":42,"tag":706,"props":4059,"children":4060},{"style":729},[4061],{"type":48,"value":1543},{"type":42,"tag":706,"props":4063,"children":4064},{"style":718},[4065],{"type":48,"value":998},{"type":42,"tag":706,"props":4067,"children":4068},{"style":729},[4069],{"type":48,"value":4070},"{\"model\":\"\u003Cproperties.deployment.modelName>\",\"max_tokens\":16,\"messages\":[{\"role\":\"user\",\"content\":\"Hello!\"}]}",{"type":42,"tag":706,"props":4072,"children":4073},{"style":718},[4074],{"type":48,"value":1110},{"type":42,"tag":55,"props":4076,"children":4077},{},[4078,4080,4085,4087,4093,4095,4101,4103,4109,4111,4116,4118,4123],{"type":48,"value":4079},"For SDKs, set the base URL per the derivation table above and keep the ",{"type":42,"tag":61,"props":4081,"children":4083},{"className":4082},[],[4084],{"type":48,"value":2067},{"type":48,"value":4086}," header: the OpenAI SDK's ",{"type":42,"tag":61,"props":4088,"children":4090},{"className":4089},[],[4091],{"type":48,"value":4092},"responses.create(...)",{"type":48,"value":4094}," targets a Responses model, and the Anthropic SDK with ",{"type":42,"tag":61,"props":4096,"children":4098},{"className":4097},[],[4099],{"type":48,"value":4100},"base_url = \u003Cmessages endpoint minus \u002Fv1\u002Fmessages>",{"type":48,"value":4102}," plus ",{"type":42,"tag":61,"props":4104,"children":4106},{"className":4105},[],[4107],{"type":48,"value":4108},"default_headers={\"Api-Key\": ...}",{"type":48,"value":4110}," targets a Messages model. Don't point an OpenAI Chat Completions client at a ",{"type":42,"tag":61,"props":4112,"children":4114},{"className":4113},[],[4115],{"type":48,"value":1872},{"type":48,"value":4117},"- or ",{"type":42,"tag":61,"props":4119,"children":4121},{"className":4120},[],[4122],{"type":48,"value":1894},{"type":48,"value":4124},"-only model (and vice versa) — the protocol must match the endpoint.",{"type":42,"tag":259,"props":4126,"children":4127},{},[],{"type":42,"tag":269,"props":4129,"children":4131},{"id":4130},"path-b-connect-to-mcp-tool-servers",[4132],{"type":48,"value":4133},"Path B — Connect to MCP tool servers",{"type":42,"tag":55,"props":4135,"children":4136},{},[4137,4139,4147],{"type":48,"value":4138},"Each registered MCP tool server is reachable at its own MCP endpoint (captured during discovery), authenticated with the same gateway key via the ",{"type":42,"tag":99,"props":4140,"children":4141},{},[4142],{"type":42,"tag":61,"props":4143,"children":4145},{"className":4144},[],[4146],{"type":48,"value":2067},{"type":48,"value":4148}," header. Use it from any MCP client:",{"type":42,"tag":152,"props":4150,"children":4151},{},[4152,4170,4187],{"type":42,"tag":111,"props":4153,"children":4154},{},[4155,4160,4162,4168],{"type":42,"tag":99,"props":4156,"children":4157},{},[4158],{"type":48,"value":4159},"Endpoint:",{"type":48,"value":4161}," the tool server's MCP URL from discovery (e.g. ",{"type":42,"tag":61,"props":4163,"children":4165},{"className":4164},[],[4166],{"type":48,"value":4167},"\u003Cai-gateway-host>\u002Fdefault\u002Ftoolservers\u002F\u003Cname>\u002Fmcp",{"type":48,"value":4169},").",{"type":42,"tag":111,"props":4171,"children":4172},{},[4173,4178,4180,4186],{"type":42,"tag":99,"props":4174,"children":4175},{},[4176],{"type":48,"value":4177},"Transport:",{"type":48,"value":4179}," streamable HTTP (",{"type":42,"tag":61,"props":4181,"children":4183},{"className":4182},[],[4184],{"type":48,"value":4185},"type: \"http\"",{"type":48,"value":4169},{"type":42,"tag":111,"props":4188,"children":4189},{},[4190,4194,4195,4200],{"type":42,"tag":99,"props":4191,"children":4192},{},[4193],{"type":48,"value":2836},{"type":48,"value":300},{"type":42,"tag":61,"props":4196,"children":4198},{"className":4197},[],[4199],{"type":48,"value":2843},{"type":48,"value":587},{"type":42,"tag":55,"props":4202,"children":4203},{},[4204,4206,4211,4212,4217,4218,4223,4225,4230,4232,4237],{"type":48,"value":4205},"To sanity-check a tool server manually, run the full MCP handshake — ",{"type":42,"tag":61,"props":4207,"children":4209},{"className":4208},[],[4210],{"type":48,"value":2091},{"type":48,"value":2358},{"type":42,"tag":61,"props":4213,"children":4215},{"className":4214},[],[4216],{"type":48,"value":2117},{"type":48,"value":2358},{"type":42,"tag":61,"props":4219,"children":4221},{"className":4220},[],[4222],{"type":48,"value":2131},{"type":48,"value":4224}," — carrying the ",{"type":42,"tag":61,"props":4226,"children":4228},{"className":4227},[],[4229],{"type":48,"value":2102},{"type":48,"value":4231}," returned by ",{"type":42,"tag":61,"props":4233,"children":4235},{"className":4234},[],[4236],{"type":48,"value":2091},{"type":48,"value":4238}," on the follow-up calls:",{"type":42,"tag":433,"props":4240,"children":4242},{"className":698,"code":4241,"language":700,"meta":441,"style":441},"# 1. initialize — capture the Mcp-Session-Id response header\nSID=$(curl -s -D - -o \u002Fdev\u002Fnull \"$TOOL_ENDPOINT\" \\\n  -H \"Content-Type: application\u002Fjson\" -H \"Accept: application\u002Fjson, text\u002Fevent-stream\" \\\n  -H \"Api-Key: $AI_GATEWAY_API_KEY\" \\\n  -d '{\"jsonrpc\":\"2.0\",\"id\":1,\"method\":\"initialize\",\"params\":{\"protocolVersion\":\"2024-11-05\",\"capabilities\":{},\"clientInfo\":{\"name\":\"probe\",\"version\":\"1.0\"}}}' \\\n  | awk -F': ' 'tolower($1)==\"mcp-session-id\"{print $2}' | tr -d '\\r')\n\n# 2. notifications\u002Finitialized\ncurl -s \"$TOOL_ENDPOINT\" -H \"Content-Type: application\u002Fjson\" \\\n  -H \"Accept: application\u002Fjson, text\u002Fevent-stream\" -H \"Api-Key: $AI_GATEWAY_API_KEY\" \\\n  ${SID:+-H \"Mcp-Session-Id: $SID\"} \\\n  -d '{\"jsonrpc\":\"2.0\",\"method\":\"notifications\u002Finitialized\"}' >\u002Fdev\u002Fnull\n\n# 3. tools\u002Flist — an empty \"tools\" array means the server exposes no usable tools\ncurl -s \"$TOOL_ENDPOINT\" -H \"Content-Type: application\u002Fjson\" \\\n  -H \"Accept: application\u002Fjson, text\u002Fevent-stream\" -H \"Api-Key: $AI_GATEWAY_API_KEY\" \\\n  ${SID:+-H \"Mcp-Session-Id: $SID\"} \\\n  -d '{\"jsonrpc\":\"2.0\",\"id\":2,\"method\":\"tools\u002Flist\",\"params\":{}}'\n",[4243],{"type":42,"tag":61,"props":4244,"children":4245},{"__ignoreMap":441},[4246,4254,4310,4349,4376,4400,4474,4481,4489,4532,4575,4622,4652,4659,4667,4710,4753,4796],{"type":42,"tag":706,"props":4247,"children":4248},{"class":708,"line":709},[4249],{"type":42,"tag":706,"props":4250,"children":4251},{"style":915},[4252],{"type":48,"value":4253},"# 1. initialize — capture the Mcp-Session-Id response header\n",{"type":42,"tag":706,"props":4255,"children":4256},{"class":708,"line":740},[4257,4262,4266,4270,4274,4279,4284,4288,4293,4297,4302,4306],{"type":42,"tag":706,"props":4258,"children":4259},{"style":713},[4260],{"type":48,"value":4261},"SID",{"type":42,"tag":706,"props":4263,"children":4264},{"style":718},[4265],{"type":48,"value":776},{"type":42,"tag":706,"props":4267,"children":4268},{"style":779},[4269],{"type":48,"value":936},{"type":42,"tag":706,"props":4271,"children":4272},{"style":729},[4273],{"type":48,"value":941},{"type":42,"tag":706,"props":4275,"children":4276},{"style":729},[4277],{"type":48,"value":4278}," -D",{"type":42,"tag":706,"props":4280,"children":4281},{"style":729},[4282],{"type":48,"value":4283}," -",{"type":42,"tag":706,"props":4285,"children":4286},{"style":729},[4287],{"type":48,"value":816},{"type":42,"tag":706,"props":4289,"children":4290},{"style":729},[4291],{"type":48,"value":4292}," \u002Fdev\u002Fnull",{"type":42,"tag":706,"props":4294,"children":4295},{"style":718},[4296],{"type":48,"value":880},{"type":42,"tag":706,"props":4298,"children":4299},{"style":713},[4300],{"type":48,"value":4301},"$TOOL_ENDPOINT",{"type":42,"tag":706,"props":4303,"children":4304},{"style":718},[4305],{"type":48,"value":726},{"type":42,"tag":706,"props":4307,"children":4308},{"style":713},[4309],{"type":48,"value":1079},{"type":42,"tag":706,"props":4311,"children":4312},{"class":708,"line":765},[4313,4317,4321,4325,4329,4333,4337,4341,4345],{"type":42,"tag":706,"props":4314,"children":4315},{"style":729},[4316],{"type":48,"value":1495},{"type":42,"tag":706,"props":4318,"children":4319},{"style":718},[4320],{"type":48,"value":880},{"type":42,"tag":706,"props":4322,"children":4323},{"style":729},[4324],{"type":48,"value":1526},{"type":42,"tag":706,"props":4326,"children":4327},{"style":718},[4328],{"type":48,"value":726},{"type":42,"tag":706,"props":4330,"children":4331},{"style":729},[4332],{"type":48,"value":1345},{"type":42,"tag":706,"props":4334,"children":4335},{"style":718},[4336],{"type":48,"value":880},{"type":42,"tag":706,"props":4338,"children":4339},{"style":729},[4340],{"type":48,"value":2075},{"type":42,"tag":706,"props":4342,"children":4343},{"style":718},[4344],{"type":48,"value":726},{"type":42,"tag":706,"props":4346,"children":4347},{"style":713},[4348],{"type":48,"value":1079},{"type":42,"tag":706,"props":4350,"children":4351},{"class":708,"line":829},[4352,4356,4360,4364,4368,4372],{"type":42,"tag":706,"props":4353,"children":4354},{"style":729},[4355],{"type":48,"value":1495},{"type":42,"tag":706,"props":4357,"children":4358},{"style":718},[4359],{"type":48,"value":880},{"type":42,"tag":706,"props":4361,"children":4362},{"style":729},[4363],{"type":48,"value":1504},{"type":42,"tag":706,"props":4365,"children":4366},{"style":713},[4367],{"type":48,"value":3030},{"type":42,"tag":706,"props":4369,"children":4370},{"style":718},[4371],{"type":48,"value":726},{"type":42,"tag":706,"props":4373,"children":4374},{"style":713},[4375],{"type":48,"value":1079},{"type":42,"tag":706,"props":4377,"children":4378},{"class":708,"line":859},[4379,4383,4387,4392,4396],{"type":42,"tag":706,"props":4380,"children":4381},{"style":729},[4382],{"type":48,"value":1543},{"type":42,"tag":706,"props":4384,"children":4385},{"style":718},[4386],{"type":48,"value":998},{"type":42,"tag":706,"props":4388,"children":4389},{"style":729},[4390],{"type":48,"value":4391},"{\"jsonrpc\":\"2.0\",\"id\":1,\"method\":\"initialize\",\"params\":{\"protocolVersion\":\"2024-11-05\",\"capabilities\":{},\"clientInfo\":{\"name\":\"probe\",\"version\":\"1.0\"}}}",{"type":42,"tag":706,"props":4393,"children":4394},{"style":718},[4395],{"type":48,"value":1008},{"type":42,"tag":706,"props":4397,"children":4398},{"style":713},[4399],{"type":48,"value":1079},{"type":42,"tag":706,"props":4401,"children":4402},{"class":708,"line":901},[4403,4407,4412,4417,4421,4426,4430,4434,4439,4443,4447,4452,4457,4461,4466,4470],{"type":42,"tag":706,"props":4404,"children":4405},{"style":718},[4406],{"type":48,"value":1088},{"type":42,"tag":706,"props":4408,"children":4409},{"style":779},[4410],{"type":48,"value":4411}," awk",{"type":42,"tag":706,"props":4413,"children":4414},{"style":729},[4415],{"type":48,"value":4416}," -F",{"type":42,"tag":706,"props":4418,"children":4419},{"style":718},[4420],{"type":48,"value":1008},{"type":42,"tag":706,"props":4422,"children":4423},{"style":729},[4424],{"type":48,"value":4425},": ",{"type":42,"tag":706,"props":4427,"children":4428},{"style":718},[4429],{"type":48,"value":1008},{"type":42,"tag":706,"props":4431,"children":4432},{"style":718},[4433],{"type":48,"value":998},{"type":42,"tag":706,"props":4435,"children":4436},{"style":729},[4437],{"type":48,"value":4438},"tolower($1)==\"mcp-session-id\"{print $2}",{"type":42,"tag":706,"props":4440,"children":4441},{"style":718},[4442],{"type":48,"value":1008},{"type":42,"tag":706,"props":4444,"children":4445},{"style":718},[4446],{"type":48,"value":983},{"type":42,"tag":706,"props":4448,"children":4449},{"style":779},[4450],{"type":48,"value":4451}," tr",{"type":42,"tag":706,"props":4453,"children":4454},{"style":729},[4455],{"type":48,"value":4456}," -d",{"type":42,"tag":706,"props":4458,"children":4459},{"style":718},[4460],{"type":48,"value":998},{"type":42,"tag":706,"props":4462,"children":4463},{"style":729},[4464],{"type":48,"value":4465},"\\r",{"type":42,"tag":706,"props":4467,"children":4468},{"style":718},[4469],{"type":48,"value":1008},{"type":42,"tag":706,"props":4471,"children":4472},{"style":718},[4473],{"type":48,"value":826},{"type":42,"tag":706,"props":4475,"children":4476},{"class":708,"line":911},[4477],{"type":42,"tag":706,"props":4478,"children":4479},{"emptyLinePlaceholder":905},[4480],{"type":48,"value":908},{"type":42,"tag":706,"props":4482,"children":4483},{"class":708,"line":921},[4484],{"type":42,"tag":706,"props":4485,"children":4486},{"style":915},[4487],{"type":48,"value":4488},"# 2. notifications\u002Finitialized\n",{"type":42,"tag":706,"props":4490,"children":4491},{"class":708,"line":1015},[4492,4496,4500,4504,4508,4512,4516,4520,4524,4528],{"type":42,"tag":706,"props":4493,"children":4494},{"style":779},[4495],{"type":48,"value":936},{"type":42,"tag":706,"props":4497,"children":4498},{"style":729},[4499],{"type":48,"value":941},{"type":42,"tag":706,"props":4501,"children":4502},{"style":718},[4503],{"type":48,"value":880},{"type":42,"tag":706,"props":4505,"children":4506},{"style":713},[4507],{"type":48,"value":4301},{"type":42,"tag":706,"props":4509,"children":4510},{"style":718},[4511],{"type":48,"value":726},{"type":42,"tag":706,"props":4513,"children":4514},{"style":729},[4515],{"type":48,"value":1345},{"type":42,"tag":706,"props":4517,"children":4518},{"style":718},[4519],{"type":48,"value":880},{"type":42,"tag":706,"props":4521,"children":4522},{"style":729},[4523],{"type":48,"value":1526},{"type":42,"tag":706,"props":4525,"children":4526},{"style":718},[4527],{"type":48,"value":726},{"type":42,"tag":706,"props":4529,"children":4530},{"style":713},[4531],{"type":48,"value":1079},{"type":42,"tag":706,"props":4533,"children":4534},{"class":708,"line":1023},[4535,4539,4543,4547,4551,4555,4559,4563,4567,4571],{"type":42,"tag":706,"props":4536,"children":4537},{"style":729},[4538],{"type":48,"value":1495},{"type":42,"tag":706,"props":4540,"children":4541},{"style":718},[4542],{"type":48,"value":880},{"type":42,"tag":706,"props":4544,"children":4545},{"style":729},[4546],{"type":48,"value":2075},{"type":42,"tag":706,"props":4548,"children":4549},{"style":718},[4550],{"type":48,"value":726},{"type":42,"tag":706,"props":4552,"children":4553},{"style":729},[4554],{"type":48,"value":1345},{"type":42,"tag":706,"props":4556,"children":4557},{"style":718},[4558],{"type":48,"value":880},{"type":42,"tag":706,"props":4560,"children":4561},{"style":729},[4562],{"type":48,"value":1504},{"type":42,"tag":706,"props":4564,"children":4565},{"style":713},[4566],{"type":48,"value":3030},{"type":42,"tag":706,"props":4568,"children":4569},{"style":718},[4570],{"type":48,"value":726},{"type":42,"tag":706,"props":4572,"children":4573},{"style":713},[4574],{"type":48,"value":1079},{"type":42,"tag":706,"props":4576,"children":4577},{"class":708,"line":1032},[4578,4583,4587,4591,4596,4600,4605,4610,4614,4618],{"type":42,"tag":706,"props":4579,"children":4580},{"style":718},[4581],{"type":48,"value":4582},"  ${",{"type":42,"tag":706,"props":4584,"children":4585},{"style":713},[4586],{"type":48,"value":4261},{"type":42,"tag":706,"props":4588,"children":4589},{"style":718},[4590],{"type":48,"value":695},{"type":42,"tag":706,"props":4592,"children":4593},{"style":713},[4594],{"type":48,"value":4595},"+-H ",{"type":42,"tag":706,"props":4597,"children":4598},{"style":718},[4599],{"type":48,"value":726},{"type":42,"tag":706,"props":4601,"children":4602},{"style":729},[4603],{"type":48,"value":4604},"Mcp-Session-Id: ",{"type":42,"tag":706,"props":4606,"children":4607},{"style":713},[4608],{"type":48,"value":4609},"$SID",{"type":42,"tag":706,"props":4611,"children":4612},{"style":718},[4613],{"type":48,"value":726},{"type":42,"tag":706,"props":4615,"children":4616},{"style":718},[4617],{"type":48,"value":3355},{"type":42,"tag":706,"props":4619,"children":4620},{"style":713},[4621],{"type":48,"value":1079},{"type":42,"tag":706,"props":4623,"children":4624},{"class":708,"line":1082},[4625,4629,4633,4638,4642,4647],{"type":42,"tag":706,"props":4626,"children":4627},{"style":729},[4628],{"type":48,"value":1543},{"type":42,"tag":706,"props":4630,"children":4631},{"style":718},[4632],{"type":48,"value":998},{"type":42,"tag":706,"props":4634,"children":4635},{"style":729},[4636],{"type":48,"value":4637},"{\"jsonrpc\":\"2.0\",\"method\":\"notifications\u002Finitialized\"}",{"type":42,"tag":706,"props":4639,"children":4640},{"style":718},[4641],{"type":48,"value":1008},{"type":42,"tag":706,"props":4643,"children":4644},{"style":718},[4645],{"type":48,"value":4646}," >",{"type":42,"tag":706,"props":4648,"children":4649},{"style":729},[4650],{"type":48,"value":4651},"\u002Fdev\u002Fnull\n",{"type":42,"tag":706,"props":4653,"children":4654},{"class":708,"line":1113},[4655],{"type":42,"tag":706,"props":4656,"children":4657},{"emptyLinePlaceholder":905},[4658],{"type":48,"value":908},{"type":42,"tag":706,"props":4660,"children":4661},{"class":708,"line":1121},[4662],{"type":42,"tag":706,"props":4663,"children":4664},{"style":915},[4665],{"type":48,"value":4666},"# 3. tools\u002Flist — an empty \"tools\" array means the server exposes no usable tools\n",{"type":42,"tag":706,"props":4668,"children":4669},{"class":708,"line":1130},[4670,4674,4678,4682,4686,4690,4694,4698,4702,4706],{"type":42,"tag":706,"props":4671,"children":4672},{"style":779},[4673],{"type":48,"value":936},{"type":42,"tag":706,"props":4675,"children":4676},{"style":729},[4677],{"type":48,"value":941},{"type":42,"tag":706,"props":4679,"children":4680},{"style":718},[4681],{"type":48,"value":880},{"type":42,"tag":706,"props":4683,"children":4684},{"style":713},[4685],{"type":48,"value":4301},{"type":42,"tag":706,"props":4687,"children":4688},{"style":718},[4689],{"type":48,"value":726},{"type":42,"tag":706,"props":4691,"children":4692},{"style":729},[4693],{"type":48,"value":1345},{"type":42,"tag":706,"props":4695,"children":4696},{"style":718},[4697],{"type":48,"value":880},{"type":42,"tag":706,"props":4699,"children":4700},{"style":729},[4701],{"type":48,"value":1526},{"type":42,"tag":706,"props":4703,"children":4704},{"style":718},[4705],{"type":48,"value":726},{"type":42,"tag":706,"props":4707,"children":4708},{"style":713},[4709],{"type":48,"value":1079},{"type":42,"tag":706,"props":4711,"children":4712},{"class":708,"line":1200},[4713,4717,4721,4725,4729,4733,4737,4741,4745,4749],{"type":42,"tag":706,"props":4714,"children":4715},{"style":729},[4716],{"type":48,"value":1495},{"type":42,"tag":706,"props":4718,"children":4719},{"style":718},[4720],{"type":48,"value":880},{"type":42,"tag":706,"props":4722,"children":4723},{"style":729},[4724],{"type":48,"value":2075},{"type":42,"tag":706,"props":4726,"children":4727},{"style":718},[4728],{"type":48,"value":726},{"type":42,"tag":706,"props":4730,"children":4731},{"style":729},[4732],{"type":48,"value":1345},{"type":42,"tag":706,"props":4734,"children":4735},{"style":718},[4736],{"type":48,"value":880},{"type":42,"tag":706,"props":4738,"children":4739},{"style":729},[4740],{"type":48,"value":1504},{"type":42,"tag":706,"props":4742,"children":4743},{"style":713},[4744],{"type":48,"value":3030},{"type":42,"tag":706,"props":4746,"children":4747},{"style":718},[4748],{"type":48,"value":726},{"type":42,"tag":706,"props":4750,"children":4751},{"style":713},[4752],{"type":48,"value":1079},{"type":42,"tag":706,"props":4754,"children":4755},{"class":708,"line":1208},[4756,4760,4764,4768,4772,4776,4780,4784,4788,4792],{"type":42,"tag":706,"props":4757,"children":4758},{"style":718},[4759],{"type":48,"value":4582},{"type":42,"tag":706,"props":4761,"children":4762},{"style":713},[4763],{"type":48,"value":4261},{"type":42,"tag":706,"props":4765,"children":4766},{"style":718},[4767],{"type":48,"value":695},{"type":42,"tag":706,"props":4769,"children":4770},{"style":713},[4771],{"type":48,"value":4595},{"type":42,"tag":706,"props":4773,"children":4774},{"style":718},[4775],{"type":48,"value":726},{"type":42,"tag":706,"props":4777,"children":4778},{"style":729},[4779],{"type":48,"value":4604},{"type":42,"tag":706,"props":4781,"children":4782},{"style":713},[4783],{"type":48,"value":4609},{"type":42,"tag":706,"props":4785,"children":4786},{"style":718},[4787],{"type":48,"value":726},{"type":42,"tag":706,"props":4789,"children":4790},{"style":718},[4791],{"type":48,"value":3355},{"type":42,"tag":706,"props":4793,"children":4794},{"style":713},[4795],{"type":48,"value":1079},{"type":42,"tag":706,"props":4797,"children":4798},{"class":708,"line":1217},[4799,4803,4807,4812],{"type":42,"tag":706,"props":4800,"children":4801},{"style":729},[4802],{"type":48,"value":1543},{"type":42,"tag":706,"props":4804,"children":4805},{"style":718},[4806],{"type":48,"value":998},{"type":42,"tag":706,"props":4808,"children":4809},{"style":729},[4810],{"type":48,"value":4811},"{\"jsonrpc\":\"2.0\",\"id\":2,\"method\":\"tools\u002Flist\",\"params\":{}}",{"type":42,"tag":706,"props":4813,"children":4814},{"style":718},[4815],{"type":48,"value":1110},{"type":42,"tag":55,"props":4817,"children":4818},{},[4819,4821,4827,4829,4834,4836,4842,4843,4849],{"type":48,"value":4820},"To wire it into an application, configure your MCP client with the endpoint URL, ",{"type":42,"tag":61,"props":4822,"children":4824},{"className":4823},[],[4825],{"type":48,"value":4826},"http",{"type":48,"value":4828}," transport, and the ",{"type":42,"tag":61,"props":4830,"children":4832},{"className":4831},[],[4833],{"type":48,"value":2067},{"type":48,"value":4835}," header — for example, in a client that reads an ",{"type":42,"tag":61,"props":4837,"children":4839},{"className":4838},[],[4840],{"type":48,"value":4841},"mcp.json",{"type":48,"value":231},{"type":42,"tag":61,"props":4844,"children":4846},{"className":4845},[],[4847],{"type":48,"value":4848},"mcpServers",{"type":48,"value":4850}," map:",{"type":42,"tag":433,"props":4852,"children":4854},{"className":2244,"code":4853,"language":2246,"meta":441,"style":441},"{\n  \"mcpServers\": {\n    \"\u003Ctool-name>\": {\n      \"type\": \"http\",\n      \"url\": \"\u003Ctool-endpoint>\",\n      \"headers\": { \"Api-Key\": \"${AI_GATEWAY_API_KEY}\" }\n    }\n  }\n}\n",[4855],{"type":42,"tag":61,"props":4856,"children":4857},{"__ignoreMap":441},[4858,4865,4889,4914,4951,4988,5045,5053,5061],{"type":42,"tag":706,"props":4859,"children":4860},{"class":708,"line":709},[4861],{"type":42,"tag":706,"props":4862,"children":4863},{"style":718},[4864],{"type":48,"value":3054},{"type":42,"tag":706,"props":4866,"children":4867},{"class":708,"line":740},[4868,4872,4876,4880,4884],{"type":42,"tag":706,"props":4869,"children":4870},{"style":718},[4871],{"type":48,"value":1371},{"type":42,"tag":706,"props":4873,"children":4874},{"style":2265},[4875],{"type":48,"value":4848},{"type":42,"tag":706,"props":4877,"children":4878},{"style":718},[4879],{"type":48,"value":726},{"type":42,"tag":706,"props":4881,"children":4882},{"style":718},[4883],{"type":48,"value":695},{"type":42,"tag":706,"props":4885,"children":4886},{"style":718},[4887],{"type":48,"value":4888}," {\n",{"type":42,"tag":706,"props":4890,"children":4891},{"class":708,"line":765},[4892,4897,4902,4906,4910],{"type":42,"tag":706,"props":4893,"children":4894},{"style":718},[4895],{"type":48,"value":4896},"    \"",{"type":42,"tag":706,"props":4898,"children":4899},{"style":779},[4900],{"type":48,"value":4901},"\u003Ctool-name>",{"type":42,"tag":706,"props":4903,"children":4904},{"style":718},[4905],{"type":48,"value":726},{"type":42,"tag":706,"props":4907,"children":4908},{"style":718},[4909],{"type":48,"value":695},{"type":42,"tag":706,"props":4911,"children":4912},{"style":718},[4913],{"type":48,"value":4888},{"type":42,"tag":706,"props":4915,"children":4916},{"class":708,"line":829},[4917,4922,4927,4931,4935,4939,4943,4947],{"type":42,"tag":706,"props":4918,"children":4919},{"style":718},[4920],{"type":48,"value":4921},"      \"",{"type":42,"tag":706,"props":4923,"children":4924},{"style":3728},[4925],{"type":48,"value":4926},"type",{"type":42,"tag":706,"props":4928,"children":4929},{"style":718},[4930],{"type":48,"value":726},{"type":42,"tag":706,"props":4932,"children":4933},{"style":718},[4934],{"type":48,"value":695},{"type":42,"tag":706,"props":4936,"children":4937},{"style":718},[4938],{"type":48,"value":880},{"type":42,"tag":706,"props":4940,"children":4941},{"style":729},[4942],{"type":48,"value":4826},{"type":42,"tag":706,"props":4944,"children":4945},{"style":718},[4946],{"type":48,"value":726},{"type":42,"tag":706,"props":4948,"children":4949},{"style":718},[4950],{"type":48,"value":3370},{"type":42,"tag":706,"props":4952,"children":4953},{"class":708,"line":859},[4954,4958,4963,4967,4971,4975,4980,4984],{"type":42,"tag":706,"props":4955,"children":4956},{"style":718},[4957],{"type":48,"value":4921},{"type":42,"tag":706,"props":4959,"children":4960},{"style":3728},[4961],{"type":48,"value":4962},"url",{"type":42,"tag":706,"props":4964,"children":4965},{"style":718},[4966],{"type":48,"value":726},{"type":42,"tag":706,"props":4968,"children":4969},{"style":718},[4970],{"type":48,"value":695},{"type":42,"tag":706,"props":4972,"children":4973},{"style":718},[4974],{"type":48,"value":880},{"type":42,"tag":706,"props":4976,"children":4977},{"style":729},[4978],{"type":48,"value":4979},"\u003Ctool-endpoint>",{"type":42,"tag":706,"props":4981,"children":4982},{"style":718},[4983],{"type":48,"value":726},{"type":42,"tag":706,"props":4985,"children":4986},{"style":718},[4987],{"type":48,"value":3370},{"type":42,"tag":706,"props":4989,"children":4990},{"class":708,"line":901},[4991,4995,5000,5004,5008,5012,5016,5020,5024,5028,5032,5037,5041],{"type":42,"tag":706,"props":4992,"children":4993},{"style":718},[4994],{"type":48,"value":4921},{"type":42,"tag":706,"props":4996,"children":4997},{"style":3728},[4998],{"type":48,"value":4999},"headers",{"type":42,"tag":706,"props":5001,"children":5002},{"style":718},[5003],{"type":48,"value":726},{"type":42,"tag":706,"props":5005,"children":5006},{"style":718},[5007],{"type":48,"value":695},{"type":42,"tag":706,"props":5009,"children":5010},{"style":718},[5011],{"type":48,"value":3433},{"type":42,"tag":706,"props":5013,"children":5014},{"style":718},[5015],{"type":48,"value":880},{"type":42,"tag":706,"props":5017,"children":5018},{"style":3315},[5019],{"type":48,"value":2067},{"type":42,"tag":706,"props":5021,"children":5022},{"style":718},[5023],{"type":48,"value":726},{"type":42,"tag":706,"props":5025,"children":5026},{"style":718},[5027],{"type":48,"value":695},{"type":42,"tag":706,"props":5029,"children":5030},{"style":718},[5031],{"type":48,"value":880},{"type":42,"tag":706,"props":5033,"children":5034},{"style":729},[5035],{"type":48,"value":5036},"${AI_GATEWAY_API_KEY}",{"type":42,"tag":706,"props":5038,"children":5039},{"style":718},[5040],{"type":48,"value":726},{"type":42,"tag":706,"props":5042,"children":5043},{"style":718},[5044],{"type":48,"value":2328},{"type":42,"tag":706,"props":5046,"children":5047},{"class":708,"line":911},[5048],{"type":42,"tag":706,"props":5049,"children":5050},{"style":718},[5051],{"type":48,"value":5052},"    }\n",{"type":42,"tag":706,"props":5054,"children":5055},{"class":708,"line":921},[5056],{"type":42,"tag":706,"props":5057,"children":5058},{"style":718},[5059],{"type":48,"value":5060},"  }\n",{"type":42,"tag":706,"props":5062,"children":5063},{"class":708,"line":1015},[5064],{"type":42,"tag":706,"props":5065,"children":5066},{"style":718},[5067],{"type":48,"value":5068},"}\n",{"type":42,"tag":55,"props":5070,"children":5071},{},[5072,5074,5079],{"type":48,"value":5073},"Adapt the exact shape to whatever MCP client\u002Flibrary the user's app uses (the essentials are always: endpoint URL, HTTP transport, and the ",{"type":42,"tag":61,"props":5075,"children":5077},{"className":5076},[],[5078],{"type":48,"value":2067},{"type":48,"value":5080}," header). Native config locations for common coding agents:",{"type":42,"tag":152,"props":5082,"children":5083},{},[5084,5137,5211],{"type":42,"tag":111,"props":5085,"children":5086},{},[5087,5092,5093,5098,5100,5106,5108,5113,5115,5120,5122,5128,5129,5135],{"type":42,"tag":99,"props":5088,"children":5089},{},[5090],{"type":48,"value":5091},"Claude Code",{"type":48,"value":2158},{"type":42,"tag":61,"props":5094,"children":5096},{"className":5095},[],[5097],{"type":48,"value":4848},{"type":48,"value":5099}," JSON above is exactly the shape of a project-scoped ",{"type":42,"tag":61,"props":5101,"children":5103},{"className":5102},[],[5104],{"type":48,"value":5105},".mcp.json",{"type":48,"value":5107},". Claude Code expands ",{"type":42,"tag":61,"props":5109,"children":5111},{"className":5110},[],[5112],{"type":48,"value":5036},{"type":48,"value":5114}," from the environment in HTTP ",{"type":42,"tag":61,"props":5116,"children":5118},{"className":5117},[],[5119],{"type":48,"value":4999},{"type":48,"value":5121},". Run ",{"type":42,"tag":61,"props":5123,"children":5125},{"className":5124},[],[5126],{"type":48,"value":5127},"claude mcp list",{"type":48,"value":2808},{"type":42,"tag":61,"props":5130,"children":5132},{"className":5131},[],[5133],{"type":48,"value":5134},"\u002Fmcp",{"type":48,"value":5136},") and approve the project server when prompted.",{"type":42,"tag":111,"props":5138,"children":5139},{},[5140,5145,5147,5153,5155,5161,5163,5196,5198,5204,5205,5210],{"type":42,"tag":99,"props":5141,"children":5142},{},[5143],{"type":48,"value":5144},"OpenAI Codex",{"type":48,"value":5146}," — add to ",{"type":42,"tag":61,"props":5148,"children":5150},{"className":5149},[],[5151],{"type":48,"value":5152},"~\u002F.codex\u002Fconfig.toml",{"type":48,"value":5154}," (or a trusted project ",{"type":42,"tag":61,"props":5156,"children":5158},{"className":5157},[],[5159],{"type":48,"value":5160},".codex\u002Fconfig.toml",{"type":48,"value":5162},"), passing the key by env-var reference so the secret isn't written into config:\n",{"type":42,"tag":433,"props":5164,"children":5168},{"className":5165,"code":5166,"language":5167,"meta":441,"style":441},"language-toml shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","[mcp_servers.\u003Ctool-server-name>]\nurl = \"\u003Cai-gateway-host>\u002Fdefault\u002Ftoolservers\u002F\u003Ctool-server-name>\u002Fmcp\"\nenv_http_headers = { \"Api-Key\" = \"AI_GATEWAY_API_KEY\" }\n","toml",[5169],{"type":42,"tag":61,"props":5170,"children":5171},{"__ignoreMap":441},[5172,5180,5188],{"type":42,"tag":706,"props":5173,"children":5174},{"class":708,"line":709},[5175],{"type":42,"tag":706,"props":5176,"children":5177},{},[5178],{"type":48,"value":5179},"[mcp_servers.\u003Ctool-server-name>]\n",{"type":42,"tag":706,"props":5181,"children":5182},{"class":708,"line":740},[5183],{"type":42,"tag":706,"props":5184,"children":5185},{},[5186],{"type":48,"value":5187},"url = \"\u003Cai-gateway-host>\u002Fdefault\u002Ftoolservers\u002F\u003Ctool-server-name>\u002Fmcp\"\n",{"type":42,"tag":706,"props":5189,"children":5190},{"class":708,"line":765},[5191],{"type":42,"tag":706,"props":5192,"children":5193},{},[5194],{"type":48,"value":5195},"env_http_headers = { \"Api-Key\" = \"AI_GATEWAY_API_KEY\" }\n",{"type":48,"value":5197},"\nVerify with ",{"type":42,"tag":61,"props":5199,"children":5201},{"className":5200},[],[5202],{"type":48,"value":5203},"codex mcp list",{"type":48,"value":1646},{"type":42,"tag":61,"props":5206,"children":5208},{"className":5207},[],[5209],{"type":48,"value":5134},{"type":48,"value":587},{"type":42,"tag":111,"props":5212,"children":5213},{},[5214,5219,5221,5226],{"type":42,"tag":99,"props":5215,"children":5216},{},[5217],{"type":48,"value":5218},"Other MCP-capable agents",{"type":48,"value":5220}," — consult the agent's current CLI help or config schema for its remote\u002FHTTP MCP entry rather than guessing field names; the essentials are the same three: endpoint URL, HTTP transport, ",{"type":42,"tag":61,"props":5222,"children":5224},{"className":5223},[],[5225],{"type":48,"value":2067},{"type":48,"value":5227}," header.",{"type":42,"tag":55,"props":5229,"children":5230},{},[5231,5233,5238],{"type":48,"value":5232},"If the user is building an agent that needs these tools, prefer ",{"type":42,"tag":99,"props":5234,"children":5235},{},[5236],{"type":48,"value":5237},"Path C",{"type":48,"value":5239},", which wires models and MCP tools together.",{"type":42,"tag":259,"props":5241,"children":5242},{},[],{"type":42,"tag":269,"props":5244,"children":5246},{"id":5245},"path-c-scaffold-a-standalone-agent-github-copilot-sdk",[5247],{"type":48,"value":5248},"Path C — Scaffold a standalone agent (GitHub Copilot SDK)",{"type":42,"tag":55,"props":5250,"children":5251},{},[5252,5254,5259],{"type":48,"value":5253},"Use this path when the user explicitly wants a runnable standalone ",{"type":42,"tag":99,"props":5255,"children":5256},{},[5257],{"type":48,"value":5258},"agent",{"type":48,"value":5260}," project that combines the selected model and MCP tools.",{"type":42,"tag":2949,"props":5262,"children":5264},{"id":5263},"c1-choose-language",[5265],{"type":48,"value":5266},"C.1 Choose language",{"type":42,"tag":55,"props":5268,"children":5269},{},[5270,5272,5277],{"type":48,"value":5271},"Ask the user which language they prefer. ",{"type":42,"tag":99,"props":5273,"children":5274},{},[5275],{"type":48,"value":5276},"Default to Python",{"type":48,"value":5278}," if not specified. Supported:",{"type":42,"tag":152,"props":5280,"children":5281},{},[5282,5287],{"type":42,"tag":111,"props":5283,"children":5284},{},[5285],{"type":48,"value":5286},"Python (default)",{"type":42,"tag":111,"props":5288,"children":5289},{},[5290],{"type":48,"value":5291},"TypeScript\u002FJavaScript",{"type":42,"tag":2949,"props":5293,"children":5295},{"id":5294},"c2-generate-agent-code",[5296],{"type":48,"value":5297},"C.2 Generate agent code",{"type":42,"tag":55,"props":5299,"children":5300},{},[5301,5303,5308,5310,5316],{"type":48,"value":5302},"Generate the agent code using the ",{"type":42,"tag":99,"props":5304,"children":5305},{},[5306],{"type":48,"value":5307},"GitHub Copilot SDK",{"type":48,"value":5309}," (code, docs, examples: ",{"type":42,"tag":248,"props":5311,"children":5314},{"href":5312,"rel":5313},"https:\u002F\u002Fgithub.com\u002Fgithub\u002Fcopilot-sdk",[252],[5315],{"type":48,"value":5312},{"type":48,"value":4169},{"type":42,"tag":51,"props":5318,"children":5319},{},[5320],{"type":42,"tag":55,"props":5321,"children":5322},{},[5323,5335,5337,5342,5344,5349,5351,5357,5359,5365,5367,5373],{"type":42,"tag":99,"props":5324,"children":5325},{},[5326,5328,5334],{"type":48,"value":5327},"Required SDK version: ",{"type":42,"tag":61,"props":5329,"children":5331},{"className":5330},[],[5332],{"type":48,"value":5333},"github-copilot-sdk >= 1.0.0",{"type":48,"value":587},{"type":48,"value":5336}," The agent authenticates the BYOK model and the MCP tool servers by passing the gateway key in custom request headers (",{"type":42,"tag":61,"props":5338,"children":5340},{"className":5339},[],[5341],{"type":48,"value":2067},{"type":48,"value":5343},"). SDK versions older than 1.0.0 silently drop provider\u002Fcustom headers, so the gateway rejects the call with a misleading ",{"type":42,"tag":61,"props":5345,"children":5347},{"className":5346},[],[5348],{"type":48,"value":1697},{"type":48,"value":5350}," error. Always pin ",{"type":42,"tag":61,"props":5352,"children":5354},{"className":5353},[],[5355],{"type":48,"value":5356},">= 1.0.0",{"type":48,"value":5358}," in ",{"type":42,"tag":61,"props":5360,"children":5362},{"className":5361},[],[5363],{"type":48,"value":5364},"requirements.txt",{"type":48,"value":5366}," \u002F ",{"type":42,"tag":61,"props":5368,"children":5370},{"className":5369},[],[5371],{"type":48,"value":5372},"package.json",{"type":48,"value":5374}," and in any install command.",{"type":42,"tag":55,"props":5376,"children":5377},{},[5378],{"type":48,"value":5379},"The generated code must:",{"type":42,"tag":152,"props":5381,"children":5382},{},[5383,5398,5418,5440,5453,5533,5546,5598,5644,5672,5693,5698,5727,5746,5751,5756],{"type":42,"tag":111,"props":5384,"children":5385},{},[5386,5388,5396],{"type":48,"value":5387},"Use the GitHub Copilot SDK correctly for the chosen language (default to Python, unless the user specifies otherwise). Require ",{"type":42,"tag":99,"props":5389,"children":5390},{},[5391],{"type":42,"tag":61,"props":5392,"children":5394},{"className":5393},[],[5395],{"type":48,"value":5333},{"type":48,"value":5397}," — older versions drop the custom headers used to authenticate the gateway model and tools",{"type":42,"tag":111,"props":5399,"children":5400},{},[5401,5403,5409,5411,5416],{"type":48,"value":5402},"Configure MCP tool connections to the selected AI Gateway tool servers via ",{"type":42,"tag":61,"props":5404,"children":5406},{"className":5405},[],[5407],{"type":48,"value":5408},"mcp_servers",{"type":48,"value":5410}," in the session config, using ",{"type":42,"tag":61,"props":5412,"children":5414},{"className":5413},[],[5415],{"type":48,"value":4185},{"type":48,"value":5417}," with the tool server's MCP endpoint URL",{"type":42,"tag":111,"props":5419,"children":5420},{},[5421,5423,5431,5433,5438],{"type":48,"value":5422},"Authenticate tool servers with the gateway API key passed in the ",{"type":42,"tag":99,"props":5424,"children":5425},{},[5426],{"type":42,"tag":61,"props":5427,"children":5429},{"className":5428},[],[5430],{"type":48,"value":2067},{"type":48,"value":5432}," header via the ",{"type":42,"tag":61,"props":5434,"children":5436},{"className":5435},[],[5437],{"type":48,"value":4999},{"type":48,"value":5439}," config",{"type":42,"tag":111,"props":5441,"children":5442},{},[5443,5445,5451],{"type":48,"value":5444},"Configure model access through a BYOK ",{"type":42,"tag":61,"props":5446,"children":5448},{"className":5447},[],[5449],{"type":48,"value":5450},"provider",{"type":48,"value":5452}," in the session config",{"type":42,"tag":111,"props":5454,"children":5455},{},[5456,5458,5463,5465,5473,5475,5480,5482,5486,5488,5493,5495,5500,5502,5507,5509,5517,5519,5524,5526,5531],{"type":48,"value":5457},"Authenticate models with the ",{"type":42,"tag":99,"props":5459,"children":5460},{},[5461],{"type":48,"value":5462},"same",{"type":48,"value":5464}," gateway API key passed in the ",{"type":42,"tag":99,"props":5466,"children":5467},{},[5468],{"type":42,"tag":61,"props":5469,"children":5471},{"className":5470},[],[5472],{"type":48,"value":2067},{"type":48,"value":5474}," header via the provider's ",{"type":42,"tag":61,"props":5476,"children":5478},{"className":5477},[],[5479],{"type":48,"value":4999},{"type":48,"value":5481}," config — ",{"type":42,"tag":99,"props":5483,"children":5484},{},[5485],{"type":48,"value":1603},{"type":48,"value":5487}," the ",{"type":42,"tag":61,"props":5489,"children":5491},{"className":5490},[],[5492],{"type":48,"value":2884},{"type":48,"value":5494}," field alone. The SDK sends ",{"type":42,"tag":61,"props":5496,"children":5498},{"className":5497},[],[5499],{"type":48,"value":2884},{"type":48,"value":5501}," as an ",{"type":42,"tag":61,"props":5503,"children":5505},{"className":5504},[],[5506],{"type":48,"value":2858},{"type":48,"value":5508}," header, which the AI Gateway model passthrough rejects with a misleading ",{"type":42,"tag":99,"props":5510,"children":5511},{},[5512],{"type":42,"tag":61,"props":5513,"children":5515},{"className":5514},[],[5516],{"type":48,"value":1697},{"type":48,"value":5518}," error. Set the ",{"type":42,"tag":61,"props":5520,"children":5522},{"className":5521},[],[5523],{"type":48,"value":2067},{"type":48,"value":5525}," header explicitly (keep ",{"type":42,"tag":61,"props":5527,"children":5529},{"className":5528},[],[5530],{"type":48,"value":2884},{"type":48,"value":5532}," too, since the SDK requires a non-empty value)",{"type":42,"tag":111,"props":5534,"children":5535},{},[5536,5538,5544],{"type":48,"value":5537},"Use model provider ",{"type":42,"tag":61,"props":5539,"children":5541},{"className":5540},[],[5542],{"type":48,"value":5543},"type: \"openai\"",{"type":48,"value":5545}," (the AI Gateway exposes an OpenAI-compatible passthrough, where the model is selected by name in the request body)",{"type":42,"tag":111,"props":5547,"children":5548},{},[5549,5551,5557,5559,5564,5566,5571,5572,5577,5579,5584,5586,5591,5593],{"type":48,"value":5550},"Construct the model ",{"type":42,"tag":61,"props":5552,"children":5554},{"className":5553},[],[5555],{"type":48,"value":5556},"base_url",{"type":48,"value":5558}," as the AI Gateway's unified model passthrough: ",{"type":42,"tag":61,"props":5560,"children":5562},{"className":5561},[],[5563],{"type":48,"value":2784},{"type":48,"value":5565}," — for example ",{"type":42,"tag":61,"props":5567,"children":5569},{"className":5568},[],[5570],{"type":48,"value":2792},{"type":48,"value":2794},{"type":42,"tag":248,"props":5573,"children":5575},{"href":250,"rel":5574},[252],[5576],{"type":48,"value":255},{"type":48,"value":5578}," advertises to consumers (the SDK appends ",{"type":42,"tag":61,"props":5580,"children":5582},{"className":5581},[],[5583],{"type":48,"value":1850},{"type":48,"value":5585},"). The ",{"type":42,"tag":61,"props":5587,"children":5589},{"className":5588},[],[5590],{"type":48,"value":554},{"type":48,"value":5592}," workspace segment is required — dropping it returns ",{"type":42,"tag":61,"props":5594,"children":5596},{"className":5595},[],[5597],{"type":48,"value":2012},{"type":42,"tag":111,"props":5599,"children":5600},{},[5601,5603,5611,5612,5617,5619,5624,5625,5630,5631,5636,5637,5642],{"type":48,"value":5602},"Precisely specify the model parameter and match it exactly to the selected model's ",{"type":42,"tag":99,"props":5604,"children":5605},{},[5606],{"type":42,"tag":61,"props":5607,"children":5609},{"className":5608},[],[5610],{"type":48,"value":1594},{"type":48,"value":504},{"type":42,"tag":61,"props":5613,"children":5615},{"className":5614},[],[5616],{"type":48,"value":1644},{"type":48,"value":5618},") — same dots, same casing, same punctuation. Prefer it over the ARM resource ",{"type":42,"tag":61,"props":5620,"children":5622},{"className":5621},[],[5623],{"type":48,"value":1611},{"type":48,"value":504},{"type":42,"tag":61,"props":5626,"children":5628},{"className":5627},[],[5629],{"type":48,"value":1679},{"type":48,"value":2932},{"type":42,"tag":61,"props":5632,"children":5634},{"className":5633},[],[5635],{"type":48,"value":2938},{"type":48,"value":2940},{"type":42,"tag":61,"props":5638,"children":5640},{"className":5639},[],[5641],{"type":48,"value":1697},{"type":48,"value":5643}," on some gateways",{"type":42,"tag":111,"props":5645,"children":5646},{},[5647,5649,5655,5657,5663,5665,5671],{"type":48,"value":5648},"Include ",{"type":42,"tag":61,"props":5650,"children":5652},{"className":5651},[],[5653],{"type":48,"value":5654},"\"on_permission_request\": PermissionHandler.approve_all",{"type":48,"value":5656}," in the session config (import ",{"type":42,"tag":61,"props":5658,"children":5660},{"className":5659},[],[5661],{"type":48,"value":5662},"PermissionHandler",{"type":48,"value":5664}," from ",{"type":42,"tag":61,"props":5666,"children":5668},{"className":5667},[],[5669],{"type":48,"value":5670},"copilot",{"type":48,"value":2665},{"type":42,"tag":111,"props":5673,"children":5674},{},[5675,5677,5683,5685,5691],{"type":48,"value":5676},"Pass the session config to ",{"type":42,"tag":61,"props":5678,"children":5680},{"className":5679},[],[5681],{"type":48,"value":5682},"create_session",{"type":48,"value":5684}," as keyword arguments (e.g. ",{"type":42,"tag":61,"props":5686,"children":5688},{"className":5687},[],[5689],{"type":48,"value":5690},"create_session(model=..., provider=..., mcp_servers=...)",{"type":48,"value":5692},"), like in the example below",{"type":42,"tag":111,"props":5694,"children":5695},{},[5696],{"type":48,"value":5697},"Read all credentials from environment variables — never hardcode secrets",{"type":42,"tag":111,"props":5699,"children":5700},{},[5701,5703,5709,5711,5717,5719,5725],{"type":48,"value":5702},"Load environment variables from a ",{"type":42,"tag":61,"props":5704,"children":5706},{"className":5705},[],[5707],{"type":48,"value":5708},".env",{"type":48,"value":5710}," file using ",{"type":42,"tag":61,"props":5712,"children":5714},{"className":5713},[],[5715],{"type":48,"value":5716},"python-dotenv",{"type":48,"value":5718}," (Python) or ",{"type":42,"tag":61,"props":5720,"children":5722},{"className":5721},[],[5723],{"type":48,"value":5724},"dotenv",{"type":48,"value":5726}," (TypeScript)",{"type":42,"tag":111,"props":5728,"children":5729},{},[5730,5731,5737,5739,5744],{"type":48,"value":496},{"type":42,"tag":61,"props":5732,"children":5734},{"className":5733},[],[5735],{"type":48,"value":5736},"send_and_wait()",{"type":48,"value":5738}," with the prompt as a positional string to get the agent's response, then ",{"type":42,"tag":99,"props":5740,"children":5741},{},[5742],{"type":48,"value":5743},"always print the response content or the error",{"type":48,"value":5745}," — the user must see output",{"type":42,"tag":111,"props":5747,"children":5748},{},[5749],{"type":48,"value":5750},"Handle errors gracefully with full tracebacks for debugging",{"type":42,"tag":111,"props":5752,"children":5753},{},[5754],{"type":48,"value":5755},"Include a clear main entry point and example usage",{"type":42,"tag":111,"props":5757,"children":5758},{},[5759],{"type":48,"value":5760},"Match the code example below as closely as possible",{"type":42,"tag":5762,"props":5763,"children":5765},"h5",{"id":5764},"python-example-structure",[5766],{"type":48,"value":5767},"Python Example Structure",{"type":42,"tag":433,"props":5769,"children":5771},{"className":3091,"code":5770,"language":3093,"meta":441,"style":441},"import asyncio\nimport os\nfrom dotenv import load_dotenv\nfrom copilot import CopilotClient, PermissionHandler\n\nload_dotenv()\n\nasync def main():\n    client = CopilotClient()\n    await client.start()\n\n    try:\n        session = await client.create_session(\n            on_permission_request=PermissionHandler.approve_all,\n            model=\"\u003Cselected-model>\",  # e.g. \"gpt-4o\"\n            # BYOK provider — points to the AI Gateway unified model passthrough.\n            # The gateway authenticates the model passthrough via the `Api-Key`\n            # header, so pass the key in `headers`. The `api_key` field alone is\n            # sent as `Authorization: Bearer`, which the gateway rejects with\n            # `unknown_model`.\n            provider={\n                \"type\": \"openai\",\n                \"base_url\": \"\u003Cai-gateway-host>\u002Fdefault\u002Fmodels\u002Fopenai\u002Fv1\",\n                \"api_key\": os.environ[\"AI_GATEWAY_API_KEY\"],\n                \"headers\": {\n                    \"Api-Key\": os.environ[\"AI_GATEWAY_API_KEY\"],\n                },\n            },\n            # MCP tool servers from AI Gateway\n            mcp_servers={\n                \"\u003Ctool-name>\": {\n                    \"type\": \"http\",\n                    \"url\": \"\u003Ctool-endpoint>\",\n                    \"headers\": {\n                        \"Api-Key\": os.environ[\"AI_GATEWAY_API_KEY\"],\n                    },\n                    \"tools\": [\"*\"],\n                },\n                # Add more tools as needed\n            },\n        )\n\n        def on_event(event):\n            event_type = event.type.value\n            if event_type == \"tool.execution_start\":\n                print(f\"  [tool call: {event.data.tool_name}]\")\n            elif event_type == \"error\":\n                msg = getattr(event.data, \"message\", str(event))\n                print(f\"  [error: {msg}]\")\n\n        session.on(on_event)\n\n        reply = await session.send_and_wait(\"\u003Cuser prompt>\")\n\n        if reply:\n            print(\"\\n=== Agent Response ===\")\n            print(reply.data.content if reply.data.content else \"(empty response)\")\n        else:\n            print(\"\\n=== No response received from agent ===\")\n\n        await session.disconnect()\n\n    except Exception as e:\n        print(f\"\\nFailed to run agent: {e}\")\n        import traceback\n        traceback.print_exc()\n    finally:\n        await client.stop()\n\nif __name__ == \"__main__\":\n    asyncio.run(main())\n",[5772],{"type":42,"tag":61,"props":5773,"children":5774},{"__ignoreMap":441},[5775,5783,5790,5798,5806,5813,5821,5828,5836,5844,5852,5859,5867,5875,5883,5891,5899,5907,5915,5923,5931,5939,5947,5955,5963,5971,5979,5988,5997,6006,6015,6024,6033,6042,6051,6060,6069,6078,6086,6095,6103,6112,6120,6129,6138,6147,6156,6165,6174,6183,6191,6200,6208,6217,6225,6234,6243,6252,6261,6270,6278,6287,6295,6304,6313,6322,6331,6340,6349,6357,6366],{"type":42,"tag":706,"props":5776,"children":5777},{"class":708,"line":709},[5778],{"type":42,"tag":706,"props":5779,"children":5780},{},[5781],{"type":48,"value":5782},"import asyncio\n",{"type":42,"tag":706,"props":5784,"children":5785},{"class":708,"line":740},[5786],{"type":42,"tag":706,"props":5787,"children":5788},{},[5789],{"type":48,"value":3105},{"type":42,"tag":706,"props":5791,"children":5792},{"class":708,"line":765},[5793],{"type":42,"tag":706,"props":5794,"children":5795},{},[5796],{"type":48,"value":5797},"from dotenv import load_dotenv\n",{"type":42,"tag":706,"props":5799,"children":5800},{"class":708,"line":829},[5801],{"type":42,"tag":706,"props":5802,"children":5803},{},[5804],{"type":48,"value":5805},"from copilot import CopilotClient, PermissionHandler\n",{"type":42,"tag":706,"props":5807,"children":5808},{"class":708,"line":859},[5809],{"type":42,"tag":706,"props":5810,"children":5811},{"emptyLinePlaceholder":905},[5812],{"type":48,"value":908},{"type":42,"tag":706,"props":5814,"children":5815},{"class":708,"line":901},[5816],{"type":42,"tag":706,"props":5817,"children":5818},{},[5819],{"type":48,"value":5820},"load_dotenv()\n",{"type":42,"tag":706,"props":5822,"children":5823},{"class":708,"line":911},[5824],{"type":42,"tag":706,"props":5825,"children":5826},{"emptyLinePlaceholder":905},[5827],{"type":48,"value":908},{"type":42,"tag":706,"props":5829,"children":5830},{"class":708,"line":921},[5831],{"type":42,"tag":706,"props":5832,"children":5833},{},[5834],{"type":48,"value":5835},"async def main():\n",{"type":42,"tag":706,"props":5837,"children":5838},{"class":708,"line":1015},[5839],{"type":42,"tag":706,"props":5840,"children":5841},{},[5842],{"type":48,"value":5843},"    client = CopilotClient()\n",{"type":42,"tag":706,"props":5845,"children":5846},{"class":708,"line":1023},[5847],{"type":42,"tag":706,"props":5848,"children":5849},{},[5850],{"type":48,"value":5851},"    await client.start()\n",{"type":42,"tag":706,"props":5853,"children":5854},{"class":708,"line":1032},[5855],{"type":42,"tag":706,"props":5856,"children":5857},{"emptyLinePlaceholder":905},[5858],{"type":48,"value":908},{"type":42,"tag":706,"props":5860,"children":5861},{"class":708,"line":1082},[5862],{"type":42,"tag":706,"props":5863,"children":5864},{},[5865],{"type":48,"value":5866},"    try:\n",{"type":42,"tag":706,"props":5868,"children":5869},{"class":708,"line":1113},[5870],{"type":42,"tag":706,"props":5871,"children":5872},{},[5873],{"type":48,"value":5874},"        session = await client.create_session(\n",{"type":42,"tag":706,"props":5876,"children":5877},{"class":708,"line":1121},[5878],{"type":42,"tag":706,"props":5879,"children":5880},{},[5881],{"type":48,"value":5882},"            on_permission_request=PermissionHandler.approve_all,\n",{"type":42,"tag":706,"props":5884,"children":5885},{"class":708,"line":1130},[5886],{"type":42,"tag":706,"props":5887,"children":5888},{},[5889],{"type":48,"value":5890},"            model=\"\u003Cselected-model>\",  # e.g. \"gpt-4o\"\n",{"type":42,"tag":706,"props":5892,"children":5893},{"class":708,"line":1200},[5894],{"type":42,"tag":706,"props":5895,"children":5896},{},[5897],{"type":48,"value":5898},"            # BYOK provider — points to the AI Gateway unified model passthrough.\n",{"type":42,"tag":706,"props":5900,"children":5901},{"class":708,"line":1208},[5902],{"type":42,"tag":706,"props":5903,"children":5904},{},[5905],{"type":48,"value":5906},"            # The gateway authenticates the model passthrough via the `Api-Key`\n",{"type":42,"tag":706,"props":5908,"children":5909},{"class":708,"line":1217},[5910],{"type":42,"tag":706,"props":5911,"children":5912},{},[5913],{"type":48,"value":5914},"            # header, so pass the key in `headers`. The `api_key` field alone is\n",{"type":42,"tag":706,"props":5916,"children":5917},{"class":708,"line":1300},[5918],{"type":42,"tag":706,"props":5919,"children":5920},{},[5921],{"type":48,"value":5922},"            # sent as `Authorization: Bearer`, which the gateway rejects with\n",{"type":42,"tag":706,"props":5924,"children":5925},{"class":708,"line":1365},[5926],{"type":42,"tag":706,"props":5927,"children":5928},{},[5929],{"type":48,"value":5930},"            # `unknown_model`.\n",{"type":42,"tag":706,"props":5932,"children":5933},{"class":708,"line":1405},[5934],{"type":42,"tag":706,"props":5935,"children":5936},{},[5937],{"type":48,"value":5938},"            provider={\n",{"type":42,"tag":706,"props":5940,"children":5941},{"class":708,"line":1438},[5942],{"type":42,"tag":706,"props":5943,"children":5944},{},[5945],{"type":48,"value":5946},"                \"type\": \"openai\",\n",{"type":42,"tag":706,"props":5948,"children":5949},{"class":708,"line":1446},[5950],{"type":42,"tag":706,"props":5951,"children":5952},{},[5953],{"type":48,"value":5954},"                \"base_url\": \"\u003Cai-gateway-host>\u002Fdefault\u002Fmodels\u002Fopenai\u002Fv1\",\n",{"type":42,"tag":706,"props":5956,"children":5957},{"class":708,"line":1455},[5958],{"type":42,"tag":706,"props":5959,"children":5960},{},[5961],{"type":48,"value":5962},"                \"api_key\": os.environ[\"AI_GATEWAY_API_KEY\"],\n",{"type":42,"tag":706,"props":5964,"children":5965},{"class":708,"line":1489},[5966],{"type":42,"tag":706,"props":5967,"children":5968},{},[5969],{"type":48,"value":5970},"                \"headers\": {\n",{"type":42,"tag":706,"props":5972,"children":5973},{"class":708,"line":1537},[5974],{"type":42,"tag":706,"props":5975,"children":5976},{},[5977],{"type":48,"value":5978},"                    \"Api-Key\": os.environ[\"AI_GATEWAY_API_KEY\"],\n",{"type":42,"tag":706,"props":5980,"children":5982},{"class":708,"line":5981},27,[5983],{"type":42,"tag":706,"props":5984,"children":5985},{},[5986],{"type":48,"value":5987},"                },\n",{"type":42,"tag":706,"props":5989,"children":5991},{"class":708,"line":5990},28,[5992],{"type":42,"tag":706,"props":5993,"children":5994},{},[5995],{"type":48,"value":5996},"            },\n",{"type":42,"tag":706,"props":5998,"children":6000},{"class":708,"line":5999},29,[6001],{"type":42,"tag":706,"props":6002,"children":6003},{},[6004],{"type":48,"value":6005},"            # MCP tool servers from AI Gateway\n",{"type":42,"tag":706,"props":6007,"children":6009},{"class":708,"line":6008},30,[6010],{"type":42,"tag":706,"props":6011,"children":6012},{},[6013],{"type":48,"value":6014},"            mcp_servers={\n",{"type":42,"tag":706,"props":6016,"children":6018},{"class":708,"line":6017},31,[6019],{"type":42,"tag":706,"props":6020,"children":6021},{},[6022],{"type":48,"value":6023},"                \"\u003Ctool-name>\": {\n",{"type":42,"tag":706,"props":6025,"children":6027},{"class":708,"line":6026},32,[6028],{"type":42,"tag":706,"props":6029,"children":6030},{},[6031],{"type":48,"value":6032},"                    \"type\": \"http\",\n",{"type":42,"tag":706,"props":6034,"children":6036},{"class":708,"line":6035},33,[6037],{"type":42,"tag":706,"props":6038,"children":6039},{},[6040],{"type":48,"value":6041},"                    \"url\": \"\u003Ctool-endpoint>\",\n",{"type":42,"tag":706,"props":6043,"children":6045},{"class":708,"line":6044},34,[6046],{"type":42,"tag":706,"props":6047,"children":6048},{},[6049],{"type":48,"value":6050},"                    \"headers\": {\n",{"type":42,"tag":706,"props":6052,"children":6054},{"class":708,"line":6053},35,[6055],{"type":42,"tag":706,"props":6056,"children":6057},{},[6058],{"type":48,"value":6059},"                        \"Api-Key\": os.environ[\"AI_GATEWAY_API_KEY\"],\n",{"type":42,"tag":706,"props":6061,"children":6063},{"class":708,"line":6062},36,[6064],{"type":42,"tag":706,"props":6065,"children":6066},{},[6067],{"type":48,"value":6068},"                    },\n",{"type":42,"tag":706,"props":6070,"children":6072},{"class":708,"line":6071},37,[6073],{"type":42,"tag":706,"props":6074,"children":6075},{},[6076],{"type":48,"value":6077},"                    \"tools\": [\"*\"],\n",{"type":42,"tag":706,"props":6079,"children":6081},{"class":708,"line":6080},38,[6082],{"type":42,"tag":706,"props":6083,"children":6084},{},[6085],{"type":48,"value":5987},{"type":42,"tag":706,"props":6087,"children":6089},{"class":708,"line":6088},39,[6090],{"type":42,"tag":706,"props":6091,"children":6092},{},[6093],{"type":48,"value":6094},"                # Add more tools as needed\n",{"type":42,"tag":706,"props":6096,"children":6098},{"class":708,"line":6097},40,[6099],{"type":42,"tag":706,"props":6100,"children":6101},{},[6102],{"type":48,"value":5996},{"type":42,"tag":706,"props":6104,"children":6106},{"class":708,"line":6105},41,[6107],{"type":42,"tag":706,"props":6108,"children":6109},{},[6110],{"type":48,"value":6111},"        )\n",{"type":42,"tag":706,"props":6113,"children":6115},{"class":708,"line":6114},42,[6116],{"type":42,"tag":706,"props":6117,"children":6118},{"emptyLinePlaceholder":905},[6119],{"type":48,"value":908},{"type":42,"tag":706,"props":6121,"children":6123},{"class":708,"line":6122},43,[6124],{"type":42,"tag":706,"props":6125,"children":6126},{},[6127],{"type":48,"value":6128},"        def on_event(event):\n",{"type":42,"tag":706,"props":6130,"children":6132},{"class":708,"line":6131},44,[6133],{"type":42,"tag":706,"props":6134,"children":6135},{},[6136],{"type":48,"value":6137},"            event_type = event.type.value\n",{"type":42,"tag":706,"props":6139,"children":6141},{"class":708,"line":6140},45,[6142],{"type":42,"tag":706,"props":6143,"children":6144},{},[6145],{"type":48,"value":6146},"            if event_type == \"tool.execution_start\":\n",{"type":42,"tag":706,"props":6148,"children":6150},{"class":708,"line":6149},46,[6151],{"type":42,"tag":706,"props":6152,"children":6153},{},[6154],{"type":48,"value":6155},"                print(f\"  [tool call: {event.data.tool_name}]\")\n",{"type":42,"tag":706,"props":6157,"children":6159},{"class":708,"line":6158},47,[6160],{"type":42,"tag":706,"props":6161,"children":6162},{},[6163],{"type":48,"value":6164},"            elif event_type == \"error\":\n",{"type":42,"tag":706,"props":6166,"children":6168},{"class":708,"line":6167},48,[6169],{"type":42,"tag":706,"props":6170,"children":6171},{},[6172],{"type":48,"value":6173},"                msg = getattr(event.data, \"message\", str(event))\n",{"type":42,"tag":706,"props":6175,"children":6177},{"class":708,"line":6176},49,[6178],{"type":42,"tag":706,"props":6179,"children":6180},{},[6181],{"type":48,"value":6182},"                print(f\"  [error: {msg}]\")\n",{"type":42,"tag":706,"props":6184,"children":6186},{"class":708,"line":6185},50,[6187],{"type":42,"tag":706,"props":6188,"children":6189},{"emptyLinePlaceholder":905},[6190],{"type":48,"value":908},{"type":42,"tag":706,"props":6192,"children":6194},{"class":708,"line":6193},51,[6195],{"type":42,"tag":706,"props":6196,"children":6197},{},[6198],{"type":48,"value":6199},"        session.on(on_event)\n",{"type":42,"tag":706,"props":6201,"children":6203},{"class":708,"line":6202},52,[6204],{"type":42,"tag":706,"props":6205,"children":6206},{"emptyLinePlaceholder":905},[6207],{"type":48,"value":908},{"type":42,"tag":706,"props":6209,"children":6211},{"class":708,"line":6210},53,[6212],{"type":42,"tag":706,"props":6213,"children":6214},{},[6215],{"type":48,"value":6216},"        reply = await session.send_and_wait(\"\u003Cuser prompt>\")\n",{"type":42,"tag":706,"props":6218,"children":6220},{"class":708,"line":6219},54,[6221],{"type":42,"tag":706,"props":6222,"children":6223},{"emptyLinePlaceholder":905},[6224],{"type":48,"value":908},{"type":42,"tag":706,"props":6226,"children":6228},{"class":708,"line":6227},55,[6229],{"type":42,"tag":706,"props":6230,"children":6231},{},[6232],{"type":48,"value":6233},"        if reply:\n",{"type":42,"tag":706,"props":6235,"children":6237},{"class":708,"line":6236},56,[6238],{"type":42,"tag":706,"props":6239,"children":6240},{},[6241],{"type":48,"value":6242},"            print(\"\\n=== Agent Response ===\")\n",{"type":42,"tag":706,"props":6244,"children":6246},{"class":708,"line":6245},57,[6247],{"type":42,"tag":706,"props":6248,"children":6249},{},[6250],{"type":48,"value":6251},"            print(reply.data.content if reply.data.content else \"(empty response)\")\n",{"type":42,"tag":706,"props":6253,"children":6255},{"class":708,"line":6254},58,[6256],{"type":42,"tag":706,"props":6257,"children":6258},{},[6259],{"type":48,"value":6260},"        else:\n",{"type":42,"tag":706,"props":6262,"children":6264},{"class":708,"line":6263},59,[6265],{"type":42,"tag":706,"props":6266,"children":6267},{},[6268],{"type":48,"value":6269},"            print(\"\\n=== No response received from agent ===\")\n",{"type":42,"tag":706,"props":6271,"children":6273},{"class":708,"line":6272},60,[6274],{"type":42,"tag":706,"props":6275,"children":6276},{"emptyLinePlaceholder":905},[6277],{"type":48,"value":908},{"type":42,"tag":706,"props":6279,"children":6281},{"class":708,"line":6280},61,[6282],{"type":42,"tag":706,"props":6283,"children":6284},{},[6285],{"type":48,"value":6286},"        await session.disconnect()\n",{"type":42,"tag":706,"props":6288,"children":6290},{"class":708,"line":6289},62,[6291],{"type":42,"tag":706,"props":6292,"children":6293},{"emptyLinePlaceholder":905},[6294],{"type":48,"value":908},{"type":42,"tag":706,"props":6296,"children":6298},{"class":708,"line":6297},63,[6299],{"type":42,"tag":706,"props":6300,"children":6301},{},[6302],{"type":48,"value":6303},"    except Exception as e:\n",{"type":42,"tag":706,"props":6305,"children":6307},{"class":708,"line":6306},64,[6308],{"type":42,"tag":706,"props":6309,"children":6310},{},[6311],{"type":48,"value":6312},"        print(f\"\\nFailed to run agent: {e}\")\n",{"type":42,"tag":706,"props":6314,"children":6316},{"class":708,"line":6315},65,[6317],{"type":42,"tag":706,"props":6318,"children":6319},{},[6320],{"type":48,"value":6321},"        import traceback\n",{"type":42,"tag":706,"props":6323,"children":6325},{"class":708,"line":6324},66,[6326],{"type":42,"tag":706,"props":6327,"children":6328},{},[6329],{"type":48,"value":6330},"        traceback.print_exc()\n",{"type":42,"tag":706,"props":6332,"children":6334},{"class":708,"line":6333},67,[6335],{"type":42,"tag":706,"props":6336,"children":6337},{},[6338],{"type":48,"value":6339},"    finally:\n",{"type":42,"tag":706,"props":6341,"children":6343},{"class":708,"line":6342},68,[6344],{"type":42,"tag":706,"props":6345,"children":6346},{},[6347],{"type":48,"value":6348},"        await client.stop()\n",{"type":42,"tag":706,"props":6350,"children":6352},{"class":708,"line":6351},69,[6353],{"type":42,"tag":706,"props":6354,"children":6355},{"emptyLinePlaceholder":905},[6356],{"type":48,"value":908},{"type":42,"tag":706,"props":6358,"children":6360},{"class":708,"line":6359},70,[6361],{"type":42,"tag":706,"props":6362,"children":6363},{},[6364],{"type":48,"value":6365},"if __name__ == \"__main__\":\n",{"type":42,"tag":706,"props":6367,"children":6369},{"class":708,"line":6368},71,[6370],{"type":42,"tag":706,"props":6371,"children":6372},{},[6373],{"type":48,"value":6374},"    asyncio.run(main())\n",{"type":42,"tag":2949,"props":6376,"children":6378},{"id":6377},"c3-create-project-files",[6379],{"type":48,"value":6380},"C.3 Create project files",{"type":42,"tag":55,"props":6382,"children":6383},{},[6384,6386,6390,6392,6397,6398,6404,6405,6411],{"type":48,"value":6385},"After generating the agent code, create a complete, self-contained project the user can download and run as-is. See ",{"type":42,"tag":1939,"props":6387,"children":6388},{},[6389],{"type":48,"value":2527},{"type":48,"value":6391}," below for ",{"type":42,"tag":61,"props":6393,"children":6395},{"className":6394},[],[6396],{"type":48,"value":5708},{"type":48,"value":322},{"type":42,"tag":61,"props":6399,"children":6401},{"className":6400},[],[6402],{"type":48,"value":6403},".env.example",{"type":48,"value":330},{"type":42,"tag":61,"props":6406,"children":6408},{"className":6407},[],[6409],{"type":48,"value":6410},".gitignore",{"type":48,"value":6412},", plus:",{"type":42,"tag":107,"props":6414,"children":6415},{"start":829},[6416,6475],{"type":42,"tag":111,"props":6417,"children":6418},{},[6419,6427,6429,6438,6442,6444,6449,6451,6457,6459,6465,6467,6473],{"type":42,"tag":99,"props":6420,"children":6421},{},[6422],{"type":42,"tag":61,"props":6423,"children":6425},{"className":6424},[],[6426],{"type":48,"value":5364},{"type":48,"value":6428}," (Python) — pin the agent's dependencies so the project installs in one command:",{"type":42,"tag":433,"props":6430,"children":6433},{"className":6431,"code":6432,"language":48},[436],"github-copilot-sdk>=1.0.0\npython-dotenv\n",[6434],{"type":42,"tag":61,"props":6435,"children":6436},{"__ignoreMap":441},[6437],{"type":48,"value":6432},{"type":42,"tag":6439,"props":6440,"children":6441},"br",{},[],{"type":48,"value":6443},"(For TypeScript, generate a ",{"type":42,"tag":61,"props":6445,"children":6447},{"className":6446},[],[6448],{"type":48,"value":5372},{"type":48,"value":6450}," with the equivalent dependencies — ",{"type":42,"tag":61,"props":6452,"children":6454},{"className":6453},[],[6455],{"type":48,"value":6456},"github-copilot-sdk",{"type":48,"value":6458}," at ",{"type":42,"tag":61,"props":6460,"children":6462},{"className":6461},[],[6463],{"type":48,"value":6464},">=1.0.0",{"type":48,"value":6466}," — and a ",{"type":42,"tag":61,"props":6468,"children":6470},{"className":6469},[],[6471],{"type":48,"value":6472},"start",{"type":48,"value":6474}," script.)",{"type":42,"tag":111,"props":6476,"children":6477},{},[6478,6487,6489],{"type":42,"tag":99,"props":6479,"children":6480},{},[6481],{"type":42,"tag":61,"props":6482,"children":6484},{"className":6483},[],[6485],{"type":48,"value":6486},"README.md",{"type":48,"value":6488}," — a short, self-contained guide so the downloaded project runs without this chat. Include:",{"type":42,"tag":152,"props":6490,"children":6491},{},[6492,6497,6508,6520,6545],{"type":42,"tag":111,"props":6493,"children":6494},{},[6495],{"type":48,"value":6496},"what the agent does and which gateway model + tool servers it uses (by name)",{"type":42,"tag":111,"props":6498,"children":6499},{},[6500,6502,6507],{"type":48,"value":6501},"prerequisites (Python 3.10+, the Copilot CLI, ",{"type":42,"tag":61,"props":6503,"children":6505},{"className":6504},[],[6506],{"type":48,"value":5333},{"type":48,"value":2665},{"type":42,"tag":111,"props":6509,"children":6510},{},[6511,6513,6519],{"type":48,"value":6512},"install steps (",{"type":42,"tag":61,"props":6514,"children":6516},{"className":6515},[],[6517],{"type":48,"value":6518},"pip install -r requirements.txt",{"type":48,"value":2665},{"type":42,"tag":111,"props":6521,"children":6522},{},[6523,6525,6530,6532,6537,6539,6544],{"type":48,"value":6524},"how to set credentials (copy ",{"type":42,"tag":61,"props":6526,"children":6528},{"className":6527},[],[6529],{"type":48,"value":6403},{"type":48,"value":6531}," to ",{"type":42,"tag":61,"props":6533,"children":6535},{"className":6534},[],[6536],{"type":48,"value":5708},{"type":48,"value":6538},", or use the pre-filled ",{"type":42,"tag":61,"props":6540,"children":6542},{"className":6541},[],[6543],{"type":48,"value":5708},{"type":48,"value":2665},{"type":42,"tag":111,"props":6546,"children":6547},{},[6548],{"type":48,"value":6549},"the run command and the expected output",{"type":42,"tag":2949,"props":6551,"children":6553},{"id":6552},"c4-provide-setup-instructions",[6554],{"type":48,"value":6555},"C.4 Provide setup instructions",{"type":42,"tag":55,"props":6557,"children":6558},{},[6559],{"type":48,"value":6560},"After generating the code, provide:",{"type":42,"tag":152,"props":6562,"children":6563},{},[6564,6597,6602,6634],{"type":42,"tag":111,"props":6565,"children":6566},{},[6567,6569,6575,6577,6582,6584,6589,6591,6596],{"type":48,"value":6568},"Required package installation commands: ",{"type":42,"tag":61,"props":6570,"children":6572},{"className":6571},[],[6573],{"type":48,"value":6574},"pip install \"github-copilot-sdk>=1.0.0\" python-dotenv",{"type":48,"value":6576}," (the ",{"type":42,"tag":61,"props":6578,"children":6580},{"className":6579},[],[6581],{"type":48,"value":5356},{"type":48,"value":6583}," pin is mandatory — older SDKs drop the custom ",{"type":42,"tag":61,"props":6585,"children":6587},{"className":6586},[],[6588],{"type":48,"value":2067},{"type":48,"value":6590}," headers and the gateway returns ",{"type":42,"tag":61,"props":6592,"children":6594},{"className":6593},[],[6595],{"type":48,"value":1697},{"type":48,"value":2665},{"type":42,"tag":111,"props":6598,"children":6599},{},[6600],{"type":48,"value":6601},"Copilot CLI must be installed separately (the SDK communicates with it via JSON-RPC)",{"type":42,"tag":111,"props":6603,"children":6604},{},[6605,6607],{"type":48,"value":6606},"Environment variable setup:\n",{"type":42,"tag":152,"props":6608,"children":6609},{},[6610],{"type":42,"tag":111,"props":6611,"children":6612},{},[6613,6618,6620,6625,6627,6632],{"type":42,"tag":61,"props":6614,"children":6616},{"className":6615},[],[6617],{"type":48,"value":2520},{"type":48,"value":6619}," — the gateway API key from discovery (passed via the ",{"type":42,"tag":61,"props":6621,"children":6623},{"className":6622},[],[6624],{"type":48,"value":2067},{"type":48,"value":6626}," header for tool servers and via the BYOK provider ",{"type":42,"tag":61,"props":6628,"children":6630},{"className":6629},[],[6631],{"type":48,"value":2884},{"type":48,"value":6633}," for the model)",{"type":42,"tag":111,"props":6635,"children":6636},{},[6637],{"type":48,"value":6638},"How to run the agent",{"type":42,"tag":2949,"props":6640,"children":6642},{"id":6641},"c5-run-and-verify",[6643],{"type":48,"value":6644},"C.5 Run and verify",{"type":42,"tag":55,"props":6646,"children":6647},{},[6648],{"type":48,"value":6649},"Don't stop at \"here's the code.\" Run the agent once and confirm the wiring actually works, then report the outcome to the user:",{"type":42,"tag":152,"props":6651,"children":6652},{},[6653,6670,6706,6828],{"type":42,"tag":111,"props":6654,"children":6655},{},[6656,6661,6662,6668],{"type":42,"tag":99,"props":6657,"children":6658},{},[6659],{"type":48,"value":6660},"Run it",{"type":48,"value":504},{"type":42,"tag":61,"props":6663,"children":6665},{"className":6664},[],[6666],{"type":48,"value":6667},"python agent.py",{"type":48,"value":6669},") and read the output.",{"type":42,"tag":111,"props":6671,"children":6672},{},[6673,6678,6680,6685,6687],{"type":42,"tag":99,"props":6674,"children":6675},{},[6676],{"type":48,"value":6677},"Distinguish config failures from benign backend conditions.",{"type":48,"value":6679}," Treat these as a ",{"type":42,"tag":99,"props":6681,"children":6682},{},[6683],{"type":48,"value":6684},"healthy",{"type":48,"value":6686}," end-to-end wiring (the gateway accepted the request) — report success and move on:\n",{"type":42,"tag":152,"props":6688,"children":6689},{},[6690,6701],{"type":42,"tag":111,"props":6691,"children":6692},{},[6693,6699],{"type":42,"tag":61,"props":6694,"children":6696},{"className":6695},[],[6697],{"type":48,"value":6698},"429 ... exceeded rate limit",{"type":48,"value":6700}," or quota errors from the model",{"type":42,"tag":111,"props":6702,"children":6703},{},[6704],{"type":48,"value":6705},"empty\u002Fslow responses caused by the upstream model, not the client",{"type":42,"tag":111,"props":6707,"children":6708},{},[6709,6714],{"type":42,"tag":99,"props":6710,"children":6711},{},[6712],{"type":48,"value":6713},"Treat these as real bugs to fix before handing off:",{"type":42,"tag":152,"props":6715,"children":6716},{},[6717,6780,6805],{"type":42,"tag":111,"props":6718,"children":6719},{},[6720,6725,6727,6732,6733,6738,6739,6744,6746,6751,6752,6757,6759,6763,6765,6771,6773,6778],{"type":42,"tag":61,"props":6721,"children":6723},{"className":6722},[],[6724],{"type":48,"value":1697},{"type":48,"value":6726}," → wrong model identifier (used ARM ",{"type":42,"tag":61,"props":6728,"children":6730},{"className":6729},[],[6731],{"type":48,"value":1611},{"type":48,"value":231},{"type":42,"tag":61,"props":6734,"children":6736},{"className":6735},[],[6737],{"type":48,"value":2938},{"type":48,"value":3810},{"type":42,"tag":61,"props":6740,"children":6742},{"className":6741},[],[6743],{"type":48,"value":1594},{"type":48,"value":6745},"), a protocol mismatch (e.g. a Chat Completions client pointed at a ",{"type":42,"tag":61,"props":6747,"children":6749},{"className":6748},[],[6750],{"type":48,"value":1872},{"type":48,"value":4117},{"type":42,"tag":61,"props":6753,"children":6755},{"className":6754},[],[6756],{"type":48,"value":1894},{"type":48,"value":6758},"-only model), ",{"type":42,"tag":99,"props":6760,"children":6761},{},[6762],{"type":48,"value":305},{"type":48,"value":6764}," an SDK older than ",{"type":42,"tag":61,"props":6766,"children":6768},{"className":6767},[],[6769],{"type":48,"value":6770},"1.0.0",{"type":48,"value":6772}," dropping the ",{"type":42,"tag":61,"props":6774,"children":6776},{"className":6775},[],[6777],{"type":48,"value":2067},{"type":48,"value":6779}," header",{"type":42,"tag":111,"props":6781,"children":6782},{},[6783,6789,6791,6796,6798,6803],{"type":42,"tag":61,"props":6784,"children":6786},{"className":6785},[],[6787],{"type":48,"value":6788},"KeyError: 'AI_GATEWAY_API_KEY'",{"type":48,"value":6790}," → ",{"type":42,"tag":61,"props":6792,"children":6794},{"className":6793},[],[6795],{"type":48,"value":5708},{"type":48,"value":6797}," not loaded, usually a BOM (see the ",{"type":42,"tag":61,"props":6799,"children":6801},{"className":6800},[],[6802],{"type":48,"value":5708},{"type":48,"value":6804}," note below)",{"type":42,"tag":111,"props":6806,"children":6807},{},[6808,6813,6814,6820,6822,6827],{"type":42,"tag":61,"props":6809,"children":6811},{"className":6810},[],[6812],{"type":48,"value":2866},{"type":48,"value":231},{"type":42,"tag":61,"props":6815,"children":6817},{"className":6816},[],[6818],{"type":48,"value":6819},"403",{"type":48,"value":6821}," → wrong or missing ",{"type":42,"tag":61,"props":6823,"children":6825},{"className":6824},[],[6826],{"type":48,"value":2067},{"type":48,"value":6779},{"type":42,"tag":111,"props":6829,"children":6830},{},[6831,6833,6839],{"type":48,"value":6832},"If you can't get a clean model response because of a backend ",{"type":42,"tag":61,"props":6834,"children":6836},{"className":6835},[],[6837],{"type":48,"value":6838},"429",{"type":48,"value":6840},"\u002Fquota, say so explicitly and note that everything up to the model was validated, rather than implying the full round-trip succeeded.",{"type":42,"tag":259,"props":6842,"children":6843},{},[],{"type":42,"tag":269,"props":6845,"children":6847},{"id":6846},"shared-credentials-project-hygiene",[6848],{"type":48,"value":2527},{"type":42,"tag":55,"props":6850,"children":6851},{},[6852],{"type":48,"value":6853},"Whenever you write credentials or scaffold files into the user's project (any path), keep secrets safe:",{"type":42,"tag":107,"props":6855,"children":6856},{},[6857,7029,7051],{"type":42,"tag":111,"props":6858,"children":6859},{},[6860,6868,6870,6879,6919],{"type":42,"tag":99,"props":6861,"children":6862},{},[6863],{"type":42,"tag":61,"props":6864,"children":6866},{"className":6865},[],[6867],{"type":48,"value":5708},{"type":48,"value":6869}," — populated with the actual key retrieved during discovery:",{"type":42,"tag":433,"props":6871,"children":6874},{"className":6872,"code":6873,"language":48},[436],"AI_GATEWAY_API_KEY=\u003Cactual gateway API key from discovery>\n",[6875],{"type":42,"tag":61,"props":6876,"children":6877},{"__ignoreMap":441},[6878],{"type":48,"value":6873},{"type":42,"tag":51,"props":6880,"children":6881},{},[6882],{"type":42,"tag":55,"props":6883,"children":6884},{},[6885,6890,6892,6897,6899,6904,6906,6918],{"type":42,"tag":99,"props":6886,"children":6887},{},[6888],{"type":48,"value":6889},"Security note:",{"type":48,"value":6891}," this writes a ",{"type":42,"tag":99,"props":6893,"children":6894},{},[6895],{"type":48,"value":6896},"live gateway secret in cleartext",{"type":48,"value":6898}," to disk. The ",{"type":42,"tag":61,"props":6900,"children":6902},{"className":6901},[],[6903],{"type":48,"value":6410},{"type":48,"value":6905}," (below) keeps it out of source control, but warn the user that the file holds a real key and to ",{"type":42,"tag":99,"props":6907,"children":6908},{},[6909,6911,6916],{"type":48,"value":6910},"rotate it in the ",{"type":42,"tag":248,"props":6912,"children":6914},{"href":250,"rel":6913},[252],[6915],{"type":48,"value":255},{"type":48,"value":6917}," if it is ever exposed or shared",{"type":48,"value":587},{"type":42,"tag":51,"props":6920,"children":6921},{},[6922,7001,7017],{"type":42,"tag":55,"props":6923,"children":6924},{},[6925,6944,6945,6950,6952,6957,6959,6963,6965,6971,6973,6978,6980,6986,6987,6993,6994,6999],{"type":42,"tag":99,"props":6926,"children":6927},{},[6928,6930,6935,6937,6942],{"type":48,"value":6929},"Write ",{"type":42,"tag":61,"props":6931,"children":6933},{"className":6932},[],[6934],{"type":48,"value":5708},{"type":48,"value":6936}," as UTF-8 ",{"type":42,"tag":1939,"props":6938,"children":6939},{},[6940],{"type":48,"value":6941},"without",{"type":48,"value":6943}," a BOM.",{"type":48,"value":300},{"type":42,"tag":61,"props":6946,"children":6948},{"className":6947},[],[6949],{"type":48,"value":5716},{"type":48,"value":6951}," (and ",{"type":42,"tag":61,"props":6953,"children":6955},{"className":6954},[],[6956],{"type":48,"value":5724},{"type":48,"value":6958}," for Node) does ",{"type":42,"tag":99,"props":6960,"children":6961},{},[6962],{"type":48,"value":1603},{"type":48,"value":6964}," strip a leading byte-order mark, so a BOM makes the first variable load as ",{"type":42,"tag":61,"props":6966,"children":6968},{"className":6967},[],[6969],{"type":48,"value":6970},"\\ufeffAI_GATEWAY_API_KEY",{"type":48,"value":6972}," and the app crashes with ",{"type":42,"tag":61,"props":6974,"children":6976},{"className":6975},[],[6977],{"type":48,"value":6788},{"type":48,"value":6979},". This bites on Windows specifically: PowerShell's ",{"type":42,"tag":61,"props":6981,"children":6983},{"className":6982},[],[6984],{"type":48,"value":6985},"Set-Content -Encoding utf8",{"type":48,"value":76},{"type":42,"tag":61,"props":6988,"children":6990},{"className":6989},[],[6991],{"type":48,"value":6992},"Out-File",{"type":48,"value":300},{"type":42,"tag":99,"props":6995,"children":6996},{},[6997],{"type":48,"value":6998},"add a BOM",{"type":48,"value":7000},". Write the file with a BOM-free encoder instead, e.g.:",{"type":42,"tag":433,"props":7002,"children":7006},{"className":7003,"code":7004,"language":7005,"meta":441,"style":441},"language-powershell shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","[System.IO.File]::WriteAllText(\"$PWD\\.env\", \"AI_GATEWAY_API_KEY=$key`n\", (New-Object System.Text.UTF8Encoding($false)))\n","powershell",[7007],{"type":42,"tag":61,"props":7008,"children":7009},{"__ignoreMap":441},[7010],{"type":42,"tag":706,"props":7011,"children":7012},{"class":708,"line":709},[7013],{"type":42,"tag":706,"props":7014,"children":7015},{},[7016],{"type":48,"value":7004},{"type":42,"tag":55,"props":7018,"children":7019},{},[7020,7022,7028],{"type":48,"value":7021},"or simply create the file through your editor\u002Fagent file-write tool, which does not add a BOM. After writing, sanity-check that the first byte is not ",{"type":42,"tag":61,"props":7023,"children":7025},{"className":7024},[],[7026],{"type":48,"value":7027},"0xEF",{"type":48,"value":587},{"type":42,"tag":111,"props":7030,"children":7031},{},[7032,7040,7042],{"type":42,"tag":99,"props":7033,"children":7034},{},[7035],{"type":42,"tag":61,"props":7036,"children":7038},{"className":7037},[],[7039],{"type":48,"value":6403},{"type":48,"value":7041}," — a template with a placeholder value for documentation:",{"type":42,"tag":433,"props":7043,"children":7046},{"className":7044,"code":7045,"language":48},[436],"AI_GATEWAY_API_KEY=your-gateway-api-key-here\n",[7047],{"type":42,"tag":61,"props":7048,"children":7049},{"__ignoreMap":441},[7050],{"type":48,"value":7045},{"type":42,"tag":111,"props":7052,"children":7053},{},[7054,7062,7064,7069,7071],{"type":42,"tag":99,"props":7055,"children":7056},{},[7057],{"type":42,"tag":61,"props":7058,"children":7060},{"className":7059},[],[7061],{"type":48,"value":6410},{"type":48,"value":7063}," — must include ",{"type":42,"tag":61,"props":7065,"children":7067},{"className":7066},[],[7068],{"type":48,"value":5708},{"type":48,"value":7070}," to prevent committing secrets:",{"type":42,"tag":433,"props":7072,"children":7075},{"className":7073,"code":7074,"language":48},[436],".env\n__pycache__\u002F\n*.pyc\n.venv\u002F\n",[7076],{"type":42,"tag":61,"props":7077,"children":7078},{"__ignoreMap":441},[7079],{"type":48,"value":7074},{"type":42,"tag":7081,"props":7082,"children":7083},"style",{},[7084],{"type":48,"value":7085},"html .light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}html.light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}html .default .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html.dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}",{"items":7087,"total":7264},[7088,7107,7126,7143,7158,7173,7186,7201,7212,7226,7239,7252],{"slug":7089,"name":7089,"fn":7090,"description":7091,"org":7092,"tags":7093,"stars":7104,"repoUrl":7105,"updatedAt":7106},"azure-arg-external-evaluation-policy-author","author and test Azure Resource Graph policies","Use when the user wants to author, design, or test an Azure Policy that queries Azure Resource Graph (ARG) at request-time — i.e. a policy whose deny\u002Faudit decision depends on data from elsewhere in the subscription (sibling\u002Fparent resource state, RG-wide invariants, multi-hop relationships, etc.). Formally called Azure Policy External Evaluation; sometimes referred to colloquially as \"Invoke\". Drives an iterative KQL co-design loop against the user's real subscription via `az graph query`, then emits a policy definition, assignment, `.http` test flow, and an `EXPLANATION.md` companion. Read-only; never provisions anything.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":11},[7094,7095,7098,7101],{"name":11,"slug":8,"type":14},{"name":7096,"slug":7097,"type":14},"Compliance","compliance",{"name":7099,"slug":7100,"type":14},"Governance","governance",{"name":7102,"slug":7103,"type":14},"Policy","policy",1686,"https:\u002F\u002Fgithub.com\u002FAzure\u002Fazure-policy","2026-07-12T08:17:48.378432",{"slug":7108,"name":7108,"fn":7109,"description":7110,"org":7111,"tags":7112,"stars":7123,"repoUrl":7124,"updatedAt":7125},"azure-blueprints-migration","migrate Azure Blueprints to Template Specs","Use when a user needs to migrate off Azure Blueprints (definitions and\u002For assignments) to Template Specs and Deployment Stacks before the January 31, 2027 retirement. Covers inventory, export, conversion to Bicep, policy decoupling, Template Spec publishing, Deployment Stack deployment with deny-settings, validation, and cutover.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":11},[7113,7114,7117,7120],{"name":11,"slug":8,"type":14},{"name":7115,"slug":7116,"type":14},"Deployment","deployment",{"name":7118,"slug":7119,"type":14},"Infrastructure as Code","infrastructure-as-code",{"name":7121,"slug":7122,"type":14},"Migration","migration",260,"https:\u002F\u002Fgithub.com\u002FAzure\u002Fazure-blueprints","2026-07-12T08:17:49.646405",{"slug":7127,"name":7127,"fn":7128,"description":7129,"org":7130,"tags":7131,"stars":7140,"repoUrl":7141,"updatedAt":7142},"apiview-feedback-resolution","resolve APIView feedback on Azure SDKs","Analyze and resolve APIView review feedback on Azure SDK PRs. **UTILITY SKILL**. USE FOR: APIView comments, API review feedback, SDK API surface changes. DO NOT USE FOR: general code review, non-APIView feedback. INVOKES: azure-sdk-mcp:azsdk_apiview_get_comments, azure-sdk-mcp:azsdk_typespec_customized_code_update.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":11},[7132,7133,7134,7137],{"name":22,"slug":23,"type":14},{"name":11,"slug":8,"type":14},{"name":7135,"slug":7136,"type":14},"Code Review","code-review",{"name":7138,"slug":7139,"type":14},"Documentation","documentation",133,"https:\u002F\u002Fgithub.com\u002FAzure\u002Fazure-sdk-tools","2026-07-12T08:17:43.350876",{"slug":7144,"name":7144,"fn":7145,"description":7146,"org":7147,"tags":7148,"stars":7140,"repoUrl":7141,"updatedAt":7157},"azsdk-common-live-and-recorded-tests","deploy resources and run Azure SDK tests","Deploy test resources and run Azure SDK tests in live, record, or playback mode. WHEN: \"run live tests\", \"run recorded tests\", \"deploy test resources\", \"record tests\", \"run tests in record mode\", \"clean up test resources\", \"run tests against live resources\". DO NOT USE FOR: writing new tests, authoring Bicep templates, playback-only test runs without resource deployment. INVOKES: azure-sdk-mcp:azsdk_package_run_tests.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":11},[7149,7150,7151,7154],{"name":11,"slug":8,"type":14},{"name":7115,"slug":7116,"type":14},{"name":7152,"slug":7153,"type":14},"SDK","sdk",{"name":7155,"slug":7156,"type":14},"Testing","testing","2026-07-12T08:17:44.718943",{"slug":7159,"name":7159,"fn":7160,"description":7161,"org":7162,"tags":7163,"stars":7140,"repoUrl":7141,"updatedAt":7172},"azsdk-common-prepare-release-plan","manage Azure SDK release plan work items","Create, get, update, abandon, and link SDK PRs to release plan work items for Azure SDK releases. **UTILITY SKILL**. USE FOR: \"create release plan\", \"get release plan\", \"update release plan\", \"update API spec in release plan\", \"update SDK details in release plan\", \"abandon release plan\", \"link SDK PR to plan\", \"namespace approval\", \"check release plan status\". DO NOT USE FOR: SDK code generation, pipeline troubleshooting, API review feedback. INVOKES: azure-sdk-mcp:azsdk_create_release_plan, azure-sdk-mcp:azsdk_get_release_plan, azure-sdk-mcp:azsdk_get_release_plan_for_spec_pr, azure-sdk-mcp:azsdk_update_release_plan, azure-sdk-mcp:azsdk_update_api_spec_pull_request_in_release_plan, azure-sdk-mcp:azsdk_update_sdk_details_in_release_plan, azure-sdk-mcp:azsdk_abandon_release_plan, azure-sdk-mcp:azsdk_link_sdk_pull_request_to_release_plan, azure-sdk-mcp:azsdk_link_namespace_approval_issue.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":11},[7164,7165,7168,7171],{"name":11,"slug":8,"type":14},{"name":7166,"slug":7167,"type":14},"GitHub","github",{"name":7169,"slug":7170,"type":14},"Project Management","project-management",{"name":7152,"slug":7153,"type":14},"2026-07-12T08:17:38.345387",{"slug":7174,"name":7174,"fn":7175,"description":7176,"org":7177,"tags":7178,"stars":7140,"repoUrl":7141,"updatedAt":7185},"azsdk-common-sdk-release","release Azure SDK packages","Check release readiness and trigger the release pipeline for Azure SDK packages. **UTILITY SKILL**. USE FOR: \"release SDK\", \"trigger release\", \"check release readiness\", \"release pipeline\", \"publish package\", \"ship SDK\". DO NOT USE FOR: SDK development, code generation, pipeline debugging, release plan creation. INVOKES: azure-sdk-mcp:azsdk_release_sdk.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":11},[7179,7180,7183,7184],{"name":11,"slug":8,"type":14},{"name":7181,"slug":7182,"type":14},"CI\u002FCD","ci-cd",{"name":7115,"slug":7116,"type":14},{"name":7152,"slug":7153,"type":14},"2026-07-12T08:17:34.27607",{"slug":7187,"name":7187,"fn":7188,"description":7189,"org":7190,"tags":7191,"stars":7140,"repoUrl":7141,"updatedAt":7200},"azure-typespec-author","author and modify Azure TypeSpec API specifications","Authors and modifies Azure TypeSpec (.tsp) API specifications. USE FOR: any TypeSpec\u002Ftsp change — api versions (add, bump, preview, stable, promote), resources, operations, models, properties, decorators, visibility, constraints, breaking changes, LRO, suppressions, operationId, spread model. Covers ARM resource-manager and data-plane services. DO NOT USE FOR: SDK generation, releasing SDK packages, or single MCP tool calls. INVOKES: azure-sdk-mcp:azsdk_typespec_generate_authoring_plan, azure-sdk-mcp:azsdk_run_typespec_validation.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":11},[7192,7193,7194,7197],{"name":22,"slug":23,"type":14},{"name":11,"slug":8,"type":14},{"name":7195,"slug":7196,"type":14},"OpenAPI","openapi",{"name":7198,"slug":7199,"type":14},"Technical Writing","technical-writing","2026-07-12T08:17:39.603232",{"slug":7202,"name":7202,"fn":7203,"description":7204,"org":7205,"tags":7206,"stars":7140,"repoUrl":7141,"updatedAt":7211},"generate-sdk-locally","generate and test Azure SDKs locally","Generate, build, and test Azure SDKs locally from TypeSpec with automatic customization. WHEN: \"generate SDK locally\", \"build SDK\", \"run SDK tests\", \"run CI checks\", \"validate package\", \"run checks\", \"update changelog\", \"fix SDK build errors\", \"fix breaking changes\", \"resolve SDK generation errors\", \"customize TypeSpec\", \"rename SDK client\", \"rename SDK model\", \"hide operation from SDK\", \"fix analyzer errors\", \"resolve customization drift\", \"create subclient\", \"update metadata\", \"update version\". DO NOT USE FOR: publishing to package registries, CI pipeline configuration, API design review. INVOKES: azsdk_verify_setup, azsdk_package_generate_code, azsdk_package_build_code, azsdk_package_run_check, azsdk_package_run_tests, azsdk_customized_code_update, azsdk_package_update_changelog_content, azsdk_package_update_metadata, azsdk_package_update_version.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":11},[7207,7208,7209,7210],{"name":11,"slug":8,"type":14},{"name":7181,"slug":7182,"type":14},{"name":7152,"slug":7153,"type":14},{"name":7155,"slug":7156,"type":14},"2026-07-12T08:17:37.08523",{"slug":7213,"name":7213,"fn":7214,"description":7215,"org":7216,"tags":7217,"stars":7140,"repoUrl":7141,"updatedAt":7225},"markdown-token-optimizer","optimize markdown files for token efficiency","Analyze markdown files for token efficiency and reduce context-window bloat. **UTILITY SKILL**. DO NOT USE FOR: code optimization, general file editing, non-markdown files. TRIGGERS: optimize markdown, reduce tokens, token count, token bloat, too many tokens, make concise, shrink file, file too large, optimize for AI, token efficiency, verbose markdown, reduce file size. INVOKES: waza CLI.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":11},[7218,7221,7224],{"name":7219,"slug":7220,"type":14},"LLM","llm",{"name":7222,"slug":7223,"type":14},"Performance","performance",{"name":7198,"slug":7199,"type":14},"2026-07-12T08:17:42.080413",{"slug":7227,"name":7227,"fn":7228,"description":7229,"org":7230,"tags":7231,"stars":7140,"repoUrl":7141,"updatedAt":7238},"pipeline-troubleshooting","troubleshoot Azure SDK CI pipelines","Diagnose and resolve failures in Azure SDK CI and generation pipelines. **UTILITY SKILL**. USE FOR: \"pipeline failed\", \"build failure\", \"CI check failing\", \"SDK generation error\", \"reproduce pipeline locally\", \"debug SDK pipeline\". DO NOT USE FOR: local build issues without pipeline context, API design review, SDK publishing. INVOKES: azure-sdk-mcp:azsdk_analyze_pipeline, azure-sdk-mcp:azsdk_package_build_code, azure-sdk-mcp:azsdk_package_run_check.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":11},[7232,7233,7234,7237],{"name":11,"slug":8,"type":14},{"name":7181,"slug":7182,"type":14},{"name":7235,"slug":7236,"type":14},"Debugging","debugging",{"name":7152,"slug":7153,"type":14},"2026-07-12T08:17:40.821512",{"slug":7240,"name":7240,"fn":7241,"description":7242,"org":7243,"tags":7244,"stars":7140,"repoUrl":7141,"updatedAt":7251},"sensei","improve skill frontmatter compliance","**WORKFLOW SKILL** — Iteratively improve skill frontmatter compliance using the Ralph loop pattern. WHEN: \"run sensei\", \"sensei help\", \"improve skill\", \"fix frontmatter\", \"skill compliance\", \"frontmatter audit\", \"score skill\", \"check skill tokens\". INVOKES: token counting tools, test runners, git commands. FOR SINGLE OPERATIONS: use token CLI directly for counts\u002Fchecks.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":11},[7245,7246,7247,7250],{"name":11,"slug":8,"type":14},{"name":7096,"slug":7097,"type":14},{"name":7248,"slug":7249,"type":14},"Process Optimization","process-optimization",{"name":7198,"slug":7199,"type":14},"2026-07-12T08:17:32.970921",{"slug":7253,"name":7253,"fn":7254,"description":7255,"org":7256,"tags":7257,"stars":7140,"repoUrl":7141,"updatedAt":7263},"skill-authoring","author agent skills for agentskills.io","Write Agent Skills that comply with the agentskills.io specification. WHEN: \"create a skill\", \"new skill\", \"write a skill\", \"skill template\", \"skill structure\", \"review skill\", \"skill PR\", \"skill compliance\", \"SKILL.md format\", \"skill frontmatter\", \"skill best practices\". DO NOT USE FOR: improving existing skills (use sensei), general documentation. INVOKES: waza CLI.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":11},[7258,7259,7262],{"name":7138,"slug":7139,"type":14},{"name":7260,"slug":7261,"type":14},"Plugin Development","plugin-development",{"name":7198,"slug":7199,"type":14},"2026-07-12T08:17:35.873862",109,{"items":7266,"total":709},[7267],{"slug":4,"name":4,"fn":5,"description":6,"org":7268,"tags":7269,"stars":24,"repoUrl":25,"updatedAt":26},{"slug":8,"name":9,"logoUrl":10,"githubOrg":11},[7270,7271,7272,7273],{"name":19,"slug":20,"type":14},{"name":22,"slug":23,"type":14},{"name":11,"slug":8,"type":14},{"name":16,"slug":17,"type":14}]