> ## 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 or Anthropic clients

Sail supports the OpenAI Chat Completions (`/v1/chat/completions`), OpenAI Responses (`/v1/responses`), and Anthropic Messages (`/v1/messages`) APIs; see the [API support matrix](/support) for the full picture. If you are already using these APIs, 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

Point the SDK you already use at Sail. The OpenAI SDK works with the Chat Completions and Responses APIs, and the Anthropic SDK works with the Messages API.

<Tabs>
  <Tab title="Chat Completions (OpenAI)">
    <CodeGroup>
      ```python Python theme={null}
      from openai import OpenAI


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

      completion = client.chat.completions.create(
          model="zai-org/GLM-5.3",
          messages=[{"role": "user", "content": "Explain the key ideas behind transformers."}],
      )

      print(completion.choices[0].message.content)
      ```

      ```typescript TypeScript theme={null}
      import OpenAI from "openai";

      const client = new OpenAI({
        baseURL: "https://api.sailresearch.com/v1",
        apiKey: process.env.SAIL_API_KEY,
      });

      const completion = await client.chat.completions.create({
        model: "zai-org/GLM-5.3",
        messages: [
          {
            role: "user",
            content: "Explain the key ideas behind transformers.",
          },
        ],
      });

      console.log(completion.choices[0].message.content);
      ```

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

      curl -s $URL \
        -H "$AUTH" \
        -H "Content-Type: application/json" \
        -d '{
          "model": "zai-org/GLM-5.3",
          "messages": [
            {
              "role": "user",
              "content": "Explain the key ideas behind transformers."
            }
          ]
        }' | jq
      ```
    </CodeGroup>
  </Tab>

  <Tab title="Responses (OpenAI)">
    <CodeGroup>
      ```python Python theme={null}
      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.3",
          input="Explain the key ideas behind transformers.",
          max_output_tokens=1000,
      )

      # Incomplete responses still expose their partial output.
      print(response.output_text)
      ```

      ```typescript TypeScript theme={null}
      import OpenAI from "openai";

      const client = new OpenAI({
        baseURL: "https://api.sailresearch.com/v1",
        apiKey: process.env.SAIL_API_KEY,
      });

      const response = await client.responses.create({
        model: "zai-org/GLM-5.3",
        input: "Explain the key ideas behind transformers.",
        max_output_tokens: 1000,
      });

      // Incomplete responses still expose their partial output.
      console.log(response.output_text);
      ```

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

      curl -s $URL \
        -H "$AUTH" \
        -H "Content-Type: application/json" \
        -d '{
          "model": "zai-org/GLM-5.3",
          "input": "Explain the key ideas behind transformers.",
          "max_output_tokens": 1000
        }' | jq
      ```
    </CodeGroup>
  </Tab>

  <Tab title="Messages (Anthropic)">
    <CodeGroup>
      ```python Python theme={null}
      from anthropic import Anthropic


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

      message = client.messages.create(
          model="zai-org/GLM-5.3",
          max_tokens=1000,
          messages=[{"role": "user", "content": "Explain the key ideas behind transformers."}],
      )

      # Reasoning models can return a thinking block first, so select text by type.
      for block in message.content:
          if block.type == "text":
              print(block.text)
      ```

      ```typescript TypeScript theme={null}
      import Anthropic from "@anthropic-ai/sdk";

      const client = new Anthropic({
        baseURL: "https://api.sailresearch.com",
        apiKey: process.env.SAIL_API_KEY,
      });

      const message = await client.messages.create({
        model: "zai-org/GLM-5.3",
        max_tokens: 1000,
        messages: [
          {
            role: "user",
            content: "Explain the key ideas behind transformers.",
          },
        ],
      });

      // Reasoning models can return a thinking block first, so select text by type.
      for (const block of message.content) {
        if (block.type === "text") console.log(block.text);
      }
      ```

      ```bash cURL theme={null}
      URL=https://api.sailresearch.com/v1/messages
      AUTH="x-api-key: YOUR_SAIL_API_KEY"

      curl -s $URL \
        -H "$AUTH" \
        -H "Content-Type: application/json" \
        -d '{
          "model": "zai-org/GLM-5.3",
          "max_tokens": 1000,
          "messages": [
            {
              "role": "user",
              "content": "Explain the key ideas behind transformers."
            }
          ]
        }' | jq
      ```
    </CodeGroup>
  </Tab>
</Tabs>

## Next steps

* Look at our full list of supported [models](/models) and [pricing](/pricing).
* Check the [API support matrix](/support) for what each API supports today, and browse the full [API reference](/api-reference) for endpoints and request fields.
* Using a coding agent? Connect it to the [Sail docs MCP server](/mcp-server)
  to give it a live connection to these docs.
* [Email us](mailto:support@sailresearch.com) if you have questions.
