deleteCache( )
Deletes KV cache files.
function deleteCache(params): Promise<{ success: boolean }>;
Union type. One of:
| Field | Type | Required? | Description |
|---|
| all | true | ✓ | Deletes all cache files |
| Field | Type | Required? | Description |
|---|
| kvCacheKey | string | ✓ | The cache key to delete |
| modelId | string | ✗ | Specific model ID to delete within the cache key. If not provided, deletes the entire cache key. |
Promise<{ success: boolean }> — Resolves with the success status.
| Error | When |
|---|
INVALID_DELETE_CACHE_PARAMS | Neither all nor kvCacheKey was provided |
DELETE_CACHE_FAILED | The server reports cache deletion failure |
// Delete all caches
await deleteCache({ all: true });
// Delete entire cache key (all models)
await deleteCache({ kvCacheKey: "my-session" });
// Delete only specific model within cache key
await deleteCache({ kvCacheKey: "my-session", modelId: "model-abc123" });