Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions OVERVIEW.md
Original file line number Diff line number Diff line change
Expand Up @@ -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" }
Expand All @@ -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",
});
```
Expand All @@ -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" }
Expand All @@ -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
Expand Down Expand Up @@ -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!" }
Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -73,16 +73,16 @@ const result = await openRouter.chat.send({
content: "Hello, how are you?",
},
],
model: "openai/gpt-5"
model: "openai/gpt-5",
provider: {
zdr: true,
sort: "price",
},
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)
}

```
Expand Down