> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.claw-ops.com/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.claw-ops.com/_mcp/server.

# 녹음으로 음성 복제

POST https://api.claw-ops.com/v1/accounts/{accountId}/voice-clones
Content-Type: multipart/form-data

사용 권리를 확인한 짧은 음성 파일을 복제하고 Agent의 voice로 사용할 ID를 반환합니다.
원본 오디오는 요청 메모리에서 공급자로 전달한 뒤 즉시 지우며 ClawOps 저장소에 보관하지 않습니다.
이 API로 만든 음성에는 미리듣기 샘플이 없습니다(콘솔에서 등록한 음성만 생성합니다).
계정당 시간당 약 10회로 제한됩니다.

Reference: https://docs.claw-ops.com/api-레퍼런스/claw-ops-api/agents/create-voice-clone

## Authentication

- `Authorization` header (bearer token, required) — API Key를 Bearer 토큰으로 전달

## Request

### Path parameters

- `accountId` (string, required) — 계정 ID

### Body (multipart/form-data)

- `name` (string, required)
- `description` (string, optional)
- `consent` (string, required) — 업로더가 이 목소리를 사용할 권리가 있음을 확인해야 합니다. `true` 또는 `on`.
- `clip` (file, required) — 최대 10MB의 wav, mp3, flac, ogg, webm 또는 m4a 음성 파일

## Response

### 201

복제 완료

- `id` (string, required) — ClawOps 복제 음성 리소스 ID
- `name` (string, required)
- `status` (enum, required)
  - Allowed values: `cloning`, `ready`, `failed`
- `description` (string, optional, nullable)
- `voice` (string, optional) — ready 상태에서 Agent voice 설정에 사용할 ID
- `consentAt` (datetime, optional, nullable)
- `dateCreated` (datetime, optional)

## Examples

**Request**

```json
{
  "clip": "<file: [object Object]>",
  "consent": {
    "type": "json",
    "value": "true"
  },
  "description": {
    "type": "json"
  },
  "name": {
    "type": "json",
    "value": "string"
  }
}
```

**Response**

```json
{
  "id": "string",
  "name": "string",
  "status": "cloning",
  "description": "string",
  "voice": "string",
  "consentAt": "2024-01-15T09:30:00Z",
  "dateCreated": "2024-01-15T09:30:00Z"
}
```

**SDK Code**

```python
import requests

url = "https://api.claw-ops.com/v1/accounts/AC1a2b3c4d/voice-clones"

files = { "clip": "open('[object Object]', 'rb')" }
payload = {
    "consent": "{
  \"type\": \"json\",
  \"value\": \"true\"
}",
    "description": "{
  \"type\": \"json\"
}",
    "name": "{
  \"type\": \"json\",
  \"value\": \"string\"
}"
}
headers = {"Authorization": "Bearer <token>"}

response = requests.post(url, data=payload, files=files, headers=headers)

print(response.json())
```

```javascript
const url = 'https://api.claw-ops.com/v1/accounts/AC1a2b3c4d/voice-clones';
const form = new FormData();
form.append('clip', '[object Object]');
form.append('consent', '{
  "type": "json",
  "value": "true"
}');
form.append('description', '{
  "type": "json"
}');
form.append('name', '{
  "type": "json",
  "value": "string"
}');

const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};

options.body = form;

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io"
)

func main() {

	url := "https://api.claw-ops.com/v1/accounts/AC1a2b3c4d/voice-clones"

	payload := strings.NewReader("-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"clip\"; filename=\"[object Object]\"\r\nContent-Type: application/octet-stream\r\n\r\n\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"consent\"\r\n\r\n{\n  \"type\": \"json\",\n  \"value\": \"true\"\n}\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"description\"\r\n\r\n{\n  \"type\": \"json\"\n}\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"name\"\r\n\r\n{\n  \"type\": \"json\",\n  \"value\": \"string\"\n}\r\n-----011000010111000001101001--\r\n")

	req, _ := http.NewRequest("POST", url, payload)

	req.Header.Add("Authorization", "Bearer <token>")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby
require 'uri'
require 'net/http'

url = URI("https://api.claw-ops.com/v1/accounts/AC1a2b3c4d/voice-clones")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request.body = "-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"clip\"; filename=\"[object Object]\"\r\nContent-Type: application/octet-stream\r\n\r\n\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"consent\"\r\n\r\n{\n  \"type\": \"json\",\n  \"value\": \"true\"\n}\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"description\"\r\n\r\n{\n  \"type\": \"json\"\n}\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"name\"\r\n\r\n{\n  \"type\": \"json\",\n  \"value\": \"string\"\n}\r\n-----011000010111000001101001--\r\n"

response = http.request(request)
puts response.read_body
```

