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

# API Reference

> Swaps API endpoint documentation

## Overview

The Swaps API provides endpoints for authenticating, creating orders, and managing your prediction market positions.

<Tip>
  All API endpoints require an API key for authentication. Only two endpoints (Create Order and Create Withdraw Intent) additionally require JWT authentication. See the [Authentication](/api-reference/auth/get-message) section to get started.
</Tip>

## Base URL

```
https://swap-api.flux.fun
```

## Authentication

### API Key Authentication (Required for All Endpoints)

All API endpoints require an API key in the `x-api-key` header:

```http theme={null}
x-api-key: <your-api-key>
```

### JWT Authentication (Required for Create Order & Withdraw)

Only the following endpoints require **both** API key and JWT authentication:

* [POST /v1/order](/api-reference/orders/create-order) - Create Order
* [POST /v1/order/withdraw](/api-reference/withdraw/withdraw) - Create Withdraw Intent

For these endpoints, include both headers:

```http theme={null}
x-api-key: <your-api-key>
Authorization: Bearer <your-jwt-token>
```

Get your JWT token by following the [authentication flow](/api-reference/auth/get-message).
