Skip to content

Commit 9f1990a

Browse files
committed
update docs
1 parent 5e6dd0f commit 9f1990a

File tree

162 files changed

+175
-2813
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

162 files changed

+175
-2813
lines changed

.speakeasy/gen.lock

Lines changed: 93 additions & 93 deletions
Large diffs are not rendered by default.

.speakeasy/gen.yaml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ generation:
2929
generateNewTests: true
3030
skipResponseBodyAssertions: false
3131
typescript:
32-
version: 0.0.1
32+
version: 0.1.0
3333
acceptHeaderEnum: false
3434
additionalDependencies:
3535
dependencies: {}
@@ -39,6 +39,7 @@ typescript:
3939
vitest: ^3.2.4
4040
peerDependencies: {}
4141
additionalPackageJSON: {}
42+
additionalScripts: {}
4243
author: OpenRouter
4344
baseErrorName: OpenRouterError
4445
clientServerStatusCodesAsErrors: true

.speakeasy/workflow.lock

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
speakeasyVersion: 1.643.2
1+
speakeasyVersion: 1.648.1
22
sources:
33
OpenRouter API:
44
sourceNamespace: open-router-chat-completions-api
@@ -14,7 +14,7 @@ targets:
1414
sourceRevisionDigest: sha256:1076c98248df2a8c6c6a22cb2fcefd3a517f2dc346c0c5b410abfe301bdb1dad
1515
sourceBlobDigest: sha256:da053f100fc1b8b64975f7612dd8970661444f9156cd295a6cc49fd5914e8247
1616
codeSamplesNamespace: open-router-chat-completions-api-typescript-code-samples
17-
codeSamplesRevisionDigest: sha256:5ebfa7c0a3f1ea7ef487fc4560666289a2a46e64eb7aefa144a760cb61a65dd4
17+
codeSamplesRevisionDigest: sha256:812e850dbf1a556527446c6d855475fd5019953bfb0156058fd5e003beb83b79
1818
workflow:
1919
workflowVersion: 1.0.0
2020
speakeasyVersion: latest

FUNCTIONS.md

Lines changed: 1 addition & 109 deletions
Original file line numberDiff line numberDiff line change
@@ -29,115 +29,7 @@ const openRouter = new OpenRouterCore({
2929
});
3030

