Limits and runtimes

Where the SDK runs, and the sizes, counts, and times it checks before a call is sent.

Runtimes

The SDK runs on servers, in any of these:

RuntimeVersion
Node20.3 or newer
BunCurrent releases
DenoCurrent releases, with --allow-env to read environment variables and --allow-net to make calls
Cloudflare WorkersCurrent releases. Pass the key and project to createSpace() from env

It ships as ES modules and as CommonJS, so both import and require work, and it includes its own TypeScript types.

Another server runtime may work when it has the same web APIs, such as fetch, AbortSignal.any, and Web Crypto. Without fetch, pass one in the fetch option, or createSpace() fails with unsupported_runtime.

Only on servers

The SDK holds an API key, and anyone who can see a key can use it. In a web page, every call that needs a key fails with browser_not_allowed before anything is sent. Call the SDK from your backend, and send your web page only what it needs, such as a download link from url().

The client

LimitValue
timeoutMs, for one try of a call1,000 to 600,000 ms. 30,000 by default
Chat calls600,000 ms for one try, unless the call passes timeoutMs
retries0 to 5. 2 by default
Longest wait set by Retry-After30 seconds
userAgent200 characters

See createSpace() and space.

Storage

space.fs checks these before it sends anything. Storage’s own limits, such as storage in one project and buckets in one project, are in Storage limits.

LimitValue
Largest file100,000,000 bytes, exported as maxFileBytes
Key1,024 bytes, not starting or ending with /, without //, a folder named . or .., or control characters
Bucket name3 to 63 lowercase letters, digits, and single hyphens, starting and ending with a letter or digit
pageSize for list()1 to 1,000. 1,000 by default
Preset name1 to 64 characters

write() holds the whole file in memory while it sends it. A stream is read to its end first, and fails with file_too_large as soon as it passes the largest size.

AI

space.ai checks these before it sends anything. Your plan’s limits, such as units a month and requests a minute, are in AI limits.

LimitValue
Messages in one call1 to 1,000
Tools in one call1 to 128
stopUp to 4 strings
temperature0 to 2
topP0 to 1
presencePenalty and frequencyPenalty-2 to 2
user256 characters

Scheduler

space.schedule checks these before it sends anything. The scheduler’s own limits, such as jobs in one project, are in Scheduler limits.

LimitValue
Job name1 to 100 characters. every() shortens its own name to fit
Job description500 characters
Target URLhttps, up to 2,048 characters, without a # part
Retries after the first attempt0 to 5
Longest time to keep retrying86,400 seconds
Wait between retries1 to 3,600 seconds
Doublings of the wait0 to 16
Time for one attempt15 to 1,800 seconds

verify() keeps the scheduler’s public keys for 5 minutes, and allows 30 seconds of difference between clocks when it checks a token’s times.

Webhooks

space.hooks checks these before it sends anything.

LimitValue
Source and destination names1 to 100 characters
Destination URLhttps, up to 2,048 characters, without a # part
Attempts for one delivery1 to 20
Time for one attempt1 to 60 seconds
Rate limit1 to 100,000 a second, minute, or hour
Delay on a connection0 to 86,400 seconds
Transformation code64 KB
Deliveries to send again in one call1 to 100

verify() accepts a delivery signed up to 5 minutes before or after your server’s clock. Change it with toleranceSeconds, from 1 to 86,400.

Last updated