Skip to content

Conversation

@Anya299
Copy link

@Anya299 Anya299 commented Jan 9, 2026

Title:
Add example for API Key header configuration

Description:
This PR adds a simple example showing how to configure and verify an API Key using FastAPI.

Demonstrates using Header and Depends to secure an endpoint with a custom API key.

Returns 401 Unauthorized if the API key is invalid.

Includes a sample /secure-data endpoint to test the functionality.

This addition is meant to help users understand how to implement basic API key authentication in their FastAPI projects.

@github-actions
Copy link
Contributor

github-actions bot commented Jan 9, 2026

📝 Docs preview

Last commit 1e33c91 at: https://19bb2c92.fastapitiangolo.pages.dev

@codspeed-hq
Copy link

codspeed-hq bot commented Jan 9, 2026

CodSpeed Performance Report

Merging this PR will not alter performance

Comparing Anya299:docs/api-key-header-example (1e33c91) with master (f2687dc)

Summary

✅ 20 untouched benchmarks
⏩ 40 skipped benchmarks1

Footnotes

  1. 40 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant