Policy Behavior Changes and Deprecations

One status code change and two deprecated options across the Monetization, API Key Authentication, and Smart Router policies. Deprecated options keep working, so no existing configuration breaks.

Monetization returns 401 for missing or invalid keys

Effective September 15, 2026.

The Monetization policy now separates authentication failures from access decisions:

  • 401 Unauthorized: the API key is missing, malformed, invalid, or expired. When authScheme is set, the response includes a WWW-Authenticate challenge for that scheme.
  • 403 Forbidden: the key is valid, but its subscription, payment status, or entitlements deny access.

Previously, both cases returned 403. If your clients or monitoring treat 403 as “bad key,” update them to expect 401.

API Key Authentication: use bucketId instead of bucketName

Effective August 4, 2026.

The bucketName option on the API Key Authentication policy is deprecated. It still works, but editors no longer suggest it and the gateway logs a deprecation warning when a policy uses it.

Most projects don’t need either option, because the policy defaults to your project’s own API key bucket. If you point the policy at a specific bucket, replace bucketName with bucketId:

JSONjson
"options": {
  "bucketId": "<your-bucket-id>"
}

Smart Router: use dialect instead of adapter

Effective October 13, 2026.

In the Smart Router policy, classifier.app.adapter is renamed to classifier.app.dialect. It takes the same values: chat-completions (the default), messages, and system-one.

JSONjson
"classifier": {
  "app": {
    "appId": "$env(CLASSIFIER_APP_ID)",
    "model": "anthropic/claude-haiku-4-5",
    "dialect": "messages"
  }
}

adapter is still honored when dialect isn’t set. Rename the field to dialect, and don’t set both: a policy with both fields is rejected with a configuration error.