treasures-b2b-api
Treasures B2B API — Agent Skill
Guide for AI agents (and any non-human caller) using the Treasures public B2B API to discover tokenized stocks, quote + execute trades, bridge USDC across chains, and read portfolio + trade history on behalf of a single end-user wallet pair.
- Base URL:
https://api.treasures.io/public/v1 - Network: trades execute against Ethereum mainnet + Solana mainnet-beta — real funds, not a testnet, plus two more venues: Robinhood Chain (4663) — now co-ranked in unpinned quotes, not just pinned — and Base (8453). Point your own RPCs at mainnet; the token/contract addresses in this skill are mainnet.
- Required headers: set
Content-Type: application/jsonon every request carrying a body — a body sent with a non-JSON content-type (e.g.text/plain, which some HTTP clients default to when you don't set headers) fails415before any schema check. Also sendX-Treasures-Skill: treasures-b2b-apiandX-Treasures-Skill-Version: 1.6.0(this skill'smetadata.version): today they're informational (the fund-moving endpoints echoX-Treasures-Api-Revision+X-Min-Skill-Versionback), but once the API floor rises, an enrolled caller below it gets a clean426 skill_version_unsupportedwith upgrade instructions — plusDeprecation/Sunsetwarning headers during the grace window — instead of a silent break. Omitting the version header opts out of that early warning. - Wire format: all token amounts, USDC, shares, prices, and bps-derived decimals are strings (avoid JS float drift). Integer fields (
expires_at,*_bps,quote_index) are JSON numbers. Never round-trip a money value through JSnumber.
This entry doc is the map + the footguns. It is not enough on its own to execute a trade — full schemas, signing code, and error tables live in the references below. Load the reference for the task before you act; you don't need to read them all.
Schema-of-record: an OpenAPI spec (
openapi.yaml) is published alongside this skill in the same repository. This skill is self-sufficient for normal use — consult the spec only for exhaustive field-level validation or client codegen; you don't need to read it to operate.