Implementation:Openai Openai node FineTuning Resource
| Knowledge Sources | |
|---|---|
| Domains | SDK, Fine-Tuning |
| Last Updated | 2026-02-15 12:00 GMT |
Overview
The FineTuning class is the top-level API resource that aggregates all fine-tuning sub-resources including jobs, methods, checkpoints, and alpha features.
Description
The FineTuning class extends APIResource and serves as a namespace that organizes the fine-tuning API surface into logically grouped sub-resources. It does not define any HTTP methods of its own; instead, it instantiates child resource classes that encapsulate the actual API endpoints.
The four sub-resources exposed are: Methods (training method type definitions for supervised, DPO, and reinforcement learning), Jobs (CRUD operations and event listing for fine-tuning jobs), Checkpoints (listing checkpoint permissions), and Alpha (experimental fine-tuning features). Each sub-resource is initialized with the shared _client instance, ensuring consistent authentication and configuration.
The module also re-exports all relevant TypeScript types from its sub-resources, including FineTuningJob, FineTuningJobEvent, DpoMethod, SupervisedMethod, ReinforcementMethod, and their corresponding hyperparameter interfaces, along with pagination page types and parameter interfaces for job creation, listing, and event retrieval.
Usage
Use this resource as the primary entry point for all fine-tuning operations. Access it via client.fineTuning and then navigate to the desired sub-resource (e.g., client.fineTuning.jobs.create() or client.fineTuning.jobs.checkpoints.list()).
Code Reference
Source Location
- Repository: openai-node
- File: src/resources/fine-tuning/fine-tuning.ts
Signature
export class FineTuning extends APIResource {
methods: MethodsAPI.Methods;
jobs: JobsAPI.Jobs;
checkpoints: CheckpointsAPI.Checkpoints;
alpha: AlphaAPI.Alpha;
}
Import
import OpenAI from 'openai';
I/O Contract
Inputs
| Name | Type | Required | Description |
|---|---|---|---|
| (none) | -- | -- | The FineTuning class has no direct methods; all inputs are routed through sub-resources (jobs, methods, checkpoints, alpha). |
Outputs
| Name | Type | Description |
|---|---|---|
| methods | Methods |
Sub-resource for training method type definitions (supervised, DPO, reinforcement). |
| jobs | Jobs |
Sub-resource providing CRUD operations for fine-tuning jobs. |
| checkpoints | Checkpoints |
Sub-resource for listing fine-tuning checkpoints. |
| alpha | Alpha |
Sub-resource for experimental alpha fine-tuning features. |
Usage Examples
import OpenAI from 'openai';
const client = new OpenAI();
// Create a fine-tuning job via the jobs sub-resource
const job = await client.fineTuning.jobs.create({
training_file: 'file-abc123',
model: 'gpt-4o-mini-2024-07-18',
});
// List fine-tuning jobs
for await (const job of client.fineTuning.jobs.list()) {
console.log(job.id);
}
// List checkpoints for a specific job
for await (const checkpoint of client.fineTuning.jobs.checkpoints.list('ft-AF1WoRqd3aJAHsqc9NY7iL8F')) {
console.log(checkpoint.fine_tuned_model_checkpoint);
}