---
title: "Image To Text"
method: POST
path: "/api/generate/image-to-text"
tags: ["generate"]
---

# Image To Text

`POST /api/generate/image-to-text`

## Request

- The document declares no server URL.
- Auth: none declared

Transform image files to text.

## Request body `multipart/form-data`

- BodyGenImageToText
  - `image` string, binary, required: Uploaded image to transform with the pipeline.
  - `prompt` string: Text prompt(s) to guide transformation.
  - `model_id` string, required: Hugging Face model ID used for transformation.

## Response `200`

Successful Response

- ImageToTextResponse: Response model for text generation.
  - `text` string, required: The generated text.

## Other responses

- `400`: Bad Request
- `401`: Unauthorized
- `413`: Request Entity Too Large
- `422`: Validation Error
- `500`: Internal Server Error
- `default`: Error

## Changes

- **2025-10-30** `dfc937fc0d2c`: 8 breaking, 4 info
  - the `oneOf[subschema #1: HTTPError]/detail` response's property type changed from `object` to no type for status `400`
  - the `oneOf[subschema #1: HTTPError]/detail` response's property type changed from `object` to no type for status `401`
  - the `oneOf[subschema #1: HTTPError]/detail` response's property type changed from `object` to no type for status `413`
  - the `oneOf[subschema #1: HTTPError]/detail` response's property type changed from `object` to no type for status `500`
  - …8 more
- **2025-10-30** `f5d01b71ba9a`: 4 breaking, 8 info
  - the `oneOf[subschema #1: HTTPError]/detail` response's property type changed from no type to `object` for status `400`
  - the `oneOf[subschema #1: HTTPError]/detail` response's property type changed from no type to `object` for status `401`
  - the `oneOf[subschema #1: HTTPError]/detail` response's property type changed from no type to `object` for status `413`
  - the `oneOf[subschema #1: HTTPError]/detail` response's property type changed from no type to `object` for status `500`
  - …8 more
- **2025-10-28** `dfc937fc0d2c`: 1 info
  - endpoint added

[Operation history](https://skmtc.dev/livepeer/apis/livepeer-ai-api/changes/api/generate/image-to-text/post.md)

---

[API](https://skmtc.dev/livepeer/apis/livepeer-ai-api.md) - [All operations](https://skmtc.dev/livepeer/apis/livepeer-ai-api/llms.txt) - [OpenAPI document](https://skmtc.dev/livepeer/apis/livepeer-ai-api/revisions/dfc937fc0d2c?raw)
