# Reading the embedded images

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

`includes=attachments` returns the images a document carries. On GET the markdown holds them directly; on POST the same images come back in `attachments[]`, an index describing each one, so an image can be judged before it is transferred or looked at.

| Field               | Meaning                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  |
| ------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `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&includes=attachments` 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
- **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
- **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
- **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

## 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.
