Overview
Screen Answerer uses API key authentication to secure access to its endpoints. All API requests require a valid Gemini API key to process questions and images.API key requirements
You must provide your own Google Gemini API key to use Screen Answerer. The API key must be in the correct format:- Format:
AIza[0-9A-Za-z_-]{35} - Example:
AIzaSyDxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Get your free Gemini API key from Google AI Studio
Providing your API key
You can pass your API key in two ways:Option 1: HTTP header (recommended)
Include theX-API-Key header in your request:
Option 2: Request body
Include theapiKey field in your request body:
API key validation
Screen Answerer performs validation on your API key:Format validation
The API checks that your key matches the expected Gemini API key format. If the format is invalid, you’ll receive:Authentication errors
If your API key is rejected by Google’s Gemini API during processing, you’ll receive:401 Unauthorized.
Security best practices
Never commit your API key to version control or expose it in client-side code
- Store your API key in environment variables
- Use the
X-API-Keyheader method for cleaner separation - Rotate your API key periodically
- Monitor your Google Cloud quota usage
Missing API key
If you don’t provide an API key, the API will return:400 Bad Request.