# Create samples

URL: https://docs.hanzo.ai/docs/openapi/compute/recordfleetsample

> Records a BYO worker's live GPU utilization into the SAME series the fleet board overlays.

`POST /v1/compute/fleet/samples`

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

|               |                                                 |
| ------------- | ----------------------------------------------- |
| **Address**   | `https://api.hanzo.ai/v1/compute/fleet/samples` |
| **Method**    | `POST`                                          |
| **Operation** | `recordFleetSample`                             |
| **Auth**      | `Authorization: Bearer $HANZO_API_KEY`          |

Records a BYO worker's live GPU utilization into the SAME series the
fleet board overlays. The org is the validated principal and source/kind are fixed
server-side, so a worker names only its own metrics — never another tenant or
another source. Answers 202: the warehouse write is DETACHED (its own bounded
context, never in the response path), so a slow or absent warehouse cannot stall a
heartbeat.

## Request

7 fields, body `application/json` (required).

| Field      | In   | Type            | Required | Description                                                                                                          |
| ---------- | ---- | --------------- | -------- | -------------------------------------------------------------------------------------------------------------------- |
| `gpuModel` | body | string          | —        | GPUModel names the representative accelerator ("GB10"); GPUs carries how many.                                       |
| `gpuUtil`  | body | number (double) | —        | GPUUtil is accelerator utilization as a fraction 0..1; the warehouse clamps anything outside that.                   |
| `gpus`     | body | integer (int64) | —        | GPUs is how many accelerators this reading covers.                                                                   |
| `host`     | body | string          | —        | Host is the node's hostname, for display.                                                                            |
| `memFree`  | body | integer (int64) | —        | MemFree is host memory still available, in BYTES.                                                                    |
| `memUsed`  | body | integer (int64) | —        | MemUsed is host memory in use, in BYTES.                                                                             |
| `unit`     | body | string          | —        | Unit is the reporting node's own id — the same id it registered under, and the key the board joins this series onto. |

## Response

| Status    | Body                   | Meaning |
| --------- | ---------------------- | ------- |
| `200`     | compute.sampleAccepted | ok      |
| `default` | problem-details        | refused |

`200` body — 1 field.

| Field      | In   | Type    | Always | Description                                                                                                                                 |
| ---------- | ---- | ------- | ------ | ------------------------------------------------------------------------------------------------------------------------------------------- |
| `recorded` | body | boolean | —      | Recorded is always true: the response is an acknowledgement, and the warehouse write is detached, so it reports acceptance, not durability. |

Failure carries the platform error shape — see [Errors](https://docs.hanzo.ai/docs/errors).

## Examples

**CLI**

```bash
hanzo compute fleet samples create
```

**SDK**

**.ts**

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

const api = new ComputeApi(new Configuration({ accessToken: process.env.HANZO_API_KEY }));
const { data } = await api.recordFleetSample({ gpuModel: "<gpuModel>", gpuUtil: 0 });
```

**.py**

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

client = ApiClient(Configuration(access_token=os.environ["HANZO_API_KEY"]))
result = ComputeApi(client).record_fleet_sample(gpu_model="<gpuModel>", gpu_util=0)
```

**.go**

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

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

**.rs**

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

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

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

**.java**

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

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

var result = new ComputeApi(client).recordFleetSample();
```

**HTTP**

```bash
curl -X POST https://api.hanzo.ai/v1/compute/fleet/samples \
  -H "Authorization: Bearer $HANZO_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
       "gpuModel": "<gpuModel>",
       "gpuUtil": 0
     }'
```

**MCP**

Tool `compute`, op `recordFleetSample` — POST the JSON-RPC envelope to `https://api.hanzo.ai/v1/mcp`.

```bash
curl -X POST https://api.hanzo.ai/v1/mcp \
  -H "Authorization: Bearer $HANZO_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
       "jsonrpc": "2.0",
       "id": 1,
       "method": "tools/call",
       "params": {
         "name": "compute",
         "arguments": {
           "op": "recordFleetSample",
           "input": {
             "gpuModel": "<gpuModel>",
             "gpuUtil": 0
           }
         }
       }
     }'
```

---

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