Skip to content
Hayonix

API reference · Fine-tuning

A short-lived link to download an artefact tar without credentials

POST/v1/fine-tunes/{fine_tune_id}/download-link
API keyfine_tune_job:readProjectIdempotency-Key
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

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.
Idempotency-KeynoMakes 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_idstringrequired

    ID of the fine-tuning job

    ID with prefix ftj_

Body

JSON (application/json): FineTuneDownloadLinkRequest, optional.

  • artifactstring

    As for the download route (default: adapter for LoRA jobs)

    One ofadaptermergedweightsadapter_ggufmerged_gguf

  • checkpoint_idstring

    Default: the final checkpoint

    ID with prefix ftc_

Response

201 DownloadLink — The link

  • objectstringrequired

    Always `download_link`: the type of this object

    One ofdownload_link

  • urlstringrequired

    Absolute URL of the download; works without credentials until `expires_at`

  • pathstringrequired

    The same link relative to the API origin (`/v1/downloads?token=…`)

  • filenamestringrequired

    The name the download is saved under

  • bytesintegerrequired

    Size in bytes

  • expires_atstring (date-time)required

    When it expires (null: never) (ISO 8601, UTC)

Example response
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:

Errors
StatusTypeWhen
400invalid_request_errorA parameter or body field is missing or not allowed; param names it.
401authentication_errorThe key or session is missing, revoked or expired.
403permission_errorThe credential lacks the permission this needs, or the organization is suspended.
404not_found_errorNo such resource in this project (an ID from another project is answered the same way).
409conflict_errorThe resource's current state does not allow this.
409conflict_error idempotency_in_progressA request with the same Idempotency-Key is still running.
422idempotency_error idempotency_key_reusedThe Idempotency-Key was used with a different request.
429rate_limit_error rate_limitedToo many requests; retry after retry-after seconds.