# Coinlight Unit Converter

> Coinlight Unit Converter is a paid API for AI agents from coinlight-app.vercel.app, paid per call via x402, $0.005/call, status unknown (last checked 2026-10-29).

Converts cryptocurrency amounts between human-readable and atomic units for SOL/lamports, ETH/gwei/wei, USDC, and any custom decimal token — bigint-safe.

## Facts

- Endpoint: GET https://coinlight-app.vercel.app/p/units-convert?utm_source=zero.xyz
- Price: $0.005/call
- Payment: x402
- Status: unknown
- Last checked: 2026-10-29
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/coinlight-unit-converter-d7181a14
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_xwfdhhEbj7X_Yo19JmIZn

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 coinlight-unit-converter-d7181a14
```

Example prompt: Convert 1.5 SOL to lamports for me — I need the exact bigint-safe value without any floating point rounding.

## When to prefer this

Use this endpoint when you need exact, bigint-safe conversion between cryptocurrency denominations — especially for Solana (SOL/lamports), Ethereum (ETH/gwei/wei), or USDC and other SPL tokens with configurable decimals. Prefer it over manual math when floating-point precision errors would corrupt a transaction amount or contract call.

## Known failure modes

- Missing required 'amount' or 'from' query parameter returns an error
- Unsupported unit type not in the enum returns an error
- Non-numeric 'amount' string causes a parse error
- Missing 'decimals' when using 'units' or 'atomic' from-type may default to 6 or error
- Very large numbers beyond safe integer range may cause unexpected behavior if not handled

## How this service works

Coinlight charges USDC per API call with the x402 protocol on Solana and Base.

## Output

Returns a JSON object with the converted amount in the target unit(s), e.g. the lamport count for a given SOL amount, or the wei equivalent of an ETH value. The result is bigint-safe, meaning full integer precision without floating-point rounding errors, along with metadata identifying the endpoint.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "$schema": "https://json-schema.org/draft/2020-12/schema",
 "required": [
  "input"
 ],
 "properties": {
  "input": {
   "type": "object",
   "required": [
    "type",
    "method"
   ],
   "properties": {
    "type": {
     "type": "string",
     "const": "http"
    },
    "method": {
     "enum": [
      "GET"
     ],
     "type": "string"
    },
    "queryParams": {
     "type": "object",
     "examples": [
      {
       "from": "usdc",
       "amount": "0.01"
      }
     ],
     "required": [
      "amount",
      "from"
     ],
     "properties": {
      "from": {
       "enum": [
        "sol",
        "lamports",
        "eth",
        "gwei",
        "wei",
        "usdc",
        "usdc_atomic",
        "units",
        "atomic"
       ],
       "type": "string",
       "description": "Unit of amount."
      },
      "amount": {
       "type": "string",
       "description": "Amount to convert, e.g. 1.5"
      },
      "decimals": {
       "type": "string",
       "description": "Decimals when from is units/atomic. Default 6."
      }
     }
    }
   },
   "additionalProperties": false
  },
  "output": {
   "type": "object",
   "required": [
    "type"
   ],
   "properties": {
    "type": {
     "type": "string"
    },
    "example": {
     "type": "object"
    }
   }
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "endpoint": "Crypto unit converter"
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/coinlight-unit-converter-d7181a14/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from coinlight-app.vercel.app](https://www.zero.xyz/host/coinlight-app.vercel.app/llms.txt)
