Skip to main content

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.

Sail supports the OpenAI Responses API (/v1/responses). If you’re already using the OpenAI SDK, switching to Sail is mostly a base URL and API key change.

1. Get your API key

Sign up at the Sail dashboard 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:
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="moonshotai/Kimi-K2.5",
    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)

cURL Example

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": "moonshotai/Kimi-K2.5",
    "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

3. Next steps