Docs · Reference

Limits and errors

The limits we enforce, and the errors you get when you reach one. mat whoami shows your account's quotas and what you use of them.

Limits and errorsMenu

Account quotas

Quotas are per account. mat whoami and GET /v1/me show yours and what you use of them. A new account has a quota of zero until it subscribes or we enable it.

Account quotas
LimitValueDetails
Sandboxes50Every sandbox not deleted counts, paused and stopped ones included.
Sandbox memory200 GiB (204800 MiB)The memory of every sandbox not deleted, running or paused.
Running at once10Sandboxes creating, running, resuming or pausing. Checked on every create and every resume, including a resume caused by exec, files or a connection.

Rates and waiting

Rates and waiting
LimitValueDetails
Creates60 per account per minuteForks count too. Every attempt counts, including retries with the same Idempotency-Key.
Waiting for roomUp to 1 minuteWhen no host has room, a create or resume waits for some before it answers 503.
Idempotency-Key1 to 128 visible ASCII characters

Sandboxes

Sandboxes
LimitValueDetails
Idle timeout1 to 1440 minutes10 by default.
Disk throughput100 MiB/s and 4000 operations/s per vCPUWith a burst of 1 GiB, so package installs and image pulls stay fast.
Network bandwidth100 Mbit/s each way per vCPUWith a burst of 256 MiB.

Commands and files

Commands and files
LimitValueDetails
Command output keptThe last 1 MiB per commandOlder output is dropped; a stream says from which byte it continues.
File transferOne file, up to 1 GiBThe path is absolute, up to 4096 bytes. No directories.
Terminal size1 to 1000 columns and rows

Network

Network
LimitValueDetails
Allowed domains256 per sandboxUnder restricted, besides the essentials.
Outbound mailPort 25 is blockedSend mail through a provider on port 465 or 587.
Open connections1024 per sandbox
New connections20 per second, bursts of 400A quarter of that for accounts without an active subscription. Far above what installs, git, model APIs and browsing need.
Failed destinations200 distinct within a minuteLooks like a port scan: the sandbox is paused and held for review.
Egress logThe last 1000 connections per sandboxKept in memory on the host; lost if the host agent restarts.

Secrets

Secrets
LimitValueDetails
NameUp to 128 charactersLetters, digits and _, not starting with a digit.
Value1 to 8192 bytes of printable ASCII
Domains per secret1 to 16
Secrets per sandbox64

Snapshots

Snapshots
LimitValueDetails
Snapshots per sandbox10Snapshots being taken count too.
Snapshot storage per account200 GiB by default for a subscribed accountEach snapshot counts its sandbox's disk plus memory: 12 GiB small, 24 GiB medium, 48 GiB large. `mat whoami` shows yours.
Host diskChecked before each snapshotA host refuses a snapshot it could not hold if the sandbox rewrote its whole disk; retry later.
Name1 to 64 charactersNo control characters.

Sign-in and connections

Sign-in and connections
LimitValueDetails
Session7 daysThen sign in again. API keys do not expire; revoke them when you are done.
mat login code10 minutes
Connect and preview tokensSingle use, 60 seconds
API key labelUp to 64 printable characters

Account quotas are the defaults for a subscribed account. Yours may differ; mat whoami is the authority.

Error codes

Every error body has a code and a message. The message names the limit or the reason.

API error codes
StatusCodeMeaning
400invalid_requestThe request is malformed or a value is out of range. Unknown JSON fields are refused too.
401unauthorizedMissing, invalid or expired credentials. The message is always: missing, invalid or expired credentials; sign in again.
403forbiddenSigned in, but not allowed this way, such as an API key managing API keys.
404not_foundNo such sandbox, exec, secret, key or route in your account.
409conflictThe sandbox is not in a state that allows this, e.g. deleting a sandbox while it is being created.
429quota_exceededAn account limit or the create rate limit. The message names the limit.
503unavailableNo capacity right now, a host is busy or unreachable, or the sandbox reported it is out of room. Usually worth retrying shortly.
500internalSomething failed on our side. The message is just internal error.

Retrying

  • 503 unavailable is usually worth retrying after a short wait: a host was busy, full or slow to answer.
  • When a host does not confirm a change, the message says to check the sandbox's status. We settle it in the background; read the sandbox before you retry.
  • For 429 quota_exceeded, read the message. The create rate limit says how many seconds to wait; the other quotas need you to pause or delete a sandbox, or a higher quota.
  • Retry creates with the same Idempotency-Key, so a retry returns the sandbox the first attempt made.

CLI exit codes

mat exit codes
CodeMeaning
0Success.
1The API refused the request, or could not be reached. The message says why.
2Bad arguments or missing setup, such as not being signed in.
Nmat exec, mat logs and mat shell exit with the remote command's own code, or 128 + the signal that ended it.
130You detached from mat exec with a second Ctrl-C. The command keeps running.