> ## 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

<a id="sql-gpt-generate-tokens" />

Counts the number of tokens that would be used in generating the SQL in an
equivalent [GENERATE SQL](/content/sql/sqlgpt/generate-sql#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

<AccordionGroup>
  <Accordion title="WITH OPTIONS" id="with-options" defaultOpen>
    Optional indicator that a comma-delimited list of token generation option/value assignments
    will follow.

    See [SQL Token Generation Options](/content/sql/sqlgpt/generate-tokens#sql-gpt-generate-tokens-opts) for the complete list of options.
  </Accordion>
</AccordionGroup>

<a id="sql-gpt-generate-tokens-opts" />

## SQL Token Generation Options

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

<AccordionGroup>
  <Accordion title="context_name" id="context_name" defaultOpen>
    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>

  <Accordion title="context_names" id="context_names" defaultOpen>
    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'
    ```
  </Accordion>
</AccordionGroup>

## 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.