Using OpenAI and Gemini Batch APIs to Qualify Sales Leads - Superpayments

Using OpenAI and Gemini Batch APIs to Qualify Sales Leads

Mar 2, 2026

Data

The following blog details how the Data team used AI to solve a specific problem for our Marketing and Sales teams — Qualify 3000 websites (Salesforce Accounts) to determine if they are ecommerce and can take payments.

It is broken down into:

TL;DR

We implemented a batch data enrichment pipeline that uses OpenAI and Gemini Large Language Models (LLMs) via the OpenAI Batch API and Google Batch Predictions for a cost-effective way to enrich data using the power of LLMs.

To ensure maximum accuracy and minimise the effects of hallucinations from the LLMs, we use a simple consensus system: each website is checked by both AIs 3 times each, and only results where they agree are accepted. Yes, this makes it more expensive, but we optimised for time to value and getting good leads into the hands of the Sales team.

We used a prompt template configured to use the web search tool to ground the LLM with real-time information about the website, overcoming the model's static knowledge cutoff date.

We trained the Marketing team in writing effective prompts for the LLMs before we scaled up using the batch mode.

A great example of tech and the business working together to achieve a shared outcome and spreading the use of AI in the business.

Problem at Hand

The Marketing team periodically builds lists of potential merchants that can integrate Super as a payment method on their website checkout. These leads are then provided to Account Executives (AEs) to sign up.

When assigned a website the first thing AEs do is manually double-check is the website ecommerce:

⚠️ Many websites were not ecommerce ⚠️ resulting in:

What are we trying to solve?

Questions we asked ourselves:

Process Design

Before we dive into the details of Prompt Engineering and how the Batch pipeline works, what follows illustrates the process and its two parts.

Why use LLMs from 2 AI Providers?

Even though it was more costly to do so, we needed to be confident in the accuracy of what we were telling the AEs in the Sales team. Instead of relying on a single AI, we used LLMs from two different AI providers, then based our final decision on their consensus.

Think of it like getting a second opinion from a trusted expert. If two independent specialists examine the same data and come to the same conclusion, your confidence in that outcome increases dramatically.

Some benefits include:

Prompt Engineering

Prompt engineering is the process of writing effective instructions for a LLM, such that it consistently generates content that meets your requirements.

We used the OpenAI developer platform to iteratively develop a reusable prompt template that could be used in the responses API. The platform allows testing different versions of a prompt side-by-side to evaluate changes.

Advantages of using a Prompt Template

You can use variables via {{placeholder}} and your integration code remains the same, e.g.

response = client.responses.create(

model="gpt-4.1",

prompt={

"id": "pmpt_abc123",

"version": "2",

"variables": {

"website_url": "xyz.com"

}

}

)

You can also configure the prompt to use the web search tool to allow the LLM to search the web for the latest information before generating a response:

{

"type":"web_search_preview",

"user_location":{

"type":"approximate",

"country":"GB",

"search_context_size":"high",

}

}

Prompt Template

The Marketing team produced a prompt template that had clear instructions for the LLM to check if a single website URL is ecommerce.

Please research the website {{url}} provided by the user. You must only return the data requested in the "InformationRequested" section and in a format according to the "OutputFormat" section. Do not include any explanations, reasoning, or commentary.

## InformationRequested

- url: {{url}}

- is_url_valid: Y/N — Is the URL valid and accessible?

- is_ecommerce: Y/N - You MUST use rules from section "Evaluation Rules for column is_ecommerce"

## OutputFormat

Output as JSON with the following fields. Do not include markdown around the JSON:

- url

- is_url_valid

- is_ecommerce

## Evaluation Rules for column is_ecommerce

*Mark "Y" only if all of the following are true, based on explicit evidence available*:

* rule 1

* rule 2

* etc

*Mark "N" in any of the following cases*:

* rule 1

* rule 2

* etc

## Final Reminder

- You must only return the data requested in the "InformationRequested" section.

- You must only return it in the format according to the "OutputFormat" section.

- You must not include any explanations, reasoning, or commentary.

Scaling it up - OpenAI Batch API

OpenAI has a Batch API that allows you to send asynchronous groups of requests with 50% lower costs, a separate pool of significantly higher rate limits, and a clear 24-hour turnaround time. The workflow is:

The uploaded batch file containing the requests will have one line per website as below,

{"custom_id":"request-[1756480801.159196]-xyz.com","method":"POST","url":"/v1/responses","body":{"model":"gpt-4.1","input":"Run the following prompt","prompt":{"id":"pmpt_XXX","version":"2","variables":{"url":"xyz.com"}}}}

{"custom_id":"request-[1756480802.1434196]-abc.com","method":"POST","url":"/v1/responses","body":{"model":"gpt-4.1","input":"Run the following prompt","prompt":{"id":"pmpt_XXX","version":"2","variables":{"url":"abc.com"}}}}

The benefits of this are:

Scaling it up - Google Batch Predictions

Google Batch Predictions also allows you to generate predictions from Gemini models using a Batch Job, the workflow is:

Similar to OpenAI the batch job file contains one request per line, but you cannot use a prompt template, so each request in the file has the full prompt. Also web search tools in Gemini are not available via Batch Predictions, but we still found the results to be accurate.

Where we Ended Up

We now have a repeatable way to enrich data using the power of LLMs for a large number of websites. We have already started using it to conduct other checks.

The Salesforce Accounts we enriched with is_ecommerce = Y/N were used to create a better qualified list at the top of the sales funnel.

AEs were no longer reporting the website as not ecommerce.

A job well done by AI and Humans!

Jag Thind, Data

Read