Select your cookie preferences

We use essential cookies and similar tools that are necessary to provide our site and services. We use performance cookies to collect anonymous statistics, so we can understand how customers use our site and make improvements. Essential cookies cannot be deactivated, but you can choose “Customize” or “Decline” to decline performance cookies.

If you agree, AWS and approved third parties will also use cookies to provide useful site features, remember your preferences, and display relevant content, including relevant advertising. To accept or decline all non-essential cookies, choose “Accept” or “Decline.” To make more detailed choices, choose “Customize.”

x-amazon-apigateway-api-key-source property

Focus mode
x-amazon-apigateway-api-key-source property - Amazon API Gateway
This page has not been translated into your language. Request translation

Specify the source to receive an API key to throttle API methods that require a key. This API-level property is a String type. For more information about configuring a method to require an API key, see Configure a method to use API keys with an OpenAPI definition.

Specify the source of the API key for requests. Valid values are:

  • HEADER for receiving the API key from the X-API-Key header of a request.

  • AUTHORIZER for receiving the API key from the UsageIdentifierKey from a Lambda authorizer (formerly known as a custom authorizer).

x-amazon-apigateway-api-key-source example

The following example sets the X-API-Key header as the API key source.

OpenAPI 2.0
{ "swagger" : "2.0", "info" : { "title" : "Test1" }, "schemes" : [ "https" ], "basePath" : "/import", "x-amazon-apigateway-api-key-source" : "HEADER", . . . }
OpenAPI 3.0.1
{ "openapi" : "3.0.1", "info" : { "title" : "Test1" }, "servers" : [ { "url" : "/{basePath}", "variables" : { "basePath" : { "default" : "import" } } } ], "x-amazon-apigateway-api-key-source" : "HEADER", . . . }
{ "swagger" : "2.0", "info" : { "title" : "Test1" }, "schemes" : [ "https" ], "basePath" : "/import", "x-amazon-apigateway-api-key-source" : "HEADER", . . . }
PrivacySite termsCookie preferences
© 2025, Amazon Web Services, Inc. or its affiliates. All rights reserved.