Durable Streams API — Agentuity Documentation

Durable Streams API

Create durable, resumable data streams with public URLs

Create durable, resumable data streams with public URLs.

https://streams-usw.agentuity.cloud

Authentication

All requests require a Bearer token. Pass your SDK key in the Authorization header.

HeaderValue
AuthorizationBearer YOUR_SDK_KEY

You can find your SDK key in the Agentuity Console under your project settings.


Create Stream

Create a new stream and receive its stream ID.

POST/stream
https://streams-usw.agentuity.cloud/stream

Request Body

Stream creation payload.

FieldTypeDescription
namestringThe namespace/group name (1–254 chars)
metadataobjectOptional key-value metadata (optional)
headersobjectOptional headers map (commonly includes `content-type`) (optional)
ttlnumber | nullStream TTL in seconds (optional)

Response

JSON response containing the new stream ID.

StatusDescription
200Stream created successfully
401Unauthorized
402Payment required

Response Fields

FieldTypeDescription
idstringCreated stream ID

Notes

TTL behavior:

  • Omitted: Stream expires after the service default period
  • null or 0: Stream never expires
  • 60–7,776,000: Expires after specified seconds (values outside range are clamped)

Example

curl -X POST 'https://streams-usw.agentuity.cloud/stream' \
  -H 'Authorization: Bearer $AGENTUITY_SDK_KEY' \
  -H 'Content-Type: application/json' \
  -d '{
  "name": "agent-logs",
  "metadata": {
    "exportDate": "2024-01-15"
  },
  "headers": {
    "content-type": "application/json"
  }
}'

Get Stream Info

Get stream metadata, size, public URL, and expiration info.

POST/stream/{id}/info
https://streams-usw.agentuity.cloud/stream/{id}/info

Parameters

path
NameTypeRequiredDescription
idstringYesThe stream ID

Request Body

Empty JSON object is required.

Response

JSON object with stream details.

StatusDescription
200Stream info returned
401Unauthorized
404Stream not found

Response Fields

FieldTypeDescription
idstringStream ID
namestringNamespace name
metadataobjectStream metadata
urlstringPublic stream URL
size_bytesnumberCurrent stream size in bytes
expires_atstring | nullISO 8601 expiration timestamp

Example

curl -X POST 'https://streams-usw.agentuity.cloud/stream/stream_abc123/info' \
  -H 'Authorization: Bearer $AGENTUITY_SDK_KEY' \
  -H 'Content-Type: application/json' \
  -d '{}'

Download Stream

Download the finalized stream contents as raw binary data.

GET/stream/{id}
https://streams-usw.agentuity.cloud/stream/{id}

Parameters

path
NameTypeRequiredDescription
idstringYesThe stream ID

Response

Raw binary stream data with original content type.

StatusDescription
200Stream data returned
401Unauthorized
404Stream not found

Example

curl -X GET 'https://streams-usw.agentuity.cloud/stream/stream_abc123' \
  -H 'Authorization: Bearer $AGENTUITY_SDK_KEY'

List Streams

List streams with filtering, pagination, and sorting.

POST/stream/list
https://streams-usw.agentuity.cloud/stream/list

Request Body

Optional list filters and pagination controls.

FieldTypeDescription
namestringFilter by namespace (optional)
metadataobjectFilter by metadata fields (optional)
limitnumberMaximum streams to return (optional)
offsetnumberOffset for pagination (optional)
sortstringSort by `name`, `created`, `updated`, `size`, `count`, or `lastUsed` (optional)
directionstringSort direction: `asc` or `desc` (optional)

Response

JSON response with stream list and total count.

StatusDescription
200Stream list returned
401Unauthorized

Response Fields

FieldTypeDescription
successbooleanWhether the request succeeded
streamsobject[]Matching streams
streams[].idstringStream ID
streams[].namestringNamespace name
streams[].metadataobjectStream metadata
streams[].urlstringPublic stream URL
streams[].size_bytesnumberCurrent stream size in bytes
streams[].expires_atstring | nullISO 8601 expiration timestamp
totalnumberTotal matches

Example

curl -X POST 'https://streams-usw.agentuity.cloud/stream/list' \
  -H 'Authorization: Bearer $AGENTUITY_SDK_KEY' \
  -H 'Content-Type: application/json' \
  -d '{
  "name": "agent-logs",
  "limit": 50
}'

Delete Stream

Delete a stream by ID.

DELETE/stream/{id}
https://streams-usw.agentuity.cloud/stream/{id}

Parameters

path
NameTypeRequiredDescription
idstringYesThe stream ID

Response

Empty response on success.

StatusDescription
200Stream deleted
401Unauthorized
404Stream not found

Example

curl -X DELETE 'https://streams-usw.agentuity.cloud/stream/stream_abc123' \
  -H 'Authorization: Bearer $AGENTUITY_SDK_KEY'

Append Data

Append a binary chunk (up to 5MB) to an open stream.

POST/stream/{id}/append
https://streams-usw.agentuity.cloud/stream/{id}/append

Parameters

path
NameTypeRequiredDescription
idstringYesThe stream ID

Request Body

Raw binary body. Set Content-Type: application/octet-stream.

Response

Empty response on success.

StatusDescription
200Data appended
401Unauthorized
413Chunk too large

Example

curl -X POST 'https://streams-usw.agentuity.cloud/stream/stream_abc123/append' \
  -H 'Authorization: Bearer $AGENTUITY_SDK_KEY' \
  -H 'Content-Type: application/octet-stream' \
  -d '<binary data>'

Complete Stream

Finalize stream writing and make it available for reading.

POST/stream/{id}/complete
https://streams-usw.agentuity.cloud/stream/{id}/complete

Parameters

path
NameTypeRequiredDescription
idstringYesThe stream ID

Request Body

Empty body. Optional header: X-Compress: gzip for server-side compression.

Response

Empty response on success.

StatusDescription
200Stream completed
401Unauthorized

Example

curl -X POST 'https://streams-usw.agentuity.cloud/stream/stream_abc123/complete' \
  -H 'Authorization: Bearer $AGENTUITY_SDK_KEY'