Jump to content

Connect SuperML | Leeroopedia MCP: Equip your AI agents with best practices, code verification, and debugging knowledge. Powered by Leeroo — building Organizational Superintelligence. Contact us at founders@leeroo.com.

Implementation:Openai Openai node Checkpoint Permissions

From Leeroopedia
Knowledge Sources
Domains SDK, Fine_Tuning, Permissions
Last Updated 2026-02-15 12:00 GMT

Overview

The Permissions resource class provides methods for creating, retrieving, and deleting permissions on fine-tuned model checkpoints, enabling cross-project model sharing within an organization.

Description

The Permissions class extends APIResource and exposes three methods: create, retrieve, and delete. All three methods require an admin API key.

The create method sends a POST request to /fine_tuning/checkpoints/{fineTunedModelCheckpoint}/permissions to grant access to specified projects, returning a paginated list of PermissionCreateResponse objects. The retrieve method sends a GET to the same endpoint to list all existing permissions for a checkpoint, returning a PermissionRetrieveResponse with pagination support (has_more, first_id, last_id). The delete method sends a DELETE request to remove a specific permission by its ID.

Each permission object (PermissionCreateResponse) contains an id, created_at timestamp, object type (always checkpoint.permission), and project_id. The PermissionRetrieveParams interface supports pagination with after, limit, order, and filtering by project_id.

This resource enables organization owners to share fine-tuned model checkpoints across different projects within their organization, providing granular access control for fine-tuned models.

Usage

Use the Permissions resource when you need to manage access to fine-tuned model checkpoints across projects in your organization. This requires an admin API key. Access it via client.fineTuning.checkpoints.permissions.

Code Reference

Source Location

Signature

export class Permissions extends APIResource {
  create(
    fineTunedModelCheckpoint: string,
    body: PermissionCreateParams,
    options?: RequestOptions,
  ): PagePromise<PermissionCreateResponsesPage, PermissionCreateResponse>;

  retrieve(
    fineTunedModelCheckpoint: string,
    query?: PermissionRetrieveParams | null | undefined,
    options?: RequestOptions,
  ): APIPromise<PermissionRetrieveResponse>;

  delete(
    permissionID: string,
    params: PermissionDeleteParams,
    options?: RequestOptions,
  ): APIPromise<PermissionDeleteResponse>;
}

export interface PermissionCreateResponse {
  id: string;
  created_at: number;
  object: 'checkpoint.permission';
  project_id: string;
}

export interface PermissionCreateParams {
  project_ids: Array<string>;
}

export interface PermissionDeleteParams {
  fine_tuned_model_checkpoint: string;
}

Import

import OpenAI from 'openai';

I/O Contract

Inputs

create:

Name Type Required Description
fineTunedModelCheckpoint string Yes The fine-tuned model checkpoint identifier
project_ids Array<string> Yes The project identifiers to grant access to

retrieve:

Name Type Required Description
fineTunedModelCheckpoint string Yes The fine-tuned model checkpoint identifier
after string No Cursor for pagination (last permission ID from previous request)
limit number No Number of permissions to retrieve
order 'descending' No Sort order for permissions
project_id string No Filter by specific project ID

delete:

Name Type Required Description
permissionID string Yes The permission ID to delete
fine_tuned_model_checkpoint string Yes The checkpoint the permission belongs to

Outputs

Name Type Description
PermissionCreateResponse { id, created_at, object, project_id } Created permission with ID, timestamp, and project reference
PermissionRetrieveResponse { data, has_more, object, first_id?, last_id? } Paginated list of permissions for the checkpoint
PermissionDeleteResponse { id, deleted, object } Confirmation of permission deletion

Usage Examples

import OpenAI from 'openai';

const client = new OpenAI(); // requires admin API key

const checkpointId = 'ft:gpt-4o-mini-2024-07-18:org:weather:B7R9VjQd';

// Grant access to projects
for await (const permission of client.fineTuning.checkpoints.permissions.create(
  checkpointId,
  { project_ids: ['proj_abc123', 'proj_def456'] },
)) {
  console.log('Created permission:', permission.id, 'for project:', permission.project_id);
}

// List all permissions for a checkpoint
const permissions = await client.fineTuning.checkpoints.permissions.retrieve(
  checkpointId,
);
console.log('Total permissions:', permissions.data.length);
console.log('Has more:', permissions.has_more);

// Delete a specific permission
const deleted = await client.fineTuning.checkpoints.permissions.delete(
  'cp_zc4Q7MP6XxulcVzj4MZdwsAB',
  { fine_tuned_model_checkpoint: checkpointId },
);
console.log('Permission deleted:', deleted.deleted);

Related Pages

Page Connections

Double-click a node to navigate. Hold to expand connections.
Principle
Implementation
Heuristic
Environment