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

# Getting Started with API

> Authenticate with the Yellow.pro API and start calling endpoints.

This guide walks you through authenticating with the Yellow\.pro API so you can start calling endpoints.

> [!NOTE]
>
> All trading, account, and transfer endpoints require authentication. Market data endpoints are public and need no credentials.

For API base URLs, see [Base URLs](https://docs.yellow.pro/api-and-programmatic-access/overview.md#base-urls).

## Authentication Flow

Yellow\.pro uses Ethereum wallet-based authentication with a challenge-response mechanism:

**1. Request a challenge**

POST to `/auth/challenge` with your wallet address.

**2. Sign the challenge**

Sign the returned challenge text with your Ethereum wallet.

**3. Verify the signature**

POST to `/auth/verify` with your wallet address, the challenge, and the signature.

**4. Receive tokens**

Get a JWT access token and a refresh token for API access.

**5. Use the access token**

Include the JWT in the `Authorization` header on authenticated endpoints.

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

See the [Authentication Service API](https://docs.yellow.pro/api-and-programmatic-access/authentication-service-api.md) for full request and response details on each endpoint.

## Authentication Methods

All authenticated endpoints support two authentication methods.

> [tab] JWT Token
>
> Obtained via the `/auth/verify` endpoint. Include the token in the `Authorization` header:
>
> ```http theme={null}
> Authorization: Bearer <token>
> ```
>
> Supported by all authenticated endpoints.

> [tab] API Key (HMAC)
>
> Best suited for programmatic / server-side access where you don't want to manage a wallet signing flow on every request. Each request includes three headers:
>
> ```http theme={null}
> X-API-KEY: <your-api-key>
> X-TIMESTAMP: <Unix timestamp in seconds>
> X-SIGNATURE: <HMAC-SHA256 signature of the request>
> ```
>
> * Supported by all authenticated endpoints (spot, perpetuals, transfers)
> * Automatically falls back to JWT if API key headers are not present
>
> See [**Signing Requests With API Keys**](https://docs.yellow.pro/api-and-programmatic-access/signing-requests-with-api-keys.md) for the exact signature algorithm and ready-to-use Node.js and Python examples.
>
> > [!WARNING]
> >
> > Never commit API keys or secrets to version control. Store them in environment variables or a secrets manager.

## Security Notes

> [!WARNING]
>
> * Access tokens expire in 15 minutes
> * Refresh tokens expire in 7 days
> * Sessions can be invalidated via logout
> * Rate limiting is enforced on authentication endpoints

## Next Steps

[Create an API key](https://docs.yellow.pro/api-and-programmatic-access/api-key-management.md)

| Section | Description | Target |
| - | - | - |
| **API Key Management** | Create, list, and revoke API keys | [API Key Management](https://docs.yellow.pro/api-and-programmatic-access/api-key-management.md) |
| **Signing Requests with API Keys** | HMAC-SHA256 signing with code examples | [Signing Requests with API Keys](https://docs.yellow.pro/api-and-programmatic-access/signing-requests-with-api-keys.md) |
| **Market Data API** | Prices and indicators (no auth required) | [Market Data API](https://docs.yellow.pro/api-and-programmatic-access/market-data-api.md) |
| **Spot Trading** | Place and manage spot orders | [Spot Trading API](https://docs.yellow.pro/api-and-programmatic-access/spot-trading-api.md) |
| **Perpetuals Trading** | Positions, leverage, and perpetual orders | [Perpetuals Trading API](https://docs.yellow.pro/api-and-programmatic-access/perpetuals-trading-api.md) |


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.