From 11adf5dc11b6e7bdb7ce0beb0e4df267a4f370be Mon Sep 17 00:00:00 2001 From: Matt Apperson Date: Mon, 10 Nov 2025 08:02:29 -0500 Subject: [PATCH] Fix quickstart documentation errors - Update all instances of client.chat.completions.create to client.chat.send in OVERVIEW.md (5 occurrences) - Fix syntax error: add missing comma after model parameter in README.md - Fix variable name: change 'stream' to 'result' in streaming example in README.md - Fix typo: change 'hunk' to 'chunk' in streaming example in README.md --- OVERVIEW.md | 10 +++++----- README.md | 6 +++--- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/OVERVIEW.md b/OVERVIEW.md index 13c4cd61..86fb09fc 100644 --- a/OVERVIEW.md +++ b/OVERVIEW.md @@ -13,7 +13,7 @@ const client = new OpenRouter({ apiKey: process.env.OPENROUTER_API_KEY }); -const response = await client.chat.completions.create({ +const response = await client.chat.send({ model: "minimax/minimax-m2", messages: [ { role: "user", content: "Explain quantum computing" } @@ -29,7 +29,7 @@ The SDK is automatically generated from OpenRouter's OpenAPI specs and updated w ```typescript // When new models launch, they're available instantly -const response = await client.chat.completions.create({ +const response = await client.chat.send({ model: "minimax/minimax-m2", }); ``` @@ -39,7 +39,7 @@ const response = await client.chat.completions.create({ Every parameter, response field, and configuration option is fully typed. Invalid configurations are caught at compile time, not in production. ```typescript -const response = await client.chat.completions.create({ +const response = await client.chat.send({ model: "minimax/minimax-m2", messages: [ { role: "user", content: "Hello" } @@ -61,7 +61,7 @@ const response = await client.chat.completions.create({ **Type-safe streaming:** ```typescript -const stream = await client.chat.completions.create({ +const stream = await client.chat.send({ model: "minimax/minimax-m2", messages: [{ role: "user", content: "Write a story" }], stream: true @@ -90,7 +90,7 @@ const client = new OpenRouter({ apiKey: process.env.OPENROUTER_API_KEY }); -const response = await client.chat.completions.create({ +const response = await client.chat.send({ model: "minimax/minimax-m2", messages: [ { role: "user", content: "Hello!" } diff --git a/README.md b/README.md index 7d846fcb..a1693a8e 100644 --- a/README.md +++ b/README.md @@ -73,7 +73,7 @@ const result = await openRouter.chat.send({ content: "Hello, how are you?", }, ], - model: "openai/gpt-5" + model: "openai/gpt-5", provider: { zdr: true, sort: "price", @@ -81,8 +81,8 @@ const result = await openRouter.chat.send({ stream: true }); -for await (const chunk of stream) { - console.log(hunk.choices[0].delta.content) +for await (const chunk of result) { + console.log(chunk.choices[0].delta.content) } ```