Microsoft Azure API Management AI API

The AI API from Microsoft Azure API Management — 3 operation(s) for ai.

Documentation

Specifications

SDKs

Code Examples

Schemas & Data

📊
JSONSchema
https://raw.githubusercontent.com/api-evangelist/microsoft-azure-api-management/refs/heads/main/json-schema/ai-gateway-chat-completion-request-schema.json
📊
JSONSchema
https://raw.githubusercontent.com/api-evangelist/microsoft-azure-api-management/refs/heads/main/json-schema/ai-gateway-chat-completion-response-schema.json
📊
JSONSchema
https://raw.githubusercontent.com/api-evangelist/microsoft-azure-api-management/refs/heads/main/json-schema/ai-gateway-completion-request-schema.json
📊
JSONSchema
https://raw.githubusercontent.com/api-evangelist/microsoft-azure-api-management/refs/heads/main/json-schema/ai-gateway-completion-response-schema.json
📊
JSONSchema
https://raw.githubusercontent.com/api-evangelist/microsoft-azure-api-management/refs/heads/main/json-schema/ai-gateway-embedding-request-schema.json
📊
JSONSchema
https://raw.githubusercontent.com/api-evangelist/microsoft-azure-api-management/refs/heads/main/json-schema/ai-gateway-embedding-response-schema.json
📊
JSONSchema
https://raw.githubusercontent.com/api-evangelist/microsoft-azure-api-management/refs/heads/main/json-schema/ai-gateway-mcp-request-schema.json
📊
JSONSchema
https://raw.githubusercontent.com/api-evangelist/microsoft-azure-api-management/refs/heads/main/json-schema/ai-gateway-mcp-response-schema.json
📊
JSONStructure
https://raw.githubusercontent.com/api-evangelist/microsoft-azure-api-management/refs/heads/main/json-structure/ai-gateway-chat-completion-request-structure.json
📊
JSONStructure
https://raw.githubusercontent.com/api-evangelist/microsoft-azure-api-management/refs/heads/main/json-structure/ai-gateway-chat-completion-response-structure.json
📊
JSONStructure
https://raw.githubusercontent.com/api-evangelist/microsoft-azure-api-management/refs/heads/main/json-structure/ai-gateway-completion-request-structure.json
📊
JSONStructure
https://raw.githubusercontent.com/api-evangelist/microsoft-azure-api-management/refs/heads/main/json-structure/ai-gateway-completion-response-structure.json
📊
JSONStructure
https://raw.githubusercontent.com/api-evangelist/microsoft-azure-api-management/refs/heads/main/json-structure/ai-gateway-embedding-request-structure.json
📊
JSONStructure
https://raw.githubusercontent.com/api-evangelist/microsoft-azure-api-management/refs/heads/main/json-structure/ai-gateway-embedding-response-structure.json
📊
JSONStructure
https://raw.githubusercontent.com/api-evangelist/microsoft-azure-api-management/refs/heads/main/json-structure/ai-gateway-mcp-request-structure.json
📊
JSONStructure
https://raw.githubusercontent.com/api-evangelist/microsoft-azure-api-management/refs/heads/main/json-structure/ai-gateway-mcp-response-structure.json

Other Resources

