> This page is for version v1.3 (default).
> For other versions, use one of these documentation indexes:
> - v1.3 (default): https://docs.twelvelabs.io/v1.3/llms.txt

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

# Create embeddings for text, image, and audio

POST https://api.twelvelabs.io/v1.3/embed
Content-Type: multipart/form-data

This endpoint will be deprecated in a future version. Migrate to the [Embed API v2](/v1.3/api-reference/create-embeddings-v2) for continued support and access to new features.

This method creates embeddings for text, image, and audio content.

Ensure your media files meet the following requirements:

* [Audio files](/v1.3/docs/concepts/models/marengo/marengo-3-0#audio-file-requirements).
* [Images](/v1.3/docs/concepts/models/marengo/marengo-3-0#image-file-requirements).

Parameters for embeddings:

* **Common parameters**:
  * `model_name`: The video understanding model you want to use. Example: "marengo3.0".
* **Text embeddings**:
  * `text`: Text for which to create an embedding.
* **Image embeddings**:
  Provide one of the following:
  * `image_url`: Publicly accessible URL of your image file.
  * `image_file`:  Local image file.
* **Audio embeddings**:
  Provide one of the following:
  * `audio_url`: Publicly accessible URL of your audio file.
  * `audio_file`: Local audio file.

- The Marengo video understanding model generates embeddings for all modalities in the same latent space. This shared space enables any-to-any searches across different types of content.
- You can create multiple types of embeddings in a single API call.
- Audio embeddings combine generic sound and human speech in a single embedding. For videos with transcriptions, you can retrieve transcriptions and then [create text embeddings](/v1.3/api-reference/create-embeddings-v1/text-image-audio-embeddings/create-text-image-audio-embeddings) from these
- This endpoint is rate-limited. For details, see the [Rate limits](/v1.3/docs/get-started/rate-limits) page.

Reference: https://docs.twelvelabs.io/api-reference/create-embeddings-v1/text-image-audio-embeddings/create-text-image-audio-embeddings

## Authentication

- `x-api-key` header (required) — Your API key. You can find your API key on the API Keys page.

## Request

### Body (multipart/form-data)

This endpoint expects a multipart form with multiple files.

- `model_name` (string, required) — The name of the model you want to use. The following models are available: - `marengo3.0`: Enhanced model with sports intelligence and extended content support.
- `text` (string, optional) — The text for which you wish to create an embedding. **Example**: "Man with a dog crossing the street"
- `image_url` (string, optional) — The publicly accessible URL of the image for which you wish to create an embedding. This parameter is required for image embeddings if `image_file` is not provided.
- `image_file` (file, optional) — The image file for which you wish to create an embedding as a local file. This parameter is required for image embeddings if `image_url` is not provided.
- `audio_url` (string, optional) — The publicly accessible URL of the audio file for which you wish to creae an embedding. This parameter is required for audio embeddings if `audio_file` is not provided.
- `audio_file` (file, optional) — The audio file for which you wish to create an embedding as a local file. This parameter is required for audio embeddings if `audio_url` is not provided.
- `audio_start_offset_sec` (double, optional) — Specifies the start time, in seconds, from which the platform generates the audio embeddings. This parameter allows you to skip the initial portion of the audio during processing. **Default**: `0`.

## Response

### 200

A text embedding has successfully been created.

- `model_name` (string, required) — The name of the video understanding model the platform has used to create this embedding.
- `text_embedding` (TextEmbeddingResult, optional) — An object that contains the generated text embedding vector and associated information. Present when text was processed.
- `image_embedding` (ImageEmbeddingResult, optional) — An object that contains the generated image embedding vector and associated information. Present when image was processed.
- `audio_embedding` (AudioEmbeddingResult, optional) — An object that contains the generated audio embedding vector and associated information. Present when audio was processed.

## Errors

### 400 Bad Request Error

The request has failed.

- `code` (string, optional) — A string representing the code associated with the error. See the [Error codes](/v1.3/api-reference/error-codes) page for details.
- `message` (string, optional) — A human-readable string describing the error, intended to be suitable for display in a user interface.

## Types

### TextEmbeddingResult

An object containing the generated embedding vector.

- `error_message` (string, optional) — Error message if the embedding generation failed.
- `segments` (list of BaseSegment, optional) — An object that contains the embedding.

### ImageEmbeddingResult

An object containing the generated embedding vector and associated information.

- `error_message` (string, optional) — Error message if the embedding generation failed.
- `segments` (list of BaseSegment, optional) — An object that contains the embedding.
- `metadata` (BaseEmbeddingMetadata, optional) — Metadata about the embedding.

### AudioEmbeddingResult

An object that contains the generated embedding vector and associated information.

- `segments` (list of AudioSegment, optional) — An object that contains the embedding and its start time.
- `error_message` (string, optional) — Error message if the embedding generation failed.
- `metadata` (BaseEmbeddingMetadata, optional) — Metadata about the embedding.

### BaseSegment

An object that contains the embedding value of a segment.

- `float` (list of double, optional) — An array of floating point numbers representing the embedding. You can use this array with cosine similarity for various downstream tasks. Note that the example response was truncated for brevity.

### BaseEmbeddingMetadata

Metadata about the embedding.

- `input_url` (string, optional) — The URL of the media file used to generate the embedding. Present if a URL was provided in the request.
- `input_filename` (string, optional) — The name of the media file used to generate the embedding. Present if a file was provided in the request.

### AudioSegment

An object that contains the audio embedding and its start time.

- `float` (list of double, optional) — An array of floating point numbers representing the embedding. You can use this array with cosine similarity for various downstream tasks. Note that the example response was truncated for brevity.
- `start_offset_sec` (double, optional) — The start time in seconds from the beginning of the file.
- `end_offset_sec` (double, optional) — The end time in seconds from the beginning of the file.

## Examples

### Image embedding using URL

**Request**

```json
{
  "model_name": "marengo3.0",
  "image_url": "https://example.com/image.jpg",
  "image_file": "<file: <file1>>",
  "audio_file": "<file: <file1>>"
}
```

**Response**

```json
{
  "model_name": "marengo3.0",
  "text_embedding": {
    "segments": [
      {
        "float": [
          -0.042632885,
          0.014312328,
          0.029209055
        ]
      }
    ]
  },
  "image_embedding": {
    "segments": [
      {
        "float": [
          -0.042632885,
          0.014312328,
          0.029209055
        ]
      }
    ],
    "metadata": {
      "input_filename": "01.jpg"
    }
  },
  "audio_embedding": {
    "segments": [
      {
        "float": [
          -0.042632885,
          0.014312328,
          0.029209055
        ],
        "start_offset_sec": 0,
        "end_offset_sec": 6,
        "embedding_option": "audio"
      },
      {
        "float": [
          -0.042632885,
          0.014312328,
          0.029209055
        ],
        "start_offset_sec": 0,
        "end_offset_sec": 6,
        "embedding_option": "transcription"
      }
    ],
    "metadata": {
      "input_filename": "01.mp3"
    }
  }
}
```

**SDK Code**

```python Image embedding using URL
import requests

url = "https://api.twelvelabs.io/v1.3/embed"

files = {
    "image_file": "open('<file1>', 'rb')",
    "audio_file": "open('<file1>', 'rb')"
}
payload = {
    "model_name": "marengo3.0",
    "text": ,
    "image_url": "https://example.com/image.jpg",
    "audio_url": ,
    "audio_start_offset_sec": 
}
headers = {"x-api-key": "<apiKey>"}

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

print(response.json())
```

```javascript Image embedding using URL
const url = 'https://api.twelvelabs.io/v1.3/embed';
const form = new FormData();
form.append('model_name', 'marengo3.0');
form.append('text', '');
form.append('image_url', 'https://example.com/image.jpg');
form.append('image_file', '<file1>');
form.append('audio_url', '');
form.append('audio_file', '<file1>');
form.append('audio_start_offset_sec', '');

const options = {method: 'POST', headers: {'x-api-key': '<apiKey>'}};

options.body = form;

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

```go Image embedding using URL
package main

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

func main() {

	url := "https://api.twelvelabs.io/v1.3/embed"

	payload := strings.NewReader("-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"model_name\"\r\n\r\nmarengo3.0\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"text\"\r\n\r\n\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"image_url\"\r\n\r\nhttps://example.com/image.jpg\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"image_file\"; filename=\"<file1>\"\r\nContent-Type: application/octet-stream\r\n\r\n\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"audio_url\"\r\n\r\n\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"audio_file\"; filename=\"<file1>\"\r\nContent-Type: application/octet-stream\r\n\r\n\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"audio_start_offset_sec\"\r\n\r\n\r\n-----011000010111000001101001--\r\n")

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

	req.Header.Add("x-api-key", "<apiKey>")

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

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

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

}
```

```ruby Image embedding using URL
require 'uri'
require 'net/http'

url = URI("https://api.twelvelabs.io/v1.3/embed")

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

request = Net::HTTP::Post.new(url)
request["x-api-key"] = '<apiKey>'
request.body = "-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"model_name\"\r\n\r\nmarengo3.0\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"text\"\r\n\r\n\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"image_url\"\r\n\r\nhttps://example.com/image.jpg\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"image_file\"; filename=\"<file1>\"\r\nContent-Type: application/octet-stream\r\n\r\n\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"audio_url\"\r\n\r\n\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"audio_file\"; filename=\"<file1>\"\r\nContent-Type: application/octet-stream\r\n\r\n\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"audio_start_offset_sec\"\r\n\r\n\r\n-----011000010111000001101001--\r\n"

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

```java Image embedding using URL
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://api.twelvelabs.io/v1.3/embed")
  .header("x-api-key", "<apiKey>")
  .body("-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"model_name\"\r\n\r\nmarengo3.0\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"text\"\r\n\r\n\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"image_url\"\r\n\r\nhttps://example.com/image.jpg\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"image_file\"; filename=\"<file1>\"\r\nContent-Type: application/octet-stream\r\n\r\n\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"audio_url\"\r\n\r\n\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"audio_file\"; filename=\"<file1>\"\r\nContent-Type: application/octet-stream\r\n\r\n\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"audio_start_offset_sec\"\r\n\r\n\r\n-----011000010111000001101001--\r\n")
  .asString();
```

```php Image embedding using URL
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://api.twelvelabs.io/v1.3/embed', [
  'multipart' => [
    [
        'name' => 'model_name',
        'contents' => 'marengo3.0'
    ],
    [
        'name' => 'image_url',
        'contents' => 'https://example.com/image.jpg'
    ],
    [
        'name' => 'image_file',
        'filename' => '<file1>',
        'contents' => null
    ],
    [
        'name' => 'audio_file',
        'filename' => '<file1>',
        'contents' => null
    ]
  ]
  'headers' => [
    'x-api-key' => '<apiKey>',
  ],
]);

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

```csharp Image embedding using URL
using RestSharp;

var client = new RestClient("https://api.twelvelabs.io/v1.3/embed");
var request = new RestRequest(Method.POST);
request.AddHeader("x-api-key", "<apiKey>");
request.AddParameter("undefined", "-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"model_name\"\r\n\r\nmarengo3.0\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"text\"\r\n\r\n\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"image_url\"\r\n\r\nhttps://example.com/image.jpg\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"image_file\"; filename=\"<file1>\"\r\nContent-Type: application/octet-stream\r\n\r\n\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"audio_url\"\r\n\r\n\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"audio_file\"; filename=\"<file1>\"\r\nContent-Type: application/octet-stream\r\n\r\n\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"audio_start_offset_sec\"\r\n\r\n\r\n-----011000010111000001101001--\r\n", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift Image embedding using URL
import Foundation

let headers = ["x-api-key": "<apiKey>"]
let parameters = [
  [
    "name": "model_name",
    "value": "marengo3.0"
  ],
  [
    "name": "text",
    "value": 
  ],
  [
    "name": "image_url",
    "value": "https://example.com/image.jpg"
  ],
  [
    "name": "image_file",
    "fileName": "<file1>"
  ],
  [
    "name": "audio_url",
    "value": 
  ],
  [
    "name": "audio_file",
    "fileName": "<file1>"
  ],
  [
    "name": "audio_start_offset_sec",
    "value": 
  ]
]

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.twelvelabs.io/v1.3/embed")! 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()
```

### Image embedding using local file

**Request**

```json
{
  "model_name": "marengo3.0",
  "image_file": "<file: /Users/john/Documents/image.jpg>",
  "audio_file": "<file: <file1>>"
}
```

**Response**

```json
{
  "model_name": "marengo3.0",
  "text_embedding": {
    "segments": [
      {
        "float": [
          -0.042632885,
          0.014312328,
          0.029209055
        ]
      }
    ]
  },
  "image_embedding": {
    "segments": [
      {
        "float": [
          -0.042632885,
          0.014312328,
          0.029209055
        ]
      }
    ],
    "metadata": {
      "input_filename": "01.jpg"
    }
  },
  "audio_embedding": {
    "segments": [
      {
        "float": [
          -0.042632885,
          0.014312328,
          0.029209055
        ],
        "start_offset_sec": 0,
        "end_offset_sec": 6,
        "embedding_option": "audio"
      },
      {
        "float": [
          -0.042632885,
          0.014312328,
          0.029209055
        ],
        "start_offset_sec": 0,
        "end_offset_sec": 6,
        "embedding_option": "transcription"
      }
    ],
    "metadata": {
      "input_filename": "01.mp3"
    }
  }
}
```

**SDK Code**

```python Image embedding using local file
import requests

url = "https://api.twelvelabs.io/v1.3/embed"

files = {
    "image_file": "open('/Users/john/Documents/image.jpg', 'rb')",
    "audio_file": "open('<file1>', 'rb')"
}
payload = {
    "model_name": "marengo3.0",
    "text": ,
    "image_url": ,
    "audio_url": ,
    "audio_start_offset_sec": 
}
headers = {"x-api-key": "<apiKey>"}

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

print(response.json())
```

```javascript Image embedding using local file
const url = 'https://api.twelvelabs.io/v1.3/embed';
const form = new FormData();
form.append('model_name', 'marengo3.0');
form.append('text', '');
form.append('image_url', '');
form.append('image_file', '/Users/john/Documents/image.jpg');
form.append('audio_url', '');
form.append('audio_file', '<file1>');
form.append('audio_start_offset_sec', '');

const options = {method: 'POST', headers: {'x-api-key': '<apiKey>'}};

options.body = form;

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

```go Image embedding using local file
package main

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

func main() {

	url := "https://api.twelvelabs.io/v1.3/embed"

	payload := strings.NewReader("-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"model_name\"\r\n\r\nmarengo3.0\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"text\"\r\n\r\n\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"image_url\"\r\n\r\n\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"image_file\"; filename=\"image.jpg\"\r\nContent-Type: application/octet-stream\r\n\r\n\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"audio_url\"\r\n\r\n\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"audio_file\"; filename=\"<file1>\"\r\nContent-Type: application/octet-stream\r\n\r\n\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"audio_start_offset_sec\"\r\n\r\n\r\n-----011000010111000001101001--\r\n")

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

	req.Header.Add("x-api-key", "<apiKey>")

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

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

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

}
```

```ruby Image embedding using local file
require 'uri'
require 'net/http'

url = URI("https://api.twelvelabs.io/v1.3/embed")

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

request = Net::HTTP::Post.new(url)
request["x-api-key"] = '<apiKey>'
request.body = "-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"model_name\"\r\n\r\nmarengo3.0\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"text\"\r\n\r\n\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"image_url\"\r\n\r\n\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"image_file\"; filename=\"image.jpg\"\r\nContent-Type: application/octet-stream\r\n\r\n\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"audio_url\"\r\n\r\n\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"audio_file\"; filename=\"<file1>\"\r\nContent-Type: application/octet-stream\r\n\r\n\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"audio_start_offset_sec\"\r\n\r\n\r\n-----011000010111000001101001--\r\n"

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

```java Image embedding using local file
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://api.twelvelabs.io/v1.3/embed")
  .header("x-api-key", "<apiKey>")
  .body("-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"model_name\"\r\n\r\nmarengo3.0\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"text\"\r\n\r\n\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"image_url\"\r\n\r\n\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"image_file\"; filename=\"image.jpg\"\r\nContent-Type: application/octet-stream\r\n\r\n\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"audio_url\"\r\n\r\n\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"audio_file\"; filename=\"<file1>\"\r\nContent-Type: application/octet-stream\r\n\r\n\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"audio_start_offset_sec\"\r\n\r\n\r\n-----011000010111000001101001--\r\n")
  .asString();
```

```php Image embedding using local file
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://api.twelvelabs.io/v1.3/embed', [
  'multipart' => [
    [
        'name' => 'model_name',
        'contents' => 'marengo3.0'
    ],
    [
        'name' => 'image_file',
        'filename' => '/Users/john/Documents/image.jpg',
        'contents' => null
    ],
    [
        'name' => 'audio_file',
        'filename' => '<file1>',
        'contents' => null
    ]
  ]
  'headers' => [
    'x-api-key' => '<apiKey>',
  ],
]);

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

```csharp Image embedding using local file
using RestSharp;

var client = new RestClient("https://api.twelvelabs.io/v1.3/embed");
var request = new RestRequest(Method.POST);
request.AddHeader("x-api-key", "<apiKey>");
request.AddParameter("undefined", "-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"model_name\"\r\n\r\nmarengo3.0\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"text\"\r\n\r\n\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"image_url\"\r\n\r\n\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"image_file\"; filename=\"image.jpg\"\r\nContent-Type: application/octet-stream\r\n\r\n\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"audio_url\"\r\n\r\n\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"audio_file\"; filename=\"<file1>\"\r\nContent-Type: application/octet-stream\r\n\r\n\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"audio_start_offset_sec\"\r\n\r\n\r\n-----011000010111000001101001--\r\n", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift Image embedding using local file
import Foundation

let headers = ["x-api-key": "<apiKey>"]
let parameters = [
  [
    "name": "model_name",
    "value": "marengo3.0"
  ],
  [
    "name": "text",
    "value": 
  ],
  [
    "name": "image_url",
    "value": 
  ],
  [
    "name": "image_file",
    "fileName": "/Users/john/Documents/image.jpg"
  ],
  [
    "name": "audio_url",
    "value": 
  ],
  [
    "name": "audio_file",
    "fileName": "<file1>"
  ],
  [
    "name": "audio_start_offset_sec",
    "value": 
  ]
]

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.twelvelabs.io/v1.3/embed")! 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()
```

### Audio embedding using URL

**Request**

```json
{
  "model_name": "marengo3.0",
  "image_file": "<file: <file1>>",
  "audio_url": "https://example.com/audio.mp3",
  "audio_file": "<file: <file1>>"
}
```

**Response**

```json
{
  "model_name": "marengo3.0",
  "text_embedding": {
    "segments": [
      {
        "float": [
          -0.042632885,
          0.014312328,
          0.029209055
        ]
      }
    ]
  },
  "image_embedding": {
    "segments": [
      {
        "float": [
          -0.042632885,
          0.014312328,
          0.029209055
        ]
      }
    ],
    "metadata": {
      "input_filename": "01.jpg"
    }
  },
  "audio_embedding": {
    "segments": [
      {
        "float": [
          -0.042632885,
          0.014312328,
          0.029209055
        ],
        "start_offset_sec": 0,
        "end_offset_sec": 6,
        "embedding_option": "audio"
      },
      {
        "float": [
          -0.042632885,
          0.014312328,
          0.029209055
        ],
        "start_offset_sec": 0,
        "end_offset_sec": 6,
        "embedding_option": "transcription"
      }
    ],
    "metadata": {
      "input_filename": "01.mp3"
    }
  }
}
```

**SDK Code**

```python Audio embedding using URL
import requests

url = "https://api.twelvelabs.io/v1.3/embed"

files = {
    "image_file": "open('<file1>', 'rb')",
    "audio_file": "open('<file1>', 'rb')"
}
payload = {
    "model_name": "marengo3.0",
    "text": ,
    "image_url": ,
    "audio_url": "https://example.com/audio.mp3",
    "audio_start_offset_sec": 
}
headers = {"x-api-key": "<apiKey>"}

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

print(response.json())
```

```javascript Audio embedding using URL
const url = 'https://api.twelvelabs.io/v1.3/embed';
const form = new FormData();
form.append('model_name', 'marengo3.0');
form.append('text', '');
form.append('image_url', '');
form.append('image_file', '<file1>');
form.append('audio_url', 'https://example.com/audio.mp3');
form.append('audio_file', '<file1>');
form.append('audio_start_offset_sec', '');

const options = {method: 'POST', headers: {'x-api-key': '<apiKey>'}};

options.body = form;

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

```go Audio embedding using URL
package main

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

func main() {

	url := "https://api.twelvelabs.io/v1.3/embed"

	payload := strings.NewReader("-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"model_name\"\r\n\r\nmarengo3.0\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"text\"\r\n\r\n\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"image_url\"\r\n\r\n\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"image_file\"; filename=\"<file1>\"\r\nContent-Type: application/octet-stream\r\n\r\n\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"audio_url\"\r\n\r\nhttps://example.com/audio.mp3\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"audio_file\"; filename=\"<file1>\"\r\nContent-Type: application/octet-stream\r\n\r\n\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"audio_start_offset_sec\"\r\n\r\n\r\n-----011000010111000001101001--\r\n")

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

	req.Header.Add("x-api-key", "<apiKey>")

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

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

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

}
```

```ruby Audio embedding using URL
require 'uri'
require 'net/http'

url = URI("https://api.twelvelabs.io/v1.3/embed")

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

request = Net::HTTP::Post.new(url)
request["x-api-key"] = '<apiKey>'
request.body = "-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"model_name\"\r\n\r\nmarengo3.0\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"text\"\r\n\r\n\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"image_url\"\r\n\r\n\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"image_file\"; filename=\"<file1>\"\r\nContent-Type: application/octet-stream\r\n\r\n\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"audio_url\"\r\n\r\nhttps://example.com/audio.mp3\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"audio_file\"; filename=\"<file1>\"\r\nContent-Type: application/octet-stream\r\n\r\n\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"audio_start_offset_sec\"\r\n\r\n\r\n-----011000010111000001101001--\r\n"

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

```java Audio embedding using URL
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://api.twelvelabs.io/v1.3/embed")
  .header("x-api-key", "<apiKey>")
  .body("-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"model_name\"\r\n\r\nmarengo3.0\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"text\"\r\n\r\n\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"image_url\"\r\n\r\n\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"image_file\"; filename=\"<file1>\"\r\nContent-Type: application/octet-stream\r\n\r\n\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"audio_url\"\r\n\r\nhttps://example.com/audio.mp3\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"audio_file\"; filename=\"<file1>\"\r\nContent-Type: application/octet-stream\r\n\r\n\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"audio_start_offset_sec\"\r\n\r\n\r\n-----011000010111000001101001--\r\n")
  .asString();
```

```php Audio embedding using URL
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://api.twelvelabs.io/v1.3/embed', [
  'multipart' => [
    [
        'name' => 'model_name',
        'contents' => 'marengo3.0'
    ],
    [
        'name' => 'image_file',
        'filename' => '<file1>',
        'contents' => null
    ],
    [
        'name' => 'audio_url',
        'contents' => 'https://example.com/audio.mp3'
    ],
    [
        'name' => 'audio_file',
        'filename' => '<file1>',
        'contents' => null
    ]
  ]
  'headers' => [
    'x-api-key' => '<apiKey>',
  ],
]);

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

```csharp Audio embedding using URL
using RestSharp;

var client = new RestClient("https://api.twelvelabs.io/v1.3/embed");
var request = new RestRequest(Method.POST);
request.AddHeader("x-api-key", "<apiKey>");
request.AddParameter("undefined", "-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"model_name\"\r\n\r\nmarengo3.0\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"text\"\r\n\r\n\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"image_url\"\r\n\r\n\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"image_file\"; filename=\"<file1>\"\r\nContent-Type: application/octet-stream\r\n\r\n\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"audio_url\"\r\n\r\nhttps://example.com/audio.mp3\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"audio_file\"; filename=\"<file1>\"\r\nContent-Type: application/octet-stream\r\n\r\n\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"audio_start_offset_sec\"\r\n\r\n\r\n-----011000010111000001101001--\r\n", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift Audio embedding using URL
import Foundation

let headers = ["x-api-key": "<apiKey>"]
let parameters = [
  [
    "name": "model_name",
    "value": "marengo3.0"
  ],
  [
    "name": "text",
    "value": 
  ],
  [
    "name": "image_url",
    "value": 
  ],
  [
    "name": "image_file",
    "fileName": "<file1>"
  ],
  [
    "name": "audio_url",
    "value": "https://example.com/audio.mp3"
  ],
  [
    "name": "audio_file",
    "fileName": "<file1>"
  ],
  [
    "name": "audio_start_offset_sec",
    "value": 
  ]
]

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.twelvelabs.io/v1.3/embed")! 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()
```

### Audio embedding using local file

**Request**

```json
{
  "model_name": "marengo3.0",
  "image_file": "<file: <file1>>",
  "audio_file": "<file: /Users/john/Documents/audio.mp3>"
}
```

**Response**

```json
{
  "model_name": "marengo3.0",
  "text_embedding": {
    "segments": [
      {
        "float": [
          -0.042632885,
          0.014312328,
          0.029209055
        ]
      }
    ]
  },
  "image_embedding": {
    "segments": [
      {
        "float": [
          -0.042632885,
          0.014312328,
          0.029209055
        ]
      }
    ],
    "metadata": {
      "input_filename": "01.jpg"
    }
  },
  "audio_embedding": {
    "segments": [
      {
        "float": [
          -0.042632885,
          0.014312328,
          0.029209055
        ],
        "start_offset_sec": 0,
        "end_offset_sec": 6,
        "embedding_option": "audio"
      },
      {
        "float": [
          -0.042632885,
          0.014312328,
          0.029209055
        ],
        "start_offset_sec": 0,
        "end_offset_sec": 6,
        "embedding_option": "transcription"
      }
    ],
    "metadata": {
      "input_filename": "01.mp3"
    }
  }
}
```

**SDK Code**

```python Audio embedding using local file
import requests

url = "https://api.twelvelabs.io/v1.3/embed"

files = {
    "image_file": "open('<file1>', 'rb')",
    "audio_file": "open('/Users/john/Documents/audio.mp3', 'rb')"
}
payload = {
    "model_name": "marengo3.0",
    "text": ,
    "image_url": ,
    "audio_url": ,
    "audio_start_offset_sec": 
}
headers = {"x-api-key": "<apiKey>"}

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

print(response.json())
```

```javascript Audio embedding using local file
const url = 'https://api.twelvelabs.io/v1.3/embed';
const form = new FormData();
form.append('model_name', 'marengo3.0');
form.append('text', '');
form.append('image_url', '');
form.append('image_file', '<file1>');
form.append('audio_url', '');
form.append('audio_file', '/Users/john/Documents/audio.mp3');
form.append('audio_start_offset_sec', '');

const options = {method: 'POST', headers: {'x-api-key': '<apiKey>'}};

options.body = form;

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

```go Audio embedding using local file
package main

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

func main() {

	url := "https://api.twelvelabs.io/v1.3/embed"

	payload := strings.NewReader("-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"model_name\"\r\n\r\nmarengo3.0\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"text\"\r\n\r\n\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"image_url\"\r\n\r\n\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"image_file\"; filename=\"<file1>\"\r\nContent-Type: application/octet-stream\r\n\r\n\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"audio_url\"\r\n\r\n\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"audio_file\"; filename=\"audio.mp3\"\r\nContent-Type: application/octet-stream\r\n\r\n\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"audio_start_offset_sec\"\r\n\r\n\r\n-----011000010111000001101001--\r\n")

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

	req.Header.Add("x-api-key", "<apiKey>")

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

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

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

}
```

```ruby Audio embedding using local file
require 'uri'
require 'net/http'

url = URI("https://api.twelvelabs.io/v1.3/embed")

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

request = Net::HTTP::Post.new(url)
request["x-api-key"] = '<apiKey>'
request.body = "-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"model_name\"\r\n\r\nmarengo3.0\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"text\"\r\n\r\n\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"image_url\"\r\n\r\n\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"image_file\"; filename=\"<file1>\"\r\nContent-Type: application/octet-stream\r\n\r\n\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"audio_url\"\r\n\r\n\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"audio_file\"; filename=\"audio.mp3\"\r\nContent-Type: application/octet-stream\r\n\r\n\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"audio_start_offset_sec\"\r\n\r\n\r\n-----011000010111000001101001--\r\n"

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

```java Audio embedding using local file
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://api.twelvelabs.io/v1.3/embed")
  .header("x-api-key", "<apiKey>")
  .body("-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"model_name\"\r\n\r\nmarengo3.0\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"text\"\r\n\r\n\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"image_url\"\r\n\r\n\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"image_file\"; filename=\"<file1>\"\r\nContent-Type: application/octet-stream\r\n\r\n\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"audio_url\"\r\n\r\n\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"audio_file\"; filename=\"audio.mp3\"\r\nContent-Type: application/octet-stream\r\n\r\n\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"audio_start_offset_sec\"\r\n\r\n\r\n-----011000010111000001101001--\r\n")
  .asString();
```

```php Audio embedding using local file
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://api.twelvelabs.io/v1.3/embed', [
  'multipart' => [
    [
        'name' => 'model_name',
        'contents' => 'marengo3.0'
    ],
    [
        'name' => 'image_file',
        'filename' => '<file1>',
        'contents' => null
    ],
    [
        'name' => 'audio_file',
        'filename' => '/Users/john/Documents/audio.mp3',
        'contents' => null
    ]
  ]
  'headers' => [
    'x-api-key' => '<apiKey>',
  ],
]);

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

