# Usage Examples
## Basic Usage
This example shows the basic usage of Thanix for its intended
use case of generating a NetBox API client.
```bash
curl -o netbox-schema.yaml https://demo.netbox.dev/api/schema
thanix netbox-schema.yaml -o netbox-client
```
This creates a complete Rust crate at `./netbox-client/` with:
- `src/types.rs` — All API object structs
- `src/paths.rs` — All API endpoint functions
- `src/util.rs` — `ThanixClient` struct and helpers
- `src/lib.rs` — Crate root
- `Cargo.toml` — Package manifest
- `build.rs` — Version embedding from `Cargo.toml`
## Using the Generated Client
```rust
use netbox_client::util::ThanixClient;
use netbox_client::paths::*;
let client = ThanixClient::new("https://demo.netbox.dev");
client.auth_header_value = Some("Token abc123def456".into());
let sites = dcim_sites_list(&client, Default::default())?;
```
## Custom API
```bash
thanix my-api-schema.yaml -o my-api-client --patch-prefix Update
```
```rust
use my_api_client::util::ThanixClient;
use my_api_client::paths::*;
let client = ThanixClient::new("https://api.my-service.com");
client.auth_header_value = Some("Bearer my-jwt-token".into());
let users = users_list(&client, Default::default())?;
```
## With Workaround Mode
If the API returns inconsistent null values:
```bash
thanix my-schema.yaml -o my-client --workaround
```