> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://hiddenlayer.ferndocs.com/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://hiddenlayer.ferndocs.com/_mcp/server.

# Get file by SHA256

GET https://api.hiddenlayer.ai/model-intel/v1/file/{sha256}

Retrieve detailed file information including all associated instances, repositories, and metadata

Reference: https://hiddenlayer.ferndocs.com/api-reference/llm-proxy-api/model-intelligence/get-file

## Authentication

- `Authorization` header (bearer token, required) — Bearer authentication of the form `Bearer <token>`, where token is your auth token.

## Servers

- `https://api.hiddenlayer.ai` (ProdUs, default)
- `https://api.eu.hiddenlayer.ai` (ProdEu)

## Request

### Path parameters

- `sha256` (string, required) — SHA256 hash of the file (64 hexadecimal characters)

### Query parameters

- `page_size` (integer, optional, default: 25) — Number of items to return per page
- `cursor` (string, optional) — Cursor for pagination, used to navigate through pages of results

## Response

### 200

File found and returned successfully

- `first` (string, required) — Pagination cursor pointing to the first page.
- `prev` (string, required) — Pagination cursor pointing to the previous page.
- `next` (string, required) — Pagination cursor pointing to the next page.
- `last` (string, optional) — Pagination cursor pointing to the last page.
- `file_instances` (list of FileInstanceFull, optional)

## Errors

### 422 Unprocessable Entity Error

Invalid SHA256 Parameter

- `errors` (list of ProblemDetailsErrorsItems, required) — Error details
- `type` (string, optional) — https://www.rfc-editor.org/rfc/rfc9457.html#name-type
- `title` (string, optional) — https://www.rfc-editor.org/rfc/rfc9457.html#name-title
- `detail` (string, optional) — https://www.rfc-editor.org/rfc/rfc9457.html#name-detail
- `instance` (string, optional) — https://www.rfc-editor.org/rfc/rfc9457.html#name-instance

## Types

### FileInstanceFull

- `instance` (FileInstance, required)
- `repo_revision` (RepoRevision, required)
- `repository` (Repository, required)
- `repo_owner` (Contributor, required)
- `licenses` (list of License, required)
- `use_policies` (list of UsePolicy, required)

### ProblemDetailsErrorsItems

- `code` (string, optional)
- `detail` (string, optional)
- `pointer` (list of string, optional) — array of JSON Pointers

### FileInstance

- `sha256` (string, required) — SHA256 hash of the file
- `revision_id` (string, required) — UUID of the repository revision
- `path` (string, required) — File path within the repository
- `source` (string, required) — Source of the file instance
- `tags` (list of string, required) — Tags associated with the file instance
- `created_at` (datetime, required) — Timestamp when the file instance was created
- `updated_at` (datetime, required) — Timestamp when the file instance was last updated
- `committed_date` (datetime, optional) — Date when the file was committed to the repository

### RepoRevision

- `id` (string, required) — UUID of the repository revision
- `repository_id` (string, required) — UUID of the repository
- `commit_hash` (string, required) — Git commit hash
- `metadata` (map from string to any, required) — Additional metadata for the revision
- `fetched_at` (datetime, required) — Timestamp when the revision was fetched
- `created_at` (datetime, required) — Timestamp when the revision was created
- `updated_at` (datetime, required) — Timestamp when the revision was last updated

### Repository

- `id` (string, required) — UUID of the repository
- `owner_id` (string, required) — UUID of the repository owner
- `url` (string, required) — URL of the repository
- `architectures` (list of string, required) — Supported architectures
- `modalities` (list of string, required) — Supported modalities
- `tags` (list of string, required) — Tags associated with the repository
- `metadata` (map from string to any, required) — Additional metadata for the repository
- `created_at` (datetime, required) — Timestamp when the repository was created
- `updated_at` (datetime, required) — Timestamp when the repository was last updated
- `name` (string, optional) — Name of the repository
- `description` (string, optional) — Description of the repository

### Contributor

- `id` (string, required) — UUID of the contributor
- `handle` (string, required) — Handle or username of the contributor
- `kind` (string, required) — Type of contributor
- `homepage_url` (string, required) — Homepage URL of the contributor
- `trust_level` (string, required) — Trust level of the contributor
- `country` (string, required) — Country of the contributor
- `source` (string, required) — Source platform of the contributor
- `tags` (list of string, required) — Tags associated with the contributor
- `metadata` (map from string to any, required) — Additional metadata for the contributor
- `created_at` (datetime, required) — Timestamp when the contributor was created
- `updated_at` (datetime, required) — Timestamp when the contributor was last updated
- `display_name` (string, optional) — Display name of the contributor

### License

- `id` (string, required) — UUID of the license
- `name` (string, required) — Name of the license
- `version` (string, required) — Version of the license
- `url` (string, required) — URL of the license
- `sha256` (string, required) — SHA256 hash of the license text
- `created_at` (datetime, required) — Timestamp when the license was created
- `updated_at` (datetime, required) — Timestamp when the license was last updated
- `spdx_id` (string, optional) — SPDX identifier for the license
- `description` (string, optional) — Description of the license

### UsePolicy

