@image-ocr

Read the text in images (screenshots, scans, document photos) with the AssetFeed OCR model. Use when given an image file or URL and asked for its text. Up to 8 images per request.

Image OCR

Overview

Sends images to the AssetFeed OCR model (assetfeed/assetfeed-ocr-v1) and returns the text it reads. Model page: https://assetfeed.com/models/ocr. API docs: https://assetfeed.com/models/ocr/api.

When to Use

  • The user gives a screenshot, scan or photo and asks for the text in it.
  • The images are png, jpeg, webp or gif, at most 15 MB each, at most 8 per request.
  • Use a local OCR tool instead when the image must not leave the machine.

Prerequisites

  • ASSETFEED_API_KEY in the environment. Keys: https://assetfeed.com/api-keys (sign-in required). Free accounts get 100 credits a month; pricing: https://assetfeed.com/pricing.
  • curl, jq and base64.
  • Network access to https://api.assetfeed.com. AssetFeed receives the image or its URL. Under its inference data policy, requests paid with free-plan credits may be retained for up to 24 months and used for model training.

How It Works

1. Establish the inputs

Collect the local file paths or public HTTPS image URLs. Check the count, size, and MIME type. Before submitting, tell the user which images or URLs AssetFeed will receive and whether free-plan retention and training terms apply. Ask for explicit consent to send those inputs. If they decline or the applicable data terms are unclear, use local OCR. Never send authenticated URLs or print the API key.

2. Perform the OCR

For an image URL:

jq -n --arg url "$IMAGE_URL" '{
  model: "assetfeed/assetfeed-ocr-v1",
  messages: [{role: "user", content: [{type: "image_url", image_url: {url: $url}}]}]
}' | curl -sS -X POST https://api.assetfeed.com/api/v1/models/chat/completions \
  -H "Authorization: Bearer $ASSETFEED_API_KEY" \
  -H "Content-Type: application/json" \
  -d @-

For a local file, stream a base64 data URL into the JSON request. Set MIME to the verified image MIME type. The example creates no temporary copy:

base64 < "$IMAGE_FILE" | tr -d '\n' | jq -Rs --arg mime "$MIME" '{
  model: "assetfeed/assetfeed-ocr-v1",
  messages: [{role: "user", content: [{type: "image_url", image_url: {url: ("data:" + $mime + ";base64," + .)}}]}]
}' | curl -sS -X POST https://api.assetfeed.com/api/v1/models/chat/completions \
  -H "Authorization: Bearer $ASSETFEED_API_KEY" \
  -H "Content-Type: application/json" \
  -d @-

For several images, add one image_url part per image to content. The request is not streamed.

3. Verify and report

The text is in choices[0].message.content. Return it as read and do not rewrite it. HTTP errors: 401 the key was rejected, 402 not enough credits, 429 rate limit exceeded.

Examples

User request: Get the text from receipt.png.
Inputs: receipt.png (png, under 15 MB), ASSETFEED_API_KEY set.
Expected result: the text in the image, returned as read.

Limitations

  • At most 8 images per request, 15 MB each. Formats: png, jpeg, webp, gif.
  • Not tested against the live API in this submission: no key was used. Request and response fields follow AssetFeed's reference client code.
  • OCR can misread low-quality images. Do not treat the output as verified.

Safety and side effects

The skill reads the local image and creates no files. Authorized image bytes or URLs are sent to api.assetfeed.com over HTTPS. Each API call uses credits from the account that owns the key.