Quickstart
sk_live_… from API Integration
GET /intelligence/feed or walletAddress in context
POST /assistant/chat → functionResults (draft wallet_order)
Actions: on_chain POST /execute/** or merchant torque-checkout SDK → wallet_order committed
sk_live_… from API Integration
GET /intelligence/feed or walletAddress in context
POST /assistant/chat → functionResults (draft wallet_order)
Actions: on_chain POST /execute/** or merchant torque-checkout SDK → wallet_order committed
sk_live_… from API Integration
GET /intelligence/feed or walletAddress in context
POST /assistant/chat → functionResults (draft wallet_order)
Actions: on_chain POST /execute/** or merchant torque-checkout SDK → wallet_order committed
SDK heroes (≤6 lines)
Prefer npm over curl? Three surfaces — wallets, intelligence, checkout — each in six lines. Full reference: Server SDKs.
Wallets
import { createTorqueFromEnv } from 'torque-node'
const torque = createTorqueFromEnv()
const wallet = await torque.wallets.ensure({
externalUserId: 'player_48291',
email: 'user@example.com',
})Intelligence
import { createTorqueFromEnv } from 'torque-node'
const torque = createTorqueFromEnv()
const feed = await torque.read.intelligence.getFeed({
walletAddress: '0x…',
})Checkout
import { checkout, redirectToCheckout } from 'torque-checkout'
const url = await checkout({ productId: 'prod_123', email: 'a@b.com' })
redirectToCheckout(url)Authenticate
# sk_live_… → app.torque.fi → Business Settings → API Integration
curl -sS "https://app.torque.fi/api/v1/capabilities" | jq '.manifestVersion'Load Context
Optional: market context before DECIDE.
export TORQUE_KEY="sk_live_…"
curl -sS "https://app.torque.fi/api/v1/intelligence/feed?chainId=8453&includeBrief=1" \
-H "Authorization: Bearer $TORQUE_KEY" \
| jq '.brief.summary, (.items | length)'Decide
POST /decide/assistant/chat → content or functionResults.
export TORQUE_KEY="sk_live_…"
curl -sS -X POST "https://app.torque.fi/api/v1/decide/assistant/chat" \
-H "Authorization: Bearer $TORQUE_KEY" \
-H "Content-Type: application/json" \
-d '{
"messages": [{ "role": "user", "content": "What is the price of ETH?" }],
"context": { "walletAddress": "0x…", "chainId": 8453 }
}' | jq '.content, .functionResults'Execute
POST functionResults to /execute/** with Smart Wallet JWT.
export WALLET_JWT="<smart_wallet_jwt>"
curl -sS -X POST "https://app.torque.fi/api/v1/execute/trades" \
-H "Authorization: Bearer $WALLET_JWT" \
-H "Content-Type: application/json" \
-d '{ ... prepared swap body from functionResults ... }'Routes: API Catalog. Third-party: Authentication.
Integration Paths
The golden path above covers READ → DECIDE → EXECUTE for wallet apps. Pick a persona below for a shorter walkthrough.
Merchant Checkout
Embed Torque payments with the Checkout SDK. One-shot: checkout({ productId, email }) (≤6 lines). BFF option below keeps secrets on the server.
import { checkout, redirectToCheckout } from 'torque-checkout'
const url = await checkout({ productId: 'prod_123', email: 'a@b.com' })
redirectToCheckout(url)Next.js BFF (alternative):
import { handleCheckoutRequest } from 'torque-checkout/nextjs'
export const POST = handleCheckoutRequest()
// Body: items (productId + quantity) & customer → response includes checkoutUrlOrder status webhooks: torque-webhooks.
Intelligence Partner
Fetch market signals, briefs, and datasets with your business API key. Full surface: Intelligence API.
export TORQUE_KEY="sk_live_…"
curl -sS "https://app.torque.fi/api/v1/intelligence/feed?chainId=8453&includeBrief=1" \
-H "Authorization: Bearer $TORQUE_KEY" \
| jq '.brief.summary, (.items | length)'SDK: torque.read.intelligence.getFeed() — see hero above or Server SDKs. Building a Discord bot? See Signals in Discord.
Fintech / Platform
Call Torque Assistant programmatically; execute prepared actions when functionResults return signable payloads. Surface guide: Assistant API.
export TORQUE_KEY="sk_live_…"
curl -sS -X POST "https://app.torque.fi/api/v1/decide/assistant/chat" \
-H "Authorization: Bearer $TORQUE_KEY" \
-H "Content-Type: application/json" \
-d '{
"messages": [{ "role": "user", "content": "Summarize my portfolio risk" }],
"context": { "walletAddress": "0x…", "chainId": 8453 }
}' | jq '.content, .functionResults'Smart wallets that cash out on behalf of users: Connect OAuth for delegated execute JWTs.
Production SDKs: Server SDKs.
FAQ
Which integration path should I choose?
Intelligence Partners: market data and feeds. Fintech and Apps: Assistant plus Actions execute. Merchants: Checkout SDK. Pick the card on Introduction that matches your product.
Do I need user sign-in for execute?
Yes for onchain execute routes. Your server uses a business key for reads and provisioning; the end user approves trades or cash-out through Torque sign-in (smart wallet JWT or Connect OAuth).
Where is the developer portal?
developers.torque.fi for API keys, end-user wallet dashboard, cash-out setup, and deposit webhooks.
Questions or corrections? hello@torque.fi