- `id` (string, required) — UUID of the use policy
- `title` (string, required) — Title of the use policy
- `url` (string, required) — URL of the use policy
- `sha256` (string, required) — SHA256 hash of the policy text
- `created_at` (datetime, required) — Timestamp when the use policy was created
- `updated_at` (datetime, required) — Timestamp when the use policy was last updated
- `description` (string, optional) — Description of the use policy

## Examples

**Response**

```json
{
  "first": "string",
  "prev": "string",
  "next": "string",
  "last": "string",
  "file_instances": [
    {
      "instance": {
        "sha256": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",
        "revision_id": "550e8400-e29b-41d4-a716-446655440000",
        "path": "onnx_files/model.onnx",
        "source": "github",
        "tags": [
          "code",
          "onnx"
        ],
        "created_at": "2024-01-15T10:30:00Z",
        "updated_at": "2024-01-15T10:30:00Z",
        "committed_date": "2024-01-10T08:00:00Z"
      },
      "repo_revision": {
        "id": "550e8400-e29b-41d4-a716-446655440000",
        "repository_id": "550e8400-e29b-41d4-a716-446655440001",
        "commit_hash": "a1b2c3d4e5f6789012345678901234567890abcd",
        "metadata": {
          "branch": "main",
          "author": "john.doe"
        },
        "fetched_at": "2024-01-15T10:30:00Z",
        "created_at": "2024-01-15T10:30:00Z",
        "updated_at": "2024-01-15T10:30:00Z"
      },
      "repository": {
        "id": "550e8400-e29b-41d4-a716-446655440000",
        "owner_id": "550e8400-e29b-41d4-a716-446655440001",
        "url": "https://github.com/user/my-awesome-project",
        "architectures": [
          "transformer",
          "cnn"
        ],
        "modalities": [
          "text",
          "image"
        ],
        "tags": [
          "machine-learning",
          "nlp"
        ],
        "metadata": {
          "language": "Python",
          "framework": "PyTorch"
        },
        "created_at": "2024-01-15T10:30:00Z",
        "updated_at": "2024-01-15T10:30:00Z",
        "name": "my-awesome-project",
        "description": "An awesome project for doing awesome things"
      },
      "repo_owner": {
        "id": "550e8400-e29b-41d4-a716-446655440000",
        "handle": "john_doe",
        "kind": "user",
        "homepage_url": "https://johndoe.com",
        "trust_level": "verified",
        "country": "US",
        "source": "github",
        "tags": [
          "developer",
          "ml-engineer"
        ],
        "metadata": {
          "github_followers": 1000,
          "company": "Tech Corp"
        },
        "created_at": "2024-01-15T10:30:00Z",
        "updated_at": "2024-01-15T10:30:00Z",
        "display_name": "John Doe"
      },
      "licenses": [
        {
          "id": "550e8400-e29b-41d4-a716-446655440000",
          "name": "MIT License",
          "version": "1.0",
          "url": "https://opensource.org/licenses/MIT",
          "sha256": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",
          "created_at": "2024-01-15T10:30:00Z",
          "updated_at": "2024-01-15T10:30:00Z",
          "spdx_id": "MIT",
          "description": "A permissive license that allows for commercial use"
        }
      ],
      "use_policies": [
        {
          "id": "550e8400-e29b-41d4-a716-446655440000",
          "title": "Commercial Use Policy",
          "url": "https://example.com/use-policy",
          "sha256": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",
          "created_at": "2024-01-15T10:30:00Z",
          "updated_at": "2024-01-15T10:30:00Z",
          "description": "Policy governing commercial use of the content"
        }
      ]
    }
  ]
}
```

**SDK Code**

```python
import requests

url = "https://api.hiddenlayer.ai/model-intel/v1/file/e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"

headers = {"Authorization": "Bearer <token>"}

response = requests.get(url, headers=headers)

print(response.json())
```

```javascript
const url = 'https://api.hiddenlayer.ai/model-intel/v1/file/e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855';
const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go
package main

import (
	"fmt"
	"net/http"
	"io"
)

func main() {

	url := "https://api.hiddenlayer.ai/model-intel/v1/file/e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"

	req, _ := http.NewRequest("GET", url, nil)

	req.Header.Add("Authorization", "Bearer <token>")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby
require 'uri'
require 'net/http'

url = URI("https://api.hiddenlayer.ai/model-intel/v1/file/e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'

response = http.request(request)
puts response.read_body
```

```java
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.get("https://api.hiddenlayer.ai/model-intel/v1/file/e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855")
  .header("Authorization", "Bearer <token>")
  .asString();
```

```php
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('GET', 'https://api.hiddenlayer.ai/model-intel/v1/file/e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855', [
  'headers' => [
    'Authorization' => 'Bearer <token>',
  ],
]);

echo $response->getBody();
```

```csharp
using RestSharp;

var client = new RestClient("https://api.hiddenlayer.ai/model-intel/v1/file/e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855");
var request = new RestRequest(Method.GET);
request.AddHeader("Authorization", "Bearer <token>");
IRestResponse response = client.Execute(request);
```

```swift
import Foundation

let headers = ["Authorization": "Bearer <token>"]

let request = NSMutableURLRequest(url: NSURL(string: "https://api.hiddenlayer.ai/model-intel/v1/file/e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "GET"
request.allHTTPHeaderFields = headers

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```