I built a service that auto-generates unique h1, alt text, and titles for images using OpenAI. This improved SEO, accessibility, reduced content cannibalization, and saved time for authors.I built a service that auto-generates unique h1, alt text, and titles for images using OpenAI. This improved SEO, accessibility, reduced content cannibalization, and saved time for authors.

Automation of ALT Text Generation for Images Using the OpenAI API

2025/09/10 16:03
5 min read

Hello, I’m a developer who has been building websites for some time. Not long ago, I took part in the development of a website that is still in its early stages. This is my test project for checking my own features (my first commercial project where I also worked on the server-side of the website; before that, I had experience creating a small REST API using Express.js, but here the server was built with Nest.js).

I won’t go into too many details now – instead, in this article I’ll write about the benefits I personally gained from this experience. (It might be within the next few days or weeks, I’ll either highlight a quote in this blog or leave a link in the comments here.)

\

Introduction to the Core of the Problem

One of the main and key problems is the lack of a unique h1 on image pages (many website SEO checking services report non-unique errors as a critical or medium-level issue), which is indexed by GoogleBot and participates in search results and Google Images.

The problem was the absence of alt in images, which are needed to improve SEO and adjust settings in Google Images, including to improve the accessibility of your website (see the European Directive on the accessibility of digital products and services, effective June 28, 2025):

\

  • problems when including an image;
  • for people with visual impairments, screen readers read the alt;
  • content cannibalization, for example, in the title and alternative images, leads to the use of titles to which the image belongs; in the web project, there were a large number of such titles.

\

An Example of This Problem Was Solved

The old version of the title and alternative text that was used looked like this, for example with this image – FlatOut 2 Screenshot 48. Below is the current version, which was generated with AI.

Example of a New Generated h1 for an Image Page

\ Example of a Generated alt for an Image

\ PS: The image description and caption were also generated with AI, but later we abandoned this idea since we cannot fully create the description – it turns out too long. (You can see an example here, and you can also compare this description – these were our first attempts based on the game description with the addition of the page. We eventually concluded that it was useless, but we decided to leave it in these test cases.)

\

Problem Solution

At the moment, I’ve written a test version – a small service that uses the OpenAI API and a function that provides prompts for AI templates of input data and configuration settings. (By the way, the new GPT-5 version no longer has the temperature parameter; previously, this parameter influenced creativity – see more details).

The next step in the development was a function in the image service, which is responsible for retrieving images that don’t yet have an alt or title. This function worked with a limit on the number of images to avoid overload. The p-limit library was used to manage parallel requests to the OpenAI API and speed up data generation.

So, we now have a ready function that can generate textual descriptions for images.

Currently, I use a cron function to trigger this process at intervals. In other words, I don’t generate alt text immediately at the time of image upload and don’t execute this operation in a separate queue (like Bull, BullMQ, and others).

\ At the moment, I am using the version gpt-4_1-mini-2025-04-14

OpenAI API Usage Metrics

Some Numbers:

  • 46.82s execution time for 5 requests to the OpenAI API with p-limit 1;
  • 19.71s - 23.12sExecution time for 5 requests using a p-limit of 3;

\

\ The price of this version is quite low: when generating alt text and titles for around 2,200 images, the cost was $5.5. I also tested more expensive versions but did not notice any significant improvement in the quality of generation or the accuracy of the image descriptions.

\

What We Achieved in the End

  • Unique page title;
  • Fully filled-in alt text;
  • Reduced cannibalization in the project;
  • Reduced workload for content authors (a concrete example: a website created in 6 languages, where authors cannot always afford to add alt/title to images in all languages - and in most cases, they don’t even want to do it in one language);
  • More attractive and enriched snippets in search results;
  • OpenGraph metadata, which can attract users from social networks.

In conclusion, I can say that the idea came naturally, although it is far from new.

Today, you can already find many ready-made solutions in search. If anyone needs help with such a custom implementation, here is my GitHub.

\


\

Sources:

  • European Directive on the accessibility of digital products and services;
  • Example website;
  • p-limit – a library for controlling concurrency of Promises;
  • Cheat sheet on the temperature[ and ]()top_p[ parameters in the ChatGPT API]();
  • GitHub (for contact).

\ \ \ \ \

Disclaimer: The articles reposted on this site are sourced from public platforms and are provided for informational purposes only. They do not necessarily reflect the views of MEXC. All rights remain with the original authors. If you believe any content infringes on third-party rights, please contact service@support.mexc.com for removal. MEXC makes no guarantees regarding the accuracy, completeness, or timeliness of the content and is not responsible for any actions taken based on the information provided. The content does not constitute financial, legal, or other professional advice, nor should it be considered a recommendation or endorsement by MEXC.

You May Also Like

Is Putnam Global Technology A (PGTAX) a strong mutual fund pick right now?

Is Putnam Global Technology A (PGTAX) a strong mutual fund pick right now?

The post Is Putnam Global Technology A (PGTAX) a strong mutual fund pick right now? appeared on BitcoinEthereumNews.com. On the lookout for a Sector – Tech fund? Starting with Putnam Global Technology A (PGTAX – Free Report) should not be a possibility at this time. PGTAX possesses a Zacks Mutual Fund Rank of 4 (Sell), which is based on various forecasting factors like size, cost, and past performance. Objective We note that PGTAX is a Sector – Tech option, and this area is loaded with many options. Found in a wide number of industries such as semiconductors, software, internet, and networking, tech companies are everywhere. Thus, Sector – Tech mutual funds that invest in technology let investors own a stake in a notoriously volatile sector, but with a much more diversified approach. History of fund/manager Putnam Funds is based in Canton, MA, and is the manager of PGTAX. The Putnam Global Technology A made its debut in January of 2009 and PGTAX has managed to accumulate roughly $650.01 million in assets, as of the most recently available information. The fund is currently managed by Di Yao who has been in charge of the fund since December of 2012. Performance Obviously, what investors are looking for in these funds is strong performance relative to their peers. PGTAX has a 5-year annualized total return of 14.46%, and is in the middle third among its category peers. But if you are looking for a shorter time frame, it is also worth looking at its 3-year annualized total return of 27.02%, which places it in the middle third during this time-frame. It is important to note that the product’s returns may not reflect all its expenses. Any fees not reflected would lower the returns. Total returns do not reflect the fund’s [%] sale charge. If sales charges were included, total returns would have been lower. When looking at a fund’s performance, it…
Share
BitcoinEthereumNews2025/09/18 04:05
Mystake Review 2023 – Unveil the Gaming Experience

Mystake Review 2023 – Unveil the Gaming Experience

Cryptsy - Latest Cryptocurrency News and Predictions Cryptsy - Latest Cryptocurrency News and Predictions - Experts in Crypto Casinos Did you know Mystake Casino
Share
Cryptsy2026/02/07 11:32
Strategic Move Sparks Market Analysis

Strategic Move Sparks Market Analysis

The post Strategic Move Sparks Market Analysis appeared on BitcoinEthereumNews.com. Trend Research Deposits $816M In ETH To Binance: Strategic Move Sparks Market
Share
BitcoinEthereumNews2026/02/07 11:13