> ## 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.

# APIリファレンス

> VoiceCheap REST APIの完全なリファレンス

# APIリファレンス

VoiceCheap APIはREST原則に基づいて構成されています。標準的なHTTPメソッドを使用し、JSON形式のレスポンスを返し、標準的なHTTPレスポンスコードを使用します。

## ベースURL

すべてのAPIリクエストは以下に対して行う必要があります:

```
https://api.voicecheap.ai
```

## 認証

すべてのリクエストには、`x-api-key`ヘッダーで渡されるAPIキーが必要です。詳細は[認証](/docs/ja/authentication)ページを参照してください。

## コンテンツタイプ

* **リクエスト**: ファイルアップロードには`multipart/form-data`を、その他のリクエストには`application/json`を使用してください
* **レスポンス**: JSONエンドポイントは`application/json`を返します。文字起こしのエクスポートではSRTまたはVTTテキストを返すこともできます。

## 利用可能なエンドポイント

<CardGroup cols={2}>
  <Card title="メディアの文字起こし" icon="captions" href="/docs/ja/api-reference/transcribe">
    `POST /v1/transcribe`

    アップロードされたファイルをJSON、SRT、またはVTTとして文字起こしします。
  </Card>

  <Card title="プロジェクトの文字起こしをエクスポート" icon="file-lines" href="/docs/ja/api-reference/project-transcript">
    `POST /v1/projects/{projectId}/transcript`

    オリジナルまたは翻訳済みのプロジェクトの文字起こしを取得します。
  </Card>

  <Card title="翻訳を開始" icon="play" href="/docs/ja/api-reference/translate">
    `POST /v1/translate`

    ビデオまたはオーディオファイルをアップロードし、翻訳プロジェクトを開始します。
  </Card>

  <Card title="翻訳ステータスを取得" icon="magnifying-glass" href="/docs/ja/api-reference/translation-status">
    `GET /v1/translate/{projectId}/status`

    翻訳プロジェクトのステータスを確認し、結果を取得します。
  </Card>

  <Card title="プロジェクトの詳細を取得" icon="list-tree" href="/docs/ja/api-reference/project-details">
    `GET /v1/projects/{projectId}`

    翻訳されたバージョン履歴、リップシンク履歴、およびプロジェクトの状態を取得します。
  </Card>

  <Card title="プロジェクトを削除" icon="trash" href="/docs/ja/api-reference/delete-project">
    `DELETE /v1/translate/{projectId}`

    翻訳プロジェクトとそのアセットを完全に削除します。
  </Card>
</CardGroup>

## 翻訳ワークフロー

ビデオを翻訳するための一般的なワークフローは以下の通りです:

```mermaid theme={null}
sequenceDiagram
    participant Client
    participant API
    participant Processing

    Client->>API: POST /v1/translate (file + options)
    API->>Processing: Queue translation job
    API-->>Client: 200 OK (projectId)

    loop Poll for status
        Client->>API: GET /v1/translate/{projectId}/status
        API-->>Client: Status (processing/success/failed)
    end

    Note over Client: Download translated video URL when status is "success"
```

## レスポンス形式

すべての成功したレスポンスは、この一般的な構造に従います:

```json theme={null}
{
  "success": true,
  "message": "Description of the result"
  // Additional fields specific to the endpoint
}
```

エラーレスポンスはこの構造に従います:

```json theme={null}
{
  "code": "ERROR_CODE",
  "message": "Human-readable error description"
}
```

## HTTPステータスコード

| ステータスコード | 説明                     |
| -------- | ---------------------- |
| 200      | 成功                     |
| 400      | 不正なリクエスト - 無効なパラメータ    |
| 401      | 認証失敗 - APIキーが無効または未指定  |
| 403      | アクセス拒否 - 権限またはクレジット不足  |
| 404      | 見つかりません - リソースが存在しません  |
| 429      | リクエスト過多 - レート制限を超過しました |
| 500      | 内部サーバーエラー              |
