# Halowerk Scrap Margin Calculator

> Halowerk Scrap Margin Calculator is a paid API for AI agents from material.halowerk.com, paid per call via x402, $0.003/call, status unknown (last checked 2026-10-13).

Calculates scrap margin for material or manufacturing inputs, returning margin/profitability data for scrap material transactions

## Facts

- Endpoint: POST https://material.halowerk.com/scrap-margin?utm_source=zero.xyz
- Price: $0.003/call
- Payment: x402
- Status: unknown
- Last checked: 2026-10-13
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/halowerk-scrap-margin-calculator-0d367761
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_wDHGwAZaYcF_YgWVuyDVY

Status and success rate cover calls made through Zero and Zero's own probes. Third-party monitors may report differently.

## How to call it through Zero

Zero handles the 402 payment challenge and records the run. With the Zero CLI installed (`npm i -g @zeroxyz/cli`):

```sh
zero fetch --capability halowerk-scrap-margin-calculator-0d367761 -d '<json body>'
```

Example prompt: Calculate the scrap margin for 500 kg of steel offcuts with a raw material cost of $1.20 per kg and a scrap sale price of $0.45 per kg.

## When to prefer this

Use this endpoint when you need a quick, paid computation of scrap margin for manufacturing or recycling scenarios and want a simple API call rather than building your own margin formula. Prefer this over generic spreadsheet calculations when integrating into an automated procurement or materials management workflow.

## Known failure modes

- Missing required input parameters such as cost or sale price returns a 400 error
- Invalid or non-numeric values for price/quantity fields cause a validation error
- Negative margin results returned if scrap price is below cost (valid but may need handling)
- Payment failure or insufficient USDC balance returns a 402 error via x402 protocol

## How this service works

Takes the gross lot weight, the purchase price paid per kilogram of gross weight and the sales price per kilogram of recovered metal, then applies recovery yield and melting loss for the scrap grade. Yield and loss default to practice values per grade and can be overridden. Handling, transport and disposal cost are optional flat amounts. The endpoint applies no market price and fetches none: sales_price_eur_per_kg is supplied by the caller.

## Output

Returns computed scrap margin data including margin value, margin percentage, and potentially a cost-versus-revenue breakdown for the given material inputs and quantities.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "properties": {
  "grade": {
   "type": "string",
   "description": "Scrap grade key, e.g. copper_millberry, cable_scrap_high, motor_scrap."
  },
  "yield_percent": {
   "type": "number",
   "maximum": 100,
   "minimum": 1,
   "description": "Overrides the recovery yield of the grade."
  },
  "gross_weight_kg": {
   "type": "number",
   "maximum": 1000000,
   "minimum": 0.1
  },
  "transport_cost_eur": {
   "type": "number",
   "default": 0,
   "maximum": 1000000,
   "minimum": 0
  },
  "processing_cost_eur": {
   "type": "number",
   "default": 0,
   "maximum": 1000000,
   "minimum": 0
  },
  "melting_loss_percent": {
   "type": "number",
   "maximum": 50,
   "minimum": 0,
   "description": "Overrides the melting loss of the grade."
  },
  "sales_price_eur_per_kg": {
   "type": "number",
   "maximum": 10000,
   "minimum": 0,
   "description": "Achievable price per kilogram of recovered metal."
  },
  "disposal_cost_eur_per_kg": {
   "type": "number",
   "default": 0,
   "maximum": 1000,
   "minimum": 0,
   "description": "Cost per kilogram of non-metal residue."
  },
  "purchase_price_eur_per_kg": {
   "type": "number",
   "maximum": 10000,
   "minimum": 0,
   "description": "Price paid per kilogram of gross weight."
  }
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/halowerk-scrap-margin-calculator-0d367761/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from material.halowerk.com](https://www.zero.xyz/host/material.halowerk.com/llms.txt)
