Skip to content
ACS Infra
Tokenize

Detokenize

POST
/v1/detokenize

vLLM: turn the model's token ids back into text. The API asks no Inference, so the route costs no tokens and never starts a GPU.

Authorization

bearer
headerAuthorizationBearer <token>

An API key: Authorization: Bearer sk-acs-..., or a key of the old platform, acs-bm-.... A User makes and revokes keys in the App.

Request Body

application/json
  1. body
model?string

The Base model whose tokenizer to use: an id from GET /v1/models, such as llama-8b. Left out, the model that GET /v1/models marks default.

Match^[^\u0000]*$
tokens*array<>

vLLM: the token ids to turn into text, at most 65536, each in the model's vocabulary.

Response Body

DetokenizeResponse

application/json
  1. response
prompt*string

The text of the ids, special tokens included, with no space taken out.

Example Request
curl -X POST 'https://api.infra.acsresearch.org/v1/detokenize' \  -H 'Authorization: Bearer <API_KEY>' \  -H 'Content-Type: application/json' \  -d '{  "tokens": [    0  ]}'
Example Response
{  "prompt": "string"}