Service: Image Description Generator - EyevinnOSC/community GitHub Wiki
The Image Description Generator (serviceId eyevinn-img-alt-gen, source) generates alt text descriptions for images using OpenAI. In Eyevinn Open Source Cloud (OSC) it is a long-running service instance. License: MIT.
- Generate an image alt description from an image URL through the
/image/altendpoint. - Return the description as an HTML
imgtag including the alt attribute, or as plain text withformat=text. - Serve accessibility and SEO workflows through an HTTP API with built-in API docs.
You need an OpenAI account and API key. The service has no dependencies on other OSC services.
- Store the key with
create-service-secret(serviceIdeyevinn-img-alt-gen, for example nameopenaikey). - Create the instance with
create-service-instance,serviceId: "eyevinn-img-alt-gen":
{ "name": "mygenerator", "OpenaiApiKey": "{{secrets.openaikey}}" }- Wait for it to be running (
wait-for-service-readyorget-instance-status) and get the URL withdescribe-service-instance.
| Option | Required | Type | Meaning |
|---|---|---|---|
| name | Yes | string | Name of the instance. Letters, digits and underscore only (^\w+$), at most 20 characters. |
| OpenaiApiKey | Yes | string, sensitive | OpenAI API key the service uses to generate descriptions. Store it as a service secret and pass it as {{secrets.NAME}} (whole field value only). |
Overwriting a secret does not restart a running instance.
The instance serves interactive API docs. Try /image/alt with the query parameter url set to an image URL, for example https://blog.osaas.io/wp-content/uploads/2025/02/image-1536x851.png. The response is HTML:
<img src="https://blog.osaas.io/wp-content/uploads/2025/02/image-1536x851.png" alt="The image shows a dashboard displaying the status, uptime, error counts, and stream information for media monitoring." />
To call the API from an application you need a service access token. Set a personal access token in OSC_ACCESS_TOKEN (see Finding Your API Token) and generate the service token with the OSC CLI:
% export OSC_ACCESS_TOKEN=<personal-access-token>
% npx @osaas/cli service-access-token eyevinn-img-alt-gen
<service-token>Then use it as a bearer token:
% curl -H 'Authorization: Bearer <service-token>' "https://<tenant>-<name>.eyevinn-img-alt-gen.auto.prod-se.osaas.io/image/alt?url=https%3A%2F%2Fblog.osaas.io%2Fwp-content%2Fuploads%2F2025%2F02%2Fimage-1536x851.png&format=text"
The image displays a dashboard tracking the status and performance of streaming monitors, showing active status, uptime, and error rates.