diff options
Diffstat (limited to 'docs/cli')
| -rw-r--r-- | docs/cli/index.md | 1 | ||||
| -rw-r--r-- | docs/cli/token-caching.md | 14 |
2 files changed, 15 insertions, 0 deletions
diff --git a/docs/cli/index.md b/docs/cli/index.md index 430548b9..fe10f90a 100644 --- a/docs/cli/index.md +++ b/docs/cli/index.md @@ -7,6 +7,7 @@ Within Gemini CLI, `packages/cli` is the frontend for users to send and receive - **[Authentication](./authentication.md):** A guide to setting up authentication with Google's AI services. - **[Commands](./commands.md):** A reference for Gemini CLI commands (e.g., `/help`, `/tools`, `/theme`). - **[Configuration](./configuration.md):** A guide to tailoring Gemini CLI behavior using configuration files. +- **[Token Caching](./token-caching.md):** Optimize API costs through token caching. - **[Themes](./themes.md)**: A guide to customizing the CLI's appearance with different themes. - **[Tutorials](tutorials.md)**: A tutorial showing how to use Gemini CLI to automate a development task. diff --git a/docs/cli/token-caching.md b/docs/cli/token-caching.md new file mode 100644 index 00000000..17e103e1 --- /dev/null +++ b/docs/cli/token-caching.md @@ -0,0 +1,14 @@ +# Token Caching and Cost Optimization + +Gemini CLI automatically optimizes API costs through token caching when using API key authentication (Gemini API key or Vertex AI). This feature reuses previous system instructions and context to reduce the number of tokens processed in subsequent requests. + +**Token caching is available for:** + +- API key users (Gemini API key) +- Vertex AI users (with project and location setup) + +**Token caching is not available for:** + +- OAuth users (Google Personal/Enterprise accounts) - the Code Assist API does not support cached content creation at this time + +You can view your token usage and cached token savings using the `/stats` command. When cached tokens are available, they will be displayed in the stats output. |
