---
title: "Get safetensors metadata"
method: GET
path: "/api/models/{namespace}/{repo}/safetensors-metadata/{path}"
tags: ["models"]
---

# Get safetensors metadata

`GET /api/models/{namespace}/{repo}/safetensors-metadata/{path}`

## Request

- Base URL: `https://huggingface.co`
- URL: `https://huggingface.co/api/models/{namespace}/{repo}/safetensors-metadata/{path}`
- Auth: HTTP bearer

Get the parsed headers of all the shards of a sharded safetensors model in a single request, instead of reading the index and then the header of every shard.

Only the `main` revision is served: the `ETag` is the commit sha of `main`, and requests with a matching `If-None-Match` get a 304. Returns 400 when the path isn't a `.safetensors.index.json` file and 422 when the files can't be parsed.

The response is brotli-compressed when the client accepts it, otherwise gzip-compressed or plain JSON.

## Path parameters

- `namespace` string, required
- `repo` string, required
- `path` string, required: Wildcard path parameter

## Response `200`

Parsed headers of the shards of a sharded safetensors model

- object
  - `sharded` true, required
  - `index` object, required: The index file, without its `weight_map`: each shard header lists its tensors
    - `metadata` object
  - `headers` object, required: The header of each shard, by shard file name: `__metadata__`, then the `dtype`, `shape` and `data_offsets` of each tensor
  - `parameterCount` object, required: Number of parameters per dtype
  - `parameterTotal` integer
  - `filepaths` string[], required: The index file, then every shard file

## Changes

- **2026-10-15** `b7d9dd357082`: 1 info
  - endpoint added

[Operation history](https://skmtc.dev/huggingface/apis/hub-api-endpoints/changes/api/models/:namespace/:repo/safetensors-metadata/:path/get.md)

---

[API](https://skmtc.dev/huggingface/apis/hub-api-endpoints.md) - [All operations](https://skmtc.dev/huggingface/apis/hub-api-endpoints/llms.txt) - [OpenAPI document](https://skmtc.dev/huggingface/apis/hub-api-endpoints/revisions/5cabdcc8a394?raw)
