API & SDK coverage
Master reference for docs authors and partner integrators — which HTTP routes have npm helpers, which auth model applies, and what is still HTTP-only. Start here, then drill into domain guides.
At a glance
| Layer | Auth | npm |
|---|---|---|
| Checkout | sk_live_… + Business ID | torque-checkout 3.x |
| Platform API v1 | sk_live_… (read + assistant) · JWT (actions) | @torquefi/types, torque-intelligence, torque-assistant, torque-node, … |
Base URL https://app.torque.fi/api/v1 · OpenAPI · capabilities manifest
Domain coverage
| Domain | HTTP | npm SDK | Auth |
|---|---|---|---|
| Intelligence feeds | 5 GET routes | torque-intelligence / torque-node | sk_live_… |
| Opportunities | 2 GET routes | 0.1.1 getYield/LendingOpportunities | sk_live_… |
| Assistant | POST chat (+ SSE) | torque-assistant / torque-node | sk_live_… |
| Wallet actions | 8 POST routes | HTTP only | Smart wallet JWT |
| Checkout | separate surface | torque-checkout 3.x | sk_live_… + Business ID |
npm versions (June 2026)
| Package | Version | Notes |
|---|---|---|
| @torquefi/types | 0.1.1 | opportunities subpath, enriched IntelligenceActionV1 |
| torque-intelligence | 0.1.1 | getYieldOpportunities, getLendingOpportunities |
| torque-node | 0.1.1 | Opportunities on torque.intelligence |
| torque-assistant | 0.1.0 | unchanged |
| torque-webhooks | 0.1.0 | unchanged |
| @torquefi/react | 0.1.0 | unchanged — no Opportunities hooks yet |
| torque-checkout | 3.x | separate product track |
yarn add @torquefi/types@^0.1.1 torque-intelligence@^0.1.1
# or unified:
yarn add torque-node@^0.1.1Intelligence feeds
🔑 Business key · Guide: Intelligence API
| HTTP | torque-intelligence | @torquefi/react |
|---|---|---|
| GET …/intelligence/feed | getFeed() | useIntelligenceFeed (BFF) |
| GET …/trade-angles | getTradeAngles() | — |
| GET …/happening-now | getHappeningNow() | — |
| GET …/brief | HTTP only | — |
| GET …/market-outlook | HTTP only | — |
Opportunities (0.1.1)
🔑 Business key · Read-only rate tiles · Guide: Opportunities API
| GET …/opportunities/yield | getYieldOpportunities() | Yield Spotlight — optional wallet personalization |
| GET …/opportunities/lending | getLendingOpportunities() | Lend/Borrow Markets — catalog only (no wallet borrow personalization) |
Assistant & actions
Assistant: chat() / chatStream() on torque-assistant and torque-node. useAssistantChat via BFF.
Actions: eight POST /api/v1/actions/** routes — HTTP only, smart wallet JWT. No torque-actions package yet.
Authentication reference
| Credential | Header | Used for |
|---|---|---|
| Business API key | Authorization: Bearer sk_live_… | Intelligence, Opportunities, Assistant, Checkout |
| Smart wallet JWT | Authorization: Bearer <jwt> | GET /wallet/me, POST /actions/** |
| Business ID | Checkout SDK config | torque-checkout only — not Platform SDKs |
Never embed sk_live_… in browser bundles. Platform + Opportunities from React → BFF with torque-node or torque-intelligence. See Authentication.
Recommended integrator stack
import { createTorqueFromEnv } from 'torque-node'
const torque = createTorqueFromEnv()
const [yieldSpot, lending, feed] = await Promise.all([
torque.intelligence.getYieldOpportunities({ walletAddress: '0x…' }),
torque.intelligence.getLendingOpportunities({ tokenFilter: 'USD' }),
torque.intelligence.feed({ walletAddress: '0x…', includeBrief: 1 }),
])
// Client: render action.label + action.subtitle; link action.torqueUrlExplicit gaps
- No @torquefi/react hooks for Opportunities — BFF + torque-node / torque-intelligence
- No torque-actions npm client — Actions need smart wallet JWT
- Opportunities are read-only (rates + torqueUrl deep links)
- No wallet-personalized borrow catalog on lending endpoint
- Intelligence brief / market-outlook — HTTP only in SDK today