Context Caching for Conversation Creation
1. Overview
Create a context cache. After obtaining the cache ID field through this interface, use the context_id
in Context Caching for Conversation Generation.
Available model list:
Doubao-1.5-pro-32k
Doubao-1.5-lite-32k
Doubao-pro-32k
2. Request Description
Request method:
POST
Request address:
https://gateway.theturbo.ai/v1/context/create
3. Input Parameters
3.1 Header Parameters
Content-Type
string
Yes
Set the request header type, which must be application/json
application/json
Accept
string
Yes
Set the response type, which is recommended to be unified as application/json
application/json
Authorization
string
Yes
API_KEY required for authentication. Format: Bearer $YOUR_API_KEY
Bearer $YOUR_API_KEY
3.2 Body Parameters (application/json)
model
string
Yes
Doubao-1.5-pro-32k
messages
array
Yes
Chat message list, compatible with OpenAI interface format. Each object in the array contains role
and content
.
[{"role": "user","content": "you are a helpful assistant"}]
role
string
No
Message role. Optional values: system
, user
, assistant
.
system
content
string
No
The specific content of the message.
you are a helpful assistant
mode
string
No
Session cache (session
) and prefix cache (common_prefix
) are available.
session
ttl
number
No
The expiration time is in seconds, starting when created and resetting with each use. If it exceeds the TTL, the data is deleted. TTL can be set between 1 hour (3600 seconds) and 7 days (604800 seconds).
86400
4. Request Example
5. Response Example
Last updated