a6-plugin-key-auth

Configure APISIX key-auth plugin via a6 CLI for API key authentication.

1|2|Updated Mar 6, 2026
One-click install
npx skills add https://github.com/api7/a6 --skill a6-plugin-key-auth-api7
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: a6-plugin-key-auth
Source: https://github.com/api7/a6/tree/main/skills/a6-plugin-key-auth
Command: npx skills add https://github.com/api7/a6 --skill a6-plugin-key-auth-api7

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Configures APISIX to enforce API key authentication via the key-auth plugin using the a6 CLI, enabling secure access control for routes and consumers.

Core Features & Use Cases

  • Enables API key authentication on routes with the key-auth plugin and binds credentials to consumers.
  • Supports API key lookups from header, query, or cookie to authenticate clients in typical deployment scenarios.
  • Includes operational patterns for hiding credentials in upstream requests and providing anonymous consumers when keys are absent.

Quick Start

Create a consumer, bind a key-auth credential to the consumer, and apply the key-auth plugin to a route to enable API key authentication.

Frequently Asked Questions about a6-plugin-key-auth

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I configure APISIX key-auth for API route protection?

Configure APISIX key-auth by using the a6 CLI to enable the key-auth plugin on specific routes and bind API key credentials to consumers. This enforces API key authentication for secure access control.

Can I retrieve API keys from headers, query parameters, and cookies in APISIX?

Yes, APISIX key-auth supports API key lookups from header, query, or cookie to authenticate clients. You can configure these lookup sources via the a6 CLI to match your typical deployment scenarios.

How do I bind API key credentials to consumers in APISIX?

Bind API key credentials to APISIX consumers by creating a consumer and attaching the key-auth credential using the a6 CLI. This ensures the key is validated against the consumer profile during route access.

Does APISIX key-auth support hiding credentials in upstream requests?

Yes, APISIX key-auth includes operational patterns for hiding credentials in upstream requests. This prevents sensitive API keys from being forwarded to backend services after client authentication.

What happens when an API key is absent on a key-auth protected route?

When an API key is absent on a key-auth protected route, APISIX can provide anonymous consumers. This operational pattern allows controlled access for unauthenticated requests without failing the request.

How do I apply the key-auth plugin to a route using the a6 CLI?

Apply the key-auth plugin to a route by executing a6 CLI commands for route management. This route-scoped plugin enablement ensures consistent API key authentication is enforced for that specific endpoint.