{"uid":"cap_oc4g8_bdXFqfJW6PIC-j7","slug":"fastx402-lab-token-units-converter-bc956aca","name":"FastX402 Lab Token Units Converter","description":"FastX402 Lab: small pay-per-call tools for AI agents, paid per request in USDC on Base over x402. No signup, no API key.","url":"https://lab.fastx402.tools/token-units?utm_source=zero.xyz","method":"GET","headers":{},"bodySchema":{"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","required":["value","decimals","direction"],"properties":{"value":{"type":"string","description":"Amount: a decimal like 1.5 for to_atomic, or an integer like 1500000 for from_atomic"},"decimals":{"type":"string","description":"Token decimals, 0-36 (USDC 6, ETH 18)"},"direction":{"enum":["to_atomic","from_atomic"],"type":"string","description":"to_atomic or from_atomic"}}}},"additionalProperties":false},"output":{"type":"object","required":["type"],"properties":{"type":{"type":"string"},"example":{"type":"object","properties":{"atomic":{"type":"string"},"decimal":{"type":"string"},"decimals":{"type":"integer"}}}}}}},"responseSchema":{"type":"json","example":{"atomic":"1500000","decimal":"1.5","decimals":6}},"example":null,"exampleRequest":null,"tags":["x402"],"displayCostAmount":"0.001","displayCostAsset":"USDC","priceDynamic":false,"priceHint":null,"priceStatus":"priced","priceSource":"probe","requiresHandshake":false,"reviewCount":0,"rating":{"score":"0.00","successRate":"0.00","reviews":0,"stars":null,"state":"unrated"},"availabilityStatus":"unknown","priceObserved":null,"sessionDeposit":null,"pricing":{"kind":"static","summary":"$0.001/call","primary":{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.001","per":"call","confidence":"exact"},"accepted":[{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.001","per":"call","confidence":"exact"}]},"paymentMethods":[{"uid":"pm_r2pgkD21S55Y9YxlyIFBm","protocol":"x402","methodType":"crypto","chain":"base","mode":"charge","costAmount":"0.001","costPer":"request","priority":0,"asset":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","unit":"request","depositMicros":null,"planRef":null}],"brandName":null,"brandSlug":null,"brandBaseUrl":null,"brandDocsUrl":null,"whatItDoes":"Converts token amounts between human-readable decimal and blockchain atomic (integer) units given a token's decimal precision","exampleAgentPrompt":"Convert 1.5 USDC to its atomic integer form — USDC has 6 decimals, use the to_atomic direction.","exampleUseCases":[{"title":"Prepare USDC payment for smart contract","prompt":"I need to send 25 USDC via a smart contract call. Can you convert 25.0 to atomic units for me? USDC has 6 decimals, direction to_atomic."},{"title":"Display ETH balance in human-readable form","prompt":"I got back 4500000000000000 from the blockchain — that's an ETH value with 18 decimals. Convert it from_atomic so I can show it to the user as a decimal number."},{"title":"Compute raw token amount for DeFi transaction","prompt":"I want to swap 0.05 WBTC on a DEX. WBTC has 8 decimals. What's the atomic integer I should pass to the contract? Use to_atomic direction."}],"resultDescription":"Returns a JSON object containing the atomic integer string representation, the decimal string representation, and the number of decimals used — e.g. {\"atomic\":\"1500000\",\"decimal\":\"1.5\",\"decimals\":6}.","failureModes":["Missing required query parameters (value, decimals, direction) returns a 400 error","Invalid direction value (not to_atomic or from_atomic) returns validation error","Non-numeric value string causes a parsing error","Decimals out of 0-36 range may produce unexpected results","Payment failure over x402 protocol results in 402 response requiring USDC payment on Base"],"whenToPreferThis":"Use this endpoint when an AI agent needs a quick, stateless, no-signup conversion between human-readable token amounts and raw blockchain integer units — especially useful before constructing smart contract calls or formatting on-chain balances for display. Prefer this over manual arithmetic when precision for high-decimal tokens (18 decimals) matters and you want a verified result.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-10-17T12:40:07.743Z","isFirstParty":false,"canonicalSlug":"fastx402-lab-token-units-converter-bc956aca"}