Skip to content

Commit 6d8c8e2

Browse files
authored
Fix quickstart documentation errors (#71)
2 parents 8c9f9fc + 11adf5d commit 6d8c8e2

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

OVERVIEW.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ const client = new OpenRouter({
1313
apiKey: process.env.OPENROUTER_API_KEY
1414
});
1515

16-
const response = await client.chat.completions.create({
16+
const response = await client.chat.send({
1717
model: "minimax/minimax-m2",
1818
messages: [
1919
{ role: "user", content: "Explain quantum computing" }
@@ -29,7 +29,7 @@ The SDK is automatically generated from OpenRouter's OpenAPI specs and updated w
2929

3030
```typescript
3131
// When new models launch, they're available instantly
32-
const response = await client.chat.completions.create({
32+
const response = await client.chat.send({
3333
model: "minimax/minimax-m2",
3434
});
3535
```
@@ -39,7 +39,7 @@ const response = await client.chat.completions.create({
3939
Every parameter, response field, and configuration option is fully typed. Invalid configurations are caught at compile time, not in production.
4040

4141
```typescript
42-
const response = await client.chat.completions.create({
42+
const response = await client.chat.send({
4343
model: "minimax/minimax-m2",
4444
messages: [
4545
{ role: "user", content: "Hello" }
@@ -61,7 +61,7 @@ const response = await client.chat.completions.create({
6161
**Type-safe streaming:**
6262

6363
```typescript
64-
const stream = await client.chat.completions.create({
64+
const stream = await client.chat.send({
6565
model: "minimax/minimax-m2",
6666
messages: [{ role: "user", content: "Write a story" }],
6767
stream: true
@@ -90,7 +90,7 @@ const client = new OpenRouter({
9090
apiKey: process.env.OPENROUTER_API_KEY
9191
});
9292

93-
const response = await client.chat.completions.create({
93+
const response = await client.chat.send({
9494
model: "minimax/minimax-m2",
9595
messages: [
9696
{ role: "user", content: "Hello!" }

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -73,16 +73,16 @@ const result = await openRouter.chat.send({
7373
content: "Hello, how are you?",
7474
},
7575
],
76-
model: "openai/gpt-5"
76+
model: "openai/gpt-5",
7777
provider: {
7878
zdr: true,
7979
sort: "price",
8080
},
8181
stream: true
8282
});
8383

84-
for await (const chunk of stream) {
85-
console.log(hunk.choices[0].delta.content)
84+
for await (const chunk of result) {
85+
console.log(chunk.choices[0].delta.content)
8686
}
8787

8888
```

0 commit comments

Comments
 (0)