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

# Claude Code setup

> Configure Claude Code for Wallbit API development

Claude Code is Anthropic's official CLI tool. This guide will help you set up Claude Code to build integrations with the Wallbit API.

<AccordionGroup>
  <Accordion title="Quick Setup" icon="rocket">
    Jump to [Create CLAUDE.md](#create-claudemd) to get started.
  </Accordion>

  <Accordion title="Example Usage" icon="lightbulb">
    See [Example Usage](#example-usage) for common prompts.
  </Accordion>

  <Accordion title="Dashboard Prompt" icon="sparkles">
    Copy the [Complete Dashboard Prompt](#complete-dashboard-prompt) to generate
    a full dashboard.
  </Accordion>
</AccordionGroup>

## Prerequisites

* Active Claude subscription (Pro, Max, or API access)
* Wallbit API key from your [dashboard](https://developer.wallbit.io/dashboard)

## Setup

1. Install Claude Code globally:

```bash theme={null}
npm install -g @anthropic-ai/claude-code
```

2. Navigate to your project directory.
3. Add the `CLAUDE.md` file below to your project.
4. Run `claude` to start.

## Create `CLAUDE.md`

Create a `CLAUDE.md` file at the root of your project to train Claude Code on the Wallbit API:

````markdown theme={null}
# Wallbit API Integration

## Working relationship

- You can push back on ideas - this can lead to better code. Cite sources and explain your reasoning when you do so
- ALWAYS ask for clarification rather than making assumptions
- NEVER lie, guess, or make up information about the API

## API Overview

Wallbit is a global neobank and the world's first to offer a public API for programmatic account control. We offer US accounts, investments in ETFs, stocks and bonds, and local currency rails.

Base URL: `https://api.wallbit.io`

### Authentication

All requests require `X-API-Key` header:

```bash
curl -H "X-API-Key: $WALLBIT_API_KEY" https://api.wallbit.io/api/public/v1/balance/checking
```

### Available Endpoints

**Balance**

- `GET /api/public/v1/balance/checking` - Checking account balance
- `GET /api/public/v1/balance/stocks` - Investment portfolio

**Transactions**

- `GET /api/public/v1/transactions` - Transaction history (supports pagination & filters)

**Trades**

- `POST /api/public/v1/trades` - Execute buy/sell orders
  - Required: symbol, direction (BUY/SELL), currency, order_type (MARKET/LIMIT)
  - Specify either `amount` (USD) or `shares`, not both

**Account Details**

- `GET /api/public/v1/account-details` - Bank details for ACH/SEPA deposits

**Wallets**

- `GET /api/public/v1/wallets` - Crypto wallet addresses (USDT, USDC)

**Assets**

- `GET /api/public/v1/assets` - List available stocks/ETFs
- `GET /api/public/v1/assets/{symbol}` - Asset details

**Operations**

- `POST /api/public/v1/operations/internal` - Move funds between checking/investment

### Error Codes

- `401` - Invalid/missing API key
- `403` - Insufficient permissions
- `412` - KYC incomplete or account locked
- `422` - Validation error
- `429` - Rate limited (check Retry-After header)

## Code Standards

- Store API keys in environment variables
- Implement proper error handling for all API calls
- Use TypeScript for type safety when possible
- Add retry logic with exponential backoff for 429 errors

## Do not

- Hardcode API keys in source code
- Make assumptions about API behavior - check the docs
- Skip error handling
- Execute trades without validating parameters first
````

## Example Usage

After setting up, you can ask Claude Code to help with Wallbit integrations:

```
> Create a function to fetch my portfolio and calculate total value
```

```
> Build an alert system that notifies me when AAPL drops below $150
```

```
> Set up a scheduled job to export my transactions to a CSV
```

## Complete Dashboard Prompt

Copy and paste this prompt to Claude Code to generate a complete Wallbit account dashboard:

```
Build a React dashboard application for exploring a Wallbit account. The dashboard should include:

1. Account Overview Section:
   - Fetch and display checking account balances from GET /api/public/v1/balance/checking
   - Show currency and balance for each account type
   - Calculate and display total balance across all currencies

2. Investment Portfolio Section:
   - Fetch portfolio from GET /api/public/v1/balance/stocks
   - Display each position with: symbol, shares, current value, unrealized gain/loss
   - Calculate total portfolio value
   - Show percentage allocation pie chart or breakdown

3. Transaction History Section:
   - Fetch transactions from GET /api/public/v1/transactions
   - Display in a table with: type, amount, currency, status, date
   - Add filters for: status (COMPLETED, PENDING, FAILED), currency, date range
   - Implement pagination (page, limit)

4. Asset Browser:
   - List available assets from GET /api/public/v1/assets
   - Add search/filter functionality
   - Show asset details (symbol, name, type)

5. Trade Execution:
   - Form to execute trades via POST /api/public/v1/trades
   - Fields: symbol (dropdown), direction (BUY/SELL), currency, order_type (MARKET/LIMIT), amount
   - Validation and error handling
   - Success confirmation

Use Wallbit API: https://api.wallbit.io
Authentication: X-API-Key header from WALLBIT_API_KEY environment variable

Use TypeScript, Tailwind CSS, React hooks, proper error boundaries, and loading states. Make it responsive and accessible.
```

## Useful Links

<CardGroup cols={2}>
  <Card title="API Reference" icon="code" href="/api-reference/introduction">
    Complete Wallbit API documentation.
  </Card>

  <Card title="Quickstart" icon="rocket" href="/quickstart">
    Get your API key and make your first call.
  </Card>
</CardGroup>
