The AltText AI connector lets your AI agent act in each user's AltText AI account. Each user connects their own AltText AI API key once, and Scalekit sends it with every call, so your agent never handles credentials. It comes with 9 tools.
- Tools
- 9
- What they doRead · write · destructive
- 4 · 4 · 14 read4 write1 destructive
- Users sign in with
- API key
Setup
Install the SDK
Terminal window npm install @scalekit-sdk/node dotenvTerminal window pip install scalekit-sdk-python python-dotenvSet your credentials
Add your Scalekit credentials to your
.envfile. Find values in app.scalekit.com > Developers > API Credentials..env SCALEKIT_ENVIRONMENT_URL=<your-environment-url>SCALEKIT_CLIENT_ID=<your-client-id>SCALEKIT_CLIENT_SECRET=<your-client-secret>Create the AltText AI connection
In AgentKit > Connections, create an AltText AI connection. The name you give it is the
connection_nameyour code passes. See Configure connections.Authorize a user and make your first call
quickstart.mts import { ScalekitClient } from '@scalekit-sdk/node'import 'dotenv/config'import { createInterface } from 'node:readline/promises'const scalekit = new ScalekitClient(process.env.SCALEKIT_ENVIRONMENT_URL,process.env.SCALEKIT_CLIENT_ID,process.env.SCALEKIT_CLIENT_SECRET,)const actions = scalekit.actionsconst connector = 'alttextai'const identifier = 'user_123'// Generate an authorization link for the userconst { link } = await actions.getAuthorizationLink({ connectionName: connector, identifier })console.log('Authorize AltText AI:', link)const rl = createInterface({ input: process.stdin, output: process.stdout })await rl.question('Press Enter after authorizing...')rl.close()// Make your first callconst result = await actions.executeTool({connector,identifier,toolName: 'alttextai_account_get',toolInput: {},})console.log(result)Terminal window npx tsx quickstart.mtsquickstart.py import osfrom scalekit import ScalekitClientfrom dotenv import load_dotenvload_dotenv()scalekit_client = ScalekitClient(env_url=os.getenv("SCALEKIT_ENVIRONMENT_URL"),client_id=os.getenv("SCALEKIT_CLIENT_ID"),client_secret=os.getenv("SCALEKIT_CLIENT_SECRET"),)actions = scalekit_client.actionsconnection_name = "alttextai"identifier = "user_123"# Generate an authorization link for the userlink_response = actions.get_authorization_link(connection_name=connection_name,identifier=identifier,)print("Authorize AltText AI:", link_response.link)input("Press Enter after authorizing...")# Make your first callresult = actions.execute_tool(tool_input={},tool_name="alttextai_account_get",connection_name=connection_name,identifier=identifier,)print(result)Terminal window python quickstart.pyEach user opens the link once and enters their AltText AI credentials there. See Authorize a user for the full flow and statuses.
Tools
Pass the exact name toexecute_toolalttextai_account_getGet the AltText.ai account the API key belongs to.Read-onlyGet Account
Get the AltText.ai account the API key belongs to. Returns the account name, webhook URL, notification email, credit usage and subscription, and details of the calling key. Use this to check remaining credits or to confirm the connection works.
Inputs
This tool takes no inputs.
alttextai_image_getGet one image from the AltText.ai library.Read-onlyGet Image
Get one image from the AltText.ai library. Returns the image's asset_id, url, alt_texts by language, tags, metadata and timestamps. Use alttextai_images_list or alttextai_images_search to find the asset ID.
Inputs
asset_idstringrequired- Asset ID of the image, from alttextai_images_list or the response of alttextai_image_create. Example: img-8f2a1c.
alttextai_images_listList the images in the AltText.ai library, one page at a time.Read-onlyList Images
List the images in the AltText.ai library, one page at a time. Returns each image's asset_id, url, alt_texts by language, tags and metadata, plus pagination details. Use this to browse the library or to find one image by its exact URL. Use alttextai_images_search for a text, asset ID or partial URL search.
Inputs
limitinteger- Number of results per page, at most 100. Example: 20.
pageinteger- Page of results to return, starting at 1. Example: 1.
urlstring- Only return the image with exactly this URL (no wildcards). Example: https://example.com/images/shoe.jpg.
alttextai_images_searchSearch the AltText.ai library by alt text words, asset ID or URL substring; the search type is detected from the query.Read-onlySearch Images
Search the AltText.ai library by alt text words, asset ID or URL substring; the search type is detected from the query. Returns matching images with asset_id, url and alt_texts, plus pagination details. Use this to find images when you do not know the exact URL. Use alttextai_images_list to page through everything.
Inputs
qstringrequired- Search query: words or a phrase from the alt text, an asset ID, or a URL fragment starting with http:// or https://. Example: red running shoe.
limitinteger- Number of results per page, at most 100. Example: 20.
pageinteger- Page of results to return, starting at 1. Example: 1.
alttextai_account_updateUpdate the AltText.ai account's name, default webhook URL or notification email.WriteUpdate Account
Update the AltText.ai account's name, default webhook URL or notification email. Returns the updated account. Only the fields you set are sent.
- Idempotent
Inputs
namestring- New account name. Example: Acme Store.
notification_emailstring- Email address for important account notices such as a low credit balance. Example: ops@example.com.
webhook_urlstring- Default URL that receives webhook notifications, for example when an async image finishes. Example: https://example.com/hooks/alttext.
alttextai_image_createAdd an image to the AltText.ai library by public URL or base64 data and generate its alt text.WriteGenerate Alt Text for Image
Add an image to the AltText.ai library by public URL or base64 data and generate its alt text. Uses credits, except when the URL is already in the library. Returns the image with its generated alt_texts by language (empty when async is true). Use this for one image. Use alttextai_page_scrape to process every image on a web page. Send either url or raw, not both.
Inputs
asset_idstring- Your own unique ID for the image. Cannot contain ? & # \ / % < > +. Generated when omitted. Example: sku-1042-front.
asyncboolean- true adds the image in the background and returns an empty body right away; use webhooks to learn when it is done. Not supported with raw. Example: false.
ecomm_brandstring- Brand of the product in the image; used with ecomm_product. Example: Acme.
ecomm_colorstring- Color of the product in the image; used with ecomm_product. Example: red.
ecomm_productstring- Product name, to use the e-commerce vision model that includes product details in the alt text. Example: Trail Runner 2.
gpt_promptstring- Final Pass prompt run on the generated alt text, in English. It must contain the AltText macro (the word AltText inside two pairs of curly braces), which is replaced with the generated alt text. Example: Rewrite this in under 100 characters: {{AltText}}
keyword_sourcestring- Text to take keywords from, such as a product description; only used when keywords is empty. Example: Lightweight trail running shoe with a grippy sole.
keywordsarray- Keywords or phrases to consider when writing the alt text, for SEO; usually one or two of them are used. Example: ["running shoes", "trail"]
langstring- Language code(s) for the generated alt text, comma-separated (for example en or en,es,fr). Each language after the first uses one extra translation credit per image. Defaults to the account's default language. Example: en,es.
max_charsinteger- Maximum length of the alt text. Defaults to the account setting. Example: 125.
metadataobject- Custom key-value data stored with the image and returned on every API response and webhook. Example: {"product_id": "1042"}
model_namestring- Writing style model: describe-detailed, describe-regular, describe-factual, succinct-describe-factual or describe-terse. Defaults to the account setting. Example: describe-regular.one of
describe-detaileddescribe-regulardescribe-factualsuccinct-describe-factualdescribe-terse negative_keywordsarray- Words or phrases to remove from any generated alt text. Must be in English, even when lang asks for another language. Example: ["cheap"]
overwriteboolean- true regenerates the alt text when an image with the same URL or asset ID already exists, using credits again. Example: false.
rawstring- Base64-encoded image data (RFC 4648, no line feeds), for images that are not publicly reachable. Send this or url. Not supported with async. Example: iVBORw0KGgoAAAANSUhEUgAA...
tagsarray- Words or phrases to associate with the image. Example: ["shoes", "summer"]
timeout_secsinteger- Maximum seconds to wait for the alt text. Best left unset. Example: 30.
urlstring- Public URL of the image (JPEG, PNG, GIF, WEBP or BMP, up to 16 MB). Send this or raw. Example: https://example.com/images/shoe.jpg.
webhook_urlstring- Webhook URL for this request only, instead of the account default. Example: https://example.com/hooks/alttext.
alttextai_image_updateUpdate an image's alt text, asset ID or metadata in the AltText.ai library.WriteUpdate Image
Update an image's alt text, asset ID or metadata in the AltText.ai library. The image URL cannot be changed. Returns the updated image. Use this to correct alt text by hand. Use alttextai_image_create with overwrite=true to regenerate it instead.
- Idempotent
Inputs
asset_idstringrequired- Current asset ID of the image to update, from alttextai_images_list. Example: img-8f2a1c.
alt_textstring- New alt text for the image. Example: Red trail running shoe with a thick grippy sole.
langstring- Language code(s) that alt_text is written in, comma-separated, for example en. Defaults to the account's default language. Example: en.
metadataobject- Custom key-value data to store with the image. Example: {"product_id": "1042"}
new_asset_idstring- New asset ID for the image; must be unique and cannot contain ? & # \ / % < > +. Example: sku-1042-side.
overwriteboolean- true replaces existing alt text in those languages; false (default) keeps it. Example: true.
alttextai_page_scrapeScan a web page (or an HTML document you send) for img elements and queue alt text generation for each image in the background.WriteScrape Page Images
Scan a web page (or an HTML document you send) for img elements and queue alt text generation for each image in the background. Uses credits per image. Returns the images found on the page, without the final alt text; fetch it later with alttextai_image_get or alttextai_images_list. Use this for a whole page. Use alttextai_image_create for one image. JavaScript is not run, and the page must load within 3 seconds.
Inputs
htmlstring- Raw HTML document to scan instead of fetching url. Example: <html><body><img src="https://example.com/a.jpg"></body></html>.
include_existingboolean- true also processes images that already have alt text in the HTML; by default they are skipped. Example: false.
keywordsarray- Keywords or phrases to consider when writing the alt text, for SEO; usually one or two of them are used. Example: ["running shoes", "trail"]
langstring- Language code(s) for the generated alt text, comma-separated (for example en or en,es,fr). Each language after the first uses one extra translation credit per image. Defaults to the account's default language. Example: en.
negative_keywordsarray- Words or phrases to remove from any generated alt text. Must be in English, even when lang asks for another language. Example: ["cheap"]
urlstring- URL of the page to scan. Send this, html, or both. Example: https://example.com/products/trail-runner.
alttextai_image_deleteDelete an image and its alt text from the AltText.ai library.DestructiveDelete Image
Delete an image and its alt text from the AltText.ai library. Returns an empty success response. This cannot be undone.
- Idempotent
Inputs
asset_idstringrequired- Asset ID of the image to delete, from alttextai_images_list. Example: img-8f2a1c.
No tools match.