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

# 快速上手

## 1. 登录平台

创建一个 [SiliconFlow](https://cloud.siliconflow.com/) 帐户。

## 2. 查看模型列表和模型详情

通过 [模型广场](https://cloud.siliconflow.com/models) 查看当前可用的模型详情、模型价格、用户可用的最高限速等信息，并可以通过模型详情页的“在线体验”测试模型。

## 3. 在 playground 体验 GenAI 能力

进入 [“体验中心 ( playground )”](https://cloud.siliconflow.com/) 页面，左侧栏可选择语言模型、文生图模型和图生图模型，选择相应模型即可开始实时体验。输入相关参数及 prompt，点击“运行”按钮，即可看到模型生成的结果。

## 4. 使用 SiliconFlow API 调用 GenAI 能力

### 4.1 创建 API key

进入 [API 密钥](https://cloud.siliconflow.com/account/ak) 页面，点击“新建 API 密钥”，创建您的 API key。

### 4.2 通过 REST 接口进行服务调用

您可以直接在平台的 [“文档链接”](https://docs.siliconflow.com/api-reference/chat-completions/chat-completions) 中使用您的 API key 进行在线调用，此处可以生成对应语言的代码。

### 4.3 通过 OpenAI 接口调用

当前大语言模型部分支持以 OpenAI 库进行调用，
安装 Python3.7.1 或更高版本并设置虚拟环境后，即可安装 OpenAI Python 库。从终端/命令行运行：

```shell theme={null}
pip install --upgrade openai
```

完成此操作后，running 将显示您在当前环境中安装的 Python 库，确认 OpenAI Python 库已成功安装。
之后可以直接通过 OpenAI 的相关接口进行调用，目前平台支持 OpenAI 相关的大多数参数。

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

client = OpenAI(api_key="YOUR_API_KEY", base_url="https://api.siliconflow.com/v1")
response = client.chat.completions.create(
    model='deepseek-ai/DeepSeek-R1',
    messages=[
        {'role': 'user', 
        'content': "tell me a story"}
    ],
    stream=True
)

for chunk in response:
    if not chunk.choices:
        continue
    if chunk.choices[0].delta.content:
        print(chunk.choices[0].delta.content, end="", flush=True)
    if chunk.choices[0].delta.reasoning_content:
        print(chunk.choices[0].delta.reasoning_content, end="", flush=True)
```
