@zhivex-ai/openrouter 0.5.13 → 0.5.15

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/README.md +30 -1
  2. package/package.json +2 -2
package/README.md CHANGED
@@ -5,9 +5,38 @@ OpenRouter adapter for Zhivex AI SDK.
5
5
  ## Install
6
6
 
7
7
  ```bash
8
- bun add @zhivex-ai/openrouter
8
+ bun add @zhivex-ai/sdk @zhivex-ai/openrouter
9
9
  ```
10
10
 
11
+ ## Usage
12
+
13
+ ```ts
14
+ import { generateText } from "@zhivex-ai/sdk";
15
+ import { createOpenRouter, openRouterWebSearchTool } from "@zhivex-ai/openrouter";
16
+
17
+ const openrouter = createOpenRouter({
18
+ apiKey: process.env.OPENROUTER_API_KEY,
19
+ appName: "my-zhivex-app",
20
+ appURL: "https://example.com"
21
+ });
22
+
23
+ const result = await generateText({
24
+ model: openrouter("openai/gpt-4o-mini"),
25
+ prompt: "Summarize current TypeScript runtime news.",
26
+ tools: {
27
+ search: openRouterWebSearchTool({
28
+ search_context_size: "medium"
29
+ })
30
+ }
31
+ });
32
+
33
+ console.log(result.text);
34
+ ```
35
+
36
+ `createOpenRouter()` reads `OPENROUTER_API_KEY` and defaults to `https://openrouter.ai/api/v1`. `appName` and `appURL` populate OpenRouter's optional attribution headers.
37
+
38
+ The adapter supports streaming, callable tools, tool choice, native structured output, reasoning controls, vision, and OpenRouter web search. It does not expose embeddings, audio, files, remote MCP, approval requests, or provider-hosted code execution through the shared contract. Model-level support can be narrower than the adapter surface, so select a model that implements every requested capability.
39
+
11
40
  Repository and full documentation:
12
41
 
13
42
  - <https://github.com/Zhivex/zhivex-ai-sdk>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zhivex-ai/openrouter",
3
- "version": "0.5.13",
3
+ "version": "0.5.15",
4
4
  "description": "OpenRouter adapter for Zhivex AI SDK.",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -41,7 +41,7 @@
41
41
  "access": "public"
42
42
  },
43
43
  "dependencies": {
44
- "@zhivex-ai/core": "^0.19.0",
44
+ "@zhivex-ai/core": "^1.0.0",
45
45
  "zod": "^4.4.3"
46
46
  }
47
47
  }