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

# Quickstart

> Issue your first virtual card and make a payment in 5 minutes.

## 1. Get an API key

Sign in at [mag3nt.com](https://mag3nt.com) with your wallet, then generate an API key from the dashboard.

```bash theme={null}
# Your key looks like this:
mag3nt_live_a1b2c3d4e5f6g7h8i9j0...
```

## 2. Install the SDK

<CodeGroup>
  ```bash npm theme={null}
  npm install @mag3nt/sdk
  ```

  ```bash pip theme={null}
  pip install mag3nt
  ```
</CodeGroup>

## 3. Initialize the client

<CodeGroup>
  ```typescript TypeScript theme={null}
  import { Mag3nt } from "@mag3nt/sdk";

  const mag3nt = new Mag3nt({
    serverURL: "https://mag3nt.com",
    security: {
      bearerAuth: "mag3nt_live_your_api_key_here",
    },
  });
  ```

  ```python Python theme={null}
  import mag3nt
  from mag3nt.models.components import Security

  sdk = mag3nt.Mag3nt(
      server_url="https://mag3nt.com",
      security=Security(bearer_auth="mag3nt_live_your_api_key_here"),
  )
  ```
</CodeGroup>

## 4. Fund your treasury

Send USDC or pathUSD to your treasury address (e.g. Base, Solana, or Tempo). Check your balance:

<CodeGroup>
  ```typescript TypeScript theme={null}
  const config = await mag3nt.status.statusGetConfig();
  console.log("Treasury address:", config.treasury?.evm);
  // Send USDC/pathUSD to this address

  const balance = await mag3nt.funding.fundingGetBalance();
  console.log("Available:", balance.balances);
  ```

  ```python Python theme={null}
  config = sdk.status.status_get_config()
  print("Treasury address:", config.treasury.evm)
  # Send USDC/pathUSD to this address

  balance = sdk.funding.funding_get_balance()
  print("Available:", balance.balances)
  ```
</CodeGroup>

## 5. Issue a card

<CodeGroup>
  ```typescript TypeScript theme={null}
  const card = await mag3nt.cards.cardsCreate({
    purpose: "Research Agent",
    limitAmount: 50,
    network: "eip155:8453",
    asset: "USDC",
  });

  console.log("Card ID:", card.card?.id);
  console.log("Card Token:", card.card?.token);
  console.log("Status:", card.card?.status);
  ```

  ```python Python theme={null}
  card = sdk.cards.cards_create(
      purpose="Research Agent",
      limit_amount=50,
      network="eip155:8453",
      asset="USDC",
  )

  print("Card ID:", card.card.id)
  print("Card Token:", card.card.token)
  print("Status:", card.card.status)
  ```
</CodeGroup>

## 6. Make a payment

Use your card to make a payment. mag3nt. automatically detects the protocol (x402, MPP, or AP2) and settles on-chain:

<CodeGroup>
  ```typescript TypeScript theme={null}
  const payment = await mag3nt.payments.paymentsExecute({
    cardId: card.card.id,
    cardToken: card.card.token,
    url: "https://api.weather.com/forecast",
  });

  console.log("Payment successful:", payment.transactionId);
  ```

  ```python Python theme={null}
  payment = sdk.payments.payments_execute(
      card_id=card.card.id,
      card_token=card.card.token,
      url="https://api.weather.com/forecast",
  )

  print("Payment successful:", payment.transaction_id)
  ```
</CodeGroup>

## Next steps

<CardGroup cols={2}>
  <Card title="Card controls" icon="shield" href="/concepts/cards">
    MCC locks, single-use cards, spending limits
  </Card>

  <Card title="W3C HTTP Headers" icon="arrows-left-right" href="/protocols/w3c">
    How 402 payment challenges work
  </Card>

  <Card title="Funding" icon="wallet" href="/concepts/funding">
    Deposits, balance, multi-network support
  </Card>

  <Card title="API Reference" icon="code" href="/api-reference/cards/list-all-cards-for-the-authenticated-wallet">
    All 42 endpoints with interactive examples
  </Card>
</CardGroup>
