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

# 快速开始

> 完成首次同步 TTS 请求

export const apiKeyUrl = "https://www.vmeg.ai/open-api-setting";

export const productUrls = JSON.parse('{"home":"https://www.vmeg.ai/home","apiConfiguration":"https://www.vmeg.ai/open-api-setting","signIn":"https://www.vmeg.ai/signIn?redirect=%2Fhome","signInToApiSettings":"https://www.vmeg.ai/signIn?redirect=%2Fopen-api-setting","signUp":"https://www.vmeg.ai/signup","account":"https://www.vmeg.ai/account","helpCenter":"https://www.vmeg.ai/help-center/","pricing":"https://www.vmeg.ai/pricing","myTasks":"https://www.vmeg.ai/my-tasks","myAssets":"https://www.vmeg.ai/my-assets","videoTranslation":"https://www.vmeg.ai/translation","audioTranslation":"https://www.vmeg.ai/audio-translation","cloneVoice":"https://www.vmeg.ai/clone-voice","bookDemo":"https://www.vmeg.ai/book-a-demo/","contactUs":"https://www.vmeg.ai/contact-us/","apiDocs":"https://docs.vmeg.ai"}');

## 前置条件

* 已付费账户且有余量 — 见 [价格](/zh/guides/pricing)
* 已创建 **API Key** — 见 [API 密钥](/zh/guides/authentication) 与 <a href={apiKeyUrl}>API 配置</a>（未登录请先 <a href={productUrls.signInToApiSettings}>登录</a>）

## 同步 TTS 示例

提交一行文本，在 HTTP 响应中直接获得合成音频 URL。

```bash theme={null}
curl -X POST "https://api.vmeg.ai/openapi/v1/task/tts/create" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "language": { "target": "en-US" },
    "outputFormat": "mp3",
    "data": [
      {
        "text": "Hello from VMEG Open API.",
        "voiceId": "YOUR_VOICE_ID"
      }
    ]
  }'
```

成功时 `code` 为 `200`，`data.results` 含 CDN 音频地址。字段细节见 API 参考中 **Create TTS (sync)**。

将 `YOUR_VOICE_ID` 替换为 [列出系统音色](/zh/api-reference/assets/voices/list-system-voices) 返回的 `voiceId`（如 `sv_…`）。

## 异步任务

异步任务：

1. 每个 `POST` 都须携带 [`X-Idempotency-Key`](/zh/guides/idempotency)（必填，最长 64 字符）。
2. 在 <a href={apiKeyUrl}>API 配置</a> 设置 [Webhook](/zh/guides/webhooks)。
3. HTTP 响应仅确认受理（`taskId` 等）— 成品在 [Webhook 请求体](/zh/guides/webhook-request) 中送达。

各产品同步/异步对照见 [产品概览](/zh/guides/products/overview)。

## 下一步

<CardGroup cols={2}>
  <Card title="API 密钥" icon="key" href="/zh/guides/authentication">
    API Key 与 Bearer 头
  </Card>

  <Card title="文本转语音" icon="volume-high" href="/zh/guides/products/text-to-speech">
    TTS 流程与选音色
  </Card>
</CardGroup>