```csharp Audio embedding using local file
using RestSharp;

var client = new RestClient("https://api.twelvelabs.io/v1.3/embed");
var request = new RestRequest(Method.POST);
request.AddHeader("x-api-key", "<apiKey>");
request.AddParameter("undefined", "-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"model_name\"\r\n\r\nmarengo3.0\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"text\"\r\n\r\n\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"image_url\"\r\n\r\n\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"image_file\"; filename=\"<file1>\"\r\nContent-Type: application/octet-stream\r\n\r\n\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"audio_url\"\r\n\r\n\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"audio_file\"; filename=\"audio.mp3\"\r\nContent-Type: application/octet-stream\r\n\r\n\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"audio_start_offset_sec\"\r\n\r\n\r\n-----011000010111000001101001--\r\n", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift Audio embedding using local file
import Foundation

let headers = ["x-api-key": "<apiKey>"]
let parameters = [
  [
    "name": "model_name",
    "value": "marengo3.0"
  ],
  [
    "name": "text",
    "value": 
  ],
  [
    "name": "image_url",
    "value": 
  ],
  [
    "name": "image_file",
    "fileName": "<file1>"
  ],
  [
    "name": "audio_url",
    "value": 
  ],
  [
    "name": "audio_file",
    "fileName": "/Users/john/Documents/audio.mp3"
  ],
  [
    "name": "audio_start_offset_sec",
    "value": 
  ]
]

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.twelvelabs.io/v1.3/embed")! 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()
```