🔗
SDKs
https://github.com/Azure/azure-sdk-for-python/tree/main/sdk/apimanagement
🔗
SDKs
https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/apimanagement
🔗
SDKs
https://github.com/Azure/azure-sdk-for-java/tree/main/sdk/apimanagement
🔗
SDKs
https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/apimanagement
🔗
SDKs
https://github.com/Azure/azure-sdk-for-go/tree/main/sdk/resourcemanager/apimanagement
🔗
Tutorials
https://learn.microsoft.com/en-us/azure/api-management/transform-api
🔗
PolicySnippets
https://github.com/Azure/api-management-policy-snippets
🔗
Tools
https://github.com/Azure/azure-api-management-policy-toolkit
🔗
HelmChart
https://github.com/Azure/api-management-self-hosted-gateway/tree/main/helm-charts/azure-api-management-gateway
🔗
MCPServerOverview
https://learn.microsoft.com/en-us/azure/api-management/mcp-server-overview
🔗
ExportRESTToMCP
https://learn.microsoft.com/en-us/azure/api-management/export-rest-mcp-server
🔗
ProxyExistingMCP
https://learn.microsoft.com/en-us/azure/api-management/expose-existing-mcp-server
🔗
A2AAgentAPI
https://learn.microsoft.com/en-us/azure/api-management/agent-to-agent-api
🔗
TokenLimitPolicy
https://learn.microsoft.com/en-us/azure/api-management/llm-token-limit-policy
🔗
SemanticCaching
https://learn.microsoft.com/en-us/azure/api-management/azure-openai-enable-semantic-caching
🔗
ContentSafetyPolicy
https://learn.microsoft.com/en-us/azure/api-management/llm-content-safety-policy
🔗
ReferenceArchitecture
https://github.com/Azure-Samples/ai-hub-gateway-solution-accelerator
🔗
JSONLD
https://raw.githubusercontent.com/api-evangelist/microsoft-azure-api-management/refs/heads/main/json-ld/microsoft-azure-api-management-ai-gateway-context.jsonld
🔗
Examples
https://raw.githubusercontent.com/api-evangelist/microsoft-azure-api-management/refs/heads/main/examples/ai-gateway-chat-completion-request-example.json
🔗
Examples
https://raw.githubusercontent.com/api-evangelist/microsoft-azure-api-management/refs/heads/main/examples/ai-gateway-chat-completion-response-example.json
🔗
Examples
https://raw.githubusercontent.com/api-evangelist/microsoft-azure-api-management/refs/heads/main/examples/ai-gateway-completion-request-example.json
🔗
Examples
https://raw.githubusercontent.com/api-evangelist/microsoft-azure-api-management/refs/heads/main/examples/ai-gateway-completion-response-example.json
🔗
Examples
https://raw.githubusercontent.com/api-evangelist/microsoft-azure-api-management/refs/heads/main/examples/ai-gateway-embedding-request-example.json
🔗
Examples
https://raw.githubusercontent.com/api-evangelist/microsoft-azure-api-management/refs/heads/main/examples/ai-gateway-embedding-response-example.json
🔗
Examples
https://raw.githubusercontent.com/api-evangelist/microsoft-azure-api-management/refs/heads/main/examples/ai-gateway-mcp-request-example.json
🔗
Examples
https://raw.githubusercontent.com/api-evangelist/microsoft-azure-api-management/refs/heads/main/examples/ai-gateway-mcp-response-example.json
🔗
Tutorials
https://learn.microsoft.com/en-us/azure/api-management/api-management-howto-developer-portal-customize

OpenAPI Specification

microsoft-azure-api-management-ai-api-openapi.yml Raw ↑
openapi: 3.0.3
info:
  title: Azure API Management Gateway AI API
  description: The AI gateway capabilities in Azure API Management provide specialized features for managing, securing, and observing AI backend APIs including Azure OpenAI, OpenAI-compatible LLMs, MCP servers, and A2A agent APIs. Includes token rate limiting, semantic caching, load balancing across AI backends, and content safety enforcement.
  version: '2024-05-01'
  contact:
    name: Microsoft Azure
    url: https://learn.microsoft.com/en-us/azure/api-management/genai-gateway-capabilities
servers:
- url: https://{service-name}.azure-api.net
tags:
- name: AI
paths:
  /deployments/{deployment-id}/chat/completions:
    post:
      summary: Microsoft Azure API Management Chat Completions Via AI Gateway
      operationId: AIGateway_ChatCompletions
      tags:
      - AI
      description: Proxies chat completion requests to Azure OpenAI or compatible backends with token rate limiting, semantic caching, and load balancing.
      x-microcks-operation:
        delay: 0
        dispatcher: FALLBACK
      parameters:
      - name: deployment-id
        in: path
        required: true
        schema:
          type: string
        example: gpt-4o-deployment
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ChatCompletionRequest'
            examples:
              ChatCompletionExample:
                summary: Basic chat completion request
                value:
                  messages:
                  - role: system
                    content: You are a helpful assistant.
                  - role: user
                    content: What is Azure API Management?
                  max_tokens: 256
                  temperature: 0.7
      responses:
        '200':
          description: Chat completion response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ChatCompletionResponse'
              examples:
                ChatCompletionExample:
                  summary: Successful chat completion
                  value:
                    id: chatcmpl-abc123def456
                    object: chat.completion
                    created: 1714000000
                    model: gpt-4o
                    choices:
                    - index: 0
                      message:
                        role: assistant
                        content: Azure API Management is a hybrid, multicloud management platform for APIs across all environments.
                      finish_reason: stop
                    usage:
                      prompt_tokens: 24
                      completion_tokens: 18
                      total_tokens: 42
              x-microcks-default:
                id: chatcmpl-abc123def456
                object: chat.completion
                created: 1714000000
                model: gpt-4o
  /deployments/{deployment-id}/completions:
    post:
      summary: Microsoft Azure API Management Completions Via AI Gateway
      operationId: AIGateway_Completions
      tags:
      - AI
      description: Proxies completion requests to AI backends.
      x-microcks-operation:
        delay: 0
        dispatcher: FALLBACK
      parameters:
      - name: deployment-id
        in: path
        required: true
        schema:
          type: string
        example: gpt-4o-deployment
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CompletionRequest'
            examples:
              CompletionExample:
                summary: Basic completion request
                value:
                  prompt: Explain the benefits of API management in
                  max_tokens: 128
                  temperature: 0.7
      responses:
        '200':
          description: Completion response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CompletionResponse'
              examples:
                CompletionExample:
                  summary: Successful completion
                  value:
                    id: cmpl-xyz789
                    object: text_completion
                    created: 1714000000
                    model: gpt-4o
                    choices:
                    - index: 0
                      text: enterprise environments includes centralized governance, security enforcement, and developer experience improvements.
                      finish_reason: stop
                    usage:
                      prompt_tokens: 10
                      completion_tokens: 15
                      total_tokens: 25
              x-microcks-default:
                id: cmpl-xyz789
                object: text_completion
  /deployments/{deployment-id}/embeddings:
    post:
      summary: Microsoft Azure API Management Embeddings Via AI Gateway
      operationId: AIGateway_Embeddings
      tags:
      - AI
      description: Proxies embedding requests to AI backends.
      x-microcks-operation:
        delay: 0
        dispatcher: FALLBACK
      parameters:
      - name: deployment-id
        in: path
        required: true
        schema:
          type: string
        example: text-embedding-ada-002-deployment
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/EmbeddingRequest'
            examples:
              EmbeddingExample:
                summary: Basic embedding request
                value:
                  input: Azure API Management provides a unified gateway for APIs.
                  model: text-embedding-ada-002
      responses:
        '200':
          description: Embedding response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/EmbeddingResponse'
              examples:
                EmbeddingExample:
                  summary: Successful embedding
                  value:
                    object: list
                    data:
                    - object: embedding
                      index: 0
                      embedding:
                      - 0.0023
                      - -0.0091
                      - 0.0152
                    model: text-embedding-ada-002
                    usage:
                      prompt_tokens: 12
                      total_tokens: 12
              x-microcks-default:
                object: list
                model: text-embedding-ada-002
