API reference · Files
The upload size cap, the purposes and the validation limits
GET
/v1/files/limitsAPI 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
| Header | Required | Description |
|---|---|---|
Authorization | yes | Bearer and your API key. The key implies its project. |
X-Project-Id | session only | The project to act in, for console sessions. Requests with an API key leave it out. |
Response
200 FileLimits — The limits in force
objectstringrequiredAlways `file_limits`: the type of this object
One of
file_limitsmax_upload_bytesintegerrequiredLargest file `POST /v1/files` takes
purposesarray of stringrequiredPurposes an upload may name
max_line_bytesintegerrequiredLargest single line (one example)
reported_errorsintegerrequiredErrors 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:
| Status | Type | When |
|---|---|---|
401 | authentication_error | The key or session is missing, revoked or expired. |
403 | permission_error | The credential lacks the permission this needs, or the organization is suspended. |
429 | rate_limit_error rate_limited | Too many requests; retry after retry-after seconds. |