### Example 5

**Request**

```json
{
  "model_name": "marengo3.0",
  "text": "Man with a dog crossing the street",
  "image_file": "<file: <file1>>",
  "audio_file": "<file: <file1>>"
}
```

**Response**

```json
{
  "model_name": "marengo3.0",
  "text_embedding": {
    "segments": [
      {
        "float": [
          -0.042632885,
          0.014312328,
          0.029209055
        ]
      }
    ]
  },
  "image_embedding": {
    "segments": [
      {
        "float": [
          -0.042632885,
          0.014312328,
          0.029209055
        ]
      }
    ],
    "metadata": {
      "input_filename": "01.jpg"
    }
  },
  "audio_embedding": {
    "segments": [
      {
        "float": [
          -0.042632885,
          0.014312328,
          0.029209055
        ],
        "start_offset_sec": 0,
        "end_offset_sec": 6,
        "embedding_option": "audio"
      },
      {
        "float": [
          -0.042632885,
          0.014312328,
          0.029209055
        ],
        "start_offset_sec": 0,
        "end_offset_sec": 6,
        "embedding_option": "transcription"
      }
    ],
    "metadata": {
      "input_filename": "01.mp3"
    }
  }
}
```

**SDK Code**

```python
import requests

url = "https://api.twelvelabs.io/v1.3/embed"

files = {
    "image_file": "open('<file1>', 'rb')",
    "audio_file": "open('<file1>', 'rb')"
}
payload = {
    "model_name": "marengo3.0",
    "text": "Man with a dog crossing the street",
    "image_url": ,
    "audio_url": ,
    "audio_start_offset_sec": 
}
headers = {"x-api-key": "<apiKey>"}

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

print(response.json())
```

