v1

latestOpenAPI 3.1.0Apache 2.02026-07-264001921002.3 KB
GenAI Integration

Create cached content (Gemini format)

Creates a cached content entry that can be re-used across subsequent generate-content calls to reduce repeated prefix tokens.

post/genai/v1beta/cachedContents

Headers

x-model-providerstring

Optional provider override. Defaults to gemini. Use vertex to route to Vertex.

Request body

modelstring required

Gemini model identifier (e.g. gemini-1.5-pro). The models/ prefix is stripped.

displayNamestring
systemInstructionobject

System instruction content.

{"stackTrail":"paths:/genai/v1beta/cachedContents:post:requestBody:content:application/json:schema:properties:toolConfig","oasType":"schema","type":"unknown"}
ttlstring

TTL in protobuf duration format (e.g. 3600s).

expireTimestring date-time

Response

Successful response

object required