Authentication
The Brave Search API uses an API key for authentication, passed via the X-Subscription-Token header.
Getting an API Key
- Sign up at brave.com/search/api
- Navigate to the API keys section in your dashboard
- Create a new API key
Client Initialization
1 2 3 4 | |
The SDK handles the authentication header conversion automatically.
Internally, the client converts the standard Bearer token to the
X-Subscription-Token header that Brave Search expects.
Environment Variables
For integration tests, set the following environment variable:
1 | |