Create multimodal embedding
curl --request POST \
--url https://api.upmore.net/v1/embeddings \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"model": "doubao-embedding-vision",
"input": [
{
"type": "text",
"text": "A ginger cat napping on a piano"
},
{
"type": "image_url",
"image_url": {
"url": "https://example.com/cat.jpg"
}
}
]
}
'import requests
url = "https://api.upmore.net/v1/embeddings"
payload = {
"model": "doubao-embedding-vision",
"input": [
{
"type": "text",
"text": "A ginger cat napping on a piano"
},
{
"type": "image_url",
"image_url": { "url": "https://example.com/cat.jpg" }
}
]
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
model: 'doubao-embedding-vision',
input: [
{type: 'text', text: 'A ginger cat napping on a piano'},
{type: 'image_url', image_url: {url: 'https://example.com/cat.jpg'}}
]
})
};
fetch('https://api.upmore.net/v1/embeddings', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.upmore.net/v1/embeddings",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'model' => 'doubao-embedding-vision',
'input' => [
[
'type' => 'text',
'text' => 'A ginger cat napping on a piano'
],
[
'type' => 'image_url',
'image_url' => [
'url' => 'https://example.com/cat.jpg'
]
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.upmore.net/v1/embeddings"
payload := strings.NewReader("{\n \"model\": \"doubao-embedding-vision\",\n \"input\": [\n {\n \"type\": \"text\",\n \"text\": \"A ginger cat napping on a piano\"\n },\n {\n \"type\": \"image_url\",\n \"image_url\": {\n \"url\": \"https://example.com/cat.jpg\"\n }\n }\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.upmore.net/v1/embeddings")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"model\": \"doubao-embedding-vision\",\n \"input\": [\n {\n \"type\": \"text\",\n \"text\": \"A ginger cat napping on a piano\"\n },\n {\n \"type\": \"image_url\",\n \"image_url\": {\n \"url\": \"https://example.com/cat.jpg\"\n }\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.upmore.net/v1/embeddings")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"model\": \"doubao-embedding-vision\",\n \"input\": [\n {\n \"type\": \"text\",\n \"text\": \"A ginger cat napping on a piano\"\n },\n {\n \"type\": \"image_url\",\n \"image_url\": {\n \"url\": \"https://example.com/cat.jpg\"\n }\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"object": "list",
"model": "<string>",
"data": {
"object": "embedding",
"embedding": [
123
]
},
"usage": {
"prompt_tokens": 123,
"total_tokens": 123,
"prompt_tokens_details": {
"text_tokens": 123,
"image_tokens": 123
}
}
}{
"error": {
"code": "<string>",
"message": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>"
}
}ByteDance
Doubao Embedding Vision
Embeds text, an image, or a combined text+image input into a single 2048-dimension vector. Text and image tokens are billed at separate rates.
POST
/
v1
/
embeddings
Create multimodal embedding
curl --request POST \
--url https://api.upmore.net/v1/embeddings \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"model": "doubao-embedding-vision",
"input": [
{
"type": "text",
"text": "A ginger cat napping on a piano"
},
{
"type": "image_url",
"image_url": {
"url": "https://example.com/cat.jpg"
}
}
]
}
'import requests
url = "https://api.upmore.net/v1/embeddings"
payload = {
"model": "doubao-embedding-vision",
"input": [
{
"type": "text",
"text": "A ginger cat napping on a piano"
},
{
"type": "image_url",
"image_url": { "url": "https://example.com/cat.jpg" }
}
]
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
model: 'doubao-embedding-vision',
input: [
{type: 'text', text: 'A ginger cat napping on a piano'},
{type: 'image_url', image_url: {url: 'https://example.com/cat.jpg'}}
]
})
};
fetch('https://api.upmore.net/v1/embeddings', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.upmore.net/v1/embeddings",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'model' => 'doubao-embedding-vision',
'input' => [
[
'type' => 'text',
'text' => 'A ginger cat napping on a piano'
],
[
'type' => 'image_url',
'image_url' => [
'url' => 'https://example.com/cat.jpg'
]
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.upmore.net/v1/embeddings"
payload := strings.NewReader("{\n \"model\": \"doubao-embedding-vision\",\n \"input\": [\n {\n \"type\": \"text\",\n \"text\": \"A ginger cat napping on a piano\"\n },\n {\n \"type\": \"image_url\",\n \"image_url\": {\n \"url\": \"https://example.com/cat.jpg\"\n }\n }\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.upmore.net/v1/embeddings")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"model\": \"doubao-embedding-vision\",\n \"input\": [\n {\n \"type\": \"text\",\n \"text\": \"A ginger cat napping on a piano\"\n },\n {\n \"type\": \"image_url\",\n \"image_url\": {\n \"url\": \"https://example.com/cat.jpg\"\n }\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.upmore.net/v1/embeddings")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"model\": \"doubao-embedding-vision\",\n \"input\": [\n {\n \"type\": \"text\",\n \"text\": \"A ginger cat napping on a piano\"\n },\n {\n \"type\": \"image_url\",\n \"image_url\": {\n \"url\": \"https://example.com/cat.jpg\"\n }\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"object": "list",
"model": "<string>",
"data": {
"object": "embedding",
"embedding": [
123
]
},
"usage": {
"prompt_tokens": 123,
"total_tokens": 123,
"prompt_tokens_details": {
"text_tokens": 123,
"image_tokens": 123
}
}
}{
"error": {
"code": "<string>",
"message": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>"
}
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Body
application/json
Must be doubao-embedding-vision.
Available options:
doubao-embedding-vision Example:
"doubao-embedding-vision"
Content objects (Ark multimodal format). Text-only input also uses this array form. The whole input produces one fused embedding.
Show child attributes
Show child attributes
Example:
[
{
"type": "text",
"text": "A ginger cat napping on a piano"
},
{
"type": "image_url",
"image_url": { "url": "https://example.com/cat.jpg" }
}
]⌘I