Skip to content

Research AI API Testing

Overview

This documentation describes how to switch between the RAI Production API and the RAI Development API on the stage environment. This enables internal testing of both API versions without requiring code changes.

useRaiDevUrl

Accepted Values

  • true - Enables the RAI Dev API
  • Not set - Uses the RAI Prod API (default)

Prerequisites

For the Dev API to be used, both conditions must be met:

  1. ✅ Cookie useRaiDevUrl is set to true
  2. ✅ Environment variable APP_AI_SUMMARY_KEY_DEV is defined

Using Browser DevTools

  1. Open Browser DevTools (F12)
  2. Go to the Application tab (Chrome) or Storage tab (Firefox)
  3. Navigate to Cookies → Select the domain
  4. Click "Add Cookie" or create a new cookie:
    • Name: useRaiDevUrl
    • Value: true

Testing Workflow

Scenario 1: Testing RAI Dev API

  1. Set the cookie: useRaiDevUrl=true
  2. Reload the page
  3. Execute Research AI requests (summaries, suggestions, etc.)
  4. All requests go to Dev API

Scenario 2: Testing RAI Prod API

  1. Delete the cookie or set: useRaiDevUrl=false
  2. Reload the page
  3. Execute Research AI requests
  4. All requests go to the default Prod API

Important Notes

⚠️ Cookie Persistence

  • The cookie remains set until it is deleted or expires
  • Don't forget to remove the cookie after testing

⚠️ Session

  • After setting/deleting the cookie, the page must be reloaded
  • Already open API connections are not affected