Base URL
When running locally:API architecture
The API is built on Node.js with Express and provides three main endpoints:Process Question
Process text or image questions with AI
Monitor Screen
Detect and answer quiz questions from screen captures
Rate Limiting
Understand API rate limits and quotas
Authentication
Learn how to authenticate API requests
Quick start
Here’s a simple example of processing a text question:cURL
Response
Authentication
All API endpoints require a valid Google Gemini API key. You can provide it in two ways:- Recommended: Via the
X-API-Keyheader - In the request body as
apiKeyfield
Response format
All successful API responses return JSON with ananswers array:
error field and optional message:
Rate limiting
The API implements multiple layers of rate limiting to prevent abuse and quota exhaustion:- Global limit: 100 requests per 15 minutes per IP
- Per-client limit: 5-second window between requests
- Internal quota: 50 API calls per minute (resets automatically)
Model selection
By default, all endpoints usegemini-2.0-flash-lite for optimal speed. You can specify a different model using the /process_question_with_key endpoint:
gemini-2.0-flash-lite(default) - Faster responses, lower costgemini-2.0-flash- Balanced speed and accuracy
Error handling
The API includes automatic retry logic for transient errors:- Maximum retries: 3 attempts
- Retry delay: Exponential backoff starting at 1000ms
- Retryable errors: Rate limits (429), quota exhaustion, network issues
Next steps
Process Question Endpoint
Process text and image questions
Screen Monitoring
Automatically detect quiz questions
Integration Examples
Real code examples in multiple languages
Error Handling
Handle errors and implement retries