OpenAPI security examples backed by httpbin.io so the playground returns real responses (headers, bearer auth, cookies, request body echo).
Servers
API key in header
Bearer authentication
Calls httpbin /bearer, which requires a valid Authorization: Bearer <token> header and returns 401 without it.
Authorizations
"Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiYWRtaW4iOnRydWUsImlhdCI6MTUxNjIzOTAyMn0.KMUFsIDTnFmyG3nMiGM6H9FNFUROf3wh7SmqJp-QV30"Responses
Authenticated
API key and bearer auth
Calls httpbin /put, which echoes headers and JSON body. Requires both api_key and bearer auth.
Authorizations
"your-api-key""Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiYWRtaW4iOnRydWUsImlhdCI6MTUxNjIzOTAyMn0.KMUFsIDTnFmyG3nMiGM6H9FNFUROf3wh7SmqJp-QV30"Parameters
Header Parameters
Header parameter description
"value"Responses
Echo of the PUT request
API key or bearer auth
Calls httpbin /anything/{pathParam}. Accepts either an API key or a bearer token.
Authorizations
"your-api-key""Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiYWRtaW4iOnRydWUsImlhdCI6MTUxNjIzOTAyMn0.KMUFsIDTnFmyG3nMiGM6H9FNFUROf3wh7SmqJp-QV30"Parameters
Path Parameters
Path segment echoed by httpbin
"demo"Responses
Echo of the request
Multiple security requirement options
Calls httpbin /anything/{pathParam} with a JSON body. Either (apiKey + bearer) or (basicAuth + internalApiKey).
Authorizations
"your-api-key""Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiYWRtaW4iOnRydWUsImlhdCI6MTUxNjIzOTAyMn0.KMUFsIDTnFmyG3nMiGM6H9FNFUROf3wh7SmqJp-QV30"Basic authentication with username and password
Internal API key for special customers
"special-key"Parameters
Path Parameters
Path segment echoed by httpbin
"demo"Query Parameters
Query parameter description
"value1""value2""value1"Another query parameter description
"hello"Request Body
Responses
Echo of the request including body, args, and headers
No security
API key in query
Calls httpbin /anything, which echoes query args so you can verify api_key was sent as a query parameter.
Authorizations
"your-api-key"Parameters
Query Parameters
An optional query parameter
"optional-value"Responses
Echo of the request including query args
apiKey header name differs from scheme key
Uses managementKey as the securitySchemes key but sends the header X-Management-Key. Code samples must use the scheme name, not the key. Calls httpbin /headers so the response shows the received headers.
Authorizations
Management API key. Scheme key is managementKey; header name is X-Management-Key.
"mgmt-secret"Responses
Request headers as seen by httpbin
apiKey in cookie
Uses an apiKey scheme with in: cookie. Code samples must send a Cookie request header, not Set-Cookie. Calls httpbin /cookies, which returns cookies received on the request.
Authorizations
Session id cookie. Request samples must use the Cookie header.
"session-id-example"Responses
Cookies received by httpbin