AI Gateway · JSON Structure

Ai Gateway Policy Structure

A reusable AI gateway policy — guardrail, cost control, rate limit, access rule, data-residency constraint, audit configuration, or transformation — attachable to routes, tenants, or virtual keys.

Type: object Properties: 12 Required: 4
AI GatewayLLM RouterLLM ProxyModel RoutingPrompt FirewallGuardrailsAI ObservabilityCost ControlsAI GovernanceAPI Gateway

AIGatewayPolicy is a JSON Structure definition published by AI Gateway, describing 12 properties, of which 4 are required. It conforms to the https://json-structure.org/meta/core/v0/# meta-schema.

Properties

policyId name kind stage scope guardrail cost rateLimit access dataResidency audit enabled

Meta-schema: https://json-structure.org/meta/core/v0/#

JSON Structure

Raw ↑
{
  "$schema": "https://json-structure.org/meta/core/v0/#",
  "$id": "https://raw.githubusercontent.com/api-evangelist/ai-gateway/refs/heads/main/json-structure/ai-gateway-policy-structure.json",
  "name": "AIGatewayPolicy",
  "description": "A reusable AI gateway policy — guardrail, cost control, rate limit, access rule, data-residency constraint, audit configuration, or transformation — attachable to routes, tenants, or virtual keys.",
  "type": "object",
  "properties": {
    "policyId": { "type": "string", "example": "pii-redaction-default" },
    "name": { "type": "string", "example": "PII Redaction" },
    "kind": { "type": "string", "example": "guardrail" },
    "stage": { "type": "string", "example": "both" },
    "scope": { "type": "string", "example": "tenant" },
    "guardrail": {
      "type": "object",
      "properties": {
        "type": { "type": "string", "example": "pii" },
        "categories": {
          "type": "array",
          "items": { "type": "string" }
        },
        "action": { "type": "string", "example": "redact" },
        "engine": { "type": "string", "example": "presidio" }
      }
    },
    "cost": {
      "type": "object",
      "properties": {
        "limit": { "type": "float", "example": 1000.0 },
        "currency": { "type": "string", "example": "USD" },
        "period": { "type": "string", "example": "monthly" },
        "action": { "type": "string", "example": "block" }
      }
    },
    "rateLimit": {
      "type": "object",
      "properties": {
        "requestsPerMinute": { "type": "int32", "example": 600 },
        "tokensPerMinute": { "type": "int32", "example": 200000 },
        "concurrency": { "type": "int32", "example": 32 }
      }
    },
    "access": {
      "type": "object",
      "properties": {
        "roles": {
          "type": "array",
          "items": { "type": "string" }
        },
        "allowedModels": {
          "type": "array",
          "items": { "type": "string" }
        },
        "deniedModels": {
          "type": "array",
          "items": { "type": "string" }
        }
      }
    },
    "dataResidency": {
      "type": "object",
      "properties": {
        "allowedRegions": {
          "type": "array",
          "items": { "type": "string" }
        },
        "deniedProviders": {
          "type": "array",
          "items": { "type": "string" }
        }
      }
    },
    "audit": {
      "type": "object",
      "properties": {
        "logRequestBody": { "type": "boolean", "example": true },
        "logResponseBody": { "type": "boolean", "example": true },
        "retentionDays": { "type": "int32", "example": 90 },
        "sink": { "type": "string", "example": "s3://ai-audit-logs/prod" }
      }
    },
    "enabled": { "type": "boolean", "example": true }
  },
  "required": ["policyId", "kind", "stage", "scope"]
}

Work with this as data

Every JSON Structure here is available over the APIs.io API and to AI agents over MCP.

MCP server

One button, every client — Claude, Cursor, VS Code and the rest.

https://apis.io/mcp

Tools for json structure

4 MCP tools reach this
  • find_json_structuresBrowse and filter every JSON Structure in the catalog.
  • apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.
  • resolveTurn a domain, URL or GitHub org into the provider it belongs to.
  • find_cohortsEvery scored population of providers in the catalog.
All 92 tools →

Call it yourself

curl for this page
This JSON Structure
curl "https://apis.io/api/v1/json-structures/ai-gateway-policy-structure"
All json structure
curl "https://apis.io/api/v1/json-structures?limit=25"

Discovery needs no key. Ratings and market analysis are Pro.

Get an API key

Free tier, no form to fill in. Signing in shares your email address with us — we store it to create your key and to recognise you if you sign in with another provider. See our Privacy Policy and Terms.

A second provider on the same verified email joins the account you already have.