FriendliAI Dedicated.Token API
The Dedicated.Token API from FriendliAI — 2 operation(s) for dedicated.token.
The Dedicated.Token API from FriendliAI — 2 operation(s) for dedicated.token.
openapi: 3.1.0
info:
title: Friendli Suite API Reference Container.Audio Dedicated.Token API
description: This is an OpenAPI reference of Friendli Suite API.
termsOfService: https://friendli.ai/terms-of-service
contact:
name: FriendliAI Support Team
email: support@friendli.ai
version: 0.1.0
servers:
- url: https://api.friendli.ai
tags:
- name: Dedicated.Token
paths:
/dedicated/v1/tokenize:
post:
tags:
- Dedicated.Token
summary: Tokenization
description: Convert text input into token IDs.
operationId: dedicatedTokenization
security:
- token: []
parameters:
- name: X-Friendli-Team
in: header
required: false
schema:
anyOf:
- type: string
- type: 'null'
description: ID of team to run requests as (optional parameter).
title: X-Friendli-Team
description: ID of team to run requests as (optional parameter).
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/DedicatedTokenizationBody'
responses:
'200':
description: Successfully tokenized the text.
content:
application/json:
schema:
$ref: '#/components/schemas/DedicatedTokenizationSuccess'
examples:
Example:
value:
tokens:
- 128000
- 3923
- 374
- 1803
- 1413
- 15592
- 30
'422':
description: Unprocessable Entity
x-speakeasy-name-override: tokenize
x-mint:
metadata:
title: Dedicated Tokenization
sidebarTitle: Tokenization
og:title: Dedicated Tokenization
description: Convert text input into token IDs.
og:description: Convert text input into token IDs.
href: /openapi/dedicated/inference/tokenization
content: 'Convert text input into token IDs.
To request successfully, it is mandatory to enter a **Personal API Key** (e.g. flp_XXX) value in the **Bearer Token** field.
Refer to the [authentication section](/openapi/introduction#authentication) on our introduction page to learn how to acquire this variable and [visit here](https://friendli.ai/suite/~/setting/keys) to generate your API Key.'
/dedicated/v1/detokenize:
post:
tags:
- Dedicated.Token
summary: Detokenization
description: Convert a list of token IDs back into text.
operationId: dedicatedDetokenization
security:
- token: []
parameters:
- name: X-Friendli-Team
in: header
required: false
schema:
anyOf:
- type: string
- type: 'null'
description: ID of team to run requests as (optional parameter).
title: X-Friendli-Team
description: ID of team to run requests as (optional parameter).
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/DedicatedDetokenizationBody'
responses:
'200':
description: Successfully detokenized the tokens.
content:
application/json:
schema:
$ref: '#/components/schemas/DedicatedDetokenizationSuccess'
examples:
Example:
value:
text: What is generative AI?
'422':
description: Unprocessable Entity
x-speakeasy-name-override: detokenize
x-mint:
metadata:
title: Dedicated Detokenization
sidebarTitle: Detokenization
og:title: Dedicated Detokenization
description: Convert a list of token IDs back into text.
og:description: Convert a list of token IDs back into text.
href: /openapi/dedicated/inference/detokenization
content: 'Convert a list of token IDs back into text.
To request successfully, it is mandatory to enter a **Personal API Key** (e.g. flp_XXX) value in the **Bearer Token** field.
Refer to the [authentication section](/openapi/introduction#authentication) on our introduction page to learn how to acquire this variable and [visit here](https://friendli.ai/suite/~/setting/keys) to generate your API Key.'
components:
schemas:
DedicatedDetokenizationBody:
properties:
model:
type: string
title: Model
description: ID of target endpoint. If you want to send request to specific adapter, use the format "YOUR_ENDPOINT_ID:YOUR_ADAPTER_ROUTE". Otherwise, you can just use "YOUR_ENDPOINT_ID" alone.
examples:
- (endpoint-id)
tokens:
items:
type: integer
type: array
title: Tokens
description: A token sequence to detokenize.
examples:
- - 128000
- 3923
- 374
- 1803
- 1413
- 15592
- 30
type: object
required:
- model
- tokens
title: DedicatedDetokenizationBody
example:
model: (endpoint-id)
tokens:
- 128000
- 3923
- 374
- 1803
- 1413
- 15592
- 30
DedicatedTokenizationBody:
properties:
model:
type: string
title: Model
description: ID of target endpoint. If you want to send request to specific adapter, use the format "YOUR_ENDPOINT_ID:YOUR_ADAPTER_ROUTE". Otherwise, you can just use "YOUR_ENDPOINT_ID" alone.
examples:
- (endpoint-id)
prompt:
type: string
title: Prompt
description: Input text prompt to tokenize.
examples:
- What is generative AI?
type: object
required:
- model
- prompt
title: DedicatedTokenizationBody
example:
model: (endpoint-id)
prompt: What is generative AI?
DedicatedTokenizationSuccess:
properties:
tokens:
items:
type: integer
type: array
title: Tokens
description: A list of token IDs.
type: object
required:
- tokens
title: DedicatedTokenizationSuccess
DedicatedDetokenizationSuccess:
properties:
text:
type: string
title: Text
description: Detokenized text output.
type: object
required:
- text
title: DedicatedDetokenizationSuccess
securitySchemes:
token:
type: http
description: 'When using Friendli Suite API for inference requests, you need to provide a **Friendli Token** for authentication and authorization purposes.
For more detailed information, please refer [here](https://friendli.ai/docs/openapi/introduction#authentication).'
scheme: bearer
x-speakeasy-retries:
strategy: backoff
backoff:
initialInterval: 500
maxInterval: 60000
maxElapsedTime: 3600000
exponent: 1.5
statusCodes:
- 429
- 500
- 502
- 503
- 504
retryConnectionErrors: true