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

# Prompt Caching

Prompt caching can substantially reduce the cost of model calls on official channels. GeekAI supports caching for OpenAI, Claude, DeepSeek, and other providers. Filter the [model catalog](https://geekai.co/models) by prompt caching to see supported models:

![Models that support prompt caching on GeekAI](https://static.geekai.co/storage/2025/04/11/328198eae4740f34c429530baf0f2fe.png)

Most providers, including OpenAI, DeepSeek, and Kimi, cache prompts automatically. For Claude, enable caching by specifying `cache_control` in the request body.

### OpenAI

Cache pricing:

* Cache writes are free.
* Cache reads cost 0.5 times the standard input price.

OpenAI caches prompts automatically without additional configuration. A prompt must contain at least 1,024 tokens to qualify. For usage and limits, see the [OpenAI documentation](https://platform.openai.com/docs/guides/prompt-caching).

### Claude

Cache pricing:

* Cache writes cost 1.25 times the standard input price.
* Cache reads cost 0.1 times the standard input price.

For Claude, add `cache_control` to the message content object you want to cache. You can cache system or user messages. For example, to cache a system message:

```json theme={null}
{
  "messages": [
    {
      "role": "system",
      "content": [
        {
          "type": "text",
          "text": "You are a financial analyst who specializes in analyzing and forecasting market trends."
        },
        {
          "type": "text",
          "text": "HUGE TEXT BODY",
          "cache_control": {
            "type": "ephemeral"
          }
        }
      ]
    },
    {
      "role": "user",
      "content": [
        {
          "type": "text",
          "text": "Analyze the current market trends."
        }
      ]
    }
  ]
}
```

To cache a user message:

```json theme={null}
{
  "messages": [
    {
      "role": "user",
      "content": [
        {
          "type": "text",
          "text": "Given the following book contents:"
        },
        {
          "type": "text",
          "text": "HUGE TEXT BODY",
          "cache_control": {
            "type": "ephemeral"
          }
        },
        {
          "type": "text",
          "text": "List the names of all the characters in the book above."
        }
      ]
    }
  ]
}
```

Like OpenAI, Claude has minimum prompt lengths for caching:

* Claude 3.7 Sonnet, Claude 3.5 Sonnet, and Claude 3 Opus require 1,024 tokens.
* Claude 3.5 Haiku and Claude 3 Haiku require 2,048 tokens.

For usage and limits, see the [Claude documentation](https://docs.anthropic.com/en/docs/build-with-claude/prompt-caching).

### DeepSeek

Cache pricing:

* Cache writes are free.
* Cache reads cost 0.1 times the standard input price.

Like OpenAI, DeepSeek caches prompts automatically without additional configuration. Its minimum is 64 tokens. See the [DeepSeek documentation](https://api-docs.deepseek.com/zh-cn/guides/kv_cache) for details.

### Gemini

Cache pricing:

* Cache writes are free.
* Cache reads cost 0.25 times the standard input price.

GeekAI supports only Gemini's implicit caching, available starting with Gemini 2.5. Like OpenAI and DeepSeek caching, it is automatic. Gemini 2.5 Flash requires at least 1,024 tokens; Gemini 2.5 Pro requires at least 4,096. See the [Gemini documentation](https://ai.google.dev/gemini-api/docs/caching?lang=node#implicit-caching) for details.

### Check cache usage

See cache hits and pricing in your GeekAI account's [billing history](https://geekai.co/user/transactions).


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