Skip to content
Hayonix

API reference · Files

The upload size cap, the purposes and the validation limits

GET/v1/files/limits
API keyfile:readProject
TypeScript
client.files.getLimits()
Python
client.files.get_limits()
CLI
hayonix files limits

Read this before uploading to check a file against the limits in force; larger files and longer lines are refused or fail validation.

Project API key (Authorization: Bearer sk_…), or a console session. Requires the file:read permission (a key's scope, or a role that includes it).

Examples

The samples read API_KEY and API_BASE_URL from the environment (see Setup). Values are examples.

curl -sS "$API_BASE_URL/files/limits" \
  -H "Authorization: Bearer $API_KEY"

Request

Headers
HeaderRequiredDescription
AuthorizationyesBearer and your API key. The key implies its project.
X-Project-Idsession onlyThe project to act in, for console sessions. Requests with an API key leave it out.

Response

200 FileLimits — The limits in force

  • objectstringrequired

    Always `file_limits`: the type of this object

    One offile_limits

  • max_upload_bytesintegerrequired

    Largest file `POST /v1/files` takes

  • purposesarray of stringrequired

    Purposes an upload may name

  • max_line_bytesintegerrequired

    Largest single line (one example)

  • reported_errorsintegerrequired

    Errors kept in a validation report (all are counted)

Example response
Example response
{
  "object": "file_limits",
  "max_upload_bytes": 1,
  "purposes": [
    "fine-tune"
  ],
  "max_line_bytes": 1,
  "reported_errors": 1
}

Errors

Errors use the standard envelope. What this operation can answer:

Errors
StatusTypeWhen
401authentication_errorThe key or session is missing, revoked or expired.
403permission_errorThe credential lacks the permission this needs, or the organization is suspended.
429rate_limit_error rate_limitedToo many requests; retry after retry-after seconds.