What you will have at the end
On the Sandbox Environment from Add your first Environment: an Upstream with one node, the orders service; a Route, orders-api, that serves /orders/* from it; a Consumer, mobile_app, with an API key; and two Plugins on the Route, key-auth and limit-count, so that a request without the key is refused with 401, a request with it is answered 200, and the sixth within a minute is refused with 429. The three answers are records in Traffic Explorer with gateway or the backend’s address in the Upstream node column, each save is an audit record with the before and the after, and the Raw JSON tab shows the Route as the engine stores it. The other articles of this knowledge base call this Route “the Route from the first article”.
Prerequisites
- The Environment from the previous article, with its engine and gateway address, and a log store connected under Observability as in Traffic Explorer: connect your log store; the previous article left the log store out, and the records below need it; the gateway here answers at
127.0.0.1:9381. - A backend the gateway can reach. The lab’s orders service,
orders-svc:8080, answersGET /orders/<id>with a JSON order. - A role that may manage Upstreams, Routes and Consumers. The screenshots below were taken as
nora.becker.
The Upstream
Open Upstreams in the Environment’s navigation and select New upstream. Name orders-backend. Under Targets, keep Nodes, a fixed list of hosts, ports and weights, and Add entry: Host orders-svc, Port 8080, Weight 1. The section’s own help says what the other two columns do: weight 0 keeps a node in the list without sending it traffic, and a lower priority is used only when every node of a higher one is down.

Select Create upstream. The Changes panel on the right had shown the object that reaches the engine: name, description and the nodes list. Everything else, balancing, health checks, timeouts, keeps the engine’s defaults, and the Upstream page says so, card by card.
The Route
Open Routes, New route. Name orders-api. Under Matching, Paths /orders/*, where the trailing * matches everything under the path, and tick GET and POST under Methods; left unticked, a Route matches any method.

Under Target, choose Upstream and pick orders-backend from the list. The other choices are what they say: nodes written on the Route itself and shared with nothing, a Service whose Upstream and Plugins the Route inherits, or no backend at all for a Route that serves its Plugins alone.

Select Create route. The Route page shows its address under Matching, http://127.0.0.1:9381/orders/, built from the Gateway URL of the Environment, and a request already works, because nothing guards it yet:
### GET /orders/ord-10421 right after the save, no Plugin on the Route
HTTP/1.1 200 OK
The Consumer and its key
Open Consumers, New consumer, Username mobile_app; the username is the identity of the Consumer and cannot change later. Create consumer, then the Credentials tab, New credential: Credential ID mobile-app-key, Plugin key-auth, and under it Key, the API key the client will send. The note under the field is worth a second look: a credential whose key is empty authenticates any request that sends the header with an empty value.

key-auth on the Route
Back on the Route, the Plugins tab, Add plugin, key-auth. Its five settings can all stay at their defaults: the key is read from the header the Header field shows in grey, apikey, or from the Query parameter when the header is absent; Hide credentials keeps the key from reaching the backend; Realm is sent back in WWW-Authenticate on a refusal; Anonymous consumer names a Consumer that a request without a credential passes as, and the note says why to leave it empty.

Select Add plugin.
limit-count on the Route
Add plugin again, limit-count. Under Basics, One limit for everything here: Count 5 and Time window 60 seconds, a small budget so the refusal is easy to reach by hand. Key type stays var and Key is consumer_name, so the engine counts under the name of the authenticated Consumer and every Consumer gets a window of its own. Under Behavior, Policy stays local, counted in the memory of each gateway node; the Redis policies share the count across nodes, and Rate limiting per Consumer sets one up. Rejected code 429. Show limit quota header on, so every answer says how much of the budget is left.

Select Add plugin. The Plugins tab now draws the request path: what runs, in which order, for a request to this Route.

What a client sees
### GET /orders/ord-10421 without a key
HTTP/1.1 401 Unauthorized
WWW-Authenticate: apikey realm="key"
{"message":"Missing API key in request"}
### the same request with the key
HTTP/1.1 200 OK
X-RateLimit-Limit: 5
X-RateLimit-Remaining: 4
X-RateLimit-Reset: 60
{"id":"ord-10421","customer":"cust-8831","status":"open","total":249.90,"currency":"EUR",…}
### four more with the key, status only
200 200 200 200
### the sixth within the minute
HTTP/1.1 429 Too Many Requests
X-RateLimit-Limit: 5
X-RateLimit-Remaining: 0
X-RateLimit-Reset: 59.79
### a wrong key
HTTP/1.1 401 Unauthorized
{"message":"Invalid API key in request"}
The three headers are the quota headers the switch turned on: the limit, what is left, and the seconds until the window resets.
What Traffic Explorer shows
Every request is a record. The refusals carry gateway in the Upstream node column, because the gateway answered them itself; the answered requests carry the backend’s address; and the requests that were authenticated carry the Consumer’s name beside the Route.

The Route’s Analytics tab counts the same requests by status class from Prometheus. Right after the first batch it read zero; a minute later came a second batch of twenty keyed requests, all of them refused with 429 because the budget was spent, and one more without a key, refused with 401. Then it reads this:

What the audit log keeps
Each save is a record in the Environment’s audit log: upstream.created, route.created, consumer.created, credential.created and two route.updated, one per Plugin. The last one shows the Route before and after, with the limit-count block added beside the key-auth block that was already there.

The same Route as the engine stores it
The Raw JSON tab shows the whole object the engine holds, validated against the gateway’s schema as you type, and it is the one place to read the Route without the forms: name, paths, methods, the two Plugin blocks and the Upstream’s id.

What to do next
- Let your colleagues in with their directory accounts and give them roles per Environment: Sign in with Active Directory and map its groups to G8 roles.
- Share the count across gateway nodes with Redis and read the 429s in Analytics: Rate limiting per Consumer.
- The Route and Plugin settings side by side are in the capabilities reference and on API Gateway.