Yandex Cloud
Search
Contact UsGet started
  • Blog
  • Pricing
  • Documentation
  • All Services
  • System Status
    • Featured
    • Infrastructure & Network
    • Data Platform
    • Containers
    • Developer tools
    • Serverless
    • Security
    • Monitoring & Resources
    • ML & AI
    • Business tools
  • All Solutions
    • By industry
    • By use case
    • Economics and Pricing
    • Security
    • Technical Support
    • Customer Stories
    • Gateway to Russia
    • Cloud for Startups
    • Education and Science
  • Blog
  • Pricing
  • Documentation
Yandex project
© 2025 Yandex.Cloud LLC
Yandex Foundation Models
    • Overview
    • API authentication
        • Overview
          • Overview
          • Tokenize
          • TokenizeCompletion
  • Yandex Cloud ML SDK
  • Compatibility with OpenAI
  • Access management
  • Pricing policy
  • Public materials
  • Release notes

In this article:

  • gRPC request
  • TokenizeRequest
  • TokenizeResponse
  • Token
  1. API references
  2. Text Generation API
  3. gRPC
  4. Tokenizer
  5. Tokenize

Foundation Models Text Generation API, gRPC: TokenizerService.Tokenize

Written by
Yandex Cloud
Updated at November 26, 2024
  • gRPC request
  • TokenizeRequest
  • TokenizeResponse
  • Token

RPC method for tokenizing text.

gRPC requestgRPC request

rpc Tokenize (TokenizeRequest) returns (TokenizeResponse)

TokenizeRequestTokenizeRequest

{
  "model_uri": "string",
  "text": "string"
}

Request for the service to tokenize input text.

Field

Description

model_uri

string

The identifier of the model to be used for tokenization.

text

string

Text to be tokenized.

TokenizeResponseTokenizeResponse

{
  "tokens": [
    {
      "id": "int64",
      "text": "string",
      "special": "bool"
    }
  ],
  "model_version": "string"
}

Response containing tokenized content from request.

Field

Description

tokens[]

Token

A list of tokens obtained from tokenization.

model_version

string

Model version (changes with model releases).

TokenToken

Represents a token, the basic unit of content, used by the foundation model.

Field

Description

id

int64

An internal token identifier.

text

string

The textual representation of the token.

special

bool

Indicates whether the token is special or not. Special tokens may define the model's behavior and are not visible to users.

Was the article helpful?

Previous
Overview
Next
TokenizeCompletion
Yandex project
© 2025 Yandex.Cloud LLC