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

# Nxos API documentation

> Programmatic access to accounts, quotes, trades, and payouts.

The Nxos API lets you move money between fiat and crypto programmatically. You can hold balances in multiple currencies, convert between assets, and pay out to bank accounts or blockchain wallets.

All interaction happens through a single REST API authenticated with API keys.

## Where to start

<CardGroup cols={2}>
  <Card title="Authentication" icon="key" href="/concepts/authentication">
    Create and manage API keys.
  </Card>

  <Card title="Conventions" icon="book" href="/concepts/conventions">
    Pagination, amounts, timestamps, and error handling.
  </Card>

  <Card title="Onramp guide" icon="arrow-right-to-bracket" href="/guides/onramp">
    Accept fiat, convert to crypto, send on-chain.
  </Card>

  <Card title="Offramp guide" icon="arrow-right-from-bracket" href="/guides/offramp">
    Receive crypto, convert to fiat, pay out to a bank.
  </Card>
</CardGroup>

## Resource hierarchy

Every API key belongs to an **organization**. An organization contains one or more **accounts**, and accounts are the central container for all monetary activity on the platform.

```
Organization
├── API Keys
└── Accounts
    ├── Balances          USD, USDC, EUR, USDT
    ├── Funding Methods   bank accounts, crypto wallets
    └── Beneficiaries     payout recipients
```

| Resource         | Description                                                        |
| ---------------- | ------------------------------------------------------------------ |
| **Organization** | Your company. Owns accounts and API keys.                          |
| **Account**      | Holds multi-currency balances. Source for all transactions.        |
| **Beneficiary**  | A registered payout recipient — a crypto wallet or a bank account. |

### How money moves

All asset conversions go through the **quote-then-execute** pattern. Once you hold the right asset, you pay out to a beneficiary.

<Steps>
  <Step title="Create a quote">
    Specify the account, source asset, destination asset, and either the amount to sell (`fromAmount`) or the amount to receive (`toAmount`). The API returns a locked rate, the exact amounts on both sides, and any spread fee. Quotes are valid for **5 minutes**.
  </Step>

  <Step title="Execute the quote">
    Call the execute endpoint. Balances update atomically — the source asset is debited and the destination asset is credited in a single operation. The result is a **trade** transaction.
  </Step>

  <Step title="Pay out">
    Send funds to a pre-registered **beneficiary**. Crypto payouts complete immediately with an on-chain `txHash`. Fiat payouts enter `LOCKED` status and settle via banking rails.
  </Step>
</Steps>

## Environments

| Environment | Base URL                      | Purpose                                 |
| ----------- | ----------------------------- | --------------------------------------- |
| Sandbox     | `https://api.sandbox.nxos.io` | Testing and integration. No real funds. |
| Production  | `https://api.nxos.io`         | Live transactions with real funds.      |

Both environments share the same API surface. Sandbox accounts are provisioned automatically when you sign up.

## Quick example

```bash theme={null}
curl https://api.sandbox.nxos.io/v1/accounts \
  -H "Authorization: Bearer nxos_sk_test_..."
```

```json theme={null}
{
  "object": "list",
  "data": [
    {
      "object": "account",
      "accountId": "acct_a1b2c3d4e5f6a1b2c3d4e5f6a1b2c3d4",
      "name": "Main",
      "isPrimary": true,
      "status": "ACTIVE",
      "fundingMethods": [],
      "createdAt": "2025-01-15T10:30:00.000Z",
      "updatedAt": "2025-01-15T10:30:00.000Z"
    }
  ],
  "hasMore": false,
  "nextCursor": null
}
```
