Datablocks API
Train, manage, and deploy datablocks for efficient long-context inference.
Overview
The Datablocks API allows you to create, train, and manage pre-computed context blocks. Datablocks dramatically reduce inference costs and latency by pre-processing large amounts of context into compact KV cache representations.
Training Datablocks
POST /api/v1/datablocks/train
Train a new datablock from your documents. The training process compresses your context into a highly efficient KV cache format.
Managing Datablocks
List Datablocks
GET /v1/datablocks
Get Datablock
GET /v1/datablocks/{datablock_id}
Delete Datablock
DELETE /v1/datablocks/{datablock_id}
Best Practices
Optimize Document Size
For best results, train datablocks with 10K-100K tokens of context per document.
Reuse Datablocks
Once trained, datablocks can be reused across millions of queries with zero additional cost.