Detokenization
curl --request POST \
--url http://localhost:8000/v1/detokenize \
--header 'Content-Type: application/json' \
--data '
{
"tokens": [
128000,
3923,
374,
1803,
1413,
15592,
30
]
}
'import requests
url = "http://localhost:8000/v1/detokenize"
payload = { "tokens": [128000, 3923, 374, 1803, 1413, 15592, 30] }
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({tokens: [128000, 3923, 374, 1803, 1413, 15592, 30]})
};
fetch('http://localhost:8000/v1/detokenize', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "http://localhost:8000/v1/detokenize"
payload := strings.NewReader("{\n \"tokens\": [\n 128000,\n 3923,\n 374,\n 1803,\n 1413,\n 15592,\n 30\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
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))
}{
"text": "What is generative AI?"
}Inference
Container Detokenization
Convert a list of token IDs back into text.
POST
/
v1
/
detokenize
Detokenization
curl --request POST \
--url http://localhost:8000/v1/detokenize \
--header 'Content-Type: application/json' \
--data '
{
"tokens": [
128000,
3923,
374,
1803,
1413,
15592,
30
]
}
'import requests
url = "http://localhost:8000/v1/detokenize"
payload = { "tokens": [128000, 3923, 374, 1803, 1413, 15592, 30] }
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({tokens: [128000, 3923, 374, 1803, 1413, 15592, 30]})
};
fetch('http://localhost:8000/v1/detokenize', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "http://localhost:8000/v1/detokenize"
payload := strings.NewReader("{\n \"tokens\": [\n 128000,\n 3923,\n 374,\n 1803,\n 1413,\n 15592,\n 30\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
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))
}{
"text": "What is generative AI?"
}Convert a list of token IDs back into text.
Last modified on June 9, 2026
⌘I