I am having trouble using my Brave Search API keys. I have generated separate keys for each endpoint (Web Search, Suggest, Spellcheck, and AI) from the Brave API dashboard at https://api-dashboard.search.brave.com/app/keys.
When I use the correct key for the correct endpoint (for example, the AI key for the /answer
endpoint), I receive the following error:
{"error":{"code":"SUBSCRIPTION_TOKEN_INVALID","detail":"The provided subscription token is invalid.","meta":{"component":"authentication"},"status":422},"type":"ErrorResponse"}
I have:
- Regenerated the keys multiple times
- Carefully copied and pasted the keys with no extra spaces
- Verified that the keys work in the Brave API playground, but not in my own code
- Used the correct endpoint URLs as documented
Could someone please help me resolve this issue or let me know if there is something wrong with my account or the keys?
Thank You!