> ## Documentation Index
> Fetch the complete documentation index at: https://docs.fastino.ai/llms.txt
> Use this file to discover all available pages before exploring further.

> ## Agent Instructions
> Use https://docs.fastino.ai/llms.txt to discover and navigate pages. Use https://docs.fastino.ai/llms-full.txt when you need the complete documentation corpus. Use https://docs.fastino.ai/openapi.json as the source of truth for customer-facing routes. For GLiDE decision inference, call POST https://api.fastino.ai/v1/systemone with model fastino/GLiDE. Start managed training (config job) with POST /v1/training/jobs using base_model. For interactive training, native JSON clients use the public operations under /v1/training/jobs and /v1/training/usage. Existing Tinker clients use tinker==0.32.0 with TINKER_BASE_URL=https://api.fastino.ai/v1/training/compat/tinker and TINKER_CREDENTIAL_CMD. Compatibility child routes are private and absent from OpenAPI. Auto Train is private access and has no public route; direct interested users to sales@fastino.ai. Do not infer undocumented routes. Read API keys from FASTINO_API_KEY and never embed credentials in code, logs, or reports.

# Sample from an interactive job

> Generate continuations of a tokenized prompt from a sampler checkpoint and read tokens from the completed future's result.sequences, even after the job stops.

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

Pass a sampler checkpoint name for one of the job's `sampler` checkpoints to
generate continuations of a tokenized prompt.
Sampling remains available after the interactive job is stopped.
Read the generated tokens from the completed future's `result.sequences`.

## Request

**X-API-Key** `string` *required*

Your Fastino API key.

**job\_id** `string` *required*

Interactive job ID.

**checkpoint** `string` *required*

The name of a sampler checkpoint saved by this job, or its
`tinker://<job_id>/sampler_weights/<name>` path.

**prompt\_tokens** `integer[]` *required*

Prompt token IDs from the base model's tokenizer. At least one token.

**num\_samples** `integer` (default: 1)

Number of continuations, from `1` through `512`.

**sampling\_params** `object`

Decoding settings.

**properties**

**max\_tokens** `integer` (default: 1024)

Maximum generated tokens. Prompt plus `max_tokens` must fit the model's
sampling limit. Qwen can sample up to `65,536` tokens, although each Qwen
training datum is limited to `32,768` tokens.

**temperature** `number` (default: 1.0)

Sampling temperature.

**top\_p** `number` (default: 1.0)

Nucleus-sampling probability mass.

**top\_k** `integer` (default: -1)

Top-k cutoff. `-1` disables it.

**stop** `string | string[] | integer[]`

Stop strings or stop token IDs.

**seed** `integer`

Sampling seed.

**prompt\_logprobs** `boolean` (default: false)

Also return the log probability of each prompt token.

**topk\_prompt\_logprobs** `integer` (default: 0)

Return the top-k alternatives at each prompt position.

**topk\_sample\_logprobs** `integer` (default: 0)

Return the top-k alternatives at each generated position.

The numeric prompt-token array below is an illustrative placeholder. Tokenize
your actual prompt with the tokenizer for the job's `base_model`.

> [!NOTE]
>
> A team can have at most `2,048` sampling requests in flight. The API returns
> `429` when that limit is reached; wait for existing sample futures to finish
> before retrying.

```bash cURL theme={null}
curl -X POST "https://api.fastino.ai/v1/training/jobs/$TRAINING_JOB_ID/sample" \
  -H "X-API-Key: $FASTINO_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "checkpoint": "step-000100",
    "prompt_tokens": [151644, 872, 198, 3838],
    "num_samples": 2,
    "sampling_params": {"max_tokens": 64, "temperature": 0.7}
  }'
```

## Response

```json Response theme={null}
{
  "future_id": "FUTURE_ID",
  "job_id": "SESSION_ID:train:0",
  "type": "sample"
}
```

Each sequence in the completed result has `tokens`, `logprobs`, `stop_reason`
(`stop` or `length`), and `topk_logprobs`. Decode `tokens` with the same
tokenizer. Cancel an unfinished sample with
[`POST /v1/training/jobs/{job_id}/futures/{future_id}/cancel`](https://docs.fastino.ai/api-reference/training-jobs/interactive/cancel-future).

| Status | Meaning |
| - | - |
| `400` | `checkpoint` is invalid, another job's checkpoint, or a state checkpoint, the prompt is too long, or the job is a GLiDE job, which doesn't generate (use `forward` for its option probabilities). |
| `402` | The team is out of credits or has no valid payment setup. |
| `404` | The job or checkpoint doesn't exist, or the job belongs to another team. |
| `429` | The team already has `2,048` sampling requests in flight. Wait for existing sample futures before retrying. |
| `422` | `checkpoint` or `prompt_tokens` is missing, or the body has an unknown field. |


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.