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

# Converting from Kinetic to Gas Station API

> Guide for migrating from Kinetic API to the new Gas Station API

# Converting from Kinetic to Gas Station API

This guide will help you migrate your existing Kinetic API integration to the new Gas Station API, which offers improved performance, simplified authentication, and better developer experience.

## Key Differences

### API Endpoints

* **Kinetic API**: Used environment and index-based routing
* **Gas Station API**: Uses direct endpoint paths with cleaner structure

### Authentication

* **Kinetic API**: Required environment and app configuration
* **Gas Station API**: Simplified authentication with API keys

### Base URL

* **Kinetic API**: Base URL of your Kinetic instance (for example, `https://<your-kinetic-host>/api`)
* **Gas Station API**: `https://api.altude.so/api`

## Migration Steps

### 1. Update Base URL

Replace your Kinetic API base URL with the Gas Station API URL:

```diff theme={null}
- const baseURL = 'https://<your-kinetic-host>/api'
+ const baseURL = 'https://api.altude.so/api'
```

### 2. Account Operations

#### Get Account Balance

**Kinetic API:**

```javascript theme={null}
GET /account/balance/{environment}/{index}/{accountId}
```

**Gas Station API:**

```javascript theme={null}
POST /Account/balance
{
  "accountAddress": "your_account_address",
  "mintAddress": "optional_mint_address"
}
```

#### Create Account

**Kinetic API:**

```javascript theme={null}
POST /account/create
{
  "environment": "devnet",
  "index": 1,
  "commitment": "confirmed",
  "mint": "mint_address",
  "tx": "signed_transaction"
}
```

**Gas Station API:**

```javascript theme={null}
POST /Account/create
{
  "signedTransaction": "base64_signed_transaction"
}
```

#### Get Account History

**Kinetic API:**

```javascript theme={null}
GET /account/history/{environment}/{index}/{accountId}/{mint}
```

**Gas Station API:**

```javascript theme={null}
POST /Account/gethistory?WalletAddress=wallet_address&PageNumber=1&PageSize=10
```

### 3. Transaction Operations

#### Send Transaction

**Kinetic API:**

```javascript theme={null}
POST /transaction/make-transfer
{
  "environment": "devnet",
  "index": 1,
  "commitment": "confirmed",
  "mint": "mint_address",
  "tx": "signed_transaction"
}
```

**Gas Station API:**

```javascript theme={null}
POST /Transaction/send
{
  "signedTransaction": "base64_signed_transaction"
}
```

#### Batch Transactions

The Gas Station API introduces a new batch transaction feature:

```javascript theme={null}
POST /Transaction/sendbatch
{
  "signedTransaction": "base64_signed_batch_transaction"
}
```

## Code Examples

### Before (Kinetic API)

```javascript theme={null}
import { KineticSdk } from '@kinetic/kinetic-sdk'

const kinetic = new KineticSdk({
  endpoint: 'https://<your-kinetic-host>/api',
  environment: 'devnet',
  index: 1
})

// Get balance
const balance = await kinetic.getBalance({
  account: 'account_address',
  mint: 'mint_address'
})

// Make transfer
const transaction = await kinetic.makeTransfer({
  amount: '1000000',
  destination: 'destination_address',
  mint: 'mint_address'
})
```

### After (Gas Station API)

```javascript theme={null}
const API_BASE = 'https://api.altude.so/api'

// Get balance
const balanceResponse = await fetch(`${API_BASE}/Account/balance`, {
  method: 'POST',
  headers: { 'Content-Type': 'application/json' },
  body: JSON.stringify({
    accountAddress: 'account_address',
    mintAddress: 'mint_address'
  })
})

// Send transaction
const sendResponse = await fetch(`${API_BASE}/Transaction/send`, {
  method: 'POST',
  headers: { 'Content-Type': 'application/json' },
  body: JSON.stringify({
    signedTransaction: 'base64_signed_transaction'
  })
})
```

## Benefits of Gas Station API

* **Simplified Architecture**: No more environment/index management
* **Better Performance**: Optimized endpoints for faster responses
* **Batch Operations**: Send multiple transactions in a single request
* **Consistent API Design**: RESTful endpoints with clear request/response patterns
* **Enhanced Security**: Improved authentication and validation

## Need Help?

If you need assistance with the migration or have questions about specific use cases, please reach out to our support team at [andrew@altude.so](mailto:andrew@altude.so).
