Skip to main content

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.

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.

About ETags

An ETag (entity tag) is a content fingerprint returned for every object. ETags are included in the response of PutObject, 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 a GetObject 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.
Replace [BUCKET-NAME], [OBJECT-KEY], [LAST-KNOWN-ETAG], and [LOCAL-OUTPUT-PATH] with the appropriate values.
aws s3api get-object \
  --bucket [BUCKET-NAME] \
  --key [OBJECT-KEY] \
  --if-none-match '"[LAST-KNOWN-ETAG]"' \
  --endpoint-url https://cwobject.com \
  [LOCAL-OUTPUT-PATH]
If the ETag matches (the object has not changed), the command returns an error wrapping the 304 Not Modified response.

Conditional writes

Conditional writes prevent accidental overwrites by requiring a precondition to be met before PutObject, 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:
PatternHeaderValueBehavior
Safe createIf-None-Match*Write only if no object exists at the key
Compare-and-swapIf-MatchETag stringWrite only if the object’s current ETag matches
For full header constraints, see Conditional writes in the S3 API reference.

Safe create

Use If-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.
Replace [BUCKET-NAME], [OBJECT-KEY], and [LOCAL-FILE-PATH] with the appropriate values.
aws s3api put-object \
  --bucket [BUCKET-NAME] \
  --key [OBJECT-KEY] \
  --body [LOCAL-FILE-PATH] \
  --if-none-match '*' \
  --endpoint-url https://cwobject.com

Compare-and-swap

Use If-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:
  1. Call HeadObject to retrieve the current ETag.
  2. Perform your local computation or modification.
  3. Call PutObject with If-Match set to the ETag from step 1.
If another writer modified the object between step 1 and step 3, the server returns 412 Precondition Failed. Retry from step 1 to read the updated object.
Replace [BUCKET-NAME], [OBJECT-KEY], and [LOCAL-FILE-PATH] with the appropriate values.
# Step 1: Get the current ETag
ETAG=$(aws s3api head-object \
  --bucket [BUCKET-NAME] \
  --key [OBJECT-KEY] \
  --endpoint-url https://cwobject.com \
  --query ETag --output text)

# Step 2: Write only if the ETag still matches
aws s3api put-object \
  --bucket [BUCKET-NAME] \
  --key [OBJECT-KEY] \
  --body [LOCAL-FILE-PATH] \
  --if-match "$ETAG" \
  --endpoint-url https://cwobject.com

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.
Last modified on April 16, 2026