3131
async function run() {
32-
const res = await betaResponsesSend(openRouter, {
33-
input: [
34-
{
35-
type: "message",
36-
role: "user",
37-
content: "Hello, how are you?",
38-
},
39-
],
40-
instructions: "<value>",
41-
metadata: {
42-
"user_id": "123",
43-
"session_id": "abc-def-ghi",
44-
},
45-
tools: [
46-
{
47-
type: "function",
48-
name: "get_current_weather",
49-
description: "Get the current weather in a given location",
50-
strict: true,
51-
parameters: {
52-
"type": "object",
53-
"properties": {
54-
"location": {
55-
"type": "string",
56-
},
57-
},
58-
},
59-
},
60-
],
61-
toolChoice: {
62-
type: "function",
63-
name: "<value>",
64-
},
65-
parallelToolCalls: true,
66-
model: "anthropic/claude-4.5-sonnet-20250929",
67-
models: [
68-
"<value 1>",
69-
],
70-
text: {
71-
format: {
72-
type: "text",
73-
},
74-
verbosity: "medium",
75-
},
76-
reasoning: {
77-
effort: "high",
78-
summary: "auto",
79-
maxTokens: 8661.16,
80-
enabled: true,
81-
},
82-
maxOutputTokens: null,
83-
temperature: 0.7,
84-
topP: 0.9,
85-
topK: 193.77,
86-
promptCacheKey: "<value>",
87-
previousResponseId: "<id>",
88-
prompt: {
89-
id: "<id>",
90-
variables: {
91-
"key": {
92-
type: "input_text",
93-
text: "Hello, how can I help you?",
94-
},
95-
},
96-
},
97-
include: [
98-
"reasoning.encrypted_content",
99-
],
100-
background: true,
101-
safetyIdentifier: "<value>",
102-
store: true,
103-
serviceTier: "auto",
104-
truncation: "auto",
105-
provider: {
106-
allowFallbacks: null,
107-
requireParameters: true,
108-
dataCollection: "deny",
109-
zdr: true,
110-
order: [
111-
"OpenAI",
112-
],
113-
only: [
114-
"OpenAI",
115-
],
116-
ignore: null,
117-
quantizations: [
118-
"fp16",
119-
],
120-
sort: "price",
121-
maxPrice: {
122-
prompt: "1000",
123-
completion: 1000,
124-
image: 1000,
125-
audio: "1000",
126-
request: 1000,
127-
},
128-
experimental: {},
129-
},
130-
plugins: [
131-
{
132-
id: "file-parser",
133-
maxFiles: 4870.55,
134-
pdf: {
135-
engine: "mistral-ocr",
136-
},
137-
},
138-
],
139-
user: "Elmer_Yundt72",
140-
});
32+
const res = await betaResponsesSend(openRouter, {});
14133
if (res.ok) {
14234
const { value: result } = res;
14335
console.log(result);

REACT_QUERY.md

Lines changed: 4 additions & 121 deletions
Original file line numberDiff line numberDiff line change
@@ -53,9 +53,7 @@ from TanStack Query.
5353
import { useAnalyticsGetUserActivity } from "@openrouter/sdk/react-query/analyticsGetUserActivity.js";
5454

5555
export function Example() {
56-
const { data, error, status } = useAnalyticsGetUserActivity({
57-
date: "2025-08-24",
58-
});
56+
const { data, error, status } = useAnalyticsGetUserActivity();
5957

6058
// Render the UI here...
6159
}
@@ -73,9 +71,6 @@ import { useAnalyticsGetUserActivity } from "@openrouter/sdk/react-query/analyti
7371
export function ExampleWithOptions() {
7472
const [enabled, setEnabled] = useState(true);
7573
const { data, error, status } = useAnalyticsGetUserActivity(
76-
{
77-
date: "2025-08-24",
78-
},
7974
{
8075
// TanStack Query options:
8176
enabled,
@@ -124,115 +119,7 @@ export function Example() {
124119

125120
// Read form data here...
126121

127-
mutate({
128-
input: [
129-
{
130-
type: "message",
131-
role: "user",
132-
content: "Hello, how are you?",
133-
},
134-
],
135-
instructions: "<value>",
136-
metadata: {
137-
"user_id": "123",
138-
"session_id": "abc-def-ghi",
139-
},
140-
tools: [
141-
{
142-
type: "function",
143-
name: "get_current_weather",
144-
description: "Get the current weather in a given location",
145-
strict: true,
146-
parameters: {
147-
"type": "object",
148-
"properties": {
149-
"location": {
150-
"type": "string",
151-
},
152-
},
153-
},
154-
},
155-
],
156-
toolChoice: {
157-
type: "function",
158-
name: "<value>",
159-
},
160-
parallelToolCalls: true,
161-
model: "anthropic/claude-4.5-sonnet-20250929",
162-
models: [
163-
"<value 1>",
164-
],
165-
text: {
166-
format: {
167-
type: "text",
168-
},
169-
verbosity: "medium",
170-
},
171-
reasoning: {
172-
effort: "high",
173-
summary: "auto",
174-
maxTokens: 8661.16,
175-
enabled: true,
176-
},
177-
maxOutputTokens: null,
178-
temperature: 0.7,
179-
topP: 0.9,
180-
topK: 193.77,
181-
promptCacheKey: "<value>",
182-
previousResponseId: "<id>",
183-
prompt: {
184-
id: "<id>",
185-
variables: {
186-
"key": {
187-
type: "input_text",
188-
text: "Hello, how can I help you?",
189-
},
190-
},
191-
},
192-
include: [
193-
"reasoning.encrypted_content",
194-
],
195-
background: true,
196-
safetyIdentifier: "<value>",
197-
store: true,
198-
serviceTier: "auto",
199-
truncation: "auto",
200-
provider: {
201-
allowFallbacks: null,
202-
requireParameters: true,
203-
dataCollection: "deny",
204-
zdr: true,
205-
order: [
206-
"OpenAI",
207-
],
208-
only: [
209-
"OpenAI",
210-
],
211-
ignore: null,
212-
quantizations: [
213-
"fp16",
214-
],
215-
sort: "price",
216-
maxPrice: {
217-
prompt: "1000",
218-
completion: 1000,
219-
image: 1000,
220-
audio: "1000",
221-
request: 1000,
222-
},
223-
experimental: {},
224-
},
225-
plugins: [
226-
{
227-
id: "file-parser",
228-
maxFiles: 4870.55,
229-
pdf: {
230-
engine: "mistral-ocr",
231-
},
232-
},
233-
],
234-
user: "Elmer_Yundt72",
235-
});
122+
mutate({});
236123
}}
237124
>
238125
{/* Form fields go here... */}
@@ -366,9 +253,7 @@ export function App() {
366253
}
367254

368255
function Example() {
369-
const { data } = useAnalyticsGetUserActivitySuspense({
370-
date: "2025-08-24",
371-
});
256+
const { data } = useAnalyticsGetUserActivitySuspense();
372257

373258
// Render the UI here...
374259
}
@@ -396,9 +281,7 @@ export default async function Page() {
396281
apiKey: process.env["OPENROUTER_API_KEY"] ?? "",
397282
});
398283

399-
await prefetchAnalyticsGetUserActivity(queryClient, openRouter, {
400-
date: "2025-08-24",
401-
});
284+
await prefetchAnalyticsGetUserActivity(openRouter);
402285

403286
return (
404287
// HydrationBoundary is a Client Component, so hydration will happen there.

0 commit comments

Comments
 (0)