# Reading the embedded images

> mdapi.io - Minimal Data API I/O: a content transformation layer primitive for AI systems.
>
> Transforms files and webpages into AI-ready Markdown and structured data, optimized for LLM efficiency and token usage.

The images a document carries - inline on GET, indexed in `attachments[]` on POST.

`attachments=all` keeps the images the document carries instead of dropping them: on GET they arrive inline in the markdown, on POST the same images come back as the `attachments[]` index, one entry per image, described well enough to triage an image before it is transferred or looked at. A selection (`1,4-5`) takes those ids only, ordered by the document. `ocr=all | 1,4-5` is the separate paid pass that prints the recognized text of the selected images under their placeholders. A document whose pages are pictures and carry no text layer is read page by page by that pass. A field is present only when the format let us know it, so an absent field never means zero. The model input of such a request is the text alone - the images go back into the answer after that input has been cut - so reading a picture is a separate capability, not this index.

- `name` - The image's own name when the document carries one, otherwise its `img-N` placeholder - the same string the markdown uses as alt text
- `mimeType` - The image type (`image/png`, `image/jpeg`, ...)
- `size` - Length in bytes - what fetching this one image would transfer
- `placeholder` - The `img-N` token this entry replaced in the markdown. That reference resolves to an inline data URI, or to `url` when `ttl` is set
- `width` / `height` - Pixel size read from the image header. Absent when the header could not be read; the two are always present together or both absent, and an absent pair never means zero pixels
- `units[]` - Where the image sat in the source, when the container itself names a unit: `{kind, index}`, `kind` = `slide` or `sheet`, plus `name` for sheets. Only the two legacy binary containers that carry a named unit produce it - legacy PPT (slides) and legacy XLS (sheets). It is a label on top of the universal position, not a second one: `part` is present for every format, and a format without named units simply omits `units` while still carrying `part`. One image reused on several units is ONE entry carrying several of them - looking at it once answers for every place it sits on. Word (DOC) images carry no unit: their anchor is a per-character reference the native extractor does not read, so they arrive as one block at the end
- `part` - The document part this image's placeholder stands in, counted by the same boundaries `part` selects by - so `part=7` is exactly the request that brings this image. Absent for an archive read by parts, whose chapters are numbered by the archive and not by the markdown the request received. An image the document reuses carries the part it first appears in
- `url` / `expiresAt` - Link mode only (an explicit `ttl`): the temporary `GET /att/{id}` link and when it stops working. Inline mode carries neither - the bytes are already in the markdown, and the array stays an index without them

The index describes the answer, never the document: only the images whose placeholder stands in the markdown being returned are listed, and only those are resolved - so `part=35` over a 500-page report lists and encodes the pictures of page 35 and leaves the other 199 alone. Without `part` the answer is the whole document and the index is the whole inventory. `find` and `result=meta` answer with the index and no bytes at all: they name which part each image sits in, and `part=N&attachments=all` then brings the bytes of the one worth having.

```json
{
  "success": true,
  "attachments": [
    {
      "name": "chart-q3.png",
      "mimeType": "image/png",
      "size": 48213,
      "placeholder": "img-3",
      "width": 1240,
      "height": 720,
      "part": 7,
      "url": "https://mdapi.io/att/<id>",
      "expiresAt": "2027-01-01T00:00:00.000Z"
    }
  ]
}
```

A field is present only when the format allowed us to know it - the office, PDF, HTML/RTF and legacy DOC/XLS/PPT readers differ in what they record, and an absent `width`/`height` or `units` never means zero or none. Asking for attachments adds no model work: the images are kept instead of dropped on the way through. The model input of that request is the text alone - the images are put back into the answer after that input has been cut - so asking a model what a picture shows is a separate capability, not something this request does.

## Links

- **About service:** https://mdapi.io/about
- **Privacy:** https://mdapi.io/privacy
- **Contact:** https://mdapi.io/contact
- **Agent entry point:** https://mdapi.io/AGENTS.md or https://mdapi.io/agents.md or https://mdapi.io/agent.md
- **Agent access:** https://mdapi.io/auth.md
- **API documentation and conversion:** https://mdapi.io
- **MCP server manifest:** https://mdapi.io/mcp
- **Health check:** https://mdapi.io/health
- **Documentation index:** https://mdapi.io/llms.txt
- **Full API documentation:** https://mdapi.io/llms-full.txt
- **AI discovery:** https://mdapi.io/.well-known/ai-discovery.json or https://mdapi.io/ai-discovery.json
- **AI Agent discovery:** https://mdapi.io/.well-known/agent.json or https://mdapi.io/agent.json
- **A2A Agent card:** https://mdapi.io/.well-known/agent-card.json or https://mdapi.io/agent-card.json
- **ACP manifest:** https://mdapi.io/.well-known/acp.json or https://mdapi.io/acp.json
- **x402 payment manifest:** https://mdapi.io/.well-known/x402.json or https://mdapi.io/x402.json or https://mdapi.io/.well-known/x402
- **OpenAPI specification (JSON):** https://mdapi.io/.well-known/openapi.json or https://mdapi.io/openapi.json
- **OpenAPI specification (YAML):** https://mdapi.io/.well-known/openapi.yaml or https://mdapi.io/openapi.yaml
- **MAPI specification:** https://mdapi.io/.well-known/mapi.md or https://mdapi.io/mapi.md
- **Skill specification:** https://mdapi.io/.well-known/skill.md or https://mdapi.io/skill.md
- **ARD manifest:** https://mdapi.io/.well-known/ard.json or https://mdapi.io/.well-known/ai-catalog.json or https://mdapi.io/ard.json
- **Agent Plugins manifest:** https://mdapi.io/.well-known/plugin/plugin.json or https://mdapi.io/.well-known/plugin.json
- **Agent Plugins MCP config:** https://mdapi.io/.well-known/plugin/mcp.json
- **Agent Plugins conversion skill:** https://mdapi.io/.well-known/plugin/skills/mdapi-conversion/SKILL.md
- **API documentation pages:** https://mdapi.io/docs
- **Example pages:** https://mdapi.io/docs/examples

## External Links

- **github.com** https://github.com/mdapiio/mdapi.io
- **skills.sh** https://www.skills.sh/mdapiio/mdapi.io
- **skillsmp.com** https://skillsmp.com/creators/mdapiio/mdapi.io
- **clawhub.ai** https://clawhub.ai/mdapiio
- **x.com** https://x.com/mdapiio

## Disclaimer

**The service is provided "AS IS".**


> mdapi.io is an edge-native service-transport primitive for AI, autonomous agents, and the Web4 ecosystem.