```javascript
const url = 'https://api.twelvelabs.io/v1.3/embed';
const form = new FormData();
form.append('model_name', 'marengo3.0');
form.append('text', 'Man with a dog crossing the street');
form.append('image_url', '');
form.append('image_file', '<file1>');
form.append('audio_url', '');
form.append('audio_file', '<file1>');
form.append('audio_start_offset_sec', '');

const options = {method: 'POST', headers: {'x-api-key': '<apiKey>'}};

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.twelvelabs.io/v1.3/embed"

	payload := strings.NewReader("-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"model_name\"\r\n\r\nmarengo3.0\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"text\"\r\n\r\nMan with a dog crossing the street\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"image_url\"\r\n\r\n\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"image_file\"; filename=\"<file1>\"\r\nContent-Type: application/octet-stream\r\n\r\n\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"audio_url\"\r\n\r\n\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"audio_file\"; filename=\"<file1>\"\r\nContent-Type: application/octet-stream\r\n\r\n\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"audio_start_offset_sec\"\r\n\r\n\r\n-----011000010111000001101001--\r\n")

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

	req.Header.Add("x-api-key", "<apiKey>")

	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.twelvelabs.io/v1.3/embed")

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

request = Net::HTTP::Post.new(url)
request["x-api-key"] = '<apiKey>'
request.body = "-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"model_name\"\r\n\r\nmarengo3.0\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"text\"\r\n\r\nMan with a dog crossing the street\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"image_url\"\r\n\r\n\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"image_file\"; filename=\"<file1>\"\r\nContent-Type: application/octet-stream\r\n\r\n\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"audio_url\"\r\n\r\n\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"audio_file\"; filename=\"<file1>\"\r\nContent-Type: application/octet-stream\r\n\r\n\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"audio_start_offset_sec\"\r\n\r\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.twelvelabs.io/v1.3/embed")
  .header("x-api-key", "<apiKey>")
  .body("-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"model_name\"\r\n\r\nmarengo3.0\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"text\"\r\n\r\nMan with a dog crossing the street\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"image_url\"\r\n\r\n\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"image_file\"; filename=\"<file1>\"\r\nContent-Type: application/octet-stream\r\n\r\n\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"audio_url\"\r\n\r\n\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"audio_file\"; filename=\"<file1>\"\r\nContent-Type: application/octet-stream\r\n\r\n\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"audio_start_offset_sec\"\r\n\r\n\r\n-----011000010111000001101001--\r\n")
  .asString();
```

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

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://api.twelvelabs.io/v1.3/embed', [
  'multipart' => [
    [
        'name' => 'model_name',
        'contents' => 'marengo3.0'
    ],
    [
        'name' => 'text',
        'contents' => 'Man with a dog crossing the street'
    ],
    [
        'name' => 'image_file',
        'filename' => '<file1>',
        'contents' => null
    ],
    [
        'name' => 'audio_file',
        'filename' => '<file1>',
        'contents' => null
    ]
  ]
  'headers' => [
    'x-api-key' => '<apiKey>',
  ],
]);

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

