API reference · Fine-tuning
A short-lived link to download an artefact tar without credentials
/v1/fine-tunes/{fine_tune_id}/download-link- TypeScript
client.fineTuning.createDownloadLink()- Python
client.fine_tuning.create_download_link()- CLI
hayonix fine-tunes download-link
Takes the same artifact and checkpoint_id as GET /v1/fine-tunes/{fine_tune_id}/download (the body may be omitted for the defaults). The link works for 5 minutes for that one archive, which is streamed: use it where a request cannot carry credentials (a browser saving large weights to disk).
Project API key (Authorization: Bearer sk_…), or a console session. Requires the fine_tune_job: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/fine-tunes/ftj_01jc5zq4m8k3v6x9t2w7r0b1e4/download-link" \
-H "Authorization: Bearer $API_KEY" \
-H "Idempotency-Key: $(uuidgen)" \
-H "Content-Type: application/json" \
-d '{
"artifact": "adapter"
}'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. |
Idempotency-Key | no | Makes a retry safe: the same key and request within 24 hours return the original response (see Idempotency). The SDKs send one for you. |
Path parameters
fine_tune_idstringrequiredID of the fine-tuning job
ID with prefix ftj_
Body
JSON (application/json): FineTuneDownloadLinkRequest, optional.
artifactstringAs for the download route (default: adapter for LoRA jobs)
One of
adaptermergedweightsadapter_ggufmerged_ggufcheckpoint_idstringDefault: the final checkpoint
ID with prefix ftc_
Response
201 DownloadLink — The link
objectstringrequiredAlways `download_link`: the type of this object
One of
download_linkurlstringrequiredAbsolute URL of the download; works without credentials until `expires_at`
pathstringrequiredThe same link relative to the API origin (`/v1/downloads?token=…`)
filenamestringrequiredThe name the download is saved under
bytesintegerrequiredSize in bytes
expires_atstring (date-time)requiredWhen it expires (null: never) (ISO 8601, UTC)
Example response
{
"object": "download_link",
"url": "https://api.example.com/v1/downloads?token=dl1.eyJr….Zm9v",
"path": "string",
"filename": "string",
"bytes": 1,
"expires_at": "2026-01-01T00:00:00.000Z"
}Errors
Errors use the standard envelope. What this operation can answer:
| Status | Type | When |
|---|---|---|
400 | invalid_request_error | A parameter or body field is missing or not allowed; param names it. |
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. |
404 | not_found_error | No such resource in this project (an ID from another project is answered the same way). |
409 | conflict_error | The resource's current state does not allow this. |
409 | conflict_error idempotency_in_progress | A request with the same Idempotency-Key is still running. |
422 | idempotency_error idempotency_key_reused | The Idempotency-Key was used with a different request. |
429 | rate_limit_error rate_limited | Too many requests; retry after retry-after seconds. |