Skip to main content
POST
Forward-backward pass

Authorizations

Authorization
string
header
default:default
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Headers

Idempotency-Key
string
required

Required key that makes retries return the original operation; use a new key for changed request bodies.

Path Parameters

session_id
string
required

Training session ID

Body

application/json
samples
object[]
required

Batch of training samples to process

loss
object
required

Loss function configuration

return_loss_fn_outputs
boolean

Return the loss function's per-sample output tensors alongside the loss and metrics. Defaults to false. Enabling it increases the response size substantially for large batches and reduces step throughput, so leave it unset for ordinary training steps.

Example:

true

forward_only
boolean

Run the forward pass only: report the loss and metrics, and the per-sample outputs when requested, without accumulating gradients. Defaults to false. Pair it with return_loss_fn_outputs to score a batch and read back its per-token log-probabilities.

Example:

true

Response

Async forward-backward pass operation

id
string
required

Operation ID

Example:

"550e8400-e29b-41d4-a716-446655440000"

status
enum<string>
default:TRAINING_OPERATION_STATUS_UNSPECIFIED
required

Operation status

Available options:
TRAINING_OPERATION_STATUS_UNSPECIFIED,
TRAINING_OPERATION_STATUS_PENDING,
TRAINING_OPERATION_STATUS_RUNNING,
TRAINING_OPERATION_STATUS_COMPLETED,
TRAINING_OPERATION_STATUS_FAILED
Example:

"TRAINING_OPERATION_STATUS_PENDING"

output
object

Result on success

error
object

Error details on failure