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

# Execution APIs

> Execute swaps and perpetual trades across multiple chains with a unified API.

<Frame>
  <img src="https://i.imgur.com/eZ2hAXj.png" />
</Frame>

## Overview

Mobula's Execution APIs provide a unified interface to execute trades across decentralized exchanges:

<CardGroup cols={2}>
  <Card title="Swap API" icon="arrows-rotate" color="#5C7DF9">
    **Spot Trading**

    * Cross-chain token swaps
    * Best price routing
    * Slippage protection
    * Transaction building
  </Card>

  <Card title="Perps API" icon="chart-line-up" color="#10B981">
    **Perpetual Trading**

    * Leverage positions
    * Cross-margin support
    * Order management
    * Position tracking
  </Card>
</CardGroup>

## TypeScript SDK

For the best developer experience, use the official TypeScript SDK:

```bash theme={null}
npm install @mobula_labs/sdk
```

```typescript theme={null}
import { MobulaClient } from '@mobula_labs/sdk';

const client = new MobulaClient({ apiKey: 'your-api-key' });

// Get swap quote
const quote = await client.getSwapQuote({
  chain: 'ethereum',
  fromToken: '0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee',
  toToken: '0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48',
  amount: '1000000000000000000',
  slippage: 0.5
});
```

<Card title="SDK Documentation" icon="npm" href="/rest-api-reference/sdk">
  Full type safety, all REST methods, and utility functions included
</Card>

## API Endpoints

<CardGroup cols={2}>
  <Card title="Demo API" icon="flask" color="#F59E0B">
    **demo-api.mobula.io**

    * No signup required
    * Rate limited (for testing only)
    * Perfect for exploring the API
  </Card>

  <Card title="Production API" icon="rocket" color="#10B981">
    **api.mobula.io**

    * Requires free API key
    * Higher rate limits
    * Production-ready
  </Card>
</CardGroup>

<Note>
  **Getting Started**: You can test all endpoints using **demo-api.mobula.io** without any signup. For production use, [generate a free API key](https://admin.mobula.io) to use **api.mobula.io**.
</Note>

## Quick Links

<CardGroup>
  <Card title="Swap Quote" icon="calculator" href="/rest-api-reference/endpoint/swap-quoting">
    Get the best swap route and price.
  </Card>

  <Card title="Swap Instructions" icon="code" href="/rest-api-reference/endpoint/swap-instructions">
    Get transaction data to execute swaps.
  </Card>

  <Card title="Perp Quote" icon="chart-candlestick" href="/rest-api-reference/endpoint/perp-quote">
    Get perpetual trading quotes.
  </Card>

  <Card title="Complete Swap Guide" icon="book" href="/guides/complete-swap-guide">
    Step-by-step swap integration guide.
  </Card>
</CardGroup>
