> ## Documentation Index
> Fetch the complete documentation index at: https://docs.shuriken.trade/llms.txt
> Use this file to discover all available pages before exploring further.

# API Introduction

> Programmatic access to multi-chain DEX trading. Quote, swap, and manage positions across Solana, Base, BSC, and Monad.

The Shuriken API v2 gives you direct access to the same multi-chain trading engine that powers the Terminal, Telegram Bot, and AI Agent Kit. Build trading bots, automate strategies, or integrate real-time token data into your own tools through REST endpoints and real-time WebSocket streams.

<Info>
  All API requests require a Bearer token. Create an [Agent Key](/agent-kit/create-agent-key) from the Terminal to get started.
</Info>

## SDKs

The fastest way to get started is with an official SDK. They handle authentication, typed responses, WebSocket connection management, and automatic reconnection — so you can focus on your trading logic instead of protocol details. See the [SDKs page](/api-reference/sdks) for usage snippets and quickstart repos.

<CardGroup cols={2}>
  <Card title="TypeScript SDK" icon="js" href="https://github.com/ShurikenTrade/shuriken-sdk-ts">
    REST + WebSocket client with typed events. Install via `npm install @shuriken/sdk-ts`.
  </Card>

  <Card title="Rust SDK" icon="rust" href="https://github.com/ShurikenTrade/shuriken-sdk-rs">
    Async REST + WebSocket with `futures::Stream` support. Add `shuriken-sdk` to your `Cargo.toml`.
  </Card>
</CardGroup>

## CLI

A thin command-line client for the same v2 developer surface — useful for quick lookups, scripting, and testing without writing SDK code. HTTP only; WebSocket streams require an SDK or direct connection. The installer drops a single `shuriken` binary in `~/.local/bin` and supports in-place updates via `shuriken update apply`. See the [CLI page](/api-reference/cli) for installer flags, auth, and update details.

```bash theme={null}
curl -fsSL https://cdn.shuriken.trade/shuriken-cli/install.sh | sh
```

<Tip>
  Pin a version with `SHURIKEN_VERSION=v0.3.2` or change the install location with `SHURIKEN_INSTALL_DIR="$HOME/bin"`. Pass either as an environment variable on the same line as `sh`.
</Tip>

## Base URL

All endpoints live under a single base URL with version prefix:

```
https://api.shuriken.trade/api/v2
```

## Supported chains

<CardGroup cols={4}>
  <Card title="Solana" icon="bolt">
    SVM
  </Card>

  <Card title="Base" icon="circle-nodes">
    EVM
  </Card>

  <Card title="BSC" icon="coins">
    EVM
  </Card>

  <Card title="Monad" icon="fire">
    EVM
  </Card>
</CardGroup>

## Authentication

Every request must include your API key as a Bearer token in the `Authorization` header:

```bash theme={null}
curl -X GET "https://api.shuriken.trade/api/v2/account/me" \
  -H "Authorization: Bearer YOUR_API_KEY"
```

Read the full [Authentication guide](/api-reference/authentication) for setup instructions and security best practices.

## Endpoint groups

<CardGroup cols={2}>
  <Card title="Account" icon="user" href="/api-reference/endpoint/account/get-me">
    Manage your profile, wallets, trade settings, and check API key usage.
  </Card>

  <Card title="Portfolio" icon="chart-pie" href="/api-reference/endpoint/portfolio/get-balances">
    View token balances, trade history, PnL summaries, and open positions across all chains.
  </Card>

  <Card title="Swap" icon="arrow-right-arrow-left" href="/api-reference/endpoint/swap/get-quote">
    Get quotes, build transactions, execute swaps, and track execution status.
  </Card>

  <Card title="Tokens" icon="coins" href="/api-reference/endpoint/tokens/search">
    Search tokens, fetch metadata, prices, OHLCV charts, pool data, and trading stats.
  </Card>

  <Card title="Trigger Orders" icon="crosshairs" href="/api-reference/endpoint/trigger/create-order">
    Create and manage limit orders and stop-loss triggers based on price, market cap, or liquidity.
  </Card>

  <Card title="Perpetuals" icon="chart-line" href="/api-reference/endpoint/perp/get-markets">
    Trade perpetual futures with leverage, manage positions, and track fills and funding.
  </Card>

  <Card title="WebSocket" icon="plug" href="/api-reference/websocket/overview">
    Real-time streams for swaps, balances, pool data, alpha signals, and portfolio updates.
  </Card>

  <Card title="Tasks" icon="spinner" href="/api-reference/endpoint/tasks/get-status">
    Poll execution status for async operations like swaps and approvals.
  </Card>
</CardGroup>

## Response format

All successful responses follow the same envelope:

```json theme={null}
{
  "data": { ... },
  "requestId": "req_abc123",
  "pagination": null
}
```

When pagination applies, the `pagination` field includes `page`, `limit`, `hasMore`, and an optional `total`.

Errors use a consistent format too  - see the [Errors reference](/api-reference/errors) for details.

<Tip>
  Every response includes a `requestId`. Include it when contacting support to speed up debugging.
</Tip>
