CoreWeave AI Object Storage supports conditional requests on reads and writes. A conditional request attaches an HTTP precondition header to an S3 API call. The operation proceeds only if the precondition is satisfied; otherwise the server returns an error and the object is not modified or transferred.Documentation Index
Fetch the complete documentation index at: https://docs.coreweave.com/llms.txt
Use this file to discover all available pages before exploring further.
About ETags
An ETag (entity tag) is a content fingerprint returned for every object. ETags are included in the response ofPutObject, HeadObject, and GetObject calls. When an object’s content changes, its ETag changes. Use HeadObject to retrieve the current ETag without downloading the object.
ETags are returned as quoted hex strings, for example "1b2cf535f27731c97434645a985325". Include the quotes when passing an ETag to a precondition header.
Conditional reads
Conditional reads let you skip aGetObject download when the object has not changed since the last time you read it. Pass the ETag you last received as the If-None-Match value. If the object has not changed, the server returns 304 Not Modified and no data is transferred. If the object has changed, the download proceeds.
Use If-Match to download only when the object matches a specific ETag, or to detect that the object changed since you last read it.
- AWS CLI
- Boto3
Replace If the ETag matches (the object has not changed), the command returns an error wrapping the
[BUCKET-NAME], [OBJECT-KEY], [LAST-KNOWN-ETAG], and [LOCAL-OUTPUT-PATH] with the appropriate values.304 Not Modified response.Conditional writes
Conditional writes prevent accidental overwrites by requiring a precondition to be met beforePutObject, CompleteMultipartUpload, CopyObject, or RenameObject modifies an object. If the precondition fails, the server returns 412 Precondition Failed and the object is not modified. RenameObject supports a richer set of conditional headers, including separate source and destination preconditions and time-based conditions. See RenameObject conditionals for details.
Two patterns are supported:
| Pattern | Header | Value | Behavior |
|---|---|---|---|
| Safe create | If-None-Match | * | Write only if no object exists at the key |
| Compare-and-swap | If-Match | ETag string | Write only if the object’s current ETag matches |
Safe create
UseIf-None-Match: * to write an object only if no object already exists at that key. This prevents overwriting existing data even when multiple writers race for the same key.
If two concurrent requests use If-None-Match: * for the same key, one succeeds and the other returns 409 ConditionalRequestConflict. Retry the request on 409.
- AWS CLI
- Boto3
Replace
[BUCKET-NAME], [OBJECT-KEY], and [LOCAL-FILE-PATH] with the appropriate values.Compare-and-swap
UseIf-Match with the current ETag to write an object only if it has not changed since you last read it. This detects concurrent updates that occurred between your read and write.
The workflow is:
- Call
HeadObjectto retrieve the current ETag. - Perform your local computation or modification.
- Call
PutObjectwithIf-Matchset to the ETag from step 1.
412 Precondition Failed. Retry from step 1 to read the updated object.
- AWS CLI
- Boto3
Replace
[BUCKET-NAME], [OBJECT-KEY], and [LOCAL-FILE-PATH] with the appropriate values.RenameObject conditionals
RenameObject supports a richer set of conditional headers, including separate preconditions for the source and destination objects, and time-based conditions. See Preconditions and safeguards in the rename objects guide.