Skip to main content
Official SDKs are available for TypeScript and Python. Both provide typed methods for every endpoint, automatic retries, and built-in pagination.

Installation

npm install @yoshi-ai/sdk
# or
pnpm add @yoshi-ai/sdk

Quick example

import Yoshi from "@yoshi-ai/sdk";

const yoshi = new Yoshi(); // reads YOSHI_API_KEY from env

const accounts = await yoshi.accounts.list();
const scores = await yoshi.scores.list();
const me = await yoshi.me.retrieve();
const summary = await yoshi.me.summary();

Configuration

Both SDKs accept the same core options:
OptionDefaultDescription
apiKey / api_keyYOSHI_API_KEY env varYour API key (starts with yoshi_)
environment"production""production" or "staging"
maxRetries / max_retries2Maximum number of automatic retries on failure
timeout30000 ms / 30.0 sRequest timeout
import Yoshi from "@yoshi-ai/sdk";

const yoshi = new Yoshi({
  apiKey: "yoshi_3xK9mP...",
  environment: "staging",
  maxRetries: 3,
  timeout: 60_000,
});

Auto-pagination

List endpoints return paginated results. The SDKs handle cursor-based pagination automatically with async iterators:
// Iterate over all transactions automatically
for await (const tx of yoshi.transactions.list({ limit: 100 })) {
  console.log(tx.merchant_name, tx.amount);
}
You can also fetch a single page:
const page = await yoshi.transactions.list({ limit: 50 });
console.log(page.data);
console.log(page.has_more);

Error handling

The SDKs raise typed exceptions for common HTTP error codes:
import Yoshi from "@yoshi-ai/sdk";

try {
  await yoshi.accounts.list();
} catch (err) {
  if (err instanceof Yoshi.AuthenticationError) {
    // 401 — invalid or revoked API key
  } else if (err instanceof Yoshi.RateLimitError) {
    // 429 — rate limited
    console.log("Retry after:", err.headers["retry-after"]);
  } else if (err instanceof Yoshi.NotFoundError) {
    // 404 — resource not found
  }
}

Available resources

The SDKs expose methods that map directly to the API reference:
SDK methodEndpoint
accounts.list()GET /accounts
accounts.balanceSeries.list(id)GET /accounts/{id}/balances
transactions.list()GET /transactions
scores.list()GET /scores
goals.list()GET /goals
recurring.list()GET /recurring
investments.list()GET /investments
income.retrieve()GET /income
me.retrieve()GET /me
me.summary()GET /me/summary
paperTrading.accounts.create()POST /paper-trading/accounts
paperTrading.accounts.list()GET /paper-trading/accounts
paperTrading.accounts.trades.create(id)POST /paper-trading/accounts/{id}/trades
paperTrading.accounts.trades.list(id)GET /paper-trading/accounts/{id}/trades
paperTrading.accounts.holdings.list(id)GET /paper-trading/accounts/{id}/holdings
actions.create()POST /actions
actions.list()GET /actions
actions.retrieve(id)GET /actions/{id}
approvals.retrieve(threadId)GET /approvals/{threadId}
Python method names use snake_case (e.g., paper_trading.accounts.create()).

Requirements

SDKMinimum version
TypeScriptNode.js 18+
PythonPython 3.8+
Last modified on April 16, 2026