Functions

retrieve-batch

fn (request: RetrieveBatchRequest): RetrieveBatchResponse
fn (request: RetrieveBatchRequest, opts: Map): RetrieveBatchResponse

GET /batches/{batch_id} - Retrieve the status and details of a batch.

retrieve-file

fn (request: RetrieveFileRequest): RetrieveFileResponse
fn (request: RetrieveFileRequest, opts: Map): RetrieveFileResponse

GET /files/{file_id} - Retrieve metadata about an uploaded file.

retrieve-finetuning-job

fn (request: RetrieveFineTuningJobRequest): RetrieveFineTuningJobResponse
fn (request: RetrieveFineTuningJobRequest, opts: Map): RetrieveFineTuningJobResponse

GET /fine_tuning/jobs/{fine_tuning_job_id} - Retrieve the status and details of a fine-tuning job.

retrieve-model

fn (request: RetrieveModelRequest): RetrieveModelResponse
fn (request: RetrieveModelRequest, opts: Map): RetrieveModelResponse

GET /models/{model} - Retrieve a specific model by ID.

For a more ergonomic API, see ::openai::models/get.

Example

model ::openai::retrieve/retrieve-model(RetrieveModelRequest({model: "gpt-4o"}))
model.id       // => "gpt-4o"
model.owned_by // => "system"

retrieve-vector-store-file-content

fn (request: RetrieveVectorStoreFileContentRequest): RetrieveVectorStoreFileContentResponse
fn (request: RetrieveVectorStoreFileContentRequest, opts: Map): RetrieveVectorStoreFileContentResponse

GET /vector_stores/{vector_store_id}/files/{file_id}/content - Retrieve vector store file content

Types

Batch

Batch type {
    id: Str,
    object: "batch",
    endpoint: Str,
    errors: Map?,
    input_file_id: Str,
    completion_window: Str,
    status: BatchStatus,
    output_file_id: Str?,
    error_file_id: Str?,
    created_at: Int,
    in_progress_at: Int?,
    expires_at: Int?,
    finalizing_at: Int?,
    completed_at: Int?,
    failed_at: Int?,
    expired_at: Int?,
    cancelling_at: Int?,
    cancelled_at: Int?,
    request_counts: BatchRequestCounts?,
    metadata: Metadata?
}

BatchRequestCounts

BatchRequestCounts type {
    total: Int,
    completed: Int,
    failed: Int
}

BatchStatus

BatchStatus type "validating" | "failed" | "in_progress" | "finalizing" | "completed" | "expired" | "cancelling" | "cancelled"

FineTuneDPOHyperparameters

FineTuneDPOHyperparameters type {
    beta: Any?,
    batch_size: Any?,
    learning_rate_multiplier: Any?,
    n_epochs: Any?
}

FineTuneDPOMethod

FineTuneDPOMethod type {
    hyperparameters: FineTuneDPOHyperparameters?
}

FineTuneMethod

FineTuneMethod type {
    type: FineTuneMethodType,
    supervised: FineTuneSupervisedMethod?,
    dpo: FineTuneDPOMethod?,
    reinforcement: FineTuneReinforcementMethod?
}

FineTuneMethodType

FineTuneMethodType type "supervised" | "dpo" | "reinforcement"

FineTuneReasoningEffort

FineTuneReasoningEffort type "default" | "low" | "medium" | "high"

FineTuneReinforcementHyperparameters

FineTuneReinforcementHyperparameters type {
    batch_size: Any?,
    learning_rate_multiplier: Any?,
    n_epochs: Any?,
    reasoning_effort: FineTuneReasoningEffort?,
    compute_multiplier: Any?,
    eval_interval: Any?,
    eval_samples: Any?
}

FineTuneReinforcementMethod

FineTuneReinforcementMethod type {
    grader: Map,
    hyperparameters: FineTuneReinforcementHyperparameters?
}

FineTuneSupervisedHyperparameters

FineTuneSupervisedHyperparameters type {
    batch_size: Any?,
    learning_rate_multiplier: Any?,
    n_epochs: Any?
}

FineTuneSupervisedMethod

FineTuneSupervisedMethod type {
    hyperparameters: FineTuneSupervisedHyperparameters?
}

