Skip to content

Commit b2b96bf

Browse files
authored
fix: auth error schema (#4)
1 parent 602525e commit b2b96bf

File tree

12 files changed

+50
-37
lines changed

12 files changed

+50
-37
lines changed

.speakeasy/OAS_files/chat-completions-openapi.yaml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -455,7 +455,7 @@ components:
455455
type: object
456456
properties:
457457
code:
458-
type: string
458+
type: number
459459
nullable: true
460460
message:
461461
type: string
@@ -467,8 +467,6 @@ components:
467467
required:
468468
- code
469469
- message
470-
- param
471-
- type
472470
description: Error object structure
473471
required:
474472
- error

.speakeasy/gen.lock

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
lockVersion: 2.0.0
22
id: 53e6e641-e7b6-4f11-8e15-1d930a684b2b
33
management:
4-
docChecksum: 94a9004b4eb9d74143f6acdb06982dd9
4+
docChecksum: 43ffe8928bc1b697d9993d04b3024a7c
55
docVersion: 1.0.0
6-
speakeasyVersion: 1.611.0
6+
speakeasyVersion: 1.611.1
77
generationVersion: 2.694.1
8-
releaseVersion: 0.5.3
9-
configChecksum: 86f9fc17e898d37ca28f113762f1344a
8+
releaseVersion: 0.5.4
9+
configChecksum: b79d463e59ce1857adb0434ebe618ccd
1010
repoURL: https://github.com/speakeasy-sdks/openrouter-typescript-sdk.git
1111
installationURL: https://github.com/speakeasy-sdks/openrouter-typescript-sdk
1212
features:
@@ -277,9 +277,9 @@ examples:
277277
"200":
278278
application/json: {"id": "<id>", "choices": [], "created": 6977.95, "model": "El Camino", "object": "chat.completion"}
279279
"400":
280-
application/json: {"error": {"code": "<value>", "message": "<value>", "param": "<value>", "type": "<value>"}}
280+
application/json: {"error": {"code": null, "message": "<value>"}}
281281
"500":
282-
application/json: {"error": {"code": "<value>", "message": "<value>", "param": "<value>", "type": "<value>"}}
282+
application/json: {"error": {"code": null, "message": "<value>"}}
283283
speakeasy-default-create-chat-completion-raw:
284284
requestBody:
285285
text/event-stream: "x-file: example.file"

.speakeasy/gen.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ generation:
2525
generateNewTests: true
2626
skipResponseBodyAssertions: false
2727
typescript:
28-
version: 0.5.3
28+
version: 0.5.4
2929
additionalDependencies:
3030
dependencies: {}
3131
devDependencies: {}

.speakeasy/out.openapi.yaml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -456,7 +456,7 @@ components:
456456
type: object
457457
properties:
458458
code:
459-
type: string
459+
type: number
460460
nullable: true
461461
message:
462462
type: string
@@ -468,8 +468,6 @@ components:
468468
required:
469469
- code
470470
- message
471-
- param
472-
- type
473471
description: Error object structure
474472
required:
475473
- error

.speakeasy/workflow.lock

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
speakeasyVersion: 1.611.0
1+
speakeasyVersion: 1.611.1
22
sources:
33
OpenRouter Chat Completions API:
44
sourceNamespace: open-router-chat-completions-api

docs/models/errort.md

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,16 +10,14 @@ import { ErrorT } from "open-router/models";
1010
let value: ErrorT = {
1111
code: null,
1212
message: "<value>",
13-
param: "<value>",
14-
type: "<value>",
1513
};
1614
```
1715

1816
## Fields
1917

2018
| Field | Type | Required | Description |
2119
| ------------------ | ------------------ | ------------------ | ------------------ |
22-
| `code` | *string* | :heavy_check_mark: | N/A |
20+
| `code` | *number* | :heavy_check_mark: | N/A |
2321
| `message` | *string* | :heavy_check_mark: | N/A |
24-
| `param` | *string* | :heavy_check_mark: | N/A |
25-
| `type` | *string* | :heavy_check_mark: | N/A |
22+
| `param` | *string* | :heavy_minus_sign: | N/A |
23+
| `type` | *string* | :heavy_minus_sign: | N/A |

examples/unauthorized.example.ts

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
import dotenv from "dotenv";
2+
dotenv.config();
3+
import { OpenRouter } from "open-router";
4+
const openRouter = new OpenRouter({
5+
apiKey: "",
6+
});
7+
async function main() {
8+
const result = await openRouter.chat.complete({
9+
model: "openai/gpt-3.5-turbo",
10+
messages: [
11+
{
12+
role: "user",
13+
content: "Hello, how are you?",
14+
},
15+
],
16+
});
17+
console.log(result);
18+
}
19+
main()

jsr.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
{
44
"name": "open-router",
5-
"version": "0.5.3",
5+
"version": "0.5.4",
66
"exports": {
77
".": "./src/index.ts",
88
"./models/errors": "./src/models/errors/index.ts",

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "open-router",
3-
"version": "0.5.3",
3+
"version": "0.5.4",
44
"author": "Speakeasy",
55
"type": "module",
66
"tshy": {

0 commit comments

Comments
 (0)