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

# Gemini 明示的コンテキストキャッシュ - キャッシュを削除

> キャッシュを即座に削除します。以後その名前を参照すると404です。徴収済みの保存料金は返金されません。無料です。

> [!NOTE]
>
> **BaseURL**：デフォルトの BaseURL は `https://direct.evolink.ai` で、テキストモデルへの対応が優れており、長時間接続をサポートします。`https://api.evolink.ai` はマルチモーダルの主力エンドポイントで、テキストモデルに対しては代替アドレスとして使用されます。

> [!NOTE]
>
> 削除したキャッシュは参照できなくなります。徴収済みの保存料金は返金されません。


## OpenAPI

````yaml ja/api-manual/language-series/gemini/cached-contents/cached-contents.json DELETE /v1beta/cachedContents/{id}
openapi: 3.1.0
info:
  title: Gemini 明示的コンテキストキャッシュ（cachedContents）
  description: >-
    繰り返し使う長いプレフィックス（文書、システム指示、ツール定義）を一度キャッシュし、以後の生成リクエストではキャッシュ名と新しい質問だけを送ります。キャッシュ部分にはキャッシュヒット単価が適用されます。形式は
    Gemini ネイティブの cachedContents API と同じです。
  license:
    name: MIT
  version: 1.0.0
servers:
  - url: https://direct.evolink.ai
    description: 本番環境（推奨）
  - url: https://api.evolink.ai
    description: 代替アドレス
security:
  - bearerAuth: []
tags:
  - name: 明示的コンテキストキャッシュ
    description: Gemini の明示的キャッシュの作成、取得、延長、削除
paths:
  /v1beta/cachedContents/{id}:
    delete:
      tags:
        - 明示的コンテキストキャッシュ
      summary: キャッシュを削除
      description: キャッシュを即座に削除します。以後その名前を参照すると404です。徴収済みの保存料金は返金されません。無料です。
      operationId: geminiDeleteCachedContent
      parameters:
        - name: id
          in: path
          required: true
          description: >-
            キャッシュID：作成時の `name` から `cachedContents/`
            を除いた部分です。`cachedContents/20261103012026348092000s1oTuB96` なら
            `20261103012026348092000s1oTuB96` を指定します。
          schema:
            type: string
            example: 20261103012026348092000s1oTuB96
      responses:
        '200':
          description: 削除済み。空のオブジェクトを返します
          content:
            application/json:
              schema:
                type: object
              example: {}
        '401':
          description: API Key が無効または未指定
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                error:
                  code: 401
                  message: Invalid API key
                  status: UNAUTHENTICATED
        '403':
          description: Key にモデル利用権限がないか、送信元IPが許可リスト外
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                error:
                  code: 403
                  message: This key is not allowed to use model gemini-3.8-flash
                  status: PERMISSION_DENIED
        '404':
          description: キャッシュが存在しない、期限切れ、削除済み、他アカウントに所属、または明示的キャッシュ機能が未提供
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                error:
                  code: 404
                  message: cached content not found
                  status: NOT_FOUND
                  details:
                    - '@type': type.googleapis.com/google.rpc.ErrorInfo
                      reason: CACHE_NOT_FOUND
                      domain: evolink.ai
        '429':
          description: レート制限超過
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                error:
                  code: 429
                  message: Rate limit exceeded
                  status: RESOURCE_EXHAUSTED
        '503':
          description: キャッシュが一時的に利用できません。後ほど再試行してください
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                error:
                  code: 503
                  message: >-
                    cached content is temporarily unavailable; please retry
                    later
                  status: UNAVAILABLE
                  details:
                    - '@type': type.googleapis.com/google.rpc.ErrorInfo
                      reason: CACHE_CHANNEL_UNAVAILABLE
                      domain: evolink.ai
components:
  schemas:
    ErrorResponse:
      type: object
      description: >-
        Gemini ネイティブのエラー形式。`error.details[0].reason` は理由コードです：`INVALID_ARGUMENT`
        パラメータエラー、`EXPLICIT_CACHE_UNSUPPORTED`
        モデルが明示的キャッシュに非対応、`NO_AVAILABLE_CHANNEL`・`MODEL_PRICE_ERROR`
        現在のユーザーグループでは未提供、`CACHE_EXPIRED`
        キャッシュが期限切れ、または残り有効期間が短すぎる、`CACHE_MODEL_MISMATCH`
        モデルがキャッシュと一致しない、`INVALID_CACHED_CONTENT` `cachedContent`
        の形式が不正、`INSUFFICIENT_QUOTA` 残高不足、`CACHE_NOT_FOUND`
        キャッシュが存在しない・期限切れ・削除済み・他のアカウントのもの、`EXPLICIT_CACHE_DISABLED`
        機能が未提供、`CACHE_CONTENT_TOO_LARGE` リクエストボディが 10 MB を超過、`UPSTREAM_ERROR`
        リクエストが受け付けられなかった（`message` を参照）、`CACHE_CHANNEL_UNAVAILABLE`・`INTERNAL`
        一時的に利用不可、時間をおいて再試行してください。
      properties:
        error:
          type: object
          properties:
            code:
              type: integer
              description: HTTP ステータスコード
            message:
              type: string
            status:
              type: string
              description: ステータス値（INVALID_ARGUMENT / NOT_FOUND / UNAVAILABLE など）
            details:
              type: array
              items:
                type: object
                properties:
                  '@type':
                    type: string
                    example: type.googleapis.com/google.rpc.ErrorInfo
                  reason:
                    type: string
                    example: CACHE_NOT_FOUND
                  domain:
                    type: string
                    example: evolink.ai
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: >-
        ## すべてのエンドポイントは Bearer Token 認証が必要です


        **API Key の取得：**


        [API Key 管理](https://evolink.ai/dashboard/keys)で取得してください。


        **リクエストヘッダーに追加：**

        ```

        Authorization: Bearer YOUR_API_KEY

        ```


        Gemini ネイティブ形式の `x-goog-api-key: YOUR_API_KEY` ヘッダー、または URL パラメータ
        `?key=YOUR_API_KEY` も使用できます。

````

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