```java
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://api.claw-ops.com/v1/accounts/AC1a2b3c4d/voice-clones")
  .header("Authorization", "Bearer <token>")
  .body("-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"clip\"; filename=\"[object Object]\"\r\nContent-Type: application/octet-stream\r\n\r\n\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"consent\"\r\n\r\n{\n  \"type\": \"json\",\n  \"value\": \"true\"\n}\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"description\"\r\n\r\n{\n  \"type\": \"json\"\n}\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"name\"\r\n\r\n{\n  \"type\": \"json\",\n  \"value\": \"string\"\n}\r\n-----011000010111000001101001--\r\n")
  .asString();
```

```php
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://api.claw-ops.com/v1/accounts/AC1a2b3c4d/voice-clones', [
  'multipart' => [
    [
        'name' => 'clip',
        'filename' => '[object Object]',
        'contents' => null
    ],
    [
        'name' => 'consent',
        'contents' => '{
  "type": "json",
  "value": "true"
}'
    ],
    [
        'name' => 'description',
        'contents' => '{
  "type": "json"
}'
    ],
    [
        'name' => 'name',
        'contents' => '{
  "type": "json",
  "value": "string"
}'
    ]
  ]
  'headers' => [
    'Authorization' => 'Bearer <token>',
  ],
]);

echo $response->getBody();
```

```csharp
using RestSharp;

var client = new RestClient("https://api.claw-ops.com/v1/accounts/AC1a2b3c4d/voice-clones");
var request = new RestRequest(Method.POST);
request.AddHeader("Authorization", "Bearer <token>");
request.AddParameter("undefined", "-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"clip\"; filename=\"[object Object]\"\r\nContent-Type: application/octet-stream\r\n\r\n\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"consent\"\r\n\r\n{\n  \"type\": \"json\",\n  \"value\": \"true\"\n}\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"description\"\r\n\r\n{\n  \"type\": \"json\"\n}\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"name\"\r\n\r\n{\n  \"type\": \"json\",\n  \"value\": \"string\"\n}\r\n-----011000010111000001101001--\r\n", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift
import Foundation

let headers = ["Authorization": "Bearer <token>"]
let parameters = [
  [
    "name": "clip",
    "fileName": "[object Object]"
  ],
  [
    "name": "consent",
    "value": "{
  \"type\": \"json\",
  \"value\": \"true\"
}"
  ],
  [
    "name": "description",
    "value": "{
  \"type\": \"json\"
}"
  ],
  [
    "name": "name",
    "value": "{
  \"type\": \"json\",
  \"value\": \"string\"
}"
  ]
]

let boundary = "---011000010111000001101001"

var body = ""
var error: NSError? = nil
for param in parameters {
  let paramName = param["name"]!
  body += "--\(boundary)\r\n"
  body += "Content-Disposition:form-data; name=\"\(paramName)\""
  if let filename = param["fileName"] {
    let contentType = param["content-type"]!
    let fileContent = String(contentsOfFile: filename, encoding: String.Encoding.utf8)
    if (error != nil) {
      print(error as Any)
    }
    body += "; filename=\"\(filename)\"\r\n"
    body += "Content-Type: \(contentType)\r\n\r\n"
    body += fileContent
  } else if let paramValue = param["value"] {
    body += "\r\n\r\n\(paramValue)"
  }
}

let request = NSMutableURLRequest(url: NSURL(string: "https://api.claw-ops.com/v1/accounts/AC1a2b3c4d/voice-clones")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```