FineTuningJob

FineTuningJob type {
    id: Str,
    created_at: Int,
    error: Map?,
    fine_tuned_model: Str?,
    finished_at: Int?,
    hyperparameters: Map,
    model: Str,
    object: "fine_tuning.job",
    organization_id: Str,
    result_files: Vec<Str>,
    status: FineTuningJobStatus,
    trained_tokens: Int?,
    training_file: Str,
    validation_file: Str?,
    integrations: Vec?,
    seed: Int,
    estimated_finish: Int?,
    method: FineTuneMethod?,
    metadata: Metadata?
}

FineTuningJobStatus

FineTuningJobStatus type "validating_files" | "queued" | "running" | "succeeded" | "failed" | "cancelled"

Metadata

Metadata type Map

Model

Model type {
    id: Str,
    created: Int,
    object: "model",
    owned_by: Str
}

OpenAIFile

OpenAIFile type {
    id: Str,
    bytes: Int,
    created_at: Int,
    expires_at: Int?,
    filename: Str,
    object: "file",
    purpose: OpenAIFilePurpose,
    status: OpenAIFileStatus,
    status_details: Str?
}

OpenAIFilePurpose

OpenAIFilePurpose type "assistants" | "assistants_output" | "batch" | "batch_output" | "fine-tune" | "fine-tune-results" | "vision" | "user_data"

OpenAIFileStatus

OpenAIFileStatus type "uploaded" | "processed" | "error"

RetrieveBatchRequest

RetrieveBatchRequest type {
    batch-id: Str
}

RetrieveBatchResponse

RetrieveBatchResponse type {
    id: Str,
    object: "batch",
    endpoint: Str,
    errors: Map?,
    input_file_id: Str,
    completion_window: Str,
    status: BatchStatus,
    output_file_id: Str?,
    error_file_id: Str?,
    created_at: Int,
    in_progress_at: Int?,
    expires_at: Int?,
    finalizing_at: Int?,
    completed_at: Int?,
    failed_at: Int?,
    expired_at: Int?,
    cancelling_at: Int?,
    cancelled_at: Int?,
    request_counts: BatchRequestCounts?,
    metadata: Metadata?
}

RetrieveFileRequest

RetrieveFileRequest type {
    file-id: Str
}

RetrieveFileResponse

RetrieveFileResponse type {
    id: Str,
    bytes: Int,
    created_at: Int,
    expires_at: Int?,
    filename: Str,
    object: "file",
    purpose: OpenAIFilePurpose,
    status: OpenAIFileStatus,
    status_details: Str?
}

RetrieveFineTuningJobRequest

RetrieveFineTuningJobRequest type {
    fine-tuning-job-id: Str
}

RetrieveFineTuningJobResponse

RetrieveFineTuningJobResponse type {
    id: Str,
    created_at: Int,
    error: Map?,
    fine_tuned_model: Str?,
    finished_at: Int?,
    hyperparameters: Map,
    model: Str,
    object: "fine_tuning.job",
    organization_id: Str,
    result_files: Vec<Str>,
    status: FineTuningJobStatus,
    trained_tokens: Int?,
    training_file: Str,
    validation_file: Str?,
    integrations: Vec?,
    seed: Int,
    estimated_finish: Int?,
    method: FineTuneMethod?,
    metadata: Metadata?
}

RetrieveModelRequest

RetrieveModelRequest type {
    model: Str
}

RetrieveModelResponse

RetrieveModelResponse type {
    id: Str,
    created: Int,
    object: "model",
    owned_by: Str
}

RetrieveVectorStoreFileContentRequest

RetrieveVectorStoreFileContentRequest type {
    vector-store-id: Str,
    file-id: Str
}

RetrieveVectorStoreFileContentResponse

RetrieveVectorStoreFileContentResponse type {
    object: "vector_store.file_content.page",
    data: Vec<Map>,
    has_more: Bool,
    next_page: Str?
}

VectorStoreFileContentResponse

VectorStoreFileContentResponse type {
    object: "vector_store.file_content.page",
    data: Vec<Map>,
    has_more: Bool,
    next_page: Str
}