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

# 快速開始

> 快速接入 Cloudsome 提供的 OpenAI 相容介面。

## 開始之前

1. 註冊帳戶，並在控制台建立 API 金鑰。
2. 確認目前空間餘額充足，如有需要請先儲值。
3. 安裝你所用語言的 OpenAI SDK。
4. 從模型頁面或 GET /v1/models 取得目前可用的模型 ID，將 base URL 指向 Cloudsome，並使用該模型 ID 發起請求。

## 請求範例

```bash cURL theme={null}
curl https://api.cloudsome-inc.ai/v1/chat/completions \
  -H "Authorization: Bearer sk_live_..." \
  -H "Content-Type: application/json" \
  -d '{
    "model": "YOUR_MODEL_ID",
    "messages": [{"role": "user", "content": "Hello!"}]
  }'
```

```python Python theme={null}
from openai import OpenAI

client = OpenAI(
    base_url="https://api.cloudsome-inc.ai/v1",
    api_key="sk_live_...",
)

response = client.chat.completions.create(
    model="claude-sonnet-4-6",
    messages=[{"role": "user", "content": "Hello!"}],
    stream=True,
)

for chunk in response:
    for choice in chunk.choices:
        if choice.delta.content:
            print(choice.delta.content, end="")
```

```javascript Node.js theme={null}
import OpenAI from "openai";

const client = new OpenAI({
  baseURL: "https://api.cloudsome-inc.ai/v1",
  apiKey: "sk_live_...",
});

const response = await client.chat.completions.create({
  model: "YOUR_MODEL_ID",
  messages: [{ role: "user", content: "Hello!" }],
});

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

[cURL →](https://docs.cloudsome-inc.ai/zh-TW/curl.md) · [Python →](https://docs.cloudsome-inc.ai/zh-TW/python.md) · [Node.js →](https://docs.cloudsome-inc.ai/zh-TW/node.md)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.