Skip to main content

ai

An internal routing speed-up with no settings; added here it does nothing to requests.

Category AIAdd it to Route, Service, Consumer, Consumer group, Global rule, Plugin configEngine plugin aiPriority 22900

What it does​

ai names an internal speed-up of how the gateway matches requests to routes. It has no settings of its own, the console edits it in Raw JSON, and an entry on a route carries nothing but the settings every plugin shares.

Added to a route, it does nothing to requests. A client and the backend see the same answers with it and without it, so adding it is not a way to make a route faster.

When to use it​

  • You find ai on a route someone else configured and want to know what it changes for clients of the orders API, which is nothing.
  • The plugin list of your gateway shows ai beside the plugins you use, and you decide whether the orders API needs it.
  • A clean-up of routes, where removing an ai entry leaves every answer as it was.

Not for sending prompts to a model and its answer back — see ai-proxy (Proxies requests to an LLM provider with a unified API) or refusing prompts that match a pattern — see ai-prompt-guard (Allows or denies prompts that match configured patterns).

Set it up​

Add the plugin to a route, where it changes nothing​

The speed-up it stands for is switched on in the gateway's static configuration; an entry here is stored with its shared settings and does nothing to requests.

ai · as the console saves it
{}

Things to know​

  • The plugin is an internal routing speed-up with no settings, and an entry on a route does nothing to requests.
  • A key of its own, any key besides the shared settings, is refused when you save.
  • An unknown key under _meta is refused when you save as well.
  • AdviceLeave it off your routes, so that every entry a reader finds on a route is one that acts on requests.

Edited as Raw JSON​

This plugin works across the whole gateway once the gateway's configuration enables it; an entry on this object carries only the five shared settings and changes nothing.

Every plugin also has Enabled, Priority, Filter, Error response and Pre-function: see Plugin execution settings.

G8 dev · Apache APISIX® 3.19.0
Apache, Apache APISIX and APISIX are trademarks of The Apache Software Foundation.
Facts
Category
AI
Add it to
Route, Service, Consumer, Consumer group, Global rule, Plugin config
Engine plugin
ai
Priority
22900