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

# Getting Started

> Make your first request to the Struct API.

## Base URL

All Struct API requests are made to:

```
https://api.struct.to
```

Enterprise customers with a dedicated domain can use their own host. See [SDK Configuration](/sdk/configuration#custom-base-url) for the override.

## Authentication

Every request must include your API key in the `X-API-Key` header.

```bash theme={null}
curl https://api.struct.to/v1/polymarket/market \
  -H "X-API-Key: YOUR_API_KEY"
```

See [Authentication](/introduction/authentication) for secret keys, JWT public keys (browser-safe), rotation, and the full error responses.

<Warning>Keep `sk_live_*` keys secret. Never embed them in client-side code, mobile apps, or public repositories. Use `pk_jwt_*` keys for any environment you do not fully control.</Warning>

## Making your first request

<Steps>
  <Step title="Create an account">
    Sign up at [struct.to/dashboard](https://struct.to/dashboard) and create an organisation.
  </Step>

  <Step title="Generate an API key">
    Open the [API Keys](https://struct.to/dashboard) page in your dashboard and create a new key. Copy the value somewhere safe; you won't be able to view it again. See [Authentication](/introduction/authentication) for key types, JWT public keys, and rotation.
  </Step>

  <Step title="Send a request">
    Use the base URL and your API key to make your first call:

    <CodeGroup>
      ```typescript SDK theme={null}
      import { StructClient } from "@structbuild/sdk";

      const client = new StructClient({ apiKey: "YOUR_API_KEY" });

      const { data: markets } = await client.markets.getMarkets({ limit: 10 });
      ```

      ```bash cURL theme={null}
      curl https://api.struct.to/v1/polymarket/market \
        -H "X-API-Key: YOUR_API_KEY"
      ```

      ```javascript JavaScript theme={null}
      const response = await fetch("https://api.struct.to/v1/polymarket/market", {
        headers: { "X-API-Key": "YOUR_API_KEY" },
      });

      const data = await response.json();
      ```

      ```python Python theme={null}
      import requests

      response = requests.get(
          "https://api.struct.to/v1/polymarket/market",
          headers={"X-API-Key": "YOUR_API_KEY"},
      )

      data = response.json()
      ```
    </CodeGroup>
  </Step>
</Steps>

## Response format

Every response is wrapped in a standard envelope with `success`, `data`, `message`, and an `info` block carrying the API `version` and `credits_consumed`. See [Response Format](/api-reference/response-format).

## Rate limits

Limits depend on your plan. See [Rate Limits](/guides/rate-limits) for the full matrix and [Pricing](/introduction/pricing) for credit allowances.

## Errors

Failures return the same envelope with `success: false`. For the full status-code reference and retry guidance, see [Errors](/guides/errors).
