Skip to main content

Code samples

Welcome to Apache APISIX Code Samples!

Our Code Samples is your go-to resource for exploring the full potential of Apache APISIX, boosting your understanding of our platform's features, and accelerating your API development.

In our collection, you'll find a diverse range of code samples, including exposing new APIs, handling API calls, securing, and observing your APIs with Apache APISIX, and many more.

Now, feel free to dive in! Whether you're a beginner in need of a jumpstart or an experienced developer seeking more efficient solutions, our Code Samples are here to empower you on your journey. And if you ever get stuck or need further assistance, our community of developers is always here to help. Happy coding!

TitleDescriptionSource codeTutorialCategoryLevelLanguage
Hands-on lab Apache APISIXIt shows a couple of nifty features that can help your information system cope with the challenges introduced by APIsAPISIX Workshop for beginnerHands-on lab referenceAuthentication, Security, Serverless, Observability, TransformationBeginnerShell
How to create a File-proxy custom plugin in LuaLearn to develop a new plugin that exposes the static files through API and fetches a file from a specified URL.APISIX File Proxy Plugin DemoCustom Plugin Development With ChatGPTCustom plugin, File proxyIntermediateLua, Yaml
Managing AI-powered Java App with API ManagementIt demonstrates how to use OpenAI ChatGPT APIs in Spring Boot, secure and manage the traffic with Apache APISIXAPISIX Java OpenAI API ManagementManaging AI powered Java app with APISIXSecurity, Authentication, JWT plugin, ConsumersIntermediateJava, Yaml
Manage .NET-based APIs with Apache APISIX API GatewayThis is an example project focused on the usage of APISIX for applications developed in ASP .NET Core 6APISIX .NET Docker exampleManage .NET microservices APIs with APISIXSecurity, Authentication, Rate Limiting, CachingBeginnerC#, Yaml
Chaining API requests with API GatewayLearn how to create a custom plugin for APISIX API Gateway to handle client requests that should be called in sequence.APISIX Request Pipeline Plugin demoChaining API requests with APISIXCustom plugin, Serverless, Request ChainingIntermediateLua, Shell
Manage OpenAI APIs with Apache APISIXManages the OpenAI API traffic by creating a route, upstream and enabling some plugins.APISIX OpenAI API demoPowering AI capabilities with APISIXAI, Traffic control, Consumer, Rate-limiting, Prometheus, API versioning, Traffic splitBeginnerShell, Yaml
Dynamic routing based on JWT Claim with Apache APISIX and OktaExplore the benefits of adopting dynamic routing based on authentication attributesDynamic routing with APISIXDynamic routing with APISIX blog postDynamic routing, JWT, Authentication, Consumer managementAdvancedShell, Yaml
Manage serverless APIs with Apache APISIX and Azure FunctionsA simple example of how to manage Java-based serverless APIs built with Azure functions.Manage serverless APIs with APISIX demoManage serverless APIs with APISIXServerless, Basic auth, Rate-limiting, Traffic managementIntermediateJava, Shell
Manage API ConsumersExplains how to manage your single or multiple API consumers with Apache APISIX.API consumers management with APISIX demoManage API consumers blog postAPI consumers, Rate-limiting, Consumer groupsBeginnerShell
Secure APIs with Apache APISIX API GatewayHow to use APISIX Plugins for securing your Spring Boot REST APIs and it demonstrates how to effectively use them.APISIX plugins for Spring Boot Apps demoAPISIX plugins to secure Spring Boot REST APIs blog postSecurity, Authorization, Authentication, MonitoringBeginnerJava
An API observability with Apache APISIX Plugins ExampleLearn observing your APIs with Apache APISIX pluginsAPISIX observability plugins demoObservability plugins usage tutorialObservability, Traces, Metrics, LogsBeginnerShell
End-to-end tracing with OpenTelemetryUse OpenTelemetry and APISIX to start your journey into observabilityOpen Telemetry tracing with APISIX demoOpen Telemetry tracing tutorialObservability, Traces, OpenTelemetryIntermediateKotlin, Python, Rust
Chopping the monolithExtract HTTP endpoints from the monolith and gradually migrate to microservices using API GatewayChopping monolith demoChopping monolith tutorialAzure function, Response-rewriteBeginnerKotlin, JavaScript, HTML, Shell
Evolving your RESTful APIs, a step-by-step approachUse API Gateway to evolve APIs step by step by versioning, splitting the traffic, doing canary releases, and more.Evolve APIs demoEvolve APIs blog postProxy rewrite, Proxy mirror, Traffic split, Response rewrite, RedirectIntermediateKotlin, Lua, Java
Discussing Backend For Front-endUse API Gateway to build Backend For Frontend solution.Backend for front-end demoBackend for front-end blog postPublic endpoint, Proxy-rewrite, RoutingBeginnerPython, Lua
Getting Hands-On with the New Kubernetes Gateway APITutorial about using the Gateway API in practice with Apache APISIX Ingress.Getting Hands-On with the New Kubernetes Gateway API demoGetting Hands-On with the New Kubernetes Gateway API tutorialIngress, Kubernetes, RoutingBeginnerShell
Custom Plugins in APISIX IngressLearn how to create and use a small custom Plugin with APISIX deployed in Kubernetes.Custom plugin development for APISIX Ingress demoCustom plugin development for APISIX Ingress blog postCustom plugins, Ingress, KubernetesIntermediateLua
Canary Release in Kubernetes With Apache APISIX IngressGuide on setting up a canary release in Kubernetes using APISIX Ingress Controller.Canary release in Kubernetes with APISIX demoCanary release in Kubernetes with APISIX blog postIngress, Kubernetes, Canary releaseIntermediateLua
An Introduction to Monitoring Microservices with Prometheus and GrafanaInstruction on how you can set up monitoring on your microservice application using two of the popular tools in this space, Prometheus, and Grafana.Monitoring microservices demoIntro to monitoring microservices APIs with APISIX blog postObservability, Prometheus, GrafanaIntermediateGo, Python
Monitor API Health Check with APISIX and PrometheusThis example demonstrates how to enable and monitor API health checks using APISIX and Prometheus.Monitor API Health Check with APISIX and Prometheus demoPrometheus Plugin DemoObservability, Prometheus, GrafanaIntermediateGo, Python