TorqueTorque

Search docs

Search Torque documentation pages & sections

Quickstart

Auth

sk_live_… from API Integration

READOptional

GET /intelligence/feed or walletAddress in context

DECIDE

POST /assistant/chat → functionResults (draft wallet_order)

EXECUTE

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

server.ts
import { createTorqueFromEnv } from 'torque-node'
const torque = createTorqueFromEnv()
const wallet = await torque.wallets.ensure({
  externalUserId: 'player_48291',
  email: 'user@example.com',
})

Intelligence

server.ts
import { createTorqueFromEnv } from 'torque-node'
const torque = createTorqueFromEnv()
const feed = await torque.read.intelligence.getFeed({
  walletAddress: '0x…',
})

Checkout

server.ts
import { checkout, redirectToCheckout } from 'torque-checkout'
const url = await checkout({ productId: 'prod_123', email: 'a@b.com' })
redirectToCheckout(url)
[01]Auth

Authenticate

probe-capabilities.sh
# sk_live_… → app.torque.fi → Business Settings → API Integration

curl -sS "https://app.torque.fi/api/v1/capabilities" | jq '.manifestVersion'
[02]READ

Load Context

Optional: market context before DECIDE.

read-context.sh
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)'
[03]DECIDE

Decide

POST /decide/assistant/chat content or functionResults.

decide-action.sh
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'
[04]EXECUTE

Execute

POST functionResults to /execute/** with Smart Wallet JWT.

execute-action.sh
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.

server.ts
import { checkout, redirectToCheckout } from 'torque-checkout'
const url = await checkout({ productId: 'prod_123', email: 'a@b.com' })
redirectToCheckout(url)

Next.js BFF (alternative):

app/api/checkout-session/route.ts
import { handleCheckoutRequest } from 'torque-checkout/nextjs'

export const POST = handleCheckoutRequest()
// Body: items (productId + quantity) & customer → response includes checkoutUrl

Order status webhooks: torque-webhooks.

Intelligence Partner

Fetch market signals, briefs, and datasets with your business API key. Full surface: Intelligence API.

intelligence-feed.sh
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.

assistant-chat.sh
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