---
title: "Detokenization"
method: POST
path: "/serverless/v1/detokenize"
tags: ["Serverless.Token"]
---

# Detokenization

`POST /serverless/v1/detokenize`

## Request

- Base URL: `https://api.friendli.ai`
- URL: `https://api.friendli.ai/serverless/v1/detokenize`
- Auth: HTTP bearer
- TypeScript: <https://skmtc.dev/friendli/apis/friendli-suite-api-reference/docs/serverless/v1/detokenize/post.ts> (a function with typed inputs; its response is checked against the schema)

By giving a list of tokens, generate a detokenized output text string.

## Headers

- `X-Friendli-Team` string, nullable: ID of team to run requests as (optional parameter).

## Request body

- ServerlessDetokenizationBody
  - `model` string, required: Code of the model to use. See [available model list](https://friendli.ai/docs/guides/model-apis/pricing#billing-methods).
  - `tokens` integer[], required: A token sequence to detokenize.

## Response `200`

Successfully detokenized the tokens.

- ServerlessDetokenizationSuccess
  - `text` string, required: Detokenized text output.

## Other responses

- `422`: Unprocessable Entity

---

[API](https://skmtc.dev/friendli/apis/friendli-suite-api-reference.md) - [All operations](https://skmtc.dev/friendli/apis/friendli-suite-api-reference/llms.txt) - [OpenAPI document](https://skmtc.dev/friendli/apis/friendli-suite-api-reference/revisions/38fb43993a11?raw)
