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

# OpenAPI Spec

> Access the Turtle Earn API spec for SDK generation and API testing.

The Turtle Earn API publishes an OpenAPI 3.0 specification that you can use for client generation, API testing, and documentation tooling.

**Raw spec URL:** `https://earn.turtle.xyz/docs/openapi.json`

## What you can do with it

* Import into Postman or Insomnia for interactive API testing
* Generate TypeScript or Python clients with `openapi-generator`
* Use with Swagger UI locally for browsing endpoints

## Generate a TypeScript client

<CodeGroup>
  ```bash curl theme={null}
  npx @openapitools/openapi-generator-cli generate \
    -i https://earn.turtle.xyz/docs/openapi.json \
    -g typescript-fetch \
    -o ./turtle-client
  ```

  ```typescript TypeScript theme={null}
  // After generating, import and use the client:
  import { OpportunitiesApi, Configuration } from './turtle-client';

  const config = new Configuration({
    headers: { 'X-API-Key': 'pk_live_xxxxx' },
  });

  const api = new OpportunitiesApi(config);
  const opportunities = await api.getOpportunities();
  ```
</CodeGroup>

<Note>
  The spec is generated from the live API. Three fields confirmed in the raw spec are now documented on the [Opportunities](/sdk/opportunities/get-opportunities) page: `minDepositAmountUsd`, `swapDirectEnabled`, `swapRouteEnabled`.
</Note>
