Gemini Resources

Create Gemini cached content

Creates cached content for a current TokenLab Gemini model. Supported fields, resource references, and lifetime depend on the service and model; lowerCamelCase and the corresponding proto snake_case names are accepted. Resources can only be read, referenced, changed, or deleted in their owning Workspace. Missing, expired, or inaccessible resources return a Gemini-format error.

post/v1beta/cachedContents

Request

  • Base URL: https://api.tokenlab.sh
  • URL: https://api.tokenlab.sh/v1beta/cachedContents
  • Auth: one of:
    • HTTP bearer
    • API key in header x-goog-api-key

Query parameters

keystring

API key alternative to Bearer or x-goog-api-key.

Headers

Idempotency-Keystring

Reuse the same key and request body when recovering a create response. A different body with the same key returns a conflict.

Request body

modelstring required

Current TokenLab model ID that supports Gemini cached content.

displayNamestring

Human-readable cache name.

ttlstring

Positive duration such as 3600s. Supported lifetime is validated by the service.

expireTimestring date-time

Requested expiration time; use ttl or expireTime as supported by the service.

contentsContents (unresolved $ref)
systemInstructionSystemInstruction (unresolved $ref)
toolsTools (unresolved $ref)
toolConfigToolConfig (unresolved $ref)

Response

Success

namestring

Resource name such as cachedContents/{cacheId}.

modelstring

TokenLab model ID associated with the cached content.

displayNamestring

Human-readable cache name.

createTimestring date-time
updateTimestring date-time
expireTimestring date-time
usageMetadataobject

Changes

No recorded changes to this operation across all 1 revision of this API.