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

# 删除项目

> 永久删除翻译项目

# 删除项目

永久删除翻译项目及其关联资产。

项目记录始终会被删除。媒体删除以尽力方式进行：如果某个已存储的文件无法移除，或在删除完成前已被移除，清理会记录该情况并继续进行，最终仍完成项目删除。因此，偶尔可能会有生成的文件残留在存储中。

> [!WARNING]
>
> 此操作不可逆。项目、其作品、所有转录记录以及所有生成的媒体都将被删除。

## 会被删除的内容

* 项目记录及其关联的每个翻译作品（每种目标语言一个）。
* 原始转录片段和每个已翻译的转录片段，包括您通过 `translatedSrt` 提供的文本。
* 为该项目生成的所有媒体：配音视频和音轨、唇形同步视频、波形、分离出的人声轨和背景轨，以及为每个已翻译片段生成的逐片段语音文件。
* 上传的源文件和提取的原始音频。
* 为该项目生成的克隆语音预览样本。

删除项目会释放上述资产占用的存储空间。引用该项目的记录会从所有曾有权访问它的账户（所有者和团队成员）中移除。

## 不会被删除的内容

* 保存在您账户语音库中的自定义语音。它们在项目之间共享；如需删除，请从语音库中移除。
* 负责转录、翻译或语音生成的处理合作伙伴所持有的副本。这些副本遵循各合作伙伴自己的保留期限，无法通过 VoiceCheap 访问。
* 已为该项目扣除的分钟数不予退还。

## 请求

### 标头

**x-api-key** `string` *required*

您的 VoiceCheap API 密钥。请从 [app.voicecheap.ai/page-api](https://app.voicecheap.ai/page-api) 获取。

### 路径参数

**projectId** `string` *required*

要删除的翻译项目的唯一标识符。

## 响应

**success** `boolean` *required*

表示删除操作已成功完成。

**message** `string` *required*

人类可读的确认消息。

**projectId** `string` *required*

已删除项目的 ID。

## 示例

```bash cURL theme={null}
curl -X DELETE "https://api.voicecheap.ai/v1/translate/abc123-def456-ghi789" \
  -H "x-api-key: vc_your-api-key"
```

```typescript TypeScript theme={null}
interface DeleteProjectResponse {
  success: true;
  message: string;
  projectId: string;
}

async function deleteProject(projectId: string): Promise<DeleteProjectResponse> {
  const response = await fetch(
    `https://api.voicecheap.ai/v1/translate/${projectId}`,
    {
      method: 'DELETE',
      headers: {
        'x-api-key': 'vc_your-api-key',
      },
    },
  );

  if (!response.ok) {
    const error = await response.json();
    throw new Error(error.message || 'Failed to delete project');
  }

  return response.json();
}

// Usage
deleteProject('abc123-def456-ghi789')
  .then((result) => console.log('Deleted:', result.projectId))
  .catch((error) => console.error('Error:', error));
```

```python Python theme={null}
import requests

project_id = 'abc123-def456-ghi789'
headers = {'x-api-key': 'vc_your-api-key'}

response = requests.delete(
    f'https://api.voicecheap.ai/v1/translate/{project_id}',
    headers=headers
)

if not response.ok:
    error = response.json()
    raise Exception(error.get('message', 'Failed to delete project'))

result = response.json()
print(f"Deleted: {result['projectId']}")
```

```php PHP theme={null}
<?php
$apiKey = 'vc_your-api-key';
$projectId = 'abc123-def456-ghi789';

$curl = curl_init();

curl_setopt_array($curl, [
    CURLOPT_URL => "https://api.voicecheap.ai/v1/translate/{$projectId}",
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_CUSTOMREQUEST => 'DELETE',
    CURLOPT_HTTPHEADER => [
        "x-api-key: {$apiKey}"
    ]
]);

$response = curl_exec($curl);
$result = json_decode($response, true);

if (!isset($result['success'])) {
    $message = $result['message'] ?? 'Failed to delete project';
    throw new Exception($message);
}

echo "Deleted: " . $result['projectId'];
```

## 错误

| 状态 | 代码 | 描述 |
| - | - | - |
| 401 | `INVALID_API_KEY` | 提供的 API 密钥无效 |
| 403 | `FORBIDDEN` | 您没有权限删除此项目 |
| 404 | `PROJECT_NOT_FOUND` | 指定的项目不存在 |
| 429 | `RATE_LIMIT_EXCEEDED` | 请求过多（限制：每分钟 10 次请求） |
| 500 | `INTERNAL_ERROR` | 意外的服务器错误 |


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