curl --request PATCH \
--url https://direct.evolink.ai/v1beta/cachedContents/{id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"ttl": "7200s"
}'
{
"name": "cachedContents/20261103012026348092000s1oTuB96",
"model": "models/gemini-3.8-flash",
"displayName": "product-manual-v3",
"createTime": "2026-11-03T01:20:27.311Z",
"updateTime": "2026-11-03T01:35:10.020Z",
"expireTime": "2026-11-03T03:35:10.000Z",
"usageMetadata": {
"totalTokenCount": 7525
}
}{
"error": {
"code": 400,
"message": "new expiry must be at least 60s in the future",
"status": "INVALID_ARGUMENT",
"details": [
{
"@type": "type.googleapis.com/google.rpc.ErrorInfo",
"reason": "INVALID_ARGUMENT",
"domain": "evolink.ai"
}
]
}
}{
"error": {
"code": 401,
"message": "Invalid API key",
"status": "UNAUTHENTICATED"
}
}{
"error": {
"code": 402,
"message": "insufficient quota for cache storage extension",
"status": "RESOURCE_EXHAUSTED",
"details": [
{
"@type": "type.googleapis.com/google.rpc.ErrorInfo",
"reason": "INSUFFICIENT_QUOTA",
"domain": "evolink.ai"
}
]
}
}{
"error": {
"code": 403,
"message": "This key is not allowed to use model gemini-3.8-flash",
"status": "PERMISSION_DENIED"
}
}{
"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"
}
]
}
}{
"error": {
"code": 429,
"message": "Rate limit exceeded",
"status": "RESOURCE_EXHAUSTED"
}
}{
"error": {
"code": 502,
"message": "the request could not be completed due to a service authorization problem; please retry later or contact support",
"status": "INTERNAL",
"details": [
{
"@type": "type.googleapis.com/google.rpc.ErrorInfo",
"reason": "UPSTREAM_ERROR",
"domain": "evolink.ai"
}
]
}
}{
"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"
}
]
}
}명시적 컨텍스트 캐싱
Gemini 명시적 컨텍스트 캐싱 - 유효 기간 연장 또는 단축
내용은 바꿀 수 없으며 유효 기간만 변경합니다. ttl(지금부터의 새 기간, 예: "7200s") 또는 expireTime(새 절대 만료 시각) 중 하나를 지정합니다.
- 새 만료 시각은 지금부터 최소 60초, 최대 168시간 후여야 합니다.
ttl또는expireTime만 허용하며 둘 다 보내거나 다른 필드를 보내면 400입니다.- 연장: 추가 기간의 저장 요금을 초 단위로 청구하며 1초 미만은 1초로 계산합니다. 단축: 이미 청구한 저장 요금은 환불하지 않습니다.
- 유료 작업입니다. Key에 모델 권한이 필요하며 현재 사용자 그룹의 단가를 적용합니다. 잔액 부족은 402입니다.
- 같은 연장 요청을 재시도할 때
Idempotency-Key헤더로 중복 과금을 방지할 수 있습니다.
PATCH
/
v1beta
/
cachedContents
/
{id}
curl --request PATCH \
--url https://direct.evolink.ai/v1beta/cachedContents/{id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"ttl": "7200s"
}'
{
"name": "cachedContents/20261103012026348092000s1oTuB96",
"model": "models/gemini-3.8-flash",
"displayName": "product-manual-v3",
"createTime": "2026-11-03T01:20:27.311Z",
"updateTime": "2026-11-03T01:35:10.020Z",
"expireTime": "2026-11-03T03:35:10.000Z",
"usageMetadata": {
"totalTokenCount": 7525
}
}{
"error": {
"code": 400,
"message": "new expiry must be at least 60s in the future",
"status": "INVALID_ARGUMENT",
"details": [
{
"@type": "type.googleapis.com/google.rpc.ErrorInfo",
"reason": "INVALID_ARGUMENT",
"domain": "evolink.ai"
}
]
}
}{
"error": {
"code": 401,
"message": "Invalid API key",
"status": "UNAUTHENTICATED"
}
}{
"error": {
"code": 402,
"message": "insufficient quota for cache storage extension",
"status": "RESOURCE_EXHAUSTED",
"details": [
{
"@type": "type.googleapis.com/google.rpc.ErrorInfo",
"reason": "INSUFFICIENT_QUOTA",
"domain": "evolink.ai"
}
]
}
}{
"error": {
"code": 403,
"message": "This key is not allowed to use model gemini-3.8-flash",
"status": "PERMISSION_DENIED"
}
}{
"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"
}
]
}
}{
"error": {
"code": 429,
"message": "Rate limit exceeded",
"status": "RESOURCE_EXHAUSTED"
}
}{
"error": {
"code": 502,
"message": "the request could not be completed due to a service authorization problem; please retry later or contact support",
"status": "INTERNAL",
"details": [
{
"@type": "type.googleapis.com/google.rpc.ErrorInfo",
"reason": "UPSTREAM_ERROR",
"domain": "evolink.ai"
}
]
}
}{
"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"
}
]
}
}BaseURL: 기본 BaseURL은
https://direct.evolink.ai이며, 텍스트 모델 지원이 더 우수하고 장시간 연결을 지원합니다. https://api.evolink.ai는 멀티모달 서비스의 주력 엔드포인트이며, 텍스트 모델에 대해서는 대체 주소로 사용됩니다.유효 기간만 변경할 수 있으며, 요청 본문에
ttl 또는 expireTime 중 하나를 보냅니다. 연장 시 추가 기간분 저장 요금을 청구하며, 단축해도 환불되지 않습니다.인증
모든 엔드포인트는 Bearer Token 인증이 필요합니다
API Key 발급:
API Key 관리에서 발급받으세요.
다음 요청 헤더 추가:
Authorization: Bearer YOUR_API_KEY
Gemini 네이티브 형식인 x-goog-api-key: YOUR_API_KEY 헤더 또는 ?key=YOUR_API_KEY URL 매개변수도 사용할 수 있습니다.
경로 매개변수
본문
application/json
응답
갱신된 캐시 메타데이터. expireTime은 새 만료 시각입니다