Models
List and describe the various models available in the API.
npm i @xsai/modelExamples
listModels
import { } from '@xsai/model'
import { } from 'node:process'
// [
// {
// "id": "model-id-0",
// "object": "model",
// "created": 1686935002,
// "owned_by": "organization-owner"
// },
// {
// "id": "model-id-1",
// "object": "model",
// "created": 1686935002,
// "owned_by": "organization-owner",
// },
// {
// "id": "model-id-2",
// "object": "model",
// "created": 1686935002,
// "owned_by": "openai"
// },
// ]
const = await ({
: .!,
: 'https://api.openai.com/v1/',
})retrieveModel
import { } from '@xsai/model'
import { } from 'node:process'
// {
// "id": "gpt-4o",
// "object": "model",
// "created": 1686935002,
// "owned_by": "openai"
// }
const = await ({
: .!,
: 'https://api.openai.com/v1/',
: 'gpt-4o',
})