# GET /image/caption: $0.008 per call

Describe an image for an AI agent: a caption (short) or a detailed description of the scene, objects, text, colours and layout, plus alt text. JPEG, PNG, GIF or WebP up to 5 MB from a public URL. People are described generically, never identified.

- **Price:** $0.008 in USDC, the same on Base, Solana, Polygon, Arbitrum. Failed calls are never charged.
- **Free trial:** yes, 20 free calls a day from Claude, Cursor or any MCP client ([set-up](/mcp/setup)).
- **Tier:** live
- **Answers cached for:** 1 day(s)
- **Data sources:** Workers AI: Llama 3.2 11B Vision (metered)
- **Lane:** AI media ([OpenAPI](/openapi/ai-media.json))
- **Live health:** [status page](/status)

## Free sample

See an answer for the demo input first, free (no payment, 10 a minute): [https://aayatai.com/sample/image-caption](/sample/image-caption). It is a stored real answer when we have one, otherwise an example marked `"kind": "illustrative"`.

```bash
curl "https://aayatai.com/sample/image-caption"
```

## 1. See the price (free)

Call it without paying: you get `402 Payment Required` and a `PAYMENT-REQUIRED` header with the exact price and where to pay.

```bash
curl -i "https://aayatai.com/image/caption?url=https%3A%2F%2Faayatai.com%2Fexamples%2Fsign.png"
```

## 2. Pay and call (TypeScript)

```bash
npm install @x402/fetch @x402/evm viem
```

```ts
import { wrapFetchWithPaymentFromConfig } from "@x402/fetch";
import { ExactEvmScheme } from "@x402/evm";
import { privateKeyToAccount } from "viem/accounts";

// A wallet used only by your agent, holding a little USDC on Base.
const account = privateKeyToAccount(process.env.WALLET_PRIVATE_KEY as `0x${string}`);
const pay = wrapFetchWithPaymentFromConfig(fetch, {
  schemes: [{ network: "eip155:8453", client: new ExactEvmScheme(account) }],
});

const res = await pay("https://aayatai.com/image/caption?url=https%3A%2F%2Faayatai.com%2Fexamples%2Fsign.png");
console.log(await res.json());
```

## 3. Or as an MCP tool

```ts
// MCP server: https://aayatai.com/mcp (Streamable HTTP). With the x402 MCP client (see /start):
const result = await client.callTool("image-caption", {"url":"https://aayatai.com/examples/sign.png"});
```

## Inputs

- `url` **(required)** (string): Public image URL (JPEG, PNG, GIF or WebP, up to 5 MB).
- `detail` (string; one of `short`, `detailed`; default `short`): short = one or two sentences; detailed = a full description.

Bad inputs are rejected with HTTP 400 before any payment is asked for.

## Example answer

Example only: the shape of an answer, with placeholder addresses and made-up figures. It is not data about any real token or wallet; call the service (or its free sample) for real results.

```json
{
  "url": "https://aayatai.com/examples/sign.png",
  "caption": "A blue rectangular sign with white text reading OPEN, Mon–Fri 9am – 5pm.",
  "altText": "Blue OPEN sign with weekday opening hours",
  "model": "@cf/meta/llama-3.2-11b-vision-instruct"
}
```

## Related

- [GET /image/ocr](/services/image-ocr) ($0.01): Read the text in an image (OCR): screenshots, photos of signs, receipts, slides, scanned pages.

New here? [Getting started in 60 seconds](/start). All services: [Aayat AI](/).