Yandex Cloud
Search
Contact UsGet started
  • Pricing
  • Customer Stories
  • Documentation
  • Blog
  • All Services
  • System Status
    • Featured
    • Infrastructure & Network
    • Data Platform
    • Containers
    • Developer tools
    • Serverless
    • Security
    • Monitoring & Resources
    • AI for business
    • Business tools
  • All Solutions
    • By industry
    • By use case
    • Economics and Pricing
    • Security
    • Technical Support
    • Start testing with double trial credits
    • Cloud credits to scale your IT product
    • Gateway to Russia
    • Cloud for Startups
    • Center for Technologies and Society
    • Yandex Cloud Partner program
  • Pricing
  • Customer Stories
  • Documentation
  • Blog
© 2025 Direct Cursus Technology L.L.C.
Yandex AI Studio
    • About Yandex AI Studio
    • Yandex Workflows
    • Quotas and limits
    • Terms and definitions
  • Compatibility with OpenAI
    • Overview
    • API authentication
        • Overview
          • Overview
          • Tokenize
          • TokenizeCompletion
  • Access management
  • Pricing policy
  • Audit Trails events
  • 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
© 2025 Direct Cursus Technology L.L.C.