heymegabyte/agent-skills / skills/openai
openai
VerifiedOpenAI API API skill — auto-forged from OpenAPI 2.3.0. The OpenAI REST API. Please see https://platform.openai.com/docs/api-reference for more details.
client.ts
View on GitHub// Auto-generated by forge-skill-from-openapi
// API: openai
// DO NOT EDIT — re-run forge to regenerate
import type * as T from './types.js';
function appendQuery(url: string, query?: Record<string, string>): string {
if (!query || Object.keys(query).length === 0) return url;
const qs = new URLSearchParams(query).toString();
return url.includes('?') ? `${url}&${qs}` : `${url}?${qs}`;
}
export class OpenaiClient {
constructor(
private readonly apiToken: string,
private readonly baseUrl: string = 'https://api.openai.com/v1',
) {}
private async request<T>(method: string, url: string, body?: string): Promise<T> {
const res = await fetch(url, {
method,
headers: {
'Authorization': `Bearer ${this.apiToken}`,
'Content-Type': 'application/json',
'Accept': 'application/json',
},
body,
});
if (!res.ok) {
const text = await res.text().catch(() => '');
throw new Error(`${method} ${url} → ${res.status}: ${text}`);
}
if (res.status === 204) return undefined as T;
return res.json() as T;
}
async listAssistants(query?: Record<string, string>): Promise<listAssistantsResponse> {
return this.request('GET', appendQuery(`https://api.openai.com/v1/assistants`, query));
},
async createAssistant(body?: createAssistantBody): Promise<createAssistantResponse> {
return this.request('POST', `https://api.openai.com/v1/assistants`, body ? JSON.stringify(body) : undefined);
},
async getAssistant(assistant_id: string): Promise<getAssistantResponse> {
return this.request('GET', `https://api.openai.com/v1/assistants/${assistant_id}`);
},
async modifyAssistant(assistant_id: string, body?: modifyAssistantBody): Promise<modifyAssistantResponse> {
return this.request('POST', `https://api.openai.com/v1/assistants/${assistant_id}`, body ? JSON.stringify(body) : undefined);
},
async deleteAssistant(assistant_id: string): Promise<deleteAssistantResponse> {
return this.request('DELETE', `https://api.openai.com/v1/assistants/${assistant_id}`);
},
async createSpeech(body?: createSpeechBody): Promise<createSpeechResponse> {
return this.request('POST', `https://api.openai.com/v1/audio/speech`, body ? JSON.stringify(body) : undefined);
},
async createTranscription(body?: createTranscriptionBody): Promise<createTranscriptionResponse> {
return this.request('POST', `https://api.openai.com/v1/audio/transcriptions`, body ? JSON.stringify(body) : undefined);
},
async createTranslation(body?: createTranslationBody): Promise<createTranslationResponse> {
return this.request('POST', `https://api.openai.com/v1/audio/translations`, body ? JSON.stringify(body) : undefined);
},
async listVoiceConsents(query?: Record<string, string>): Promise<listVoiceConsentsResponse> {
return this.request('GET', appendQuery(`https://api.openai.com/v1/audio/voice_consents`, query));
},
async createVoiceConsent(body?: createVoiceConsentBody): Promise<createVoiceConsentResponse> {
return this.request('POST', `https://api.openai.com/v1/audio/voice_consents`, body ? JSON.stringify(body) : undefined);
},
async getVoiceConsent(consent_id: string): Promise<getVoiceConsentResponse> {
return this.request('GET', `https://api.openai.com/v1/audio/voice_consents/${consent_id}`);
},
async updateVoiceConsent(consent_id: string, body?: updateVoiceConsentBody): Promise<updateVoiceConsentResponse> {
return this.request('POST', `https://api.openai.com/v1/audio/voice_consents/${consent_id}`, body ? JSON.stringify(body) : undefined);
},
async deleteVoiceConsent(consent_id: string): Promise<deleteVoiceConsentResponse> {
return this.request('DELETE', `https://api.openai.com/v1/audio/voice_consents/${consent_id}`);
},
async createVoice(body?: createVoiceBody): Promise<createVoiceResponse> {
return this.request('POST', `https://api.openai.com/v1/audio/voices`, body ? JSON.stringify(body) : undefined);
},
async listBatches(query?: Record<string, string>): Promise<listBatchesResponse> {
return this.request('GET', appendQuery(`https://api.openai.com/v1/batches`, query));
},
async createBatch(body?: createBatchBody): Promise<createBatchResponse> {
return this.request('POST', `https://api.openai.com/v1/batches`, body ? JSON.stringify(body) : undefined);
},
async retrieveBatch(batch_id: string): Promise<retrieveBatchResponse> {
return this.request('GET', `https://api.openai.com/v1/batches/${batch_id}`);
},
async cancelBatch(batch_id: string, body?: Record<string, unknown>): Promise<cancelBatchResponse> {
return this.request('POST', `https://api.openai.com/v1/batches/${batch_id}/cancel`, body ? JSON.stringify(body) : undefined);
},
async listChatCompletions(query?: Record<string, string>): Promise<listChatCompletionsResponse> {
return this.request('GET', appendQuery(`https://api.openai.com/v1/chat/completions`, query));
},
async createChatCompletion(body?: createChatCompletionBody): Promise<createChatCompletionResponse> {
return this.request('POST', `https://api.openai.com/v1/chat/completions`, body ? JSON.stringify(body) : undefined);
},
async getChatCompletion(completion_id: string): Promise<getChatCompletionResponse> {
return this.request('GET', `https://api.openai.com/v1/chat/completions/${completion_id}`);
},
async updateChatCompletion(completion_id: string, body?: updateChatCompletionBody): Promise<updateChatCompletionResponse> {
return this.request('POST', `https://api.openai.com/v1/chat/completions/${completion_id}`, body ? JSON.stringify(body) : undefined);
},
async deleteChatCompletion(completion_id: string): Promise<deleteChatCompletionResponse> {
return this.request('DELETE', `https://api.openai.com/v1/chat/completions/${completion_id}`);
},
async getChatCompletionMessages(completion_id: string, query?: Record<string, string>): Promise<getChatCompletionMessagesResponse> {
return this.request('GET', appendQuery(`https://api.openai.com/v1/chat/completions/${completion_id}/messages`, query));
},
async createCompletion(body?: createCompletionBody): Promise<createCompletionResponse> {
return this.request('POST', `https://api.openai.com/v1/completions`, body ? JSON.stringify(body) : undefined);
},
async ListContainers(query?: Record<string, string>): Promise<ListContainersResponse> {
return this.request('GET', appendQuery(`https://api.openai.com/v1/containers`, query));
},
async CreateContainer(body?: CreateContainerBody): Promise<CreateContainerResponse> {
return this.request('POST', `https://api.openai.com/v1/containers`, body ? JSON.stringify(body) : undefined);
},
async RetrieveContainer(container_id: string): Promise<RetrieveContainerResponse> {
return this.request('GET', `https://api.openai.com/v1/containers/${container_id}`);
},
async DeleteContainer(container_id: string): Promise<DeleteContainerResponse> {
return this.request('DELETE', `https://api.openai.com/v1/containers/${container_id}`);
},
async ListContainerFiles(container_id: string, query?: Record<string, string>): Promise<ListContainerFilesResponse> {
return this.request('GET', appendQuery(`https://api.openai.com/v1/containers/${container_id}/files`, query));
},
async CreateContainerFile(container_id: string, body?: CreateContainerFileBody): Promise<CreateContainerFileResponse> {
return this.request('POST', `https://api.openai.com/v1/containers/${container_id}/files`, body ? JSON.stringify(body) : undefined);
},
async RetrieveContainerFile(container_id: string, file_id: string): Promise<RetrieveContainerFileResponse> {
return this.request('GET', `https://api.openai.com/v1/containers/${container_id}/files/${file_id}`);
},
async DeleteContainerFile(container_id: string, file_id: string): Promise<DeleteContainerFileResponse> {
return this.request('DELETE', `https://api.openai.com/v1/containers/${container_id}/files/${file_id}`);
},
async RetrieveContainerFileContent(container_id: string, file_id: string): Promise<RetrieveContainerFileContentResponse> {
return this.request('GET', `https://api.openai.com/v1/containers/${container_id}/files/${file_id}/content`);
},
async listConversationItems(conversation_id: string, query?: Record<string, string>): Promise<listConversationItemsResponse> {
return this.request('GET', appendQuery(`https://api.openai.com/v1/conversations/${conversation_id}/items`, query));
},
async createConversationItems(conversation_id: string, query?: Record<string, string>, body?: createConversationItemsBody): Promise<createConversationItemsResponse> {
return this.request('POST', appendQuery(`https://api.openai.com/v1/conversations/${conversation_id}/items`, query), body ? JSON.stringify(body) : undefined);
},
async getConversationItem(conversation_id: string, item_id: string, query?: Record<string, string>): Promise<getConversationItemResponse> {
return this.request('GET', appendQuery(`https://api.openai.com/v1/conversations/${conversation_id}/items/${item_id}`, query));
},
async deleteConversationItem(conversation_id: string, item_id: string): Promise<deleteConversationItemResponse> {
return this.request('DELETE', `https://api.openai.com/v1/conversations/${conversation_id}/items/${item_id}`);
},
async createEmbedding(body?: createEmbeddingBody): Promise<createEmbeddingResponse> {
return this.request('POST', `https://api.openai.com/v1/embeddings`, body ? JSON.stringify(body) : undefined);
},
async listEvals(query?: Record<string, string>): Promise<listEvalsResponse> {
return this.request('GET', appendQuery(`https://api.openai.com/v1/evals`, query));
},
async createEval(body?: createEvalBody): Promise<createEvalResponse> {
return this.request('POST', `https://api.openai.com/v1/evals`, body ? JSON.stringify(body) : undefined);
},
async getEval(eval_id: string): Promise<getEvalResponse> {
return this.request('GET', `https://api.openai.com/v1/evals/${eval_id}`);
},
async updateEval(eval_id: string, body?: updateEvalBody): Promise<updateEvalResponse> {
return this.request('POST', `https://api.openai.com/v1/evals/${eval_id}`, body ? JSON.stringify(body) : undefined);
},
async deleteEval(eval_id: string): Promise<deleteEvalResponse> {
return this.request('DELETE', `https://api.openai.com/v1/evals/${eval_id}`);
},
async getEvalRuns(eval_id: string, query?: Record<string, string>): Promise<getEvalRunsResponse> {
return this.request('GET', appendQuery(`https://api.openai.com/v1/evals/${eval_id}/runs`, query));
},
async createEvalRun(eval_id: string, body?: createEvalRunBody): Promise<createEvalRunResponse> {
return this.request('POST', `https://api.openai.com/v1/evals/${eval_id}/runs`, body ? JSON.stringify(body) : undefined);
},
async getEvalRun(eval_id: string, run_id: string): Promise<getEvalRunResponse> {
return this.request('GET', `https://api.openai.com/v1/evals/${eval_id}/runs/${run_id}`);
},
async cancelEvalRun(eval_id: string, run_id: string, body?: Record<string, unknown>): Promise<cancelEvalRunResponse> {
return this.request('POST', `https://api.openai.com/v1/evals/${eval_id}/runs/${run_id}`, body ? JSON.stringify(body) : undefined);
},
async deleteEvalRun(eval_id: string, run_id: string): Promise<deleteEvalRunResponse> {
return this.request('DELETE', `https://api.openai.com/v1/evals/${eval_id}/runs/${run_id}`);
},
async getEvalRunOutputItems(eval_id: string, run_id: string, query?: Record<string, string>): Promise<getEvalRunOutputItemsResponse> {
return this.request('GET', appendQuery(`https://api.openai.com/v1/evals/${eval_id}/runs/${run_id}/output_items`, query));
},
async getEvalRunOutputItem(eval_id: string, run_id: string, output_item_id: string): Promise<getEvalRunOutputItemResponse> {
return this.request('GET', `https://api.openai.com/v1/evals/${eval_id}/runs/${run_id}/output_items/${output_item_id}`);
},
async listFiles(query?: Record<string, string>): Promise<listFilesResponse> {
return this.request('GET', appendQuery(`https://api.openai.com/v1/files`, query));
},
async createFile(body?: createFileBody): Promise<createFileResponse> {
return this.request('POST', `https://api.openai.com/v1/files`, body ? JSON.stringify(body) : undefined);
},
async retrieveFile(file_id: string): Promise<retrieveFileResponse> {
return this.request('GET', `https://api.openai.com/v1/files/${file_id}`);
},
async deleteFile(file_id: string): Promise<deleteFileResponse> {
return this.request('DELETE', `https://api.openai.com/v1/files/${file_id}`);
},
async downloadFile(file_id: string): Promise<downloadFileResponse> {
return this.request('GET', `https://api.openai.com/v1/files/${file_id}/content`);
},
async runGrader(body?: runGraderBody): Promise<runGraderResponse> {
return this.request('POST', `https://api.openai.com/v1/fine_tuning/alpha/graders/run`, body ? JSON.stringify(body) : undefined);
},
async validateGrader(body?: validateGraderBody): Promise<validateGraderResponse> {
return this.request('POST', `https://api.openai.com/v1/fine_tuning/alpha/graders/validate`, body ? JSON.stringify(body) : undefined);
},
async listFineTuningCheckpointPermissions(fine_tuned_model_checkpoint: string, query?: Record<string, string>): Promise<listFineTuningCheckpointPermissionsResponse> {
return this.request('GET', appendQuery(`https://api.openai.com/v1/fine_tuning/checkpoints/${fine_tuned_model_checkpoint}/permissions`, query));
},
async createFineTuningCheckpointPermission(fine_tuned_model_checkpoint: string, body?: createFineTuningCheckpointPermissionBody): Promise<createFineTuningCheckpointPermissionResponse> {
return this.request('POST', `https://api.openai.com/v1/fine_tuning/checkpoints/${fine_tuned_model_checkpoint}/permissions`, body ? JSON.stringify(body) : undefined);
},
async deleteFineTuningCheckpointPermission(fine_tuned_model_checkpoint: string, permission_id: string): Promise<deleteFineTuningCheckpointPermissionResponse> {
return this.request('DELETE', `https://api.openai.com/v1/fine_tuning/checkpoints/${fine_tuned_model_checkpoint}/permissions/${permission_id}`);
},
async listPaginatedFineTuningJobs(query?: Record<string, string>): Promise<listPaginatedFineTuningJobsResponse> {
return this.request('GET', appendQuery(`https://api.openai.com/v1/fine_tuning/jobs`, query));
},
async createFineTuningJob(body?: createFineTuningJobBody): Promise<createFineTuningJobResponse> {
return this.request('POST', `https://api.openai.com/v1/fine_tuning/jobs`, body ? JSON.stringify(body) : undefined);
},
async retrieveFineTuningJob(fine_tuning_job_id: string): Promise<retrieveFineTuningJobResponse> {
return this.request('GET', `https://api.openai.com/v1/fine_tuning/jobs/${fine_tuning_job_id}`);
},
async cancelFineTuningJob(fine_tuning_job_id: string, body?: Record<string, unknown>): Promise<cancelFineTuningJobResponse> {
return this.request('POST', `https://api.openai.com/v1/fine_tuning/jobs/${fine_tuning_job_id}/cancel`, body ? JSON.stringify(body) : undefined);
},
async listFineTuningJobCheckpoints(fine_tuning_job_id: string, query?: Record<string, string>): Promise<listFineTuningJobCheckpointsResponse> {
return this.request('GET', appendQuery(`https://api.openai.com/v1/fine_tuning/jobs/${fine_tuning_job_id}/checkpoints`, query));
},
async listFineTuningEvents(fine_tuning_job_id: string, query?: Record<string, string>): Promise<listFineTuningEventsResponse> {
return this.request('GET', appendQuery(`https://api.openai.com/v1/fine_tuning/jobs/${fine_tuning_job_id}/events`, query));
},
async pauseFineTuningJob(fine_tuning_job_id: string, body?: Record<string, unknown>): Promise<pauseFineTuningJobResponse> {
return this.request('POST', `https://api.openai.com/v1/fine_tuning/jobs/${fine_tuning_job_id}/pause`, body ? JSON.stringify(body) : undefined);
},
async resumeFineTuningJob(fine_tuning_job_id: string, body?: Record<string, unknown>): Promise<resumeFineTuningJobResponse> {
return this.request('POST', `https://api.openai.com/v1/fine_tuning/jobs/${fine_tuning_job_id}/resume`, body ? JSON.stringify(body) : undefined);
},
async createImageEdit(body?: createImageEditBody): Promise<createImageEditResponse> {
return this.request('POST', `https://api.openai.com/v1/images/edits`, body ? JSON.stringify(body) : undefined);
},
async createImage(body?: createImageBody): Promise<createImageResponse> {
return this.request('POST', `https://api.openai.com/v1/images/generations`, body ? JSON.stringify(body) : undefined);
},
async createImageVariation(body?: createImageVariationBody): Promise<createImageVariationResponse> {
return this.request('POST', `https://api.openai.com/v1/images/variations`, body ? JSON.stringify(body) : undefined);
},
async listModels(): Promise<listModelsResponse> {
return this.request('GET', `https://api.openai.com/v1/models`);
},
async retrieveModel(model: string): Promise<retrieveModelResponse> {
return this.request('GET', `https://api.openai.com/v1/models/${model}`);
},
async deleteModel(model: string): Promise<deleteModelResponse> {
return this.request('DELETE', `https://api.openai.com/v1/models/${model}`);
},
async createModeration(body?: createModerationBody): Promise<createModerationResponse> {
return this.request('POST', `https://api.openai.com/v1/moderations`, body ? JSON.stringify(body) : undefined);
},
async admin-api-keys-list(query?: Record<string, string>): Promise<admin-api-keys-listResponse> {
return this.request('GET', appendQuery(`https://api.openai.com/v1/organization/admin_api_keys`, query));
},
async admin-api-keys-create(body?: admin-api-keys-createBody): Promise<admin-api-keys-createResponse> {
return this.request('POST', `https://api.openai.com/v1/organization/admin_api_keys`, body ? JSON.stringify(body) : undefined);
},
async admin-api-keys-get(key_id: string): Promise<admin-api-keys-getResponse> {
return this.request('GET', `https://api.openai.com/v1/organization/admin_api_keys/${key_id}`);
},
async admin-api-keys-delete(key_id: string): Promise<admin-api-keys-deleteResponse> {
return this.request('DELETE', `https://api.openai.com/v1/organization/admin_api_keys/${key_id}`);
},
async list-audit-logs(query?: Record<string, string>): Promise<list-audit-logsResponse> {
return this.request('GET', appendQuery(`https://api.openai.com/v1/organization/audit_logs`, query));
},
async listOrganizationCertificates(query?: Record<string, string>): Promise<listOrganizationCertificatesResponse> {
return this.request('GET', appendQuery(`https://api.openai.com/v1/organization/certificates`, query));
},
async uploadCertificate(body?: uploadCertificateBody): Promise<uploadCertificateResponse> {
return this.request('POST', `https://api.openai.com/v1/organization/certificates`, body ? JSON.stringify(body) : undefined);
},
async activateOrganizationCertificates(body?: activateOrganizationCertificatesBody): Promise<activateOrganizationCertificatesResponse> {
return this.request('POST', `https://api.openai.com/v1/organization/certificates/activate`, body ? JSON.stringify(body) : undefined);
},
async deactivateOrganizationCertificates(body?: deactivateOrganizationCertificatesBody): Promise<deactivateOrganizationCertificatesResponse> {
return this.request('POST', `https://api.openai.com/v1/organization/certificates/deactivate`, body ? JSON.stringify(body) : undefined);
},
async getCertificate(certificate_id: string, query?: Record<string, string>): Promise<getCertificateResponse> {
return this.request('GET', appendQuery(`https://api.openai.com/v1/organization/certificates/${certificate_id}`, query));
},
async modifyCertificate(certificate_id: string, body?: modifyCertificateBody): Promise<modifyCertificateResponse> {
return this.request('POST', `https://api.openai.com/v1/organization/certificates/${certificate_id}`, body ? JSON.stringify(body) : undefined);
},
async deleteCertificate(certificate_id: string): Promise<deleteCertificateResponse> {
return this.request('DELETE', `https://api.openai.com/v1/organization/certificates/${certificate_id}`);
},
async usage-costs(query?: Record<string, string>): Promise<usage-costsResponse> {
return this.request('GET', appendQuery(`https://api.openai.com/v1/organization/costs`, query));
},
async list-groups(query?: Record<string, string>): Promise<list-groupsResponse> {
return this.request('GET', appendQuery(`https://api.openai.com/v1/organization/groups`, query));
},
async create-group(body?: create-groupBody): Promise<create-groupResponse> {
return this.request('POST', `https://api.openai.com/v1/organization/groups`, body ? JSON.stringify(body) : undefined);
},
async update-group(group_id: string, body?: update-groupBody): Promise<update-groupResponse> {
return this.request('POST', `https://api.openai.com/v1/organization/groups/${group_id}`, body ? JSON.stringify(body) : undefined);
},
async delete-group(group_id: string): Promise<delete-groupResponse> {
return this.request('DELETE', `https://api.openai.com/v1/organization/groups/${group_id}`);
},
async list-group-role-assignments(group_id: string, query?: Record<string, string>): Promise<list-group-role-assignmentsResponse> {
return this.request('GET', appendQuery(`https://api.openai.com/v1/organization/groups/${group_id}/roles`, query));
},
async assign-group-role(group_id: string, body?: assign-group-roleBody): Promise<assign-group-roleResponse> {
return this.request('POST', `https://api.openai.com/v1/organization/groups/${group_id}/roles`, body ? JSON.stringify(body) : undefined);
},
async unassign-group-role(group_id: string, role_id: string): Promise<unassign-group-roleResponse> {
return this.request('DELETE', `https://api.openai.com/v1/organization/groups/${group_id}/roles/${role_id}`);
},
async list-group-users(group_id: string, query?: Record<string, string>): Promise<list-group-usersResponse> {
return this.request('GET', appendQuery(`https://api.openai.com/v1/organization/groups/${group_id}/users`, query));
},
async add-group-user(group_id: string, body?: add-group-userBody): Promise<add-group-userResponse> {
return this.request('POST', `https://api.openai.com/v1/organization/groups/${group_id}/users`, body ? JSON.stringify(body) : undefined);
},
async remove-group-user(group_id: string, user_id: string): Promise<remove-group-userResponse> {
return this.request('DELETE', `https://api.openai.com/v1/organization/groups/${group_id}/users/${user_id}`);
},
async list-invites(query?: Record<string, string>): Promise<list-invitesResponse> {
return this.request('GET', appendQuery(`https://api.openai.com/v1/organization/invites`, query));
},
async inviteUser(body?: inviteUserBody): Promise<inviteUserResponse> {
return this.request('POST', `https://api.openai.com/v1/organization/invites`, body ? JSON.stringify(body) : undefined);
},
async retrieve-invite(invite_id: string): Promise<retrieve-inviteResponse> {
return this.request('GET', `https://api.openai.com/v1/organization/invites/${invite_id}`);
},
async delete-invite(invite_id: string): Promise<delete-inviteResponse> {
return this.request('DELETE', `https://api.openai.com/v1/organization/invites/${invite_id}`);
},
async list-projects(query?: Record<string, string>): Promise<list-projectsResponse> {
return this.request('GET', appendQuery(`https://api.openai.com/v1/organization/projects`, query));
},
async create-project(body?: create-projectBody): Promise<create-projectResponse> {
return this.request('POST', `https://api.openai.com/v1/organization/projects`, body ? JSON.stringify(body) : undefined);
},
async retrieve-project(project_id: string): Promise<retrieve-projectResponse> {
return this.request('GET', `https://api.openai.com/v1/organization/projects/${project_id}`);
},
async modify-project(project_id: string, body?: modify-projectBody): Promise<modify-projectResponse> {
return this.request('POST', `https://api.openai.com/v1/organization/projects/${project_id}`, body ? JSON.stringify(body) : undefined);
},
async list-project-api-keys(project_id: string, query?: Record<string, string>): Promise<list-project-api-keysResponse> {
return this.request('GET', appendQuery(`https://api.openai.com/v1/organization/projects/${project_id}/api_keys`, query));
},
async retrieve-project-api-key(project_id: string, api_key_id: string): Promise<retrieve-project-api-keyResponse> {
return this.request('GET', `https://api.openai.com/v1/organization/projects/${project_id}/api_keys/${api_key_id}`);
},
async delete-project-api-key(project_id: string, api_key_id: string): Promise<delete-project-api-keyResponse> {
return this.request('DELETE', `https://api.openai.com/v1/organization/projects/${project_id}/api_keys/${api_key_id}`);
},
async archive-project(project_id: string, body?: Record<string, unknown>): Promise<archive-projectResponse> {
return this.request('POST', `https://api.openai.com/v1/organization/projects/${project_id}/archive`, body ? JSON.stringify(body) : undefined);
},
async listProjectCertificates(project_id: string, query?: Record<string, string>): Promise<listProjectCertificatesResponse> {
return this.request('GET', appendQuery(`https://api.openai.com/v1/organization/projects/${project_id}/certificates`, query));
},
async activateProjectCertificates(project_id: string, body?: activateProjectCertificatesBody): Promise<activateProjectCertificatesResponse> {
return this.request('POST', `https://api.openai.com/v1/organization/projects/${project_id}/certificates/activate`, body ? JSON.stringify(body) : undefined);
},
async deactivateProjectCertificates(project_id: string, body?: deactivateProjectCertificatesBody): Promise<deactivateProjectCertificatesResponse> {
return this.request('POST', `https://api.openai.com/v1/organization/projects/${project_id}/certificates/deactivate`, body ? JSON.stringify(body) : undefined);
},
async list-project-groups(project_id: string, query?: Record<string, string>): Promise<list-project-groupsResponse> {
return this.request('GET', appendQuery(`https://api.openai.com/v1/organization/projects/${project_id}/groups`, query));
},
async add-project-group(project_id: string, body?: add-project-groupBody): Promise<add-project-groupResponse> {
return this.request('POST', `https://api.openai.com/v1/organization/projects/${project_id}/groups`, body ? JSON.stringify(body) : undefined);
},
async remove-project-group(project_id: string, group_id: string): Promise<remove-project-groupResponse> {
return this.request('DELETE', `https://api.openai.com/v1/organization/projects/${project_id}/groups/${group_id}`);
},
async list-project-rate-limits(project_id: string, query?: Record<string, string>): Promise<list-project-rate-limitsResponse> {
return this.request('GET', appendQuery(`https://api.openai.com/v1/organization/projects/${project_id}/rate_limits`, query));
},
async update-project-rate-limits(project_id: string, rate_limit_id: string, body?: update-project-rate-limitsBody): Promise<update-project-rate-limitsResponse> {
return this.request('POST', `https://api.openai.com/v1/organization/projects/${project_id}/rate_limits/${rate_limit_id}`, body ? JSON.stringify(body) : undefined);
},
async list-project-service-accounts(project_id: string, query?: Record<string, string>): Promise<list-project-service-accountsResponse> {
return this.request('GET', appendQuery(`https://api.openai.com/v1/organization/projects/${project_id}/service_accounts`, query));
},
async create-project-service-account(project_id: string, body?: create-project-service-accountBody): Promise<create-project-service-accountResponse> {
return this.request('POST', `https://api.openai.com/v1/organization/projects/${project_id}/service_accounts`, body ? JSON.stringify(body) : undefined);
},
async retrieve-project-service-account(project_id: string, service_account_id: string): Promise<retrieve-project-service-accountResponse> {
return this.request('GET', `https://api.openai.com/v1/organization/projects/${project_id}/service_accounts/${service_account_id}`);
},
async delete-project-service-account(project_id: string, service_account_id: string): Promise<delete-project-service-accountResponse> {
return this.request('DELETE', `https://api.openai.com/v1/organization/projects/${project_id}/service_accounts/${service_account_id}`);
},
async list-project-users(project_id: string, query?: Record<string, string>): Promise<list-project-usersResponse> {
return this.request('GET', appendQuery(`https://api.openai.com/v1/organization/projects/${project_id}/users`, query));
},
async create-project-user(project_id: string, body?: create-project-userBody): Promise<create-project-userResponse> {
return this.request('POST', `https://api.openai.com/v1/organization/projects/${project_id}/users`, body ? JSON.stringify(body) : undefined);
},
async retrieve-project-user(project_id: string, user_id: string): Promise<retrieve-project-userResponse> {
return this.request('GET', `https://api.openai.com/v1/organization/projects/${project_id}/users/${user_id}`);
},
async modify-project-user(project_id: string, user_id: string, body?: modify-project-userBody): Promise<modify-project-userResponse> {
return this.request('POST', `https://api.openai.com/v1/organization/projects/${project_id}/users/${user_id}`, body ? JSON.stringify(body) : undefined);
},
async delete-project-user(project_id: string, user_id: string): Promise<delete-project-userResponse> {
return this.request('DELETE', `https://api.openai.com/v1/organization/projects/${project_id}/users/${user_id}`);
},
async list-roles(query?: Record<string, string>): Promise<list-rolesResponse> {
return this.request('GET', appendQuery(`https://api.openai.com/v1/organization/roles`, query));
},
async create-role(body?: create-roleBody): Promise<create-roleResponse> {
return this.request('POST', `https://api.openai.com/v1/organization/roles`, body ? JSON.stringify(body) : undefined);
},
async update-role(role_id: string, body?: update-roleBody): Promise<update-roleResponse> {
return this.request('POST', `https://api.openai.com/v1/organization/roles/${role_id}`, body ? JSON.stringify(body) : undefined);
},
async delete-role(role_id: string): Promise<delete-roleResponse> {
return this.request('DELETE', `https://api.openai.com/v1/organization/roles/${role_id}`);
},
async usage-audio-speeches(query?: Record<string, string>): Promise<usage-audio-speechesResponse> {
return this.request('GET', appendQuery(`https://api.openai.com/v1/organization/usage/audio_speeches`, query));
},
async usage-audio-transcriptions(query?: Record<string, string>): Promise<usage-audio-transcriptionsResponse> {
return this.request('GET', appendQuery(`https://api.openai.com/v1/organization/usage/audio_transcriptions`, query));
},
async usage-code-interpreter-sessions(query?: Record<string, string>): Promise<usage-code-interpreter-sessionsResponse> {
return this.request('GET', appendQuery(`https://api.openai.com/v1/organization/usage/code_interpreter_sessions`, query));
},
async usage-completions(query?: Record<string, string>): Promise<usage-completionsResponse> {
return this.request('GET', appendQuery(`https://api.openai.com/v1/organization/usage/completions`, query));
},
async usage-embeddings(query?: Record<string, string>): Promise<usage-embeddingsResponse> {
return this.request('GET', appendQuery(`https://api.openai.com/v1/organization/usage/embeddings`, query));
},
async usage-images(query?: Record<string, string>): Promise<usage-imagesResponse> {
return this.request('GET', appendQuery(`https://api.openai.com/v1/organization/usage/images`, query));
},
async usage-moderations(query?: Record<string, string>): Promise<usage-moderationsResponse> {
return this.request('GET', appendQuery(`https://api.openai.com/v1/organization/usage/moderations`, query));
},
async usage-vector-stores(query?: Record<string, string>): Promise<usage-vector-storesResponse> {
return this.request('GET', appendQuery(`https://api.openai.com/v1/organization/usage/vector_stores`, query));
},
async list-users(query?: Record<string, string>): Promise<list-usersResponse> {
return this.request('GET', appendQuery(`https://api.openai.com/v1/organization/users`, query));
},
async retrieve-user(user_id: string): Promise<retrieve-userResponse> {
return this.request('GET', `https://api.openai.com/v1/organization/users/${user_id}`);
},
async modify-user(user_id: string, body?: modify-userBody): Promise<modify-userResponse> {
return this.request('POST', `https://api.openai.com/v1/organization/users/${user_id}`, body ? JSON.stringify(body) : undefined);
},
async delete-user(user_id: string): Promise<delete-userResponse> {
return this.request('DELETE', `https://api.openai.com/v1/organization/users/${user_id}`);
},
async list-user-role-assignments(user_id: string, query?: Record<string, string>): Promise<list-user-role-assignmentsResponse> {
return this.request('GET', appendQuery(`https://api.openai.com/v1/organization/users/${user_id}/roles`, query));
},
async assign-user-role(user_id: string, body?: assign-user-roleBody): Promise<assign-user-roleResponse> {
return this.request('POST', `https://api.openai.com/v1/organization/users/${user_id}/roles`, body ? JSON.stringify(body) : undefined);
},
async unassign-user-role(user_id: string, role_id: string): Promise<unassign-user-roleResponse> {
return this.request('DELETE', `https://api.openai.com/v1/organization/users/${user_id}/roles/${role_id}`);
},
async list-project-group-role-assignments(project_id: string, group_id: string, query?: Record<string, string>): Promise<list-project-group-role-assignmentsResponse> {
return this.request('GET', appendQuery(`https://api.openai.com/v1/projects/${project_id}/groups/${group_id}/roles`, query));
},
async assign-project-group-role(project_id: string, group_id: string, body?: assign-project-group-roleBody): Promise<assign-project-group-roleResponse> {
return this.request('POST', `https://api.openai.com/v1/projects/${project_id}/groups/${group_id}/roles`, body ? JSON.stringify(body) : undefined);
},
async unassign-project-group-role(project_id: string, group_id: string, role_id: string): Promise<unassign-project-group-roleResponse> {
return this.request('DELETE', `https://api.openai.com/v1/projects/${project_id}/groups/${group_id}/roles/${role_id}`);
},
async list-project-roles(project_id: string, query?: Record<string, string>): Promise<list-project-rolesResponse> {
return this.request('GET', appendQuery(`https://api.openai.com/v1/projects/${project_id}/roles`, query));
},
async create-project-role(project_id: string, body?: create-project-roleBody): Promise<create-project-roleResponse> {
return this.request('POST', `https://api.openai.com/v1/projects/${project_id}/roles`, body ? JSON.stringify(body) : undefined);
},
async update-project-role(project_id: string, role_id: string, body?: update-project-roleBody): Promise<update-project-roleResponse> {
return this.request('POST', `https://api.openai.com/v1/projects/${project_id}/roles/${role_id}`, body ? JSON.stringify(body) : undefined);
},
async delete-project-role(project_id: string, role_id: string): Promise<delete-project-roleResponse> {
return this.request('DELETE', `https://api.openai.com/v1/projects/${project_id}/roles/${role_id}`);
},
async list-project-user-role-assignments(project_id: string, user_id: string, query?: Record<string, string>): Promise<list-project-user-role-assignmentsResponse> {
return this.request('GET', appendQuery(`https://api.openai.com/v1/projects/${project_id}/users/${user_id}/roles`, query));
},
async assign-project-user-role(project_id: string, user_id: string, body?: assign-project-user-roleBody): Promise<assign-project-user-roleResponse> {
return this.request('POST', `https://api.openai.com/v1/projects/${project_id}/users/${user_id}/roles`, body ? JSON.stringify(body) : undefined);
},
async unassign-project-user-role(project_id: string, user_id: string, role_id: string): Promise<unassign-project-user-roleResponse> {
return this.request('DELETE', `https://api.openai.com/v1/projects/${project_id}/users/${user_id}/roles/${role_id}`);
},
async create-realtime-call(body?: create-realtime-callBody): Promise<create-realtime-callResponse> {
return this.request('POST', `https://api.openai.com/v1/realtime/calls`, body ? JSON.stringify(body) : undefined);
},
async accept-realtime-call(call_id: string, body?: accept-realtime-callBody): Promise<accept-realtime-callResponse> {
return this.request('POST', `https://api.openai.com/v1/realtime/calls/${call_id}/accept`, body ? JSON.stringify(body) : undefined);
},
async hangup-realtime-call(call_id: string, body?: Record<string, unknown>): Promise<hangup-realtime-callResponse> {
return this.request('POST', `https://api.openai.com/v1/realtime/calls/${call_id}/hangup`, body ? JSON.stringify(body) : undefined);
},
async refer-realtime-call(call_id: string, body?: refer-realtime-callBody): Promise<refer-realtime-callResponse> {
return this.request('POST', `https://api.openai.com/v1/realtime/calls/${call_id}/refer`, body ? JSON.stringify(body) : undefined);
},
async reject-realtime-call(call_id: string, body?: reject-realtime-callBody): Promise<reject-realtime-callResponse> {
return this.request('POST', `https://api.openai.com/v1/realtime/calls/${call_id}/reject`, body ? JSON.stringify(body) : undefined);
},
async create-realtime-client-secret(body?: create-realtime-client-secretBody): Promise<create-realtime-client-secretResponse> {
return this.request('POST', `https://api.openai.com/v1/realtime/client_secrets`, body ? JSON.stringify(body) : undefined);
},
async create-realtime-session(body?: create-realtime-sessionBody): Promise<create-realtime-sessionResponse> {
return this.request('POST', `https://api.openai.com/v1/realtime/sessions`, body ? JSON.stringify(body) : undefined);
},
async create-realtime-transcription-session(body?: create-realtime-transcription-sessionBody): Promise<create-realtime-transcription-sessionResponse> {
return this.request('POST', `https://api.openai.com/v1/realtime/transcription_sessions`, body ? JSON.stringify(body) : undefined);
},
async create-realtime-translation-client-secret(body?: create-realtime-translation-client-secretBody): Promise<create-realtime-translation-client-secretResponse> {
return this.request('POST', `https://api.openai.com/v1/realtime/translations/client_secrets`, body ? JSON.stringify(body) : undefined);
},
async createResponse(body?: createResponseBody): Promise<createResponseResponse> {
return this.request('POST', `https://api.openai.com/v1/responses`, body ? JSON.stringify(body) : undefined);
},
async getResponse(response_id: string, query?: Record<string, string>): Promise<getResponseResponse> {
return this.request('GET', appendQuery(`https://api.openai.com/v1/responses/${response_id}`, query));
},
async deleteResponse(response_id: string): Promise<deleteResponseResponse> {
return this.request('DELETE', `https://api.openai.com/v1/responses/${response_id}`);
},
async cancelResponse(response_id: string, body?: Record<string, unknown>): Promise<cancelResponseResponse> {
return this.request('POST', `https://api.openai.com/v1/responses/${response_id}/cancel`, body ? JSON.stringify(body) : undefined);
},
async listInputItems(response_id: string, query?: Record<string, string>): Promise<listInputItemsResponse> {
return this.request('GET', appendQuery(`https://api.openai.com/v1/responses/${response_id}/input_items`, query));
},
async createThread(body?: createThreadBody): Promise<createThreadResponse> {
return this.request('POST', `https://api.openai.com/v1/threads`, body ? JSON.stringify(body) : undefined);
},
async createThreadAndRun(body?: createThreadAndRunBody): Promise<createThreadAndRunResponse> {
return this.request('POST', `https://api.openai.com/v1/threads/runs`, body ? JSON.stringify(body) : undefined);
},
async getThread(thread_id: string): Promise<getThreadResponse> {
return this.request('GET', `https://api.openai.com/v1/threads/${thread_id}`);
},
async modifyThread(thread_id: string, body?: modifyThreadBody): Promise<modifyThreadResponse> {
return this.request('POST', `https://api.openai.com/v1/threads/${thread_id}`, body ? JSON.stringify(body) : undefined);
},
async deleteThread(thread_id: string): Promise<deleteThreadResponse> {
return this.request('DELETE', `https://api.openai.com/v1/threads/${thread_id}`);
},
async listMessages(thread_id: string, query?: Record<string, string>): Promise<listMessagesResponse> {
return this.request('GET', appendQuery(`https://api.openai.com/v1/threads/${thread_id}/messages`, query));
},
async createMessage(thread_id: string, body?: createMessageBody): Promise<createMessageResponse> {
return this.request('POST', `https://api.openai.com/v1/threads/${thread_id}/messages`, body ? JSON.stringify(body) : undefined);
},
async getMessage(thread_id: string, message_id: string): Promise<getMessageResponse> {
return this.request('GET', `https://api.openai.com/v1/threads/${thread_id}/messages/${message_id}`);
},
async modifyMessage(thread_id: string, message_id: string, body?: modifyMessageBody): Promise<modifyMessageResponse> {
return this.request('POST', `https://api.openai.com/v1/threads/${thread_id}/messages/${message_id}`, body ? JSON.stringify(body) : undefined);
},
async deleteMessage(thread_id: string, message_id: string): Promise<deleteMessageResponse> {
return this.request('DELETE', `https://api.openai.com/v1/threads/${thread_id}/messages/${message_id}`);
},
async listRuns(thread_id: string, query?: Record<string, string>): Promise<listRunsResponse> {
return this.request('GET', appendQuery(`https://api.openai.com/v1/threads/${thread_id}/runs`, query));
},
async createRun(thread_id: string, query?: Record<string, string>, body?: createRunBody): Promise<createRunResponse> {
return this.request('POST', appendQuery(`https://api.openai.com/v1/threads/${thread_id}/runs`, query), body ? JSON.stringify(body) : undefined);
},
async getRun(thread_id: string, run_id: string): Promise<getRunResponse> {
return this.request('GET', `https://api.openai.com/v1/threads/${thread_id}/runs/${run_id}`);
},
async modifyRun(thread_id: string, run_id: string, body?: modifyRunBody): Promise<modifyRunResponse> {
return this.request('POST', `https://api.openai.com/v1/threads/${thread_id}/runs/${run_id}`, body ? JSON.stringify(body) : undefined);
},
async cancelRun(thread_id: string, run_id: string, body?: Record<string, unknown>): Promise<cancelRunResponse> {
return this.request('POST', `https://api.openai.com/v1/threads/${thread_id}/runs/${run_id}/cancel`, body ? JSON.stringify(body) : undefined);
},
async listRunSteps(thread_id: string, run_id: string, query?: Record<string, string>): Promise<listRunStepsResponse> {
return this.request('GET', appendQuery(`https://api.openai.com/v1/threads/${thread_id}/runs/${run_id}/steps`, query));
},
async getRunStep(thread_id: string, run_id: string, step_id: string, query?: Record<string, string>): Promise<getRunStepResponse> {
return this.request('GET', appendQuery(`https://api.openai.com/v1/threads/${thread_id}/runs/${run_id}/steps/${step_id}`, query));
},
async submitToolOuputsToRun(thread_id: string, run_id: string, body?: submitToolOuputsToRunBody): Promise<submitToolOuputsToRunResponse> {
return this.request('POST', `https://api.openai.com/v1/threads/${thread_id}/runs/${run_id}/submit_tool_outputs`, body ? JSON.stringify(body) : undefined);
},
async createUpload(body?: createUploadBody): Promise<createUploadResponse> {
return this.request('POST', `https://api.openai.com/v1/uploads`, body ? JSON.stringify(body) : undefined);
},
async cancelUpload(upload_id: string, body?: Record<string, unknown>): Promise<cancelUploadResponse> {
return this.request('POST', `https://api.openai.com/v1/uploads/${upload_id}/cancel`, body ? JSON.stringify(body) : undefined);
},
async completeUpload(upload_id: string, body?: completeUploadBody): Promise<completeUploadResponse> {
return this.request('POST', `https://api.openai.com/v1/uploads/${upload_id}/complete`, body ? JSON.stringify(body) : undefined);
},
async addUploadPart(upload_id: string, body?: addUploadPartBody): Promise<addUploadPartResponse> {
return this.request('POST', `https://api.openai.com/v1/uploads/${upload_id}/parts`, body ? JSON.stringify(body) : undefined);
},
async listVectorStores(query?: Record<string, string>): Promise<listVectorStoresResponse> {
return this.request('GET', appendQuery(`https://api.openai.com/v1/vector_stores`, query));
},
async createVectorStore(body?: createVectorStoreBody): Promise<createVectorStoreResponse> {
return this.request('POST', `https://api.openai.com/v1/vector_stores`, body ? JSON.stringify(body) : undefined);
},
async getVectorStore(vector_store_id: string): Promise<getVectorStoreResponse> {
return this.request('GET', `https://api.openai.com/v1/vector_stores/${vector_store_id}`);
},
async modifyVectorStore(vector_store_id: string, body?: modifyVectorStoreBody): Promise<modifyVectorStoreResponse> {
return this.request('POST', `https://api.openai.com/v1/vector_stores/${vector_store_id}`, body ? JSON.stringify(body) : undefined);
},
async deleteVectorStore(vector_store_id: string): Promise<deleteVectorStoreResponse> {
return this.request('DELETE', `https://api.openai.com/v1/vector_stores/${vector_store_id}`);
},
async createVectorStoreFileBatch(vector_store_id: string, body?: createVectorStoreFileBatchBody): Promise<createVectorStoreFileBatchResponse> {
return this.request('POST', `https://api.openai.com/v1/vector_stores/${vector_store_id}/file_batches`, body ? JSON.stringify(body) : undefined);
},
async getVectorStoreFileBatch(vector_store_id: string, batch_id: string): Promise<getVectorStoreFileBatchResponse> {
return this.request('GET', `https://api.openai.com/v1/vector_stores/${vector_store_id}/file_batches/${batch_id}`);
},
async cancelVectorStoreFileBatch(vector_store_id: string, batch_id: string, body?: Record<string, unknown>): Promise<cancelVectorStoreFileBatchResponse> {
return this.request('POST', `https://api.openai.com/v1/vector_stores/${vector_store_id}/file_batches/${batch_id}/cancel`, body ? JSON.stringify(body) : undefined);
},
async listFilesInVectorStoreBatch(vector_store_id: string, batch_id: string, query?: Record<string, string>): Promise<listFilesInVectorStoreBatchResponse> {
return this.request('GET', appendQuery(`https://api.openai.com/v1/vector_stores/${vector_store_id}/file_batches/${batch_id}/files`, query));
},
async listVectorStoreFiles(vector_store_id: string, query?: Record<string, string>): Promise<listVectorStoreFilesResponse> {
return this.request('GET', appendQuery(`https://api.openai.com/v1/vector_stores/${vector_store_id}/files`, query));
},
async createVectorStoreFile(vector_store_id: string, body?: createVectorStoreFileBody): Promise<createVectorStoreFileResponse> {
return this.request('POST', `https://api.openai.com/v1/vector_stores/${vector_store_id}/files`, body ? JSON.stringify(body) : undefined);
},
async getVectorStoreFile(vector_store_id: string, file_id: string): Promise<getVectorStoreFileResponse> {
return this.request('GET', `https://api.openai.com/v1/vector_stores/${vector_store_id}/files/${file_id}`);
},
async updateVectorStoreFileAttributes(vector_store_id: string, file_id: string, body?: updateVectorStoreFileAttributesBody): Promise<updateVectorStoreFileAttributesResponse> {
return this.request('POST', `https://api.openai.com/v1/vector_stores/${vector_store_id}/files/${file_id}`, body ? JSON.stringify(body) : undefined);
},
async deleteVectorStoreFile(vector_store_id: string, file_id: string): Promise<deleteVectorStoreFileResponse> {
return this.request('DELETE', `https://api.openai.com/v1/vector_stores/${vector_store_id}/files/${file_id}`);
},
async retrieveVectorStoreFileContent(vector_store_id: string, file_id: string): Promise<retrieveVectorStoreFileContentResponse> {
return this.request('GET', `https://api.openai.com/v1/vector_stores/${vector_store_id}/files/${file_id}/content`);
},
async searchVectorStore(vector_store_id: string, body?: searchVectorStoreBody): Promise<searchVectorStoreResponse> {
return this.request('POST', `https://api.openai.com/v1/vector_stores/${vector_store_id}/search`, body ? JSON.stringify(body) : undefined);
},
async createConversation(body?: createConversationBody): Promise<createConversationResponse> {
return this.request('POST', `https://api.openai.com/v1/conversations`, body ? JSON.stringify(body) : undefined);
},
async getConversation(conversation_id: string): Promise<getConversationResponse> {
return this.request('GET', `https://api.openai.com/v1/conversations/${conversation_id}`);
},
async updateConversation(conversation_id: string, body?: updateConversationBody): Promise<updateConversationResponse> {
return this.request('POST', `https://api.openai.com/v1/conversations/${conversation_id}`, body ? JSON.stringify(body) : undefined);
},
async deleteConversation(conversation_id: string): Promise<deleteConversationResponse> {
return this.request('DELETE', `https://api.openai.com/v1/conversations/${conversation_id}`);
},
async ListVideos(query?: Record<string, string>): Promise<ListVideosResponse> {
return this.request('GET', appendQuery(`https://api.openai.com/v1/videos`, query));
},
async createVideo(body?: createVideoBody): Promise<createVideoResponse> {
return this.request('POST', `https://api.openai.com/v1/videos`, body ? JSON.stringify(body) : undefined);
},
async CreateVideoCharacter(body?: CreateVideoCharacterBody): Promise<CreateVideoCharacterResponse> {
return this.request('POST', `https://api.openai.com/v1/videos/characters`, body ? JSON.stringify(body) : undefined);
},
async GetVideoCharacter(character_id: string): Promise<GetVideoCharacterResponse> {
return this.request('GET', `https://api.openai.com/v1/videos/characters/${character_id}`);
},
async CreateVideoEdit(body?: CreateVideoEditBody): Promise<CreateVideoEditResponse> {
return this.request('POST', `https://api.openai.com/v1/videos/edits`, body ? JSON.stringify(body) : undefined);
},
async CreateVideoExtend(body?: CreateVideoExtendBody): Promise<CreateVideoExtendResponse> {
return this.request('POST', `https://api.openai.com/v1/videos/extensions`, body ? JSON.stringify(body) : undefined);
},
async GetVideo(video_id: string): Promise<GetVideoResponse> {
return this.request('GET', `https://api.openai.com/v1/videos/${video_id}`);
},
async DeleteVideo(video_id: string): Promise<DeleteVideoResponse> {
return this.request('DELETE', `https://api.openai.com/v1/videos/${video_id}`);
},
async RetrieveVideoContent(video_id: string, query?: Record<string, string>): Promise<RetrieveVideoContentResponse> {
return this.request('GET', appendQuery(`https://api.openai.com/v1/videos/${video_id}/content`, query));
},
async CreateVideoRemix(video_id: string, body?: CreateVideoRemixBody): Promise<CreateVideoRemixResponse> {
return this.request('POST', `https://api.openai.com/v1/videos/${video_id}/remix`, body ? JSON.stringify(body) : undefined);
},
async Getinputtokencounts(body?: GetinputtokencountsBody): Promise<GetinputtokencountsResponse> {
return this.request('POST', `https://api.openai.com/v1/responses/input_tokens`, body ? JSON.stringify(body) : undefined);
},
async Compactconversation(body?: CompactconversationBody): Promise<CompactconversationResponse> {
return this.request('POST', `https://api.openai.com/v1/responses/compact`, body ? JSON.stringify(body) : undefined);
},
async ListSkills(query?: Record<string, string>): Promise<ListSkillsResponse> {
return this.request('GET', appendQuery(`https://api.openai.com/v1/skills`, query));
},
async CreateSkill(body?: CreateSkillBody): Promise<CreateSkillResponse> {
return this.request('POST', `https://api.openai.com/v1/skills`, body ? JSON.stringify(body) : undefined);
},
async GetSkill(skill_id: string): Promise<GetSkillResponse> {
return this.request('GET', `https://api.openai.com/v1/skills/${skill_id}`);
},
async UpdateSkillDefaultVersion(skill_id: string, body?: UpdateSkillDefaultVersionBody): Promise<UpdateSkillDefaultVersionResponse> {
return this.request('POST', `https://api.openai.com/v1/skills/${skill_id}`, body ? JSON.stringify(body) : undefined);
},
async DeleteSkill(skill_id: string): Promise<DeleteSkillResponse> {
return this.request('DELETE', `https://api.openai.com/v1/skills/${skill_id}`);
},
async GetSkillContent(skill_id: string): Promise<GetSkillContentResponse> {
return this.request('GET', `https://api.openai.com/v1/skills/${skill_id}/content`);
},
async ListSkillVersions(skill_id: string, query?: Record<string, string>): Promise<ListSkillVersionsResponse> {
return this.request('GET', appendQuery(`https://api.openai.com/v1/skills/${skill_id}/versions`, query));
},
async CreateSkillVersion(skill_id: string, body?: CreateSkillVersionBody): Promise<CreateSkillVersionResponse> {
return this.request('POST', `https://api.openai.com/v1/skills/${skill_id}/versions`, body ? JSON.stringify(body) : undefined);
},
async GetSkillVersion(skill_id: string, version: string): Promise<GetSkillVersionResponse> {
return this.request('GET', `https://api.openai.com/v1/skills/${skill_id}/versions/${version}`);
},
async DeleteSkillVersion(skill_id: string, version: string): Promise<DeleteSkillVersionResponse> {
return this.request('DELETE', `https://api.openai.com/v1/skills/${skill_id}/versions/${version}`);
},
async GetSkillVersionContent(skill_id: string, version: string): Promise<GetSkillVersionContentResponse> {
return this.request('GET', `https://api.openai.com/v1/skills/${skill_id}/versions/${version}/content`);
},
async CancelChatSessionMethod(session_id: string, body?: Record<string, unknown>): Promise<CancelChatSessionMethodResponse> {
return this.request('POST', `https://api.openai.com/v1/chatkit/sessions/${session_id}/cancel`, body ? JSON.stringify(body) : undefined);
},
async CreateChatSessionMethod(body?: CreateChatSessionMethodBody): Promise<CreateChatSessionMethodResponse> {
return this.request('POST', `https://api.openai.com/v1/chatkit/sessions`, body ? JSON.stringify(body) : undefined);
},
async ListThreadItemsMethod(thread_id: string, query?: Record<string, string>): Promise<ListThreadItemsMethodResponse> {
return this.request('GET', appendQuery(`https://api.openai.com/v1/chatkit/threads/${thread_id}/items`, query));
},
async GetThreadMethod(thread_id: string): Promise<GetThreadMethodResponse> {
return this.request('GET', `https://api.openai.com/v1/chatkit/threads/${thread_id}`);
},
async DeleteThreadMethod(thread_id: string): Promise<DeleteThreadMethodResponse> {
return this.request('DELETE', `https://api.openai.com/v1/chatkit/threads/${thread_id}`);
},
async ListThreadsMethod(query?: Record<string, string>): Promise<ListThreadsMethodResponse> {
return this.request('GET', appendQuery(`https://api.openai.com/v1/chatkit/threads`, query));
},
}
Related skills
| Skill | Stars | Updated | Works with | Status | Install |
|---|---|---|---|---|---|
| rea-changelog-updatemorluto/reaPrepare or rewrite REA release changelogs and GitHub release notes from pinned Git history, with verified contributor thanks and Release Please synchronization. | Stars: 472k | Updated | Claude CodeCodex | Verified | Install |
| academy-guideanthropics/skillsStop and check this skill before finishing any reply to a question about how to use Claude or a Claude product — it recommends matching courses, tutorials, and use cases from Claude Academy (academy.claude.com), Anthropic's learning hub. Trigger on: "how do I", "how can I", "getting started with", "what can Claude do", "teach me", "learn to use"; questions about artifacts, projects, skills, plugins, connectors, MCP; requests about rolling Claude out to a team, class, or organization; and any ask for training materials, onboarding content, or learning resources. Use it when the user is learning how to use a feature or product — not when they are mid-task and just want the task done. This skill composes with other skills: after consulting product documentation to answer how a Claude feature works, also check here for a matching course or tutorial — a docs-grounded answer and an Academy recommendation belong together. Only recommend on a strong match; never invent Academy content. | Stars: 198k | Updated | Claude CodeCodex | Verified | Install |
| claude-apianthropics/skillsReference for the Claude API / Anthropic SDK — model ids, pricing, params, streaming, tool use, MCP, agents, caching, token counting, model migration. TRIGGER — read BEFORE opening the target file; don't skip because it "looks like a one-liner" — whenever: the prompt names Claude/Anthropic in any form (Claude, Anthropic, Fable, Opus, Sonnet, Haiku, `anthropic`, `@anthropic-ai`, `claude-*`, `us.anthropic.*`, `[1m]`); the user asks about an LLM (pricing/model choice/limits/caching) — never answer from memory; OR the task is LLM-shaped with provider unstated (agent/MCP/tool-definition/multi-agent/RAG/LLM-judge/computer-use; generate/summarize/extract/classify/rewrite/converse over NL; debugging refusals/cutoffs/streaming/tool-calls/tokens). SKIP only when another provider is being worked on (overrides all triggers): OpenAI/GPT/Gemini/Llama/Mistral/Cohere/Ollama named in the query; OR `grep -rE 'openai|langchain_openai|google.generativeai|genai|mistralai|cohere|ollama'` over the project hits (run this grep FIRST if no provider named — don't Read the file). | Stars: 198k | Updated | Claude CodeCodex | Unverified | Install |
| doc-coauthoringanthropics/skillsGuide users through a structured workflow for co-authoring documentation. Use when user wants to write documentation, proposals, technical specs, decision docs, or similar structured content. This workflow helps users efficiently transfer context, refine content through iteration, and verify the doc works for readers. Trigger when user mentions writing docs, creating proposals, drafting specs, or similar documentation tasks. | Stars: 198k | Updated | Claude CodeCodex | Verified | Install |