> ## Documentation Index
> Fetch the complete documentation index at: https://docs.kinetica.com/llms.txt
> Use this file to discover all available pages before exploring further.

# GENERATE TOKENS

Counts the number of tokens that would be used in generating the SQL in an
equivalent [GENERATE SQL](https://docs.kinetica.com/content/sql/sqlgpt/generate-sql.md#sql-gpt-generate-sql) call.  This is, effectively, the
number of combined tokens in the given contexts.

```sql title="GENERATE TOKENS Syntax" theme={null}
GENERATE TOKENS
[WITH OPTIONS (<option name> = '<option value>'[,...])]
```

## Parameters

> [accordion] WITH OPTIONS
>
> Optional indicator that a comma-delimited list of token generation option/value assignments
> will follow.
>
> See [SQL Token Generation Options](https://docs.kinetica.com/content/sql/sqlgpt/generate-tokens.md#sql-gpt-generate-tokens-opts) for the complete list of options.

## SQL Token Generation Options

The following options can be specified to modify the way the counted tokens are
generated.

> [accordion] context\_name
>
> Name of the *SQL-GPT context* to use as a basis for counting generated tokens; should be of the
> form `[<schema name>.]<context name>`.

> [accordion] context\_names
>
> Comma-separated list of names of *SQL-GPT contexts* to use as the basis for counting generated
> tokens; each should be of the form `[<schema name>.]<context name>`, and the entire list
> should be single-quoted.
>
> For example:
>
> ```
> context_names = 'example.atc_ctx,example.nyctaxi'
> ```

## SQL Token Generation Examples

To count the generated tokens for the `example.atc_ctx`
*SQL-GPT context*:

```sql GENERATE TOKENS Example theme={null}
GENERATE TOKENS
WITH OPTIONS (context_name = 'example.atc_ctx')
```


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.