FriendliAI Container.Token API

The Container.Token API from FriendliAI — 2 operation(s) for container.token.

Operations 2

POST /v1/tokenize Tokenization #
POST /v1/detokenize Detokenization #

Work with this as data

Every API here is available over the APIs.io API and to AI agents over MCP.

MCP server

One button, every client — Claude, Cursor, VS Code and the rest.

https://apis.io/mcp

Tools for apis

7 MCP tools reach this
  • find_apisBrowse and filter every API in the catalog.
  • get_api_artifactsOne API's artifacts, grouped by type.
  • get_openapiThe primary OpenAPI for this API.
  • find_similar_apisAPIs that look like this one.
  • apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.
  • resolveTurn a domain, URL or GitHub org into the provider it belongs to.
  • find_cohortsEvery scored population of providers in the catalog.
All 92 tools →

Call it yourself

curl for this page
This API
curl "https://apis.io/api/v1/apis/friendliai-container-token-api"
All apis
curl "https://apis.io/api/v1/apis?limit=25"

Discovery needs no key. Ratings and market analysis are Pro.

Get an API key

Free tier, no email required.

A second provider on the same verified email joins the account you already have.

OpenAPI Specification

friendliai-container-token-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  title: Friendli Suite API Reference Container.Audio Container.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: Container.Token
paths:
  /v1/tokenize:
    servers:
    - url: http://localhost:8000
    post:
      tags:
      - Container.Token
      summary: Tokenization
      description: Convert text input into token IDs.
      operationId: containerTokenization
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ContainerTokenizationBody'
        required: true
      responses:
        '200':
          description: Successfully tokenized the text.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ContainerTokenizationSuccess'
              examples:
                Example:
                  value:
                    tokens:
                    - 128000
                    - 3923
                    - 374
                    - 1803
                    - 1413
                    - 15592
                    - 30
        '422':
          description: Unprocessable Entity
      x-speakeasy-name-override: tokenize
      x-mint:
        metadata:
          title: Container Tokenization
          sidebarTitle: Tokenization
          og:title: Container Tokenization
          description: Convert text input into token IDs.
          og:description: Convert text input into token IDs.
        href: /openapi/container/tokenization
        content: Convert text input into token IDs.
  /v1/detokenize:
    servers:
    - url: http://localhost:8000
    post:
      tags:
      - Container.Token
      summary: Detokenization
      description: Convert a list of token IDs back into text.
      operationId: containerDetokenization
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ContainerDetokenizationBody'
        required: true
      responses:
        '200':
          description: Successfully detokenized the tokens.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ContainerDetokenizationSuccess'
              examples:
                Example:
                  value:
                    text: What is generative AI?
        '422':
          description: Unprocessable Entity
      x-speakeasy-name-override: detokenize
      x-mint:
        metadata:
          title: Container Detokenization
          sidebarTitle: Detokenization
          og:title: Container Detokenization
          description: Convert a list of token IDs back into text.
          og:description: Convert a list of token IDs back into text.
        href: /openapi/container/detokenization
        content: Convert a list of token IDs back into text.
components:
  schemas:
    ContainerTokenizationBody:
      properties:
        model:
          anyOf:
          - type: string
          - type: 'null'
          title: Model
          description: Routes the request to a specific adapter.
          examples:
          - (adapter-route)
        prompt:
          type: string
          title: Prompt
          description: Input text prompt to tokenize.
          examples:
          - What is generative AI?
      type: object
      required:
      - prompt
      title: ContainerTokenizationBody
      example:
        prompt: What is generative AI?
    ContainerDetokenizationBody:
      properties:
        model:
          anyOf:
          - type: string
          - type: 'null'
          title: Model
          description: Routes the request to a specific adapter.
          examples:
          - (adapter-route)
        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:
      - tokens
      title: ContainerDetokenizationBody
      example:
        tokens:
        - 128000
        - 3923
        - 374
        - 1803
        - 1413
        - 15592
        - 30
    ContainerDetokenizationSuccess:
      properties:
        text:
          type: string
          title: Text
          description: Detokenized text output.
      type: object
      required:
      - text
      title: ContainerDetokenizationSuccess
    ContainerTokenizationSuccess:
      properties:
        tokens:
          items:
            type: integer
          type: array
          title: Tokens
          description: A list of token IDs.
      type: object
      required:
      - tokens
      title: ContainerTokenizationSuccess
  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