Skip to main content
PATCH
BaseURL: The default BaseURL is https://direct.evolink.ai, which has better support for text models and long-lived connections. https://api.evolink.ai is the primary endpoint for multimodal services and serves as a fallback address for text models.
Only the lifetime can be changed: send either ttl or expireTime. Extending charges storage for the added duration; shortening is not refunded.

Authorizations

Authorization
string
header
required

All endpoints require Bearer Token authentication

Get an API Key:

Visit API Key Management to get your API Key.

Add this request header:

The Gemini native format is also accepted: the x-goog-api-key: YOUR_API_KEY header or the ?key=YOUR_API_KEY URL parameter.

Path Parameters

id
string
required

Cache ID: the name returned on creation, without the cachedContents/ prefix. For example, if name is cachedContents/20261103012026348092000s1oTuB96, use 20261103012026348092000s1oTuB96 here.

Example:

"20261103012026348092000s1oTuB96"

Body

application/json

Provide exactly one of ttl or expireTime; other fields return 400

ttl
string

New lifetime starting now, such as "7200s". Minimum 60s, maximum 604800s

Example:

"7200s"

expireTime
string<date-time>

New absolute expiry time (RFC 3339, UTC)

Example:

"2026-11-03T06:00:00Z"

Response

Updated cache metadata; expireTime is the new expiry time

name
string

Cache name, in the form cachedContents/<id>. Use it in the cachedContent field of generation requests; <id> is also the creation request's ID

Example:

"cachedContents/20261103012026348092000s1oTuB96"

model
string

Model bound to the cache; the generation request must use the same model

Example:

"models/gemini-3.8-flash"

displayName
string

Name provided on creation; omitted if not provided

createTime
string<date-time>

Creation time (UTC)

updateTime
string<date-time>

Most recent update time (UTC)

expireTime
string<date-time>

Expiry time (UTC); automatically deleted on expiry

usageMetadata
object