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

# Quick Start

> 快速开始：Quick Start

## 1. 安装

```bash theme={null}
pip install openai
```

## 2. 初始化

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

client = OpenAI(
    api_key="sk-your-token",           # 控制台创建的令牌
    base_url="https://socialvision.tisyk.xyz/v1",    #  Base URL
)
```

## 3. 最小对话

```python theme={null}
resp = client.chat.completions.create(
    model="gpt-4o-mini",  # 替换为控制台可用模型
    messages=[
        {"role": "user", "content": "用一句话介绍API"},
    ],
)
print(resp.choices[0].message.content)
```

## 4. 响应说明

* 成功：HTTP 200，body 为 OpenAI 兼容 JSON（含 `choices`）
* 失败：HTTP 4xx/5xx 或 body 内 `error` 字段（视上游格式而定）

## 5. 注意事项

1. `base_url` 必须带 `/v1`，不要漏掉路径前缀
2. 模型名以控制台为准，与 OpenAI 官方 ID 可能不同
3. 流式请求设置 `stream=True`，可在门户接口参考中查看流式相关说明
4. 视频 / 音乐等异步接口见 [async-task-general.md](/tutorials/async-task-general)
5. 在线调试请使用本站开发者门户的 Try it / 接口参考


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