Getting started / image understanding for agents

Let your agent read an image in 3 lines

Give it an image URL. It returns a description, every piece of text in the image (OCR), or the answer to your question: screenshots, receipts, charts, documents, product photos. $0.006 a call, JPEG, PNG, WebP or GIF up to 8 MB.

1. Get a free key

This tool is above the free keyless allowance, so it needs a key or an x402 payment. A free key (no card, no email) comes with trial credit.

2. Call it

curl -s -X POST https://aipaygen.com/v1/describe_image -H "Authorization: Bearer YOUR_KEY" -H 'content-type: application/json'   -d '{"url": "https://upload.wikimedia.org/wikipedia/commons/4/47/PNG_transparency_demonstration_1.png", "question": "What is in this image?"}'

The answer is JSON: data.answer (the description or the answer to your question), data.text_in_image (the transcribed text, when no question is asked), data.image_bytes. Leave out question to get a description plus all the text.

3. From code

JavaScript

// Node 20+, no packages
const r = await fetch("https://aipaygen.com/v1/describe_image", {
  method: "POST",
  headers: { "content-type": "application/json", authorization: "Bearer " + process.env.AIPAYGEN_KEY },
  body: JSON.stringify({ url: "https://example.com/receipt.png", question: "What is the total?" }),
});
const { data } = await r.json();
console.log(data.answer, data.text_in_image);

Python

import os, requests
r = requests.post("https://aipaygen.com/v1/describe_image",
    headers={"Authorization": "Bearer " + os.environ["AIPAYGEN_KEY"]},
    json={"url": "https://example.com/receipt.png", "question": "What is the total?"})
d = r.json()["data"]; print(d["answer"], d["text_in_image"])

No key? Pay per call

An unpaid call answers 402 with the price ($0.006). Any x402 client pays it in USDC on Base. Failed calls are never charged. Same tool over MCP: describe_image at https://mcp.aipaygen.com/mcp. All tools and prices: docs.