# API7 Docs
> Official documentation for AISIX AI Gateway, AISIX Cloud, Apache APISIX, API7 Gateway, API7 and APISIX Ingress Controllers, and gateway plugins.
## ai-gateway
Route AI requests through a dedicated gateway layer with centralized provider keys, model aliases, routing, and traffic policy.
- [AISIX AI Gateway](https://docs.api7.ai/ai-gateway.md): Route AI requests through a dedicated gateway layer with centralized provider keys, model aliases, routing, and traffic policy.
### reference
#### admin-api
Inspect resources, model status, and health through the authenticated, read-only Admin API of an open-source AISIX gateway.
- [AISIX Admin API](https://docs.api7.ai/ai-gateway/reference/admin-api.md): Inspect resources, model status, and health through the authenticated, read-only Admin API of an open-source AISIX gateway.
#### cloud-admin-api
AISIX Cloud Admin API reference for organization-scoped automation in AISIX Cloud and AISIX Cloud On-Premises, generated from the AISIX control plane OpenAPI source.
- [AISIX Cloud Admin API](https://docs.api7.ai/ai-gateway/reference/cloud-admin-api.md): AISIX Cloud Admin API reference for organization-scoped automation in AISIX Cloud and AISIX Cloud On-Premises, generated from the AISIX control plane OpenAPI source.
#### cli
Reference for AISIX gateway commands that validate declarative resources and export etcd configuration to a resources.yaml file.
- [CLI Reference](https://docs.api7.ai/ai-gateway/reference/cli.md): Reference for AISIX gateway commands that validate declarative resources and export etcd configuration to a resources.yaml file.
#### cloud-admin-api-changelog
Endpoint and schema differences between released versions of the AISIX Cloud Admin API.
- [AISIX Cloud Admin API Changelog](https://docs.api7.ai/ai-gateway/reference/cloud-admin-api-changelog.md): Endpoint and schema differences between released versions of the AISIX Cloud Admin API.
#### config-status
Reference for AISIX gateway configuration-status endpoints and metrics, including applied, rejected, stale, and partially compatible resources.
- [Configuration Status](https://docs.api7.ai/ai-gateway/reference/config-status.md): Reference for AISIX gateway configuration-status endpoints and metrics, including applied, rejected, stale, and partially compatible resources.
#### configuration-files
Reference for AISIX gateway startup configuration formats, resource sources, connection settings, loading precedence, and common options.
- [Startup Configuration Reference](https://docs.api7.ai/ai-gateway/reference/configuration-files.md): Reference for AISIX gateway startup configuration formats, resource sources, connection settings, loading precedence, and common options.
#### environment-variables
Reference for AISIX AI Gateway environment variables used for configuration files, startup overrides, AISIX gateways, and runtime tuning.
- [Environment Variables](https://docs.api7.ai/ai-gateway/reference/environment-variables.md): Reference for AISIX AI Gateway environment variables used for configuration files, startup overrides, AISIX gateways, and runtime tuning.
#### headers-and-error-codes
Reference for AISIX gateway response headers, status codes, and error envelopes across proxy, MCP, A2A, and passthrough routes.
- [Headers and Error Codes](https://docs.api7.ai/ai-gateway/reference/headers-and-error-codes.md): Reference for AISIX gateway response headers, status codes, and error envelopes across proxy, MCP, A2A, and passthrough routes.
#### metrics
Reference for AISIX AI Gateway Prometheus metrics covering traffic, latency, tokens, cost, caching, guardrails, and upstream health.
- [Metrics Reference](https://docs.api7.ai/ai-gateway/reference/metrics.md): Reference for AISIX AI Gateway Prometheus metrics covering traffic, latency, tokens, cost, caching, guardrails, and upstream health.
#### on-premises-configuration
Reference for Docker Compose environment variables and Helm values used to run the AISIX Cloud control plane in your infrastructure.
- [On-Premises Configuration](https://docs.api7.ai/ai-gateway/reference/on-premises-configuration.md): Reference for Docker Compose environment variables and Helm values used to run the AISIX Cloud control plane in your infrastructure.
#### ports
Reference for default AISIX gateway and AISIX Cloud control-plane ports, traffic direction, configuration, and recommended network exposure.
- [Port Reference](https://docs.api7.ai/ai-gateway/reference/ports.md): Reference for default AISIX gateway and AISIX Cloud control-plane ports, traffic direction, configuration, and recommended network exposure.
#### proxy-api
Reference for AISIX gateway proxy routes, authentication, model discovery, routing behavior, and endpoint constraints.
- [Proxy API Reference](https://docs.api7.ai/ai-gateway/reference/proxy-api.md): Reference for AISIX gateway proxy routes, authentication, model discovery, routing behavior, and endpoint constraints.
#### resources-file
Configure AISIX AI Gateway with resources.yaml using this reference for supported collections, fields, environment interpolation, and validation rules.
- [Resources File Reference](https://docs.api7.ai/ai-gateway/reference/resources-file.md): Configure AISIX AI Gateway with resources.yaml using this reference for supported collections, fields, environment interpolation, and validation rules.
### agent-gateway
#### agent-access-control
Scope each AISIX caller API key to exact A2A agent names, name patterns, or every registered agent. A2A access is denied by default.
- [Control Agent Access](https://docs.api7.ai/ai-gateway/agent-gateway/agent-access-control.md): Scope each AISIX caller API key to exact A2A agent names, name patterns, or every registered agent. A2A access is denied by default.
#### observability
Read the usage events and Prometheus metrics that A2A agent calls emit in AISIX AI Gateway, tagged so you can isolate A2A traffic from model traffic.
- [Observability](https://docs.api7.ai/ai-gateway/agent-gateway/observability.md): Read the usage events and Prometheus metrics that A2A agent calls emit in AISIX AI Gateway, tagged so you can isolate A2A traffic from model traffic.
#### overview
Expose A2A agents through AISIX with caller access control, upstream authentication, rate limits, AISIX Cloud budgets, and telemetry.
- [Agent Gateway Overview](https://docs.api7.ai/ai-gateway/agent-gateway/overview.md): Expose A2A agents through AISIX with caller access control, upstream authentication, rate limits, AISIX Cloud budgets, and telemetry.
#### setup
Register an A2A agent in AISIX Cloud or an open-source AISIX gateway, grant caller access, and verify it with the official A2A Go SDK client.
- [Set Up Agent Gateway](https://docs.api7.ai/ai-gateway/agent-gateway/setup.md): Register an A2A agent in AISIX Cloud or an open-source AISIX gateway, grant caller access, and verify it with the official A2A Go SDK client.
#### streaming-and-discovery
Use the official A2A Go SDK client to test streaming through AISIX Agent Gateway and verify agent-card discovery through a public origin.
- [A2A Streaming and Agent-Card Discovery](https://docs.api7.ai/ai-gateway/agent-gateway/streaming-and-discovery.md): Use the official A2A Go SDK client to test streaming through AISIX Agent Gateway and verify agent-card discovery through a public origin.
#### traffic-controls
Apply caller API key request and concurrency limits to A2A calls in AISIX, and use AISIX Cloud budgets across a caller's traffic.
- [Rate Limits and Budgets](https://docs.api7.ai/ai-gateway/agent-gateway/traffic-controls.md): Apply caller API key request and concurrency limits to A2A calls in AISIX, and use AISIX Cloud budgets across a caller's traffic.
#### upstream-authentication
Configure how AISIX authenticates to an upstream A2A agent with no credential, a bearer token, or an API key held by the gateway.
- [Upstream Authentication](https://docs.api7.ai/ai-gateway/agent-gateway/upstream-authentication.md): Configure how AISIX authenticates to an upstream A2A agent with no credential, a bearer token, or an API key held by the gateway.
### cloud
#### admin-tokens
Create and manage AISIX Cloud admin tokens for organization-level automation, including scopes, expiration, rotation, revocation, and SCIM access.
- [Admin Tokens](https://docs.api7.ai/ai-gateway/cloud/admin-tokens.md): Create and manage AISIX Cloud admin tokens for organization-level automation, including scopes, expiration, rotation, revocation, and SCIM access.
#### connect-a-gateway
Add an AISIX gateway as the data plane for an AISIX Cloud environment with dashboard-issued mTLS credentials, deployment snippets, and connection verification.
- [Connect an AISIX Gateway](https://docs.api7.ai/ai-gateway/cloud/connect-a-gateway.md): Add an AISIX gateway as the data plane for an AISIX Cloud environment with dashboard-issued mTLS credentials, deployment snippets, and connection verification.
#### custom-roles
Understand AISIX Cloud owner, admin, member, and custom roles, then assign fine-grained permissions and environment-scoped access across the control plane.
- [Roles and Custom Roles](https://docs.api7.ai/ai-gateway/cloud/custom-roles.md): Understand AISIX Cloud owner, admin, member, and custom roles, then assign fine-grained permissions and environment-scoped access across the control plane.
#### high-availability
Design a highly available AISIX Cloud traffic path with redundant AISIX gateways, resilient control-plane connectivity, and upstream failover.
- [High Availability](https://docs.api7.ai/ai-gateway/cloud/high-availability.md): Design a highly available AISIX Cloud traffic path with redundant AISIX gateways, resilient control-plane connectivity, and upstream failover.
#### kubernetes
Deploy and scale AISIX gateways as AISIX Cloud data planes on Kubernetes using the api7/aisix Helm chart, a HorizontalPodAutoscaler, or KEDA.
- [Deploy AISIX Gateways on Kubernetes](https://docs.api7.ai/ai-gateway/cloud/kubernetes.md): Deploy and scale AISIX gateways as AISIX Cloud data planes on Kubernetes using the api7/aisix Helm chart, a HorizontalPodAutoscaler, or KEDA.
#### logging-and-auditing
Understand how the AISIX Cloud control plane records gateway requests and resource changes.
- [Logging and Auditing](https://docs.api7.ai/ai-gateway/cloud/logging-and-auditing.md): Understand how the AISIX Cloud control plane records gateway requests and resource changes.
#### members
Add organization members for AISIX Cloud control-plane access or API key ownership.
- [Members](https://docs.api7.ai/ai-gateway/cloud/members.md): Add organization members for AISIX Cloud control-plane access or API key ownership.
#### model-pricing
Understand how the AISIX Cloud control plane derives per-request cost, and set prices for models the catalog does not cover.
- [Model Pricing](https://docs.api7.ai/ai-gateway/cloud/model-pricing.md): Understand how the AISIX Cloud control plane derives per-request cost, and set prices for models the catalog does not cover.
#### offline-resilience
Understand how AISIX gateways serve cached configuration during control-plane outages, including restart, budget, telemetry, and recovery behavior.
- [Offline Resilience](https://docs.api7.ai/ai-gateway/cloud/offline-resilience.md): Understand how AISIX gateways serve cached configuration during control-plane outages, including restart, budget, telemetry, and recovery behavior.
#### organizations-and-environments
Create and understand AISIX Cloud organizations and environments, including how environment resources reach connected AISIX gateways.
- [Organizations and Environments](https://docs.api7.ai/ai-gateway/cloud/organizations-and-environments.md): Create and understand AISIX Cloud organizations and environments, including how environment resources reach connected AISIX gateways.
#### overview
Learn how AISIX Cloud adds centralized management while AISIX gateways serve AI traffic directly in your environment.
- [AISIX Cloud](https://docs.api7.ai/ai-gateway/cloud/overview.md): Learn how AISIX Cloud adds centralized management while AISIX gateways serve AI traffic directly in your environment.
#### playground
Understand what AISIX Cloud playground requests can validate compared with gateway requests.
- [Playground](https://docs.api7.ai/ai-gateway/cloud/playground.md): Understand what AISIX Cloud playground requests can validate compared with gateway requests.
#### resource-projection
Understand how AISIX Cloud projects environment resources, then verify publication, gateway application, and caller-visible behavior.
- [Resource Projection](https://docs.api7.ai/ai-gateway/cloud/resource-projection.md): Understand how AISIX Cloud projects environment resources, then verify publication, gateway application, and caller-visible behavior.
#### scim-directory-sync
Provision AISIX organization members automatically from your identity provider with SCIM 2.0.
- [SCIM Directory Sync](https://docs.api7.ai/ai-gateway/cloud/scim-directory-sync.md): Provision AISIX organization members automatically from your identity provider with SCIM 2.0.
#### teams
Group AISIX Cloud members into teams, bind caller API keys for attribution, and configure team budgets, rate limits, and MCP access.
- [Teams](https://docs.api7.ai/ai-gateway/cloud/teams.md): Group AISIX Cloud members into teams, bind caller API keys for attribution, and configure team budgets, rate limits, and MCP access.
#### usage-reporting
Understand how the AISIX Cloud control plane reports gateway usage, spend, and budget-related signals.
- [Usage Reporting](https://docs.api7.ai/ai-gateway/cloud/usage-reporting.md): Understand how the AISIX Cloud control plane reports gateway usage, spend, and budget-related signals.
### deployment
#### configuration-propagation
Understand how resource changes reach an AISIX gateway, reload a declarative resources file safely, and verify the applied configuration.
- [Configuration Propagation](https://docs.api7.ai/ai-gateway/deployment/configuration-propagation.md): Understand how resource changes reach an AISIX gateway, reload a declarative resources file safely, and verify the applied configuration.
#### forward-proxy
Deploy AISIX behind a TLS-terminating egress proxy for governed IDE AI traffic, using GitHub Copilot extensions and Copilot CLI as the worked example.
- [Forward Proxy for IDE AI Traffic](https://docs.api7.ai/ai-gateway/deployment/forward-proxy.md): Deploy AISIX behind a TLS-terminating egress proxy for governed IDE AI traffic, using GitHub Copilot extensions and Copilot CLI as the worked example.
#### health-checks
Choose and interpret AISIX gateway health checks for process liveness, traffic readiness, model health, and configuration state.
- [Health Checks](https://docs.api7.ai/ai-gateway/deployment/health-checks.md): Choose and interpret AISIX gateway health checks for process liveness, traffic readiness, model health, and configuration state.
#### network-and-security
Operate AISIX AI Gateway with correct listener exposure, configuration-source isolation, and credential handling.
- [Network and Security](https://docs.api7.ai/ai-gateway/deployment/network-and-security.md): Operate AISIX AI Gateway with correct listener exposure, configuration-source isolation, and credential handling.
#### performance-and-sizing
Expected AISIX AI Gateway proxy overhead and throughput, and how to size CPU for your request volume.
- [Performance and Sizing](https://docs.api7.ai/ai-gateway/deployment/performance-and-sizing.md): Expected AISIX AI Gateway proxy overhead and throughput, and how to size CPU for your request volume.
#### production
Prepare AISIX AI Gateway for production traffic by planning capacity, dependencies, network exposure, health checks, recovery, and shutdown.
- [Production Readiness](https://docs.api7.ai/ai-gateway/deployment/production.md): Prepare AISIX AI Gateway for production traffic by planning capacity, dependencies, network exposure, health checks, recovery, and shutdown.
#### startup-configuration
Configure AISIX AI Gateway startup settings, including its resource source, listeners, runtime dependencies, observability, and AISIX Cloud connection.
- [Startup Configuration](https://docs.api7.ai/ai-gateway/deployment/startup-configuration.md): Configure AISIX AI Gateway startup settings, including its resource source, listeners, runtime dependencies, observability, and AISIX Cloud connection.
#### thread-per-core-workers
Configure AISIX AI Gateway worker threads and thread-per-core serving, verify the active mode, and plan for per-worker upstream pools and shared listeners.
- [Thread-per-Core Workers](https://docs.api7.ai/ai-gateway/deployment/thread-per-core-workers.md): Configure AISIX AI Gateway worker threads and thread-per-core serving, verify the active mode, and plan for per-worker upstream pools and shared listeners.
#### tls-and-mtls
Configure listener TLS, upstream trust, etcd mTLS, and AISIX Cloud control-plane mTLS for AISIX AI Gateway.
- [TLS and mTLS](https://docs.api7.ai/ai-gateway/deployment/tls-and-mtls.md): Configure listener TLS, upstream trust, etcd mTLS, and AISIX Cloud control-plane mTLS for AISIX AI Gateway.
#### troubleshooting
Diagnose startup, configuration, caller access, policy, upstream, and AISIX gateway failures in AISIX AI Gateway.
- [Troubleshooting](https://docs.api7.ai/ai-gateway/deployment/troubleshooting.md): Diagnose startup, configuration, caller access, policy, upstream, and AISIX gateway failures in AISIX AI Gateway.
#### url-rewriting
Map legacy or external URL shapes onto AISIX AI Gateway endpoints with entry-level rewrite rules, so existing clients migrate without configuration changes.
- [URL Rewriting](https://docs.api7.ai/ai-gateway/deployment/url-rewriting.md): Map legacy or external URL shapes onto AISIX AI Gateway endpoints with entry-level rewrite rules, so existing clients migrate without configuration changes.
### endpoints
#### anthropic-messages
Understand how AISIX AI Gateway handles Anthropic-style Messages requests, including caller keys, model aliases, upstream translation, token counting, and errors.
- [Anthropic-Style Messages API](https://docs.api7.ai/ai-gateway/endpoints/anthropic-messages.md): Understand how AISIX AI Gateway handles Anthropic-style Messages requests, including caller keys, model aliases, upstream translation, token counting, and errors.
#### audio
Learn how AISIX AI Gateway handles OpenAI-style audio transcription, translation, and speech endpoints.
- [Speech and Audio](https://docs.api7.ai/ai-gateway/endpoints/audio.md): Learn how AISIX AI Gateway handles OpenAI-style audio transcription, translation, and speech endpoints.
#### batch-files-fine-tuning
Run the OpenAI-compatible Files, Batch, and Fine-tuning APIs through AISIX AI Gateway, with gateway-managed provider routing and batch usage attribution.
- [Batch, Files, and Fine-Tuning](https://docs.api7.ai/ai-gateway/endpoints/batch-files-fine-tuning.md): Run the OpenAI-compatible Files, Batch, and Fine-tuning APIs through AISIX AI Gateway, with gateway-managed provider routing and batch usage attribution.
#### chat-audio
Send audio to an OpenAI-compatible chat model through AISIX and save generated audio from a non-streaming Chat Completions response.
- [Audio Input and Output with Chat Completions](https://docs.api7.ai/ai-gateway/endpoints/chat-audio.md): Send audio to an OpenAI-compatible chat model through AISIX and save generated audio from a non-streaming Chat Completions response.
#### embeddings
Learn how AISIX AI Gateway handles the OpenAI-compatible embeddings endpoint, including request format and provider limits.
- [Embeddings](https://docs.api7.ai/ai-gateway/endpoints/embeddings.md): Learn how AISIX AI Gateway handles the OpenAI-compatible embeddings endpoint, including request format and provider limits.
#### image-editing
Edit images through the AISIX AI Gateway /v1/images/edits endpoint with multipart uploads, model aliases, prompt guardrails, and token usage accounting.
- [Image Editing](https://docs.api7.ai/ai-gateway/endpoints/image-editing.md): Edit images through the AISIX AI Gateway /v1/images/edits endpoint with multipart uploads, model aliases, prompt guardrails, and token usage accounting.
#### image-generation
Learn how AISIX AI Gateway handles the OpenAI image generation endpoint and provider support.
- [Image Generation](https://docs.api7.ai/ai-gateway/endpoints/image-generation.md): Learn how AISIX AI Gateway handles the OpenAI image generation endpoint and provider support.
#### openai-client-to-anthropic
Use an OpenAI-compatible client with an Anthropic-backed AISIX model alias and understand how the gateway translates requests and responses.
- [OpenAI Client with Anthropic Upstream](https://docs.api7.ai/ai-gateway/endpoints/openai-client-to-anthropic.md): Use an OpenAI-compatible client with an Anthropic-backed AISIX model alias and understand how the gateway translates requests and responses.
#### openai-compatible-chat
Understand how AISIX AI Gateway handles OpenAI-compatible POST /v1/chat/completions requests, model aliases, authentication, provider translation, and errors.
- [OpenAI-Compatible Chat Completions](https://docs.api7.ai/ai-gateway/endpoints/openai-compatible-chat.md): Understand how AISIX AI Gateway handles OpenAI-compatible POST /v1/chat/completions requests, model aliases, authentication, provider translation, and errors.
#### overview
Compare AISIX caller-facing API families and proxy routes, including supported operations, model discovery, health checks, and shared gateway behavior.
- [Supported Endpoints](https://docs.api7.ai/ai-gateway/endpoints/overview.md): Compare AISIX caller-facing API families and proxy routes, including supported operations, model discovery, health checks, and shared gateway behavior.
#### provider-passthrough
Relay provider-native APIs and forward-proxy traffic through AISIX passthrough routes with matching, authentication, credentials, controls, and telemetry.
- [Passthrough Routes](https://docs.api7.ai/ai-gateway/endpoints/provider-passthrough.md): Relay provider-native APIs and forward-proxy traffic through AISIX passthrough routes with matching, authentication, credentials, controls, and telemetry.
#### realtime
Connect OpenAI Realtime WebSocket clients through AISIX AI Gateway with gateway-managed authentication, policy enforcement, and session usage tracking.
- [Realtime API](https://docs.api7.ai/ai-gateway/endpoints/realtime.md): Connect OpenAI Realtime WebSocket clients through AISIX AI Gateway with gateway-managed authentication, policy enforcement, and session usage tracking.
#### request-lifecycle
Understand how AISIX authenticates callers, resolves model aliases, applies controls, routes to providers, and records usage for each AI request.
- [Request Lifecycle](https://docs.api7.ai/ai-gateway/endpoints/request-lifecycle.md): Understand how AISIX authenticates callers, resolves model aliases, applies controls, routes to providers, and records usage for each AI request.
#### rerank
Learn how AISIX AI Gateway proxies rerank requests through supported rerank providers.
- [Rerank](https://docs.api7.ai/ai-gateway/endpoints/rerank.md): Learn how AISIX AI Gateway proxies rerank requests through supported rerank providers.
#### responses-api
Learn how AISIX AI Gateway handles the OpenAI Responses API and provider support.
- [Responses API](https://docs.api7.ai/ai-gateway/endpoints/responses-api.md): Learn how AISIX AI Gateway handles the OpenAI Responses API and provider support.
#### streaming
Understand streaming behavior on AISIX AI Gateway, including OpenAI-style and Anthropic-style streaming paths.
- [Streaming](https://docs.api7.ai/ai-gateway/endpoints/streaming.md): Understand streaming behavior on AISIX AI Gateway, including OpenAI-style and Anthropic-style streaming paths.
#### text-completions
Learn how AISIX AI Gateway handles OpenAI-compatible text-completions requests.
- [Text Completions](https://docs.api7.ai/ai-gateway/endpoints/text-completions.md): Learn how AISIX AI Gateway handles OpenAI-compatible text-completions requests.
#### tool-calling
Understand tool-calling behavior on AISIX AI Gateway, including OpenAI-compatible requests and Anthropic translation.
- [Tool Calling](https://docs.api7.ai/ai-gateway/endpoints/tool-calling.md): Understand tool-calling behavior on AISIX AI Gateway, including OpenAI-compatible requests and Anthropic translation.
#### video-generation
Generate videos through the AISIX AI Gateway /v1/videos endpoint with asynchronous task submission, status polling, and video download.
- [Video Generation](https://docs.api7.ai/ai-gateway/endpoints/video-generation.md): Generate videos through the AISIX AI Gateway /v1/videos endpoint with asynchronous task submission, status polling, and video download.
### getting-started
#### aisix-cloud-quickstart
Deploy an On-Premises AISIX Cloud control plane with Docker Compose, configure a model, and send your first request through an attached AISIX gateway.
- [AISIX Cloud Quickstart](https://docs.api7.ai/ai-gateway/getting-started/aisix-cloud-quickstart.md): Deploy an On-Premises AISIX Cloud control plane with Docker Compose, configure a model, and send your first request through an attached AISIX gateway.
#### anthropic-sdk
Configure an Anthropic-compatible client to call AISIX AI Gateway through the /v1/messages proxy API.
- [Anthropic SDK](https://docs.api7.ai/ai-gateway/getting-started/anthropic-sdk.md): Configure an Anthropic-compatible client to call AISIX AI Gateway through the /v1/messages proxy API.
#### gateway-quickstart
Run an open-source AISIX gateway in one container, declare provider keys, models, and caller API keys in a resources.yaml file, and send your first request.
- [Open-Source AISIX Gateway Quickstart](https://docs.api7.ai/ai-gateway/getting-started/gateway-quickstart.md): Run an open-source AISIX gateway in one container, declare provider keys, models, and caller API keys in a resources.yaml file, and send your first request.
#### openai-sdk
Configure the official OpenAI SDK to call AISIX AI Gateway through the OpenAI-compatible proxy API.
- [OpenAI SDK](https://docs.api7.ai/ai-gateway/getting-started/openai-sdk.md): Configure the official OpenAI SDK to call AISIX AI Gateway through the OpenAI-compatible proxy API.
#### products-and-deployment-options
Compare the open-source AISIX gateway with the On-Premises and Hybrid Cloud control-plane deployment options for AISIX Cloud.
- [AISIX Products and Deployment Options](https://docs.api7.ai/ai-gateway/getting-started/products-and-deployment-options.md): Compare the open-source AISIX gateway with the On-Premises and Hybrid Cloud control-plane deployment options for AISIX Cloud.
### integrations
Connect SDKs, coding agents, application frameworks, AI application platforms, and voice agent platforms to AISIX AI Gateway.
- [Integrations](https://docs.api7.ai/ai-gateway/integrations.md): Connect SDKs, coding agents, application frameworks, AI application platforms, and voice agent platforms to AISIX AI Gateway.
#### application-platforms
Connect AI application platforms to AISIX AI Gateway for governed model access while the platform continues to run workflows, tools, RAG, and user interfaces.
- [AI Application Platforms](https://docs.api7.ai/ai-gateway/integrations/application-platforms.md): Connect AI application platforms to AISIX AI Gateway for governed model access while the platform continues to run workflows, tools, RAG, and user interfaces.
- [Dify](https://docs.api7.ai/ai-gateway/integrations/application-platforms/dify.md): Configure Dify's OpenAI-API-compatible model provider plugin to send application and agent model requests through AISIX AI Gateway.
- [n8n](https://docs.api7.ai/ai-gateway/integrations/application-platforms/n8n.md): Configure the n8n OpenAI Chat Model to send AI Agent and chain requests through AISIX AI Gateway with a caller key and model alias.
- [Open WebUI](https://docs.api7.ai/ai-gateway/integrations/application-platforms/open-webui.md): Connect Open WebUI to AISIX AI Gateway as an OpenAI-compatible endpoint with caller authentication, model discovery, streaming, and tool-call support.
#### coding-agents
Connect coding agents directly or through a forward proxy to govern model, tool, and official-service traffic with AISIX access controls and telemetry.
- [Coding Agents](https://docs.api7.ai/ai-gateway/integrations/coding-agents.md): Connect coding agents directly or through a forward proxy to govern model, tool, and official-service traffic with AISIX access controls and telemetry.
- [Claude Code](https://docs.api7.ai/ai-gateway/integrations/coding-agents/claude-code.md): Configure Claude Code to send Anthropic Messages traffic through AISIX AI Gateway.
- [Cline](https://docs.api7.ai/ai-gateway/integrations/coding-agents/cline.md): Configure Cline to send OpenAI-compatible model traffic through AISIX AI Gateway.
- [Codex](https://docs.api7.ai/ai-gateway/integrations/coding-agents/codex.md): Configure Codex to send Responses API traffic through AISIX AI Gateway.
- [Cursor](https://docs.api7.ai/ai-gateway/integrations/coding-agents/cursor.md): Configure Cursor to send OpenAI-compatible chat traffic through AISIX AI Gateway.
#### frameworks
- [CrewAI](https://docs.api7.ai/ai-gateway/integrations/frameworks/crewai.md): Configure CrewAI to send OpenAI-compatible chat traffic through AISIX AI Gateway.
- [Haystack](https://docs.api7.ai/ai-gateway/integrations/frameworks/haystack.md): Configure Haystack to send OpenAI Responses API traffic through AISIX AI Gateway.
- [Instructor](https://docs.api7.ai/ai-gateway/integrations/frameworks/instructor.md): Configure Instructor to send OpenAI Responses API structured-output requests through AISIX AI Gateway.
- [LangChain and LangGraph](https://docs.api7.ai/ai-gateway/integrations/frameworks/langchain.md): Configure LangChain and LangGraph to send OpenAI Responses API traffic through AISIX AI Gateway.
- [LlamaIndex](https://docs.api7.ai/ai-gateway/integrations/frameworks/llamaindex.md): Configure LlamaIndex to send OpenAI Responses API traffic through AISIX AI Gateway.
- [Microsoft Agent Framework](https://docs.api7.ai/ai-gateway/integrations/frameworks/microsoft-agent-framework.md): Configure Microsoft Agent Framework to send OpenAI Responses API traffic through AISIX AI Gateway.
- [OpenAI Agents SDK](https://docs.api7.ai/ai-gateway/integrations/frameworks/openai-agents-sdk.md): Configure OpenAI Agents SDK to send OpenAI Responses API traffic through AISIX AI Gateway.
- [Pydantic AI](https://docs.api7.ai/ai-gateway/integrations/frameworks/pydantic-ai.md): Configure Pydantic AI to send OpenAI Responses API traffic through AISIX AI Gateway.
- [Vercel AI SDK](https://docs.api7.ai/ai-gateway/integrations/frameworks/vercel-ai-sdk.md): Configure Vercel AI SDK to send OpenAI Responses API traffic through AISIX AI Gateway.
#### voice-agents
Connect voice agent platforms to AISIX AI Gateway so their text model requests use gateway authentication, model aliases, routing, policy, and telemetry.
- [Voice Agent Platforms](https://docs.api7.ai/ai-gateway/integrations/voice-agents.md): Connect voice agent platforms to AISIX AI Gateway so their text model requests use gateway authentication, model aliases, routing, policy, and telemetry.
- [ElevenLabs Agents](https://docs.api7.ai/ai-gateway/integrations/voice-agents/elevenlabs.md): Configure an ElevenLabs Agent to use AISIX AI Gateway as its Custom LLM endpoint with a restricted caller key and model alias.
- [LiveKit Agents](https://docs.api7.ai/ai-gateway/integrations/voice-agents/livekit.md): Configure the LiveKit Agents OpenAI plugin to stream Chat Completions requests through AISIX AI Gateway with a caller key and model alias.
- [Pipecat](https://docs.api7.ai/ai-gateway/integrations/voice-agents/pipecat.md): Configure Pipecat OpenAILLMService to stream Chat Completions requests through AISIX AI Gateway while Pipecat operates the voice pipeline.
- [Vapi](https://docs.api7.ai/ai-gateway/integrations/voice-agents/vapi.md): Configure a Vapi voice assistant to use AISIX AI Gateway as an authenticated OpenAI-compatible Custom LLM endpoint.
### mcp-gateway
#### access-policies
Manage MCP tool access across AISIX Cloud environments and teams, and combine those layers with each caller API key's own grant.
- [Manage MCP Access with Policies](https://docs.api7.ai/ai-gateway/mcp-gateway/access-policies.md): Manage MCP tool access across AISIX Cloud environments and teams, and combine those layers with each caller API key's own grant.
#### client-authentication
Choose how MCP clients authenticate to AISIX AI Gateway — with a gateway API key, through OAuth sign-in, or anonymously from trusted networks.
- [Client Authentication](https://docs.api7.ai/ai-gateway/mcp-gateway/client-authentication.md): Choose how MCP clients authenticate to AISIX AI Gateway — with a gateway API key, through OAuth sign-in, or anonymously from trusted networks.
#### cursor
Connect Cursor to AISIX MCP Gateway with a caller API key, discover the permitted tools, and verify a complete tool call through AISIX.
- [Connect Cursor to MCP Gateway](https://docs.api7.ai/ai-gateway/mcp-gateway/cursor.md): Connect Cursor to AISIX MCP Gateway with a caller API key, discover the permitted tools, and verify a complete tool call through AISIX.
#### guardrails
Inspect MCP tool-call arguments and results with AISIX guardrails, blocking unsafe calls before dispatch or withholding unsafe results from clients.
- [Guardrails](https://docs.api7.ai/ai-gateway/mcp-gateway/guardrails.md): Inspect MCP tool-call arguments and results with AISIX guardrails, blocking unsafe calls before dispatch or withholding unsafe results from clients.
#### observability
Read the usage events and Prometheus metrics that MCP tool calls emit in AISIX AI Gateway, tagged so you can isolate MCP traffic from model traffic.
- [Observability](https://docs.api7.ai/ai-gateway/mcp-gateway/observability.md): Read the usage events and Prometheus metrics that MCP tool calls emit in AISIX AI Gateway, tagged so you can isolate MCP traffic from model traffic.
#### openapi-servers
Register a REST API with its OpenAPI document so AISIX AI Gateway generates MCP tools from its operations and executes tool calls as HTTP requests.
- [Expose a REST API as MCP Tools](https://docs.api7.ai/ai-gateway/mcp-gateway/openapi-servers.md): Register a REST API with its OpenAPI document so AISIX AI Gateway generates MCP tools from its operations and executes tool calls as HTTP requests.
#### overview
Expose upstream MCP servers through AISIX AI Gateway with caller API key access control, upstream authentication, guardrails, telemetry, and automatic MCP protocol version negotiation.
- [MCP Gateway Overview](https://docs.api7.ai/ai-gateway/mcp-gateway/overview.md): Expose upstream MCP servers through AISIX AI Gateway with caller API key access control, upstream authentication, guardrails, telemetry, and automatic MCP protocol version negotiation.
#### server-review
Review MCP server registrations and changes in AISIX Cloud before publishing them to gateways, and revoke approvals that no longer hold.
- [Review and Approve MCP Servers](https://docs.api7.ai/ai-gateway/mcp-gateway/server-review.md): Review MCP server registrations and changes in AISIX Cloud before publishing them to gateways, and revoke approvals that no longer hold.
#### setup
Register an upstream MCP server in AISIX Cloud or an open-source AISIX gateway, grant one tool, and verify allowed and denied MCP calls.
- [Set Up MCP Gateway](https://docs.api7.ai/ai-gateway/mcp-gateway/setup.md): Register an upstream MCP server in AISIX Cloud or an open-source AISIX gateway, grant one tool, and verify allowed and denied MCP calls.
#### tool-access-control
Scope each caller API key to the MCP tools it may list and call in AISIX AI Gateway, using exact names, per-server wildcards, or a global wildcard.
- [Control Tool Access](https://docs.api7.ai/ai-gateway/mcp-gateway/tool-access-control.md): Scope each caller API key to the MCP tools it may list and call in AISIX AI Gateway, using exact names, per-server wildcards, or a global wildcard.
#### traffic-controls
Configure MCP request and concurrency limits in AISIX AI Gateway, plus AISIX Cloud budgets, using the caller API key boundary.
- [Rate Limits and Budgets](https://docs.api7.ai/ai-gateway/mcp-gateway/traffic-controls.md): Configure MCP request and concurrency limits in AISIX AI Gateway, plus AISIX Cloud budgets, using the caller API key boundary.
#### upstream-authentication
Configure how AISIX AI Gateway authenticates to each upstream MCP server with no credential, a bearer token, an API key, or OAuth 2.0 client credentials.
- [Upstream Authentication](https://docs.api7.ai/ai-gateway/mcp-gateway/upstream-authentication.md): Configure how AISIX AI Gateway authenticates to each upstream MCP server with no credential, a bearer token, an API key, or OAuth 2.0 client credentials.
#### vscode
Connect Visual Studio Code to AISIX MCP Gateway with a protected caller key, discover permitted tools, and verify a complete tool call.
- [Connect VS Code to MCP Gateway](https://docs.api7.ai/ai-gateway/mcp-gateway/vscode.md): Connect Visual Studio Code to AISIX MCP Gateway with a protected caller key, discover permitted tools, and verify a complete tool call.
### models
#### model-aliases
Configure direct and wildcard model aliases in AISIX gateway deployments, including retries, pricing, rate limits, and other model-level behavior.
- [Model Aliases](https://docs.api7.ai/ai-gateway/models/model-aliases.md): Configure direct and wildcard model aliases in AISIX gateway deployments, including retries, pricing, rate limits, and other model-level behavior.
#### provider-key-rotation
Rotate upstream provider credentials across AISIX gateway deployments with in-place and gradual workflows that keep caller API keys and model aliases stable.
- [Provider Key Rotation](https://docs.api7.ai/ai-gateway/models/provider-key-rotation.md): Rotate upstream provider credentials across AISIX gateway deployments with in-place and gradual workflows that keep caller API keys and model aliases stable.
#### provider-keys
Configure provider keys across AISIX gateway deployments for upstream credentials, endpoints, adapters, request headers, compatibility overrides, and rotation.
- [Provider Keys](https://docs.api7.ai/ai-gateway/models/provider-keys.md): Configure provider keys across AISIX gateway deployments for upstream credentials, endpoints, adapters, request headers, compatibility overrides, and rotation.
#### reasoning-effort-mapping
Rewrite reasoning-effort values for each direct model without changing client requests.
- [Reasoning Effort Mapping](https://docs.api7.ai/ai-gateway/models/reasoning-effort-mapping.md): Rewrite reasoning-effort values for each direct model without changing client requests.
#### resource-model
Understand how provider keys, models, caller API keys, routing, traffic controls, and policies work together across AISIX gateway deployments.
- [Resource Model](https://docs.api7.ai/ai-gateway/models/resource-model.md): Understand how provider keys, models, caller API keys, routing, traffic controls, and policies work together across AISIX gateway deployments.
#### upstream-request-headers
Forward approved caller headers to an upstream on any AISIX proxy face, inject request-context headers on a provider key, and understand which headers AISIX never relays.
- [Upstream Request Headers](https://docs.api7.ai/ai-gateway/models/upstream-request-headers.md): Forward approved caller headers to an upstream on any AISIX proxy face, inject request-context headers on a provider key, and understand which headers AISIX never relays.
### observability
#### exporters
Send AISIX gateway request telemetry to OTLP collectors, object storage, Datadog, or Alibaba Cloud SLS through either configuration path.
- [Observability Exporters](https://docs.api7.ai/ai-gateway/observability/exporters.md): Send AISIX gateway request telemetry to OTLP collectors, object storage, Datadog, or Alibaba Cloud SLS through either configuration path.
#### load-logs-into-snowflake
Export AISIX gateway request telemetry to Amazon S3 or Azure Blob, ingest the records with Snowpipe, and query them through a Snowflake view.
- [Load Request Telemetry into Snowflake](https://docs.api7.ai/ai-gateway/observability/load-logs-into-snowflake.md): Export AISIX gateway request telemetry to Amazon S3 or Azure Blob, ingest the records with Snowpipe, and query them through a Snowflake view.
#### metrics-and-logs
Monitor AISIX gateway traffic with Prometheus metrics, structured access logs, response headers, and exportable per-attempt usage events.
- [Metrics and Logs](https://docs.api7.ai/ai-gateway/observability/metrics-and-logs.md): Monitor AISIX gateway traffic with Prometheus metrics, structured access logs, response headers, and exportable per-attempt usage events.
### on-premises
#### deployment
Plan production resources and install the AISIX Cloud control plane in your infrastructure with Docker Compose, Helm, or an offline package.
- [On-Premises Installation](https://docs.api7.ai/ai-gateway/on-premises/deployment.md): Plan production resources and install the AISIX Cloud control plane in your infrastructure with Docker Compose, Helm, or an offline package.
#### external-database
Provision external PostgreSQL and a least-privilege role for an AISIX Cloud control plane installed with Helm, without granting superuser access.
- [External Database](https://docs.api7.ai/ai-gateway/on-premises/external-database.md): Provision external PostgreSQL and a least-privilege role for an AISIX Cloud control plane installed with Helm, without granting superuser access.
### providers
#### adapters
Understand the OpenAI, Anthropic, Amazon Bedrock, Google Vertex AI, and Azure OpenAI protocol adapter families available in AISIX gateway deployments.
- [Adapter Protocol Families](https://docs.api7.ai/ai-gateway/providers/adapters.md): Understand the OpenAI, Anthropic, Amazon Bedrock, Google Vertex AI, and Azure OpenAI protocol adapter families available in AISIX gateway deployments.
#### amazon-nova
Connect the direct Amazon Nova API to AISIX gateway deployments. Configure API credentials, Nova model aliases, caller API keys, and model access controls.
- [Amazon Nova API](https://docs.api7.ai/ai-gateway/providers/amazon-nova.md): Connect the direct Amazon Nova API to AISIX gateway deployments. Configure API credentials, Nova model aliases, caller API keys, and model access controls.
#### anthropic
Connect Anthropic Claude to AISIX gateway deployments through the native Messages or OpenAI-compatible API. Configure credentials, model aliases, and caller access.
- [Anthropic](https://docs.api7.ai/ai-gateway/providers/anthropic.md): Connect Anthropic Claude to AISIX gateway deployments through the native Messages or OpenAI-compatible API. Configure credentials, model aliases, and caller access.
#### aws-bedrock
Connect AWS Bedrock to AISIX gateway deployments using SigV4. Configure regional endpoints, model or inference-profile aliases, caller keys, and access controls.
- [AWS Bedrock](https://docs.api7.ai/ai-gateway/providers/aws-bedrock.md): Connect AWS Bedrock to AISIX gateway deployments using SigV4. Configure regional endpoints, model or inference-profile aliases, caller keys, and access controls.
#### azure-openai
Connect Azure OpenAI to AISIX gateway deployments using resource API keys or Microsoft Entra ID. Configure deployment aliases, caller keys, and access controls.
- [Azure OpenAI](https://docs.api7.ai/ai-gateway/providers/azure-openai.md): Connect Azure OpenAI to AISIX gateway deployments using resource API keys or Microsoft Entra ID. Configure deployment aliases, caller keys, and access controls.
#### baseten
Connect Baseten Model APIs or dedicated endpoints to AISIX gateway deployments. Configure credentials, model aliases, caller keys, and access controls.
- [Baseten](https://docs.api7.ai/ai-gateway/providers/baseten.md): Connect Baseten Model APIs or dedicated endpoints to AISIX gateway deployments. Configure credentials, model aliases, caller keys, and access controls.
#### bring-your-own-endpoint
Connect AISIX gateway deployments to private OpenAI-compatible endpoints such as vLLM, SGLang, or Ollama. Configure credentials, aliases, and custom token pricing.
- [Bring Your Own Endpoint](https://docs.api7.ai/ai-gateway/providers/bring-your-own-endpoint.md): Connect AISIX gateway deployments to private OpenAI-compatible endpoints such as vLLM, SGLang, or Ollama. Configure credentials, aliases, and custom token pricing.
#### cerebras
Connect Cerebras Inference to AISIX gateway deployments through its OpenAI-compatible API. Configure credentials, model aliases, caller keys, and access controls.
- [Cerebras](https://docs.api7.ai/ai-gateway/providers/cerebras.md): Connect Cerebras Inference to AISIX gateway deployments through its OpenAI-compatible API. Configure credentials, model aliases, caller keys, and access controls.
#### cloudflare-workers-ai
Connect Cloudflare Workers AI to AISIX gateway deployments. Configure account-scoped endpoints, API credentials, @cf model IDs, aliases, and caller access.
- [Cloudflare Workers AI](https://docs.api7.ai/ai-gateway/providers/cloudflare-workers-ai.md): Connect Cloudflare Workers AI to AISIX gateway deployments. Configure account-scoped endpoints, API credentials, @cf model IDs, aliases, and caller access.
#### cohere
Connect Cohere to AISIX gateway deployments for Command chat models, embeddings, and reranking. Configure provider credentials, model aliases, and caller access.
- [Cohere](https://docs.api7.ai/ai-gateway/providers/cohere.md): Connect Cohere to AISIX gateway deployments for Command chat models, embeddings, and reranking. Configure provider credentials, model aliases, and caller access.
#### compatibility
Compare provider protocol and proxy endpoint support across AISIX gateway deployments, including chat, embeddings, media, Realtime, and job APIs.
- [Provider Compatibility](https://docs.api7.ai/ai-gateway/providers/compatibility.md): Compare provider protocol and proxy endpoint support across AISIX gateway deployments, including chat, embeddings, media, Realtime, and job APIs.
#### databricks
Connect Databricks Model Serving to AISIX gateway deployments. Configure workspace endpoints, provider credentials, model aliases, caller keys, and access controls.
- [Databricks](https://docs.api7.ai/ai-gateway/providers/databricks.md): Connect Databricks Model Serving to AISIX gateway deployments. Configure workspace endpoints, provider credentials, model aliases, caller keys, and access controls.
#### deepinfra
Connect DeepInfra to AISIX gateway deployments through its OpenAI-compatible API. Configure explicit endpoints, credentials, model aliases, and caller access.
- [DeepInfra](https://docs.api7.ai/ai-gateway/providers/deepinfra.md): Connect DeepInfra to AISIX gateway deployments through its OpenAI-compatible API. Configure explicit endpoints, credentials, model aliases, and caller access.
#### deepseek
Connect DeepSeek models to AISIX gateway deployments through the OpenAI-compatible API. Configure provider credentials, model aliases, caller keys, and access controls.
- [DeepSeek](https://docs.api7.ai/ai-gateway/providers/deepseek.md): Connect DeepSeek models to AISIX gateway deployments through the OpenAI-compatible API. Configure provider credentials, model aliases, caller keys, and access controls.
#### digitalocean-gradient-ai
Connect DigitalOcean Gradient AI to AISIX gateway deployments. Configure serverless-inference credentials, model aliases, caller API keys, and access controls.
- [DigitalOcean Gradient AI](https://docs.api7.ai/ai-gateway/providers/digitalocean-gradient-ai.md): Connect DigitalOcean Gradient AI to AISIX gateway deployments. Configure serverless-inference credentials, model aliases, caller API keys, and access controls.
#### fireworks-ai
Connect Fireworks AI to AISIX gateway deployments through its OpenAI-compatible API. Configure provider credentials, model aliases, caller keys, and access controls.
- [Fireworks AI](https://docs.api7.ai/ai-gateway/providers/fireworks-ai.md): Connect Fireworks AI to AISIX gateway deployments through its OpenAI-compatible API. Configure provider credentials, model aliases, caller keys, and access controls.
#### gemini
Connect Google Gemini to AISIX gateway deployments through the AI Studio OpenAI-compatible API. Configure credentials, model aliases, caller keys, and access controls.
- [Gemini (Google AI Studio)](https://docs.api7.ai/ai-gateway/providers/gemini.md): Connect Google Gemini to AISIX gateway deployments through the AI Studio OpenAI-compatible API. Configure credentials, model aliases, caller keys, and access controls.
#### google-vertex-ai
Connect Google Vertex AI to AISIX. Configure service-account credentials, global or regional endpoints, model aliases, and understand adapter limits.
- [Google Vertex AI](https://docs.api7.ai/ai-gateway/providers/google-vertex-ai.md): Connect Google Vertex AI to AISIX. Configure service-account credentials, global or regional endpoints, model aliases, and understand adapter limits.
#### groq
Connect Groq to AISIX. Configure credentials and model aliases, then understand chat, Responses, audio, batch, and provider-specific limits.
- [Groq](https://docs.api7.ai/ai-gateway/providers/groq.md): Connect Groq to AISIX. Configure credentials and model aliases, then understand chat, Responses, audio, batch, and provider-specific limits.
#### huggingface
Connect Hugging Face Inference Providers to AISIX. Configure router credentials and model aliases, then understand route and provider boundaries.
- [Hugging Face](https://docs.api7.ai/ai-gateway/providers/huggingface.md): Connect Hugging Face Inference Providers to AISIX. Configure router credentials and model aliases, then understand route and provider boundaries.
#### jina
Connect Jina AI embeddings and rerankers to AISIX gateway deployments, including model, route, passthrough, and accounting boundaries.
- [Jina](https://docs.api7.ai/ai-gateway/providers/jina.md): Connect Jina AI embeddings and rerankers to AISIX gateway deployments, including model, route, passthrough, and accounting boundaries.
#### meta-llama-api
Connect the Meta Llama API to AISIX through its OpenAI-compatible endpoint, with the correct API base, example model, and route boundaries.
- [Meta Llama API](https://docs.api7.ai/ai-gateway/providers/meta-llama-api.md): Connect the Meta Llama API to AISIX through its OpenAI-compatible endpoint, with the correct API base, example model, and route boundaries.
#### minimax
Connect MiniMax models to AISIX gateway deployments through the OpenAI-compatible API. Configure the explicit endpoint, credentials, aliases, and caller access.
- [MiniMax](https://docs.api7.ai/ai-gateway/providers/minimax.md): Connect MiniMax models to AISIX gateway deployments through the OpenAI-compatible API. Configure the explicit endpoint, credentials, aliases, and caller access.
#### mistral
Connect Mistral AI to AISIX for chat and compatible endpoints, with model aliases, structured-response boundaries, and passthrough routes.
- [Mistral AI](https://docs.api7.ai/ai-gateway/providers/mistral.md): Connect Mistral AI to AISIX for chat and compatible endpoints, with model aliases, structured-response boundaries, and passthrough routes.
#### modelscope
Connect ModelScope API-Inference to AISIX gateway deployments. Configure OpenAI-compatible endpoints, namespaced model IDs, provider keys, and caller access.
- [ModelScope](https://docs.api7.ai/ai-gateway/providers/modelscope.md): Connect ModelScope API-Inference to AISIX gateway deployments. Configure OpenAI-compatible endpoints, namespaced model IDs, provider keys, and caller access.
#### moonshotai
Connect Moonshot AI and Kimi models to AISIX gateway deployments. Configure regional endpoints, credentials, model aliases, thinking mode, and caller access.
- [Moonshot AI (Kimi)](https://docs.api7.ai/ai-gateway/providers/moonshotai.md): Connect Moonshot AI and Kimi models to AISIX gateway deployments. Configure regional endpoints, credentials, model aliases, thinking mode, and caller access.
#### nebius-token-factory
Connect Nebius Token Factory to AISIX through its OpenAI-compatible API, with model aliases, endpoint compatibility, and passthrough routes for native APIs.
- [Nebius Token Factory](https://docs.api7.ai/ai-gateway/providers/nebius-token-factory.md): Connect Nebius Token Factory to AISIX through its OpenAI-compatible API, with model aliases, endpoint compatibility, and passthrough routes for native APIs.
#### novita-ai
Connect Novita AI to AISIX through its OpenAI-compatible API, with model aliases, endpoint compatibility, batch workflows, and passthrough routes.
- [Novita AI](https://docs.api7.ai/ai-gateway/providers/novita-ai.md): Connect Novita AI to AISIX through its OpenAI-compatible API, with model aliases, endpoint compatibility, batch workflows, and passthrough routes.
#### nvidia-nim
Connect hosted or privately deployed NVIDIA NIM models to AISIX gateway deployments. Configure endpoint credentials, namespaced model aliases, and caller access.
- [NVIDIA NIM](https://docs.api7.ai/ai-gateway/providers/nvidia-nim.md): Connect hosted or privately deployed NVIDIA NIM models to AISIX gateway deployments. Configure endpoint credentials, namespaced model aliases, and caller access.
#### ollama
Connect a local or private Ollama server to AISIX gateway deployments through its OpenAI-compatible API. Configure endpoints, model aliases, and caller access.
- [Ollama](https://docs.api7.ai/ai-gateway/providers/ollama.md): Connect a local or private Ollama server to AISIX gateway deployments through its OpenAI-compatible API. Configure endpoints, model aliases, and caller access.
#### openai
Connect OpenAI chat models and Sora video generation to AISIX gateway deployments. Configure credentials, model aliases, caller API keys, access controls, rate limits, and request verification.
- [OpenAI](https://docs.api7.ai/ai-gateway/providers/openai.md): Connect OpenAI chat models and Sora video generation to AISIX gateway deployments. Configure credentials, model aliases, caller API keys, access controls, rate limits, and request verification.
#### openai-compatible-vendors
Configure public OpenAI-compatible LLM providers in AISIX gateway deployments using explicit API endpoints, provider credentials, model aliases, and caller keys.
- [Other OpenAI-Compatible Providers](https://docs.api7.ai/ai-gateway/providers/openai-compatible-vendors.md): Configure public OpenAI-compatible LLM providers in AISIX gateway deployments using explicit API endpoints, provider credentials, model aliases, and caller keys.
#### openrouter
Connect OpenRouter to AISIX gateway deployments through its OpenAI-compatible API. Configure credentials, namespaced model IDs, aliases, and caller access.
- [OpenRouter](https://docs.api7.ai/ai-gateway/providers/openrouter.md): Connect OpenRouter to AISIX gateway deployments through its OpenAI-compatible API. Configure credentials, namespaced model IDs, aliases, and caller access.
#### overview
Compare hosted AI provider APIs and private model servers supported across AISIX gateway deployments, including native adapters, community providers, Ollama, and vLLM.
- [Choose a Provider Upstream](https://docs.api7.ai/ai-gateway/providers/overview.md): Compare hosted AI provider APIs and private model servers supported across AISIX gateway deployments, including native adapters, community providers, Ollama, and vLLM.
#### ovhcloud-ai-endpoints
Connect OVHcloud AI Endpoints to AISIX gateway deployments through the OpenAI-compatible API. Configure credentials, model aliases, caller keys, and access controls.
- [OVHcloud AI Endpoints](https://docs.api7.ai/ai-gateway/providers/ovhcloud-ai-endpoints.md): Connect OVHcloud AI Endpoints to AISIX gateway deployments through the OpenAI-compatible API. Configure credentials, model aliases, caller keys, and access controls.
#### perplexity
Connect Perplexity Sonar models to AISIX gateway deployments through the OpenAI-compatible API. Configure credentials, model aliases, caller keys, and access controls.
- [Perplexity](https://docs.api7.ai/ai-gateway/providers/perplexity.md): Connect Perplexity Sonar models to AISIX gateway deployments through the OpenAI-compatible API. Configure credentials, model aliases, caller keys, and access controls.
#### qwen
Connect Alibaba Cloud Qwen chat models and Wan video generation to AISIX gateway deployments. Configure regional DashScope endpoints, credentials, model aliases, and caller access.
- [Qwen (Alibaba Cloud)](https://docs.api7.ai/ai-gateway/providers/qwen.md): Connect Alibaba Cloud Qwen chat models and Wan video generation to AISIX gateway deployments. Configure regional DashScope endpoints, credentials, model aliases, and caller access.
#### runwayml
Connect RunwayML video generation to AISIX gateway deployments through the AISIX video API. Configure credentials, model aliases, caller keys, and access controls.
- [RunwayML](https://docs.api7.ai/ai-gateway/providers/runwayml.md): Connect RunwayML video generation to AISIX gateway deployments through the AISIX video API. Configure credentials, model aliases, caller keys, and access controls.
#### siliconflow
Connect SiliconFlow to AISIX gateway deployments through its OpenAI-compatible API. Configure credentials, namespaced model IDs, aliases, and caller access.
- [SiliconFlow](https://docs.api7.ai/ai-gateway/providers/siliconflow.md): Connect SiliconFlow to AISIX gateway deployments through its OpenAI-compatible API. Configure credentials, namespaced model IDs, aliases, and caller access.
#### snowflake-cortex
Connect Snowflake Cortex to AISIX gateway deployments. Configure account-specific OpenAI-compatible endpoints, credentials, model aliases, and caller access.
- [Snowflake Cortex](https://docs.api7.ai/ai-gateway/providers/snowflake-cortex.md): Connect Snowflake Cortex to AISIX gateway deployments. Configure account-specific OpenAI-compatible endpoints, credentials, model aliases, and caller access.
#### together
Connect Together AI to AISIX gateway deployments through its OpenAI-compatible API. Configure provider credentials, model aliases, caller keys, and access controls.
- [Together AI](https://docs.api7.ai/ai-gateway/providers/together.md): Connect Together AI to AISIX gateway deployments through its OpenAI-compatible API. Configure provider credentials, model aliases, caller keys, and access controls.
#### vllm
Connect a private vLLM OpenAI-compatible server to AISIX gateway deployments. Configure endpoint credentials, served model aliases, caller keys, and access controls.
- [vLLM](https://docs.api7.ai/ai-gateway/providers/vllm.md): Connect a private vLLM OpenAI-compatible server to AISIX gateway deployments. Configure endpoint credentials, served model aliases, caller keys, and access controls.
#### volcengine-ark
Connect Volcengine Ark to AISIX gateway deployments for Doubao chat and Seedance video generation. Configure credentials, model aliases, and caller access.
- [Volcengine Ark (Doubao)](https://docs.api7.ai/ai-gateway/providers/volcengine-ark.md): Connect Volcengine Ark to AISIX gateway deployments for Doubao chat and Seedance video generation. Configure credentials, model aliases, and caller access.
#### wandb-inference
Connect Weights & Biases Inference to AISIX gateway deployments through its OpenAI-compatible API. Configure credentials, model aliases, and caller access.
- [Weights & Biases Inference](https://docs.api7.ai/ai-gateway/providers/wandb-inference.md): Connect Weights & Biases Inference to AISIX gateway deployments through its OpenAI-compatible API. Configure credentials, model aliases, and caller access.
#### xai
Connect xAI Grok models to AISIX gateway deployments through the OpenAI-compatible API. Configure regional endpoints, credentials, aliases, and caller access.
- [xAI (Grok)](https://docs.api7.ai/ai-gateway/providers/xai.md): Connect xAI Grok models to AISIX gateway deployments through the OpenAI-compatible API. Configure regional endpoints, credentials, aliases, and caller access.
#### zhipuai
Connect Zhipu AI to AISIX gateway deployments for GLM chat and CogVideoX video generation. Configure API credentials, model aliases, and caller access.
- [Zhipu AI (GLM)](https://docs.api7.ai/ai-gateway/providers/zhipuai.md): Connect Zhipu AI to AISIX gateway deployments for GLM chat and CogVideoX video generation. Configure API credentials, model aliases, and caller access.
### release-notes
New features, improvements, and fixes in each AISIX AI Gateway release.
- [Release Notes](https://docs.api7.ai/ai-gateway/release-notes.md): New features, improvements, and fixes in each AISIX AI Gateway release.
### routing
#### ensemble-models
Configure ensemble models in AISIX gateway deployments to fan out chat requests, synthesize panel responses, and manage latency, cost, and failures.
- [Ensemble Models](https://docs.api7.ai/ai-gateway/routing/ensemble-models.md): Configure ensemble models in AISIX gateway deployments to fan out chat requests, synthesize panel responses, and manage latency, cost, and failures.
#### proxy-errors-and-retries
Understand how client applications should handle AISIX AI Gateway proxy errors, retry signals, and upstream failures.
- [Proxy Errors and Retries](https://docs.api7.ai/ai-gateway/routing/proxy-errors-and-retries.md): Understand how client applications should handle AISIX AI Gateway proxy errors, retry signals, and upstream failures.
#### routing-and-failover
Configure and test multi-target routing and failover in AISIX gateway deployments, including selection strategies, retries, runtime filtering, and recovery.
- [Multi-Target Routing and Failover](https://docs.api7.ai/ai-gateway/routing/routing-and-failover.md): Configure and test multi-target routing and failover in AISIX gateway deployments, including selection strategies, retries, runtime filtering, and recovery.
#### semantic-routing
Configure semantic routing in AISIX gateway deployments to select direct models by request meaning, tune similarity thresholds, and define safe fallbacks.
- [Semantic Routing](https://docs.api7.ai/ai-gateway/routing/semantic-routing.md): Configure semantic routing in AISIX gateway deployments to select direct models by request meaning, tune similarity thresholds, and define safe fallbacks.
### traffic-controls
#### budget-alerts
Configure AISIX Cloud budget alerts to notify operators through webhooks or Slack when AI spending crosses a defined percentage of a budget limit.
- [Budget Alerts and Notifications](https://docs.api7.ai/ai-gateway/traffic-controls/budget-alerts.md): Configure AISIX Cloud budget alerts to notify operators through webhooks or Slack when AI spending crosses a defined percentage of a budget limit.
#### budgets
Configure AISIX Cloud budgets to enforce AI spending limits across organizations, environments, caller API keys, provider keys, teams, and members.
- [Budgets](https://docs.api7.ai/ai-gateway/traffic-controls/budgets.md): Configure AISIX Cloud budgets to enforce AI spending limits across organizations, environments, caller API keys, provider keys, teams, and members.
#### caching
Configure memory or Redis response caching for eligible Chat Completions requests in AISIX Cloud and open-source AISIX gateway deployments.
- [Response Caching](https://docs.api7.ai/ai-gateway/traffic-controls/caching.md): Configure memory or Redis response caching for eligible Chat Completions requests in AISIX Cloud and open-source AISIX gateway deployments.
#### caller-api-keys
Configure caller API keys for AISIX gateway deployments, including model access controls, expiration, disablement, rotation, authentication, and verification.
- [Caller API Keys](https://docs.api7.ai/ai-gateway/traffic-controls/caller-api-keys.md): Configure caller API keys for AISIX gateway deployments, including model access controls, expiration, disablement, rotation, authentication, and verification.
#### claim-mappings
Map verified JWT claims in AISIX to caller API keys with priority-ordered rules, shared access controls, and per-identity usage attribution.
- [JWT Claim Mappings](https://docs.api7.ai/ai-gateway/traffic-controls/claim-mappings.md): Map verified JWT claims in AISIX to caller API keys with priority-ordered rules, shared access controls, and per-identity usage attribution.
#### guardrails
- [Alibaba Cloud Content Moderation](https://docs.api7.ai/ai-gateway/traffic-controls/guardrails/alibaba-cloud-ai.md): Configure Alibaba Cloud Content Moderation through AISIX Cloud or a resources file, then verify TextModerationPlus risk-level enforcement.
- [Alibaba Cloud AI Guardrails](https://docs.api7.ai/ai-gateway/traffic-controls/guardrails/alibaba-cloud-ai-guardrails.md): Configure Alibaba Cloud AI Guardrails through AISIX Cloud or a resources file, then verify MultiModalGuard blocking and sensitive-data masking.
- [AWS Bedrock Guardrails](https://docs.api7.ai/ai-gateway/traffic-controls/guardrails/aws-bedrock.md): Configure AWS Bedrock Guardrails through AISIX Cloud or a resources file, then verify blocking and PII anonymization in AISIX AI Gateway.
- [Azure AI Content Safety Guardrails](https://docs.api7.ai/ai-gateway/traffic-controls/guardrails/azure-content-safety.md): Configure Azure AI Content Safety through AISIX Cloud or a resources file, then verify Prompt Shield and Text Moderation behavior in AISIX.
- [Guardrail Behavior](https://docs.api7.ai/ai-gateway/traffic-controls/guardrails/behavior.md): Understand AISIX guardrail hook points, enforcement modes, scope differences, streaming output controls, remote failures, and caller behavior.
- [Custom Script Guardrails](https://docs.api7.ai/ai-gateway/traffic-controls/guardrails/custom-script.md): Configure custom JavaScript guardrails through AISIX Cloud or a resources file to run screening logic, including calls to content-policy services.
- [Built-in Keyword Guardrails](https://docs.api7.ai/ai-gateway/traffic-controls/guardrails/keyword.md): Configure built-in AISIX keyword guardrails through AISIX Cloud or a resources file, then verify blocking, monitor mode, and scoped behavior.
- [Lakera Guard](https://docs.api7.ai/ai-gateway/traffic-controls/guardrails/lakera.md): Configure Lakera Guard through AISIX Cloud or a resources file, then verify prompt-injection blocking and PII masking in AISIX AI Gateway.
- [OpenAI Moderation Guardrails](https://docs.api7.ai/ai-gateway/traffic-controls/guardrails/openai-moderation.md): Configure OpenAI Moderation through AISIX Cloud or a resources file, then verify blocking and tune per-category thresholds in AISIX AI Gateway.
- [Choosing a Guardrail Provider](https://docs.api7.ai/ai-gateway/traffic-controls/guardrails/overview.md): Compare built-in and remote AISIX guardrail providers by evaluation location, detection coverage, enforcement actions, and configuration path.
- [PII Detection and Redaction](https://docs.api7.ai/ai-gateway/traffic-controls/guardrails/pii.md): Configure built-in AISIX PII detection through AISIX Cloud or a resources file, then verify masking, blocking, and custom sensitive-data patterns.
- [Presidio Guardrails](https://docs.api7.ai/ai-gateway/traffic-controls/guardrails/presidio.md): Deploy the Presidio analyzer and anonymizer in your own infrastructure, connect them to AISIX as a guardrail, and verify PII anonymization and blocking.
- [Qwen3Guard Guardrails](https://docs.api7.ai/ai-gateway/traffic-controls/guardrails/qwen3guard.md): Run the open-source Qwen3Guard safety classifier in your own infrastructure and connect it to AISIX with a custom script guardrail that screens requests and model responses.
- [Semantic Screening Guardrails](https://docs.api7.ai/ai-gateway/traffic-controls/guardrails/semantic-screening.md): Configure and verify AISIX semantic screening guardrails for requests and responses, including deny policies, topic allow lists, and threshold setup.
- [Calibrate Semantic Screening Guardrails](https://docs.api7.ai/ai-gateway/traffic-controls/guardrails/semantic-screening-calibration.md): Calibrate AISIX semantic screening thresholds with sample and real-traffic scores, interpret request telemetry, and review upgraded policies.
#### jwt-authentication
Configure OIDC trust and JWT authentication in AISIX gateway deployments, including issuer discovery, claim validation, and external identity mapping to caller API keys.
- [JWT Authentication](https://docs.api7.ai/ai-gateway/traffic-controls/jwt-authentication.md): Configure OIDC trust and JWT authentication in AISIX gateway deployments, including issuer discovery, claim validation, and external identity mapping to caller API keys.
#### keycloak-integration
A verified end-to-end walkthrough — configure a Keycloak realm so each user authenticates at the gateway with their own JWT, and map departments and groups to caller API keys with claim mappings.
- [Keycloak Integration](https://docs.api7.ai/ai-gateway/traffic-controls/keycloak-integration.md): A verified end-to-end walkthrough — configure a Keycloak realm so each user authenticates at the gateway with their own JWT, and map departments and groups to caller API keys with claim mappings.
#### overview
Understand how caller identity, rate limits, AISIX Cloud budgets, guardrails, and caching govern requests through AISIX.
- [Traffic Controls](https://docs.api7.ai/ai-gateway/traffic-controls/overview.md): Understand how caller identity, rate limits, AISIX Cloud budgets, guardrails, and caching govern requests through AISIX.
#### prompt-caching
Enable automatic Anthropic prompt caching in AISIX Cloud or an open-source AISIX gateway so repeated prompt prefixes receive provider cache discounts.
- [Anthropic Prompt Caching](https://docs.api7.ai/ai-gateway/traffic-controls/prompt-caching.md): Enable automatic Anthropic prompt caching in AISIX Cloud or an open-source AISIX gateway so repeated prompt prefixes receive provider cache discounts.
#### rate-limit-policies
Configure AISIX rate limit policies with conditional traffic matching, independent quota buckets, classic single-scope rules, and suspension schedules.
- [Rate Limit Policies](https://docs.api7.ai/ai-gateway/traffic-controls/rate-limit-policies.md): Configure AISIX rate limit policies with conditional traffic matching, independent quota buckets, classic single-scope rules, and suspension schedules.
#### rate-limits
Configure and verify request, token, and concurrency limits for caller API keys and models in AISIX Cloud and the open-source AISIX gateway.
- [API Key and Model Rate Limits](https://docs.api7.ai/ai-gateway/traffic-controls/rate-limits.md): Configure and verify request, token, and concurrency limits for caller API keys and models in AISIX Cloud and the open-source AISIX gateway.
#### semantic-caching
Serve cached Chat Completions responses for semantically similar prompts using embedding similarity, with configurable thresholds, sharing scopes, and purging.
- [Semantic Caching](https://docs.api7.ai/ai-gateway/traffic-controls/semantic-caching.md): Serve cached Chat Completions responses for semantically similar prompts using embedding similarity, with configurable thresholds, sharing scopes, and purging.
## api7-gateway
### reference
Find API7 Gateway reference documentation for APIs, CLI tools, deployment configuration, security controls, and configuration syntax.
- [Reference Overview](https://docs.api7.ai/api7-gateway/reference.md): Find API7 Gateway reference documentation for APIs, CLI tools, deployment configuration, security controls, and configuration syntax.
#### admin-api
API7 Enterprise Admin APIs are RESTful APIs that allow you to create and manage API7 resources.
- [API7 Enterprise Admin APIs](https://docs.api7.ai/api7-gateway/reference/admin-api.md): API7 Enterprise Admin APIs are RESTful APIs that allow you to create and manage API7 resources.
#### developer-portal-api
API7 Enterprise Admin APIs are RESTful APIs that allow you to create and manage API7 resources.
- [API7 Enterprise Developer Portal APIs](https://docs.api7.ai/api7-gateway/reference/developer-portal-api.md): API7 Enterprise Admin APIs are RESTful APIs that allow you to create and manage API7 resources.
#### a7-cli
Use the separately installed a7 CLI to manage API7 Gateway groups and resources interactively, in scripts, or through API7 Gateway Agent Skills.
- [a7 CLI](https://docs.api7.ai/api7-gateway/reference/a7-cli.md): Use the separately installed a7 CLI to manage API7 Gateway groups and resources interactively, in scripts, or through API7 Gateway Agent Skills.
#### adc
Use API Declarative CLI (ADC) to manage API7 Gateway configuration declaratively.
- [API Declarative CLI (ADC)](https://docs.api7.ai/api7-gateway/reference/adc.md): Use API Declarative CLI (ADC) to manage API7 Gateway configuration declaratively.
#### alert-template
Customize alert notifications with pre-defined variables in API7 Gateway, enabling dynamic content in alert messages and emails.
- [Alert Variables and Templates](https://docs.api7.ai/api7-gateway/reference/alert-template.md): Customize alert notifications with pre-defined variables in API7 Gateway, enabling dynamic content in alert messages and emails.
#### approval-variables
Use API7 Gateway approval variables to customize API product subscription notification email content and webhook messages with current template values.
- [Approval Notification Variables and Templates](https://docs.api7.ai/api7-gateway/reference/approval-variables.md): Use API7 Gateway approval variables to customize API product subscription notification email content and webhook messages with current template values.
#### built-in-variables
Discover the built-in variables available in API7 Gateway, including NGINX and APISIX variables, which can be utilized for route matching, log customization, and plugin configurations.
- [Built-In Variables](https://docs.api7.ai/api7-gateway/reference/built-in-variables.md): Discover the built-in variables available in API7 Gateway, including NGINX and APISIX variables, which can be utilized for route matching, log customization, and plugin configurations.
#### configuration
Understand the configuration files used in API7 Gateway, including default and user-defined files for managing settings effectively.
- [Configuration Files](https://docs.api7.ai/api7-gateway/reference/configuration.md): Understand the configuration files used in API7 Gateway, including default and user-defined files for managing settings effectively.
#### environment-variables
Explore the use of environment variables in API7 Gateway for configuring consumer credentials, SSL certificates, and plugins.
- [Environment Variables](https://docs.api7.ai/api7-gateway/reference/environment-variables.md): Explore the use of environment variables in API7 Gateway for configuring consumer credentials, SSL certificates, and plugins.
#### expressions
Understand how to use expressions in API7 Gateway for route matching, request filtering, and conditional logic in configurations.
- [API7 Expressions](https://docs.api7.ai/api7-gateway/reference/expressions.md): Understand how to use expressions in API7 Gateway for route matching, request filtering, and conditional logic in configurations.
#### hardening
Learn about securing sensitive information in API7 Gateway, including storage, encryption, and communication practices to protect against threats.
- [Security Hardening Reference](https://docs.api7.ai/api7-gateway/reference/hardening.md): Learn about securing sensitive information in API7 Gateway, including storage, encryption, and communication practices to protect against threats.
#### helm-chart
Learn where to find API7 Gateway Helm chart values and how Helm values are rendered into gateway configuration.
- [Helm Chart](https://docs.api7.ai/api7-gateway/reference/helm-chart.md): Learn where to find API7 Gateway Helm chart values and how Helm values are rendered into gateway configuration.
#### obtain-dashboard-token
Create a token in the API7 Dashboard and use it for API7 Gateway Admin API and ADC authentication.
- [Obtain a Token from the Dashboard](https://docs.api7.ai/api7-gateway/reference/obtain-dashboard-token.md): Create a token in the API7 Dashboard and use it for API7 Gateway Admin API and ADC authentication.
#### permission-policy-action-and-resource
Complete reference for all permission policy actions and ARN-style resources in API7 Gateway — organized by namespace (gateway, iam, portal) for building least-privilege policies.
- [Permission Policy Actions and Resources](https://docs.api7.ai/api7-gateway/reference/permission-policy-action-and-resource.md): Complete reference for all permission policy actions and ARN-style resources in API7 Gateway — organized by namespace (gateway, iam, portal) for building least-privilege policies.
#### permission-policy-examples
Ready-to-adapt permission policy examples for API7 Gateway, organized by access pattern, service and plugin operations, IAM and governance, and portal management.
- [Permission Policy Examples](https://docs.api7.ai/api7-gateway/reference/permission-policy-examples.md): Ready-to-adapt permission policy examples for API7 Gateway, organized by access pattern, service and plugin operations, IAM and governance, and portal management.
### 3.9.x
#### ai-gateway
- [Proxy Your First LLM Request in 5 Minutes](https://docs.api7.ai/api7-gateway/3.9.x/ai-gateway/get-started.md): Set up API7 AI Gateway and proxy your first request to OpenAI in under 5 minutes. Step-by-step guide with code examples.
- [Connect to Anthropic Claude](https://docs.api7.ai/api7-gateway/3.9.x/ai-gateway/llm-providers/anthropic.md): Route Anthropic Claude API traffic through API7 Gateway for centralized security, rate limiting, and observability.
- [Integrate Azure OpenAI Service](https://docs.api7.ai/api7-gateway/3.9.x/ai-gateway/llm-providers/azure-openai.md): Manage Azure OpenAI deployments through API7 Gateway. Handle resource names, API versions, and auth centrally.
- [Route Traffic to DeepSeek Models](https://docs.api7.ai/api7-gateway/3.9.x/ai-gateway/llm-providers/deepseek.md): Proxy DeepSeek API requests through API7 Gateway. Manage authentication, enable failover, and monitor usage centrally.
- [Integrate Google Gemini](https://docs.api7.ai/api7-gateway/3.9.x/ai-gateway/llm-providers/google-gemini.md): Proxy Google Gemini API requests through API7 Gateway. Manage API keys and monitor AI traffic centrally.
- [Route Traffic to OpenAI](https://docs.api7.ai/api7-gateway/3.9.x/ai-gateway/llm-providers/openai.md): Proxy and secure OpenAI API requests through API7 Gateway. Centralize authentication, enable failover, and monitor usage.
- [Connect Any OpenAI-Compatible LLM](https://docs.api7.ai/api7-gateway/3.9.x/ai-gateway/llm-providers/openai-compatible.md): Proxy any OpenAI-compatible API through API7 Gateway. Connect self-hosted models, custom endpoints, or niche providers.
- [Access Hundreds of LLMs via OpenRouter](https://docs.api7.ai/api7-gateway/3.9.x/ai-gateway/llm-providers/openrouter.md): Use OpenRouter with API7 AI Gateway to access 200+ LLMs through one API while maintaining enterprise security controls.
- [Route Enterprise AI Traffic to Vertex AI](https://docs.api7.ai/api7-gateway/3.9.x/ai-gateway/llm-providers/vertex-ai.md): Securely proxy Google Cloud Vertex AI requests through API7 Gateway with service account auth and regional routing.
- [Manage and Secure AI Traffic](https://docs.api7.ai/api7-gateway/3.9.x/ai-gateway/overview.md): Centralize LLM access with API7 AI Gateway. Route traffic to multiple providers, enforce guardrails, and control costs from one platform.
- [Monitor AI Traffic and Track LLM Costs](https://docs.api7.ai/api7-gateway/3.9.x/ai-gateway/use-cases/ai-observability-and-cost-tracking.md): Gain visibility into LLM usage, token consumption, latency, and costs with API7 AI Gateway's observability features.
- [Transform API Requests with AI-Powered Rewriting](https://docs.api7.ai/api7-gateway/3.9.x/ai-gateway/use-cases/ai-request-transformation.md): Use LLMs to intelligently transform, enrich, or restructure API requests and responses at the gateway layer.
- [Enforce AI Guardrails and Protect PII](https://docs.api7.ai/api7-gateway/3.9.x/ai-gateway/use-cases/content-safety-and-guardrails.md): Block prompt injection, detect toxicity, and redact PII before requests reach LLMs using API7 AI Gateway guardrails.
- [Expose REST APIs as MCP Tools for AI Agents](https://docs.api7.ai/api7-gateway/3.9.x/ai-gateway/use-cases/expose-apis-as-mcp-tools.md): Convert existing OpenAPI services into MCP-compatible tools so AI agents can discover and invoke your APIs automatically.
- [Manage API7 Enterprise from an AI Client with API7-MCP](https://docs.api7.ai/api7-gateway/3.9.x/ai-gateway/use-cases/manage-api7-with-mcp.md): Deploy the API7-MCP server so an AI client such as Cursor, Claude Desktop, or Cline can read API7 Enterprise resources, check Prometheus metrics, manage RBAC, and send test traffic through the gateway.
- [Set Up Multi-LLM Routing and Automatic Fallback](https://docs.api7.ai/api7-gateway/3.9.x/ai-gateway/use-cases/multi-llm-routing-and-fallback.md): Route AI traffic across multiple LLM providers with weighted load balancing, automatic failover, and health checks.
- [Implement Prompt Templates and Decorators](https://docs.api7.ai/api7-gateway/3.9.x/ai-gateway/use-cases/prompt-engineering-and-templating.md): Standardize LLM interactions with reusable prompt templates and automatic system prompt injection using API7 AI Gateway.
- [Convert Anthropic Messages to OpenAI Chat Completions](https://docs.api7.ai/api7-gateway/3.9.x/ai-gateway/use-cases/protocol-conversion.md): Use API7 AI Gateway to transparently convert Anthropic Messages API requests to the OpenAI Chat Completions API format, enabling teams to use the Anthropic SDK with any OpenAI-compatible backend.
- [Implement RAG at the Gateway Layer](https://docs.api7.ai/api7-gateway/3.9.x/ai-gateway/use-cases/retrieval-augmented-generation.md): Enhance LLM responses with relevant context using Retrieval-Augmented Generation (RAG) built into API7 AI Gateway.
- [Control AI Costs with Token-Based Rate Limiting](https://docs.api7.ai/api7-gateway/3.9.x/ai-gateway/use-cases/token-rate-limiting-and-quota-management.md): Implement token-based rate limits to prevent LLM abuse and control AI costs per route and model instance.
#### configure-and-manage
- [Run Benchmarks on AWS EKS](https://docs.api7.ai/api7-gateway/3.9.x/configure-and-manage/benchmark-on-aws-eks.md): Reproduce the published API7 Gateway performance benchmark on AWS EKS. Walkthrough covers EKS cluster setup, three isolated node groups, Helm install, NGINX upstream and wrk2 deployment, and running the full scenario suite.
- [Configuration Reference for API7 Gateway Control Plane](https://docs.api7.ai/api7-gateway/3.9.x/configure-and-manage/configure-control-plane.md): Detailed configuration reference for the API7 Gateway Control Plane, covering the Dashboard and DP Manager configuration files.
- [Configuration Reference for API7 Gateway Data Plane](https://docs.api7.ai/api7-gateway/3.9.x/configure-and-manage/configure-data-plane.md): Detailed configuration reference for API7 Gateway Data Plane, based on the config-default.yaml structure.
- [Data Plane Resilience](https://docs.api7.ai/api7-gateway/3.9.x/configure-and-manage/data-plane-resilience.md): Configure fallback storage for API7 Gateway data plane nodes so they can restart and continue operating during extended control plane outages.
- [Multiple Availability Zones Deployment of API7 Gateway](https://docs.api7.ai/api7-gateway/3.9.x/configure-and-manage/deployment-scenarios/multi-az-deployment.md): Configuration and architecture for deploying API7 Gateway across multiple availability zones for high availability and fault tolerance.
- [Multi-Region Deployment Patterns](https://docs.api7.ai/api7-gateway/3.9.x/configure-and-manage/deployment-scenarios/multi-region-deployment.md): Architecture and considerations for deploying API7 Gateway across multiple geographic regions for global reach and disaster recovery.
- [Data Plane High Availability](https://docs.api7.ai/api7-gateway/3.9.x/configure-and-manage/high-availability-data-plane.md): Design a highly available API7 Gateway data plane with multiple nodes, health checks, and load balancer failover.
- [Labels](https://docs.api7.ai/api7-gateway/3.9.x/configure-and-manage/labels.md): Organize and filter API7 Gateway resources at scale with labels — key-value metadata attached to gateway groups, services, routes, consumers, and other entities for team, environment, and application-level segmentation.
- [License Management](https://docs.api7.ai/api7-gateway/3.9.x/configure-and-manage/license-management.md): Manage your API7 Gateway license, understand core quotas and license states, and configure license file paths for automated deployment.
- [Performance Benchmark](https://docs.api7.ai/api7-gateway/3.9.x/configure-and-manage/performance-benchmark.md): Published performance benchmark results for API7 Gateway (AWS EKS and single-host baselines), plus methodology and optimization guidance for running your own benchmarks accurately.
- [Production Best Practices](https://docs.api7.ai/api7-gateway/3.9.x/configure-and-manage/production-best-practices.md): Operational best practices for managing API7 Gateway in production, including GitOps, change management, and disaster recovery.
- [Running in Production](https://docs.api7.ai/api7-gateway/3.9.x/configure-and-manage/run-in-production.md): Pre-production checklist and deployment guide for API7 Gateway to ensure a stable and secure production environment.
- [Scale Data Plane](https://docs.api7.ai/api7-gateway/3.9.x/configure-and-manage/scale-data-plane.md): Scale API7 Gateway data plane nodes horizontally to increase throughput and prepare for high-availability deployments.
- [Shared Memory Sizing](https://docs.api7.ai/api7-gateway/3.9.x/configure-and-manage/shared-dict-sizing.md): Size API7 Gateway shared memory zones for metrics, service discovery, the Developer Portal, and tracing so they do not overflow at your deployment's scale.
- [Optimize Telemetry Data Transfer](https://docs.api7.ai/api7-gateway/3.9.x/configure-and-manage/telemetry-opt-out.md): Configure telemetry data transfer between the data plane and control plane, including compression levels and how to disable telemetry.
- [User Management](https://docs.api7.ai/api7-gateway/3.9.x/configure-and-manage/user-management.md): Manage users, roles, and permission policies in API7 Enterprise.
#### developer-portal
- [Configure the Developer Portal](https://docs.api7.ai/api7-gateway/3.9.x/developer-portal/deploy/configure-portal.md): Configure the Developer Portal settings, including public access, portal tokens, built-in authentication, and SCIM provisioning.
- [Customize the Developer Portal](https://docs.api7.ai/api7-gateway/3.9.x/developer-portal/deploy/customize-portal.md): Customize the Developer Portal branding, theme, authentication providers, and functionality using the API7 Developer Portal Boilerplate.
- [Deploy the Developer Portal](https://docs.api7.ai/api7-gateway/3.9.x/developer-portal/deploy/deploy-portal.md): Deploy the API7 Developer Portal with its two official images — the Portal API backend and the customer-facing frontend — on Docker Compose or Kubernetes, and connect them to your API7 control plane.
- [Browse APIs](https://docs.api7.ai/api7-gateway/3.9.x/developer-portal/guides/browse-apis.md): Discover and explore available API products in the Developer Portal's API Hub.
- [Create an Application](https://docs.api7.ai/api7-gateway/3.9.x/developer-portal/guides/create-application.md): Create an application in the Developer Portal to group your API subscriptions and credentials.
- [Manage Credentials](https://docs.api7.ai/api7-gateway/3.9.x/developer-portal/guides/manage-credentials.md): Create, view, regenerate, and delete credentials in the Developer Portal for authenticating API requests.
- [Manage Your Organization](https://docs.api7.ai/api7-gateway/3.9.x/developer-portal/guides/manage-organization.md): Manage your organization in the Developer Portal, including inviting members, assigning roles, and switching between organizations.
- [Register and Log In](https://docs.api7.ai/api7-gateway/3.9.x/developer-portal/guides/register-and-login.md): Create a developer account and log in to the Developer Portal using email/password, SSO, or an organization invitation.
- [Subscribe to an API](https://docs.api7.ai/api7-gateway/3.9.x/developer-portal/guides/subscribe-to-api.md): Subscribe your application to an API product to gain access to consume APIs through the Developer Portal.
- [Try an API](https://docs.api7.ai/api7-gateway/3.9.x/developer-portal/guides/try-api.md): Test API endpoints directly from the Developer Portal using the built-in Try It Out feature.
- [API Products](https://docs.api7.ai/api7-gateway/3.9.x/developer-portal/key-concepts/api-products.md): Understand API products in the Developer Portal, including product types, visibility settings, authentication options, and the publishing lifecycle.
- [Applications](https://docs.api7.ai/api7-gateway/3.9.x/developer-portal/key-concepts/applications.md): Understand applications in the Developer Portal, which group subscriptions and credentials for a specific project or use case.
- [Credentials](https://docs.api7.ai/api7-gateway/3.9.x/developer-portal/key-concepts/credentials.md): Understand credentials in the Developer Portal, including supported authentication types (key auth, basic auth, OAuth/DCR) and credential lifecycle management.
- [Developers](https://docs.api7.ai/api7-gateway/3.9.x/developer-portal/key-concepts/developers.md): Understand developers in the Developer Portal, including registration methods, account states, and the difference between developers and consumers.
- [Subscriptions](https://docs.api7.ai/api7-gateway/3.9.x/developer-portal/key-concepts/subscriptions.md): Understand subscriptions in the Developer Portal, including the approval workflow, status transitions, and auto-approval configuration.
- [Configure Dynamic Client Registration (DCR)](https://docs.api7.ai/api7-gateway/3.9.x/developer-portal/manage/configure-dcr.md): Configure DCR providers to enable developers to register OAuth 2.0 clients through the Developer Portal.
- [Configure SCIM Provisioning for a Custom Developer Portal with Okta](https://docs.api7.ai/api7-gateway/3.9.x/developer-portal/manage/configure-scim.md): Configure SCIM provisioning with Okta for a custom Developer Portal based on the API7 Developer Portal Boilerplate.
- [Configure SSO for the Developer Portal](https://docs.api7.ai/api7-gateway/3.9.x/developer-portal/manage/configure-sso.md): Configure Single Sign-On (SSO) for the Developer Portal using OIDC, SAML, LDAP, or CAS identity providers.
- [Manage API Products](https://docs.api7.ai/api7-gateway/3.9.x/developer-portal/manage/manage-api-products.md): Create, configure, publish, and manage API products in the Provider Portal for developer consumption through the Developer Portal.
- [Manage Applications](https://docs.api7.ai/api7-gateway/3.9.x/developer-portal/manage/manage-applications.md): Manage developer applications in the Developer Portal, including lifecycle, structure, and how to call the Developer Portal backend programmatically.
- [Manage Developers](https://docs.api7.ai/api7-gateway/3.9.x/developer-portal/manage/manage-developers.md): Manage developer accounts using the Provider Portal Admin API and the standalone Developer Portal backend, including listing, creating, approving registrations, and deleting developers.
- [Manage Subscriptions](https://docs.api7.ai/api7-gateway/3.9.x/developer-portal/manage/manage-subscriptions.md): Manage API product subscriptions in the Provider Portal, including approving, rejecting, and cancelling subscription requests.
- [Developer Portal Overview](https://docs.api7.ai/api7-gateway/3.9.x/developer-portal/overview.md): Learn about the API7 Developer Portal, a platform for API providers to publish API products and for developers to discover, subscribe to, and consume APIs.
#### enterprise-features
- [Alerts and Contact Points](https://docs.api7.ai/api7-gateway/3.9.x/enterprise-features/alerts-and-contact-points.md): Explore the concept of alerts and contact points in API7 Gateway, which monitor exceptions and send timely notifications.
- [Anonymous Consumers](https://docs.api7.ai/api7-gateway/3.9.x/enterprise-features/anonymous-consumers.md): Explore the concept of anonymous consumers in API7 Gateway, allowing non-authenticated access to APIs while maintaining security.
- [API Portal](https://docs.api7.ai/api7-gateway/3.9.x/enterprise-features/api-portal.md): Explore the concept of the API portal in API7 Gateway, providing a centralized space for developers to access and manage APIs.
- [Audit and Rollback](https://docs.api7.ai/api7-gateway/3.9.x/enterprise-features/audit-and-rollback.md): Explore the concept of audit logging and rollback in API7 Gateway, tracking user actions and restoring previous configurations.
- [Compliance](https://docs.api7.ai/api7-gateway/3.9.x/enterprise-features/compliance.md): Explore the concept of compliance in API7 Gateway, helping organizations meet regulatory requirements and maintain security standards.
- [Credentials](https://docs.api7.ai/api7-gateway/3.9.x/enterprise-features/credentials.md): Explore the concept of credentials in API7 Gateway, authenticating users and ensuring secure access while facilitating management and rotation.
- [Custom Plugins](https://docs.api7.ai/api7-gateway/3.9.x/enterprise-features/custom-plugins.md): Explore the concept of custom plugins in API7 Gateway, enabling tailored extensions to meet specific business needs.
- [Dashboard SSO Options](https://docs.api7.ai/api7-gateway/3.9.x/enterprise-features/dashboard-sso.md): Explore the concept of Single Sign-On (SSO) in API7 Gateway, allowing users to authenticate with existing credentials for easy access.
- [Enterprise Plugins](https://docs.api7.ai/api7-gateway/3.9.x/enterprise-features/enterprise-plugins.md): Explore the concept of enterprise plugins in API7 Gateway, which extend functionality and enhance capabilities for API management.
- [Gateway Groups](https://docs.api7.ai/api7-gateway/3.9.x/enterprise-features/gateway-groups.md): Explore the concept of gateway groups in API7 Gateway, which manage multiple API gateway instances with shared configurations.
- [High Availability](https://docs.api7.ai/api7-gateway/3.9.x/enterprise-features/high-availability.md): Explore the concept of high availability in API7 Gateway, ensuring continuous service delivery for mission-critical applications.
- [Organization and RBAC](https://docs.api7.ai/api7-gateway/3.9.x/enterprise-features/organization-and-rbac.md): Explore the concept of organization management and RBAC in API7 Gateway, enabling fine-grained permission management.
- [Enterprise Features Overview](https://docs.api7.ai/api7-gateway/3.9.x/enterprise-features/overview.md): Discover the enterprise-grade features that distinguish API7 Gateway from open-source Apache APISIX, including centralized management, RBAC, audit logging, and professional support.
- [Permission Policies and Boundaries](https://docs.api7.ai/api7-gateway/3.9.x/enterprise-features/permission-policies-and-boundaries.md): Explore the concept of permission policies and boundaries in API7 Gateway, defining user access levels for enhanced security.
- [Secret Providers](https://docs.api7.ai/api7-gateway/3.9.x/enterprise-features/secret-providers.md): Explore the concept of secret providers in API7 Gateway, which enhance security by storing sensitive data using third-party tools.
- [Security Hardening](https://docs.api7.ai/api7-gateway/3.9.x/enterprise-features/security-hardening.md): Explore the concept of security hardening in API7 Gateway, designed to protect API infrastructure against threats and vulnerabilities.
- [Service Release](https://docs.api7.ai/api7-gateway/3.9.x/enterprise-features/service-release.md): Explore the concept of service release in API7 Gateway, detailing the creation, configuration, and deployment of APIs effectively.
#### getting-started
- [Learn More About API7 Products and APISIX](https://docs.api7.ai/api7-gateway/3.9.x/getting-started/learn-more.md): Understand the API7 product family, the relationship between API7 Enterprise and Apache APISIX, and how they fit into your API management strategy.
- [API7 Gateway Overview](https://docs.api7.ai/api7-gateway/3.9.x/getting-started/overview.md): Get started with API7 Gateway. Understand the platform components, how they work together, and choose the right path for your use case.
- [Quick Start](https://docs.api7.ai/api7-gateway/3.9.x/getting-started/quick-start.md): Get API7 Gateway running locally with Docker Compose and proxy your first API request in under 10 minutes.
- [Tutorial: Proxying and Managing API Requests via Plugins](https://docs.api7.ai/api7-gateway/3.9.x/getting-started/tutorial-proxying-api-requests.md): A hands-on tutorial that walks you through proxying API requests, adding authentication with Key Auth, and enabling rate limiting with the Limit Count plugin.
#### how-to-guides
- [Configure Basic Authentication](https://docs.api7.ai/api7-gateway/3.9.x/how-to-guides/api-security/basic-auth.md): Learn how to secure your APIs by requiring clients to provide a standard username and password in the HTTP Authorization header.
- [Configure Data Masking](https://docs.api7.ai/api7-gateway/3.9.x/how-to-guides/api-security/data-masking.md): Use the data-mask plugin to redact, replace, or remove sensitive fields from request data before it is written to access logs and logger plugin output, helping you meet GDPR, HIPAA, and PCI-DSS requirements.
- [Forward External Auth User Info to Upstream](https://docs.api7.ai/api7-gateway/3.9.x/how-to-guides/api-security/forward-auth-user-info.md): Forward authenticated user information from OpenID Connect or SAML routes to upstream services as request headers or the consumer name.
- [Configure HMAC Authentication](https://docs.api7.ai/api7-gateway/3.9.x/how-to-guides/api-security/hmac-auth.md): Learn how to secure your APIs with Hash-based Message Authentication Code (HMAC) for request signing in API7 Enterprise.
- [Configure JWT Authentication](https://docs.api7.ai/api7-gateway/3.9.x/how-to-guides/api-security/jwt-auth.md): Learn how to secure your APIs using JSON Web Tokens (JWT) for stateless authentication in API7 Enterprise.
- [Configure Key Authentication](https://docs.api7.ai/api7-gateway/3.9.x/how-to-guides/api-security/key-auth.md): Learn how to secure your APIs by requiring clients to provide a unique API key in the request header or query string.
- [Configure Readiness and Liveness Probes](https://docs.api7.ai/api7-gateway/3.9.x/how-to-guides/ops/configure-readiness-probe.md): Configure readiness and liveness checks for API7 Gateway data planes in Kubernetes, Docker, and other non-Helm deployments.
- [Create a Custom Role](https://docs.api7.ai/api7-gateway/3.9.x/how-to-guides/ops/create-custom-role.md): Create a custom role in API7 Gateway by defining permission policies, attaching them to a role, and assigning the role to a user.
- [Design a Custom Role System](https://docs.api7.ai/api7-gateway/3.9.x/how-to-guides/ops/design-custom-role-system.md): Design a scalable custom role system in API7 Gateway by combining roles, permission policies, labels, and permission boundaries.
- [Manage Gateway Groups](https://docs.api7.ai/api7-gateway/3.9.x/how-to-guides/ops/multi-gateway-group.md): Learn how to create and manage multiple gateway groups to organize and isolate API traffic across environments or teams.
- [Configure Secret Management](https://docs.api7.ai/api7-gateway/3.9.x/how-to-guides/ops/secret-manager.md): Learn how to configure secret providers and reference external secrets in API7 Enterprise without hardcoding sensitive values in gateway resources.
- [How-To Guides](https://docs.api7.ai/api7-gateway/3.9.x/how-to-guides/overview.md): Practical how-to guides for common API7 Gateway tasks and workflows.
- [Plugin Development Best Practices](https://docs.api7.ai/api7-gateway/3.9.x/how-to-guides/plugin-development/best-practices.md): Write custom Lua plugins that are correct, fast, and maintainable by using the built-in core library instead of low-level OpenResty APIs, validating configuration with a schema, and choosing the right phase and priority.
- [Develop Custom Lua Plugins](https://docs.api7.ai/api7-gateway/3.9.x/how-to-guides/plugin-development/custom-lua-plugins.md): Learn how to develop, register, and test custom Lua plugins for API7 Gateway.
- [Serverless Functions or Custom Plugins](https://docs.api7.ai/api7-gateway/3.9.x/how-to-guides/plugin-development/serverless-or-custom-plugins.md): Compare the built-in serverless-function plugins with custom Lua plugins, and choose the right way to run your own Lua logic in API7 Gateway.
- [Configure GraphQL Proxying](https://docs.api7.ai/api7-gateway/3.9.x/how-to-guides/protocol-proxy/graphql-proxy.md): Learn how to proxy GraphQL APIs through API7 Gateway and when to add GraphQL-aware plugins for rate limiting and caching.
- [Configure gRPC Proxying](https://docs.api7.ai/api7-gateway/3.9.x/how-to-guides/protocol-proxy/grpc-proxy.md): Learn how to configure API7 Enterprise to proxy gRPC traffic, including REST-to-gRPC transcoding and gRPC-Web support for browser clients.
- [Configure TCP/UDP Proxying](https://docs.api7.ai/api7-gateway/3.9.x/how-to-guides/protocol-proxy/tcp-udp-proxy.md): Configure API7 Gateway to proxy TCP and UDP (Layer 4) traffic to upstream services such as databases, message queues, and custom protocols.
- [Configure WebSocket Proxying](https://docs.api7.ai/api7-gateway/3.9.x/how-to-guides/protocol-proxy/websocket-proxy.md): Learn how to enable and configure WebSocket proxying for your routes in API7 Enterprise to handle long-lived, bidirectional connections.
- [Implement Blue-Green Deployment](https://docs.api7.ai/api7-gateway/3.9.x/how-to-guides/traffic-management/blue-green-deployment.md): Implement blue-green deployments using API7 Gateway to switch traffic between two upstream environments with zero downtime.
- [Implement Canary Release](https://docs.api7.ai/api7-gateway/3.9.x/how-to-guides/traffic-management/canary-release.md): Learn how to gradually shift traffic to a new version of your backend service using the traffic-split plugin.
- [Configure CORS](https://docs.api7.ai/api7-gateway/3.9.x/how-to-guides/traffic-management/cors.md): Learn how to configure Cross-Origin Resource Sharing (CORS) for your APIs to allow or restrict access from different domains.
- [Configure Fault Injection](https://docs.api7.ai/api7-gateway/3.9.x/how-to-guides/traffic-management/fault-injection.md): Learn how to test the resilience of your application by injecting HTTP errors and response delays.
- [Conditionally Disable Global Plugins](https://docs.api7.ai/api7-gateway/3.9.x/how-to-guides/traffic-management/global-plugin-exemption.md): Conditionally skip global plugin execution for specific routes using route labels and the _meta.filter mechanism.
- [Configure Upstream Health Checks](https://docs.api7.ai/api7-gateway/3.9.x/how-to-guides/traffic-management/health-check.md): Learn how to configure active and passive health checks for upstream services to ensure high availability.
- [Configure Proxy Cache](https://docs.api7.ai/api7-gateway/3.9.x/how-to-guides/traffic-management/proxy-cache.md): Learn how to improve API performance and reduce upstream load by caching responses at the Gateway.
- [Configure Proxy Mirror](https://docs.api7.ai/api7-gateway/3.9.x/how-to-guides/traffic-management/proxy-mirror.md): Learn how to duplicate and send a percentage of real production traffic to a secondary service for testing and verification.
- [Rewrite Proxy Requests](https://docs.api7.ai/api7-gateway/3.9.x/how-to-guides/traffic-management/proxy-rewrite.md): Learn how to modify request URIs, methods, and headers before proxying them to upstream services.
- [Configure Rate Limiting](https://docs.api7.ai/api7-gateway/3.9.x/how-to-guides/traffic-management/rate-limiting.md): Learn how to configure simple and advanced rate limiting for your APIs to prevent abuse and ensure fair usage.
- [Configure Response Rewrite](https://docs.api7.ai/api7-gateway/3.9.x/how-to-guides/traffic-management/response-rewrite.md): Learn how to modify response status codes, headers, and body content before they are returned to the client.
#### install
- [Deploy for High Availability](https://docs.api7.ai/api7-gateway/3.9.x/install/deploy-high-availability.md): Deploy API7 Gateway control plane and data plane in a high-availability configuration to eliminate single points of failure.
- [Deploy on Kubernetes](https://docs.api7.ai/api7-gateway/3.9.x/install/deploy-on-kubernetes.md): Deploy API7 Enterprise on Kubernetes using Helm, including control plane setup, data plane configuration with mTLS, and cloud-specific guidance for AWS EKS, GCP GKE, and Azure AKS.
- [Deploy on OpenShift](https://docs.api7.ai/api7-gateway/3.9.x/install/deploy-on-openshift.md): Deploy API7 Gateway on Red Hat OpenShift with proper Security Context Constraints (SCCs), service accounts, and Helm chart configuration.
- [Deploy with Docker Compose](https://docs.api7.ai/api7-gateway/3.9.x/install/deploy-with-docker-compose.md): Deploy API7 Enterprise locally with Docker Compose. This development and testing setup brings up the control plane with PostgreSQL, Prometheus, Jaeger, the integrated Dashboard, and the DP Manager, then adds a data plane gateway with a dashboard-generated Docker command.
- [Installation FAQ](https://docs.api7.ai/api7-gateway/3.9.x/install/installation-faq.md): Frequently asked questions and troubleshooting common installation issues.
- [Installation Packages](https://docs.api7.ai/api7-gateway/3.9.x/install/installation-packages.md): Container images, Helm charts, and CLI tools used to install API7 Enterprise — including the official Docker Hub repositories for the gateway, DP manager, Developer Portal, and integrated control plane images.
- [Install API7 Gateway On-Premises](https://docs.api7.ai/api7-gateway/3.9.x/install/overview.md): Overview of deployment options for API7 Enterprise on-premises infrastructure.
- [Supported Versions and Interoperability](https://docs.api7.ai/api7-gateway/3.9.x/install/supported-versions-and-interoperability.md): Version compatibility matrix for API7 Enterprise components and infrastructure.
- [System Requirements](https://docs.api7.ai/api7-gateway/3.9.x/install/system-requirements.md): Hardware, operating system, and network requirements for installing API7 Gateway.
#### key-concepts
- [Architecture](https://docs.api7.ai/api7-gateway/3.9.x/key-concepts/architecture.md): Deep dive into the decoupled control plane and data plane architecture of API7 Enterprise.
- [Consumers and Credentials](https://docs.api7.ai/api7-gateway/3.9.x/key-concepts/consumers-and-credentials.md): Identity management and authentication using Consumers and Credentials.
- [Gateway Groups](https://docs.api7.ai/api7-gateway/3.9.x/key-concepts/gateway-groups.md): Logical grouping of data plane instances for environment isolation and configuration management.
- [Key Concepts Overview](https://docs.api7.ai/api7-gateway/3.9.x/key-concepts/overview.md): Introduction to the core abstractions and entities in API7 Enterprise.
- [Plugins](https://docs.api7.ai/api7-gateway/3.9.x/key-concepts/plugins.md): Modular components to intercept and modify API traffic in API7 Gateway.
- [Service Discovery](https://docs.api7.ai/api7-gateway/3.9.x/key-concepts/service-discovery.md): Dynamic upstream resolution in API7 Gateway — automatically discover backend endpoints from Kubernetes Services, Nacos, and Consul registries without hardcoding IPs.
- [Services and Routes](https://docs.api7.ai/api7-gateway/3.9.x/key-concepts/services-and-routes.md): Understand how to group and route API traffic using Services and Routes.
- [SSL Certificates](https://docs.api7.ai/api7-gateway/3.9.x/key-concepts/ssl-certificates.md): Understanding how API7 Gateway manages SSL/TLS certificates and terminates secure connections.
- [Stream Routes](https://docs.api7.ai/api7-gateway/3.9.x/key-concepts/stream-routes.md): Understand stream routes in API7 Gateway for proxying TCP and UDP (Layer 4) traffic, including matching rules, supported plugins, and the relationship with stream services.
- [Upstreams and Load Balancing](https://docs.api7.ai/api7-gateway/3.9.x/key-concepts/upstreams-and-load-balancing.md): Definitions of backend targets, including load balancing algorithms and health checks.
#### observability
- [Configure Alerts](https://docs.api7.ai/api7-gateway/3.9.x/observability/alerts.md): Configure alert policies and contact points in API7 Gateway to get notified by email or webhook when gateway instances go offline, certificates expire, or error rates breach a threshold.
- [Include Consumer Labels in Access Logs](https://docs.api7.ai/api7-gateway/3.9.x/observability/consumer-label-based-logging.md): Include consumer labels in API7 Gateway access logs for per-consumer traffic tracking and analysis.
- [Capture Request Traces with Debug Sessions](https://docs.api7.ai/api7-gateway/3.9.x/observability/debug-sessions.md): Find out exactly what the gateway did to a single request — which plugins ran, in what order, which one was slow, and what it logged. Capture on demand, or automatically when an alert fires.
- [Use an Existing Prometheus](https://docs.api7.ai/api7-gateway/3.9.x/observability/external-prometheus.md): Point API7 Gateway at an existing external Prometheus and remove the bundled instance from a Docker Compose deployment, keeping the Dashboard Monitoring page working throughout.
- [Send Kubernetes Error Logs to Splunk](https://docs.api7.ai/api7-gateway/3.9.x/observability/kubernetes-error-log-forwarding.md): Forward API7 Gateway error logs from Kubernetes to Splunk by using the Splunk OpenTelemetry Collector.
- [Configure Centralized Logging](https://docs.api7.ai/api7-gateway/3.9.x/observability/logging.md): Understand the access and error logs that API7 Gateway produces, how to configure their format and verbosity, and how to forward them to a centralized log management system.
- [Monitor Metrics](https://docs.api7.ai/api7-gateway/3.9.x/observability/metrics.md): Monitor API7 Gateway metrics via the built-in Dashboard page or by scraping the Prometheus endpoint exposed by the data plane.
- [Send Access Logs to Splunk](https://docs.api7.ai/api7-gateway/3.9.x/observability/splunk-integration.md): Send API7 Gateway access logs to Splunk using the HTTP Event Collector (HEC) logging plugin.
- [Configure Distributed Tracing](https://docs.api7.ai/api7-gateway/3.9.x/observability/tracing.md): Enable distributed tracing in API7 Gateway with the OpenTelemetry plugin. Configure the OTLP collector, sampling strategy, and per-route spans to visualize request flows and analyze latency bottlenecks.
#### overview
Discover API7 Gateway, a dynamic, high-performance API gateway for cloud-native environments, built on Apache APISIX. Learn about its architecture, features, and deployment models.
- [API7 Gateway](https://docs.api7.ai/api7-gateway/3.9.x/overview.md): Discover API7 Gateway, a dynamic, high-performance API gateway for cloud-native environments, built on Apache APISIX. Learn about its architecture, features, and deployment models.
#### reference
Technical reference documentation for API7 Gateway, including configuration files, environment variables, CLI tools, and API specifications.
- [Reference Overview](https://docs.api7.ai/api7-gateway/3.9.x/reference.md): Technical reference documentation for API7 Gateway, including configuration files, environment variables, CLI tools, and API specifications.
- [API Declarative CLI (ADC)](https://docs.api7.ai/api7-gateway/3.9.x/reference/adc.md): Use API Declarative CLI (ADC) to manage API7 Gateway configuration declaratively.
- [Alert Variables and Templates](https://docs.api7.ai/api7-gateway/3.9.x/reference/alert-template.md): Customize alert notifications with pre-defined variables in API7 Gateway, enabling dynamic content in alert messages and emails.
- [Approval Notification Variables and Templates](https://docs.api7.ai/api7-gateway/3.9.x/reference/approval-variables.md): Use API7 Gateway approval variables to customize API product subscription notification email content and webhook messages with current template values.
- [Built-In Variables](https://docs.api7.ai/api7-gateway/3.9.x/reference/built-in-variables.md): Discover the built-in variables available in API7 Gateway, including NGINX and APISIX variables, which can be utilized for route matching, log customization, and plugin configurations.
- [Configuration Files](https://docs.api7.ai/api7-gateway/3.9.x/reference/configuration.md): Understand the configuration files used in API7 Gateway, including default and user-defined files for managing settings effectively.
- [Environment Variables](https://docs.api7.ai/api7-gateway/3.9.x/reference/environment-variables.md): Explore the use of environment variables in API7 Gateway for configuring consumer credentials, SSL certificates, and plugins.
- [API7 Expressions](https://docs.api7.ai/api7-gateway/3.9.x/reference/expressions.md): Understand how to use expressions in API7 Gateway for route matching, request filtering, and conditional logic in configurations.
- [Security Hardening Reference](https://docs.api7.ai/api7-gateway/3.9.x/reference/hardening.md): Learn about securing sensitive information in API7 Gateway, including storage, encryption, and communication practices to protect against threats.
- [Helm Chart](https://docs.api7.ai/api7-gateway/3.9.x/reference/helm-chart.md): Learn where to find API7 Gateway Helm chart values and how Helm values are rendered into gateway configuration.
- [Obtain a Token from the Dashboard](https://docs.api7.ai/api7-gateway/3.9.x/reference/obtain-dashboard-token.md): Create a token in the API7 Dashboard and use it for API7 Gateway Admin API and ADC authentication.
- [Permission Policy Actions and Resources](https://docs.api7.ai/api7-gateway/3.9.x/reference/permission-policy-action-and-resource.md): Complete reference for all permission policy actions and ARN-style resources in API7 Gateway — organized by namespace (gateway, iam, portal) for building least-privilege policies.
- [Permission Policy Examples](https://docs.api7.ai/api7-gateway/3.9.x/reference/permission-policy-examples.md): Ready-to-adapt permission policy examples for API7 Gateway, organized by access pattern, service and plugin operations, IAM and governance, and portal management.
#### release-notes
Review the latest updates, features, improvements, and bug fixes for each version of API7 Gateway in release notes.
- [API7 Gateway Release Notes](https://docs.api7.ai/api7-gateway/3.9.x/release-notes.md): Review the latest updates, features, improvements, and bug fixes for each version of API7 Gateway in release notes.
#### scalability
- [Autoscale Data Plane on Kubernetes](https://docs.api7.ai/api7-gateway/3.9.x/scalability/autoscale-on-kubernetes.md): Autoscale API7 Gateway data plane pods on Kubernetes with a Horizontal Pod Autoscaler (HPA) to handle changing traffic automatically.
#### security-and-compliance
- [Access Control Lists (ACLs)](https://docs.api7.ai/api7-gateway/3.9.x/security-and-compliance/access-control-lists.md): Restrict API access using the consumer-restriction plugin in API7 Gateway. Configure allowlists and denylists keyed by consumer name, consumer group ID, service ID, or route ID for granular security.
- [Audit Logs](https://docs.api7.ai/api7-gateway/3.9.x/security-and-compliance/audit-logs.md): Track all administrative changes in the API7 Control Plane with detailed audit logs. Learn how to review, manage, and export audit trails for security and compliance.
- [Client mTLS Authentication](https://docs.api7.ai/api7-gateway/3.9.x/security-and-compliance/authenticate/client-mtls.md): Configure mutual TLS (mTLS) on API7 Gateway to authenticate API clients with X.509 certificates before allowing access to your APIs.
- [Mutual TLS between Control Plane and Data Plane](https://docs.api7.ai/api7-gateway/3.9.x/security-and-compliance/authenticate/mutual-tls-cp-dp.md): Learn how API7 Gateway uses a robust, PKI-based mutual TLS (mTLS) model to secure all communication between the Control Plane and Data Plane.
- [SCIM Provisioning for Dashboard](https://docs.api7.ai/api7-gateway/3.9.x/security-and-compliance/authenticate/scim.md): Configure SCIM provisioning for API7 Gateway Dashboard with supported identity providers.
- [SCIM Provisioning with Microsoft Entra ID](https://docs.api7.ai/api7-gateway/3.9.x/security-and-compliance/authenticate/scim-microsoft-entra-id.md): Configure SCIM provisioning with Microsoft Entra ID for API7 Gateway Dashboard.
- [SCIM Provisioning with Okta](https://docs.api7.ai/api7-gateway/3.9.x/security-and-compliance/authenticate/scim-okta.md): Configure SCIM provisioning with Okta for API7 Gateway Dashboard.
- [Upstream mTLS](https://docs.api7.ai/api7-gateway/3.9.x/security-and-compliance/authenticate/upstream-mtls.md): Configure mutual TLS (mTLS) between API7 Gateway and upstream services so the gateway presents a client certificate to the upstream and optionally validates the upstream's server certificate.
- [IP Restrictions for Control Plane](https://docs.api7.ai/api7-gateway/3.9.x/security-and-compliance/ip-restrictions-control-plane.md): Restrict which client IP addresses can reach the API7 Control Plane (Dashboard and Admin API) using the Control Plane's built-in IP allow list, with complementary network-level controls for defence in depth.
- [OAuth 2.0 and OIDC](https://docs.api7.ai/api7-gateway/3.9.x/security-and-compliance/oauth-oidc.md): Secure your APIs with modern token-based authentication. Learn how to integrate API7 Gateway with OAuth 2.0 and OpenID Connect (OIDC) providers like Okta and Keycloak.
- [Open Source Licenses](https://docs.api7.ai/api7-gateway/3.9.x/security-and-compliance/open-source-licenses.md): API7 Gateway's commitment to open-source software and license compliance. Review the major open-source components used and their respective licenses.
- [Security and Compliance Overview](https://docs.api7.ai/api7-gateway/3.9.x/security-and-compliance/overview.md): Learn how API7 Gateway provides comprehensive security and compliance features to protect your APIs, including authentication, authorization, encryption, and auditing capabilities.
- [Permission Policies and Boundaries](https://docs.api7.ai/api7-gateway/3.9.x/security-and-compliance/permission-policies-and-boundaries.md): Author permission policies in API7 Gateway using the native JSON document format. Learn the statement structure, allowed actions, ARN-style resources, label-based conditions, and how permission boundaries enforce maximum allowable permissions.
- [Role-Based Access Control (RBAC)](https://docs.api7.ai/api7-gateway/3.9.x/security-and-compliance/role-based-access-control.md): Manage user access to the API7 Gateway control plane with Role-Based Access Control. Assign users to roles, attach permission policies, and enforce least-privilege access across gateway groups.
- [Secure Credentials Management](https://docs.api7.ai/api7-gateway/3.9.x/security-and-compliance/secure-credentials.md): Protect your sensitive information with API7 Gateway's secure credentials management. Learn how to manage SSL certificates and integrate with external secret managers like HashiCorp Vault.
- [SSO for Dashboard](https://docs.api7.ai/api7-gateway/3.9.x/security-and-compliance/sso-dashboard.md): Centralize user access to the API7 Dashboard using Single Sign-On (SSO). Supports OIDC, SAML, LDAP, and CAS protocols with automatic role mapping.
- [SSO with LDAP](https://docs.api7.ai/api7-gateway/3.9.x/security-and-compliance/sso-ldap.md): Configure Single Sign-On (SSO) for the API7 Dashboard using LDAP, allowing users to authenticate with their existing directory service credentials.
- [SSO with OIDC](https://docs.api7.ai/api7-gateway/3.9.x/security-and-compliance/sso-oidc.md): Configure Single Sign-On (SSO) for the API7 Dashboard using OpenID Connect (OIDC), with provider-specific guidance for Keycloak, Microsoft Entra ID, and Auth0.
- [SSO with SAML](https://docs.api7.ai/api7-gateway/3.9.x/security-and-compliance/sso-saml.md): Configure Single Sign-On (SSO) for the API7 Dashboard using SAML 2.0, with provider-specific guidance for Microsoft Entra ID and Okta.
- [Trust Center](https://docs.api7.ai/api7-gateway/3.9.x/security-and-compliance/trust-center.md): The API7 Trust Center is your centralized resource for all security and compliance-related information, including certifications, security reports, and best practice guides.
- [Verify Image Signatures](https://docs.api7.ai/api7-gateway/3.9.x/security-and-compliance/verify-image-signatures.md): Verify API7 Enterprise container image signatures with Cosign and keyless OIDC-based verification. Protect your supply chain by confirming every image was built and signed by API7.ai.
- [Vulnerability Scanning](https://docs.api7.ai/api7-gateway/3.9.x/security-and-compliance/vulnerability-scanning.md): Learn about API7.ai's security testing and vulnerability scanning practices for API7 Gateway, including our CVE reporting and patching processes.
- [Web Application Firewall (WAF)](https://docs.api7.ai/api7-gateway/3.9.x/security-and-compliance/web-application-firewall.md): Learn when to use a Web Application Firewall with API7 Gateway, how it fits into your security model, and where to find the current documented integration path.
#### troubleshooting
Diagnose and resolve common issues with API7 Gateway deployments, including connectivity problems, configuration errors, and performance degradation.
- [Troubleshoot API7 Gateway](https://docs.api7.ai/api7-gateway/3.9.x/troubleshooting.md): Diagnose and resolve common issues with API7 Gateway deployments, including connectivity problems, configuration errors, and performance degradation.
#### upgrade-guides
- [Backup and Restoration](https://docs.api7.ai/api7-gateway/3.9.x/upgrade-guides/backup-and-restore.md): Learn how to back up and restore your API7 Gateway data with step-by-step instructions for database backup, declarative configuration backup, and data restoration procedures.
- [API Gateway Cluster Migration](https://docs.api7.ai/api7-gateway/3.9.x/upgrade-guides/cluster-migration.md): A step-by-step guide for migrating your API7 Gateway deployment to a new cluster with zero downtime.
- [Dual-Cluster Upgrade](https://docs.api7.ai/api7-gateway/3.9.x/upgrade-guides/dual-cluster.md): Step-by-step guide for performing a dual-cluster upgrade of API7 Gateway, covering new cluster deployment, traffic shifting, and rollback procedures.
- [In-Place Upgrade](https://docs.api7.ai/api7-gateway/3.9.x/upgrade-guides/in-place.md): Step-by-step guide for performing an in-place upgrade of API7 Gateway Control Plane, covering database reuse, configuration updates, and verification procedures.
- [Rolling Upgrade](https://docs.api7.ai/api7-gateway/3.9.x/upgrade-guides/rolling-upgrade.md): Step-by-step guide for performing a rolling upgrade of API7 Gateway Data Plane nodes, ensuring zero downtime while maintaining API request processing and service continuity.
- [Upgrade API7 Gateway](https://docs.api7.ai/api7-gateway/3.9.x/upgrade-guides/upgrade.md): Comprehensive guide for upgrading API7 Gateway, covering in-place CP upgrade, rolling DP upgrade, data backup, and stability considerations.
#### version-support-policy
API7 Enterprise version support lifecycle, LTS policy, and upgrade guidance. Learn how long each release is supported and which versions are currently designated as LTS.
- [Version Support Policy](https://docs.api7.ai/api7-gateway/3.9.x/version-support-policy.md): API7 Enterprise version support lifecycle, LTS policy, and upgrade guidance. Learn how long each release is supported and which versions are currently designated as LTS.
### ai-agent-skills
Manage API7 Gateway with AI coding agents like Claude Code and Cursor. Agent skills that configure your API7 Enterprise Edition gateway from natural language.
- [AI Agent Skills for API7 Gateway](https://docs.api7.ai/api7-gateway/ai-agent-skills.md): Manage API7 Gateway with AI coding agents like Claude Code and Cursor. Agent skills that configure your API7 Enterprise Edition gateway from natural language.
#### a7-persona-developer
Persona skill for API developers building and testing APIs on API7 Enterprise Edition (API7 EE) using the a7 CLI. Provides decision frameworks for servi…
- [a7-persona-developer](https://docs.api7.ai/api7-gateway/ai-agent-skills/a7-persona-developer.md): Persona skill for API developers building and testing APIs on API7 Enterprise Edition (API7 EE) using the a7 CLI. Provides decision frameworks for servi…
#### a7-persona-operator
Persona skill for platform operators and DevOps engineers managing API7 Enterprise Edition (API7 EE) instances using the a7 CLI. Provides decision frame…
- [a7-persona-operator](https://docs.api7.ai/api7-gateway/ai-agent-skills/a7-persona-operator.md): Persona skill for platform operators and DevOps engineers managing API7 Enterprise Edition (API7 EE) instances using the a7 CLI. Provides decision frame…
#### a7-plugin-ai-content-moderation
Skill for configuring API7 Enterprise Edition AI content moderation plugins via the a7 CLI. Covers both ai-aws-content-moderation (AWS Comprehend, reque…
- [a7-plugin-ai-content-moderation](https://docs.api7.ai/api7-gateway/ai-agent-skills/a7-plugin-ai-content-moderation.md): Skill for configuring API7 Enterprise Edition AI content moderation plugins via the a7 CLI. Covers both ai-aws-content-moderation (AWS Comprehend, reque…
#### a7-plugin-ai-prompt-decorator
Skill for configuring the API7 Enterprise Edition ai-prompt-decorator plugin via the a7 CLI. Covers prepending and appending system/user/assistant messa…
- [a7-plugin-ai-prompt-decorator](https://docs.api7.ai/api7-gateway/ai-agent-skills/a7-plugin-ai-prompt-decorator.md): Skill for configuring the API7 Enterprise Edition ai-prompt-decorator plugin via the a7 CLI. Covers prepending and appending system/user/assistant messa…
#### a7-plugin-ai-prompt-template
Skill for configuring the API7 Enterprise Edition ai-prompt-template plugin via the a7 CLI. Covers defining reusable prompt templates with variable plac…
- [a7-plugin-ai-prompt-template](https://docs.api7.ai/api7-gateway/ai-agent-skills/a7-plugin-ai-prompt-template.md): Skill for configuring the API7 Enterprise Edition ai-prompt-template plugin via the a7 CLI. Covers defining reusable prompt templates with variable plac…
#### a7-plugin-ai-proxy
Skill for configuring the API7 Enterprise Edition ai-proxy plugin via the a7 CLI. Covers proxying requests to LLM providers (OpenAI, Azure OpenAI, DeepS…
- [a7-plugin-ai-proxy](https://docs.api7.ai/api7-gateway/ai-agent-skills/a7-plugin-ai-proxy.md): Skill for configuring the API7 Enterprise Edition ai-proxy plugin via the a7 CLI. Covers proxying requests to LLM providers (OpenAI, Azure OpenAI, DeepS…
#### a7-plugin-basic-auth
Skill for configuring the API7 Enterprise Edition (API7 EE) basic-auth plugin via the a7 CLI. Covers HTTP Basic Authentication setup on routes, consumer…
- [a7-plugin-basic-auth](https://docs.api7.ai/api7-gateway/ai-agent-skills/a7-plugin-basic-auth.md): Skill for configuring the API7 Enterprise Edition (API7 EE) basic-auth plugin via the a7 CLI. Covers HTTP Basic Authentication setup on routes, consumer…
#### a7-plugin-consumer-restriction
Skill for configuring the API7 Enterprise Edition consumer-restriction plugin via the a7 CLI. Covers restricting access by consumer name, service ID, or…
- [a7-plugin-consumer-restriction](https://docs.api7.ai/api7-gateway/ai-agent-skills/a7-plugin-consumer-restriction.md): Skill for configuring the API7 Enterprise Edition consumer-restriction plugin via the a7 CLI. Covers restricting access by consumer name, service ID, or…
#### a7-plugin-cors
Skill for configuring the API7 Enterprise Edition (API7 EE) cors plugin via the a7 CLI. Covers Cross-Origin Resource Sharing setup on routes, allow_orig…
- [a7-plugin-cors](https://docs.api7.ai/api7-gateway/ai-agent-skills/a7-plugin-cors.md): Skill for configuring the API7 Enterprise Edition (API7 EE) cors plugin via the a7 CLI. Covers Cross-Origin Resource Sharing setup on routes, allow_orig…
#### a7-plugin-datadog
Skill for configuring the API7 Enterprise Edition datadog plugin via the a7 CLI. Covers pushing custom metrics to Datadog via DogStatsD, metric tags, ba…
- [a7-plugin-datadog](https://docs.api7.ai/api7-gateway/ai-agent-skills/a7-plugin-datadog.md): Skill for configuring the API7 Enterprise Edition datadog plugin via the a7 CLI. Covers pushing custom metrics to Datadog via DogStatsD, metric tags, ba…
#### a7-plugin-ext-plugin
Skill for configuring the API7 Enterprise Edition external plugin system (ext-plugin-pre-req, ext-plugin-post-req, ext-plugin-post-resp) via the a7 CLI.…
- [a7-plugin-ext-plugin](https://docs.api7.ai/api7-gateway/ai-agent-skills/a7-plugin-ext-plugin.md): Skill for configuring the API7 Enterprise Edition external plugin system (ext-plugin-pre-req, ext-plugin-post-req, ext-plugin-post-resp) via the a7 CLI.…
#### a7-plugin-fault-injection
Skill for configuring the API7 Enterprise Edition fault-injection plugin via the a7 CLI. Covers injecting delays and HTTP aborts for chaos engineering,…
- [a7-plugin-fault-injection](https://docs.api7.ai/api7-gateway/ai-agent-skills/a7-plugin-fault-injection.md): Skill for configuring the API7 Enterprise Edition fault-injection plugin via the a7 CLI. Covers injecting delays and HTTP aborts for chaos engineering,…
#### a7-plugin-grpc-transcode
Skill for configuring the API7 Enterprise Edition (API7 EE) grpc-transcode plugin via the a7 CLI. Covers converting RESTful HTTP requests to gRPC, proto…
- [a7-plugin-grpc-transcode](https://docs.api7.ai/api7-gateway/ai-agent-skills/a7-plugin-grpc-transcode.md): Skill for configuring the API7 Enterprise Edition (API7 EE) grpc-transcode plugin via the a7 CLI. Covers converting RESTful HTTP requests to gRPC, proto…
#### a7-plugin-hmac-auth
Skill for configuring the API7 Enterprise Edition (API7 EE) hmac-auth plugin via the a7 CLI. Covers HMAC signature authentication, consumer credential b…
- [a7-plugin-hmac-auth](https://docs.api7.ai/api7-gateway/ai-agent-skills/a7-plugin-hmac-auth.md): Skill for configuring the API7 Enterprise Edition (API7 EE) hmac-auth plugin via the a7 CLI. Covers HMAC signature authentication, consumer credential b…
#### a7-plugin-http-logger
Skill for configuring the API7 Enterprise Edition (API7 EE) http-logger plugin via the a7 CLI. Covers pushing access logs to HTTP/HTTPS endpoints in bat…
- [a7-plugin-http-logger](https://docs.api7.ai/api7-gateway/ai-agent-skills/a7-plugin-http-logger.md): Skill for configuring the API7 Enterprise Edition (API7 EE) http-logger plugin via the a7 CLI. Covers pushing access logs to HTTP/HTTPS endpoints in bat…
#### a7-plugin-ip-restriction
Skill for configuring the API7 Enterprise Edition (API7 EE) ip-restriction plugin via the a7 CLI. Covers IP whitelist/blacklist setup on routes, CIDR ra…
- [a7-plugin-ip-restriction](https://docs.api7.ai/api7-gateway/ai-agent-skills/a7-plugin-ip-restriction.md): Skill for configuring the API7 Enterprise Edition (API7 EE) ip-restriction plugin via the a7 CLI. Covers IP whitelist/blacklist setup on routes, CIDR ra…
#### a7-plugin-jwt-auth
Skill for configuring the API7 Enterprise Edition (API7 EE) jwt-auth plugin via the a7 CLI. Covers JWT token authentication, HS256/RS256 algorithm selec…
- [a7-plugin-jwt-auth](https://docs.api7.ai/api7-gateway/ai-agent-skills/a7-plugin-jwt-auth.md): Skill for configuring the API7 Enterprise Edition (API7 EE) jwt-auth plugin via the a7 CLI. Covers JWT token authentication, HS256/RS256 algorithm selec…
#### a7-plugin-kafka-logger
Skill for configuring the API7 Enterprise Edition (API7 EE) kafka-logger plugin via the a7 CLI. Covers pushing access logs to Apache Kafka topics, broke…
- [a7-plugin-kafka-logger](https://docs.api7.ai/api7-gateway/ai-agent-skills/a7-plugin-kafka-logger.md): Skill for configuring the API7 Enterprise Edition (API7 EE) kafka-logger plugin via the a7 CLI. Covers pushing access logs to Apache Kafka topics, broke…
#### a7-plugin-key-auth
Skill for configuring the API7 Enterprise Edition (API7 EE) key-auth plugin via the a7 CLI. Covers API key authentication setup on routes, consumer cred…
- [a7-plugin-key-auth](https://docs.api7.ai/api7-gateway/ai-agent-skills/a7-plugin-key-auth.md): Skill for configuring the API7 Enterprise Edition (API7 EE) key-auth plugin via the a7 CLI. Covers API key authentication setup on routes, consumer cred…
#### a7-plugin-limit-count
Skill for configuring the API7 Enterprise Edition (API7 EE) limit-count plugin via the a7 CLI. Covers fixed-window rate limiting, count/time_window conf…
- [a7-plugin-limit-count](https://docs.api7.ai/api7-gateway/ai-agent-skills/a7-plugin-limit-count.md): Skill for configuring the API7 Enterprise Edition (API7 EE) limit-count plugin via the a7 CLI. Covers fixed-window rate limiting, count/time_window conf…
#### a7-plugin-limit-req
Skill for configuring the API7 Enterprise Edition (API7 EE) limit-req plugin via the a7 CLI. Covers leaky-bucket rate limiting, rate/burst configuration…
- [a7-plugin-limit-req](https://docs.api7.ai/api7-gateway/ai-agent-skills/a7-plugin-limit-req.md): Skill for configuring the API7 Enterprise Edition (API7 EE) limit-req plugin via the a7 CLI. Covers leaky-bucket rate limiting, rate/burst configuration…
#### a7-plugin-openid-connect
Skill for configuring the API7 Enterprise Edition (API7 EE) openid-connect plugin via the a7 CLI. Covers OIDC authorization code flow, bearer token vali…
- [a7-plugin-openid-connect](https://docs.api7.ai/api7-gateway/ai-agent-skills/a7-plugin-openid-connect.md): Skill for configuring the API7 Enterprise Edition (API7 EE) openid-connect plugin via the a7 CLI. Covers OIDC authorization code flow, bearer token vali…
#### a7-plugin-prometheus
Skill for configuring the API7 Enterprise Edition (API7 EE) prometheus plugin via the a7 CLI. Covers enabling Prometheus metrics export on routes and gl…
- [a7-plugin-prometheus](https://docs.api7.ai/api7-gateway/ai-agent-skills/a7-plugin-prometheus.md): Skill for configuring the API7 Enterprise Edition (API7 EE) prometheus plugin via the a7 CLI. Covers enabling Prometheus metrics export on routes and gl…
#### a7-plugin-proxy-rewrite
Skill for configuring the API7 Enterprise Edition (API7 EE) proxy-rewrite plugin via the a7 CLI. Covers rewriting request URI, host, method, headers, an…
- [a7-plugin-proxy-rewrite](https://docs.api7.ai/api7-gateway/ai-agent-skills/a7-plugin-proxy-rewrite.md): Skill for configuring the API7 Enterprise Edition (API7 EE) proxy-rewrite plugin via the a7 CLI. Covers rewriting request URI, host, method, headers, an…
#### a7-plugin-redirect
Skill for configuring the API7 Enterprise Edition (API7 EE) redirect plugin via the a7 CLI. Covers URI redirects, HTTP-to-HTTPS redirection, regex-based…
- [a7-plugin-redirect](https://docs.api7.ai/api7-gateway/ai-agent-skills/a7-plugin-redirect.md): Skill for configuring the API7 Enterprise Edition (API7 EE) redirect plugin via the a7 CLI. Covers URI redirects, HTTP-to-HTTPS redirection, regex-based…
#### a7-plugin-response-rewrite
Skill for configuring the API7 Enterprise Edition (API7 EE) response-rewrite plugin via the a7 CLI. Covers rewriting response status codes, headers, and…
- [a7-plugin-response-rewrite](https://docs.api7.ai/api7-gateway/ai-agent-skills/a7-plugin-response-rewrite.md): Skill for configuring the API7 Enterprise Edition (API7 EE) response-rewrite plugin via the a7 CLI. Covers rewriting response status codes, headers, and…
#### a7-plugin-serverless
Skill for configuring the API7 Enterprise Edition serverless-pre-function and serverless-post-function plugins via the a7 CLI. Covers inline Lua functio…
- [a7-plugin-serverless](https://docs.api7.ai/api7-gateway/ai-agent-skills/a7-plugin-serverless.md): Skill for configuring the API7 Enterprise Edition serverless-pre-function and serverless-post-function plugins via the a7 CLI. Covers inline Lua functio…
#### a7-plugin-skywalking
Skill for configuring the API7 Enterprise Edition (API7 EE) skywalking plugin via the a7 CLI. Covers distributed tracing with Apache SkyWalking OAP, sam…
- [a7-plugin-skywalking](https://docs.api7.ai/api7-gateway/ai-agent-skills/a7-plugin-skywalking.md): Skill for configuring the API7 Enterprise Edition (API7 EE) skywalking plugin via the a7 CLI. Covers distributed tracing with Apache SkyWalking OAP, sam…
#### a7-plugin-traffic-split
Skill for configuring the API7 Enterprise Edition (API7 EE) traffic-split plugin via the a7 CLI. Covers weighted traffic splitting between upstreams wit…
- [a7-plugin-traffic-split](https://docs.api7.ai/api7-gateway/ai-agent-skills/a7-plugin-traffic-split.md): Skill for configuring the API7 Enterprise Edition (API7 EE) traffic-split plugin via the a7 CLI. Covers weighted traffic splitting between upstreams wit…
#### a7-plugin-wolf-rbac
Skill for configuring the API7 Enterprise Edition (API7 EE) wolf-rbac plugin via the a7 CLI. Covers integration with the Wolf RBAC server for role-based…
- [a7-plugin-wolf-rbac](https://docs.api7.ai/api7-gateway/ai-agent-skills/a7-plugin-wolf-rbac.md): Skill for configuring the API7 Enterprise Edition (API7 EE) wolf-rbac plugin via the a7 CLI. Covers integration with the Wolf RBAC server for role-based…
#### a7-plugin-zipkin
Skill for configuring the API7 Enterprise Edition (API7 EE) zipkin plugin via the a7 CLI. Covers distributed tracing with Zipkin, Jaeger, or any Zipkin-…
- [a7-plugin-zipkin](https://docs.api7.ai/api7-gateway/ai-agent-skills/a7-plugin-zipkin.md): Skill for configuring the API7 Enterprise Edition (API7 EE) zipkin plugin via the a7 CLI. Covers distributed tracing with Zipkin, Jaeger, or any Zipkin-…
#### a7-recipe-api-versioning
Recipe skill for implementing API versioning strategies using API7 Enterprise Edition (API7 EE) and the a7 CLI. Covers URI path versioning, header-based…
- [a7-recipe-api-versioning](https://docs.api7.ai/api7-gateway/ai-agent-skills/a7-recipe-api-versioning.md): Recipe skill for implementing API versioning strategies using API7 Enterprise Edition (API7 EE) and the a7 CLI. Covers URI path versioning, header-based…
#### a7-recipe-blue-green
Recipe skill for implementing blue-green deployments using the a7 CLI in API7 Enterprise Edition. Covers creating two service-backed environments, switc…
- [a7-recipe-blue-green](https://docs.api7.ai/api7-gateway/ai-agent-skills/a7-recipe-blue-green.md): Recipe skill for implementing blue-green deployments using the a7 CLI in API7 Enterprise Edition. Covers creating two service-backed environments, switc…
#### a7-recipe-canary
Recipe skill for implementing canary releases using the a7 CLI in API7 Enterprise Edition. Covers gradual traffic shifting with the traffic-split plugin…
- [a7-recipe-canary](https://docs.api7.ai/api7-gateway/ai-agent-skills/a7-recipe-canary.md): Recipe skill for implementing canary releases using the a7 CLI in API7 Enterprise Edition. Covers gradual traffic shifting with the traffic-split plugin…
#### a7-recipe-circuit-breaker
Recipe skill for implementing circuit breaker patterns using the a7 CLI in API7 Enterprise Edition. Covers the api-breaker plugin, unhealthy thresholds,…
- [a7-recipe-circuit-breaker](https://docs.api7.ai/api7-gateway/ai-agent-skills/a7-recipe-circuit-breaker.md): Recipe skill for implementing circuit breaker patterns using the a7 CLI in API7 Enterprise Edition. Covers the api-breaker plugin, unhealthy thresholds,…
#### a7-recipe-graphql-proxy
Recipe skill for implementing GraphQL proxying patterns using API7 Enterprise Edition (API7 EE) and the a7 CLI. Covers operation-based routing, per-oper…
- [a7-recipe-graphql-proxy](https://docs.api7.ai/api7-gateway/ai-agent-skills/a7-recipe-graphql-proxy.md): Recipe skill for implementing GraphQL proxying patterns using API7 Enterprise Edition (API7 EE) and the a7 CLI. Covers operation-based routing, per-oper…
#### a7-recipe-health-check
Recipe skill for configuring backend health checks using the a7 CLI in API7 Enterprise Edition. Covers active health checks, passive health checks, comb…
- [a7-recipe-health-check](https://docs.api7.ai/api7-gateway/ai-agent-skills/a7-recipe-health-check.md): Recipe skill for configuring backend health checks using the a7 CLI in API7 Enterprise Edition. Covers active health checks, passive health checks, comb…
#### a7-recipe-mtls
Recipe skill for configuring mutual TLS (mTLS) using the a7 CLI in API7 Enterprise Edition. Covers SSL certificate management, upstream mTLS to backend…
- [a7-recipe-mtls](https://docs.api7.ai/api7-gateway/ai-agent-skills/a7-recipe-mtls.md): Recipe skill for configuring mutual TLS (mTLS) using the a7 CLI in API7 Enterprise Edition. Covers SSL certificate management, upstream mTLS to backend…
#### a7-recipe-multi-tenant
Recipe skill for implementing multi-tenant patterns using API7 Enterprise Edition (API7 EE) and the a7 CLI. Covers gateway-group isolation, consumer pol…
- [a7-recipe-multi-tenant](https://docs.api7.ai/api7-gateway/ai-agent-skills/a7-recipe-multi-tenant.md): Recipe skill for implementing multi-tenant patterns using API7 Enterprise Edition (API7 EE) and the a7 CLI. Covers gateway-group isolation, consumer pol…
#### a7-shared
Core skill for working with the a7 CLI — the command-line tool for API7 Enterprise Edition. Provides project conventions, command patterns, dual-API arc…
- [a7 Shared Skill](https://docs.api7.ai/api7-gateway/ai-agent-skills/a7-shared.md): Core skill for working with the a7 CLI — the command-line tool for API7 Enterprise Edition. Provides project conventions, command patterns, dual-API arc…
### ai-gateway
#### get-started
Set up API7 AI Gateway and proxy your first request to OpenAI in under 5 minutes. Step-by-step guide with code examples.
- [Proxy Your First LLM Request in 5 Minutes](https://docs.api7.ai/api7-gateway/ai-gateway/get-started.md): Set up API7 AI Gateway and proxy your first request to OpenAI in under 5 minutes. Step-by-step guide with code examples.
#### llm-providers
- [Connect to Anthropic Claude](https://docs.api7.ai/api7-gateway/ai-gateway/llm-providers/anthropic.md): Route Anthropic Claude API traffic through API7 Gateway for centralized security, rate limiting, and observability.
- [Integrate Azure OpenAI Service](https://docs.api7.ai/api7-gateway/ai-gateway/llm-providers/azure-openai.md): Manage Azure OpenAI deployments through API7 Gateway. Handle resource names, API versions, and auth centrally.
- [Route Traffic to DeepSeek Models](https://docs.api7.ai/api7-gateway/ai-gateway/llm-providers/deepseek.md): Proxy DeepSeek API requests through API7 Gateway. Manage authentication, enable failover, and monitor usage centrally.
- [Integrate Google Gemini](https://docs.api7.ai/api7-gateway/ai-gateway/llm-providers/google-gemini.md): Proxy Google Gemini API requests through API7 Gateway. Manage API keys and monitor AI traffic centrally.
- [Route Traffic to OpenAI](https://docs.api7.ai/api7-gateway/ai-gateway/llm-providers/openai.md): Proxy and secure OpenAI API requests through API7 Gateway. Centralize authentication, enable failover, and monitor usage.
- [Connect Any OpenAI-Compatible LLM](https://docs.api7.ai/api7-gateway/ai-gateway/llm-providers/openai-compatible.md): Proxy any OpenAI-compatible API through API7 Gateway. Connect self-hosted models, custom endpoints, or niche providers.
- [Access Hundreds of LLMs via OpenRouter](https://docs.api7.ai/api7-gateway/ai-gateway/llm-providers/openrouter.md): Use OpenRouter with API7 AI Gateway to access 200+ LLMs through one API while maintaining enterprise security controls.
- [Route Enterprise AI Traffic to Vertex AI](https://docs.api7.ai/api7-gateway/ai-gateway/llm-providers/vertex-ai.md): Securely proxy Google Cloud Vertex AI requests through API7 Gateway with service account auth and regional routing.
#### overview
Centralize LLM access with API7 AI Gateway. Route traffic to multiple providers, enforce guardrails, and control costs from one platform.
- [Manage and Secure AI Traffic](https://docs.api7.ai/api7-gateway/ai-gateway/overview.md): Centralize LLM access with API7 AI Gateway. Route traffic to multiple providers, enforce guardrails, and control costs from one platform.
#### use-cases
- [Monitor AI Traffic and Track LLM Costs](https://docs.api7.ai/api7-gateway/ai-gateway/use-cases/ai-observability-and-cost-tracking.md): Gain visibility into LLM usage, token consumption, latency, and costs with API7 AI Gateway's observability features.
- [Transform API Requests with AI-Powered Rewriting](https://docs.api7.ai/api7-gateway/ai-gateway/use-cases/ai-request-transformation.md): Use LLMs to intelligently transform, enrich, or restructure API requests and responses at the gateway layer.
- [Enforce AI Guardrails and Protect PII](https://docs.api7.ai/api7-gateway/ai-gateway/use-cases/content-safety-and-guardrails.md): Block prompt injection, detect toxicity, and redact PII before requests reach LLMs using API7 AI Gateway guardrails.
- [Expose REST APIs as MCP Tools for AI Agents](https://docs.api7.ai/api7-gateway/ai-gateway/use-cases/expose-apis-as-mcp-tools.md): Convert existing OpenAPI services into MCP-compatible tools so AI agents can discover and invoke your APIs automatically.
- [Manage API7 Enterprise from an AI Client with API7-MCP](https://docs.api7.ai/api7-gateway/ai-gateway/use-cases/manage-api7-with-mcp.md): Deploy the API7-MCP server so an AI client such as Cursor, Claude Desktop, or Cline can read API7 Enterprise resources, check Prometheus metrics, manage RBAC, and send test traffic through the gateway.
- [Set Up Multi-LLM Routing and Automatic Fallback](https://docs.api7.ai/api7-gateway/ai-gateway/use-cases/multi-llm-routing-and-fallback.md): Route AI traffic across multiple LLM providers with weighted load balancing, automatic failover, and health checks.
- [Implement Prompt Templates and Decorators](https://docs.api7.ai/api7-gateway/ai-gateway/use-cases/prompt-engineering-and-templating.md): Standardize LLM interactions with reusable prompt templates and automatic system prompt injection using API7 AI Gateway.
- [Convert Anthropic Messages to OpenAI Chat Completions](https://docs.api7.ai/api7-gateway/ai-gateway/use-cases/protocol-conversion.md): Use API7 AI Gateway to transparently convert Anthropic Messages API requests to the OpenAI Chat Completions API format, enabling teams to use the Anthropic SDK with any OpenAI-compatible backend.
- [Implement RAG at the Gateway Layer](https://docs.api7.ai/api7-gateway/ai-gateway/use-cases/retrieval-augmented-generation.md): Enhance LLM responses with relevant context using Retrieval-Augmented Generation (RAG) built into API7 AI Gateway.
- [Control AI Costs with Token-Based Rate Limiting](https://docs.api7.ai/api7-gateway/ai-gateway/use-cases/token-rate-limiting-and-quota-management.md): Implement token-based rate limits to prevent LLM abuse and control AI costs per route and model instance.
### configure-and-manage
#### benchmark-on-aws-eks
Reproduce the published API7 Gateway performance benchmark on AWS EKS. Walkthrough covers EKS cluster setup, three isolated node groups, Helm install, NGINX upstream and wrk2 deployment, and running the full scenario suite.
- [Run Benchmarks on AWS EKS](https://docs.api7.ai/api7-gateway/configure-and-manage/benchmark-on-aws-eks.md): Reproduce the published API7 Gateway performance benchmark on AWS EKS. Walkthrough covers EKS cluster setup, three isolated node groups, Helm install, NGINX upstream and wrk2 deployment, and running the full scenario suite.
#### configure-control-plane
Detailed configuration reference for the API7 Gateway Control Plane, covering the Dashboard and DP Manager configuration files.
- [Configuration Reference for API7 Gateway Control Plane](https://docs.api7.ai/api7-gateway/configure-and-manage/configure-control-plane.md): Detailed configuration reference for the API7 Gateway Control Plane, covering the Dashboard and DP Manager configuration files.
#### configure-data-plane
Detailed configuration reference for API7 Gateway Data Plane, based on the config-default.yaml structure.
- [Configuration Reference for API7 Gateway Data Plane](https://docs.api7.ai/api7-gateway/configure-and-manage/configure-data-plane.md): Detailed configuration reference for API7 Gateway Data Plane, based on the config-default.yaml structure.
#### data-plane-resilience
Configure fallback storage for API7 Gateway data plane nodes so they can restart and continue operating during extended control plane outages.
- [Data Plane Resilience](https://docs.api7.ai/api7-gateway/configure-and-manage/data-plane-resilience.md): Configure fallback storage for API7 Gateway data plane nodes so they can restart and continue operating during extended control plane outages.
#### deployment-scenarios
- [Multiple Availability Zones Deployment of API7 Gateway](https://docs.api7.ai/api7-gateway/configure-and-manage/deployment-scenarios/multi-az-deployment.md): Configuration and architecture for deploying API7 Gateway across multiple availability zones for high availability and fault tolerance.
- [Multi-Region Deployment Patterns](https://docs.api7.ai/api7-gateway/configure-and-manage/deployment-scenarios/multi-region-deployment.md): Architecture and considerations for deploying API7 Gateway across multiple geographic regions for global reach and disaster recovery.
#### high-availability-data-plane
Design a highly available API7 Gateway data plane with multiple nodes, health checks, and load balancer failover.
- [Data Plane High Availability](https://docs.api7.ai/api7-gateway/configure-and-manage/high-availability-data-plane.md): Design a highly available API7 Gateway data plane with multiple nodes, health checks, and load balancer failover.
#### labels
Organize and filter API7 Gateway resources at scale with labels — key-value metadata attached to gateway groups, services, routes, consumers, and other entities for team, environment, and application-level segmentation.
- [Labels](https://docs.api7.ai/api7-gateway/configure-and-manage/labels.md): Organize and filter API7 Gateway resources at scale with labels — key-value metadata attached to gateway groups, services, routes, consumers, and other entities for team, environment, and application-level segmentation.
#### license-management
Manage your API7 Gateway license, understand the production and non-production core quotas and license states, and configure license file paths for automated deployment.
- [License Management](https://docs.api7.ai/api7-gateway/configure-and-manage/license-management.md): Manage your API7 Gateway license, understand the production and non-production core quotas and license states, and configure license file paths for automated deployment.
#### performance-benchmark
Published performance benchmark results for API7 Gateway (AWS EKS and single-host baselines), plus methodology and optimization guidance for running your own benchmarks accurately.
- [Performance Benchmark](https://docs.api7.ai/api7-gateway/configure-and-manage/performance-benchmark.md): Published performance benchmark results for API7 Gateway (AWS EKS and single-host baselines), plus methodology and optimization guidance for running your own benchmarks accurately.
#### production-best-practices
Operational best practices for managing API7 Gateway in production, including GitOps, change management, and disaster recovery.
- [Production Best Practices](https://docs.api7.ai/api7-gateway/configure-and-manage/production-best-practices.md): Operational best practices for managing API7 Gateway in production, including GitOps, change management, and disaster recovery.
#### run-in-production
Pre-production checklist and deployment guide for API7 Gateway to ensure a stable and secure production environment.
- [Running in Production](https://docs.api7.ai/api7-gateway/configure-and-manage/run-in-production.md): Pre-production checklist and deployment guide for API7 Gateway to ensure a stable and secure production environment.
#### scale-data-plane
Scale API7 Gateway data plane nodes horizontally to increase throughput and prepare for high-availability deployments.
- [Scale Data Plane](https://docs.api7.ai/api7-gateway/configure-and-manage/scale-data-plane.md): Scale API7 Gateway data plane nodes horizontally to increase throughput and prepare for high-availability deployments.
#### shared-dict-sizing
Size API7 Gateway shared memory zones for metrics, service discovery, the Developer Portal, and tracing so they do not overflow at your deployment's scale.
- [Shared Memory Sizing](https://docs.api7.ai/api7-gateway/configure-and-manage/shared-dict-sizing.md): Size API7 Gateway shared memory zones for metrics, service discovery, the Developer Portal, and tracing so they do not overflow at your deployment's scale.
#### telemetry-opt-out
Configure telemetry data transfer between the data plane and control plane, including compression levels and how to disable telemetry.
- [Optimize Telemetry Data Transfer](https://docs.api7.ai/api7-gateway/configure-and-manage/telemetry-opt-out.md): Configure telemetry data transfer between the data plane and control plane, including compression levels and how to disable telemetry.
#### user-management
Manage users, roles, and permission policies in API7 Enterprise.
- [User Management](https://docs.api7.ai/api7-gateway/configure-and-manage/user-management.md): Manage users, roles, and permission policies in API7 Enterprise.
### developer-portal
#### deploy
- [Configure the Developer Portal](https://docs.api7.ai/api7-gateway/developer-portal/deploy/configure-portal.md): Configure the Developer Portal settings, including public access, portal tokens, built-in authentication, and SCIM provisioning.
- [Customize the Developer Portal](https://docs.api7.ai/api7-gateway/developer-portal/deploy/customize-portal.md): Customize the Developer Portal branding, theme, authentication providers, and functionality using the API7 Developer Portal Boilerplate.
- [Deploy the Developer Portal](https://docs.api7.ai/api7-gateway/developer-portal/deploy/deploy-portal.md): Deploy the API7 Developer Portal with its two official images — the Portal API backend and the customer-facing frontend — on Docker Compose or Kubernetes, and connect them to your API7 control plane.
#### get-started
Start a local API7 Developer Portal from the packaged Docker Compose deployment, register a developer, and verify access to the API Hub.
- [Start a Local Developer Portal](https://docs.api7.ai/api7-gateway/developer-portal/get-started.md): Start a local API7 Developer Portal from the packaged Docker Compose deployment, register a developer, and verify access to the API Hub.
#### guides
- [Browse APIs](https://docs.api7.ai/api7-gateway/developer-portal/guides/browse-apis.md): Discover and explore available API products in the Developer Portal's API Hub.
- [Create an Application](https://docs.api7.ai/api7-gateway/developer-portal/guides/create-application.md): Create an application in the Developer Portal to group your API subscriptions and credentials.
- [Manage Credentials](https://docs.api7.ai/api7-gateway/developer-portal/guides/manage-credentials.md): Create, view, regenerate, and delete credentials in the Developer Portal for authenticating API requests.
- [Manage Your Organization](https://docs.api7.ai/api7-gateway/developer-portal/guides/manage-organization.md): Manage your organization in the Developer Portal, including inviting members, assigning roles, and switching between organizations.
- [Register and Log In](https://docs.api7.ai/api7-gateway/developer-portal/guides/register-and-login.md): Create a developer account and log in to the Developer Portal using email/password, SSO, or an organization invitation.
- [Subscribe to an API](https://docs.api7.ai/api7-gateway/developer-portal/guides/subscribe-to-api.md): Subscribe your application to an API product to gain access to consume APIs through the Developer Portal.
- [Try an API](https://docs.api7.ai/api7-gateway/developer-portal/guides/try-api.md): Test API endpoints directly from the Developer Portal using the built-in Try It Out feature.
#### key-concepts
- [API Products](https://docs.api7.ai/api7-gateway/developer-portal/key-concepts/api-products.md): Understand API products in the Developer Portal, including product types, visibility settings, authentication options, and the publishing lifecycle.
- [Applications](https://docs.api7.ai/api7-gateway/developer-portal/key-concepts/applications.md): Understand applications in the Developer Portal, which group subscriptions and credentials for a specific project or use case.
- [Credentials](https://docs.api7.ai/api7-gateway/developer-portal/key-concepts/credentials.md): Understand credentials in the Developer Portal, including supported authentication types (key auth, basic auth, OAuth/DCR) and credential lifecycle management.
- [Developers](https://docs.api7.ai/api7-gateway/developer-portal/key-concepts/developers.md): Understand developers in the Developer Portal, including registration methods, account states, and the difference between developers and consumers.
- [Subscriptions](https://docs.api7.ai/api7-gateway/developer-portal/key-concepts/subscriptions.md): Understand subscriptions in the Developer Portal, including the approval workflow, status transitions, and auto-approval configuration.
#### manage
- [Configure Dynamic Client Registration (DCR)](https://docs.api7.ai/api7-gateway/developer-portal/manage/configure-dcr.md): Configure DCR providers to enable developers to register OAuth 2.0 clients through the Developer Portal.
- [Configure SCIM Provisioning for a Custom Developer Portal with Okta](https://docs.api7.ai/api7-gateway/developer-portal/manage/configure-scim.md): Configure SCIM provisioning with Okta for a custom Developer Portal based on the API7 Developer Portal Boilerplate.
- [Configure SSO for the Developer Portal](https://docs.api7.ai/api7-gateway/developer-portal/manage/configure-sso.md): Configure Single Sign-On (SSO) for the Developer Portal using OIDC, SAML, LDAP, or CAS identity providers.
- [Manage API Products](https://docs.api7.ai/api7-gateway/developer-portal/manage/manage-api-products.md): Create, configure, publish, and manage API products in the Provider Portal for developer consumption through the Developer Portal.
- [Manage Applications](https://docs.api7.ai/api7-gateway/developer-portal/manage/manage-applications.md): Manage developer applications in the Developer Portal, including lifecycle, structure, and how to call the Developer Portal backend programmatically.
- [Manage Developers](https://docs.api7.ai/api7-gateway/developer-portal/manage/manage-developers.md): Manage developer accounts using the Provider Portal Admin API and the standalone Developer Portal backend, including listing, creating, approving registrations, and deleting developers.
- [Manage Subscriptions](https://docs.api7.ai/api7-gateway/developer-portal/manage/manage-subscriptions.md): Manage API product subscriptions in the Provider Portal, including approving, rejecting, and cancelling subscription requests.
#### overview
Learn about the API7 Developer Portal, a platform for API providers to publish API products and for developers to discover, subscribe to, and consume APIs.
- [Developer Portal Overview](https://docs.api7.ai/api7-gateway/developer-portal/overview.md): Learn about the API7 Developer Portal, a platform for API providers to publish API products and for developers to discover, subscribe to, and consume APIs.
### enterprise-features
#### alerts-and-contact-points
Explore the concept of alerts and contact points in API7 Gateway, which monitor exceptions and send timely notifications.
- [Alerts and Contact Points](https://docs.api7.ai/api7-gateway/enterprise-features/alerts-and-contact-points.md): Explore the concept of alerts and contact points in API7 Gateway, which monitor exceptions and send timely notifications.
#### anonymous-consumers
Explore the concept of anonymous consumers in API7 Gateway, allowing non-authenticated access to APIs while maintaining security.
- [Anonymous Consumers](https://docs.api7.ai/api7-gateway/enterprise-features/anonymous-consumers.md): Explore the concept of anonymous consumers in API7 Gateway, allowing non-authenticated access to APIs while maintaining security.
#### api-portal
Explore the concept of the API portal in API7 Gateway, providing a centralized space for developers to access and manage APIs.
- [API Portal](https://docs.api7.ai/api7-gateway/enterprise-features/api-portal.md): Explore the concept of the API portal in API7 Gateway, providing a centralized space for developers to access and manage APIs.
#### audit-logging
Explore audit logging in API7 Gateway, including how user actions and configuration changes are recorded.
- [Audit Logging](https://docs.api7.ai/api7-gateway/enterprise-features/audit-logging.md): Explore audit logging in API7 Gateway, including how user actions and configuration changes are recorded.
#### compliance
Explore the concept of compliance in API7 Gateway, helping organizations meet regulatory requirements and maintain security standards.
- [Compliance](https://docs.api7.ai/api7-gateway/enterprise-features/compliance.md): Explore the concept of compliance in API7 Gateway, helping organizations meet regulatory requirements and maintain security standards.
#### credentials
Explore the concept of credentials in API7 Gateway, authenticating users and ensuring secure access while facilitating management and rotation.
- [Credentials](https://docs.api7.ai/api7-gateway/enterprise-features/credentials.md): Explore the concept of credentials in API7 Gateway, authenticating users and ensuring secure access while facilitating management and rotation.
#### custom-plugins
Explore the concept of custom plugins in API7 Gateway, enabling tailored extensions to meet specific business needs.
- [Custom Plugins](https://docs.api7.ai/api7-gateway/enterprise-features/custom-plugins.md): Explore the concept of custom plugins in API7 Gateway, enabling tailored extensions to meet specific business needs.
#### dashboard-sso
Explore the concept of Single Sign-On (SSO) in API7 Gateway, allowing users to authenticate with existing credentials for easy access.
- [Dashboard SSO Options](https://docs.api7.ai/api7-gateway/enterprise-features/dashboard-sso.md): Explore the concept of Single Sign-On (SSO) in API7 Gateway, allowing users to authenticate with existing credentials for easy access.
#### gateway-groups
Explore the concept of gateway groups in API7 Gateway, which manage multiple API gateway instances with shared configurations.
- [Gateway Groups](https://docs.api7.ai/api7-gateway/enterprise-features/gateway-groups.md): Explore the concept of gateway groups in API7 Gateway, which manage multiple API gateway instances with shared configurations.
#### high-availability
Explore the concept of high availability in API7 Gateway, ensuring continuous service delivery for mission-critical applications.
- [High Availability](https://docs.api7.ai/api7-gateway/enterprise-features/high-availability.md): Explore the concept of high availability in API7 Gateway, ensuring continuous service delivery for mission-critical applications.
#### organization-and-rbac
Explore the concept of organization management and RBAC in API7 Gateway, enabling fine-grained permission management.
- [Organization and RBAC](https://docs.api7.ai/api7-gateway/enterprise-features/organization-and-rbac.md): Explore the concept of organization management and RBAC in API7 Gateway, enabling fine-grained permission management.
#### overview
Discover the enterprise-grade features that distinguish API7 Gateway from open-source Apache APISIX, including centralized management, RBAC, audit logging, and professional support.
- [Enterprise Features Overview](https://docs.api7.ai/api7-gateway/enterprise-features/overview.md): Discover the enterprise-grade features that distinguish API7 Gateway from open-source Apache APISIX, including centralized management, RBAC, audit logging, and professional support.
#### permission-policies-and-boundaries
Explore the concept of permission policies and boundaries in API7 Gateway, defining user access levels for enhanced security.
- [Permission Policies and Boundaries](https://docs.api7.ai/api7-gateway/enterprise-features/permission-policies-and-boundaries.md): Explore the concept of permission policies and boundaries in API7 Gateway, defining user access levels for enhanced security.
#### secret-providers
Explore the concept of secret providers in API7 Gateway, which enhance security by storing sensitive data using third-party tools.
- [Secret Providers](https://docs.api7.ai/api7-gateway/enterprise-features/secret-providers.md): Explore the concept of secret providers in API7 Gateway, which enhance security by storing sensitive data using third-party tools.
#### security-hardening
Explore the concept of security hardening in API7 Gateway, designed to protect API infrastructure against threats and vulnerabilities.
- [Security Hardening](https://docs.api7.ai/api7-gateway/enterprise-features/security-hardening.md): Explore the concept of security hardening in API7 Gateway, designed to protect API infrastructure against threats and vulnerabilities.
### getting-started
#### learn-more
Understand the API7 product family, the relationship between API7 Enterprise and Apache APISIX, and how they fit into your API management strategy.
- [Learn More About API7 Products and APISIX](https://docs.api7.ai/api7-gateway/getting-started/learn-more.md): Understand the API7 product family, the relationship between API7 Enterprise and Apache APISIX, and how they fit into your API management strategy.
#### management-options
Compare the API7 Gateway Dashboard, Admin API, ADC, a7 CLI, and API7-MCP for interactive operations, automation, GitOps, and AI clients.
- [Management Options](https://docs.api7.ai/api7-gateway/getting-started/management-options.md): Compare the API7 Gateway Dashboard, Admin API, ADC, a7 CLI, and API7-MCP for interactive operations, automation, GitOps, and AI clients.
#### overview
Get started with API7 Gateway. Understand the platform components, how they work together, and choose the right path for your use case.
- [API7 Gateway Overview](https://docs.api7.ai/api7-gateway/getting-started/overview.md): Get started with API7 Gateway. Understand the platform components, how they work together, and choose the right path for your use case.
#### quick-start
Get API7 Gateway running locally with Docker Compose and proxy your first API request in under 10 minutes.
- [Quick Start](https://docs.api7.ai/api7-gateway/getting-started/quick-start.md): Get API7 Gateway running locally with Docker Compose and proxy your first API request in under 10 minutes.
#### tutorial-proxying-api-requests
A hands-on tutorial that walks you through proxying API requests, adding authentication with Key Auth, and enabling rate limiting with the Limit Count plugin.
- [Tutorial: Proxying and Managing API Requests via Plugins](https://docs.api7.ai/api7-gateway/getting-started/tutorial-proxying-api-requests.md): A hands-on tutorial that walks you through proxying API requests, adding authentication with Key Auth, and enabling rate limiting with the Limit Count plugin.
### how-to-guides
#### api-security
- [Configure Basic Authentication](https://docs.api7.ai/api7-gateway/how-to-guides/api-security/basic-auth.md): Learn how to secure your APIs by requiring clients to provide a standard username and password in the HTTP Authorization header.
- [Configure Data Masking](https://docs.api7.ai/api7-gateway/how-to-guides/api-security/data-masking.md): Use the data-mask plugin to redact, replace, or remove sensitive fields from request data before it is written to access logs and logger plugin output, helping you meet GDPR, HIPAA, and PCI-DSS requirements.
- [Forward External Auth User Info to Upstream](https://docs.api7.ai/api7-gateway/how-to-guides/api-security/forward-auth-user-info.md): Forward authenticated user information from OpenID Connect or SAML routes to upstream services as request headers or the consumer name.
- [Configure HMAC Authentication](https://docs.api7.ai/api7-gateway/how-to-guides/api-security/hmac-auth.md): Learn how to secure your APIs with Hash-based Message Authentication Code (HMAC) for request signing in API7 Enterprise.
- [Configure JWT Authentication](https://docs.api7.ai/api7-gateway/how-to-guides/api-security/jwt-auth.md): Learn how to secure your APIs using JSON Web Tokens (JWT) for stateless authentication in API7 Enterprise.
- [Configure Key Authentication](https://docs.api7.ai/api7-gateway/how-to-guides/api-security/key-auth.md): Learn how to secure your APIs by requiring clients to provide a unique API key in the request header or query string.
#### ops
- [Configure Readiness and Liveness Probes](https://docs.api7.ai/api7-gateway/how-to-guides/ops/configure-readiness-probe.md): Configure readiness and liveness checks for API7 Gateway data planes in Kubernetes, Docker, and other non-Helm deployments.
- [Create a Custom Role](https://docs.api7.ai/api7-gateway/how-to-guides/ops/create-custom-role.md): Create a custom role in API7 Gateway by defining permission policies, attaching them to a role, and assigning the role to a user.
- [Design a Custom Role System](https://docs.api7.ai/api7-gateway/how-to-guides/ops/design-custom-role-system.md): Design a scalable custom role system in API7 Gateway by combining roles, permission policies, labels, and permission boundaries.
- [Manage Gateway Groups](https://docs.api7.ai/api7-gateway/how-to-guides/ops/multi-gateway-group.md): Learn how to create and manage multiple gateway groups to organize and isolate API traffic across environments or teams.
- [Configure Secret Management](https://docs.api7.ai/api7-gateway/how-to-guides/ops/secret-manager.md): Learn how to configure secret providers and reference external secrets in API7 Enterprise without hardcoding sensitive values in gateway resources.
#### overview
Practical how-to guides for common API7 Gateway tasks and workflows.
- [How-To Guides](https://docs.api7.ai/api7-gateway/how-to-guides/overview.md): Practical how-to guides for common API7 Gateway tasks and workflows.
#### plugin-development
- [Plugin Development Best Practices](https://docs.api7.ai/api7-gateway/how-to-guides/plugin-development/best-practices.md): Write custom Lua plugins that are correct, fast, and maintainable by using the built-in core library instead of low-level OpenResty APIs, validating configuration with a schema, and choosing the right phase and priority.
- [Develop Custom Lua Plugins](https://docs.api7.ai/api7-gateway/how-to-guides/plugin-development/custom-lua-plugins.md): Learn how to develop, register, and test custom Lua plugins for API7 Gateway.
- [Serverless Functions or Custom Plugins](https://docs.api7.ai/api7-gateway/how-to-guides/plugin-development/serverless-or-custom-plugins.md): Compare the built-in serverless-function plugins with custom Lua plugins, and choose the right way to run your own Lua logic in API7 Gateway.
#### protocol-proxy
- [Configure GraphQL Proxying](https://docs.api7.ai/api7-gateway/how-to-guides/protocol-proxy/graphql-proxy.md): Learn how to proxy GraphQL APIs through API7 Gateway and when to add GraphQL-aware plugins for rate limiting and caching.
- [Configure gRPC Proxying](https://docs.api7.ai/api7-gateway/how-to-guides/protocol-proxy/grpc-proxy.md): Learn how to configure API7 Enterprise to proxy gRPC traffic, including REST-to-gRPC transcoding and gRPC-Web support for browser clients.
- [Configure TCP/UDP Proxying](https://docs.api7.ai/api7-gateway/how-to-guides/protocol-proxy/tcp-udp-proxy.md): Configure API7 Gateway to proxy TCP and UDP (Layer 4) traffic to upstream services such as databases, message queues, and custom protocols.
- [Configure WebSocket Proxying](https://docs.api7.ai/api7-gateway/how-to-guides/protocol-proxy/websocket-proxy.md): Learn how to enable and configure WebSocket proxying for your routes in API7 Enterprise to handle long-lived, bidirectional connections.
#### traffic-management
- [Implement Blue-Green Deployment](https://docs.api7.ai/api7-gateway/how-to-guides/traffic-management/blue-green-deployment.md): Implement blue-green deployments using API7 Gateway to switch traffic between two upstream environments with zero downtime.
- [Implement Canary Release](https://docs.api7.ai/api7-gateway/how-to-guides/traffic-management/canary-release.md): Learn how to gradually shift traffic to a new version of your backend service using the traffic-split plugin.
- [Configure CORS](https://docs.api7.ai/api7-gateway/how-to-guides/traffic-management/cors.md): Learn how to configure Cross-Origin Resource Sharing (CORS) for your APIs to allow or restrict access from different domains.
- [Configure Fault Injection](https://docs.api7.ai/api7-gateway/how-to-guides/traffic-management/fault-injection.md): Learn how to test the resilience of your application by injecting HTTP errors and response delays.
- [Conditionally Disable Global Plugins](https://docs.api7.ai/api7-gateway/how-to-guides/traffic-management/global-plugin-exemption.md): Conditionally skip global plugin execution for specific routes using route labels and the _meta.filter mechanism.
- [Configure Upstream Health Checks](https://docs.api7.ai/api7-gateway/how-to-guides/traffic-management/health-check.md): Learn how to configure active and passive health checks for upstream services to ensure high availability.
- [Configure Proxy Cache](https://docs.api7.ai/api7-gateway/how-to-guides/traffic-management/proxy-cache.md): Learn how to improve API performance and reduce upstream load by caching responses at the Gateway.
- [Configure Proxy Mirror](https://docs.api7.ai/api7-gateway/how-to-guides/traffic-management/proxy-mirror.md): Learn how to duplicate and send a percentage of real production traffic to a secondary service for testing and verification.
- [Rewrite Proxy Requests](https://docs.api7.ai/api7-gateway/how-to-guides/traffic-management/proxy-rewrite.md): Learn how to modify request URIs, methods, and headers before proxying them to upstream services.
- [Configure Rate Limiting](https://docs.api7.ai/api7-gateway/how-to-guides/traffic-management/rate-limiting.md): Learn how to configure simple and advanced rate limiting for your APIs to prevent abuse and ensure fair usage.
- [Improve Rate Limiting Accuracy Across Gateway Instances](https://docs.api7.ai/api7-gateway/how-to-guides/traffic-management/rate-limiting-accuracy.md): Understand where rate limiting error comes from when counter synchronization is batched across gateway instances, and why sliding windows keep the long-term error near zero.
- [Configure Response Rewrite](https://docs.api7.ai/api7-gateway/how-to-guides/traffic-management/response-rewrite.md): Learn how to modify response status codes, headers, and body content before they are returned to the client.
### install
#### deploy-high-availability
Deploy API7 Gateway control plane and data plane in a high-availability configuration to eliminate single points of failure.
- [Deploy for High Availability](https://docs.api7.ai/api7-gateway/install/deploy-high-availability.md): Deploy API7 Gateway control plane and data plane in a high-availability configuration to eliminate single points of failure.
#### deploy-on-kubernetes
Deploy API7 Enterprise on Kubernetes using Helm, including control plane setup, data plane configuration with mTLS, and cloud-specific guidance for AWS EKS, GCP GKE, and Azure AKS.
- [Deploy on Kubernetes](https://docs.api7.ai/api7-gateway/install/deploy-on-kubernetes.md): Deploy API7 Enterprise on Kubernetes using Helm, including control plane setup, data plane configuration with mTLS, and cloud-specific guidance for AWS EKS, GCP GKE, and Azure AKS.
#### deploy-on-openshift
Deploy API7 Gateway on Red Hat OpenShift with proper Security Context Constraints (SCCs), service accounts, and Helm chart configuration.
- [Deploy on OpenShift](https://docs.api7.ai/api7-gateway/install/deploy-on-openshift.md): Deploy API7 Gateway on Red Hat OpenShift with proper Security Context Constraints (SCCs), service accounts, and Helm chart configuration.
#### deploy-with-docker-compose
Install a complete API7 Gateway stack with Docker Compose using an online quickstart script, an offline bundle, or a customizable manual deployment.
- [Deploy with Docker Compose](https://docs.api7.ai/api7-gateway/install/deploy-with-docker-compose.md): Install a complete API7 Gateway stack with Docker Compose using an online quickstart script, an offline bundle, or a customizable manual deployment.
#### deploy-with-rpm
Deploy API7 Enterprise on Red Hat-family systems (RHEL, Rocky Linux, AlmaLinux, and CentOS 8 and 9) from the offline RPM bundle, fully air-gapped and managed by systemd.
- [Deploy with the Offline RPM Bundle](https://docs.api7.ai/api7-gateway/install/deploy-with-rpm.md): Deploy API7 Enterprise on Red Hat-family systems (RHEL, Rocky Linux, AlmaLinux, and CentOS 8 and 9) from the offline RPM bundle, fully air-gapped and managed by systemd.
#### installation-faq
Frequently asked questions and troubleshooting common installation issues.
- [Installation FAQ](https://docs.api7.ai/api7-gateway/install/installation-faq.md): Frequently asked questions and troubleshooting common installation issues.
#### installation-packages
Container images, Helm charts, and CLI tools used to install API7 Enterprise — including the official Docker Hub repositories for the gateway, DP manager, Developer Portal, and integrated control plane images.
- [Installation Packages](https://docs.api7.ai/api7-gateway/install/installation-packages.md): Container images, Helm charts, and CLI tools used to install API7 Enterprise — including the official Docker Hub repositories for the gateway, DP manager, Developer Portal, and integrated control plane images.
#### overview
Compare Kubernetes, Docker Compose, and package-based deployment options for API7 Gateway across production, evaluation, and air-gapped environments.
- [Install API7 Gateway On-Premises](https://docs.api7.ai/api7-gateway/install/overview.md): Compare Kubernetes, Docker Compose, and package-based deployment options for API7 Gateway across production, evaluation, and air-gapped environments.
#### rpm-from-docker
When the Dashboard does not yet generate an RPM data-plane script, extract the connection parameters from the Docker script to onboard an api7-gateway RPM.
- [Deploy an RPM Data Plane from a Docker Script](https://docs.api7.ai/api7-gateway/install/rpm-from-docker.md): When the Dashboard does not yet generate an RPM data-plane script, extract the connection parameters from the Docker script to onboard an api7-gateway RPM.
#### rpm-quickstart
Bring up an API7 Enterprise control plane on a single host in minutes with the bundled quickstart.sh for evaluation and PoC.
- [Single-Host RPM Evaluation Quickstart](https://docs.api7.ai/api7-gateway/install/rpm-quickstart.md): Bring up an API7 Enterprise control plane on a single host in minutes with the bundled quickstart.sh for evaluation and PoC.
#### supported-versions-and-interoperability
Version compatibility matrix for API7 Enterprise components and infrastructure.
- [Supported Versions and Interoperability](https://docs.api7.ai/api7-gateway/install/supported-versions-and-interoperability.md): Version compatibility matrix for API7 Enterprise components and infrastructure.
#### system-requirements
Hardware, operating system, and network requirements for installing API7 Gateway.
- [System Requirements](https://docs.api7.ai/api7-gateway/install/system-requirements.md): Hardware, operating system, and network requirements for installing API7 Gateway.
### key-concepts
#### architecture
Deep dive into the decoupled control plane and data plane architecture of API7 Enterprise.
- [Architecture](https://docs.api7.ai/api7-gateway/key-concepts/architecture.md): Deep dive into the decoupled control plane and data plane architecture of API7 Enterprise.
#### consumers-and-credentials
Identity management and authentication using Consumers and Credentials.
- [Consumers and Credentials](https://docs.api7.ai/api7-gateway/key-concepts/consumers-and-credentials.md): Identity management and authentication using Consumers and Credentials.
#### gateway-groups
Logical grouping of data plane instances for environment isolation and configuration management.
- [Gateway Groups](https://docs.api7.ai/api7-gateway/key-concepts/gateway-groups.md): Logical grouping of data plane instances for environment isolation and configuration management.
#### overview
Introduction to the core abstractions and entities in API7 Enterprise.
- [Key Concepts Overview](https://docs.api7.ai/api7-gateway/key-concepts/overview.md): Introduction to the core abstractions and entities in API7 Enterprise.
#### plugins
Modular components to intercept and modify API traffic in API7 Gateway.
- [Plugins](https://docs.api7.ai/api7-gateway/key-concepts/plugins.md): Modular components to intercept and modify API traffic in API7 Gateway.
#### service-discovery
Dynamic upstream resolution in API7 Gateway — automatically discover backend endpoints from Kubernetes Services, Nacos, and Consul registries without hardcoding IPs.
- [Service Discovery](https://docs.api7.ai/api7-gateway/key-concepts/service-discovery.md): Dynamic upstream resolution in API7 Gateway — automatically discover backend endpoints from Kubernetes Services, Nacos, and Consul registries without hardcoding IPs.
#### services-and-routes
Understand how to group and route API traffic using Services and Routes.
- [Services and Routes](https://docs.api7.ai/api7-gateway/key-concepts/services-and-routes.md): Understand how to group and route API traffic using Services and Routes.
#### ssl-certificates
Understanding how API7 Gateway manages SSL/TLS certificates and terminates secure connections.
- [SSL Certificates](https://docs.api7.ai/api7-gateway/key-concepts/ssl-certificates.md): Understanding how API7 Gateway manages SSL/TLS certificates and terminates secure connections.
#### stream-routes
Understand stream routes in API7 Gateway for proxying TCP and UDP (Layer 4) traffic, including matching rules, supported plugins, and the relationship with stream services.
- [Stream Routes](https://docs.api7.ai/api7-gateway/key-concepts/stream-routes.md): Understand stream routes in API7 Gateway for proxying TCP and UDP (Layer 4) traffic, including matching rules, supported plugins, and the relationship with stream services.
#### upstreams-and-load-balancing
Definitions of backend targets, including load balancing algorithms and health checks.
- [Upstreams and Load Balancing](https://docs.api7.ai/api7-gateway/key-concepts/upstreams-and-load-balancing.md): Definitions of backend targets, including load balancing algorithms and health checks.
### observability
#### alerts
Configure alert policies and contact points in API7 Gateway to get notified by email or webhook when gateway instances go offline, certificates expire, or error rates breach a threshold.
- [Configure Alerts](https://docs.api7.ai/api7-gateway/observability/alerts.md): Configure alert policies and contact points in API7 Gateway to get notified by email or webhook when gateway instances go offline, certificates expire, or error rates breach a threshold.
#### consumer-label-based-logging
Include consumer labels in API7 Gateway access logs for per-consumer traffic tracking and analysis.
- [Include Consumer Labels in Access Logs](https://docs.api7.ai/api7-gateway/observability/consumer-label-based-logging.md): Include consumer labels in API7 Gateway access logs for per-consumer traffic tracking and analysis.
#### debug-sessions
Find out exactly what the gateway did to a single request — which plugins ran, in what order, which one was slow, and what it logged. Capture on demand, or automatically when an alert fires.
- [Capture Request Traces with Debug Sessions](https://docs.api7.ai/api7-gateway/observability/debug-sessions.md): Find out exactly what the gateway did to a single request — which plugins ran, in what order, which one was slow, and what it logged. Capture on demand, or automatically when an alert fires.
#### external-prometheus
Point API7 Gateway at an existing external Prometheus and remove the bundled instance from a Docker Compose deployment, keeping the Dashboard Monitoring page working throughout.
- [Use an Existing Prometheus](https://docs.api7.ai/api7-gateway/observability/external-prometheus.md): Point API7 Gateway at an existing external Prometheus and remove the bundled instance from a Docker Compose deployment, keeping the Dashboard Monitoring page working throughout.
#### kubernetes-error-log-forwarding
Forward API7 Gateway error logs from Kubernetes to Splunk by using the Splunk OpenTelemetry Collector.
- [Send Kubernetes Error Logs to Splunk](https://docs.api7.ai/api7-gateway/observability/kubernetes-error-log-forwarding.md): Forward API7 Gateway error logs from Kubernetes to Splunk by using the Splunk OpenTelemetry Collector.
#### kubernetes-log-collection
Collect API7 Gateway access and error logs on Kubernetes with the OpenTelemetry Collector or Filebeat, either from container output or from log files written inside the pod.
- [Collect Gateway Logs on Kubernetes](https://docs.api7.ai/api7-gateway/observability/kubernetes-log-collection.md): Collect API7 Gateway access and error logs on Kubernetes with the OpenTelemetry Collector or Filebeat, either from container output or from log files written inside the pod.
#### logging
Understand the access and error logs that API7 Gateway produces, how to configure their format and verbosity, and how to forward them to a centralized log management system.
- [Configure Centralized Logging](https://docs.api7.ai/api7-gateway/observability/logging.md): Understand the access and error logs that API7 Gateway produces, how to configure their format and verbosity, and how to forward them to a centralized log management system.
#### metrics
Monitor API7 Gateway metrics via the built-in Dashboard page or by scraping the Prometheus endpoint exposed by the data plane.
- [Monitor Metrics](https://docs.api7.ai/api7-gateway/observability/metrics.md): Monitor API7 Gateway metrics via the built-in Dashboard page or by scraping the Prometheus endpoint exposed by the data plane.
#### splunk-integration
Send API7 Gateway access logs to Splunk using the HTTP Event Collector (HEC) logging plugin.
- [Send Access Logs to Splunk](https://docs.api7.ai/api7-gateway/observability/splunk-integration.md): Send API7 Gateway access logs to Splunk using the HTTP Event Collector (HEC) logging plugin.
#### tracing
Enable distributed tracing in API7 Gateway with the OpenTelemetry plugin. Configure the OTLP collector, sampling strategy, and per-route spans to visualize request flows and analyze latency bottlenecks.
- [Configure Distributed Tracing](https://docs.api7.ai/api7-gateway/observability/tracing.md): Enable distributed tracing in API7 Gateway with the OpenTelemetry plugin. Configure the OTLP collector, sampling strategy, and per-route spans to visualize request flows and analyze latency bottlenecks.
### overview
Discover API7 Gateway, a dynamic, high-performance API gateway for cloud-native environments, built on Apache APISIX. Learn about its architecture, features, and deployment models.
- [API7 Gateway](https://docs.api7.ai/api7-gateway/overview.md): Discover API7 Gateway, a dynamic, high-performance API gateway for cloud-native environments, built on Apache APISIX. Learn about its architecture, features, and deployment models.
### release-notes
Review the latest updates, features, improvements, and bug fixes for each version of API7 Gateway in release notes.
- [API7 Gateway Release Notes](https://docs.api7.ai/api7-gateway/release-notes.md): Review the latest updates, features, improvements, and bug fixes for each version of API7 Gateway in release notes.
### scalability
#### autoscale-on-kubernetes
Autoscale API7 Gateway data plane pods on Kubernetes with a Horizontal Pod Autoscaler (HPA) to handle changing traffic automatically.
- [Autoscale Data Plane on Kubernetes](https://docs.api7.ai/api7-gateway/scalability/autoscale-on-kubernetes.md): Autoscale API7 Gateway data plane pods on Kubernetes with a Horizontal Pod Autoscaler (HPA) to handle changing traffic automatically.
### security-and-compliance
#### access-control-lists
Restrict API access using the consumer-restriction plugin in API7 Gateway. Configure allowlists and denylists keyed by consumer name, consumer group ID, service ID, or route ID for granular security.
- [Access Control Lists (ACLs)](https://docs.api7.ai/api7-gateway/security-and-compliance/access-control-lists.md): Restrict API access using the consumer-restriction plugin in API7 Gateway. Configure allowlists and denylists keyed by consumer name, consumer group ID, service ID, or route ID for granular security.
#### audit-logs
Track all administrative changes in the API7 Control Plane with detailed audit logs. Learn how to review, manage, and export audit trails for security and compliance.
- [Audit Logs](https://docs.api7.ai/api7-gateway/security-and-compliance/audit-logs.md): Track all administrative changes in the API7 Control Plane with detailed audit logs. Learn how to review, manage, and export audit trails for security and compliance.
#### authenticate
- [Client mTLS Authentication](https://docs.api7.ai/api7-gateway/security-and-compliance/authenticate/client-mtls.md): Configure mutual TLS (mTLS) on API7 Gateway to authenticate API clients with X.509 certificates before allowing access to your APIs.
- [Mutual TLS between Control Plane and Data Plane](https://docs.api7.ai/api7-gateway/security-and-compliance/authenticate/mutual-tls-cp-dp.md): Learn how API7 Gateway uses a robust, PKI-based mutual TLS (mTLS) model to secure all communication between the Control Plane and Data Plane.
- [SCIM Provisioning for Dashboard](https://docs.api7.ai/api7-gateway/security-and-compliance/authenticate/scim.md): Configure SCIM provisioning for API7 Gateway Dashboard with supported identity providers.
- [SCIM Provisioning with Microsoft Entra ID](https://docs.api7.ai/api7-gateway/security-and-compliance/authenticate/scim-microsoft-entra-id.md): Configure SCIM provisioning with Microsoft Entra ID for API7 Gateway Dashboard.
- [SCIM Provisioning with Okta](https://docs.api7.ai/api7-gateway/security-and-compliance/authenticate/scim-okta.md): Configure SCIM provisioning with Okta for API7 Gateway Dashboard.
- [Upstream mTLS](https://docs.api7.ai/api7-gateway/security-and-compliance/authenticate/upstream-mtls.md): Configure mutual TLS (mTLS) between API7 Gateway and upstream services so the gateway presents a client certificate to the upstream and optionally validates the upstream's server certificate.
#### ip-restrictions-control-plane
Restrict which client IP addresses can reach the API7 Control Plane (Dashboard and Admin API) using the Control Plane's built-in IP allow list, with complementary network-level controls for defence in depth.
- [IP Restrictions for Control Plane](https://docs.api7.ai/api7-gateway/security-and-compliance/ip-restrictions-control-plane.md): Restrict which client IP addresses can reach the API7 Control Plane (Dashboard and Admin API) using the Control Plane's built-in IP allow list, with complementary network-level controls for defence in depth.
#### oauth-oidc
Secure your APIs with modern token-based authentication. Learn how to integrate API7 Gateway with OAuth 2.0 and OpenID Connect (OIDC) providers like Okta and Keycloak.
- [OAuth 2.0 and OIDC](https://docs.api7.ai/api7-gateway/security-and-compliance/oauth-oidc.md): Secure your APIs with modern token-based authentication. Learn how to integrate API7 Gateway with OAuth 2.0 and OpenID Connect (OIDC) providers like Okta and Keycloak.
#### open-source-licenses
API7 Gateway's commitment to open-source software and license compliance. Review the major open-source components used and their respective licenses.
- [Open Source Licenses](https://docs.api7.ai/api7-gateway/security-and-compliance/open-source-licenses.md): API7 Gateway's commitment to open-source software and license compliance. Review the major open-source components used and their respective licenses.
#### overview
Learn how API7 Gateway provides comprehensive security and compliance features to protect your APIs, including authentication, authorization, encryption, and auditing capabilities.
- [Security and Compliance Overview](https://docs.api7.ai/api7-gateway/security-and-compliance/overview.md): Learn how API7 Gateway provides comprehensive security and compliance features to protect your APIs, including authentication, authorization, encryption, and auditing capabilities.
#### permission-policies-and-boundaries
Author permission policies in API7 Gateway using the native JSON document format. Learn the statement structure, allowed actions, ARN-style resources, label-based conditions, and how permission boundaries enforce maximum allowable permissions.
- [Permission Policies and Boundaries](https://docs.api7.ai/api7-gateway/security-and-compliance/permission-policies-and-boundaries.md): Author permission policies in API7 Gateway using the native JSON document format. Learn the statement structure, allowed actions, ARN-style resources, label-based conditions, and how permission boundaries enforce maximum allowable permissions.
#### role-based-access-control
Manage user access to the API7 Gateway control plane with Role-Based Access Control. Assign users to roles, attach permission policies, and enforce least-privilege access across gateway groups.
- [Role-Based Access Control (RBAC)](https://docs.api7.ai/api7-gateway/security-and-compliance/role-based-access-control.md): Manage user access to the API7 Gateway control plane with Role-Based Access Control. Assign users to roles, attach permission policies, and enforce least-privilege access across gateway groups.
#### secure-credentials
Protect your sensitive information with API7 Gateway's secure credentials management. Learn how to manage SSL certificates and integrate with external secret managers like HashiCorp Vault.
- [Secure Credentials Management](https://docs.api7.ai/api7-gateway/security-and-compliance/secure-credentials.md): Protect your sensitive information with API7 Gateway's secure credentials management. Learn how to manage SSL certificates and integrate with external secret managers like HashiCorp Vault.
#### sso-dashboard
Centralize user access to the API7 Dashboard using Single Sign-On (SSO). Supports OIDC, SAML, LDAP, and CAS protocols with automatic role mapping.
- [SSO for Dashboard](https://docs.api7.ai/api7-gateway/security-and-compliance/sso-dashboard.md): Centralize user access to the API7 Dashboard using Single Sign-On (SSO). Supports OIDC, SAML, LDAP, and CAS protocols with automatic role mapping.
#### sso-ldap
Configure Single Sign-On (SSO) for the API7 Dashboard using LDAP, allowing users to authenticate with their existing directory service credentials.
- [SSO with LDAP](https://docs.api7.ai/api7-gateway/security-and-compliance/sso-ldap.md): Configure Single Sign-On (SSO) for the API7 Dashboard using LDAP, allowing users to authenticate with their existing directory service credentials.
#### sso-oidc
Configure Single Sign-On (SSO) for the API7 Dashboard using OpenID Connect (OIDC), with provider-specific guidance for Keycloak, Microsoft Entra ID, and Auth0.
- [SSO with OIDC](https://docs.api7.ai/api7-gateway/security-and-compliance/sso-oidc.md): Configure Single Sign-On (SSO) for the API7 Dashboard using OpenID Connect (OIDC), with provider-specific guidance for Keycloak, Microsoft Entra ID, and Auth0.
#### sso-saml
Configure Single Sign-On (SSO) for the API7 Dashboard using SAML 2.0, with provider-specific guidance for Microsoft Entra ID and Okta.
- [SSO with SAML](https://docs.api7.ai/api7-gateway/security-and-compliance/sso-saml.md): Configure Single Sign-On (SSO) for the API7 Dashboard using SAML 2.0, with provider-specific guidance for Microsoft Entra ID and Okta.
#### trust-center
The API7 Trust Center is your centralized resource for all security and compliance-related information, including certifications, security reports, and best practice guides.
- [Trust Center](https://docs.api7.ai/api7-gateway/security-and-compliance/trust-center.md): The API7 Trust Center is your centralized resource for all security and compliance-related information, including certifications, security reports, and best practice guides.
#### verify-image-signatures
Verify API7 Enterprise container image signatures with Cosign and keyless OIDC-based verification. Protect your supply chain by confirming every image was built and signed by API7.ai.
- [Verify Image Signatures](https://docs.api7.ai/api7-gateway/security-and-compliance/verify-image-signatures.md): Verify API7 Enterprise container image signatures with Cosign and keyless OIDC-based verification. Protect your supply chain by confirming every image was built and signed by API7.ai.
#### vulnerability-scanning
Learn about API7.ai's security testing and vulnerability scanning practices for API7 Gateway, including our CVE reporting and patching processes.
- [Vulnerability Scanning](https://docs.api7.ai/api7-gateway/security-and-compliance/vulnerability-scanning.md): Learn about API7.ai's security testing and vulnerability scanning practices for API7 Gateway, including our CVE reporting and patching processes.
#### web-application-firewall
Learn when to use a Web Application Firewall with API7 Gateway, how it fits into your security model, and where to find the current documented integration path.
- [Web Application Firewall (WAF)](https://docs.api7.ai/api7-gateway/security-and-compliance/web-application-firewall.md): Learn when to use a Web Application Firewall with API7 Gateway, how it fits into your security model, and where to find the current documented integration path.
### troubleshooting
Diagnose and resolve common issues with API7 Gateway deployments, including connectivity problems, configuration errors, and performance degradation.
- [Troubleshoot API7 Gateway](https://docs.api7.ai/api7-gateway/troubleshooting.md): Diagnose and resolve common issues with API7 Gateway deployments, including connectivity problems, configuration errors, and performance degradation.
### upgrade-guides
#### backup-and-restore
Back up and restore API7 Gateway CP data and gateway-group configuration with database-native tools and ADC.
- [Backup and Restoration](https://docs.api7.ai/api7-gateway/upgrade-guides/backup-and-restore.md): Back up and restore API7 Gateway CP data and gateway-group configuration with database-native tools and ADC.
#### cluster-migration
A step-by-step guide for migrating your API7 Gateway deployment to a new cluster with zero downtime.
- [API Gateway Cluster Migration](https://docs.api7.ai/api7-gateway/upgrade-guides/cluster-migration.md): A step-by-step guide for migrating your API7 Gateway deployment to a new cluster with zero downtime.
#### dual-cluster
Upgrade API7 Gateway with independent source and target clusters, controlled traffic shifting, write reconciliation, validation, and safe rollback.
- [Dual-Cluster Upgrade](https://docs.api7.ai/api7-gateway/upgrade-guides/dual-cluster.md): Upgrade API7 Gateway with independent source and target clusters, controlled traffic shifting, write reconciliation, validation, and safe rollback.
#### in-place
Upgrade the API7 Gateway Control Plane against its existing database with a write freeze, source shutdown, target validation, and recoverable rollback.
- [Control Plane In-Place Upgrade](https://docs.api7.ai/api7-gateway/upgrade-guides/in-place.md): Upgrade the API7 Gateway Control Plane against its existing database with a write freeze, source shutdown, target validation, and recoverable rollback.
#### lts-upgrades
Choose the supported API7 Gateway route and exact version anchors for upgrading from a predecessor LTS release to this LTS release.
- [Choose an LTS Upgrade Path](https://docs.api7.ai/api7-gateway/upgrade-guides/lts-upgrades.md): Choose the supported API7 Gateway route and exact version anchors for upgrading from a predecessor LTS release to this LTS release.
#### rolling-upgrade
Replace API7 Gateway Data Plane nodes gradually with capacity planning, canary validation, add-before-drain rollout, traffic checks, and rollback.
- [Data Plane Rolling Upgrade](https://docs.api7.ai/api7-gateway/upgrade-guides/rolling-upgrade.md): Replace API7 Gateway Data Plane nodes gradually with capacity planning, canary validation, add-before-drain rollout, traffic checks, and rollback.
#### upgrade
Plan an API7 Gateway upgrade by confirming the supported version path, selecting deployment strategies, preparing backups, and rehearsing rollback.
- [Plan an API7 Gateway Upgrade](https://docs.api7.ai/api7-gateway/upgrade-guides/upgrade.md): Plan an API7 Gateway upgrade by confirming the supported version path, selecting deployment strategies, preparing backups, and rehearsing rollback.
#### upgrade-3.8-to-3.10
Upgrade API7 Gateway from 3.8.23 to 3.10.6 on Helm and Kubernetes with external PostgreSQL, validation, and backup-based rollback.
- [Upgrade from 3.8 LTS to 3.10 LTS](https://docs.api7.ai/api7-gateway/upgrade-guides/upgrade-3.8-to-3.10.md): Upgrade API7 Gateway from 3.8.23 to 3.10.6 on Helm and Kubernetes with external PostgreSQL, validation, and backup-based rollback.
#### upgrade-3.9-to-3.10
Upgrade API7 Gateway directly from 3.9.19 to 3.10.6 on Helm and Kubernetes with external PostgreSQL 15.x, validation, and rollback.
- [Upgrade from 3.9 LTS to 3.10 LTS](https://docs.api7.ai/api7-gateway/upgrade-guides/upgrade-3.9-to-3.10.md): Upgrade API7 Gateway directly from 3.9.19 to 3.10.6 on Helm and Kubernetes with external PostgreSQL 15.x, validation, and rollback.
### version-support-policy
API7 Enterprise version support lifecycle, LTS policy, and upgrade guidance. Learn how long each release is supported and which versions are currently designated as LTS.
- [Version Support Policy](https://docs.api7.ai/api7-gateway/version-support-policy.md): API7 Enterprise version support lifecycle, LTS policy, and upgrade guidance. Learn how long each release is supported and which versions are currently designated as LTS.
## apisix
### reference
#### admin-api
The Apache APISIX Admin API is a RESTful interface for managing all APISIX gateway resources — routes, upstreams, services, consumers, SSL certificates, plugins, and more. APISIX Admin API allows...
- [Apache APISIX Admin API](https://docs.api7.ai/apisix/reference/admin-api.md): The Apache APISIX Admin API is a RESTful interface for managing all APISIX gateway resources — routes, upstreams, services, consumers, SSL certificates, plugins, and more. APISIX Admin API allows...
#### control-api
Use the APISIX Control API to inspect or control the runtime state of one APISIX instance. It is enabled by default at http://127.0.0.1:9090; configure apisix.enable control and apisix.control in...
- [APISIX Control API](https://docs.api7.ai/apisix/reference/control-api.md): Use the APISIX Control API to inspect or control the runtime state of one APISIX instance. It is enabled by default at http://127.0.0.1:9090; configure apisix.enable control and apisix.control in...
#### a6-cli
Understand how the separately installed a6 CLI manages Apache APISIX through the Admin API and how it differs from other management tools.
- [a6 CLI](https://docs.api7.ai/apisix/reference/a6-cli.md): Understand how the separately installed a6 CLI manages Apache APISIX through the Admin API and how it differs from other management tools.
#### adc
Use API Declarative CLI (ADC) to manage Apache APISIX configuration declaratively.
- [API Declarative CLI (ADC)](https://docs.api7.ai/apisix/reference/adc.md): Use API Declarative CLI (ADC) to manage Apache APISIX configuration declaratively.
#### api-standalone-usage
Learn about api-driven standalone mode usage in Apache APISIX, which stores gateway configurations entirely in memory rather than in a configuration file.
- [API-Driven Standalone Mode Usage](https://docs.api7.ai/apisix/reference/api-standalone-usage.md): Learn about api-driven standalone mode usage in Apache APISIX, which stores gateway configurations entirely in memory rather than in a configuration file.
#### apisix-cli
Discover the APISIX Command Line Interface (CLI), a tool designed for easy management and control of APISIX instances.
- [APISIX CLI](https://docs.api7.ai/apisix/reference/apisix-cli.md): Discover the APISIX Command Line Interface (CLI), a tool designed for easy management and control of APISIX instances.
#### apisix-expressions
Learn about APISIX expressions, which combine variables and operators for route matching, request filtering, and other functionalities.
- [APISIX Expressions](https://docs.api7.ai/apisix/reference/apisix-expressions.md): Learn about APISIX expressions, which combine variables and operators for route matching, request filtering, and other functionalities.
#### apisix-mcp
Use APISIX-MCP to expose Apache APISIX resource operations and gateway test requests to MCP-compatible AI clients and agents.
- [APISIX Model Context Protocol (APISIX-MCP)](https://docs.api7.ai/apisix/reference/apisix-mcp.md): Use APISIX-MCP to expose Apache APISIX resource operations and gateway test requests to MCP-compatible AI clients and agents.
#### batch-processor
Understand how APISIX batches logging and telemetry entries, limits pending work, and controls memory use when a destination slows down or becomes unavailable.
- [Batch Processor](https://docs.api7.ai/apisix/reference/batch-processor.md): Understand how APISIX batches logging and telemetry entries, limits pending work, and controls memory use when a destination slows down or becomes unavailable.
#### built-in-variables
Discover built-in variables in Apache APISIX that provide access to request-specific information for plugin configurations and routing.
- [Built-In Variables](https://docs.api7.ai/apisix/reference/built-in-variables.md): Discover built-in variables in Apache APISIX that provide access to request-specific information for plugin configurations and routing.
#### configuration-files
Understand the configuration files in Apache APISIX, detailing how to customize parameters for various environments.
- [Configuration Files](https://docs.api7.ai/apisix/reference/configuration-files.md): Understand the configuration files in Apache APISIX, detailing how to customize parameters for various environments.
#### environment-variables
Explore environment variables in Apache APISIX, which enable configurable settings during deployments for enhanced flexibility.
- [Environment Variables](https://docs.api7.ai/apisix/reference/environment-variables.md): Explore environment variables in Apache APISIX, which enable configurable settings during deployments for enhanced flexibility.
#### file-standalone-configurations
Learn about file-driven standalone configurations in Apache APISIX, which allow the gateway to load gateway configurations from a YAML or JSON file.
- [File-Driven Standalone Mode Configurations](https://docs.api7.ai/apisix/reference/file-standalone-configurations.md): Learn about file-driven standalone configurations in Apache APISIX, which allow the gateway to load gateway configurations from a YAML or JSON file.
#### helm-chart
Learn where to find Apache APISIX Helm chart values and how Helm values are rendered into gateway configuration.
- [Helm Chart](https://docs.api7.ai/apisix/reference/helm-chart.md): Learn where to find Apache APISIX Helm chart values and how Helm values are rendered into gateway configuration.
#### plugin-common-configurations
Explore common plugin configurations in Apache APISIX, which enable universal settings for all plugins via meta attributes.
- [Plugin Common Configurations](https://docs.api7.ai/apisix/reference/plugin-common-configurations.md): Explore common plugin configurations in Apache APISIX, which enable universal settings for all plugins via meta attributes.
#### router-options
Understand router options in Apache APISIX, which detail how to adjust routing behaviors for API request handling.
- [Router Options](https://docs.api7.ai/apisix/reference/router-options.md): Understand router options in Apache APISIX, which detail how to adjust routing behaviors for API request handling.
### ai-agent-skills
Manage Apache APISIX with AI coding agents like Claude Code and Cursor. Browse open-source agent skills that configure your API gateway from natural language.
- [AI Agent Skills for Apache APISIX](https://docs.api7.ai/apisix/ai-agent-skills.md): Manage Apache APISIX with AI coding agents like Claude Code and Cursor. Browse open-source agent skills that configure your API gateway from natural language.
#### a6-persona-developer
Persona skill for API developers building and testing APIs on APISIX using the a6 CLI. Provides decision frameworks for API design, route configuration,…
- [a6-persona-developer](https://docs.api7.ai/apisix/ai-agent-skills/a6-persona-developer.md): Persona skill for API developers building and testing APIs on APISIX using the a6 CLI. Provides decision frameworks for API design, route configuration,…
#### a6-persona-operator
Persona skill for platform operators and DevOps engineers managing APISIX instances using the a6 CLI. Provides decision frameworks for day-to-day operat…
- [a6-persona-operator](https://docs.api7.ai/apisix/ai-agent-skills/a6-persona-operator.md): Persona skill for platform operators and DevOps engineers managing APISIX instances using the a6 CLI. Provides decision frameworks for day-to-day operat…
#### a6-plugin-ai-content-moderation
Skill for configuring APISIX AWS and Aliyun AI content moderation via the a6 CLI. Covers request and response checks, streaming, deny_code, and ai-proxy.
- [a6-plugin-ai-content-moderation](https://docs.api7.ai/apisix/ai-agent-skills/a6-plugin-ai-content-moderation.md): Skill for configuring APISIX AWS and Aliyun AI content moderation via the a6 CLI. Covers request and response checks, streaming, deny_code, and ai-proxy.
#### a6-plugin-ai-prompt-decorator
Skill for configuring the Apache APISIX ai-prompt-decorator plugin via the a6 CLI. Covers prepending and appending system/user/assistant messages to LLM…
- [a6-plugin-ai-prompt-decorator](https://docs.api7.ai/apisix/ai-agent-skills/a6-plugin-ai-prompt-decorator.md): Skill for configuring the Apache APISIX ai-prompt-decorator plugin via the a6 CLI. Covers prepending and appending system/user/assistant messages to LLM…
#### a6-plugin-ai-prompt-template
Skill for configuring the Apache APISIX ai-prompt-template plugin via the a6 CLI. Covers defining reusable prompt templates with variable placeholders,…
- [a6-plugin-ai-prompt-template](https://docs.api7.ai/apisix/ai-agent-skills/a6-plugin-ai-prompt-template.md): Skill for configuring the Apache APISIX ai-prompt-template plugin via the a6 CLI. Covers defining reusable prompt templates with variable placeholders,…
#### a6-plugin-ai-proxy
Skill for configuring the Apache APISIX ai-proxy plugin via the a6 CLI. Covers proxying requests to LLM providers (OpenAI, Azure OpenAI, DeepSeek, Anthr…
- [a6-plugin-ai-proxy](https://docs.api7.ai/apisix/ai-agent-skills/a6-plugin-ai-proxy.md): Skill for configuring the Apache APISIX ai-proxy plugin via the a6 CLI. Covers proxying requests to LLM providers (OpenAI, Azure OpenAI, DeepSeek, Anthr…
#### a6-plugin-basic-auth
Skill for configuring the Apache APISIX basic-auth plugin via the a6 CLI. Covers HTTP Basic Authentication setup on routes, consumer credential binding…
- [a6-plugin-basic-auth](https://docs.api7.ai/apisix/ai-agent-skills/a6-plugin-basic-auth.md): Skill for configuring the Apache APISIX basic-auth plugin via the a6 CLI. Covers HTTP Basic Authentication setup on routes, consumer credential binding…
#### a6-plugin-consumer-restriction
Skill for configuring the Apache APISIX consumer-restriction plugin via the a6 CLI. Covers restricting access by consumer name, consumer group ID, servi…
- [a6-plugin-consumer-restriction](https://docs.api7.ai/apisix/ai-agent-skills/a6-plugin-consumer-restriction.md): Skill for configuring the Apache APISIX consumer-restriction plugin via the a6 CLI. Covers restricting access by consumer name, consumer group ID, servi…
#### a6-plugin-cors
Skill for configuring the Apache APISIX cors plugin via the a6 CLI. Covers Cross-Origin Resource Sharing setup on routes, allow_origins, allow_methods,…
- [a6-plugin-cors](https://docs.api7.ai/apisix/ai-agent-skills/a6-plugin-cors.md): Skill for configuring the Apache APISIX cors plugin via the a6 CLI. Covers Cross-Origin Resource Sharing setup on routes, allow_origins, allow_methods,…
#### a6-plugin-datadog
Skill for configuring the Apache APISIX datadog plugin via the a6 CLI. Covers pushing custom metrics to Datadog via DogStatsD, metric tags, batching, pl…
- [a6-plugin-datadog](https://docs.api7.ai/apisix/ai-agent-skills/a6-plugin-datadog.md): Skill for configuring the Apache APISIX datadog plugin via the a6 CLI. Covers pushing custom metrics to Datadog via DogStatsD, metric tags, batching, pl…
#### a6-plugin-ext-plugin
Skill for configuring the Apache APISIX external plugin system (ext-plugin-pre-req, ext-plugin-post-req, ext-plugin-post-resp) via the a6 CLI. Covers Pl…
- [a6-plugin-ext-plugin](https://docs.api7.ai/apisix/ai-agent-skills/a6-plugin-ext-plugin.md): Skill for configuring the Apache APISIX external plugin system (ext-plugin-pre-req, ext-plugin-post-req, ext-plugin-post-resp) via the a6 CLI. Covers Pl…
#### a6-plugin-fault-injection
Skill for configuring the Apache APISIX fault-injection plugin via the a6 CLI. Covers injecting delays and HTTP aborts for chaos engineering, percentage…
- [a6-plugin-fault-injection](https://docs.api7.ai/apisix/ai-agent-skills/a6-plugin-fault-injection.md): Skill for configuring the Apache APISIX fault-injection plugin via the a6 CLI. Covers injecting delays and HTTP aborts for chaos engineering, percentage…
#### a6-plugin-grpc-transcode
Skill for configuring the Apache APISIX grpc-transcode plugin via the a6 CLI. Covers converting RESTful HTTP requests to gRPC, proto file management, pb…
- [a6-plugin-grpc-transcode](https://docs.api7.ai/apisix/ai-agent-skills/a6-plugin-grpc-transcode.md): Skill for configuring the Apache APISIX grpc-transcode plugin via the a6 CLI. Covers converting RESTful HTTP requests to gRPC, proto file management, pb…
#### a6-plugin-hmac-auth
Skill for configuring the Apache APISIX hmac-auth plugin via the a6 CLI. Covers HMAC signature authentication, consumer credential binding with key_id/s…
- [a6-plugin-hmac-auth](https://docs.api7.ai/apisix/ai-agent-skills/a6-plugin-hmac-auth.md): Skill for configuring the Apache APISIX hmac-auth plugin via the a6 CLI. Covers HMAC signature authentication, consumer credential binding with key_id/s…
#### a6-plugin-http-logger
Skill for configuring the Apache APISIX http-logger plugin via the a6 CLI. Covers pushing access logs to HTTP/HTTPS endpoints in batches, custom log for…
- [a6-plugin-http-logger](https://docs.api7.ai/apisix/ai-agent-skills/a6-plugin-http-logger.md): Skill for configuring the Apache APISIX http-logger plugin via the a6 CLI. Covers pushing access logs to HTTP/HTTPS endpoints in batches, custom log for…
#### a6-plugin-ip-restriction
Skill for configuring the Apache APISIX ip-restriction plugin via the a6 CLI. Covers IP whitelist/blacklist setup on routes, CIDR range support, IPv4/IP…
- [a6-plugin-ip-restriction](https://docs.api7.ai/apisix/ai-agent-skills/a6-plugin-ip-restriction.md): Skill for configuring the Apache APISIX ip-restriction plugin via the a6 CLI. Covers IP whitelist/blacklist setup on routes, CIDR range support, IPv4/IP…
#### a6-plugin-jwt-auth
Skill for configuring the Apache APISIX jwt-auth plugin via the a6 CLI. Covers JWT token authentication, HS256/RS256 algorithm selection, consumer crede…
- [a6-plugin-jwt-auth](https://docs.api7.ai/apisix/ai-agent-skills/a6-plugin-jwt-auth.md): Skill for configuring the Apache APISIX jwt-auth plugin via the a6 CLI. Covers JWT token authentication, HS256/RS256 algorithm selection, consumer crede…
#### a6-plugin-kafka-logger
Skill for configuring the Apache APISIX kafka-logger plugin via the a6 CLI. Covers pushing access logs to Apache Kafka topics, broker configuration, SAS…
- [a6-plugin-kafka-logger](https://docs.api7.ai/apisix/ai-agent-skills/a6-plugin-kafka-logger.md): Skill for configuring the Apache APISIX kafka-logger plugin via the a6 CLI. Covers pushing access logs to Apache Kafka topics, broker configuration, SAS…
#### a6-plugin-key-auth
Skill for configuring the Apache APISIX key-auth plugin via the a6 CLI. Covers API key authentication setup on routes, consumer credential binding, key…
- [a6-plugin-key-auth](https://docs.api7.ai/apisix/ai-agent-skills/a6-plugin-key-auth.md): Skill for configuring the Apache APISIX key-auth plugin via the a6 CLI. Covers API key authentication setup on routes, consumer credential binding, key…
#### a6-plugin-limit-count
Skill for configuring the APISIX limit-count plugin via the a6 CLI. Covers fixed and sliding windows, Redis Sentinel, delayed sync, and shared quotas.
- [a6-plugin-limit-count](https://docs.api7.ai/apisix/ai-agent-skills/a6-plugin-limit-count.md): Skill for configuring the APISIX limit-count plugin via the a6 CLI. Covers fixed and sliding windows, Redis Sentinel, delayed sync, and shared quotas.
#### a6-plugin-limit-req
Skill for configuring the Apache APISIX limit-req plugin via the a6 CLI. Covers leaky-bucket rate limiting, rate/burst configuration, nodelay behavior,…
- [a6-plugin-limit-req](https://docs.api7.ai/apisix/ai-agent-skills/a6-plugin-limit-req.md): Skill for configuring the Apache APISIX limit-req plugin via the a6 CLI. Covers leaky-bucket rate limiting, rate/burst configuration, nodelay behavior,…
#### a6-plugin-openid-connect
Skill for configuring the APISIX openid-connect plugin via the a6 CLI. Covers authorization-code and bearer flows, PAR, DPoP, and session validation.
- [a6-plugin-openid-connect](https://docs.api7.ai/apisix/ai-agent-skills/a6-plugin-openid-connect.md): Skill for configuring the APISIX openid-connect plugin via the a6 CLI. Covers authorization-code and bearer flows, PAR, DPoP, and session validation.
#### a6-plugin-prometheus
Skill for configuring APISIX prometheus via the a6 CLI. Covers HTTP, LLM, and AI cache metrics, latency type labels, and Grafana dashboards.
- [a6-plugin-prometheus](https://docs.api7.ai/apisix/ai-agent-skills/a6-plugin-prometheus.md): Skill for configuring APISIX prometheus via the a6 CLI. Covers HTTP, LLM, and AI cache metrics, latency type labels, and Grafana dashboards.
#### a6-plugin-proxy-rewrite
Skill for configuring the Apache APISIX proxy-rewrite plugin via the a6 CLI. Covers rewriting request URI, host, method, headers, and scheme before forw…
- [a6-plugin-proxy-rewrite](https://docs.api7.ai/apisix/ai-agent-skills/a6-plugin-proxy-rewrite.md): Skill for configuring the Apache APISIX proxy-rewrite plugin via the a6 CLI. Covers rewriting request URI, host, method, headers, and scheme before forw…
#### a6-plugin-redirect
Skill for configuring the Apache APISIX redirect plugin via the a6 CLI. Covers URI redirects, HTTP-to-HTTPS redirection, regex-based URI rewriting, quer…
- [a6-plugin-redirect](https://docs.api7.ai/apisix/ai-agent-skills/a6-plugin-redirect.md): Skill for configuring the Apache APISIX redirect plugin via the a6 CLI. Covers URI redirects, HTTP-to-HTTPS redirection, regex-based URI rewriting, quer…
#### a6-plugin-response-rewrite
Skill for configuring the Apache APISIX response-rewrite plugin via the a6 CLI. Covers rewriting response status codes, headers, and body before returni…
- [a6-plugin-response-rewrite](https://docs.api7.ai/apisix/ai-agent-skills/a6-plugin-response-rewrite.md): Skill for configuring the Apache APISIX response-rewrite plugin via the a6 CLI. Covers rewriting response status codes, headers, and body before returni…
#### a6-plugin-serverless
Skill for configuring the Apache APISIX serverless-pre-function and serverless-post-function plugins via the a6 CLI. Covers inline Lua function executio…
- [a6-plugin-serverless](https://docs.api7.ai/apisix/ai-agent-skills/a6-plugin-serverless.md): Skill for configuring the Apache APISIX serverless-pre-function and serverless-post-function plugins via the a6 CLI. Covers inline Lua function executio…
#### a6-plugin-skywalking
Skill for configuring the Apache APISIX skywalking plugin via the a6 CLI. Covers distributed tracing with Apache SkyWalking OAP, sampling configuration,…
- [a6-plugin-skywalking](https://docs.api7.ai/apisix/ai-agent-skills/a6-plugin-skywalking.md): Skill for configuring the Apache APISIX skywalking plugin via the a6 CLI. Covers distributed tracing with Apache SkyWalking OAP, sampling configuration,…
#### a6-plugin-traffic-split
Skill for configuring the Apache APISIX traffic-split plugin via the a6 CLI. Covers weighted traffic splitting between upstreams with conditional match…
- [a6-plugin-traffic-split](https://docs.api7.ai/apisix/ai-agent-skills/a6-plugin-traffic-split.md): Skill for configuring the Apache APISIX traffic-split plugin via the a6 CLI. Covers weighted traffic splitting between upstreams with conditional match…
#### a6-plugin-wolf-rbac
Skill for configuring the Apache APISIX wolf-rbac plugin via the a6 CLI. Covers integration with the Wolf RBAC server for role-based access control, tok…
- [a6-plugin-wolf-rbac](https://docs.api7.ai/apisix/ai-agent-skills/a6-plugin-wolf-rbac.md): Skill for configuring the Apache APISIX wolf-rbac plugin via the a6 CLI. Covers integration with the Wolf RBAC server for role-based access control, tok…
#### a6-plugin-zipkin
Skill for configuring the Apache APISIX zipkin plugin via the a6 CLI. Covers distributed tracing with Zipkin, Jaeger, or any Zipkin-compatible collector…
- [a6-plugin-zipkin](https://docs.api7.ai/apisix/ai-agent-skills/a6-plugin-zipkin.md): Skill for configuring the Apache APISIX zipkin plugin via the a6 CLI. Covers distributed tracing with Zipkin, Jaeger, or any Zipkin-compatible collector…
#### a6-recipe-api-versioning
Recipe skill for implementing API versioning strategies using the a6 CLI. Covers URI path versioning with proxy-rewrite, header-based versioning with tr…
- [a6-recipe-api-versioning](https://docs.api7.ai/apisix/ai-agent-skills/a6-recipe-api-versioning.md): Recipe skill for implementing API versioning strategies using the a6 CLI. Covers URI path versioning with proxy-rewrite, header-based versioning with tr…
#### a6-recipe-blue-green
Recipe skill for implementing blue-green deployments using the a6 CLI. Covers creating two upstream environments, switching traffic instantly via route…
- [a6-recipe-blue-green](https://docs.api7.ai/apisix/ai-agent-skills/a6-recipe-blue-green.md): Recipe skill for implementing blue-green deployments using the a6 CLI. Covers creating two upstream environments, switching traffic instantly via route…
#### a6-recipe-canary
Recipe skill for implementing canary releases using the a6 CLI. Covers gradual traffic shifting with the traffic-split plugin, header-based canary routi…
- [a6-recipe-canary](https://docs.api7.ai/apisix/ai-agent-skills/a6-recipe-canary.md): Recipe skill for implementing canary releases using the a6 CLI. Covers gradual traffic shifting with the traffic-split plugin, header-based canary routi…
#### a6-recipe-circuit-breaker
Recipe skill for implementing circuit breaker patterns using the a6 CLI. Covers the api-breaker plugin for automatic upstream circuit breaking, configur…
- [a6-recipe-circuit-breaker](https://docs.api7.ai/apisix/ai-agent-skills/a6-recipe-circuit-breaker.md): Recipe skill for implementing circuit breaker patterns using the a6 CLI. Covers the api-breaker plugin for automatic upstream circuit breaking, configur…
#### a6-recipe-graphql-proxy
Recipe skill for implementing GraphQL proxying patterns using the a6 CLI. Covers operation-based routing with built-in GraphQL variables, per-operation…
- [a6-recipe-graphql-proxy](https://docs.api7.ai/apisix/ai-agent-skills/a6-recipe-graphql-proxy.md): Recipe skill for implementing GraphQL proxying patterns using the a6 CLI. Covers operation-based routing with built-in GraphQL variables, per-operation…
#### a6-recipe-health-check
Recipe skill for configuring upstream health checks using the a6 CLI. Covers active health checks (HTTP probing), passive health checks (response analys…
- [a6-recipe-health-check](https://docs.api7.ai/apisix/ai-agent-skills/a6-recipe-health-check.md): Recipe skill for configuring upstream health checks using the a6 CLI. Covers active health checks (HTTP probing), passive health checks (response analys…
#### a6-recipe-mtls
Recipe skill for configuring mutual TLS (mTLS) using the a6 CLI. Covers SSL certificate management, upstream mTLS to backend services, client certificat…
- [a6-recipe-mtls](https://docs.api7.ai/apisix/ai-agent-skills/a6-recipe-mtls.md): Recipe skill for configuring mutual TLS (mTLS) using the a6 CLI. Covers SSL certificate management, upstream mTLS to backend services, client certificat…
#### a6-recipe-multi-tenant
Recipe skill for implementing tenant-aware policies on a shared APISIX gateway using the a6 CLI. Covers shared policies through Consumer Groups, host/pa…
- [Build Tenant-Aware Policies on a Shared Gateway](https://docs.api7.ai/apisix/ai-agent-skills/a6-recipe-multi-tenant.md): Recipe skill for implementing tenant-aware policies on a shared APISIX gateway using the a6 CLI. Covers shared policies through Consumer Groups, host/pa…
#### a6-shared
Core skill for working with the a6 CLI — the Apache APISIX command-line tool. Provides project conventions, command patterns, architecture overview, and…
- [a6 Shared Skill](https://docs.api7.ai/apisix/ai-agent-skills/a6-shared.md): Core skill for working with the a6 CLI — the Apache APISIX command-line tool. Provides project conventions, command patterns, architecture overview, and…
### documentation
Explore the comprehensive Apache APISIX documentation, covering setup, guides, plugins, and key concepts for effective API management and gateway functionality.
- [Apache APISIX Documentation](https://docs.api7.ai/apisix/documentation.md): Explore the comprehensive Apache APISIX documentation, covering setup, guides, plugins, and key concepts for effective API management and gateway functionality.
### getting-started
Learn how to quickly install and set up Apache APISIX, a dynamic and high-performance API gateway, to streamline your API lifecycle management.
- [Get APISIX](https://docs.api7.ai/apisix/getting-started.md): Learn how to quickly install and set up Apache APISIX, a dynamic and high-performance API gateway, to streamline your API lifecycle management.
#### configure-routes
Learn how to define routes in Apache APISIX to manage traffic, match client requests, and forward them to upstream services effectively.
- [Configure Routes](https://docs.api7.ai/apisix/getting-started/configure-routes.md): Learn how to define routes in Apache APISIX to manage traffic, match client requests, and forward them to upstream services effectively.
#### key-authentication
Explore how to configure key authentication in Apache APISIX, allowing secure access to your APIs by managing consumer credentials effectively.
- [Key Authentication](https://docs.api7.ai/apisix/getting-started/key-authentication.md): Explore how to configure key authentication in Apache APISIX, allowing secure access to your APIs by managing consumer credentials effectively.
#### load-balancing
Understand how to implement load balancing in Apache APISIX, utilizing various algorithms to distribute incoming requests across multiple upstream services.
- [Load Balancing](https://docs.api7.ai/apisix/getting-started/load-balancing.md): Understand how to implement load balancing in Apache APISIX, utilizing various algorithms to distribute incoming requests across multiple upstream services.
#### management-options
Compare the Admin API, ADC, a6 CLI, and APISIX-MCP to choose an APISIX resource management workflow for interactive use or automation.
- [Management Options](https://docs.api7.ai/apisix/getting-started/management-options.md): Compare the Admin API, ADC, a6 CLI, and APISIX-MCP to choose an APISIX resource management workflow for interactive use or automation.
#### rate-limiting
Implement rate limiting in Apache APISIX to control traffic flow, protect your APIs from misuse, and ensure fair usage by setting request limits.
- [Rate Limiting](https://docs.api7.ai/apisix/getting-started/rate-limiting.md): Implement rate limiting in Apache APISIX to control traffic flow, protect your APIs from misuse, and ensure fair usage by setting request limits.
### how-apisix-works
Understand how Apache APISIX handles a request end-to-end, from configuration store to upstream selection, and how its router and hot-reload design let it scale to thousands of routes without a restart.
- [How APISIX Works](https://docs.api7.ai/apisix/how-apisix-works.md): Understand how Apache APISIX handles a request end-to-end, from configuration store to upstream selection, and how its router and hot-reload design let it scale to thousands of routes without a restart.
### how-to-guide
#### ai-gateway
- [Configure Prompt Decorators](https://docs.api7.ai/apisix/how-to-guide/ai-gateway/configure-prompt-decorators.md): Learn how to configure APISIX prompt decorators to prepend and append instructions to OpenAI Chat Completions and Responses API requests at the gateway.
- [Implement Prompt Guardrails](https://docs.api7.ai/apisix/how-to-guide/ai-gateway/implement-prompt-guardrails.md): Discover how to implement prompt guardrails in Apache APISIX to protect user privacy and discourage unintended model behaviors when using large language models (LLMs).
- [Pre-Define Prompt Templates](https://docs.api7.ai/apisix/how-to-guide/ai-gateway/pre-define-prompt-templates.md): Learn how to configure reusable Chat Completions and Responses API prompt templates in APISIX using client-supplied values, OpenAI web search, and tool use.
- [Proxy Amazon Bedrock Requests](https://docs.api7.ai/apisix/how-to-guide/ai-gateway/proxy-amazon-bedrock-requests.md): Learn how to configure APISIX to authenticate with Amazon Bedrock and proxy Converse and ConverseStream requests with the ai-proxy plugin.
- [Proxy Anthropic Requests](https://docs.api7.ai/apisix/how-to-guide/ai-gateway/proxy-anthropic-requests.md): Configure Apache APISIX to proxy OpenAI-compatible and native Anthropic Messages requests to Claude models with the ai-proxy plugin.
- [Proxy Azure OpenAI Requests](https://docs.api7.ai/apisix/how-to-guide/ai-gateway/proxy-azure-openai-requests.md): Learn how to configure APISIX to authenticate with Azure OpenAI and proxy streaming and non-streaming Chat Completions and Responses API requests.
- [Proxy Gemini Requests](https://docs.api7.ai/apisix/how-to-guide/ai-gateway/proxy-gemini-requests.md): Learn how to configure Apache APISIX to proxy requests to Google Gemini with the ai-proxy plugin, enabling access to Gemini models via an OpenAI-compatible API without specifying a custom endpoint.
- [Proxy OpenAI Requests](https://docs.api7.ai/apisix/how-to-guide/ai-gateway/proxy-openai-requests.md): Learn how to configure APISIX to authenticate with OpenAI and proxy Chat Completions, Responses API, and Embeddings requests with the ai-proxy plugin.
- [Proxy OpenRouter Requests](https://docs.api7.ai/apisix/how-to-guide/ai-gateway/proxy-openrouter-requests.md): Learn how to configure Apache APISIX to proxy requests to OpenRouter with the ai-proxy plugin, enabling access to many model providers via an OpenAI-compatible API without specifying a custom endpoint.
- [Proxy Vertex AI Requests](https://docs.api7.ai/apisix/how-to-guide/ai-gateway/proxy-vertex-ai-requests.md): Learn how to configure Apache APISIX to proxy requests to Google Vertex AI with the ai-proxy plugin, enabling access to Gemini models through an OpenAI-compatible API.
#### authentication
- [Implement Basic Authentication](https://docs.api7.ai/apisix/how-to-guide/authentication/implement-basic-auth.md): Learn how to set up basic authentication in Apache APISIX, allowing clients to authenticate using a username and password combination securely.
- [Implement HMAC Authentication](https://docs.api7.ai/apisix/how-to-guide/authentication/implement-hmac-auth.md): Explore the process of setting up HMAC authentication in Apache APISIX, ensuring secure API requests through cryptographic signatures using shared secret keys.
- [Implement JWT Authentication](https://docs.api7.ai/apisix/how-to-guide/authentication/implement-jwt-auth.md): Understand how to implement JWT authentication in Apache APISIX, allowing secure and stateless authentication of API clients using JSON Web Tokens.
- [Implement Key Authentication](https://docs.api7.ai/apisix/how-to-guide/authentication/implement-key-auth.md): Learn how to set up key authentication in Apache APISIX, allowing you to issue unique API keys to consumers for effective access control to your APIs.
- [Secure OIDC with PAR and DPoP](https://docs.api7.ai/apisix/how-to-guide/authentication/secure-oidc-with-par-and-dpop.md): Configure APISIX and Keycloak to secure an OIDC authorization code flow with PAR, PKCE, DPoP-bound tokens, and private-key JWT authentication.
- [Secure WebSocket Traffic](https://docs.api7.ai/apisix/how-to-guide/authentication/secure-websocket-traffic.md): Learn how to secure WebSocket traffic in Apache APISIX, implementing authentication mechanisms during the initial handshake to protect WebSocket connections.
- [Set Up SSO with Amazon Cognito](https://docs.api7.ai/apisix/how-to-guide/authentication/set-up-sso-with-amazon-cognito.md): Learn how to set up single sign-on (SSO) with Amazon Cognito in Apache APISIX, facilitating secure user authentication and access management.
- [Set Up SSO with Auth0](https://docs.api7.ai/apisix/how-to-guide/authentication/set-up-sso-with-auth0.md): Discover how to configure Apache APISIX to use Auth0 for single sign-on (SSO), enabling secure user authentication through various identity management features.
- [Set Up SSO with Microsoft Entra ID (Azure AD)](https://docs.api7.ai/apisix/how-to-guide/authentication/set-up-sso-with-azure-ad.md): Understand how to set up single sign-on (SSO) in Apache APISIX using Microsoft Entra ID (Azure AD) for secure authentication via OpenID Connect.
- [Set Up SSO with Google](https://docs.api7.ai/apisix/how-to-guide/authentication/set-up-sso-with-google.md): Explore how to integrate Apache APISIX with Google for single sign-on (SSO) using OpenID Connect, facilitating secure user authentication for your APIs.
- [Set Up SSO with Keycloak](https://docs.api7.ai/apisix/how-to-guide/authentication/set-up-sso-with-keycloak.md): Learn how to integrate Apache APISIX with Keycloak to implement single sign-on (SSO) using OpenID Connect for secure authentication processes.
- [Set Up SSO with Okta](https://docs.api7.ai/apisix/how-to-guide/authentication/set-up-sso-with-okta.md): Discover how to configure Apache APISIX to work with Okta for single sign-on (SSO), enabling secure authentication processes using OpenID Connect.
#### custom-plugins
- [Create a Custom Plugin in Lua](https://docs.api7.ai/apisix/how-to-guide/custom-plugins/create-plugin-in-lua.md): Discover how to develop custom Lua plugins for Apache APISIX to extend its functionality.
- [Use Wasm Plugins in APISIX](https://docs.api7.ai/apisix/how-to-guide/custom-plugins/wasm-plugins.md): Learn how to implement WebAssembly (Wasm) plugins in Apache APISIX, leveraging Proxy-Wasm specifications for enhanced capabilities.
#### observability
- [Log Consumer Label in Access Log](https://docs.api7.ai/apisix/how-to-guide/observability/log-consumer-label-in-access-log.md): Learn how to configure Apache APISIX to log consumer labels in access log, enhancing API management and security.
- [Log with ClickHouse](https://docs.api7.ai/apisix/how-to-guide/observability/log-with-clickhouse.md): Learn how to configure Apache APISIX to log access information to ClickHouse, facilitating efficient log management and analysis.
- [Log with Elasticsearch](https://docs.api7.ai/apisix/how-to-guide/observability/log-with-elasticsearch.md): Understand how to integrate Apache APISIX with Elasticsearch to collect and index logs, providing powerful search and visualization capabilities through the ELK stack.
- [Monitor APISIX Metrics with Datadog](https://docs.api7.ai/apisix/how-to-guide/observability/monitor-apisix-with-datadog.md): Explore the process of integrating Datadog with Apache APISIX to monitor metrics, enabling enhanced observability and alerting capabilities.
- [Monitor APISIX Metrics with Prometheus](https://docs.api7.ai/apisix/how-to-guide/observability/monitor-apisix-with-prometheus.md): Understand how to enable Prometheus in Apache APISIX for metrics collection, allowing you to monitor system performance and health effectively.
- [Trace Requests with Zipkin](https://docs.api7.ai/apisix/how-to-guide/observability/trace-with-zipkin.md): Discover how to implement request tracing in Apache APISIX with Zipkin, enabling detailed monitoring of request flows and performance diagnostics.
#### security
- [Manage Secrets in AWS Secrets Manager](https://docs.api7.ai/apisix/how-to-guide/security/secrets-management/manage-secrets-in-aws.md): Discover how to use AWS Secrets Manager with Apache APISIX to securely store and manage sensitive credentials, ensuring automated rotation and secure access.
- [Manage Secrets in GCP Secret Manager](https://docs.api7.ai/apisix/how-to-guide/security/secrets-management/manage-secrets-in-gcp-secret-manager.md): Understand how to integrate GCP Secret Manager with Apache APISIX for centralized management of secrets like API keys and passwords, with secure retrieval mechanisms.
- [Manage Secrets in HashiCorp Vault](https://docs.api7.ai/apisix/how-to-guide/security/secrets-management/manage-secrets-in-hashicorp-vault.md): Learn how to integrate HashiCorp Vault with Apache APISIX for secure management of sensitive information, including API keys and passwords, and how to retrieve these secrets within your application.
- [Integrate with Coraza](https://docs.api7.ai/apisix/how-to-guide/security/waf/integrate-with-coraza.md): Explore the integration of Coraza Web Application Firewall (WAF) with Apache APISIX to enhance security, providing robust protection against various cyber attacks.
#### service-discovery
- [Integrate with HashiCorp Consul](https://docs.api7.ai/apisix/how-to-guide/service-discovery/consul-integration.md): Learn how to set up HashiCorp Consul for service discovery and integrate it with Apache APISIX to dynamically route and load balance traffic across microservices.
- [Integrate with Netflix Eureka](https://docs.api7.ai/apisix/how-to-guide/service-discovery/eureka-integration.md): Discover how to configure Netflix Eureka for service discovery and integrate it with Apache APISIX to manage service registration and routing seamlessly.
- [Integrate with Kubernetes Service Discovery](https://docs.api7.ai/apisix/how-to-guide/service-discovery/kubernetes-service-discovery.md): Configure Apache APISIX to discover Kubernetes Endpoints or EndpointSlices securely and route requests to services in one or more clusters.
#### traffic-management
- [Implement API Versioning](https://docs.api7.ai/apisix/how-to-guide/traffic-management/api-versioning.md): Learn to implement API versioning in Apache APISIX using path, query, and header strategies for better API management.
- [Manage Traffic Conditionally](https://docs.api7.ai/apisix/how-to-guide/traffic-management/conditional-traffic-management.md): Explore how to implement conditional traffic management in Apache APISIX, enabling dynamic routing and actions based on request characteristics such as headers or parameters.
- [Configure Upstream Health Checks](https://docs.api7.ai/apisix/how-to-guide/traffic-management/health-check.md): Learn how to configure both active and passive health checks for upstream services in Apache APISIX, ensuring that requests are only forwarded to healthy services.
- [Configure HTTP/3 QUIC Between Client and APISIX](https://docs.api7.ai/apisix/how-to-guide/traffic-management/http3-quic.md): Learn how to configure HTTP/3 connections in Apache APISIX to leverage the benefits of QUIC for improved performance and reduced latency.
- [Proxy Transport Layer (L4) Traffic](https://docs.api7.ai/apisix/how-to-guide/traffic-management/proxy-transport-layer-l4-traffic.md): Explore how to configure Apache APISIX to handle transport layer (L4) TCP and UDP traffic, allowing for efficient proxying of various types of network traffic.
- [Proxy WebSocket Connections](https://docs.api7.ai/apisix/how-to-guide/traffic-management/proxy-websocket.md): Discover how to enable Apache APISIX to proxy WebSocket connections, facilitating real-time, bidirectional communication between clients and servers.
- [Configure Rate Limiting](https://docs.api7.ai/apisix/how-to-guide/traffic-management/rate-limiting.md): Understand how to set up rate limiting in Apache APISIX using various plugins to control access to your APIs and protect them from excessive requests.
- [Configure HTTPS Between Client and APISIX](https://docs.api7.ai/apisix/how-to-guide/traffic-management/tls-and-mtls/configure-https-between-client-and-apisix.md): Discover how to configure HTTPS between clients and Apache APISIX to enhance API security.
- [Configure mTLS Between APISIX and Upstream](https://docs.api7.ai/apisix/how-to-guide/traffic-management/tls-and-mtls/configure-mtls-between-apisix-and-upstream.md): Discover how to configure mutual TLS between Apache APISIX and upstream services for enhanced API security.
- [Configure mTLS Between Client and APISIX](https://docs.api7.ai/apisix/how-to-guide/traffic-management/tls-and-mtls/configure-mtls-between-client-and-apisix.md): Discover how to configure mutual TLS between clients and Apache APISIX for enhanced API security.
- [Configure Upstream HTTPS](https://docs.api7.ai/apisix/how-to-guide/traffic-management/tls-and-mtls/configure-upstream-https.md): Discover how to connect to upstream services on HTTPS ports in Apache APISIX, to secure communication and enhance API security.
- [Implement Traffic Mirroring](https://docs.api7.ai/apisix/how-to-guide/traffic-management/traffic-mirroring.md): Understand how to set up traffic mirroring in Apache APISIX, allowing you to duplicate incoming traffic to a secondary service for testing or analysis without affecting the primary service.
#### transformation
- [Convert JSON to XML](https://docs.api7.ai/apisix/how-to-guide/transformation/convert-json-to-xml.md): Discover how to use the body-transformer plugin in Apache APISIX to convert JSON data to XML format and vice versa, facilitating data interchange between different systems.
- [Transcode HTTP to gRPC](https://docs.api7.ai/apisix/how-to-guide/transformation/transcode-http-to-grpc.md): Learn how to use the grpc-transcode plugin in Apache APISIX to convert between RESTful HTTP requests and gRPC requests, enabling seamless integration of gRPC services.
### install
#### docker
Learn how to install Apache APISIX using Docker, providing a straightforward method for deploying and managing your API gateway in a containerized environment.
- [Install APISIX with Docker](https://docs.api7.ai/apisix/install/docker.md): Learn how to install Apache APISIX using Docker, providing a straightforward method for deploying and managing your API gateway in a containerized environment.
- [Build Your Own Docker Images](https://docs.api7.ai/apisix/install/docker/build-custom-images.md): Learn how to build custom Docker images for Apache APISIX, allowing for tailored configurations to meet your specific deployment needs.
#### kubernetes
- [Install APISIX on ROSA](https://docs.api7.ai/apisix/install/kubernetes/rosa.md): Follow the steps to install Apache APISIX on Red Hat OpenShift Service on AWS (ROSA), a fully managed service for deploying OpenShift clusters.
### key-concepts
#### consumer-groups
Understand the concept of consumer groups in Apache APISIX, which allow for the management of multiple consumers with shared configurations.
- [Consumer Groups](https://docs.api7.ai/apisix/key-concepts/consumer-groups.md): Understand the concept of consumer groups in Apache APISIX, which allow for the management of multiple consumers with shared configurations.
#### consumers
Understand the concept of consumers in Apache APISIX, which represent users or applications that interact with the API gateway and its services.
- [Consumers](https://docs.api7.ai/apisix/key-concepts/consumers.md): Understand the concept of consumers in Apache APISIX, which represent users or applications that interact with the API gateway and its services.
#### credentials
Understand the concept of credentials in Apache APISIX, which manage authentication configurations for consumers to enhance security and access control.
- [Credentials](https://docs.api7.ai/apisix/key-concepts/credentials.md): Understand the concept of credentials in Apache APISIX, which manage authentication configurations for consumers to enhance security and access control.
#### plugin-configs
Understand the concept of plugin configs in Apache APISIX, which centralize plugin configurations to enhance efficiency in API management.
- [Plugin Configs](https://docs.api7.ai/apisix/key-concepts/plugin-configs.md): Understand the concept of plugin configs in Apache APISIX, which centralize plugin configurations to enhance efficiency in API management.
#### plugin-global-rules
Understand the concept of global rules in Apache APISIX, which allow plugins to be executed on every incoming request for consistent API behavior.
- [Plugin Global Rules](https://docs.api7.ai/apisix/key-concepts/plugin-global-rules.md): Understand the concept of global rules in Apache APISIX, which allow plugins to be executed on every incoming request for consistent API behavior.
#### plugin-metadata
Understand the concept of plugin metadata in Apache APISIX, which manages shared configurations for plugins, ensuring consistency across multiple instances.
- [Plugin Metadata](https://docs.api7.ai/apisix/key-concepts/plugin-metadata.md): Understand the concept of plugin metadata in Apache APISIX, which manages shared configurations for plugins, ensuring consistency across multiple instances.
#### plugins
Understand the concept of plugins in Apache APISIX, which extend functionality for traffic management, security, and observability in API operations.
- [Plugins](https://docs.api7.ai/apisix/key-concepts/plugins.md): Understand the concept of plugins in Apache APISIX, which extend functionality for traffic management, security, and observability in API operations.
#### protos
Understand the concept of protos in Apache APISIX, which facilitates efficient data serialization and communication between services.
- [Protos](https://docs.api7.ai/apisix/key-concepts/protos.md): Understand the concept of protos in Apache APISIX, which facilitates efficient data serialization and communication between services.
#### routes
Understand the concept of routes in Apache APISIX, which define paths to upstream services and facilitate effective traffic management.
- [Routes](https://docs.api7.ai/apisix/key-concepts/routes.md): Understand the concept of routes in Apache APISIX, which define paths to upstream services and facilitate effective traffic management.
#### secrets
Understand the concept of secrets in Apache APISIX, which enable secure storage and management of sensitive information like API keys.
- [Secrets](https://docs.api7.ai/apisix/key-concepts/secrets.md): Understand the concept of secrets in Apache APISIX, which enable secure storage and management of sensitive information like API keys.
#### services
Understand the concept of services in Apache APISIX, which represent backend applications and streamline API management by reducing configuration redundancies.
- [Services](https://docs.api7.ai/apisix/key-concepts/services.md): Understand the concept of services in Apache APISIX, which represent backend applications and streamline API management by reducing configuration redundancies.
#### ssl-certificates
Understand the concept of SSL certificates in Apache APISIX, which ensure secure communication between clients and the API gateway.
- [SSL Certificates](https://docs.api7.ai/apisix/key-concepts/ssl-certificates.md): Understand the concept of SSL certificates in Apache APISIX, which ensure secure communication between clients and the API gateway.
#### stream-routes
Understand the concept of stream routes in Apache APISIX, which manage TCP/UDP traffic, enhancing the gateway's capabilities for various protocols.
- [Stream Routes](https://docs.api7.ai/apisix/key-concepts/stream-routes.md): Understand the concept of stream routes in Apache APISIX, which manage TCP/UDP traffic, enhancing the gateway's capabilities for various protocols.
#### upstreams
Understand the concept of upstreams in Apache APISIX, which manage backend service addresses for efficient load balancing and service discovery.
- [Upstreams](https://docs.api7.ai/apisix/key-concepts/upstreams.md): Understand the concept of upstreams in Apache APISIX, which manage backend service addresses for efficient load balancing and service discovery.
### migration
#### nginx-to-apisix
Follow the guide for migrating from NGINX to Apache APISIX, ensuring a smooth transition while leveraging the benefits of the API gateway.
- [Migrate from NGINX to APISIX](https://docs.api7.ai/apisix/migration/nginx-to-apisix.md): Follow the guide for migrating from NGINX to Apache APISIX, ensuring a smooth transition while leveraging the benefits of the API gateway.
### networking
#### port-reference
Explore the default port configurations for Apache APISIX, detailing the ports used for various protocols and services within the API gateway.
- [Port Reference](https://docs.api7.ai/apisix/networking/port-reference.md): Explore the default port configurations for Apache APISIX, detailing the ports used for various protocols and services within the API gateway.
### production
#### deployment-modes
Understand the various deployment modes of Apache APISIX, including traditional, decoupled, and standalone modes, to optimize your API gateway deployment strategy.
- [Deployment Modes](https://docs.api7.ai/apisix/production/deployment-modes.md): Understand the various deployment modes of Apache APISIX, including traditional, decoupled, and standalone modes, to optimize your API gateway deployment strategy.
#### performance
- [Performance Testing Benchmarks](https://docs.api7.ai/apisix/production/performance/performance-testing.md): Explore methods for conducting performance testing on Apache APISIX, ensuring your API gateway can handle expected traffic loads effectively.
#### recovery
- [Back Up and Restore etcd](https://docs.api7.ai/apisix/production/recovery/etcd-backup-restore.md): Discover best practices for backing up and restoring etcd in Apache APISIX, ensuring data integrity and availability for your API configurations.
#### scaling
- [Autoscale APISIX Gateway (AWS EC2)](https://docs.api7.ai/apisix/production/scaling/autoscale-apisix-gateway-aws.md): Learn how to autoscale APISIX Gateway on AWS EC2 using Auto Scaling Group (ASG) to maintain consistent API performance under varying traffic loads.
- [Autoscale APISIX Gateway (K8s)](https://docs.api7.ai/apisix/production/scaling/autoscale-apisix-gateway-k8s.md): Learn how to autoscale APISIX Gateway on Kubernetes using a Horizontal Pod Autoscaler (HPA) to maintain consistent API performance under varying traffic loads.
#### security
- [Admin API Key](https://docs.api7.ai/apisix/production/security/admin-api-key.md): Learn about the importance of configuring Admin API keys in Apache APISIX, ensuring secure access to Admin API endpoints and managing permissions effectively.
- [Data Encryption with Keyring](https://docs.api7.ai/apisix/production/security/data-encryption-with-keyring.md): Understand the significance of data encryption in Apache APISIX and how to secure sensitive information using keyrings for enhanced protection.
- [IP Restriction](https://docs.api7.ai/apisix/production/security/ip-restriction.md): Discover how to implement IP restriction in Apache APISIX to control access to resources, enhancing security by allowing only authorized IP addresses.
- [Configure mTLS between APISIX and etcd](https://docs.api7.ai/apisix/production/security/mtls/configure-mtls-between-apisix-and-etcd.md): Learn how to configure mutual TLS between Apache APISIX and etcd, ensuring secure communication and authentication between these components.
- [Configure mTLS between Client and APISIX Admin API](https://docs.api7.ai/apisix/production/security/mtls/configure-mtls-between-client-and-admin-api.md): Explore the steps to set up mutual TLS between clients and the APISIX Admin API, enhancing API security through two-way authentication.
#### serve-static-resources
Understand how to configure Apache APISIX to serve static resources efficiently, improving performance and resource management for your APIs.
- [Serve Static Resources](https://docs.api7.ai/apisix/production/serve-static-resources.md): Understand how to configure Apache APISIX to serve static resources efficiently, improving performance and resource management for your APIs.
#### upgrade
- [Canary Deployment](https://docs.api7.ai/apisix/production/upgrade/canary-deployment.md): Learn about the canary deployment strategy in Apache APISIX, allowing for gradual rollouts of new features while minimizing risk.
- [Review Changes Before Upgrade](https://docs.api7.ai/apisix/production/upgrade/review-changes-before-upgrade.md): Review APISIX behavior changes that can affect existing routes, plugins, metrics, and authentication before you upgrade into this version.
### troubleshooting
#### debug-mode
Enable and configure debug mode in Apache APISIX to inspect runtime behavior, log details, and troubleshoot issues effectively.
- [Use Debug Mode](https://docs.api7.ai/apisix/troubleshooting/debug-mode.md): Enable and configure debug mode in Apache APISIX to inspect runtime behavior, log details, and troubleshoot issues effectively.
#### set-breakpoints
Learn how to use the APISIX inspect plugin to capture local variables and function-scoped captured values at any line of Lua source in a running worker, without restarting APISIX or modifying source code.
- [Set Breakpoints](https://docs.api7.ai/apisix/troubleshooting/set-breakpoints.md): Learn how to use the APISIX inspect plugin to capture local variables and function-scoped captured values at any line of Lua source in a running worker, without restarting APISIX or modifying source code.
## hub
Explore plugin documentation for Apache APISIX and API7 Gateway, including configuration references and examples for gateway and Ingress Controller workflows.
- [Welcome to API Gateway Plugin Hub](https://docs.api7.ai/hub.md): Explore plugin documentation for Apache APISIX and API7 Gateway, including configuration references and examples for gateway and Ingress Controller workflows.
### acl
The acl plugin controls access to upstream resources by verifying if the user is on the access control lists, enhancing API management.
- [acl](https://docs.api7.ai/hub/acl.md): The acl plugin controls access to upstream resources by verifying if the user is on the access control lists, enhancing API management.
#### configuration
Parameters
- [ACL](https://docs.api7.ai/hub/acl/configuration.md): Parameters
### ai-aliyun-content-moderation
The ai-aliyun-content-moderation plugin uses Aliyun to evaluate selected request roles and LLM responses, including streaming responses, against a risk threshold.
- [ai-aliyun-content-moderation](https://docs.api7.ai/hub/ai-aliyun-content-moderation.md): The ai-aliyun-content-moderation plugin uses Aliyun to evaluate selected request roles and LLM responses, including streaming responses, against a risk threshold.
#### configuration
Parameters
- [AI Aliyun Content Moderation](https://docs.api7.ai/hub/ai-aliyun-content-moderation/configuration.md): Parameters
### ai-aws-content-moderation
The ai-aws-content-moderation plugin uses Amazon Comprehend to detect toxicity in selected request roles and LLM responses, including streaming responses.
- [ai-aws-content-moderation](https://docs.api7.ai/hub/ai-aws-content-moderation.md): The ai-aws-content-moderation plugin uses Amazon Comprehend to detect toxicity in selected request roles and LLM responses, including streaming responses.
#### configuration
Parameters
- [AI AWS Content Moderation](https://docs.api7.ai/hub/ai-aws-content-moderation/configuration.md): Parameters
### ai-cache
The ai-cache plugin stores exact and semantically similar LLM responses in Redis, reducing response latency and repeated upstream model usage.
- [ai-cache](https://docs.api7.ai/hub/ai-cache.md): The ai-cache plugin stores exact and semantically similar LLM responses in Redis, reducing response latency and repeated upstream model usage.
#### configuration
Parameters
- [AI Cache](https://docs.api7.ai/hub/ai-cache/configuration.md): Parameters
### ai-lakera-guard
The ai-lakera-guard plugin screens AI traffic through the Lakera Guard API to detect prompt injection and other unsafe content in requests and LLM responses.
- [ai-lakera-guard](https://docs.api7.ai/hub/ai-lakera-guard.md): The ai-lakera-guard plugin screens AI traffic through the Lakera Guard API to detect prompt injection and other unsafe content in requests and LLM responses.
#### configuration
Parameters
- [AI Lakera Guard](https://docs.api7.ai/hub/ai-lakera-guard/configuration.md): Parameters
### ai-prompt-decorator
The ai-prompt-decorator plugin decorates user prompts to LLMs by prefixing and appending pre-engineered prompts, streamlining API operation and content generation.
- [ai-prompt-decorator](https://docs.api7.ai/hub/ai-prompt-decorator.md): The ai-prompt-decorator plugin decorates user prompts to LLMs by prefixing and appending pre-engineered prompts, streamlining API operation and content generation.
#### configuration
Parameters
- [AI Prompt Decorator](https://docs.api7.ai/hub/ai-prompt-decorator/configuration.md): Parameters
### ai-prompt-guard
The ai-prompt-guard plugin safeguards prompts to LLM using allow/deny patterns, ensuring only approved inputs pass. It can check the latest message or full history.
- [ai-prompt-guard](https://docs.api7.ai/hub/ai-prompt-guard.md): The ai-prompt-guard plugin safeguards prompts to LLM using allow/deny patterns, ensuring only approved inputs pass. It can check the latest message or full history.
#### configuration
Parameters
- [AI Prompt Guard](https://docs.api7.ai/hub/ai-prompt-guard/configuration.md): Parameters
### ai-prompt-template
The ai-prompt-template plugin supports pre-configured templates for user inputs to LLMs in a "fill in the blank" fashion, streamlining API management.
- [ai-prompt-template](https://docs.api7.ai/hub/ai-prompt-template.md): The ai-prompt-template plugin supports pre-configured templates for user inputs to LLMs in a "fill in the blank" fashion, streamlining API management.
#### configuration
Parameters
- [AI Prompt Template](https://docs.api7.ai/hub/ai-prompt-template/configuration.md): Parameters
### ai-proxy
The ai-proxy plugin simplifies access to LLM and embedding models providers by converting plugin configurations into the required request format for OpenAI, DeepSeek, Anthropic, and other OpenAI-compatible APIs.
- [ai-proxy](https://docs.api7.ai/hub/ai-proxy.md): The ai-proxy plugin simplifies access to LLM and embedding models providers by converting plugin configurations into the required request format for OpenAI, DeepSeek, Anthropic, and other OpenAI-compatible APIs.
#### configuration
Static Configurations
- [AI Proxy](https://docs.api7.ai/hub/ai-proxy/configuration.md): Static Configurations
### ai-proxy-multi
The ai-proxy-multi plugin extends the capabilities of ai-proxy with load balancing, retries, fallbacks, and health checks, simplifying the integration with OpenAI, DeepSeek, and other OpenAI-compatible APIs.
- [ai-proxy-multi](https://docs.api7.ai/hub/ai-proxy-multi.md): The ai-proxy-multi plugin extends the capabilities of ai-proxy with load balancing, retries, fallbacks, and health checks, simplifying the integration with OpenAI, DeepSeek, and other OpenAI-compatible APIs.
#### configuration
Static Configurations
- [AI Proxy Multi](https://docs.api7.ai/hub/ai-proxy-multi/configuration.md): Static Configurations
### ai-proxy-protocol-reference
Understand how ai-proxy and ai-proxy-multi detect client request protocols and convert Anthropic Messages requests to OpenAI Chat Completions.
- [Protocol Reference](https://docs.api7.ai/hub/ai-proxy-protocol-reference.md): Understand how ai-proxy and ai-proxy-multi detect client request protocols and convert Anthropic Messages requests to OpenAI Chat Completions.
### ai-rag
The ai-rag plugin retrieves context with Azure OpenAI embeddings and Azure AI Search before an LLM request is proxied.
- [ai-rag](https://docs.api7.ai/hub/ai-rag.md): The ai-rag plugin retrieves context with Azure OpenAI embeddings and Azure AI Search before an LLM request is proxied.
#### configuration
Plugin Parameters
- [AI RAG](https://docs.api7.ai/hub/ai-rag/configuration.md): Plugin Parameters
### ai-rate-limiting
The ai-rate-limiting plugin enforces token-based rate limiting for LLM service requests, preventing overuse, optimizing API consumption, and ensuring efficient resource allocation.
- [ai-rate-limiting](https://docs.api7.ai/hub/ai-rate-limiting.md): The ai-rate-limiting plugin enforces token-based rate limiting for LLM service requests, preventing overuse, optimizing API consumption, and ensuring efficient resource allocation.
#### configuration
Parameters
- [AI Rate Limiting](https://docs.api7.ai/hub/ai-rate-limiting/configuration.md): Parameters
### ai-request-rewrite
The ai-request-rewrite plugin forwards client requests to LLM services for processing before sending them upstream, enabling AI-driven redaction, enrichment, and reformatting.
- [ai-request-rewrite](https://docs.api7.ai/hub/ai-request-rewrite.md): The ai-request-rewrite plugin forwards client requests to LLM services for processing before sending them upstream, enabling AI-driven redaction, enrichment, and reformatting.
#### configuration
Parameters
- [AI Request Rewrite](https://docs.api7.ai/hub/ai-request-rewrite/configuration.md): Parameters
### attach-consumer-label
The attach-consumer-label plugin attaches custom consumer labels to authenticated requests, for upstream services to implement additional business logics.
- [attach-consumer-label](https://docs.api7.ai/hub/attach-consumer-label.md): The attach-consumer-label plugin attaches custom consumer labels to authenticated requests, for upstream services to implement additional business logics.
#### configuration
Parameters
- [Attach Consumer Label](https://docs.api7.ai/hub/attach-consumer-label/configuration.md): Parameters
### authz-keycloak
The authz-keycloak plugin integrates with Keycloak for user authentication and authorization, enhancing API security and management.
- [authz-keycloak](https://docs.api7.ai/hub/authz-keycloak.md): The authz-keycloak plugin integrates with Keycloak for user authentication and authorization, enhancing API security and management.
#### configuration
Parameters
- [Authz Keycloak](https://docs.api7.ai/hub/authz-keycloak/configuration.md): Parameters
### aws-lambda
The aws-lambda plugin simplifies APISIX integration with AWS Lambda and Amazon API gateway, supporting authentication via IAM user credentials and API keys.
- [aws-lambda](https://docs.api7.ai/hub/aws-lambda.md): The aws-lambda plugin simplifies APISIX integration with AWS Lambda and Amazon API gateway, supporting authentication via IAM user credentials and API keys.
#### configuration
Attributes
- [AWS Lambda](https://docs.api7.ai/hub/aws-lambda/configuration.md): Attributes
### basic-auth
The basic-auth plugin provides basic access authentication, requiring clients to authenticate before accessing upstream resources, enhancing API security.
- [basic-auth](https://docs.api7.ai/hub/basic-auth.md): The basic-auth plugin provides basic access authentication, requiring clients to authenticate before accessing upstream resources, enhancing API security.
#### configuration
Parameters
- [Basic Auth](https://docs.api7.ai/hub/basic-auth/configuration.md): Parameters
### body-transformer
The body-transformer plugin converts request and response bodies between formats, such as JSON to XML, facilitating seamless data exchange.
- [body-transformer](https://docs.api7.ai/hub/body-transformer.md): The body-transformer plugin converts request and response bodies between formats, such as JSON to XML, facilitating seamless data exchange.
#### configuration
Parameters
- [Body Transformer](https://docs.api7.ai/hub/body-transformer/configuration.md): Parameters
### chaitin-waf
The chaitin-waf plugin integrates with Chaitin WAF (SafeLine) to detect and block web threats, strengthening application security and protecting user data.
- [chaitin-waf](https://docs.api7.ai/hub/chaitin-waf.md): The chaitin-waf plugin integrates with Chaitin WAF (SafeLine) to detect and block web threats, strengthening application security and protecting user data.
#### configuration
Parameters
- [Chaitin WAF](https://docs.api7.ai/hub/chaitin-waf/configuration.md): Parameters
### clickhouse-logger
The clickhouse-logger plugin pushes request and response logs to ClickHouse databases in batches, allowing for customizable log formats to enhance data management.
- [clickhouse-logger](https://docs.api7.ai/hub/clickhouse-logger.md): The clickhouse-logger plugin pushes request and response logs to ClickHouse databases in batches, allowing for customizable log formats to enhance data management.
#### configuration
Parameters
- [ClickHouse Logger](https://docs.api7.ai/hub/clickhouse-logger/configuration.md): Parameters
### consumer-restriction
The consumer-restriction plugin implements access controls based on consumer name, route ID, service ID, or consumer group ID, enhancing API security.
- [consumer-restriction](https://docs.api7.ai/hub/consumer-restriction.md): The consumer-restriction plugin implements access controls based on consumer name, route ID, service ID, or consumer group ID, enhancing API security.
#### configuration
Parameters
- [Consumer Restriction](https://docs.api7.ai/hub/consumer-restriction/configuration.md): Parameters
### cors
The cors plugin enables cross-origin resource sharing, allowing servers to specify permitted origins and instructing browsers to load resources from those origins, enhancing API accessibility.
- [cors](https://docs.api7.ai/hub/cors.md): The cors plugin enables cross-origin resource sharing, allowing servers to specify permitted origins and instructing browsers to load resources from those origins, enhancing API accessibility.
#### configuration
Parameters
- [CORS](https://docs.api7.ai/hub/cors/configuration.md): Parameters
### data-mask
The data-mask plugin removes or replaces sensitive information in request headers, bodies, and URL queries for logging purposes, enhancing data privacy and security.
- [data-mask](https://docs.api7.ai/hub/data-mask.md): The data-mask plugin removes or replaces sensitive information in request headers, bodies, and URL queries for logging purposes, enhancing data privacy and security.
#### configuration
Parameters
- [Data Mask](https://docs.api7.ai/hub/data-mask/configuration.md): Parameters
### datadog
The datadog plugin integrates with Datadog, sending metrics to DogStatsD in batches to improve API monitoring and API performance tracking.
- [datadog](https://docs.api7.ai/hub/datadog.md): The datadog plugin integrates with Datadog, sending metrics to DogStatsD in batches to improve API monitoring and API performance tracking.
#### configuration
Parameters
- [Datadog](https://docs.api7.ai/hub/datadog/configuration.md): Parameters
### degraphql
The degraphql plugin enables communication with upstream GraphQL services through standard HTTP requests by mapping GraphQL queries to HTTP endpoints, simplifying API integration.
- [degraphql](https://docs.api7.ai/hub/degraphql.md): The degraphql plugin enables communication with upstream GraphQL services through standard HTTP requests by mapping GraphQL queries to HTTP endpoints, simplifying API integration.
#### configuration
Parameters
- [degraphql](https://docs.api7.ai/hub/degraphql/configuration.md): Parameters
### elasticsearch-logger
The elasticsearch-logger plugin pushes request and response logs in batches to Elasticsearch, allowing for customizable log formats to enhance data management.
- [elasticsearch-logger](https://docs.api7.ai/hub/elasticsearch-logger.md): The elasticsearch-logger plugin pushes request and response logs in batches to Elasticsearch, allowing for customizable log formats to enhance data management.
#### configuration
Parameters
- [Elasticsearch Logger](https://docs.api7.ai/hub/elasticsearch-logger/configuration.md): Parameters
### error-log-collect
The error-log-collect plugin captures the error logs produced while processing selected requests, including lower-severity entries that the configured log level would otherwise discard, and writes them to the gateway error log for targeted debugging.
- [error-log-collect Enterprise](https://docs.api7.ai/hub/error-log-collect.md): The error-log-collect plugin captures the error logs produced while processing selected requests, including lower-severity entries that the configured log level would otherwise discard, and writes them to the gateway error log for targeted debugging.
#### configuration
Parameters
- [Error Log Collect](https://docs.api7.ai/hub/error-log-collect/configuration.md): Parameters
### error-log-logger
The error-log-logger plugin pushes APISIX's error logs to TCP, Apache SkyWalking, Apache Kafka, or ClickHouse servers, in batches. You can specify the severity level of which the plugin should send the corresponding logs.
- [error-log-logger](https://docs.api7.ai/hub/error-log-logger.md): The error-log-logger plugin pushes APISIX's error logs to TCP, Apache SkyWalking, Apache Kafka, or ClickHouse servers, in batches. You can specify the severity level of which the plugin should send the corresponding logs.
#### configuration
Parameters
- [Error Log Logger](https://docs.api7.ai/hub/error-log-logger/configuration.md): Parameters
### error-page
The error-page plugin customizes gateway-generated 404, 500, 502, and 503 responses without modifying responses returned by upstream services.
- [error-page](https://docs.api7.ai/hub/error-page.md): The error-page plugin customizes gateway-generated 404, 500, 502, and 503 responses without modifying responses returned by upstream services.
#### configuration
Parameters
- [Error Page](https://docs.api7.ai/hub/error-page/configuration.md): Parameters
### exit-transformer
The exit-transformer plugin customizes responses generated by gateway plugins or missing routes before APISIX sends them to clients.
- [exit-transformer](https://docs.api7.ai/hub/exit-transformer.md): The exit-transformer plugin customizes responses generated by gateway plugins or missing routes before APISIX sends them to clients.
#### configuration
Parameters
- [Exit Transformer](https://docs.api7.ai/hub/exit-transformer/configuration.md): Parameters
### fault-injection
The fault-injection plugin tests application resiliency by simulating controlled faults or delays, making it ideal for chaos engineering and failure condition analysis.
- [fault-injection](https://docs.api7.ai/hub/fault-injection.md): The fault-injection plugin tests application resiliency by simulating controlled faults or delays, making it ideal for chaos engineering and failure condition analysis.
#### configuration
Parameters
- [Fault Injection](https://docs.api7.ai/hub/fault-injection/configuration.md): Parameters
### forward-auth
The forward-auth plugin integrates with external authorization services, enhancing API security and access control.
- [forward-auth](https://docs.api7.ai/hub/forward-auth.md): The forward-auth plugin integrates with external authorization services, enhancing API security and access control.
#### configuration
Parameters
- [Forward Auth](https://docs.api7.ai/hub/forward-auth/configuration.md): Parameters
### google-cloud-logging
The google-cloud-logging plugin pushes request and response logs in batches to Google Cloud Logging Service and supports the customization of log formats.
- [google-cloud-logging](https://docs.api7.ai/hub/google-cloud-logging.md): The google-cloud-logging plugin pushes request and response logs in batches to Google Cloud Logging Service and supports the customization of log formats.
#### configuration
Parameters
- [Google Cloud Logging](https://docs.api7.ai/hub/google-cloud-logging/configuration.md): Parameters
### graphql-limit-count
The graphql-limit-count plugin uses fixed windows to limit accumulated GraphQL document cost, with selection depth as the default measure.
- [graphql-limit-count](https://docs.api7.ai/hub/graphql-limit-count.md): The graphql-limit-count plugin uses fixed windows to limit accumulated GraphQL document cost, with selection depth as the default measure.
#### configuration
Parameters
- [GraphQL Limit Count](https://docs.api7.ai/hub/graphql-limit-count/configuration.md): Parameters
### graphql-proxy-cache
The graphql-proxy-cache plugin enables caching of responses for GraphQL queries, improving API performance.
- [graphql-proxy-cache](https://docs.api7.ai/hub/graphql-proxy-cache.md): The graphql-proxy-cache plugin enables caching of responses for GraphQL queries, improving API performance.
#### configuration
Static Configurations
- [GraphQL Proxy Cache](https://docs.api7.ai/hub/graphql-proxy-cache/configuration.md): Static Configurations
### grpc-transcode
The grpc-transcode plugin converts between HTTP and gRPC requests and responses, facilitating seamless communication between different API protocols.
- [grpc-transcode](https://docs.api7.ai/hub/grpc-transcode.md): The grpc-transcode plugin converts between HTTP and gRPC requests and responses, facilitating seamless communication between different API protocols.
#### configuration
Parameters
- [gRPC Transcode](https://docs.api7.ai/hub/grpc-transcode/configuration.md): Parameters
### grpc-web
The grpc-web plugin enables the gateway to handle gRPC-Web requests from browsers and JavaScript clients by translating them into standard gRPC calls and forwarding them to upstream gRPC services.
- [grpc-web](https://docs.api7.ai/hub/grpc-web.md): The grpc-web plugin enables the gateway to handle gRPC-Web requests from browsers and JavaScript clients by translating them into standard gRPC calls and forwarding them to upstream gRPC services.
#### configuration
Parameters
- [gRPC Web](https://docs.api7.ai/hub/grpc-web/configuration.md): Parameters
### hmac-auth
The hmac-auth plugin supports HMAC authentication to ensure request integrity, preventing modifications during transmission and enhancing API security.
- [hmac-auth](https://docs.api7.ai/hub/hmac-auth.md): The hmac-auth plugin supports HMAC authentication to ensure request integrity, preventing modifications during transmission and enhancing API security.
#### configuration
Parameters
- [HMAC Auth](https://docs.api7.ai/hub/hmac-auth/configuration.md): Parameters
### http-logger
The http-logger plugin pushes request and response logs as JSON objects to HTTP(S) servers in batches, allowing for customizable log formats to enhance data management.
- [http-logger](https://docs.api7.ai/hub/http-logger.md): The http-logger plugin pushes request and response logs as JSON objects to HTTP(S) servers in batches, allowing for customizable log formats to enhance data management.
#### configuration
Parameters
- [HTTP Logger](https://docs.api7.ai/hub/http-logger/configuration.md): Parameters
### ip-restriction
The ip-restriction plugin restricts access to upstream resources based on an IP address whitelist or blacklist, improving API security.
- [ip-restriction](https://docs.api7.ai/hub/ip-restriction.md): The ip-restriction plugin restricts access to upstream resources based on an IP address whitelist or blacklist, improving API security.
#### configuration
Parameters
- [IP Restriction](https://docs.api7.ai/hub/ip-restriction/configuration.md): Parameters
### jwe-decrypt
The jwe-decrypt plugin decrypts its supported five-part compact token format and forwards the plaintext in a configured request header.
- [jwe-decrypt](https://docs.api7.ai/hub/jwe-decrypt.md): The jwe-decrypt plugin decrypts its supported five-part compact token format and forwards the plaintext in a configured request header.
#### configuration
Parameters
- [JWE Decrypt](https://docs.api7.ai/hub/jwe-decrypt/configuration.md): Parameters
### jwt-auth
The jwt-auth plugin supports the use of JSON Web Token (JWT) for client authentication before accessing upstream resources, enhancing API security measures.
- [jwt-auth](https://docs.api7.ai/hub/jwt-auth.md): The jwt-auth plugin supports the use of JSON Web Token (JWT) for client authentication before accessing upstream resources, enhancing API security measures.
#### configuration
Parameters
- [JWT Auth](https://docs.api7.ai/hub/jwt-auth/configuration.md): Parameters
### kafka-logger
The kafka-logger plugin pushes request and response logs as JSON objects to Apache Kafka clusters in batches, allowing for customizable log formats to enhance data management.
- [kafka-logger](https://docs.api7.ai/hub/kafka-logger.md): The kafka-logger plugin pushes request and response logs as JSON objects to Apache Kafka clusters in batches, allowing for customizable log formats to enhance data management.
#### configuration
Parameters
- [Kafka Logger](https://docs.api7.ai/hub/kafka-logger/configuration.md): Parameters
### key-auth
The key-auth plugin allows clients to authenticate using an authentication key before accessing upstream resources, enhancing API security measures.
- [key-auth](https://docs.api7.ai/hub/key-auth.md): The key-auth plugin allows clients to authenticate using an authentication key before accessing upstream resources, enhancing API security measures.
#### configuration
Parameters
- [Key Auth](https://docs.api7.ai/hub/key-auth/configuration.md): Parameters
### ldap-auth-advanced
The ldap-auth-advanced plugin authenticates clients against an LDAP directory and maps the authenticated user onto a consumer, so directory identities can be used with per-consumer plugins, rate limits, and analytics.
- [ldap-auth-advanced](https://docs.api7.ai/hub/ldap-auth-advanced.md): The ldap-auth-advanced plugin authenticates clients against an LDAP directory and maps the authenticated user onto a consumer, so directory identities can be used with per-consumer plugins, rate limits, and analytics.
#### configuration
Parameters
- [LDAP Auth Advanced](https://docs.api7.ai/hub/ldap-auth-advanced/configuration.md): Parameters
### limit-conn
The limit-conn plugin restricts the rate of requests by managing concurrent connections. Requests exceeding the threshold may be delayed or rejected, ensuring controlled API usage and preventing overload.
- [limit-conn](https://docs.api7.ai/hub/limit-conn.md): The limit-conn plugin restricts the rate of requests by managing concurrent connections. Requests exceeding the threshold may be delayed or rejected, ensuring controlled API usage and preventing overload.
#### configuration
Parameters
- [Limit Conn](https://docs.api7.ai/hub/limit-conn/configuration.md): Parameters
### limit-count
The limit-count plugin enforces API rate limiting with a fixed window algorithm, restricting requests within a time interval. Requests over the quota are rejected.
- [limit-count](https://docs.api7.ai/hub/limit-count.md): The limit-count plugin enforces API rate limiting with a fixed window algorithm, restricting requests within a time interval. Requests over the quota are rejected.
#### configuration
Parameters
- [Limit Count](https://docs.api7.ai/hub/limit-count/configuration.md): Parameters
### limit-count-advanced
The limit-count-advanced plugin enforces API rate limiting with a fixed window or sliding window algorithm, restricting requests within a time window. Requests over the quota are rejected.
- [limit-count-advanced Enterprise](https://docs.api7.ai/hub/limit-count-advanced.md): The limit-count-advanced plugin enforces API rate limiting with a fixed window or sliding window algorithm, restricting requests within a time window. Requests over the quota are rejected.
#### configuration
Parameters
- [Limit Count Advanced](https://docs.api7.ai/hub/limit-count-advanced/configuration.md): Parameters
### limit-req
The limit-req plugin enforces API rate limiting with a leaky bucket algorithm to rate limit requests, enabling effective throttling to manage traffic flow.
- [limit-req](https://docs.api7.ai/hub/limit-req.md): The limit-req plugin enforces API rate limiting with a leaky bucket algorithm to rate limit requests, enabling effective throttling to manage traffic flow.
#### configuration
Parameters
- [Limit Req](https://docs.api7.ai/hub/limit-req/configuration.md): Parameters
### loki-logger
The loki-logger plugin sends request and response logs as JSON objects to Grafana Loki in batches via the Loki HTTP API, allowing for customizable log formats to enhance data management.
- [loki-logger](https://docs.api7.ai/hub/loki-logger.md): The loki-logger plugin sends request and response logs as JSON objects to Grafana Loki in batches via the Loki HTTP API, allowing for customizable log formats to enhance data management.
#### configuration
Parameters
- [Loki Logger](https://docs.api7.ai/hub/loki-logger/configuration.md): Parameters
### mcp-tools-acl
The mcp-tools-acl plugin provides per-consumer access control for MCP tool calls on routes powered by openapi-to-mcp, supporting rule-based allowlist and denylist modes with optional expression conditions.
- [mcp-tools-acl Enterprise](https://docs.api7.ai/hub/mcp-tools-acl.md): The mcp-tools-acl plugin provides per-consumer access control for MCP tool calls on routes powered by openapi-to-mcp, supporting rule-based allowlist and denylist modes with optional expression conditions.
#### configuration
Parameters
- [MCP Tools ACL](https://docs.api7.ai/hub/mcp-tools-acl/configuration.md): Parameters
### mocking
The mocking plugin simulates API responses without forwarding requests to upstream services, offering customization of status codes, response bodies, headers, and more for API testing and development.
- [mocking](https://docs.api7.ai/hub/mocking.md): The mocking plugin simulates API responses without forwarding requests to upstream services, offering customization of status codes, response bodies, headers, and more for API testing and development.
#### configuration
Parameters
- [Mocking](https://docs.api7.ai/hub/mocking/configuration.md): Parameters
### mqtt-proxy
The mqtt-proxy plugin supports proxying and load balancing MQTT requests to MQTT servers, enhancing API operation and management.
- [mqtt-proxy](https://docs.api7.ai/hub/mqtt-proxy.md): The mqtt-proxy plugin supports proxying and load balancing MQTT requests to MQTT servers, enhancing API operation and management.
#### configuration
Parameters
- [MQTT Proxy](https://docs.api7.ai/hub/mqtt-proxy/configuration.md): Parameters
### multi-auth
The multi-auth plugin enables consumers using diverse authentication methods to share the same route or service, streamlining API lifecycle management.
- [multi-auth](https://docs.api7.ai/hub/multi-auth.md): The multi-auth plugin enables consumers using diverse authentication methods to share the same route or service, streamlining API lifecycle management.
#### configuration
Parameters
- [Multi Auth](https://docs.api7.ai/hub/multi-auth/configuration.md): Parameters
### oas-validator
The oas-validator plugin checks incoming HTTP requests against an OpenAPI specification before they are forwarded to upstream services.
- [oas-validator](https://docs.api7.ai/hub/oas-validator.md): The oas-validator plugin checks incoming HTTP requests against an OpenAPI specification before they are forwarded to upstream services.
#### configuration
Parameters
- [OAS Validator](https://docs.api7.ai/hub/oas-validator/configuration.md): Parameters
### opa
The OPA plugin integrates with Open Policy Agent, enabling unified policy definition and enforcement for authorization in API operations.
- [OPA](https://docs.api7.ai/hub/opa.md): The OPA plugin integrates with Open Policy Agent, enabling unified policy definition and enforcement for authorization in API operations.
#### configuration
Parameters
- [OPA](https://docs.api7.ai/hub/opa/configuration.md): Parameters
### openapi-to-mcp
The openapi-to-mcp plugin lets API7 expose OpenAPI services through MCP, proxy requests with custom headers, and support real-time SSE streaming.
- [openapi-to-mcp Enterprise](https://docs.api7.ai/hub/openapi-to-mcp.md): The openapi-to-mcp plugin lets API7 expose OpenAPI services through MCP, proxy requests with custom headers, and support real-time SSE streaming.
#### configuration
Static Configurations
- [OpenAPI to MCP](https://docs.api7.ai/hub/openapi-to-mcp/configuration.md): Static Configurations
### openid-connect
The openid-connect plugin integrates with OIDC providers like Keycloak and Auth0, simplifying user authentication in API management.
- [openid-connect](https://docs.api7.ai/hub/openid-connect.md): The openid-connect plugin integrates with OIDC providers like Keycloak and Auth0, simplifying user authentication in API management.
#### configuration
Parameters
- [OpenID Connect](https://docs.api7.ai/hub/openid-connect/configuration.md): Parameters
### opentelemetry
The opentelemetry plugin instruments the API gateway, sending traces to the OpenTelemetry collector for monitoring API operations per OpenTelemetry specs.
- [OpenTelemetry](https://docs.api7.ai/hub/opentelemetry.md): The opentelemetry plugin instruments the API gateway, sending traces to the OpenTelemetry collector for monitoring API operations per OpenTelemetry specs.
#### configuration
Parameters
- [OpenTelemetry](https://docs.api7.ai/hub/opentelemetry/configuration.md): Parameters
### prometheus
The Prometheus plugin integrates with Prometheus for metric collection and continuous monitoring, enhancing API observability.
- [Prometheus](https://docs.api7.ai/hub/prometheus.md): The Prometheus plugin integrates with Prometheus for metric collection and continuous monitoring, enhancing API observability.
#### configuration
Static Configurations
- [Prometheus](https://docs.api7.ai/hub/prometheus/configuration.md): Static Configurations
### proxy-buffering
The proxy-buffering plugin dynamically disables NGINX proxy buffering, optimizing performance with SSE and other streaming upstream services in API gateway.
- [proxy-buffering](https://docs.api7.ai/hub/proxy-buffering.md): The proxy-buffering plugin dynamically disables NGINX proxy buffering, optimizing performance with SSE and other streaming upstream services in API gateway.
#### configuration
Parameters
- [Proxy Buffering](https://docs.api7.ai/hub/proxy-buffering/configuration.md): Parameters
### proxy-cache
The proxy-cache plugin caches responses based on keys, supporting disk and memory caching for GET, POST, and HEAD requests, enhancing API performance.
- [proxy-cache](https://docs.api7.ai/hub/proxy-cache.md): The proxy-cache plugin caches responses based on keys, supporting disk and memory caching for GET, POST, and HEAD requests, enhancing API performance.
#### configuration
Static Configurations
- [Proxy Cache](https://docs.api7.ai/hub/proxy-cache/configuration.md): Static Configurations
### proxy-mirror
The proxy-mirror plugin duplicates ingress traffic to API gateway, forwarding it to a designated upstream while keeping regular services uninterrupted.
- [proxy-mirror](https://docs.api7.ai/hub/proxy-mirror.md): The proxy-mirror plugin duplicates ingress traffic to API gateway, forwarding it to a designated upstream while keeping regular services uninterrupted.
#### configuration
Static Configurations
- [Proxy Mirror](https://docs.api7.ai/hub/proxy-mirror/configuration.md): Static Configurations
### proxy-rewrite
The proxy-rewrite plugin offers flexible options to rewrite requests that API gateway forwards to upstream services, enhancing API management.
- [proxy-rewrite](https://docs.api7.ai/hub/proxy-rewrite.md): The proxy-rewrite plugin offers flexible options to rewrite requests that API gateway forwards to upstream services, enhancing API management.
#### configuration
Parameters
- [Proxy Rewrite](https://docs.api7.ai/hub/proxy-rewrite/configuration.md): Parameters
### public-api
The public-api plugin exposes internal API endpoints, allowing external access while maintaining control over API management and security.
- [public-api](https://docs.api7.ai/hub/public-api.md): The public-api plugin exposes internal API endpoints, allowing external access while maintaining control over API management and security.
#### configuration
Parameters
- [Public API](https://docs.api7.ai/hub/public-api/configuration.md): Parameters
### real-ip
The real-ip plugin enables the API gateway to fetch the client's real IP using the IP address from the HTTP header or query string, improving data quality.
- [real-ip](https://docs.api7.ai/hub/real-ip.md): The real-ip plugin enables the API gateway to fetch the client's real IP using the IP address from the HTTP header or query string, improving data quality.
#### configuration
Parameters
- [Real IP](https://docs.api7.ai/hub/real-ip/configuration.md): Parameters
### request-id
The request-id plugin adds a unique ID to each request proxied through the API gateway, facilitating effective tracking of API requests for better API management.
- [request-id](https://docs.api7.ai/hub/request-id.md): The request-id plugin adds a unique ID to each request proxied through the API gateway, facilitating effective tracking of API requests for better API management.
#### configuration
Parameters
- [Request ID](https://docs.api7.ai/hub/request-id/configuration.md): Parameters
### request-validation
The request-validation plugin checks requests for compliance before forwarding them to upstream services, enhancing security in API operations.
- [request-validation](https://docs.api7.ai/hub/request-validation.md): The request-validation plugin checks requests for compliance before forwarding them to upstream services, enhancing security in API operations.
#### configuration
Parameters
- [Request Validation](https://docs.api7.ai/hub/request-validation/configuration.md): Parameters
### response-rewrite
The response-rewrite plugin allows rewriting of responses from API gateway and upstream services, providing flexibility in API responses.
- [response-rewrite](https://docs.api7.ai/hub/response-rewrite.md): The response-rewrite plugin allows rewriting of responses from API gateway and upstream services, providing flexibility in API responses.
#### configuration
Parameters
- [Response Rewrite](https://docs.api7.ai/hub/response-rewrite/configuration.md): Parameters
### rocketmq-logger
The rocketmq-logger plugin pushes request and response logs as JSON objects to RocketMQ clusters in batches, allowing for customizable log formats to enhance data management.
- [rocketmq-logger](https://docs.api7.ai/hub/rocketmq-logger.md): The rocketmq-logger plugin pushes request and response logs as JSON objects to RocketMQ clusters in batches, allowing for customizable log formats to enhance data management.
#### configuration
Parameters
- [RocketMQ Logger](https://docs.api7.ai/hub/rocketmq-logger/configuration.md): Parameters
### saml-auth
The saml-auth plugin enables user authentication via SAML 2.0 in the API gateway by interacting with identity providers (IdP), enhancing API security.
- [saml-auth](https://docs.api7.ai/hub/saml-auth.md): The saml-auth plugin enables user authentication via SAML 2.0 in the API gateway by interacting with identity providers (IdP), enhancing API security.
#### configuration
Parameters
- [SAML Auth](https://docs.api7.ai/hub/saml-auth/configuration.md): Parameters
### serverless-functions
The serverless function plugins (pre-function and post-function) allow execution of user-defined logic at the start or end of specified execution phases in API gateway.
- [Serverless Functions](https://docs.api7.ai/hub/serverless-functions.md): The serverless function plugins (pre-function and post-function) allow execution of user-defined logic at the start or end of specified execution phases in API gateway.
#### configuration
Parameters
- [Serverless Functions](https://docs.api7.ai/hub/serverless-functions/configuration.md): Parameters
### skywalking
The skywalking plugin integrates with Apache SkyWalking for effective request tracing, enhancing API observability.
- [SkyWalking](https://docs.api7.ai/hub/skywalking.md): The skywalking plugin integrates with Apache SkyWalking for effective request tracing, enhancing API observability.
#### configuration
Static Configurations
- [skywalking](https://docs.api7.ai/hub/skywalking/configuration.md): Static Configurations
### skywalking-logger
The skywalking-logger pushes request and response logs as JSON objects to SkyWalking OAP server in batches, allowing for customizable log formats to enhance data management.
- [skywalking-logger](https://docs.api7.ai/hub/skywalking-logger.md): The skywalking-logger pushes request and response logs as JSON objects to SkyWalking OAP server in batches, allowing for customizable log formats to enhance data management.
#### configuration
Parameters
- [SkyWalking Logger](https://docs.api7.ai/hub/skywalking-logger/configuration.md): Parameters
### soap
The soap plugin simplifies transformation between RESTful HTTP requests and SOAP requests, including their corresponding responses, for better API interoperability.
- [soap Enterprise](https://docs.api7.ai/hub/soap.md): The soap plugin simplifies transformation between RESTful HTTP requests and SOAP requests, including their corresponding responses, for better API interoperability.
#### configuration
Static Configurations
- [SOAP](https://docs.api7.ai/hub/soap/configuration.md): Static Configurations
### splunk-hec-logging
The splunk-hec-logging plugin serializes request and response context information to Splunk Event Data format and push to your Splunk HTTP Event Collector (HEC) in batches, allowing for customizable log formats to enhance data management.
- [splunk-hec-logging](https://docs.api7.ai/hub/splunk-hec-logging.md): The splunk-hec-logging plugin serializes request and response context information to Splunk Event Data format and push to your Splunk HTTP Event Collector (HEC) in batches, allowing for customizable log formats to enhance data management.
#### configuration
Parameters
- [splunk-hec-logging](https://docs.api7.ai/hub/splunk-hec-logging/configuration.md): Parameters
### syslog
The syslog plugin pushes request and response logs as JSON objects to syslog servers in batches, allowing for customizable log formats to enhance data management.
- [syslog](https://docs.api7.ai/hub/syslog.md): The syslog plugin pushes request and response logs as JSON objects to syslog servers in batches, allowing for customizable log formats to enhance data management.
#### configuration
Parameters
- [syslog](https://docs.api7.ai/hub/syslog/configuration.md): Parameters
### traffic-label
The traffic-label plugin evaluates request expressions and applies weighted request-header changes for conditional traffic management.
- [traffic-label](https://docs.api7.ai/hub/traffic-label.md): The traffic-label plugin evaluates request expressions and applies weighted request-header changes for conditional traffic management.
#### configuration
Parameters
- [Traffic Label](https://docs.api7.ai/hub/traffic-label/configuration.md): Parameters
### traffic-split
The traffic-split plugin directs traffic to multiple upstream services based on conditions or weights, providing a flexible approach for API release strategies and traffic management.
- [traffic-split](https://docs.api7.ai/hub/traffic-split.md): The traffic-split plugin directs traffic to multiple upstream services based on conditions or weights, providing a flexible approach for API release strategies and traffic management.
#### configuration
Parameters
- [Traffic Split](https://docs.api7.ai/hub/traffic-split/configuration.md): Parameters
### ua-restriction
The ua-restriction plugin restricts access to upstream resources using an allowlist or denylist of user agents, preventing overload from web crawlers and enhancing API security.
- [ua-restriction](https://docs.api7.ai/hub/ua-restriction.md): The ua-restriction plugin restricts access to upstream resources using an allowlist or denylist of user agents, preventing overload from web crawlers and enhancing API security.
#### configuration
Parameters
- [UA Restriction](https://docs.api7.ai/hub/ua-restriction/configuration.md): Parameters
### workflow
The workflow plugin enables conditional execution of user-defined actions on client traffic based on specific rules, allowing granular API traffic management.
- [workflow](https://docs.api7.ai/hub/workflow.md): The workflow plugin enables conditional execution of user-defined actions on client traffic based on specific rules, allowing granular API traffic management.
#### configuration
Parameters
- [Workflow](https://docs.api7.ai/hub/workflow/configuration.md): Parameters
### zipkin
The zipkin plugin instruments the API gateway to send traces to Zipkin or compatible collectors like Jaeger and Apache SkyWalking, enhancing request tracing capabilities.
- [zipkin](https://docs.api7.ai/hub/zipkin.md): The zipkin plugin instruments the API gateway to send traces to Zipkin or compatible collectors like Jaeger and Apache SkyWalking, enhancing request tracing capabilities.
#### configuration
Static Configurations
- [Zipkin](https://docs.api7.ai/hub/zipkin/configuration.md): Static Configurations
## ingress-controller
### apply-plugins-to-l4-routes
Learn how to attach APISIX stream plugins to Gateway API TCPRoute, UDPRoute, and TLSRoute resources by configuring and verifying an L4RoutePolicy.
- [Apply Plugins to L4 Routes](https://docs.api7.ai/ingress-controller/apply-plugins-to-l4-routes.md): Learn how to attach APISIX stream plugins to Gateway API TCPRoute, UDPRoute, and TLSRoute resources by configuring and verifying an L4RoutePolicy.
### canary-releases
Plan canary releases with APISIX or API7 Ingress Controller by coordinating workloads, weighted routes, analysis, promotion, and rollback.
- [Canary Releases](https://docs.api7.ai/ingress-controller/canary-releases.md): Plan canary releases with APISIX or API7 Ingress Controller by coordinating workloads, weighted routes, analysis, promotion, and rollback.
#### argo-rollouts
Configure Argo Rollouts to shift APISIX or API7 Gateway traffic with HTTPRoute or ApisixRoute, then promote, analyze, and abort releases.
- [Canary Releases with Argo Rollouts](https://docs.api7.ai/ingress-controller/canary-releases/argo-rollouts.md): Configure Argo Rollouts to shift APISIX or API7 Gateway traffic with HTTPRoute or ApisixRoute, then promote, analyze, and abort releases.
#### flagger
Use Flagger and APISIX metrics to automate canary analysis, promotion, and rollback through Gateway API HTTPRoute or ApisixRoute resources.
- [Automated Canary Releases with Flagger](https://docs.api7.ai/ingress-controller/canary-releases/flagger.md): Use Flagger and APISIX metrics to automate canary analysis, promotion, and rollback through Gateway API HTTPRoute or ApisixRoute resources.
### common-use-cases
Explore common use cases enabled by the gateway’s plugin ecosystem and learn how to configure these plugins using the Ingress Controller.
- [Common Use Cases](https://docs.api7.ai/ingress-controller/common-use-cases.md): Explore common use cases enabled by the gateway’s plugin ecosystem and learn how to configure these plugins using the Ingress Controller.
### configure-upstream-health-checks
Learn how to configure APISIX or API7 Ingress Controller to configure upstream health checks.
- [Configure Upstream Health Checks](https://docs.api7.ai/ingress-controller/configure-upstream-health-checks.md): Learn how to configure APISIX or API7 Ingress Controller to configure upstream health checks.
### custom-plugins
#### lua
Learn how to load Lua custom plugins into gateways in a Kubernetes environment and apply them to routes using APISIX or API7 Ingress Controller.
- [Deploy Lua Custom Plugins](https://docs.api7.ai/ingress-controller/custom-plugins/lua.md): Learn how to load Lua custom plugins into gateways in a Kubernetes environment and apply them to routes using APISIX or API7 Ingress Controller.
#### wasm
Learn how to load Wasm custom plugins into gateways in a Kubernetes environment and apply them to routes using APISIX Ingress Controller.
- [Deploy Wasm Plugins](https://docs.api7.ai/ingress-controller/custom-plugins/wasm.md): Learn how to load Wasm custom plugins into gateways in a Kubernetes environment and apply them to routes using APISIX Ingress Controller.
### detect-upstream-protocol-appprotocol
Learn how to use APISIX or API7 Ingress Controller to automatically configure upstream protocols based on the values of appProtocol.
- [Detect Upstream Protocol with appProtocol](https://docs.api7.ai/ingress-controller/detect-upstream-protocol-appprotocol.md): Learn how to use APISIX or API7 Ingress Controller to automatically configure upstream protocols based on the values of appProtocol.
### documentation
Explore API7 and APISIX Ingress Controller docs, covering installation, how-tos, troubleshooting, and reference for dynamic traffic routing via Ingress, Gateway API, and APISIX CRDs.
- [Ingress Controller Documentation](https://docs.api7.ai/ingress-controller/documentation.md): Explore API7 and APISIX Ingress Controller docs, covering installation, how-tos, troubleshooting, and reference for dynamic traffic routing via Ingress, Gateway API, and APISIX CRDs.
### high-availability
Configure APISIX or API7 Ingress Controller replicas, placement, leader election, and failover validation for a highly available deployment.
- [High Availability](https://docs.api7.ai/ingress-controller/high-availability.md): Configure APISIX or API7 Ingress Controller replicas, placement, leader election, and failover validation for a highly available deployment.
### installation
#### gitops
Plan a GitOps deployment of APISIX or API7 Ingress Controller, including repository structure, resource ownership, CRDs, and credentials.
- [Prepare for GitOps](https://docs.api7.ai/ingress-controller/installation/gitops.md): Plan a GitOps deployment of APISIX or API7 Ingress Controller, including repository structure, resource ownership, CRDs, and credentials.
- [Manage with Argo CD](https://docs.api7.ai/ingress-controller/installation/gitops/argo-cd.md): Install APISIX or API7 Ingress Controller with Argo CD using stable webhook certificates, explicit CRD ownership, and safe reconciliation.
- [Manage with Flux](https://docs.api7.ai/ingress-controller/installation/gitops/flux.md): Install APISIX or API7 Ingress Controller with Flux using HelmRelease resources, explicit CRD policies, drift detection, and verification.
#### openshift
Learn how to install API7 Ingress Controller on an OpenShift cluster, including prerequisites, configuration, and verification steps.
- [Install API7 Ingress Controller on OpenShift](https://docs.api7.ai/ingress-controller/installation/openshift.md): Learn how to install API7 Ingress Controller on an OpenShift cluster, including prerequisites, configuration, and verification steps.
### production
#### cross-namespace
Configure secure cross-namespace references for Routes, backends, TLS Secrets, and Consumer credentials with APISIX or API7 Ingress Controller.
- [Configure Cross-Namespace References](https://docs.api7.ai/ingress-controller/production/cross-namespace.md): Configure secure cross-namespace references for Routes, backends, TLS Secrets, and Consumer credentials with APISIX or API7 Ingress Controller.
#### gateway-api-access-control
Delegate Gateway API resource management safely between platform and application teams with Kubernetes RBAC for APISIX or API7 Ingress Controller.
- [Delegate Gateway API Access with Kubernetes RBAC](https://docs.api7.ai/ingress-controller/production/gateway-api-access-control.md): Delegate Gateway API resource management safely between platform and application teams with Kubernetes RBAC for APISIX or API7 Ingress Controller.
#### upgrade
Upgrade APISIX or API7 Ingress Controller from 2.1.0 to 2.2.0 by updating CRDs, reviewing compatibility changes, and verifying traffic.
- [Upgrade Ingress Controller](https://docs.api7.ai/ingress-controller/production/upgrade.md): Upgrade APISIX or API7 Ingress Controller from 2.1.0 to 2.2.0 by updating CRDs, reviewing compatibility changes, and verifying traffic.
### proxy-grpc-traffic
Learn how to use APISIX or API7 Ingress Controller to configure routes to proxy gRPC traffic.
- [Proxy gRPC Traffic](https://docs.api7.ai/ingress-controller/proxy-grpc-traffic.md): Learn how to use APISIX or API7 Ingress Controller to configure routes to proxy gRPC traffic.
### proxy-requests-to-a-service
Learn how to create a route with the Ingress Controller to proxy requests to a sample HTTP upstream service and verify routing, enabling efficient API traffic management.
- [Proxy Requests to a Service](https://docs.api7.ai/ingress-controller/proxy-requests-to-a-service.md): Learn how to create a route with the Ingress Controller to proxy requests to a sample HTTP upstream service and verify routing, enabling efficient API traffic management.
### proxy-tcp-traffic
Learn how to configure APISIX or API7 Ingress Controller to proxy TCP traffic by port.
- [Proxy TCP Traffic by Port](https://docs.api7.ai/ingress-controller/proxy-tcp-traffic.md): Learn how to configure APISIX or API7 Ingress Controller to proxy TCP traffic by port.
### proxy-tcp-traffic-over-tls
Learn how to use APISIX or API7 Ingress Controller to configure routes to proxy TCP traffic over TLS by SNI.
- [Proxy TCP Traffic over TLS by SNI](https://docs.api7.ai/ingress-controller/proxy-tcp-traffic-over-tls.md): Learn how to use APISIX or API7 Ingress Controller to configure routes to proxy TCP traffic over TLS by SNI.
### proxy-to-external-services
Learn how to configure APISIX or API7 Ingress Controller to proxy requests to external services hosted outside your Kubernetes cluster.
- [Proxy Requests to External Services](https://docs.api7.ai/ingress-controller/proxy-to-external-services.md): Learn how to configure APISIX or API7 Ingress Controller to proxy requests to external services hosted outside your Kubernetes cluster.
### proxy-to-weighted-backends
Learn how to configure weighted routing to distribute traffic across multiple upstream services using APISIX or API7 Ingress Controller.
- [Proxy Requests to Weighted Backends](https://docs.api7.ai/ingress-controller/proxy-to-weighted-backends.md): Learn how to configure weighted routing to distribute traffic across multiple upstream services using APISIX or API7 Ingress Controller.
### proxy-udp-traffic
Learn how to configure APISIX or API7 Ingress Controller to proxy UDP traffic by port.
- [Proxy UDP Traffic by Port](https://docs.api7.ai/ingress-controller/proxy-udp-traffic.md): Learn how to configure APISIX or API7 Ingress Controller to proxy UDP traffic by port.
### proxy-websocket-connection
Learn how to configure APISIX or API7 Ingress Controller to configure routes to proxy WebSocket connections.
- [Proxy WebSocket Connection](https://docs.api7.ai/ingress-controller/proxy-websocket-connection.md): Learn how to configure APISIX or API7 Ingress Controller to configure routes to proxy WebSocket connections.
### reference
#### annotations
Learn how annotations extend the functionality of Kubernetes Ingress and IngressClass resource in the Ingress Controller to configure routing, security, and gateway behaviors.
- [Annotations](https://docs.api7.ai/ingress-controller/reference/annotations.md): Learn how annotations extend the functionality of Kubernetes Ingress and IngressClass resource in the Ingress Controller to configure routing, security, and gateway behaviors.
#### configuration-file
Configure APISIX or API7 Ingress Controller logging, leader election, metrics, synchronization, Gateway API, and webhook settings.
- [Configuration File](https://docs.api7.ai/ingress-controller/reference/configuration-file.md): Configure APISIX or API7 Ingress Controller logging, leader election, metrics, synchronization, Gateway API, and webhook settings.
#### crd-reference
Explore detailed reference documentation for the custom resource definitions (CRDs) supported by the Ingress Controller.
- [Custom Resource Definitions API Reference](https://docs.api7.ai/ingress-controller/reference/crd-reference.md): Explore detailed reference documentation for the custom resource definitions (CRDs) supported by the Ingress Controller.
#### examples
Discover various examples showcasing the Ingress Controller resource configurations to help you effectively tailor settings for your environment.
- [Configuration Examples](https://docs.api7.ai/ingress-controller/reference/examples.md): Discover various examples showcasing the Ingress Controller resource configurations to help you effectively tailor settings for your environment.
#### helm-charts
Learn about the Helm charts for deploying APISIX and API7 Ingress Controllers, including how they function and references for configurable chart values.
- [Helm Charts](https://docs.api7.ai/ingress-controller/reference/helm-charts.md): Learn about the Helm charts for deploying APISIX and API7 Ingress Controllers, including how they function and references for configurable chart values.
#### ingress-and-gateway-api-support
Learn about the Gateway API and Ingress resources supported by the Ingress Controller and their current capabilities.
- [Ingress and Gateway API Support](https://docs.api7.ai/ingress-controller/reference/ingress-and-gateway-api-support.md): Learn about the Gateway API and Ingress resources supported by the Ingress Controller and their current capabilities.
### release-notes
Review shared and product-specific changes, upgrade requirements, compatibility, and important fixes for APISIX and API7 Ingress Controller releases.
- [Release Notes](https://docs.api7.ai/ingress-controller/release-notes.md): Review shared and product-specific changes, upgrade requirements, compatibility, and important fixes for APISIX and API7 Ingress Controller releases.
### set-up-ingress-controller-and-gateway
Learn how to quickly deploy and configure API7 Ingress Controller or APISIX Ingress Controller for managing Kubernetes ingress traffic.
- [Set Up Ingress Controller and Gateway](https://docs.api7.ai/ingress-controller/set-up-ingress-controller-and-gateway.md): Learn how to quickly deploy and configure API7 Ingress Controller or APISIX Ingress Controller for managing Kubernetes ingress traffic.
### tls-and-mtls
#### configure-downstream-https
Learn how to use APISIX or API7 Ingress Controller to configure the gateway to accept HTTPS traffic from clients.
- [Configure HTTPS Between Client and Gateway](https://docs.api7.ai/ingress-controller/tls-and-mtls/configure-downstream-https.md): Learn how to use APISIX or API7 Ingress Controller to configure the gateway to accept HTTPS traffic from clients.
#### configure-downstream-mtls
Learn how to use APISIX or API7 Ingress Controller to configure the gateway to require mutual TLS (mTLS) from clients.
- [Configure mTLS Between Client and Gateway](https://docs.api7.ai/ingress-controller/tls-and-mtls/configure-downstream-mtls.md): Learn how to use APISIX or API7 Ingress Controller to configure the gateway to require mutual TLS (mTLS) from clients.
#### configure-upstream-mtls
Learn how to use APISIX or API7 Ingress Controller to configure the gateway to forward traffic to upstream services over mutual TLS (mTLS).
- [Configure mTLS Between Gateway and Upstream](https://docs.api7.ai/ingress-controller/tls-and-mtls/configure-upstream-mtls.md): Learn how to use APISIX or API7 Ingress Controller to configure the gateway to forward traffic to upstream services over mutual TLS (mTLS).
#### proxy-to-https-upstream
Learn how to use APISIX or API7 Ingress Controller to configure the gateway to forward traffic to upstream services over HTTPS.
- [Proxy Requests to HTTPS Upstream Services](https://docs.api7.ai/ingress-controller/tls-and-mtls/proxy-to-https-upstream.md): Learn how to use APISIX or API7 Ingress Controller to configure the gateway to forward traffic to upstream services over HTTPS.
### troubleshooting
#### admission-webhook
Learn about the admission webhook, the error and warning messages it may return when applying Ingress Controller resources, and how to resolve them.
- [Understand the Admission Webhook](https://docs.api7.ai/ingress-controller/troubleshooting/admission-webhook.md): Learn about the admission webhook, the error and warning messages it may return when applying Ingress Controller resources, and how to resolve them.
#### common-issues
Learn how to identify and resolve common issues in APISIX or API7 Ingress Controller with practical guidance for effective troubleshooting.
- [Common Issues and Solutions](https://docs.api7.ai/ingress-controller/troubleshooting/common-issues.md): Learn how to identify and resolve common issues in APISIX or API7 Ingress Controller with practical guidance for effective troubleshooting.
#### configuration-synchronization
Learn how to inspect and troubleshoot configuration translation and synchronization in APISIX or API7 Ingress Controller.
- [Troubleshoot Manifest Translation and Synchronization](https://docs.api7.ai/ingress-controller/troubleshooting/configuration-synchronization.md): Learn how to inspect and troubleshoot configuration translation and synchronization in APISIX or API7 Ingress Controller.
#### gateway-debug-mode
Learn how to enable gateway debug mode in a Kubernetes environment to troubleshoot and monitor the gateway’s runtime behavior effectively.
- [Enable Gateway Debug Mode](https://docs.api7.ai/ingress-controller/troubleshooting/gateway-debug-mode.md): Learn how to enable gateway debug mode in a Kubernetes environment to troubleshoot and monitor the gateway’s runtime behavior effectively.
---
# Full Documentation Content
[Skip to main content](#__docusaurus_skipToContent_fallback)
[](https://api7.ai/)
ProductsSolutions[Customers](https://api7.ai/customers)
Pricing
Resources[Blog](https://api7.ai/blog)
[Login](https://console.api7.cloud)Get a DemoStart for Free
[](https://api7.ai/)
* Products
[API7 Gateway](https://api7.ai/enterprise)[- ](https://api7.ai/enterprise)
[API7 Gateway](https://api7.ai/enterprise)[- ](https://api7.ai/api7-enterprise-vs-apisix)
[Apache APISIX vs API7](https://api7.ai/api7-enterprise-vs-apisix)[- ](https://api7.ai/portal)
[API7 API Portal](https://api7.ai/portal)
[Apache APISIX](https://api7.ai/apisix)[- ](https://api7.ai/apisix)
[What's Apache APISIX?](https://api7.ai/apisix)[- ](https://api7.ai/blog/why-is-apache-apisix-the-best-api-gateway)
[Why Apache APISIX?](https://api7.ai/blog/why-is-apache-apisix-the-best-api-gateway)[- ](https://api7.ai/apache-apisix-enterprise-support)
[APISIX Commercial Support](https://api7.ai/apache-apisix-enterprise-support)
[AISIX AI Gateway](https://api7.ai/ai-gateway)[- ](https://api7.ai/ai-gateway)
[AISIX AI Gateway](https://api7.ai/ai-gateway)
* Solutions
[Developer](https://api7.ai/solutions/monolith-to-microservices)[- ](https://api7.ai/solutions/monolith-to-microservices)
[Monolith to Microservices](https://api7.ai/solutions/monolith-to-microservices)[- ](https://api7.ai/solutions/on-prem-to-hybrid-cloud)
[On-Prem to Hybrid Cloud](https://api7.ai/solutions/on-prem-to-hybrid-cloud)[- ](https://api7.ai/solutions/observability)
[Observability](https://api7.ai/solutions/observability)
[- ](https://api7.ai/solutions/vm-to-kubernetes)
[VM to Kubernetes](https://api7.ai/solutions/vm-to-kubernetes)[- ](https://api7.ai/solutions/zero-trust-security)
[Zero Trust Security](https://api7.ai/solutions/zero-trust-security)
[Industry](https://api7.ai/solutions/financial-services)[- ](https://api7.ai/solutions/financial-services)
[Financial Services](https://api7.ai/solutions/financial-services)[- ](https://api7.ai/solutions/iot)
[IoT and Automotive](https://api7.ai/solutions/iot)[- ](https://api7.ai/solutions/blockchain)
[Blockchain](https://api7.ai/solutions/blockchain)
[- ](https://api7.ai/solutions/manufacturing)
[Manufacturing](https://api7.ai/solutions/manufacturing)
* [Customers](https://api7.ai/customers)
* Pricing
[- ](https://api7.ai/pricing)
[API Gateway](https://api7.ai/pricing)[- ](https://api7.ai/ai-gateway/pricing)
[AI Gateway](https://api7.ai/ai-gateway/pricing)
* Resources
[Docs](https://docs.api7.ai/ai-gateway/.md)[- ](https://docs.api7.ai/ai-gateway/.md)
[AISIX Docs](https://docs.api7.ai/ai-gateway/.md)[- ](https://docs.api7.ai/api7-gateway)
[API7 Gateway](https://docs.api7.ai/api7-gateway)[- ](https://docs.api7.ai/api7-gateway/ai-agent-skills.md)
[API7 AI Agent Skills](https://docs.api7.ai/api7-gateway/ai-agent-skills.md)[- ](https://docs.api7.ai/apisix)
[Apache APISIX](https://docs.api7.ai/apisix)[- ](https://docs.api7.ai/apisix/ai-agent-skills.md)
[APISIX AI Agent Skills](https://docs.api7.ai/apisix/ai-agent-skills.md)
[Compare](https://api7.ai/apisix-vs-kong)[- ](https://api7.ai/apisix-vs-kong)
[Apache APISIX vs Kong](https://api7.ai/apisix-vs-kong)[- ](https://api7.ai/apisix-vs-nginx)
[Apache APISIX vs NGINX](https://api7.ai/apisix-vs-nginx)[- ](https://api7.ai/api-gateway-comparison)
[2026 Top API Gateway Comparison](https://api7.ai/api-gateway-comparison)[- ](https://api7.ai/ai-gateway-comparison)
[AI Gateway Comparison](https://api7.ai/ai-gateway-comparison)
[Learn](https://api7.ai/learning-center/openresty)[- ](https://api7.ai/learning-center/openresty)
[OpenResty (NGINX + Lua)](https://api7.ai/learning-center/openresty)[- ](https://api7.ai/learning-center/api-gateway-guide)
[API Gateway Guide](https://api7.ai/learning-center/api-gateway-guide)[- ](https://api7.ai/learning-center/ai-gateway-guide)
[AI Gateway Guide](https://api7.ai/learning-center/ai-gateway-guide)[- ](https://api7.ai/learning-center/api-infrastructure-guide)
[API Infrastructure Guide](https://api7.ai/learning-center/api-infrastructure-guide)
[Explore](https://api7.ai/demos)[- ](https://api7.ai/demos)
[Demo Hub](https://api7.ai/demos)[- ](https://docs.api7.ai/hub.md)
[Plugin Hub](https://docs.api7.ai/hub.md)[- ](https://api7.ai/category/usercase)
[Case Studies](https://api7.ai/category/usercase)
* [Blog](https://api7.ai/blog)
Get a DemoStart for Free
[](https://docs.api7.ai/)[Apache APISIX](https://docs.api7.ai/apisix/documentation.md)[API7 Gateway](https://docs.api7.ai/api7-gateway/overview.md)[Ingress Controller](https://docs.api7.ai/ingress-controller/documentation.md)[AISIX AI Gateway](https://docs.api7.ai/ai-gateway/.md)[Plugin Hub](https://docs.api7.ai/hub.md)
Search
API version1.0.0 (/ai-gateway/reference/admin-api)
# AISIX Admin API
The AISIX Admin API is the read-only operational surface of an open-source AISIX gateway: list and inspect the loaded models, caller API keys, provider credentials, guardrails, MCP servers, A2A...
## Health
* [`GET` Get Gateway Health `/admin/v1/health`](#fallback-operation-0-0)
Get model health levels and configuration-watch freshness for this gateway.
* [`GET` Get Liveness Status `/livez`](#fallback-operation-0-1)
Process liveness: should this instance be restarted? Answers 200 whenever it answers at all, including throughout a graceful drain — draining is deliberate work, and restarting an instance that is finishing the requests it accepted would kill exactly those. Use /readyz for...
* [`GET` Get Readiness Status `/readyz`](#fallback-operation-0-2)
Traffic eligibility (readiness): 200 when the instance can serve, 503 while draining or before the first config apply. Stays 200 for as long as the instance keeps serving that configuration, however long ago the last config event was — see /admin/v1/health and /status/config...
## OpenAPI
* [`GET` Open Scalar UI `/admin/openapi-scalar`](#fallback-operation-1-0)
Open the browser UI that loads /admin/openapi.json from the admin listener.
* [`GET` Get OpenAPI Document `/admin/openapi.json`](#fallback-operation-1-1)
Get the machine-readable OpenAPI 3.1 document served by this gateway process.
## Models
* [`GET` List Models `/admin/v1/models`](#fallback-operation-2-0)
List all configured model resources.
* [`GET` List Model Runtime Status `/admin/v1/models/status`](#fallback-operation-2-1)
Returns runtime routing and exclusion state for every model.
* [`GET` Get Model by ID `/admin/v1/models/{id}`](#fallback-operation-2-2)
Get a model resource by ID.
## Caller API Keys
* [`GET` List Caller API Keys `/admin/v1/api_keys`](#fallback-operation-3-0)
List caller API keys with plaintext credentials redacted.
* [`GET` Get Caller API Key by ID `/admin/v1/api_keys/{id}`](#fallback-operation-3-1)
Get a caller API key by ID with plaintext credentials redacted.
* [`GET` List Caller API Keys (alternate path) `/admin/v1/apikeys`](#fallback-operation-3-2)
Alternate spelling of /admin/v1/api keys. Requests and responses are identical on both paths. List caller API keys with plaintext credentials redacted.
* [`GET` Get Caller API Key by ID (alternate path) `/admin/v1/apikeys/{id}`](#fallback-operation-3-3)
Alternate spelling of /admin/v1/api keys/{id}. Requests and responses are identical on both paths. Get a caller API key by ID with plaintext credentials redacted.
## Provider Keys
* [`GET` List Provider Keys `/admin/v1/provider_keys`](#fallback-operation-4-0)
List all configured provider key resources.
* [`GET` Get Provider Key by ID `/admin/v1/provider_keys/{id}`](#fallback-operation-4-1)
Get a provider key resource by ID.
## MCP Servers
* [`GET` List MCP Servers `/admin/v1/mcp_servers`](#fallback-operation-5-0)
List registered upstream MCP server resources.
* [`GET` Get MCP Server by ID `/admin/v1/mcp_servers/{id}`](#fallback-operation-5-1)
Get an upstream MCP server resource by ID.
## A2A Agents
* [`GET` List A2A Agents `/admin/v1/a2a_agents`](#fallback-operation-6-0)
List registered upstream A2A agent resources.
* [`GET` Get A2A Agent by ID `/admin/v1/a2a_agents/{id}`](#fallback-operation-6-1)
Get an upstream A2A agent resource by ID.
## Passthrough Routes
* [`GET` List Passthrough Routes `/admin/v1/passthrough_routes`](#fallback-operation-7-0)
List explicit passthrough route resources.
* [`GET` Get Passthrough Route by ID `/admin/v1/passthrough_routes/{id}`](#fallback-operation-7-1)
Get an explicit passthrough route resource by ID.
## Guardrails
* [`GET` List Guardrails `/admin/v1/guardrails`](#fallback-operation-8-0)
List all configured guardrail resources.
* [`GET` Get Guardrail by ID `/admin/v1/guardrails/{id}`](#fallback-operation-8-1)
Get a guardrail resource by ID.
## Cache Policies
* [`GET` List Cache Policies `/admin/v1/cache_policies`](#fallback-operation-9-0)
List all configured cache policy resources.
* [`GET` Get Cache Policy by ID `/admin/v1/cache_policies/{id}`](#fallback-operation-9-1)
Get a cache policy resource by ID.
## Observability Exporters
* [`GET` List Observability Exporters `/admin/v1/observability_exporters`](#fallback-operation-10-0)
List all configured observability exporter resources.
* [`GET` Get Observability Exporter by ID `/admin/v1/observability_exporters/{id}`](#fallback-operation-10-1)
Get an observability exporter resource by ID.
## Playground
* [`POST` Create Playground Chat Completion `/playground/chat/completions`](#fallback-operation-11-0)
Forwards a chat completion through the proxy path for local playground testing. Use a proxy API key, not an admin key.

The digital world is connected by APIs,
API7.ai exists to make APIs more efficient, reliable, and secure.
Sign up for API7 newsletter
[Email address]()Subscribe
Product
[API7 Gateway](https://api7.ai/enterprise)[AISIX AI Gateway](https://api7.ai/ai-gateway)[API7 API Portal](https://api7.ai/portal)
Learn
[API Gateway Guide](https://api7.ai/learning-center/api-gateway-guide)[Plugin Hub](https://docs.api7.ai/hub.md)[API Gateway Comparison](https://api7.ai/api-gateway-comparison)[Customers](https://api7.ai/customers)
Resources
[API Gateway Docs](https://docs.api7.ai/apisix/documentation.md)[APISIX AI Agent Skills](https://docs.api7.ai/apisix/ai-agent-skills.md)[API7 AI Agent Skills](https://docs.api7.ai/api7-gateway/ai-agent-skills.md)[Blog](https://api7.ai/blog)[Demo Hub](https://api7.ai/demos)[APISIX vs Kong](https://api7.ai/apisix-vs-kong)[AI Gateway Comparison](https://api7.ai/ai-gateway-comparison)
Company
[About](https://api7.ai/about)[Contact](https://api7.ai/contact)[Partners](https://api7.ai/partners)[Compliance Standards](https://api7.ai/compliance)[Brand Assets](https://api7.ai/branding)[Terms & Privacy](https://api7.ai/terms)
***
[](https://api7.ai/compliance)
[](https://api7.ai/compliance)
[](https://api7.ai/compliance)
[](https://api7.ai/compliance)
[](https://api7.ai/blog/among-2022-red-herring-top-100-global)
Copyright © APISEVEN PTE. LTD 2019 – 2026. Apache, Apache APISIX, APISIX, and associated open source project names are trademarks of the [Apache Software Foundation](https://www.apache.org/)
[](https://www.linkedin.com/company/api7-ai/)[](https://github.com/api7)[](https://twitter.com/api7_ai)
---
[Skip to main content](#__docusaurus_skipToContent_fallback)
[](https://api7.ai/)
ProductsSolutions[Customers](https://api7.ai/customers)
Pricing
Resources[Blog](https://api7.ai/blog)
[Login](https://console.api7.cloud)Get a DemoStart for Free
[](https://api7.ai/)
* Products
[API7 Gateway](https://api7.ai/enterprise)[- ](https://api7.ai/enterprise)
[API7 Gateway](https://api7.ai/enterprise)[- ](https://api7.ai/api7-enterprise-vs-apisix)
[Apache APISIX vs API7](https://api7.ai/api7-enterprise-vs-apisix)[- ](https://api7.ai/portal)
[API7 API Portal](https://api7.ai/portal)
[Apache APISIX](https://api7.ai/apisix)[- ](https://api7.ai/apisix)
[What's Apache APISIX?](https://api7.ai/apisix)[- ](https://api7.ai/blog/why-is-apache-apisix-the-best-api-gateway)
[Why Apache APISIX?](https://api7.ai/blog/why-is-apache-apisix-the-best-api-gateway)[- ](https://api7.ai/apache-apisix-enterprise-support)
[APISIX Commercial Support](https://api7.ai/apache-apisix-enterprise-support)
[AISIX AI Gateway](https://api7.ai/ai-gateway)[- ](https://api7.ai/ai-gateway)
[AISIX AI Gateway](https://api7.ai/ai-gateway)
* Solutions
[Developer](https://api7.ai/solutions/monolith-to-microservices)[- ](https://api7.ai/solutions/monolith-to-microservices)
[Monolith to Microservices](https://api7.ai/solutions/monolith-to-microservices)[- ](https://api7.ai/solutions/on-prem-to-hybrid-cloud)
[On-Prem to Hybrid Cloud](https://api7.ai/solutions/on-prem-to-hybrid-cloud)[- ](https://api7.ai/solutions/observability)
[Observability](https://api7.ai/solutions/observability)
[- ](https://api7.ai/solutions/vm-to-kubernetes)
[VM to Kubernetes](https://api7.ai/solutions/vm-to-kubernetes)[- ](https://api7.ai/solutions/zero-trust-security)
[Zero Trust Security](https://api7.ai/solutions/zero-trust-security)
[Industry](https://api7.ai/solutions/financial-services)[- ](https://api7.ai/solutions/financial-services)
[Financial Services](https://api7.ai/solutions/financial-services)[- ](https://api7.ai/solutions/iot)
[IoT and Automotive](https://api7.ai/solutions/iot)[- ](https://api7.ai/solutions/blockchain)
[Blockchain](https://api7.ai/solutions/blockchain)
[- ](https://api7.ai/solutions/manufacturing)
[Manufacturing](https://api7.ai/solutions/manufacturing)
* [Customers](https://api7.ai/customers)
* Pricing
[- ](https://api7.ai/pricing)
[API Gateway](https://api7.ai/pricing)[- ](https://api7.ai/ai-gateway/pricing)
[AI Gateway](https://api7.ai/ai-gateway/pricing)
* Resources
[Docs](https://docs.api7.ai/ai-gateway/.md)[- ](https://docs.api7.ai/ai-gateway/.md)
[AISIX Docs](https://docs.api7.ai/ai-gateway/.md)[- ](https://docs.api7.ai/api7-gateway)
[API7 Gateway](https://docs.api7.ai/api7-gateway)[- ](https://docs.api7.ai/api7-gateway/ai-agent-skills.md)
[API7 AI Agent Skills](https://docs.api7.ai/api7-gateway/ai-agent-skills.md)[- ](https://docs.api7.ai/apisix)
[Apache APISIX](https://docs.api7.ai/apisix)[- ](https://docs.api7.ai/apisix/ai-agent-skills.md)
[APISIX AI Agent Skills](https://docs.api7.ai/apisix/ai-agent-skills.md)
[Compare](https://api7.ai/apisix-vs-kong)[- ](https://api7.ai/apisix-vs-kong)
[Apache APISIX vs Kong](https://api7.ai/apisix-vs-kong)[- ](https://api7.ai/apisix-vs-nginx)
[Apache APISIX vs NGINX](https://api7.ai/apisix-vs-nginx)[- ](https://api7.ai/api-gateway-comparison)
[2026 Top API Gateway Comparison](https://api7.ai/api-gateway-comparison)[- ](https://api7.ai/ai-gateway-comparison)
[AI Gateway Comparison](https://api7.ai/ai-gateway-comparison)
[Learn](https://api7.ai/learning-center/openresty)[- ](https://api7.ai/learning-center/openresty)
[OpenResty (NGINX + Lua)](https://api7.ai/learning-center/openresty)[- ](https://api7.ai/learning-center/api-gateway-guide)
[API Gateway Guide](https://api7.ai/learning-center/api-gateway-guide)[- ](https://api7.ai/learning-center/ai-gateway-guide)
[AI Gateway Guide](https://api7.ai/learning-center/ai-gateway-guide)[- ](https://api7.ai/learning-center/api-infrastructure-guide)
[API Infrastructure Guide](https://api7.ai/learning-center/api-infrastructure-guide)
[Explore](https://api7.ai/demos)[- ](https://api7.ai/demos)
[Demo Hub](https://api7.ai/demos)[- ](https://docs.api7.ai/hub.md)
[Plugin Hub](https://docs.api7.ai/hub.md)[- ](https://api7.ai/category/usercase)
[Case Studies](https://api7.ai/category/usercase)
* [Blog](https://api7.ai/blog)
Get a DemoStart for Free
[](https://docs.api7.ai/)[Apache APISIX](https://docs.api7.ai/apisix/documentation.md)[API7 Gateway](https://docs.api7.ai/api7-gateway/overview.md)[Ingress Controller](https://docs.api7.ai/ingress-controller/documentation.md)[AISIX AI Gateway](https://docs.api7.ai/ai-gateway/.md)[Plugin Hub](https://docs.api7.ai/hub.md)
Search
API versionCurrent release (1.0.0) (/ai-gateway/reference/cloud-admin-api)[Compare versions](https://docs.api7.ai/ai-gateway/reference/cloud-admin-api-changelog.md)
# AISIX Cloud Admin API
The AISIX Cloud Admin API is the stable, customer-facing automation contract for AISIX Cloud across its control-plane deployment options. It lets operators manage organization-scoped environments...
## Caller API Keys
* [`GET` List Caller API Keys `/environments/{env_id}/api_keys`](#fallback-operation-0-0)
List caller API keys in an environment. Pagination is opt-in: omit page size to get the full key list in one response. page is only meaningful together with page size and is rejected without it.
* [`POST` Create Caller API Key `/environments/{env_id}/api_keys`](#fallback-operation-0-1)
Create a caller credential for an environment. The plaintext bearer is returned once in the create response and cannot be recovered later.
* [`DELETE` Delete Caller API Key `/environments/{env_id}/api_keys/{api_key_id}`](#fallback-operation-0-2)
Deletes the caller credential. Any caller still using the plaintext bearer receives 401 Unauthorized on subsequent gateway requests. Refused with 409 while something resolves an identity to this key — a passthrough route using it as its anonymous principal, or a claim mapping...
* [`PATCH` Update Caller API Key `/environments/{env_id}/api_keys/{api_key_id}`](#fallback-operation-0-3)
Update selected caller API key fields. Nullable fields can be cleared with an explicit null. Changing the underlying bearer is not part of this operation — use the rotate operation instead.
* [`POST` Rotate Caller API Key `/environments/{env_id}/api_keys/{api_key_id}/rotate`](#fallback-operation-0-4)
Replace the key's underlying bearer with a freshly generated value in one operation. The key resource is preserved — name, allowed models, rate limit, bindings, expiry deadline, and disabled state carry over; only the credential changes. The old plaintext stops authenticating...
## Environments
* [`GET` List Environments `/environments`](#fallback-operation-1-0)
Return every environment in the authenticated organization. The response is not paginated.
* [`POST` Create Environment `/environments`](#fallback-operation-1-1)
Create an environment in the authenticated organization. Environment names are case-sensitive and must be unique within the organization.
* [`GET` Get Environment by ID `/environments/{env_id}`](#fallback-operation-1-2)
Return one environment in the authenticated organization. An ID that is missing or belongs to another organization returns 404.
* [`DELETE` Delete Environment `/environments/{env_id}`](#fallback-operation-1-3)
Deletes an environment after revoking its active AISIX gateway certificates. If certificate revocation fails, the environment remains intact and the delete operation can be retried.
* [`PATCH` Update Environment `/environments/{env_id}`](#fallback-operation-1-4)
Update an environment's display name and MCP OAuth discovery settings. Fields that are omitted keep their current value.
## Models
* [`GET` List Models `/environments/{env_id}/models`](#fallback-operation-2-0)
Return every direct, routing, ensemble, semantic, and embedding model configured in the environment. The response is not paginated.
* [`POST` Create Model `/environments/{env_id}/models`](#fallback-operation-2-1)
Create a model alias in an environment. The AISIX Cloud control plane creates a direct model unless another kind is selected.
* [`GET` Get Model by ID `/environments/{env_id}/models/{model_id}`](#fallback-operation-2-2)
Return one model and the configuration block for its model kind. The model must belong to the environment in the request path.
* [`DELETE` Delete Model `/environments/{env_id}/models/{model_id}`](#fallback-operation-2-3)
Delete a model. If another model still references it, rebind or delete the dependent model first. Refused with 409 while a semantic cache policy or a kind: semantic guardrail uses it as their embedding model. The guardrail case is not cosmetic: a guardrail defaults to fail...
* [`PATCH` Update Model `/environments/{env_id}/models/{model_id}`](#fallback-operation-2-4)
Update selected fields on a model. The model kind is fixed at creation, and editable fields depend on the current kind. Renaming a model rebinds everything that references it. The one rename that is refused with 400 is a rename into a wildcard alias — display name or model...
## Provider Keys
* [`GET` List Provider Keys `/provider_keys`](#fallback-operation-3-0)
List provider keys in the authenticated organization. Fetch a single key to see its endpoint override. Pagination is opt-in: omit page size to get the full key list in one response. page is only meaningful together with page size and is rejected without it.
* [`POST` Create Provider Key `/provider_keys`](#fallback-operation-3-1)
Create an upstream provider credential. The plaintext API key is encrypted before storage and is never returned by read endpoints.
* [`GET` Get Provider Key by ID `/provider_keys/{provider_key_id}`](#fallback-operation-3-2)
Get a provider key, including its endpoint override.
* [`DELETE` Delete Provider Key `/provider_keys/{provider_key_id}`](#fallback-operation-3-3)
Deletes the provider key from every environment where it was allowed. Models that still reference the key cannot dispatch successfully, so rebind affected models before deleting the key.
* [`PATCH` Update Provider Key `/provider_keys/{provider_key_id}`](#fallback-operation-3-4)
Update selected provider key fields, including the upstream secret. Send api key (or config, for a multi-field credential) to rotate the secret in place: every model that references this provider key picks up the new credential, with no model or caller change. Omit those...
## MCP Servers
* [`GET` List MCP Servers `/mcp_servers`](#fallback-operation-4-0)
List MCP servers in the authenticated organization. Stored bearer secrets are never included in read responses.
* [`POST` Create MCP Server `/mcp_servers`](#fallback-operation-4-1)
Register an upstream MCP server and expose it to the allowed environments.
* [`GET` Get MCP Server by ID `/mcp_servers/{mcp_server_id}`](#fallback-operation-4-2)
Get an MCP server. Stored bearer secrets are never returned.
* [`DELETE` Delete MCP Server `/mcp_servers/{mcp_server_id}`](#fallback-operation-4-3)
Deletes the MCP server from every environment where it was allowed.
* [`PATCH` Update MCP Server `/mcp_servers/{mcp_server_id}`](#fallback-operation-4-4)
Update selected MCP server fields. A new secret rotates a bearer credential. This caller holds the permission that approves servers, so an approved server keeps serving across the patch and the new configuration is published immediately; the edit is recorded as its review\...
* [`GET` List Generated MCP Tools `/mcp_servers/{mcp_server_id}/tools`](#fallback-operation-4-5)
List the MCP tools an OpenAPI-backed server generates, derived from its stored OpenAPI document by the same walk that validated it at write time. Only servers of type: openapi can be listed: an upstream MCP server's tool set lives on the upstream, which the control plane never...
* [`POST` Approve MCP Server `/mcp_servers/{mcp_server_id}/approve`](#fallback-operation-4-6)
Publishes a reviewed MCP server: it is projected to the environments in allowed environments and becomes discoverable and callable by gateway clients. A previously rejected server can be approved. Approving one that is already approved returns 400. On a live server carrying a...
* [`POST` Reject MCP Server `/mcp_servers/{mcp_server_id}/reject`](#fallback-operation-4-7)
Refuses a submitted MCP server, and is also how an approval is revoked: rejecting an approved server withdraws it from every environment it was serving in, so gateway clients stop seeing it. Rejecting one that is already rejected returns 400. On a live server carrying a...
* [`POST` Submit MCP Server for Review `/mcp_server_submissions`](#fallback-operation-4-8)
Proposes an upstream MCP server without publishing it. The server is registered with approval status set to pending review and is not projected to any environment, so it cannot be discovered or called until a reviewer approves it. This is the entry point for roles that may...
* [`PATCH` Revise a Submitted MCP Server `/mcp_server_submissions/{mcp_server_id}`](#fallback-operation-4-9)
The proposer's write path, on a permission that cannot publish. On a server that is not live it corrects the submission in place and leaves it in the review queue — how a rejected server is fixed and resubmitted. On a server that IS live it changes nothing: the patch is stored...
## A2A Agents
* [`GET` List A2A Agents `/a2a_agents`](#fallback-operation-5-0)
List A2A agents in the authenticated organization. Stored credentials are never included in read responses.
* [`POST` Create A2A Agent `/a2a_agents`](#fallback-operation-5-1)
Register an upstream A2A agent and expose it to the allowed environments.
* [`GET` Get A2A Agent by ID `/a2a_agents/{a2a_agent_id}`](#fallback-operation-5-2)
Get an A2A agent. Stored credentials are never returned.
* [`DELETE` Delete A2A Agent `/a2a_agents/{a2a_agent_id}`](#fallback-operation-5-3)
Deletes the A2A agent from every environment where it was allowed.
* [`PATCH` Update A2A Agent `/a2a_agents/{a2a_agent_id}`](#fallback-operation-5-4)
Update selected A2A agent fields. A new secret rotates the stored credential.
## Members
* [`GET` List Members `/members`](#fallback-operation-6-0)
List organization members. Pagination is opt-in: omit page size to get the full member list in one response. page is only meaningful together with page size and is rejected without it.
* [`POST` Create Member `/members`](#fallback-operation-6-1)
Create a login-less member directly, bypassing the email-invitation handshake. The created principal can be added to teams and issued caller API keys immediately, but carries no dashboard credentials and can never sign in. The role is fixed to member.
* [`DELETE` Remove Organization Member `/members/{user_id}`](#fallback-operation-6-2)
Remove a member from the organization. Only an organization owner can do this, and the last owner cannot be removed. The member's environment role bindings and team memberships go with them. Caller API keys they own are not deleted and keep working — the user id already...
## Invitations
* [`GET` List Invitations `/invitations`](#fallback-operation-7-0)
List the organization's invitations. By default only invitations that can still be redeemed are returned; pass include stale=true to also see accepted, revoked and expired ones.
* [`POST` Create Invitation `/invitations`](#fallback-operation-7-1)
Invite an email address to join the organization with a given role. The response carries the invitation token in clear text, once. plaintext and the invite url built from it are never recoverable afterwards — anyone holding either can redeem the invitation, so deliver it over...
* [`DELETE` Revoke Invitation `/invitations/{invitation_id}`](#fallback-operation-7-2)
Revoke a pending invitation so its link can no longer be redeemed. An invitation that is already accepted, revoked or expired is reported as 404 — there is nothing left to revoke.
## Roles
* [`PATCH` Update Member Organization Role `/members/{user_id}`](#fallback-operation-8-0)
Replace a member's organization-wide role. Only an organization owner can assign roles. Assigning owner clears the member's environment role bindings because owners already have full access. The last owner cannot be demoted.
* [`GET` List Member Environment Role Bindings `/members/{member_id}/role_bindings`](#fallback-operation-8-1)
List the roles granted to one member in individual environments. Each binding adds its role to the member's organization role for resources inside that environment. It does not reduce the member's organization-level access or grant control over the environment object itself.
* [`PUT` Replace Member Environment Role Bindings `/members/{member_id}/role_bindings`](#fallback-operation-8-2)
Replace the member's complete set of environment-scoped role bindings. Send an empty array to remove every binding. Only an organization owner can change bindings. The target member cannot be an owner, and each environment can appear at most once. Changes can take up to 30...
* [`GET` List Roles `/roles`](#fallback-operation-8-3)
List the built-in owner, admin, and member roles together with every custom role defined in the authenticated organization.
* [`POST` Create Custom Role `/roles`](#fallback-operation-8-4)
Create an organization-scoped custom role. Its name is permanent because member and directory-sync assignments reference it by name. A custom role can grant only permission pairs available to the built-in admin role and cannot grant role management.
* [`DELETE` Delete Custom Role `/roles/{role_name}`](#fallback-operation-8-5)
Delete a custom role. Built-in roles cannot be deleted. A custom role must first be removed from members, pending invitations, directory-sync settings, and environment role bindings. Member assignments and environment bindings can be cleared through this API. Pending...
* [`PATCH` Update Custom Role `/roles/{role_name}`](#fallback-operation-8-6)
Update a custom role's description or replace its permissions. The role name cannot change. Built-in roles cannot be updated. Permission changes can take up to 30 seconds to propagate across control-plane replicas.
## Teams
* [`GET` List Teams `/teams`](#fallback-operation-9-0)
List the organization's teams, each with its current member count. Pagination is opt-in: omit page size to get every team in one response. page is only meaningful together with page size and is rejected without it.
* [`POST` Create Team `/teams`](#fallback-operation-9-1)
Create a team. Teams group organization members so a limit, budget or MCP entitlement can be written once and apply to everyone on the team. display name must be unique within the organization.
* [`GET` Get Team `/teams/{team_id}`](#fallback-operation-9-2)
Return one team with its current member count.
* [`DELETE` Delete Team `/teams/{team_id}`](#fallback-operation-9-3)
Delete the team. Its entitlements are cleared first, so caller API keys bound to it stop carrying the team's MCP layer; the keys themselves are not deleted.
* [`PATCH` Update Team `/teams/{team_id}`](#fallback-operation-9-4)
Update the team's name or description. Omitted fields are left unchanged.
* [`GET` List Team Members `/teams/{team_id}/members`](#fallback-operation-9-5)
List everyone on the team, with the organization email and display name resolved alongside the team role.
* [`POST` Add Team Member `/teams/{team_id}/members`](#fallback-operation-9-6)
Put an existing organization member on the team. The user must already belong to the organization — this endpoint does not invite anyone. role defaults to member.
* [`DELETE` Remove Team Member `/teams/{team_id}/members/{user_id}`](#fallback-operation-9-7)
Take a member off the team. The organization membership is untouched. A team must keep at least one lead, so removing the last one is refused.
* [`PATCH` Update Team Member Role `/teams/{team_id}/members/{user_id}`](#fallback-operation-9-8)
Change a member's role within the team. A team must keep at least one lead: demoting the last one is refused, so promote another member first.
## Guardrails
* [`GET` List Guardrails `/environments/{env_id}/guardrails`](#fallback-operation-10-0)
Return every guardrail definition in the environment. Scope attachments are listed separately through the attachments endpoint.
* [`POST` Create Guardrail `/environments/{env_id}/guardrails`](#fallback-operation-10-1)
Create a guardrail in an environment. The per-kind config shape is validated by the server against the guardrail catalog (GET /guardrails/schema); this spec models the stable envelope and treats config as an open object.
* [`POST` Test Guardrail Connection `/environments/{env_id}/guardrails/test-connection`](#fallback-operation-10-2)
Probe a remote-API guardrail provider (Bedrock, Azure Content Safety, Aliyun, Lakera, OpenAI Moderation, …) with the supplied credentials before saving the guardrail. The request mirrors the create body's kind + config; the exact config shape is provider-specific and validated...
* [`GET` Get Guardrail by ID `/environments/{env_id}/guardrails/{guardrail_id}`](#fallback-operation-10-3)
Return one guardrail definition in the environment. Provider credentials in the kind-specific configuration are redacted.
* [`DELETE` Delete Guardrail `/environments/{env_id}/guardrails/{guardrail_id}`](#fallback-operation-10-4)
Delete a guardrail definition from the environment and remove it from the configuration distributed to connected gateways.
* [`PATCH` Update Guardrail `/environments/{env_id}/guardrails/{guardrail_id}`](#fallback-operation-10-5)
Update selected fields on a guardrail. The kind is fixed at creation; config (when present) is validated by the server against the guardrail catalog for that kind.
* [`GET` List Guardrail Attachments `/environments/{env_id}/guardrails/{guardrail_id}/attachments`](#fallback-operation-10-6)
Return the scope attachments for one guardrail. Each attachment determines whether the guardrail applies to an environment, model, caller API key, or team.
* [`POST` Attach Guardrail to a Scope `/environments/{env_id}/guardrails/{guardrail_id}/attachments`](#fallback-operation-10-7)
Attach a guardrail to an env, model, api key, or team scope. scope id is required for every scope except env (which must omit it).
* [`DELETE` Detach Guardrail from a Scope `/environments/{env_id}/guardrails/{guardrail_id}/attachments/{attachment_id}`](#fallback-operation-10-8)
Delete one scope attachment so it no longer makes the guardrail applicable through that scope. Other attachments are unchanged.
* [`GET` List Guardrail Providers `/guardrails/providers`](#fallback-operation-10-9)
Catalog of guardrail providers and their kinds. Read-only metadata used by the dashboard's guardrail form; the response shape is catalog-driven.
* [`GET` Get Guardrail Config Schema `/guardrails/schema`](#fallback-operation-10-10)
Per-kind JSON schema for the guardrail config blob, consumed by the dashboard form. Read-only; the response is catalog-driven. Not every kind publishes a dynamic schema: the ones the dashboard renders with a built-in form (see has schema on GET /guardrails/providers) answer...
## Cache Policies
* [`GET` List Cache Policies `/environments/{env_id}/cache_policies`](#fallback-operation-11-0)
Return every prompt-response cache policy configured in the environment. The response is not paginated.
* [`POST` Create Cache Policy `/environments/{env_id}/cache_policies`](#fallback-operation-11-1)
Create a prompt-response cache rule in an environment. Policy names are unique within the environment, and the name and backend cannot be changed after creation.
* [`GET` Get Cache Policy by ID `/environments/{env_id}/cache_policies/{cache_policy_id}`](#fallback-operation-11-2)
Return one cache policy. The policy must belong to the environment in the request path.
* [`DELETE` Delete Cache Policy `/environments/{env_id}/cache_policies/{cache_policy_id}`](#fallback-operation-11-3)
Deletes the cache policy. The gateway stops serving cached responses for the traffic the policy covered.
* [`PATCH` Update Cache Policy `/environments/{env_id}/cache_policies/{cache_policy_id}`](#fallback-operation-11-4)
Update selected fields on a cache policy. The policy name and backend are fixed at creation — delete and recreate the policy to change them.
* [`POST` Purge Cache Policy Entries `/environments/{env_id}/cache_policies/{cache_policy_id}/purge`](#fallback-operation-11-5)
Invalidate every entry cached under this policy, across both exact and semantic matching and on every gateway instance. The operation increments the policy's purge generation; gateways pick the new generation up through configuration propagation (typically within seconds) and...
## Observability Exporters
* [`GET` List Observability Exporters `/environments/{env_id}/observability_exporters`](#fallback-operation-12-0)
Return every telemetry exporter configured in the environment. Secret header values and credential material are not returned.
* [`POST` Create Observability Exporter `/environments/{env_id}/observability_exporters`](#fallback-operation-12-1)
Create a telemetry exporter in an environment. The kind value selects which configuration fields apply; fields that belong to other kinds are ignored. Exporter names are unique within the environment. Secrets are never part of this request: aliyun sls, object store, and...
* [`GET` Get Observability Exporter by ID `/environments/{env_id}/observability_exporters/{exporter_id}`](#fallback-operation-12-2)
Return one telemetry exporter in the environment. Secret header values and credential material are not returned.
* [`DELETE` Delete Observability Exporter `/environments/{env_id}/observability_exporters/{exporter_id}`](#fallback-operation-12-3)
Deletes the exporter. The gateway stops shipping telemetry to the target.
* [`PATCH` Update Observability Exporter `/environments/{env_id}/observability_exporters/{exporter_id}`](#fallback-operation-12-4)
Update selected fields on an exporter. The exporter name and kind are fixed at creation, and a field that does not belong to the exporter's kind is rejected. Configuration changes are validated against the same rules as create; an explicit empty string clears optional fields...
## Rate Limit Policies
* [`GET` List Rate Limit Policies `/environments/{env_id}/rate_limits`](#fallback-operation-13-0)
List rate limit policies in an environment. Pagination is opt-in: omit page size to get the full policy list in one response. page is only meaningful together with page size and is rejected without it.
* [`POST` Create Rate Limit Policy `/environments/{env_id}/rate_limits`](#fallback-operation-13-1)
Create a rate limit policy in an environment. Each policy pins one scope and scope ref pair, and a second policy for the same pair is rejected. At least one of max requests or max tokens must be set, and max tokens is only accepted with window: minute or window: day — the...
* [`GET` Get Rate Limit Policy by ID `/environments/{env_id}/rate_limits/{rate_limit_id}`](#fallback-operation-13-2)
Return one rate-limit policy. The policy must belong to the environment in the request path.
* [`DELETE` Delete Rate Limit Policy `/environments/{env_id}/rate_limits/{rate_limit_id}`](#fallback-operation-13-3)
Deletes the policy. The gateway stops enforcing the limit.
* [`PATCH` Update Rate Limit Policy `/environments/{env_id}/rate_limits/{rate_limit_id}`](#fallback-operation-13-4)
Update selected fields on a rate limit policy. The scope and scope ref pair is fixed at creation. The limit fields are independently clearable: an explicit null clears one limit while keeping the other, and an update that would leave the policy with neither limit is rejected.
## Data Plane Nodes
* [`GET` List Data Plane Nodes `/environments/{env_id}/dp_nodes`](#fallback-operation-14-0)
List the data plane nodes that have connected to the environment. A node appears after its first status report; a gateway certificate that was issued but never used to connect is not listed. Each entry reflects the node's most recent report, including which configuration...
## Rejected Resources
* [`GET` List Rejected Resources `/environments/{env_id}/rejected_resources`](#fallback-operation-15-0)
List configuration resources in the environment that at least one data plane node is currently refusing to apply. A save can succeed at the API and still be rejected at a gateway — for example when an older gateway version does not recognize a newer field. A rejected resource...
## MCP Access Policies
* [`GET` Get Effective Permissions `/environments/{env_id}/api_keys/{api_key_id}/effective_permissions`](#fallback-operation-16-0)
Resolve the MCP tool access a caller API key ends up with once the environment layer, the key team's layer, and the key's own mcp access block are intersected. Every allow and deny pattern in the answer carries its source, and layers names the layers that constrain the key —...
* [`GET` Get MCP Access Policy `/environments/{env_id}/mcp_policy`](#fallback-operation-16-1)
Fetch the environment layer of the MCP tool ACL. It applies to every caller API key in the environment, intersected with the key's team layer and the key's own mcp access block. The layer is optional: mcp policy is null when the environment configures none, the same way the...
* [`PUT` Set MCP Access Policy `/environments/{env_id}/mcp_policy`](#fallback-operation-16-2)
Create or replace the environment layer of the MCP tool ACL. allow: \[" "] covers every tool on every MCP server, including servers and tools registered later — choosing it is always an explicit decision, never a default. The layer narrows what keys can reach but never widens...
* [`DELETE` Delete MCP Access Policy `/environments/{env_id}/mcp_policy`](#fallback-operation-16-3)
Remove the environment layer of the MCP tool ACL. Keys with no team layer and no mcp access block of their own are then left with no layer at all, which means no MCP tool access; keys that configure their own layer keep it.
* [`GET` Get Team Entitlements `/teams/{team_id}/entitlements`](#fallback-operation-16-4)
Fetch the team's entitlements. The mcp block, when present, is the MCP ACL layer caller API keys bound to this team carry in every environment of the organization; it is intersected with the environment layer for those keys and can only narrow it. Absent means the team adds no...
* [`PUT` Set Team Entitlements `/teams/{team_id}/entitlements`](#fallback-operation-16-5)
Create, replace, or clear the team's entitlements. Setting the mcp block applies it to the team's caller API keys in every environment of the organization — identity-provider group changes synced to the team propagate automatically, with no per-key edits. Sending "mcp": null...
## OIDC Providers
* [`GET` List OIDC Providers `/environments/{env_id}/oidc_providers`](#fallback-operation-17-0)
Return every OIDC provider configured for JWT authentication in the environment. The response is not paginated.
* [`POST` Create OIDC Provider `/environments/{env_id}/oidc_providers`](#fallback-operation-17-1)
Register an identity provider the gateway trusts for JWT authentication in this environment. Once at least one enabled provider exists, requests may authenticate with a JWT issued by it instead of an API key: the token's issuer selects the provider, its signature and claims...
* [`GET` Get OIDC Provider by ID `/environments/{env_id}/oidc_providers/{oidc_provider_id}`](#fallback-operation-17-2)
Return one OIDC provider. The provider must belong to the environment in the request path.
* [`DELETE` Delete OIDC Provider `/environments/{env_id}/oidc_providers/{oidc_provider_id}`](#fallback-operation-17-3)
Deletes the OIDC provider. Tokens issued by it stop authenticating as soon as the gateway picks up the change; API keys and their jwt subject bindings are unaffected.
* [`PATCH` Update OIDC Provider `/environments/{env_id}/oidc_providers/{oidc_provider_id}`](#fallback-operation-17-4)
Update selected fields on an OIDC provider. The provider name is fixed at creation — delete and recreate the provider to change it. Changes take effect on new requests without a gateway restart.
## Claim Mappings
* [`GET` List Claim Mappings `/environments/{env_id}/claim_mappings`](#fallback-operation-18-0)
Return every claim mapping in the environment. The response is not paginated.
* [`POST` Create Claim Mapping `/environments/{env_id}/claim_mappings`](#fallback-operation-18-1)
Create a rule that resolves verified JWT claims to an existing caller API key. When a token passes an OIDC provider's verification and no key binds its subject via jwt subject, the enabled mappings naming that provider are evaluated in priority order (lower first, ties broken...
* [`GET` Get Claim Mapping by ID `/environments/{env_id}/claim_mappings/{claim_mapping_id}`](#fallback-operation-18-2)
Return one claim mapping. The mapping must belong to the environment in the request path.
* [`DELETE` Delete Claim Mapping `/environments/{env_id}/claim_mappings/{claim_mapping_id}`](#fallback-operation-18-3)
Deletes the claim mapping. Identities it admitted stop authenticating as soon as the gateway picks up the change; API keys bound directly via jwt subject are unaffected.
* [`PATCH` Update Claim Mapping `/environments/{env_id}/claim_mappings/{claim_mapping_id}`](#fallback-operation-18-4)
Update selected fields on a claim mapping. The mapping name is fixed at creation — delete and recreate the mapping to change it. Changes take effect on new requests without a gateway restart.
## Passthrough Routes
* [`GET` List Passthrough Routes `/environments/{env_id}/passthrough_routes`](#fallback-operation-19-0)
Return every passthrough route in the environment. The response is not paginated.
* [`POST` Create Passthrough Route `/environments/{env_id}/passthrough_routes`](#fallback-operation-19-1)
Create an explicit passthrough route: a binding from a gateway entry — a path prefix on the gateway's own URL space, an inbound hosts allowlist (forward-proxy traffic delivered with its original Host), or both — to one upstream target, forwarded without protocol translation...
* [`GET` Get Passthrough Route by ID `/environments/{env_id}/passthrough_routes/{passthrough_route_id}`](#fallback-operation-19-2)
Return one passthrough route. The route must belong to the environment in the request path.
* [`DELETE` Delete Passthrough Route `/environments/{env_id}/passthrough_routes/{passthrough_route_id}`](#fallback-operation-19-3)
Deletes the passthrough route. Traffic it served answers 404 (or the tunnel-namespace 410) as soon as the gateway picks up the change. Guardrail attachments scoped to the route are deleted with it; API keys keep any now-dangling allowed routes patterns, which simply grant...
* [`PATCH` Update Passthrough Route `/environments/{env_id}/passthrough_routes/{passthrough_route_id}`](#fallback-operation-19-4)
Update selected fields on a passthrough route. The route name is fixed at creation — delete and recreate the route to change it. The create-time coupling rules apply to the PATCHED result: the route must keep at least one match dimension, exactly one target shape, and each...
## Budgets
* [`GET` List Budgets `/budgets`](#fallback-operation-20-0)
List every budget in the organization, across all scopes, each with its current-period spend state. Budgets whose spend is not tracked as a single total (team member) return a zero-seeded state: the limit applies to each member of the team separately.
* [`POST` Create Budget `/budgets`](#fallback-operation-20-1)
Create a spending cap. Each target — identified by the scope + scope ref pair — can hold at most one budget; creating a second one for the same target is rejected with 409. A hard stop budget makes the gateway reject matching traffic with 429 budget exceeded once the period's...
* [`GET` Get Budget `/budgets/{budget_id}`](#fallback-operation-20-2)
Return one budget together with its current-period spend state. The state starts as a zero seed at creation and updates as spend is aggregated.
* [`DELETE` Delete Budget `/budgets/{budget_id}`](#fallback-operation-20-3)
Remove a budget. Spend tracking continues; only the cap is removed. Enforcement stops within a few seconds — in-flight traffic checked against a cached decision may still be rejected briefly.
* [`PATCH` Update Budget `/budgets/{budget_id}`](#fallback-operation-20-4)
Update a budget's name, limit, period, or enforcement mode. Fields left out keep their current values. The budget's scope and scope ref are fixed at creation — to cap a different target, create a new budget.
## Model Pricing
* [`GET` List Model Prices `/model_pricing`](#fallback-operation-21-0)
List the prices this organization is billed at: one row per (provider, model), with the organization's own override taking the place of the catalog default where one exists. source says which you are looking at — user for an override, models.dev or snapshot for the catalog...
* [`PUT` Set Model Price Override `/model_pricing`](#fallback-operation-21-1)
Set this organization's price for one (provider, model) pair, creating the override or replacing the existing one. Every rate is replaced, not merged: a rate you omit is stored as 0, which means the token class bills at the prompt or completion rate rather than keeping...
* [`DELETE` Delete Model Price Override `/model_pricing/{id}`](#fallback-operation-21-2)
Drop the organization's override so the catalog price takes over again. Catalog rows are not deletable and report 404, the same as an id that does not exist.
## Usage
* [`GET` List Usage Events `/environments/{env_id}/usage_events`](#fallback-operation-22-0)
Page through the environment's request telemetry, newest first. One row is one upstream attempt , not one request: a request that retried or failed over emits several rows sharing a request id, ordered by attempt index. Aggregate by request id when you need per-request...
* [`GET` Export Usage Events `/environments/{env_id}/usage_events/export`](#fallback-operation-22-1)
Download the rows listUsageEvents would return for the same filters, as one file. Takes the identical filter set; limit and page are ignored — an export is the whole match, capped at 50,000 rows. Each row carries the model, caller API key and member names alongside their ids...
* [`GET` Get Usage Summary `/environments/{env_id}/usage_summary`](#fallback-operation-22-2)
Roll the environment's usage up into one bucket per day, model or caller API key over the given window. Counts are request-level: request count is the number of distinct requests in the bucket, not the number of upstream attempts, so a request that retried or failed over...
* [`GET` Get Usage Metrics `/environments/{env_id}/usage_metrics`](#fallback-operation-22-3)
Request-level counters and exact latency percentiles for the window. These are the figures to use for success rate and latency over a whole window: usage summary also counts distinct requests, but it does so per bucket, so a request whose attempts straddle a bucket boundary is...
## Notification Channels
* [`GET` List Notification Channels `/notification_channels`](#fallback-operation-23-0)
List the organization's outbound notification channels. Channel URLs are masked — the full URL is write-only.
* [`POST` Create Notification Channel `/notification_channels`](#fallback-operation-23-1)
Create an outbound notification channel. webhook channels receive alert events as JSON POSTs; slack channels expect a Slack incoming-webhook URL and receive a rendered text message. Enabled channels receive every alert raised in the organization (budget threshold alerts...
* [`GET` Get Notification Channel `/notification_channels/{channel_id}`](#fallback-operation-23-2)
Return one notification channel in the authenticated organization. The destination URL is masked in the response.
* [`DELETE` Delete Notification Channel `/notification_channels/{channel_id}`](#fallback-operation-23-3)
Remove a channel. Its delivery history is kept as an audit trail; pending deliveries to it are marked failed.
* [`PATCH` Update Notification Channel `/notification_channels/{channel_id}`](#fallback-operation-23-4)
Update a channel's name, type, URL, or enabled state. Fields left out keep their current values. Disabling a channel stops future deliveries; already-queued deliveries to it are marked failed rather than parked. Reads mask url, so a read-modify-write sends the mask back under...
* [`POST` Test Notification Channel `/notification_channels/{channel_id}/test`](#fallback-operation-23-5)
Synchronously send a clearly-labeled test notification through the channel and report the outcome. Always returns 200; the body carries the verdict.
## Notification Deliveries
* [`GET` List Notification Deliveries `/notification_deliveries`](#fallback-operation-24-0)
Read the delivery log for the organization's notification channels, newest first — what was sent, to which channel, and whether it landed. Paginate with the cursor rather than an offset: pass the next before id from the previous response as before id. A response whose next...

The digital world is connected by APIs,
API7.ai exists to make APIs more efficient, reliable, and secure.
Sign up for API7 newsletter
[Email address]()Subscribe
Product
[API7 Gateway](https://api7.ai/enterprise)[AISIX AI Gateway](https://api7.ai/ai-gateway)[API7 API Portal](https://api7.ai/portal)
Learn
[API Gateway Guide](https://api7.ai/learning-center/api-gateway-guide)[Plugin Hub](https://docs.api7.ai/hub.md)[API Gateway Comparison](https://api7.ai/api-gateway-comparison)[Customers](https://api7.ai/customers)
Resources
[API Gateway Docs](https://docs.api7.ai/apisix/documentation.md)[APISIX AI Agent Skills](https://docs.api7.ai/apisix/ai-agent-skills.md)[API7 AI Agent Skills](https://docs.api7.ai/api7-gateway/ai-agent-skills.md)[Blog](https://api7.ai/blog)[Demo Hub](https://api7.ai/demos)[APISIX vs Kong](https://api7.ai/apisix-vs-kong)[AI Gateway Comparison](https://api7.ai/ai-gateway-comparison)
Company
[About](https://api7.ai/about)[Contact](https://api7.ai/contact)[Partners](https://api7.ai/partners)[Compliance Standards](https://api7.ai/compliance)[Brand Assets](https://api7.ai/branding)[Terms & Privacy](https://api7.ai/terms)
***
[](https://api7.ai/compliance)
[](https://api7.ai/compliance)
[](https://api7.ai/compliance)
[](https://api7.ai/compliance)
[](https://api7.ai/blog/among-2022-red-herring-top-100-global)
Copyright © APISEVEN PTE. LTD 2019 – 2026. Apache, Apache APISIX, APISIX, and associated open source project names are trademarks of the [Apache Software Foundation](https://www.apache.org/)
[](https://www.linkedin.com/company/api7-ai/)[](https://github.com/api7)[](https://twitter.com/api7_ai)
---
[Skip to main content](#__docusaurus_skipToContent_fallback)
[](https://api7.ai/)
ProductsSolutions[Customers](https://api7.ai/customers)
Pricing
Resources[Blog](https://api7.ai/blog)
[Login](https://console.api7.cloud)Get a DemoStart for Free
[](https://api7.ai/)
* Products
[API7 Gateway](https://api7.ai/enterprise)[- ](https://api7.ai/enterprise)
[API7 Gateway](https://api7.ai/enterprise)[- ](https://api7.ai/api7-enterprise-vs-apisix)
[Apache APISIX vs API7](https://api7.ai/api7-enterprise-vs-apisix)[- ](https://api7.ai/portal)
[API7 API Portal](https://api7.ai/portal)
[Apache APISIX](https://api7.ai/apisix)[- ](https://api7.ai/apisix)
[What's Apache APISIX?](https://api7.ai/apisix)[- ](https://api7.ai/blog/why-is-apache-apisix-the-best-api-gateway)
[Why Apache APISIX?](https://api7.ai/blog/why-is-apache-apisix-the-best-api-gateway)[- ](https://api7.ai/apache-apisix-enterprise-support)
[APISIX Commercial Support](https://api7.ai/apache-apisix-enterprise-support)
[AISIX AI Gateway](https://api7.ai/ai-gateway)[- ](https://api7.ai/ai-gateway)
[AISIX AI Gateway](https://api7.ai/ai-gateway)
* Solutions
[Developer](https://api7.ai/solutions/monolith-to-microservices)[- ](https://api7.ai/solutions/monolith-to-microservices)
[Monolith to Microservices](https://api7.ai/solutions/monolith-to-microservices)[- ](https://api7.ai/solutions/on-prem-to-hybrid-cloud)
[On-Prem to Hybrid Cloud](https://api7.ai/solutions/on-prem-to-hybrid-cloud)[- ](https://api7.ai/solutions/observability)
[Observability](https://api7.ai/solutions/observability)
[- ](https://api7.ai/solutions/vm-to-kubernetes)
[VM to Kubernetes](https://api7.ai/solutions/vm-to-kubernetes)[- ](https://api7.ai/solutions/zero-trust-security)
[Zero Trust Security](https://api7.ai/solutions/zero-trust-security)
[Industry](https://api7.ai/solutions/financial-services)[- ](https://api7.ai/solutions/financial-services)
[Financial Services](https://api7.ai/solutions/financial-services)[- ](https://api7.ai/solutions/iot)
[IoT and Automotive](https://api7.ai/solutions/iot)[- ](https://api7.ai/solutions/blockchain)
[Blockchain](https://api7.ai/solutions/blockchain)
[- ](https://api7.ai/solutions/manufacturing)
[Manufacturing](https://api7.ai/solutions/manufacturing)
* [Customers](https://api7.ai/customers)
* Pricing
[- ](https://api7.ai/pricing)
[API Gateway](https://api7.ai/pricing)[- ](https://api7.ai/ai-gateway/pricing)
[AI Gateway](https://api7.ai/ai-gateway/pricing)
* Resources
[Docs](https://docs.api7.ai/ai-gateway/.md)[- ](https://docs.api7.ai/ai-gateway/.md)
[AISIX Docs](https://docs.api7.ai/ai-gateway/.md)[- ](https://docs.api7.ai/api7-gateway)
[API7 Gateway](https://docs.api7.ai/api7-gateway)[- ](https://docs.api7.ai/api7-gateway/ai-agent-skills.md)
[API7 AI Agent Skills](https://docs.api7.ai/api7-gateway/ai-agent-skills.md)[- ](https://docs.api7.ai/apisix)
[Apache APISIX](https://docs.api7.ai/apisix)[- ](https://docs.api7.ai/apisix/ai-agent-skills.md)
[APISIX AI Agent Skills](https://docs.api7.ai/apisix/ai-agent-skills.md)
[Compare](https://api7.ai/apisix-vs-kong)[- ](https://api7.ai/apisix-vs-kong)
[Apache APISIX vs Kong](https://api7.ai/apisix-vs-kong)[- ](https://api7.ai/apisix-vs-nginx)
[Apache APISIX vs NGINX](https://api7.ai/apisix-vs-nginx)[- ](https://api7.ai/api-gateway-comparison)
[2026 Top API Gateway Comparison](https://api7.ai/api-gateway-comparison)[- ](https://api7.ai/ai-gateway-comparison)
[AI Gateway Comparison](https://api7.ai/ai-gateway-comparison)
[Learn](https://api7.ai/learning-center/openresty)[- ](https://api7.ai/learning-center/openresty)
[OpenResty (NGINX + Lua)](https://api7.ai/learning-center/openresty)[- ](https://api7.ai/learning-center/api-gateway-guide)
[API Gateway Guide](https://api7.ai/learning-center/api-gateway-guide)[- ](https://api7.ai/learning-center/ai-gateway-guide)
[AI Gateway Guide](https://api7.ai/learning-center/ai-gateway-guide)[- ](https://api7.ai/learning-center/api-infrastructure-guide)
[API Infrastructure Guide](https://api7.ai/learning-center/api-infrastructure-guide)
[Explore](https://api7.ai/demos)[- ](https://api7.ai/demos)
[Demo Hub](https://api7.ai/demos)[- ](https://docs.api7.ai/hub.md)
[Plugin Hub](https://docs.api7.ai/hub.md)[- ](https://api7.ai/category/usercase)
[Case Studies](https://api7.ai/category/usercase)
* [Blog](https://api7.ai/blog)
Get a DemoStart for Free
[](https://docs.api7.ai/)[Apache APISIX](https://docs.api7.ai/apisix/documentation.md)[API7 Gateway](https://docs.api7.ai/api7-gateway/overview.md)[Ingress Controller](https://docs.api7.ai/ingress-controller/documentation.md)[AISIX AI Gateway](https://docs.api7.ai/ai-gateway/.md)[Plugin Hub](https://docs.api7.ai/hub.md)
Search
# API7 Enterprise Admin APIs
API7 Enterprise Admin APIs are RESTful APIs that allow you to create, configure, and manage all API7 Enterprise resources programmatically. These APIs power the API7 Dashboard and can be used...
## Service
* [`GET` List all services on a gateway group `/apisix/admin/services`](#fallback-operation-0-0)
List services through an APISIX Admin API compatible endpoint under /apisix/admin/. Use this to browse APISIX-formatted service objects in a gateway group. Required IAM Permission: Action gateway:GetPublishedService, Resource arn:api7:gateway:gatewaygroup/%s/service/%s
* [`POST` Create a service on a gateway group `/apisix/admin/services`](#fallback-operation-0-1)
Create a service through an APISIX Admin API compatible endpoint under /apisix/admin/. The payload follows APISIX conventions while operating on the same underlying service resource managed by dashboard APIs. Required IAM Permission: Action gateway:CreatePublishedService...
* [`GET` Get a service on a gateway group `/apisix/admin/services/{service_id}`](#fallback-operation-0-2)
Get one service through an APISIX Admin API compatible endpoint under /apisix/admin/. The response keeps APISIX field conventions for migration and interoperability scenarios. Required IAM Permission: Action gateway:GetPublishedService, Resource...
* [`PUT` Update a service directly `/apisix/admin/services/{service_id}`](#fallback-operation-0-3)
Fully update a service through an APISIX Admin API compatible endpoint under /apisix/admin/. This replaces the stored service configuration. Required IAM Permission: Action gateway:UpdatePublishedService, Resource arn:api7:gateway:gatewaygroup/%s/service/%s
* [`DELETE` Delete a service on a gateway group `/apisix/admin/services/{service_id}`](#fallback-operation-0-4)
Delete a service through an APISIX Admin API compatible endpoint under /apisix/admin/. Removing this object affects all APISIX-compatible references to the service in that gateway group. Required IAM Permission: Action gateway:DeletePublishedService, Resource...
* [`PATCH` Patch a service on a gateway group `/apisix/admin/services/{service_id}`](#fallback-operation-0-5)
Partially update a service via JSON Patch (RFC 6902) through an APISIX Admin API compatible endpoint under /apisix/admin/. Use this for targeted field changes. Required IAM Permission: Action gateway:UpdatePublishedService, Resource arn:api7:gateway:gatewaygroup/%s/service/%s
* [`GET` List all GraphQL cost decorations in a service on a gateway group `/apisix/admin/services/{service_id}/graphql_cost_decorations`](#fallback-operation-0-6)
List the GraphQL cost decorations attached to a service through an APISIX Admin API compatible endpoint under /apisix/admin/. Together they are the service's GraphQL cost model. Required IAM Permission: Action gateway:GetPublishedService, Resource...
* [`POST` Create a GraphQL cost decoration in a service on a gateway group `/apisix/admin/services/{service_id}/graphql_cost_decorations`](#fallback-operation-0-7)
Create a GraphQL cost decoration within a service through an APISIX Admin API compatible endpoint under /apisix/admin/. A decoration gives one position in the service's GraphQL schema graph a weight, which the graphql-limit-count plugin uses to compute a query's cost. A field...
* [`GET` Get a GraphQL cost decoration in a service on a gateway group `/apisix/admin/services/{service_id}/graphql_cost_decorations/{graphql_cost_decoration_id}`](#fallback-operation-0-8)
Get one GraphQL cost decoration in a service through an APISIX Admin API compatible endpoint under /apisix/admin/. Required IAM Permission: Action gateway:GetPublishedService, Resource arn:api7:gateway:gatewaygroup/%s/service/%s
* [`PUT` Update a GraphQL cost decoration in a service on a gateway group `/apisix/admin/services/{service_id}/graphql_cost_decorations/{graphql_cost_decoration_id}`](#fallback-operation-0-9)
Fully update a GraphQL cost decoration through an APISIX Admin API compatible endpoint under /apisix/admin/. Submit the complete decoration object to replace the existing one. Required IAM Permission: Action gateway:UpdatePublishedService, Resource...
* [`DELETE` Delete a GraphQL cost decoration in a service on a gateway group `/apisix/admin/services/{service_id}/graphql_cost_decorations/{graphql_cost_decoration_id}`](#fallback-operation-0-10)
Delete a GraphQL cost decoration from a service through an APISIX Admin API compatible endpoint under /apisix/admin/. Deleting the service reclaims its decorations automatically. Required IAM Permission: Action gateway:UpdatePublishedService, Resource...
## Route
* [`GET` List all routes in a service `/apisix/admin/routes`](#fallback-operation-1-0)
List routes in a service through an APISIX Admin API compatible endpoint under /apisix/admin/. Use pagination and filters to inspect APISIX-compatible route entries. Required IAM Permission: Action gateway:GetPublishedService, Resource arn:api7:gateway:gatewaygroup/%s/service/%s
* [`POST` Create a route in a service on a gateway group `/apisix/admin/routes`](#fallback-operation-1-1)
Create a route in a service through an APISIX Admin API compatible endpoint under /apisix/admin/. This adds APISIX-formatted HTTP routing rules on shared dashboard resources. Required IAM Permission: Action gateway:UpdatePublishedService, Resource...
* [`GET` Get a route in a service on a gateway group `/apisix/admin/routes/{route_id}`](#fallback-operation-1-2)
Get one route in a service through an APISIX Admin API compatible endpoint under /apisix/admin/. This returns the route with APISIX field format. Required IAM Permission: Action gateway:GetPublishedService, Resource arn:api7:gateway:gatewaygroup/%s/service/%s
* [`PUT` Update a route in a service on a gateway group `/apisix/admin/routes/{route_id}`](#fallback-operation-1-3)
Fully update a route in a service through an APISIX Admin API compatible endpoint under /apisix/admin/. Use this when replacing the entire route object. Required IAM Permission: Action gateway:UpdatePublishedService, Resource arn:api7:gateway:gatewaygroup/%s/service/%s
* [`DELETE` Delete a route in a service on a gateway group `/apisix/admin/routes/{route_id}`](#fallback-operation-1-4)
Delete a route from a service through an APISIX Admin API compatible endpoint under /apisix/admin/. Requests that matched this rule will no longer be routed by it. Required IAM Permission: Action gateway:UpdatePublishedService, Resource arn:api7:gateway:gatewaygroup/%s/service/%s
* [`PATCH` Patch a route in a service on a gateway group `/apisix/admin/routes/{route_id}`](#fallback-operation-1-5)
Partially update a route in a service via JSON Patch (RFC 6902) through an APISIX Admin API compatible endpoint under /apisix/admin/. Required IAM Permission: Action gateway:UpdatePublishedService, Resource arn:api7:gateway:gatewaygroup/%s/service/%s
## Stream Route
* [`GET` List all stream routes in a service on a gateway group `/apisix/admin/stream_routes`](#fallback-operation-2-0)
List stream routes in a service through an APISIX Admin API compatible endpoint under /apisix/admin/. Use this for visibility into current L4 routing rules. Required IAM Permission: Action gateway:GetPublishedService, Resource arn:api7:gateway:gatewaygroup/%s/service/%s
* [`POST` Create a stream route in a service on a gateway group `/apisix/admin/stream_routes`](#fallback-operation-2-1)
Create a stream route in a service through an APISIX Admin API compatible endpoint under /apisix/admin/. This configures APISIX-style TCP/UDP traffic matching rules. Required IAM Permission: Action gateway:UpdatePublishedService, Resource...
* [`GET` Get a stream route in a service on a gateway group `/apisix/admin/stream_routes/{stream_route_id}`](#fallback-operation-2-2)
Get one stream route in a service through an APISIX Admin API compatible endpoint under /apisix/admin/. The returned object matches APISIX stream-route conventions. Required IAM Permission: Action gateway:GetPublishedService, Resource arn:api7:gateway:gatewaygroup/%s/service/%s
* [`PUT` Update a stream route in a service on a gateway group `/apisix/admin/stream_routes/{stream_route_id}`](#fallback-operation-2-3)
Fully update a stream route in a service through an APISIX Admin API compatible endpoint under /apisix/admin/. This replaces the existing stream-route configuration. Required IAM Permission: Action gateway:UpdatePublishedService, Resource...
* [`DELETE` Delete a stream route in a service on a gateway group `/apisix/admin/stream_routes/{stream_route_id}`](#fallback-operation-2-4)
Delete a stream route from a service through an APISIX Admin API compatible endpoint under /apisix/admin/. This removes a specific L4 route while preserving other service objects. Required IAM Permission: Action gateway:UpdatePublishedService, Resource...
## Upstream
* [`GET` List all upstreams in a service on a gateway group `/apisix/admin/services/{service_id}/upstreams`](#fallback-operation-3-0)
List upstreams attached to a service through an APISIX Admin API compatible endpoint under /apisix/admin/. Use this to inspect backend pools and their current settings. Required IAM Permission: Action gateway:GetPublishedService, Resource...
* [`POST` Create an upstream in a service on a gateway group `/apisix/admin/services/{service_id}/upstreams`](#fallback-operation-3-1)
Create an upstream within a service through an APISIX Admin API compatible endpoint under /apisix/admin/. This adds backend target configuration in APISIX format. Required IAM Permission: Action gateway:UpdatePublishedService, Resource arn:api7:gateway:gatewaygroup/%s/service/%s
* [`GET` Get an upstream in a service on a gateway group `/apisix/admin/services/{service_id}/upstreams/{upstream_id}`](#fallback-operation-3-2)
Get one upstream in a service through an APISIX Admin API compatible endpoint under /apisix/admin/. The response uses APISIX-style upstream structure. Required IAM Permission: Action gateway:GetPublishedService, Resource arn:api7:gateway:gatewaygroup/%s/service/%s
* [`PUT` Update an upstream in a service on a gateway group `/apisix/admin/services/{service_id}/upstreams/{upstream_id}`](#fallback-operation-3-3)
Fully update an upstream in a service through an APISIX Admin API compatible endpoint under /apisix/admin/. Submit the complete upstream object to replace existing configuration. Required IAM Permission: Action gateway:UpdatePublishedService, Resource...
* [`DELETE` Delete an upstream in a service on a gateway group `/apisix/admin/services/{service_id}/upstreams/{upstream_id}`](#fallback-operation-3-4)
Delete an upstream from a service through an APISIX Admin API compatible endpoint under /apisix/admin/. This updates service backend routing targets without deleting the service itself. Required IAM Permission: Action gateway:UpdatePublishedService, Resource...
* [`PATCH` Patch an upstream in a service on a gateway group `/apisix/admin/services/{service_id}/upstreams/{upstream_id}`](#fallback-operation-3-5)
Partially update an upstream in a service via JSON Patch (RFC 6902) through an APISIX Admin API compatible endpoint under /apisix/admin/. Required IAM Permission: Action gateway:UpdatePublishedService, Resource arn:api7:gateway:gatewaygroup/%s/service/%s
* [`GET` Get healthcheck status for the upstream of a service on a gateway group, if upstream\_id is not provided, get healthcheck status for default upstream of this service `/api/gateway_groups/{gateway_group_id}/services/{apisix_service_id}/healthcheck`](#fallback-operation-3-6)
Retrieve upstream node health check results for a service in a gateway group. If no upstream ID is provided, the status of the service's default upstream is returned. Required IAM Permission: Action gateway:GetPublishedService, Resource arn:api7:gateway:gatewaygroup/%s/service/%s
## OpenAPI
* [`GET` Get the OpenAPI Specification of a service `/api/gateway_groups/{gateway_group_id}/services/{apisix_service_id}/oas`](#fallback-operation-4-0)
Get the OAS document for a service. Required IAM Permission: Action gateway:GetPublishedService, Resource arn:api7:gateway:gatewaygroup/%s/service/%s
* [`PUT` Update the OpenAPI Specification of a service `/api/gateway_groups/{gateway_group_id}/services/{apisix_service_id}/oas`](#fallback-operation-4-1)
Update the OAS document for a service. Required IAM Permission: Action gateway:UpdatePublishedService, Resource arn:api7:gateway:gatewaygroup/%s/service/%s
* [`POST` Generate an OpenAPI specification from services in a gateway group `/api/gateway_groups/{gateway_group_id}/services/export`](#fallback-operation-4-2)
Export service definitions from a specific gateway group as an OpenAPI 3.0 specification document. Required IAM Permission: Action gateway:GetPublishedService, Resource arn:api7:gateway:gatewaygroup/%s/service/
* [`POST` Import services based on OpenAPI Specification `/api/import/services`](#fallback-operation-4-3)
Import an OpenAPI specification directly into services for a gateway group. This operation creates runtime service resources scoped to the target gateway group. Required IAM Permission: Action gateway:CreatePublishedService, Resource arn:api7:gateway:gatewaygroup/%s/service/
* [`PUT` Convert OpenAPI Specification to service and route resources `/api/openapi/convert`](#fallback-operation-4-4)
Convert a given OpenAPI Specification into service and route resource structures without creating those resources. Use this endpoint for preview, validation, and transformation workflows before import.
## Consumer
* [`GET` List all consumers on a gateway group `/apisix/admin/consumers`](#fallback-operation-5-0)
IAM Action: gateway:GetConsumer, Resource: arn:api7:gateway:gatewaygroup/%s/consumer/%s
* [`POST` Create a consumer on a gateway group `/apisix/admin/consumers`](#fallback-operation-5-1)
IAM Action: gateway:CreateConsumer, Resource: arn:api7:gateway:gatewaygroup/%s/consumer/
* [`GET` Get a consumer on a gateway group `/apisix/admin/consumers/{username}`](#fallback-operation-5-2)
IAM Action: gateway:GetConsumer, Resource: arn:api7:gateway:gatewaygroup/%s/consumer/%s
* [`PUT` Update a consumer on a gateway group `/apisix/admin/consumers/{username}`](#fallback-operation-5-3)
IAM Action: gateway:UpdateConsumer, Resource: arn:api7:gateway:gatewaygroup/%s/consumer/%s
* [`DELETE` Delete a consumer `/apisix/admin/consumers/{username}`](#fallback-operation-5-4)
IAM Action: gateway:DeleteConsumer, Resource: arn:api7:gateway:gatewaygroup/%s/consumer/%s
* [`PATCH` Update a consumer on a gateway group `/apisix/admin/consumers/{username}`](#fallback-operation-5-5)
IAM Action: gateway:UpdateConsumer, Resource: arn:api7:gateway:gatewaygroup/%s/consumer/%s
* [`GET` List all consumer credentials on a gateway group `/apisix/admin/consumers/{username}/credentials`](#fallback-operation-5-6)
IAM Action: gateway:GetConsumerCredential, Resource: arn:api7:gateway:gatewaygroup/%s/consumer/%s
* [`POST` Create a consumer credential on a gateway group `/apisix/admin/consumers/{username}/credentials`](#fallback-operation-5-7)
IAM Action: gateway:CreateConsumerCredential, Resource: arn:api7:gateway:gatewaygroup/%s/consumer/%s
* [`GET` Get a consumer credential on a gateway group `/apisix/admin/consumers/{username}/credentials/{credential_id}`](#fallback-operation-5-8)
IAM Action: gateway:GetConsumerCredential, Resource: arn:api7:gateway:gatewaygroup/%s/consumer/%s
* [`PUT` Update a consumer credential on a gateway group `/apisix/admin/consumers/{username}/credentials/{credential_id}`](#fallback-operation-5-9)
IAM Action: gateway:UpdateConsumerCredential, Resource: arn:api7:gateway:gatewaygroup/%s/consumer/%s
* [`DELETE` Delete a consumer credential `/apisix/admin/consumers/{username}/credentials/{credential_id}`](#fallback-operation-5-10)
IAM Action: gateway:DeleteConsumerCredential, Resource: arn:api7:gateway:gatewaygroup/%s/consumer/%s
## Gateway Group
* [`POST` Check service route conflicts in a gateway group `/api/gateway_groups/{gateway_group_id}/services/conflict_check`](#fallback-operation-6-0)
Check for duplicate or overlapping routes among services within a gateway group.
* [`GET` List all gateway groups `/api/gateway_groups`](#fallback-operation-6-1)
IAM Action: gateway:GetGatewayGroup, Resource: arn:api7:gateway:gatewaygroup/%s
* [`POST` Create a gateway group `/api/gateway_groups`](#fallback-operation-6-2)
IAM Action: gateway:CreateGatewayGroup, Resource: arn:api7:gateway:gatewaygroup/%s
* [`GET` Count resources by type in each gateway group `/api/gateway_groups/count/{resource_type}`](#fallback-operation-6-3)
* [`GET` List SSL Usage in a gateway group `/api/gateway_groups/{gateway_group_id}/ssls/{ssl_id}/usage`](#fallback-operation-6-4)
IAM Action: gateway:GetSSLCertificate, Resource: arn:api7:gateway:gatewaygroup/%s
* [`GET` List SNI Usage in a gateway group `/api/gateway_groups/{gateway_group_id}/snis/{sni_id}/usage`](#fallback-operation-6-5)
IAM Action: gateway:GetSNI, Resource: arn:api7:gateway:gatewaygroup/%s
* [`GET` List Certificate Usage in a gateway group `/api/gateway_groups/{gateway_group_id}/certificates/{certificate_id}/usage`](#fallback-operation-6-6)
IAM Action: gateway:GetCertificate, Resource: arn:api7:gateway:gatewaygroup/%s
* [`GET` List CA Certificate Usage in a gateway group `/api/gateway_groups/{gateway_group_id}/ca_certificates/{ca_certificate_id}/usage`](#fallback-operation-6-7)
IAM Action: gateway:GetCACertificate, Resource: arn:api7:gateway:gatewaygroup/%s
* [`POST` Check if a certificate exists in a gateway group `/api/gateway_groups/{gateway_group_id}/certificates/exists`](#fallback-operation-6-8)
IAM Action: gateway:GetCACertificate, Resource: arn:api7:gateway:gatewaygroup/%s
* [`POST` Check if a CA certificate exists in a gateway group `/api/gateway_groups/{gateway_group_id}/ca_certificates/exists`](#fallback-operation-6-9)
IAM Action: gateway:GetCACertificate, Resource: arn:api7:gateway:gatewaygroup/%s
* [`GET` List Secret Provider Usage in a gateway group `/api/gateway_groups/{gateway_group_id}/secret_providers/{secret_provider}/{secret_provider_id}/usage`](#fallback-operation-6-10)
IAM Action: gateway:GetSecretProvider, Resource: arn:api7:gateway:gatewaygroup/%s
* [`GET` Get a gateway group `/api/gateway_groups/{gateway_group_id}`](#fallback-operation-6-11)
IAM Action: gateway:GetGatewayGroup, Resource: arn:api7:gateway:gatewaygroup/%s
* [`PUT` Update a gateway group `/api/gateway_groups/{gateway_group_id}`](#fallback-operation-6-12)
IAM Action: gateway:UpdateGatewayGroup, Resource: arn:api7:gateway:gatewaygroup/%s
* [`DELETE` Delete a gateway group `/api/gateway_groups/{gateway_group_id}`](#fallback-operation-6-13)
IAM Action: gateway:DeleteGatewayGroup, Resource: arn:api7:gateway:gatewaygroup/%s
* [`POST` Get resource paths `/api/gateway_groups/{gateway_group_id}/resource_paths`](#fallback-operation-6-14)
Resolve resource IDs to ordered business resource paths on demand. IAM Action: gateway:GetGatewayGroup, Resource: arn:api7:gateway:gatewaygroup/%s
* [`GET` List monitored shared dictionaries of a gateway group `/api/gateway_groups/{gateway_group_id}/shared_dict_names`](#fallback-operation-6-15)
List the shared dictionaries (shared memory zones) worth monitoring for a gateway group, i.e. every shared dict the data plane reports metrics for minus the ones on the alert denylist (lock dicts and LRU caches).
* [`GET` Get the admin key for a gateway group. `/api/gateway_groups/{gateway_group_id}/admin_key`](#fallback-operation-6-16)
IAM Action: gateway:GetAdminKey, Resource: arn:api7:gateway:gatewaygroup/%s
* [`PUT` Generate an admin key for a gateway group `/api/gateway_groups/{gateway_group_id}/admin_key`](#fallback-operation-6-17)
IAM Action: gateway:UpdateGatewayGroup, Resource: arn:api7:gateway:gatewaygroup/%s
* [`GET` Generate a script to install gateway API resources for ingress gateway group `/api/gateway_groups/{gateway_group_id}/ingress/script`](#fallback-operation-6-18)
IAM Action: gateway:GetAdminKey, Resource: arn:api7:gateway:gatewaygroup/%s
* [`GET` Generate script to install the gateway api resources for ingress gateway group. `/api/gateway_groups/{gateway_group_id}/ingress/step1`](#fallback-operation-6-19)
## Gateway Instance
* [`GET` List all gateway instances of all gateway groups `/api/instances`](#fallback-operation-7-0)
IAM Action: gateway:GetGatewayInstance, Resource: arn:api7:gateway:gatewaygroup/%s
* [`GET` List all gateway instances on a gateway group `/api/gateway_groups/{gateway_group_id}/instances`](#fallback-operation-7-1)
IAM Action: gateway:GetGatewayInstance, Resource: arn:api7:gateway:gatewaygroup/%s
* [`GET` Count the number of gateway instances by status in a gateway group `/api/instances/count/{field}`](#fallback-operation-7-2)
IAM Action: gateway:GetGatewayInstance, Resource: arn:api7:gateway:gatewaygroup/%s
* [`GET` List gateway instances cores of all gateway groups `/api/instances/cores`](#fallback-operation-7-3)
IAM Action: gateway:GetGatewayInstanceCore, Resource: arn:api7:gateway:gatewaygroup/
* [`GET` Export the gateway instance core usage `/api/instances/cores_usages/export`](#fallback-operation-7-4)
The gateway instance’s core usage is exported hourly within the specified time interval. IAM Action: gateway:GetGatewayInstanceCore, Resource: arn:api7:gateway:gatewaygroup/
* [`GET` Generate a script to install the gateway instance by Docker `/api/gateway_groups/{gateway_group_id}/deployment/docker`](#fallback-operation-7-5)
IAM Action: gateway:CreateGatewayInstance, Resource: arn:api7:gateway:gatewaygroup/%s
* [`GET` Generate a script to install the gateway instance by Docker Compose `/api/gateway_groups/{gateway_group_id}/deployment/docker-compose`](#fallback-operation-7-6)
IAM Action: gateway:CreateGatewayInstance, Resource: arn:api7:gateway:gatewaygroup/%s
* [`GET` Generate a script to install the gateway instance by Helm in Kubernetes `/api/gateway_groups/{gateway_group_id}/deployment/helm/script`](#fallback-operation-7-7)
IAM Action: gateway:CreateGatewayInstance, Resource: arn:api7:gateway:gatewaygroup/%s
* [`GET` Generate a values file for the gateway's Kubernetes Helm chart `/api/gateway_groups/{gateway_group_id}/deployment/helm/yaml`](#fallback-operation-7-8)
IAM Action: gateway:CreateGatewayInstance, Resource: arn:api7:gateway:gatewaygroup/%s
* [`GET` Generate a script to install the gateway instance by RPM `/api/gateway_groups/{gateway_group_id}/deployment/rpm`](#fallback-operation-7-9)
IAM Action: gateway:CreateGatewayInstance, Resource: arn:api7:gateway:gatewaygroup/%s
* [`DELETE` Delete gateway instance `/api/gateway_groups/{gateway_group_id}/instances/{gateway_instance_id}`](#fallback-operation-7-10)
IAM Action: gateway:DeleteGatewayInstance, Resource: arn:api7:gateway:gatewaygroup/%s
* [`POST` Issue a data plane certificate on a gateway group `/api/gateway_groups/{gateway_group_id}/dp_client_certificates`](#fallback-operation-7-11)
Issue a client TLS certificate for data plane instances in the specified gateway group to authenticate with the control plane. Use this during gateway bootstrap or certificate rotation. Required IAM Permission: Action gateway:CreateGatewayInstance, Resource...
* [`POST` Create a token for all gateway instances in a gateway group `/api/gateway_groups/{gateway_group_id}/instance_token`](#fallback-operation-7-12)
IAM Action: gateway:CreateGatewayInstance, Resource: arn:api7:gateway:gatewaygroup/%s
## SSL
* [`GET` List all SSL certificates on a gateway group `/apisix/admin/ssls`](#fallback-operation-8-0)
IAM Action: gateway:GetSSLCertificate, Resource: arn:api7:gateway:gatewaygroup/%s
* [`POST` Create an SSL certificate `/apisix/admin/ssls`](#fallback-operation-8-1)
IAM Action: gateway:CreateSSLCertificate, Resource: arn:api7:gateway:gatewaygroup/%s
* [`GET` Get an SSL certificate on a gateway group `/apisix/admin/ssls/{ssl_id}`](#fallback-operation-8-2)
IAM Action: gateway:GetSSLCertificate, Resource: arn:api7:gateway:gatewaygroup/%s
* [`PUT` Update an SSL certificate on a gateway group `/apisix/admin/ssls/{ssl_id}`](#fallback-operation-8-3)
IAM Action: gateway:UpdateSSLCertificate, Resource: arn:api7:gateway:gatewaygroup/%s
* [`DELETE` Delete an SSL certificate on a gateway group `/apisix/admin/ssls/{ssl_id}`](#fallback-operation-8-4)
IAM Action: gateway:DeleteSSLCertificate, Resource: arn:api7:gateway:gatewaygroup/%s
* [`PUT` Parse an SSL certificate `/api/parse_certificate`](#fallback-operation-8-5)
* [`PUT` Validate an SSL certificate and key `/api/validate_cert_key`](#fallback-operation-8-6)
## Certificate
* [`GET` List all certificates on a gateway group `/apisix/admin/certificates`](#fallback-operation-9-0)
List TLS server certificates configured in the gateway group. Use filters such as labels, related SNI, expiration time, and search keywords to find certificates for rotation or troubleshooting. Required IAM Permission: Action gateway:GetCertificate, Resource...
* [`POST` Create a certificate `/apisix/admin/certificates`](#fallback-operation-9-1)
Create a TLS server certificate for the gateway group, including the certificate chain and private key used for HTTPS termination. Required IAM Permission: Action gateway:CreateCertificate, Resource arn:api7:gateway:gatewaygroup/%s
* [`GET` Get a certificate on a gateway group `/apisix/admin/certificates/{certificate_id}`](#fallback-operation-9-2)
Retrieve details of a specific TLS server certificate in the gateway group, including its configured metadata and bindings. Required IAM Permission: Action gateway:GetCertificate, Resource arn:api7:gateway:gatewaygroup/%s
* [`PUT` Update a certificate on a gateway group `/apisix/admin/certificates/{certificate_id}`](#fallback-operation-9-3)
Replace the full configuration of an existing TLS server certificate in the gateway group. This operation may impact HTTPS traffic using this certificate. Required IAM Permission: Action gateway:UpdateCertificate, Resource arn:api7:gateway:gatewaygroup/%s
* [`DELETE` Delete a certificate on a gateway group `/apisix/admin/certificates/{certificate_id}`](#fallback-operation-9-4)
Delete a TLS server certificate from the gateway group. Ensure no active SNI or route still depends on this certificate before removal. Required IAM Permission: Action gateway:DeleteCertificate, Resource arn:api7:gateway:gatewaygroup/%s
* [`PATCH` Patch a certificate on a gateway group `/apisix/admin/certificates/{certificate_id}`](#fallback-operation-9-5)
Partially update fields of a TLS server certificate using JSON Patch (RFC 6902). Use this when adjusting selected attributes without replacing the entire certificate object. Required IAM Permission: Action gateway:UpdateCertificate, Resource arn:api7:gateway:gatewaygroup/%s
## CACertificate
* [`GET` List all CA certificates on a gateway group `/apisix/admin/ca_certificates`](#fallback-operation-10-0)
List CA certificates configured for mTLS client certificate verification in the gateway group. Use query filters to locate certificates by labels, expiration, or associated SNI. Required IAM Permission: Action gateway:GetCertificate, Resource arn:api7:gateway:gatewaygroup/%s
* [`POST` Create a CA certificate `/apisix/admin/ca_certificates`](#fallback-operation-10-1)
Create a CA certificate used to verify client certificates during mTLS handshakes in the gateway group. Required IAM Permission: Action gateway:CreateCertificate, Resource arn:api7:gateway:gatewaygroup/%s
* [`GET` Get a CA certificate on a gateway group `/apisix/admin/ca_certificates/{ca_certificate_id}`](#fallback-operation-10-2)
Retrieve details of a specific CA certificate configured in the gateway group for mTLS validation. Required IAM Permission: Action gateway:GetCertificate, Resource arn:api7:gateway:gatewaygroup/%s
* [`PUT` Update a CA certificate on a gateway group `/apisix/admin/ca_certificates/{ca_certificate_id}`](#fallback-operation-10-3)
Replace the full configuration of an existing CA certificate used for client certificate verification. Changes can affect mTLS authentication for related traffic. Required IAM Permission: Action gateway:UpdateCertificate, Resource arn:api7:gateway:gatewaygroup/%s
* [`DELETE` Delete a CA certificate on a gateway group `/apisix/admin/ca_certificates/{ca_certificate_id}`](#fallback-operation-10-4)
Delete a CA certificate from the gateway group. Confirm no active mTLS SNI or client verification flow still relies on this certificate. Required IAM Permission: Action gateway:DeleteCertificate, Resource arn:api7:gateway:gatewaygroup/%s
* [`PATCH` Patch a CA certificate on a gateway group `/apisix/admin/ca_certificates/{ca_certificate_id}`](#fallback-operation-10-5)
Partially update a CA certificate with JSON Patch (RFC 6902) operations. Use patching for targeted changes without sending the full CA certificate payload. Required IAM Permission: Action gateway:UpdateCertificate, Resource arn:api7:gateway:gatewaygroup/%s
## SNI
* [`GET` List all SNIs on a gateway group `/apisix/admin/snis`](#fallback-operation-11-0)
List SNI configurations for the gateway group, including hostname and mTLS related settings. Use filters to locate entries by domain, labels, or mTLS enablement. Required IAM Permission: Action gateway:GetSNI, Resource arn:api7:gateway:gatewaygroup/%s
* [`POST` Create an SNI `/apisix/admin/snis`](#fallback-operation-11-1)
Create an SNI entry that maps one or more hostnames to TLS certificates in the gateway group. This allows a single gateway to serve multiple domains over HTTPS. Required IAM Permission: Action gateway:CreateSNI, Resource arn:api7:gateway:gatewaygroup/%s
* [`GET` Get an SNI on a gateway group `/apisix/admin/snis/{sni_id}`](#fallback-operation-11-2)
Retrieve the configuration of a specific SNI entry in the gateway group, including bound domains and certificate references. Required IAM Permission: Action gateway:GetSNI, Resource arn:api7:gateway:gatewaygroup/%s
* [`PUT` Update an SNI on a gateway group `/apisix/admin/snis/{sni_id}`](#fallback-operation-11-3)
Replace an existing SNI configuration in full, such as domain mappings, certificate bindings, or mTLS options. Updates take effect on TLS handshakes for matching hostnames. Required IAM Permission: Action gateway:UpdateSNI, Resource arn:api7:gateway:gatewaygroup/%s
* [`DELETE` Delete an SNI on a gateway group `/apisix/admin/snis/{sni_id}`](#fallback-operation-11-4)
Delete an SNI entry from the gateway group to remove its hostname-to- certificate mapping. Verify that traffic for those domains has a replacement SNI before deletion. Required IAM Permission: Action gateway:DeleteSNI, Resource arn:api7:gateway:gatewaygroup/%s
* [`PATCH` Patch an SNI on a gateway group `/apisix/admin/snis/{sni_id}`](#fallback-operation-11-5)
Partially update selected SNI fields using JSON Patch (RFC 6902). This is useful for incremental hostname or certificate adjustments without replacing the entire SNI object. Required IAM Permission: Action gateway:UpdateSNI, Resource arn:api7:gateway:gatewaygroup/%s
## Global Rule
* [`GET` List all global rules on a gateway group `/apisix/admin/global_rules`](#fallback-operation-12-0)
List global plugin rules configured for the gateway group. This helps audit request-wide policies and understand which plugins are enforced universally. Required IAM Permission: Action gateway:GetGlobalPluginRule, Resource arn:api7:gateway:gatewaygroup/%s
* [`POST` Create a global rule on a gateway group `/apisix/admin/global_rules`](#fallback-operation-12-1)
Create a global rule that applies plugin configuration to all requests in the gateway group. Use this for cross-cutting behavior such as global authentication, logging, or rate controls. Required IAM Permission: Action gateway:CreateGlobalPluginRule, Resource...
* [`GET` Get a global rule on a gateway group `/apisix/admin/global_rules/{global_rule_id}`](#fallback-operation-12-2)
Retrieve one global rule in the gateway group, including its plugin configuration and execution settings. Required IAM Permission: Action gateway:GetGlobalPluginRule, Resource arn:api7:gateway:gatewaygroup/%s
* [`PUT` Update a global rule on a gateway group `/apisix/admin/global_rules/{global_rule_id}`](#fallback-operation-12-3)
Replace an existing global rule configuration in full for the gateway group. Changes immediately affect all matching traffic because global rules are applied gateway-wide. Required IAM Permission: Action gateway:UpdateGlobalPluginRule, Resource arn:api7:gateway:gatewaygroup/%s
* [`DELETE` Delete a global rule on a gateway group `/apisix/admin/global_rules/{global_rule_id}`](#fallback-operation-12-4)
Delete a global rule from the gateway group, removing its plugin behavior from all requests. Review related route or service plugin configuration if equivalent controls are still required. Required IAM Permission: Action gateway:DeleteGlobalPluginRule, Resource...
## Plugin
* [`GET` Get all plugin schemas and priorities `/apisix/admin/plugins`](#fallback-operation-13-0)
* [`GET` List all plugin names `/apisix/admin/plugins/list`](#fallback-operation-13-1)
* [`GET` Get schema definition of a plugin `/apisix/admin/plugins/{plugin_name}`](#fallback-operation-13-2)
Get schema definition of a plugin, including plugin meta properties and plugin properties. The endpoint returns the same response as the /apisix/admin/schema/plugins/{plugin name} endpoint when scope is not set.
* [`GET` Get all plugin details `/api/plugins`](#fallback-operation-13-3)
* [`GET` List all plugin catalogs `/api/plugins/catalogs`](#fallback-operation-13-4)
* [`GET` Get the usage of a plugin in a gateway group `/api/gateway_groups/{gateway_group_id}/plugins/{plugin_name}/usage`](#fallback-operation-13-5)
List the resources of the gateway group that reference the plugin. A custom plugin belongs to a gateway group, so its usage is a question about one group. Required IAM Permission: Action gateway:GetCustomPlugin, Resource arn:api7:gateway:gatewaygroup/{gateway group id}
## Plugin Metadata
* [`GET` List all plugin metadata on a gateway group `/apisix/admin/plugin_metadata`](#fallback-operation-14-0)
List plugin metadata objects configured in the gateway group. Plugin metadata provides shared settings for a plugin type across all its instances. Required IAM Permission: Action gateway:GetPluginMetadata, Resource arn:api7:gateway:gatewaygroup/%s
* [`GET` Get a plugin metadata on a gateway group `/apisix/admin/plugin_metadata/{plugin_name}`](#fallback-operation-14-1)
Retrieve metadata for a specific plugin type in the gateway group. You can optionally request default metadata values for comparison. Required IAM Permission: Action gateway:GetPluginMetadata, Resource arn:api7:gateway:gatewaygroup/%s
* [`PUT` Update a plugin metadata on a gateway group `/apisix/admin/plugin_metadata/{plugin_name}`](#fallback-operation-14-2)
Update the shared metadata configuration for a specific plugin type in the gateway group. The change affects behavior of all plugin instances that consume this metadata. Required IAM Permission: Action gateway:UpdatePluginMetadata, Resource arn:api7:gateway:gatewaygroup/%s
* [`DELETE` Delete a plugin metadata on a gateway group `/apisix/admin/plugin_metadata/{plugin_name}`](#fallback-operation-14-3)
Delete metadata for a specific plugin type in the gateway group and revert to plugin defaults where applicable. Validate downstream plugin behavior after removal. Required IAM Permission: Action gateway:DeletePluginMetadata, Resource arn:api7:gateway:gatewaygroup/%s
* [`GET` Get the default value of a plugin metadata `/apisix/admin/plugin_metadata/{plugin_name}/default`](#fallback-operation-14-4)
## Custom Plugin
* [`GET` List the custom plugins of a gateway group `/api/gateway_groups/{gateway_group_id}/custom_plugins`](#fallback-operation-15-0)
List the custom plugins the gateway group runs. Use pagination and search parameters to locate plugins by name. Required IAM Permission: Action gateway:GetCustomPlugin, Resource arn:api7:gateway:gatewaygroup/{gateway group id}
* [`GET` Get a custom plugin `/api/gateway_groups/{gateway_group_id}/custom_plugins/{custom_plugin_name}`](#fallback-operation-15-1)
Retrieve the code and metadata of the custom plugin the gateway group runs under this name. Required IAM Permission: Action gateway:GetCustomPlugin, Resource arn:api7:gateway:gatewaygroup/{gateway group id}
* [`PUT` Create or replace a custom plugin `/api/gateway_groups/{gateway_group_id}/custom_plugins/{custom_plugin_name}`](#fallback-operation-15-2)
Upload a custom plugin to the gateway group, creating it or replacing the code the group is running under this name. The plugin name declared by the uploaded code must match the name in the path. Only this gateway group is affected: the same plugin name in another gateway...
* [`DELETE` Delete a custom plugin `/api/gateway_groups/{gateway_group_id}/custom_plugins/{custom_plugin_name}`](#fallback-operation-15-3)
Remove the custom plugin from the gateway group. The plugin must no longer be referenced by the resources of this gateway group. Required IAM Permission: Action gateway:DeleteCustomPlugin, Resource arn:api7:gateway:gatewaygroup/{gateway group id}
* [`PUT` Parse custom plugin code `/api/gateway_groups/{gateway_group_id}/custom_plugins/code/parse`](#fallback-operation-15-4)
Parse and validate custom plugin source payload to extract plugin metadata and detect structural issues before uploading a plugin. Required IAM Permission: Action gateway:UpdateCustomPlugin, Resource arn:api7:gateway:gatewaygroup/{gateway group id}
## Secret Provider
* [`GET` List all secret providers on a gateway group `/apisix/admin/secret_providers`](#fallback-operation-16-0)
List secret provider integrations configured for the gateway group, such as Vault or cloud secret managers. Use this view to audit external secret backends available for plugin and route configurations. Required IAM Permission: Action gateway:GetSecretProvider, Resource...
* [`GET` Get a secret provider on a gateway group `/apisix/admin/secret_providers/{secret_provider}/{secret_provider_id}`](#fallback-operation-16-1)
Retrieve details of one secret provider integration in the gateway group, including provider-specific connection settings. Required IAM Permission: Action gateway:GetSecretProvider, Resource arn:api7:gateway:gatewaygroup/%s/secret provider/%s
* [`PUT` Update a secret provider on a gateway group `/apisix/admin/secret_providers/{secret_provider}/{secret_provider_id}`](#fallback-operation-16-2)
Create or replace the configuration of a secret provider integration in the gateway group. This controls how the gateway resolves externally managed secrets referenced by runtime configs. Required IAM Permission: Action gateway:PutSecretProvider, Resource...
* [`DELETE` Delete a secret provider on a gateway group `/apisix/admin/secret_providers/{secret_provider}/{secret_provider_id}`](#fallback-operation-16-3)
Delete a secret provider integration from the gateway group. Ensure no plugin or resource still references secrets from this provider before removal. Required IAM Permission: Action gateway:DeleteSecretProvider, Resource arn:api7:gateway:gatewaygroup/%s/secret provider/%s
## Proto
* [`GET` List all protos on a gateway group `/apisix/admin/protos`](#fallback-operation-17-0)
List Protocol Buffers definitions stored in the gateway group. These proto files are used by gRPC-transcode related configurations to map REST calls to gRPC methods. Required IAM Permission: Action gateway:GetProto, Resource arn:api7:gateway:gatewaygroup/%s
* [`POST` Create a proto on a gateway group `/apisix/admin/protos`](#fallback-operation-17-1)
Upload a new .proto definition to the gateway group for gRPC transcoding scenarios. Ensure package and service definitions align with upstream gRPC services. Required IAM Permission: Action gateway:CreateProto, Resource arn:api7:gateway:gatewaygroup/%s
* [`GET` Get a proto on a gateway group `/apisix/admin/protos/{proto_id}`](#fallback-operation-17-2)
Retrieve one proto definition from the gateway group, including its current content and metadata. Required IAM Permission: Action gateway:GetProto, Resource arn:api7:gateway:gatewaygroup/%s
* [`PUT` Update a proto on a gateway group `/apisix/admin/protos/{proto_id}`](#fallback-operation-17-3)
Replace an existing proto definition in the gateway group. After updates, verify dependent gRPC-transcode routes still match the revised service and method signatures. Required IAM Permission: Action gateway:UpdateProto, Resource arn:api7:gateway:gatewaygroup/%s
* [`DELETE` Delete a proto on a gateway group `/apisix/admin/protos/{proto_id}`](#fallback-operation-17-4)
Delete a proto definition from the gateway group. Check for any gRPC-transcode plugin configurations that still reference this proto before deletion. Required IAM Permission: Action gateway:DeleteProto, Resource arn:api7:gateway:gatewaygroup/%s
## Service Registry
* [`GET` List all service registry connections on a gateway group `/api/gateway_groups/{gateway_group_id}/service_registries`](#fallback-operation-18-0)
IAM Action: gateway:GetServiceRegistry, Resource: arn:api7:gateway:gatewaygroup/%s
* [`POST` Create a service registry connection on a gateway group `/api/gateway_groups/{gateway_group_id}/service_registries`](#fallback-operation-18-1)
IAM Action: gateway:ConnectServiceRegistry, Resource: arn:api7:gateway:gatewaygroup/%s
* [`GET` Get a service registry connection on a gateway group `/api/gateway_groups/{gateway_group_id}/service_registries/{service_registry_id}`](#fallback-operation-18-2)
IAM Action: gateway:GetServiceRegistry, Resource: arn:api7:gateway:gatewaygroup/%s
* [`PUT` Update a service registry connection on a gateway group `/api/gateway_groups/{gateway_group_id}/service_registries/{service_registry_id}`](#fallback-operation-18-3)
IAM Action: gateway:UpdateServiceRegistry, Resource: arn:api7:gateway:gatewaygroup/%s
* [`DELETE` Delete a service registry connection on a gateway group `/api/gateway_groups/{gateway_group_id}/service_registries/{service_registry_id}`](#fallback-operation-18-4)
IAM Action: gateway:DisconnectServiceRegistry, Resource: arn:api7:gateway:gatewaygroup/%s
* [`GET` List all services connected to a service registry `/api/gateway_groups/{gateway_group_id}/service_registries/{service_registry_id}/connected_services`](#fallback-operation-18-5)
IAM Action: gateway:GetServiceRegistry, Resource: arn:api7:gateway:gatewaygroup/%s
* [`GET` List all internal services in a Kubernetes service registry `/api/gateway_groups/{gateway_group_id}/service_registries/{service_registry_id}/kubernetes/internal_services`](#fallback-operation-18-6)
IAM Action: gateway:GetServiceRegistry, Resource: arn:api7:gateway:gatewaygroup/%s
* [`GET` List all namespaces in a Nacos service registry `/api/gateway_groups/{gateway_group_id}/service_registries/{service_registry_id}/nacos/namespaces`](#fallback-operation-18-7)
* [`GET` List all groups in a Nacos namespace `/api/gateway_groups/{gateway_group_id}/service_registries/{service_registry_id}/nacos/namespaces/{nacos_namespace}/groups`](#fallback-operation-18-8)
IAM Action: gateway:GetServiceRegistry, Resource: arn:api7:gateway:gatewaygroup/%s
* [`GET` List all internal services in a Nacos group `/api/gateway_groups/{gateway_group_id}/service_registries/{service_registry_id}/nacos/namespaces/{nacos_namespace}/groups/{nacos_group}/services`](#fallback-operation-18-9)
IAM Action: gateway:GetServiceRegistry, Resource: arn:api7:gateway:gatewaygroup/%s
* [`GET` Get all instance metadata of a Nacos services registry `/api/gateway_groups/{gateway_group_id}/service_registries/{service_registry_id}/nacos/namespaces/{nacos_namespace}/groups/{nacos_group}/services/{nacos_service}/instances_metadata`](#fallback-operation-18-10)
IAM Action: gateway:GetServiceRegistry, Resource: arn:api7:gateway:gatewaygroup/%s
* [`GET` List all datacenters in a Consul service registry `/api/gateway_groups/{gateway_group_id}/service_registries/{service_registry_id}/consul/datacenters`](#fallback-operation-18-11)
IAM Action: gateway:GetServiceRegistry, Resource: arn:api7:gateway:gatewaygroup/%s
* [`GET` List all services in a Consul datacenter `/api/gateway_groups/{gateway_group_id}/service_registries/{service_registry_id}/consul/datacenters/{consul_datacenter}/services`](#fallback-operation-18-12)
IAM Action: gateway:GetServiceRegistry, Resource: arn:api7:gateway:gatewaygroup/%s
* [`GET` Get all instance metadata of a Consul service `/api/gateway_groups/{gateway_group_id}/service_registries/{service_registry_id}/consul/datacenters/{consul_datacenter}/services/{consul_service}/instances_metadata`](#fallback-operation-18-13)
IAM Action: gateway:GetServiceRegistry, Resource: arn:api7:gateway:gatewaygroup/%s
* [`GET` Get health check history of a service registry connection on a gateway group `/api/gateway_groups/{gateway_group_id}/service_registries/{service_registry_id}/health_check_history`](#fallback-operation-18-14)
IAM Action: gateway:GetServiceRegistry, Resource: arn:api7:gateway:gatewaygroup/%s
## User
* [`GET` List all users `/api/users`](#fallback-operation-19-0)
List dashboard user accounts with pagination and role-based filtering. Use this to audit who can authenticate by local credentials or configured SSO methods. Required IAM Permission: Action iam:GetUser, Resource arn:api7:iam:user/%s
* [`GET` Get a user `/api/users/{user_id}`](#fallback-operation-19-1)
Get one dashboard user account by ID to inspect account details and current state. Required IAM Permission: Action iam:GetUser, Resource arn:api7:iam:user/%s
* [`PUT` Update basic attributes of a user `/api/users/{user_id}`](#fallback-operation-19-2)
Update basic attributes of a specified dashboard user account. This is intended for administrative account maintenance. Required IAM Permission: Action iam:UpdateUser, Resource arn:api7:iam:user/%s
* [`DELETE` Delete a user `/api/users/{user_id}`](#fallback-operation-19-3)
Delete a dashboard user account and revoke its login access. Verify downstream ownership and role dependencies before removal. Required IAM Permission: Action iam:DeleteUser, Resource arn:api7:iam:user/%s
* [`PUT` Update the user's permission boundaries `/api/users/{user_id}/boundaries`](#fallback-operation-19-4)
Replace a user's permission boundaries using permission policy IDs. Boundaries constrain the maximum effective permissions a user can obtain. Required IAM Permission: Action iam:UpdateUserBoundary, Resource arn:api7:iam:user/%s
* [`PUT` Reset the password to specific value `/api/users/{user_id}/password_reset`](#fallback-operation-19-5)
Reset a specified user's password to an administrator-provided value. Use this for recovery or emergency credential rotation. Required IAM Permission: Action iam:ResetPassword, Resource arn:api7:iam:user/%s
* [`PUT` Reset (disable) a user's two-factor authentication `/api/users/{user_id}/2fa_reset`](#fallback-operation-19-6)
Administratively disable a specified user's two-factor authentication, for example when the user has lost their authenticator device. Required IAM Permission: Action iam:ResetTwoFactor, Resource arn:api7:iam:user/%s
* [`GET` Get my user detail `/api/me`](#fallback-operation-19-7)
Get details of the currently authenticated dashboard user.
* [`PUT` Update my user profile `/api/me`](#fallback-operation-19-8)
Update profile attributes of the currently authenticated dashboard user without changing role assignments.
* [`PUT` Update the user email `/api/me/email`](#fallback-operation-19-9)
Update the email address for the currently authenticated user account.
* [`DELETE` Delete the user email `/api/me/email`](#fallback-operation-19-10)
Remove the email address currently bound to the authenticated user account.
* [`POST` Start two-factor (2FA) enrollment for the current user `/api/me/2fa/setup`](#fallback-operation-19-11)
Generate a new TOTP secret for the currently authenticated user and return it together with a provisioning URI and QR code. The secret is not active until confirmed via the enable endpoint.
* [`POST` Confirm and enable two-factor (2FA) for the current user `/api/me/2fa/enable`](#fallback-operation-19-12)
Confirm a pending TOTP secret with a valid code and enable two-factor authentication. Returns one-time recovery codes that are shown only once.
* [`POST` Disable two-factor (2FA) for the current user `/api/me/2fa/disable`](#fallback-operation-19-13)
Disable two-factor authentication for the currently authenticated user after validating a current TOTP or recovery code.
* [`POST` Invite a user `/api/invites`](#fallback-operation-19-14)
Invite a new dashboard user account. The invitation initiates onboarding so the user can later sign in with supported authentication methods. Required IAM Permission: Action iam:InviteUser, Resource arn:api7:iam:user/
* [`PUT` Update my user password `/api/password`](#fallback-operation-19-15)
Change the password for the currently authenticated user account.
* [`POST` Log in to API7 Enterprise using the built-in username and password `/api/login`](#fallback-operation-19-16)
Authenticate a dashboard user with built-in username and password credentials and create a session.
* [`POST` Log out from API7 Enterprise using the built-in username and password `/api/logout`](#fallback-operation-19-17)
Log out the current built-in authentication session and invalidate related session state.
* [`PUT` Update assigned roles for a user `/api/users/{user_id}/assigned_roles`](#fallback-operation-19-18)
Update role assignments for a user. Assigned roles determine the permission policies and effective access granted to that account. Required IAM Permission: Action iam:UpdateUserRole, Resource arn:api7:iam:user/%s
* [`POST` Check if a user has permissions on specific resources `/api/allow_access`](#fallback-operation-19-19)
Evaluate whether a user is allowed to perform specified actions on given resources based on current RBAC and policy configuration.
* [`POST` Log in to API7 Enterprise using the LDAP username and password `/api/ldap/{login_option_id}/login`](#fallback-operation-19-20)
Authenticate a user through the specified LDAP login option and create a dashboard session.
* [`POST` Log out from API7 Enterprise using the LDAP username and password `/api/ldap/{login_option_id}/logout`](#fallback-operation-19-21)
Log out a session established via LDAP authentication for the specified login option.
* [`GET` Log in using the CAS provider `/api/cas/{login_option_id}/login`](#fallback-operation-19-22)
Start or complete CAS login for the selected login option, including CAS ticket processing.
* [`GET` Log out using the CAS provider `/api/cas/{login_option_id}/logout`](#fallback-operation-19-23)
Start CAS logout for the selected login option and redirect to the configured post-logout target.
* [`GET` Log in using the OIDC provider `/api/oidc/{login_option_id}/login`](#fallback-operation-19-24)
Start OIDC authentication by redirecting to the configured OpenID Connect provider for the selected login option.
* [`GET` Log in using the OIDC provider `/api/oidc/{login_option_id}/callback`](#fallback-operation-19-25)
Process OIDC callback parameters and complete authentication for the selected login option.
* [`GET` Log out using the OIDC provider `/api/oidc/{login_option_id}/logout`](#fallback-operation-19-26)
Start OIDC logout flow and redirect through the provider logout endpoint for the selected login option.
* [`GET` SAML login (redirect to IdP and call back to Dashboard) `/api/saml/{login_option_id}/login`](#fallback-operation-19-27)
Start SAML 2.0 login by redirecting to the identity provider and preparing for ACS callback handling.
* [`GET` SAML Logout (redirect to IdP and call back to Dashboard) `/api/saml/{login_option_id}/logout`](#fallback-operation-19-28)
Start SAML 2.0 logout by redirecting through the identity provider for the selected login option.
* [`POST` SAML ACS/SLO callback (from IdP to Dashboard) `/api/saml/{login_option_id}/acs`](#fallback-operation-19-29)
Handle SAML ACS/SLO callback payloads posted by the identity provider for the selected login option.
* [`GET` SAML ACS/SLO callback (from IdP to Dashboard) `/api/saml/{login_option_id}/slo`](#fallback-operation-19-30)
Handle SAML ACS/SLO callback query parameters from the identity provider and finalize SAML sign-in or sign-out.
* [`POST` SAML ACS/SLO callback (from IdP to Dashboard) `/api/saml/{login_option_id}/slo`](#fallback-operation-19-31)
Handle SAML ACS/SLO callback payloads posted by the identity provider for the selected login option.
* [`GET` SAML SP metadata `/api/saml/{login_option_id}/metadata`](#fallback-operation-19-32)
Get SAML service provider metadata XML for the specified login option to help configure identity-provider trust.
## Role
* [`GET` List all roles `/api/roles`](#fallback-operation-20-0)
List RBAC roles with pagination and filtering. Results include built-in roles (Super Admin, Admin, Viewer) and custom roles. Required IAM Permission: Action iam:GetRole, Resource arn:api7:iam:role/%s
* [`POST` Create a role `/api/roles`](#fallback-operation-20-1)
Create a custom RBAC role used to group permission policies. The new role can then be assigned to users. Required IAM Permission: Action iam:CreateRole, Resource arn:api7:iam:role/
* [`GET` Get a role `/api/roles/{role_id}`](#fallback-operation-20-2)
Get detailed information for a specific RBAC role. This includes role metadata used to grant permissions through user-role assignments. Required IAM Permission: Action iam:GetRole, Resource arn:api7:iam:role/%s
* [`PUT` Update a role `/api/roles/{role_id}`](#fallback-operation-20-3)
Update a role definition by ID. Changes affect all users currently assigned to the role. Required IAM Permission: Action iam:UpdateRole, Resource arn:api7:iam:role/%s
* [`DELETE` Delete a role `/api/roles/{role_id}`](#fallback-operation-20-4)
Delete a custom RBAC role from the organization. Review user assignments first to avoid unintended access loss. Required IAM Permission: Action iam:DeleteRole, Resource arn:api7:iam:role/%s
* [`GET` List all permission policies attached to a role `/api/roles/{role_id}/permission_policies`](#fallback-operation-20-5)
List permission policies attached to a role. This reveals the policy statements that determine the role's effective access. Required IAM Permission: Action iam:GetPermissionPolicy, Resource arn:api7:iam:permissionpolicy/%s
* [`POST` Attach permission policies to a role `/api/roles/{role_id}/attach_permission_policies`](#fallback-operation-20-6)
Attach permission policies to a role. Attached policies immediately affect all users assigned to that role. Required IAM Permission: Action iam:UpdateRole, Resource arn:api7:iam:role/%s
* [`POST` Detach permission policies of a role `/api/roles/{role_id}/detach_permission_policies`](#fallback-operation-20-7)
Detach permission policies from a role. Removing policies may reduce or revoke access for assigned users. Required IAM Permission: Action iam:UpdateRole, Resource arn:api7:iam:role/%s
## Permission Policy
* [`GET` List all permission policies `/api/permission_policies`](#fallback-operation-21-0)
List available permission policies in the organization with pagination and filters. Use this to choose policies for roles and boundaries. Required IAM Permission: Action iam:GetPermissionPolicy, Resource arn:api7:iam:permissionpolicy/%s
* [`POST` Create a permission policy `/api/permission_policies`](#fallback-operation-21-1)
Create a fine-grained permission policy with allow/deny statements over specific IAM actions and resource ARNs. Required IAM Permission: Action iam:CreatePermissionPolicy, Resource arn:api7:iam:permissionpolicy/
* [`GET` Get the permission policy authoring catalog `/api/permission_policies/metadata`](#fallback-operation-21-2)
Return the static catalog used by the console Visual Editor to author permission policies: every supported resource type with its ARN templates, available list endpoint, condition keys, and the ordered list of actions classified by access level. The payload is purely...
* [`GET` Get a permission policy `/api/permission_policies/{permission_policy_id}`](#fallback-operation-21-3)
Get a permission policy by ID, including all statements and metadata. Required IAM Permission: Action iam:GetPermissionPolicy, Resource arn:api7:iam:permissionpolicy/%s
* [`PUT` Update a permission policy `/api/permission_policies/{permission_policy_id}`](#fallback-operation-21-4)
Update an existing permission policy definition. Changes apply to all roles or users that reference this policy. Required IAM Permission: Action iam:UpdatePermissionPolicy, Resource arn:api7:iam:permissionpolicy/%s
* [`DELETE` Delete a permission policy `/api/permission_policies/{permission_policy_id}`](#fallback-operation-21-5)
Delete a permission policy. Ensure references are reviewed first to prevent accidental permission breakage. Required IAM Permission: Action iam:DeletePermissionPolicy, Resource arn:api7:iam:permissionpolicy/%s
* [`GET` List the Roles or Users that directly reference the Permission Policy `/api/permission_policies/{permission_policy_id}/references`](#fallback-operation-21-6)
List roles and users that directly reference the specified permission policy. This helps estimate impact before policy changes. Required IAM Permission: Action iam:GetPermissionPolicy, Resource arn:api7:iam:permissionpolicy/%s
## Token
* [`GET` List all tokens `/api/tokens`](#fallback-operation-22-0)
List API access tokens created for programmatic dashboard API access, with pagination, ordering, and search filters.
* [`POST` Create a token `/api/tokens`](#fallback-operation-22-1)
Create a new API access token for programmatic, non-interactive access to dashboard APIs. You can configure token metadata and optional expiration at creation time.
* [`GET` Get a token `/api/tokens/{token_id}`](#fallback-operation-22-2)
Get details of an API access token by token ID.
* [`PUT` Update a token `/api/tokens/{token_id}`](#fallback-operation-22-3)
Update mutable properties of an API access token, such as expiration and metadata fields.
* [`DELETE` Delete a token `/api/tokens/{token_id}`](#fallback-operation-22-4)
Delete an API access token and immediately revoke its ability to authenticate API requests.
* [`PUT` Regenerate a token `/api/tokens/{token_id}/regenerate`](#fallback-operation-22-5)
Regenerate the secret value of an existing API access token. Clients must replace stored credentials after regeneration.
## Dashboard Login Option
* [`GET` Get a login option `/api/login_options/{login_option_id}`](#fallback-operation-23-0)
Get a login option configuration by ID. This returns settings for one external authentication integration such as OIDC, LDAP, SAML 2.0, or CAS. Required IAM Permission: Action iam:GetLoginOption, Resource arn:api7:iam:organization/
* [`PUT` Update a login option `/api/login_options/{login_option_id}`](#fallback-operation-23-1)
Fully update a login option configuration with a complete protocol-specific payload. Required IAM Permission: Action iam:UpdateLoginOption, Resource arn:api7:iam:organization/
* [`DELETE` Delete a login option `/api/login_options/{login_option_id}`](#fallback-operation-23-2)
Delete a login option and remove that authentication method from available sign-in choices. Required IAM Permission: Action iam:DeleteLoginOption, Resource arn:api7:iam:organization/
* [`PATCH` Patch a login option `/api/login_options/{login_option_id}`](#fallback-operation-23-3)
Partially update a login option using JSON Patch (RFC 6902). Use this for targeted changes without replacing full configuration. Required IAM Permission: Action iam:UpdateLoginOption, Resource arn:api7:iam:organization/
* [`GET` List all login options `/api/login_options`](#fallback-operation-23-4)
List all configured login options for the organization, including protocol-specific provider settings. Required IAM Permission: Action iam:GetLoginOption, Resource arn:api7:iam:organization/
* [`POST` Create a login option `/api/login_options`](#fallback-operation-23-5)
Create a new login option for external authentication integration. Supported protocols include OIDC, LDAP, SAML 2.0, and CAS. Required IAM Permission: Action iam:CreateLoginOption, Resource arn:api7:iam:organization/
* [`GET` List all login options (public) `/api/login_options_for_login`](#fallback-operation-23-6)
List login options. No authentication is required, and provider or policy/role details are not included in the response.
## License
* [`GET` Get API7 Enterprise license details `/api/license`](#fallback-operation-24-0)
Retrieve current API7 Enterprise license information, including validity and licensed capabilities. Use this endpoint to inspect license status for operations and troubleshooting.
* [`PUT` Import or update the API7 Enterprise license `/api/license`](#fallback-operation-24-1)
Import a new license payload or update the existing enterprise license for the organization. You can optionally use dry-run mode to validate license content before applying it. Required IAM Permission: Action iam:UpdateLicense, Resource arn:api7:iam:organization/
## Label
* [`GET` Get all labels of a resource type `/api/labels/{resource_type}`](#fallback-operation-25-0)
List available key-value labels for the specified resource type. Use these labels to organize resources and apply label-based filtering in list queries.
## Alert
* [`GET` List all alert policies `/api/alert/policies`](#fallback-operation-26-0)
List alert policies configured for monitoring conditions such as error rates, latency thresholds, and availability checks. Use query filters to narrow results by severity, status, labels, and search terms. Required IAM Permission: Action gateway:GetAlertPolicy, Resource...
* [`POST` Create an alert policy `/api/alert/policies`](#fallback-operation-26-1)
Create a new alert policy that defines trigger conditions, evaluation behavior, and notification routing. After creation, the policy can begin generating alert history entries when conditions are met. Required IAM Permission: Action gateway:CreateAlertPolicy, Resource...
* [`GET` Get an alert policy `/api/alert/policies/{alert_policy_id}`](#fallback-operation-26-2)
Retrieve the full configuration of a specific alert policy, including its trigger rules and notification settings. Use this endpoint before updating or troubleshooting policy behavior. Required IAM Permission: Action gateway:GetAlertPolicy, Resource arn:api7:gateway:alert/%s
* [`PUT` Update an alert policy `/api/alert/policies/{alert_policy_id}`](#fallback-operation-26-3)
Replace the full configuration of an alert policy with the provided payload. Use this operation when you want to update all policy fields in a single request. Required IAM Permission: Action gateway:UpdateAlertPolicy, Resource arn:api7:gateway:alert/%s
* [`DELETE` Delete an alert policy `/api/alert/policies/{alert_policy_id}`](#fallback-operation-26-4)
Delete an existing alert policy so it no longer evaluates conditions or sends notifications. This action affects future alerting only and does not remove historical alert records. Required IAM Permission: Action gateway:DeleteAlertPolicy, Resource arn:api7:gateway:alert/%s
* [`PATCH` Patch an alert policy `/api/alert/policies/{alert_policy_id}`](#fallback-operation-26-5)
Partially update an alert policy using JSON Patch (RFC 6902) operations. This is useful for targeted edits without resubmitting the full policy definition. Required IAM Permission: Action gateway:UpdateAlertPolicy, Resource arn:api7:gateway:alert/%s
* [`GET` List all alert histories `/api/alert/policies/histories`](#fallback-operation-26-6)
List historical alert events triggered by alert policies, including occurrence time, severity, and related gateway group context. Use time-range and policy filters to investigate incidents and alert trends. Required IAM Permission: Action gateway:GetAlertPolicy, Resource...
## Contact Point
* [`GET` List Contact Points `/api/contact_points`](#fallback-operation-27-0)
List contact points available for alert notification delivery. Use filters and pagination to locate channels by type, labels, or search terms. Required IAM Permission: Action iam:GetContactPoint, Resource arn:api7:iam:contactpoint/%s
* [`POST` Create a contact point `/api/contact_points`](#fallback-operation-27-1)
Create a new contact point to deliver alert notifications through channels such as email, webhook, Slack, or DingTalk. The created contact point can then be referenced by alert policies. Required IAM Permission: Action iam:CreateContactPoint, Resource arn:api7:iam:contactpoint/
* [`GET` Get a contact point `/api/contact_points/{contact_point_id}`](#fallback-operation-27-2)
Retrieve details of a specific contact point, including its configuration and metadata. Use this before updating or validating notification settings. Required IAM Permission: Action iam:GetContactPoint, Resource arn:api7:iam:contactpoint/%s
* [`PUT` Update a contact point `/api/contact_points/{contact_point_id}`](#fallback-operation-27-3)
Update a contact point configuration, such as destination address, authentication details, or labels. Changes take effect for subsequent alert notifications. Required IAM Permission: Action iam:UpdateContactPoint, Resource arn:api7:iam:contactpoint/%s
* [`DELETE` Delete a contact point `/api/contact_points/{contact_point_id}`](#fallback-operation-27-4)
Delete a contact point so it can no longer be used as an alert notification channel. Ensure dependent alert policies are updated to avoid delivery failures. Required IAM Permission: Action iam:DeleteContactPoint, Resource arn:api7:iam:contactpoint/%s
* [`GET` List notification logs of a contact point `/api/contact_points/{contact_point_id}/notification_logs`](#fallback-operation-27-5)
List notification delivery logs for a contact point, including status, target resource type, and timestamps. Use this to troubleshoot failed or delayed alert notifications. Required IAM Permission: Action iam:GetContactPoint, Resource arn:api7:iam:contactpoint/%s
* [`GET` List a contact point usages `/api/contact_points/{contact_point_id}/usages`](#fallback-operation-27-6)
List resources that currently reference the specified contact point. Check usage before deletion or major edits to understand downstream impact. Required IAM Permission: Action iam:GetContactPoint, Resource arn:api7:iam:contactpoint/%s
## Audit Logs
* [`GET` List all audit logs `/api/audit_logs`](#fallback-operation-28-0)
Retrieve immutable audit log records for administrative and configuration actions, including who performed each action and when. Use filters such as event type, operator, resource, gateway group, and time range to narrow the result set. Required IAM Permission: Action...
* [`GET` List all event types of audit logs `/api/audit_logs/event_types`](#fallback-operation-28-1)
List supported audit event types that can be used for filtering and analysis when querying audit logs. No IAM permission required.
* [`GET` Export all audit logs `/api/audit_logs/export`](#fallback-operation-28-2)
Export audit logs that match the specified filters into a downloadable file format for compliance, archival, or external analysis. Apply event, operator, resource, and time-range filters before export to control data scope. Required IAM Permission: Action iam:ExportAudits...
## Audit Config
* [`GET` Get the configuration for audit logs. `/api/audit_logs/config`](#fallback-operation-29-0)
Get the current audit logging configuration for the organization. Use this to verify how audit events are captured and retained. No IAM permission required.
## Monitoring
* [`GET` Get provider portal monitoring data at a single point in time `/api/portal/monitor/query`](#fallback-operation-30-0)
See Prometheus instant queries for more information.
* [`GET` Get provider portal monitoring data over a range of time `/api/portal/monitor/query_range`](#fallback-operation-30-1)
See Prometheus range queries for more information.
* [`GET` Get data from Prometheus `/api/control_plane/prometheus/{prometheus_path}`](#fallback-operation-30-2)
* [`POST` Get data from Prometheus `/api/control_plane/prometheus/{prometheus_path}`](#fallback-operation-30-3)
## Debugger
* [`GET` List debug sessions `/api/gateway_groups/{gateway_group_id}/debug_sessions`](#fallback-operation-31-0)
IAM Action: gateway:GetDebugSession, Resource: arn:api7:gateway:gatewaygroup/%s
* [`POST` Create a debug session `/api/gateway_groups/{gateway_group_id}/debug_sessions`](#fallback-operation-31-1)
IAM Action: gateway:CreateDebugSession, Resource: arn:api7:gateway:gatewaygroup/%s
* [`GET` Get a debug session `/api/gateway_groups/{gateway_group_id}/debug_sessions/{debug_session_id}`](#fallback-operation-31-2)
IAM Action: gateway:GetDebugSession, Resource: arn:api7:gateway:gatewaygroup/%s
* [`DELETE` Delete a debug session `/api/gateway_groups/{gateway_group_id}/debug_sessions/{debug_session_id}`](#fallback-operation-31-3)
IAM Action: gateway:DeleteDebugSession, Resource: arn:api7:gateway:gatewaygroup/%s
* [`POST` Stop a debug session `/api/gateway_groups/{gateway_group_id}/debug_sessions/{debug_session_id}/stop`](#fallback-operation-31-4)
IAM Action: gateway:StopDebugSession, Resource: arn:api7:gateway:gatewaygroup/%s
* [`GET` List traces of a debug session `/api/gateway_groups/{gateway_group_id}/debug_sessions/{debug_session_id}/traces`](#fallback-operation-31-5)
IAM Action: GetDebugSession, Resource: arn:api7:gateway:gatewaygroup/%s
* [`GET` Get a trace detail `/api/gateway_groups/{gateway_group_id}/debug_sessions/{debug_session_id}/traces/{trace_id}`](#fallback-operation-31-6)
IAM Action: GetDebugSession, Resource: arn:api7:gateway:gatewaygroup/%s
* [`POST` Download a trace `/api/gateway_groups/{gateway_group_id}/debug_sessions/{debug_session_id}/traces/{trace_id}/download`](#fallback-operation-31-7)
IAM Action: gateway:ExportDebugSession, Resource: arn:api7:gateway:gatewaygroup/%s
## Schema
* [`GET` Get schema by resource name `/apisix/admin/schema/{resource_name}`](#fallback-operation-32-0)
Get the schema definition for a specific resource type by name. This is useful when rendering dynamic forms or validating resource-specific request payloads.
* [`GET` Get schema definition of a plugin `/apisix/admin/schema/plugins/{plugin_name}`](#fallback-operation-32-1)
Get schema definition of a plugin, including plugin meta properties and plugin properties.
* [`GET` Get OpenAPI schema `/api/openapi/request_body_schema`](#fallback-operation-32-2)
The endpoint returns the request body schema of PUT/POST requests for users to understand how to structure a request.
* [`GET` Get core resources schema `/api/schema/core`](#fallback-operation-32-3)
Retrieve schema definitions for core gateway resources. Use these schemas to validate payload structures and build configuration tooling.
## Configuration
* [`POST` Validate batch configuration `/apisix/admin/configs/validate`](#fallback-operation-33-0)
Validate a batch of APISIX declarative configurations including routes, services, consumers, upstreams, etc. Performs resource-level JSON Schema validation, plugin check schema advanced validation, and duplicate ID detection. Returns all validation errors at once.
## Variables
* [`GET` Get all variables `/apisix/admin/variables`](#fallback-operation-34-0)
List all APISIX variables (including built-in NGINX variables) that can be used in route matching conditions and plugin configurations.
## System Settings
* [`GET` Get deployment settings `/api/system_settings`](#fallback-operation-35-0)
Retrieve current global deployment settings for the control plane. Use this endpoint to inspect active system-level configuration before making changes.
* [`PUT` Update deployment settings `/api/system_settings`](#fallback-operation-35-1)
Update global system settings that control dashboard deployment behavior and platform-wide defaults. This operation affects configuration used across managed gateway resources. Required IAM Permission: Action gateway:UpdateDeploymentSetting, Resource...
* [`GET` Get SCIM settings `/api/system_settings/scim`](#fallback-operation-35-2)
Retrieve the current SCIM provisioning configuration for the organization. Use this to validate synchronization endpoints and provisioning status. Required IAM Permission: Action iam:GetSCIMProvisioning, Resource arn:api7:iam:organization/
* [`PUT` Update SCIM settings `/api/system_settings/scim`](#fallback-operation-35-3)
Update SCIM provisioning settings used for automated identity and user lifecycle synchronization. Changes here affect how external identity providers integrate with organization users. Required IAM Permission: Action iam:UpdateSCIMProvisioning, Resource arn:api7:iam:organization/
* [`PUT` Generate SCIM Token `/api/system_settings/scim/token`](#fallback-operation-35-4)
Generate or rotate the SCIM access token used by external identity providers to call SCIM provisioning APIs. Rotating this token may require updating the provider configuration. Required IAM Permission: Action iam:UpdateSCIMProvisioning, Resource arn:api7:iam:organization/
* [`GET` Get SMTP server settings `/api/system_settings/smtp_server`](#fallback-operation-35-5)
Retrieve the current SMTP server settings configured for outbound email delivery. Use this endpoint when auditing email configuration or debugging mail issues. Required IAM Permission: Action iam:GetSMTPServer, Resource arn:api7:iam:organization/
* [`PUT` Update SMTP server settings `/api/system_settings/smtp_server`](#fallback-operation-35-6)
Update SMTP server configuration used for system email delivery, including notifications and verification emails. Ensure credentials and host settings are valid to avoid delivery failures. Required IAM Permission: Action iam:UpdateSMTPServer, Resource arn:api7:iam:organization/
* [`GET` Get SMTP server settings status `/api/system_settings/smtp_server_status`](#fallback-operation-35-7)
Get the health and readiness status of the configured SMTP server settings. This endpoint helps verify whether current configuration can be used for email sending.
* [`GET` Get login failure restriction settings `/api/system_settings/login_failure_restriction`](#fallback-operation-35-8)
Retrieve the current policy for temporarily banning built-in users after too many consecutive failed login attempts. Required IAM Permission: Action iam:GetLoginFailureRestriction, Resource arn:api7:iam:organization/
* [`PUT` Update login failure restriction settings `/api/system_settings/login_failure_restriction`](#fallback-operation-35-9)
Update the policy that temporarily bans built-in users after too many consecutive failed login attempts, including the failure threshold and ban duration. Required IAM Permission: Action iam:UpdateLoginFailureRestriction, Resource arn:api7:iam:organization/
## Developer Portal Settings
* [`GET` Get developer portal public access `/api/portal/system_settings/public_access`](#fallback-operation-36-0)
Get the current developer portal public access configuration for the specified portal. Use this to verify login and public accessibility settings. Required IAM Permission: Action portal:GetDeveloperPortalPublicAccess, Resource arn:api7:portal:portal/%s/loginsetting/
* [`PUT` Update developer portal public access `/api/portal/system_settings/public_access`](#fallback-operation-36-1)
Update public access and login behavior for a developer portal, such as how external users can access sign-in or registration flows. This setting controls portal exposure and authentication entry points. Required IAM Permission: Action portal:UpdateDeveloperPortalPublicAccess...
## System Infos
* [`GET` Get all system infos `/api/system_infos`](#fallback-operation-37-0)
Retrieve system metadata for the dashboard environment, such as version details, license state, and runtime information used for administration and diagnostics.
## Email
* [`GET` Check if an email is verified `/api/email_verified`](#fallback-operation-38-0)
Check whether the specified email address has completed verification. Use this to gate workflows that require verified contact information.
* [`GET` Get email verification `/api/verify_email`](#fallback-operation-38-1)
Verify an email address using the verification token and redirect to the corresponding result page. This endpoint is typically called from links sent in verification emails.
## Common
* [`GET` Get Dashboard Version `/api/version`](#fallback-operation-39-0)
Return the current dashboard version information. Use this endpoint for compatibility checks and operational diagnostics.
* [`POST` Get resource names `/api/resource_names`](#fallback-operation-39-1)
Query resource names by conditions in the request payload to support selectors, autocomplete, or dependency checks in UI workflows.
## File
* [`POST` Upload a file `/api/files`](#fallback-operation-40-0)
Upload a file to the control plane. The file is stored compressed in the database. Returns the file ID which can be used to construct a dp-manager URL for plugin configuration.
* [`GET` Download file content `/api/files/{file_id}`](#fallback-operation-40-1)
Download the original content of an uploaded file.
## Provider Portal - DCR Provider
* [`GET` List all DCR providers `/api/dcr_providers`](#fallback-operation-41-0)
IAM Action: portal:GetDCRProvider, Resource: arn:api7:portal:dcrprovider/%s
* [`POST` Create an DCR provider `/api/dcr_providers`](#fallback-operation-41-1)
IAM Action: portal:CreateDCRProvider, Resource: arn:api7:portal:dcrprovider/
* [`GET` Get an DCR provider `/api/dcr_providers/{dcr_provider_id}`](#fallback-operation-41-2)
IAM Action: portal:GetDCRProvider, Resource: arn:api7:portal:dcrprovider/%s
* [`PUT` Update an DCR Provider `/api/dcr_providers/{dcr_provider_id}`](#fallback-operation-41-3)
IAM Action: portal:UpdateDCRProvider, Resource: arn:api7:portal:dcrprovider/%s
* [`DELETE` Delete an DCR Provider `/api/dcr_providers/{dcr_provider_id}`](#fallback-operation-41-4)
IAM Action: portal:DeleteDCRProvider, Resource: arn:api7:portal:dcrprovider/%s
## Provider Portal - API Product
* [`GET` List all API products in Provider Portal `/api/api_products`](#fallback-operation-42-0)
IAM Action: portal:GetAPIProduct, Resource: arn:api7:portal:portal/%s/apiproduct/%s
* [`POST` Create an API product in Provider Portal `/api/api_products`](#fallback-operation-42-1)
IAM Action: portal:CreateAPIProduct, Resource: arn:api7:portal:portal/%s/apiproduct/
* [`GET` Get an API product in Provider Portal `/api/api_products/{api_product_id}`](#fallback-operation-42-2)
IAM Action: portal:GetAPIProduct, Resource: arn:api7:portal:portal/%s/apiproduct/%s
* [`PUT` Update an API product in Provider Portal `/api/api_products/{api_product_id}`](#fallback-operation-42-3)
IAM Action: portal:UpdateAPIProduct, Resource: arn:api7:portal:portal/%s/apiproduct/%s
* [`DELETE` Delete an API product in Provider Portal `/api/api_products/{api_product_id}`](#fallback-operation-42-4)
IAM Action: portal:DeleteAPIProduct, Resource: arn:api7:portal:portal/%s/apiproduct/%s
* [`PATCH` Patch an API product in Provider Portal `/api/api_products/{api_product_id}`](#fallback-operation-42-5)
IAM Action: portal:UpdateAPIProduct, Resource: arn:api7:portal:portal/%s/apiproduct/%s
* [`GET` List all subscriptions in Provider Portal for an API product `/api/api_products/{api_product_id}/subscriptions`](#fallback-operation-42-6)
IAM Action: portal:GetAPIProduct, Resource: arn:api7:portal:portal/%s/apiproduct/%s
* [`DELETE` Cancel a subscription in Provider Portal for an API product `/api/api_products/{api_product_id}/subscriptions/{subscription_id}`](#fallback-operation-42-7)
IAM Action: portal:UpdateAPIProduct, Resource: arn:api7:portal:portal/%s/apiproduct/%s
* [`GET` List all notification histories for an API product `/api/api_products/{api_product_id}/notification_histories`](#fallback-operation-42-8)
IAM Action: portal:GetAPIProduct, Resource: arn:api7:portal:portal/%s/apiproduct/%s
## Provider Portal - Portal Instance
* [`GET` List all portal instances `/api/portals`](#fallback-operation-43-0)
IAM Action: portal:ListPortals, Resource: arn:api7:portal:portal/
* [`POST` Create a portal instance `/api/portals`](#fallback-operation-43-1)
IAM Action: portal:CreatePortal, Resource: arn:api7:portal:portal/
* [`GET` Get a portal instance `/api/portals/{portal_id}`](#fallback-operation-43-2)
IAM Action: portal:GetPortal, Resource: arn:api7:portal:portal/%s
* [`PUT` Update a portal instance `/api/portals/{portal_id}`](#fallback-operation-43-3)
IAM Action: portal:UpdatePortal, Resource: arn:api7:portal:portal/%s
* [`DELETE` Delete a portal instance `/api/portals/{portal_id}`](#fallback-operation-43-4)
IAM Action: portal:DeletePortal, Resource: arn:api7:portal:portal/%s
## Provider Portal - Portal Token
* [`GET` List all portal tokens `/api/portal/tokens`](#fallback-operation-44-0)
IAM Action: portal:GetPortalToken, Resource: arn:api7:portal:portal/%s/token/
* [`POST` Create a portal token `/api/portal/tokens`](#fallback-operation-44-1)
IAM Action: portal:CreatePortalToken, Resource: arn:api7:portal:portal/%s/token/
* [`GET` Get a portal token `/api/portal/tokens/{portal_token_id}`](#fallback-operation-44-2)
IAM Action: portal:GetPortalToken, Resource: arn:api7:portal:portal/%s/token/
* [`PUT` Update a portal token `/api/portal/tokens/{portal_token_id}`](#fallback-operation-44-3)
IAM Action: portal:UpdatePortalToken, Resource: arn:api7:portal:portal/%s/token/
* [`DELETE` Delete a portal token `/api/portal/tokens/{portal_token_id}`](#fallback-operation-44-4)
IAM Action: portal:DeletePortalToken, Resource: arn:api7:portal:portal/%s/token/
* [`PUT` Regenerate a portal token `/api/portal/tokens/{portal_token_id}/regenerate`](#fallback-operation-44-5)
IAM Action: portal:UpdatePortalToken, Resource: arn:api7:portal:portal/%s/token/
## Developer
* [`GET` List Developers `/api/developers`](#fallback-operation-45-0)
IAM Action: portal:GetDeveloper, Resource: arn:api7:portal:portal/%s/developer/%s
* [`DELETE` Delete a developer `/api/developers/{developer_external_id}`](#fallback-operation-45-1)
IAM Action: portal:DeleteDeveloper, Resource: arn:api7:portal:portal/%s/developer/%s
## Approval
* [`GET` List approvals `/api/approvals`](#fallback-operation-46-0)
List pending and processed approval workflow items for developer portal operations, such as API product subscriptions and developer registrations. Use filters to review approvals by status, event type, operator, applicant, and resource. Required IAM Permission: For event type...
* [`POST` Accept an approval request `/api/approvals/{approval_id}/accept`](#fallback-operation-46-1)
Approve a specific workflow request and apply the corresponding portal-side change, such as granting an API product subscription or accepting a developer sign-up. This operation advances the approval lifecycle to an accepted state. Required IAM Permission: For event type api...
* [`POST` Reject an approval request `/api/approvals/{approval_id}/reject`](#fallback-operation-46-2)
Reject a specific workflow approval request so the requested action is not applied. Use this endpoint to explicitly deny subscription or registration requests that do not meet review criteria. Required IAM Permission: For event type api product subscription: Action...
## AI Gateway Group
* [`GET` List all AI Gateway groups `/api/ai_gateway_groups`](#fallback-operation-47-0)
Returns a paginated list of all AI Gateway groups (AISIX clusters).
* [`POST` Create an AI Gateway group `/api/ai_gateway_groups`](#fallback-operation-47-1)
IAM Action: ai gateway:CreateAIGatewayGroup, Resource: arn:api7:ai gateway:aigatewaygroup/ Creates a new AI Gateway group (AISIX cluster).
* [`GET` Get an AI Gateway group `/api/ai_gateway_groups/{ai_gateway_group_id}`](#fallback-operation-47-2)
IAM Action: ai gateway:GetAIGatewayGroup, Resource: arn:api7:ai gateway:aigatewaygroup/%s Returns the specified AI Gateway group by ID.
* [`PUT` Update an AI Gateway group `/api/ai_gateway_groups/{ai_gateway_group_id}`](#fallback-operation-47-3)
IAM Action: ai gateway:UpdateAIGatewayGroup, Resource: arn:api7:ai gateway:aigatewaygroup/%s Updates the name, description, or configuration of the specified AI Gateway group.
* [`DELETE` Delete an AI Gateway group `/api/ai_gateway_groups/{ai_gateway_group_id}`](#fallback-operation-47-4)
IAM Action: ai gateway:DeleteAIGatewayGroup, Resource: arn:api7:ai gateway:aigatewaygroup/%s Deletes the specified AI Gateway group and all its associated instances.
## AI Gateway Instance
* [`GET` List AI Gateway instances in a group `/api/ai_gateway_groups/{ai_gateway_group_id}/instances`](#fallback-operation-48-0)
IAM Action: ai gateway:GetAIGatewayInstance, Resource: arn:api7:ai gateway:aigatewaygroup/%s Returns all AI Gateway instances (AISIX nodes) registered in the specified group. Instance status is computed dynamically from the last heartbeat time: Healthy within 60 seconds...
* [`DELETE` Delete a single AI Gateway instance `/api/ai_gateway_groups/{ai_gateway_group_id}/instances/{ai_gateway_instance_id}`](#fallback-operation-48-1)
IAM Action: ai gateway:DeleteAIGatewayInstance, Resource: arn:api7:ai gateway:aigatewaygroup/%s Removes the specified AI Gateway instance from its group.
* [`GET` Generate a Docker run command to install an AI Gateway instance `/api/ai_gateway_groups/{ai_gateway_group_id}/deployment/docker`](#fallback-operation-48-2)
IAM Action: ai gateway:GetAIGatewayGroup, Resource: arn:api7:ai gateway:aigatewaygroup/%s Generates a docker run command that configures and starts an AISIX AI Gateway instance connected to the specified AI Gateway group.
* [`GET` Generate a Docker Compose file to install an AI Gateway instance `/api/ai_gateway_groups/{ai_gateway_group_id}/deployment/docker-compose`](#fallback-operation-48-3)
IAM Action: ai gateway:GetAIGatewayGroup, Resource: arn:api7:ai gateway:aigatewaygroup/%s Generates a Docker Compose configuration that starts an AISIX AI Gateway instance connected to the specified AI Gateway group.
* [`GET` Generate a Helm install script for an AI Gateway instance `/api/ai_gateway_groups/{ai_gateway_group_id}/deployment/helm/script`](#fallback-operation-48-4)
IAM Action: ai gateway:GetAIGatewayGroup, Resource: arn:api7:ai gateway:aigatewaygroup/%s Generates a shell script that uses Helm to install an AISIX AI Gateway instance in Kubernetes, connected to the specified AI Gateway group.
* [`GET` Generate a Helm values YAML for an AI Gateway instance `/api/ai_gateway_groups/{ai_gateway_group_id}/deployment/helm/yaml`](#fallback-operation-48-5)
IAM Action: ai gateway:GetAIGatewayGroup, Resource: arn:api7:ai gateway:aigatewaygroup/%s Generates a Helm values YAML file for deploying an AISIX AI Gateway instance in Kubernetes, connected to the specified AI Gateway group.
* [`POST` Issue an AI data plane certificate `/api/ai_gateway_groups/{ai_gateway_group_id}/dp_client_certificates`](#fallback-operation-48-6)
Issues a client mTLS certificate for an aisix-ee AI Gateway instance to authenticate with the control plane (dp-manager). Use this during aisix-ee bootstrap or certificate rotation.
## AI Provider
* [`GET` List AI providers in a group `/aisix/admin/providers`](#fallback-operation-49-0)
IAM Action: ai gateway:ListAIProviders, Resource: arn:api7:ai gateway:aigatewaygroup/%s Returns all AI provider configurations in the specified AI Gateway group.
* [`POST` Create an AI provider `/aisix/admin/providers`](#fallback-operation-49-1)
IAM Action: ai gateway:CreateAIProvider, Resource: arn:api7:ai gateway:aigatewaygroup/%s Creates a new AI provider configuration in the specified AI Gateway group. The provider will be synced to the aisix data plane via etcd.
* [`GET` Get an AI provider `/aisix/admin/providers/{provider_id}`](#fallback-operation-49-2)
IAM Action: ai gateway:GetAIProvider, Resource: arn:api7:ai gateway:aigatewaygroup/%s Returns the specified AI provider configuration by ID.
* [`PUT` Update an AI provider `/aisix/admin/providers/{provider_id}`](#fallback-operation-49-3)
IAM Action: ai gateway:UpdateAIProvider, Resource: arn:api7:ai gateway:aigatewaygroup/%s Updates the specified AI provider configuration. Changes are synced to the aisix data plane via etcd.
* [`DELETE` Delete an AI provider `/aisix/admin/providers/{provider_id}`](#fallback-operation-49-4)
IAM Action: ai gateway:DeleteAIProvider, Resource: arn:api7:ai gateway:aigatewaygroup/%s Deletes the specified AI provider configuration and removes it from etcd. Returns 409 Conflict if any AI models reference this provider.
## AI Model
* [`GET` List AI models in a group `/aisix/admin/models`](#fallback-operation-50-0)
IAM Action: ai gateway:ListAIModels, Resource: arn:api7:ai gateway:aigatewaygroup/%s Returns all AI model configurations in the specified AI Gateway group.
* [`POST` Create an AI model `/aisix/admin/models`](#fallback-operation-50-1)
IAM Action: ai gateway:CreateAIModel, Resource: arn:api7:ai gateway:aigatewaygroup/%s Creates a new AI model configuration in the specified AI Gateway group. The model will be synced to the aisix data plane via etcd.
* [`GET` Get an AI model `/aisix/admin/models/{model_id}`](#fallback-operation-50-2)
IAM Action: ai gateway:GetAIModel, Resource: arn:api7:ai gateway:aigatewaygroup/%s Returns the specified AI model configuration by ID.
* [`PUT` Update an AI model `/aisix/admin/models/{model_id}`](#fallback-operation-50-3)
IAM Action: ai gateway:UpdateAIModel, Resource: arn:api7:ai gateway:aigatewaygroup/%s Updates the specified AI model configuration. Changes are synced to the aisix data plane via etcd.
* [`DELETE` Delete an AI model `/aisix/admin/models/{model_id}`](#fallback-operation-50-4)
IAM Action: ai gateway:DeleteAIModel, Resource: arn:api7:ai gateway:aigatewaygroup/%s Deletes the specified AI model configuration and removes it from etcd.
## AI API Key
* [`GET` List AI API keys in a group `/aisix/admin/apikeys`](#fallback-operation-51-0)
IAM Action: ai gateway:ListAIAPIKeys, Resource: arn:api7:ai gateway:aigatewaygroup/%s Returns all AI API key configurations in the specified AI Gateway group.
* [`POST` Create an AI API key `/aisix/admin/apikeys`](#fallback-operation-51-1)
IAM Action: ai gateway:CreateAIAPIKey, Resource: arn:api7:ai gateway:aigatewaygroup/%s Creates a new AI API key in the specified AI Gateway group. The key will be synced to the aisix data plane via etcd.
* [`GET` Get an AI API key `/aisix/admin/apikeys/{api_key_id}`](#fallback-operation-51-2)
IAM Action: ai gateway:GetAIAPIKey, Resource: arn:api7:ai gateway:aigatewaygroup/%s Returns the specified AI API key configuration by ID.
* [`PUT` Update an AI API key `/aisix/admin/apikeys/{api_key_id}`](#fallback-operation-51-3)
IAM Action: ai gateway:UpdateAIAPIKey, Resource: arn:api7:ai gateway:aigatewaygroup/%s Updates the specified AI API key configuration. Changes are synced to the aisix data plane via etcd.
* [`DELETE` Delete an AI API key `/aisix/admin/apikeys/{api_key_id}`](#fallback-operation-51-4)
IAM Action: ai gateway:DeleteAIAPIKey, Resource: arn:api7:ai gateway:aigatewaygroup/%s Deletes the specified AI API key configuration and removes it from etcd.
## AI Gateway Log
* [`GET` List AI gateway span logs `/api/ai_gateway_logs`](#fallback-operation-52-0)
IAM Action: ai gateway:ListAIGatewayLogs, Resource: arn:api7:ai gateway:aigatewaygroup/ Returns a paginated list of AI/LLM span logs extracted from OTLP traces sent by AI gateway dataplanes.
## Model Catalog
* [`GET` List model catalog entries `/api/model_catalogs`](#fallback-operation-53-0)
IAM Action: ai gateway:ListModelCatalogs, Resource: arn:api7:ai gateway:modelcatalog/ Returns globally synchronized model catalog entries that can be used to populate AI model selections. Set compact=true to receive the reduced dropdown-oriented item shape.
* [`POST` Trigger a manual model catalog sync `/api/model_catalogs/sync`](#fallback-operation-53-1)
IAM Action: ai gateway:SyncModelCatalog, Resource: arn:api7:ai gateway:modelcatalog/ Triggers an immediate synchronization against the configured upstream model catalog endpoint. Remote fetch failures are returned as HTTP 200 with success=false; HTTP 409 is reserved for...
* [`GET` List model catalog sync logs `/api/model_sync_logs`](#fallback-operation-53-2)
IAM Action: ai gateway:ListModelSyncLogs, Resource: arn:api7:ai gateway:modelcatalog/ Returns synchronization history entries, including execution status and structured diff information.

The digital world is connected by APIs,
API7.ai exists to make APIs more efficient, reliable, and secure.
Sign up for API7 newsletter
[Email address]()Subscribe
Product
[API7 Gateway](https://api7.ai/enterprise)[AISIX AI Gateway](https://api7.ai/ai-gateway)[API7 API Portal](https://api7.ai/portal)
Learn
[API Gateway Guide](https://api7.ai/learning-center/api-gateway-guide)[Plugin Hub](https://docs.api7.ai/hub.md)[API Gateway Comparison](https://api7.ai/api-gateway-comparison)[Customers](https://api7.ai/customers)
Resources
[API Gateway Docs](https://docs.api7.ai/apisix/documentation.md)[APISIX AI Agent Skills](https://docs.api7.ai/apisix/ai-agent-skills.md)[API7 AI Agent Skills](https://docs.api7.ai/api7-gateway/ai-agent-skills.md)[Blog](https://api7.ai/blog)[Demo Hub](https://api7.ai/demos)[APISIX vs Kong](https://api7.ai/apisix-vs-kong)[AI Gateway Comparison](https://api7.ai/ai-gateway-comparison)
Company
[About](https://api7.ai/about)[Contact](https://api7.ai/contact)[Partners](https://api7.ai/partners)[Compliance Standards](https://api7.ai/compliance)[Brand Assets](https://api7.ai/branding)[Terms & Privacy](https://api7.ai/terms)
***
[](https://api7.ai/compliance)
[](https://api7.ai/compliance)
[](https://api7.ai/compliance)
[](https://api7.ai/compliance)
[](https://api7.ai/blog/among-2022-red-herring-top-100-global)
Copyright © APISEVEN PTE. LTD 2019 – 2026. Apache, Apache APISIX, APISIX, and associated open source project names are trademarks of the [Apache Software Foundation](https://www.apache.org/)
[](https://www.linkedin.com/company/api7-ai/)[](https://github.com/api7)[](https://twitter.com/api7_ai)
---
[Skip to main content](#__docusaurus_skipToContent_fallback)
[](https://api7.ai/)
ProductsSolutions[Customers](https://api7.ai/customers)
Pricing
Resources[Blog](https://api7.ai/blog)
[Login](https://console.api7.cloud)Get a DemoStart for Free
[](https://api7.ai/)
* Products
[API7 Gateway](https://api7.ai/enterprise)[- ](https://api7.ai/enterprise)
[API7 Gateway](https://api7.ai/enterprise)[- ](https://api7.ai/api7-enterprise-vs-apisix)
[Apache APISIX vs API7](https://api7.ai/api7-enterprise-vs-apisix)[- ](https://api7.ai/portal)
[API7 API Portal](https://api7.ai/portal)
[Apache APISIX](https://api7.ai/apisix)[- ](https://api7.ai/apisix)
[What's Apache APISIX?](https://api7.ai/apisix)[- ](https://api7.ai/blog/why-is-apache-apisix-the-best-api-gateway)
[Why Apache APISIX?](https://api7.ai/blog/why-is-apache-apisix-the-best-api-gateway)[- ](https://api7.ai/apache-apisix-enterprise-support)
[APISIX Commercial Support](https://api7.ai/apache-apisix-enterprise-support)
[AISIX AI Gateway](https://api7.ai/ai-gateway)[- ](https://api7.ai/ai-gateway)
[AISIX AI Gateway](https://api7.ai/ai-gateway)
* Solutions
[Developer](https://api7.ai/solutions/monolith-to-microservices)[- ](https://api7.ai/solutions/monolith-to-microservices)
[Monolith to Microservices](https://api7.ai/solutions/monolith-to-microservices)[- ](https://api7.ai/solutions/on-prem-to-hybrid-cloud)
[On-Prem to Hybrid Cloud](https://api7.ai/solutions/on-prem-to-hybrid-cloud)[- ](https://api7.ai/solutions/observability)
[Observability](https://api7.ai/solutions/observability)
[- ](https://api7.ai/solutions/vm-to-kubernetes)
[VM to Kubernetes](https://api7.ai/solutions/vm-to-kubernetes)[- ](https://api7.ai/solutions/zero-trust-security)
[Zero Trust Security](https://api7.ai/solutions/zero-trust-security)
[Industry](https://api7.ai/solutions/financial-services)[- ](https://api7.ai/solutions/financial-services)
[Financial Services](https://api7.ai/solutions/financial-services)[- ](https://api7.ai/solutions/iot)
[IoT and Automotive](https://api7.ai/solutions/iot)[- ](https://api7.ai/solutions/blockchain)
[Blockchain](https://api7.ai/solutions/blockchain)
[- ](https://api7.ai/solutions/manufacturing)
[Manufacturing](https://api7.ai/solutions/manufacturing)
* [Customers](https://api7.ai/customers)
* Pricing
[- ](https://api7.ai/pricing)
[API Gateway](https://api7.ai/pricing)[- ](https://api7.ai/ai-gateway/pricing)
[AI Gateway](https://api7.ai/ai-gateway/pricing)
* Resources
[Docs](https://docs.api7.ai/ai-gateway/.md)[- ](https://docs.api7.ai/ai-gateway/.md)
[AISIX Docs](https://docs.api7.ai/ai-gateway/.md)[- ](https://docs.api7.ai/api7-gateway)
[API7 Gateway](https://docs.api7.ai/api7-gateway)[- ](https://docs.api7.ai/api7-gateway/ai-agent-skills.md)
[API7 AI Agent Skills](https://docs.api7.ai/api7-gateway/ai-agent-skills.md)[- ](https://docs.api7.ai/apisix)
[Apache APISIX](https://docs.api7.ai/apisix)[- ](https://docs.api7.ai/apisix/ai-agent-skills.md)
[APISIX AI Agent Skills](https://docs.api7.ai/apisix/ai-agent-skills.md)
[Compare](https://api7.ai/apisix-vs-kong)[- ](https://api7.ai/apisix-vs-kong)
[Apache APISIX vs Kong](https://api7.ai/apisix-vs-kong)[- ](https://api7.ai/apisix-vs-nginx)
[Apache APISIX vs NGINX](https://api7.ai/apisix-vs-nginx)[- ](https://api7.ai/api-gateway-comparison)
[2026 Top API Gateway Comparison](https://api7.ai/api-gateway-comparison)[- ](https://api7.ai/ai-gateway-comparison)
[AI Gateway Comparison](https://api7.ai/ai-gateway-comparison)
[Learn](https://api7.ai/learning-center/openresty)[- ](https://api7.ai/learning-center/openresty)
[OpenResty (NGINX + Lua)](https://api7.ai/learning-center/openresty)[- ](https://api7.ai/learning-center/api-gateway-guide)
[API Gateway Guide](https://api7.ai/learning-center/api-gateway-guide)[- ](https://api7.ai/learning-center/ai-gateway-guide)
[AI Gateway Guide](https://api7.ai/learning-center/ai-gateway-guide)[- ](https://api7.ai/learning-center/api-infrastructure-guide)
[API Infrastructure Guide](https://api7.ai/learning-center/api-infrastructure-guide)
[Explore](https://api7.ai/demos)[- ](https://api7.ai/demos)
[Demo Hub](https://api7.ai/demos)[- ](https://docs.api7.ai/hub.md)
[Plugin Hub](https://docs.api7.ai/hub.md)[- ](https://api7.ai/category/usercase)
[Case Studies](https://api7.ai/category/usercase)
* [Blog](https://api7.ai/blog)
Get a DemoStart for Free
[](https://docs.api7.ai/)[Apache APISIX](https://docs.api7.ai/apisix/documentation.md)[API7 Gateway](https://docs.api7.ai/api7-gateway/overview.md)[Ingress Controller](https://docs.api7.ai/ingress-controller/documentation.md)[AISIX AI Gateway](https://docs.api7.ai/ai-gateway/.md)[Plugin Hub](https://docs.api7.ai/hub.md)
Search
# API7 Enterprise Developer Portal APIs
API7 Enterprise Developer Portal APIs are RESTful APIs that allow you to create and manage developer portal resources. Base URL All API paths are relative to your API7 Developer Portal address...
## Developer
* [`GET` List Developers `/api/developers`](#fallback-operation-0-0)
* [`POST` Create a developer `/api/developers`](#fallback-operation-0-1)
* [`DELETE` Delete a developer `/api/developers/{developer_id}`](#fallback-operation-0-2)
## API Product
* [`GET` List all API products `/api/api_products`](#fallback-operation-1-0)
* [`GET` Get an API Product for Developer Portal `/api/api_products/{api_product_id}`](#fallback-operation-1-1)
* [`POST` Create a subscription for an API Product. `/api/api_products/{api_product_id}/subscriptions`](#fallback-operation-1-2)
## Subscription
* [`GET` List subscriptions. `/api/subscriptions`](#fallback-operation-2-0)
* [`POST` Create a subscription for an API Product `/api/subscriptions`](#fallback-operation-2-1)
* [`DELETE` Unsubscribe an API product for the given application `/api/subscriptions/{subscription_id}`](#fallback-operation-2-2)
## Application
* [`GET` List all applications for the logged in developer. `/api/applications`](#fallback-operation-3-0)
* [`POST` Create an application by the logged in developer. `/api/applications`](#fallback-operation-3-1)
* [`GET` Get an application for the logged in developer. `/api/applications/{application_id}`](#fallback-operation-3-2)
* [`PUT` Update an application basic information by the logged in developer. `/api/applications/{application_id}`](#fallback-operation-3-3)
* [`DELETE` Delete an application by the logged in developer. `/api/applications/{application_id}`](#fallback-operation-3-4)
## Credential
* [`GET` List all credentials for the logged in developer `/api/applications/{application_id}/credentials`](#fallback-operation-4-0)
* [`POST` Create an application credential `/api/applications/{application_id}/credentials`](#fallback-operation-4-1)
* [`GET` Get an application credential for Developer Portal `/api/applications/{application_id}/credentials/{credential_id}`](#fallback-operation-4-2)
* [`PUT` Update an application credential for Developer Portal `/api/applications/{application_id}/credentials/{credential_id}`](#fallback-operation-4-3)
* [`DELETE` Delete an application credential for Developer Portal `/api/applications/{application_id}/credentials/{credential_id}`](#fallback-operation-4-4)
* [`PUT` Regenerate an application credential auth conf `/api/applications/{application_id}/credentials/{credential_id}/regenerate`](#fallback-operation-4-5)
* [`GET` List all Credentials `/api/credentials`](#fallback-operation-4-6)
## API Calls
* [`GET` Get API Calls `/api/applications/api_calls`](#fallback-operation-5-0)
Retrieve a list of API calls made by the user.
## Label
* [`GET` Get all labels of a resource type `/api/labels/{resource_type}`](#fallback-operation-6-0)
## System Settings
* [`GET` Get SMTP server settings status `/api/system_settings/smtp_server_status`](#fallback-operation-7-0)
Get SMTP server settings status.
* [`GET` Get public access settings `/api/system_settings/public_access`](#fallback-operation-7-1)
## DCR Provider
* [`GET` List all DCR providers `/api/dcr_providers`](#fallback-operation-8-0)
## Approval
* [`GET` List approvals `/api/approvals`](#fallback-operation-9-0)
List pending and processed approval workflow items for the current portal, such as API product subscriptions and developer registrations. Results are scoped to the portal of the request token.
* [`POST` Accept an approval request `/api/approvals/{approval_id}/accept`](#fallback-operation-9-1)
Approve a specific workflow request and apply the corresponding portal-side change, such as granting an API product subscription or accepting a developer sign-up.
* [`POST` Reject an approval request `/api/approvals/{approval_id}/reject`](#fallback-operation-9-2)
Reject a specific workflow approval request so the requested action is not applied.

The digital world is connected by APIs,
API7.ai exists to make APIs more efficient, reliable, and secure.
Sign up for API7 newsletter
[Email address]()Subscribe
Product
[API7 Gateway](https://api7.ai/enterprise)[AISIX AI Gateway](https://api7.ai/ai-gateway)[API7 API Portal](https://api7.ai/portal)
Learn
[API Gateway Guide](https://api7.ai/learning-center/api-gateway-guide)[Plugin Hub](https://docs.api7.ai/hub.md)[API Gateway Comparison](https://api7.ai/api-gateway-comparison)[Customers](https://api7.ai/customers)
Resources
[API Gateway Docs](https://docs.api7.ai/apisix/documentation.md)[APISIX AI Agent Skills](https://docs.api7.ai/apisix/ai-agent-skills.md)[API7 AI Agent Skills](https://docs.api7.ai/api7-gateway/ai-agent-skills.md)[Blog](https://api7.ai/blog)[Demo Hub](https://api7.ai/demos)[APISIX vs Kong](https://api7.ai/apisix-vs-kong)[AI Gateway Comparison](https://api7.ai/ai-gateway-comparison)
Company
[About](https://api7.ai/about)[Contact](https://api7.ai/contact)[Partners](https://api7.ai/partners)[Compliance Standards](https://api7.ai/compliance)[Brand Assets](https://api7.ai/branding)[Terms & Privacy](https://api7.ai/terms)
***
[](https://api7.ai/compliance)
[](https://api7.ai/compliance)
[](https://api7.ai/compliance)
[](https://api7.ai/compliance)
[](https://api7.ai/blog/among-2022-red-herring-top-100-global)
Copyright © APISEVEN PTE. LTD 2019 – 2026. Apache, Apache APISIX, APISIX, and associated open source project names are trademarks of the [Apache Software Foundation](https://www.apache.org/)
[](https://www.linkedin.com/company/api7-ai/)[](https://github.com/api7)[](https://twitter.com/api7_ai)
---
[Skip to main content](#__docusaurus_skipToContent_fallback)
[](https://api7.ai/)
ProductsSolutions[Customers](https://api7.ai/customers)
Pricing
Resources[Blog](https://api7.ai/blog)
[Login](https://console.api7.cloud)Get a DemoStart for Free
[](https://api7.ai/)
* Products
[API7 Gateway](https://api7.ai/enterprise)[- ](https://api7.ai/enterprise)
[API7 Gateway](https://api7.ai/enterprise)[- ](https://api7.ai/api7-enterprise-vs-apisix)
[Apache APISIX vs API7](https://api7.ai/api7-enterprise-vs-apisix)[- ](https://api7.ai/portal)
[API7 API Portal](https://api7.ai/portal)
[Apache APISIX](https://api7.ai/apisix)[- ](https://api7.ai/apisix)
[What's Apache APISIX?](https://api7.ai/apisix)[- ](https://api7.ai/blog/why-is-apache-apisix-the-best-api-gateway)
[Why Apache APISIX?](https://api7.ai/blog/why-is-apache-apisix-the-best-api-gateway)[- ](https://api7.ai/apache-apisix-enterprise-support)
[APISIX Commercial Support](https://api7.ai/apache-apisix-enterprise-support)
[AISIX AI Gateway](https://api7.ai/ai-gateway)[- ](https://api7.ai/ai-gateway)
[AISIX AI Gateway](https://api7.ai/ai-gateway)
* Solutions
[Developer](https://api7.ai/solutions/monolith-to-microservices)[- ](https://api7.ai/solutions/monolith-to-microservices)
[Monolith to Microservices](https://api7.ai/solutions/monolith-to-microservices)[- ](https://api7.ai/solutions/on-prem-to-hybrid-cloud)
[On-Prem to Hybrid Cloud](https://api7.ai/solutions/on-prem-to-hybrid-cloud)[- ](https://api7.ai/solutions/observability)
[Observability](https://api7.ai/solutions/observability)
[- ](https://api7.ai/solutions/vm-to-kubernetes)
[VM to Kubernetes](https://api7.ai/solutions/vm-to-kubernetes)[- ](https://api7.ai/solutions/zero-trust-security)
[Zero Trust Security](https://api7.ai/solutions/zero-trust-security)
[Industry](https://api7.ai/solutions/financial-services)[- ](https://api7.ai/solutions/financial-services)
[Financial Services](https://api7.ai/solutions/financial-services)[- ](https://api7.ai/solutions/iot)
[IoT and Automotive](https://api7.ai/solutions/iot)[- ](https://api7.ai/solutions/blockchain)
[Blockchain](https://api7.ai/solutions/blockchain)
[- ](https://api7.ai/solutions/manufacturing)
[Manufacturing](https://api7.ai/solutions/manufacturing)
* [Customers](https://api7.ai/customers)
* Pricing
[- ](https://api7.ai/pricing)
[API Gateway](https://api7.ai/pricing)[- ](https://api7.ai/ai-gateway/pricing)
[AI Gateway](https://api7.ai/ai-gateway/pricing)
* Resources
[Docs](https://docs.api7.ai/ai-gateway/.md)[- ](https://docs.api7.ai/ai-gateway/.md)
[AISIX Docs](https://docs.api7.ai/ai-gateway/.md)[- ](https://docs.api7.ai/api7-gateway)
[API7 Gateway](https://docs.api7.ai/api7-gateway)[- ](https://docs.api7.ai/api7-gateway/ai-agent-skills.md)
[API7 AI Agent Skills](https://docs.api7.ai/api7-gateway/ai-agent-skills.md)[- ](https://docs.api7.ai/apisix)
[Apache APISIX](https://docs.api7.ai/apisix)[- ](https://docs.api7.ai/apisix/ai-agent-skills.md)
[APISIX AI Agent Skills](https://docs.api7.ai/apisix/ai-agent-skills.md)
[Compare](https://api7.ai/apisix-vs-kong)[- ](https://api7.ai/apisix-vs-kong)
[Apache APISIX vs Kong](https://api7.ai/apisix-vs-kong)[- ](https://api7.ai/apisix-vs-nginx)
[Apache APISIX vs NGINX](https://api7.ai/apisix-vs-nginx)[- ](https://api7.ai/api-gateway-comparison)
[2026 Top API Gateway Comparison](https://api7.ai/api-gateway-comparison)[- ](https://api7.ai/ai-gateway-comparison)
[AI Gateway Comparison](https://api7.ai/ai-gateway-comparison)
[Learn](https://api7.ai/learning-center/openresty)[- ](https://api7.ai/learning-center/openresty)
[OpenResty (NGINX + Lua)](https://api7.ai/learning-center/openresty)[- ](https://api7.ai/learning-center/api-gateway-guide)
[API Gateway Guide](https://api7.ai/learning-center/api-gateway-guide)[- ](https://api7.ai/learning-center/ai-gateway-guide)
[AI Gateway Guide](https://api7.ai/learning-center/ai-gateway-guide)[- ](https://api7.ai/learning-center/api-infrastructure-guide)
[API Infrastructure Guide](https://api7.ai/learning-center/api-infrastructure-guide)
[Explore](https://api7.ai/demos)[- ](https://api7.ai/demos)
[Demo Hub](https://api7.ai/demos)[- ](https://docs.api7.ai/hub.md)
[Plugin Hub](https://docs.api7.ai/hub.md)[- ](https://api7.ai/category/usercase)
[Case Studies](https://api7.ai/category/usercase)
* [Blog](https://api7.ai/blog)
Get a DemoStart for Free
[](https://docs.api7.ai/)[Apache APISIX](https://docs.api7.ai/apisix/documentation.md)[API7 Gateway](https://docs.api7.ai/api7-gateway/overview.md)[Ingress Controller](https://docs.api7.ai/ingress-controller/documentation.md)[AISIX AI Gateway](https://docs.api7.ai/ai-gateway/.md)[Plugin Hub](https://docs.api7.ai/hub.md)
Search
# Apache APISIX Admin API
The Apache APISIX Admin API is a RESTful interface for managing all APISIX gateway resources — routes, upstreams, services, consumers, SSL certificates, plugins, and more. APISIX Admin API allows...
## Routes
* [`GET` List All Routes `/apisix/admin/routes`](#fallback-operation-0-0)
Retrieve all configured routes. Supports filtering by name, label, uri, or filter expression. Results include full route configuration and metadata (creation/update timestamps).
* [`POST` Create a Route `/apisix/admin/routes`](#fallback-operation-0-1)
Create a new route with an auto-generated ID. A route must include at least a uri and one of: upstream (inline), upstream id, service id, or plugins.
* [`GET` Get a Route `/apisix/admin/routes/{id}`](#fallback-operation-0-2)
Retrieve a single route by its ID.
* [`PUT` Create or Replace a Route `/apisix/admin/routes/{id}`](#fallback-operation-0-3)
Create a new route with a specified ID, or fully replace an existing route. Note: This is a full replacement — all fields must be provided. Use PATCH for partial updates.
* [`DELETE` Delete a Route `/apisix/admin/routes/{id}`](#fallback-operation-0-4)
Delete a route by its ID. This action is irreversible.
* [`PATCH` Update a Route (Partial) `/apisix/admin/routes/{id}`](#fallback-operation-0-5)
Partially update a route's configuration. Only the fields included in the request body are modified; all other fields remain unchanged. Tip: Use this to update a single field (e.g., change the upstream) without resending the entire route configuration.
* [`PATCH` Replace a single nested field of a route `/apisix/admin/routes/{id}/{sub_path}`](#fallback-operation-0-6)
Replaces the value at sub path within the route document with the request body. The body is any valid JSON value, not necessarily an object. The updated complete resource must pass validation.
## Upstreams
* [`GET` List All Upstreams `/apisix/admin/upstreams`](#fallback-operation-1-0)
Retrieve all configured upstreams.
* [`POST` Create an Upstream `/apisix/admin/upstreams`](#fallback-operation-1-1)
Create a new upstream with an auto-generated ID.
* [`GET` Get an Upstream `/apisix/admin/upstreams/{id}`](#fallback-operation-1-2)
Retrieve a single upstream by its ID.
* [`PUT` Create or Replace an Upstream `/apisix/admin/upstreams/{id}`](#fallback-operation-1-3)
Create a new upstream with a specified ID, or fully replace an existing upstream.
* [`DELETE` Delete an Upstream `/apisix/admin/upstreams/{id}`](#fallback-operation-1-4)
Delete an upstream by its ID. Fails if the upstream is still referenced by a route or service.
* [`PATCH` Update an Upstream (Partial) `/apisix/admin/upstreams/{id}`](#fallback-operation-1-5)
Partially update an upstream's configuration.
* [`PATCH` Replace a single nested field of an upstream `/apisix/admin/upstreams/{id}/{sub_path}`](#fallback-operation-1-6)
Replaces the value at sub path within the upstream document with the request body. The body is any valid JSON value, not necessarily an object. The updated complete resource must pass validation.
## Services
* [`GET` List All Services `/apisix/admin/services`](#fallback-operation-2-0)
Retrieve all configured services.
* [`POST` Create a Service `/apisix/admin/services`](#fallback-operation-2-1)
Create a new service with an auto-generated ID.
* [`GET` Get a Service `/apisix/admin/services/{id}`](#fallback-operation-2-2)
Retrieve a single service by its ID.
* [`PUT` Create or Replace a Service `/apisix/admin/services/{id}`](#fallback-operation-2-3)
Create a new service with a specified ID, or fully replace an existing service.
* [`DELETE` Delete a Service `/apisix/admin/services/{id}`](#fallback-operation-2-4)
Delete a service by its ID.
* [`PATCH` Update a Service (Partial) `/apisix/admin/services/{id}`](#fallback-operation-2-5)
Partially update a service's configuration.
* [`PATCH` Replace a single nested field of a service `/apisix/admin/services/{id}/{sub_path}`](#fallback-operation-2-6)
Replaces the value at sub path within the service document with the request body. The body is any valid JSON value, not necessarily an object. The updated complete resource must pass validation.
## Consumers
* [`GET` List All Consumers `/apisix/admin/consumers`](#fallback-operation-3-0)
Retrieve all configured consumers.
* [`PUT` Create or Update a Consumer `/apisix/admin/consumers`](#fallback-operation-3-1)
Create a new consumer or update an existing one. The consumer is identified by username in the request body.
* [`GET` Get a Consumer `/apisix/admin/consumers/{username}`](#fallback-operation-3-2)
Retrieve a single consumer by username.
* [`DELETE` Delete a Consumer `/apisix/admin/consumers/{username}`](#fallback-operation-3-3)
Delete a consumer by username. This also deletes all associated credentials.
## Consumer Groups
* [`GET` List All Consumer Groups `/apisix/admin/consumer_groups`](#fallback-operation-4-0)
Retrieve all configured consumer groups.
* [`GET` Get a Consumer Group `/apisix/admin/consumer_groups/{id}`](#fallback-operation-4-1)
Retrieve a single consumer group by its ID.
* [`PUT` Create or Replace a Consumer Group `/apisix/admin/consumer_groups/{id}`](#fallback-operation-4-2)
Create a new consumer group with a specified ID, or fully replace an existing one.
* [`DELETE` Delete a Consumer Group `/apisix/admin/consumer_groups/{id}`](#fallback-operation-4-3)
Delete a consumer group by its ID.
* [`PATCH` Update a Consumer Group (Partial) `/apisix/admin/consumer_groups/{id}`](#fallback-operation-4-4)
Partially update a consumer group's configuration.
* [`PATCH` Replace a single nested field of a consumer group `/apisix/admin/consumer_groups/{id}/{sub_path}`](#fallback-operation-4-5)
Replaces the value at sub path within the consumer group document with the request body. The body is any valid JSON value, not necessarily an object. The updated complete resource must pass validation.
## Credentials
* [`GET` List Consumer Credentials `/apisix/admin/consumers/{username}/credentials`](#fallback-operation-5-0)
Retrieve all credentials for a specific consumer.
* [`GET` Get a Credential `/apisix/admin/consumers/{username}/credentials/{id}`](#fallback-operation-5-1)
Retrieve a specific credential for a consumer.
* [`PUT` Create or Replace a Credential `/apisix/admin/consumers/{username}/credentials/{id}`](#fallback-operation-5-2)
Create a new credential for a consumer with a specified ID, or replace an existing one. Each credential holds exactly one authentication plugin.
* [`DELETE` Delete a Credential `/apisix/admin/consumers/{username}/credentials/{id}`](#fallback-operation-5-3)
Delete a specific credential from a consumer.
## Plugins
* [`GET` List Plugin Names `/apisix/admin/plugins/list`](#fallback-operation-6-0)
Get a list of all available plugin names, optionally filtered by subsystem (http or stream).
* [`GET` Get Plugin JSON Schema `/apisix/admin/plugins/{plugin_name}`](#fallback-operation-6-1)
Retrieve the JSON Schema definition for a specific plugin. This is useful for validating plugin configurations before applying them.
* [`GET` List Plugin Attributes `/apisix/admin/plugins`](#fallback-operation-6-2)
Get attributes of all plugins configured on the APISIX instance. Deprecated: This endpoint is being replaced. Use GET /plugins/list and GET /plugins/{plugin name} instead.
* [`PUT` Hot-Reload Plugins `/apisix/admin/plugins/reload`](#fallback-operation-6-3)
Trigger a hot reload of all plugins. This re-reads plugin configurations from etcd without restarting APISIX. Important: Only the PUT method is accepted.
## Plugin Configs
* [`GET` List All Plugin Configs `/apisix/admin/plugin_configs`](#fallback-operation-7-0)
Retrieve all configured plugin configs.
* [`GET` Get a Plugin Config `/apisix/admin/plugin_configs/{id}`](#fallback-operation-7-1)
Retrieve a single plugin config by its ID.
* [`PUT` Create or Replace a Plugin Config `/apisix/admin/plugin_configs/{id}`](#fallback-operation-7-2)
Create a new plugin config with a specified ID, or fully replace an existing one.
* [`DELETE` Delete a Plugin Config `/apisix/admin/plugin_configs/{id}`](#fallback-operation-7-3)
Delete a plugin config by its ID.
* [`PATCH` Update a Plugin Config (Partial) `/apisix/admin/plugin_configs/{id}`](#fallback-operation-7-4)
Partially update a plugin config's configuration.
* [`PATCH` Replace a single nested field of a plugin config `/apisix/admin/plugin_configs/{id}/{sub_path}`](#fallback-operation-7-5)
Replaces the value at sub path within the plugin config document with the request body. The body is any valid JSON value, not necessarily an object. The updated complete resource must pass validation.
## Plugin Metadata
* [`GET` List All Plugin Metadata `/apisix/admin/plugin_metadata`](#fallback-operation-8-0)
Retrieve metadata for all plugins that have metadata configured.
* [`GET` Get Plugin Metadata `/apisix/admin/plugin_metadata/{plugin_name}`](#fallback-operation-8-1)
Retrieve metadata for a specific plugin by plugin name.
* [`PUT` Create or Replace Plugin Metadata `/apisix/admin/plugin_metadata/{plugin_name}`](#fallback-operation-8-2)
Set metadata for a specific plugin. This applies to all instances of the plugin across the cluster.
* [`DELETE` Delete Plugin Metadata `/apisix/admin/plugin_metadata/{plugin_name}`](#fallback-operation-8-3)
Delete metadata for a specific plugin.
## Global Rules
* [`GET` List All Global Rules `/apisix/admin/global_rules`](#fallback-operation-9-0)
Retrieve all configured global rules.
* [`GET` Get a Global Rule `/apisix/admin/global_rules/{id}`](#fallback-operation-9-1)
Retrieve a single global rule by its ID.
* [`PUT` Create or Replace a Global Rule `/apisix/admin/global_rules/{id}`](#fallback-operation-9-2)
Create a new global rule with a specified ID, or fully replace an existing one.
* [`DELETE` Delete a Global Rule `/apisix/admin/global_rules/{id}`](#fallback-operation-9-3)
Delete a global rule by its ID.
* [`PATCH` Update a Global Rule (Partial) `/apisix/admin/global_rules/{id}`](#fallback-operation-9-4)
Partially update a global rule's configuration.
* [`PATCH` Replace a single nested field of a global rule `/apisix/admin/global_rules/{id}/{sub_path}`](#fallback-operation-9-5)
Replaces the value at sub path within the global rule document with the request body. The body is any valid JSON value, not necessarily an object. The updated complete resource must pass validation.
## Stream Routes
* [`GET` List All Stream Routes `/apisix/admin/stream_routes`](#fallback-operation-10-0)
Retrieve all configured stream (L4) routes. Prerequisite: Stream mode must be enabled in config.yaml.
* [`POST` Create a Stream Route `/apisix/admin/stream_routes`](#fallback-operation-10-1)
Create a new stream route with an auto-generated ID.
* [`GET` Get Stream Route by ID `/apisix/admin/stream_routes/{id}`](#fallback-operation-10-2)
Get stream route by ID.
* [`PUT` Create Stream Route by ID `/apisix/admin/stream_routes/{id}`](#fallback-operation-10-3)
Create a stream route with a specified ID.
* [`DELETE` Delete Stream Route by ID `/apisix/admin/stream_routes/{id}`](#fallback-operation-10-4)
Delete a stream route by ID.
## SSL Certificates
* [`GET` List All SSL Certificates `/apisix/admin/ssls`](#fallback-operation-11-0)
Retrieve all configured SSL certificates. Private keys are not included in the response for security.
* [`POST` Create an SSL Certificate `/apisix/admin/ssls`](#fallback-operation-11-1)
Upload a new SSL certificate with an auto-generated ID.
* [`GET` Get an SSL Certificate `/apisix/admin/ssls/{id}`](#fallback-operation-11-2)
Retrieve a single SSL certificate by its ID. The private key is not included in the response.
* [`PUT` Create or Replace an SSL Certificate `/apisix/admin/ssls/{id}`](#fallback-operation-11-3)
Upload a new SSL certificate with a specified ID, or replace an existing one.
* [`DELETE` Delete an SSL Certificate `/apisix/admin/ssls/{id}`](#fallback-operation-11-4)
Delete an SSL certificate by its ID.
* [`PATCH` Update an SSL Certificate (Partial) `/apisix/admin/ssls/{id}`](#fallback-operation-11-5)
Partially update an SSL certificate's configuration. Only the fields included in the request body are modified; all other fields remain unchanged.
* [`PATCH` Replace a single nested field of an SSL certificate `/apisix/admin/ssls/{id}/{sub_path}`](#fallback-operation-11-6)
Replaces the value at sub path within the SSL certificate document with the request body. The body is any valid JSON value, not necessarily an object. The updated complete resource must pass validation.
## Secrets
* [`GET` List All Secrets `/apisix/admin/secrets`](#fallback-operation-12-0)
Retrieve all configured secret manager integrations.
* [`GET` Get a Secret `/apisix/admin/secrets/{secret_type}/{id}`](#fallback-operation-12-1)
Retrieve a specific secret manager configuration.
* [`PUT` Create or Replace a Secret `/apisix/admin/secrets/{secret_type}/{id}`](#fallback-operation-12-2)
Configure a secret manager integration with a specified ID.
* [`DELETE` Delete a Secret `/apisix/admin/secrets/{secret_type}/{id}`](#fallback-operation-12-3)
Delete a secret manager configuration.
* [`PATCH` Update a Secret (Partial) `/apisix/admin/secrets/{secret_type}/{id}`](#fallback-operation-12-4)
Partially update a secret manager configuration.
* [`GET` List secrets of a single secret-manager type `/apisix/admin/secrets/{secret_type}`](#fallback-operation-12-5)
Returns secrets registered under the given manager (vault, aws, or gcp). For listing across all managers, use GET /apisix/admin/secrets.
* [`PATCH` Replace a single nested field of a secret `/apisix/admin/secrets/{secret_type}/{id}/{sub_path}`](#fallback-operation-12-6)
Replaces the value at sub path within the secret document with the request body. The body is any valid JSON value, not necessarily an object. The updated complete resource must pass validation.
## Protos
* [`GET` Get a Proto `/apisix/admin/protos/{id}`](#fallback-operation-13-0)
Retrieve a single protobuf definition by its ID.
* [`PUT` Create or Replace a Proto `/apisix/admin/protos/{id}`](#fallback-operation-13-1)
Upload a protobuf definition with a specified ID, or replace an existing one.
* [`DELETE` Delete a Proto `/apisix/admin/protos/{id}`](#fallback-operation-13-2)
Delete a protobuf definition by its ID.
* [`GET` List All Protos `/apisix/admin/protos`](#fallback-operation-13-3)
Retrieve all stored protobuf definitions.
* [`POST` Create a Proto `/apisix/admin/protos`](#fallback-operation-13-4)
Upload a new protobuf definition with an auto-generated ID.
## Schema Validation
* [`POST` Validate Resource Configuration `/apisix/admin/schema/validate/{resource}`](#fallback-operation-14-0)
Validate a resource configuration against APISIX's JSON Schema without creating the resource. Useful for dry-run validation in CI/CD pipelines. The {resource} path parameter specifies the resource type (e.g., routes, upstreams, services, etc.).
* [`POST` Validate a Configuration Without Applying It `/apisix/admin/configs/validate`](#fallback-operation-14-1)
Validates a declarative APISIX configuration when the deployment uses either the etcd or yaml configuration provider. The endpoint accepts JSON and YAML request bodies up to 1.5 MiB and uses the normal Admin API authentication. Validation covers known resource arrays, numeric...
* [`GET` Get the JSON Schema of a built-in resource `/apisix/admin/schema/{resource}`](#fallback-operation-14-2)
Returns the JSON Schema document used internally by APISIX to validate the named resource type.
* [`GET` Get a plugin's JSON Schema (alternative path) `/apisix/admin/schema/plugins/{plugin_name}`](#fallback-operation-14-3)
Equivalent to GET /apisix/admin/plugins/{plugin name}. Provided for symmetry with GET /apisix/admin/schema/{resource}.
## Health
* [`HEAD` Liveness probe `/apisix/admin`](#fallback-operation-15-0)
Returns 200 OK if the Admin API is reachable. Useful as a Kubernetes liveness probe target. This endpoint does not require authentication.
## Standalone
* [`GET` Get the standalone configuration `/apisix/admin/configs`](#fallback-operation-16-0)
Available only when deployment.role data plane.config provider is yaml. Returns the entire current configuration document.
* [`PUT` Replace the standalone configuration `/apisix/admin/configs`](#fallback-operation-16-1)
Replaces the entire current configuration. Available only when deployment.role data plane.config provider is yaml.
* [`HEAD` Probe standalone configuration availability `/apisix/admin/configs`](#fallback-operation-16-2)
Returns 200 OK if the deployment is in YAML provider mode and the configuration endpoint is reachable.

The digital world is connected by APIs,
API7.ai exists to make APIs more efficient, reliable, and secure.
Sign up for API7 newsletter
[Email address]()Subscribe
Product
[API7 Gateway](https://api7.ai/enterprise)[AISIX AI Gateway](https://api7.ai/ai-gateway)[API7 API Portal](https://api7.ai/portal)
Learn
[API Gateway Guide](https://api7.ai/learning-center/api-gateway-guide)[Plugin Hub](https://docs.api7.ai/hub.md)[API Gateway Comparison](https://api7.ai/api-gateway-comparison)[Customers](https://api7.ai/customers)
Resources
[API Gateway Docs](https://docs.api7.ai/apisix/documentation.md)[APISIX AI Agent Skills](https://docs.api7.ai/apisix/ai-agent-skills.md)[API7 AI Agent Skills](https://docs.api7.ai/api7-gateway/ai-agent-skills.md)[Blog](https://api7.ai/blog)[Demo Hub](https://api7.ai/demos)[APISIX vs Kong](https://api7.ai/apisix-vs-kong)[AI Gateway Comparison](https://api7.ai/ai-gateway-comparison)
Company
[About](https://api7.ai/about)[Contact](https://api7.ai/contact)[Partners](https://api7.ai/partners)[Compliance Standards](https://api7.ai/compliance)[Brand Assets](https://api7.ai/branding)[Terms & Privacy](https://api7.ai/terms)
***
[](https://api7.ai/compliance)
[](https://api7.ai/compliance)
[](https://api7.ai/compliance)
[](https://api7.ai/compliance)
[](https://api7.ai/blog/among-2022-red-herring-top-100-global)
Copyright © APISEVEN PTE. LTD 2019 – 2026. Apache, Apache APISIX, APISIX, and associated open source project names are trademarks of the [Apache Software Foundation](https://www.apache.org/)
[](https://www.linkedin.com/company/api7-ai/)[](https://github.com/api7)[](https://twitter.com/api7_ai)
---
[Skip to main content](#__docusaurus_skipToContent_fallback)
[](https://api7.ai/)
ProductsSolutions[Customers](https://api7.ai/customers)
Pricing
Resources[Blog](https://api7.ai/blog)
[Login](https://console.api7.cloud)Get a DemoStart for Free
[](https://api7.ai/)
* Products
[API7 Gateway](https://api7.ai/enterprise)[- ](https://api7.ai/enterprise)
[API7 Gateway](https://api7.ai/enterprise)[- ](https://api7.ai/api7-enterprise-vs-apisix)
[Apache APISIX vs API7](https://api7.ai/api7-enterprise-vs-apisix)[- ](https://api7.ai/portal)
[API7 API Portal](https://api7.ai/portal)
[Apache APISIX](https://api7.ai/apisix)[- ](https://api7.ai/apisix)
[What's Apache APISIX?](https://api7.ai/apisix)[- ](https://api7.ai/blog/why-is-apache-apisix-the-best-api-gateway)
[Why Apache APISIX?](https://api7.ai/blog/why-is-apache-apisix-the-best-api-gateway)[- ](https://api7.ai/apache-apisix-enterprise-support)
[APISIX Commercial Support](https://api7.ai/apache-apisix-enterprise-support)
[AISIX AI Gateway](https://api7.ai/ai-gateway)[- ](https://api7.ai/ai-gateway)
[AISIX AI Gateway](https://api7.ai/ai-gateway)
* Solutions
[Developer](https://api7.ai/solutions/monolith-to-microservices)[- ](https://api7.ai/solutions/monolith-to-microservices)
[Monolith to Microservices](https://api7.ai/solutions/monolith-to-microservices)[- ](https://api7.ai/solutions/on-prem-to-hybrid-cloud)
[On-Prem to Hybrid Cloud](https://api7.ai/solutions/on-prem-to-hybrid-cloud)[- ](https://api7.ai/solutions/observability)
[Observability](https://api7.ai/solutions/observability)
[- ](https://api7.ai/solutions/vm-to-kubernetes)
[VM to Kubernetes](https://api7.ai/solutions/vm-to-kubernetes)[- ](https://api7.ai/solutions/zero-trust-security)
[Zero Trust Security](https://api7.ai/solutions/zero-trust-security)
[Industry](https://api7.ai/solutions/financial-services)[- ](https://api7.ai/solutions/financial-services)
[Financial Services](https://api7.ai/solutions/financial-services)[- ](https://api7.ai/solutions/iot)
[IoT and Automotive](https://api7.ai/solutions/iot)[- ](https://api7.ai/solutions/blockchain)
[Blockchain](https://api7.ai/solutions/blockchain)
[- ](https://api7.ai/solutions/manufacturing)
[Manufacturing](https://api7.ai/solutions/manufacturing)
* [Customers](https://api7.ai/customers)
* Pricing
[- ](https://api7.ai/pricing)
[API Gateway](https://api7.ai/pricing)[- ](https://api7.ai/ai-gateway/pricing)
[AI Gateway](https://api7.ai/ai-gateway/pricing)
* Resources
[Docs](https://docs.api7.ai/ai-gateway/.md)[- ](https://docs.api7.ai/ai-gateway/.md)
[AISIX Docs](https://docs.api7.ai/ai-gateway/.md)[- ](https://docs.api7.ai/api7-gateway)
[API7 Gateway](https://docs.api7.ai/api7-gateway)[- ](https://docs.api7.ai/api7-gateway/ai-agent-skills.md)
[API7 AI Agent Skills](https://docs.api7.ai/api7-gateway/ai-agent-skills.md)[- ](https://docs.api7.ai/apisix)
[Apache APISIX](https://docs.api7.ai/apisix)[- ](https://docs.api7.ai/apisix/ai-agent-skills.md)
[APISIX AI Agent Skills](https://docs.api7.ai/apisix/ai-agent-skills.md)
[Compare](https://api7.ai/apisix-vs-kong)[- ](https://api7.ai/apisix-vs-kong)
[Apache APISIX vs Kong](https://api7.ai/apisix-vs-kong)[- ](https://api7.ai/apisix-vs-nginx)
[Apache APISIX vs NGINX](https://api7.ai/apisix-vs-nginx)[- ](https://api7.ai/api-gateway-comparison)
[2026 Top API Gateway Comparison](https://api7.ai/api-gateway-comparison)[- ](https://api7.ai/ai-gateway-comparison)
[AI Gateway Comparison](https://api7.ai/ai-gateway-comparison)
[Learn](https://api7.ai/learning-center/openresty)[- ](https://api7.ai/learning-center/openresty)
[OpenResty (NGINX + Lua)](https://api7.ai/learning-center/openresty)[- ](https://api7.ai/learning-center/api-gateway-guide)
[API Gateway Guide](https://api7.ai/learning-center/api-gateway-guide)[- ](https://api7.ai/learning-center/ai-gateway-guide)
[AI Gateway Guide](https://api7.ai/learning-center/ai-gateway-guide)[- ](https://api7.ai/learning-center/api-infrastructure-guide)
[API Infrastructure Guide](https://api7.ai/learning-center/api-infrastructure-guide)
[Explore](https://api7.ai/demos)[- ](https://api7.ai/demos)
[Demo Hub](https://api7.ai/demos)[- ](https://docs.api7.ai/hub.md)
[Plugin Hub](https://docs.api7.ai/hub.md)[- ](https://api7.ai/category/usercase)
[Case Studies](https://api7.ai/category/usercase)
* [Blog](https://api7.ai/blog)
Get a DemoStart for Free
[](https://docs.api7.ai/)[Apache APISIX](https://docs.api7.ai/apisix/documentation.md)[API7 Gateway](https://docs.api7.ai/api7-gateway/overview.md)[Ingress Controller](https://docs.api7.ai/ingress-controller/documentation.md)[AISIX AI Gateway](https://docs.api7.ai/ai-gateway/.md)[Plugin Hub](https://docs.api7.ai/hub.md)
Search
# APISIX Control API
Use the APISIX Control API to inspect or control the runtime state of one APISIX instance. It is enabled by default at http\://127.0.0.1:9090; configure apisix.enable control and apisix.control in...
## Schema
* [`GET` Get JSON Schema `/v1/schema`](#fallback-operation-0-0)
Get the JSON schema used by the gateway instance. Only loaded plugins are included.
## Health Check
* [`GET` Get Health Check Information `/v1/healthcheck`](#fallback-operation-1-0)
Get health check information of the APISIX instance. You need to initiate a request to the route to generate Control API health check information.
* [`GET` Get Health Status By Type and ID `/v1/healthcheck/{src_type}/{src_id}`](#fallback-operation-1-1)
Get health status of a specified resource.
## Garbage Collection
* [`POST` Trigger Garbage Collection `/v1/gc`](#fallback-operation-2-0)
Trigger a full garbage collection (GC) in the HTTP subsystem. Note that a request to this endpoint would not trigger a garbage collection in the stream subsystem because the subsystems are run in the separate Lua VM.
## Route
* [`GET` Get All Routes `/v1/routes`](#fallback-operation-3-0)
Get all configured routes.
* [`GET` Get Route by ID `/v1/route/{route_id}`](#fallback-operation-3-1)
Get a route by ID.
## Upstream
* [`GET` Get All Upstreams `/v1/upstreams`](#fallback-operation-4-0)
Get all configured upstreams.
* [`GET` Get Upstream by ID `/v1/upstream/{upstream_id}`](#fallback-operation-4-1)
Get an upstream by ID.
## Service
* [`GET` Get All Services `/v1/services`](#fallback-operation-5-0)
Get all configured services.
* [`GET` Get Service by ID `/v1/service/{service_id}`](#fallback-operation-5-1)
Get a service by ID.
## Plugin Metadata
* [`GET` Get All Plugin Metadata `/v1/plugin_metadatas`](#fallback-operation-6-0)
Get all plugin metadata.
* [`GET` Get Plugin Metadata by Name `/v1/plugin_metadata/{plugin_name}`](#fallback-operation-6-1)
Get plugin metadata by the plugin name.
## Plugin
* [`PUT` Reload All Plugins `/v1/plugins/reload`](#fallback-operation-7-0)
Hot reload plugins for changes to the plugin list in configuration files or plugin source files to take effect.
## Service Discovery
* [`GET` Get Memory Dump `/v1/discovery/{service}/dump`](#fallback-operation-8-0)
Get the in-memory service and configuration data for a configured service discovery module. This endpoint exists only when the module implements runtime data dumping.
* [`GET` Get Dump File `/v1/discovery/{service}/show_dump_file`](#fallback-operation-8-1)
Read the persisted service discovery dump. This endpoint is currently provided by compatible service discovery modules such as Consul and exists only when the module is configured.
## Server Information
* [`GET` Get Server Information `/v1/server_info`](#fallback-operation-9-0)
Get information about the local APISIX instance. This endpoint is available only when the server-info plugin is enabled. The plugin is deprecated in APISIX 3.17.0.

The digital world is connected by APIs,
API7.ai exists to make APIs more efficient, reliable, and secure.
Sign up for API7 newsletter
[Email address]()Subscribe
Product
[API7 Gateway](https://api7.ai/enterprise)[AISIX AI Gateway](https://api7.ai/ai-gateway)[API7 API Portal](https://api7.ai/portal)
Learn
[API Gateway Guide](https://api7.ai/learning-center/api-gateway-guide)[Plugin Hub](https://docs.api7.ai/hub.md)[API Gateway Comparison](https://api7.ai/api-gateway-comparison)[Customers](https://api7.ai/customers)
Resources
[API Gateway Docs](https://docs.api7.ai/apisix/documentation.md)[APISIX AI Agent Skills](https://docs.api7.ai/apisix/ai-agent-skills.md)[API7 AI Agent Skills](https://docs.api7.ai/api7-gateway/ai-agent-skills.md)[Blog](https://api7.ai/blog)[Demo Hub](https://api7.ai/demos)[APISIX vs Kong](https://api7.ai/apisix-vs-kong)[AI Gateway Comparison](https://api7.ai/ai-gateway-comparison)
Company
[About](https://api7.ai/about)[Contact](https://api7.ai/contact)[Partners](https://api7.ai/partners)[Compliance Standards](https://api7.ai/compliance)[Brand Assets](https://api7.ai/branding)[Terms & Privacy](https://api7.ai/terms)
***
[](https://api7.ai/compliance)
[](https://api7.ai/compliance)
[](https://api7.ai/compliance)
[](https://api7.ai/compliance)
[](https://api7.ai/blog/among-2022-red-herring-top-100-global)
Copyright © APISEVEN PTE. LTD 2019 – 2026. Apache, Apache APISIX, APISIX, and associated open source project names are trademarks of the [Apache Software Foundation](https://www.apache.org/)
[](https://www.linkedin.com/company/api7-ai/)[](https://github.com/api7)[](https://twitter.com/api7_ai)
---
[Skip to main content](#__docusaurus_skipToContent_fallback)
[](https://api7.ai/)
ProductsSolutions[Customers](https://api7.ai/customers)
Pricing
Resources[Blog](https://api7.ai/blog)
[Login](https://console.api7.cloud)Get a DemoStart for Free
[](https://api7.ai/)
* Products
[API7 Gateway](https://api7.ai/enterprise)[- ](https://api7.ai/enterprise)
[API7 Gateway](https://api7.ai/enterprise)[- ](https://api7.ai/api7-enterprise-vs-apisix)
[Apache APISIX vs API7](https://api7.ai/api7-enterprise-vs-apisix)[- ](https://api7.ai/portal)
[API7 API Portal](https://api7.ai/portal)
[Apache APISIX](https://api7.ai/apisix)[- ](https://api7.ai/apisix)
[What's Apache APISIX?](https://api7.ai/apisix)[- ](https://api7.ai/blog/why-is-apache-apisix-the-best-api-gateway)
[Why Apache APISIX?](https://api7.ai/blog/why-is-apache-apisix-the-best-api-gateway)[- ](https://api7.ai/apache-apisix-enterprise-support)
[APISIX Commercial Support](https://api7.ai/apache-apisix-enterprise-support)
[AISIX AI Gateway](https://api7.ai/ai-gateway)[- ](https://api7.ai/ai-gateway)
[AISIX AI Gateway](https://api7.ai/ai-gateway)
* Solutions
[Developer](https://api7.ai/solutions/monolith-to-microservices)[- ](https://api7.ai/solutions/monolith-to-microservices)
[Monolith to Microservices](https://api7.ai/solutions/monolith-to-microservices)[- ](https://api7.ai/solutions/on-prem-to-hybrid-cloud)
[On-Prem to Hybrid Cloud](https://api7.ai/solutions/on-prem-to-hybrid-cloud)[- ](https://api7.ai/solutions/observability)
[Observability](https://api7.ai/solutions/observability)
[- ](https://api7.ai/solutions/vm-to-kubernetes)
[VM to Kubernetes](https://api7.ai/solutions/vm-to-kubernetes)[- ](https://api7.ai/solutions/zero-trust-security)
[Zero Trust Security](https://api7.ai/solutions/zero-trust-security)
[Industry](https://api7.ai/solutions/financial-services)[- ](https://api7.ai/solutions/financial-services)
[Financial Services](https://api7.ai/solutions/financial-services)[- ](https://api7.ai/solutions/iot)
[IoT and Automotive](https://api7.ai/solutions/iot)[- ](https://api7.ai/solutions/blockchain)
[Blockchain](https://api7.ai/solutions/blockchain)
[- ](https://api7.ai/solutions/manufacturing)
[Manufacturing](https://api7.ai/solutions/manufacturing)
* [Customers](https://api7.ai/customers)
* Pricing
[- ](https://api7.ai/pricing)
[API Gateway](https://api7.ai/pricing)[- ](https://api7.ai/ai-gateway/pricing)
[AI Gateway](https://api7.ai/ai-gateway/pricing)
* Resources
[Docs](https://docs.api7.ai/ai-gateway/.md)[- ](https://docs.api7.ai/ai-gateway/.md)
[AISIX Docs](https://docs.api7.ai/ai-gateway/.md)[- ](https://docs.api7.ai/api7-gateway)
[API7 Gateway](https://docs.api7.ai/api7-gateway)[- ](https://docs.api7.ai/api7-gateway/ai-agent-skills.md)
[API7 AI Agent Skills](https://docs.api7.ai/api7-gateway/ai-agent-skills.md)[- ](https://docs.api7.ai/apisix)
[Apache APISIX](https://docs.api7.ai/apisix)[- ](https://docs.api7.ai/apisix/ai-agent-skills.md)
[APISIX AI Agent Skills](https://docs.api7.ai/apisix/ai-agent-skills.md)
[Compare](https://api7.ai/apisix-vs-kong)[- ](https://api7.ai/apisix-vs-kong)
[Apache APISIX vs Kong](https://api7.ai/apisix-vs-kong)[- ](https://api7.ai/apisix-vs-nginx)
[Apache APISIX vs NGINX](https://api7.ai/apisix-vs-nginx)[- ](https://api7.ai/api-gateway-comparison)
[2026 Top API Gateway Comparison](https://api7.ai/api-gateway-comparison)[- ](https://api7.ai/ai-gateway-comparison)
[AI Gateway Comparison](https://api7.ai/ai-gateway-comparison)
[Learn](https://api7.ai/learning-center/openresty)[- ](https://api7.ai/learning-center/openresty)
[OpenResty (NGINX + Lua)](https://api7.ai/learning-center/openresty)[- ](https://api7.ai/learning-center/api-gateway-guide)
[API Gateway Guide](https://api7.ai/learning-center/api-gateway-guide)[- ](https://api7.ai/learning-center/ai-gateway-guide)
[AI Gateway Guide](https://api7.ai/learning-center/ai-gateway-guide)[- ](https://api7.ai/learning-center/api-infrastructure-guide)
[API Infrastructure Guide](https://api7.ai/learning-center/api-infrastructure-guide)
[Explore](https://api7.ai/demos)[- ](https://api7.ai/demos)
[Demo Hub](https://api7.ai/demos)[- ](https://docs.api7.ai/hub.md)
[Plugin Hub](https://docs.api7.ai/hub.md)[- ](https://api7.ai/category/usercase)
[Case Studies](https://api7.ai/category/usercase)
* [Blog](https://api7.ai/blog)
Get a DemoStart for Free
[](https://docs.api7.ai/)[Apache APISIX](https://docs.api7.ai/apisix/documentation.md)[API7 Gateway](https://docs.api7.ai/api7-gateway/overview.md)[Ingress Controller](https://docs.api7.ai/ingress-controller/documentation.md)[AISIX AI Gateway](https://docs.api7.ai/ai-gateway/.md)[Plugin Hub](https://docs.api7.ai/hub.md)
Search

# Welcome to API Gateway Plugin Hub

Discover powerful plugins to extend and enhance Apache APISIX’s capabilities for seamless API management
[Plugin Overview](https://docs.api7.ai/apisix/key-concepts/plugins.md)|[Common Configurations](https://docs.api7.ai/apisix/reference/plugin-common-configurations.md)
## AI[#](#ai)
[](https://docs.api7.ai/hub/ai-aliyun-content-moderation.md)
#### [AI Aliyun Content Moderation](https://docs.api7.ai/hub/ai-aliyun-content-moderation.md)
[The ai-aliyun-content-moderation plugin uses Aliyun to evaluate selected request roles and LLM responses, including streaming responses, against a risk threshold.](https://docs.api7.ai/hub/ai-aliyun-content-moderation.md)
[](https://docs.api7.ai/hub/ai-aws-content-moderation.md)
#### [AI AWS Content Moderation](https://docs.api7.ai/hub/ai-aws-content-moderation.md)
[The ai-aws-content-moderation plugin uses Amazon Comprehend to detect toxicity in selected request roles and LLM responses, including streaming responses.](https://docs.api7.ai/hub/ai-aws-content-moderation.md)
[](https://docs.api7.ai/hub/ai-cache.md)
#### [AI Cache](https://docs.api7.ai/hub/ai-cache.md)
[The ai-cache plugin stores exact and semantically similar LLM responses in Redis, reducing response latency and repeated upstream model usage.](https://docs.api7.ai/hub/ai-cache.md)
[](https://docs.api7.ai/hub/ai-lakera-guard.md)
#### [AI Lakera Guard](https://docs.api7.ai/hub/ai-lakera-guard.md)
[The ai-lakera-guard plugin screens AI traffic through the Lakera Guard API to detect prompt injection and other unsafe content in requests and LLM responses.](https://docs.api7.ai/hub/ai-lakera-guard.md)
[](https://docs.api7.ai/hub/ai-prompt-decorator.md)
#### [AI Prompt Decorator](https://docs.api7.ai/hub/ai-prompt-decorator.md)
[The ai-prompt-decorator plugin decorates user prompts to LLMs by prefixing and appending pre-engineered prompts, streamlining API operation and content generation.](https://docs.api7.ai/hub/ai-prompt-decorator.md)
[](https://docs.api7.ai/hub/ai-prompt-template.md)
#### [AI Prompt Template](https://docs.api7.ai/hub/ai-prompt-template.md)
[The ai-prompt-template plugin supports pre-configured templates for user inputs to LLMs in a "fill in the blank" fashion, streamlining API management.](https://docs.api7.ai/hub/ai-prompt-template.md)
[](https://docs.api7.ai/hub/ai-rag.md)
#### [AI RAG](https://docs.api7.ai/hub/ai-rag.md)
[The ai-rag plugin retrieves context with Azure OpenAI embeddings and Azure AI Search before an LLM request is proxied.](https://docs.api7.ai/hub/ai-rag.md)
[](https://docs.api7.ai/hub/ai-proxy.md)
#### [AI Proxy](https://docs.api7.ai/hub/ai-proxy.md)
[The ai-proxy plugin simplifies access to LLM and embedding models providers by converting plugin configurations into the required request format for OpenAI, DeepSeek, Anthropic, and other OpenAI-compatible APIs.](https://docs.api7.ai/hub/ai-proxy.md)
[](https://docs.api7.ai/hub/ai-prompt-guard.md)
#### [AI Prompt Guard](https://docs.api7.ai/hub/ai-prompt-guard.md)
[The ai-prompt-guard plugin safeguards prompts to LLM using allow/deny patterns, ensuring only approved inputs pass. It can check the latest message or full history.](https://docs.api7.ai/hub/ai-prompt-guard.md)
[](https://docs.api7.ai/hub/ai-proxy-multi.md)
#### [AI Proxy Multi](https://docs.api7.ai/hub/ai-proxy-multi.md)
[The ai-proxy-multi plugin extends the capabilities of ai-proxy with load balancing, retries, fallbacks, and health checks, simplifying the integration with OpenAI, DeepSeek, and other OpenAI-compatible APIs.](https://docs.api7.ai/hub/ai-proxy-multi.md)
[](https://docs.api7.ai/hub/ai-rate-limiting.md)
#### [AI Rate Limiting](https://docs.api7.ai/hub/ai-rate-limiting.md)
[The ai-rate-limiting plugin enforces token-based rate limiting for LLM service requests, preventing overuse, optimizing API consumption, and ensuring efficient resource allocation.](https://docs.api7.ai/hub/ai-rate-limiting.md)
[](https://docs.api7.ai/hub/ai-request-rewrite.md)
#### [AI Request Rewrite](https://docs.api7.ai/hub/ai-request-rewrite.md)
[The ai-request-rewrite plugin forwards client requests to LLM services for processing before sending them upstream, enabling AI-driven redaction, enrichment, and reformatting.](https://docs.api7.ai/hub/ai-request-rewrite.md)
[Enterprise](https://docs.api7.ai/hub/openapi-to-mcp.md)
#### [OpenAPI to MCP](https://docs.api7.ai/hub/openapi-to-mcp.md)
[The openapi-to-mcp plugin lets API7 expose OpenAPI services through MCP, proxy requests with custom headers, and support real-time SSE streaming.](https://docs.api7.ai/hub/openapi-to-mcp.md)
## Traffic Management[#](#traffic-management)
[](https://docs.api7.ai/hub/graphql-limit-count.md)
#### [GraphQL Limit Count](https://docs.api7.ai/hub/graphql-limit-count.md)
[The graphql-limit-count plugin uses fixed windows to limit accumulated GraphQL document cost, with selection depth as the default measure.](https://docs.api7.ai/hub/graphql-limit-count.md)
[](https://docs.api7.ai/hub/graphql-proxy-cache.md)
#### [GraphQL Proxy Cache](https://docs.api7.ai/hub/graphql-proxy-cache.md)
[The graphql-proxy-cache plugin enables caching of responses for GraphQL queries, improving API performance.](https://docs.api7.ai/hub/graphql-proxy-cache.md)
[Enterprise](https://docs.api7.ai/hub/limit-count-advanced.md)
#### [Limit Count Advanced](https://docs.api7.ai/hub/limit-count-advanced.md)
[The limit-count-advanced plugin enforces API rate limiting with a fixed window or sliding window algorithm, restricting requests within a time window. Requests over the quota are rejected.](https://docs.api7.ai/hub/limit-count-advanced.md)
[](https://docs.api7.ai/hub/limit-req.md)
#### [Limit Req](https://docs.api7.ai/hub/limit-req.md)
[The limit-req plugin enforces API rate limiting with a leaky bucket algorithm to rate limit requests, enabling effective throttling to manage traffic flow.](https://docs.api7.ai/hub/limit-req.md)
[](https://docs.api7.ai/hub/limit-conn.md)
#### [Limit Conn](https://docs.api7.ai/hub/limit-conn.md)
[The limit-conn plugin restricts the rate of requests by managing concurrent connections. Requests exceeding the threshold may be delayed or rejected, ensuring controlled API usage and preventing overload.](https://docs.api7.ai/hub/limit-conn.md)
[](https://docs.api7.ai/hub/limit-count.md)
#### [Limit Count](https://docs.api7.ai/hub/limit-count.md)
[The limit-count plugin enforces API rate limiting with a fixed window algorithm, restricting requests within a time interval. Requests over the quota are rejected.](https://docs.api7.ai/hub/limit-count.md)
[](https://docs.api7.ai/hub/oas-validator.md)
#### [OAS Validator](https://docs.api7.ai/hub/oas-validator.md)
[The oas-validator plugin checks incoming HTTP requests against an OpenAPI specification before they are forwarded to upstream services.](https://docs.api7.ai/hub/oas-validator.md)
[](https://docs.api7.ai/hub/proxy-buffering.md)
#### [Proxy Buffering](https://docs.api7.ai/hub/proxy-buffering.md)
[The proxy-buffering plugin dynamically disables NGINX proxy buffering, optimizing performance with SSE and other streaming upstream services in API gateway.](https://docs.api7.ai/hub/proxy-buffering.md)
[](https://docs.api7.ai/hub/proxy-cache.md)
#### [Proxy Cache](https://docs.api7.ai/hub/proxy-cache.md)
[The proxy-cache plugin caches responses based on keys, supporting disk and memory caching for GET, POST, and HEAD requests, enhancing API performance.](https://docs.api7.ai/hub/proxy-cache.md)
[](https://docs.api7.ai/hub/proxy-mirror.md)
#### [Proxy Mirror](https://docs.api7.ai/hub/proxy-mirror.md)
[The proxy-mirror plugin duplicates ingress traffic to API gateway, forwarding it to a designated upstream while keeping regular services uninterrupted.](https://docs.api7.ai/hub/proxy-mirror.md)
[](https://docs.api7.ai/hub/request-id.md)
#### [Request ID](https://docs.api7.ai/hub/request-id.md)
[The request-id plugin adds a unique ID to each request proxied through the API gateway, facilitating effective tracking of API requests for better API management.](https://docs.api7.ai/hub/request-id.md)
[](https://docs.api7.ai/hub/request-validation.md)
#### [Request Validation](https://docs.api7.ai/hub/request-validation.md)
[The request-validation plugin checks requests for compliance before forwarding them to upstream services, enhancing security in API operations.](https://docs.api7.ai/hub/request-validation.md)
[](https://docs.api7.ai/hub/traffic-label.md)
#### [Traffic Label](https://docs.api7.ai/hub/traffic-label.md)
[The traffic-label plugin labels traffic based on user-defined rules, enabling actions based on labels and associated weights for improved API traffic management.](https://docs.api7.ai/hub/traffic-label.md)
[](https://docs.api7.ai/hub/workflow.md)
#### [Workflow](https://docs.api7.ai/hub/workflow.md)
[The workflow plugin enables conditional execution of user-defined actions on client traffic based on specific rules, allowing granular API traffic management.](https://docs.api7.ai/hub/workflow.md)
[](https://docs.api7.ai/hub/traffic-split.md)
#### [Traffic Split](https://docs.api7.ai/hub/traffic-split.md)
[The traffic-split plugin directs traffic to multiple upstream services based on conditions or weights, providing a flexible approach for API release strategies and traffic management.](https://docs.api7.ai/hub/traffic-split.md)
## Transformation[#](#transformation)
[](https://docs.api7.ai/hub/attach-consumer-label.md)
#### [Attach Consumer Label](https://docs.api7.ai/hub/attach-consumer-label.md)
[The attach-consumer-label plugin attaches custom consumer labels to authenticated requests, for upstream services to implement additional business logics.](https://docs.api7.ai/hub/attach-consumer-label.md)
[](https://docs.api7.ai/hub/body-transformer.md)
#### [Body Transformer](https://docs.api7.ai/hub/body-transformer.md)
[The body-transformer plugin converts request and response bodies between formats, such as JSON to XML, facilitating seamless data exchange.](https://docs.api7.ai/hub/body-transformer.md)
[](https://docs.api7.ai/hub/degraphql.md)
#### [degraphql](https://docs.api7.ai/hub/degraphql.md)
[The degraphql plugin enables communication with upstream GraphQL services through standard HTTP requests by mapping GraphQL queries to HTTP endpoints, simplifying API integration.](https://docs.api7.ai/hub/degraphql.md)
[](https://docs.api7.ai/hub/exit-transformer.md)
#### [Exit transformer](https://docs.api7.ai/hub/exit-transformer.md)
[The exit-transformer plugin customizes responses generated by gateway plugins or missing routes before APISIX sends them to clients.](https://docs.api7.ai/hub/exit-transformer.md)
[](https://docs.api7.ai/hub/fault-injection.md)
#### [Fault Injection](https://docs.api7.ai/hub/fault-injection.md)
[The fault-injection plugin tests application resiliency by simulating controlled faults or delays, making it ideal for chaos engineering and failure condition analysis.](https://docs.api7.ai/hub/fault-injection.md)
[](https://docs.api7.ai/hub/grpc-transcode.md)
#### [gRPC Transcode](https://docs.api7.ai/hub/grpc-transcode.md)
[The grpc-transcode plugin converts between HTTP and gRPC requests and responses, facilitating seamless communication between different API protocols.](https://docs.api7.ai/hub/grpc-transcode.md)
[](https://docs.api7.ai/hub/grpc-web.md)
#### [gRPC Web](https://docs.api7.ai/hub/grpc-web.md)
[The grpc-web plugin enables the gateway to handle gRPC-Web requests from browsers and JavaScript clients by translating them into standard gRPC calls and forwarding them to upstream gRPC services.](https://docs.api7.ai/hub/grpc-web.md)
[](https://docs.api7.ai/hub/mocking.md)
#### [Mocking](https://docs.api7.ai/hub/mocking.md)
[The mocking plugin simulates API responses without forwarding requests to upstream services, offering customization of status codes, response bodies, headers, and more for API testing and development.](https://docs.api7.ai/hub/mocking.md)
[](https://docs.api7.ai/hub/proxy-rewrite.md)
#### [Proxy Rewrite](https://docs.api7.ai/hub/proxy-rewrite.md)
[The proxy-rewrite plugin offers flexible options to rewrite requests that API gateway forwards to upstream services, enhancing API management.](https://docs.api7.ai/hub/proxy-rewrite.md)
[](https://docs.api7.ai/hub/response-rewrite.md)
#### [Response Rewrite](https://docs.api7.ai/hub/response-rewrite.md)
[The response-rewrite plugin allows rewriting of responses from API gateway and upstream services, providing flexibility in API responses.](https://docs.api7.ai/hub/response-rewrite.md)
[Enterprise](https://docs.api7.ai/hub/soap.md)
#### [SOAP](https://docs.api7.ai/hub/soap.md)
[The soap plugin simplifies transformation between RESTful HTTP requests and SOAP requests, including their corresponding responses, for better API interoperability.](https://docs.api7.ai/hub/soap.md)
## Authentication[#](#authentication)
[](https://docs.api7.ai/hub/authz-keycloak.md)
#### [Authz Keycloak](https://docs.api7.ai/hub/authz-keycloak.md)
[The authz-keycloak plugin integrates with Keycloak for user authentication and authorization, enhancing API security and management.](https://docs.api7.ai/hub/authz-keycloak.md)
[](https://docs.api7.ai/hub/basic-auth.md)
#### [Basic Auth](https://docs.api7.ai/hub/basic-auth.md)
[The basic-auth plugin provides basic access authentication, requiring clients to authenticate before accessing upstream resources, enhancing API security.](https://docs.api7.ai/hub/basic-auth.md)
[](https://docs.api7.ai/hub/forward-auth.md)
#### [Forward Auth](https://docs.api7.ai/hub/forward-auth.md)
[The forward-auth plugin integrates with external authorization services, enhancing API security and access control.](https://docs.api7.ai/hub/forward-auth.md)
[](https://docs.api7.ai/hub/jwt-auth.md)
#### [JWT Auth](https://docs.api7.ai/hub/jwt-auth.md)
[The jwt-auth plugin supports the use of JSON Web Token (JWT) for client authentication before accessing upstream resources, enhancing API security measures.](https://docs.api7.ai/hub/jwt-auth.md)
[](https://docs.api7.ai/hub/jwe-decrypt.md)
#### [JWE Decrypt](https://docs.api7.ai/hub/jwe-decrypt.md)
[The jwe-decrypt plugin decrypts its supported five-part compact token format and forwards the plaintext in a configured request header.](https://docs.api7.ai/hub/jwe-decrypt.md)
[](https://docs.api7.ai/hub/key-auth.md)
#### [Key Auth](https://docs.api7.ai/hub/key-auth.md)
[The key-auth plugin allows clients to authenticate using an authentication key before accessing upstream resources, enhancing API security measures.](https://docs.api7.ai/hub/key-auth.md)
[](https://docs.api7.ai/hub/hmac-auth.md)
#### [HMAC Auth](https://docs.api7.ai/hub/hmac-auth.md)
[The hmac-auth plugin supports HMAC authentication to ensure request integrity, preventing modifications during transmission and enhancing API security.](https://docs.api7.ai/hub/hmac-auth.md)
[](https://docs.api7.ai/hub/ldap-auth-advanced.md)
#### [LDAP Auth Advanced](https://docs.api7.ai/hub/ldap-auth-advanced.md)
[The ldap-auth-advanced plugin authenticates clients against an LDAP directory and maps the authenticated user onto a consumer, so directory identities can be used with per-consumer plugins, rate limits, and analytics.](https://docs.api7.ai/hub/ldap-auth-advanced.md)
[](https://docs.api7.ai/hub/multi-auth.md)
#### [Multi Auth](https://docs.api7.ai/hub/multi-auth.md)
[The multi-auth plugin enables consumers using diverse authentication methods to share the same route or service, streamlining API lifecycle management.](https://docs.api7.ai/hub/multi-auth.md)
[](https://docs.api7.ai/hub/openid-connect.md)
#### [OpenID Connect](https://docs.api7.ai/hub/openid-connect.md)
[The openid-connect plugin integrates with OIDC providers like Keycloak and Auth0, simplifying user authentication in API management.](https://docs.api7.ai/hub/openid-connect.md)
[](https://docs.api7.ai/hub/saml-auth.md)
#### [SAML Auth](https://docs.api7.ai/hub/saml-auth.md)
[The saml-auth plugin enables user authentication via SAML 2.0 in the API gateway by interacting with identity providers (IdP), enhancing API security.](https://docs.api7.ai/hub/saml-auth.md)
[](https://docs.api7.ai/hub/opa.md)
#### [OPA](https://docs.api7.ai/hub/opa.md)
[The opa plugin integrates with Open Policy Agent, enabling unified policy definition and enforcement for authorization in API operations.](https://docs.api7.ai/hub/opa.md)
## Security[#](#security)
[](https://docs.api7.ai/hub/acl.md)
#### [ACL](https://docs.api7.ai/hub/acl.md)
[The acl plugin controls access to upstream resources by verifying if the user is on the access control lists, enhancing API management.](https://docs.api7.ai/hub/acl.md)
[](https://docs.api7.ai/hub/chaitin-waf.md)
#### [Chaitin WAF](https://docs.api7.ai/hub/chaitin-waf.md)
[The chaitin-waf plugin integrates with Chaitin WAF (SafeLine) to detect and block web threats, strengthening application security and protecting user data.](https://docs.api7.ai/hub/chaitin-waf.md)
[](https://docs.api7.ai/hub/cors.md)
#### [CORS](https://docs.api7.ai/hub/cors.md)
[The cors plugin enables cross-origin resource sharing, allowing servers to specify permitted origins and instructing browsers to load resources from those origins, enhancing API accessibility.](https://docs.api7.ai/hub/cors.md)
[](https://docs.api7.ai/hub/data-mask.md)
#### [Data Mask](https://docs.api7.ai/hub/data-mask.md)
[The data-mask plugin removes or replaces sensitive information in request headers, bodies, and URL queries for logging purposes, enhancing data privacy and security.](https://docs.api7.ai/hub/data-mask.md)
[](https://docs.api7.ai/hub/consumer-restriction.md)
#### [Consumer Restriction](https://docs.api7.ai/hub/consumer-restriction.md)
[The consumer-restriction plugin implements access controls based on consumer name, route ID, service ID, or consumer group ID, enhancing API security.](https://docs.api7.ai/hub/consumer-restriction.md)
[](https://docs.api7.ai/hub/ip-restriction.md)
#### [IP Restriction](https://docs.api7.ai/hub/ip-restriction.md)
[The ip-restriction plugin restricts access to upstream resources based on an IP address whitelist or blacklist, improving API security.](https://docs.api7.ai/hub/ip-restriction.md)
[Enterprise](https://docs.api7.ai/hub/mcp-tools-acl.md)
#### [MCP Tools ACL](https://docs.api7.ai/hub/mcp-tools-acl.md)
[The mcp-tools-acl plugin provides per-consumer access control for MCP tool calls on routes powered by openapi-to-mcp, supporting rule-based allowlist and denylist modes with optional expression conditions.](https://docs.api7.ai/hub/mcp-tools-acl.md)
[](https://docs.api7.ai/hub/ua-restriction.md)
#### [UA Restriction](https://docs.api7.ai/hub/ua-restriction.md)
[The ua-restriction plugin restricts access to upstream resources using an allowlist or denylist of user agents, preventing overload from web crawlers and enhancing API security.](https://docs.api7.ai/hub/ua-restriction.md)
## Observability[#](#observability)
[](https://docs.api7.ai/hub/clickhouse-logger.md)
#### [ClickHouse Logger](https://docs.api7.ai/hub/clickhouse-logger.md)
[The clickhouse-logger plugin pushes request and response logs to ClickHouse databases in batches, allowing for customizable log formats to enhance data management.](https://docs.api7.ai/hub/clickhouse-logger.md)
[](https://docs.api7.ai/hub/datadog.md)
#### [Datadog](https://docs.api7.ai/hub/datadog.md)
[The datadog plugin integrates with Datadog, sending metrics to DogStatsD in batches to improve API monitoring and API performance tracking.](https://docs.api7.ai/hub/datadog.md)
[](https://docs.api7.ai/hub/elasticsearch-logger.md)
#### [Elasticsearch Logger](https://docs.api7.ai/hub/elasticsearch-logger.md)
[The elasticsearch-logger plugin pushes request and response logs in batches to Elasticsearch, allowing for customizable log formats to enhance data management.](https://docs.api7.ai/hub/elasticsearch-logger.md)
[Enterprise](https://docs.api7.ai/hub/error-log-collect.md)
#### [Error Log Collect](https://docs.api7.ai/hub/error-log-collect.md)
[The error-log-collect plugin captures the error logs produced while processing selected requests, including lower-severity entries that the configured log level would otherwise discard, and writes them to the gateway error log for targeted debugging.](https://docs.api7.ai/hub/error-log-collect.md)
[](https://docs.api7.ai/hub/error-log-logger.md)
#### [Error Log Logger](https://docs.api7.ai/hub/error-log-logger.md)
[The error-log-logger plugin pushes APISIX's error logs to TCP, Apache SkyWalking, Apache Kafka, or ClickHouse servers, in batches. You can specify the severity level of which the plugin should send the corresponding logs.](https://docs.api7.ai/hub/error-log-logger.md)
[](https://docs.api7.ai/hub/google-cloud-logging.md)
#### [Google Cloud Logging](https://docs.api7.ai/hub/google-cloud-logging.md)
[The google-cloud-logging plugin pushes request and response logs in batches to Google Cloud Logging Service and supports the customization of log formats.](https://docs.api7.ai/hub/google-cloud-logging.md)
[](https://docs.api7.ai/hub/http-logger.md)
#### [HTTP Logger](https://docs.api7.ai/hub/http-logger.md)
[The http-logger plugin pushes request and response logs as JSON objects to HTTP(S) servers in batches, allowing for customizable log formats to enhance data management.](https://docs.api7.ai/hub/http-logger.md)
[](https://docs.api7.ai/hub/kafka-logger.md)
#### [Kafka Logger](https://docs.api7.ai/hub/kafka-logger.md)
[The kafka-logger plugin pushes request and response logs as JSON objects to Apache Kafka clusters in batches, allowing for customizable log formats to enhance data management.](https://docs.api7.ai/hub/kafka-logger.md)
[](https://docs.api7.ai/hub/loki-logger.md)
#### [Loki Logger](https://docs.api7.ai/hub/loki-logger.md)
[The loki-logger plugin sends request and response logs as JSON objects to Grafana Loki in batches via the Loki HTTP API, allowing for customizable log formats to enhance data management.](https://docs.api7.ai/hub/loki-logger.md)
[](https://docs.api7.ai/hub/prometheus.md)
#### [Prometheus](https://docs.api7.ai/hub/prometheus.md)
[The Prometheus plugin integrates with Prometheus for metric collection and continuous monitoring, enhancing API observability.](https://docs.api7.ai/hub/prometheus.md)
[](https://docs.api7.ai/hub/opentelemetry.md)
#### [OpenTelemetry](https://docs.api7.ai/hub/opentelemetry.md)
[The opentelemetry plugin instruments the API gateway, sending traces to the OpenTelemetry collector for monitoring API operations per OpenTelemetry specs.](https://docs.api7.ai/hub/opentelemetry.md)
[](https://docs.api7.ai/hub/rocketmq-logger.md)
#### [RocketMQ Logger](https://docs.api7.ai/hub/rocketmq-logger.md)
[The rocketmq-logger plugin pushes request and response logs as JSON objects to RocketMQ clusters in batches, allowing for customizable log formats to enhance data management.](https://docs.api7.ai/hub/rocketmq-logger.md)
[](https://docs.api7.ai/hub/skywalking-logger.md)
#### [SkyWalking Logger](https://docs.api7.ai/hub/skywalking-logger.md)
[The skywalking-logger pushes request and response logs as JSON objects to SkyWalking OAP server in batches, allowing for customizable log formats to enhance data management.](https://docs.api7.ai/hub/skywalking-logger.md)
[](https://docs.api7.ai/hub/syslog.md)
#### [syslog](https://docs.api7.ai/hub/syslog.md)
[The syslog plugin pushes request and response logs as JSON objects to syslog servers in batches, allowing for customizable log formats to enhance data management.](https://docs.api7.ai/hub/syslog.md)
[](https://docs.api7.ai/hub/skywalking.md)
#### [SkyWalking](https://docs.api7.ai/hub/skywalking.md)
[The skywalking plugin integrates with Apache SkyWalking for effective request tracing, enhancing API observability.](https://docs.api7.ai/hub/skywalking.md)
[](https://docs.api7.ai/hub/splunk-hec-logging.md)
#### [Splunk HEC Logging](https://docs.api7.ai/hub/splunk-hec-logging.md)
[The splunk-hec-logging plugin serializes request and response context information to Splunk Event Data format and push to your Splunk HTTP Event Collector (HEC) in batches, allowing for customizable log formats to enhance data management.](https://docs.api7.ai/hub/splunk-hec-logging.md)
[](https://docs.api7.ai/hub/zipkin.md)
#### [Zipkin](https://docs.api7.ai/hub/zipkin.md)
[The zipkin plugin instruments the API gateway to send traces to Zipkin or compatible collectors like Jaeger and Apache SkyWalking, enhancing request tracing capabilities.](https://docs.api7.ai/hub/zipkin.md)
## General[#](#general)
[](https://docs.api7.ai/hub/error-page.md)
#### [Error Page](https://docs.api7.ai/hub/error-page.md)
[The error-page plugin customizes gateway-generated 404, 500, 502, and 503 responses without modifying responses returned by upstream services.](https://docs.api7.ai/hub/error-page.md)
[](https://docs.api7.ai/hub/public-api.md)
#### [Public API](https://docs.api7.ai/hub/public-api.md)
[The public-api plugin exposes internal API endpoints, allowing external access while maintaining control over API management and security.](https://docs.api7.ai/hub/public-api.md)
[](https://docs.api7.ai/hub/real-ip.md)
#### [Real IP](https://docs.api7.ai/hub/real-ip.md)
[The real-ip plugin enables the API gateway to fetch the client's real IP using the IP address from the HTTP header or query string, improving data quality.](https://docs.api7.ai/hub/real-ip.md)
## Serverless[#](#serverless)
[](https://docs.api7.ai/hub/aws-lambda.md)
#### [AWS Lambda](https://docs.api7.ai/hub/aws-lambda.md)
[The aws-lambda plugin simplifies APISIX integration with AWS Lambda and Amazon API gateway, supporting authentication via IAM user credentials and API keys.](https://docs.api7.ai/hub/aws-lambda.md)
[](https://docs.api7.ai/hub/serverless-functions.md)
#### [Serverless Functions](https://docs.api7.ai/hub/serverless-functions.md)
[The serverless function plugins (pre-function and post-function) allow execution of user-defined logic at the start or end of specified execution phases in API gateway.](https://docs.api7.ai/hub/serverless-functions.md)
## Other Protocols[#](#other-protocols)
[](https://docs.api7.ai/hub/mqtt-proxy.md)
#### [MQTT Proxy](https://docs.api7.ai/hub/mqtt-proxy.md)
[The mqtt-proxy plugin supports proxying and load balancing MQTT requests to MQTT servers, enhancing API operation and management.](https://docs.api7.ai/hub/mqtt-proxy.md)

The digital world is connected by APIs,
API7.ai exists to make APIs more efficient, reliable, and secure.
Sign up for API7 newsletter
[Email address]()Subscribe
Product
[API7 Gateway](https://api7.ai/enterprise)[AISIX AI Gateway](https://api7.ai/ai-gateway)[API7 API Portal](https://api7.ai/portal)
Learn
[API Gateway Guide](https://api7.ai/learning-center/api-gateway-guide)[Plugin Hub](https://docs.api7.ai/hub.md)[API Gateway Comparison](https://api7.ai/api-gateway-comparison)[Customers](https://api7.ai/customers)
Resources
[API Gateway Docs](https://docs.api7.ai/apisix/documentation.md)[APISIX AI Agent Skills](https://docs.api7.ai/apisix/ai-agent-skills.md)[API7 AI Agent Skills](https://docs.api7.ai/api7-gateway/ai-agent-skills.md)[Blog](https://api7.ai/blog)[Demo Hub](https://api7.ai/demos)[APISIX vs Kong](https://api7.ai/apisix-vs-kong)[AI Gateway Comparison](https://api7.ai/ai-gateway-comparison)
Company
[About](https://api7.ai/about)[Contact](https://api7.ai/contact)[Partners](https://api7.ai/partners)[Compliance Standards](https://api7.ai/compliance)[Brand Assets](https://api7.ai/branding)[Terms & Privacy](https://api7.ai/terms)
***
[](https://api7.ai/compliance)
[](https://api7.ai/compliance)
[](https://api7.ai/compliance)
[](https://api7.ai/compliance)
[](https://api7.ai/blog/among-2022-red-herring-top-100-global)
Copyright © APISEVEN PTE. LTD 2019 – 2026. Apache, Apache APISIX, APISIX, and associated open source project names are trademarks of the [Apache Software Foundation](https://www.apache.org/)
[](https://www.linkedin.com/company/api7-ai/)[](https://github.com/api7)[](https://twitter.com/api7_ai)
---
# acl
The `acl` plugin allows or denies request access to upstream resources by verifying whether the user initiating the request is in the access control lists.
## Examples[](#examples "Direct link to Examples")
The examples below demonstrate how you can use the `acl` plugin for different scenarios.
### Control Access by Examining Consumer Labels[](#control-access-by-examining-consumer-labels "Direct link to Control Access by Examining Consumer Labels")
The following example demonstrates how to control consumer access based on consumer labels, upon a successful authentication.
* Admin API
* ADC
* Ingress Controller
Create two consumers, `john` and `jane`, each with their own labels for organizations and projects:
```
curl "http://127.0.0.1:9180/apisix/admin/consumers" -X PUT \
-H "X-API-KEY: ${ADMIN_API_KEY}" \
-d '{
"username": "john",
"labels": {
"org": "[\"opensource\",\"apache\"]",
"project": "[\"tomcat\",\"web-server\",\"http,server\"]"
}
}'
```
```
curl "http://127.0.0.1:9180/apisix/admin/consumers" -X PUT \
-H "X-API-KEY: ${ADMIN_API_KEY}" \
-d '{
"username": "jane",
"labels": {
"org": "apache",
"project": "gateway,apisix,web-server"
}
}'
```
Create `key-auth` credentials for `john` and `jane`:
```
curl "http://127.0.0.1:9180/apisix/admin/consumers/john/credentials" -X PUT \
-H "X-API-KEY: ${ADMIN_API_KEY}" \
-d '{
"id": "cred-john-key-auth",
"plugins": {
"key-auth": {
"key": "john-key"
}
}
}'
```
```
curl "http://127.0.0.1:9180/apisix/admin/consumers/jane/credentials" -X PUT \
-H "X-API-KEY: ${ADMIN_API_KEY}" \
-d '{
"id": "cred-jane-key-auth",
"plugins": {
"key-auth": {
"key": "jane-key"
}
}
}'
```
tip
Consumer labels can be configured with either of the two approaches:
1. comma-separated string value, such as `{"project": "gateway,apisix"}`
2. character escaped string array,such as `{"project": "[\"gateway\",\"apisix\"]"}`
Create a route with `key-auth` enabled, and configure the `acl` plugin:
```
curl "http://127.0.0.1:9180/apisix/admin/routes" -X PUT \
-H "X-API-KEY: ${ADMIN_API_KEY}" \
-d '{
"id": "acl-route",
"uri": "/get",
"plugins": {
"key-auth": {},
"acl": {
"allow_labels": {
"org": ["opensource"]
}
}
},
"upstream": {
"type": "roundrobin",
"nodes": {
"httpbin.org:80": 1
}
}
}'
```
❶ Allow only consumers with `org` label value `opensource` to access the upstream resource.
Create two consumers, `john` and `jane`, each with their own labels, credentials, and a route with `key-auth` and `acl` plugins configured:
adc.yaml
```
consumers:
- username: john
labels:
org: "[\"opensource\",\"apache\"]"
project: "[\"tomcat\",\"web-server\",\"http,server\"]"
credentials:
- name: cred-john-key-auth
type: key-auth
config:
key: john-key
- username: jane
labels:
org: "apache"
project: "gateway,apisix,web-server"
credentials:
- name: cred-jane-key-auth
type: key-auth
config:
key: jane-key
services:
- name: acl-service
routes:
- name: acl-route
uris:
- /get
plugins:
key-auth: {}
acl:
allow_labels:
org:
- opensource
upstream:
type: roundrobin
nodes:
- host: httpbin.org
port: 80
weight: 1
```
❶ Consumer labels can be configured with either of the two approaches: comma-separated string value, such as `"apache"`, or character escaped string array, such as `"[\"opensource\",\"apache\"]"`.
❷ Allow only consumers with `org` label value `opensource` to access the upstream resource.
Synchronize the configuration to the gateway:
```
adc sync -f adc.yaml
```
* Gateway API
* APISIX CRD
Create two labeled consumers and attach the `acl` plugin through a `PluginConfig` referenced by `HTTPRoute`:
acl-gateway-api.yaml
```
apiVersion: apisix.apache.org/v2
kind: ApisixConsumer
metadata:
namespace: aic
name: john
labels:
org: opensource
spec:
ingressClassName: apisix
authParameter:
keyAuth:
value:
key: john-key
---
apiVersion: apisix.apache.org/v2
kind: ApisixConsumer
metadata:
namespace: aic
name: jane
labels:
org: apache
spec:
ingressClassName: apisix
authParameter:
keyAuth:
value:
key: jane-key
---
apiVersion: v1
kind: Service
metadata:
namespace: aic
name: httpbin-external-domain
spec:
type: ExternalName
externalName: httpbin.org
---
apiVersion: apisix.apache.org/v1alpha1
kind: PluginConfig
metadata:
namespace: aic
name: acl-plugin-config
spec:
plugins:
- name: key-auth
config: {}
- name: acl
config:
allow_labels:
org:
- opensource
---
apiVersion: gateway.networking.k8s.io/v1
kind: HTTPRoute
metadata:
namespace: aic
name: acl-route
spec:
parentRefs:
- name: apisix
rules:
- matches:
- path:
type: Exact
value: /get
filters:
- type: ExtensionRef
extensionRef:
group: apisix.apache.org
kind: PluginConfig
name: acl-plugin-config
backendRefs:
- name: httpbin-external-domain
port: 80
```
Apply the configuration to your cluster:
```
kubectl apply -f acl-gateway-api.yaml
```
Create two labeled consumers and apply the `acl` plugin through an `ApisixRoute`:
acl-apisix-crd.yaml
```
apiVersion: apisix.apache.org/v2
kind: ApisixConsumer
metadata:
namespace: aic
name: john
labels:
org: opensource
spec:
ingressClassName: apisix
authParameter:
keyAuth:
value:
key: john-key
---
apiVersion: apisix.apache.org/v2
kind: ApisixConsumer
metadata:
namespace: aic
name: jane
labels:
org: apache
spec:
ingressClassName: apisix
authParameter:
keyAuth:
value:
key: jane-key
---
apiVersion: apisix.apache.org/v2
kind: ApisixRoute
metadata:
namespace: aic
name: acl-route
spec:
ingressClassName: apisix
http:
- name: acl
match:
paths:
- /get
backends:
- serviceName: httpbin
servicePort: 80
plugins:
- name: key-auth
config: {}
- name: acl
config:
allow_labels:
org:
- opensource
```
Apply the configuration to your cluster:
```
kubectl apply -f acl-apisix-crd.yaml
```
Send a request to the route as consumer `jane`:
```
curl -i "http://127.0.0.1:9080/get" -H 'apikey: jane-key'
```
You should see an `HTTP/1.1 403 Forbidden` response, as consumer `jane` was not configured with the required label to access the route.
Send a request to the route as consumer `john`:
```
curl -i "http://127.0.0.1:9080/get" -H 'apikey: john-key'
```
You should see an `HTTP/1.1 200 OK` response, as consumer `john` was configured with the required label to access the route.
### Control Access by Examining User Information from External Identity Provider[](#control-access-by-examining-user-information-from-external-identity-provider "Direct link to Control Access by Examining User Information from External Identity Provider")
The following example demonstrates how to control user access based on user labels, upon a successful authentication with an external identity provider. Specifically, the example uses Keycloak and user groups as labels.
Follow the steps in [set up SSO with Keycloak how-to guide](https://docs.api7.ai/apisix/how-to-guide/authentication/set-up-sso-with-keycloak.md) to create a realm, a client, and a user.
Go to **Groups** and create two new groups, `apisix` and `opensource`:

To add the user to group memberships, click into the user and go to the **Groups** tab. Select each group in turn and click **join**:

To include the group membership when user info is requested from Keycloak, go to the client and go to the **Mappers** tab. Create a new mapper:

Fill in the name for the protocol mapper, select **Group Membership** as the mapper type, use `groups` as the token claim name, and click **Save**:

To verify if the attribute will be visible when requesting user info, first obtain an access token from Keycloak:
```
OIDC_USER=quickstart-user
OIDC_PASSWORD=quickstart-user-pass
OIDC_CLIENT_ID=apisix-quickstart-client
OIDC_CLIENT_SECRET=bi9NFscFT4k0ljaRzQWlJWthrlygUn3x # replace with your client secret
curl "http://$KEYCLOAK_IP:8080/realms/quickstart-realm/protocol/openid-connect/token" -X POST \
-d 'grant_type=password' \
-d 'client_id='$OIDC_CLIENT_ID'' \
-d 'client_secret='$OIDC_CLIENT_SECRET'' \
-d 'username='$OIDC_USER'' \
-d 'password='$OIDC_PASSWORD''
```
Save the access token to an environment variable called `ACCESS_TOKEN` and send a request to the Keycloak user info endpoint with the token:
```
curl "http://$KEYCLOAK_IP:8080/realms/quickstart-realm/protocol/openid-connect/userinfo" -H "Authorization: Bearer $ACCESS_TOKEN"
```
You should see a response similar to the following:
```
{
"sub":"4310e97c-d4c3-479b-bbbd-8c66120e6cee",
"email_verified":false,
"groups":["/apisix", "/opensource"],
"preferred_username":"quickstart-user"
}
```
Suppose you would like to only allow users with `/apisix` value in the `groups` attribute to access upstream resources.
Create a route with [`openid-connect`](https://docs.api7.ai/hub/openid-connect.md) and `acl` plugins as such:
* Admin API
* ADC
* Ingress Controller
```
KEYCLOAK_IP=192.168.1.81 # replace with your host IP
OIDC_DISCOVERY=http://${KEYCLOAK_IP}:8080/realms/quickstart-realm/.well-known/openid-configuration
curl "http://127.0.0.1:9180/apisix/admin/routes" -X PUT \
-H "X-API-KEY: ${ADMIN_API_KEY}" \
--data-binary @- <= 23.0.0`.
Next, request user access token and user information from `/userinfo` endpoint, similar to the [last example](#control-access-by-examining-user-information-from-external-identity-provider). You should see Keycloak returning user information similar to the following:
```
{
"sub": "f62086ef-29e1-4401-8609-451a2d724bd7",
"email_verified": false,
"acl_labels": {
"nested": {
"groups": [
"/apisix",
"/opensource"
]
}
},
"preferred_username": "quickstart-user"
}
```
In API7, create a route with [`openid-connect`](https://docs.api7.ai/hub/openid-connect.md) to authenticate with Keycloak and configure `acl` plugins as such:
* Admin API
* ADC
* Ingress Controller
```
KEYCLOAK_IP=192.168.1.81 # replace with your host IP
OIDC_DISCOVERY=http://${KEYCLOAK_IP}:8080/realms/quickstart-realm/.well-known/openid-configuration
curl "http://127.0.0.1:9180/apisix/admin/routes" -X PUT \
-H "X-API-KEY: ${ADMIN_API_KEY}" \
--data-binary @- <
## Demo[](#demo "Direct link to Demo")
The following demo demonstrates the [moderate request content toxicity example](#moderate-request-content-toxicity) in API7 Enterprise using the Dashboard, where you can moderate request content for toxicity and customize the rejection code and message.
## Behavior by Request Format[](#behavior-by-request-format "Direct link to Behavior by Request Format")
The plugin moderates Chat Completions, Responses API, Embeddings, Anthropic Messages, and Bedrock Converse requests using each protocol's native content structure.
The gateway identifies each request by checking URI-specific rules before body-only rules:
* Bedrock Converse requires a URI ending in `/converse` and a `messages` array.
* Anthropic Messages requires a URI ending in `/v1/messages`.
* Responses API requires a URI ending in `/v1/responses` and an `input` field.
* Chat Completions uses a `messages` array.
* Embeddings uses `input` after the earlier rules do not match.
* Other non-empty JSON objects use passthrough after none of the earlier rules match.
| Request format | Content available for moderation |
| ------------------------ | --------------------------------------------- |
| Bedrock Converse | Text from `system` and `messages`. |
| Anthropic Messages | Text from `messages`. |
| Responses API | Text from `instructions` and `input`. |
| Chat Completions | Text from `messages`. |
| Embeddings | A string or an array of strings in `input`. |
| Other JSON (passthrough) | No request-format-specific text is extracted. |
APISIX moderates all extracted content shown in the table. It moderates the latest user turn by default. Use `request_check_roles` to select user, tool, or system content and `request_check_mode` to select the latest or all matching turns. Introduced in API7 Enterprise 3.9.16 and 3.10.3, and APISIX 3.18.0.
With role-aware selection, the Anthropic top-level `system` prompt is available when the system role is selected. Tool-result moderation applies when the request format represents tool output as a distinct tool role or item. Anthropic Messages and Bedrock Converse nest tool results in user messages, so they are not extracted when only the tool role is selected.
To moderate the broadest supported request content, configure all available roles and all turns in the plugin configuration:
```
{
"request_check_roles": ["user", "tool", "system"],
"request_check_mode": "all"
}
```
This configuration scans all text that the detected protocol exposes for those roles. It does not reproduce raw-body moderation: nested Anthropic and Bedrock tool results remain part of user content rather than distinct `tool` messages, and unsupported non-AI structures follow `fail_mode`.
If Responses content is rejected, the plugin returns the configured message in Responses API format. Streaming requests receive typed server-sent events ending with `response.completed`.
Embeddings has no conversation roles or turns. With role-aware selection, its `input` is selected by the user role. Rejected requests receive an OpenAI-style error response.
If an Aliyun moderation request fails, the plugin logs the error and allows the content without a moderation verdict. The `fail_mode` setting governs unsupported or non-AI request formats; it does not make Aliyun service failures fail closed. Monitor moderation errors and Aliyun availability when this plugin is an enforcement control.
## Examples[](#examples "Direct link to Examples")
The following examples will be using OpenAI as the upstream service provider.
Before proceeding, create an [OpenAI account](https://openai.com) and obtain an [API key](https://openai.com/blog/openai-api). If you are working with other LLM providers, please refer to the provider's documentation to obtain an API key.
Additionally, create an [Aliyun account](https://www.aliyun.com), enable Machine-Assisted Moderation Plus, and obtain the endpoint, region ID, access key ID, and access key secret.
You can optionally save these information to environment variables:
```
# replace with your data
export OPENAI_API_KEY=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
export ALIYUN_ENDPOINT=https://green-cip.cn-shanghai.aliyuncs.com
export ALIYUN_REGION_ID=cn-shanghai
export ALIYUN_ACCESS_KEY_ID=LTAI5yXKZP77gR3BQQM9WJnA
export ALIYUN_ACCESS_KEY_SECRET=hT2YpkqLs9FIjh3dyznBw7RMux5OKv
```
### Moderate Request Content Toxicity[](#moderate-request-content-toxicity "Direct link to Moderate Request Content Toxicity")
The following example demonstrates how you can use the plugin to moderate content toxicity in requests and customize rejection code and message.
* Admin API
* ADC
* Ingress Controller
Create a route to the LLM chat completion endpoint using the [`ai-proxy`](https://docs.api7.ai/hub/ai-proxy.md) plugin and configure the integration details as well as the deny code and message in the `ai-aliyun-content-moderation` plugin:
```
curl "http://127.0.0.1:9180/apisix/admin/routes" -X PUT \
-H "X-API-KEY: ${ADMIN_API_KEY}" \
--data-binary @- <
## Behavior by Request Format[](#behavior-by-request-format "Direct link to Behavior by Request Format")
The plugin identifies the request format by checking URI-specific rules before body-only rules:
* Bedrock Converse requires a URI ending in `/converse` and a `messages` array.
* Anthropic Messages requires a URI ending in `/v1/messages`.
* Responses API requires a URI ending in `/v1/responses` and an `input` field.
* Chat Completions uses a `messages` array.
* Embeddings uses `input` after the earlier rules do not match.
* Other non-empty JSON objects use passthrough after none of the earlier rules match.
It can extract the following content for moderation:
| Request format | Text moderated |
| ------------------------ | ------------------------------------------------------- |
| Bedrock Converse | Text from `system` and `messages`. |
| Anthropic Messages | Text from the top-level `system` prompt and `messages`. |
| Responses API | Text from `input` and `instructions`. |
| Chat Completions | Text from all entries in `messages`. |
| Embeddings | A string or an array of strings in `input`. |
| Other JSON (passthrough) | No request-format-specific text is extracted. |
Introduced in API7 Enterprise 3.9.16 and 3.10.3.
By default, the plugin moderates every extracted `user`, `assistant`, `system`, and `tool` message. Use `request_check_roles` to select roles and `request_check_mode` to moderate all selected turn messages or only the latest consecutive block. A selected `system` role also covers OpenAI `developer` messages and is always checked; it is not limited by `request_check_mode`.
Tool-result moderation applies to OpenAI-compatible formats where the tool output is a distinct `tool` role or item. Anthropic Messages and Bedrock Converse nest tool results inside user messages, so selecting only the `tool` role does not extract those nested results.
When request content exceeds a threshold, the plugin returns a denial in the detected AI protocol using `deny_code` and `deny_message`. The default status is `200` so AI SDKs can parse the provider-compatible refusal; set a `4xx` value when clients should treat moderation as an HTTP error. Streaming Chat Completions, Responses API, and Anthropic Messages use protocol-specific SSE denial events. Bedrock ConverseStream uses the non-streaming Converse denial body rather than AWS event-stream framing.
Set `check_response` to `true` to moderate LLM responses. A non-streaming response is buffered and fails closed with HTTP 500 if Comprehend cannot score it. In `final_packet` streaming mode, earlier chunks have already reached the client, so the plugin annotates the final data event with `risk_level` instead of retracting content. In `realtime` mode, a flagged batch replaces the remainder of the stream with the denial message. A Comprehend failure after streaming begins is logged, and the remaining stream passes without moderation.
The plugin sets `$llm_content_risk_level` to `high` when content exceeds a threshold and to `none` after a clean score. Request-side Comprehend failures return HTTP 500 rather than forwarding the request without moderation.
Introduced in API7 Enterprise 3.9.18 and 3.10.5, and APISIX 3.18.0.
## Examples[](#examples "Direct link to Examples")
The following examples will be using OpenAI as the upstream service provider.
Before proceeding, create an [OpenAI account](https://openai.com) and obtain an [API key](https://openai.com/blog/openai-api). If you are working with other LLM providers, please refer to the provider's documentation to obtain an API key.
Additionally, create [AWS IAM user access keys](https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_access-keys.html) for APISIX to access [AWS Comprehend](https://aws.amazon.com/comprehend/).
You can optionally save these keys to environment variables:
```
# replace with your keys
export OPENAI_API_KEY=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
export AWS_ACCESS_KEY=AKIARK7HKSJVSHWLD6OS
export AWS_SECRET_ACCESS_KEY=4ehUfCPoQmC+AKpG5/5ZaHlzFxFziZ88AylyPerj
```
### Moderate Profanity[](#moderate-profanity "Direct link to Moderate Profanity")
The following example demonstrates how you can use the plugin to moderate the level of profanity in prompts.
* Admin API
* ADC
* Ingress Controller
Create a route to the LLM chat completion endpoint using the [`ai-proxy`](https://docs.api7.ai/hub/ai-proxy.md) plugin and configure the allowed profanity level in `ai-aws-content-moderation`:
```
curl "http://127.0.0.1:9180/apisix/admin/routes" -X PUT \
-H "X-API-KEY: ${ADMIN_API_KEY}" \
--data-binary @- <",
"object": "chat.completion",
"model": "gpt-4",
"choices": [
{
"index": 0,
"message": {
"role": "assistant",
"content": "request body exceeds PROFANITY threshold"
},
"finish_reason": "stop"
}
],
"usage": {
"prompt_tokens": 0,
"completion_tokens": 0,
"total_tokens": 0
}
}
```
Send another request to the route with a typical question in the request body:
```
curl -i "http://127.0.0.1:9080/post" -X POST \
-H "Content-Type: application/json" \
-d '{
"messages": [
{ "role": "system", "content": "You are a mathematician" },
{ "role": "user", "content": "What is 1+1?" }
]
}'
```
You should receive an `HTTP/1.1 200 OK` response with the model output:
```
{
...,
"model": "gpt-4-0613",
"choices": [
{
"index": 0,
"message": {
"role": "assistant",
"content": "1+1 equals 2.",
"refusal": null
},
"logprobs": null,
"finish_reason": "stop"
}
],
...
}
```
### Moderate Overall Toxicity[](#moderate-overall-toxicity "Direct link to Moderate Overall Toxicity")
The following example demonstrates how you can use the plugin to moderate the overall toxicity level in prompts, in addition to moderating individual categories.
* Admin API
* ADC
* Ingress Controller
Create a route to the LLM chat completion endpoint using the [`ai-proxy`](https://docs.api7.ai/hub/ai-proxy.md) plugin and configure the allowed profanity and overall toxicity levels in `ai-aws-content-moderation`:
```
curl "http://127.0.0.1:9180/apisix/admin/routes" -X PUT \
-H "X-API-KEY: ${ADMIN_API_KEY}" \
--data-binary @- <",
"object": "chat.completion",
"model": "gpt-4",
"choices": [
{
"index": 0,
"message": {
"role": "assistant",
"content": "request body exceeds toxicity threshold"
},
"finish_reason": "stop"
}
],
"usage": {
"prompt_tokens": 0,
"completion_tokens": 0,
"total_tokens": 0
}
}
```
Send another request to the route without any profane word in the request body:
```
curl -i "http://127.0.0.1:9080/post" -X POST \
-H "Content-Type: application/json" \
-d '{
"messages": [
{ "role": "system", "content": "You are a mathematician" },
{ "role": "user", "content": "What is 1+1?" }
]
}'
```
You should receive an `HTTP/1.1 200 OK` response with the model output:
```
{
...,
"model": "gpt-4-0613",
"choices": [
{
"index": 0,
"message": {
"role": "assistant",
"content": "1+1 equals 2.",
"refusal": null
},
"logprobs": null,
"finish_reason": "stop"
}
],
...
}
```
---
## Parameters[](#parameters "Direct link to Parameters")
See plugin [common configurations](https://docs.api7.ai/apisix/reference/plugin-common-configurations.md) for configuration options available to all plugins.
This plugin supports referencing sensitive parameter values from environment variables using the `env://` prefix, or from a secret manager, such as HashiCorp Vault’s [KV secrets engine](https://developer.hashicorp.com/vault/docs/secrets/kv), using the `secret://` prefix. For more information, see [environment variables in plugin](https://docs.api7.ai/apisix/reference/environment-variables.md#plugins) and [secrets](https://docs.api7.ai/apisix/key-concepts/secrets.md).
* comprehend
object
required
***
[AWS Comprehend](https://aws.amazon.com/comprehend) configurations.
* access\_key\_id
string
required
***
AWS access key ID.
* secret\_access\_key
string
required
***
AWS secret access key. The value is encrypted with AES before being stored in etcd.
* region
string
required
***
AWS region.
* endpoint
string
***
AWS Comprehend service endpoint. If not set, defaults to `https://comprehend.{region}.amazonaws.com`.
* ssl\_verify
boolean
default: `true`
***
If true, enable TLS certificate verification.
* moderation\_categories
object
***
Key-value pairs of moderation category and their corresponding threshold.
In each pair, the key should be one of the `PROFANITY`, `HATE_SPEECH`, `INSULT`, `HARASSMENT_OR_ABUSE`, `SEXUAL`, or `VIOLENCE_OR_THREAT`; and the threshold value should be between 0 and 1 (inclusive).
* moderation\_threshold
number
default: `0.5`
vaild vaule:
between 0 and 1 inclusive
***
Overall toxicity threshold. A higher value means more toxic content allowed.
This option differs from the individual category thresholds in `moderation_categories`. For example, if `moderation_categories` is set with a `PROFANITY` threshold of `0.5`, and a request has a `PROFANITY` score of `0.1`, the request will not exceed the category threshold. However, if the request has other categories like `SEXUAL` or `VIOLENCE_OR_THREAT` exceeding the `moderation_threshold`, the request will be rejected.
* check\_request
boolean
default: `true`
***
If true, moderate request content.
Introduced in API7 Enterprise 3.9.16 and 3.10.3, and APISIX 3.18.0.
* deny\_code
integer
default: `200`
vaild vaule:
between 200 and 599 inclusive
***
HTTP status code returned when flagged traffic is denied before response headers are sent. The default `200` returns a provider-compatible refusal; set a `4xx` value to expose moderation as an HTTP error. After streaming starts, the status cannot be changed.
Introduced in API7 Enterprise 3.9.16 and 3.10.3, and APISIX 3.18.0.
* deny\_message
string
***
Message returned when request or response content is denied. If unset, the plugin returns the threshold failure reason.
Introduced in API7 Enterprise 3.9.16 and 3.10.3, and APISIX 3.18.0.
* fail\_mode
string
default: `skip`
vaild vaule:
`skip`, `warn`, or `error`
***
Behavior when the plugin receives a request it cannot moderate, such as non-AI traffic on a Consumer binding or a request that did not pass through AI Proxy. With `skip`, the request passes unchecked. With `warn`, it passes unchecked and a warning is logged. With `error`, the plugin rejects it with the applicable HTTP 400 or 500 response. None of these outcomes means moderation succeeded.
Introduced in API7 Enterprise 3.9.14 and APISIX 3.18.0.
* request\_check\_roles
array\[string]
default: `["user", "tool", "system", "assistant"]`
vaild vaule:
`user`, `assistant`, `system`, or `tool`
***
Message roles to moderate on the request side. `user`, `tool`, and `assistant` follow `request_check_mode`; `system` is checked on every request because system content can be affected by malicious tool-call arguments. `assistant` messages are client-supplied conversation history, so they are moderated by default as well.
Selecting `system` also covers `developer` messages, which is the role OpenAI uses in place of `system` on newer models and on the Responses API. There is no separate `developer` entry.
Tool-result moderation applies to OpenAI-compatible formats where tool output is represented as a distinct `tool` role or item.
Introduced in API7 Enterprise 3.9.18 and 3.10.5, and APISIX 3.18.0.
* request\_check\_mode
string
default: `all`
vaild vaule:
`all` or `last`
***
Which messages of the selected roles are moderated. With `all`, every message of a selected role is checked. With `last`, only the latest consecutive block of selected-role messages is checked. The `system` role is unaffected and is always checked when selected.
Selecting `assistant` together with `last` widens the block that is considered latest, because assistant turns no longer end it.
Introduced in API7 Enterprise 3.9.18 and 3.10.5, and APISIX 3.18.0.
* request\_check\_length\_limit
integer
default: `1000`
vaild vaule:
between 4 and 1024 inclusive
***
Maximum number of bytes of request content per Amazon Comprehend text segment. Longer content is split across several segments so that it is moderated in full instead of being truncated.
Introduced in API7 Enterprise 3.9.18 and 3.10.5, and APISIX 3.18.0.
* check\_response
boolean
default: `false`
***
If true, moderate the content of the LLM response in addition to the request. A non-streaming response is moderated before it is returned and fails closed with HTTP 500 if Comprehend cannot score it. A streaming response is moderated according to `stream_check_mode`; after bytes are sent, provider failures are logged and the remaining stream passes without a verdict.
Introduced in API7 Enterprise 3.9.18 and 3.10.5, and APISIX 3.18.0.
* response\_check\_length\_limit
integer
default: `1000`
vaild vaule:
between 4 and 1024 inclusive
***
Maximum number of bytes of response content per Amazon Comprehend text segment. Longer content is split across several segments.
Introduced in API7 Enterprise 3.9.18 and 3.10.5, and APISIX 3.18.0.
* stream\_check\_mode
string
default: `final_packet`
vaild vaule:
`final_packet` or `realtime`
***
How a streaming response is moderated when `check_response` is enabled. With `final_packet`, the assembled response is moderated once and the last chunk is annotated with its risk level. With `realtime`, batches are moderated while the response streams, and the remainder of the stream is replaced with the denial message as soon as a batch is flagged.
Introduced in API7 Enterprise 3.9.18 and 3.10.5, and APISIX 3.18.0.
* stream\_check\_cache\_size
integer
default: `128`
vaild vaule:
greater than or equal to 1
***
Maximum number of characters accumulated per moderation batch in `realtime` mode. A smaller value detects harmful content earlier at the cost of more moderation calls.
Introduced in API7 Enterprise 3.9.18 and 3.10.5, and APISIX 3.18.0.
* stream\_check\_interval
number
default: `3`
vaild vaule:
greater than or equal to 0.1
***
Number of seconds between batch checks in `realtime` mode.
Introduced in API7 Enterprise 3.9.18 and 3.10.5, and APISIX 3.18.0.
* timeout
integer
default: `10000`
vaild vaule:
greater than or equal to 1
***
Timeout in milliseconds for a request to Amazon Comprehend.
Introduced in API7 Enterprise 3.9.18 and 3.10.5, and APISIX 3.18.0.
* keepalive
boolean
default: `true`
***
If true, keep the connection to Amazon Comprehend alive so that it is reused across the moderation calls of a request instead of being reopened for each of them.
Introduced in API7 Enterprise 3.9.18 and 3.10.5, and APISIX 3.18.0.
* keepalive\_timeout
integer
default: `60000`
vaild vaule:
greater than or equal to 1000
***
Idle time in milliseconds after which a pooled connection to Amazon Comprehend is closed.
Introduced in API7 Enterprise 3.9.18 and 3.10.5, and APISIX 3.18.0.
---
# ai-cache
The `ai-cache` plugin caches responses from LLM services so that repeated requests are served from the cache instead of calling the upstream model again. This reduces response latency and upstream token usage for repeated prompts.
The plugin supports exact-match caching, where a response is reused only when the normalized request is identical to a previously cached one. It can also use a semantic cache layer that compares prompt embeddings through RediSearch after an exact miss.
## Behavior by Request Format[](#behavior-by-request-format "Direct link to Behavior by Request Format")
The plugin keeps each detected request format in separate cache entries.
The gateway identifies each request by checking URI-specific rules before body-only rules:
* Bedrock Converse requires a URI ending in `/converse` and a `messages` array.
* Anthropic Messages requires a URI ending in `/v1/messages`.
* Responses API requires a URI ending in `/v1/responses` and an `input` field.
* Chat Completions uses a `messages` array.
* Embeddings uses `input` after the earlier rules do not match.
* Other non-empty JSON objects use passthrough after none of the earlier rules match.
| Request format | Exact-match cache | Semantic cache |
| ------------------------ | ----------------- | -------------- |
| Bedrock Converse | Supported | Bypassed |
| Anthropic Messages | Supported | Bypassed |
| Responses API | Supported | Bypassed |
| Chat Completions | Supported | Supported |
| Embeddings | Supported | Bypassed |
| Other JSON (passthrough) | Supported | Bypassed |
Exact-match caching was introduced in API7 Enterprise 3.9.16 and 3.10.2, and APISIX 3.18.0.
Semantic and streaming response caching were introduced in API7 Enterprise 3.9.16 and 3.10.3, and APISIX 3.18.0.
## How It Works[](#how-it-works "Direct link to How It Works")
The `ai-cache` plugin must be used together with the [`ai-proxy`](https://docs.api7.ai/hub/ai-proxy.md) or [`ai-proxy-multi`](https://docs.api7.ai/hub/ai-proxy-multi.md) plugin on the same route, because it caches the LLM traffic those plugins proxy.
On each request, the plugin computes a cache key from the detected request format, the request body, and the selected AI instance's configuration. From API7 Enterprise version 3.9.20, the key under the `passthrough` protocol also includes the client's request method, path, and query string. That protocol proxies all three verbatim, so they select the upstream endpoint. The key is scoped as configured by `cache_key`. Exact cache entries are stored in Redis with a configurable time-to-live.
For Chat Completions requests, semantic caching runs after an exact cache miss. The plugin embeds the configured prompt window and queries a RediSearch vector index for a sufficiently similar cached response.
The plugin sets the `X-AI-Cache-Status` response header to one of the following:
* `HIT` - a valid cached response was found and is returned directly, without calling the upstream. The `X-AI-Cache-Age` header reports the age of the cached entry in seconds. Semantic hits also return `X-AI-Cache-Similarity`.
* `MISS` - no cached response was found. The request is proxied to the upstream, and a successful (`HTTP 200`) response within `max_cache_body_size` is cached for future requests.
* `BYPASS` - caching is skipped for this request, for example because it matches a `bypass_on` rule, no AI instance was selected, or the response cannot be safely captured.
Complete SSE streaming responses can be cached and replayed with their streaming content type. A stream is cached only after the plugin receives the client protocol's terminal event, such as `[DONE]` for OpenAI Chat Completions, `message_stop` for Anthropic Messages, or `response.completed` for the OpenAI Responses API. Interrupted or limit-truncated streams are not cached. Streaming and non-streaming requests use separate entries, and a cached stream is replayed immediately rather than with its original token timing. Streams that use another framing format, such as Bedrock ConverseStream's AWS event-stream format, bypass the cache.
caution
Cached prompts and responses can contain sensitive data. Restrict access to Redis, choose an appropriate cache TTL, and use `cache_key.include_consumer` or `cache_key.include_vars` when cached responses should not be shared across consumers or request contexts.
## Examples[](#examples "Direct link to Examples")
The following example uses OpenAI as the upstream LLM service and a Redis instance to store the cache. Before proceeding, create an [OpenAI account](https://openai.com) and an [API key](https://openai.com/blog/openai-api), and make sure a Redis instance is reachable from the gateway. You can optionally save the key to an environment variable:
```
export OPENAI_API_KEY=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 # replace with your API key
```
If you are working with other LLM providers, please refer to the provider's documentation to obtain an API key.
### Cache LLM Responses[](#cache-llm-responses "Direct link to Cache LLM Responses")
The following example demonstrates how to configure `ai-cache` together with `ai-proxy` so that repeated, identical requests are served from Redis.
* Admin API
* ADC
* Ingress Controller
Create a route that proxies to OpenAI with `ai-proxy` and caches responses with `ai-cache`:
```
curl "http://127.0.0.1:9180/apisix/admin/routes" -X PUT \
-H "X-API-KEY: ${ADMIN_API_KEY}" \
--data-binary @- <
## Demo[](#demo "Direct link to Demo")
The following demo demonstrates the [implement allow and deny patterns example](#implement-allow-and-deny-patterns) in API7 Enterprise using the Dashboard, where you can validate user prompts by defining both allow and deny patterns and understand how the allow pattern takes precedence.
## Behavior by Request Format[](#behavior-by-request-format "Direct link to Behavior by Request Format")
The plugin checks Chat Completions, Responses API, Embeddings, Anthropic Messages, and Bedrock Converse requests using each protocol's native content structure.
The gateway identifies each request by checking URI-specific rules before body-only rules:
* Bedrock Converse requires a URI ending in `/converse` and a `messages` array.
* Anthropic Messages requires a URI ending in `/v1/messages`.
* Responses API requires a URI ending in `/v1/responses` and an `input` field.
* Chat Completions uses a `messages` array.
* Embeddings uses `input` after the earlier rules do not match.
* Other non-empty JSON objects use passthrough after none of the earlier rules match.
By default, the plugin checks the latest user content. Use `match_all_roles` to include other roles and `match_all_conversation_history` to include earlier messages.
| Request format | Content checked |
| ------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Bedrock Converse | Content in `system` and `messages`, subject to the role and conversation-history settings. |
| Anthropic Messages | Content in the top-level `system` prompt and `messages`, subject to the role and conversation-history settings. |
| Responses API | User content in `input`. With `match_all_roles` enabled, it also checks `instructions` and content assigned other roles in `input`. The conversation-history setting does not apply because `instructions` and `input` are parallel fields. |
| Chat Completions | Content in `messages`, subject to the role and conversation-history settings. |
| Embeddings | A string in `input`, treated as user content. An array of input strings is not inspected. |
| Other JSON (passthrough) | Not inspected as a supported AI request format. |
## Examples[](#examples "Direct link to Examples")
The following examples will be using OpenAI as the upstream service provider. Before proceeding, create an [OpenAI account](https://openai.com) and an [API key](https://openai.com/blog/openai-api). You can optionally save the key to an environment variable as such:
```
export OPENAI_API_KEY=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 # replace with your API key
```
If you are working with other LLM providers, please refer to the provider's documentation to obtain an API key.
### Implement Allow and Deny Patterns[](#implement-allow-and-deny-patterns "Direct link to Implement Allow and Deny Patterns")
The following example demonstrates how to use the `ai-prompt-guard` plugin to validate user prompts by defining both allow and deny patterns and understand how the allow pattern takes precedence.
Define the allow and deny patterns. You can optionally save them to environment variables for easier escape:
```
# allow US dollar amount
export ALLOW_PATTERN_1='\\$?\\(?\\d{1,3}(,\\d{3})*(\\.\\d{1,2})?\\)?'
# deny phone number in US number format
export DENY_PATTERN_1='(\\([0-9]{3}\\)|[0-9]{3}-)[0-9]{3}-[0-9]{4}'
```
* Admin API
* ADC
* Ingress Controller
Create a route that uses `ai-proxy` to proxy to OpenAI and `ai-prompt-guard` to inspect input prompts:
```
curl "http://127.0.0.1:9180/apisix/admin/routes" -X PUT \
-H "X-API-KEY: ${ADMIN_API_KEY}" \
--data-binary @- </` format.
Create a route with the `ai-proxy` plugin configured as such:
adc.yaml
```
services:
- name: vertex-ai-service
routes:
- name: vertex-ai-route
uris:
- /anything
methods:
- POST
plugins:
ai-proxy:
provider: vertex-ai
auth:
gcp:
service_account_json: "${GCP_SA_JSON}"
provider_conf:
project_id: api7-vertex
region: us-central1
options:
model: google/gemini-2.5-flash
```
Synchronize the configuration to the gateway:
```
adc sync -f adc.yaml
```
❶ Specify the provider to be `vertex-ai`.
❷ Replace with your JSON credentials. Ensure that it is a JSON-escaped string.
❸ Replace with your Vertex AI project ID and region.
❹ Specify the name of the Gemini model through Vertex AI in the `/` format.
* Gateway API
* APISIX CRD
vertex-ai-ic.yaml
```
apiVersion: apisix.apache.org/v1alpha1
kind: PluginConfig
metadata:
namespace: aic
name: ai-proxy-plugin-config
spec:
plugins:
- name: ai-proxy
config:
provider: vertex-ai
auth:
gcp:
service_account_json: '{"type":"service_account","project_id":"api7-vertex","private_key_id":"...","private_key":"-----BEGIN PRIVATE KEY-----\n...\n-----END PRIVATE KEY-----","client_email":"api7-docs@api7-vertex.iam.gserviceaccount.com","client_id":"...","auth_uri":"https://accounts.google.com/o/oauth2/auth","token_uri":"https://oauth2.googleapis.com/token","auth_provider_x509_cert_url":"https://www.googleapis.com/oauth2/v1/certs","client_x509_cert_url":"https://www.googleapis.com/robot/v1/metadata/x509/api7-docs%40api7-vertex.iam.gserviceaccount.com","universe_domain":"googleapis.com"}'
provider_conf:
project_id: api7-vertex
region: us-central1
options:
model: google/gemini-2.5-flash
---
apiVersion: gateway.networking.k8s.io/v1
kind: HTTPRoute
metadata:
namespace: aic
name: vertex-ai-route
spec:
parentRefs:
- name: apisix
rules:
- matches:
- path:
type: Exact
value: /anything
method: POST
filters:
- type: ExtensionRef
extensionRef:
group: apisix.apache.org
kind: PluginConfig
name: ai-proxy-plugin-config
```
Apply the configuration to your cluster:
```
kubectl apply -f vertex-ai-ic.yaml
```
❶ Specify the provider to be `vertex-ai`.
❷ Replace with your JSON credentials. Ensure that it is a JSON-escaped string.
❸ Replace with your Vertex AI project ID and region.
❹ Specify the name of the Gemini model through Vertex AI in the `/` format.
vertex-ai-ic.yaml
```
apiVersion: apisix.apache.org/v2
kind: ApisixRoute
metadata:
namespace: aic
name: vertex-ai-route
spec:
ingressClassName: apisix
http:
- name: vertex-ai-route
match:
paths:
- /anything
methods:
- POST
plugins:
- name: ai-proxy
enable: true
config:
provider: vertex-ai
auth:
gcp:
service_account_json: '{"type":"service_account","project_id":"api7-vertex","private_key_id":"...","private_key":"-----BEGIN PRIVATE KEY-----\n...\n-----END PRIVATE KEY-----","client_email":"api7-docs@api7-vertex.iam.gserviceaccount.com","client_id":"...","auth_uri":"https://accounts.google.com/o/oauth2/auth","token_uri":"https://oauth2.googleapis.com/token","auth_provider_x509_cert_url":"https://www.googleapis.com/oauth2/v1/certs","client_x509_cert_url":"https://www.googleapis.com/robot/v1/metadata/x509/api7-docs%40api7-vertex.iam.gserviceaccount.com","universe_domain":"googleapis.com"}'
provider_conf:
project_id: api7-vertex
region: us-central1
options:
model: google/gemini-2.5-flash
```
Apply the configuration to your cluster:
```
kubectl apply -f vertex-ai-ic.yaml
```
❶ Specify the provider to be `vertex-ai`.
❷ Replace with your JSON credentials. Ensure that it is a JSON-escaped string.
❸ Replace with your Vertex AI project ID and region.
❹ Specify the name of the Gemini model through Vertex AI in the `/` format.
Send a POST request to the route with a system prompt and a sample user question in the request body:
```
curl "http://127.0.0.1:9080/anything" -X POST \
-H "Content-Type: application/json" \
-d '{
"messages": [
{ "role": "system", "content": "You are a mathematician" },
{ "role": "user", "content": "What is 1+1?" }
]
}'
```
You should receive a response similar to the following:
```
{
"choices": [
{
"message": {
"role": "assistant",
"content": "1 + 1 = 2\n"
},
"index": 0,
"logprobs": null,
"finish_reason": "stop"
}
],
"usage": {
"completion_tokens": 8,
"extra_properties": {
"google": {
"traffic_type": "ON_DEMAND"
}
},
"total_tokens": 19,
"prompt_tokens": 11
},
"object": "chat.completion",
"model": "google/gemini-2.5-flash",
...
}
```
### Proxy to Vertex AI Embedding Models[](#proxy-to-vertex-ai-embedding-models "Direct link to Proxy to Vertex AI Embedding Models")
The following example demonstrates how you can configure the `ai-proxy` plugin to proxy requests to Vertex AI embedding models using GCP service account authentication. This example applies to API7 Enterprise from version 3.9.2 and APISIX from version 3.17.0.
Before proceeding:
* [Enable Vertex AI](https://docs.cloud.google.com/vertex-ai/docs/featurestore/setup) and billing for your GCP project.
* Follow the [service account credentials](https://developers.google.com/workspace/guides/create-credentials#service-account) section to create a service account in GCP, assign the account with the "Vertex AI User" role, and obtain the account credentials in JSON.
Your credentials file should look similar to the following:
credentials.json
```
{
"type": "service_account",
"project_id": "api7-vertex",
"private_key_id": "...",
"private_key": "-----BEGIN PRIVATE KEY-----\n...\n-----END PRIVATE KEY-----\n",
"client_email": "api7-docs@api7-vertex.iam.gserviceaccount.com",
"client_id": "....",
"auth_uri": "https://accounts.google.com/o/oauth2/auth",
"token_uri": "https://oauth2.googleapis.com/token",
"auth_provider_x509_cert_url": "https://www.googleapis.com/oauth2/v1/certs",
"client_x509_cert_url": "https://www.googleapis.com/robot/v1/metadata/x509/api7-docs%40api7-vertex.iam.gserviceaccount.com",
"universe_domain": "googleapis.com"
}
```
Optionally save the JSON to an environment variable:
```
export GCP_SA_JSON="$(cat credentials.json)"
```
* Admin API
* ADC
* Ingress Controller
Create a route and configure the `ai-proxy` plugin as such:
```
curl "http://127.0.0.1:9180/apisix/admin/routes" -X PUT \
-H "X-API-KEY: ${ADMIN_API_KEY}" \
--data-binary @- <
export AWS_SECRET_ACCESS_KEY=
```
Create a route with the `ai-proxy` plugin configured for Bedrock:
* Admin API
* ADC
* Ingress Controller
```
curl "http://127.0.0.1:9180/apisix/admin/routes" -X PUT \
-H "X-API-KEY: ${ADMIN_API_KEY}" \
--data-binary @- < -n -f values.yaml
```
Now if you create a route following the [Proxy to OpenAI example](#proxy-to-openai). Send a request like this:
```
curl "http://127.0.0.1:9080/anything" -X POST \
-H "Content-Type: application/json" \
-d '{
"model": "gpt-3.5",
"messages": [
{ "role": "system", "content": "You are a mathematician" },
{ "role": "user", "content": "What is 1+1?" }
]
}'
```
Since the model in `ai-proxy` is `gpt-4`, the request will be forwarded to GPT-4 model and you will receive a response similar to the following:
```
{
...,
"model": "gpt-4-0613",
"choices": [
{
"index": 0,
"message": {
"role": "assistant",
"content": "1+1 equals 2.",
"refusal": null,
"annotations": []
},
"logprobs": null,
"finish_reason": "stop"
}
],
"usage": {
"prompt_tokens": 23,
"completion_tokens": 8,
"total_tokens": 31,
"prompt_tokens_details": {
"cached_tokens": 0,
"audio_tokens": 0
},
...
},
"service_tier": "default",
"system_fingerprint": null
}
```
In the gateway's access log, you should see a log entry similar to the following:
```
192.168.215.1 - - [29/Aug/2025:09:54:16 +0000] 127.0.0.1:9080 "POST /anything HTTP/1.1" 200 808 2.670 "-" "curl/8.6.0" - - 2670 "http://127.0.0.1:9080" "6526bf5c961b6e6bb8cfcb66486f02dc" "ai_chat" "2670" "gpt-4" "gpt-3.5" "23" "8" "31" "false" "false" "0" "" "0" "0" "0"
```
The access log entry shows an upstream response time and time to first token of `2670` milliseconds. The request uses the `ai_chat` type, requests `gpt-3.5`, and is forwarded to `gpt-4`. It uses 23 prompt tokens, 8 completion tokens, and 31 total tokens.
The remaining values show a non-streaming request with no tool calls, provided tools, end-user identifier, prompt-cache tokens, or reasoning tokens.
### Send Request Log to Logger[](#send-request-log-to-logger "Direct link to Send Request Log to Logger")
The following example demonstrates how you can log request and request information, including LLM model, token, and payload, and push them to a logger. Before proceeding, you should first set up a logger, such as Kafka. See [`kafka-logger`](https://docs.api7.ai/hub/kafka-logger.md) for more information.
* Admin API
* ADC
* Ingress Controller
Create a route to your LLM service and configure logging details as such:
```
curl "http://127.0.0.1:9180/apisix/admin/routes" -X PUT \
-H "X-API-KEY: ${ADMIN_API_KEY}" \
--data-binary @- <
## Demo[](#demo "Direct link to Demo")
The following demo demonstrates the [configure instance priority and rate limiting example](#configure-instance-priority-and-rate-limiting). It shows how you can configure two models with different priorities and apply rate limiting on the instance with a higher priority in API7 Enterprise using the Dashboard. In the case where `fallback_strategy` is set to `["rate_limiting"]`, the plugin should continue to forward requests to the low priority instance once the high priority instance's rate limiting quota is fully consumed.
## Examples[](#examples "Direct link to Examples")
The examples below demonstrate how you can configure `ai-proxy-multi` for different scenarios.
### Load Balance between Instances[](#load-balance-between-instances "Direct link to Load Balance between Instances")
The following example configures two models for load balancing, forwarding 80% of the traffic to one instance and 20% to the other. It also retries one additional instance when the first attempt returns `429` or `5xx` within two seconds. `max_retries` and `retry_on_failure_within_ms` are available in API7 Enterprise from version 3.9.14 and APISIX from version 3.17.0.
For demonstration and easier differentiation, you will be configuring one OpenAI instance and one DeepSeek instance as the upstream LLM services.
Create a route as such and update with your LLM providers, models, API keys, and endpoints if applicable:
* Admin API
* ADC
* Ingress Controller
```
curl "http://127.0.0.1:9180/apisix/admin/routes" -X PUT \
-H "X-API-KEY: ${ADMIN_API_KEY}" \
--data-binary @- <"
options:
model: gpt-4.1
- name: openai-responses-secondary
provider: openai
weight: 1
auth:
header:
Authorization: "Bearer "
options:
model: gpt-4.1-mini
---
apiVersion: gateway.networking.k8s.io/v1
kind: HTTPRoute
metadata:
namespace: aic
name: ai-proxy-multi-responses-route
spec:
parentRefs:
- name: apisix
rules:
- matches:
- path:
type: Exact
value: /v1/responses
method: POST
filters:
- type: ExtensionRef
extensionRef:
group: apisix.apache.org
kind: PluginConfig
name: ai-proxy-multi-responses-plugin-config
```
Apply the configuration to your cluster:
```
kubectl apply -f ai-proxy-multi-ic.yaml
```
ai-proxy-multi-ic.yaml
```
apiVersion: apisix.apache.org/v2
kind: ApisixRoute
metadata:
namespace: aic
name: ai-proxy-multi-responses-route
spec:
ingressClassName: apisix
http:
- name: ai-proxy-multi-responses-route
match:
paths:
- /v1/responses
methods:
- POST
plugins:
- name: ai-proxy-multi
enable: true
config:
instances:
- name: openai-responses-primary
provider: openai
weight: 1
auth:
header:
Authorization: "Bearer "
options:
model: gpt-4.1
- name: openai-responses-secondary
provider: openai
weight: 1
auth:
header:
Authorization: "Bearer "
options:
model: gpt-4.1-mini
```
Apply the configuration to your cluster:
```
kubectl apply -f ai-proxy-multi-ic.yaml
```
Send a request using the OpenAI Responses API format:
```
curl "http://127.0.0.1:9080/v1/responses" -X POST \
-H "Content-Type: application/json" \
-d '{
"input": "Write one sentence about API gateways."
}'
```
The request is forwarded to one of the configured OpenAI instances and the response is returned in the Responses API format.
### Route by Semantic Similarity[](#route-by-semantic-similarity "Direct link to Route by Semantic Similarity")
The `semantic` balancer selects an instance by comparing the request prompt with example utterances assigned to each instance. It is available in API7 Enterprise 3.9.18 and 3.10.5, and in APISIX 3.18.0.
Export API keys for the embedding request and LLM requests:
```
export EMBEDDING_API_KEY=""
export LLM_API_KEY=""
```
Create a route with instances for programming, translation, and general prompts. The general instance is also the fallback when no score reaches the configured threshold or the embedding request fails:
```
curl "http://127.0.0.1:9180/apisix/admin/routes" -X PUT \
-H "X-API-KEY: ${ADMIN_API_KEY}" \
--data-binary @- <` format.
❹ Configure the provider to be `vertex-ai` for Vertex AI Gemini access.
❺ Replace with your JSON credentials. Ensure that it is a JSON-escaped string.
❻ Replace with your Vertex AI project ID and region.
❼ Specify the name of the Gemini model through Vertex AI in the `/` format.
adc.yaml
```
services:
- name: ai-proxy-multi-service
routes:
- name: ai-proxy-multi-route
uris:
- /anything
methods:
- POST
plugins:
ai-proxy-multi:
fallback_strategy:
- rate_limiting
instances:
- name: gemini-instance
provider: gemini
weight: 7
auth:
header:
Authorization: "Bearer ${GEMINI_API_KEY}"
options:
model: gemini-2.5-flash
- name: vertex-ai-instance
provider: vertex-ai
weight: 3
auth:
gcp:
service_account_json: "${GCP_SA_JSON}"
provider_conf:
project_id: api7-vertex
region: us-central1
options:
model: google/gemini-2.5-flash
```
Synchronize the configuration to the gateway:
```
adc sync -f adc.yaml
```
❶ Configure the provider to be `gemini` for Google AI Studio Gemini access.
❷ Replace with your Gemini API key in the `Authorization` header.
❸ Specify the name of the Gemini model through Google AI Studio in the `` format.
❹ Configure the provider to be `vertex-ai` for Vertex AI Gemini access.
❺ Replace with your JSON credentials. Ensure that it is a JSON-escaped string.
❻ Replace with your Vertex AI project ID and region.
❼ Specify the name of the Gemini model through Vertex AI in the `/` format.
* Gateway API
* APISIX CRD
ai-proxy-multi-ic.yaml
```
apiVersion: apisix.apache.org/v1alpha1
kind: PluginConfig
metadata:
namespace: aic
name: ai-proxy-multi-plugin-config
spec:
plugins:
- name: ai-proxy-multi
config:
fallback_strategy:
- rate_limiting
instances:
- name: gemini-instance
provider: gemini
weight: 7
auth:
header:
Authorization: "Bearer AIzaSyDUMZbZmHCmJ5BNNLl0KfQk"
options:
model: gemini-2.5-flash
- name: vertex-ai-instance
provider: vertex-ai
weight: 3
auth:
gcp:
service_account_json: '{"type":"service_account","project_id":"api7-vertex","private_key_id":"...","private_key":"-----BEGIN PRIVATE KEY-----\n...\n-----END PRIVATE KEY-----","client_email":"api7-docs@api7-vertex.iam.gserviceaccount.com","client_id":"...","auth_uri":"https://accounts.google.com/o/oauth2/auth","token_uri":"https://oauth2.googleapis.com/token","auth_provider_x509_cert_url":"https://www.googleapis.com/oauth2/v1/certs","client_x509_cert_url":"https://www.googleapis.com/robot/v1/metadata/x509/api7-docs%40api7-vertex.iam.gserviceaccount.com","universe_domain":"googleapis.com"}'
provider_conf:
project_id: api7-vertex
region: us-central1
options:
model: google/gemini-2.5-flash
---
apiVersion: gateway.networking.k8s.io/v1
kind: HTTPRoute
metadata:
namespace: aic
name: ai-proxy-multi-route
spec:
parentRefs:
- name: apisix
rules:
- matches:
- path:
type: Exact
value: /anything
method: POST
filters:
- type: ExtensionRef
extensionRef:
group: apisix.apache.org
kind: PluginConfig
name: ai-proxy-multi-plugin-config
```
Apply the configuration to your cluster:
```
kubectl apply -f ai-proxy-multi-ic.yaml
```
❶ Configure the provider to be `gemini` for Google AI Studio Gemini access.
❷ Replace with your Gemini API key in the `Authorization` header.
❸ Specify the name of the Gemini model through Google AI Studio in the `` format.
❹ Configure the provider to be `vertex-ai` for Vertex AI Gemini access.
❺ Replace with your JSON credentials. Ensure that it is a JSON-escaped string.
❻ Replace with your Vertex AI project ID and region.
❼ Specify the name of the Gemini model through Vertex AI in the `/` format.
ai-proxy-multi-ic.yaml
```
apiVersion: apisix.apache.org/v2
kind: ApisixRoute
metadata:
namespace: aic
name: ai-proxy-multi-route
spec:
ingressClassName: apisix
http:
- name: ai-proxy-multi-route
match:
paths:
- /anything
methods:
- POST
plugins:
- name: ai-proxy-multi
enable: true
config:
fallback_strategy:
- rate_limiting
instances:
- name: gemini-instance
provider: gemini
weight: 7
auth:
header:
Authorization: "Bearer AIzaSyDUMZbZmHCmJ5BNNLl0KfQk"
options:
model: gemini-2.5-flash
- name: vertex-ai-instance
provider: vertex-ai
weight: 3
auth:
gcp:
service_account_json: '{"type":"service_account","project_id":"api7-vertex","private_key_id":"...","private_key":"-----BEGIN PRIVATE KEY-----\n...\n-----END PRIVATE KEY-----","client_email":"api7-docs@api7-vertex.iam.gserviceaccount.com","client_id":"...","auth_uri":"https://accounts.google.com/o/oauth2/auth","token_uri":"https://oauth2.googleapis.com/token","auth_provider_x509_cert_url":"https://www.googleapis.com/oauth2/v1/certs","client_x509_cert_url":"https://www.googleapis.com/robot/v1/metadata/x509/api7-docs%40api7-vertex.iam.gserviceaccount.com","universe_domain":"googleapis.com"}'
provider_conf:
project_id: api7-vertex
region: us-central1
options:
model: google/gemini-2.5-flash
```
Apply the configuration to your cluster:
```
kubectl apply -f ai-proxy-multi-ic.yaml
```
❶ Configure the provider to be `gemini` for Google AI Studio Gemini access.
❷ Replace with your Gemini API key in the `Authorization` header.
❸ Specify the name of the Gemini model through Google AI Studio in the `` format.
❹ Configure the provider to be `vertex-ai` for Vertex AI Gemini access.
❺ Replace with your JSON credentials. Ensure that it is a JSON-escaped string.
❻ Replace with your Vertex AI project ID and region.
❼ Specify the name of the Gemini model through Vertex AI in the `/` format.
Send 10 POST requests to the route to see the load balancing distribution:
```
studio_count=0
vertex_count=0
for i in {1..10}; do
model=$(curl -s "http://127.0.0.1:9080/anything" -X POST \
-H "Content-Type: application/json" \
-d '{
"messages": [
{ "role": "system", "content": "You are a mathematician" },
{ "role": "user", "content": "What is 1+1?" }
]
}' | jq -r '.model')
if [[ "$model" == "gemini-2.5-flash" ]]; then
((studio_count++))
elif [[ "$model" == "google/gemini-2.5-flash" ]]; then
((vertex_count++))
fi
done
echo "Google AI Studio Gemini responses: $studio_count"
echo "Vertex AI Gemini responses: $vertex_count"
```
You should see a response similar to the following:
```
Google AI Studio Gemini responses: 7
Vertex AI Gemini responses: 3
```
### Configure Instance Priority and Rate Limiting[](#configure-instance-priority-and-rate-limiting "Direct link to Configure Instance Priority and Rate Limiting")
The following example demonstrates how you can configure two models with different priorities and apply rate limiting on the instance with a higher priority. In the case where `fallback_strategy` is set to `["rate_limiting"]`, the plugin should continue to forward requests to the low priority instance once the high priority instance's rate limiting quota is fully consumed.
Create a route as such and update with your LLM providers, models, API keys, and endpoints if applicable:
* Admin API
* ADC
* Ingress Controller
```
curl "http://127.0.0.1:9180/apisix/admin/routes" -X PUT \
-H "X-API-KEY: ${ADMIN_API_KEY}" \
--data-binary @- < -n -f values.yaml
```
Next, create a route with the `ai-proxy-multi` plugin following the previous examples and send a request. For instance, if you send a request like this:
```
curl "http://127.0.0.1:9080/anything" -X POST \
-H "Content-Type: application/json" \
-d '{
"model": "gpt-3.5",
"messages": [
{ "role": "system", "content": "You are a mathematician" },
{ "role": "user", "content": "What is 1+1?" }
]
}'
```
If the LLM instance model in `ai-proxy-multi` is `gpt-4`, then the request will be forwarded to GPT-4 model and you will receive a response similar to the following:
```
{
...,
"model": "gpt-4-0613",
"choices": [
{
"index": 0,
"message": {
"role": "assistant",
"content": "1+1 equals 2.",
"refusal": null,
"annotations": []
},
"logprobs": null,
"finish_reason": "stop"
}
],
"usage": {
"prompt_tokens": 23,
"completion_tokens": 8,
"total_tokens": 31,
"prompt_tokens_details": {
"cached_tokens": 0,
"audio_tokens": 0
},
...
},
"service_tier": "default",
"system_fingerprint": null
}
```
In the gateway's access log, you should see a log entry similar to the following:
```
192.168.215.1 - - [29/Aug/2025:09:54:16 +0000] 127.0.0.1:9080 "POST /anything HTTP/1.1" 200 808 2.670 "-" "curl/8.6.0" - - 2670 "http://127.0.0.1:9080" "6526bf5c961b6e6bb8cfcb66486f02dc" "ai_chat" "2670" "gpt-4" "gpt-3.5" "23" "8" "31" "false" "false" "0" "" "0" "0" "0"
```
The access log entry shows an upstream response time and time to first token of `2670` milliseconds. The request uses the `ai_chat` type, requests `gpt-3.5`, and is forwarded to `gpt-4`. It uses 23 prompt tokens, 8 completion tokens, and 31 total tokens.
The remaining values show a non-streaming request with no tool calls, provided tools, end-user identifier, prompt-cache tokens, or reasoning tokens.
### Send Request Log to Logger[](#send-request-log-to-logger "Direct link to Send Request Log to Logger")
The following example demonstrates how you can log request and request information, including LLM model, token, and payload, and push them to a logger. Before proceeding, you should first set up a logger, such as Kafka. See [`kafka-logger`](https://docs.api7.ai/hub/kafka-logger.md) for more information.
Create a route to your LLM services and configure logging details as such:
* Admin API
* ADC
* Ingress Controller
```
curl "http://127.0.0.1:9180/apisix/admin/routes" -X PUT \
-H "X-API-KEY: ${ADMIN_API_KEY}" \
--data-binary @- < -n --all -o yaml > values.yaml
```
Add or update the following value:
values.yaml
```
apisix:
pluginAttrs:
ai-proxy:
http_client: lua-resty-http
```
Then apply the values file with the chart used for this APISIX release:
```
helm upgrade apisix/apisix -n -f values.yaml
```
## Parameters[](#parameters "Direct link to Parameters")
See plugin [common configurations](https://docs.api7.ai/apisix/reference/plugin-common-configurations.md) for configuration options available to all plugins.
* fallback\_strategy
string or array
vaild vaule:
string: `instance_health_and_rate_limiting`, `http_429`, or `http_5xx`
array: Any combination of `rate_limiting`, `http_429`, and `http_5xx`
***
Fallback strategy. The option `instance_health_and_rate_limiting` is kept for backward compatibility and is functionally the same as `rate_limiting`.
With `rate_limiting` or `instance_health_and_rate_limiting`, when the current instance's quota is exhausted, the request is forwarded to the next instance regardless of priority. With `http_429`, if an instance returns status code 429, the request is retried with other instances. With `http_5xx`, if an instance returns a 5xx status code, the request is retried with other instances. If all instances fail, the plugin returns the last upstream status, response body, and `Content-Type`.
When not set, the plugin will not forward the request to low priority instances when tokens of the high priority instance are exhausted.
* max\_retries
integer
vaild vaule:
greater than or equal to 0
***
Maximum number of fallback retries after the initial request fails. This bounds how many additional instances a single request tries, so it does not exhaust every configured instance. Only takes effect together with `fallback_strategy`. When not set, there is no explicit cap and the plugin retries until an instance succeeds or all instances have been tried. Available in API7 Enterprise from version 3.9.14 and APISIX from version 3.17.0.
* retry\_on\_failure\_within\_ms
integer
vaild vaule:
greater than or equal to 1
***
Only fall back to another instance when the upstream fails within this many milliseconds. Fast failures (such as connection errors and quick 429 or 5xx responses) are retried, while a slow failure that takes longer than this is returned to the client directly to avoid doubling the total wait time. Only takes effect together with `fallback_strategy`. When not set, the plugin retries regardless of how long the failed attempt took. Available in API7 Enterprise from version 3.9.14 and APISIX from version 3.17.0.
* fallback\_http\_statuses
array\[integer]
vaild vaule:
each between 400 and 599, no duplicates
***
Additional upstream HTTP status codes that make the request fall back to another instance, on top of the `http_429` and `http_5xx` entries of `fallback_strategy`. Use it for statuses that mean the instance's own credential or quota is the problem rather than the request, such as `401` for an expired key or `403` for a disabled account, so the request is retried elsewhere instead of being returned to the client. Only takes effect together with `fallback_strategy`. Available in API7 Enterprise from version 3.9.19 on the 3.9 line and from version 3.10.6 on the 3.10 line.
* balancer
object
***
Load balancing configurations.
* algorithm
string
default: `roundrobin`
vaild vaule:
`roundrobin`, `chash`, or `semantic`
***
Load balancing algorithm. When set to `roundrobin`, weighted round robin algorithm is used. When set to `chash`, consistent hashing algorithm is used. When set to `semantic`, the instance whose `examples` are semantically closest to the prompt is used, configured under `semantic_opts`.
The `semantic` algorithm does not participate in health checks, `fallback_strategy`, or `max_retries`. An upstream failure on the selected instance is returned to the client; the algorithm falls back only when no instance clears its threshold or the embedding request fails.
The `semantic` algorithm is available in API7 Enterprise from version 3.9.18 on the 3.9 line and from version 3.10.5 on the 3.10 line, and in APISIX from version 3.18.0.
* hash\_on
string
default: `vars`
vaild vaule:
`vars`, `header`, `cookie`, `consumer`, or `vars_combinations`
***
Used when `type` is `chash`. Support hashing on [built-in variables](https://docs.api7.ai/apisix/reference/built-in-variables.md), header, cookie, consumer, or a combination of [built-in variables](https://docs.api7.ai/apisix/reference/built-in-variables.md).
* key
string
***
Used when `type` is `chash`. When `hash_on` is set to `header` or `cookie`, `key` is required. When `hash_on` is set to `consumer`, `key` is not required as the consumer name will be used as the key automatically.
* semantic\_opts
object
***
Configurations for the `semantic` balancer algorithm. Required when `balancer.algorithm` is `semantic`, and ignored otherwise.
Available in API7 Enterprise from version 3.9.18 on the 3.9 line and from version 3.10.5 on the 3.10 line, and in APISIX from version 3.18.0.
* embeddings
object
required
***
Embedding service used to turn the prompt and each instance's `examples` into vectors. The prompt is embedded on every request, so this service is on the request path.
* provider
string
required
vaild vaule:
`openai` or `azure-openai`
***
Embedding service provider.
* model
string
required
***
Name of the embedding model, such as `text-embedding-3-small`.
* endpoint
string
***
Embedding API endpoint. Optional for `openai`, which defaults to the public API. Required for `azure-openai`, where it has to be the full URL, such as `https://{resource}.openai.azure.com/openai/deployments/{deployment}/embeddings?api-version={version}`.
* auth
object
required
***
Authentication for the embedding service, carried either as headers or as query parameters.
* header
object
***
Key-value pairs sent as request headers to the embedding service.
* query
object
***
Key-value pairs sent as query parameters to the embedding service.
* timeout
integer
default: `3000`
vaild vaule:
greater than or equal to 1
***
Timeout in milliseconds for an embedding request. Because the prompt is embedded synchronously, this bounds the latency added to each request when the embedding service is slow. On a timeout the request is routed to the fallback instance rather than failed.
* ssl\_verify
boolean
default: `true`
***
If true, verify the embedding service's TLS certificate.
* threshold
number
default: `0`
vaild vaule:
between -1 and 1 inclusive
***
Global minimum cosine similarity an instance has to reach to be selected. An instance's own `threshold` overrides this value. The default of `0` admits almost any prompt, so the fallback instance is only ever reached once a threshold above `0` is set.
* fallback
string
***
Name of the instance to route to when no instance clears its threshold or the embedding request fails. It is otherwise a normally ranked instance and needs its own `examples`. Defaults to the first instance when unset.
* debugging
boolean
default: `false`
***
If true, return the per-instance similarity scores and the routing decision in the `X-AI-Semantic-Scores` and `X-AI-Semantic-Picked-Instance` response headers. Intended for tuning `examples` and thresholds, not for production traffic.
* instances
array\[object]
required
***
LLM instance configurations.
* name
string
required
***
Name of the LLM service instance.
* examples
array\[string]
vaild vaule:
between 1 and 64 items
***
Example utterances representing what this instance handles. Each one is embedded into its own reference vector, and the semantic balancer routes a request to the instance whose closest example is most similar to the prompt.
Required for every instance when `balancer.algorithm` is `semantic`, including the instance named by `semantic_opts.fallback`. Ignored by the other algorithms.
Available in API7 Enterprise from version 3.9.18 on the 3.9 line and from version 3.10.5 on the 3.10 line, and in APISIX from version 3.18.0.
* threshold
number
vaild vaule:
between -1 and 1 inclusive
***
Minimum cosine similarity a prompt has to reach for this instance to be selected by the semantic balancer. Overrides `semantic_opts.threshold` for this instance.
Available in API7 Enterprise from version 3.9.18 on the 3.9 line and from version 3.10.5 on the 3.10 line, and in APISIX from version 3.18.0.
* provider
string
required
vaild vaule:
`openai`, `deepseek`, `azure-openai`, `aimlapi`, `gemini`, `vertex-ai`, `anthropic`, `openrouter`, `bedrock`, `openai-compatible`
***
LLM service provider.
When set to `openai`, the plugin sends detected Chat Completions, Responses API, and Embeddings requests to their corresponding OpenAI endpoints.
When set to `deepseek`, the plugin will proxy requests to `https://api.deepseek.com/chat/completions`.
When set to `gemini` (available from APISIX 3.15.0 and Enterprise 3.9.2), the plugin will proxy requests to `https://generativelanguage.googleapis.com/v1beta/openai/chat/completions`. If you are proxying requests to an embedding model, you should configure the embedding model endpoint in the `override`.
When set to `vertex-ai` (available from APISIX 3.15.0 and Enterprise 3.9.2), the plugin proxies requests to Google Cloud Vertex AI. For chat completions, the plugin will proxy requests to `https://{region}-aiplatform.googleapis.com/v1beta1/projects/{project_id}/locations/{region}/endpoints/openapi/chat/completions`. For embeddings, the plugin will proxy requests to `https://{region}-aiplatform.googleapis.com/v1/projects/{project_id}/locations/{region}/publishers/google/models/{model}:predict`. These require configuring `provider_conf` with `project_id` and `region`. Alternatively, you can configure `override` for a custom endpoint.
When set to `anthropic` (available from APISIX 3.15.0 and Enterprise 3.9.2), the plugin sends detected Chat Completions requests to `https://api.anthropic.com/v1/chat/completions` and native Anthropic Messages requests to `https://api.anthropic.com/v1/messages`.
When set to `openrouter` (available from APISIX 3.15.0 and Enterprise 3.9.2), the plugin will proxy requests to `https://openrouter.ai/api/v1/chat/completions`.
When set to `bedrock` (available from API7 Enterprise 3.9.12 and APISIX 3.17.0), the plugin proxies requests to AWS Bedrock using the Converse API.
When set to `aimlapi` (available from APISIX 3.14.0 and Enterprise 3.8.17), the plugin uses the OpenAI-compatible driver and proxies the request to `https://api.aimlapi.com/v1/chat/completions`.
When set to `openai-compatible`, the plugin proxies requests to the custom endpoint configured in `override`.
When set to `azure-openai`, the plugin also proxies requests to the custom endpoint configured in `override` and additionally removes the `model` parameter from user requests.
* priority
integer
default: `0`
***
Priority of the LLM instance in load balancing. `priority` takes precedence over `weight`.
* weight
integer
required
vaild vaule:
greater than or equal to 0
***
Weight of the LLM instance in load balancing.
* auth
object
required
***
Authentication configurations.
* header
object
***
Authentication headers. At least one of the `header` and `query` should be configured. You can configure additional custom headers that will be forwarded to the upstream LLM service.
* query
object
***
Authentication query parameters. At least one of the `header` and `query` should be configured.
* gcp
object
***
GCP service account authentication for Vertex AI. Available in API7 Enterprise from 3.9.2 and APISIX from version 3.17.0.
* service\_account\_json
string
***
GCP service account JSON content used for authentication. This can be configured using this parameter or by setting the `GCP_SERVICE_ACCOUNT` environment variable.
* max\_ttl
integer
***
Maximum TTL for GCP access token caching, in seconds.
* expire\_early\_secs
integer
default: `60`
***
Number of seconds to expire the access token before its actual expiration time. This prevents edge cases where tokens expire during active requests.
* aws
object
***
AWS IAM credentials for SigV4 signing. Required when `provider` is `bedrock` (for Bedrock, `auth.aws` is sufficient and `auth.header`/`auth.query` are not required). Available in API7 Enterprise from version 3.9.12 and APISIX from version 3.17.0.
* access\_key\_id
string
required
***
AWS IAM access key ID.
* secret\_access\_key
string
required
***
AWS IAM secret access key.
* session\_token
string
***
AWS session token for temporary credentials (e.g. from STS AssumeRole).
* options
object
***
Model configurations.
In addition to `model`, you can configure additional parameters and they will be forwarded to the upstream LLM service in the request body. For instance, if you are working with OpenAI or DeepSeek, you can configure additional parameters such as `max_tokens`, `temperature`, `top_p`, and `stream`. See your LLM provider's API documentation for more available options.
* model
string
***
Name of the LLM model, such as `gpt-4` or `gpt-3.5`. See your LLM provider's API documentation for more available models.
* provider\_conf
object
***
Provider-specific configuration. Required when `provider` is `bedrock`. When `provider` is `vertex-ai`, configure either `provider_conf` or `override.endpoint`.
Available in API7 Enterprise from 3.9.2 and APISIX from version 3.17.0.
* project\_id
string
***
Google Cloud Project ID for Vertex AI.
* region
string
required
***
Cloud region. For `vertex-ai`, this is the GCP region. For `bedrock`, this is the AWS region (e.g. `us-east-1`).
* override
object
***
Override setting.
* endpoint
string
***
LLM provider endpoint to replace the endpoint selected for the detected request protocol.
* llm\_options
object
***
Provider-aware LLM option overrides. Available in API7 Enterprise from version 3.9.10 and APISIX from version 3.17.0.
* max\_tokens
integer
***
Maximum number of output tokens. The gateway automatically maps this to the correct field name for the target provider, such as `max_completion_tokens` for OpenAI Chat or `max_output_tokens` for OpenAI Responses API, and overwrites the client value.
* request\_body
object
***
Per target-protocol request body overrides. Keys are target protocol names, such as `openai-chat`, `openai-responses`, `openai-embeddings`, `anthropic-messages`, `bedrock-converse`, and `passthrough`. Values are partial request bodies that are deep-merged into the outgoing body. Available in API7 Enterprise from version 3.9.10 and APISIX from version 3.17.0.
* request\_body\_force\_override
boolean
default: `false`
***
When `false` (default), client request body fields take priority and `request_body` override values only fill in missing fields. When `true`, `request_body` override values overwrite client fields. Available in API7 Enterprise from version 3.9.10 and APISIX from version 3.17.0.
* checks
object
***
Health check configurations.
Note that at the moment, OpenAI and DeepSeek do not provide an official health check endpoint. Other LLM services that you can configure under `openai-compatible` provider may have available health check endpoints.
* active
object
required
***
Active health check configurations.
* type
string
default: `http`
vaild vaule:
`http`, `https`, or `tcp`
***
Type of health check connection.
* timeout
number
default: `1`
***
Health check timeout in seconds.
* concurrency
integer
default: `10`
***
Number of upstream nodes to be checked at the same time.
* host
string
***
HTTP host.
* port
integer
vaild vaule:
between 1 and 65535 inclusive
***
HTTP port.
* http\_path
string
default: `/`
***
Path for HTTP probing requests.
* http\_method
string
default: `GET`
vaild vaule:
`CONNECT`, `DELETE`, `GET`, `HEAD`, `OPTIONS`, `PATCH`, `POST`, `PURGE`, `PUT`, or `TRACE`
***
HTTP method for active health check probing requests. Available in API7 Enterprise and in APISIX from version 3.18.0.
* http\_req\_body
string
***
Request body to send in active health check probing requests. This is useful when `http_method` is set to `POST`. Defaults to empty string. Available in API7 Enterprise and in APISIX from version 3.18.0.
* https\_verify\_certificate
boolean
default: `true`
***
If true, verify the node's TLS certificate.
* healthy
object
***
Healthy check configurations.
* interval
integer
default: `1`
***
Time interval of checking healthy nodes, in seconds.
* http\_statuses
array\[integer]
default: `[200,302]`
vaild vaule:
status code between 200 and 599 inclusive
***
An array of HTTP status codes that defines a healthy node.
* successes
integer
default: `2`
vaild vaule:
between 1 and 254 inclusive
***
Number of successful probes to define a healthy node.
* req\_headers
array\[string]
***
List of additional HTTP headers to send in health check probing requests, in `"Header: Value"` format.
* unhealthy
object
***
Unhealthy check configurations.
* interval
integer
default: `1`
***
Time interval of checking unhealthy nodes, in seconds.
* http\_statuses
array\[integer]
default: `[429,404,500,501,502,503,504,505]`
vaild vaule:
status code between 200 and 599 inclusive
***
An array of HTTP status codes that defines an unhealthy node.
* http\_failures
integer
default: `5`
vaild vaule:
between 1 and 254 inclusive
***
Number of HTTP failures to define an unhealthy node.
* tcp\_failures
integer
default: `2`
vaild vaule:
between 1 and 254 inclusive
***
Number of TCP failures to define an unhealthy node.
* timeouts
integer
default: `3`
vaild vaule:
between 1 and 254 inclusive
***
Number of probe timeouts to define an unhealthy node.
* logging
object
***
Logging configurations. These configurations apply to access logs and logs sent to logging plugins, and do not affect the error log.
* summaries
boolean
default: `false`
***
If true, add an `llm_summary` object to logger entries with model, latency, and token usage. In API7 Enterprise 3.9.18 and 3.10.5, and in APISIX 3.18.0, the summary also includes stream status, tool count and usage, end-user ID, cache read and creation tokens, reasoning tokens, and content risk level when available.
* payloads
boolean
default: `false`
***
If true, log request and response payload.
* timeout
integer
default: `30000`
vaild vaule:
between 1 and 600000 inclusive
***
Timeout in milliseconds for each connect, send, or blocking read operation to the LLM service. It does not limit the total duration of a streaming response; use `max_stream_duration_ms` for that limit.
* max\_req\_body\_size
integer
default: `67108864`
vaild vaule:
greater than or equal to 1
***
Maximum request body size in bytes that the plugin reads into memory. Larger requests are rejected with HTTP 413. This prevents unbounded memory buffering of large request bodies. The default is 67108864 bytes (64 MiB). Available in API7 Enterprise from versions 3.9.14 and 3.10.1 in their respective release lines, and APISIX from version 3.17.0.
* max\_stream\_duration\_ms
integer
vaild vaule:
greater than or equal to 1
***
Maximum wall-clock duration, in milliseconds, for a streaming AI response. The limit is optional. When reached, the gateway closes the connection; if output has already started, the stream ends without a protocol terminator such as `[DONE]`, `message_stop`, or `response.completed`. Enforcement occurs between upstream reads, so the final chunk can exceed the configured duration. Available in API7 Enterprise from version 3.9.10 and APISIX from version 3.17.0.
* max\_response\_bytes
integer
vaild vaule:
greater than or equal to 1
***
Maximum total bytes read from the upstream for one streaming or non-streaming AI response. The limit is optional and checked between upstream reads, so the final chunk can exceed it. If the limit is exceeded before output starts, the gateway returns `502 Bad Gateway`; after output starts, the gateway closes the stream without a protocol terminator. Available in API7 Enterprise from version 3.9.10 and APISIX from version 3.17.0.
* streaming\_flush\_interval\_ms
integer
default: `10`
vaild vaule:
greater than or equal to 0
***
Background flush interval in milliseconds for streaming responses. A positive value periodically flushes buffered output to bound client latency when the upstream sends tokens in bursts. Set to 0 to flush each chunk synchronously. Available in API7 Enterprise from version 3.9.13 and APISIX from version 3.17.0.
* keepalive
boolean
default: `true`
***
If true, keep the connection alive when requesting the LLM service.
* keepalive\_timeout
integer
default: `60000`
vaild vaule:
greater than or equal to 1000
***
Keepalive timeout in milliseconds when requesting the LLM service.
* keepalive\_pool
integer
default: `30`
vaild vaule:
greater than or equal to 1
***
Keepalive pool size for when connecting with the LLM service.
* ssl\_verify
boolean
default: `true`
***
If true, verify the LLM service's certificate.
---
# Protocol Reference
The `ai-proxy` and `ai-proxy-multi` plugins share the same request protocol detection and conversion pipeline. The pipeline identifies the client format before routing to the configured provider or selected instance.
For plugin-specific configuration, see [`ai-proxy`](https://docs.api7.ai/hub/ai-proxy.md) and [`ai-proxy-multi`](https://docs.api7.ai/hub/ai-proxy-multi.md).
## Request Protocol Detection[](#request-protocol-detection "Direct link to Request Protocol Detection")
The plugins identify the client protocol before matching it to a protocol supported by the selected provider or instance. The following detection rules apply to both plugins.
### Request Requirements[](#request-requirements "Direct link to Request Requirements")
Requests that include `Content-Type` must use `application/json`. If the header is omitted, the plugins treat the body as JSON. They reject unsupported content types and invalid bodies before selecting a provider or instance.
The request body cannot exceed `max_req_body_size`, which defaults to 67,108,864 bytes. A request that exceeds this limit receives an HTTP 413 response. In API7 Gateway, this setting is available from 3.9.14 in the 3.9.x line and from 3.10.1 in the 3.10.x line. It is available in APISIX 3.17.0 and later.
### Detection Order[](#detection-order "Direct link to Detection Order")
The plugins check the following rules in order:
| Client protocol | Body signal | Path requirement |
| ----------------------- | --------------------------------------------------------------- | -------------------------------------------------------------- |
| Bedrock Converse | The request body contains a `messages` array. | The path ends in `/converse`; custom prefixes are allowed. |
| Anthropic Messages | The request body is a JSON object. | The path ends in `/v1/messages`; custom prefixes are allowed. |
| OpenAI Responses | The request body contains `input`. | The path ends in `/v1/responses`; custom prefixes are allowed. |
| OpenAI Chat Completions | The request body contains a `messages` array. | Any path matched by the route. |
| OpenAI Embeddings | The request body contains `input`, and no earlier rule matched. | Any path matched by the route. |
The path-specific rules run before the body-only rules. This prevents Bedrock Converse and Anthropic Messages requests containing `messages` from being identified as Chat Completions. Responses and Embeddings requests both use `input`, so a request containing `input` but not `messages` is identified as Embeddings unless its path ends in `/v1/responses`.
Any other non-empty JSON object is treated as passthrough. This mode keeps the original request path and can reuse the original body when no request transformation changes it. Provider authentication and `override.endpoint` still apply. Empty or invalid request bodies are rejected.
Passthrough does not provide an AI protocol model to downstream AI-aware plugins. Usage extraction, prompt decoration or templating, content moderation text extraction, and protocol conversion therefore do not run for the passthrough body.
### After Detection[](#after-detection "Direct link to After Detection")
For a named protocol, the plugin uses the detected protocol without conversion when the selected provider supports it. Otherwise, the plugin looks for a registered converter to a protocol the provider supports. The request is rejected if neither native support nor a compatible converter is available.
The detected protocol and request body determine whether `request_type` is recorded as `ai_stream` or `ai_chat` for logging plugins. Response parsing uses the upstream response's content type to distinguish streaming from non-streaming responses.
## Request Override Precedence[](#request-override-precedence "Direct link to Request Override Precedence")
The final plugin configuration uses `override.llm_options.max_tokens` for provider-aware token-limit mapping. The provider maps that value to the field expected by the target protocol, then applies the matching `override.request_body` object.
Request-body objects are merged recursively. Arrays and scalar values replace the existing value rather than being combined. With `request_body_force_override: false`, client fields win and the override fills only missing values; with `true`, override values replace matching client fields. The request-body key names the target protocol after any conversion, such as `openai-chat`, `anthropic-messages`, or `bedrock-converse`.
## Failure Responses[](#failure-responses "Direct link to Failure Responses")
| Condition | Client-visible behavior |
| -------------------------------------------------------------------------------- | ------------------------------ |
| Request body exceeds `max_req_body_size` | `413 Request Entity Too Large` |
| LLM connection or read times out before a response is available | `504 Gateway Timeout` |
| A streaming converter receives a response it cannot parse in the selected format | `502 Bad Gateway` |
| `ai-request-rewrite` receives a request without a body | `400 Bad Request` |
If a response limit is reached after streaming output has begun, the gateway closes the downstream stream. It cannot replace bytes already sent with a new HTTP error response.
## Anthropic-to-OpenAI Conversion[](#anthropic-to-openai-conversion "Direct link to Anthropic-to-OpenAI Conversion")
An Anthropic Messages client can send requests through `ai-proxy` or `ai-proxy-multi` to a backend that supports OpenAI Chat Completions. The plugins convert the client request to OpenAI format and convert the backend response to Anthropic format. This conversion supports a subset of the Anthropic Messages API: it preserves some fields, transforms others, and discards unsupported fields.
### When Conversion Applies[](#when-conversion-applies "Direct link to When Conversion Applies")
The plugins identify an Anthropic Messages request when the request path ends in `/v1/messages` and the body is a JSON object. If the selected provider supports Anthropic Messages, the request uses that protocol without conversion. If the provider supports OpenAI Chat Completions instead, the shared converter translates the request and response.
The reverse client/backend pairing is not supported: an OpenAI Chat Completions client cannot use this converter to call an Anthropic Messages backend.
For `ai-proxy-multi`, the selected instance determines whether conversion is required. The [conversion configuration example](https://docs.api7.ai/hub/ai-proxy.md#convert-anthropic-requests-to-openai-compatible-backend) uses `ai-proxy`; for multi-instance configuration, see [`ai-proxy-multi`](https://docs.api7.ai/hub/ai-proxy-multi.md).
### Request Conversion[](#request-conversion "Direct link to Request Conversion")
The converted request body is built from an allowlist. The following tables summarize the Anthropic inputs the converter reads. Unrecognized fields are discarded before the request reaches the backend.
#### Request Fields[](#request-fields "Direct link to Request Fields")
| Anthropic field | OpenAI field | Behavior |
| --------------------------------------- | --------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `model` | `model` | Forwarded, unless the route pins a model with `options.model`. |
| `max_tokens` | `max_completion_tokens` | Renamed. |
| `stop_sequences` | `stop` | Renamed. |
| `temperature`, `top_p` | Same names | Forwarded. |
| `stream` | `stream`, plus `stream_options.include_usage` | The plugin sets `stream_options.include_usage` so that the stream carries usage. |
| `system` | A leading message with `role: system` | Text blocks are concatenated into one string. |
| `tools[]` (custom tools) | `tools[].function` | A tool name containing characters outside `[a-zA-Z0-9_-]`, or longer than 64 characters, is rewritten to satisfy the OpenAI naming rules. The original name is restored in the response. |
| `tool_choice` | `tool_choice` | Converted. `{"type": "auto"}` becomes `"auto"`, `{"type": "any"}` becomes `"required"`, `{"type": "none"}` becomes `"none"`, and `{"type": "tool", "name": "..."}` becomes an object naming that function. |
| `tool_choice.disable_parallel_tool_use` | `parallel_tool_calls: false` | Converted. |
| `thinking` | `reasoning_effort` | Approximated. A continuous `budget_tokens` value is mapped to one discrete effort level. The thresholds are release-dependent. |
| `output_config.effort` | `reasoning_effort` | Used when `thinking.type` is `adaptive`. Release-dependent; see [Release Compatibility](#release-compatibility). |
| `output_format`, `output_config.format` | `response_format` | Release-dependent; see [Release Compatibility](#release-compatibility). |
| `metadata.user_id` | `user` | Renamed. |
| `service_tier` | `service_tier` | Forwarded. |
#### Message Content[](#message-content "Direct link to Message Content")
| Anthropic content | OpenAI equivalent | Behavior |
| -------------------------------- | --------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `messages[].content` as a string | `messages[].content` as the same string | Forwarded. |
| `text` | A text content part, or a plain string | The shape depends on the release; see [Release Compatibility](#release-compatibility). |
| `image` with a base64 source | `image_url` with a `data:` URL | Converted. Whether the backend model accepts image input varies by model. |
| `image` with a URL source | `image_url` with the same URL | Forwarded unchanged. |
| `document` with a base64 source | `image_url` with a `data:` URL | Approximation. The document bytes are placed in a field the OpenAI schema defines for images, so whether a backend accepts them is outside that schema. |
| `tool_use` | An assistant message with `tool_calls` | Converted. Tool-name handling in message history is release-dependent; see [Release Compatibility](#release-compatibility). |
| `tool_result` | A message with `role: tool` | Converted. Its ordering relative to ordinary text is release-dependent; see [Release Compatibility](#release-compatibility). |
#### Dropped Fields[](#dropped-fields "Direct link to Dropped Fields")
The backend does not receive the following fields, and the response carries no signal that they were removed:
| Anthropic field | Why it is dropped |
| ------------------------------------------------------------------------------------------------ | ----------------------------------------------------------------------------------------------------- |
| `top_k` | OpenAI Chat Completions has no equivalent parameter. |
| `cache_control` | No equivalent. The converted request carries no caching directive. |
| `citations` | The converter does not map citations in either direction. |
| `thinking` and `redacted_thinking` blocks in message history | OpenAI Chat Completions has no equivalent field. Ordinary text in the same assistant message is kept. |
| Anthropic built-in tools (`computer_`, `bash_`, `text_editor_`, `web_search`, `code_execution_`) | The converter has no mapping for these tools. |
#### Request Headers[](#request-headers "Direct link to Request Headers")
If a request has an `x-api-key` header but no `Authorization` header, the converter sends the key as a bearer token in `Authorization`. It removes the original `x-api-key` header and headers whose names start with `anthropic-` or `x-stainless-`.
### Response Conversion[](#response-conversion "Direct link to Response Conversion")
The converter reads completion fields only from `choices[0]`; any additional OpenAI choices are discarded. It maps top-level `usage` and `error` fields separately.
| OpenAI response field | Anthropic response | Behavior |
| -------------------------------------------------- | ----------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `message.content` | A `text` content block | Converted. |
| `message.reasoning_content` or `message.reasoning` | A `thinking` content block | Converted when the backend returns a non-empty string. A non-streaming block has an empty signature; see [Known Limitations](#known-limitations). |
| `message.tool_calls` | `tool_use` content blocks | Converted. Sanitized tool names are restored when the original name is available. |
| `finish_reason` | `stop_reason` | `stop` and `content_filter` become `end_turn`; `length` becomes `max_tokens`; `tool_calls` and `function_call` become `tool_use`. Any other value defaults to `end_turn`. |
| `usage` | `input_tokens`, `output_tokens`, and available cache-token fields | `prompt_tokens` becomes `input_tokens`, and `completion_tokens` becomes `output_tokens`. When cache details are available, cached prompt tokens are removed from `input_tokens` and reported as `cache_read_input_tokens`; `cache_creation_input_tokens` is also included when provided. |
| `error` | An Anthropic error object | Converted when a normally parsed upstream response body contains an error object. HTTP 429, 5xx, and transport errors can bypass this conversion. |
For streaming responses, the converter emits Anthropic message and content-block events for OpenAI text, reasoning, and tool-call deltas. The initial `message_start` usage values are zero; final token usage is emitted in `message_delta`. Available cache-token fields can be included when the backend supplies them in a supported usage chunk. Clients that report streaming usage should read the final event and should not assume that cache-token fields are present.
### Release Compatibility[](#release-compatibility "Direct link to Release Compatibility")
API7 Gateway 3.9.x and 3.10.x receive fixes independently. Check the column for the release line you run.
| Behavior | API7 Gateway 3.9.x | API7 Gateway 3.10.x | APISIX |
| --------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------ | ------------------- | ---------------- |
| An orphaned `tool_choice` is removed when every tool was dropped | 3.9.16 and later | 3.10.2 and later | 3.18.0 and later |
| A malformed backend tool call degrades instead of failing the response | 3.9.16 and later | 3.10.2 and later | 3.18.0 and later |
| `message_start.content` is serialized as an array | 3.9.16 and later | 3.10.3 and later | 3.18.0 and later |
| Anthropic's current structured-output shape is recognized | 3.9.16 and later | 3.10.3 and later | 3.18.0 and later |
| `thinking.type: adaptive` uses `output_config.effort` | 3.9.16 and later | 3.10.3 and later | 3.18.0 and later |
| `thinking.budget_tokens` uses the four-level mapping described below | 3.9.16 and later | 3.10.3 and later | 3.18.0 and later |
| A user message with a single text block is sent as a content array, and an assistant message with several text blocks is concatenated into a string | 3.9.16 and later | 3.10.3 and later | 3.18.0 and later |
| Tool names in message history are rewritten consistently with declared tools | 3.9.16 and later | 3.10.3 and later | 3.18.0 and later |
| `tool_result` messages are placed before ordinary text from the same user message | 3.9.16 and later | 3.10.3 and later | 3.18.0 and later |
| Media is retained when a user message also contains `tool_result` | 3.9.16 and later | 3.10.3 and later | 3.18.0 and later |
These version differences affect structured output, message content, thinking effort, and tool history as follows:
#### Structured Output[](#structured-output "Direct link to Structured Output")
API7 Gateway 3.9.15 and earlier, API7 Gateway 3.10.0 through 3.10.2, and APISIX 3.17.0 recognize only the converter's legacy expected shape. That shape is `output_config` or `output_format` carrying `type: json_schema` together with a `json_schema` field, or carrying `type: json` or `type: json_object`.
Anthropic's current shape carries the schema in `output_format.schema` or in `output_config.format`. In the 3.9.x line, API7 Gateway 3.9.16 and later recognize this shape. In the 3.10.x line, 3.10.3 and later recognize it. APISIX 3.18.0 and later recognize it as well. These releases normalize the schema and send `response_format` with strict mode enabled. On earlier releases, the backend receives no `response_format`, and the client receives no error.
#### Message Content Shape[](#message-content-shape "Direct link to Message Content Shape")
On a release that predates the change, a user message carrying a single text block is sent as a plain string. An assistant message carrying several text blocks is sent as a content array. A backend that accepts only one of these shapes behaves differently across an upgrade.
#### Thinking Effort[](#thinking-effort "Direct link to Thinking Effort")
The `budget_tokens` mapping changes across releases. The earlier mapping applies to APISIX 3.17.0 and API7 Gateway releases before 3.9.16 or 3.10.3 in their respective lines. The later mapping applies from APISIX 3.18.0 and from API7 Gateway 3.9.16 and 3.10.3 in their respective lines.
| `budget_tokens` | Earlier releases | Later releases |
| ------------------ | ---------------- | -------------- |
| Below 1024 | `low` | `minimal` |
| 1024 through 2047 | `low` | `low` |
| 2048 through 4095 | `low` | `medium` |
| 4096 through 16383 | `medium` | `high` |
| 16384 or higher | `high` | `high` |
| Not provided | `medium` | `minimal` |
#### Tool History[](#tool-history "Direct link to Tool History")
On an earlier release, a `tool_use` name in message history is not rewritten with the corresponding declared tool name. Ordinary text can also be sent before `tool_result` messages from the same user message, and media in that message is discarded. A strict backend may reject the name or ordering mismatch. APISIX 3.18.0 and later, API7 Gateway 3.9.16 and later, and API7 Gateway 3.10.3 and later rewrite history names consistently, place tool messages first, and retain media.
### Known Limitations[](#known-limitations "Direct link to Known Limitations")
The following limitations can affect converted requests and responses across the supported releases.
#### Streaming Can End Without a Terminating Event[](#streaming-can-end-without-a-terminating-event "Direct link to Streaming Can End Without a Terminating Event")
When a backend closes the stream without a properly delimited final frame, the plugins do not emit the closing `message_delta` and `message_stop` events. A client that relies on `message_stop` may wait indefinitely or treat the stream as incomplete. This affects every release listed above. Set a client-side timeout and treat an unexpected end of the stream as a failure.
#### Converted `thinking` Blocks Do Not Carry a Valid Signature[](#converted-thinking-blocks-do-not-carry-a-valid-signature "Direct link to converted-thinking-blocks-do-not-carry-a-valid-signature")
For a non-streaming response, the plugins set the block's `signature` to an empty string. For a streaming response, they emit thinking deltas without a signature. Clients that require a valid signature cannot replay either converted form as a signed Anthropic thinking block. A backend that instead embeds reasoning in ordinary message content produces a response where the reasoning appears as visible text.
#### Error Responses Are Not Consistently Anthropic-Shaped[](#error-responses-are-not-consistently-anthropic-shaped "Direct link to Error Responses Are Not Consistently Anthropic-Shaped")
HTTP 429, 5xx, and transport timeout responses can bypass response conversion. Clients should be prepared to receive an upstream or gateway error body that does not follow the Anthropic error schema.
#### Backend Capabilities Are Not Validated[](#backend-capabilities-are-not-validated "Direct link to Backend Capabilities Are Not Validated")
The plugins convert the request but do not check whether the backend model supports the result. A backend can return HTTP 200 while silently ignoring a capability, such as dropping an image, ignoring `response_format`, or returning no tool call.
Backend behavior varies by model and between dated snapshots of the same model name. Validate the specific models you plan to use rather than generalizing from a backend.
### Validate Backend Compatibility[](#validate-backend-compatibility "Direct link to Validate Backend Compatibility")
Test the following converted inputs against each backend model because a backend can reject them even when the original Anthropic request is valid:
* **A named `tool_choice`.** The converter emits an object naming the function, or `"required"`. Some backends accept only `"auto"` while the model is reasoning. If a backend rejects the converted form, send `{"type": "auto"}` from the client.
* **`thinking` together with a small `max_tokens`.** `thinking` becomes `reasoning_effort`, which can make a backend reserve a reasoning budget. When that budget exceeds the converted `max_completion_tokens`, the backend rejects the request. Raise `max_tokens` when you enable `thinking`.
* **A `document` block.** The converter can only offer it to the backend as an image. A model that cannot read it may answer with invented content instead of reporting an error.
* **Mixed text, media, and `tool_result` content.** Earlier releases can put ordinary text before the converted tool message and discard media from the same user message. Test this shape if the backend validates tool-message ordering, or upgrade to a release that places tool messages first and retains media.
## Related Configuration[](#related-configuration "Direct link to Related Configuration")
* [Configure `ai-proxy` to convert Anthropic requests](https://docs.api7.ai/hub/ai-proxy.md#convert-anthropic-requests-to-openai-compatible-backend).
* [Configure native Anthropic Messages pass-through](https://docs.api7.ai/hub/ai-proxy.md#native-anthropic-messages-api-pass-through).
* [Configure `ai-proxy-multi`](https://docs.api7.ai/hub/ai-proxy-multi.md).
* [Convert Anthropic Messages with API7 Gateway](https://docs.api7.ai/api7-gateway/ai-gateway/use-cases/protocol-conversion.md).
---
## Static Configurations[](#static-configurations "Direct link to Static Configurations")
APISIX 3.18.0 uses `ngx_http_ffi_client` by default for upstream requests from `ai-proxy`, `ai-proxy-multi`, and `ai-request-rewrite`. Set `http_client` to `lua-resty-http` to use the Lua client instead. API7 Gateway 3.9 and 3.10 use the Lua client and do not expose this setting.
* Host or Docker
* Kubernetes (Helm)
To use the Lua client in an APISIX host or Docker deployment, configure the following setting:
config.yaml
```
plugin_attr:
ai-proxy:
http_client: lua-resty-http
```
Then reload APISIX for the change to take effect.
Export the full effective values for the installed APISIX release:
```
helm get values -n --all -o yaml > values.yaml
```
Add or update the following value:
values.yaml
```
apisix:
pluginAttrs:
ai-proxy:
http_client: lua-resty-http
```
Then apply the values file with the chart used for this APISIX release:
```
helm upgrade apisix/apisix -n -f values.yaml
```
## Parameters[](#parameters "Direct link to Parameters")
See plugin [common configurations](https://docs.api7.ai/apisix/reference/plugin-common-configurations.md) for configuration options available to all plugins.
* provider
string
required
vaild vaule:
`openai`, `deepseek`, `azure-openai`, `aimlapi`, `gemini`, `vertex-ai`, `anthropic`, `openrouter`, `bedrock`, `openai-compatible`
***
LLM service provider.
When set to `openai`, the plugin sends detected Chat Completions, Responses API, and Embeddings requests to their corresponding OpenAI endpoints.
When set to `deepseek`, the plugin will proxy requests to `https://api.deepseek.com/chat/completions`.
When set to `gemini` (available from APISIX 3.15.0 and Enterprise 3.9.2), the plugin will proxy requests to `https://generativelanguage.googleapis.com/v1beta/openai/chat/completions`. If you are proxying requests to an embedding model, you should configure the embedding model endpoint in the `override`.
When set to `vertex-ai` (available from APISIX 3.15.0 and Enterprise 3.9.2), the plugin proxies requests to Google Cloud Vertex AI. For chat completions, the plugin will proxy requests to `https://{region}-aiplatform.googleapis.com/v1beta1/projects/{project_id}/locations/{region}/endpoints/openapi/chat/completions`. For embeddings, the plugin will proxy requests to `https://{region}-aiplatform.googleapis.com/v1/projects/{project_id}/locations/{region}/publishers/google/models/{model}:predict`. These require configuring `provider_conf` with `project_id` and `region`. Alternatively, you can configure `override` for a custom endpoint.
When set to `anthropic` (available from APISIX 3.15.0 and Enterprise 3.9.2), the plugin sends detected Chat Completions requests to `https://api.anthropic.com/v1/chat/completions` and native Anthropic Messages requests to `https://api.anthropic.com/v1/messages`.
When set to `openrouter` (available from APISIX 3.15.0 and Enterprise 3.9.2), the plugin will proxy requests to `https://openrouter.ai/api/v1/chat/completions`.
When set to `bedrock` (available from API7 Enterprise 3.9.12 and APISIX 3.17.0), the plugin proxies requests to AWS Bedrock using the [Converse API](https://docs.aws.amazon.com/bedrock/latest/APIReference/API_runtime_Converse.html). Requires configuring `auth.aws` with IAM credentials and `provider_conf.region` with the AWS region. Supports both non-streaming and streaming (ConverseStream) when `stream` is set to `true` in the request body.
When set to `aimlapi` (available from APISIX 3.14.0 and Enterprise 3.8.17), the plugin uses the OpenAI-compatible driver and proxies the request to `https://api.aimlapi.com/v1/chat/completions`.
When set to `openai-compatible`, the plugin proxies requests to the custom endpoint configured in `override`.
When set to `azure-openai`, the plugin also proxies requests to the custom endpoint configured in `override` and additionally removes the `model` parameter from user requests.
* auth
object
required
***
Authentication configurations.
* header
object
***
Authentication headers.
* query
object
***
Authentication query parameters.
* gcp
object
***
GCP service account authentication for Vertex AI. Available in API7 Enterprise from 3.9.2 and APISIX from version 3.17.0.
* service\_account\_json
string
***
GCP service account JSON content used for authentication. This can be configured using this parameter or by setting the `GCP_SERVICE_ACCOUNT` environment variable.
* max\_ttl
integer
***
Maximum TTL for GCP access token caching, in seconds.
* expire\_early\_secs
integer
default: `60`
***
Number of seconds to expire the access token before its actual expiration time. This prevents edge cases where tokens expire during active requests.
* aws
object
***
AWS IAM credentials for SigV4 signing. Required when `provider` is `bedrock` (for Bedrock, `auth.aws` is sufficient and `auth.header`/`auth.query` are not required). Available in API7 Enterprise from version 3.9.12 and APISIX from version 3.17.0.
* access\_key\_id
string
required
***
AWS IAM access key ID.
* secret\_access\_key
string
required
***
AWS IAM secret access key.
* session\_token
string
***
AWS session token for temporary credentials (e.g. from STS AssumeRole).
* options
object
***
Model configurations.
In addition to `model`, you can configure additional parameters and they will be forwarded to the upstream LLM service in the request body. For instance, if you are working with OpenAI, you can configure additional parameters such as `temperature`, `top_p`, and `stream`. See your LLM provider's API documentation for more available options.
* model
string
***
Name of the LLM model, such as `gpt-4` or `gpt-3.5`. See your LLM provider's API documentation for more available models.
* provider\_conf
object
***
Provider-specific configuration. Required when `provider` is `bedrock`. When `provider` is `vertex-ai`, configure either `provider_conf` or `override.endpoint`.
Available in API7 Enterprise from 3.9.2 and APISIX from version 3.17.0.
* project\_id
string
***
Google Cloud Project ID. Required when `provider` is `vertex-ai`.
* region
string
required
***
Cloud region. For `vertex-ai`, this is the GCP region. For `bedrock`, this is the AWS region (e.g. `us-east-1`).
* override
object
***
Override setting.
* endpoint
string
***
LLM provider endpoint. Required when `provider` is `openai-compatible`.
* llm\_options
object
***
Provider-aware LLM option overrides. Available in API7 Enterprise from version 3.9.10 and APISIX from version 3.17.0.
* max\_tokens
integer
***
Maximum number of output tokens. The gateway automatically maps this to the correct field name for the target provider (e.g. `max_completion_tokens` for OpenAI Chat, `max_output_tokens` for OpenAI Responses API). Always force-overwrites the client value.
* request\_body
object
***
Per target-protocol request body overrides. Keys are target protocol names (`openai-chat`, `openai-responses`, `openai-embeddings`, `anthropic-messages`, `bedrock-converse`, `passthrough`); values are partial request bodies that are deep-merged into the outgoing body (objects merged recursively, arrays and scalars replaced wholesale). Available in API7 Enterprise from version 3.9.10 and APISIX from version 3.17.0.
* request\_body\_force\_override
boolean
default: `false`
***
When `false` (default), client request body fields take priority and `request_body` override values only fill in missing fields. When `true`, `request_body` override values forcefully overwrite client fields. Available in API7 Enterprise from version 3.9.10 and APISIX from version 3.17.0.
* logging
object
***
Logging configurations. These configurations apply to access logs and logs sent to logging plugins, and do not affect the error log.
* summaries
boolean
default: `false`
***
If true, add an `llm_summary` object to logger entries with model, latency, and token usage. In API7 Enterprise 3.9.18 and 3.10.5, and in APISIX 3.18.0, the summary also includes stream status, tool count and usage, end-user ID, cache read and creation tokens, reasoning tokens, and content risk level when available.
* payloads
boolean
default: `false`
***
If true, log request and response payload.
* timeout
integer
default: `30000`
vaild vaule:
between 1 and 600000 inclusive
***
Timeout in milliseconds for each connect, send, or blocking read operation to the LLM service. It does not limit the total duration of a streaming response; use `max_stream_duration_ms` for that limit.
* max\_req\_body\_size
integer
default: `67108864`
***
Maximum request body size in bytes that the plugin reads into memory (default 67108864 bytes, which is 64 MiB). Requests with a body larger than this limit are rejected with HTTP 413. This prevents unbounded memory buffering of large request bodies. Available in API7 Enterprise from versions 3.9.14 and 3.10.1 in their respective release lines, and APISIX from version 3.17.0.
* keepalive
boolean
default: `true`
***
If true, keep the connection alive when requesting the LLM service.
* keepalive\_timeout
integer
default: `60000`
vaild vaule:
greater than or equal to 1000
***
Keepalive timeout in milliseconds when requesting the LLM service.
* keepalive\_pool
integer
default: `30`
vaild vaule:
greater than or equal to 1
***
Keepalive pool size for when connecting with the LLM service.
* ssl\_verify
boolean
default: `true`
***
If true, verify the LLM service's certificate.
* max\_stream\_duration\_ms
integer
***
Maximum wall-clock duration, in milliseconds, for a streaming AI response. The limit is optional. When reached, the gateway closes the connection; if output has already started, the stream ends without a protocol terminator such as `[DONE]`, `message_stop`, or `response.completed`. Enforcement occurs between upstream reads, so the final chunk can exceed the configured duration. Available in API7 Enterprise from version 3.9.10 and APISIX from version 3.17.0.
* max\_response\_bytes
integer
***
Maximum total bytes read from the upstream for one streaming or non-streaming AI response. The limit is optional and checked between upstream reads, so the final chunk can exceed it. If the limit is exceeded before output starts, the gateway returns `502 Bad Gateway`; after output starts, the gateway closes the stream without a protocol terminator. Available in API7 Enterprise from version 3.9.10 and APISIX from version 3.17.0.
* streaming\_flush\_interval\_ms
integer
default: `10`
***
Background flush interval in milliseconds for streaming responses. A positive value starts a background thread that flushes output periodically to bound client latency when upstreams burst multiple tokens at once. Set to 0 to flush each chunk synchronously inline. Available in API7 Enterprise from version 3.9.13 and APISIX from version 3.17.0.
---
# ai-rag
The `ai-rag` plugin implements the retrieval step of a Retrieval-Augmented Generation (RAG) request flow. It generates an embedding from the request and performs a vector search. It then adds the retrieved content to the protocol-specific LLM input and removes the `ai_rag` object before proxying the request.
The current implementation supports [Azure OpenAI](https://azure.microsoft.com/en-us/products/ai-services/openai-service) for embeddings and [Azure AI Search](https://azure.microsoft.com/en-us/products/ai-services/ai-search) for vector search. Use the [`ai-proxy`](https://docs.api7.ai/hub/ai-proxy.md) plugin in the same request flow to proxy the augmented request to the LLM provider. The plugin does not create or populate a search index; prepare the index and its content before sending requests through APISIX.
## Behavior by Request Format[](#behavior-by-request-format "Direct link to Behavior by Request Format")
The plugin enriches Chat Completions, Responses API, Anthropic Messages, and Bedrock Converse requests using each protocol's native prompt structure.
The gateway identifies each request by checking URI-specific rules before body-only rules:
* Bedrock Converse requires a URI ending in `/converse` and a `messages` array.
* Anthropic Messages requires a URI ending in `/v1/messages`.
* Responses API requires a URI ending in `/v1/responses` and an `input` field.
* Chat Completions uses a `messages` array.
* Embeddings uses `input` after the earlier rules do not match.
* Other non-empty JSON objects use passthrough after none of the earlier rules match.
| Request format | Context enrichment |
| ------------------------ | -------------------------------------------------------------------------------------------------------------------------------- |
| Bedrock Converse | Appends the retrieved context as a user message in `messages`. |
| Anthropic Messages | Appends the retrieved context as a user message in `messages`. |
| Responses API | Appends the retrieved context to `input`. |
| Chat Completions | Appends the retrieved context as a user message in `messages`. |
| Embeddings | Does not enrich the request. The nested `ai_rag.embeddings` object configures the embedding input used internally for retrieval. |
| Other JSON (passthrough) | Does not enrich the request. |
## Verify Upstream TLS[](#verify-upstream-tls "Direct link to Verify Upstream TLS")
In API7 Enterprise from version 3.9.10 and APISIX from version 3.17.0, `ssl_verify` defaults to `true` for calls to the embedding and vector-search services. Configure a trusted certificate chain for both endpoints before enabling the plugin in production. Setting `ssl_verify` to `false` preserves connectivity to an endpoint with an untrusted certificate, but should be limited to temporary migration or development use.
## Example[](#example "Direct link to Example")
To follow along the example, create an [Azure account](https://portal.azure.com) and complete the following steps:
* In [Azure AI Foundry](https://oai.azure.com/portal), deploy a generative chat model, such as `gpt-4o`, and an embedding model, such as `text-embedding-3-large`. Obtain the API key and model endpoints.
* Follow [Azure's example](https://github.com/Azure/azure-search-vector-samples/blob/main/demo-python/code/basic-vector-workflow/azure-search-vector-python-sample.ipynb) to prepare for a vector search in [Azure AI Search](https://azure.microsoft.com/en-us/products/ai-services/ai-search) using Python. The example will create a search index called `vectest` with the desired schema and upload the [sample data](https://github.com/Azure/azure-search-vector-samples/blob/main/data/text-sample.json) which contains 108 descriptions of various Azure services, for embeddings `titleVector` and `contentVector` to be generated based on `title` and `content`. Complete all the setups before performing vector searches in Python.
* In [Azure AI Search](https://azure.microsoft.com/en-us/products/ai-services/ai-search), [obtain the Azure vector search API key and the search service endpoint](https://learn.microsoft.com/en-us/azure/search/search-get-started-vector?tabs=api-key#retrieve-resource-information).
Save the API keys and endpoints to environment variables:
```
# replace with your values
export AZ_OPENAI_DOMAIN=https://your-openai-resource.openai.azure.com
export AZ_OPENAI_API_KEY=your-azure-openai-api-key
export AZ_CHAT_ENDPOINT=${AZ_OPENAI_DOMAIN}/openai/deployments/gpt-4o/chat/completions?api-version=2024-02-15-preview
export AZ_EMBEDDING_MODEL=text-embedding-3-large
export AZ_EMBEDDINGS_ENDPOINT=${AZ_OPENAI_DOMAIN}/openai/deployments/${AZ_EMBEDDING_MODEL}/embeddings?api-version=2023-05-15
export AZ_AI_SEARCH_SVC_DOMAIN=https://your-search-service.search.windows.net
export AZ_AI_SEARCH_KEY=your-azure-ai-search-api-key
export AZ_AI_SEARCH_INDEX=vectest
export AZ_AI_SEARCH_ENDPOINT=${AZ_AI_SEARCH_SVC_DOMAIN}/indexes/${AZ_AI_SEARCH_INDEX}/docs/search?api-version=2024-07-01
```
### Integrate with Azure for RAG-Enhanced Responses[](#integrate-with-azure-for-rag-enhanced-responses "Direct link to Integrate with Azure for RAG-Enhanced Responses")
The following example demonstrates how you can use the [`ai-proxy`](https://docs.api7.ai/hub/ai-proxy.md) plugin to proxy requests to Azure OpenAI LLM and use the `ai-rag` plugin to generate embeddings and perform vector search to enhance LLM responses.
* Admin API
* ADC
* Ingress Controller
Create a route as such:
```
curl "http://127.0.0.1:9180/apisix/admin/routes" -X PUT \
-H "X-API-KEY: ${ADMIN_API_KEY}" \
--data-binary @- <>> Check for open slots...
>>> Check slots coverage...
[OK] All 16384 slots covered.
```
4. Verify cluster nodes:
```
docker exec -it redis-node-7000 redis-cli -c -a redis-cluster-password -p 7000 cluster nodes
```
The expected output should be similar to the following:
```
node-id-1 172.XX.0.2:7000@17000 myself,master - 0 0 1 connected 0-5460
node-id-2 172.XX.0.3:7001@17001 master - 0 0 2 connected 5461-10922
node-id-3 172.XX.0.4:7002@17002 master - 0 0 3 connected 10923-16383
node-id-4 172.XX.0.5:7003@17003 slave node-id-1 0 0 1 connected
node-id-5 172.XX.0.6:7004@17004 slave node-id-2 0 0 2 connected
node-id-6 172.XX.0.7:7005@17005 slave node-id-3 0 0 3 connected
```
5. Check cluster health (optional):
```
docker exec redis-node-7000 redis-cli -c -a redis-cluster-password -p 7000 cluster info
```
You should see the following response:
```
cluster_state:ok
cluster_slots_assigned:16384
cluster_slots_ok:16384
cluster_known_nodes:6
cluster_size:3
...
```
Create a Kubernetes manifest for the Redis cluster:
redis-cluster.yaml
```
apiVersion: apps/v1
kind: StatefulSet
metadata:
namespace: aic
name: redis-cluster
spec:
serviceName: redis-cluster
replicas: 6
selector:
matchLabels:
app: redis-cluster
template:
metadata:
labels:
app: redis-cluster
spec:
containers:
- name: redis
image: redis:7.2-alpine
ports:
- containerPort: 6379
name: client
- containerPort: 16379
name: gossip
command:
- redis-server
- --cluster-enabled
- "yes"
- --cluster-config-file
- nodes.conf
- --cluster-node-timeout
- "5000"
- --appendonly
- "yes"
- --requirepass
- redis-cluster-password
- --masterauth
- redis-cluster-password
volumeMounts:
- name: data
mountPath: /data
volumeClaimTemplates:
- metadata:
name: data
spec:
accessModes: ["ReadWriteOnce"]
resources:
requests:
storage: 1Gi
---
apiVersion: v1
kind: Service
metadata:
namespace: aic
name: redis-cluster
spec:
clusterIP: None
selector:
app: redis-cluster
ports:
- port: 6379
name: client
- port: 16379
name: gossip
```
Apply the manifest:
```
kubectl apply -f redis-cluster.yaml
```
Wait for all pods to be ready, then initialize the cluster:
```
kubectl exec -n aic redis-cluster-0 -- redis-cli \
--cluster create \
$(for i in 0 1 2 3 4 5; do \
echo -n "$(kubectl get pod -n aic redis-cluster-$i -o jsonpath='{.status.podIP}'):6379 "; \
done) \
--cluster-replicas 1 \
--cluster-yes \
-a redis-cluster-password
```
#### Create Route and Configure Rate Limiting[](#create-route-and-configure-rate-limiting-1 "Direct link to Create Route and Configure Rate Limiting")
Create a route with the following configurations in the gateway group:
* Admin API
* ADC
* Ingress Controller
```
curl "http://127.0.0.1:9180/apisix/admin/routes" -X PUT \
-H "X-API-KEY: ${ADMIN_API_KEY}" \
--data-binary @- </dev/null | grep -v "^$" || echo "No related keys found"
done
```
You should see output similar to the following:
```
Checking node redis-node-7000:
No related keys found
Checking node redis-node-7001:
No related keys found
Checking node redis-node-7002:
plugin-ai-rate-limitingroute&service&:::
Checking node redis-node-7003:
plugin-ai-rate-limitingroute&service&:::
Checking node redis-node-7004:
No related keys found
Checking node redis-node-7005:
No related keys found
```
### Share Quota Among Gateway Nodes with a Redis Sentinel[](#share-quota-among-gateway-nodes-with-a-redis-sentinel "Direct link to Share Quota Among Gateway Nodes with a Redis Sentinel")
This authenticated Redis Sentinel example applies to API7 Enterprise version 3.10.5 and later, and to APISIX version 3.18.0 and later.
Use Redis Sentinel when you need automatic failover and high availability but do not require data partitioning. This pattern is simpler to manage and suitable for most high-availability requirements.
Ensure that your Redis instances are running in [Sentinel mode](https://redis.io/docs/latest/operate/oss_and_stack/management/sentinel/).
#### Prerequisites[](#prerequisites-2 "Direct link to Prerequisites")
* Docker
* Kubernetes
1. Create a Docker network:
```
docker network create redis-sentinel-network
```
Ensure that your gateway instance is running within the same network as your Redis Sentinel cluster.
2. Start a Redis master node:
```
docker run -d --name redis-master --network redis-sentinel-network \
-p 6379:6379 \
redis:7.2-alpine \
redis-server --requirepass StrongP@ss123 --appendonly yes
```
3. Start Sentinel replica nodes:
```
for i in 1 2; do
PORT=$((6380 + i - 1))
docker run -d --name redis-slave-$i --network redis-sentinel-network \
-p $PORT:6379 \
redis:7.2-alpine \
redis-server --slaveof redis-master 6379 \
--requirepass StrongP@ss123 \
--masterauth StrongP@ss123 \
--appendonly yes
done
```
4. Get master node IP address for next step:
```
MASTER_IP=$(docker inspect -f '{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' redis-master)
echo "Redis master node IP: $MASTER_IP"
```
5. Start Sentinel cluster and replace `$MASTER_IP` with your master node IP:
```
for i in 1 2 3; do
docker run -d --name redis-sentinel-$i --network redis-sentinel-network -p $((26378+i-1)):26379 \
redis:7.2-alpine \
sh -c "
cat << 'EOF' > /sentinel.conf
port 26379
sentinel monitor mymaster $MASTER_IP 6379 2
sentinel auth-pass mymaster StrongP@ss123
requirepass admin-password
sentinel down-after-milliseconds mymaster 5000
sentinel failover-timeout mymaster 10000
sentinel parallel-syncs mymaster 1
protected-mode no
EOF
redis-sentinel /sentinel.conf
"
done
echo "✅ Sentinel cluster started successfully."
```
You can see the following response:
```
Starting redis-sentinel-1 (port:26379)...
eb9efacb629d0cfdfaa48856f42ba8c67642baa79f1589df5b251c11d3ec6e1a
Starting redis-sentinel-2 (port:26380)...
7f23f4b6e63c9b6be4c5e1903a244f078d481952a1465a9650c743ea2ee4600f
Starting redis-sentinel-3 (port:26381)...
1df087502124e3903df7ae665ef597bf735669c5ce3f9d87696c4acd82526626
✅ Sentinel cluster started successfully.
```
6. Confirm the Sentinel environment is running correctly:
```
echo "Waiting for Sentinel cluster establishment (10 seconds)..."
sleep 10
echo -e "\nVerifying Sentinel cluster status:"
for i in 1 2 3; do
echo "--- Sentinel $i status ---"
if docker ps | grep -q "redis-sentinel-$i"; then
echo "Container: ✅ Running"
docker exec redis-sentinel-$i redis-cli -p 26379 SENTINEL master mymaster 2>&1 | grep -E "(flags|num-slaves|num-other-sentinels)"
else
echo "Container: ❌ Not running (run 'docker logs redis-sentinel-$i' to check)"
fi
echo ""
done
```
You can see the following response:
```
Verifying Sentinel cluster status:
--- Sentinel 1 status ---
Container: ✅ Running
--- Sentinel 2 status ---
Container: ✅ Running
--- Sentinel 3 status ---
Container: ✅ Running
```
7. Get Sentinel IP addresses for plugin configuration:
```
echo -e "Getting Sentinel container IP addresses:"
for i in 1 2 3; do
IP=$(docker inspect -f '{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' redis-sentinel-$i)
echo " redis-sentinel-$i : $IP"
done
```
You can see the following response:
```
Getting Sentinel container IP addresses:
redis-sentinel-1 : 172.22.0.4
redis-sentinel-2 : 172.22.0.5
redis-sentinel-3 : 172.22.0.6
```
8. Conduct detailed status check:
```
echo "Checking detailed Sentinel cluster status..."
for i in 1 2 3; do
echo "=== Sentinel $i details ==="
docker exec redis-sentinel-$i redis-cli -p 26379 SENTINEL master mymaster
echo ""
done
```
You can see the following response:
```
Checking detailed Sentinel cluster status...
=== Sentinel 1 Details ===
name: mymaster
ip: 172.22.0.2
port: 6379
runid: ${YOUR_RUN_ID}
flags: master
link-pending-commands: 0
link-refcount: 1
last-ping-sent: 0
last-ok-ping-reply: 113
last-ping-reply: 113
down-after-milliseconds: 5000
info-refresh: 6979
role-reported: master
role-reported-time: 107360
config-epoch: 0
num-slaves: 1
num-other-sentinels: 2
quorum: 2
failover-timeout: 10000
parallel-syncs: 1
...
```
Create a Kubernetes manifest for the Redis master, replicas, and Sentinel cluster:
redis-sentinel.yaml
```
apiVersion: v1
kind: ConfigMap
metadata:
namespace: aic
name: redis-sentinel-config
data:
sentinel.conf: |
port 26379
sentinel monitor mymaster redis-master.aic.svc 6379 2
sentinel auth-pass mymaster StrongP@ss123
requirepass admin-password
sentinel down-after-milliseconds mymaster 5000
sentinel failover-timeout mymaster 10000
sentinel parallel-syncs mymaster 1
protected-mode no
---
apiVersion: apps/v1
kind: StatefulSet
metadata:
namespace: aic
name: redis-master
spec:
serviceName: redis-master
replicas: 1
selector:
matchLabels:
app: redis-master
template:
metadata:
labels:
app: redis-master
spec:
containers:
- name: redis
image: redis:7.2-alpine
ports:
- containerPort: 6379
command:
- redis-server
- --requirepass
- StrongP@ss123
- --appendonly
- "yes"
---
apiVersion: v1
kind: Service
metadata:
namespace: aic
name: redis-master
spec:
clusterIP: None
selector:
app: redis-master
ports:
- port: 6379
---
apiVersion: apps/v1
kind: StatefulSet
metadata:
namespace: aic
name: redis-replica
spec:
serviceName: redis-replica
replicas: 2
selector:
matchLabels:
app: redis-replica
template:
metadata:
labels:
app: redis-replica
spec:
containers:
- name: redis
image: redis:7.2-alpine
ports:
- containerPort: 6379
command:
- redis-server
- --slaveof
- redis-master.aic.svc
- "6379"
- --requirepass
- StrongP@ss123
- --masterauth
- StrongP@ss123
- --appendonly
- "yes"
---
apiVersion: v1
kind: Service
metadata:
namespace: aic
name: redis-replica
spec:
clusterIP: None
selector:
app: redis-replica
ports:
- port: 6379
---
apiVersion: apps/v1
kind: StatefulSet
metadata:
namespace: aic
name: redis-sentinel
spec:
serviceName: redis-sentinel
replicas: 3
selector:
matchLabels:
app: redis-sentinel
template:
metadata:
labels:
app: redis-sentinel
spec:
containers:
- name: sentinel
image: redis:7.2-alpine
ports:
- containerPort: 26379
command:
- redis-sentinel
- /etc/sentinel/sentinel.conf
volumeMounts:
- name: sentinel-config
mountPath: /etc/sentinel
volumes:
- name: sentinel-config
configMap:
name: redis-sentinel-config
---
apiVersion: v1
kind: Service
metadata:
namespace: aic
name: redis-sentinel
spec:
clusterIP: None
selector:
app: redis-sentinel
ports:
- port: 26379
```
Apply the manifest:
```
kubectl apply -f redis-sentinel.yaml
```
Wait for all pods to be ready:
```
kubectl wait --for=condition=Ready pod -l app=redis-sentinel -n aic --timeout=120s
```
#### Create Route and Configure Rate Limiting[](#create-route-and-configure-rate-limiting-2 "Direct link to Create Route and Configure Rate Limiting")
Create a route with the following configurations in the gateway group:
* Admin API
* ADC
* Ingress Controller
```
curl "http://127.0.0.1:9180/apisix/admin/routes" -X PUT \
-H "X-API-KEY: ${ADMIN_API_KEY}" \
--data-binary @- <When `rules` is set, the headers use a prefix instead. See `rules.header_prefix` for details.
- limit\_strategy
string
default: `total_tokens`
vaild vaule:
`total_tokens`, `prompt_tokens`, `completion_tokens`, or `expression`
***
Type of token to apply rate limiting. `total_tokens`, `prompt_tokens`, and `completion_tokens` values are returned in each model response, where `total_tokens` is the sum of `prompt_tokens` and `completion_tokens`.
When set to `expression`, rate limiting cost is calculated using a custom Lua arithmetic expression defined in `cost_expr`. Available in API7 Enterprise from version 3.9.8 and APISIX from version 3.17.0.
- cost\_expr
string
vaild vaule:
any non-empty string (must be a valid Lua arithmetic expression)
***
Lua arithmetic expression for dynamic token cost calculation. Variables are injected from the LLM provider's raw usage response fields (e.g., `input_tokens`, `output_tokens`, `cache_creation_input_tokens`). Missing variables default to `0`. Only math functions (`abs`, `ceil`, `floor`, `max`, `min`) and arithmetic operators are allowed. Expression syntax is validated when `limit_strategy` is `expression`, where this field is required.
Example: `input_tokens + cache_creation_input_tokens` computes cost from Anthropic Claude's cache-aware token usage.
Available in API7 Enterprise from version 3.9.8 and APISIX from version 3.17.0.
- instances
array\[object]
***
LLM instance rate limiting configurations.
* name
string
required
***
Name of the LLM service instance.
* limit
integer | string
required
vaild vaule:
greater than 0
***
The maximum number of tokens allowed to consume within a given time interval.
In API7 Enterprise (from 3.8.17) and in APISIX (from 3.16.0), this parameter also supports the string data type and allows the use of [built-in variables](https://docs.api7.ai/apisix/reference/built-in-variables.md) prefixed with a dollar sign (`$`). In earlier APISIX versions, only the integer type is supported.
* time\_window
integer | string
required
vaild vaule:
greater than 0
***
The time interval corresponding to the rate limiting `limit` in seconds.
In API7 Enterprise (from 3.8.17) and in APISIX (from 3.16.0), this parameter also supports the string data type and allows the use of [built-in variables](https://docs.api7.ai/apisix/reference/built-in-variables.md) prefixed with a dollar sign (`$`). In earlier APISIX versions, only the integer type is supported.
- rejected\_code
integer
default: `503`
vaild vaule:
between 200 and 599 inclusive
***
The HTTP status code returned when a request exceeding the quota is rejected.
- rejected\_msg
string
vaild vaule:
any non-empty string
***
The response body returned when a request exceeding the quota is rejected.
- policy
string
default: `local`
vaild vaule:
`local`, `redis`, `redis-cluster`, or `redis-sentinel`
***
The policy for rate limiting counters. API7 Gateway requires this field; use `local` for configurations that do not use Redis. APISIX uses `local` when the field is omitted.
Redis-backed policies are available in API7 Enterprise from version 3.8.19 and in APISIX from version 3.18.0.
Set to `local` to store the counter in memory locally.
Set to `redis` to store the counter on a Redis instance.
Set to `redis-cluster` to store the counter in a Redis cluster.
Set to `redis-sentinel` to store the counter on the Redis primary node managed by Redis Sentinel, which ensures high availability by automatically promoting a replica to primary in case of failure. Redis Sentinel provides high availability for Redis when not using Redis Cluster.
- redis\_host
string
***
The address of the Redis node. Required when `policy` is `redis`.
- redis\_port
integer
default: `6379`
vaild vaule:
greater than or equal to 1
***
The port of the Redis node when `policy` is `redis`.
- redis\_username
string
***
The username for Redis if Redis ACL is used. If you use the legacy authentication method `requirepass`, configure only `redis_password`. Used when `policy` is `redis`, and with `redis-sentinel` in API7 Enterprise 3.10.5 and APISIX 3.18.0.
- redis\_password
string
***
Password of the Redis node when `policy` is `redis` or `redis-cluster`, and with `redis-sentinel` in API7 Enterprise 3.10.5 and APISIX 3.18.0.
In API7 Gateway 3.10.2 or later in the 3.10 release series, and 3.9.16 or later in the 3.9 release series, the value is encrypted with AES256 before being saved to the database.
In APISIX 3.18.0 or later, the value is encrypted with AES before being stored in etcd.
- redis\_database
integer
default: `0`
vaild vaule:
greater than or equal to 0
***
The database number in Redis when `policy` is `redis` or `redis-sentinel`.
- redis\_ssl
boolean
default: `false`
***
If true, use SSL to connect to Redis when `policy` is `redis`.
- redis\_ssl\_verify
boolean
default: `false`
***
If true, verify the server SSL certificate when `policy` is `redis`.
- redis\_timeout
integer
default: `1000`
vaild vaule:
greater than or equal to 1
***
The Redis timeout value in milliseconds when `policy` is `redis` or `redis-cluster`.
- redis\_cluster\_nodes
array\[string]
***
List of Redis cluster nodes with at least one address. Required when `policy` is `redis-cluster`.
- redis\_cluster\_name
string
***
The name of the Redis cluster. Required when `policy` is `redis-cluster`.
- redis\_cluster\_ssl
boolean
default: `false`
***
If true, use SSL to connect to Redis cluster when `policy` is `redis-cluster`.
- redis\_cluster\_ssl\_verify
boolean
default: `false`
***
If true, verify the server SSL certificate when `policy` is `redis-cluster`.
- redis\_sentinels
array\[object]
***
An array of Redis Sentinel nodes (host and port). Required when `policy` is `redis-sentinel`.
- redis\_master\_name
string
***
The name of the Redis master group that Sentinels are monitoring. Required when `policy` is `redis-sentinel`.
- redis\_role
string
default: `master`
vaild vaule:
`master` or `slave`
***
The Redis node role to connect to. Configurable when `policy` is `redis-sentinel`. Set to `master` to connect to the current Redis master, and set to `slave` to connect to a Redis replica.
- redis\_connect\_timeout
integer
default: `1000`
vaild vaule:
greater than or equal to 1
***
Timeout in milliseconds for establishing a connection to a Redis node. Configurable when `policy` is `redis-sentinel`.
- redis\_read\_timeout
integer
default: `1000`
vaild vaule:
greater than or equal to 1
***
Timeout in milliseconds for reading data from a Redis node. Configurable when `policy` is `redis-sentinel`.
- redis\_keepalive\_timeout
integer
default: `` `10000` for `redis` or `redis-cluster`; `60000` for `redis-sentinel` ``
vaild vaule:
`redis` and `redis-cluster`: greater than or equal to 1000; `redis-sentinel`: greater than or equal to 1
***
Time in milliseconds that an idle Redis connection is kept alive in the connection pool before being closed. Used by all Redis-backed policies in APISIX 3.18.0. In API7 Enterprise, it is used by `redis-sentinel`; `redis` and `redis-cluster` support it from version 3.9.16 on the 3.9 release series and version 3.10.3 on the 3.10 release series.
- redis\_keepalive\_pool
integer
default: `100`
vaild vaule:
greater than or equal to 1
***
Maximum number of idle Redis connections in the keepalive pool. Used when `policy` is `redis` or `redis-cluster`. Available in API7 Enterprise from version 3.9.16 on the 3.9 release series and version 3.10.3 on the 3.10 release series, and in APISIX from version 3.18.0.
- sentinel\_username
string
***
Username used to authenticate with the Redis Sentinel instance. Configurable when `policy` is `redis-sentinel`.
- sentinel\_password
string
***
Password used to authenticate with the Redis Sentinel instance. Configurable when `policy` is `redis-sentinel`.
In API7 Gateway 3.10.2 or later in the 3.10 release series, and 3.9.16 or later in the 3.9 release series, the value is encrypted with AES256 before being saved to the database.
In APISIX 3.18.0 or later, the value is encrypted with AES before being stored in etcd.
- allow\_degradation
boolean
default: `false`
***
If true, allow the gateway to continue handling requests without the plugin when the plugin or its dependencies become unavailable.
Available in API7 Enterprise from version 3.8.19 and in APISIX from version 3.18.0.
- rules
array\[object]
***
An array of rate-limiting rules that are applied sequentially.
Available in API7 Enterprise from 3.8.17 and in APISIX from 3.16.0.
* count
integer | string
required
vaild vaule:
greater than 0
***
The maximum number of tokens allowed to consume within a given time interval.
This parameter also supports the string data type and allows the use of [built-in variables](https://docs.api7.ai/apisix/reference/built-in-variables.md) prefixed with a dollar sign (`$`).
* time\_window
integer | string
required
vaild vaule:
greater than 0
***
The time interval corresponding to the rate limiting `count` in seconds.
This parameter also supports the string data type and allows the use of [built-in variables](https://docs.api7.ai/apisix/reference/built-in-variables.md) prefixed with a dollar sign (`$`).
* key
string
required
***
The key to count requests by. If the configured key does not exist, the rule will not be executed.
The `key` is interpreted as a variable. The variable does not need to be prefixed by a dollar sign (`$`). See [built-in variables](https://docs.api7.ai/apisix/reference/built-in-variables.md) for available variables.
* header\_prefix
string
***
Prefix for all rate limiting response headers. Available in API7 Enterprise from version 3.8.19 and in APISIX from version 3.17.0.
When configured, the prefix is inserted after `X-AI-` in the header name. For example, with `header_prefix` set to `test`, the headers become `X-AI-Test-RateLimit-Limit`, `X-AI-Test-RateLimit-Remaining`, and `X-AI-Test-RateLimit-Reset`.
When not configured, the index of the rule in the rules array is used as the prefix. For example, headers for the first rule will be `X-AI-1-RateLimit-Limit`, `X-AI-1-RateLimit-Remaining`, and `X-AI-1-RateLimit-Reset`.
---
# ai-request-rewrite
The `ai-request-rewrite` plugin processes client requests by forwarding them to LLM services for transformation before relaying them to upstream services. This enables LLM-powered modifications such as data redaction, content enrichment, or reformatting. The plugin supports the integration with OpenAI, DeepSeek, Gemini, Vertex AI, Anthropic, OpenRouter, and other OpenAI-compatible APIs.
The LLM call used for rewriting is separate from the client's request format. With the `openai` provider, the plugin builds a non-streaming Chat Completions request from the configured prompt and the original request body. It does not classify or proxy the client's request as an AI protocol. That internal request carries the plugin's configured provider credentials and does not forward client headers.
## Examples[](#examples "Direct link to Examples")
The examples below demonstrate how you can configure `ai-request-rewrite` for different scenarios.
The examples will use OpenAI as the LLM service. To follow along, obtain the OpenAI [API key](https://openai.com/blog/openai-api) and save it to an environment variable:
```
export OPENAI_API_KEY=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 # replace with your API key
```
### Redact Sensitive Information[](#redact-sensitive-information "Direct link to Redact Sensitive Information")
The following example demonstrates how you can use the `ai-request-rewrite` plugin to redact sensitive information before the request reaches the upstream service.
* Admin API
* ADC
* Ingress Controller
Create a route and configure the `ai-request-rewrite` plugin as such:
```
curl "http://127.0.0.1:9180/apisix/admin/routes" -X PUT \
-H "X-API-KEY: ${ADMIN_API_KEY}" \
--data-binary @- < Authorization Scopes tab with the Create button highlighted](https://static.api7.ai/uploads/2024/01/06/bVHhiALe_auth-scope.png)
Create the resource `httpbin-anything` with URI `/anything` and scope `access`:

Create the client scope policy `access-client-scope-policy` that requires `httpbin-access`:

Create the scope-based permission `access-scope-perm` that uses the `access` scope and `access-client-scope-policy`:

Add `httpbin-access` to the default client scopes of `apisix-quickstart-client`:

Create a user named `quickstart-user`:

Set the password to `quickstart-user-pass` and turn off **Temporary**:

Save the client secret from **Clients** > `apisix-quickstart-client` > **Credentials**:

Save the OIDC client ID and secret to environment variables:
```
OIDC_CLIENT_ID=apisix-quickstart-client
OIDC_CLIENT_SECRET=bSaIN3MV1YynmtXvU8lKkfeY0iwpr9cH # replace with your value
```
tip
If APISIX runs in Kubernetes, use the same Keycloak hostname consistently in both the plugin configuration and the token request. Otherwise, Keycloak may reject the bearer token because the token issuer does not match the configured authorization endpoints.
#### Request Access Token[](#request-access-token "Direct link to Request Access Token")
Request an access token from Keycloak and save it to `ACCESS_TOKEN`:
* Docker
* Kubernetes
```
ACCESS_TOKEN=$(curl -sS "$KEYCLOAK_URL/realms/quickstart-realm/protocol/openid-connect/token" \
-d 'grant_type=client_credentials' \
-d 'client_id='$OIDC_CLIENT_ID'' \
-d 'client_secret='$OIDC_CLIENT_SECRET'' | jq -r '.access_token')
```
Run the token request inside the Keycloak pod and save the result to `ACCESS_TOKEN`:
```
ACCESS_TOKEN=$(kubectl exec -n aic deploy/keycloak -- env OIDC_CLIENT_SECRET="$OIDC_CLIENT_SECRET" sh -lc 'curl -sS "http://keycloak.aic.svc.cluster.local:8080/realms/quickstart-realm/protocol/openid-connect/token" \
-d grant_type=client_credentials \
-d client_id=apisix-quickstart-client \
-d client_secret="$OIDC_CLIENT_SECRET"' | jq -r '.access_token')
```
### Use Lazy Load Path and Resource Registration Endpoint[](#use-lazy-load-path-and-resource-registration-endpoint "Direct link to Use Lazy Load Path and Resource Registration Endpoint")
The examples below demonstrate how you can configure `authz-keycloak` to dynamically resolve the request URI to one or more resources using the resource registration endpoint instead of static permissions.
* Admin API
* ADC
* Ingress Controller
Create a route with `authz-keycloak-route` as follows:
```
curl "http://127.0.0.1:9180/apisix/admin/routes" -X PUT \
-H "X-API-KEY: ${ADMIN_API_KEY}" \
--data-binary @- <
info
Amazon API Gateway supports HTTP APIs and REST APIs. API key support is available only for REST APIs, which is why this example uses a REST API trigger.
You should now be redirected back to the Lambda interface. To find the API key and gateway API endpoint, go to the **Configuration** tab of the Lambda function and under **Triggers**, you can find the details of the API gateway:

Finally, create a route in APISIX with your gateway endpoint and API key:
* Admin API
* ADC
* Ingress Controller
```
curl "http://127.0.0.1:9180/apisix/admin/routes" -X PUT \
-H "X-API-KEY: ${ADMIN_API_KEY}" \
-d '{
"id": "aws-lambda-route",
"uri": "/aws-lambda",
"plugins": {
"aws-lambda": {
"function_uri": "https://your-api-id.execute-api.us-west-2.amazonaws.com/default/your-resource",
"authorization": {
"apikey": "YOUR_API_GATEWAY_API_KEY"
},
"ssl_verify": false
}
}
}'
```
adc.yaml
```
services:
- name: aws-lambda-service
routes:
- name: aws-lambda-route
uris:
- /aws-lambda
plugins:
aws-lambda:
function_uri: https://your-api-id.execute-api.us-west-2.amazonaws.com/default/your-resource
authorization:
apikey: YOUR_API_GATEWAY_API_KEY
ssl_verify: false
```
Synchronize the configuration to the gateway:
```
adc sync -f adc.yaml
```
* Gateway API
* APISIX CRD
aws-lambda-ic.yaml
```
apiVersion: apisix.apache.org/v1alpha1
kind: PluginConfig
metadata:
namespace: aic
name: aws-lambda-plugin-config
spec:
plugins:
- name: aws-lambda
config:
function_uri: https://your-api-id.execute-api.us-west-2.amazonaws.com/default/your-resource
authorization:
apikey: YOUR_API_GATEWAY_API_KEY
ssl_verify: false
---
apiVersion: gateway.networking.k8s.io/v1
kind: HTTPRoute
metadata:
namespace: aic
name: aws-lambda-route
spec:
parentRefs:
- name: apisix
rules:
- matches:
- path:
type: Exact
value: /aws-lambda
filters:
- type: ExtensionRef
extensionRef:
group: apisix.apache.org
kind: PluginConfig
name: aws-lambda-plugin-config
```
aws-lambda-ic.yaml
```
apiVersion: apisix.apache.org/v2
kind: ApisixRoute
metadata:
namespace: aic
name: aws-lambda-route
spec:
ingressClassName: apisix
http:
- name: aws-lambda-route
match:
paths:
- /aws-lambda
plugins:
- name: aws-lambda
enable: true
config:
function_uri: https://your-api-id.execute-api.us-west-2.amazonaws.com/default/your-resource
authorization:
apikey: YOUR_API_GATEWAY_API_KEY
ssl_verify: false
```
Apply the configuration:
```
kubectl apply -f aws-lambda-ic.yaml
```
Send a request to the route:
```
curl -i "http://127.0.0.1:9080/aws-lambda"
```
You should receive an `HTTP/1.1 200 OK` response with the following message:
```
"Hello from Lambda!"
```
If your API key is invalid, you should receive an `HTTP/1.1 403 Forbidden` response.
### Forward Requests to Amazon API Gateway Sub-Paths[](#forward-requests-to-amazon-api-gateway-sub-paths "Direct link to Forward Requests to Amazon API Gateway Sub-Paths")
The following example demonstrates how you can forward requests to a sub-path of the Amazon API gateway API and configure the API to trigger the execution of Lambda function.
Please follow the [previous example](#integrate-with-amazon-api-gateway-securely-with-api-key) to set up an API gateway first.
To create a sub-path, go to the **Configuration** tab of the Lambda function and under **Triggers**, click into the API gateway:

Next, select **Create resource** to create a sub-path:

Enter the sub-path information and complete creation:

Once redirected back to the main gateway console, you should see the newly created path. Select **Create method** to configure HTTP methods for the path and the associated action:

Select the allowed HTTP method in the dropdown. For the purpose of demonstration, this example continues to use the same Lambda function as the triggered action when the path is requested:

Finish the method creation. Once redirected back to the main gateway console, click on **Deploy API** to deploy the path and method changes:

Finally, create a route in APISIX with your gateway endpoint and API key:
* Admin API
* ADC
* Ingress Controller
```
curl "http://127.0.0.1:9180/apisix/admin/routes" -X PUT \
-H "X-API-KEY: ${ADMIN_API_KEY}" \
-d '{
"id": "aws-lambda-route",
"uri": "/aws-lambda/*",
"plugins": {
"aws-lambda": {
"function_uri": "https://your-api-id.execute-api.us-west-2.amazonaws.com/default",
"authorization": {
"apikey": "YOUR_API_GATEWAY_API_KEY"
},
"ssl_verify": false
}
}
}'
```
adc.yaml
```
services:
- name: aws-lambda-service
routes:
- name: aws-lambda-route
uris:
- /aws-lambda/*
plugins:
aws-lambda:
function_uri: https://your-api-id.execute-api.us-west-2.amazonaws.com/default
authorization:
apikey: YOUR_API_GATEWAY_API_KEY
ssl_verify: false
```
Synchronize the configuration to the gateway:
```
adc sync -f adc.yaml
```
* Gateway API
* APISIX CRD
aws-lambda-ic.yaml
```
apiVersion: apisix.apache.org/v1alpha1
kind: PluginConfig
metadata:
namespace: aic
name: aws-lambda-plugin-config
spec:
plugins:
- name: aws-lambda
config:
function_uri: https://your-api-id.execute-api.us-west-2.amazonaws.com/default
authorization:
apikey: YOUR_API_GATEWAY_API_KEY
ssl_verify: false
---
apiVersion: gateway.networking.k8s.io/v1
kind: HTTPRoute
metadata:
namespace: aic
name: aws-lambda-route
spec:
parentRefs:
- name: apisix
rules:
- matches:
- path:
type: PathPrefix
value: /aws-lambda/
filters:
- type: ExtensionRef
extensionRef:
group: apisix.apache.org
kind: PluginConfig
name: aws-lambda-plugin-config
```
aws-lambda-ic.yaml
```
apiVersion: apisix.apache.org/v2
kind: ApisixRoute
metadata:
namespace: aic
name: aws-lambda-route
spec:
ingressClassName: apisix
http:
- name: aws-lambda-route
match:
paths:
- /aws-lambda/*
plugins:
- name: aws-lambda
enable: true
config:
function_uri: https://your-api-id.execute-api.us-west-2.amazonaws.com/default
authorization:
apikey: YOUR_API_GATEWAY_API_KEY
ssl_verify: false
```
Apply the configuration:
```
kubectl apply -f aws-lambda-ic.yaml
```
❶ match all sub-paths of `/aws-lambda/`
❷ For Admin API, ADC, and APISIX CRD examples, the sub-paths matched by the wildcard `*` will be appended to the end of the `function_uri`. In the Gateway API example, `PathPrefix` matches requests under `/aws-lambda/`, so the forwarded request path continues after the configured `function_uri` prefix.
Send a request to the route:
```
curl -i "http://127.0.0.1:9080/aws-lambda/api7-docs"
```
APISIX will forward the request to `https://your-api-id.execute-api.us-west-2.amazonaws.com/default/api7-docs` and you should receive an `HTTP/1.1 200 OK` response with the following message:
```
"Hello from Lambda!"
```
If your API key is invalid or if the requested path is not associated with any method, you should receive an `HTTP/1.1 403 Forbidden` response.
---
## Attributes[](#attributes "Direct link to Attributes")
## Parameters[](#parameters "Direct link to Parameters")
See plugin [common configurations](https://docs.api7.ai/apisix/reference/plugin-common-configurations.md) for configuration options available to all plugins.
* function\_uri
string
required
***
AWS Lambda function URL or AWS API gateway endpoint that triggers the Lambda function.
* authorization
object
***
Credentials used in authentication and authorization on AWS to invoke Lambda function.
* apikey
string
***
API key for the REST API gateway when API key is selected as the security mechanism. API7 Gateway encrypts the value with AES at rest. APISIX encrypts it before etcd storage when `apisix.data_encryption.enable_encrypt_fields` is enabled.
* iam
object
***
IAM credentials to be authenticated using [AWS Signature Version 4](https://docs.aws.amazon.com/AmazonS3/latest/API/sig-v4-authenticating-requests.html) and authorized.
* accesskey
string
***
IAM user access key. API7 Gateway encrypts the value with AES at rest. APISIX encrypts it before etcd storage when `apisix.data_encryption.enable_encrypt_fields` is enabled.
* secretkey
string
***
IAM user secret access key. API7 Gateway encrypts the value with AES at rest. APISIX encrypts it before etcd storage when `apisix.data_encryption.enable_encrypt_fields` is enabled.
* aws\_region
string
default: `us-east-1`
***
AWS region.
* service
string
default: `execute-api`
***
Service receiving the request.
To integrate with AWS API gateway for API execution, set the service to `execute-api` for HTTP trigger.
To integrate with Lambda function directly, set the service to `lambda`.
* timeout
integer
default: `3000`
vaild vaule:
greater than or equal to 100
***
Proxy request timeout in milliseconds.
* ssl\_verify
boolean
default: `true`
***
If true, perform SSL verification.
* keepalive
boolean
default: `true`
***
If true, keep the connection alive for reuse.
* keepalive\_pool
integer
default: `5`
vaild vaule:
greater than or equal to 1
***
If true, keep the connection alive for reuse.
* keepalive\_timeout
integer
default: `60000`
vaild vaule:
greater than or equal to 1000
***
Time for connection to remain idle without closing in milliseconds.
* max\_req\_body\_size
integer
default: `67108864`
vaild vaule:
greater than or equal to 1
***
Maximum request body size in bytes read before the request is sent to AWS Lambda. A larger body is rejected with `400 Bad Request`. Introduced in API7 Enterprise 3.9.17 and 3.10.4, and APISIX 3.18.0.
---
# basic-auth
The `basic-auth` plugin adds [basic access authentication](https://en.wikipedia.org/wiki/Basic_access_authentication) for [consumers](https://docs.api7.ai/apisix/key-concepts/consumers.md) to authenticate themselves before being able to access upstream resources.
When a consumer is successfully authenticated, APISIX adds additional headers, such as `X-Consumer-Username`, `X-Credential-Identifier`, and other consumer custom headers if configured, to the request, before proxying it to the upstream service. The upstream service will be able to differentiate between consumers and implement additional logics as needed. If any of these values is not available, the corresponding header will not be added.
About X-Consumer-Username
When consumers are configured using the Ingress Controller, the consumer name is generated in the format `namespace_consumername`. As a result, the `X-Consumer-Username` header will also follow this format instead of just `consumername`.
## Examples[](#examples "Direct link to Examples")
The examples below demonstrate how you can work with the `basic-auth` plugin for different scenarios.
### Implement Basic Authentication on Route[](#implement-basic-authentication-on-route "Direct link to Implement Basic Authentication on Route")
The following example demonstrates how to implement basic authentication on a route.
* Admin API
* ADC
* Ingress Controller
Create a consumer `johndoe`:
```
curl "http://127.0.0.1:9180/apisix/admin/consumers" -X PUT \
-H "X-API-KEY: ${ADMIN_API_KEY}" \
-d '{
"username": "johndoe"
}'
```
Create `basic-auth` credential for the consumer:
```
curl "http://127.0.0.1:9180/apisix/admin/consumers/johndoe/credentials" -X PUT \
-H "X-API-KEY: ${ADMIN_API_KEY}" \
-d '{
"id": "cred-john-basic-auth",
"plugins": {
"basic-auth": {
"username": "johndoe",
"password": "john-key"
}
}
}'
```
Create a route with `basic-auth`:
```
curl "http://127.0.0.1:9180/apisix/admin/routes" -X PUT \
-H "X-API-KEY: ${ADMIN_API_KEY}" \
-d '{
"id": "basic-auth-route",
"uri": "/anything",
"plugins": {
"basic-auth": {}
},
"upstream": {
"type": "roundrobin",
"nodes": {
"httpbin.org:80": 1
}
}
}'
```
Create a consumer with `basic-auth` credential and a route with `basic-auth` plugin configured:
adc.yaml
```
consumers:
- username: johndoe
credentials:
- name: basic-auth
type: basic-auth
config:
username: johndoe
password: john-key
services:
- name: basic-auth-service
routes:
- name: basic-auth-route
uris:
- /anything
plugins:
basic-auth: {}
upstream:
type: roundrobin
nodes:
- host: httpbin.org
port: 80
weight: 1
```
Synchronize the configuration to the gateway:
```
adc sync -f adc.yaml
```
Create a consumer with `basic-auth` credential and a route with `basic-auth` plugin configured:
* Gateway API
* APISIX CRD
basic-auth-ic.yaml
```
apiVersion: apisix.apache.org/v1alpha1
kind: Consumer
metadata:
namespace: aic
name: johndoe
spec:
gatewayRef:
name: apisix
credentials:
- type: basic-auth
name: primary-cred
config:
username: johndoe
password: john-key
---
apiVersion: v1
kind: Service
metadata:
namespace: aic
name: httpbin-external-domain
spec:
type: ExternalName
externalName: httpbin.org
---
apiVersion: apisix.apache.org/v1alpha1
kind: PluginConfig
metadata:
namespace: aic
name: basic-auth-plugin-config
spec:
plugins:
- name: basic-auth
config:
_meta:
disable: false
---
apiVersion: gateway.networking.k8s.io/v1
kind: HTTPRoute
metadata:
namespace: aic
name: basic-auth-route
spec:
parentRefs:
- name: apisix
rules:
- matches:
- path:
type: Exact
value: /anything
filters:
- type: ExtensionRef
extensionRef:
group: apisix.apache.org
kind: PluginConfig
name: basic-auth-plugin-config
backendRefs:
- name: httpbin-external-domain
port: 80
```
Apply the configuration to your cluster:
```
kubectl apply -f basic-auth-ic.yaml
```
basic-auth-ic.yaml
```
apiVersion: apisix.apache.org/v2
kind: ApisixConsumer
metadata:
namespace: aic
name: johndoe
spec:
ingressClassName: apisix
authParameter:
basicAuth:
value:
username: johndoe
password: john-key
---
apiVersion: apisix.apache.org/v2
kind: ApisixUpstream
metadata:
namespace: aic
name: httpbin-external-domain
spec:
ingressClassName: apisix
externalNodes:
- type: Domain
name: httpbin.org
---
apiVersion: apisix.apache.org/v2
kind: ApisixRoute
metadata:
namespace: aic
name: basic-auth-route
spec:
ingressClassName: apisix
http:
- name: basic-auth-route
match:
paths:
- /anything
upstreams:
- name: httpbin-external-domain
plugins:
- name: basic-auth
enable: true
```
Apply the configuration to your cluster:
```
kubectl apply -f basic-auth-ic.yaml
```
#### Verify with Valid Credentials[](#verify-with-valid-credentials "Direct link to Verify with Valid Credentials")
Send a request to the route with valid credentials:
```
curl -i "http://127.0.0.1:9080/anything" -u johndoe:john-key
```
You should see an `HTTP/1.1 200 OK` response similar to the following:
```
{
"args": {},
"headers": {
"Accept": "*/*",
"Authorization": "Basic am9obmRvZTpqb2huLWtleQ==",
"Host": "127.0.0.1",
"User-Agent": "curl/8.6.0",
"X-Amzn-Trace-Id": "Root=1-66e5107c-5bb3e24f2de5baf733aec1cc",
"X-Consumer-Username": "johndoe",
"X-Credential-Identifier": "cred-john-basic-auth",
"X-Forwarded-Host": "127.0.0.1"
},
"origin": "192.168.65.1, 205.198.122.37",
"url": "http://127.0.0.1/anything"
}
```
#### Verify with Invalid Credentials[](#verify-with-invalid-credentials "Direct link to Verify with Invalid Credentials")
Send a request with invalid credentials:
```
curl -i "http://127.0.0.1:9080/anything" -u johndoe:invalid-password
```
You should see an `HTTP/1.1 401 Unauthorized` response with the following:
```
{"message":"Invalid user authorization"}
```
#### Verify without Credentials[](#verify-without-credentials "Direct link to Verify without Credentials")
Send a request without credentials:
```
curl -i "http://127.0.0.1:9080/anything"
```
You should see an `HTTP/1.1 401 Unauthorized` response with the following:
```
{"message":"Missing authorization in request"}
```
### Hide Authentication Information From Upstream[](#hide-authentication-information-from-upstream "Direct link to Hide Authentication Information From Upstream")
The following example demonstrates how to prevent the client's credentials (the `Authorization` header) from being sent to the upstream services by configuring `hide_credentials`. If you are using APISIX, the `Authorization` header containing the client's credentials is forwarded to the upstream services by default, which might lead to security risks in some circumstances and you should consider updating `hide_credentials` as shown in this example.
* Admin API
* ADC
* Ingress Controller
Create a consumer `johndoe`:
```
curl "http://127.0.0.1:9180/apisix/admin/consumers" -X PUT \
-H "X-API-KEY: ${ADMIN_API_KEY}" \
-d '{
"username": "johndoe"
}'
```
Create `basic-auth` credential for the consumer:
```
curl "http://127.0.0.1:9180/apisix/admin/consumers/johndoe/credentials" -X PUT \
-H "X-API-KEY: ${ADMIN_API_KEY}" \
-d '{
"id": "cred-john-basic-auth",
"plugins": {
"basic-auth": {
"username": "johndoe",
"password": "john-key"
}
}
}'
```
#### Without Hiding Credentials[](#without-hiding-credentials "Direct link to Without Hiding Credentials")
Create a route with `basic-auth` and configure `hide_credentials` to `false`, which is the default configuration:
```
curl "http://127.0.0.1:9180/apisix/admin/routes" -X PUT \
-H "X-API-KEY: ${ADMIN_API_KEY}" \
-d '{
"id": "basic-auth-route",
"uri": "/anything",
"plugins": {
"basic-auth": {
"hide_credentials": false
}
},
"upstream": {
"type": "roundrobin",
"nodes": {
"httpbin.org:80": 1
}
}
}'
```
Create a consumer with `basic-auth` credential and a route with `basic-auth` plugin configured:
adc.yaml
```
consumers:
- username: johndoe
credentials:
- name: basic-auth
type: basic-auth
config:
username: johndoe
password: john-key
services:
- name: basic-auth-service
routes:
- name: basic-auth-route
uris:
- /anything
plugins:
basic-auth:
hide_credentials: false
upstream:
type: roundrobin
nodes:
- host: httpbin.org
port: 80
weight: 1
```
Synchronize the configuration to the gateway:
```
adc sync -f adc.yaml
```
Create a consumer with `basic-auth` credential and a route with `basic-auth` plugin configured:
* Gateway API
* APISIX CRD
basic-auth-ic.yaml
```
apiVersion: apisix.apache.org/v1alpha1
kind: Consumer
metadata:
namespace: aic
name: johndoe
spec:
gatewayRef:
name: apisix
credentials:
- type: basic-auth
name: primary-cred
config:
username: johndoe
password: john-key
---
apiVersion: v1
kind: Service
metadata:
namespace: aic
name: httpbin-external-domain
spec:
type: ExternalName
externalName: httpbin.org
---
apiVersion: apisix.apache.org/v1alpha1
kind: PluginConfig
metadata:
namespace: aic
name: basic-auth-plugin-config
spec:
plugins:
- name: basic-auth
config:
_meta:
disable: false
hide_credentials: false
---
apiVersion: gateway.networking.k8s.io/v1
kind: HTTPRoute
metadata:
namespace: aic
name: basic-auth-route
spec:
parentRefs:
- name: apisix
rules:
- matches:
- path:
type: Exact
value: /anything
filters:
- type: ExtensionRef
extensionRef:
group: apisix.apache.org
kind: PluginConfig
name: basic-auth-plugin-config
backendRefs:
- name: httpbin-external-domain
port: 80
```
Apply the configuration to your cluster:
```
kubectl apply -f basic-auth-ic.yaml
```
basic-auth-ic.yaml
```
apiVersion: apisix.apache.org/v2
kind: ApisixConsumer
metadata:
namespace: aic
name: johndoe
spec:
ingressClassName: apisix
authParameter:
basicAuth:
value:
username: johndoe
password: john-key
---
apiVersion: apisix.apache.org/v2
kind: ApisixUpstream
metadata:
namespace: aic
name: httpbin-external-domain
spec:
ingressClassName: apisix
externalNodes:
- type: Domain
name: httpbin.org
---
apiVersion: apisix.apache.org/v2
kind: ApisixRoute
metadata:
namespace: aic
name: basic-auth-route
spec:
ingressClassName: apisix
http:
- name: basic-auth-route
match:
paths:
- /anything
upstreams:
- name: httpbin-external-domain
plugins:
- name: basic-auth
enable: true
config:
hide_credentials: false
```
Apply the configuration to your cluster:
```
kubectl apply -f basic-auth-ic.yaml
```
Send a request with the valid key:
```
curl -i "http://127.0.0.1:9080/anything" -u johndoe:john-key
```
You should see an `HTTP/1.1 200 OK` response with the following:
```
{
"args": {},
"data": "",
"files": {},
"form": {},
"headers": {
"Accept": "*/*",
"Authorization": "Basic am9obmRvZTpqb2huLWtleQ==",
"Host": "127.0.0.1",
"User-Agent": "curl/8.6.0",
"X-Amzn-Trace-Id": "Root=1-66cc2195-22bd5f401b13480e63c498c6",
"X-Consumer-Username": "johndoe",
"X-Credential-Identifier": "cred-john-basic-auth",
"X-Forwarded-Host": "127.0.0.1"
},
"json": null,
"method": "GET",
"origin": "192.168.65.1, 43.228.226.23",
"url": "http://127.0.0.1/anything"
}
```
Note that the credentials are visible to the upstream service in base64-encoded format.
tip
You can also pass the base64-encoded credentials in the request using the `Authorization` header as such:
```
curl -i "http://127.0.0.1:9080/anything" -H "Authorization: Basic am9obmRvZTpqb2huLWtleQ=="
```
#### Hide Credentials[](#hide-credentials "Direct link to Hide Credentials")
* Admin API
* ADC
* Ingress Controller
Update the plugin's `hide_credentials` to `true`:
```
curl "http://127.0.0.1:9180/apisix/admin/routes/basic-auth-route" -X PATCH \
-H "X-API-KEY: ${ADMIN_API_KEY}" \
-d '{
"plugins": {
"basic-auth": {
"hide_credentials": true
}
}
}'
```
Update the route configuration:
adc.yaml
```
# other configs
# ...
services:
- name: basic-auth-service
routes:
- name: basic-auth-route
uris:
- /anything
plugins:
basic-auth:
hide_credentials: true
upstream:
type: roundrobin
nodes:
- host: httpbin.org
port: 80
weight: 1
```
Synchronize the configuration to the gateway:
```
adc sync -f adc.yaml
```
* Gateway API
* APISIX CRD
Update the PluginConfig to set `hide_credentials` to `true`:
basic-auth-ic.yaml
```
# other configs
# ---
apiVersion: apisix.apache.org/v1alpha1
kind: PluginConfig
metadata:
namespace: aic
name: basic-auth-plugin-config
spec:
plugins:
- name: basic-auth
config:
_meta:
disable: false
hide_credentials: true
```
Apply the configuration to your cluster:
```
kubectl apply -f basic-auth-ic.yaml
```
Update the ApisixRoute to set `hide_credentials` to `true`:
basic-auth-ic.yaml
```
# other configs
# ---
apiVersion: apisix.apache.org/v2
kind: ApisixRoute
metadata:
namespace: aic
name: basic-auth-route
spec:
ingressClassName: apisix
http:
- name: basic-auth-route
match:
paths:
- /anything
upstreams:
- name: httpbin-external-domain
plugins:
- name: basic-auth
enable: true
config:
hide_credentials: true
```
Apply the configuration to your cluster:
```
kubectl apply -f basic-auth-ic.yaml
```
Send a request with the valid key:
```
curl -i "http://127.0.0.1:9080/anything" -u johndoe:john-key
```
You should see an `HTTP/1.1 200 OK` response with the following:
```
{
"args": {},
"data": "",
"files": {},
"form": {},
"headers": {
"Accept": "*/*",
"Host": "127.0.0.1",
"User-Agent": "curl/8.6.0",
"X-Amzn-Trace-Id": "Root=1-66cc21a7-4f6ac87946e25f325167d53a",
"X-Consumer-Username": "johndoe",
"X-Credential-Identifier": "cred-john-basic-auth",
"X-Forwarded-Host": "127.0.0.1"
},
"json": null,
"method": "GET",
"origin": "192.168.65.1, 43.228.226.23",
"url": "http://127.0.0.1/anything"
}
```
Note that the credentials are no longer visible to the upstream service.
### Add Consumer Custom ID to Header[](#add-consumer-custom-id-to-header "Direct link to Add Consumer Custom ID to Header")
The following example demonstrates how you can attach a consumer custom ID to authenticated request in the `Consumer-Custom-Id` header, which can be used to implement additional logics as needed.
* Admin API
* ADC
* Ingress Controller
Create a consumer `johndoe` with a custom ID label:
```
curl "http://127.0.0.1:9180/apisix/admin/consumers" -X PUT \
-H "X-API-KEY: ${ADMIN_API_KEY}" \
-d '{
"username": "johndoe",
"labels": {
"custom_id": "495aec6a"
}
}'
```
Create `basic-auth` credential for the consumer:
```
curl "http://127.0.0.1:9180/apisix/admin/consumers/johndoe/credentials" -X PUT \
-H "X-API-KEY: ${ADMIN_API_KEY}" \
-d '{
"id": "cred-john-basic-auth",
"plugins": {
"basic-auth": {
"username": "johndoe",
"password": "john-key"
}
}
}'
```
Create a route with `basic-auth`:
```
curl "http://127.0.0.1:9180/apisix/admin/routes" -X PUT \
-H "X-API-KEY: ${ADMIN_API_KEY}" \
-d '{
"id": "basic-auth-route",
"uri": "/anything",
"plugins": {
"basic-auth": {}
},
"upstream": {
"type": "roundrobin",
"nodes": {
"httpbin.org:80": 1
}
}
}'
```
Create a consumer with `basic-auth` credential and a route with `basic-auth` plugin enabled:
adc.yaml
```
consumers:
- username: johndoe
labels:
custom_id: "495aec6a"
credentials:
- name: basic-auth
type: basic-auth
config:
username: johndoe
password: john-key
services:
- name: basic-auth-service
routes:
- name: basic-auth-route
uris:
- /anything
plugins:
basic-auth: {}
upstream:
type: roundrobin
nodes:
- host: httpbin.org
port: 80
weight: 1
```
Synchronize the configuration to the gateway:
```
adc sync -f adc.yaml
```
Create a consumer with `basic-auth` credential and a route with `basic-auth` plugin enabled:
* Gateway API
* APISIX CRD
basic-auth-ic.yaml
```
apiVersion: apisix.apache.org/v1alpha1
kind: Consumer
metadata:
namespace: aic
name: johndoe
labels:
custom_id: "495aec6a"
spec:
gatewayRef:
name: apisix
credentials:
- type: basic-auth
name: primary-key
config:
username: johndoe
password: john-key
---
apiVersion: v1
kind: Service
metadata:
namespace: aic
name: httpbin-external-domain
spec:
type: ExternalName
externalName: httpbin.org
---
apiVersion: apisix.apache.org/v1alpha1
kind: PluginConfig
metadata:
namespace: aic
name: basic-auth-plugin-config
spec:
plugins:
- name: basic-auth
config:
_meta:
disable: false
---
apiVersion: gateway.networking.k8s.io/v1
kind: HTTPRoute
metadata:
namespace: aic
name: basic-auth-route
spec:
parentRefs:
- name: apisix
rules:
- matches:
- path:
type: Exact
value: /anything
filters:
- type: ExtensionRef
extensionRef:
group: apisix.apache.org
kind: PluginConfig
name: basic-auth-plugin-config
backendRefs:
- name: httpbin-external-domain
port: 80
```
Apply the configuration to your cluster:
```
kubectl apply -f basic-auth-ic.yaml
```
basic-auth-ic.yaml
```
apiVersion: apisix.apache.org/v2
kind: ApisixConsumer
metadata:
namespace: aic
name: johndoe
labels:
custom_id: "495aec6a"
spec:
ingressClassName: apisix
authParameter:
basicAuth:
value:
username: johndoe
password: john-key
---
apiVersion: apisix.apache.org/v2
kind: ApisixUpstream
metadata:
namespace: aic
name: httpbin-external-domain
spec:
ingressClassName: apisix
externalNodes:
- type: Domain
name: httpbin.org
---
apiVersion: apisix.apache.org/v2
kind: ApisixRoute
metadata:
namespace: aic
name: basic-auth-route
spec:
ingressClassName: apisix
http:
- name: basic-auth-route
match:
paths:
- /anything
upstreams:
- name: httpbin-external-domain
plugins:
- name: basic-auth
enable: true
config:
_meta:
disable: false
```
Apply the configuration to your cluster:
```
kubectl apply -f basic-auth-ic.yaml
```
To verify, send a request to the route with the valid key:
```
curl -i "http://127.0.0.1:9080/anything" -u johndoe:john-key
```
You should see an `HTTP/1.1 200 OK` response similar to the following:
```
{
"args": {},
"data": "",
"files": {},
"form": {},
"headers": {
"Accept": "*/*",
"Authorization": "Basic am9obmRvZTpqb2huLWtleQ==",
"Host": "127.0.0.1",
"User-Agent": "curl/8.6.0",
"X-Amzn-Trace-Id": "Root=1-66ea8d64-33df89052ae198a706e18c2a",
"X-Consumer-Username": "aic_johndoe",
"X-Consumer-Custom-Id": "495aec6a",
"X-Forwarded-Host": "127.0.0.1"
},
"json": null,
"method": "GET",
"origin": "192.168.65.1, 205.198.122.37",
"url": "http://127.0.0.1/anything"
}
```
If you would like to attach more consumer custom headers to authenticated requests, see the [`attach-consumer-label`](https://docs.api7.ai/hub/attach-consumer-label.md) plugin.
### Rate Limit with Anonymous Consumer[](#rate-limit-with-anonymous-consumer "Direct link to Rate Limit with Anonymous Consumer")
The following example demonstrates how you can configure different rate limiting policies by regular and anonymous consumers, where the anonymous consumer does not need to authenticate and has less quota.
* Admin API
* ADC
* Ingress Controller
Create a regular consumer `johndoe` and configure the `limit-count` plugin to allow for a quota of 3 within a 30-second window:
```
curl "http://127.0.0.1:9180/apisix/admin/consumers" -X PUT \
-H "X-API-KEY: ${ADMIN_API_KEY}" \
-d '{
"username": "johndoe",
"plugins": {
"limit-count": {
"count": 3,
"time_window": 30,
"rejected_code": 429,
"policy": "local"
}
}
}'
```
Create the `basic-auth` credential for the consumer `johndoe`:
```
curl "http://127.0.0.1:9180/apisix/admin/consumers/johndoe/credentials" -X PUT \
-H "X-API-KEY: ${ADMIN_API_KEY}" \
-d '{
"id": "cred-john-basic-auth",
"plugins": {
"basic-auth": {
"username": "johndoe",
"password": "john-key"
}
}
}'
```
Create an anonymous user `anonymous` and configure the `limit-count` plugin to allow for a quota of 1 within a 30-second window:
```
curl "http://127.0.0.1:9180/apisix/admin/consumers" -X PUT \
-H "X-API-KEY: ${ADMIN_API_KEY}" \
-d '{
"username": "anonymous",
"plugins": {
"limit-count": {
"count": 1,
"time_window": 30,
"rejected_code": 429,
"policy": "local"
}
}
}'
```
Create a route and configure the `basic-auth` plugin to accept anonymous consumer `anonymous` from bypassing the authentication:
```
curl "http://127.0.0.1:9180/apisix/admin/routes" -X PUT \
-H "X-API-KEY: ${ADMIN_API_KEY}" \
-d '{
"id": "basic-auth-route",
"uri": "/anything",
"plugins": {
"basic-auth": {
"anonymous_consumer": "anonymous"
}
},
"upstream": {
"type": "roundrobin",
"nodes": {
"httpbin.org:80": 1
}
}
}'
```
Configure consumers with different rate limits and a route that accepts anonymous users:
adc.yaml
```
consumers:
- username: johndoe
plugins:
limit-count:
count: 3
time_window: 30
rejected_code: 429
policy: local
credentials:
- name: basic-auth
type: basic-auth
config:
username: johndoe
password: john-key
- username: anonymous
plugins:
limit-count:
count: 1
time_window: 30
rejected_code: 429
policy: local
services:
- name: anonymous-rate-limit-service
routes:
- name: basic-auth-route
uris:
- /anything
plugins:
basic-auth:
anonymous_consumer: anonymous
upstream:
type: roundrobin
nodes:
- host: httpbin.org
port: 80
weight: 1
```
Synchronize the configuration to the gateway:
```
adc sync -f adc.yaml
```
* Gateway API
* APISIX CRD
Configure consumers with different rate limits and a route that accepts anonymous users:
basic-auth-ic.yaml
```
apiVersion: apisix.apache.org/v1alpha1
kind: Consumer
metadata:
namespace: aic
name: johndoe
spec:
gatewayRef:
name: apisix
credentials:
- type: basic-auth
name: primary-key
config:
username: johndoe
password: john-key
plugins:
- name: limit-count
config:
count: 3
time_window: 30
rejected_code: 429
policy: local
---
apiVersion: apisix.apache.org/v1alpha1
kind: Consumer
metadata:
namespace: aic
name: anonymous
spec:
gatewayRef:
name: apisix
plugins:
- name: limit-count
config:
count: 1
time_window: 30
rejected_code: 429
policy: local
---
apiVersion: v1
kind: Service
metadata:
namespace: aic
name: httpbin-external-domain
spec:
type: ExternalName
externalName: httpbin.org
---
apiVersion: apisix.apache.org/v1alpha1
kind: PluginConfig
metadata:
namespace: aic
name: basic-auth-plugin-config
spec:
plugins:
- name: basic-auth
config:
anonymous_consumer: aic_anonymous # namespace_consumername
---
apiVersion: gateway.networking.k8s.io/v1
kind: HTTPRoute
metadata:
namespace: aic
name: basic-auth-route
spec:
parentRefs:
- name: apisix
rules:
- matches:
- path:
type: Exact
value: /anything
filters:
- type: ExtensionRef
extensionRef:
group: apisix.apache.org
kind: PluginConfig
name: basic-auth-plugin-config
backendRefs:
- name: httpbin-external-domain
port: 80
```
Apply the configuration to your cluster:
```
kubectl apply -f basic-auth-ic.yaml
```
Configure consumers with different rate limits and a route that accepts anonymous users:
basic-auth-ic.yaml
```
apiVersion: apisix.apache.org/v2
kind: ApisixConsumer
metadata:
namespace: aic
name: johndoe
spec:
ingressClassName: apisix
authParameter:
basicAuth:
value:
username: johndoe
password: john-key
plugins:
- name: limit-count
enable: true
config:
count: 3
time_window: 30
rejected_code: 429
policy: local
---
apiVersion: apisix.apache.org/v2
kind: ApisixConsumer
metadata:
namespace: aic
name: anonymous
spec:
ingressClassName: apisix
plugins:
- name: limit-count
enable: true
config:
count: 1
time_window: 30
rejected_code: 429
policy: local
---
apiVersion: apisix.apache.org/v2
kind: ApisixUpstream
metadata:
namespace: aic
name: httpbin-external-domain
spec:
ingressClassName: apisix
externalNodes:
- type: Domain
name: httpbin.org
---
apiVersion: apisix.apache.org/v2
kind: ApisixRoute
metadata:
namespace: aic
name: basic-auth-route
spec:
ingressClassName: apisix
http:
- name: basic-auth-route
match:
paths:
- /anything
upstreams:
- name: httpbin-external-domain
plugins:
- name: basic-auth
enable: true
config:
anonymous_consumer: aic_anonymous
```
Apply the configuration to your cluster:
```
kubectl apply -f basic-auth-ic.yaml
```
To verify, send five consecutive requests with `johndoe`'s credentials:
```
resp=$(seq 5 | xargs -I{} curl "http://127.0.0.1:9080/anything" -u johndoe:john-key -o /dev/null -s -w "%{http_code}\n") && \
count_200=$(echo "$resp" | grep "200" | wc -l) && \
count_429=$(echo "$resp" | grep "429" | wc -l) && \
echo "200": $count_200, "429": $count_429
```
You should see the following response, showing that out of the 5 requests, 3 requests were successful (status code 200) while the others were rejected (status code 429).
```
200: 3, 429: 2
```
Send five anonymous requests:
```
resp=$(seq 5 | xargs -I{} curl "http://127.0.0.1:9080/anything" -o /dev/null -s -w "%{http_code}\n") && \
count_200=$(echo "$resp" | grep "200" | wc -l) && \
count_429=$(echo "$resp" | grep "429" | wc -l) && \
echo "200": $count_200, "429": $count_429
```
You should see the following response, showing that only one request was successful:
```
200: 1, 429: 4
```
---
## Parameters[](#parameters "Direct link to Parameters")
See plugin [common configurations](https://docs.api7.ai/apisix/reference/plugin-common-configurations.md) for configuration options available to all plugins.
### Credentials[](#credentials "Direct link to Credentials")
The following are plugin attributes available for configurations on [credentials](https://docs.api7.ai/apisix/key-concepts/credentials.md).
* username
string
required
***
Unique basic auth username for a consumer.
* password
string
required
***
Basic auth password for the consumer.
In API7 Enterprise from version 3.9.20, the password must not be empty, and a password containing colons is accepted. Following RFC 7617, everything after the first colon of the decoded credentials is taken as the password. Whitespace is still stripped from both halves of the decoded credentials before they are compared, so a password containing spaces cannot be used.
The password is encrypted with AES before being stored in etcd. You can also store it in an environment variable and reference it using the `$env://` prefix, or in a secret manager such as HashiCorp Vault's [KV secrets engine](https://developer.hashicorp.com/vault/docs/secrets/kv), and reference it using the `$secret://` prefix. For more information, see [secrets](https://docs.api7.ai/apisix/key-concepts/secrets.md).
A `$env://` or `$secret://` reference that resolves to an empty value still passes configuration validation, because references are resolved at request time. From API7 Enterprise version 3.9.20, the gateway fails closed in that case, rejecting every request for the consumer with `HTTP 401` and logging a warning.
### Routes or Services[](#routes-or-services "Direct link to Routes or Services")
The following are plugin attributes available for configurations on [routes](https://docs.api7.ai/apisix/key-concepts/routes.md) or [services](https://docs.api7.ai/apisix/key-concepts/services.md).
* hide\_credentials
boolean
default: `false`
***
If true, do not pass the authorization request header to upstream services.
* anonymous\_consumer
string
***
Anonymous consumer name. If configured, allow anonymous users to bypass the authentication. See [Rate Limit with Anonymous Consumer](https://docs.api7.ai/hub/basic-auth.md#rate-limit-with-anonymous-consumer) for more details.
* realm
string
default: `basic`
***
Realm in the [`WWW-Authenticate`](https://datatracker.ietf.org/doc/html/rfc7235#section-4.1) response header returned with a `401 Unauthorized` response due to authentication failure. For example:
* If `realm` is set to `basic-auth`, the 401 response will include the following header:
```
WWW-Authenticate: Basic realm="basic-auth"
```
* If `realm` is not configured, the 401 response will include the following header:
```
WWW-Authenticate: Basic realm="basic"
```
This parameter is available in API7 Enterprise version 3.9.2 and later, and in Apache APISIX version 3.15.0 and later.
---
# body-transformer
The `body-transformer` plugin performs template-based transformations to transform the request and/or response bodies from one format to another.
## Examples[](#examples "Direct link to Examples")
The examples below demonstrate how you can configure `body-transformer` for different scenarios.
The transformation template uses [lua-resty-template](https://github.com/bungle/lua-resty-template) syntax. See the [template syntax](https://github.com/bungle/lua-resty-template#template-syntax) to learn more.
You can also use auxiliary functions `_escape_json()` and `_escape_xml()` to escape special characters such as double quotes, `_body` to access request body, and `_ctx` to access context variables.
In all cases, you should ensure that the transformation template is a valid JSON string.
### Transform between JSON and XML SOAP[](#transform-between-json-and-xml-soap "Direct link to Transform between JSON and XML SOAP")
The following example demonstrates how to transform the request body from JSON to XML and the response body from XML to JSON when working with a SOAP upstream service.
Start the sample SOAP service:
```
cd /tmp
git clone https://github.com/spring-guides/gs-producing-web-service.git
cd gs-producing-web-service/complete
./mvnw spring-boot:run
```
Create the request and response transformation templates:
```
req_template=$(cat <
{{_escape_xml(name)}}
EOF
)
rsp_template=$(cat <
{{_escape_xml(name)}}
input_format: json
response:
template: |
{% if Envelope.Body.Fault == nil then %}
{
"status":"{{_ctx.var.status}}",
"currency":"{{Envelope.Body.getCountryResponse.country.currency}}",
"population":{{Envelope.Body.getCountryResponse.country.population}},
"capital":"{{Envelope.Body.getCountryResponse.country.capital}}",
"name":"{{Envelope.Body.getCountryResponse.country.name}}"
}
{% else %}
{
"message":{*_escape_json(Envelope.Body.Fault.faultstring[1])*},
"code":"{{Envelope.Body.Fault.faultcode}}"
{% if Envelope.Body.Fault.faultactor ~= nil then %}
, "actor":"{{Envelope.Body.Fault.faultactor}}"
{% end %}
}
{% end %}
input_format: xml
proxy-rewrite:
headers:
set:
Content-Type: text/xml
upstream:
type: roundrobin
nodes:
- host: host.docker.internal
port: 8080
weight: 1
```
Synchronize the configuration to the gateway:
```
adc sync -f adc.yaml
```
* Gateway API
* APISIX CRD
Create a Kubernetes manifest file of a route with the `body-transformer` plugin:
soap-route.yaml
```
apiVersion: apisix.apache.org/v1alpha1
kind: PluginConfig
metadata:
namespace: aic
name: json-xml-plugin
spec:
plugins:
- name: body-transformer
config:
request:
template: |
{{_escape_xml(name)}}
input_format: json
response:
template: |
{% if Envelope.Body.Fault == nil then %}
{
"status":"{{_ctx.var.status}}",
"currency":"{{Envelope.Body.getCountryResponse.country.currency}}",
"population":{{Envelope.Body.getCountryResponse.country.population}},
"capital":"{{Envelope.Body.getCountryResponse.country.capital}}",
"name":"{{Envelope.Body.getCountryResponse.country.name}}"
}
{% else %}
{
"message":{*_escape_json(Envelope.Body.Fault.faultstring[1])*},
"code":"{{Envelope.Body.Fault.faultcode}}"
{% if Envelope.Body.Fault.faultactor ~= nil then %}
, "actor":"{{Envelope.Body.Fault.faultactor}}"
{% end %}
}
{% end %}
input_format: xml
- name: proxy-rewrite
config:
headers:
set:
Content-Type: text/xml
---
apiVersion: v1
kind: Service
metadata:
namespace: aic
name: ws-external-domain
spec:
type: ExternalName
externalName: host.docker.internal
---
apiVersion: gateway.networking.k8s.io/v1
kind: HTTPRoute
metadata:
namespace: aic
name: body-transformer-route
spec:
parentRefs:
- name: apisix
rules:
- matches:
- method: POST
path:
type: Exact
value: /services
filters:
- type: ExtensionRef
extensionRef:
group: apisix.apache.org
kind: PluginConfig
name: json-xml-plugin
backendRefs:
- name: ws-external-domain
port: 8080
```
Create a Kubernetes manifest file of a route with the `body-transformer` plugin:
soap-route.yaml
```
apiVersion: apisix.apache.org/v2
kind: ApisixRoute
metadata:
namespace: aic
name: body-transformer-route
spec:
ingressClassName: apisix
http:
- name: body-transformer-route
match:
paths:
- /services
methods:
- POST
plugins:
- name: body-transformer
enable: true
config:
request:
template: |
{{_escape_xml(name)}}
input_format: json
response:
template: |
{% if Envelope.Body.Fault == nil then %}
{
"status":"{{_ctx.var.status}}",
"currency":"{{Envelope.Body.getCountryResponse.country.currency}}",
"population":{{Envelope.Body.getCountryResponse.country.population}},
"capital":"{{Envelope.Body.getCountryResponse.country.capital}}",
"name":"{{Envelope.Body.getCountryResponse.country.name}}"
}
{% else %}
{
"message":{*_escape_json(Envelope.Body.Fault.faultstring[1])*},
"code":"{{Envelope.Body.Fault.faultcode}}"
{% if Envelope.Body.Fault.faultactor ~= nil then %}
, "actor":"{{Envelope.Body.Fault.faultactor}}"
{% end %}
}
{% end %}
input_format: xml
- name: proxy-rewrite
enable: true
config:
headers:
set:
Content-Type: text/xml
upstreams:
- name: ws-external-domain
---
apiVersion: apisix.apache.org/v2
kind: ApisixUpstream
metadata:
namespace: aic
name: ws-external-domain
spec:
externalNodes:
- type: Domain
name: host.docker.internal
port: 8080
```
Apply the configuration to your cluster:
```
kubectl apply -f soap-route.yaml
```
❶ Set the request input format as JSON, so that the plugin will apply the JSON decoder internally.
❷ Set the response input format as XML, so that the plugin will apply the XML decoder internally.
❸ Set the `Content-Type` header to `text/xml` for the upstream SOAP service to respond properly.
❹ The address of the SOAP service. `host.docker.internal` resolves to the host machine when APISIX runs in Docker. Replace with the actual address if you are running APISIX differently.
tip
If it is cumbersome to adjust complex text files to be valid transformation templates, you can use the base64 utility to encode the files, such as the following:
```
"body-transformer": {
"request": {
"template": "'"$(base64 -w0 /path/to/request_template_file)"'"
},
"response": {
"template": "'"$(base64 -w0 /path/to/response_template_file)"'"
}
}
```
Send a request with a valid JSON body:
```
curl "http://127.0.0.1:9080/services" -X POST -d '{"name": "Spain"}'
```
The JSON body sent in the request will be transformed into XML before being forwarded to the upstream SOAP service, and the response body will be transformed back from XML to JSON.
You should see a response similar to the following:
```
{
"status": "200",
"currency": "EUR",
"population": 46704314,
"capital": "Madrid",
"name": "Spain"
}
```
### Modify Request Body[](#modify-request-body "Direct link to Modify Request Body")
The following example demonstrates how to dynamically modify the request body.
* Admin API
* ADC
* Ingress Controller
Create a route with `body-transformer`:
```
curl "http://127.0.0.1:9180/apisix/admin/routes" -X PUT \
-H "X-API-KEY: ${ADMIN_API_KEY}" \
-d '{
"id": "body-transformer-route",
"uri": "/anything",
"plugins": {
"body-transformer": {
"request": {
"template": "{\"foo\":\"{{name .. \" world\"}}\",\"bar\":{{age+10}}}"
}
}
},
"upstream": {
"type": "roundrobin",
"nodes": {
"httpbin.org:80": 1
}
}
}'
```
Create a route with `body-transformer`:
adc.yaml
```
services:
- name: body-transformer-service
routes:
- name: body-transformer-route
uris:
- /anything
plugins:
body-transformer:
request:
template: "{\"foo\":\"{{name .. \" world\"}}\",\"bar\":{{age+10}}}"
upstream:
type: roundrobin
nodes:
- host: httpbin.org
port: 80
weight: 1
```
Synchronize the configuration to the gateway:
```
adc sync -f adc.yaml
```
* Gateway API
* APISIX CRD
Create a Kubernetes manifest file of a route with the `body-transformer` plugin:
body-transformer-ic.yaml
```
apiVersion: v1
kind: Service
metadata:
namespace: aic
name: httpbin-external-domain
spec:
type: ExternalName
externalName: httpbin.org
---
apiVersion: apisix.apache.org/v1alpha1
kind: PluginConfig
metadata:
namespace: aic
name: body-transformer-plugin-config
spec:
plugins:
- name: body-transformer
config:
request:
template: "{\"foo\":\"{{name .. \" world\"}}\",\"bar\":{{age+10}}}"
---
apiVersion: gateway.networking.k8s.io/v1
kind: HTTPRoute
metadata:
namespace: aic
name: body-transformer-route
spec:
parentRefs:
- name: apisix
rules:
- matches:
- path:
type: Exact
value: /anything
filters:
- type: ExtensionRef
extensionRef:
group: apisix.apache.org
kind: PluginConfig
name: body-transformer-plugin-config
backendRefs:
- name: httpbin-external-domain
port: 80
```
Create a Kubernetes manifest file of a route with the `body-transformer` plugin:
body-transformer-ic.yaml
```
apiVersion: apisix.apache.org/v2
kind: ApisixUpstream
metadata:
namespace: aic
name: httpbin-external-domain
spec:
ingressClassName: apisix
externalNodes:
- type: Domain
name: httpbin.org
---
apiVersion: apisix.apache.org/v2
kind: ApisixRoute
metadata:
namespace: aic
name: body-transformer-route
spec:
ingressClassName: apisix
http:
- name: body-transformer-route
match:
paths:
- /anything
upstreams:
- name: httpbin-external-domain
plugins:
- name: body-transformer
enable: true
config:
request:
template: "{\"foo\":\"{{name .. \" world\"}}\",\"bar\":{{age+10}}}"
```
Apply the configuration to your cluster:
```
kubectl apply -f body-transformer-ic.yaml
```
❶ Set a template that appends "world" to the name and adds 10 to the age and set them as values to "foo" and "bar" respectively.
Send a request to the route:
```
curl "http://127.0.0.1:9080/anything" -X POST \
-H "Content-Type: application/json" \
-d '{"name":"hello","age":20}' \
-i
```
You should see a response of the following:
```
{
"args": {},
"data": "{\"foo\":\"hello world\",\"bar\":30}",
...
"json": {
"bar": 30,
"foo": "hello world"
},
"method": "POST",
...
}
```
### Generate Request Body Using Variables[](#generate-request-body-using-variables "Direct link to Generate Request Body Using Variables")
The following example demonstrates how to generate request body dynamically using the `ctx` context variables.
* Admin API
* ADC
* Ingress Controller
Create a route with `body-transformer`:
```
curl "http://127.0.0.1:9180/apisix/admin/routes" -X PUT \
-H "X-API-KEY: ${ADMIN_API_KEY}" \
-d '{
"id": "body-transformer-route",
"uri": "/anything",
"plugins": {
"body-transformer": {
"request": {
"template": "{\"foo\":\"{{_ctx.var.arg_name .. \" world\"}}\"}"
}
}
},
"upstream": {
"type": "roundrobin",
"nodes": {
"httpbin.org:80": 1
}
}
}'
```
Create a route with `body-transformer`:
adc.yaml
```
services:
- name: body-transformer-service
routes:
- name: body-transformer-route
uris:
- /anything
plugins:
body-transformer:
request:
template: "{\"foo\":\"{{_ctx.var.arg_name .. \" world\"}}\"}"
upstream:
type: roundrobin
nodes:
- host: httpbin.org
port: 80
weight: 1
```
Synchronize the configuration to the gateway:
```
adc sync -f adc.yaml
```
* Gateway API
* APISIX CRD
Create a Kubernetes manifest file of a route with the `body-transformer` plugin:
body-transformer-ic.yaml
```
apiVersion: v1
kind: Service
metadata:
namespace: aic
name: httpbin-external-domain
spec:
type: ExternalName
externalName: httpbin.org
---
apiVersion: apisix.apache.org/v1alpha1
kind: PluginConfig
metadata:
namespace: aic
name: body-transformer-plugin-config
spec:
plugins:
- name: body-transformer
config:
request:
template: "{\"foo\":\"{{_ctx.var.arg_name .. \" world\"}}\"}"
---
apiVersion: gateway.networking.k8s.io/v1
kind: HTTPRoute
metadata:
namespace: aic
name: body-transformer-route
spec:
parentRefs:
- name: apisix
rules:
- matches:
- path:
type: Exact
value: /anything
filters:
- type: ExtensionRef
extensionRef:
group: apisix.apache.org
kind: PluginConfig
name: body-transformer-plugin-config
backendRefs:
- name: httpbin-external-domain
port: 80
```
Create a Kubernetes manifest file of a route with the `body-transformer` plugin:
body-transformer-ic.yaml
```
apiVersion: apisix.apache.org/v2
kind: ApisixUpstream
metadata:
namespace: aic
name: httpbin-external-domain
spec:
ingressClassName: apisix
externalNodes:
- type: Domain
name: httpbin.org
---
apiVersion: apisix.apache.org/v2
kind: ApisixRoute
metadata:
namespace: aic
name: body-transformer-route
spec:
ingressClassName: apisix
http:
- name: body-transformer-route
match:
paths:
- /anything
upstreams:
- name: httpbin-external-domain
plugins:
- name: body-transformer
enable: true
config:
request:
template: "{\"foo\":\"{{_ctx.var.arg_name .. \" world\"}}\"}"
```
Apply the configuration to your cluster:
```
kubectl apply -f body-transformer-ic.yaml
```
❶ Set a template which accesses the request argument using the [NGINX variable](https://docs.api7.ai/apisix/reference/built-in-variables.md#nginx-variables) `arg_name`.
Send a request to the route with `name` argument:
```
curl -i "http://127.0.0.1:9080/anything?name=hello"
```
You should see a response like this:
```
{
"args": {
"name": "hello"
},
...,
"json": {
"foo": "hello world"
},
...
}
```
### Transform Body from YAML to JSON[](#transform-body-from-yaml-to-json "Direct link to Transform Body from YAML to JSON")
The following example demonstrates how to transform request body from YAML to JSON.
Create the request transformation template:
```
req_template=$(cat < 18 then
context._multipart:set_simple("status", "adult")
else
context._multipart:set_simple("status", "minor")
end
local body = context._multipart:tostring()
%}{* body *}
EOF
)
```
* Admin API
* ADC
* Ingress Controller
Create a route with `body-transformer` as such:
```
curl "http://127.0.0.1:9180/apisix/admin/routes" -X PUT \
-H "X-API-KEY: ${ADMIN_API_KEY}" \
--data-binary @- < 18 then
context._multipart:set_simple("status", "adult")
else
context._multipart:set_simple("status", "minor")
end
local body = context._multipart:tostring()
%}{* body *}
upstream:
type: roundrobin
nodes:
- host: httpbin.org
port: 80
weight: 1
```
Synchronize the configuration to the gateway:
```
adc sync -f adc.yaml
```
* Gateway API
* APISIX CRD
Create a Kubernetes manifest file of a route with the `body-transformer` plugin:
body-transformer-ic.yaml
```
apiVersion: v1
kind: Service
metadata:
namespace: aic
name: httpbin-external-domain
spec:
type: ExternalName
externalName: httpbin.org
---
apiVersion: apisix.apache.org/v1alpha1
kind: PluginConfig
metadata:
namespace: aic
name: body-transformer-plugin-config
spec:
plugins:
- name: body-transformer
config:
request:
input_format: multipart
template: |
{%
if tonumber(context.age) > 18 then
context._multipart:set_simple("status", "adult")
else
context._multipart:set_simple("status", "minor")
end
local body = context._multipart:tostring()
%}{* body *}
---
apiVersion: gateway.networking.k8s.io/v1
kind: HTTPRoute
metadata:
namespace: aic
name: body-transformer-route
spec:
parentRefs:
- name: apisix
rules:
- matches:
- path:
type: Exact
value: /anything
filters:
- type: ExtensionRef
extensionRef:
group: apisix.apache.org
kind: PluginConfig
name: body-transformer-plugin-config
backendRefs:
- name: httpbin-external-domain
port: 80
```
Create a Kubernetes manifest file of a route with the `body-transformer` plugin:
body-transformer-ic.yaml
```
apiVersion: apisix.apache.org/v2
kind: ApisixUpstream
metadata:
namespace: aic
name: httpbin-external-domain
spec:
ingressClassName: apisix
externalNodes:
- type: Domain
name: httpbin.org
---
apiVersion: apisix.apache.org/v2
kind: ApisixRoute
metadata:
namespace: aic
name: body-transformer-route
spec:
ingressClassName: apisix
http:
- name: body-transformer-route
match:
paths:
- /anything
upstreams:
- name: httpbin-external-domain
plugins:
- name: body-transformer
enable: true
config:
request:
input_format: multipart
template: |
{%
if tonumber(context.age) > 18 then
context._multipart:set_simple("status", "adult")
else
context._multipart:set_simple("status", "minor")
end
local body = context._multipart:tostring()
%}{* body *}
```
Apply the configuration to your cluster:
```
kubectl apply -f body-transformer-ic.yaml
```
❶ Set the `input_format` to `multipart`.
❷ Set to the previously created request template.
Send a multipart POST request to the route:
```
curl -X POST \
-F "name=john" \
-F "age=10" \
"http://127.0.0.1:9080/anything"
```
You should see a response similar to the following:
```
{
"args": {},
"data": "",
"files": {},
"form": {
"age": "10",
"name": "john",
"status": "minor"
},
"headers": {
"Accept": "*/*",
"Content-Length": "361",
"Content-Type": "multipart/form-data; boundary=------------------------qtPjk4c8ZjmGOXNKzhqnOP",
...
},
...
}
```
### Transform Response Body Based on Consumer Identity[](#transform-response-body-based-on-consumer-identity "Direct link to Transform Response Body Based on Consumer Identity")
The following example demonstrates how to customize response body transformations based on different consumer identities. The example shows how to return different response formats to different consumers while filtering sensitive fields and renaming properties.
Create the response transformation template that applies different transformations based on the consumer identity:
```
rsp_template=$(cat <
## Response Headers[](#response-headers "Direct link to Response Headers")
The plugin can add the following response headers, depending on the configuration of `append_waf_resp_header` and `append_waf_debug_header`:
| Header | Description |
| ----------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `X-APISIX-CHAITIN-WAF` | Indicates whether APISIX forwarded the request to the WAF server.
• `yes`: Request was forwarded to the WAF server.
• `no`: Request was not forwarded to the WAF server.
• `unhealthy`: Request matches the configured rules, but no WAF service is available.
• `err`: An error occurred during plugin execution. The `X-APISIX-CHAITIN-WAF-ERROR` header is also included with details.
• `waf-err`: Error while interacting with the WAF server. The `X-APISIX-CHAITIN-WAF-ERROR` header is also included with details.
• `timeout`: Request to the WAF server timed out. |
| `X-APISIX-CHAITIN-WAF-TIME` | Round-trip time (RTT) in milliseconds for the request to the Chaitin WAF server, including both network latency and WAF server processing. |
| `X-APISIX-CHAITIN-WAF-STATUS` | Status code returned to APISIX by the WAF server. |
| `X-APISIX-CHAITIN-WAF-ACTION` | Action returned to APISIX by the WAF server.
• `pass`: Request was allowed by the WAF service.
• `reject`: Request was blocked by the WAF service. |
| `X-APISIX-CHAITIN-WAF-ERROR` | Debug header. Contains WAF error message. |
| `X-APISIX-CHAITIN-WAF-SERVER` | Debug header. Indicates which WAF server was selected. |
## Examples[](#examples "Direct link to Examples")
The examples below demonstrate how you can configure `chaitin-waf` plugin for different scenarios.
Before proceeding, make sure you have installed [Chaitin WAF (SafeLine)](https://docs.waf.chaitin.com/en/GetStarted/Deploy).
### Block Malicious Requests on a Route[](#block-malicious-requests-on-a-route "Direct link to Block Malicious Requests on a Route")
The following example demonstrates how to integrate with Chaitin WAF to protect traffic on a route, rejecting malicious requests immediately.
* Admin API
* ADC
* Ingress Controller
Configure the Chaitin WAF connection details using [plugin metadata](https://docs.api7.ai/apisix/key-concepts/plugin-metadata.md) (update the address accordingly):
```
curl "http://127.0.0.1:9180/apisix/admin/plugin_metadata/chaitin-waf" -X PUT \
-H 'X-API-KEY: ${ADMIN_API_KEY}' \
-d '{
"nodes": [
{
"host": "172.22.222.5",
"port": 8000
}
]
}'
```
Create a route and enable `chaitin-waf` on the route to block requests identified to be malicious:
```
curl "http://127.0.0.1:9180/apisix/admin/routes" -X PUT \
-H "X-API-KEY: ${ADMIN_API_KEY}" \
-d '{
"id": "chaitin-waf-route",
"uri": "/anything",
"plugins": {
"chaitin-waf": {
"mode": "block",
"append_waf_resp_header": true,
"append_waf_debug_header": true
}
},
"upstream": {
"type": "roundrobin",
"nodes": {
"httpbin.org:80": 1
}
}
}'
```
❶ Set `mode` to `block` to block requests identified to be malicious.
❷ Set `append_waf_resp_header` to `true` to include WAF-related standard response headers.
❸ Set `append_waf_debug_header` to `true` to include WAF-related debugging response headers.
adc.yaml
```
plugin_metadata:
chaitin-waf:
nodes:
- host: "172.22.222.5"
port: 8000
services:
- name: chaitin-waf-service
routes:
- name: chaitin-waf-route
uris:
- /anything
plugins:
chaitin-waf:
mode: block
append_waf_resp_header: true
append_waf_debug_header: true
upstream:
type: roundrobin
nodes:
- host: httpbin.org
port: 80
weight: 1
```
Synchronize the configuration to the gateway:
```
adc sync -f adc.yaml
```
❶ `nodes`: List of Chaitin WAF service addresses. Update the `host` and `port` to match your Chaitin WAF (SafeLine) deployment.
❷ Set `mode` to `block` to block requests identified to be malicious.
❸ Set `append_waf_resp_header` to `true` to include WAF-related standard response headers.
❹ Set `append_waf_debug_header` to `true` to include WAF-related debugging response headers.
Update your GatewayProxy manifest to configure the plugin metadata. If Chaitin WAF is installed on a host machine outside the cluster, use the host's IP address. In most deployments, expose Chaitin WAF as a reachable Service, IP address, or DNS name inside the cluster, or use the node/LoadBalancer address instead.
gatewayproxy.yaml
```
apiVersion: apisix.apache.org/v1alpha1
kind: GatewayProxy
metadata:
namespace: aic
name: apisix-config
spec:
provider:
type: ControlPlane
controlPlane:
# ...
# your control plane connection configuration
pluginMetadata:
chaitin-waf:
nodes:
- host: "172.22.222.5"
port: 8000
```
❶ `nodes`: List of Chaitin WAF service addresses. Update the `host` and `port` to match your Chaitin WAF (SafeLine) deployment.
* Gateway API
* APISIX CRD
Create a route with `chaitin-waf` to block malicious requests:
chaitin-waf-ic.yaml
```
apiVersion: v1
kind: Service
metadata:
namespace: aic
name: httpbin-external-domain
spec:
type: ExternalName
externalName: httpbin.org
---
apiVersion: apisix.apache.org/v1alpha1
kind: PluginConfig
metadata:
namespace: aic
name: chaitin-waf-plugin-config
spec:
plugins:
- name: chaitin-waf
config:
mode: block
append_waf_resp_header: true
append_waf_debug_header: true
---
apiVersion: gateway.networking.k8s.io/v1
kind: HTTPRoute
metadata:
namespace: aic
name: chaitin-waf-route
spec:
parentRefs:
- name: apisix
rules:
- matches:
- path:
type: Exact
value: /anything
filters:
- type: ExtensionRef
extensionRef:
group: apisix.apache.org
kind: PluginConfig
name: chaitin-waf-plugin-config
backendRefs:
- name: httpbin-external-domain
port: 80
```
Apply the configuration to your cluster:
```
kubectl apply -f gatewayproxy.yaml -f chaitin-waf-ic.yaml
```
Create a route with `chaitin-waf` to block malicious requests:
chaitin-waf-ic.yaml
```
apiVersion: apisix.apache.org/v2
kind: ApisixUpstream
metadata:
namespace: aic
name: httpbin-external-domain
spec:
ingressClassName: apisix
externalNodes:
- type: Domain
name: httpbin.org
---
apiVersion: apisix.apache.org/v2
kind: ApisixRoute
metadata:
namespace: aic
name: chaitin-waf-route
spec:
ingressClassName: apisix
http:
- name: chaitin-waf-route
match:
paths:
- /anything
upstreams:
- name: httpbin-external-domain
plugins:
- name: chaitin-waf
enable: true
config:
mode: block
append_waf_resp_header: true
append_waf_debug_header: true
```
Apply the configuration to your cluster:
```
kubectl apply -f gatewayproxy.yaml -f chaitin-waf-ic.yaml
```
❷ Set `mode` to `block` to block requests identified to be malicious.
❸ Set `append_waf_resp_header` to `true` to include WAF-related standard response headers.
❹ Set `append_waf_debug_header` to `true` to include WAF-related debugging response headers.
Send a standard request to the route:
```
curl -i "http://127.0.0.1:9080/anything"
```
You should receive an `HTTP/1.1 200 OK` response.
Send a request with SQL injection to the route:
```
curl -i "http://127.0.0.1:9080/anything" -d 'a=1 and 1=1'
```
You should see an `HTTP/1.1 403 Forbidden` response similar to the following:
```
...
X-APISIX-CHAITIN-WAF-STATUS: 403
X-APISIX-CHAITIN-WAF-ACTION: reject
X-APISIX-CHAITIN-WAF-SERVER: 172.22.222.5
X-APISIX-CHAITIN-WAF: yes
X-APISIX-CHAITIN-WAF-TIME: 3
...
{"code": 403, "success":false, "message": "blocked by Chaitin SafeLine Web Application Firewall", "event_id": "276be6457d8447a4bf1f792501dfba6c"}
```
### Monitor Requests for Malicious Intent[](#monitor-requests-for-malicious-intent "Direct link to Monitor Requests for Malicious Intent")
This example shows how to integrate with Chaitin WAF to monitor all routes with `chaitin-waf` without rejection, and to reject potentially malicious requests on a specific route.
* Admin API
* ADC
* Ingress Controller
Configure the Chaitin WAF connection details using [plugin metadata](https://docs.api7.ai/apisix/key-concepts/plugin-metadata.md) (update the address accordingly) and configure the mode:
```
curl "http://127.0.0.1:9180/apisix/admin/plugin_metadata/chaitin-waf" -X PUT \
-H 'X-API-KEY: ${ADMIN_API_KEY}' \
-d '{
"nodes": [
{
"host": "172.22.222.5",
"port": 8000
}
],
"mode": "monitor"
}'
```
❶ Set `mode` to `monitor` in the plugin metadata. This applies to all `chaitin-waf` plugin instances if `mode` is not specified on a route.
Create a route and enable `chaitin-waf` without any configuration on the route:
```
curl "http://127.0.0.1:9180/apisix/admin/routes" -X PUT \
-H "X-API-KEY: ${ADMIN_API_KEY}" \
-d '{
"id": "chaitin-waf-route",
"uri": "/anything",
"plugins": {
"chaitin-waf": {}
},
"upstream": {
"type": "roundrobin",
"nodes": {
"httpbin.org:80": 1
}
}
}'
```
adc.yaml
```
plugin_metadata:
chaitin-waf:
nodes:
- host: "172.22.222.5"
port: 8000
mode: monitor
services:
- name: chaitin-waf-service
routes:
- name: chaitin-waf-route
uris:
- /anything
plugins:
chaitin-waf: {}
upstream:
type: roundrobin
nodes:
- host: httpbin.org
port: 80
weight: 1
```
Synchronize the configuration to the gateway:
```
adc sync -f adc.yaml
```
❶ `nodes`: List of Chaitin WAF service addresses. Update the `host` and `port` to match your Chaitin WAF (SafeLine) deployment.
❷ Set `mode` to `monitor` in the plugin metadata. This applies to all `chaitin-waf` plugin instances if `mode` is not specified on a route.
Update your GatewayProxy manifest to configure the plugin metadata. If Chaitin WAF is installed on a host machine outside the cluster, use the host's IP address. In most deployments, expose Chaitin WAF as a reachable Service, IP address, or DNS name inside the cluster, or use the node/LoadBalancer address instead.
gatewayproxy.yaml
```
apiVersion: apisix.apache.org/v1alpha1
kind: GatewayProxy
metadata:
namespace: aic
name: apisix-config
spec:
provider:
type: ControlPlane
controlPlane:
# ...
# your control plane connection configuration
pluginMetadata:
chaitin-waf:
nodes:
- host: "172.22.222.5"
port: 8000
mode: monitor
```
❶ Set `mode` to `monitor` in the plugin metadata. This applies to all `chaitin-waf` plugin instances if `mode` is not specified on a route.
* Gateway API
* APISIX CRD
Create a route with `chaitin-waf` enabled without any plugin-level configuration, so it inherits the `monitor` mode from the plugin metadata:
chaitin-waf-ic.yaml
```
apiVersion: v1
kind: Service
metadata:
namespace: aic
name: httpbin-external-domain
spec:
type: ExternalName
externalName: httpbin.org
---
apiVersion: apisix.apache.org/v1alpha1
kind: PluginConfig
metadata:
namespace: aic
name: chaitin-waf-plugin-config
spec:
plugins:
- name: chaitin-waf
config: {}
---
apiVersion: gateway.networking.k8s.io/v1
kind: HTTPRoute
metadata:
namespace: aic
name: chaitin-waf-route
spec:
parentRefs:
- name: apisix
rules:
- matches:
- path:
type: Exact
value: /anything
filters:
- type: ExtensionRef
extensionRef:
group: apisix.apache.org
kind: PluginConfig
name: chaitin-waf-plugin-config
backendRefs:
- name: httpbin-external-domain
port: 80
```
Apply the configuration to your cluster:
```
kubectl apply -f gatewayproxy.yaml -f chaitin-waf-ic.yaml
```
To override the `monitor` mode and block malicious requests on the route, update the PluginConfig to set `mode: block`:
chaitin-waf-ic.yaml
```
# other configs
# ---
apiVersion: apisix.apache.org/v1alpha1
kind: PluginConfig
metadata:
namespace: aic
name: chaitin-waf-plugin-config
spec:
plugins:
- name: chaitin-waf
config:
mode: block
```
Apply the updated configuration to your cluster:
```
kubectl apply -f chaitin-waf-ic.yaml
```
Create a route with `chaitin-waf` enabled without any plugin-level configuration, so it inherits the `monitor` mode from the plugin metadata:
chaitin-waf-ic.yaml
```
apiVersion: apisix.apache.org/v2
kind: ApisixUpstream
metadata:
namespace: aic
name: httpbin-external-domain
spec:
ingressClassName: apisix
externalNodes:
- type: Domain
name: httpbin.org
---
apiVersion: apisix.apache.org/v2
kind: ApisixRoute
metadata:
namespace: aic
name: chaitin-waf-route
spec:
ingressClassName: apisix
http:
- name: chaitin-waf-route
match:
paths:
- /anything
upstreams:
- name: httpbin-external-domain
plugins:
- name: chaitin-waf
enable: true
config: {}
```
Apply the configuration to your cluster:
```
kubectl apply -f gatewayproxy.yaml -f chaitin-waf-ic.yaml
```
To override the `monitor` mode and block malicious requests on the route, update the ApisixRoute to set `mode: block`:
chaitin-waf-ic.yaml
```
# other configs
# ---
apiVersion: apisix.apache.org/v2
kind: ApisixRoute
metadata:
namespace: aic
name: chaitin-waf-route
spec:
ingressClassName: apisix
http:
- name: chaitin-waf-route
match:
paths:
- /anything
upstreams:
- name: httpbin-external-domain
plugins:
- name: chaitin-waf
enable: true
config:
mode: block
```
Apply the updated configuration to your cluster:
```
kubectl apply -f chaitin-waf-ic.yaml
```
Send a standard request to the route:
```
curl -i "http://127.0.0.1:9080/anything"
```
You should receive an `HTTP/1.1 200 OK` response.
Send a request with SQL injection to the route:
```
curl -i "http://127.0.0.1:9080/anything" -d 'a=1 and 1=1'
```
You should also receive an `HTTP/1.1 200 OK` response as the request is not blocked in the `monitor` mode, but observe the following in the log entry:
```
2025/09/09 11:44:08 [warn] 115#115: *31683 [lua] chaitin-waf.lua:385: do_access(): chaitin-waf monitor mode: request would have been rejected, event_id: 49bed20603e242f9be5ba6f1744bba4b, client: 172.20.0.1, server: _, request: "POST /anything HTTP/1.1", host: "127.0.0.1:9080"
```
If you explicitly configure the `mode` on a route, it will take precedence over the configuration in the plugin metadata. For instance, if you create a route like this:
* Admin API
* ADC
* Ingress Controller
```
curl "http://127.0.0.1:9180/apisix/admin/routes" -X PUT \
-H "X-API-KEY: ${ADMIN_API_KEY}" \
-d '{
"id": "chaitin-waf-route",
"uri": "/anything",
"plugins": {
"chaitin-waf": {
"mode": "block"
}
},
"upstream": {
"type": "roundrobin",
"nodes": {
"httpbin.org:80": 1
}
}
}'
```
adc.yaml
```
plugin_metadata:
chaitin-waf:
nodes:
- host: "172.22.222.5"
port: 8000
mode: monitor
services:
- name: chaitin-waf-service
routes:
- name: chaitin-waf-route
uris:
- /anything
plugins:
chaitin-waf:
mode: block
upstream:
type: roundrobin
nodes:
- host: httpbin.org
port: 80
weight: 1
```
Synchronize the configuration to the gateway:
```
adc sync -f adc.yaml
```
* Gateway API
* APISIX CRD
Update the PluginConfig to set `mode: block`:
chaitin-waf-ic.yaml
```
# other configs
# ---
apiVersion: apisix.apache.org/v1alpha1
kind: PluginConfig
metadata:
namespace: aic
name: chaitin-waf-plugin-config
spec:
plugins:
- name: chaitin-waf
config:
mode: block
```
Apply the updated configuration to your cluster:
```
kubectl apply -f chaitin-waf-ic.yaml
```
Update the ApisixRoute to set `mode: block`:
chaitin-waf-ic.yaml
```
# other configs
# ---
apiVersion: apisix.apache.org/v2
kind: ApisixRoute
metadata:
namespace: aic
name: chaitin-waf-route
spec:
ingressClassName: apisix
http:
- name: chaitin-waf-route
match:
paths:
- /anything
upstreams:
- name: httpbin-external-domain
plugins:
- name: chaitin-waf
enable: true
config:
mode: block
```
Apply the updated configuration to your cluster:
```
kubectl apply -f chaitin-waf-ic.yaml
```
Send a standard request to the route:
```
curl -i "http://127.0.0.1:9080/anything"
```
You should receive an `HTTP/1.1 200 OK` response.
Send a request with SQL injection to the route:
```
curl -i "http://127.0.0.1:9080/anything" -d 'a=1 and 1=1'
```
You should see an `HTTP/1.1 403 Forbidden` response similar to the following:
```
...
X-APISIX-CHAITIN-WAF-STATUS: 403
X-APISIX-CHAITIN-WAF-ACTION: reject
X-APISIX-CHAITIN-WAF: yes
X-APISIX-CHAITIN-WAF-TIME: 3
...
{"code": 403, "success":false, "message": "blocked by Chaitin SafeLine Web Application Firewall", "event_id": "c3eb25eaa7ae4c0d82eb8ceebf3600d0"}
```
---
## Parameters[](#parameters "Direct link to Parameters")
See plugin [common configurations](https://docs.api7.ai/apisix/reference/plugin-common-configurations.md) for configuration options available to all plugins.
* mode
string
default: `block`
vaild vaule:
`off`, `monitor`, or `block`
***
Mode to determine how the plugin behaves for matched requests.
In `off` mode, WAF checks are skipped. In `monitor` mode, requests with potential threats are logged but not blocked. In `block` mode, requests with threats are blocked as determined by the WAF service.
* match
array\[object]
***
An array of matching rules. The plugin uses these rules to decide whether to perform a WAF check on a request. If the list is empty, all requests are processed.
* vars
array\[array]
***
An array of one or more matching conditions in the form of [APISIX expressions](https://docs.api7.ai/apisix/reference/apisix-expressions.md) to conditionally execute the plugin.
* append\_waf\_resp\_header
boolean
default: `true`
***
If true, add response headers `X-APISIX-CHAITIN-WAF`, `X-APISIX-CHAITIN-WAF-TIME`, `X-APISIX-CHAITIN-WAF-ACTION`, and `X-APISIX-CHAITIN-WAF-STATUS`.
* append\_waf\_debug\_header
boolean
default: `false`
***
If true, add debugging headers `X-APISIX-CHAITIN-WAF-ERROR` and `X-APISIX-CHAITIN-WAF-SERVER` to the response. Effective only when `append_waf_resp_header` is `true`.
* config
object
***
Chaitin WAF service configurations. These settings override the corresponding metadata defaults when specified.
* connect\_timeout
integer
default: `1000`
***
The connection timeout to the WAF service, in milliseconds.
* send\_timeout
integer
default: `1000`
***
The sending timeout for transmitting data to the WAF service, in milliseconds.
* read\_timeout
integer
default: `1000`
***
The reading timeout for receiving data from the WAF service, in milliseconds.
* req\_body\_size
integer
default: `1024`
***
The maximum allowed request body size, in KB.
* keepalive\_size
integer
default: `256`
***
The maximum number of idle connections to the WAF detection service that can be maintained concurrently.
* keepalive\_timeout
integer
default: `60000`
***
The idle connection timeout for the WAF service, in milliseconds.
* real\_client\_ip
boolean
default: `true`
***
If true, use the client IP already resolved by the gateway, including any trusted-proxy or real-IP configuration. If false, use the direct peer address from the connection. The plugin does not read client-supplied forwarded headers directly.
* log\_resp
boolean
***
If true, report the response to the WAF detection service after it has been delivered to the client, in addition to the request. The report is advisory and never blocks or modifies the response. Available in API7 Enterprise from version 3.9.20.
* resp\_body\_size
integer
***
The maximum amount of the response body to report, in KB. Set to `0` to report only the response headers. Effective only when `log_resp` is true. Available in API7 Enterprise from version 3.9.20.
* extra\_ignored\_content\_types
string
***
A comma-separated list of additional response content types to skip, on top of the built-in ignored list. A response whose content type matches is not reported to the WAF detection service at all, headers included. Effective only when `log_resp` is true. Available in API7 Enterprise from version 3.9.20.
## Plugin Metadata[](#plugin-metadata "Direct link to Plugin Metadata")
* nodes
array\[object]
required
***
An array of addresses for the Chaitin WAF service.
* host
string
required
***
Address of Chaitin WAF service. Supports IPv4, IPv6, Unix Socket, etc.
* port
integer
default: `80`
***
Port of Chaitin WAF service.
* mode
string
default: `block`
***
Mode to determine how the plugin behaves for matched requests.
In `off` mode, WAF checks are skipped. In `monitor` mode, requests with potential threats are logged but not blocked. In `block` mode, requests with threats are blocked as determined by the WAF service.
* config
object
***
Chaitin WAF service configurations.
* connect\_timeout
integer
default: `1000`
***
The connection timeout to the WAF service, in milliseconds.
* send\_timeout
integer
default: `1000`
***
The sending timeout for transmitting data to the WAF service, in milliseconds.
* read\_timeout
integer
default: `1000`
***
The reading timeout for receiving data from the WAF service, in milliseconds.
* req\_body\_size
integer
default: `1024`
***
The maximum allowed request body size, in KB.
* keepalive\_size
integer
default: `256`
***
The maximum number of idle connections to the WAF detection service that can be maintained concurrently.
* keepalive\_timeout
integer
default: `60000`
***
The idle connection timeout for the WAF service, in milliseconds.
* real\_client\_ip
boolean
default: `true`
***
If true, use the client IP already resolved by the gateway, including any trusted-proxy or real-IP configuration. If false, use the direct peer address from the connection. The plugin does not read client-supplied forwarded headers directly.
* log\_resp
boolean
default: `false`
***
If true, report the response to the WAF detection service after it has been delivered to the client, in addition to the request. The report is advisory and never blocks or modifies the response. Available in API7 Enterprise from version 3.9.20.
* resp\_body\_size
integer
default: `4`
***
The maximum amount of the response body to report, in KB. Set to `0` to report only the response headers. Effective only when `log_resp` is true. Available in API7 Enterprise from version 3.9.20.
* extra\_ignored\_content\_types
string
***
A comma-separated list of additional response content types to skip, on top of the built-in ignored list. A response whose content type matches is not reported to the WAF detection service at all, headers included. Effective only when `log_resp` is true. Available in API7 Enterprise from version 3.9.20.
---
# clickhouse-logger
The `clickhouse-logger` plugin pushes request and response logs to ClickHouse database in batches and supports the customization of log formats.
## Examples[](#examples "Direct link to Examples")
The examples below demonstrate how you can configure `clickhouse-logger` plugin for different scenarios.
To follow along the examples, start a sample ClickHouse server with user `default` and empty password:
* Docker
* Kubernetes
```
docker run -d -p 8123:8123 -p 9000:9000 -p 9009:9009 --name clickhouse-server clickhouse/clickhouse-server
```
Create a Kubernetes manifest file for the ClickHouse deployment:
clickhouse-deployment.yaml
```
apiVersion: apps/v1
kind: Deployment
metadata:
namespace: aic
name: clickhouse-server
spec:
replicas: 1
selector:
matchLabels:
app: clickhouse-server
template:
metadata:
labels:
app: clickhouse-server
spec:
containers:
- name: clickhouse-server
image: clickhouse/clickhouse-server
ports:
- containerPort: 8123
- containerPort: 9000
- containerPort: 9009
```
Create a Kubernetes manifest file for the ClickHouse service:
clickhouse-service.yaml
```
apiVersion: v1
kind: Service
metadata:
namespace: aic
name: clickhouse-server
spec:
selector:
app: clickhouse-server
ports:
- name: http
port: 8123
targetPort: 8123
- name: native
port: 9000
targetPort: 9000
type: ClusterIP
```
Apply the manifests:
```
kubectl apply -f clickhouse-deployment.yaml -f clickhouse-service.yaml
```
### Log in the Default Log Formats[](#log-in-the-default-log-formats "Direct link to Log in the Default Log Formats")
The following example demonstrates how you can log in the default request body.
Create a table named `default_logs` in your ClickHouse database with columns corresponding to your log format:
* Docker
* Kubernetes
```
curl "http://127.0.0.1:8123" -X POST -d '
CREATE TABLE default.default_logs (
host String,
client_ip String,
route_id String,
service_id String,
start_time String,
latency String,
upstream_latency String,
apisix_latency String,
consumer String,
request String,
response String,
server String,
PRIMARY KEY(`start_time`)
)
ENGINE = MergeTree()
' --user default:
```
```
kubectl exec -n aic deploy/clickhouse-server -- clickhouse-client --query "
CREATE TABLE default.default_logs (
host String,
client_ip String,
route_id String,
service_id String,
start_time String,
latency String,
upstream_latency String,
apisix_latency String,
consumer String,
request String,
response String,
server String,
PRIMARY KEY(start_time)
)
ENGINE = MergeTree()
"
```
Create a route with `clickhouse-logger` as follows:
* Admin API
* ADC
* Ingress Controller
```
curl "http://127.0.0.1:9180/apisix/admin/routes" -X PUT \
-H "X-API-KEY: ${ADMIN_API_KEY}" \
-d '{
"id": "clickhouse-logger-route",
"uri": "/get",
"plugins": {
"clickhouse-logger": {
"user": "default",
"password": "",
"database": "default",
"logtable": "default_logs",
"endpoint_addrs": ["http://127.0.0.1:8123"]
}
},
"upstream": {
"type": "roundrobin",
"nodes": {
"httpbin.org": 1
}
}
}'
```
adc.yaml
```
services:
- name: httpbin
routes:
- uris:
- /get
name: clickhouse-logger-route
plugins:
clickhouse-logger:
user: default
password: ""
database: default
logtable: default_logs
endpoint_addrs:
- "http://127.0.0.1:8123"
upstream:
type: roundrobin
nodes:
- host: httpbin.org
port: 80
weight: 1
```
Synchronize the configuration to the gateway:
```
adc sync -f adc.yaml
```
* Gateway API
* APISIX CRD
clickhouse-logger-ic.yaml
```
apiVersion: v1
kind: Service
metadata:
namespace: aic
name: httpbin-external-domain
spec:
type: ExternalName
externalName: httpbin.org
---
apiVersion: apisix.apache.org/v1alpha1
kind: PluginConfig
metadata:
namespace: aic
name: clickhouse-logger-plugin-config
spec:
plugins:
- name: clickhouse-logger
config:
user: default
password: ""
database: default
logtable: default_logs
endpoint_addrs:
- "http://clickhouse-server.aic.svc:8123"
---
apiVersion: gateway.networking.k8s.io/v1
kind: HTTPRoute
metadata:
namespace: aic
name: clickhouse-logger-route
spec:
parentRefs:
- name: apisix
rules:
- matches:
- path:
type: Exact
value: /get
filters:
- type: ExtensionRef
extensionRef:
group: apisix.apache.org
kind: PluginConfig
name: clickhouse-logger-plugin-config
backendRefs:
- name: httpbin-external-domain
port: 80
```
clickhouse-logger-ic.yaml
```
apiVersion: apisix.apache.org/v2
kind: ApisixUpstream
metadata:
namespace: aic
name: httpbin-external-domain
spec:
ingressClassName: apisix
externalNodes:
- type: Domain
name: httpbin.org
---
apiVersion: apisix.apache.org/v2
kind: ApisixRoute
metadata:
namespace: aic
name: clickhouse-logger-route
spec:
ingressClassName: apisix
http:
- name: clickhouse-logger-route
match:
paths:
- /get
methods:
- GET
upstreams:
- name: httpbin-external-domain
plugins:
- name: clickhouse-logger
config:
user: default
password: ""
database: default
logtable: default_logs
endpoint_addrs:
- "http://clickhouse-server.aic.svc:8123"
```
Apply the configuration:
```
kubectl apply -f clickhouse-logger-ic.yaml
```
Send a request to the route to generate a log entry:
```
curl -i "http://127.0.0.1:9080/get"
```
You should see an `HTTP/1.1 200 OK` response.
Send a request to ClickHouse to see the log entries:
```
echo 'SELECT * FROM default.default_logs FORMAT Pretty' | curl "http://127.0.0.1:8123/?" -d @-
```
You should see a log entry similar to the following:
```
┏━━━━━━┳━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━┳━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━┳━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓
┃ host ┃ client_ip ┃ route_id ┃ service_id ┃ start_time ┃ latency ┃ upstream_latency ┃ apisix_latency ┃ consumer ┃ request ┃ response ┃ server ┃
┡━━━━━━╇━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━╇━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━╇━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┩
│ │ 172.19.0.1 │ clickhouse-logger-route │ │ 1703026935235 │ 481.00018501282 │ 473 │ 8.0001850128174 │ │ {"method":"GET","uri":"/get","headers":{"host":"127.0.0.1:9080","user-agent":"curl/7.29.0","accept":"*/*"},"url":"http://127.0.0.1:9080/get","querystring":{},"size":81} │ {"headers":{"access-control-allow-credentials":"true","access-control-allow-origin":"*","content-type":"application/json","content-length":"299","date":"Tue,19 Dec 2023 23:02:15 GMT","connection":"close","server":"APISIX/3.8.0"},"status":200,"size":526} │ {"hostname":"85cf6f06914e","version":"3.8.0"} │
└──────┴────────────┴─────────────────────────┴────────────┴───────────────┴─────────────────┴──────────────────┴─────────────────┴──────────┴──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┴───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┴───────────────────────────────────────────────┘
```
### Customize Log Format With Plugin Metadata[](#customize-log-format-with-plugin-metadata "Direct link to Customize Log Format With Plugin Metadata")
The following example demonstrates how you can customize log format using [plugin metadata](https://docs.api7.ai/apisix/key-concepts/plugin-metadata.md).
Create a table named `custom_logs` in your ClickHouse database with columns corresponding to your customized log format:
* Docker
* Kubernetes
```
curl "http://127.0.0.1:8123" -X POST -d '
CREATE TABLE default.custom_logs (
host String,
client_ip String,
route_id String,
service_id String,
`@timestamp` String,
PRIMARY KEY(`@timestamp`)
)
ENGINE = MergeTree()
' --user default:
```
```
kubectl exec -n aic deploy/clickhouse-server -- clickhouse-client --query "
CREATE TABLE default.custom_logs (
host String,
client_ip String,
route_id String,
service_id String,
\`@timestamp\` String,
PRIMARY KEY(\`@timestamp\`)
)
ENGINE = MergeTree()
"
```
Create a route with the `clickhouse-logger` plugin that is used to forward logs in the specified format to ClickHouse:
* Admin API
* ADC
* Ingress Controller
```
curl "http://127.0.0.1:9180/apisix/admin/routes" -X PUT \
-H "X-API-KEY: ${ADMIN_API_KEY}" \
-d '{
"id": "clickhouse-logger-route",
"uri": "/get",
"plugins": {
"clickhouse-logger": {
"user": "default",
"password": "",
"database": "default",
"logtable": "custom_logs",
"endpoint_addrs": ["http://127.0.0.1:8123"]
}
},
"upstream": {
"type": "roundrobin",
"nodes": {
"httpbin.org": 1
}
}
}'
```
adc.yaml
```
services:
- name: httpbin
routes:
- uris:
- /get
name: clickhouse-logger-route
plugins:
clickhouse-logger:
user: default
password: ""
database: default
logtable: custom_logs
endpoint_addrs:
- "http://127.0.0.1:8123"
upstream:
type: roundrobin
nodes:
- host: httpbin.org
port: 80
weight: 1
```
Synchronize the configuration to the gateway:
```
adc sync -f adc.yaml
```
* Gateway API
* APISIX CRD
clickhouse-logger-ic.yaml
```
apiVersion: v1
kind: Service
metadata:
namespace: aic
name: httpbin-external-domain
spec:
type: ExternalName
externalName: httpbin.org
---
apiVersion: apisix.apache.org/v1alpha1
kind: PluginConfig
metadata:
namespace: aic
name: clickhouse-logger-plugin-config
spec:
plugins:
- name: clickhouse-logger
config:
user: default
password: ""
database: default
logtable: custom_logs
endpoint_addrs:
- "http://clickhouse-server.aic.svc:8123"
---
apiVersion: gateway.networking.k8s.io/v1
kind: HTTPRoute
metadata:
namespace: aic
name: clickhouse-logger-route
spec:
parentRefs:
- name: apisix
rules:
- matches:
- path:
type: Exact
value: /get
filters:
- type: ExtensionRef
extensionRef:
group: apisix.apache.org
kind: PluginConfig
name: clickhouse-logger-plugin-config
backendRefs:
- name: httpbin-external-domain
port: 80
```
clickhouse-logger-ic.yaml
```
apiVersion: apisix.apache.org/v2
kind: ApisixUpstream
metadata:
namespace: aic
name: httpbin-external-domain
spec:
ingressClassName: apisix
externalNodes:
- type: Domain
name: httpbin.org
---
apiVersion: apisix.apache.org/v2
kind: ApisixRoute
metadata:
namespace: aic
name: clickhouse-logger-route
spec:
ingressClassName: apisix
http:
- name: clickhouse-logger-route
match:
paths:
- /get
methods:
- GET
upstreams:
- name: httpbin-external-domain
plugins:
- name: clickhouse-logger
config:
user: default
password: ""
database: default
logtable: custom_logs
endpoint_addrs:
- "http://clickhouse-server.aic.svc:8123"
```
Apply the configuration:
```
kubectl apply -f clickhouse-logger-ic.yaml
```
Configure plugin metadata for `clickhouse-logger`:
* Admin API
* ADC
* Ingress Controller
```
curl "http://127.0.0.1:9180/apisix/admin/plugin_metadata/clickhouse-logger" -X PUT \
-H 'X-API-KEY: ${ADMIN_API_KEY}' \
-d '{
"log_format": {
"host": "$host",
"client_ip": "$remote_addr",
"route_id": "$route_id",
"service_id": "$service_id",
"@timestamp": "$time_iso8601"
}
}'
```
adc.yaml
```
plugin_metadata:
- name: clickhouse-logger
log_format:
host: "$host"
client_ip: "$remote_addr"
route_id: "$route_id"
service_id: "$service_id"
"@timestamp": "$time_iso8601"
```
Synchronize the configuration to the gateway:
```
adc sync -f adc.yaml
```
clickhouse-logger-metadata.yaml
```
apiVersion: apisix.apache.org/v1alpha1
kind: GatewayProxy
metadata:
namespace: aic
name: apisix-config
spec:
provider:
type: ControlPlane
controlPlane:
service:
name: apisix-admin
port: 9180
auth:
type: AdminKey
adminKey:
value: edd1c9f034335f136f87ad84b625c8f1
pluginMetadata:
clickhouse-logger:
log_format:
host: "$host"
client_ip: "$remote_addr"
route_id: "$route_id"
service_id: "$service_id"
"@timestamp": "$time_iso8601"
```
Apply the configuration:
```
kubectl apply -f clickhouse-logger-metadata.yaml
```
Send a request to the route to generate a log entry:
```
curl -i "http://127.0.0.1:9080/get"
```
You should see an `HTTP/1.1 200 OK` response.
Send a request to ClickHouse to see the log entries:
```
echo 'SELECT * FROM default.custom_logs FORMAT Pretty' | curl "http://127.0.0.1:8123/?" -d @-
```
You should see a log entry similar to the following:
```
┏━━━━━━━━━━━┳━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━━┓
┃ host ┃ client_ip ┃ route_id ┃ service_id ┃ @timestamp ┃
┡━━━━━━━━━━━╇━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━━━┩
│ 127.0.0.1 │ 172.19.0.1 │ clickhouse-logger-route │ │ 2023-12-19T23:25:43+00:00 │
└───────────┴────────────┴─────────────────────────┴────────────┴───────────────────────────┘
```
---
## Parameters[](#parameters "Direct link to Parameters")
See plugin [common configurations](https://docs.api7.ai/apisix/reference/plugin-common-configurations.md) for configuration options available to all plugins.
* endpoint\_addr
string
***
Deprecated. Use `endpoint_addrs` instead. ClickHouse endpoint. Configure either `endpoint_addr` or `endpoint_addrs`.
* endpoint\_addrs
array
***
ClickHouse endpoints. Configure either `endpoint_addrs` or the deprecated `endpoint_addr`.
* database
string
required
***
Name of the database to store the logs.
* logtable
string
required
***
Name of the table that stores the logs.
* user
string
required
***
ClickHouse username.
From APISIX 3.16.0, supports referencing values from environment variables using the `$ENV://` prefix or from a secret manager using the `$secret://` prefix. For more information, see [secrets](https://docs.api7.ai/apisix/key-concepts/secrets.md).
* password
string
required
***
ClickHouse password.
The value is encrypted with AES before being stored in etcd.
From APISIX 3.16.0, supports referencing values from environment variables using the `$ENV://` prefix or from a secret manager using the `$secret://` prefix. For more information, see [secrets](https://docs.api7.ai/apisix/key-concepts/secrets.md).
* timeout
integer
default: `3`
vaild vaule:
greater than 0
***
Time to keep the connection alive for after sending a request.
* ssl\_verify
boolean
default: `true`
***
If true, verify SSL.
* log\_format
object
***
Custom log format using key-value pairs in JSON format. Values can reference [built-in variables](https://docs.api7.ai/apisix/reference/built-in-variables.md).
In APISIX from 3.15.0, log format nested structures are supported up to five levels deep. In API7 Enterprise, only flat key-value structures are supported; nested structures are not yet supported.
You can also configure log format on a global scale using the [plugin metadata](https://docs.api7.ai/apisix/key-concepts/plugin-metadata.md), which configures the log format for all `clickhouse-logger` plugin instances. If the log format configured on the individual plugin instance differs from the log format configured on plugin metadata, the log format configured on the individual plugin instance takes precedence. See the [example](https://docs.api7.ai/hub/clickhouse-logger.md#customize-log-format-with-plugin-metadata) for more details.
* log\_format\_extra
object
***
Additional fields to add to the default log entry, using key-value pairs in JSON format. Values can reference [built-in variables](https://docs.api7.ai/apisix/reference/built-in-variables.md). A configured field does not overwrite an existing default field. A plugin instance takes precedence over plugin metadata; setting an empty object on the instance disables the metadata value. When `log_format` is configured, `log_format_extra` is ignored. Introduced in API7 Enterprise 3.9.15 and 3.10.2, and APISIX 3.18.0.
* include\_req\_body
boolean
default: `false`
***
If true, include the request body in the log. Note that if the request body is too big to be kept in the memory, it can not be logged due to NGINX's limitations.
* include\_req\_body\_expr
array\[array]
***
An array of one or more conditions in the form of [APISIX expressions](https://docs.api7.ai/apisix/reference/apisix-expressions.md). Used when the `include_req_body` is true. Request body would only be logged when the expressions configured here evaluate to true.
* include\_resp\_body
boolean
default: `false`
***
If true, include the response body in the log.
* include\_resp\_body\_expr
array\[array]
***
An array of one or more conditions in the form of [APISIX expressions](https://docs.api7.ai/apisix/reference/apisix-expressions.md). Used when the `include_resp_body` is true. Response body would only be logged when the expressions configured here evaluate to true.
* max\_req\_body\_bytes
integer
default: `524288`
vaild vaule:
greater than or equal to 1
***
Maximum request body size in bytes to include in the log. If the request body exceeds this value, it will be truncated. Available in APISIX from 3.16.0.
* max\_resp\_body\_bytes
integer
default: `524288`
vaild vaule:
greater than or equal to 1
***
Maximum response body size in bytes to include in the log. If the response body exceeds this value, it will be truncated. Available in APISIX from 3.16.0.
* name
string
default: `clickhouse-logger`
***
Unique identifier of the plugin for the batch processor. If you use [Prometheus](https://docs.api7.ai/hub/prometheus.md) to monitor APISIX metrics, the name is exported in `apisix_batch_process_entries`.
* batch\_max\_size
integer
default: `1000`
vaild vaule:
greater than 0
***
The number of log entries allowed in one batch. Once reached, the batch will be sent to the logging service. Setting this parameter to 1 means immediate processing.
* inactive\_timeout
integer
default: `5`
vaild vaule:
greater than 0
***
The maximum time in seconds to wait for new logs before sending the batch to the logging service. The value should be smaller than `buffer_duration`.
* buffer\_duration
integer
default: `60`
vaild vaule:
greater than 0
***
The maximum time in seconds from the earliest entry allowed before sending the batch to the logging service.
* retry\_delay
integer
default: `1`
vaild vaule:
greater than or equal to 0
***
The time interval in seconds to retry sending the batch to the logging service if the batch was not successfully sent.
* max\_retry\_count
integer
default: `0`
vaild vaule:
greater than or equal to 0
***
The maximum number of unsuccessful retries allowed before dropping the log entries.
## Plugin Metadata[](#plugin-metadata "Direct link to Plugin Metadata")
* log\_format
object
***
Custom log format using key-value pairs in JSON format. Values can reference [built-in variables](https://docs.api7.ai/apisix/reference/built-in-variables.md).
In APISIX from 3.15.0, log format nested structures are supported up to five levels deep. In API7 Enterprise, only flat key-value structures are supported; nested structures are not yet supported.
* log\_format\_extra
object
***
Additional fields to add to the default log entry, using key-value pairs in JSON format. Values can reference [built-in variables](https://docs.api7.ai/apisix/reference/built-in-variables.md). A configured field does not overwrite an existing default field. A plugin instance takes precedence over plugin metadata; setting an empty object on the instance disables the metadata value. When `log_format` is configured, `log_format_extra` is ignored. Introduced in API7 Enterprise 3.9.15 and 3.10.2, and APISIX 3.18.0.
* max\_pending\_entries
integer
default: `` `8192` in APISIX 3.18.0 and in API7 Enterprise 3.9.19 and 3.10.6; none in API7 Enterprise 3.9.18 and 3.10.5 ``
vaild vaule:
greater than or equal to 1
***
Maximum number of entries waiting in the batch processor. New entries are discarded when the backlog reaches the limit.
Introduced in API7 Enterprise 3.8.17 and APISIX 3.15.0.
The default changed to `8192` in APISIX 3.18.0 and in API7 Enterprise 3.9.19 on the 3.9 line and 3.10.6 on the 3.10 line. In API7 Enterprise 3.9.18 and 3.10.5, and in earlier APISIX versions, omitting the parameter leaves the backlog unlimited.
See [Batch Processor](https://docs.api7.ai/apisix/reference/batch-processor.md#configure-the-pending-entry-limit) for sizing and verification guidance.
---
# consumer-restriction
The `consumer-restriction` plugin enables access controls based on consumer name, route ID, service ID, or consumer group ID.
The plugin needs to work with authentication plugins, such as [`key-auth`](https://docs.api7.ai/hub/key-auth.md) and [`jwt-auth`](https://docs.api7.ai/hub/jwt-auth.md), which means you should always create at least one [consumer](https://docs.api7.ai/apisix/key-concepts/consumers.md) in your use case. See examples below for more details.
## Examples[](#examples "Direct link to Examples")
The examples below demonstrate how you can configure `consumer-restriction` plugin for different scenarios.
While the examples use [`key-auth`](https://docs.api7.ai/hub/key-auth.md) as the authentication method, you can easily adjust to other authentication plugins based on your needs.
### Restrict Access by Consumers[](#restrict-access-by-consumers "Direct link to Restrict Access by Consumers")
The example below demonstrates how you can use the `consumer-restriction` plugin on a route to restrict consumer access by consumer names, where consumers are authenticated with [`key-auth`](https://docs.api7.ai/hub/key-auth.md).
* Admin API
* ADC
* Ingress Controller
Create a consumer `JohnDoe`:
```
curl "http://127.0.0.1:9180/apisix/admin/consumers" -X PUT \
-H "X-API-KEY: ${ADMIN_API_KEY}" \
-d '{
"username": "JohnDoe"
}'
```
Create `key-auth` credential for the consumer:
```
curl "http://127.0.0.1:9180/apisix/admin/consumers/JohnDoe/credentials" -X PUT \
-H "X-API-KEY: ${ADMIN_API_KEY}" \
-d '{
"id": "cred-john-key-auth",
"plugins": {
"key-auth": {
"key": "john-key"
}
}
}'
```
Create a second consumer `JaneDoe`:
```
curl "http://127.0.0.1:9180/apisix/admin/consumers" -X PUT \
-H "X-API-KEY: ${ADMIN_API_KEY}" \
-d '{
"username": "JaneDoe"
}'
```
Create `key-auth` credential for the consumer:
```
curl "http://127.0.0.1:9180/apisix/admin/consumers/JaneDoe/credentials" -X PUT \
-H "X-API-KEY: ${ADMIN_API_KEY}" \
-d '{
"id": "cred-jane-key-auth",
"plugins": {
"key-auth": {
"key": "jane-key"
}
}
}'
```
Next, create a route with key authentication enabled, and configure `consumer-restriction` to allow only consumer `JaneDoe`:
```
curl "http://127.0.0.1:9180/apisix/admin/routes" -X PUT \
-H "X-API-KEY: ${ADMIN_API_KEY}" \
-d '{
"id": "consumer-restricted-route",
"uri": "/get",
"plugins": {
"key-auth": {},
"consumer-restriction": {
"whitelist": ["JaneDoe"]
}
},
"upstream" : {
"nodes": {
"httpbin.org":1
}
}
}'
```
adc.yaml
```
consumers:
- username: JohnDoe
credentials:
- name: cred-john-key-auth
type: key-auth
config:
key: john-key
- username: JaneDoe
credentials:
- name: cred-jane-key-auth
type: key-auth
config:
key: jane-key
services:
- name: consumer-restriction-service
routes:
- name: consumer-restricted-route
uris:
- /get
plugins:
key-auth: {}
consumer-restriction:
whitelist:
- "JaneDoe"
upstream:
type: roundrobin
nodes:
- host: httpbin.org
port: 80
weight: 1
```
Synchronize the configuration to the gateway:
```
adc sync -f adc.yaml
```
Consumer Name Format in Ingress Controller
When consumers are configured using the Ingress Controller, the consumer name is generated in the format `namespace_consumername`. For example, a consumer named `janedoe` in the `aic` namespace becomes `aic_janedoe`. Use this format in the `whitelist` or `blacklist` of `consumer-restriction`.
* Gateway API
* APISIX CRD
consumer-restriction-ic.yaml
```
apiVersion: apisix.apache.org/v1alpha1
kind: Consumer
metadata:
namespace: aic
name: johndoe
spec:
gatewayRef:
name: apisix
credentials:
- type: key-auth
name: john-key-auth
config:
key: john-key
---
apiVersion: apisix.apache.org/v1alpha1
kind: Consumer
metadata:
namespace: aic
name: janedoe
spec:
gatewayRef:
name: apisix
credentials:
- type: key-auth
name: jane-key-auth
config:
key: jane-key
---
apiVersion: v1
kind: Service
metadata:
namespace: aic
name: httpbin-external-domain
spec:
type: ExternalName
externalName: httpbin.org
---
apiVersion: apisix.apache.org/v1alpha1
kind: PluginConfig
metadata:
namespace: aic
name: consumer-restriction-plugin-config
spec:
plugins:
- name: key-auth
config:
_meta:
disable: false
- name: consumer-restriction
config:
whitelist:
- "aic_janedoe"
---
apiVersion: gateway.networking.k8s.io/v1
kind: HTTPRoute
metadata:
namespace: aic
name: consumer-restriction-route
spec:
parentRefs:
- name: apisix
rules:
- matches:
- path:
type: Exact
value: /get
filters:
- type: ExtensionRef
extensionRef:
group: apisix.apache.org
kind: PluginConfig
name: consumer-restriction-plugin-config
backendRefs:
- name: httpbin-external-domain
port: 80
```
consumer-restriction-ic.yaml
```
apiVersion: apisix.apache.org/v2
kind: ApisixConsumer
metadata:
namespace: aic
name: johndoe
spec:
ingressClassName: apisix
authParameter:
keyAuth:
value:
key: john-key
---
apiVersion: apisix.apache.org/v2
kind: ApisixConsumer
metadata:
namespace: aic
name: janedoe
spec:
ingressClassName: apisix
authParameter:
keyAuth:
value:
key: jane-key
---
apiVersion: apisix.apache.org/v2
kind: ApisixUpstream
metadata:
namespace: aic
name: httpbin-external-domain
spec:
ingressClassName: apisix
externalNodes:
- type: Domain
name: httpbin.org
---
apiVersion: apisix.apache.org/v2
kind: ApisixRoute
metadata:
namespace: aic
name: consumer-restriction-route
spec:
ingressClassName: apisix
http:
- name: consumer-restriction-route
match:
paths:
- /get
upstreams:
- name: httpbin-external-domain
plugins:
- name: key-auth
enable: true
- name: consumer-restriction
enable: true
config:
whitelist:
- "aic_janedoe"
```
Apply the configuration to your cluster:
```
kubectl apply -f consumer-restriction-ic.yaml
```
Send a request to the route as consumer `JohnDoe`:
```
curl -i "http://127.0.0.1:9080/get" -H 'apikey: john-key'
```
You should receive an `HTTP/1.1 403 Forbidden` response with the following message:
```
{"message":"The consumer_name is forbidden."}
```
Send another request to the route as consumer `JaneDoe`:
```
curl -i "http://127.0.0.1:9080/get" -H 'apikey: jane-key'
```
You should receive an `HTTP/1.1 200 OK` response, showing the consumer access is permitted.
### Restrict Access by Consumers and HTTP Methods[](#restrict-access-by-consumers-and-http-methods "Direct link to Restrict Access by Consumers and HTTP Methods")
The example below demonstrates how you can use the `consumer-restriction` plugin on a route to restrict consumer access by consumer name and HTTP methods, where consumers are authenticated with [`key-auth`](https://docs.api7.ai/hub/key-auth.md).
* Admin API
* ADC
* Ingress Controller
Create a consumer `JohnDoe`:
```
curl "http://127.0.0.1:9180/apisix/admin/consumers" -X PUT \
-H "X-API-KEY: ${ADMIN_API_KEY}" \
-d '{
"username": "JohnDoe"
}'
```
Create `key-auth` credential for the consumer:
```
curl "http://127.0.0.1:9180/apisix/admin/consumers/JohnDoe/credentials" -X PUT \
-H "X-API-KEY: ${ADMIN_API_KEY}" \
-d '{
"id": "cred-john-key-auth",
"plugins": {
"key-auth": {
"key": "john-key"
}
}
}'
```
Create a second consumer `JaneDoe`:
```
curl "http://127.0.0.1:9180/apisix/admin/consumers" -X PUT \
-H "X-API-KEY: ${ADMIN_API_KEY}" \
-d '{
"username": "JaneDoe"
}'
```
Create `key-auth` credential for the consumer:
```
curl "http://127.0.0.1:9180/apisix/admin/consumers/JaneDoe/credentials" -X PUT \
-H "X-API-KEY: ${ADMIN_API_KEY}" \
-d '{
"id": "cred-jane-key-auth",
"plugins": {
"key-auth": {
"key": "jane-key"
}
}
}'
```
Next, create a route with key authentication enabled, and use `consumer-restriction` to allow only the configured HTTP methods by consumers:
```
curl "http://127.0.0.1:9180/apisix/admin/routes" -X PUT \
-H "X-API-KEY: ${ADMIN_API_KEY}" \
-d '{
"id": "consumer-restricted-route",
"uri": "/anything",
"plugins": {
"key-auth": {},
"consumer-restriction": {
"allowed_by_methods":[
{
"user": "JohnDoe",
"methods": ["GET"]
},
{
"user": "JaneDoe",
"methods": ["POST"]
}
]
}
},
"upstream" : {
"nodes": {
"httpbin.org":1
}
}
}'
```
adc.yaml
```
consumers:
- username: JohnDoe
credentials:
- name: cred-john-key-auth
type: key-auth
config:
key: john-key
- username: JaneDoe
credentials:
- name: cred-jane-key-auth
type: key-auth
config:
key: jane-key
services:
- name: consumer-restriction-service
routes:
- name: consumer-restricted-route
uris:
- /anything
plugins:
key-auth: {}
consumer-restriction:
allowed_by_methods:
- user: "JohnDoe"
methods:
- "GET"
- user: "JaneDoe"
methods:
- "POST"
upstream:
type: roundrobin
nodes:
- host: httpbin.org
port: 80
weight: 1
```
Synchronize the configuration to the gateway:
```
adc sync -f adc.yaml
```
* Gateway API
* APISIX CRD
consumer-restriction-ic.yaml
```
apiVersion: apisix.apache.org/v1alpha1
kind: Consumer
metadata:
namespace: aic
name: johndoe
spec:
gatewayRef:
name: apisix
credentials:
- type: key-auth
name: john-key-auth
config:
key: john-key
---
apiVersion: apisix.apache.org/v1alpha1
kind: Consumer
metadata:
namespace: aic
name: janedoe
spec:
gatewayRef:
name: apisix
credentials:
- type: key-auth
name: jane-key-auth
config:
key: jane-key
---
apiVersion: v1
kind: Service
metadata:
namespace: aic
name: httpbin-external-domain
spec:
type: ExternalName
externalName: httpbin.org
---
apiVersion: apisix.apache.org/v1alpha1
kind: PluginConfig
metadata:
namespace: aic
name: consumer-restriction-methods-config
spec:
plugins:
- name: key-auth
config:
_meta:
disable: false
- name: consumer-restriction
config:
allowed_by_methods:
- user: "aic_johndoe"
methods:
- "GET"
- user: "aic_janedoe"
methods:
- "POST"
---
apiVersion: gateway.networking.k8s.io/v1
kind: HTTPRoute
metadata:
namespace: aic
name: consumer-restriction-route
spec:
parentRefs:
- name: apisix
rules:
- matches:
- path:
type: Exact
value: /anything
filters:
- type: ExtensionRef
extensionRef:
group: apisix.apache.org
kind: PluginConfig
name: consumer-restriction-methods-config
backendRefs:
- name: httpbin-external-domain
port: 80
```
Apply the configuration to your cluster:
```
kubectl apply -f consumer-restriction-ic.yaml
```
consumer-restriction-ic.yaml
```
apiVersion: apisix.apache.org/v2
kind: ApisixConsumer
metadata:
namespace: aic
name: johndoe
spec:
ingressClassName: apisix
authParameter:
keyAuth:
value:
key: john-key
---
apiVersion: apisix.apache.org/v2
kind: ApisixConsumer
metadata:
namespace: aic
name: janedoe
spec:
ingressClassName: apisix
authParameter:
keyAuth:
value:
key: jane-key
---
apiVersion: apisix.apache.org/v2
kind: ApisixUpstream
metadata:
namespace: aic
name: httpbin-external-domain
spec:
ingressClassName: apisix
externalNodes:
- type: Domain
name: httpbin.org
---
apiVersion: apisix.apache.org/v2
kind: ApisixRoute
metadata:
namespace: aic
name: consumer-restriction-route
spec:
ingressClassName: apisix
http:
- name: consumer-restriction-route
match:
paths:
- /anything
upstreams:
- name: httpbin-external-domain
plugins:
- name: key-auth
enable: true
- name: consumer-restriction
enable: true
config:
allowed_by_methods:
- user: "aic_johndoe"
methods:
- "GET"
- user: "aic_janedoe"
methods:
- "POST"
```
Apply the configuration to your cluster:
```
kubectl apply -f consumer-restriction-ic.yaml
```
Send a POST request to the route as consumer `JohnDoe`:
```
curl -i "http://127.0.0.1:9080/anything" -X POST -H 'apikey: john-key'
```
You should receive an `HTTP/1.1 403 Forbidden` response with the following message:
```
{"message":"The consumer_name is forbidden."}
```
Now, send a GET request to the route as consumer `JohnDoe`:
```
curl -i "http://127.0.0.1:9080/anything" -X GET -H 'apikey: john-key'
```
You should receive an `HTTP/1.1 200 OK` response, showing the consumer access is permitted.
You can also verify the configurations by sending requests as consumer `JaneDoe` and observe the behaviours match up to what was configured in the `consumer-restriction` plugin on the route.
### Restricting by Service ID[](#restricting-by-service-id "Direct link to Restricting by Service ID")
The example below demonstrates how you can use the `consumer-restriction` plugin to restrict consumer access by service ID, where the consumer is authenticated with [`key-auth`](https://docs.api7.ai/hub/key-auth.md).
* Admin API
* ADC
* Ingress Controller
Create two sample services:
```
curl "http://127.0.0.1:9180/apisix/admin/services" -X PUT \
-H "X-API-KEY: ${ADMIN_API_KEY}" \
-d '{
"id": "srv-1",
"upstream": {
"type": "roundrobin",
"nodes": {
"httpbin.org":1
}
}
}'
```
```
curl "http://127.0.0.1:9180/apisix/admin/services" -X PUT \
-H "X-API-KEY: ${ADMIN_API_KEY}" \
-d '{
"id": "srv-2",
"upstream": {
"type": "roundrobin",
"nodes": {
"mock.api7.ai":1
}
}
}'
```
Next, create a consumer with `key-auth` and configure `consumer-restriction` to allow only `srv-1` service:
```
curl "http://127.0.0.1:9180/apisix/admin/consumers" -X PUT \
-H "X-API-KEY: ${ADMIN_API_KEY}" \
-d '{
"username": "JohnDoe",
"plugins": {
"key-auth": {
"key": "john-key"
},
"consumer-restriction": {
"type": "service_id",
"whitelist": ["srv-1"]
}
}
}'
```
Finally, create two routes, with each belonging to one of the services created earlier:
```
curl "http://127.0.0.1:9180/apisix/admin/routes" -X PUT \
-H "X-API-KEY: ${ADMIN_API_KEY}" \
-d '{
"id": "srv-1-route",
"uri": "/anything",
"service_id": "srv-1"
}'
```
```
curl "http://127.0.0.1:9180/apisix/admin/routes" -X PUT \
-H "X-API-KEY: ${ADMIN_API_KEY}" \
-d '{
"id": "srv-2-route",
"uri": "/srv-2",
"service_id": "srv-2"
}'
```
adc.yaml
```
consumers:
- username: JohnDoe
plugins:
key-auth:
key: john-key
consumer-restriction:
type: service_id
whitelist:
- "srv-1"
services:
- name: srv-1
routes:
- name: srv-1-route
uris:
- /anything
upstream:
type: roundrobin
nodes:
- host: httpbin.org
port: 80
weight: 1
- name: srv-2
routes:
- name: srv-2-route
uris:
- /srv-2
upstream:
type: roundrobin
nodes:
- host: mock.api7.ai
port: 80
weight: 1
```
Synchronize the configuration to the gateway:
```
adc sync -f adc.yaml
```
Service ID Format in Ingress Controller
When routes are configured using the Ingress Controller, APISIX service IDs are auto-generated as the hash of `{namespace}_{routeName}_{ruleIndex}`. These IDs cannot be easily predetermined. Consider using consumer name-based restriction.
Send a request to the route in the `srv-1` service:
```
curl -i "http://127.0.0.1:9080/anything" -H 'apikey: john-key'
```
You should receive an `HTTP/1.1 200 OK` response, showing the consumer access is permitted.
Send a request to the route in the `srv-2` service:
```
curl -i "http://127.0.0.1:9080/srv-2" -H 'apikey: john-key'
```
You should receive an `HTTP/1.1 401 Unauthorized` response with the following message:
```
{"message":"The request is rejected, please check the service_id for this request"}
```
---
## Parameters[](#parameters "Direct link to Parameters")
See plugin [common configurations](https://docs.api7.ai/apisix/reference/plugin-common-configurations.md) for configuration options available to all plugins.
* type
string
default: `consumer_name`
vaild vaule:
`consumer_name`, `consumer_group_id`, `service_id`, or `route_id`
***
Key type to restrict by.
* whitelist
array\[string]
***
List of objects to whitelist.
At least one of `whitelist`, `blacklist`, and `allowed_by_methods` should be configured. If all are configured, the precedence is `blacklist` > `whitelist` > `allowed_by_methods`.
* blacklist
array\[string]
***
List of objects to blacklist.
At least one of `whitelist`, `blacklist`, and `allowed_by_methods` should be configured. If all are configured, the precedence is `blacklist` > `whitelist` > `allowed_by_methods`.
* allowed\_by\_methods
array\[object]
***
List of key-value pairs of consumer name and their corresponding HTTP methods allowed.
At least one of `whitelist`, `blacklist`, and `allowed_by_methods` should be configured. If all are configured, the precedence is `blacklist` > `whitelist` > `allowed_by_methods`.
* user
string
***
Consumer username.
* methods
array\[string]
vaild vaule:
Any combination of the `GET`, `POST`, `PUT`, `DELETE`, `PATCH`, `HEAD`, `OPTIONS`, `CONNECT`, `TRACE`, `PURGE` methods
***
List of allowed HTTP methods for the consumer.
* rejected\_code
integer
default: `403`
vaild vaule:
greater than or equal to 200
***
HTTP status code to return when the request is rejected.
* rejected\_msg
string
***
Error message to return when the request is rejected.
---
# cors
The `cors` plugin allows you to enable [Cross-Origin Resource Sharing (CORS)](https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS). CORS is an HTTP-header based mechanism which allows a server to specify any origins (domain, scheme, or port) other than its own, and instructs browsers to allow the loading of resources from those origins.
## Examples[](#examples "Direct link to Examples")
The examples below demonstrate how you can configure routes using the `cors` plugin for different scenarios.
### Enable CORS for a Route[](#enable-cors-for-a-route "Direct link to Enable CORS for a Route")
The following example demonstrates how to enable CORS on a route to allow resource loading from a list of origins.
* Admin API
* ADC
* Ingress Controller
Create a route with the `cors` plugin:
```
curl "http://127.0.0.1:9180/apisix/admin/routes" -X PUT \
-H "X-API-KEY: ${ADMIN_API_KEY}" \
-d '{
"id": "cors-route",
"uri": "/anything",
"plugins": {
"cors": {
"allow_origins": "http://sub.domain.com,http://sub2.domain.com",
"allow_methods": "GET,POST",
"allow_headers": "headr1,headr2",
"expose_headers": "ex-headr1,ex-headr2",
"max_age": 50,
"allow_credential": true
}
},
"upstream": {
"nodes": {
"httpbin.org:80": 1
},
"type": "roundrobin"
}
}'
```
adc.yaml
```
services:
- name: cors-service
routes:
- name: cors-route
uris:
- /anything
plugins:
cors:
allow_origins: "http://sub.domain.com,http://sub2.domain.com"
allow_methods: "GET,POST"
allow_headers: "headr1,headr2"
expose_headers: "ex-headr1,ex-headr2"
max_age: 50
allow_credential: true
upstream:
type: roundrobin
nodes:
- host: httpbin.org
port: 80
weight: 1
```
Synchronize the configuration to the gateway:
```
adc sync -f adc.yaml
```
* Gateway API
* APISIX CRD
cors-ic.yaml
```
apiVersion: v1
kind: Service
metadata:
namespace: aic
name: httpbin-external-domain
spec:
type: ExternalName
externalName: httpbin.org
---
apiVersion: apisix.apache.org/v1alpha1
kind: PluginConfig
metadata:
namespace: aic
name: cors-plugin-config
spec:
plugins:
- name: cors
config:
allow_origins: "http://sub.domain.com,http://sub2.domain.com"
allow_methods: "GET,POST"
allow_headers: "headr1,headr2"
expose_headers: "ex-headr1,ex-headr2"
max_age: 50
allow_credential: true
---
apiVersion: gateway.networking.k8s.io/v1
kind: HTTPRoute
metadata:
namespace: aic
name: cors-route
spec:
parentRefs:
- name: apisix
rules:
- matches:
- path:
type: Exact
value: /anything
filters:
- type: ExtensionRef
extensionRef:
group: apisix.apache.org
kind: PluginConfig
name: cors-plugin-config
backendRefs:
- name: httpbin-external-domain
port: 80
```
Apply the configuration to your cluster:
```
kubectl apply -f cors-ic.yaml
```
cors-ic.yaml
```
apiVersion: apisix.apache.org/v2
kind: ApisixUpstream
metadata:
namespace: aic
name: httpbin-external-domain
spec:
ingressClassName: apisix
externalNodes:
- type: Domain
name: httpbin.org
---
apiVersion: apisix.apache.org/v2
kind: ApisixRoute
metadata:
namespace: aic
name: cors-route
spec:
ingressClassName: apisix
http:
- name: cors-route
match:
paths:
- /anything
upstreams:
- name: httpbin-external-domain
plugins:
- name: cors
enable: true
config:
allow_origins: "http://sub.domain.com,http://sub2.domain.com"
allow_methods: "GET,POST"
allow_headers: "headr1,headr2"
expose_headers: "ex-headr1,ex-headr2"
max_age: 50
allow_credential: true
```
Apply the configuration to your cluster:
```
kubectl apply -f cors-ic.yaml
```
❶ `allow_origins`: configure allowed origins, comma-separated. To allow all origins, set it to `*`.
❷ `max_age`: configure the maximum time the result is cached in seconds.
❸ `allow_credential`: set to `true` to allow credentials (cookies, HTTP authentication, and client-side SSL certificates) to be sent with the request. If you set this to true, you cannot use `*` for other cors attributes.
Send a head request to the route with an allowed origin:
```
curl "http://127.0.0.1:9080/anything" -H "Origin: http://sub2.domain.com" -I
```
You should receive an `HTTP/1.1 200 OK` response and observe CORS headers:
```
...
Access-Control-Allow-Origin: http://sub2.domain.com
Access-Control-Allow-Credentials: true
Server: APISIX/3.8.0
Vary: Origin
Access-Control-Allow-Methods: GET,POST
Access-Control-Max-Age: 50
Access-Control-Expose-Headers: ex-headr1,ex-headr2
Access-Control-Allow-Headers: headr1,headr2
```
Send a head request to the route with an origin that is not allowed:
```
curl "http://127.0.0.1:9080/anything" -H "Origin: http://sub3.domain.com" -I
```
You should receive an `HTTP/1.1 200 OK` response without any CORS header:
```
...
Server: APISIX/3.8.0
Vary: Origin
```
### Use RegEx to Match Origin[](#use-regex-to-match-origin "Direct link to Use RegEx to Match Origin")
The following example demonstrates how to use RegEx to match the origin in `allow_origins` using the `allow_origins_by_regex` field.
* Admin API
* ADC
* Ingress Controller
Create a route with the `cors` plugin:
```
curl "http://127.0.0.1:9180/apisix/admin/routes" -X PUT \
-H "X-API-KEY: ${ADMIN_API_KEY}" \
-d '{
"id": "cors-route",
"uri": "/anything",
"plugins": {
"cors": {
"allow_methods": "GET,POST",
"allow_headers": "headr1,headr2",
"expose_headers": "ex-headr1,ex-headr2",
"max_age": 50,
"allow_origins_by_regex": [ ".*\\.test.com$" ]
}
},
"upstream": {
"nodes": {
"httpbin.org:80": 1
},
"type": "roundrobin"
}
}'
```
adc.yaml
```
services:
- name: cors-service
routes:
- name: cors-route
uris:
- /anything
plugins:
cors:
allow_methods: "GET,POST"
allow_headers: "headr1,headr2"
expose_headers: "ex-headr1,ex-headr2"
max_age: 50
allow_origins_by_regex:
- ".*\\.test.com$"
upstream:
type: roundrobin
nodes:
- host: httpbin.org
port: 80
weight: 1
```
Synchronize the configuration to the gateway:
```
adc sync -f adc.yaml
```
* Gateway API
* APISIX CRD
cors-ic.yaml
```
apiVersion: v1
kind: Service
metadata:
namespace: aic
name: httpbin-external-domain
spec:
type: ExternalName
externalName: httpbin.org
---
apiVersion: apisix.apache.org/v1alpha1
kind: PluginConfig
metadata:
namespace: aic
name: cors-regex-plugin-config
spec:
plugins:
- name: cors
config:
allow_methods: "GET,POST"
allow_headers: "headr1,headr2"
expose_headers: "ex-headr1,ex-headr2"
max_age: 50
allow_origins_by_regex:
- ".*\\.test.com$"
---
apiVersion: gateway.networking.k8s.io/v1
kind: HTTPRoute
metadata:
namespace: aic
name: cors-route
spec:
parentRefs:
- name: apisix
rules:
- matches:
- path:
type: Exact
value: /anything
filters:
- type: ExtensionRef
extensionRef:
group: apisix.apache.org
kind: PluginConfig
name: cors-regex-plugin-config
backendRefs:
- name: httpbin-external-domain
port: 80
```
Apply the configuration to your cluster:
```
kubectl apply -f cors-ic.yaml
```
cors-ic.yaml
```
apiVersion: apisix.apache.org/v2
kind: ApisixUpstream
metadata:
namespace: aic
name: httpbin-external-domain
spec:
ingressClassName: apisix
externalNodes:
- type: Domain
name: httpbin.org
---
apiVersion: apisix.apache.org/v2
kind: ApisixRoute
metadata:
namespace: aic
name: cors-route
spec:
ingressClassName: apisix
http:
- name: cors-route
match:
paths:
- /anything
upstreams:
- name: httpbin-external-domain
plugins:
- name: cors
enable: true
config:
allow_methods: "GET,POST"
allow_headers: "headr1,headr2"
expose_headers: "ex-headr1,ex-headr2"
max_age: 50
allow_origins_by_regex:
- ".*\\.test.com$"
```
Apply the configuration to your cluster:
```
kubectl apply -f cors-ic.yaml
```
❶ `allow_origins_by_regex`: allow origins using RegEx. If used together with `allow_origins`, then `allow_origins` will be ignored.
Send a head request to the route with an allowed origin:
```
curl "http://127.0.0.1:9080/anything" -H "Origin: http://a.test.com" -I
```
You should receive an `HTTP/1.1 200 OK` response and observe CORS headers:
```
...
Access-Control-Allow-Origin: http://a.test.com
Access-Control-Allow-Credentials: true
Server: APISIX/3.8.0
Access-Control-Allow-Methods: GET,POST
Access-Control-Max-Age: 50
Access-Control-Expose-Headers: ex-headr1,ex-headr2
Access-Control-Allow-Headers: headr1,headr2
```
You can also try to make a request with an invalid origin:
```
curl "http://127.0.0.1:9080/anything" -H "Origin: http://a.test2.com" -I
```
You should receive an `HTTP/1.1 200 OK` response without any CORS header:
```
...
Server: APISIX/3.8.0
Vary: Origin
```
### Configure Origins in Plugin Metadata[](#configure-origins-in-plugin-metadata "Direct link to Configure Origins in Plugin Metadata")
The following example demonstrates how to configure origins in [plugin metadata](https://docs.api7.ai/apisix/key-concepts/plugin-metadata.md) and reference them as the allowed origins in the `cors` plugin.
* Admin API
* ADC
* Ingress Controller
Configure plugin metadata for the `cors` plugin:
```
curl "http://127.0.0.1:9180/apisix/admin/plugin_metadata/cors" -X PUT \
-H "X-API-KEY: ${ADMIN_API_KEY}" \
-d '{
"allow_origins": {
"key_1": "https://domain.com",
"key_2": "https://sub.domain.com,https://sub2.domain.com",
"key_3": "*"
}
}'
```
❶ `allow_origins` : a map of keys and allowed origins. The key will be used to match the origin in the route.
Create a route with the `cors` plugin using `allow_origins_by_metadata`:
```
curl "http://127.0.0.1:9180/apisix/admin/routes" -X PUT \
-H "X-API-KEY: ${ADMIN_API_KEY}" \
-d '{
"id": "cors-route",
"uri": "/anything",
"plugins": {
"cors": {
"allow_methods": "GET,POST",
"allow_headers": "headr1,headr2",
"expose_headers": "ex-headr1,ex-headr2",
"max_age": 50,
"allow_origins_by_metadata": ["key_1"]
}
},
"upstream": {
"nodes": {
"httpbin.org:80": 1
},
"type": "roundrobin"
}
}'
```
❶ `allow_origins_by_metadata`: keys in the metadata to match the origin.
adc.yaml
```
plugin_metadata:
cors:
allow_origins:
key_1: "https://domain.com"
key_2: "https://sub.domain.com,https://sub2.domain.com"
key_3: "*"
services:
- name: cors-service
routes:
- name: cors-route
uris:
- /anything
plugins:
cors:
allow_methods: "GET,POST"
allow_headers: "headr1,headr2"
expose_headers: "ex-headr1,ex-headr2"
max_age: 50
allow_origins_by_metadata:
- "key_1"
upstream:
type: roundrobin
nodes:
- host: httpbin.org
port: 80
weight: 1
```
Synchronize the configuration to the gateway:
```
adc sync -f adc.yaml
```
Update your GatewayProxy manifest to configure the plugin metadata:
gatewayproxy.yaml
```
apiVersion: apisix.apache.org/v1alpha1
kind: GatewayProxy
metadata:
namespace: aic
name: apisix-config
spec:
provider:
type: ControlPlane
controlPlane:
# ...
# your control plane connection configuration
pluginMetadata:
cors:
allow_origins:
key_1: "https://domain.com"
key_2: "https://sub.domain.com,https://sub2.domain.com"
key_3: "*"
```
❶ `allow_origins`: a map of keys and allowed origins. The key will be used to match the origin in the route.
* Gateway API
* APISIX CRD
Create the route with `allow_origins_by_metadata`:
cors-ic.yaml
```
apiVersion: v1
kind: Service
metadata:
namespace: aic
name: httpbin-external-domain
spec:
type: ExternalName
externalName: httpbin.org
---
apiVersion: apisix.apache.org/v1alpha1
kind: PluginConfig
metadata:
namespace: aic
name: cors-metadata-plugin-config
spec:
plugins:
- name: cors
config:
allow_methods: "GET,POST"
allow_headers: "headr1,headr2"
expose_headers: "ex-headr1,ex-headr2"
max_age: 50
allow_origins_by_metadata:
- "key_1"
---
apiVersion: gateway.networking.k8s.io/v1
kind: HTTPRoute
metadata:
namespace: aic
name: cors-route
spec:
parentRefs:
- name: apisix
rules:
- matches:
- path:
type: Exact
value: /anything
filters:
- type: ExtensionRef
extensionRef:
group: apisix.apache.org
kind: PluginConfig
name: cors-metadata-plugin-config
backendRefs:
- name: httpbin-external-domain
port: 80
```
Create the route with `allow_origins_by_metadata`:
cors-ic.yaml
```
apiVersion: apisix.apache.org/v2
kind: ApisixUpstream
metadata:
namespace: aic
name: httpbin-external-domain
spec:
ingressClassName: apisix
externalNodes:
- type: Domain
name: httpbin.org
---
apiVersion: apisix.apache.org/v2
kind: ApisixRoute
metadata:
namespace: aic
name: cors-route
spec:
ingressClassName: apisix
http:
- name: cors-route
match:
paths:
- /anything
upstreams:
- name: httpbin-external-domain
plugins:
- name: cors
enable: true
config:
allow_methods: "GET,POST"
allow_headers: "headr1,headr2"
expose_headers: "ex-headr1,ex-headr2"
max_age: 50
allow_origins_by_metadata:
- "key_1"
```
❶ `allow_origins_by_metadata`: keys in the metadata to match the origin.
Apply the configuration to your cluster:
```
kubectl apply -f gatewayproxy.yaml -f cors-ic.yaml
```
Send a head request to the route with an allowed origin:
```
curl "http://127.0.0.1:9080/anything" -H "Origin: https://domain.com" -I
```
You should receive an `HTTP/1.1 200 OK` response and observe CORS headers:
```
...
Access-Control-Allow-Origin: https://domain.com
Access-Control-Allow-Credentials: true
Server: APISIX/3.8.0
Access-Control-Allow-Methods: GET,POST
Access-Control-Max-Age: 50
Access-Control-Expose-Headers: ex-headr1,ex-headr2
Access-Control-Allow-Headers: headr1,headr2
```
Send another request with an invalid origin:
```
curl "http://127.0.0.1:9080/anything" -H "Origin: http://a.test2.com" -I
```
You should receive an `HTTP/1.1 200 OK` response without any CORS header:
```
...
Server: APISIX/3.8.0
Vary: Origin
```
---
## Parameters[](#parameters "Direct link to Parameters")
See plugin [common configurations](https://docs.api7.ai/apisix/reference/plugin-common-configurations.md) for configuration options available to all plugins.
* allow\_origins
string
default: `*`
***
Comma-separated string of origins to allow CORS.
If `allow_credential` is set to `true`, you can forcefully allow CORS on all origins by configuring the field to `**` but sensitive data, such as authentication tokens or cookies, can get exposed to any malicious website.
You can also configure allow origins on a global scale using the [plugin metadata](https://docs.api7.ai/apisix/key-concepts/plugin-metadata.md), which configures the allow origins for all `cors` plugin instances. See the [example](https://docs.api7.ai/hub/cors.md#use-metadata-to-match-origin) for more details.
* allow\_methods
string
default: `*`
***
Comma-separated string of HTTP request methods to allow CORS.
If `allow_credential` is set to `true`, you can forcefully allow CORS on all methods by configuring the field to `**`, but a malicious actor can use HTTP methods, such as `PUT` or `DELETE`, to make unexpected modifications to shared resource and pose a security threat.
* allow\_headers
string
default: `*`
***
Comma-separated string of HTTP headers allowed in requests.
If `allow_credential` is set to `true`, you can forcefully allow CORS on all request headers by configuring the field to `**`, but it can potentially allow malicious headers to be sent to the server.
* expose\_headers
string
***
Comma-separated string of HTTP headers that should be made available in response to a cross-origin request.
* max\_age
integer
default: `5`
***
Maximum time in seconds for which the results of a [preflight request](https://developer.mozilla.org/en-US/docs/Glossary/Preflight_request) can be cached. If the time is within this limit, the browser will check the cached result. To disable caching, set `max_age` to `-1`.
Note that the maximum value allowed is browser-dependent. See [`Access-Control-Max-Age`](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Access-Control-Max-Age#Directives) for more details.
* allow\_credential
boolean
***
If true, allow requests to include credentials, such as cookies. According to CORS specification, when `allow_credential` is set to true, you cannot use `*` for other CORS attributes.
To allow all origins, set the field to `**`. This can potentially allow sensitive user data, such as authentication tokens or cookies, to be exposed to malicious actors.
* allow\_origins\_by\_regex
array\[string]
***
RegEx to match origins that allow CORS. When configured, only domains in this range will be allowed and any configuration in `allow_origins` will be ignored.
For example, `['.*\.test.com$']` can match all subdomains of `test.com`.
* allow\_origins\_by\_metadata
array\[string]
***
Origins to enable CORS referenced from `allow_origins` set in the plugin metadata. For example, if `allow_origins: {'EXAMPLE': 'https://example.com'}` is set in the plugin metadata, then `['EXAMPLE']` can be used to allow CORS on the origin `https://example.com`.
* timing\_allow\_origins
string
***
Comma-separated string of origins to allow to access the resource timing information. See [`Timing-Allow-Origin`](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Timing-Allow-Origin) for more details.
* timing\_allow\_origins\_by\_regex
array\[string]
***
RegEx to match with origin for enabling access to the resource timing information. When configured, only domains matching the RegEx will be allowed and any configuration in `timing_allow_origins` will be ignored.
For example, `['.*\.test.com']` can match all subdomain of `test.com`.
## Plugin Metadata[](#plugin-metadata "Direct link to Plugin Metadata")
* allow\_origins
object
***
A map of named origins to allow for CORS, where each key is an identifier referenced by `allow_origins_by_metadata` and each value is the corresponding origin string.
For example, `{'EXAMPLE': 'https://example.com'}` defines the key `EXAMPLE` for the origin `https://example.com`.
If `allow_credential` is set to `true`, you can forcefully allow CORS on all origins by setting a map value to `**`, but sensitive data, such as authentication tokens or cookies, can get exposed to any malicious website.
---
# data-mask
The `data-mask` plugin masks sensitive information in request headers, bodies, and URL queries when using logging plugins. Note that it does not modify the actual request or response traffic.
To mask sensitive information in the gateway's access log, see [Mask Sensitive Data in Access Log](https://docs.api7.ai/api7-gateway/how-to-guides/api-security/data-masking.md).
About Plugin Execution Order
The plugin can be configured on routes, services, or as a global plugin. However, be aware that [global plugins are always executed before route- or service-level plugins](https://docs.api7.ai/apisix/key-concepts/plugins.md#plugins-execution-order), so data masking may occur after logging.
For instance, if a logging plugin is configured globally while `data-mask` is applied at the route level, requests will be logged before masking occurs, and sensitive data will appear in plaintext.
To ensure the intended behavior, it is recommended to configure both plugins at the same level:
1. Both at the global level (recommended if suitable for your use case)
2. Both at the route or service level
## Examples[](#examples "Direct link to Examples")
The examples below demonstrate how you can use the `data-mask` plugin for different scenarios.
While all examples use the `file-logger` plugin for logging, the plugin is used only to demonstrate the results of data masking. Select the logging plugin that best suits your environment.
### Mask Sensitive Information in URL Query[](#mask-sensitive-information-in-url-query "Direct link to Mask Sensitive Information in URL Query")
The following example demonstrates how you can mask sensitive information in the request URL queries, before the request is logged to a local file by the `file-logger` plugin.
Create a route with the `file-logger` plugin to log requests and the `data-mask` plugin with three data masking rules:
* Admin API
* ADC
* Ingress Controller
```
curl "http://127.0.0.1:9180/apisix/admin/routes" -X PUT \
-H "X-API-KEY: ${ADMIN_API_KEY}" \
-d '{
"id": "data-mask-route",
"uri": "/anything",
"plugins": {
"data-mask": {
"request": [
{
"action": "remove",
"name": "password",
"type": "query"
},
{
"action": "replace",
"name": "token",
"type": "query",
"value": "*****"
},
{
"action": "regex",
"name": "card",
"regex": "(\\d+)\\-\\d+\\-\\d+\\-(\\d+)",
"type": "query",
"value": "$1-****-****-$2"
}
]
},
"file-logger": {
"path": "/tmp/mask-query.log"
}
},
"upstream": {
"type": "roundrobin",
"nodes": {
"httpbin.org:80": 1
}
}
}'
```
adc.yaml
```
services:
- name: data-mask-service
routes:
- name: data-mask-route
uris:
- /anything
plugins:
data-mask:
request:
- action: remove
name: password
type: query
- action: replace
name: token
type: query
value: "*****"
- action: regex
name: card
regex: "(\\d+)\\-\\d+\\-\\d+\\-(\\d+)"
type: query
value: "$1-****-****-$2"
file-logger:
path: /tmp/mask-query.log
upstream:
type: roundrobin
nodes:
- host: httpbin.org
port: 80
weight: 1
```
Synchronize the configuration to the gateway:
```
adc sync -f adc.yaml
```
* Gateway API
* APISIX CRD
data-mask-query-ic.yaml
```
apiVersion: v1
kind: Service
metadata:
namespace: aic
name: httpbin-external-domain
spec:
type: ExternalName
externalName: httpbin.org
---
apiVersion: apisix.apache.org/v1alpha1
kind: PluginConfig
metadata:
namespace: aic
name: data-mask-query-plugin-config
spec:
plugins:
- name: data-mask
config:
request:
- action: remove
name: password
type: query
- action: replace
name: token
type: query
value: "*****"
- action: regex
name: card
regex: "(\\d+)\\-\\d+\\-\\d+\\-(\\d+)"
type: query
value: "$1-****-****-$2"
- name: file-logger
config:
path: /tmp/mask-query.log
---
apiVersion: gateway.networking.k8s.io/v1
kind: HTTPRoute
metadata:
namespace: aic
name: data-mask-route
spec:
parentRefs:
- name: apisix
rules:
- matches:
- path:
type: Exact
value: /anything
filters:
- type: ExtensionRef
extensionRef:
group: apisix.apache.org
kind: PluginConfig
name: data-mask-query-plugin-config
backendRefs:
- name: httpbin-external-domain
port: 80
```
Apply the configuration to your cluster:
```
kubectl apply -f data-mask-query-ic.yaml
```
data-mask-query-ic.yaml
```
apiVersion: apisix.apache.org/v2
kind: ApisixUpstream
metadata:
namespace: aic
name: httpbin-external-domain
spec:
ingressClassName: apisix
externalNodes:
- type: Domain
name: httpbin.org
---
apiVersion: apisix.apache.org/v2
kind: ApisixRoute
metadata:
namespace: aic
name: data-mask-route
spec:
ingressClassName: apisix
http:
- name: data-mask-route
match:
paths:
- /anything
upstreams:
- name: httpbin-external-domain
plugins:
- name: data-mask
enable: true
config:
request:
- action: remove
name: password
type: query
- action: replace
name: token
type: query
value: "*****"
- action: regex
name: card
regex: "(\\d+)\\-\\d+\\-\\d+\\-(\\d+)"
type: query
value: "$1-****-****-$2"
- name: file-logger
enable: true
config:
path: /tmp/mask-query.log
```
Apply the configuration to your cluster:
```
kubectl apply -f data-mask-query-ic.yaml
```
❶ Configure the data masking rule to remove `password` URL query from the request.
❷ Configure the data masking rule to replace the value of `token` URL query with `*****`.
❸ Configure the data masking rule that matches card number in the URL query with RegEx and mask the middle portion of the card number.
❹ path to the log file on the filesystem where logs should be saved.
Send a request to the route with sensitive information in URL queries:
```
curl -i "http://127.0.0.1:9080/anything?password=abc&token=xyz&card=1234-1234-1234-1234"
```
You should receive an `HTTP/1.1 200 OK` response.
Navigating to the `/tmp/mask-query.log` file and examining the log content, you should see a log entry similar to the following:
```
{
"request": {
"uri": "/anything?token=*****&card=1234-****-****-1234",
"method": "GET",
"url": "http://127.0.0.1:9080/anything?token=*****&card=1234-****-****-1234",
"querystring": {
"token": "*****",
"card": "1234-****-****-1234"
}
}
}
```
### Mask Sensitive Information in Request Headers[](#mask-sensitive-information-in-request-headers "Direct link to Mask Sensitive Information in Request Headers")
The following example demonstrates how you can mask sensitive information in request headers, before the request is logged to a local file by the `file-logger` plugin.
Create a route with the `file-logger` plugin to log requests and the `data-mask` plugin with three data masking rules:
* Admin API
* ADC
* Ingress Controller
```
curl "http://127.0.0.1:9180/apisix/admin/routes" -X PUT \
-H "X-API-KEY: ${ADMIN_API_KEY}" \
-d '{
"id": "data-mask-route",
"uri": "/anything",
"plugins": {
"data-mask": {
"request": [
{
"action": "remove",
"name": "password",
"type": "header"
},
{
"action": "replace",
"name": "token",
"type": "header",
"value": "*****"
},
{
"action": "regex",
"name": "card",
"regex": "(\\d+)\\-\\d+\\-\\d+\\-(\\d+)",
"type": "header",
"value": "$1-****-****-$2"
}
]
},
"file-logger": {
"path": "/tmp/mask-header.log"
}
},
"upstream": {
"type": "roundrobin",
"nodes": {
"httpbin.org:80": 1
}
}
}'
```
adc.yaml
```
services:
- name: data-mask-service
routes:
- name: data-mask-route
uris:
- /anything
plugins:
data-mask:
request:
- action: remove
name: password
type: header
- action: replace
name: token
type: header
value: "*****"
- action: regex
name: card
regex: "(\\d+)\\-\\d+\\-\\d+\\-(\\d+)"
type: header
value: "$1-****-****-$2"
file-logger:
path: /tmp/mask-header.log
upstream:
type: roundrobin
nodes:
- host: httpbin.org
port: 80
weight: 1
```
Synchronize the configuration to the gateway:
```
adc sync -f adc.yaml
```
* Gateway API
* APISIX CRD
data-mask-header-ic.yaml
```
apiVersion: v1
kind: Service
metadata:
namespace: aic
name: httpbin-external-domain
spec:
type: ExternalName
externalName: httpbin.org
---
apiVersion: apisix.apache.org/v1alpha1
kind: PluginConfig
metadata:
namespace: aic
name: data-mask-header-plugin-config
spec:
plugins:
- name: data-mask
config:
request:
- action: remove
name: password
type: header
- action: replace
name: token
type: header
value: "*****"
- action: regex
name: card
regex: "(\\d+)\\-\\d+\\-\\d+\\-(\\d+)"
type: header
value: "$1-****-****-$2"
- name: file-logger
config:
path: /tmp/mask-header.log
---
apiVersion: gateway.networking.k8s.io/v1
kind: HTTPRoute
metadata:
namespace: aic
name: data-mask-route
spec:
parentRefs:
- name: apisix
rules:
- matches:
- path:
type: Exact
value: /anything
filters:
- type: ExtensionRef
extensionRef:
group: apisix.apache.org
kind: PluginConfig
name: data-mask-header-plugin-config
backendRefs:
- name: httpbin-external-domain
port: 80
```
Apply the configuration to your cluster:
```
kubectl apply -f data-mask-header-ic.yaml
```
data-mask-header-ic.yaml
```
apiVersion: apisix.apache.org/v2
kind: ApisixUpstream
metadata:
namespace: aic
name: httpbin-external-domain
spec:
ingressClassName: apisix
externalNodes:
- type: Domain
name: httpbin.org
---
apiVersion: apisix.apache.org/v2
kind: ApisixRoute
metadata:
namespace: aic
name: data-mask-route
spec:
ingressClassName: apisix
http:
- name: data-mask-route
match:
paths:
- /anything
upstreams:
- name: httpbin-external-domain
plugins:
- name: data-mask
enable: true
config:
request:
- action: remove
name: password
type: header
- action: replace
name: token
type: header
value: "*****"
- action: regex
name: card
regex: "(\\d+)\\-\\d+\\-\\d+\\-(\\d+)"
type: header
value: "$1-****-****-$2"
- name: file-logger
enable: true
config:
path: /tmp/mask-header.log
```
Apply the configuration to your cluster:
```
kubectl apply -f data-mask-header-ic.yaml
```
❶ Configure the data masking rule to remove `password` header from the request.
❷ Configure the data masking rule to replace the value of `token` request header with `*****`.
❸ Configure the data masking rule that matches card number in the request header with RegEx and mask the middle portion of the card number.
❹ path to the log file on the filesystem where logs should be saved.
Send a POST request to the route with sensitive information in headers:
```
curl -i "http://127.0.0.1:9080/anything" -X POST \
-H "password: abc" \
-H "token: xyz" \
-H "card: 1234-1234-1234-1234"
```
You should receive an `HTTP/1.1 200 OK` response.
Navigating to the `/tmp/mask-header.log` file and examining the log content, you should see a log entry similar to the following:
```
{
"request": {
"uri": "/anything",
"method": "GET",
"url": "http://127.0.0.1:9080/anything",
"headers": {
"user-agent": "curl/8.6.0",
"token": "*****",
"card": "1234-****-****-1234"
}
}
}
```
### Mask Sensitive Information in URL-Encoded Request Bodies[](#mask-sensitive-information-in-url-encoded-request-bodies "Direct link to Mask Sensitive Information in URL-Encoded Request Bodies")
The following example demonstrates how you can mask sensitive information in URL-encoded request bodies, before the request is logged to a local file by the `file-logger` plugin.
Create a route with the `file-logger` plugin to log requests and the `data-mask` plugin with three data masking rules:
* Admin API
* ADC
* Ingress Controller
```
curl "http://127.0.0.1:9180/apisix/admin/routes" -X PUT \
-H "X-API-KEY: ${ADMIN_API_KEY}" \
-d '{
"id": "data-mask-route",
"uri": "/anything",
"plugins": {
"data-mask": {
"request": [
{
"action": "remove",
"body_format": "urlencoded",
"name": "password",
"type": "body"
},
{
"action": "replace",
"body_format": "urlencoded",
"name": "token",
"type": "body",
"value": "*****"
},
{
"action": "regex",
"body_format": "urlencoded",
"name": "card",
"regex": "(\\d+)\\-\\d+\\-\\d+\\-(\\d+)",
"type": "body",
"value": "$1-****-****-$2"
}
]
},
"file-logger": {
"include_req_body": true,
"path": "/tmp/mask-urlencoded-body.log"
}
},
"upstream": {
"type": "roundrobin",
"nodes": {
"httpbin.org:80": 1
}
}
}'
```
adc.yaml
```
services:
- name: data-mask-service
routes:
- name: data-mask-route
uris:
- /anything
plugins:
data-mask:
request:
- action: remove
body_format: urlencoded
name: password
type: body
- action: replace
body_format: urlencoded
name: token
type: body
value: "*****"
- action: regex
body_format: urlencoded
name: card
regex: "(\\d+)\\-\\d+\\-\\d+\\-(\\d+)"
type: body
value: "$1-****-****-$2"
file-logger:
include_req_body: true
path: /tmp/mask-urlencoded-body.log
upstream:
type: roundrobin
nodes:
- host: httpbin.org
port: 80
weight: 1
```
Synchronize the configuration to the gateway:
```
adc sync -f adc.yaml
```
* Gateway API
* APISIX CRD
data-mask-urlencoded-ic.yaml
```
apiVersion: v1
kind: Service
metadata:
namespace: aic
name: httpbin-external-domain
spec:
type: ExternalName
externalName: httpbin.org
---
apiVersion: apisix.apache.org/v1alpha1
kind: PluginConfig
metadata:
namespace: aic
name: data-mask-urlencoded-plugin-config
spec:
plugins:
- name: data-mask
config:
request:
- action: remove
body_format: urlencoded
name: password
type: body
- action: replace
body_format: urlencoded
name: token
type: body
value: "*****"
- action: regex
body_format: urlencoded
name: card
regex: "(\\d+)\\-\\d+\\-\\d+\\-(\\d+)"
type: body
value: "$1-****-****-$2"
- name: file-logger
config:
include_req_body: true
path: /tmp/mask-urlencoded-body.log
---
apiVersion: gateway.networking.k8s.io/v1
kind: HTTPRoute
metadata:
namespace: aic
name: data-mask-route
spec:
parentRefs:
- name: apisix
rules:
- matches:
- path:
type: Exact
value: /anything
filters:
- type: ExtensionRef
extensionRef:
group: apisix.apache.org
kind: PluginConfig
name: data-mask-urlencoded-plugin-config
backendRefs:
- name: httpbin-external-domain
port: 80
```
Apply the configuration to your cluster:
```
kubectl apply -f data-mask-urlencoded-ic.yaml
```
data-mask-urlencoded-ic.yaml
```
apiVersion: apisix.apache.org/v2
kind: ApisixUpstream
metadata:
namespace: aic
name: httpbin-external-domain
spec:
ingressClassName: apisix
externalNodes:
- type: Domain
name: httpbin.org
---
apiVersion: apisix.apache.org/v2
kind: ApisixRoute
metadata:
namespace: aic
name: data-mask-route
spec:
ingressClassName: apisix
http:
- name: data-mask-route
match:
paths:
- /anything
upstreams:
- name: httpbin-external-domain
plugins:
- name: data-mask
enable: true
config:
request:
- action: remove
body_format: urlencoded
name: password
type: body
- action: replace
body_format: urlencoded
name: token
type: body
value: "*****"
- action: regex
body_format: urlencoded
name: card
regex: "(\\d+)\\-\\d+\\-\\d+\\-(\\d+)"
type: body
value: "$1-****-****-$2"
- name: file-logger
enable: true
config:
include_req_body: true
path: /tmp/mask-urlencoded-body.log
```
Apply the configuration to your cluster:
```
kubectl apply -f data-mask-urlencoded-ic.yaml
```
❶ Configure the data masking rule to remove `password` information from the request body.
❷ Configure the data masking rule to replace `token` information in the request body with `*****`.
❸ Configure the data masking rule that matches card number in the request body with RegEx and mask the middle portion of the card number.
❹ Include the request body in the log.
Send a request to the route:
```
curl -i "http://127.0.0.1:9080/anything" \
--data-urlencode "password=abc" \
--data-urlencode "token=xyz" \
--data-urlencode "card=1234-1234-1234-1234"
```
You should receive an `HTTP/1.1 200 OK` response.
Navigating to the `/tmp/mask-urlencoded-body.log` file and examining the log content, you should see a log entry similar to the following:
```
{
"request": {
"uri": "/anything",
"body": "token=*****&card=1234-****-****-1234",
"method": "POST",
"url": "http://127.0.0.1:9080/anything"
}
}
```
### Mask Sensitive Information in JSON-Encoded Request Bodies[](#mask-sensitive-information-in-json-encoded-request-bodies "Direct link to Mask Sensitive Information in JSON-Encoded Request Bodies")
The following example demonstrates how you can mask sensitive information in JSON-encoded request bodies using [JSON path](https://goessner.net/articles/JsonPath) syntax in the plugin to look for the target field, before the request is logged to a local file by the `file-logger` plugin.
Create a route with the `file-logger` plugin to log requests and the `data-mask` plugin with three data masking rules:
* Admin API
* ADC
* Ingress Controller
```
curl "http://127.0.0.1:9180/apisix/admin/routes" -X PUT \
-H "X-API-KEY: ${ADMIN_API_KEY}" \
-d '{
"id": "data-mask-route",
"uri": "/anything",
"plugins": {
"data-mask": {
"request": [
{
"action": "remove",
"body_format": "json",
"name": "$.password",
"type": "body"
},
{
"action": "replace",
"body_format": "json",
"name": "users[*].token",
"type": "body",
"value": "*****"
},
{
"action": "regex",
"body_format": "json",
"name": "$.users[*].credit.card",
"regex": "(\\d+)\\-\\d+\\-\\d+\\-(\\d+)",
"type": "body",
"value": "$1-****-****-$2"
}
]
},
"file-logger": {
"include_req_body": true,
"path": "/tmp/mask-json-body.log"
}
},
"upstream": {
"type": "roundrobin",
"nodes": {
"httpbin.org:80": 1
}
}
}'
```
adc.yaml
```
services:
- name: data-mask-service
routes:
- name: data-mask-route
uris:
- /anything
plugins:
data-mask:
request:
- action: remove
body_format: json
name: "$.password"
type: body
- action: replace
body_format: json
name: "users[*].token"
type: body
value: "*****"
- action: regex
body_format: json
name: "$.users[*].credit.card"
regex: "(\\d+)\\-\\d+\\-\\d+\\-(\\d+)"
type: body
value: "$1-****-****-$2"
file-logger:
include_req_body: true
path: /tmp/mask-json-body.log
upstream:
type: roundrobin
nodes:
- host: httpbin.org
port: 80
weight: 1
```
Synchronize the configuration to the gateway:
```
adc sync -f adc.yaml
```
* Gateway API
* APISIX CRD
data-mask-json-ic.yaml
```
apiVersion: v1
kind: Service
metadata:
namespace: aic
name: httpbin-external-domain
spec:
type: ExternalName
externalName: httpbin.org
---
apiVersion: apisix.apache.org/v1alpha1
kind: PluginConfig
metadata:
namespace: aic
name: data-mask-json-plugin-config
spec:
plugins:
- name: data-mask
config:
request:
- action: remove
body_format: json
name: "$.password"
type: body
- action: replace
body_format: json
name: "users[*].token"
type: body
value: "*****"
- action: regex
body_format: json
name: "$.users[*].credit.card"
regex: "(\\d+)\\-\\d+\\-\\d+\\-(\\d+)"
type: body
value: "$1-****-****-$2"
- name: file-logger
config:
include_req_body: true
path: /tmp/mask-json-body.log
---
apiVersion: gateway.networking.k8s.io/v1
kind: HTTPRoute
metadata:
namespace: aic
name: data-mask-route
spec:
parentRefs:
- name: apisix
rules:
- matches:
- path:
type: Exact
value: /anything
filters:
- type: ExtensionRef
extensionRef:
group: apisix.apache.org
kind: PluginConfig
name: data-mask-json-plugin-config
backendRefs:
- name: httpbin-external-domain
port: 80
```
Apply the configuration to your cluster:
```
kubectl apply -f data-mask-json-ic.yaml
```
data-mask-json-ic.yaml
```
apiVersion: apisix.apache.org/v2
kind: ApisixUpstream
metadata:
namespace: aic
name: httpbin-external-domain
spec:
ingressClassName: apisix
externalNodes:
- type: Domain
name: httpbin.org
---
apiVersion: apisix.apache.org/v2
kind: ApisixRoute
metadata:
namespace: aic
name: data-mask-route
spec:
ingressClassName: apisix
http:
- name: data-mask-route
match:
paths:
- /anything
upstreams:
- name: httpbin-external-domain
plugins:
- name: data-mask
enable: true
config:
request:
- action: remove
body_format: json
name: "$.password"
type: body
- action: replace
body_format: json
name: "users[*].token"
type: body
value: "*****"
- action: regex
body_format: json
name: "$.users[*].credit.card"
regex: "(\\d+)\\-\\d+\\-\\d+\\-(\\d+)"
type: body
value: "$1-****-****-$2"
- name: file-logger
enable: true
config:
include_req_body: true
path: /tmp/mask-json-body.log
```
Apply the configuration to your cluster:
```
kubectl apply -f data-mask-json-ic.yaml
```
❶ Configure the data masking rule to remove `password` information from the request body.
❷ Configure the data masking rule to replace `token` information in the request body with `*****`.
❸ Configure the data masking rule that matches card number in the request body with RegEx and mask the middle portion of the card number.
❹ Include the request body in the log.
Send a request to the route with sensitive information in the request body:
```
curl -i "http://127.0.0.1:9080/anything" -X POST -d '
{
"password": "abc",
"users": [
{
"token": "xyz",
"credit": {
"card": "1234-1234-1234-1234"
}
},
{
"token": "xyz",
"credit": {
"card": "1234-1234-1234-1234"
}
}
]
}'
```
You should receive an `HTTP/1.1 200 OK` response.
Navigating to the `/tmp/mask-json-body.log` file and examining the log content, you should see a log entry similar to the following:
```
{
"request": {
"uri": "/anything",
"body": "{\"users\":[{\"token\":\"*****\",\"credit\":{\"card\":\"1234-****-****-1234\"}},{\"token\":\"*****\",\"credit\":{\"card\":\"1234-****-****-1234\"}}]}",
"method": "POST",
"url": "http://127.0.0.1:9080/anything"
}
}
```
---
## Parameters[](#parameters "Direct link to Parameters")
See plugin [common configurations](https://docs.api7.ai/apisix/reference/plugin-common-configurations.md) for configuration options available to all plugins.
* request
array\[object]
***
An array of actions to mask sensitive information in the request.
* type
string
required
vaild vaule:
`query`, `header`, or `body`
***
Location where sensitive information should be masked.
* body\_format
string
vaild vaule:
`json` or `urlencoded`
***
Encoding of the request body. Required when `type` is `body`.
* name
string
required
***
Name of the information field that contains sensitive data. For JSON body, you can use [JSONPath](https://goessner.net/articles/JsonPath) syntax.
* action
string
required
vaild vaule:
`regex`, `replace`, or `remove`
***
Action to mask the sensitive data.
* regex
string
***
Regular expressions to match the sensitive data. Required when `action` is `regex`.
* value
string
***
Value to replace the sensitive data with. Required when `action` is `regex` or `replace`.
* max\_body\_size
integer
default: `1048576`
***
Maximum body size allowed in bytes. If a request's body size exceeds the configured value, data masking rules will be ignored.
* max\_req\_post\_args
integer
default: `100`
vaild vaule:
greater than or equal to 0
***
Maximum number of URL-encoded form fields to parse when masking request body data with `body_format` set to `urlencoded`.
---
# datadog
The `datadog` plugin supports the integration with [Datadog](https://www.datadoghq.com), one of the most used observability service for cloud applications. When enabled, the plugin pushes metrics to [DogStatsD](https://docs.datadoghq.com/developers/dogstatsd/?tab=hostagent) server, which comes bundled with the [Datadog agent](https://docs.datadoghq.com/agent), over UDP protocol.
## Metrics[](#metrics "Direct link to Metrics")
The plugin exports the following metrics by default.
All metrics will be prefixed by the `namespace` configured in metadata. For example, if the `namespace` is configured to be `apisix`, you will see the `request.counter` metric exported as `apisix.request.counter` in Datadog.
| Name | Type | Description |
| ---------------- | --------- | ----------------------------------------------------------------------------------------------------- |
| request.counter | counter | Number of requests received. |
| request.latency | histogram | Time taken to process the request, in milliseconds. |
| upstream.latency | histogram | Time taken to proxy the request to the upstream server until a response is received, in milliseconds. |
| apisix.latency | histogram | Time taken by APISIX agent to process the request, in milliseconds. |
| ingress.size | timer | Request body size in bytes. |
| egress.size | timer | Response body size in bytes. |
## Tags[](#tags "Direct link to Tags")
The plugin exports metrics with the following [tags](https://docs.datadoghq.com/getting_started/tagging).
When there are no suitable values for any particular tag, the tag will be omitted.
| Name | Description |
| ----------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| route\_name | Name of the route. If not present or if the attribute `prefer_name` is set to false, fall back to the route ID. |
| service\_name | Name of the service. If not present or if the attribute `prefer_name` is set to false, fall back to the service ID. |
| consumer | Username of the consumer if the route is connected to a consumer. |
| balancer\_ip | IP address of the upstream balancer that processes the current request. |
| response\_status | HTTP response status code, such as `201`, `404`, or `503`. |
| response\_status\_class | HTTP response status code class, such as `2xx`, `4xx`, or `5xx`. Available in APISIX from version 3.14.0 and API7 Enterprise from version 3.9.0. |
| scheme | Request scheme, such as HTTP and gRPC. |
| path | HTTP path pattern. Only available if the parameter `include_path` is set to `true`. Available in APISIX from version 3.14.0 and API7 Enterprise from version 3.9.0. |
| method | HTTP method. Only available if the attribute `include_method` is set to true. Available in APISIX from version 3.14.0 and API7 Enterprise from version 3.9.0. |
## Examples[](#examples "Direct link to Examples")
The examples below demonstrate how you can configure `datadog` plugin for different scenarios.
Before proceeding, please make sure you have installed [Datadog agent](https://docs.datadoghq.com/agent) which collects events and metrics from monitored objects and sends them to Datadog.
Start the Datadog agent:
* Docker
* Kubernetes
```
docker run -d \
--name dogstatsd-agent \
-e DD_API_KEY=35ebe12345678dec56218930b79fdb4cf \
-e DD_SITE="us5.datadoghq.com" \
-e DD_HOSTNAME=apisix.quickstart \
-e DD_DOGSTATSD_NON_LOCAL_TRAFFIC=true \
-p 8125:8125/udp \
datadog/dogstatsd:latest
```
❶ `DD_API_KEY`: replace with your API key.
❷ `DD_SITE`: replace with your Datadog site.
❸ `DD_HOSTNAME`: replace with your hostname.
❹ `DD_DOGSTATSD_NON_LOCAL_TRAFFIC`: set to true to listen to DogStatsD packets from other containers.
Create a Kubernetes manifest file for the Datadog DogStatsD agent:
dogstatsd-deployment.yaml
```
apiVersion: apps/v1
kind: Deployment
metadata:
namespace: aic
name: dogstatsd-agent
spec:
replicas: 1
selector:
matchLabels:
app: dogstatsd-agent
template:
metadata:
labels:
app: dogstatsd-agent
spec:
containers:
- name: dogstatsd-agent
image: datadog/dogstatsd:latest
env:
- name: DD_API_KEY
value: "35ebe12345678dec56218930b79fdb4cf"
- name: DD_SITE
value: "us5.datadoghq.com"
- name: DD_HOSTNAME
value: "apisix.quickstart"
- name: DD_DOGSTATSD_NON_LOCAL_TRAFFIC
value: "true"
ports:
- containerPort: 8125
protocol: UDP
```
❶ `DD_API_KEY`: replace with your API key.
❷ `DD_SITE`: replace with your Datadog site.
❸ `DD_HOSTNAME`: replace with your hostname.
❹ `DD_DOGSTATSD_NON_LOCAL_TRAFFIC`: set to true to listen to DogStatsD packets from other containers.
Create a Kubernetes manifest file for the DogStatsD service:
dogstatsd-service.yaml
```
apiVersion: v1
kind: Service
metadata:
namespace: aic
name: dogstatsd-agent
spec:
selector:
app: dogstatsd-agent
ports:
- name: dogstatsd
port: 8125
targetPort: 8125
protocol: UDP
type: ClusterIP
```
Apply the manifests:
```
kubectl apply -f dogstatsd-deployment.yaml -f dogstatsd-service.yaml
```
You can configure most options in the agent’s main configuration file `datadog.yaml` through environment variables, prefixed with `DD_`. For more information, see [agent environment variables](https://docs.datadoghq.com/agent/guide/environment-variables).
### Update Datadog Agent Address and Other Metadata[](#update-datadog-agent-address-and-other-metadata "Direct link to Update Datadog Agent Address and Other Metadata")
By default, the plugin expects the DogStatsD server to be available at `127.0.0.1:8125`. To customize the address and other metadata, update the [plugin metadata](https://docs.api7.ai/hub/datadog/configuration.md#metadata) as such:
* Admin API
* ADC
* Ingress Controller
```
curl "http://127.0.0.1:9180/apisix/admin/plugin_metadata/datadog" -X PUT \
-H "X-API-KEY: ${ADMIN_API_KEY}" \
-d '{
"host": "192.168.0.90",
"port": 8125,
"namespace": "apisix",
"constant_tags": [
"source:apisix",
"service:custom"
]
}'
```
❶ Replace with your private IP address. If you are running the Datadog agent in Kubernetes, use the service DNS name (e.g., `dogstatsd-agent.aic.svc`).
❷ Set to Datadog agent listening port.
❸ Set namespace which prefixes all metrics.
❹ Configure constant tags.
To reset to default configuration, send a request to the `datadog` plugin metadata with an empty body:
```
curl "http://127.0.0.1:9180/apisix/admin/plugin_metadata/datadog" -X PUT -d '{}'
```
adc.yaml
```
plugin_metadata:
- name: datadog
host: "192.168.0.90"
port: 8125
namespace: apisix
constant_tags:
- "source:apisix"
- "service:custom"
```
❶ Replace with your private IP address. If you are running the Datadog agent in Kubernetes, use the service DNS name (e.g., `dogstatsd-agent.aic.svc`).
❷ Set to Datadog agent listening port.
❸ Set namespace which prefixes all metrics.
❹ Configure constant tags.
Synchronize the configuration to the gateway:
```
adc sync -f adc.yaml
```
datadog-metadata.yaml
```
apiVersion: apisix.apache.org/v1alpha1
kind: GatewayProxy
metadata:
namespace: aic
name: apisix-config
spec:
provider:
type: ControlPlane
controlPlane:
service:
name: apisix-admin
port: 9180
auth:
type: AdminKey
adminKey:
value: edd1c9f034335f136f87ad84b625c8f1
pluginMetadata:
datadog:
host: "dogstatsd-agent.aic.svc"
port: 8125
namespace: apisix
constant_tags:
- "source:apisix"
- "service:custom"
```
❶ Set to the Datadog DogStatsD agent service DNS name in Kubernetes.
❷ Set to Datadog agent listening port.
❸ Set namespace which prefixes all metrics.
❹ Configure constant tags.
Apply the configuration:
```
kubectl apply -f datadog-metadata.yaml
```
### Monitor Route Metrics[](#monitor-route-metrics "Direct link to Monitor Route Metrics")
The example below shows how you can send the metrics of a particular route to Datadog.
Create a route with the `datadog` plugin and a few optional configuration options:
* Admin API
* ADC
* Ingress Controller
```
curl "http://127.0.0.1:9180/apisix/admin/routes" -X PUT \
-H "X-API-KEY: ${ADMIN_API_KEY}" \
-d '{
"id": "datadog-route",
"uri": "/anything",
"plugins": {
"datadog": {
"batch_max_size" : 1,
"max_retry_count": 0
}
},
"upstream": {
"type": "roundrobin",
"nodes": {
"httpbin.org": 1
}
}
}'
```
adc.yaml
```
services:
- name: httpbin
routes:
- uris:
- /anything
name: datadog-route
plugins:
datadog:
batch_max_size: 1
max_retry_count: 0
upstream:
type: roundrobin
nodes:
- host: httpbin.org
port: 80
weight: 1
```
Synchronize the configuration to the gateway:
```
adc sync -f adc.yaml
```
* Gateway API
* APISIX CRD
datadog-ic.yaml
```
apiVersion: v1
kind: Service
metadata:
namespace: aic
name: httpbin-external-domain
spec:
type: ExternalName
externalName: httpbin.org
---
apiVersion: apisix.apache.org/v1alpha1
kind: PluginConfig
metadata:
namespace: aic
name: datadog-plugin-config
spec:
plugins:
- name: datadog
config:
batch_max_size: 1
max_retry_count: 0
---
apiVersion: gateway.networking.k8s.io/v1
kind: HTTPRoute
metadata:
namespace: aic
name: datadog-route
spec:
parentRefs:
- name: apisix
rules:
- matches:
- path:
type: Exact
value: /anything
filters:
- type: ExtensionRef
extensionRef:
group: apisix.apache.org
kind: PluginConfig
name: datadog-plugin-config
backendRefs:
- name: httpbin-external-domain
port: 80
```
datadog-ic.yaml
```
apiVersion: apisix.apache.org/v2
kind: ApisixUpstream
metadata:
namespace: aic
name: httpbin-external-domain
spec:
ingressClassName: apisix
externalNodes:
- type: Domain
name: httpbin.org
---
apiVersion: apisix.apache.org/v2
kind: ApisixRoute
metadata:
namespace: aic
name: datadog-route
spec:
ingressClassName: apisix
http:
- name: datadog-route
match:
paths:
- /anything
methods:
- GET
upstreams:
- name: httpbin-external-domain
plugins:
- name: datadog
config:
batch_max_size: 1
max_retry_count: 0
```
Apply the configuration:
```
kubectl apply -f datadog-ic.yaml
```
❶ `batch_max_size`: set to 1 to send the metric immediately.
❷ `max_retry_count`: set to 0 to disallow retries if metrics were unsuccessfully sent.
Generate a few requests to the previously created route:
```
curl "http://127.0.0.1:9080/anything"
```
In Datadog, Select **Metrics** from the left menu and go to **Explorer**. Select `apisix.ingress.size.count` as the metric. You should see the count reflecting the number of requests generated:

---
## Parameters[](#parameters "Direct link to Parameters")
See plugin [common configurations](https://docs.api7.ai/apisix/reference/plugin-common-configurations.md) for configuration options available to all plugins.
* prefer\_name
boolean
default: `true`
***
If true, export route/service name instead of their ID in metric tags.
* include\_path
boolean
default: `false`
***
If true, include the path pattern in metric tags. This option is available in APISIX but not yet supported in API7 Enterprise.
* include\_method
boolean
default: `false`
***
If true, include the HTTP method in metric tags. This option is available in APISIX but not yet supported in API7 Enterprise.
* constant\_tags
array\[string]
***
Static key-value tags that are attached to all metrics. These tags can be used to add metadata such as team ownership or environment, enabling easier filtering, aggregation, and alerting across related endpoints. Available in APISIX from version 3.14.0 and API7 Enterprise from version 3.9.0.
* name
string
default: `datadog`
***
Unique identifier of the plugin for the batch processor. If you use [Prometheus](https://docs.api7.ai/hub/prometheus.md) to monitor APISIX metrics, the name is exported in `apisix_batch_process_entries`.
* batch\_max\_size
integer
default: `1000`
vaild vaule:
greater than 0
***
The number of log entries allowed in one batch. Once reached, the batch will be sent to Datadog agent. Setting this parameter to 1 means immediate processing.
* inactive\_timeout
integer
default: `5`
vaild vaule:
greater than 0
***
The maximum time in seconds to wait for new logs before sending the batch to the logging service. The value should be smaller than `buffer_duration`.
* buffer\_duration
integer
default: `60`
vaild vaule:
greater than 0
***
The maximum time in seconds from the earliest entry allowed before sending the batch to the logging service.
* retry\_delay
integer
default: `1`
vaild vaule:
greater than or equal to 0
***
The time interval in seconds to retry sending the batch to the logging service if the batch was not successfully sent.
* max\_retry\_count
integer
default: `0`
vaild vaule:
greater than or equal to 0
***
The maximum number of unsuccessful retries allowed before dropping the log entries.
## Plugin Metadata[](#plugin-metadata "Direct link to Plugin Metadata")
* host
string
default: `127.0.0.1`
***
DogStatsD server host address.
* port
integer
default: `8125`
***
DogStatsD server port.
* namespace
string
default: `apisix`
***
Prefix for all metrics. For example, if the namespace is configured as `apisix`, you should see the `request.counter` metric exported as `apisix.request.counter` to Datadog.
* constant\_tags
array\[string]
default: `[source:apisix]`
***
Metric [tags](https://docs.datadoghq.com/getting_started/tagging).
* max\_pending\_entries
integer
default: `` `8192` in APISIX 3.18.0 and in API7 Enterprise 3.9.19 and 3.10.6 ``
vaild vaule:
greater than or equal to 1
***
Maximum number of entries waiting in the batch processor. New entries are discarded when the backlog reaches the limit.
Introduced in API7 Enterprise 3.9.19 on the 3.9 line and 3.10.6 on the 3.10 line, and in APISIX 3.18.0.
See [Batch Processor](https://docs.api7.ai/apisix/reference/batch-processor.md#configure-the-pending-entry-limit) for sizing and verification guidance.
---
# degraphql
The `degraphql` plugin supports communicating with upstream GraphQL services over regular HTTP requests by mapping GraphQL queries to HTTP endpoints.
## Examples[](#examples "Direct link to Examples")
The examples below use [Pokemon GraphQL API](https://graphql-pokemon.js.org/) as the upstream GraphQL server and demonstrate how you can configure `degraphql` to transform different types of GraphQL queries.
### Transform a Basic Query[](#transform-a-basic-query "Direct link to Transform a Basic Query")
The following example demonstrates how you can transform a simple query below:
```
query {
getAllPokemon {
key
color
}
}
```
* Admin API
* ADC
* Ingress Controller
Create a route with the `degraphql` plugin as follows:
```
curl "http://127.0.0.1:9180/apisix/admin/routes" -X PUT \
-H "X-API-KEY: ${ADMIN_API_KEY}" \
-d '{
"id": "degraphql-route",
"methods": ["POST"],
"uri": "/v8",
"upstream": {
"type": "roundrobin",
"nodes": {
"graphqlpokemon.favware.tech": 1
},
"scheme": "https",
"pass_host": "node"
},
"plugins": {
"degraphql": {
"query": "{\n getAllPokemon {\n key\n color\n }\n}"
}
}
}'
```
Create a route with the `degraphql` plugin as follows:
adc.yaml
```
services:
- name: degraphql-service
routes:
- name: degraphql-route
methods:
- POST
uris:
- /v8
plugins:
degraphql:
query: |
{
getAllPokemon {
key
color
}
}
upstream:
type: roundrobin
nodes:
- host: graphqlpokemon.favware.tech
port: 443
weight: 1
scheme: https
```
Synchronize the configuration to the gateway:
```
adc sync -f adc.yaml
```
* Gateway API
* APISIX CRD
degraphql-ic.yaml
```
apiVersion: v1
kind: Service
metadata:
namespace: aic
name: graphql-pokemon
spec:
type: ExternalName
externalName: graphqlpokemon.favware.tech
---
apiVersion: apisix.apache.org/v1alpha1
kind: BackendTrafficPolicy
metadata:
namespace: aic
name: graphql-pokemon-https
spec:
targetRefs:
- name: graphql-pokemon
kind: Service
group: ""
passHost: node
scheme: https
---
apiVersion: apisix.apache.org/v1alpha1
kind: PluginConfig
metadata:
namespace: aic
name: degraphql-plugin-config
spec:
plugins:
- name: degraphql
config:
query: |
{
getAllPokemon {
key
color
}
}
---
apiVersion: gateway.networking.k8s.io/v1
kind: HTTPRoute
metadata:
namespace: aic
name: degraphql-route
spec:
parentRefs:
- name: apisix
rules:
- matches:
- path:
type: Exact
value: /v8
method:
- POST
filters:
- type: ExtensionRef
extensionRef:
group: apisix.apache.org
kind: PluginConfig
name: degraphql-plugin-config
backendRefs:
- name: graphql-pokemon
port: 443
```
degraphql-ic.yaml
```
apiVersion: apisix.apache.org/v2
kind: ApisixRoute
metadata:
namespace: aic
name: degraphql-route
spec:
ingressClassName: apisix
http:
- name: degraphql-route
match:
paths:
- /v8
methods:
- POST
upstreams:
- name: graphql-pokemon
plugins:
- name: degraphql
enable: true
config:
query: |
{
getAllPokemon {
key
color
}
}
---
apiVersion: apisix.apache.org/v2
kind: ApisixUpstream
metadata:
namespace: aic
name: graphql-pokemon
spec:
ingressClassName: apisix
externalNodes:
- type: Domain
name: graphqlpokemon.favware.tech
port: 443
scheme: https
passHost: node
```
Apply the configuration to your cluster:
```
kubectl apply -f degraphql-ic.yaml
```
Send a request to the route to verify:
```
curl "http://127.0.0.1:9080/v8" -X POST
```
You should see a response similar to the following:
```
{
"data": {
"getAllPokemon": [
{ "key": "pokestarsmeargle", "color": "White" },
{ "key": "pokestarufo", "color": "White" },
{ "key": "pokestarufo2", "color": "White" },
...
{ "key": "terapagosstellar", "color": "Blue" },
{ "key": "pecharunt", "color": "Purple" }
]
}
}
```
### Transform a Query with Variables[](#transform-a-query-with-variables "Direct link to Transform a Query with Variables")
The following example demonstrates how you can transform the query below, with a variable:
```
query ($pokemon: PokemonEnum!) {
getPokemon(
pokemon: $pokemon
) {
color
species
}
}
variable:
{
"pokemon": "pikachu"
}
```
* Admin API
* ADC
* Ingress Controller
Create a route with the `degraphql` plugin as follows:
```
curl "http://127.0.0.1:9180/apisix/admin/routes" -X PUT \
-H "X-API-KEY: ${ADMIN_API_KEY}" \
-d '{
"id": "degraphql-route",
"uri": "/v8",
"upstream": {
"type": "roundrobin",
"nodes": {
"graphqlpokemon.favware.tech": 1
},
"scheme": "https",
"pass_host": "node"
},
"plugins": {
"degraphql": {
"query": "query ($pokemon: PokemonEnum!) {\n getPokemon(\n pokemon: $pokemon\n ) {\n color\n species\n }\n}\n",
"variables": ["pokemon"]
}
}
}'
```
Create a route with the `degraphql` plugin as follows:
adc.yaml
```
services:
- name: degraphql-service
routes:
- name: degraphql-route
uris:
- /v8
plugins:
degraphql:
query: |
query ($pokemon: PokemonEnum!) {
getPokemon(
pokemon: $pokemon
) {
color
species
}
}
variables:
- pokemon
upstream:
type: roundrobin
nodes:
- host: graphqlpokemon.favware.tech
port: 443
weight: 1
scheme: https
```
Synchronize the configuration to the gateway:
```
adc sync -f adc.yaml
```
* Gateway API
* APISIX CRD
degraphql-ic.yaml
```
apiVersion: v1
kind: Service
metadata:
namespace: aic
name: graphql-pokemon
spec:
type: ExternalName
externalName: graphqlpokemon.favware.tech
---
apiVersion: apisix.apache.org/v1alpha1
kind: BackendTrafficPolicy
metadata:
namespace: aic
name: graphql-pokemon-https
spec:
targetRefs:
- name: graphql-pokemon
kind: Service
group: ""
passHost: node
scheme: https
---
apiVersion: apisix.apache.org/v1alpha1
kind: PluginConfig
metadata:
namespace: aic
name: degraphql-plugin-config
spec:
plugins:
- name: degraphql
config:
query: |
query ($pokemon: PokemonEnum!) {
getPokemon(
pokemon: $pokemon
) {
color
species
}
}
variables:
- pokemon
---
apiVersion: gateway.networking.k8s.io/v1
kind: HTTPRoute
metadata:
namespace: aic
name: degraphql-route
spec:
parentRefs:
- name: apisix
rules:
- matches:
- path:
type: Exact
value: /v8
filters:
- type: ExtensionRef
extensionRef:
group: apisix.apache.org
kind: PluginConfig
name: degraphql-plugin-config
backendRefs:
- name: graphql-pokemon
port: 443
```
degraphql-ic.yaml
```
apiVersion: apisix.apache.org/v2
kind: ApisixRoute
metadata:
namespace: aic
name: degraphql-route
spec:
ingressClassName: apisix
http:
- name: degraphql-route
match:
paths:
- /v8
upstreams:
- name: graphql-pokemon
plugins:
- name: degraphql
enable: true
config:
query: |
query ($pokemon: PokemonEnum!) {
getPokemon(
pokemon: $pokemon
) {
color
species
}
}
variables:
- pokemon
---
apiVersion: apisix.apache.org/v2
kind: ApisixUpstream
metadata:
namespace: aic
name: graphql-pokemon
spec:
ingressClassName: apisix
externalNodes:
- type: Domain
name: graphqlpokemon.favware.tech
port: 443
scheme: https
passHost: node
```
Apply the configuration to your cluster:
```
kubectl apply -f degraphql-ic.yaml
```
Send a request to the route to verify:
```
curl "http://127.0.0.1:9080/v8" -X POST \
-d '{
"pokemon": "pikachu"
}'
```
You should see a response similar to the following:
```
{
"data": {
"getPokemon": {
"color": "Yellow",
"species": "pikachu"
}
}
}
```
Alternatively, you can also pass the variable in the URL query string of a GET request:
```
curl "http://127.0.0.1:9080/v8?pokemon=pikachu" -H "x-apollo-operation-name: GET"
```
You should see the same response as the previous.
---
## Parameters[](#parameters "Direct link to Parameters")
See plugin [common configurations](https://docs.api7.ai/apisix/reference/plugin-common-configurations.md) for configuration options available to all plugins.
* query
string
required
***
GraphQL query to be sent to the upstream.
* operation\_name
string
***
Name of the operation. Required if multiple operations are included in the query.
* variables
array\[string]
***
Variables used in GraphQL queries.
* max\_req\_body\_size
integer
default: `67108864`
vaild vaule:
greater than or equal to 1
***
Maximum POST request body size in bytes read when extracting configured GraphQL `variables`. A larger body returns `503 Service Unavailable`. The request body is not used when `variables` is not configured. Introduced in API7 Enterprise 3.9.17 and 3.10.4, and APISIX 3.18.0.
---
# elasticsearch-logger
The `elasticsearch-logger` plugin pushes request and response logs in batches to [Elasticsearch](https://www.elastic.co) and supports the customization of log formats. When enabled, the plugin will serialize the request context information to [Elasticsearch Bulk format](https://www.elastic.co/guide/en/elasticsearch/reference/current/docs-bulk.html#docs-bulk) and add them to the queue, before they are pushed to Elasticsearch.
## Examples[](#examples "Direct link to Examples")
The examples below demonstrate how you can configure `elasticsearch-logger` plugin for different scenarios.
To follow along the examples, start Elasticsearch and Kibana:
* Docker
* Kubernetes
Start an Elasticsearch instance:
```
docker run -d \
--name elasticsearch \
--network apisix-quickstart-net \
-v elasticsearch_vol:/usr/share/elasticsearch/data/ \
-p 9200:9200 \
-p 9300:9300 \
-e ES_JAVA_OPTS="-Xms512m -Xmx512m" \
-e discovery.type=single-node \
-e xpack.security.enabled=false \
docker.elastic.co/elasticsearch/elasticsearch:7.17.29
```
Start a Kibana instance to visualize the indexed data in Elasticsearch:
```
docker run -d \
--name kibana \
--network apisix-quickstart-net \
-p 5601:5601 \
-e ELASTICSEARCH_HOSTS="http://elasticsearch:9200" \
docker.elastic.co/kibana/kibana:7.17.29
```
Create a Kubernetes manifest file for the Elasticsearch deployment:
elasticsearch-deployment.yaml
```
apiVersion: apps/v1
kind: Deployment
metadata:
namespace: aic
name: elasticsearch
spec:
replicas: 1
selector:
matchLabels:
app: elasticsearch
template:
metadata:
labels:
app: elasticsearch
spec:
containers:
- name: elasticsearch
image: docker.elastic.co/elasticsearch/elasticsearch:7.17.29
env:
- name: ES_JAVA_OPTS
value: "-Xms512m -Xmx512m"
- name: discovery.type
value: single-node
- name: xpack.security.enabled
value: "false"
ports:
- containerPort: 9200
- containerPort: 9300
```
Create a Kubernetes manifest file for the Elasticsearch service:
elasticsearch-service.yaml
```
apiVersion: v1
kind: Service
metadata:
namespace: aic
name: elasticsearch
spec:
selector:
app: elasticsearch
ports:
- name: http
port: 9200
targetPort: 9200
- name: transport
port: 9300
targetPort: 9300
type: ClusterIP
```
Create a Kubernetes manifest file for the Kibana deployment:
kibana-deployment.yaml
```
apiVersion: apps/v1
kind: Deployment
metadata:
namespace: aic
name: kibana
spec:
replicas: 1
selector:
matchLabels:
app: kibana
template:
metadata:
labels:
app: kibana
spec:
containers:
- name: kibana
image: docker.elastic.co/kibana/kibana:7.17.29
env:
- name: ELASTICSEARCH_HOSTS
value: "http://elasticsearch.aic.svc:9200"
ports:
- containerPort: 5601
```
Create a Kubernetes manifest file for the Kibana service:
kibana-service.yaml
```
apiVersion: v1
kind: Service
metadata:
namespace: aic
name: kibana
spec:
selector:
app: kibana
ports:
- name: http
port: 5601
targetPort: 5601
type: ClusterIP
```
Apply the manifests:
```
kubectl apply -f elasticsearch-deployment.yaml -f elasticsearch-service.yaml -f kibana-deployment.yaml -f kibana-service.yaml
```
To access Kibana, forward the service port:
```
kubectl port-forward -n aic svc/kibana 5601:5601
```
If successful, you should see the Kibana dashboard on [localhost:5601](http://localhost:5601).
### Log in the Default Log Format[](#log-in-the-default-log-format "Direct link to Log in the Default Log Format")
The following example demonstrates how you can enable the `elasticsearch-logger` plugin on a route, which logs client requests and responses, as well as pushing logs to Elasticsearch.
Create a route with `elasticsearch-logger` as follows:
* Admin API
* ADC
* Ingress Controller
```
curl "http://127.0.0.1:9180/apisix/admin/routes" -X PUT \
-H "X-API-KEY: ${ADMIN_API_KEY}" \
-d '{
"id": "elasticsearch-logger-route",
"uri": "/anything",
"plugins": {
"elasticsearch-logger": {
"endpoint_addrs": ["http://elasticsearch:9200"],
"field": {
"index": "gateway"
}
}
},
"upstream": {
"nodes": {
"httpbin.org:80": 1
},
"type": "roundrobin"
}
}'
```
adc.yaml
```
services:
- name: httpbin
routes:
- uris:
- /anything
name: elasticsearch-logger-route
plugins:
elasticsearch-logger:
endpoint_addrs:
- "http://elasticsearch:9200"
field:
index: gateway
upstream:
type: roundrobin
nodes:
- host: httpbin.org
port: 80
weight: 1
```
Synchronize the configuration to the gateway:
```
adc sync -f adc.yaml
```
* Gateway API
* APISIX CRD
elasticsearch-logger-ic.yaml
```
apiVersion: v1
kind: Service
metadata:
namespace: aic
name: httpbin-external-domain
spec:
type: ExternalName
externalName: httpbin.org
---
apiVersion: apisix.apache.org/v1alpha1
kind: PluginConfig
metadata:
namespace: aic
name: elasticsearch-logger-plugin-config
spec:
plugins:
- name: elasticsearch-logger
config:
endpoint_addrs:
- "http://elasticsearch.aic.svc:9200"
field:
index: gateway
---
apiVersion: gateway.networking.k8s.io/v1
kind: HTTPRoute
metadata:
namespace: aic
name: elasticsearch-logger-route
spec:
parentRefs:
- name: apisix
rules:
- matches:
- path:
type: Exact
value: /anything
filters:
- type: ExtensionRef
extensionRef:
group: apisix.apache.org
kind: PluginConfig
name: elasticsearch-logger-plugin-config
backendRefs:
- name: httpbin-external-domain
port: 80
```
elasticsearch-logger-ic.yaml
```
apiVersion: apisix.apache.org/v2
kind: ApisixUpstream
metadata:
namespace: aic
name: httpbin-external-domain
spec:
ingressClassName: apisix
externalNodes:
- type: Domain
name: httpbin.org
---
apiVersion: apisix.apache.org/v2
kind: ApisixRoute
metadata:
namespace: aic
name: elasticsearch-logger-route
spec:
ingressClassName: apisix
http:
- name: elasticsearch-logger-route
match:
paths:
- /anything
methods:
- GET
upstreams:
- name: httpbin-external-domain
plugins:
- name: elasticsearch-logger
config:
endpoint_addrs:
- "http://elasticsearch.aic.svc:9200"
field:
index: gateway
```
Apply the configuration:
```
kubectl apply -f elasticsearch-logger-ic.yaml
```
❶ Configure the endpoint address to Elasticsearch.
❷ Configure the `index` field as `gateway`.
Send a request to the route to generate a log entry:
```
curl -i "http://127.0.0.1:9080/anything"
```
You should receive an `HTTP/1.1 200 OK` response.
Navigate to the Kibana dashboard on [localhost:5601](http://localhost:5601) and under **Discover** tab, create a new index pattern `gateway` to fetch the data from Elasticsearch. Once configured, navigate back to the **Discover** tab and you should see a log generated, similar to the following:
```
{
"_index": "gateway",
"_id": "CE-JL5QBOkdYRG7kEjTJ",
"_version": 1,
"_score": 1,
"_source": {
"request": {
"headers": {
"host": "127.0.0.1:9080",
"accept": "*/*",
"user-agent": "curl/8.6.0"
},
"size": 85,
"querystring": {},
"method": "GET",
"url": "http://127.0.0.1:9080/anything",
"uri": "/anything"
},
"response": {
"headers": {
"content-type": "application/json",
"access-control-allow-credentials": "true",
"server": "APISIX/3.13.0",
"content-length": "390",
"access-control-allow-origin": "*",
"connection": "close",
"date": "Mon, 13 Jan 2025 10:18:14 GMT"
},
"status": 200,
"size": 618
},
"route_id": "elasticsearch-logger-route",
"latency": 585.00003814697,
"apisix_latency": 18.000038146973,
"upstream_latency": 567,
"upstream": "50.19.58.113:80",
"server": {
"hostname": "0b9a772e68f8",
"version": "3.13.0"
},
"service_id": "",
"client_ip": "192.168.65.1"
},
"fields": {
...
}
}
```
### Customize Log Format With Plugin Metadata[](#customize-log-format-with-plugin-metadata "Direct link to Customize Log Format With Plugin Metadata")
The following example demonstrates how you can customize log format using [plugin metadata](https://docs.api7.ai/apisix/key-concepts/plugin-metadata.md) and [built-in variables](https://docs.api7.ai/apisix/reference/built-in-variables.md) to log specific headers from request and response.
In APISIX, [plugin metadata](https://docs.api7.ai/apisix/key-concepts/plugin-metadata.md) is used to configure the common metadata fields of all plugin instances of the same plugin. It is useful when a plugin is enabled across multiple resources and requires a universal update to their metadata fields.
First, create a route with `elasticsearch-logger` as follows:
```
curl "http://127.0.0.1:9180/apisix/admin/routes" -X PUT \
-H "X-API-KEY: ${ADMIN_API_KEY}" \
-d '{
"id": "elasticsearch-logger-route",
"uri": "/anything",
"plugins": {
"elasticsearch-logger": {
"endpoint_addrs": ["http://elasticsearch:9200"],
"field": {
"index": "gateway"
}
}
},
"upstream": {
"nodes": {
"httpbin.org:80": 1
},
"type": "roundrobin"
}
}'
```
Next, configure the plugin metadata for `elasticsearch-logger`:
* Admin API
* ADC
* Ingress Controller
```
curl "http://127.0.0.1:9180/apisix/admin/plugin_metadata/elasticsearch-logger" -X PUT \
-H "X-API-KEY: ${ADMIN_API_KEY}" \
-d '{
"log_format": {
"host": "$host",
"@timestamp": "$time_iso8601",
"client_ip": "$remote_addr",
"env": "$http_env",
"resp_content_type": "$sent_http_Content_Type"
}
}'
```
adc.yaml
```
plugin_metadata:
- name: elasticsearch-logger
log_format:
host: "$host"
"@timestamp": "$time_iso8601"
client_ip: "$remote_addr"
env: "$http_env"
resp_content_type: "$sent_http_Content_Type"
```
Synchronize the configuration to the gateway:
```
adc sync -f adc.yaml
```
elasticsearch-logger-metadata.yaml
```
apiVersion: apisix.apache.org/v1alpha1
kind: GatewayProxy
metadata:
namespace: aic
name: apisix-config
spec:
provider:
type: ControlPlane
controlPlane:
service:
name: apisix-admin
port: 9180
auth:
type: AdminKey
adminKey:
value: edd1c9f034335f136f87ad84b625c8f1
pluginMetadata:
elasticsearch-logger:
log_format:
host: "$host"
"@timestamp": "$time_iso8601"
client_ip: "$remote_addr"
env: "$http_env"
resp_content_type: "$sent_http_Content_Type"
```
Apply the configuration:
```
kubectl apply -f elasticsearch-logger-metadata.yaml
```
❶ log the custom request header `env`.
❷ log the response header `Content-Type`.
Send a request to the route with the `env` header:
```
curl -i "http://127.0.0.1:9080/anything" -H "env: dev"
```
You should receive an `HTTP/1.1 200 OK` response.
Navigate to the Kibana dashboard on [localhost:5601](http://localhost:5601) and under **Discover** tab, create a new index pattern `gateway` to fetch the data from Elasticsearch, if you have not done so already. Once configured, navigate back to the **Discover** tab and you should see a log generated, similar to the following:
```
{
"_index": "gateway",
"_id": "Ck-WL5QBOkdYRG7kODS0",
"_version": 1,
"_score": 1,
"_source": {
"client_ip": "192.168.65.1",
"route_id": "elasticsearch-logger-route",
"@timestamp": "2025-01-06T10:32:36+00:00",
"host": "127.0.0.1",
"resp_content_type": "application/json"
},
"fields": {
...
}
}
```
### Log Request Bodies Conditionally[](#log-request-bodies-conditionally "Direct link to Log Request Bodies Conditionally")
The following example demonstrates how you can conditionally log request body.
Create a route with `elasticsearch-logger` as follows:
* Admin API
* ADC
* Ingress Controller
```
curl "http://127.0.0.1:9180/apisix/admin/routes" -X PUT \
-H "X-API-KEY: ${ADMIN_API_KEY}" \
-d '{
"plugins": {
"elasticsearch-logger": {
"endpoint_addrs": ["http://elasticsearch:9200"],
"field": {
"index": "gateway"
},
"include_req_body": true,
"include_req_body_expr": [["arg_log_body", "==", "yes"]]
}
},
"upstream": {
"nodes": {
"httpbin.org:80": 1
},
"type": "roundrobin"
},
"uri": "/anything",
"id": "elasticsearch-logger-route"
}'
```
adc.yaml
```
services:
- name: httpbin
routes:
- uris:
- /anything
name: elasticsearch-logger-route
plugins:
elasticsearch-logger:
endpoint_addrs:
- "http://elasticsearch:9200"
field:
index: gateway
include_req_body: true
include_req_body_expr:
- - arg_log_body
- "=="
- "yes"
upstream:
type: roundrobin
nodes:
- host: httpbin.org
port: 80
weight: 1
```
Synchronize the configuration to the gateway:
```
adc sync -f adc.yaml
```
* Gateway API
* APISIX CRD
elasticsearch-logger-ic.yaml
```
apiVersion: v1
kind: Service
metadata:
namespace: aic
name: httpbin-external-domain
spec:
type: ExternalName
externalName: httpbin.org
---
apiVersion: apisix.apache.org/v1alpha1
kind: PluginConfig
metadata:
namespace: aic
name: elasticsearch-logger-plugin-config
spec:
plugins:
- name: elasticsearch-logger
config:
endpoint_addrs:
- "http://elasticsearch.aic.svc:9200"
field:
index: gateway
include_req_body: true
include_req_body_expr:
- - arg_log_body
- "=="
- "yes"
---
apiVersion: gateway.networking.k8s.io/v1
kind: HTTPRoute
metadata:
namespace: aic
name: elasticsearch-logger-route
spec:
parentRefs:
- name: apisix
rules:
- matches:
- path:
type: Exact
value: /anything
filters:
- type: ExtensionRef
extensionRef:
group: apisix.apache.org
kind: PluginConfig
name: elasticsearch-logger-plugin-config
backendRefs:
- name: httpbin-external-domain
port: 80
```
elasticsearch-logger-ic.yaml
```
apiVersion: apisix.apache.org/v2
kind: ApisixUpstream
metadata:
namespace: aic
name: httpbin-external-domain
spec:
ingressClassName: apisix
externalNodes:
- type: Domain
name: httpbin.org
---
apiVersion: apisix.apache.org/v2
kind: ApisixRoute
metadata:
namespace: aic
name: elasticsearch-logger-route
spec:
ingressClassName: apisix
http:
- name: elasticsearch-logger-route
match:
paths:
- /anything
methods:
- GET
upstreams:
- name: httpbin-external-domain
plugins:
- name: elasticsearch-logger
config:
endpoint_addrs:
- "http://elasticsearch.aic.svc:9200"
field:
index: gateway
include_req_body: true
include_req_body_expr:
- - arg_log_body
- "=="
- "yes"
```
Apply the configuration:
```
kubectl apply -f elasticsearch-logger-ic.yaml
```
❶ `include_req_body`: set to true to include request body.
❷ `include_req_body_expr`: only include request body if the URL query string `log_body` is `true`.
Send a request to the route with an URL query string satisfying the condition:
```
curl -i "http://127.0.0.1:9080/anything?log_body=yes" -X POST -d '{"env": "dev"}'
```
You should receive an `HTTP/1.1 200 OK` response.
Navigate to the Kibana dashboard on [localhost:5601](http://localhost:5601) and under **Discover** tab, create a new index pattern `gateway` to fetch the data from Elasticsearch, if you have not done so already. Once configured, navigate back to the **Discover** tab and you should see a log generated, similar to the following:
```
{
"_index": "gateway",
"_id": "Dk-cL5QBOkdYRG7k7DSW",
"_version": 1,
"_score": 1,
"_source": {
"request": {
"headers": {
"user-agent": "curl/8.6.0",
"accept": "*/*",
"content-length": "14",
"host": "127.0.0.1:9080",
"content-type": "application/x-www-form-urlencoded"
},
"size": 182,
"querystring": {
"log_body": "yes"
},
"body": "{\"env\": \"dev\"}",
"method": "POST",
"url": "http://127.0.0.1:9080/anything?log_body=yes",
"uri": "/anything?log_body=yes"
},
"start_time": 1735965595203,
"response": {
"headers": {
"content-type": "application/json",
"server": "APISIX/3.13.0",
"access-control-allow-credentials": "true",
"content-length": "548",
"access-control-allow-origin": "*",
"connection": "close",
"date": "Mon, 13 Jan 2025 11:02:32 GMT"
},
"status": 200,
"size": 776
},
"route_id": "elasticsearch-logger-route",
"latency": 703.9999961853,
"apisix_latency": 34.999996185303,
"upstream_latency": 669,
"upstream": "34.197.122.172:80",
"server": {
"hostname": "0b9a772e68f8",
"version": "3.13.0"
},
"service_id": "",
"client_ip": "192.168.65.1"
},
"fields": {
...
}
}
```
Send a request to the route without any URL query string:
```
curl -i "http://127.0.0.1:9080/anything" -X POST -d '{"env": "dev"}'
```
Navigate to the Kibana dashboard **Discover** tab and you should see a log generated, but without the request body:
```
{
"_index": "gateway",
"_id": "EU-eL5QBOkdYRG7kUDST",
"_version": 1,
"_score": 1,
"_source": {
"request": {
"headers": {
"content-type": "application/x-www-form-urlencoded",
"accept": "*/*",
"content-length": "14",
"host": "127.0.0.1:9080",
"user-agent": "curl/8.6.0"
},
"size": 169,
"querystring": {},
"method": "POST",
"url": "http://127.0.0.1:9080/anything",
"uri": "/anything"
},
"start_time": 1735965686363,
"response": {
"headers": {
"content-type": "application/json",
"access-control-allow-credentials": "true",
"server": "APISIX/3.13.0",
"content-length": "510",
"access-control-allow-origin": "*",
"connection": "close",
"date": "Mon, 13 Jan 2025 11:15:54 GMT"
},
"status": 200,
"size": 738
},
"route_id": "elasticsearch-logger-route",
"latency": 680.99999427795,
"apisix_latency": 4.9999942779541,
"upstream_latency": 676,
"upstream": "34.197.122.172:80",
"server": {
"hostname": "0b9a772e68f8",
"version": "3.13.0"
},
"service_id": "",
"client_ip": "192.168.65.1"
},
"fields": {
...
}
}
```
info
If you have customized the `log_format` in addition to setting `include_req_body` or `include_resp_body` to `true`, the plugin would not include the bodies in the logs.
As a workaround, you may be able to use the NGINX variable `$request_body` in the log format, such as:
```
{
"elasticsearch-logger": {
...,
"log_format": {"body": "$request_body"}
}
}
```
### Include Request Date in Elasticsearch Index[](#include-request-date-in-elasticsearch-index "Direct link to Include Request Date in Elasticsearch Index")
The following example demonstrates how you can configure the `elasticsearch-logger` plugin to include the request date in Elasticsearch index.
Create a route with `elasticsearch-logger` as follows:
* Admin API
* ADC
* Ingress Controller
```
curl "http://127.0.0.1:9180/apisix/admin/routes" -X PUT \
-H "X-API-KEY: ${ADMIN_API_KEY}" \
-d '{
"id": "elasticsearch-logger-route",
"uri": "/anything",
"plugins": {
"elasticsearch-logger": {
"endpoint_addrs": ["http://elasticsearch:9200"],
"field": {
"index": "api7-{%Y.%m.%d}"
}
}
},
"upstream": {
"nodes": {
"httpbin.org:80": 1
},
"type": "roundrobin"
}
}'
```
adc.yaml
```
services:
- name: httpbin
routes:
- uris:
- /anything
name: elasticsearch-logger-route
plugins:
elasticsearch-logger:
endpoint_addrs:
- "http://elasticsearch:9200"
field:
index: "api7-{%Y.%m.%d}"
upstream:
type: roundrobin
nodes:
- host: httpbin.org
port: 80
weight: 1
```
Synchronize the configuration to the gateway:
```
adc sync -f adc.yaml
```
* Gateway API
* APISIX CRD
elasticsearch-logger-ic.yaml
```
apiVersion: v1
kind: Service
metadata:
namespace: aic
name: httpbin-external-domain
spec:
type: ExternalName
externalName: httpbin.org
---
apiVersion: apisix.apache.org/v1alpha1
kind: PluginConfig
metadata:
namespace: aic
name: elasticsearch-logger-plugin-config
spec:
plugins:
- name: elasticsearch-logger
config:
endpoint_addrs:
- "http://elasticsearch.aic.svc:9200"
field:
index: "api7-{%Y.%m.%d}"
---
apiVersion: gateway.networking.k8s.io/v1
kind: HTTPRoute
metadata:
namespace: aic
name: elasticsearch-logger-route
spec:
parentRefs:
- name: apisix
rules:
- matches:
- path:
type: Exact
value: /anything
filters:
- type: ExtensionRef
extensionRef:
group: apisix.apache.org
kind: PluginConfig
name: elasticsearch-logger-plugin-config
backendRefs:
- name: httpbin-external-domain
port: 80
```
elasticsearch-logger-ic.yaml
```
apiVersion: apisix.apache.org/v2
kind: ApisixUpstream
metadata:
namespace: aic
name: httpbin-external-domain
spec:
ingressClassName: apisix
externalNodes:
- type: Domain
name: httpbin.org
---
apiVersion: apisix.apache.org/v2
kind: ApisixRoute
metadata:
namespace: aic
name: elasticsearch-logger-route
spec:
ingressClassName: apisix
http:
- name: elasticsearch-logger-route
match:
paths:
- /anything
methods:
- GET
upstreams:
- name: httpbin-external-domain
plugins:
- name: elasticsearch-logger
config:
endpoint_addrs:
- "http://elasticsearch.aic.svc:9200"
field:
index: "api7-{%Y.%m.%d}"
```
Apply the configuration:
```
kubectl apply -f elasticsearch-logger-ic.yaml
```
❶ Configure the endpoint address to Elasticsearch.
❷ Configure the `index` field to use the current year, month, and date.
Send a request to the route to generate a log entry:
```
curl -i "http://127.0.0.1:9080/anything"
```
You should receive an `HTTP/1.1 200 OK` response.
Navigate to the Kibana dashboard on [localhost:5601](http://localhost:5601) and under **Discover** tab, create a new index pattern `api7*` to fetch the data from Elasticsearch. Once configured, navigate back to the **Discover** tab and you should see a log generated, similar to the following:
```
{
"_index": "api7-2025.3.10",
"_id": "CE-KL5QB0kdYRG7dEiTJ",
"_version": 1,
"_score": 1,
"_source": {
"request": {
...
},
"response": {
...
},
"status": 200,
"size": 618
},
...
}
```
---
## Parameters[](#parameters "Direct link to Parameters")
See plugin [common configurations](https://docs.api7.ai/apisix/reference/plugin-common-configurations.md) for configuration options available to all plugins.
* endpoint\_addr
string
***
Deprecated. Use `endpoint_addrs` instead. Elasticsearch API endpoint address. Configure either `endpoint_addr` or `endpoint_addrs`.
* endpoint\_addrs
array\[string]
***
Elasticsearch API endpoint addresses. If multiple endpoints are configured, one is selected randomly for each write. Configure either `endpoint_addrs` or the deprecated `endpoint_addr`.
* field
object
required
***
Elasticsearch field configurations.
* index
string
required
***
Elasticsearch [`_index`](https://www.elastic.co/guide/en/elasticsearch/reference/current/mapping-index-field.html#mapping-index-field) field.
In API7 Enterprise from version 3.8.0 and APISIX from version 3.17.0, `index` supports the configuration of [built-in variables](https://docs.api7.ai/apisix/reference/built-in-variables.md) and a [lua time format](https://www.lua.org/pil/22.1.html) in curly brackets to include the current date, such as `service-$host-{%Y-%m-%d}`.
* log\_format
object
***
Custom log format using key-value pairs in JSON format. Values can reference [built-in variables](https://docs.api7.ai/apisix/reference/built-in-variables.md).
In APISIX from 3.15.0, log format nested structures are supported up to five levels deep. In API7 Enterprise, only flat key-value structures are supported; nested structures are not yet supported.
You can also configure log format on a global scale using the [plugin metadata](https://docs.api7.ai/apisix/key-concepts/plugin-metadata.md), which configures the log format for all `elasticsearch-logger` plugin instances. If the log format configured on the individual plugin instance differs from the log format configured on plugin metadata, the log format configured on the individual plugin instance takes precedence. See the [example](https://docs.api7.ai/hub/elasticsearch-logger.md#log-request-and-response-headers-with-plugin-metadata) for more details.
* log\_format\_extra
object
***
Additional fields to add to the default log entry, using key-value pairs in JSON format. Values can reference [built-in variables](https://docs.api7.ai/apisix/reference/built-in-variables.md). A configured field does not overwrite an existing default field. A plugin instance takes precedence over plugin metadata; setting an empty object on the instance disables the metadata value. When `log_format` is configured, `log_format_extra` is ignored. Introduced in API7 Enterprise 3.9.15 and 3.10.2, and APISIX 3.18.0.
* auth
object
***
Elasticsearch user authentication configurations.
* username
string
***
Elasticsearch authentication username.
* password
string
***
Elasticsearch authentication password. The value is encrypted before being stored.
* headers
object
***
Custom HTTP request headers to include in requests sent to Elasticsearch, as key-value pairs. They can complement or replace `auth` for authentication and other purposes. Introduced in API7 Enterprise 3.9.16 and 3.10.2, and APISIX 3.16.0. Header-value encryption was introduced in API7 Enterprise 3.9.16 and 3.10.2, and APISIX 3.18.0. The values are [encrypted before storage](https://docs.api7.ai/apisix/production/security/data-encryption-with-keyring.md) when data encryption is enabled. Authorized Admin API `GET` requests return the complete decrypted header object; encryption at rest does not redact header names or values from API responses.
* ssl\_verify
boolean
default: `true`
***
If true, perform SSL verification.
* timeout
integer
default: `10`
***
Elasticsearch send data timeout in seconds.
* include\_req\_body
boolean
default: `false`
***
If true, include the request body in the log. Note that if the request body is too big to be kept in the memory, it can not be logged due to NGINX's limitations.
* include\_req\_body\_expr
array\[array]
***
An array of one or more conditions in the form of [APISIX expressions](https://docs.api7.ai/apisix/reference/apisix-expressions.md). Used when the `include_req_body` is true. Request body would only be logged when the expressions configured here evaluate to true.
* include\_resp\_body
boolean
default: `false`
***
If true, include the response body in the log.
* include\_resp\_body\_expr
array\[array]
***
An array of one or more conditions in the form of [APISIX expressions](https://docs.api7.ai/apisix/reference/apisix-expressions.md). Used when the `include_resp_body` is true. Response body would only be logged when the expressions configured here evaluate to true.
* max\_req\_body\_bytes
integer
default: `524288`
vaild vaule:
greater than or equal to 1
***
Maximum request body size in bytes to include in the log. If the request body exceeds this value, it will be truncated. Available in APISIX from 3.16.0.
* max\_resp\_body\_bytes
integer
default: `524288`
vaild vaule:
greater than or equal to 1
***
Maximum response body size in bytes to include in the log. If the response body exceeds this value, it will be truncated. Available in APISIX from 3.16.0.
* name
string
default: `elasticsearch-logger`
***
Unique identifier of the plugin for the batch processor. If you use [Prometheus](https://docs.api7.ai/hub/prometheus.md) to monitor APISIX metrics, the name is exported in `apisix_batch_process_entries`.
* batch\_max\_size
integer
default: `1000`
vaild vaule:
greater than 0
***
Number of log entries allowed in one batch. Once reached, the batch is sent to Elasticsearch. Setting this parameter to 1 enables immediate processing.
* inactive\_timeout
integer
default: `5`
vaild vaule:
greater than 0
***
Maximum time in seconds to wait for new logs before sending the batch. The value should be smaller than `buffer_duration`.
* buffer\_duration
integer
default: `60`
vaild vaule:
greater than 0
***
Maximum time in seconds from the earliest entry before sending the batch.
* retry\_delay
integer
default: `1`
vaild vaule:
greater than or equal to 0
***
Time in seconds to wait before retrying a failed batch.
* max\_retry\_count
integer
default: `0`
vaild vaule:
greater than or equal to 0
***
Maximum number of unsuccessful retries before dropping the log entries.
## Plugin Metadata[](#plugin-metadata "Direct link to Plugin Metadata")
* log\_format
object
***
Custom log format using key-value pairs in JSON format. Values can reference [built-in variables](https://docs.api7.ai/apisix/reference/built-in-variables.md).
In APISIX from 3.15.0, log format nested structures are supported up to five levels deep. In API7 Enterprise, only flat key-value structures are supported; nested structures are not yet supported.
* log\_format\_extra
object
***
Additional fields to add to the default log entry, using key-value pairs in JSON format. Values can reference [built-in variables](https://docs.api7.ai/apisix/reference/built-in-variables.md). A configured field does not overwrite an existing default field. A plugin instance takes precedence over plugin metadata; setting an empty object on the instance disables the metadata value. When `log_format` is configured, `log_format_extra` is ignored. Introduced in API7 Enterprise 3.9.15 and 3.10.2, and APISIX 3.18.0.
* max\_pending\_entries
integer
default: `` `8192` in APISIX 3.18.0 and in API7 Enterprise 3.9.19 and 3.10.6; none in API7 Enterprise 3.9.18 and 3.10.5 ``
vaild vaule:
greater than or equal to 1
***
Maximum number of entries waiting in the batch processor. New entries are discarded when the backlog reaches the limit.
Introduced in API7 Enterprise 3.8.17 and APISIX 3.15.0.
The default changed to `8192` in APISIX 3.18.0 and in API7 Enterprise 3.9.19 on the 3.9 line and 3.10.6 on the 3.10 line. In API7 Enterprise 3.9.18 and 3.10.5, and in earlier APISIX versions, omitting the parameter leaves the backlog unlimited.
See [Batch Processor](https://docs.api7.ai/apisix/reference/batch-processor.md#configure-the-pending-entry-limit) for sizing and verification guidance.
---
# error-log-collect [Enterprise](https://api7.ai/enterprise)
The `error-log-collect` plugin captures the error logs that the gateway produces while processing matched requests and writes them to the gateway error log (`error.log`). The captured entries include lower-severity logs, such as `INFO` and `DEBUG`, that the configured error log level would normally discard. This lets you collect detailed, request-scoped diagnostics for a targeted subset of traffic, without lowering the global error log level for all requests.
Each captured entry is written at `error` level, prefixed with `[error-log-collect]`, and tagged with the request ID, so you can filter and correlate the entries in the gateway log. Use `vars` to restrict collection to requests that match a condition, and `sample_ratio` to capture only a fraction of requests on high-traffic routes.
This plugin is configured on routes or services, and is available in API7 Enterprise from version 3.10.0.
## Examples[](#examples "Direct link to Examples")
The examples below demonstrate how you can configure `error-log-collect` in different scenarios.
### Collect Error Logs on a Route[](#collect-error-logs-on-a-route "Direct link to Collect Error Logs on a Route")
The following example demonstrates how to enable the plugin on a route and view the collected logs.
Create a route to httpbin.org with the `error-log-collect` plugin enabled:
* Admin API
* ADC
* Ingress Controller
```
curl "http://127.0.0.1:9180/apisix/admin/routes" -X PUT \
-H "X-API-KEY: ${ADMIN_API_KEY}" \
-d '{
"id": "error-log-collect-route",
"uri": "/anything",
"plugins": {
"error-log-collect": {}
},
"upstream": {
"type": "roundrobin",
"nodes": {
"httpbin.org:80": 1
}
}
}'
```
adc.yaml
```
services:
- name: error-log-collect-service
routes:
- name: error-log-collect-route
uris:
- /anything
plugins:
error-log-collect: {}
upstream:
type: roundrobin
nodes:
- host: httpbin.org
port: 80
weight: 1
```
Synchronize the configuration to the gateway:
```
adc sync -f adc.yaml
```
error-log-collect.yaml
```
apiVersion: apisix.apache.org/v2
kind: ApisixUpstream
metadata:
namespace: aic
name: httpbin-external-domain
spec:
ingressClassName: apisix
externalNodes:
- type: Domain
name: httpbin.org
---
apiVersion: apisix.apache.org/v2
kind: ApisixRoute
metadata:
namespace: aic
name: error-log-collect-route
spec:
ingressClassName: apisix
http:
- name: anything
match:
paths:
- /anything
upstreams:
- name: httpbin-external-domain
plugins:
- name: error-log-collect
config: {}
```
Apply the configuration to your cluster:
```
kubectl apply -f error-log-collect.yaml
```
Send a request to the route:
```
curl -i "http://127.0.0.1:9080/anything"
```
You should receive an `HTTP/1.1 200 OK` response.
In the gateway log, look for entries prefixed with `[error-log-collect]`, each tagged with the request ID. The plugin re-emits the internal logs generated while handling the request. These include `INFO`-level entries, such as DNS resolution and upstream selection, that the default `warn` log level would normally omit:
```
2026/06/26 09:21:31 [error] 47#47: 1750901491123#0 [error-log-collect] 2026-06-26 09:21:31 b9f8c1d2e3a4f5061728394a5b6c7d8e parse_domain():118: dns resolve httpbin.org, context: ngx.timer
```
note
The plugin buffers the captured logs in memory per worker process, up to `buffer_max_size` entries. It flushes them to `error.log` when a request matches `vars`, or on every request when `vars` is not set. The buffer is shared by all requests that a worker handles, so a flush can also surface buffered logs from other recent requests on the same worker. This helps capture the context leading up to a matched event.
### Collect Logs Only for Matching Requests[](#collect-logs-only-for-matching-requests "Direct link to Collect Logs Only for Matching Requests")
To collect logs only for requests that meet a condition, set `vars` to one or more [APISIX expressions](https://docs.api7.ai/apisix/reference/apisix-expressions.md). For example, the following configuration collects logs only when the request carries an `X-Debug: true` header:
```
{
"plugins": {
"error-log-collect": {
"vars": [
["http_x_debug", "==", "true"]
]
}
}
}
```
Requests that do not match the condition are not flushed to the error log on their own. On high-traffic routes, set `sample_ratio` below `1` to collect logs for a random sample of requests and keep the log volume manageable.
---
## Parameters[](#parameters "Direct link to Parameters")
See plugin [common configurations](https://docs.api7.ai/apisix/reference/plugin-common-configurations.md) for configuration options available to all plugins.
* vars
array\[array]
***
An array of one or more matching conditions in the form of [APISIX expressions](https://docs.api7.ai/apisix/reference/apisix-expressions.md). The buffered logs are flushed to the error log only when all expressions evaluate to true. When unset, the logs are collected for every request.
* sample\_ratio
number
default: `1`
vaild vaule:
between 0.00001 and 1 inclusive
***
Probability of collecting the logs for a request. The default value of 1 collects the logs for all requests. Set to a value below 1 to collect the logs for a random sample of requests.
* buffer\_max\_size
integer
default: `1000`
vaild vaule:
greater than or equal to 1
***
Maximum number of log entries held in the per-worker buffer. When the number of buffered logs exceeds this value, the oldest entries are overwritten.
---
# error-log-logger
The `error-log-logger` plugin pushes APISIX's error logs (`error.log`) to TCP, Apache SkyWalking, Apache Kafka, or ClickHouse servers, in batches. You can specify the severity level of which the plugin should send the corresponding logs.
The plugin is disabled by default. Once enabled, it will automatically start pushing error logs to remote servers. You should configure remote server details in [plugin metadata](https://docs.api7.ai/apisix/key-concepts/plugin-metadata.md) only, instead of on other resources, such as routes.
## Examples[](#examples "Direct link to Examples")
The examples below demonstrate how you can configure `error-log-logger` plugin for different scenarios.
The APISIX and API7 Gateway runtime configurations do not load `error-log-logger` by default. Enable it in the gateway static configuration before configuring plugin metadata.
* Host or Docker
* Kubernetes (Helm)
Keep the existing plugin list in `config.yaml` and add `error-log-logger`:
config.yaml
```
plugins:
# Keep the complete plugin list used by your gateway.
- error-log-logger
```
Reload the gateway for changes to take effect.
For the APISIX Helm chart, `apisix.plugins` replaces the loaded plugin list. Start from the complete plugin list used by your gateway and add `error-log-logger`:
values.yaml
```
apisix:
plugins:
# Keep the complete plugin list used by your gateway.
- error-log-logger
```
For API7 Gateway Helm deployments, continue with the plugin metadata configuration after confirming that `error-log-logger` is loaded in the gateway plugin list. The current chart does not expose a dedicated `values.yaml` field for adding `error-log-logger` to the loaded plugin list. Check the [API7 Gateway Helm chart reference](https://docs.api7.ai/api7-gateway/reference/helm-chart.md) for the latest supported plugin-list configuration.
Then apply the values file with the chart used for this gateway release:
```
helm upgrade -n -f values.yaml
```
### Send Logs to TCP Server[](#send-logs-to-tcp-server "Direct link to Send Logs to TCP Server")
The following example demonstrates how you can configure the `error-log-logger` plugin to send error logs to a TCP server.
Start a TCP server listening on port `19000`:
* Docker
* Kubernetes
```
nc -l 19000
```
Create a Kubernetes manifest for a TCP server deployment using `socat`:
tcp-server.yaml
```
apiVersion: apps/v1
kind: Deployment
metadata:
namespace: aic
name: tcp-server
spec:
replicas: 1
selector:
matchLabels:
app: tcp-server
template:
metadata:
labels:
app: tcp-server
spec:
containers:
- name: tcp-server
image: alpine/socat
args: ["TCP-LISTEN:19000,fork,reuseaddr", "STDOUT"]
ports:
- containerPort: 19000
---
apiVersion: v1
kind: Service
metadata:
namespace: aic
name: tcp-server
spec:
selector:
app: tcp-server
ports:
- name: tcp
port: 19000
targetPort: 19000
type: ClusterIP
```
Apply the manifests:
```
kubectl apply -f tcp-server.yaml
```
Configure the plugin metadata for `error-log-logger`:
* Admin API
* ADC
* Ingress Controller
```
curl "http://127.0.0.1:9180/apisix/admin/plugin_metadata/error-log-logger" -X PUT \
-H "X-API-KEY: ${ADMIN_API_KEY}" \
-d '{
"tcp": {
"host": "192.168.2.103",
"port": 19000
},
"level": "INFO"
}'
```
adc.yaml
```
plugin_metadata:
- name: error-log-logger
tcp:
host: "192.168.2.103"
port: 19000
level: INFO
```
Synchronize the configuration to the gateway:
```
adc sync -f adc.yaml
```
error-log-logger-metadata.yaml
```
apiVersion: apisix.apache.org/v1alpha1
kind: GatewayProxy
metadata:
namespace: aic
name: apisix-config
spec:
provider:
type: ControlPlane
controlPlane:
service:
name: apisix-admin
port: 9180
auth:
type: AdminKey
adminKey:
value: edd1c9f034335f136f87ad84b625c8f1
pluginMetadata:
error-log-logger:
tcp:
host: "tcp-server.aic.svc"
port: 19000
level: INFO
```
Apply the configuration:
```
kubectl apply -f error-log-logger-metadata.yaml
```
❶ Configure the host to the TCP server address.
❷ Configure the port to your TCP server listening port.
❸ Configure the severity level to `INFO` so most logs would be sent, for easier verification.
To verify, you can manually generate a log at `warn` level by [reloading APISIX](https://docs.api7.ai/apisix/reference/apisix-cli.md#apisix-reload).
If you are using Docker, in the terminal session where netcat is listening, you should see a log entry. If you are using Kubernetes, check the tcp-server pod logs:
```
kubectl logs -n aic -l app=tcp-server
```
You should see a log entry similar to the following:
```
2025/01/26 20:15:29 [warn] 211#211: *35552 [lua] plugin.lua:205: load(): new plugins: {"cas-auth":true,"real-ip":true,"ai":true,"client-control":true,"proxy-control":true,"request-id":true,"zipkin":true,"ext-plugin-pre-req":true,"fault-injection":true,"mocking":true,"serverless-pre-function":true,"cors":true,"ip-restriction":true,"ua-restriction":true,"referer-restriction":true,"csrf":true,"uri-blocker":true,"request-validation":true,"chaitin-waf":true,"multi-auth":true,"openid-connect":true,"authz-casbin":true,"authz-casdoor":true,"wolf-rbac":true,"ldap-auth":true,"hmac-auth":true,"basic-auth":true,"jwt-auth":true,"redirect":true,"key-auth":true,"consumer-restriction":true,"attach-consumer-label":true,"authz-keycloak":true,"proxy-cache":true,"body-transformer":true,"ai-prompt-template":true,"ai-prompt-decorator":true,"proxy-mirror":true,"proxy-rewrite":true,"workflow":true,"api-breaker":true,"ai-proxy":true,"limit-conn":true,"limit-count":true,"limit-req":true,"gzip":true,"server-info":true,"traffic-split":true,"response-rewrite":true,"degraphql":true,"kafka-proxy":true,"grpc-transcode":true,"grpc-web":true,"http-dubbo":true,"public-api":true,"prometheus":true,"datadog":true,"loki-logger":true,"elasticsearch-logger":true,"echo":true,"loggly":true,"http-logger":true,"splunk-hec-logging":true,"skywalking-logger":true,"google-cloud-logging":true,"sls-logger":true,"tcp-logger":true,"kafka-logger":true,"rocketmq-logger":true,"syslog":true,"udp-logger":true,"file-logger":true,"clickhouse-logger":true,"tencent-cloud-cls":true,"inspect":true,"example-plugin":true,"aws-lambda":true,"azure-functions":true,"openwhisk":true,"openfunction":true,"error-log-logger":true,"ext-plugin-post-req":true,"ext-plugin-post-resp":true,"serverless-post-function":true,"opa":true,"forward-auth":true,"jwe-decrypt":true}, context: init_worker_by_lua*
```
### Send Logs to SkyWalking[](#send-logs-to-skywalking "Direct link to Send Logs to SkyWalking")
The following example demonstrates how you can configure the `error-log-logger` plugin to send error logs to SkyWalking.
Set up SkyWalking OAP server:
* Docker
* Kubernetes
Start a SkyWalking storage, OAP and Booster UI with Docker Compose, following [Skywalking's documentation](https://skywalking.apache.org/docs/main/next/en/setup/backend/backend-docker/). Once set up, the OAP server should be listening on `12800` and you should be able to access the UI at .
Create a Kubernetes manifest for the SkyWalking OAP server:
skywalking-oap.yaml
```
apiVersion: apps/v1
kind: Deployment
metadata:
namespace: aic
name: skywalking-oap
spec:
replicas: 1
selector:
matchLabels:
app: skywalking-oap
template:
metadata:
labels:
app: skywalking-oap
spec:
containers:
- name: skywalking-oap
image: apache/skywalking-oap-server:10.1.0
env:
- name: SW_STORAGE
value: H2
ports:
- containerPort: 11800
- containerPort: 12800
---
apiVersion: v1
kind: Service
metadata:
namespace: aic
name: skywalking-oap
spec:
selector:
app: skywalking-oap
ports:
- name: grpc
port: 11800
targetPort: 11800
- name: http
port: 12800
targetPort: 12800
type: ClusterIP
```
Apply the manifests:
```
kubectl apply -f skywalking-oap.yaml
```
Wait for the OAP server to become ready:
```
kubectl wait --for=condition=available --timeout=120s -n aic deployment/skywalking-oap
```
Configure the plugin metadata for `error-log-logger`:
* Admin API
* ADC
* Ingress Controller
```
curl "http://127.0.0.1:9180/apisix/admin/plugin_metadata/error-log-logger" -X PUT \
-H "X-API-KEY: ${ADMIN_API_KEY}" \
-d '{
"skywalking": {
"endpoint_addr": "http://192.168.2.103:12800/v3/logs"
},
"level": "INFO"
}'
```
adc.yaml
```
plugin_metadata:
- name: error-log-logger
skywalking:
endpoint_addr: "http://192.168.2.103:12800/v3/logs"
level: INFO
```
Synchronize the configuration to the gateway:
```
adc sync -f adc.yaml
```
error-log-logger-metadata.yaml
```
apiVersion: apisix.apache.org/v1alpha1
kind: GatewayProxy
metadata:
namespace: aic
name: apisix-config
spec:
provider:
type: ControlPlane
controlPlane:
service:
name: apisix-admin
port: 9180
auth:
type: AdminKey
adminKey:
value: edd1c9f034335f136f87ad84b625c8f1
pluginMetadata:
error-log-logger:
skywalking:
endpoint_addr: "http://skywalking-oap.aic.svc:12800/v3/logs"
level: INFO
```
Apply the configuration:
```
kubectl apply -f error-log-logger-metadata.yaml
```
❶ Configure the endpoint address to the SkyWalking server.
❷ Configure the severity level to `INFO` so most logs would be sent, for easier verification.
To verify, you can manually generate a log at `warn` level by [reloading APISIX](https://docs.api7.ai/apisix/reference/apisix-cli.md#apisix-reload).
In [Skywalking UI](http://localhost:8080), navigate to **General Service** > **Services**. You should see a service called `APISIX` with the following log entry:
```
2025/01/27 07:40:06 [warn] 211#211: *35552 [lua] plugin.lua:205: load(): new plugins: {"cas-auth":true,"real-ip":true,"ai":true,"client-control":true,"proxy-control":true,"request-id":true,"zipkin":true,"ext-plugin-pre-req":true,"fault-injection":true,"mocking":true,"serverless-pre-function":true,"cors":true,"ip-restriction":true,"ua-restriction":true,"referer-restriction":true,"csrf":true,"uri-blocker":true,"request-validation":true,"chaitin-waf":true,"multi-auth":true,"openid-connect":true,"authz-casbin":true,"authz-casdoor":true,"wolf-rbac":true,"ldap-auth":true,"hmac-auth":true,"basic-auth":true,"jwt-auth":true,"redirect":true,"key-auth":true,"consumer-restriction":true,"attach-consumer-label":true,"authz-keycloak":true,"proxy-cache":true,"body-transformer":true,"ai-prompt-template":true,"ai-prompt-decorator":true,"proxy-mirror":true,"proxy-rewrite":true,"workflow":true,"api-breaker":true,"ai-proxy":true,"limit-conn":true,"limit-count":true,"limit-req":true,"gzip":true,"server-info":true,"traffic-split":true,"response-rewrite":true,"degraphql":true,"kafka-proxy":true,"grpc-transcode":true,"grpc-web":true,"http-dubbo":true,"public-api":true,"prometheus":true,"datadog":true,"loki-logger":true,"elasticsearch-logger":true,"echo":true,"loggly":true,"http-logger":true,"splunk-hec-logging":true,"skywalking-logger":true,"google-cloud-logging":true,"sls-logger":true,"tcp-logger":true,"kafka-logger":true,"rocketmq-logger":true,"syslog":true,"udp-logger":true,"file-logger":true,"clickhouse-logger":true,"tencent-cloud-cls":true,"inspect":true,"example-plugin":true,"aws-lambda":true,"azure-functions":true,"openwhisk":true,"openfunction":true,"error-log-logger":true,"ext-plugin-post-req":true,"ext-plugin-post-resp":true,"serverless-post-function":true,"opa":true,"forward-auth":true,"jwe-decrypt":true}, context: init_worker_by_lua*
```
You should also observe logs at other severity levels, such as `error`, `emerg`, and `info`, when they are generated.
### Send Logs to Kafka over TLS[](#send-logs-to-kafka-over-tls "Direct link to Send Logs to Kafka over TLS")
The following example sends error-level gateway logs to a TLS-enabled Kafka broker. Complete the trusted-CA setup in [Send Logs to a TLS-Enabled Broker](https://docs.api7.ai/hub/kafka-logger.md#send-logs-to-a-tls-enabled-broker), then set the broker address and topic:
```
export KAFKA_TLS_HOST="kafka-tls"
export KAFKA_TLS_PORT="9093"
export KAFKA_ERROR_TOPIC="apisix-error-logs"
```
Create the dedicated error-log topic:
```
docker exec kafka-tls /opt/kafka/bin/kafka-topics.sh \
--bootstrap-server kafka-tls:9093 \
--command-config /etc/kafka/secrets/client.properties \
--create \
--if-not-exists \
--topic "${KAFKA_ERROR_TOPIC}" \
--partitions 1 \
--replication-factor 1
```
Configure the plugin metadata:
```
curl "http://127.0.0.1:9180/apisix/admin/plugin_metadata/error-log-logger" -X PUT \
-H "X-API-KEY: ${ADMIN_API_KEY}" \
--data-binary @- <\n \n 404\n \n \n \n 404 not found
\n \n
\n Gateway\n \n