Skip to content
Hayonix

API reference · Schema

BatchLine

  • objectstringrequired

    Always `batch_line`: the type of this object

    One ofbatch_line

  • lineintegerrequired

    Line number in the input file, from 1

  • custom_idstringrequired

    The `custom_id` the line carries

  • modelstring | nullrequired

    Model the line names (null when the line could not be read)

  • statusstringrequired

    `pending` (waiting to run, or waiting to be retried), `running`, `completed` (a response is in the output file), `failed` (an error is in the error file)

    One ofpendingrunningcompletedfailed

  • status_codeinteger | nullrequired

    HTTP status of the recorded result (null until there is one)

  • errorobject | nullrequired

    Why the line failed (null unless `status` is `failed`)

    Show 2 fields of error
    • codestringrequired

      Machine-readable reason, as in the error file

    • messagestringrequired

      One sentence for people

  • last_errorobject | nullrequired

    Why the latest attempt was put back to be retried (for example `model_unavailable` while the model has no running replica); null when none was

    Show 2 fields of last_error
    • codestringrequired

      Machine-readable reason, as in the error file

    • messagestringrequired

      One sentence for people

  • attemptsintegerrequired

    Times the request was sent; retries after a failure count

  • usageobject | nullrequired

    Tokens of the completed request (null until it completes)

    Show 3 fields of usage
    • input_tokensstringrequired

      Prompt tokens (decimal string)

    • cached_input_tokensstringrequired

      Prompt tokens served from cache (decimal string)

    • output_tokensstringrequired

      Generated tokens (decimal string)

  • coststring | nullrequired

    Charged for this line, nano-USD (null until it completes; failures cost 0)

    pattern ^-?[0-9]+$

  • started_atstring (date-time) | nullrequired

    When its current attempt started (null until it ran)

  • finished_atstring (date-time) | nullrequired

    When it completed or failed (null until then)

Example
{
  "object": "batch_line",
  "line": 1,
  "custom_id": "string",
  "model": "string",
  "status": "pending",
  "status_code": 1,
  "error": {
    "code": "string",
    "message": "string"
  },
  "last_error": {
    "code": "string",
    "message": "string"
  },
  "attempts": 1,
  "usage": {
    "input_tokens": "string",
    "cached_input_tokens": "string",
    "output_tokens": "string"
  },
  "cost": "1500000000",
  "started_at": "2026-01-01T00:00:00.000Z",
  "finished_at": "2026-01-01T00:00:00.000Z"
}

Used by