components:
  schemas:
    EmbeddingResponse:
      type: object
      properties:
        object:
          type: string
          example: list
        data:
          type: array
          items:
            type: object
            properties:
              object:
                type: string
                example: embedding
              index:
                type: integer
                example: 0
              embedding:
                type: array
                items:
                  type: number
        model:
          type: string
          example: text-embedding-ada-002
        usage:
          type: object
          properties:
            prompt_tokens:
              type: integer
              example: 12
            total_tokens:
              type: integer
              example: 12
    ChatCompletionResponse:
      type: object
      properties:
        id:
          type: string
          example: chatcmpl-abc123def456
        object:
          type: string
          example: chat.completion
        created:
          type: integer
          example: 1714000000
        model:
          type: string
          example: gpt-4o
        choices:
          type: array
          items:
            type: object
            properties:
              index:
                type: integer
                example: 0
              message:
                type: object
                properties:
                  role:
                    type: string
                    example: assistant
                  content:
                    type: string
                    example: Azure API Management is a hybrid, multicloud management platform for APIs across all environments.
              finish_reason:
                type: string
                example: stop
        usage:
          type: object
          properties:
            prompt_tokens:
              type: integer
              example: 24
            completion_tokens:
              type: integer
              example: 18
            total_tokens:
              type: integer
              example: 42
    CompletionResponse:
      type: object
      properties:
        id:
          type: string
          example: cmpl-xyz789
        object:
          type: string
          example: text_completion
        created:
          type: integer
          example: 1714000000
        model:
          type: string
          example: gpt-4o
        choices:
          type: array
          items:
            type: object
            properties:
              index:
                type: integer
                example: 0
              text:
                type: string
                example: enterprise environments includes centralized governance and security.
              finish_reason:
                type: string
                example: stop
        usage:
          type: object
          properties:
            prompt_tokens:
              type: integer
              example: 10
            completion_tokens:
              type: integer
              example: 15
            total_tokens:
              type: integer
              example: 25
    EmbeddingRequest:
      type: object
      properties:
        input:
          type: string
          example: Azure API Management provides a unified gateway for APIs.
        model:
          type: string
          example: text-embedding-ada-002
    ChatCompletionRequest:
      type: object
      properties:
        messages:
          type: array
          items:
            type: object
            properties:
              role:
                type: string
                example: user
              content:
                type: string
                example: What is Azure API Management?
        max_tokens:
          type: integer
          example: 256
        temperature:
          type: number
          example: 0.7
    CompletionRequest:
      type: object
      properties:
        prompt:
          type: string
          example: Explain the benefits of API management in
        max_tokens:
          type: integer
          example: 128
        temperature:
          type: number
          example: 0.7
externalDocs:
  description: Documentation
  url: https://learn.microsoft.com/en-us/azure/api-management/genai-gateway-capabilities
x-generated-from: documentation