Skip to content

Products, plans and consumers

How-to guideThe steps for one task.

A product is what you offer to the people who call your APIs: a set of APIs sold under one or more plans. A consumer (an application) subscribes to a product at a plan, and the gateway enforces that plan on every call the application makes to the product's APIs.

Offer chosen operations of an API

On the product's APIs tab, tick an API and choose Whole API or Chosen operations, then tick the operations to offer. A "lookup" product, for example, can offer only the lookup operations of a larger API, while a "full access" product offers all of it.

Once any product offers an API, whole or in part, an operation of it that no product offers is closed: every call gets 403 APX-PL-0015 naming the operation. The APIs tab warns before you save, listing the operations that would close. Offer them in another product, or switch the subscription off on an operation to make it public.

An application can hold only one subscription that covers a given operation, so its calls count against one plan. Products that offer different operations of one API can both be subscribed to; "lookup" and "full access" above cannot, because both offer the lookups.

In YAML:

products:
  - name: lookup
    apis: [aqdak]
    operations:
      aqdak: [get-cities, get-countries]
    plans:
      - name: basic
        quota: { limit: 10000, period: day }

Who can call what

Beside every API (the APIs list and the API's header) and every operation (the Operations tab), tags answer "who can call this?":

Tag Means
a product's name the product offers it; callers need a subscription (opens the product)
application names, or "N applications" the applications that may call it: active subscribers of its products, kept to the api-key allow list when there is one, or the allow list alone
Any API key any application with a valid key: no product or allow list limits who
Closed: in no product products offer the API but none offers this operation; every call is refused
Public no key, token or password is asked for

The tags describe the draft, as the console shows it; deploy to make it what the gateway does.

Plans

Each plan sets:

Setting Meaning
Rate limit Calls per second, minute or hour, counted per subscription across every API of the product
Quota Calls per day (resets at 00:00 UTC) or per month, durable across restarts; one count for every instance when redis.address is set
Approval Whether a new subscription waits for your approval on the Products page

A plan with subscribers cannot be removed; retire it to stop new subscriptions while existing ones keep working.

What the caller experiences

Situation Answer
No subscription to a product that offers the operation, or no product offers it 403 APX-PL-0015
Subscription pending approval, suspended or revoked 403 APX-PL-0016
Plan rate limit reached 429 APX-PL-0007 with Retry-After
Quota exhausted 429 APX-PL-0017 with X-Quota-Reset
Within limits 200 with RateLimit-*, X-Quota-Limit, X-Quota-Remaining, X-Quota-Reset

Calls must identify the application, so every API in a product needs the api-key policy (the console checks this at deploy time).

Working with consumers

  • Publish → Consumers → New application, then Issue key. The key is shown once; the gateway stores a hash. Keys can be rotated with an overlap window and revoked with immediate effect.
  • Allowed sources limit an application, or one key, to listed IP addresses and ranges (403 APX-PL-0023 otherwise). Behind a load balancer set trust_x_forwarded_for on the api-key policy.
  • Subscribe the application to a product at a plan from its page or from the product's Subscribers tab; approve, suspend, resume, revoke or change the plan there. Every change applies on the next request.
  • The application's Dashboard shows its traffic, errors by cause and quota used this period.

Shared limits and plan limits

The rate-limit policy on an API counts per consumer by default, so a modest value there caps every plan at once. With plans in place, keep the API-level limit high as an overall shield, or set its key to route for a total cap; the plans do the per-consumer work. The console shows a hint on the Develop tab when an API sold through a product carries such a limit.

A plan's limits cannot be changed by the API or an operation: they are the contract with the consumer, and a subscription binding below the product level is refused unless it only switches the policy off (enabled: false), which makes that operation public and unmetered. An operation may bind a tighter rate-limit of its own, which runs in addition.

Versions and products

A deprecated API version takes no new subscribers: subscriptions made after the deprecation cover the newer versions only (APX-PL-0025 for the old one), while earlier subscribers keep access until the version is retired. See Versions and lifecycle.