```csharp
using RestSharp;

var client = new RestClient("https://api.twelvelabs.io/v1.3/embed");
var request = new RestRequest(Method.POST);
request.AddHeader("x-api-key", "<apiKey>");
request.AddParameter("undefined", "-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"model_name\"\r\n\r\nmarengo3.0\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"text\"\r\n\r\nMan with a dog crossing the street\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"image_url\"\r\n\r\n\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"image_file\"; filename=\"<file1>\"\r\nContent-Type: application/octet-stream\r\n\r\n\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"audio_url\"\r\n\r\n\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"audio_file\"; filename=\"<file1>\"\r\nContent-Type: application/octet-stream\r\n\r\n\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"audio_start_offset_sec\"\r\n\r\n\r\n-----011000010111000001101001--\r\n", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift
import Foundation

let headers = ["x-api-key": "<apiKey>"]
let parameters = [
  [
    "name": "model_name",
    "value": "marengo3.0"
  ],
  [
    "name": "text",
    "value": "Man with a dog crossing the street"
  ],
  [
    "name": "image_url",
    "value": 
  ],
  [
    "name": "image_file",
    "fileName": "<file1>"
  ],
  [
    "name": "audio_url",
    "value": 
  ],
  [
    "name": "audio_file",
    "fileName": "<file1>"
  ],
  [
    "name": "audio_start_offset_sec",
    "value": 
  ]
]

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.twelvelabs.io/v1.3/embed")! 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()
```