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

# Quickstart

> Start using Sail with OpenAI clients

Sail supports the Responses (`/v1/responses`) and Chat Completions API (`/v1/chat/completions`); see the [API support matrix](/support) for the full picture. If you are already using OpenAI or another inference provider, switching to Sail is just a base URL and API key change.

## 1. Get your API key

Sign up at the [Sail dashboard](https://app.sailresearch.com) and create an API key.

## 2. Make a request

Install the OpenAI SDK and point it at Sail. Create a response with `background=True` so the request returns a response\_id immediately, then poll until completion:

<CodeGroup>
  ```python Python theme={null}
  import time

  from openai import OpenAI


  client = OpenAI(
      base_url="https://api.sailresearch.com/v1",
      api_key="YOUR_SAIL_API_KEY",
  )

  response = client.responses.create(
      model="zai-org/GLM-5.2-FP8",
      input="Explain the key ideas behind transformers.",
      max_output_tokens=1000,
      background=True, # return immediately with ID to poll
  )
  print(f"Started {response.id}, waiting ...")

  while response.status in {"in_progress", "queued"}:
      time.sleep(1)
      response = client.responses.retrieve(response.id)

  if response.status != "completed":
      raise RuntimeError(f"Error: {response.status}")

  print(response.output_text)

  ```

  ```bash cURL theme={null}
  URL=https://api.sailresearch.com/v1/responses
  AUTH="Authorization: Bearer YOUR_SAIL_API_KEY"

  # Create the response (returns immediately with an id)
  RESPONSE_ID=$(curl -s $URL \
    -H "$AUTH" \
    -H "Content-Type: application/json" \
    -d '{
      "model": "zai-org/GLM-5.2-FP8",
      "input": "Explain the key ideas behind transformers.",
      "background": true,
      "metadata": { "completion_window": "standard" }
    }' | jq -r '.id')

  # Poll until completed
  until [ "$(curl -s $URL/$RESPONSE_ID \
    -H "$AUTH" | jq -r '.status')" = "completed" ]; do
    sleep 1
  done

  curl -s $URL/$RESPONSE_ID -H "$AUTH" | jq
  ```
</CodeGroup>

## Next steps

* Look at our full list of supported [models](/models) and [pricing](/pricing).
* Browse the full [API reference](/api-reference) to see supported endpoints and request fields.
* Copy the [migration prompt](/migrate#copy-migration-prompt) for your coding agent.
* [Email us](mailto:support@sailresearch.com) if you have questions.
