---
title: 快速入門 | RunAPI
description: 在 5 分鐘內運行您的第一個 AI 生成任務。
url: https://runapi.ai/zh-HK/docs/guides/quickstart.md
canonical: https://runapi.ai/zh-HK/docs/guides/quickstart
locale: zh-HK
---

> HTML 版本: https://runapi.ai/zh-HK/docs/guides/quickstart
> 智能代理網站索引: https://runapi.ai/llms.txt

# 快速入門

## 第 1 步：獲取 API 金鑰

建立 RunAPI 帳戶並從儀表板生成金鑰。金鑰按專案劃定範圍，因此您可以輪換或撤銷其中一個，而不影響其餘設定。

> 每個新帳戶均附贈免費入門積分。

## 第 2 步：安裝 SDK

選擇適合您語言的客戶端。每個 SDK 均附帶完整的類型定義
和內建任務輪詢功能。

```shell
pip install runapi
npm install runapi
go get github.com/runapi/runapi-go
```

## 第 3 步：建立您的第一個任務

媒體生成是非同步的。提交任務後立即返回；
`task.wait()` 會阻塞直到輸出準備就緒。

```python
$ pip install runapi

from runapi import RunAPI

client = RunAPI()
task = client.generate(
    model="kling-v2.1",
    prompt="A cat walking on a beach",
    duration=5
)
result = task.wait()
print(result.output_url)
```

```javascript
$ npm install runapi

import RunAPI from "runapi";

const client = new RunAPI();
const task = await client.generate({
  model: "kling-v2.1",
  prompt: "A cat walking on a beach",
  duration: 5
});
const result = await task.wait();
console.log(result.outputUrl);
```

```curl
$ curl --version

curl https://runapi.ai/v1/tasks \
  -H "Authorization: Bearer $RUNAPI_KEY" \
  -d '{"model":"kling-v2.1","input":{"prompt":"A cat walking on a beach","duration":5}}'
```

```go
$ go get github.com/runapi/runapi-go

client := runapi.New()
task, _ := client.Generate(ctx, &runapi.GenerateParams{
    Model: "kling-v2.1",
    Prompt: "A cat walking on a beach",
    Duration: 5,
})
result, _ := task.Wait(ctx)
fmt.Println(result.OutputURL)
```

## 第 4 步：查看結果

已完成的任務包含輸出 URL、時長以及從您餘額中扣除的確切費用。

```json
{
  "task_id": "tsk_8f21c4ba",
  "status": "completed",
  "output": {
    "url": "https://cdn.runapi.ai/v/tsk_8f21c4ba.mp4",
    "duration": 5
  },
  "cost": { "amount": 0.21, "currency": "USD" }
}
```

---

## RunAPI 的更多內容

- [首頁](https://runapi.ai/zh-HK/.md)
- [模型目錄](https://runapi.ai/zh-HK/models.md)
- [收費](https://runapi.ai/zh-HK/pricing.md)
- [服務商](https://runapi.ai/zh-HK/models)
- [文件](https://runapi.ai/zh-HK/docs/guides)
- [SDK](https://runapi.ai/zh-HK/sdk.md)
- [CLI](https://runapi.ai/zh-HK/cli.md)
- [MCP Server](https://runapi.ai/zh-HK/mcp.md)
- [Claude Code 與 Cursor](https://runapi.ai/zh-HK/claude-code-vs-cursor.md)
- [Cursor API 設定](https://runapi.ai/zh-HK/cursor-api-setup.md)
- [RunAPI 與 OpenRouter](https://runapi.ai/zh-HK/openrouter-alternative.md)
- [企業版](https://runapi.ai/zh-HK/contact.md)
- [聯絡](https://runapi.ai/zh-HK/contact.md)
- [條款](https://runapi.ai/zh-HK/terms.md)
- [私隱](https://runapi.ai/zh-HK/privacy.md)
- [智能代理網站索引](https://runapi.ai/llms.txt)

聯絡我們: contact@runapi.ai

## 結構化資料

```json
[
  {
    "@context": "https://schema.org",
    "inLanguage": "zh-HK",
    "@type": "WebSite",
    "name": "RunAPI",
    "url": "https://runapi.ai/zh-HK",
    "potentialAction": {
      "@type": "SearchAction",
      "target": {
        "@type": "EntryPoint",
        "urlTemplate": "https://runapi.ai/zh-HK/models?q={search_term_string}"
      },
      "query-input": "required name=search_term_string"
    }
  },
  {
    "@context": "https://schema.org",
    "inLanguage": "zh-HK",
    "@type": "Organization",
    "name": "RunAPI",
    "url": "https://runapi.ai/zh-HK",
    "logo": {
      "@type": "ImageObject",
      "url": "https://runapi.ai/zh-HKicon.svg"
    },
    "sameAs": [
      "https://github.com/runapi-ai"
    ]
  },
  {
    "@context": "https://schema.org",
    "inLanguage": "zh-HK",
    "@type": "TechArticle",
    "headline": "快速入門",
    "description": "在 5 分鐘內運行您的第一個 AI 生成任務。",
    "url": "https://runapi.ai/zh-HK/docs/guides/quickstart",
    "mainEntityOfPage": "https://runapi.ai/zh-HK/docs/guides/quickstart"
  }
]
```
