UNPKG

openai

Version:

The official TypeScript library for the OpenAI API

29 lines • 1.12 kB
// File generated from our OpenAPI spec by Castiron. See CONTRIBUTING.md for details. import { APIResource } from "../../../../../core/resource.mjs"; import { path } from "../../../../../internal/utils/path.mjs"; function resolveResourceRequestOptions(options, buildOptions) { return Promise.resolve(options).then(buildOptions); } export class APIKeys extends APIResource { /** * Creates an API key for a service account in the project. * * @example * ```ts * const apiKey = * await client.admin.organization.projects.serviceAccounts.apiKeys.create( * 'service_account_id', * { project_id: 'project_id' }, * ); * ``` */ create(serviceAccountID, params, options) { const { project_id, ...body } = params; return this._client.post(path `/organization/projects/${project_id}/service_accounts/${serviceAccountID}/api_keys`, resolveResourceRequestOptions(options, (options) => ({ body, ...options, __security: { adminAPIKeyAuth: true }, }))); } } //# sourceMappingURL=api-keys.mjs.map