Skip to main content
The Screen Answerer API provides endpoints for processing quiz questions using Google’s Gemini AI. The API supports both text and image-based questions, screen monitoring, and custom model selection.

Base URL

When running locally:
http://localhost:3000
For production deployments, use your configured domain.

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
curl -X POST http://localhost:3000/process_question \
  -H "Content-Type: application/json" \
  -H "X-API-Key: YOUR_GEMINI_API_KEY" \
  -d '{"question": "What is the capital of France?"}'
Response
{
  "answers": [
    "Paris"
  ]
}

Authentication

All API endpoints require a valid Google Gemini API key. You can provide it in two ways:
  1. Recommended: Via the X-API-Key header
  2. In the request body as apiKey field
See the Authentication page for detailed information.

Response format

All successful API responses return JSON with an answers array:
{
  "answers": [
    "Answer line 1",
    "Answer line 2"
  ]
}
Error responses include an error field and optional message:
{
  "error": "API key is required",
  "message": "No API key provided in headers or body"
}

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)
See Rate Limiting for details on handling rate limit errors.

Model selection

By default, all endpoints use gemini-2.0-flash-lite for optimal speed. You can specify a different model using the /process_question_with_key endpoint:
{
  "apiKey": "YOUR_API_KEY",
  "question": "Your question",
  "model": "gemini-2.0-flash"
}
Available models:
  • gemini-2.0-flash-lite (default) - Faster responses, lower cost
  • gemini-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
See Error Handling for complete error codes and handling strategies.

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

Build docs developers (and LLMs) love