# Library

URL: https://docs.hanzo.ai/docs/openapi/library

> The Library: everything a person made, in one place.

Also for this capability: **API** · [CLI](https://docs.hanzo.ai/docs/cli/library) · [MCP](https://docs.hanzo.ai/docs/mcp-tools/library) · [SDKs](https://docs.hanzo.ai/docs/sdks)

The Library: everything a person made, in one place.

> [All API references →](https://docs.hanzo.ai/docs/openapi) · [Get started →](https://docs.hanzo.ai/docs/guides)

|                |                                        |
| -------------- | -------------------------------------- |
| **Base URL**   | `https://api.hanzo.ai`                 |
| **Operations** | 6                                      |
| **Auth**       | `Authorization: Bearer $HANZO_API_KEY` |

## Specification

Specification pending — no HIP in [hanzoai/hips](https://github.com/hanzoai/hips) declares `capability: library` yet. What this capability serves is below, from the API document; what it is — the store it owns, how it meters, what it publishes — is written as a HIP under HIP-0139.

## Four surfaces

| Surface  | Reaches this capability as                      | Coverage                                                                  |
| -------- | ----------------------------------------------- | ------------------------------------------------------------------------- |
| **REST** | `library` at its own prefix                     | 6 operations                                                              |
| **CLI**  | `hanzo library …`                               | 6 of 6                                                                    |
| **SDK**  | `LibraryApi` in every published client          | 6 methods                                                                 |
| **MCP**  | tool `library` on `https://api.hanzo.ai/v1/mcp` | 6 operations, 2 under the document's own id — ask `describe` for the rest |

## Quickstart

```bash
export HANZO_API_KEY=sk-...   # console.hanzo.ai → API keys
```

Then the first call — a read that needs nothing but the key. `GET /v1/library`, operation `get_library`:

**CLI**

```bash
hanzo library list
```

**SDK**

**.ts**

```ts
import { Configuration, LibraryApi } from 'hanzoai';

const api = new LibraryApi(new Configuration({ accessToken: process.env.HANZO_API_KEY }));
const { data } = await api.getLibrary();
```

**.py**

```python
from hanzoai.cloud import ApiClient, Configuration
from hanzoai.cloud.api import LibraryApi

client = ApiClient(Configuration(access_token=os.environ["HANZO_API_KEY"]))
result = LibraryApi(client).get_library()
```

**.go**

```go
cfg := hanzoai.NewConfiguration()
cfg.AddDefaultHeader("Authorization", "Bearer "+os.Getenv("HANZO_API_KEY"))
client := hanzoai.NewAPIClient(cfg)

resp, _, err := client.LibraryAPI.GetLibrary(context.Background()).Execute()
if err != nil {
	return err
}
```

**.rs**

```rust
use hanzo_client::apis::{configuration::Configuration, library_api};

let mut cfg = Configuration::new();
cfg.bearer_access_token = std::env::var("HANZO_API_KEY").ok();

let result = library_api::get_library(&cfg, Default::default()).await?;
```

**.java**

```java
import ai.hanzo.cloud.ApiClient;
import ai.hanzo.cloud.api.LibraryApi;

ApiClient client = new ApiClient();
client.setBearerToken(System.getenv("HANZO_API_KEY"));

var result = new LibraryApi(client).getLibrary();
```

**HTTP**

```bash
curl https://api.hanzo.ai/v1/library \
  -H "Authorization: Bearer $HANZO_API_KEY"
```

**MCP**

MCP reaches **library** through the `library` tool, which names its 6 operations with its own verbs — this one among them, under a name only MCP declares. `describe` explains any of them:

```bash
curl -X POST https://api.hanzo.ai/v1/mcp \
  -H "Content-Type: application/json" \
  -d '{
       "jsonrpc": "2.0",
       "id": 1,
       "method": "tools/call",
       "params": {
         "name": "describe",
         "arguments": {
           "op": "list_libraries"
         }
       }
     }'
```

Answers `200` with `object` — ok.

## Endpoints

| Endpoint                                                                                     | What it does                                                                                                                                        |
| -------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------- |
| [`GET /v1/library/{id}`](https://docs.hanzo.ai/docs/openapi/library/get-library-by-id)       | Reads one item with fresh signed URLs.                                                                                                              |
| [`PATCH /v1/library/{id}`](https://docs.hanzo.ai/docs/openapi/library/patch-library-by-id)   | Renames one of your items, shares it with your organization or stops sharing it, moves it to a project, or commits a reserved upload.               |
| [`DELETE /v1/library/{id}`](https://docs.hanzo.ai/docs/openapi/library/delete-library-by-id) | Deletes one of your items and its bytes.                                                                                                            |
| [`GET /v1/library/unowned`](https://docs.hanzo.ai/docs/openapi/library/get-library-unowned)  | Reads, for a SuperAdmin alone, the organization's items that record no owner.                                                                       |
| [`GET /v1/library`](https://docs.hanzo.ai/docs/openapi/library/get-library)                  | Lists what you made and what members of your organization shared with you, newest first.                                                            |
| [`POST /v1/library`](https://docs.hanzo.ai/docs/openapi/library/post-library)                | Keeps one thing you made in your Library: its bytes go to your own prefix of the Library's store, and it is listed to you alone until you share it. |

---

[All Hanzo APIs](https://docs.hanzo.ai/docs/openapi) · [Interactive reference](https://docs.hanzo.ai/docs/openapi/reference)
