For AI agents: a documentation index is available at the root level at /llms.txt and /llms-full.txt. Append /llms.txt to any URL for a page-level index, or .md for the markdown version of any page.
DocsAPI ReferenceSDKs
DocsAPI ReferenceSDKs
      • Overview
      • Chat Completions
      • Prompt Templates
      • Files & Batches
      • Embeddings
      • Image Generation
      • Responses (Reasoning)
      • Compare (Multi-model)
      • Models
      • Error Handling
LogoLogo
On this page
  • Models
Node.js SDK

Models

||View as Markdown|
Was this page helpful?
Edit this page
Previous

Compare (Multi-model)

Next

Error Handling

Built with

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.