Skip to content

Advanced Usage

Jimmy Pautz edited this page Apr 20, 2026 · 15 revisions

If you want to dig a bit deeper into what the plugin can do, here are a few extra features.

Gestures

You can tie the X-Ray menu to any of KOReader's gestures (like corner taps or edge swipes):

  1. Go to Menu → Settings → Taps and Gestures → Gesture Manager.
  2. Pick whatever gesture you prefer.
  3. Look for X-Ray Quick Menu or X-Ray Characters in the action list and assign it.

Manual Config Editing

While most settings are handled through the UI, you can manually enter your API keys by editing xray_config.lua in the plugin folder. It should look like this:

-- X-Ray API Configuration

return {
    -- Google Gemini API Key
    -- To get an API key: https://makersuite.google.com/app/apikey
    -- Enter your API key here:
    gemini_api_key = "AIzaSy...", 
    
    -- ChatGPT API Key 
    -- To get an API key: https://platform.openai.com/api-keys
    -- Enter your API key here:
    chatgpt_api_key = "sk-...",  
}

Note: Other settings like model selection and spoiler preferences are managed through the on-screen menu and stored in a separate settings.json file.

Maintenance Tools

Under the Maintenance menu, you'll find a few useful utilities:

  • Clear Cache: Sometimes the AI gets confused or returns weird data. Hit this to wipe the saved file for your current book and start fresh.
  • Troubleshooting: If things aren't working right, take a look at the xray.log file in the plugin folder. It usually points directly to whatever is going wrong.

Clone this wiki locally