<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Apache APISIX - Medium]]></title>
        <description><![CDATA[Apache APISIX provides rich traffic management features like Load Balancing, Dynamic Upstream, Canary Release, Circuit Breaking, Authentication, Observability, and more… - Medium]]></description>
        <link>https://medium.com/apache-apisix?source=rss----5b898720c0b8---4</link>
        <image>
            <url>https://cdn-images-1.medium.com/proxy/1*TGH72Nnw24QL3iV9IOm4VA.png</url>
            <title>Apache APISIX - Medium</title>
            <link>https://medium.com/apache-apisix?source=rss----5b898720c0b8---4</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Thu, 19 Nov 2026 09:30:03 GMT</lastBuildDate>
        <atom:link href="https://medium.com/feed/apache-apisix" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Release Apache APISIX Ingress Controller 2.0]]></title>
            <link>https://medium.com/apache-apisix/release-apache-apisix-ingress-controller-2-0-2fca62338adb?source=rss----5b898720c0b8---4</link>
            <guid isPermaLink="false">https://medium.com/p/2fca62338adb</guid>
            <category><![CDATA[nginx-ingress]]></category>
            <category><![CDATA[apache-apisix]]></category>
            <category><![CDATA[nginx-ingress-controller]]></category>
            <category><![CDATA[ingress]]></category>
            <category><![CDATA[ingresscontroller]]></category>
            <dc:creator><![CDATA[YiliaLin]]></dc:creator>
            <pubDate>Mon, 22 Dec 2025 07:22:48 GMT</pubDate>
            <atom:updated>2025-12-22T07:22:20.204Z</atom:updated>
            <content:encoded><![CDATA[<blockquote><em>Apache APISIX Ingress Controller 2.0 is officially released. It delivers comprehensive Gateway API support, flexible multi-data-plane deployment, and etcd-free operation for robust, scalable Kubernetes traffic management.</em></blockquote><p>Built on the high-performance API gateway Apache APISIX, <a href="https://github.com/apache/apisix-ingress-controller">APISIX Ingress Controller</a> has undergone multiple iterations and validations, and is now capable of handling large-scale traffic management demands. The Apache APISIX community is pleased to announce the official release of <a href="https://apisix.apache.org/docs/ingress-controller/overview/">APISIX Ingress Controller 2.0</a>. This release delivers substantial enhancements across three foundational pillars — comprehensive compatibility, adaptable architecture, and enterprise-grade stability — empowering users to migrate their technology stacks smoothly and reliably.</p><h3>Highlights of Apache APISIX Ingress Controller 2.0</h3><h3>Support Gateway API</h3><p>This release achieves a significant milestone in Gateway API coverage with the addition of TCPRoute, UDPRoute, GRPCRoute, and TLSRoute. These extensions provide native, protocol-aware routing for a wide range of traffic types — from traditional HTTP and TCP/UDP to modern gRPC and TLS passthrough/termination. This unified support allows organizations to manage diverse ingress requirements within a consistent, future-ready configuration model, simplifying multi-protocol deployment and easing the transition to full Gateway API adoption.</p><h3>Introduce Gateway API Extensions</h3><p>Building upon adherence to the Gateway API design principles, APISIX Ingress Controller 2.0 introduces a set of API extensions under apisix.apache.org/v1alpha1 based on the Gateway API. These extensions provide additional capabilities not currently directly covered by the standard Gateway API, while maintaining the core semantics and usage patterns of the standard resources. They are designed to meet more complex and diverse real-world usage scenarios.</p><ul><li>GatewayProxy: It defines the connection between the APISIX Ingress Controller and the APISIX, including auth, endpoints, and global plugins. It is referenced via parametersRef in Gateway, GatewayClass, or IngressClass resources.</li><li>BackendTrafficPolicy: It is for fine-grained traffic management of backend services, including load balancing, timeouts, retries, and host header handling in the APISIX Ingress Controller.</li><li>Consumer: It defines API consumers and their credentials, enabling authentication and plugin configuration for controlling access to API endpoints.</li><li>PluginConfig: It defines reusable plugin configurations that can be referenced by other resources like HTTPRoute, enabling separation of routing logic and plugin settings for better reusability and manageability.</li><li>HTTPRoutePolicy: It configures advanced traffic management and routing policies for HTTPRoute or Ingress resources, enhancing functionality without modifying the original resources.</li></ul><p>These extensions offer a standardized, vendor-supported path to leverage advanced APISIX features directly within the Gateway API ecosystem.</p><h3>Support APISIX Standalone API-Driven Mode</h3><p>APISIX Ingress Controller 2.0 offers a lightweight, etcd-free deployment option through its Standalone <a href="https://apisix.apache.org/docs/apisix/deployment-modes/#api-driven">API-Driven Mode</a>.</p><p>This deployment paradigm stores routing configurations entirely in memory rather than in a configuration file. Updates are performed through a dedicated Standalone Admin API, which replaces the full configuration in a single operation and takes effect immediately via hot reloading, without requiring a restart.</p><p>This mode is designed specifically for the APISIX Ingress Controller and is primarily intended for integration with <a href="https://github.com/api7/adc">ADC (API Declarative CLI)</a>.</p><h3>Support Multi-Data-Plane Deployment Mode</h3><p>This release introduces flexible deployment options supporting multiple data plane modes, enabling a single ingress controller to manage several independent APISIX instances. This approach is ideal for environments requiring strict isolation — such as multi-tenancy, staging vs. production, or region-based routing — while maintaining centralized control.</p><h4>Admin API Mode</h4><p>In the traditional deployment approach, APISIX uses etcd as its configuration center, allowing administrators to dynamically manage routes, upstreams, and other resources through RESTful APIs. It supports distributed cluster deployments with real-time configuration synchronization.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*IwDUgP2SQq8PmB3n" /></figure><h4>Standalone Mode</h4><p>APISIX can also run independently without relying on etcd, which is especially well‑suited for Kubernetes and single‑node deployments. It stores configurations in memory and manages them through the dedicated /apisix/admin/configs endpoint.</p><p>This mode is particularly suitable for Kubernetes environments and single-node deployments, where the API-driven memory management approach combines the convenience of traditional Admin API with the simplicity of Standalone mode.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*JE77km69ugHr_Jv5" /></figure><p>This multi-mode strategy empowers organizations to tailor their ingress architecture to diverse requirements without sacrificing manageability or control.</p><h3>Conclusion</h3><p>Apache APISIX Ingress Controller 2.0 represents a significant evolution in Kubernetes ingress management, delivering a robust platform built for the complexity of modern, multi-protocol applications. By uniting comprehensive Gateway API support, extensible configuration through official API extensions, a lightweight standalone deployment mode, and versatile multi-data-plane management, this release provides a cohesive and powerful foundation for dynamic cloud environments.</p><p>Whether you are standardizing ingress across diverse workloads, seeking greater architectural flexibility, or requiring enterprise-grade stability at scale, APISIX Ingress Controller 2.0 offers a forward-looking solution that simplifies operations without compromising capability. It stands as a testament to the community-driven innovation within the Apache APISIX ecosystem, designed to meet today’s demands while adapting to tomorrow’s challenges.</p><blockquote><em>For a complete list of features and changes, please refer to the </em><a href="https://github.com/apache/apisix-ingress-controller/blob/2.0.0/CHANGELOG.md#200"><em>Release Changelog</em></a><em>.</em></blockquote><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=2fca62338adb" width="1" height="1" alt=""><hr><p><a href="https://medium.com/apache-apisix/release-apache-apisix-ingress-controller-2-0-2fca62338adb">Release Apache APISIX Ingress Controller 2.0</a> was originally published in <a href="https://medium.com/apache-apisix">Apache APISIX</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Load Balancing AI/ML API with Apache APISIX]]></title>
            <link>https://medium.com/apache-apisix/load-balancing-ai-ml-api-with-apache-apisix-4762e38052f1?source=rss----5b898720c0b8---4</link>
            <guid isPermaLink="false">https://medium.com/p/4762e38052f1</guid>
            <category><![CDATA[ai]]></category>
            <category><![CDATA[ai-gateway]]></category>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[api]]></category>
            <category><![CDATA[apache-apisix]]></category>
            <dc:creator><![CDATA[YiliaLin]]></dc:creator>
            <pubDate>Thu, 31 Jul 2025 09:23:46 GMT</pubDate>
            <atom:updated>2025-07-31T09:23:46.783Z</atom:updated>
            <content:encoded><![CDATA[<blockquote><em>This blog provides a step-by-step guide to configure Apache APISIX for AI traffic splitting and load balancing between API versions, covering security setup, canary testing, and deployment monitoring.</em></blockquote><h3>Overview<a href="https://apisix.apache.org/blog/2025/07/31/load-balancing-between-ai-ml-api-with-apisix/#overview">​</a></h3><p><a href="https://aimlapi.com/"><strong>AI/ML API</strong></a> is a one-stop, OpenAI-compatible endpoint that is trusted by 150,000+ developers to 300+ state-of-the-art models — chat, vision, image/video/music generation, embeddings, OCR, and more — from Google, Meta, OpenAI, Anthropic, Mistral, and others.</p><p><a href="https://github.com/apache/apisix"><strong>Apache APISIX</strong></a> is a dynamic, real-time, high-performance API Gateway. APISIX API Gateway provides rich traffic management features and can serve as an AI Gateway through its flexible plugin system.</p><p>Modern AI workloads often require smooth version migrations, A/B testing, and rolling updates. This guide shows you how to:</p><ol><li><strong>Install</strong> Apache APISIX with Docker quickstart.</li><li><strong>Secure</strong> the Admin API with keys and IP whitelisting.</li><li><strong>Define</strong> separate routes for API versions v1 and v2.</li><li><strong>Implement</strong> weighted traffic splitting (50/50) via the traffic-split plugin.</li><li><strong>Verify</strong> the newly created split endpoint functionality.</li><li><strong>Load test</strong> and <strong>monitor</strong> distribution accuracy.</li></ol><p>To perform authenticated requests, you’ll need an AI/ML API key. You can get one at <a href="https://aimlapi.com/app/keys?utm_source=apisix&amp;utm_medium=guide&amp;utm_campaign=integration">https://aimlapi.com/app/keys/</a> and use it as a Bearer token in your Authorization headers.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*iDpopHCP5oY4EH-Qi_CRsw.png" /></figure><h3>Quickstart Installation<a href="https://apisix.apache.org/blog/2025/07/31/load-balancing-between-ai-ml-api-with-apisix/#quickstart-installation">​</a></h3><pre># 1. Download and run the quickstart script (includes etcd + APISIX)<br>curl -sL https://run.api7.ai/apisix/quickstart | sh<br><br># 2. Confirm APISIX is up and running<br>curl -I http://127.0.0.1:9080 | grep Server<br># ➜ Server: APISIX/3.13.0</pre><blockquote><strong><em>Tip:</em></strong><em> If you encounter port conflicts, adjust Docker host networking or map to different ports in the quickstart script.</em></blockquote><h3>Secure the Admin API<a href="https://apisix.apache.org/blog/2025/07/31/load-balancing-between-ai-ml-api-with-apisix/#secure-the-admin-api">​</a></h3><p>By default, quickstart bypasses Admin API authentication. For any non-development environment, enforce security:</p><h3>1. Set an Admin Key<a href="https://apisix.apache.org/blog/2025/07/31/load-balancing-between-ai-ml-api-with-apisix/#1-set-an-admin-key">​</a></h3><p>Edit conf/config.yaml inside the APISIX container or local install directory, replacing the example key with your own API key obtained from the link above:</p><pre>apisix:<br>  enable_admin: true            # Enable Admin API<br>  admin_key_required: true      # Reject unauthenticated Admin requests<br>  admin_key:<br>    - name: admin<br>      key: YOUR_ADMIN_KEY_HERE  # Generated admin key - you can replace this with a secure key as you wish<br>      role: admin</pre><blockquote><strong><em>Security Best Practice:</em></strong><em> Use at least 32 characters, mix letters/numbers/symbols, and rotate keys quarterly.</em></blockquote><h3>2. Whitelist Management IPs (allow_admin)<a href="https://apisix.apache.org/blog/2025/07/31/load-balancing-between-ai-ml-api-with-apisix/#2-whitelist-management-ips-allow_admin">​</a></h3><p>Add your management or local networks under the admin: section:</p><pre>admin:<br>  allow_admin:<br>    - 127.0.0.0/24   # Localhost &amp; host network<br>    - 0.0.0.0/0      # Allow all (temporary/testing only)</pre><blockquote><strong><em>Warning:</em></strong><em> </em><em>0.0.0.0/0 opens Admin API to the world! Lock this down to specific subnets in production.</em></blockquote><h3>3. Restart APISIX<a href="https://apisix.apache.org/blog/2025/07/31/load-balancing-between-ai-ml-api-with-apisix/#3-restart-apisix">​</a></h3><pre>docker restart apisix-quickstart</pre><blockquote><strong><em>Check Logs:</em></strong><em> </em><em>docker logs apisix-quickstart --tail 50 to ensure no errors about admin authentication.</em></blockquote><h3>Define Basic Routes for v1 and v2<a href="https://apisix.apache.org/blog/2025/07/31/load-balancing-between-ai-ml-api-with-apisix/#define-basic-routes-for-v1-and-v2">​</a></h3><p>Before splitting traffic, ensure each version works individually.</p><h3>1. Route for v1<a href="https://apisix.apache.org/blog/2025/07/31/load-balancing-between-ai-ml-api-with-apisix/#1-route-for-v1">​</a></h3><pre>curl -i http://127.0.0.1:9180/apisix/admin/routes/test-v1 \<br>  -X PUT \<br>  -H &quot;X-API-KEY: YOUR_ADMIN_KEY_HERE&quot; \<br>  -d &#39;{<br>    &quot;uri&quot;: &quot;/test/v1&quot;,<br>    &quot;upstream&quot;: {<br>      &quot;type&quot;: &quot;roundrobin&quot;,<br>      &quot;nodes&quot;: {&quot;api.aimlapi.com:443&quot;: 1},<br>      &quot;scheme&quot;: &quot;https&quot;,<br>      &quot;pass_host&quot;: &quot;node&quot;<br>    }<br>  }&#39;</pre><blockquote><strong><em>Tip:</em></strong><em> Use </em><em>id fields if you want to manage or delete routes easily later.</em></blockquote><h3>2. Route for v2<a href="https://apisix.apache.org/blog/2025/07/31/load-balancing-between-ai-ml-api-with-apisix/#2-route-for-v2">​</a></h3><pre>curl -i http://127.0.0.1:9180/apisix/admin/routes/test-v2 \<br>  -X PUT \<br>  -H &quot;X-API-KEY: YOUR_ADMIN_KEY_HERE&quot; \<br>  -d &#39;{<br>    &quot;uri&quot;: &quot;/test/v2&quot;,<br>    &quot;upstream&quot;: {<br>      &quot;type&quot;: &quot;roundrobin&quot;,<br>      &quot;nodes&quot;: {&quot;api.aimlapi.com:443&quot;: 1},<br>      &quot;scheme&quot;: &quot;https&quot;,<br>      &quot;pass_host&quot;: &quot;node&quot;<br>    }<br>  }&#39;</pre><h3>Implement Traffic Splitting (50/50)<a href="https://apisix.apache.org/blog/2025/07/31/load-balancing-between-ai-ml-api-with-apisix/#implement-traffic-splitting-5050">​</a></h3><p>Use the <a href="https://apisix.apache.org/docs/apisix/plugins/traffic-split/">traffic-split</a> plugin for controlled distribution between v1 and v2. In the admin request below, replace YOUR_ADMIN_KEY_HERE with your actual key.</p><pre>curl -i http://127.0.0.1:9180/apisix/admin/routes/aimlapi-split \<br>  -X PUT \<br>  -H &quot;X-API-KEY: YOUR_ADMIN_KEY_HERE&quot; \<br>  -d &#39;{<br>    &quot;id&quot;: &quot;aimlapi-split&quot;,<br>    &quot;uri&quot;: &quot;/chat/completions&quot;,<br>    &quot;upstream&quot;: {<br>      &quot;type&quot;: &quot;roundrobin&quot;,<br>      &quot;nodes&quot;: {&quot;api.aimlapi.com:443&quot;: 1},<br>      &quot;scheme&quot;: &quot;https&quot;,<br>      &quot;pass_host&quot;: &quot;node&quot;<br>    },<br>    &quot;plugins&quot;: {<br>      &quot;traffic-split&quot;: {<br>        &quot;rules&quot;: [<br>          {<br>            &quot;weight&quot;: 50,<br>            &quot;upstream&quot;: {&quot;type&quot;:&quot;roundrobin&quot;,&quot;nodes&quot;:{&quot;api.aimlapi.com:443&quot;:1},&quot;scheme&quot;:&quot;https&quot;,&quot;pass_host&quot;:&quot;node&quot;},<br>            &quot;rewrite&quot;: {&quot;uri&quot;:&quot;/v1/chat/completions&quot;}<br>          },<br>          {<br>            &quot;weight&quot;: 50,<br>            &quot;upstream&quot;: {&quot;type&quot;:&quot;roundrobin&quot;,&quot;nodes&quot;:{&quot;api.aimlapi.com:443&quot;:1},&quot;scheme&quot;:&quot;https&quot;,&quot;pass_host&quot;:&quot;node&quot;},<br>            &quot;rewrite&quot;: {&quot;uri&quot;:&quot;/v2/chat/completions&quot;}<br>          }<br>        ]<br>      }<br>    }<br>  }&#39;</pre><blockquote><strong><em>Tip:</em></strong><em> Adjust the </em><em>weight values to shift traffic ratios (e.g., 80/20 for canary).</em></blockquote><blockquote><strong><em>Note:</em></strong><em> </em><em>rewrite must match the internal API path exactly.</em></blockquote><h3>Verify Split Endpoint Functionality<a href="https://apisix.apache.org/blog/2025/07/31/load-balancing-between-ai-ml-api-with-apisix/#verify-split-endpoint-functionality">​</a></h3><p>Test the /chat/completions endpoint you just created. Replace &lt;AIML_API_KEY&gt; with the key obtained earlier and use it as a Bearer token:</p><pre>curl -v -X POST http://127.0.0.1:9080/chat/completions \<br>  -H &quot;Authorization: Bearer &lt;AIML_API_KEY&gt;&quot; \<br>  -H &quot;Content-Type: application/json&quot; \<br>  -d &#39;{&quot;model&quot;:&quot;gpt-4&quot;,&quot;messages&quot;:[{&quot;role&quot;:&quot;user&quot;,&quot;content&quot;:&quot;ping&quot;}]}&#39;</pre><p><strong>Expected Output:</strong></p><pre>{&quot;content&quot;:&quot;Pong! How can I assist you today?&quot;}</pre><blockquote><strong><em>Tip:</em></strong><em> Use </em><em>-v for verbose output to troubleshoot headers or TLS issues.</em></blockquote><h3>Load Test &amp; Distribution Validation<a href="https://apisix.apache.org/blog/2025/07/31/load-balancing-between-ai-ml-api-with-apisix/#load-test--distribution-validation">​</a></h3><p>After configuring the split route, use the following commands to validate distribution. Replace &lt;AIML_API_KEY&gt; with your Bearer token.</p><pre># 1. Send 100 test requests<br>time seq 100 | xargs -I {} curl -s -o /dev/null -X POST http://127.0.0.1:9080/chat/completions \<br>  -H &quot;Authorization: Bearer &lt;AIML_API_KEY&gt;&quot; \<br>  -H &quot;Content-Type: application/json&quot; \<br>  -d &#39;{&quot;model&quot;:&quot;gpt-4&quot;,&quot;messages&quot;:[{&quot;role&quot;:&quot;user&quot;,&quot;content&quot;:&quot;ping&quot;}]}&#39;<br><br># 2. Check APISIX logs for upstream hits (replace IPs with actual resolved IPs)<br>echo &quot;v1 hits: $(docker logs apisix-quickstart --since 5m | grep -c &#39;188.114.97.3:443&#39;)&quot;<br>echo &quot;v2 hits: $(docker logs apisix-quickstart --since 5m | grep -c &#39;188.114.96.3:443&#39;)&quot;</pre><p><strong>Expected:</strong> Approximately 50 requests to each upstream.</p><blockquote><strong><em>Tip:</em></strong><em> Use Prometheus or OpenTelemetry plugins for real‑time metrics instead of manual log parsing.</em></blockquote><h3>Best Practices &amp; Next Steps<a href="https://apisix.apache.org/blog/2025/07/31/load-balancing-between-ai-ml-api-with-apisix/#best-practices--next-steps">​</a></h3><ul><li><strong>Rate Limiting &amp; Quotas</strong>: Add <a href="https://apisix.apache.org/docs/apisix/plugins/limit-count/">limit-count</a> plugin to protect your upstream from spikes.</li><li><strong>Authentication</strong>: Layer on the <a href="https://apisix.apache.org/docs/apisix/plugins/key-auth/">key-auth</a> plugin for consumer management.</li><li><strong>Circuit Breaker</strong>: Prevent cascading failures with the <a href="https://apisix.apache.org/docs/apisix/plugins/api-breaker/">api-breaker</a> plugin.</li><li><strong>Observability</strong>: Integrate Prometheus, Skywalking, or Loki for dashboards and alerts.</li><li><strong>Infrastructure as Code</strong>: Consider managing APISIX config via Kubernetes CRDs or ADC for reproducibility.</li></ul><h3>References<a href="https://apisix.apache.org/blog/2025/07/31/load-balancing-between-ai-ml-api-with-apisix/#references">​</a></h3><ul><li><a href="https://apisix.apache.org/docs/apisix/getting-started/load-balancing/">APISIX Load Balancing Documentation</a></li><li><a href="https://docs.aimlapi.com/?utm_source=apisix&amp;utm_medium=guide&amp;utm_campaign=integration">AI/ML API Documentation</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=4762e38052f1" width="1" height="1" alt=""><hr><p><a href="https://medium.com/apache-apisix/load-balancing-ai-ml-api-with-apache-apisix-4762e38052f1">Load Balancing AI/ML API with Apache APISIX</a> was originally published in <a href="https://medium.com/apache-apisix">Apache APISIX</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Announcing APISIX Integration with AI/ML API]]></title>
            <link>https://medium.com/apache-apisix/announcing-apisix-integration-with-ai-ml-api-3addefb49e85?source=rss----5b898720c0b8---4</link>
            <guid isPermaLink="false">https://medium.com/p/3addefb49e85</guid>
            <category><![CDATA[ai-gateway]]></category>
            <category><![CDATA[ai]]></category>
            <category><![CDATA[llm]]></category>
            <category><![CDATA[apache-apisix]]></category>
            <category><![CDATA[api]]></category>
            <dc:creator><![CDATA[YiliaLin]]></dc:creator>
            <pubDate>Wed, 30 Jul 2025 09:01:51 GMT</pubDate>
            <atom:updated>2025-07-30T09:27:05.326Z</atom:updated>
            <content:encoded><![CDATA[<blockquote><em>We’re thrilled to announce that </em><strong><em>AI/ML API</em></strong><em> has become a supported provider to the </em><em>ai-proxy, </em><em>ai-proxy-multi, and </em><em>ai-request-rewrite plugins in </em><strong><em>Apache APISIX</em></strong><em>. All the AI/ML APIs will be supported in the next APISIX version.</em></blockquote><h3>Introduction<a href="https://apisix.apache.org/blog/2025/07/29/announcing-integration-of-apisix-and-ai-ml-api/#introduction">​</a></h3><p><a href="https://aimlapi.com/">AI/ML API</a> is a single endpoint that gives you access to more than 300 ready-to-use AI models — large language models, embeddings, image and audio tools — through one standard REST interface. It is used by over 150,000 developers and organizations as a centralized LLM API gateway.</p><p>We’re thrilled to announce that <strong>AI/ML API</strong> has become a supported provider to the ai-proxy, ai-proxy-multi, and ai-request-rewrite plugins in <strong>Apache APISIX</strong>.</p><p>AI/ML API provides a unified OpenAI-compatible API with access to <strong>300+ LLMs</strong> such as GPT-4, Claude, Gemini, DeepSeek, and others. This integration bridges the gap between your API infrastructure and leading AI services, enabling you to deploy intelligent features — like chatbots, real-time translations, and data analysis — faster than ever.</p><h3>Proxy to OpenAI via AI/ML API<a href="https://apisix.apache.org/blog/2025/07/29/announcing-integration-of-apisix-and-ai-ml-api/#proxy-to-openai-via-aiml-api">​</a></h3><h3>Prerequisites<a href="https://apisix.apache.org/blog/2025/07/29/announcing-integration-of-apisix-and-ai-ml-api/#prerequisites">​</a></h3><ol><li><a href="https://apisix.apache.org/docs/apisix/installation-guide/">Install APISIX</a>.</li><li>Generate your API key on the <a href="https://aimlapi.com/app/keys/">AI/ML API dashboard</a>.</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*v26IgpMIBF9n64dWnpMDEw.png" /></figure><h3>Configure the Route<a href="https://apisix.apache.org/blog/2025/07/29/announcing-integration-of-apisix-and-ai-ml-api/#configure-the-route">​</a></h3><p>Create a route and configure the ai-proxy plugin as such:</p><pre>curl &quot;http://127.0.0.1:9180/apisix/admin/routes&quot; -X PUT \<br>  -H &quot;X-API-KEY: ${ADMIN_API_KEY}&quot; \<br>  -d &#39;{<br>    &quot;id&quot;: &quot;ai-proxy-route&quot;,<br>    &quot;uri&quot;: &quot;/anything&quot;,<br>    &quot;methods&quot;: [&quot;POST&quot;],<br>    &quot;plugins&quot;: {<br>      &quot;ai-proxy&quot;: {<br>        &quot;provider&quot;: &quot;aimlapi&quot;,<br>        &quot;auth&quot;: {<br>          &quot;header&quot;: {<br>            &quot;Authorization&quot;: &quot;Bearer &#39;&quot;$OPENAI_API_KEY&quot;&#39;&quot; # Generated openai key from AI/ML API dashboard<br>          }<br>        },<br>        &quot;options&quot;:{<br>          &quot;model&quot;: &quot;gpt-4&quot;<br>        }<br>      }<br>    }<br>  }&#39;</pre><h3>Test the Integration<a href="https://apisix.apache.org/blog/2025/07/29/announcing-integration-of-apisix-and-ai-ml-api/#test-the-integration">​</a></h3><p>Send a POST request to the route with a system prompt and a sample user question in the request body:</p><pre>curl &quot;http://127.0.0.1:9080/anything&quot; -X POST \<br>  -H &quot;Content-Type: application/json&quot; \<br>  -H &quot;Host: api.openai.com&quot; \<br>  -d &#39;{<br>    &quot;messages&quot;: [<br>      { &quot;role&quot;: &quot;system&quot;, &quot;content&quot;: &quot;You are a mathematician&quot; },<br>      { &quot;role&quot;: &quot;user&quot;, &quot;content&quot;: &quot;What is 1+1?&quot; }<br>    ]<br>  }&#39;</pre><h3>Verify Response<a href="https://apisix.apache.org/blog/2025/07/29/announcing-integration-of-apisix-and-ai-ml-api/#verify-response">​</a></h3><p>You should receive a response similar to the following:</p><pre>{<br>  ...,<br>  &quot;choices&quot;: [<br>    {<br>      &quot;index&quot;: 0,<br>      &quot;finish_reason&quot;: &quot;stop&quot;,<br>      &quot;logprobs&quot;: null,<br>      &quot;message&quot;: {<br>        &quot;role&quot;: &quot;assistant&quot;,<br>        &quot;content&quot;: &quot;1 + 1 equals 2.&quot;,<br>        &quot;refusal&quot;: null,<br>        &quot;annotations&quot;: []<br>      }<br>    }<br>  ],<br>  &quot;created&quot;: 1753845968,<br>  &quot;model&quot;: &quot;gpt-4-0613&quot;,<br>  &quot;usage&quot;: {<br>    &quot;prompt_tokens&quot;: 1449,<br>    &quot;completion_tokens&quot;: 1008,<br>    &quot;total_tokens&quot;: 2457<br>  ...<br>}</pre><h3>Core Use Cases<a href="https://apisix.apache.org/blog/2025/07/29/announcing-integration-of-apisix-and-ai-ml-api/#core-use-cases">​</a></h3><p><strong>1.Unified AI Service Management</strong></p><ul><li><strong>Multi-Model Proxy and Load Balancing</strong>: Replace hardcoded vendor endpoints with a single APISIX interface, dynamically routing requests to models from OpenAI, Claude, DeepSeek, Gemini, Mistral, etc., based on cost, latency, or performance needs.</li><li><strong>Vendor-Agnostic Workflows</strong>: Seamlessly switch between models (e.g., GPT-4 for creative tasks, Claude for document analysis) without code changes.</li></ul><p><strong>2. Cost-Optimized Token Governance</strong></p><ul><li><strong>Token-Based Budget Enforcement</strong>: Set per-team/monthly spending limits; auto-throttle requests when thresholds are exceeded.</li><li><strong>Caching &amp; Fallbacks</strong>: Cache frequent LLM responses (e.g., FAQ answers) or reroute to cheaper models during provider outages.</li></ul><p><strong>3. Real-Time AI Application Scaling</strong></p><ul><li><strong>Chatbots &amp; Virtual Agents</strong>: Power low-latency conversational interfaces with streaming support for token-by-token responses.</li><li><strong>Data Enrichment Pipelines</strong>: Augment APIs with AI — e.g., auto-summarize user reviews or translate product descriptions on-the-fly.</li></ul><p><strong>4. Hybrid/Multi-Cloud AI Deployment</strong></p><ul><li><strong>Unified Control Plane</strong>: Manage on-prem LLMs (e.g., Llama 3) alongside cloud APIs (OpenAI, Azure) with consistent policy enforcement.</li><li><strong>High Availability &amp; Fault Tolerance</strong>: Built-in health-checks, automatic retries and failover; if one LLM fails, traffic is rerouted within seconds to keep services alive.</li></ul><p><strong>5. Enterprise AI Security &amp; Compliance</strong></p><ul><li><strong>Data Security and Compliance</strong>: Prompt Guard, content moderation, PII redaction, and full audit logs in a single place.</li><li><strong>One Auth Layer for 300+ LLMs</strong>: Unified authentication (JWT/OAuth2/OIDC) and authorization for 300+ LLM keys and policies.</li></ul><h3>Conclusion<a href="https://apisix.apache.org/blog/2025/07/29/announcing-integration-of-apisix-and-ai-ml-api/#conclusion">​</a></h3><p>With AI/ML API now natively supported in Apache APISIX, you no longer have to choose between <strong>speed</strong>, <strong>security</strong>, or <strong>scale</strong> — you get all three.</p><ul><li><strong>One line of YAML</strong> turns your gateway into a 300-model AI powerhouse.</li><li><strong>Zero code changes</strong> let you hot-swap GPT-4 for Claude, or route 10 % of traffic to a cheaper model for instant cost savings.</li><li><strong>Built-in guardrails</strong> (PII redaction, token budgets, content moderation) keep compliance teams happy while your product team ships faster.</li></ul><h3>More Resources<a href="https://apisix.apache.org/blog/2025/07/29/announcing-integration-of-apisix-and-ai-ml-api/#more-resources">​</a></h3><p>Related APISIX AI Plugins</p><ul><li><a href="https://apisix.apache.org/docs/apisix/plugins/ai-proxy/">ai-proxy</a></li><li><a href="https://apisix.apache.org/docs/apisix/plugins/ai-proxy-multi/">ai-proxy-multi</a></li><li><a href="https://apisix.apache.org/docs/apisix/plugins/ai-request-rewrite/">ai-request-rewrite</a></li></ul><p><a href="https://aimlapi.com/community">AI/ML API Community</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=3addefb49e85" width="1" height="1" alt=""><hr><p><a href="https://medium.com/apache-apisix/announcing-apisix-integration-with-ai-ml-api-3addefb49e85">Announcing APISIX Integration with AI/ML API</a> was originally published in <a href="https://medium.com/apache-apisix">Apache APISIX</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[From stdio to HTTP SSE: Host Your MCP Server with APISIX API Gateway]]></title>
            <link>https://medium.com/apache-apisix/from-stdio-to-http-sse-host-your-mcp-server-with-apisix-api-gateway-3de3efeaace5?source=rss----5b898720c0b8---4</link>
            <guid isPermaLink="false">https://medium.com/p/3de3efeaace5</guid>
            <category><![CDATA[http-sse]]></category>
            <category><![CDATA[stdio]]></category>
            <category><![CDATA[api-gateway]]></category>
            <category><![CDATA[mcp-server]]></category>
            <category><![CDATA[apache-apisix]]></category>
            <dc:creator><![CDATA[YiliaLin]]></dc:creator>
            <pubDate>Mon, 21 Apr 2025 10:18:53 GMT</pubDate>
            <atom:updated>2025-04-21T10:18:53.395Z</atom:updated>
            <content:encoded><![CDATA[<blockquote><em>Discover how the Apache APISIX mcp-bridge plugin seamlessly converts stdio-based MCP servers to scalable HTTP SSE services.</em></blockquote><h3>Introduction<a href="https://apisix.apache.org/blog/2025/04/21/host-mcp-server-with-api-gateway/#introduction">​</a></h3><p>In contemporary API infrastructure, HTTP protocols and streaming communications (like SSE, WebSocket) have become mainstream for building real-time, interactive applications. Over the past few months, the Model Context Protocol (MCP) has gained popularity. However, most MCP Servers are implemented via stdio for local environments and cannot be invoked by external services and developers.</p><p>To bridge these services with modern API architectures, Apache APISIX has introduced the mcp-bridge plugin. It seamlessly converts stdio-based MCP services into HTTP SSE streaming interfaces and manages them through an API gateway for routing and traffic management.</p><h3>Model Context Protocol (MCP) Overview<a href="https://apisix.apache.org/blog/2025/04/21/host-mcp-server-with-api-gateway/#model-context-protocol-mcp-overview">​</a></h3><p>MCP is an open protocol that standardizes how AI applications provide context information to large language models (LLMs). It allows developers to switch between different LLM providers while ensuring data security and facilitating integration with local or remote data sources. Supporting a client-server architecture, MCP servers expose specific functionalities that are accessible to clients via these servers.</p><h3>What Is the mcp-bridge Plugin?<a href="https://apisix.apache.org/blog/2025/04/21/host-mcp-server-with-api-gateway/#what-is-the-mcp-bridge-plugin">​</a></h3><p>The Apache APISIX mcp-bridge plugin launches a subprocess to manage the MCP Server, takes over its stdio channel, transforms client HTTP SSE requests into MCP protocol calls, and pushes responses back to the client via SSE.</p><p>Key features:</p><ul><li>📡 Wraps MCP RPC calls into SSE message streams</li><li>🔄 Manages subprocess stdio lifecycle with queued RPC scheduling</li><li>🗂️ Lightweight MCP session management (including session ID, ping keep-alive, and queuing)</li><li>🧰 Supports session sharing across multiple workers for stability in APISIX multi-worker environments</li></ul><h3>How It Works and Architecture Diagram<a href="https://apisix.apache.org/blog/2025/04/21/host-mcp-server-with-api-gateway/#how-it-works-and-architecture-diagram">​</a></h3><p>Below is a sequence diagram illustrating the working mechanism of the mcp-bridge plugin, helping you to understand the data flow from stdio to SSE:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*OF4nmFBOdMUJJEZWUDBb9A.png" /></figure><p>✅ Highlights:</p><ul><li>APISIX manages SSE long-lived connections</li><li>The mcp-bridge plugin handles subprocesses, stdio, and scheduling queues</li><li>Clients receive real-time subprocess outputs, forming streaming SSE responses</li></ul><h3>Application Scenarios and Benefits<a href="https://apisix.apache.org/blog/2025/04/21/host-mcp-server-with-api-gateway/#application-scenarios-and-benefits">​</a></h3><p>✅ Typical Application Scenarios</p><ul><li>🛠️ Integrating existing MCP/stdio services with web platforms</li><li>🖥️ Cross-language and cross-platform subprocess service management</li></ul><p>✅ Benefits</p><ul><li>🌐 Modernization: Instantly transform stdio services into HTTP SSE APIs</li><li>🕹️ Managed: Unified management of subprocess launch and IO lifecycle</li><li>📈 Scalability: Session sharing in multi-worker environments for large-scale deployment support</li><li>🔄 Traffic Control Integration: Seamless API management system integration with APISIX traffic control, authentication, and rate-limiting plugins</li></ul><h3>Authentication and Rate Limiting with Apache APISIX Plugins<a href="https://apisix.apache.org/blog/2025/04/21/host-mcp-server-with-api-gateway/#authentication-and-rate-limiting-with-apache-apisix-plugins">​</a></h3><p>Apache APISIX provides robust authentication plugins (like OAuth 2.0, JWT, and OIDC) and rate-limiting plugins (such as rate limiting and circuit breakers). These enhance the mcp-bridge plugin, ensuring secure authentication and traffic control for connected MCP services.</p><h3>Authentication Plugins<a href="https://apisix.apache.org/blog/2025/04/21/host-mcp-server-with-api-gateway/#authentication-plugins">​</a></h3><ul><li>Support for OAuth 2.0, JWT, and OIDC plugins to protect APIs and MCP services.</li><li>Automatic client identity verification during API gateway requests to prevent unauthorized access.</li></ul><h3>Rate-Limiting Plugins<a href="https://apisix.apache.org/blog/2025/04/21/host-mcp-server-with-api-gateway/#rate-limiting-plugins">​</a></h3><ul><li>Rate Limiting: Restricts each client’s request rate to prevent system overload.</li><li>Circuit Breaker: Automatically switches or returns errors to avoid system crashes during high traffic or failures.</li></ul><h3>Adding Authentication and Rate Limiting to MCP Servers<a href="https://apisix.apache.org/blog/2025/04/21/host-mcp-server-with-api-gateway/#adding-authentication-and-rate-limiting-to-mcp-servers">​</a></h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*3sn7ED8GfzkgN-kIQpvI2g.png" /></figure><p>By integrating authentication and rate-limiting plugins with the mcp-bridge plugin, you can enhance API security and ensure system stability in high-concurrency environments.</p><h3>Roadmap<a href="https://apisix.apache.org/blog/2025/04/21/host-mcp-server-with-api-gateway/#roadmap">​</a></h3><p>The current version is a prototype. Future enhancements include:</p><ul><li>Currently, MCP sessions are not shared across multiple APISIX instances. For multi-node APISIX clusters, proper session persistence configuration on the front-end load balancer is essential to ensure requests from the same client always go to the same APISIX instance.</li><li>The current MCP SSE connection is loop-driven. While the loop doesn’t consume many resources (stdio read/write will be synchronous non-blocking calls), it’s not efficient. We plan to connect to a message queue for an event-driven, scalable cluster approach.</li><li>The MCP session management module is just a prototype. We intend to abstract an MCP proxy server module to support launching MCP servers within APISIX for advanced scenarios. This proxy server module will be event-driven rather than loop-driven.</li></ul><h3>Summary<a href="https://apisix.apache.org/blog/2025/04/21/host-mcp-server-with-api-gateway/#summary">​</a></h3><p>The Apache APISIX mcp-bridge plugin significantly simplifies the integration of Model Context Protocol (MCP) services with the HTTP API world. It offers a modern streaming interface management approach for traditional services.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=3de3efeaace5" width="1" height="1" alt=""><hr><p><a href="https://medium.com/apache-apisix/from-stdio-to-http-sse-host-your-mcp-server-with-apisix-api-gateway-3de3efeaace5">From stdio to HTTP SSE: Host Your MCP Server with APISIX API Gateway</a> was originally published in <a href="https://medium.com/apache-apisix">Apache APISIX</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[APISIX-MCP: Embracing Intelligent API Management with AI + MCP]]></title>
            <link>https://medium.com/apache-apisix/apisix-mcp-embracing-intelligent-api-management-with-ai-mcp-76edd30740bf?source=rss----5b898720c0b8---4</link>
            <guid isPermaLink="false">https://medium.com/p/76edd30740bf</guid>
            <category><![CDATA[ai-gateway]]></category>
            <category><![CDATA[api-gateway]]></category>
            <category><![CDATA[mcp-server]]></category>
            <category><![CDATA[ai]]></category>
            <category><![CDATA[apache-apisix]]></category>
            <dc:creator><![CDATA[YiliaLin]]></dc:creator>
            <pubDate>Wed, 02 Apr 2025 03:03:30 GMT</pubDate>
            <atom:updated>2025-04-02T03:03:30.603Z</atom:updated>
            <content:encoded><![CDATA[<blockquote><em>This article introduces the MCP protocol and its application in APISIX-MCP. APISIX-MCP simplifies API management through natural language interaction, supporting the creation, updating, and deletion of resources.</em></blockquote><h3>Preface</h3><p>With the explosive growth of large-scale AI model applications, many traditional systems are eager to integrate AI capabilities quickly. However, the current landscape of AI tools lacks unified standards, resulting in severe fragmentation. Different models vary in capability and integration methods, creating significant challenges for traditional applications during adoption.</p><p>Against this backdrop, in late 2024, Anthropic — the company behind the renowned Claude model — introduced the Model Context Protocol (MCP). MCP positions itself as the “USB-C interface” for AI applications. Just as USB-C standardizes connections for peripherals and accessories, MCP provides a standardized approach for AI models to connect with diverse data sources and tools.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*DbiVF5hCdy_ToaMk" /></figure><p>Numerous services and applications have already adopted MCP. For example:</p><ul><li>GitHub-MCP enables natural language code submissions and PR creation.</li><li>Figma MCP allows AI to generate UI designs directly.</li><li>With Browser-tools-MCP, tools like Cursor can debug code by interacting with DOM elements and console logs.</li></ul><p>The official MCP repository includes implementations for Google Drive, Slack, Git, and various databases. As an open standard, MCP has gained widespread recognition in the AI community, attracting third-party developers who contribute hundreds of new MCP services daily. Anthropic, as the founder, actively drives MCP’s evolution by refining the protocol and educating developers.</p><h3>About APISIX-MCP</h3><p>The rise of MCP offers traditional applications a new technical pathway. Leveraging MCP’s standardized integration capabilities, we developed <a href="https://github.com/api7/apisix-mcp">APISIX-MCP</a>, which bridges large language models with Apache APISIX’s Admin API through natural language interaction. The current implementation supports the following operations:</p><h3>General Operations</h3><ul><li>get_resource: Retrieve resources by type (routes, services, upstreams, etc.).</li><li>delete_resource: Delete resources by ID.</li></ul><h3>API Resource Management</h3><ul><li>create_route/update_route/delete_route: Manage routes.</li><li>create_service/update_service/delete_service: Manage services.</li><li>create_upstream/update_upstream/delete_upstream: Manage upstreams.</li><li>create_ssl/update_ssl/delete_ssl: Manage SSL certificates.</li><li>create_or_update_proto: Manage Protobuf definitions.</li><li>create_or_update_stream_route: Manage stream routes.</li></ul><h3>Plugin Operations</h3><ul><li>get_all_plugin_names: List all available plugins.</li><li>get_plugin_info/get_plugins_by_type/get_plugin_schema: Fetch plugin configurations.</li><li>create_plugin_config/update_plugin_config: Manage plugin configurations.</li><li>create_global_rule/update_global_rule: Manage global plugin rules.</li><li>get_plugin_metadata/create_or_update_plugin_metadata/delete_plugin_metadata: Manage plugin metadata.</li></ul><h3>Security Configuration</h3><ul><li>get_secret_by_id/create_secret/update_secret: Manage secrets.</li><li>create_or_update_consumer/delete_consumer: Manage consumers.</li><li>get_credential/create_or_update_credential/delete_credential: Manage consumer credentials.</li><li>create_consumer_group/delete_consumer_group: Manage consumer groups.</li></ul><h3>How to Use APISIX-MCP</h3><p>APISIX-MCP is now open-sourced and available on <a href="https://www.npmjs.com/package/apisix-mcp">npm</a> and <a href="https://github.com/api7/apisix-mcp">GitHub</a>. It can be configured via any MCP-compatible AI client, such as Claude Desktop, Cursor, or the Cline plugin for VSCode.</p><p>Below is a step-by-step guide using Cursor:</p><ol><li>Open Cursor, click the settings icon, and navigate to the settings page.</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*BGyJ1MxJLrNMJ38y" /></figure><p>2. Click “Add new global MCP server” to edit the mcp.json configuration file:</p><pre>   {<br>     &quot;mcpServers&quot;: {<br>       &quot;apisix-mcp&quot;: {<br>         &quot;command&quot;: &quot;npx&quot;,<br>         &quot;args&quot;: [&quot;-y&quot;, &quot;apisix-mcp&quot;],<br>         &quot;env&quot;: {<br>           &quot;APISIX_SERVER_HOST&quot;: &quot;your-apisix-server-host&quot;,<br>           &quot;APISIX_ADMIN_API_PORT&quot;: &quot;your-apisix-admin-api-port&quot;,<br>           &quot;APISIX_ADMIN_API_PREFIX&quot;: &quot;your-apisix-admin-api-prefix&quot;,<br>           &quot;APISIX_ADMIN_KEY&quot;: &quot;your-apisix-api-key&quot;<br>         }<br>       }<br>     }<br>   }</pre><ul><li>In the mcpServers field of the configuration file, add a service apisix-mcp, which can be changed. Then configure the commands for running the MCP service.</li><li>command: npx (Node.js package executor).</li><li>args: -y (auto-install dependencies) and apisix-mcp (package name).</li><li>env: Customize APISIX connection settings (defaults below):</li></ul><p>In the env field, you can specify the APISIX service access address, Admin API port, prefix, and authentication key. These environment variables have default values, so if you start APISIX without any custom configuration, you can omit the env field entirely. The default values for each variable are as follows:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*3gKBdGjOqjkm5GoDO746KQ.png" /></figure><p>3. Upon successful configuration, the MCP Servers list will show a green indicator for apisix-mcp, along with available tools.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*JSj8i0XagUKu7h1a" /></figure><ul><li>Note: If setup fails, refer to the <a href="https://github.com/api7/apisix-mcp">APISIX-MCP GitHub</a> documentation for manual builds.</li></ul><p>4. In the chat panel, select Agent mode and choose a model (e.g., Claude Sonnet 3.5/3.7 or GPT-4o).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*3hSy8VY9iw1Ej0ks" /></figure><p>5. Next, we can enter relevant operational commands to verify if the MCP service is functioning correctly. Following the workflow in APISIX’s Getting Started documentation, we input the following into the dialog box and send the message:</p><ul><li><em>“Help me create a route with path </em><em>/api for accessing </em><em>https://httpbin.org upstream, with CORS and rate-limiting plugins. Print the route details after configuration.&quot;</em></li></ul><p>6. Next, in Cursor, you will see a process similar to the MCP tool invocation demonstrated in the video below. Due to the inherent randomness of large AI model responses, the exact operations performed may vary from the example shown.</p><p><a href="https://static.api7.ai/uploads/2025/04/01/V7CmO59u_mcp-demo.mp4">https://static.api7.ai/uploads/2025/04/01/V7CmO59u_mcp-demo.mp4</a></p><p>Here, the auto-execution mode (YOLO Mode) is enabled, allowing Cursor to automatically invoke all tools in the MCP server. From the video, we can observe the AI performing the following operations based on our requirements:</p><ul><li>Analyzing the plugins we need to configure, then calling get_plugins_list to retrieve all plugin names</li><li>Invoking get_plugin_schema to examine detailed configuration information for different plugins</li><li>Calling create_route to create the route</li><li>Using update_route to add the previously queried plugin configurations to the route</li><li>Executing get_route to verify whether the route was successfully configured and if the configuration is correct</li></ul><p>7. The resulting route configuration includes:</p><ul><li>Route ID: httpbin</li><li>Path: /api/*</li><li>Methods: GET, POST, PUT, DELETE, PATCH, HEAD, OPTIONS</li><li>CORS Plugin:</li></ul><pre>    allow_origins: *<br>    allow_methods: *<br>    allow_headers: *<br>    expose_headers: X-Custom-Header<br>    max_age: 3600<br>    allow_credential: false</pre><ul><li>limit-count Plugin:</li></ul><pre>    count: 100<br>    time_window: 60<br>    key: remote_addr<br>    rejected_code: 429<br>    policy: local</pre><ul><li>Upstream:</li></ul><pre>    type: roundrobin (load balancing strategy using round-robin)  <br>    upstream node: httpbin.org:443 (backend service address) </pre><h3>Advantages of AI-Driven Operations</h3><p>In the above process, we accomplished the creation of a route configured with CORS and rate-limiting through just one round of natural language interaction with AI. Compared to manual route configuration, leveraging AI offers several distinct advantages:</p><ul><li>Reduced Cognitive Load: Eliminates manual documentation lookup and parameter memorization.</li><li>Automated Workflows: AI decomposes tasks (e.g., plugin setup → route creation) without human intervention.</li><li>Closed-Loop Validation: Auto-verification ensures correctness.</li><li>Iterative Optimization: Continuous dialogue refines configurations.</li></ul><p>This interaction model transforms complex configuration processes into natural conversational experiences while maintaining accuracy and verifiability. These capabilities are achieved through the MCP protocol’s semantic parsing of requirements, intelligent tool invocation, and final execution via Admin API.</p><p>It’s important to note that APISIX-MCP isn’t designed to completely replace manual configuration, but rather to optimize efficiency for high-frequency operations. Its value shines particularly in configuration debugging and rapid validation scenarios, creating effective complementarity with traditional management approaches. As the MCP ecosystem continues to evolve, we can anticipate deeper integration of such tools in API management, promising more sophisticated capabilities.</p><h3>Conclusion</h3><p>MCP enables intelligent operations for complex API systems. APISIX-MCP lowers the barrier to Apache APISIX adoption, with future plans for AI-traffic-specific plugins. The fusion of AI and API management promises smarter, more efficient infrastructure governance.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=76edd30740bf" width="1" height="1" alt=""><hr><p><a href="https://medium.com/apache-apisix/apisix-mcp-embracing-intelligent-api-management-with-ai-mcp-76edd30740bf">APISIX-MCP: Embracing Intelligent API Management with AI + MCP</a> was originally published in <a href="https://medium.com/apache-apisix">Apache APISIX</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[What Is an AI Gateway: Differences from API Gateway]]></title>
            <link>https://medium.com/apache-apisix/what-is-an-ai-gateway-differences-from-api-gateway-ac8feb2b3fee?source=rss----5b898720c0b8---4</link>
            <guid isPermaLink="false">https://medium.com/p/ac8feb2b3fee</guid>
            <category><![CDATA[ai-gateway]]></category>
            <category><![CDATA[api-gateway]]></category>
            <category><![CDATA[apisix]]></category>
            <category><![CDATA[apisix-ai-gateway]]></category>
            <category><![CDATA[apache-apisix]]></category>
            <dc:creator><![CDATA[YiliaLin]]></dc:creator>
            <pubDate>Fri, 28 Mar 2025 03:24:39 GMT</pubDate>
            <atom:updated>2025-03-28T03:24:39.162Z</atom:updated>
            <content:encoded><![CDATA[<blockquote>“The future isn’t AI gateways — it’s API gateways that speak AI.”<em> This blog explores AI gateways, their differences from API gateways, and why evolved solutions like </em><a href="https://apisix.apache.org/blog/2025/02/24/apisix-ai-gateway-features/"><em>Apache APISIX AI Gateway</em></a><em> are shaping the future.</em></blockquote><h3>What Is an AI Gateway? Why Did It Arise in the AI Era?<a href="https://apisix.apache.org/blog/2025/03/21/ai-gateway-vs-api-gateway-differences-explained/#what-is-an-ai-gateway-why-did-it-arise-in-the-ai-era">​</a></h3><p>The AI era has ushered in unprecedented complexity in deploying and managing artificial intelligence (AI) models. Organizations now juggle multiple models — from computer vision to large language models (LLMs) — across diverse environments (cloud, edge, hybrid). Traditional API gateways, designed for general-purpose data traffic, often fall short in addressing the unique challenges posed by AI workloads. This is where AI gateways emerge as critical middleware, acting as a unified control plane for routing, securing, and optimizing AI workloads.</p><h3>The Rise of AI Gateways<a href="https://apisix.apache.org/blog/2025/03/21/ai-gateway-vs-api-gateway-differences-explained/#the-rise-of-ai-gateways">​</a></h3><p>The proliferation of generative AI and LLMs (Large Language Models) has introduced unique challenges:</p><ul><li>Token Consumption: LLMs process requests in tokens, requiring granular tracking for cost and performance optimization.</li><li>Stream-Type Requests: AI agents often generate real-time, streaming responses (e.g., ChatGPT’s incremental output), demanding low-latency handling.</li><li>Tool Integration: AI systems increasingly rely on external data sources and APIs (e.g., retrieving live weather data or CRM records).</li></ul><p>According to a 2023 Gartner report, over 75% of enterprises now use AI models in production, driving demand for specialized infrastructure. Traditional API gateways, designed for RESTful APIs and static request-response cycles, struggle with these AI-specific demands. Enter the <a href="https://apisix.apache.org/blog/2025/03/06/what-is-an-ai-gateway/">AI gateway</a> — a purpose-built solution to manage AI-native traffic.</p><h3>AI Agents vs. Traditional Devices: Why Stream-Type Requests Demand Specialized Handling<a href="https://apisix.apache.org/blog/2025/03/21/ai-gateway-vs-api-gateway-differences-explained/#ai-agents-vs-traditional-devices-why-stream-type-requests-demand-specialized-handling">​</a></h3><p>AI agents (e.g., chatbots, coding assistants) generate fundamentally different traffic patterns than traditional clients:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*mVGXb2Za58g8VNbwvodxog.png" /></figure><h3>The Stream-Type Challenge<a href="https://apisix.apache.org/blog/2025/03/21/ai-gateway-vs-api-gateway-differences-explained/#the-stream-type-challenge">​</a></h3><p>When an AI agent requests a poem generated by GPT-4, the response is streamed incrementally. Traditional API gateways, built for atomic requests, struggle with:</p><ul><li>Partial Responses: Aggregating chunks into a coherent audit log.</li><li>Token Accounting: Accurately counting tokens across streaming chunks.</li><li>Real-Time Observability: Monitoring latency per token or detecting drift in response quality.</li></ul><p>Many purpose-built AI gateways lack distributed tracing, forcing engineers to cobble together metrics. In contrast, API gateways like <a href="https://github.com/apache/apisix">Apache APISIX</a> provide built-in integrations with Prometheus and Grafana, enabling token-level dashboards.</p><h3>Two Types of AI Gateways: Purpose-Built vs. API Gateway Evolutions<a href="https://apisix.apache.org/blog/2025/03/21/ai-gateway-vs-api-gateway-differences-explained/#two-types-of-ai-gateways-purpose-built-vs-api-gateway-evolutions">​</a></h3><p>Today’s AI gateways fall into two categories:</p><h3>Specific Purpose-Built AI Gateways<a href="https://apisix.apache.org/blog/2025/03/21/ai-gateway-vs-api-gateway-differences-explained/#specific-purpose-built-ai-gateways">​</a></h3><p>These are built from the ground up to address AI use cases. Startups like PromptLayer and LangChain offer solutions focused on:</p><ul><li>Token-Based Rate Limiting: Enforcing usage quotas based on tokens instead of API calls.</li><li>Prompt Engineering Tools: Allowing developers to test and optimize prompts.</li><li>AI-Specific Analytics: Tracking metrics like response hallucination rates or token costs.</li></ul><p>Example: OpenAI’s API uses token-based pricing ($0.06 per 1K tokens for GPT-4), requiring gateways to meter usage precisely. A dedicated AI gateway might integrate token counters directly into its throttling logic.</p><p>However, these gateways often lack the observability and scalability of mature API management platforms. For instance, measuring token consumption across distributed microservices can lead to inaccuracies if the gateway lacks distributed tracing capabilities.</p><h3>Evolved AI Gateways from API Gateways<a href="https://apisix.apache.org/blog/2025/03/21/ai-gateway-vs-api-gateway-differences-explained/#evolved-ai-gateways-from-api-gateways">​</a></h3><p>Established API gateways like Kong, <a href="https://apisix.apache.org/">Apache APISIX</a>, and AWS API Gateway are adapting to AI workloads by adding:</p><ul><li>Streaming Support: Handling Server-Sent Events (SSE) and WebSockets for real-time AI responses.</li><li>Token-Aware Plugins: Extending rate-limiting plugins to track tokens.</li><li>LLM Orchestration: Managing multiple AI models (e.g., routing requests to cost-effective models like Mistral-7B for simple tasks).</li></ul><p>Mature API gateways leverage decades of experience in security (OAuth, JWT), scalability (load balancing), and monetization — features often missing in AI-first solutions.</p><h3>Why Evolved AI Gateways Are Winning Long-Term<a href="https://apisix.apache.org/blog/2025/03/21/ai-gateway-vs-api-gateway-differences-explained/#why-evolved-ai-gateways-are-winning-long-term">​</a></h3><p>While purpose-built AI gateways excel in niche scenarios, evolved API gateways are becoming the default choice for three reasons:</p><ol><li>Cost Efficiency: Maintaining separate gateways for AI and non-AI traffic doubles operational overhead. Converged systems reduce costs by 30–50% (Gartner, 2023).</li><li>Flexibility: Enterprises can’t predict which AI models will dominate. Platforms like Apache APISIX allow seamless integration of new LLMs without rearchitecting.</li><li>Future-Proofing: As AI becomes embedded in all apps (e.g., AI-powered search in e-commerce), gateways must handle hybrid workloads.</li></ol><h3>Model Context Protocol (MCP): Bridging AI Assistants and External Tools<a href="https://apisix.apache.org/blog/2025/03/21/ai-gateway-vs-api-gateway-differences-explained/#model-context-protocol-mcp-bridging-ai-assistants-and-external-tools">​</a></h3><p>To connect AI agents with external data and APIs, the <a href="https://github.com/modelcontextprotocol">Model Context Protocol (MCP)</a> has emerged as a standardized framework. MCP defines how AI models request and consume external resources, such as:</p><ul><li>Data Sources: SQL databases, vector stores (e.g., Pinecone).</li><li>APIs: CRM systems, payment gateways.</li><li>Tools: Code interpreters, and image generators.</li></ul><h3>How MCP Works<a href="https://apisix.apache.org/blog/2025/03/21/ai-gateway-vs-api-gateway-differences-explained/#how-mcp-works">​</a></h3><ol><li>Context Injection: An AI assistant sends a request with a context header specifying required tools (MCP-Context: weather_api, crm).</li><li>Gateway Routing: The AI gateway validates permissions, injects API keys, and routes the request to relevant services.</li><li>Response Synthesis: The gateway aggregates API responses (e.g., weather data + CRM contacts) and feeds them back to the AI model.</li></ol><p>Example: A user asks, “Email our top client in NYC about today’s weather.” The AI gateway uses MCP to:</p><ul><li>Fetch the top client from Salesforce.</li><li>Retrieve NYC weather from OpenWeatherMap.</li><li>Pass this context to GPT-4 to draft the email.</li></ul><h3>Benefits of MCP<a href="https://apisix.apache.org/blog/2025/03/21/ai-gateway-vs-api-gateway-differences-explained/#benefits-of-mcp">​</a></h3><ul><li>Security: Centralized policy enforcement (e.g., masking PII in CRM responses).</li><li>Cost Control: Caching frequent data requests (e.g., product catalogs).</li><li>Interoperability: Standardizing AI-to-API communication across vendors.</li></ul><h3>Future of AI Gateways: Convergence with API Monetization<a href="https://apisix.apache.org/blog/2025/03/21/ai-gateway-vs-api-gateway-differences-explained/#future-of-ai-gateways-convergence-with-api-monetization">​</a></h3><p>As AI adoption matures, two trends will shape AI gateways:</p><h3>Trend 1: The Decline of Standalone AI Gateways<a href="https://apisix.apache.org/blog/2025/03/21/ai-gateway-vs-api-gateway-differences-explained/#trend-1-the-decline-of-standalone-ai-gateways">​</a></h3><p>Niche AI gateways will struggle to compete with evolved API gateways that offer:</p><ul><li>Unified Governance: One platform for REST, GraphQL, and AI APIs.</li><li>Monetization Models: Token-based billing, subscription tiers.</li><li>Enterprise Features: Role-based access control (RBAC), audit logging.</li></ul><p>Under such a trend, AI traffic will flow through traditional API gateways enhanced with AI capabilities.</p><h3>Trend 2: API Gateways as AI Orchestrators<a href="https://apisix.apache.org/blog/2025/03/21/ai-gateway-vs-api-gateway-differences-explained/#trend-2-api-gateways-as-ai-orchestrators">​</a></h3><p>Future API gateways will act as AI orchestrators, handling:</p><ul><li>Model Routing: Directing requests to optimal models based on cost, latency, or accuracy.</li><li>Hybrid Workflows: Blending AI and non-AI services (e.g., validating a GPT-4 response against a database).</li><li>Token Analytics: Real-time dashboards showing token spend by team or project.</li></ul><h3>The Bottom Line<a href="https://apisix.apache.org/blog/2025/03/21/ai-gateway-vs-api-gateway-differences-explained/#the-bottom-line">​</a></h3><p>In the future, the line between “AI gateway” and “API gateway” will blur. But the unchangeable fact is APIs are the basics of API gateways and AI gateways. Companies that adopt AI-ready API gateways today will gain a strategic edge in scalability, cost control, and innovation.</p><h3>Conclusion: Embracing AI-API Convergence<a href="https://apisix.apache.org/blog/2025/03/21/ai-gateway-vs-api-gateway-differences-explained/#conclusion-embracing-ai-api-convergence">​</a></h3><p>AI gateways are not a replacement but an evolution of API gateways. While purpose-built solutions address immediate LLM challenges, their limitations in observability and scalability make them transitional. Established API gateways — enhanced with streaming support, token-aware plugins, and MCP — are poised to dominate.</p><p>Solutions like <a href="https://apisix.apache.org/blog/2025/02/24/apisix-ai-gateway-features/">Apache APISIX AI Gateway</a> exemplify this shift, blending AI-native features with battle-tested API management. As AI permeates every app, enterprises must choose platforms that scale beyond siloed use cases. The winners? Adaptable, extensible tools that speak both API and AI.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ac8feb2b3fee" width="1" height="1" alt=""><hr><p><a href="https://medium.com/apache-apisix/what-is-an-ai-gateway-differences-from-api-gateway-ac8feb2b3fee">What Is an AI Gateway: Differences from API Gateway</a> was originally published in <a href="https://medium.com/apache-apisix">Apache APISIX</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Comprehensive Overview of APISIX AI Gateway Features]]></title>
            <link>https://medium.com/apache-apisix/comprehensive-overview-of-apisix-ai-gateway-features-e4f40696413c?source=rss----5b898720c0b8---4</link>
            <guid isPermaLink="false">https://medium.com/p/e4f40696413c</guid>
            <category><![CDATA[ai-gateway]]></category>
            <category><![CDATA[api-gateway]]></category>
            <category><![CDATA[ai]]></category>
            <category><![CDATA[api]]></category>
            <category><![CDATA[api-integration]]></category>
            <dc:creator><![CDATA[YiliaLin]]></dc:creator>
            <pubDate>Mon, 24 Feb 2025 07:45:19 GMT</pubDate>
            <atom:updated>2025-02-24T07:45:19.154Z</atom:updated>
            <content:encoded><![CDATA[<blockquote><em>This article will provide an in-depth look at the AI gateway features of the current and upcoming versions of APISIX. As a multifunctional API and AI gateway, Apache APISIX offers efficient and secure LLM API calls for AI applications.</em></blockquote><h3>Introduction: The Rise of AI Agents and the Evolution of AI Gateway<a href="https://apisix.apache.org/blog/2025/02/24/apisix-ai-gateway-features/#introduction-the-rise-of-ai-agents-and-the-evolution-of-ai-gateway">​</a></h3><p>In recent years, AI agents such as AutoGPT, Chatbots, and AI Assistants have seen rapid development. These applications rely heavily on API calls to large language models (LLMs), which has brought about challenges considering high concurrency, cost control, and security.</p><p>Traditional API gateways primarily serve Web APIs and microservices and are not optimized for the unique needs of AI applications. This has led to the emergence of the concept of AI gateway. An AI gateway needs to provide enhanced capabilities in the following areas:</p><ul><li>Multi-LLM Proxy: Support for multiple LLM providers to avoid vendor lock-in.</li><li>Token Rate Limiting: Prevent API abuse and optimize cost management.</li><li>Security Protection: Including prompt filtering and content moderation to ensure compliance of AI applications.</li><li>Smart Traffic Management: Dynamically adjust LLM weights based on cost, latency, and stability.</li></ul><p>Apache APISIX is not only an API gateway but also an AI gateway through its plugins, helping AI applications call LLM APIs more efficiently and securely.</p><h3>LLM Proxy: Efficient Management of Multiple LLM Backends<a href="https://apisix.apache.org/blog/2025/02/24/apisix-ai-gateway-features/#llm-proxy-efficient-management-of-multiple-llm-backends">​</a></h3><p>AI applications typically do not rely on a single LLM provider but need to dynamically select the best model based on requirements. For example:</p><ul><li>Using OpenAI GPT-4 for general text generation and Claude for legal document processing.</li><li>Switching between Mistral and Gemini to optimize cost and throughput.</li></ul><p>Apache APISIX’s LLM Proxy offers the following capabilities:</p><p>✅ Support for Multiple LLM Providers: Including OpenAI, DeepSeek, Claude, Mistral, Gemini, etc., to avoid vendor lock-in.</p><p>✅ LLM Weight and Priority Management: Adjust traffic distribution based on business needs.</p><p>✅ Multi-LLM Load Balancing: Dynamically adjust LLM weights based on latency, cost, and stability.</p><p>✅ Retry and Fallback Mechanisms: Ensure business continuity if an LLM API fails.</p><p>✅ Load Balancing Across Different Providers of the Same LLM:</p><p>For example:</p><ul><li>Privately deployed DeepSeek.</li><li>Official DeepSeek API.</li><li>DeepSeek API from Volcano Engine</li></ul><p>Users can flexibly allocate traffic weights among different DeepSeek providers based on latency, stability, and price to achieve the best calling strategy.</p><p>These capabilities enable AI applications to adapt flexibly to different LLMs, improve reliability, and reduce API calling costs.</p><h3>AI Security Protection: Ensuring Safe and Compliant Use of AI<a href="https://apisix.apache.org/blog/2025/02/24/apisix-ai-gateway-features/#ai-security-protection-ensuring-safe-and-compliant-use-of-ai">​</a></h3><p>AI APIs may involve sensitive data, misleading information, and potential misuse. Therefore, an AI gateway needs to provide security at multiple levels.</p><p>The AI security capabilities provided by Apache APISIX include:</p><p>✅ AI RAG (Retrieval-Augmented Generation): Supports enterprise-owned knowledge bases to reduce LLM hallucinations and improve output reliability.</p><p>✅ Prompt Guard: Automatically intercepts sensitive, illegal, and inappropriate prompts to prevent malicious use by users.</p><p>✅ Prompt Decorator: Automatically adds content before and after user input to enhance the quality of LLM-generated content.</p><p>✅ Prompt Template: Makes it easier for users to reuse standardized prompts and improve interaction experience.</p><p>✅ Response Filtering &amp; Moderation: Intercepts sensitive or non-compliant AI-generated content.</p><p>✅ Logging &amp; Auditing: Provides complete API request logs for compliance audits.</p><p>These security measures ensure that AI applications meet enterprise-level security requirements and avoid compliance risks due to misleading AI content.</p><h3>Token Observability and Management: Preventing High Bills Due to API Abuse<a href="https://apisix.apache.org/blog/2025/02/24/apisix-ai-gateway-features/#token-observability-and-management-preventing-high-bills-due-to-api-abuse">​</a></h3><p>Calling LLM APIs consumes tokens, and API abuse can lead to significant costs. Apache APISIX provides fine-grained token monitoring and management mechanisms.</p><p>The token management capabilities of Apache APISIX include:</p><p>✅ Token Rate Limiting by Route/Service/Consumer/Consumer Group/Custom Dimension</p><p>✅ Support for Multiple Rate Limiting Modes:</p><ul><li>Single-machine vs. cluster rate limiting to accommodate different scales of AI API services.</li><li>Fixed time window vs. sliding time window to flexibly control API rates.</li></ul><p>✅ Different Rate Limiting Policies for Different LLMs: Prevent cost overruns.</p><p>Through Apache APISIX, enterprises can achieve fine-grained management of token resources and prevent high bills due to API abuse.</p><h3>Smart Routing: Dynamic Traffic Management for AI APIs<a href="https://apisix.apache.org/blog/2025/02/24/apisix-ai-gateway-features/#smart-routing-dynamic-traffic-management-for-ai-apis">​</a></h3><p>During AI API calls, different tasks may require different LLMs. For example:</p><ul><li>Code generation requests → sent to GPT-4 or DeepSeek.</li><li>Long-form summarization tasks → sent to Claude.</li><li>General conversations → sent to GPT-3.5 or Gemini.</li></ul><p>The smart routing capabilities of Apache APISIX include:</p><p>✅ Context-Aware Routing Based on Request Content:</p><ul><li>Select the optimal LLM based on prompt type.</li><li>Allocate different models (GPT-4 Turbo vs. GPT-3.5) based on user level (paid vs. free users).</li></ul><p>✅ Response Caching: Reduce redundant API calls and improve response speed.</p><p>These capabilities help AI APIs run more efficiently, reduce API latency, and increase throughput.</p><h3>Conclusion<a href="https://apisix.apache.org/blog/2025/02/24/apisix-ai-gateway-features/#conclusion">​</a></h3><p>With the rapid development of AI technology, API gateways also need to evolve to meet the unique needs of AI applications. Apache APISIX, with its LLM Proxy, token rate limiting, security protection, and smart routing features, has become the best choice for an AI gateway.</p><p>The core advantages of Apache APISIX compared to traditional API gateways are:</p><p>🚀 Support for Multiple LLM Providers: Avoid vendor lock-in.</p><p>⚡️ Smart Traffic Scheduling: Dynamic load balancing to improve API reliability.</p><p>🔒 Built-in Security Capabilities: Including prompt protection and content moderation to ensure secure and compliant AI APIs.</p><p>💰 Token Rate Limiting: Prevent high bills due to API abuse.</p><p>📊 High-performance Architecture: Meet the high concurrency needs of AI applications.</p><p>If you are building AI-related applications and want to have both a powerful API gateway and AI gateway, give Apache APISIX a try!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e4f40696413c" width="1" height="1" alt=""><hr><p><a href="https://medium.com/apache-apisix/comprehensive-overview-of-apisix-ai-gateway-features-e4f40696413c">Comprehensive Overview of APISIX AI Gateway Features</a> was originally published in <a href="https://medium.com/apache-apisix">Apache APISIX</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Cloud vs Open Source vs Commercial API Gateways: Which One Fits Your Needs?]]></title>
            <link>https://medium.com/apache-apisix/cloud-vs-open-source-vs-commercial-api-gateways-which-one-fits-your-needs-a289c306c792?source=rss----5b898720c0b8---4</link>
            <guid isPermaLink="false">https://medium.com/p/a289c306c792</guid>
            <category><![CDATA[open-source-software]]></category>
            <category><![CDATA[open-source]]></category>
            <category><![CDATA[api]]></category>
            <category><![CDATA[apisix]]></category>
            <category><![CDATA[api-gateway]]></category>
            <dc:creator><![CDATA[YiliaLin]]></dc:creator>
            <pubDate>Mon, 17 Feb 2025 09:41:41 GMT</pubDate>
            <atom:updated>2025-02-17T09:41:41.209Z</atom:updated>
            <content:encoded><![CDATA[<h3>Introduction</h3><p>API gateways have become essential components in modern cloud architectures. They provide security, traffic management, observability, and service orchestration — critical for handling APIs at scale. However, with multiple API gateway solutions available, choosing the right one can be challenging.</p><p>Broadly, API gateways fall into three categories:</p><ul><li>Cloud API Gateways (e.g., <a href="https://aws.amazon.com/api-gateway/">Amazon API Gateway</a>, <a href="https://cloud.google.com/apigee">Google Apigee</a>)</li><li>Open Source API Gateways (e.g., <a href="https://apisix.apache.org/">Apache APISIX</a>, Kong Gateway, Tyk)</li><li>Commercial API Gateways (e.g., <a href="https://www.mulesoft.com/">MuleSoft</a>, <a href="https://boomi.com/">Boomi</a>)</li></ul><p>Each option has its advantages and trade-offs. This article provides a deep dive into their differences, hidden risks, and a strategic recommendation for companies looking to scale API usage and adopt hybrid cloud architectures.</p><h3>Cloud API Gateways: Convenience vs. Lock-in</h3><h3>Pros:</h3><p>✅ Fully managed, reducing operational burden</p><p>✅ Deep integration with cloud provider services (IAM, logging, monitoring)</p><p>✅ High availability and auto-scaling out of the box</p><h3>Cons:</h3><p>❌ Vendor Lock-in: API definitions, policies, and configurations are tied to the cloud provider</p><p>❌ No Customization: Cloud API gateways are closed-source, limiting the ability to add custom plugins or functionality</p><p>❌ No Hybrid Cloud Support: Cloud-managed API gateways cannot be deployed on-premise or across multi-cloud environments</p><h3>Use Case:</h3><p>Cloud API gateways are ideal for startups and small teams that need a quick, managed solution without worrying about infrastructure maintenance. However, as API traffic grows or hybrid cloud requirements arise, their limitations become apparent.</p><p>🔹 Example: Amazon API Gateway is a popular choice for cloud-native applications but lacks flexibility for on-premises deployments.</p><h3>Open Source API Gateways: Control and Flexibility</h3><h3>Pros:</h3><p>✅ Fully customizable, allowing teams to extend functionality as needed</p><p>✅ No licensing fees, reducing costs in the long run</p><p>✅ Can be deployed anywhere — on-prem, multi-cloud, hybrid cloud</p><h3>Cons:</h3><p>❌ Operational Overhead: Requires self-hosting, upgrades, and security management</p><p>❌ Governance Risks: Some open-source projects are controlled by a single vendor, which may later change licensing terms (e.g., Redis, ELK Stack)</p><p>❌ Scalability Complexity: Running an open-source API gateway at enterprise scale requires expertise in deployment and maintenance</p><h3>Key Consideration: Choosing a Foundation-Owned Open Source Project</h3><p>Some open-source API gateways are vendor-controlled, meaning the company behind them can change licensing terms. For example, Redis and Elasticsearch modified their open-source licenses to prevent cloud providers from offering managed services.</p><p>To avoid future licensing risks, it’s safer to choose an API gateway governed by a neutral open-source foundation, such as:</p><ul><li><a href="https://apisix.apache.org/">Apache APISIX (Apache Software Foundation)</a></li><li><a href="https://www.envoyproxy.io/">Envoy Proxy (Cloud Native Computing Foundation)</a></li></ul><h3>Commercial API Gateways: Enterprise Features with Pricing Risks</h3><h3>Pros:</h3><p>✅ Enterprise-grade security</p><p>✅ SLA-backed support with 24/7 assistance</p><p>✅ Monetization and API analytics for businesses offering APIs as a service</p><h3>Cons:</h3><p>❌ High Licensing Costs: Typically charged per API call, which can become expensive</p><p>❌ Potential Pricing Changes: Many vendors modify pricing models over time, significantly increasing costs (e.g., Apigee, Kong Enterprise)</p><p>❌ Limited Deployment Flexibility: Some solutions require vendor-managed infrastructure, reducing control</p><h3>Use Case:</h3><p>Best suited for large enterprises with strict security, compliance, and SLA requirements. However, pricing unpredictability is a concern — many companies have faced sudden cost increases.</p><h3>Strategic Recommendation: A Hybrid Approach for Growth</h3><p>If your API traffic is growing rapidly and hybrid cloud is part of your strategy, the best approach is:</p><p>1. Start with an Open Source API Gateway</p><ul><li>Avoid vendor lock-in</li><li>Maintain control over deployment and customization</li><li>Lower costs by eliminating per-call fees</li></ul><p>2. Upgrade to a Commercial Version When Needed</p><ul><li>When security requirements increase</li><li>When managing multi-cluster deployments</li><li>When enterprise support and SLAs become necessary</li></ul><p>By following this approach, you get the best of both worlds: flexibility, cost control, and enterprise-grade features when needed.</p><p>🔹 Example Strategy: A company starts with Apache APISIX (open source) and later upgrades to <a href="https://api7.ai/">API7 Enterprise</a> when requiring advanced security and SLA support.</p><h3>FAQ: Common Questions About API Gateway Selection</h3><p>1. Why not start with a cloud API gateway and switch later?</p><p>Switching API gateways is complex due to differences in configurations, rate-limiting rules, authentication methods, and monitoring setups. If hybrid cloud or multi-cloud is part of your strategy, starting with an open-source gateway ensures long-term flexibility.</p><p>2. How do I avoid open-source licensing risks?</p><p>Choose projects governed by neutral software foundations (e.g., Apache Software Foundation, CNCF). Avoid projects fully controlled by a single company, as they may change their licensing model.</p><p>3. What is the best API gateway for hybrid cloud?</p><p>Open-source gateways like Apache APISIX and Envoy Proxy offer full deployment flexibility, making them ideal for hybrid and multi-cloud architectures.</p><h3>Conclusion: Making the Right Choice</h3><p>Choosing the right API gateway depends on your scalability, budget, and cloud strategy:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*HHmRGoJkgcW-End719O3yg.png" /></figure><p>If API traffic is growing rapidly and hybrid cloud adoption is planned, a hybrid approach — starting with open source and upgrading to a commercial enterprise solution when needed — offers the best flexibility and cost efficiency.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a289c306c792" width="1" height="1" alt=""><hr><p><a href="https://medium.com/apache-apisix/cloud-vs-open-source-vs-commercial-api-gateways-which-one-fits-your-needs-a289c306c792">Cloud vs Open Source vs Commercial API Gateways: Which One Fits Your Needs?</a> was originally published in <a href="https://medium.com/apache-apisix">Apache APISIX</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Announcing Integration between Apache APISIX and open-appsec WAF]]></title>
            <link>https://medium.com/apache-apisix/announcing-integration-between-apache-apisix-and-open-appsec-waf-d17f784e2c29?source=rss----5b898720c0b8---4</link>
            <guid isPermaLink="false">https://medium.com/p/d17f784e2c29</guid>
            <category><![CDATA[api-gateway]]></category>
            <category><![CDATA[waf]]></category>
            <category><![CDATA[api-security]]></category>
            <category><![CDATA[open-source]]></category>
            <category><![CDATA[apache-apisix]]></category>
            <dc:creator><![CDATA[YiliaLin]]></dc:creator>
            <pubDate>Wed, 23 Oct 2024 03:02:46 GMT</pubDate>
            <atom:updated>2024-10-23T03:02:46.898Z</atom:updated>
            <content:encoded><![CDATA[<h3>Introduction</h3><p>open-appsec WAF is excited to announce a new integration with the open-source API gateway Apache APISIX.</p><p>This new collaboration between the open-appsec and API7 teams now allows users to protect their web APIs and other web services exposed by Apache APISIX against unknown and known attack types effectively based on open-appsec’s advanced machine-learning-based technology and also adds several more enhanced security capabilities.</p><h3>About Apache APISIX</h3><p><a href="https://apisix.apache.org/">Apache APISIX</a> is a modern, flexible, and high-performance open-source API gateway solution designed to handle various use cases in microservices and cloud-native architectures. Its primary purpose is to facilitate API management by serving as a gateway for managing, securing, and optimizing API traffic between clients and backend services.</p><p>Further use cases for APISIX as an API gateway include load balancing, rate limiting, authentication, and authorization. It provides comprehensive features such as traffic control, dynamic upstream, and plugin extensibility, enabling developers to customize and extend functionality according to their specific needs.</p><ul><li>Website: <a href="https://apisix.apache.org/">apisix.apache.org</a></li><li>Github: <a href="https://github.com/apache/apisix">github.com/apache/apisix</a></li><li>Docs: <a href="https://apisix.apache.org/docs">apisix.apache.org/docs</a></li></ul><h3>About open-appsec WAF</h3><p><a href="https://www.openappsec.io/">open-appsec WAF</a> provides automatic, preemptive threat prevention and integrates with various types of reverse proxies like NGINX as well as API gateways like APISIX. It is machine-learning-based, meaning it doesn’t require signatures (or updates) at all. This enables it to provide automatic, state-of-the-art threat prevention even for true zero-day attacks while significantly reducing both administrative effort and the amount of false positives.</p><p>In addition, open-appsec provides many additional security layers such as AntiBot, rate limiting, schema enforcement, snort signature support, custom rules/exceptions, and more. open-appsec can be managed centrally using a Web UI provided as a SaaS service and also locally using a declarative configuration file.</p><ul><li>Website: <a href="https://www.openappsec.io/">www.openappsec.io</a></li><li>Github: <a href="https://github.com/openappsec">github.com/openappsec</a></li><li>Docs: <a href="https://docs.openappsec.io/">docs.openappsec.io</a></li><li>Playgrounds: <a href="https://www.openappsec.io/playground">www.openappsec.io/playground</a></li></ul><h3>Integrating Apache APISIX with open-appsec</h3><p>With this new integration, APISIX users will now have access to open-appsec WAF as an integrated, state-of-the-art machine-learning-based WAF solution for the protection of their web APIs and web applications.</p><p>They can now use e.g. open-appsec’s free and open-source “Community Edition” to get effective, AI-based protection against known but also unknown attacks for everything exposed by their APISIX API gateway, while at the same time reducing the amount of false positives significantly unburdening the administrator from tedious tasks such as creating exceptions, updating traditional signature-based policies and more.</p><p>This integration will be available for all common platforms: Linux, Docker, and Kubernetes.</p><h3>Linux</h3><p>For Linux “embedded” deployments of APISIX, an open-appsec installer will add an “open-appsec attachment” module to the existing APISIX installation and also install the “open-appsec agent” alongside it, which will receive the traffic from the attachment, inspect it, and return the concluded action to block or allow the traffic back to the APISIX respectively the open-appsec attachment integrated with it.</p><p>Here’s a simple architecture schematic for Linux deployment.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*NuBxUf_skBk8Bc2cBzOwHg.jpeg" /></figure><h3>Docker</h3><p>For Docker-based deployments of APISIX with open-appsec WAF, there is a special APISIX container image available, to which the open-appsec attachment was already added and also an enhanced docker-compose file, which deploys both, the APISIX gateway container as well as an open-appsec Agent that does the security inspection and returns the concluded decisions to the APISIX gateway to allow or block traffic.</p><p>Here’s a simple architecture schematic for deployment on Docker.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*kRE_YPxrjQXdDGtEspCPiA.jpeg" /></figure><h3>Kubernetes</h3><p>For Kubernetes based-deployments of APISIX integrated with open-appsec, there’s a Helm chart available, which is based on the official APISIX Helm chart and further enhanced to also include the open-appsec attachment in the APISIX gateway container and also deploys the open-appsec agent. Further, you will have the option to configure open-appsec in a declarative “DevOps-style” way using custom resources in K8s as an alternative to using the open-appsec central management Web UI.</p><p>Here’s a simple architecture schematic for deployment on Kubernetes.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Xmabo7QrfdYVIeeuh4XHLQ.jpeg" /></figure><h3>Adding open-appsec WAF to APISIX on Linux</h3><p>To install open-appsec on a Linux system with APISIX installed, please follow these steps:</p><h3>1. Prerequisites</h3><ul><li>The Linux platform must be Ubuntu 22.04.</li><li>Make sure to have APISIX installed.</li></ul><p>You can find the list of supported APISIX versions here: <a href="https://downloads.openappsec.io/packages/supported-apisix.txt">https://downloads.openappsec.io/packages/supported-apisix.txt</a>.</p><p>If you don’t have APISIX installed yet, you can use the following commands to perform an APISIX installation in “traditional mode”. By running these commands you will first install the etcd database for APISIX, then add the required repos before installing and starting APISIX.</p><p>Install etcd Database</p><pre>ETCD_VERSION=&#39;3.5.4&#39;<br>wget https://github.com/etcd-io/etcd/releases/download/v${ETCD_VERSION}/etcd-v${ETCD_VERSION}-linux-amd64.tar.gz<br>tar -xvf etcd-v${ETCD_VERSION}-linux-amd64.tar.gz &amp;&amp; cd etcd-v${ETCD_VERSION}-linux-amd64<br>cp -a etcd etcdctl /usr/bin/<br>nohup etcd &gt;/tmp/etcd.log 2&gt;&amp;1 &amp;<br>etcd</pre><p>Add and Update Package Repositories</p><pre>apt install gnupg<br>echo &quot;deb http://openresty.org/package/debian bullseye openresty&quot; | tee /etc/apt/sources.list.d/openresty.list<br>wget -O - https://openresty.org/package/pubkey.gpg | apt-key add -<br>wget -O - http://repos.apiseven.com/pubkey.gpg | apt-key add -<br>echo &quot;deb http://repos.apiseven.com/packages/debian bullseye main&quot; | tee /etc/apt/sources.list.d/apisix.list<br>apt update</pre><p>Install, Initiate, and Start APISIX</p><pre>apt install apisix=3.9.1-0<br>apisix init<br>apisix start</pre><h3>2. Download the open-appsec Installer</h3><pre>wget https://downloads.openappsec.io/open-appsec-install &amp;&amp; chmod +x open-appsec-install</pre><h3>3. Install open-appsec</h3><p>Install open-appsec to integrate with the existing APISIX installation.</p><blockquote><em>Note that the </em><em>--prevent flag will install open-appsec with a default policy already set to prevent mode.</em></blockquote><pre>./open-appsec-install --auto --prevent</pre><h3>4. Get and Store APISIX Admin Key</h3><p>Get the APISIX admin key from the APISIX config.yaml configuration file and store it in the APISIX_KEY env variable.</p><pre>export APISIX_KEY=$(awk &#39;/key:/{ if ($2 ~ /^edd1/) print $2 }&#39; /usr/local/apisix/conf/config.yaml )</pre><h3>5. Configure Route to Expose Services</h3><p>Configure an example route in the APISIX gateway to expose an external web service or web API. In this example, we use httpbin.org as the example backend.</p><pre>curl http://127.0.0.1:9180/apisix/admin/routes/100 -H &quot;X-API-KEY:$APISIX_KEY&quot; -X PUT -d &#39;{<br>    &quot;methods&quot;: [<br>      &quot;GET&quot;<br>    ],<br>    &quot;uri&quot;: &quot;/anything&quot;,<br>    &quot;upstream&quot;: {<br>      &quot;type&quot;: &quot;roundrobin&quot;,<br>      &quot;nodes&quot;: {<br>        &quot;httpbin.org:80&quot;: 1<br>      }<br>    }<br>  }&#39;</pre><h3>6. Validate</h3><p>Let’s see if this route works by accessing it.</p><pre>curl -s -v -G --data-urlencode email=user@domain.abc http://localhost:9080/anything</pre><h3>7. Simulate an SQL Injection Attack</h3><p>Now let’s try to simulate an SQL injection attack (see &#39;OR &#39;1&#39;=&#39;1&#39; in the below HTTP request) against the httpbin.org service exposed by the APISIX gateway which is now protected by the open-appsec WAF.</p><pre>curl -s -v -G --data-urlencode email=user@domain.abc&#39; OR &#39;1&#39;=&#39;1 http://localhost:9080/anything</pre><p>This simulated attack now gets blocked successfully by open-appsec’s contextual machine-learning WAF engine.</p><h3>8. Review Log Files</h3><p>Check out the corresponding log files showing the “prevent” for the HTTP request with the simulated attack that we just sent.</p><pre>tail -f /var/log/nano_agent/cp-nano-http-transaction-handler.log*| grep -i user@domain.abc</pre><p>Alternatively, you can use the open-appsec-ctl tool:</p><pre>open-appsec-ctl --view-logs | grep -i user@domain.abc</pre><h3>9. Connect to open-appsec for Central Management (Optional)</h3><p>Optionally you can connect your deployment now to <a href="https://my.openappsec.io/">https://my.openappsec.io</a> for centrally managing open-appsec with an easy-to-use Web UI, monitoring security events and more, see section How to Manage Your open-appsec WAF Deployment Centrally? further below for more information.</p><p>Congratulations! You successfully added open-appsec WAF to your existing APISIX installation and verified that your web services exposed by the APISIX gateway are now protected against web attacks.</p><h3>Deploying APISIX with open-appsec WAF on Containerized Platforms (Docker)</h3><p>To install APISIX integrated with open-appsec on Docker, you can follow the steps shown below.</p><p>Opposite to the above example here we are deploying APISIX in “standalone mode”, which means it’s declaratively configured using a docker volume mount with a yaml file that holds the configurations and therefore won’t require an etcd database deployment.</p><blockquote><em>Note that APISIX supports both, traditional as well as standalone modes in all deployment types (Linux, Docker, …)</em></blockquote><h3>1. Prerequisite</h3><p>Make sure to have a Linux platform with both Docker and docker-compose tools installed.</p><h3>2. Create a Folder for open-appsec</h3><p>Within the directory that you want to use for the deployment, create a folder appsec-localconfig that will hold the appsec declarative configuration file:</p><pre>mkdir ./appsec-localconfig</pre><h3>3. Download the open-appsec File into the Folder</h3><p>Download the initial declarative configuration file for open-appsec into that folder.</p><pre>wget https://raw.githubusercontent.com/openappsec/openappsec/main/config/linux/latest/prevent/local_policy.yaml -O appsec-localconfig/local_policy.yaml</pre><blockquote><em>Note that this example declarative configuration file is already set to prevent attacks.</em></blockquote><h3>4. Create a Folder for APISIX</h3><p>Create another folder apisix-localconfig that will hold the declarative configuration file for APISIX: mkdir ./apisix-localconfig.</p><h3>5. Download APISIX File into the Folder</h3><p>Let’s download a simple declarative configuration file also for APISIX so we can verify open-appsec protection after the deployment.</p><pre>wget https://raw.githubusercontent.com/openappsec/openappsec/main/deployment/apisix/apisix-example-config/apisix-standalone.yaml -O ./apisix-localconfig/apisix-standalone.yaml</pre><h3>6. Create a docer-compose.yaml File</h3><p>Create a docker-compose.yaml file with the content below, which can be downloaded as follows:</p><pre>wget https://raw.githubusercontent.com/openappsec/openappsec/main/deployment/apisix/docker-compose.yaml</pre><pre>version: &quot;3&quot;</pre><pre>services:<br>  apisix:<br>    container_name: apisix<br>    image: &quot;ghcr.io/openappsec/apisix-attachment:latest&quot;<br>    ipc: service:appsec-agent<br>    restart: always<br>    volumes:<br>      - ./apisix-localconfig/apisix-standalone.yaml:/usr/local/apisix/conf/apisix.yaml:ro<br>    environment:<br>      - APISIX_STAND_ALONE=true<br>    ports:<br>      - &quot;9180:9180/tcp&quot;<br>      - &quot;9080:9080/tcp&quot;<br>      - &quot;9091:9091/tcp&quot;<br>      - &quot;9443:9443/tcp&quot;<br>  appsec-agent:<br>    container_name: appsec-agent<br>    image: &#39;ghcr.io/openappsec/agent:latest&#39;<br>    ipc: shareable<br>    restart: unless-stopped<br>    environment:<br>      # adjust with your own email below<br>      - user_email=user@email.com<br>      - registered_server=&quot;APISIX Server&quot;<br>    volumes:<br>      - ./appsec-config:/etc/cp/conf<br>      - ./appsec-data:/etc/cp/data<br>      - ./appsec-logs:/var/log/nano_agent<br>      - ./appsec-localconfig:/ext/appsec<br>    command: /cp-nano-agent</pre><h3>7. Update Your Email Address (Optional)</h3><p>Edit the docker-compose.yaml file and replace &quot;<a href="/service/mailto:user@email.com">user@email.com</a>&quot; with your own email address, so we can provide assistance in case of any issues with the specific deployment in the future and provide information proactively regarding open-appsec.</p><p>This is an optional parameter and can be removed. If we send automatic emails, there will also be an opt-out option included for receiving similar communication in the future.</p><h3>8. Start All Containers</h3><p>Run docker-compose up to start the deployment of all relevant containers:</p><pre>docker-compose up -d</pre><h3>9. Check Container Status</h3><p>Check if the apisix-attachment and the appsec-agent containers are up and running.</p><pre>docker ps</pre><h3>10. Validate the Standalone Configuration</h3><p>Let’s see if the standalone configuration works by accessing it.</p><pre>curl -s -v -G --data-urlencode email=user@domain.abc http://localhost:9080/anything</pre><h3>11. Simulate an SQL Injection Attack</h3><p>Now let’s try to simulate an SQL injection attack against the httpin.org service exposed by the APISIX gateway container which is now protected by open-appsec.</p><pre>curl -s -v -G --data-urlencode email=user@domain.abc&#39; OR &#39;1&#39;=&#39;1 http://localhost:9080/anything</pre><h3>12. Connect to open-appsec for Central Management (Optional)</h3><p>Optionally you can connect your deployment now to https://my.openappsec.io for centrally managing open-appsec with an easy-to-use Web UI, monitoring security events, and more, see section How to Manage Your open-appsec WAF Deployment Centrally? further below for more information.</p><h3>Deploying APISIX with open-appsec WAF on Kubernetes Using Helm</h3><h3>1. Prerequisite</h3><p>Make sure the Kubernetes platform and Helm tool are available.</p><h3>2. Download open-appsec</h3><p>Download the open-appsec for the APISIX Helm chart here.</p><pre>wget https://downloads.openappsec.io/packages/helm-charts/apisix/open-appsec-k8s-apisix-latest.tgz</pre><h3>3. Install Helm Chart</h3><p>This example helm install command is installing the open-appsec for the APISIX Helm chart which is based on an extended version of the official APISIX Helm chart.</p><p>It will deploy the APISIX gateway as the APISIX Ingress Controller, as well as open-appsec WAF integrated with it. It also offers an additional configuration option specifically for open-appsec WAF (see values.yaml inside the Helm chart and open-appsec <a href="https://docs.openappsec.io/">docs</a>).</p><p>After deployment, you can assign your K8s ingress resources to the APISIX gateway by configuring them to use the following ingress class: appsec-apisix.</p><pre>helm install open-appsec-k8s-apisix-latest.tgz \<br>--name-template=appsec-apisix \<br>--set rbac.create=true \<br>--set appsec.mode=standalone \<br>--set service.type=LoadBalancer \<br>--set appsec.persistence.enabled=false \<br>--set ingress-controller.enabled=true \<br>--set ingress-controller.config.ingressClass=appsec-apisix \<br>--set appsec.userEmail=”&lt;your-email-address&gt;” \<br>--set appsec.agentToken= \<br>--create-namespace \<br>-n appsec-apisix</pre><blockquote><em>Replace in the Helm install command above with your own email address, so we can send you news and updates related to open-appsec and better support you with your deployment if needed! You can unsubscribe at any time or alternatively, just remove that line if you prefer not to provide your email.</em></blockquote><h3>4. Validate</h3><p>Validate that pods were properly deployed and are in a ready state:</p><pre>kubectl get pods -n appsec-apisix</pre><h3>5. Create an open-appsec Policy Resource</h3><p>Run the following command to create the “open-appsec-best-practice-policy” in K8s.</p><blockquote><em>Note that this example policy is already pre-configured to prevent attacks.</em></blockquote><pre>kubectl apply -f https://raw.githubusercontent.com/openappsec/openappsec/main/config/k8s/v1beta1/open-appsec-k8s-prevent-config-v1beta1.yaml</pre><p>You can also create your own custom policy, <a href="https://docs.openappsec.io/getting-started/start-with-kubernetes/configuration-using-crds">here</a> you find all the details.</p><h3>6. Fetch the Target Resource Name</h3><p>Find out the name of the relevant ingress resource which you want to protect:</p><pre>kubectl get ing -A</pre><h3>7. Edit the Ingress Resource</h3><pre>kubectl edit ing/&lt;ingress name&gt; -n &lt;ingress namespace&gt;</pre><h3>8. Change the ingressClassname</h3><p>Change the ingressClassname to use open-appsec:</p><pre>spec: ingressClassName: appsec-apisix</pre><h3>9. Add Annotation to the Ingress Resource</h3><p>Add this annotation to the ingress resource to activate open-appsec for this ingress by specifying the desired open-appsec policy custom resource.</p><pre>openappsec.io/policy: open-appsec-best-practice-policy</pre><h3>10. Validate the Standalone Configuration</h3><p>Let’s see if the standalone configuration works by accessing it:</p><pre>curl -s -v -G --data-urlencode email=user@domain.abc http://[YOUR-INGRESS-HOSTNAME]</pre><h3>11. Simulate an SQL Injection Attack</h3><p>Now let’s try to simulate an SQL injection attack against the httpin.org service exposed by the APISIX gateway container which is now protected by open-appsec.</p><pre>curl -s -v -G --data-urlencode email=user@domain.abc&#39; OR &#39;1&#39;=&#39;1 http://[YOUR-INGRESS-HOSTNAME]</pre><p>Replace [YOUR-INGRESS-HOSTNAME] in the command above with the hostname you set in the ingress resource which you protected with open-appsec WAF in the earlier steps, also change “http” to “https” if required.</p><p>Congratulations! You successfully deployed APISIX integrated with open-appsec WAF and verified that your web services exposed by the APISIX Gateway are now protected against attacks.</p><h3>How to Manage Your open-appsec WAF Deployment Centrally?</h3><p>If you like you can also manage your open-appsec WAF deployment (integrated with APISIX) centrally using the open-appsec Web UI (SaaS Service) available at <a href="https://my.openappsec.io/">https://my.openappsec.io</a>, by connecting the open-appsec agent to a deployment profile in the central Web UI.</p><p>You can alternatively continue to manage your deployment locally but still connect to a central WebUI profile in “Declarative mode” so that you will be able to see the local configuration (read-only) in the Web UI.</p><p>Alongside the configuration of open-appsec the Web UI allows you to also see much more information like the status of deployed open-appsec agents, security logs, dashboards, and more.</p><p>For instructions on how to connect your deployment to the central Web UI see the open-appsec docs available at <a href="https://docs.openappsec.io/">https://docs.openappsec.io</a>.</p><p>Below you find some screenshots of the Web UI.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ZVUI3PHpp3kYCNjVjpkyZQ.jpeg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*JeKmwfZJnf3xP1tB_eF_uA.jpeg" /></figure><h3>Summary</h3><p>In this blog we explained how open-appsec can integrate with Apache APISIX on all of the following: regular Linux-based deployments, containerized deployments (Docker), and also Kubernetes environments.</p><p>Following the deployment steps for APISIX with open-appsec WAF, we simulated SQL injection attacks, which were effectively prevented by open-appsec’s machine learning-based WAF technology.</p><p>Additionally, it was explained, what the benefits are of connecting to open-appsec central WebUI for managing, monitoring, log analysis, and reporting.</p><p>We hope these new integrations will prove very useful to enhance the security of your APISIX API gateway and its exposed web APIs and web applications with open-appsec machine learning-based WAF.</p><p>Welcome you to contact us if you have any feedback, or questions or might face some technical challenge that you want us to assist with. You can reach the open-appsec team via the chat on <a href="https://www.openappsec.io/">https://www.openappsec.io</a> or via email to: <a href="https://api7.ai/blog/info@openappsec.io">info@openappsec.io</a>.</p><h3>Additional Resources</h3><h3>open-appsec WAF</h3><p>Website: <a href="https://www.openappsec.io/">https://www.openappsec.io</a></p><p>GitHub: <a href="https://github.com/openappsec">https://github.com/openappsec</a></p><p>Docs: <a href="https://docs.openappsec.io/">https://docs.openappsec.io</a></p><p>Playgrounds: <a href="https://www.openappsec.io/playground">https://www.openappsec.io/playground</a></p><p>Blogs: <a href="https://www.openappsec.io/blogs">https://www.openappsec.io/blogs</a></p><h3>Apache APISIX</h3><p>Website: <a href="https://apisix.apache.org/">https://apisix.apache.org</a></p><p>GitHub: <a href="https://github.com/apache/apisix">https://github.com/apache/apisix</a></p><p>Docs: <a href="https://apisix.apache.org/docs/">https://apisix.apache.org/docs/</a></p><p>Blogs: <a href="https://apisix.apache.org/blog/">https://apisix.apache.org/blog/</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d17f784e2c29" width="1" height="1" alt=""><hr><p><a href="https://medium.com/apache-apisix/announcing-integration-between-apache-apisix-and-open-appsec-waf-d17f784e2c29">Announcing Integration between Apache APISIX and open-appsec WAF</a> was originally published in <a href="https://medium.com/apache-apisix">Apache APISIX</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[DRY your Apache APISIX config]]></title>
            <link>https://medium.com/apache-apisix/dry-your-apache-apisix-config-f55625094a72?source=rss----5b898720c0b8---4</link>
            <guid isPermaLink="false">https://medium.com/p/f55625094a72</guid>
            <category><![CDATA[dry]]></category>
            <category><![CDATA[configuration]]></category>
            <category><![CDATA[dont-repeat-yours]]></category>
            <category><![CDATA[apache-apisix]]></category>
            <dc:creator><![CDATA[Nicolas Fränkel]]></dc:creator>
            <pubDate>Thu, 05 Sep 2024 07:06:02 GMT</pubDate>
            <atom:updated>2024-09-05T07:06:02.015Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*0cyTJFxWIXkOnSWLI21lcA.jpeg" /></figure><p>DRY is an important principle in software development. This post will show you how to apply it to Apache APISIX configuration.</p><h3>The DRY principle</h3><blockquote><em>“Don’t repeat yourself” (DRY) is a principle of software development aimed at reducing repetition of information which is likely to change, replacing it with abstractions that are less likely to change, or using data normalization which avoids redundancy in the first place.</em></blockquote><blockquote><em>— </em><a href="https://en.wikipedia.org/wiki/Don%27t_repeat_yourself"><em>Wikipedia — Don’t repeat yourself</em></a></blockquote><p>The main idea behind DRY is that if you repeat yourself and the information changes, then you must update the changed information in multiple places. It’s not only extra effort; there’s a chance you’ll forget about it and have different information in different places. DRY shines in bug fixing.</p><p>Imagine a code snippet containing a bug. Imagine now that you have duplicated the snippet in two different places. Now, you must fix the bug in these two places, and that’s the easy part; the hard being to know about the duplication in the first place. There’s a high chance that the person duplicating and the one fixing are different. If the snippet had been refactored to be shareable and called from the two places instead, you only need to fix the bug in this one place.</p><p>Most people associate DRY with code. However, it could be more limiting and contrary to the original idea.</p><blockquote><em>The principle has been formulated by Andy Hunt and Dave Thomas in their book The Pragmatic Programmer. They apply it quite broadly to include database schemas, test plans, the build system, even documentation.</em></blockquote><blockquote><em>— </em><a href="https://en.wikipedia.org/wiki/Don%27t_repeat_yourself"><em>Wikipedia — Don’t repeat yourself</em></a></blockquote><p>Sound configuration systems allow DRY or even encourage it.</p><h3>DRY in Apache APISIX</h3><p>Apache APISIX offers DRY configuration in two places.</p><h3>DRY upstreams</h3><p>In an e-commerce context, your beginner journey to define a route on Apache APISIX probably starts like the following:</p><pre>routes:<br>  - id: 1<br>    name: Catalog<br>    uri: /products*<br>    upstream:<br>      nodes:<br>        &quot;catalog:8080&quot;: 1</pre><p>If you’re familiar with APISIX, we defined a route to the catalogue under the /products URI. However, there&#39;s an issue: you probably want would-be customers to browse the catalogue but want to prevent people from creating, deleting, or updating products. Yet, the route matches every HTTP method by default.</p><p>We should allow only authenticated users to manage the catalogue so everybody can freely browse it. To implement this approach, we need to split the route in two:</p><pre>routes:<br>  - id: 1<br>    name: Read the catalogue<br>    methods: [ &quot;GET&quot;, &quot;HEAD&quot; ]                         #1<br>    uri: /products*<br>    upstream:                                          #2<br>      nodes:<br>        &quot;catalog:8080&quot;: 1<br>  - id: 1<br>    name: Read the catalogue<br>    methods: [ &quot;PUT&quot;, &quot;POST&quot;, &quot;PATCH&quot;, &quot;DELETE&quot; ]      #3<br>    uri: /products*<br>    plugins:<br>      key-auth: ~                                      #4<br>    upstream:                                          #2<br>      nodes:<br>        &quot;catalog:8080&quot;: 1</pre><ol><li>Match browsing</li><li>Duplicated upstream!</li><li>Match managing</li><li>Only authenticated consumers can use this route; key-auth is the simplest plugin for this</li></ol><p>We fixed the security issue in the simplest way possible: by copy-pasting. By doing so, we duplicated the upstream section. If we need to change the topology, <em>.e.g</em>, by adding or removing nodes, we must do it in two places. It defeats the DRY principle.</p><p>In real-world scenarios, especially when they involve containers, you wouldn’t implement the upstream by listing nodes. You should instead implement a dynamic <a href="https://apisix.apache.org/docs/apisix/discovery/">service discovery</a> to accommodate topology changes. However, the point still stands when you need to change the service discovery configuration or implementation. Hence, my point applies equally to nodes and service discovery.</p><p>Along with the <em>Route</em> abstraction, APISIX offers an <em>Upstream</em> abstraction to implement DRY. We can rewrite the above snippet like this:</p><pre>upstreams:<br>  - id: 1                                              #1<br>    name: Catalog<br>    nodes:<br>      &quot;catalog:8080&quot;: 1<br><br>routes:<br>  - id: 1<br>    name: Read the catalogue<br>    methods: [ &quot;GET&quot;, &quot;HEAD&quot; ]<br>    uri: /products*<br>    upstream_id: 1                                     #2<br>  - id: 1<br>    name: Read the catalogue<br>    methods: [ &quot;PUT&quot;, &quot;POST&quot;, &quot;PATCH&quot;, &quot;DELETE&quot; ]<br>    uri: /products*<br>    upstream_id: 1                                     #2<br>    plugins:<br>      key-auth: ~</pre><ol><li>Define an upstream with ID 1</li><li>Reference it in the route</li></ol><p>If anything happens in the topology, we must update the change only in the single <em>Upstream</em>.</p><p>Note that defining the upstream embedded and referencing it with upstream_id are <strong>mutually exclusive</strong>.</p><h3>DRY plugin configuration</h3><p>Another area where APISIX can help you DRY your configuration with the <em>Plugin</em> abstraction. APISIX implements most features, if not all, through plugins</p><p>Let’s implement <a href="https://blog.frankel.ch/api-versioning/#path-based-versioning">path-based versioning</a> on our API. We need to rewrite the URL before we forward it.</p><pre>routes:<br>  - id: 1<br>    name: Read the catalogue<br>    methods: [ &quot;GET&quot;, &quot;HEAD&quot; ]<br>    uri: /v1/products*<br>    upstream_id: 1<br>    plugins:<br>      proxy-rewrite:<br>        regex_uri: [ &quot;/v1(.*)&quot;, &quot;$1&quot; ]                 #1<br>  - id: 1<br>    name: Read the catalogue<br>    methods: [ &quot;PUT&quot;, &quot;POST&quot;, &quot;PATCH&quot;, &quot;DELETE&quot; ]<br>    uri: /v1/products*<br>    upstream_id: 1<br>    plugins:<br>      proxy-rewrite:<br>        regex_uri: [ &quot;/v1(.*)&quot;, &quot;$1&quot; ]                 #1</pre><ol><li>Remove the /v1 prefix before forwarding</li></ol><p>Like with upstream above, the plugins section is duplicated. We can also factor the plugin configuration in a dedicated <em>Plugin Config</em> object. The following snippet has the same effect as the one above:</p><pre>plugin_configs:<br>  - id: 1                                              #1<br>    plugins:<br>      proxy-rewrite:<br>        regex_uri: [ &quot;/v1(.*)&quot;, &quot;$1&quot; ]</pre><pre>routes:<br>  - id: 1<br>    name: Read the catalogue<br>    methods: [ &quot;GET&quot;, &quot;HEAD&quot; ]<br>    uri: /v1/products*<br>    upstream_id: 1<br>    plugin_config_id: 1                                #2<br>  - id: 1<br>    name: Read the catalogue<br>    methods: [ &quot;PUT&quot;, &quot;POST&quot;, &quot;PATCH&quot;, &quot;DELETE&quot; ]<br>    uri: /v1/products*<br>    upstream_id: 1<br>    plugin_config_id: 1                                #2</pre><ol><li>Factor the plugin configuration in a dedicated object</li><li>Reference it</li></ol><p>Astute readers might have noticed that I’m missing part of the configuration: the auth-key mysteriously disappeared! Indeed, I removed it for the sake of clarity.</p><p>Unlike upstream and upstream_id, plugins and plugin_config_id are <strong>not mutually exclusive</strong>. We can fix the issue by just adding the missing plugin:</p><pre>./usr/local/apisix/conf/config.yaml<br>routes:<br>  - id: 1<br>    name: Read the catalogue<br>    methods: [ &quot;GET&quot;, &quot;HEAD&quot; ]<br>    uri: /v1/products*<br>    upstream_id: 1<br>    plugin_config_id: 1<br>  - id: 1<br>    name: Read the catalogue<br>    methods: [ &quot;PUT&quot;, &quot;POST&quot;, &quot;PATCH&quot;, &quot;DELETE&quot; ]<br>    uri: /v1/products*<br>    upstream_id: 1<br>    plugin_config_id: 1<br>    plugins:<br>      key-auth: ~                                      #1</pre><ol><li>Fix it!</li></ol><p>This way, you can move the shared configuration to a plugin_config object and keep a specific one to the place it applies to. But what if the same plugin with different configurations is used in the plugin_config and directly in the route? The <a href="https://apisix.apache.org/docs/apisix/terminology/plugin/#plugins-merging-precedence">documentation</a> is pretty clear about it:</p><blockquote><em>Consumer &gt; </em><em>Consumer Group &gt; </em><em>Route &gt; </em><em>Plugin Config &gt; </em><em>Service</em></blockquote><p>In short, the plugin configuration in a route overrules the configuration in the plugin_config_id. It also allows us to provide the apikey variable for the key-auth plugin in a consumer and only set it in a route. APISIX will find and use the key for each consumer!</p><h3>Conclusion</h3><p>DRY is not only about code; it’s about data management in general. Configuration is data and thus falls under this general umbrella.</p><p>APISIX offers two DRY options: one for upstream - upstream_id, and one for plugin - plugin_config_id. Upstreams are exclusive; plugins allow for overruling.</p><p>Both mechanisms should help you toward DRYing your configuration and make it more maintainable in the long run.</p><p><strong>To go further:</strong></p><ul><li><a href="https://en.wikipedia.org/wiki/Don%27t_repeat_yourself">The Don’t repeat yourself principle</a></li><li><a href="https://apisix.apache.org/docs/apisix/terminology/plugin/#plugins-merging-precedence">Configuration merging precedence</a></li></ul><p><em>Originally published at </em><a href="https://blog.frankel.ch/dry-apisix-config/"><em>A Java Geek</em></a><em> on September 1st, 2024</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f55625094a72" width="1" height="1" alt=""><hr><p><a href="https://medium.com/apache-apisix/dry-your-apache-apisix-config-f55625094a72">DRY your Apache APISIX config</a> was originally published in <a href="https://medium.com/apache-apisix">Apache APISIX</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>