---
title: "Sample from an interactive training job"
method: POST
path: "/v1/training/jobs/{job_id}/sample"
tags: ["training"]
---

# Sample from an interactive training job

`POST /v1/training/jobs/{job_id}/sample`

## Request

- Base URL: `https://api.fastino.ai`
- URL: `https://api.fastino.ai/v1/training/jobs/{job_id}/sample`
- Auth: one of:
  - API key in header `X-API-Key`
  - HTTP bearer
- TypeScript: <https://skmtc.dev/fastino-ai/apis/pioneer-inference-api/docs/v1/training/jobs/:job_id/sample/post.ts> (a function with typed inputs; its response is checked against the schema)

Generate continuations of a tokenized prompt with one of the job's sampler checkpoints, also after the job stopped (Tinker's `sample`). Read the result at GET /v1/training/jobs/{job_id}/futures/{future_id}.

## Path parameters

- `job_id` string, required

## Headers

- `Idempotency-Key` string, nullable: Client-generated key (a UUID is ideal; it must be URL-safe to look it up) that makes the call safe to send again after a lost response. A repeat with the same key and body from the same caller returns the first call's answer (the same job and future) without running or billing it again, or a 409 while the first call still runs; the same key with another route, job, body or caller is a 422. Look a key up with GET /v1/training/operations/{idempotency_key}.

## Request body

- SampleBody: ``POST .../sample``: continuations of one tokenized prompt from one of the job's sampler checkpoints.
  - `checkpoint` string, required: The sampler checkpoint's name, or its `tinker://<job_id>/sampler_weights/<name>` path (this job's own).
  - `num_samples` integer
  - `prompt_logprobs` boolean
  - `prompt_tokens` integer[], required
  - `sampling_params` SamplingParams: Decoding parameters.
    - `max_tokens` integer, nullable
    - `seed` integer, nullable
    - `stop` union
      - string
      - string[]
      - integer[]
    - `temperature` number
    - `top_k` integer
    - `top_p` number
  - `topk_prompt_logprobs` integer
  - `topk_sample_logprobs` integer

## Response `200`

Successful Response

- FutureAccepted: A queued call: read its result at ``GET /v1/training/jobs/{job_id}/futures/{future_id}``.
  - `future_id` string, required
  - `job_id` string, required
  - `type` string, required: The call: create, load, forward, forward_backward, optim_step, save, sample.

## Other responses

- `422`: Validation Error

## Changes

- **2026-10-17** `81465e18c1d2`: 1 info
  - added the new optional `header` request parameter `Idempotency-Key`
- **2026-10-15** `eef86c1497c1`: 1 info
  - endpoint added

[Operation history](https://skmtc.dev/fastino-ai/apis/pioneer-inference-api/changes/v1/training/jobs/:job_id/sample/post.md)

---

[API](https://skmtc.dev/fastino-ai/apis/pioneer-inference-api.md) - [All operations](https://skmtc.dev/fastino-ai/apis/pioneer-inference-api/llms.txt) - [OpenAPI document](https://skmtc.dev/fastino-ai/apis/pioneer-inference-api/revisions/81465e18c1d2?raw)
