import { APIResource } from "../core/resource.js"; import { APIPromise } from "../core/api-promise.js"; import { type Uploadable } from "../core/uploads.js"; import { RequestOptions } from "../internal/request-options.js"; export declare class Uploads extends APIResource { /** * Initiate an upload session with specified file metadata */ create(params: UploadCreateParams, options?: RequestOptions): APIPromise; /** * Get the status of the given upload session */ get(uploadID: string, params?: UploadGetParams | null | undefined, options?: RequestOptions): APIPromise; /** * Upload a chunk of bytes to the upload session */ part(uploadID: string, params: UploadPartParams, options?: RequestOptions): APIPromise; } export interface UploadCreateResponse { /** * The unique upload session identifier to use for uploading the file */ id: string; /** * The number of bytes in the file you are uploading */ bytes: number; /** * The name of the file to upload */ filename: string; /** * The MIME type of the file. Must be one of the supported MIME type for the given * purpose. */ mime_type: 'image/jpeg' | 'image/jpg' | 'image/png' | 'image/gif' | 'image/webp' | 'image/x-icon' | 'audio/mp3' | 'audio/mpeg' | 'audio/wav' | 'audio/x-wav' | 'application/jsonl' | 'application/json' | 'text/plain' | 'video/mp4' | 'application/pdf'; /** * Intended purpose of the uploaded file. */ purpose: 'attachment' | 'ephemeral_attachment' | 'image_generation_result' | 'messages_finetune' | 'messages_eval' | 'metadata'; } export interface UploadGetResponse { /** * The unique upload session identifier to use for uploading the file */ upload_id: string; /** * This is a zero-based numeric index of byte number in which the current upload * session to be resuming upload from */ offset?: number; } export interface UploadPartResponse { /** * The unique upload session identifier to use for uploading the file */ upload_id: string; /** * The ready file identifier after the upload is complete */ file_id?: string; /** * This is a zero-based numeric index of byte number in which the current upload * session to be resuming upload from */ offset?: number; } export interface UploadCreateParams { /** * Body param: The number of bytes in the file you are uploading */ bytes: number; /** * Body param: The name of the file to upload */ filename: string; /** * Body param: The MIME type of the file. Must be one of the supported MIME type * for the given purpose. */ mime_type: 'image/jpeg' | 'image/jpg' | 'image/png' | 'image/gif' | 'image/webp' | 'image/x-icon' | 'audio/mp3' | 'audio/mpeg' | 'audio/wav' | 'audio/x-wav' | 'application/jsonl' | 'application/json' | 'text/plain' | 'video/mp4' | 'application/pdf'; /** * Body param: Intended purpose of the uploaded file. */ purpose: 'attachment' | 'ephemeral_attachment' | 'image_generation_result' | 'messages_finetune' | 'messages_eval' | 'metadata'; /** * Header param: */ 'X-API-Version'?: '1.0.0'; } export interface UploadGetParams { 'X-API-Version'?: '1.0.0'; } export interface UploadPartParams { /** * Body param: The chunk of bytes to upload */ data: Uploadable; /** * Header param: */ 'X-API-Version'?: '1.0.0'; /** * Header param: The offset of the chunk of bytes to upload for the upload session */ 'X-Upload-Offset'?: number; } export declare namespace Uploads { export { type UploadCreateResponse as UploadCreateResponse, type UploadGetResponse as UploadGetResponse, type UploadPartResponse as UploadPartResponse, type UploadCreateParams as UploadCreateParams, type UploadGetParams as UploadGetParams, type UploadPartParams as UploadPartParams, }; } //# sourceMappingURL=uploads.d.ts.map