Connecting Your Google AI Account to LegalServer (BYOK)


This article describes how to connect your own Google Cloud account to LegalServer to enable LegalServer's artificial intelligence (AI) features.

Some features in LegalServer use AI, and this requires an account with an AI provider. This "Bring Your Own Key" (BYOK) model gives you full control over your billing, usage, and data governance. LegalServer supports connecting to Google's AI models using either the Generative Language API (via an API key) or Vertex AI (via a Service Account).

This guide will walk you through generating the necessary credentials for either method and connecting them to LegalServer.

Prerequisites

Before you begin, you must have the following:

  • A Google Account.
  • A Google Cloud Platform (GCP) account.
  • A GCP Project created within your account.
  • An active Billing Account linked to your GCP Project (generating credentials and using the models incurs usage costs).
  • An add-on subscription to LegalServer's AI / Machine Learning Tools.

Supported Features

Subscribing to LegalServer's AI / Machine Learning tools and connecting a Google credential can enable features such as:

  • Case Summary
  • Automated Intake
  • Magic Notes
  • Smart Time
  • Process Overview (At-a-Glance)

Integration Options

LegalServer supports two integration pathways for Google's models:

  1. Option A: Vertex AI (Enterprise Setup): Uses an IAM Service Account.

    Recommended for enterprise environments as it provides robust security, compliance controls, and does not rely on API keys.


  2. Option B: Generative Language API (API Key Setup): A simpler interface relying on a restricted API key.



Choose one of the following options to generate your credentials.



Option A: Vertex AI Setup Guide

Vertex AI requires IAM-based authentication using a Service Account JSON key.

API keys are not supported for this method.



Step 1: Enable the Vertex AI API

  1. In your GCP project, go to the Google Cloud Console API Library.
  2. Ensure the correct GCP Project is selected in the top navigation bar.
  3. In the search bar, type "Vertex AI API".
  4. Click on the result and then click the Enable button.

Step 2: Create a Service Account and Assign Roles

  1. Navigate to IAM & Admin > Service Accounts.
  2. Click + Create Service Account. Name it something descriptive (e.g., "LegalServer Vertex AI") and click Create and Continue.
  3. Under "Grant this service account access to project", select the Vertex AI User role (roles/aiplatform.user ).
  4. Click Done.

Step 3: Generate a JSON Key

  1. Click on your newly created Service Account in the list.
  2. Navigate to the Keys tab.
  3. Click Add Key > Create new key.
  4. Select JSON and click Create. The file will automatically download. Store this key securely (like a password manager), as you will need it to configure LegalServer.

Option B: Generative Language API Setup Guide

This method generates a secure API key for the Gemini models.

Step 1: Enable the Generative Language API

  1. Go to the Google Cloud Console API Library.
  2. Ensure the correct GCP Project is selected in the top navigation bar.
  3. In the search bar, type "Generative Language API".
  4. Click on the result and then click the Enable button.

Step 2: Create and Restrict Your API Key
There are two ways to create the key. We recommend Method 1 for better security and management.

  1. Navigate to APIs & Services > Credentials.
  2. Click + Create Credentials at the top of the page and select API key.
  3. A new key will be generated. Copy this key and store it securely. Close the dialog.
  4. Find your new API key in the list. Click the overflow menu (three vertical dots) on the right and select Edit API key.
  5. Change the Name to something descriptive (e.g., "LegalServer Gemini Key").
  6. Under API restrictions, select Restrict key.
  7. In the dropdown, find and select Generative Language API.
    Click OK, then click Save.

Final Step: Configure LegalServer

Once you have generated either your Vertex AI JSON Key or your Generative Language API Key, add it to your site.

  1. Log In: Requires Edit AI & Machine Learning Settings permission. Log in to your LegalServer site as an Administrator.
  2. Navigate to AI Settings: Go to the Admin > AI & Machine Learning settings page.
  3. Select Your Engine:
Find the Engine Selection setting and choose either Gemini or Vertex AI as your preferred "OCR & AI LLM," depending on which setup you completed.
  1. Provide Credentials:
If using the Generative Language API, paste your newly created Google API key into the input field. If using Vertex AI, upload your Service Account JSON file or paste its contents as prompted by the interface.

Save:

Save the settings to finalize the integration.

Important Considerations

  • Security: Your API key and JSON credentials are highly sensitive secrets. Never share them publicly, commit them to code repositories, or expose them in client-side code. Always restrict your API keys or limit your Service Account roles to only what is necessary.

  • Pricing: You are responsible for all costs associated with your GCP usage and the API key/Service Account.

  • HIPAA and Data Usage: Google's data usage and compliance terms apply. Both platforms offer varying levels of enterprise compliance; please review Google's policies for specific information on data handling and privacy.
Did this answer your question? Thanks for the feedback There was a problem submitting your feedback. Please try again later.

Still need help? Contact Us Contact Us