Models

View as Markdown

Models

1// All models
2const all = await client.models.list();
3
4// Free models only
5const free = await client.models.free();
6
7// Paid models only
8const paid = await client.models.paid();
9
10// List with filter param
11const freeViaParam = await client.models.list({ free: true });
12
13// Print model pricing
14for (const model of paid.slice(0, 5)) {
15 console.log(
16 `${model.id} — prompt: $${model.pricing.prompt_usd_per_1k}/1k, ` +
17 `completion: $${model.pricing.completion_usd_per_1k}/1k`
18 );
19}

Free models (is_free: true) cost $0 for both prompt and completion, useful for testing and light tasks. Paid models charge per token against your account balance.