@openrouter/sdk 0.0.0-beta.33 → 0.0.0-beta.38
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.
- package/FUNCTIONS.md +3 -3
- package/REACT_QUERY.md +4 -4
- package/README.md +9 -9
- package/dist/commonjs/funcs/betaResponsesSend.d.ts +26 -0
- package/dist/commonjs/funcs/betaResponsesSend.d.ts.map +1 -0
- package/dist/commonjs/funcs/{betaResponsesSendRequest.js → betaResponsesSend.js} +5 -13
- package/dist/commonjs/funcs/betaResponsesSend.js.map +1 -0
- package/dist/commonjs/funcs/chatSend.d.ts +3 -13
- package/dist/commonjs/funcs/chatSend.d.ts.map +1 -1
- package/dist/commonjs/funcs/chatSend.js +1 -8
- package/dist/commonjs/funcs/chatSend.js.map +1 -1
- package/dist/commonjs/funcs/modelsList.d.ts +1 -7
- package/dist/commonjs/funcs/modelsList.d.ts.map +1 -1
- package/dist/commonjs/funcs/modelsList.js +1 -8
- package/dist/commonjs/funcs/modelsList.js.map +1 -1
- package/dist/commonjs/lib/config.d.ts +3 -3
- package/dist/commonjs/lib/config.js +3 -3
- package/dist/commonjs/models/createapikeydata.d.ts +120 -0
- package/dist/commonjs/models/createapikeydata.d.ts.map +1 -0
- package/dist/commonjs/models/createapikeydata.js +134 -0
- package/dist/commonjs/models/createapikeydata.js.map +1 -0
- package/dist/commonjs/models/endpointslist.d.ts +8 -8
- package/dist/commonjs/models/endpointslist.d.ts.map +1 -1
- package/dist/commonjs/models/endpointslist.js +13 -13
- package/dist/commonjs/models/endpointslist.js.map +1 -1
- package/dist/commonjs/models/getapikeydata.d.ts +120 -0
- package/dist/commonjs/models/getapikeydata.d.ts.map +1 -0
- package/dist/commonjs/models/getapikeydata.js +134 -0
- package/dist/commonjs/models/getapikeydata.js.map +1 -0
- package/dist/commonjs/models/index.d.ts +5 -4
- package/dist/commonjs/models/index.d.ts.map +1 -1
- package/dist/commonjs/models/index.js +5 -4
- package/dist/commonjs/models/index.js.map +1 -1
- package/dist/commonjs/models/keyinfo.d.ts +8 -8
- package/dist/commonjs/models/listapikeysdata.d.ts +117 -0
- package/dist/commonjs/models/listapikeysdata.d.ts.map +1 -0
- package/dist/commonjs/models/listapikeysdata.js +134 -0
- package/dist/commonjs/models/listapikeysdata.js.map +1 -0
- package/dist/commonjs/models/operations/create.d.ts +43 -68
- package/dist/commonjs/models/operations/create.d.ts.map +1 -1
- package/dist/commonjs/models/operations/create.js +31 -54
- package/dist/commonjs/models/operations/create.js.map +1 -1
- package/dist/commonjs/models/operations/generate.d.ts +103 -103
- package/dist/commonjs/models/operations/generate.d.ts.map +1 -1
- package/dist/commonjs/models/operations/generate.js +142 -153
- package/dist/commonjs/models/operations/generate.js.map +1 -1
- package/dist/commonjs/models/operations/getapikey.d.ts +3 -68
- package/dist/commonjs/models/operations/getapikey.d.ts.map +1 -1
- package/dist/commonjs/models/operations/getapikey.js +4 -55
- package/dist/commonjs/models/operations/getapikey.js.map +1 -1
- package/dist/commonjs/models/operations/listapikeys.d.ts +3 -65
- package/dist/commonjs/models/operations/listapikeys.d.ts.map +1 -1
- package/dist/commonjs/models/operations/listapikeys.js +4 -54
- package/dist/commonjs/models/operations/listapikeys.js.map +1 -1
- package/dist/commonjs/models/operations/sendresponsesrequest.d.ts +1693 -0
- package/dist/commonjs/models/operations/sendresponsesrequest.d.ts.map +1 -1
- package/dist/commonjs/models/operations/sendresponsesrequest.js +1156 -1
- package/dist/commonjs/models/operations/sendresponsesrequest.js.map +1 -1
- package/dist/commonjs/models/operations/update.d.ts +43 -68
- package/dist/commonjs/models/operations/update.d.ts.map +1 -1
- package/dist/commonjs/models/operations/update.js +31 -54
- package/dist/commonjs/models/operations/update.js.map +1 -1
- package/dist/commonjs/models/responsesnonstreamingresponse.d.ts +19 -19
- package/dist/commonjs/models/responsesnonstreamingresponse.d.ts.map +1 -1
- package/dist/commonjs/models/responsesnonstreamingresponse.js +30 -32
- package/dist/commonjs/models/responsesnonstreamingresponse.js.map +1 -1
- package/dist/commonjs/models/responsesoutputitemreasoning.d.ts +3 -0
- package/dist/commonjs/models/responsesoutputitemreasoning.d.ts.map +1 -1
- package/dist/commonjs/models/responsesoutputitemreasoning.js +1 -0
- package/dist/commonjs/models/responsesoutputitemreasoning.js.map +1 -1
- package/dist/commonjs/models/{toolchoice.d.ts → toolchoiceunion.d.ts} +95 -16
- package/dist/commonjs/models/toolchoiceunion.d.ts.map +1 -0
- package/dist/commonjs/models/{toolchoice.js → toolchoiceunion.js} +94 -21
- package/dist/commonjs/models/toolchoiceunion.js.map +1 -0
- package/dist/commonjs/models/updateapikeydata.d.ts +120 -0
- package/dist/commonjs/models/updateapikeydata.d.ts.map +1 -0
- package/dist/commonjs/models/updateapikeydata.js +134 -0
- package/dist/commonjs/models/updateapikeydata.js.map +1 -0
- package/dist/commonjs/react-query/betaResponsesSend.d.ts +23 -0
- package/dist/commonjs/react-query/betaResponsesSend.d.ts.map +1 -0
- package/dist/commonjs/react-query/betaResponsesSend.js +47 -0
- package/dist/commonjs/react-query/betaResponsesSend.js.map +1 -0
- package/dist/commonjs/react-query/chatSend.d.ts +1 -5
- package/dist/commonjs/react-query/chatSend.d.ts.map +1 -1
- package/dist/commonjs/react-query/chatSend.js +0 -3
- package/dist/commonjs/react-query/chatSend.js.map +1 -1
- package/dist/commonjs/react-query/index.d.ts +1 -1
- package/dist/commonjs/react-query/index.d.ts.map +1 -1
- package/dist/commonjs/react-query/index.js +1 -1
- package/dist/commonjs/react-query/index.js.map +1 -1
- package/dist/commonjs/react-query/modelsList.d.ts +1 -5
- package/dist/commonjs/react-query/modelsList.d.ts.map +1 -1
- package/dist/commonjs/react-query/modelsList.js +0 -3
- package/dist/commonjs/react-query/modelsList.js.map +1 -1
- package/dist/commonjs/sdk/chat.d.ts +3 -11
- package/dist/commonjs/sdk/chat.d.ts.map +1 -1
- package/dist/commonjs/sdk/chat.js +1 -3
- package/dist/commonjs/sdk/chat.js.map +1 -1
- package/dist/commonjs/sdk/models.d.ts +1 -5
- package/dist/commonjs/sdk/models.d.ts.map +1 -1
- package/dist/commonjs/sdk/models.js +1 -3
- package/dist/commonjs/sdk/models.js.map +1 -1
- package/dist/commonjs/sdk/responses.d.ts +5 -13
- package/dist/commonjs/sdk/responses.d.ts.map +1 -1
- package/dist/commonjs/sdk/responses.js +4 -6
- package/dist/commonjs/sdk/responses.js.map +1 -1
- package/dist/esm/funcs/betaResponsesSend.d.ts +26 -0
- package/dist/esm/funcs/betaResponsesSend.d.ts.map +1 -0
- package/dist/esm/funcs/{betaResponsesSendRequest.js → betaResponsesSend.js} +4 -11
- package/dist/esm/funcs/betaResponsesSend.js.map +1 -0
- package/dist/esm/funcs/chatSend.d.ts +3 -13
- package/dist/esm/funcs/chatSend.d.ts.map +1 -1
- package/dist/esm/funcs/chatSend.js +1 -7
- package/dist/esm/funcs/chatSend.js.map +1 -1
- package/dist/esm/funcs/modelsList.d.ts +1 -7
- package/dist/esm/funcs/modelsList.d.ts.map +1 -1
- package/dist/esm/funcs/modelsList.js +1 -7
- package/dist/esm/funcs/modelsList.js.map +1 -1
- package/dist/esm/lib/config.d.ts +3 -3
- package/dist/esm/lib/config.js +3 -3
- package/dist/esm/models/createapikeydata.d.ts +120 -0
- package/dist/esm/models/createapikeydata.d.ts.map +1 -0
- package/dist/esm/models/createapikeydata.js +96 -0
- package/dist/esm/models/createapikeydata.js.map +1 -0
- package/dist/esm/models/endpointslist.d.ts +8 -8
- package/dist/esm/models/endpointslist.d.ts.map +1 -1
- package/dist/esm/models/endpointslist.js +12 -12
- package/dist/esm/models/endpointslist.js.map +1 -1
- package/dist/esm/models/getapikeydata.d.ts +120 -0
- package/dist/esm/models/getapikeydata.d.ts.map +1 -0
- package/dist/esm/models/getapikeydata.js +96 -0
- package/dist/esm/models/getapikeydata.js.map +1 -0
- package/dist/esm/models/index.d.ts +5 -4
- package/dist/esm/models/index.d.ts.map +1 -1
- package/dist/esm/models/index.js +5 -4
- package/dist/esm/models/index.js.map +1 -1
- package/dist/esm/models/keyinfo.d.ts +8 -8
- package/dist/esm/models/listapikeysdata.d.ts +117 -0
- package/dist/esm/models/listapikeysdata.d.ts.map +1 -0
- package/dist/esm/models/listapikeysdata.js +96 -0
- package/dist/esm/models/listapikeysdata.js.map +1 -0
- package/dist/esm/models/operations/create.d.ts +43 -68
- package/dist/esm/models/operations/create.d.ts.map +1 -1
- package/dist/esm/models/operations/create.js +30 -51
- package/dist/esm/models/operations/create.js.map +1 -1
- package/dist/esm/models/operations/generate.d.ts +103 -103
- package/dist/esm/models/operations/generate.d.ts.map +1 -1
- package/dist/esm/models/operations/generate.js +138 -149
- package/dist/esm/models/operations/generate.js.map +1 -1
- package/dist/esm/models/operations/getapikey.d.ts +3 -68
- package/dist/esm/models/operations/getapikey.d.ts.map +1 -1
- package/dist/esm/models/operations/getapikey.js +3 -52
- package/dist/esm/models/operations/getapikey.js.map +1 -1
- package/dist/esm/models/operations/listapikeys.d.ts +3 -65
- package/dist/esm/models/operations/listapikeys.d.ts.map +1 -1
- package/dist/esm/models/operations/listapikeys.js +3 -51
- package/dist/esm/models/operations/listapikeys.js.map +1 -1
- package/dist/esm/models/operations/sendresponsesrequest.d.ts +1693 -0
- package/dist/esm/models/operations/sendresponsesrequest.d.ts.map +1 -1
- package/dist/esm/models/operations/sendresponsesrequest.js +1117 -0
- package/dist/esm/models/operations/sendresponsesrequest.js.map +1 -1
- package/dist/esm/models/operations/update.d.ts +43 -68
- package/dist/esm/models/operations/update.d.ts.map +1 -1
- package/dist/esm/models/operations/update.js +30 -51
- package/dist/esm/models/operations/update.js.map +1 -1
- package/dist/esm/models/responsesnonstreamingresponse.d.ts +19 -19
- package/dist/esm/models/responsesnonstreamingresponse.d.ts.map +1 -1
- package/dist/esm/models/responsesnonstreamingresponse.js +29 -31
- package/dist/esm/models/responsesnonstreamingresponse.js.map +1 -1
- package/dist/esm/models/responsesoutputitemreasoning.d.ts +3 -0
- package/dist/esm/models/responsesoutputitemreasoning.d.ts.map +1 -1
- package/dist/esm/models/responsesoutputitemreasoning.js +1 -0
- package/dist/esm/models/responsesoutputitemreasoning.js.map +1 -1
- package/dist/esm/models/{toolchoice.d.ts → toolchoiceunion.d.ts} +95 -16
- package/dist/esm/models/toolchoiceunion.d.ts.map +1 -0
- package/dist/esm/models/toolchoiceunion.js +164 -0
- package/dist/esm/models/toolchoiceunion.js.map +1 -0
- package/dist/esm/models/updateapikeydata.d.ts +120 -0
- package/dist/esm/models/updateapikeydata.d.ts.map +1 -0
- package/dist/esm/models/updateapikeydata.js +96 -0
- package/dist/esm/models/updateapikeydata.js.map +1 -0
- package/dist/esm/react-query/betaResponsesSend.d.ts +23 -0
- package/dist/esm/react-query/betaResponsesSend.d.ts.map +1 -0
- package/dist/esm/react-query/{betaResponsesSendRequest.js → betaResponsesSend.js} +10 -11
- package/dist/esm/react-query/betaResponsesSend.js.map +1 -0
- package/dist/esm/react-query/chatSend.d.ts +1 -5
- package/dist/esm/react-query/chatSend.d.ts.map +1 -1
- package/dist/esm/react-query/chatSend.js +0 -1
- package/dist/esm/react-query/chatSend.js.map +1 -1
- package/dist/esm/react-query/index.d.ts +1 -1
- package/dist/esm/react-query/index.d.ts.map +1 -1
- package/dist/esm/react-query/index.js +1 -1
- package/dist/esm/react-query/index.js.map +1 -1
- package/dist/esm/react-query/modelsList.d.ts +1 -5
- package/dist/esm/react-query/modelsList.d.ts.map +1 -1
- package/dist/esm/react-query/modelsList.js +0 -1
- package/dist/esm/react-query/modelsList.js.map +1 -1
- package/dist/esm/sdk/chat.d.ts +3 -11
- package/dist/esm/sdk/chat.d.ts.map +1 -1
- package/dist/esm/sdk/chat.js +0 -1
- package/dist/esm/sdk/chat.js.map +1 -1
- package/dist/esm/sdk/models.d.ts +1 -5
- package/dist/esm/sdk/models.d.ts.map +1 -1
- package/dist/esm/sdk/models.js +0 -1
- package/dist/esm/sdk/models.js.map +1 -1
- package/dist/esm/sdk/responses.d.ts +5 -13
- package/dist/esm/sdk/responses.d.ts.map +1 -1
- package/dist/esm/sdk/responses.js +3 -4
- package/dist/esm/sdk/responses.js.map +1 -1
- package/docs/sdks/apikeys/README.md +4 -0
- package/docs/sdks/responses/README.md +9 -9
- package/examples/{betaResponsesSendRequest.example.ts → betaResponsesSend.example.ts} +2 -2
- package/jsr.json +1 -1
- package/package.json +1 -1
- package/src/funcs/{betaResponsesSendRequest.ts → betaResponsesSend.ts} +17 -22
- package/src/funcs/chatSend.ts +6 -12
- package/src/funcs/modelsList.ts +3 -9
- package/src/lib/config.ts +3 -3
- package/src/models/createapikeydata.ts +222 -0
- package/src/models/endpointslist.ts +14 -18
- package/src/models/getapikeydata.ts +218 -0
- package/src/models/index.ts +5 -4
- package/src/models/keyinfo.ts +8 -8
- package/src/models/listapikeysdata.ts +217 -0
- package/src/models/operations/create.ts +49 -123
- package/src/models/operations/generate.ts +232 -188
- package/src/models/operations/getapikey.ts +5 -124
- package/src/models/operations/listapikeys.ts +5 -122
- package/src/models/operations/sendresponsesrequest.ts +2005 -0
- package/src/models/operations/update.ts +49 -123
- package/src/models/responsesnonstreamingresponse.ts +37 -55
- package/src/models/responsesoutputitemreasoning.ts +1 -0
- package/src/models/{toolchoice.ts → toolchoiceunion.ts} +181 -37
- package/src/models/updateapikeydata.ts +222 -0
- package/src/react-query/{betaResponsesSendRequest.ts → betaResponsesSend.ts} +20 -26
- package/src/react-query/chatSend.ts +2 -4
- package/src/react-query/index.ts +1 -1
- package/src/react-query/modelsList.ts +2 -4
- package/src/sdk/chat.ts +5 -7
- package/src/sdk/models.ts +2 -4
- package/src/sdk/responses.ts +16 -19
- package/dist/commonjs/funcs/betaResponsesSendRequest.d.ts +0 -36
- package/dist/commonjs/funcs/betaResponsesSendRequest.d.ts.map +0 -1
- package/dist/commonjs/funcs/betaResponsesSendRequest.js.map +0 -1
- package/dist/commonjs/models/openairesponsesrequest.d.ts +0 -1704
- package/dist/commonjs/models/openairesponsesrequest.d.ts.map +0 -1
- package/dist/commonjs/models/openairesponsesrequest.js +0 -1210
- package/dist/commonjs/models/openairesponsesrequest.js.map +0 -1
- package/dist/commonjs/models/toolchoice.d.ts.map +0 -1
- package/dist/commonjs/models/toolchoice.js.map +0 -1
- package/dist/commonjs/models/toolchoicefunction.d.ts +0 -57
- package/dist/commonjs/models/toolchoicefunction.d.ts.map +0 -1
- package/dist/commonjs/models/toolchoicefunction.js +0 -89
- package/dist/commonjs/models/toolchoicefunction.js.map +0 -1
- package/dist/commonjs/models/toolchoicetypes.d.ts +0 -33
- package/dist/commonjs/models/toolchoicetypes.d.ts.map +0 -1
- package/dist/commonjs/models/toolchoicetypes.js +0 -70
- package/dist/commonjs/models/toolchoicetypes.js.map +0 -1
- package/dist/commonjs/react-query/betaResponsesSendRequest.d.ts +0 -28
- package/dist/commonjs/react-query/betaResponsesSendRequest.d.ts.map +0 -1
- package/dist/commonjs/react-query/betaResponsesSendRequest.js +0 -50
- package/dist/commonjs/react-query/betaResponsesSendRequest.js.map +0 -1
- package/dist/esm/funcs/betaResponsesSendRequest.d.ts +0 -36
- package/dist/esm/funcs/betaResponsesSendRequest.d.ts.map +0 -1
- package/dist/esm/funcs/betaResponsesSendRequest.js.map +0 -1
- package/dist/esm/models/openairesponsesrequest.d.ts +0 -1704
- package/dist/esm/models/openairesponsesrequest.d.ts.map +0 -1
- package/dist/esm/models/openairesponsesrequest.js +0 -1136
- package/dist/esm/models/openairesponsesrequest.js.map +0 -1
- package/dist/esm/models/toolchoice.d.ts.map +0 -1
- package/dist/esm/models/toolchoice.js +0 -95
- package/dist/esm/models/toolchoice.js.map +0 -1
- package/dist/esm/models/toolchoicefunction.d.ts +0 -57
- package/dist/esm/models/toolchoicefunction.d.ts.map +0 -1
- package/dist/esm/models/toolchoicefunction.js +0 -51
- package/dist/esm/models/toolchoicefunction.js.map +0 -1
- package/dist/esm/models/toolchoicetypes.d.ts +0 -33
- package/dist/esm/models/toolchoicetypes.d.ts.map +0 -1
- package/dist/esm/models/toolchoicetypes.js +0 -32
- package/dist/esm/models/toolchoicetypes.js.map +0 -1
- package/dist/esm/react-query/betaResponsesSendRequest.d.ts +0 -28
- package/dist/esm/react-query/betaResponsesSendRequest.d.ts.map +0 -1
- package/dist/esm/react-query/betaResponsesSendRequest.js.map +0 -1
- package/src/models/openairesponsesrequest.ts +0 -1974
- package/src/models/toolchoicefunction.ts +0 -100
- package/src/models/toolchoicetypes.ts +0 -73
|
@@ -0,0 +1,218 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import * as z from "zod";
|
|
6
|
+
import { remap as remap$ } from "../lib/primitives.js";
|
|
7
|
+
import { safeParse } from "../lib/schemas.js";
|
|
8
|
+
import { Result as SafeParseResult } from "../types/fp.js";
|
|
9
|
+
import { SDKValidationError } from "./errors/sdkvalidationerror.js";
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* The API key information
|
|
13
|
+
*/
|
|
14
|
+
export type GetAPIKeyData = {
|
|
15
|
+
/**
|
|
16
|
+
* Unique hash identifier for the API key
|
|
17
|
+
*/
|
|
18
|
+
hash: string;
|
|
19
|
+
/**
|
|
20
|
+
* Name of the API key
|
|
21
|
+
*/
|
|
22
|
+
name: string;
|
|
23
|
+
/**
|
|
24
|
+
* Human-readable label for the API key
|
|
25
|
+
*/
|
|
26
|
+
label: string;
|
|
27
|
+
/**
|
|
28
|
+
* Whether the API key is disabled
|
|
29
|
+
*/
|
|
30
|
+
disabled: boolean;
|
|
31
|
+
/**
|
|
32
|
+
* Spending limit for the API key in USD
|
|
33
|
+
*/
|
|
34
|
+
limit: number | null;
|
|
35
|
+
/**
|
|
36
|
+
* Remaining spending limit in USD
|
|
37
|
+
*/
|
|
38
|
+
limitRemaining: number | null;
|
|
39
|
+
/**
|
|
40
|
+
* Type of limit reset for the API key
|
|
41
|
+
*/
|
|
42
|
+
limitReset: string | null;
|
|
43
|
+
/**
|
|
44
|
+
* Whether to include external BYOK usage in the credit limit
|
|
45
|
+
*/
|
|
46
|
+
includeByokInLimit: boolean;
|
|
47
|
+
/**
|
|
48
|
+
* Total OpenRouter credit usage (in USD) for the API key
|
|
49
|
+
*/
|
|
50
|
+
usage: number;
|
|
51
|
+
/**
|
|
52
|
+
* OpenRouter credit usage (in USD) for the current UTC day
|
|
53
|
+
*/
|
|
54
|
+
usageDaily: number;
|
|
55
|
+
/**
|
|
56
|
+
* OpenRouter credit usage (in USD) for the current UTC week (Monday-Sunday)
|
|
57
|
+
*/
|
|
58
|
+
usageWeekly: number;
|
|
59
|
+
/**
|
|
60
|
+
* OpenRouter credit usage (in USD) for the current UTC month
|
|
61
|
+
*/
|
|
62
|
+
usageMonthly: number;
|
|
63
|
+
/**
|
|
64
|
+
* Total external BYOK usage (in USD) for the API key
|
|
65
|
+
*/
|
|
66
|
+
byokUsage: number;
|
|
67
|
+
/**
|
|
68
|
+
* External BYOK usage (in USD) for the current UTC day
|
|
69
|
+
*/
|
|
70
|
+
byokUsageDaily: number;
|
|
71
|
+
/**
|
|
72
|
+
* External BYOK usage (in USD) for the current UTC week (Monday-Sunday)
|
|
73
|
+
*/
|
|
74
|
+
byokUsageWeekly: number;
|
|
75
|
+
/**
|
|
76
|
+
* External BYOK usage (in USD) for current UTC month
|
|
77
|
+
*/
|
|
78
|
+
byokUsageMonthly: number;
|
|
79
|
+
/**
|
|
80
|
+
* ISO 8601 timestamp of when the API key was created
|
|
81
|
+
*/
|
|
82
|
+
createdAt: string;
|
|
83
|
+
/**
|
|
84
|
+
* ISO 8601 timestamp of when the API key was last updated
|
|
85
|
+
*/
|
|
86
|
+
updatedAt: string | null;
|
|
87
|
+
};
|
|
88
|
+
|
|
89
|
+
/** @internal */
|
|
90
|
+
export const GetAPIKeyData$inboundSchema: z.ZodType<
|
|
91
|
+
GetAPIKeyData,
|
|
92
|
+
z.ZodTypeDef,
|
|
93
|
+
unknown
|
|
94
|
+
> = z.object({
|
|
95
|
+
hash: z.string(),
|
|
96
|
+
name: z.string(),
|
|
97
|
+
label: z.string(),
|
|
98
|
+
disabled: z.boolean(),
|
|
99
|
+
limit: z.nullable(z.number()),
|
|
100
|
+
limit_remaining: z.nullable(z.number()),
|
|
101
|
+
limit_reset: z.nullable(z.string()),
|
|
102
|
+
include_byok_in_limit: z.boolean(),
|
|
103
|
+
usage: z.number(),
|
|
104
|
+
usage_daily: z.number(),
|
|
105
|
+
usage_weekly: z.number(),
|
|
106
|
+
usage_monthly: z.number(),
|
|
107
|
+
byok_usage: z.number(),
|
|
108
|
+
byok_usage_daily: z.number(),
|
|
109
|
+
byok_usage_weekly: z.number(),
|
|
110
|
+
byok_usage_monthly: z.number(),
|
|
111
|
+
created_at: z.string(),
|
|
112
|
+
updated_at: z.nullable(z.string()),
|
|
113
|
+
}).transform((v) => {
|
|
114
|
+
return remap$(v, {
|
|
115
|
+
"limit_remaining": "limitRemaining",
|
|
116
|
+
"limit_reset": "limitReset",
|
|
117
|
+
"include_byok_in_limit": "includeByokInLimit",
|
|
118
|
+
"usage_daily": "usageDaily",
|
|
119
|
+
"usage_weekly": "usageWeekly",
|
|
120
|
+
"usage_monthly": "usageMonthly",
|
|
121
|
+
"byok_usage": "byokUsage",
|
|
122
|
+
"byok_usage_daily": "byokUsageDaily",
|
|
123
|
+
"byok_usage_weekly": "byokUsageWeekly",
|
|
124
|
+
"byok_usage_monthly": "byokUsageMonthly",
|
|
125
|
+
"created_at": "createdAt",
|
|
126
|
+
"updated_at": "updatedAt",
|
|
127
|
+
});
|
|
128
|
+
});
|
|
129
|
+
|
|
130
|
+
/** @internal */
|
|
131
|
+
export type GetAPIKeyData$Outbound = {
|
|
132
|
+
hash: string;
|
|
133
|
+
name: string;
|
|
134
|
+
label: string;
|
|
135
|
+
disabled: boolean;
|
|
136
|
+
limit: number | null;
|
|
137
|
+
limit_remaining: number | null;
|
|
138
|
+
limit_reset: string | null;
|
|
139
|
+
include_byok_in_limit: boolean;
|
|
140
|
+
usage: number;
|
|
141
|
+
usage_daily: number;
|
|
142
|
+
usage_weekly: number;
|
|
143
|
+
usage_monthly: number;
|
|
144
|
+
byok_usage: number;
|
|
145
|
+
byok_usage_daily: number;
|
|
146
|
+
byok_usage_weekly: number;
|
|
147
|
+
byok_usage_monthly: number;
|
|
148
|
+
created_at: string;
|
|
149
|
+
updated_at: string | null;
|
|
150
|
+
};
|
|
151
|
+
|
|
152
|
+
/** @internal */
|
|
153
|
+
export const GetAPIKeyData$outboundSchema: z.ZodType<
|
|
154
|
+
GetAPIKeyData$Outbound,
|
|
155
|
+
z.ZodTypeDef,
|
|
156
|
+
GetAPIKeyData
|
|
157
|
+
> = z.object({
|
|
158
|
+
hash: z.string(),
|
|
159
|
+
name: z.string(),
|
|
160
|
+
label: z.string(),
|
|
161
|
+
disabled: z.boolean(),
|
|
162
|
+
limit: z.nullable(z.number()),
|
|
163
|
+
limitRemaining: z.nullable(z.number()),
|
|
164
|
+
limitReset: z.nullable(z.string()),
|
|
165
|
+
includeByokInLimit: z.boolean(),
|
|
166
|
+
usage: z.number(),
|
|
167
|
+
usageDaily: z.number(),
|
|
168
|
+
usageWeekly: z.number(),
|
|
169
|
+
usageMonthly: z.number(),
|
|
170
|
+
byokUsage: z.number(),
|
|
171
|
+
byokUsageDaily: z.number(),
|
|
172
|
+
byokUsageWeekly: z.number(),
|
|
173
|
+
byokUsageMonthly: z.number(),
|
|
174
|
+
createdAt: z.string(),
|
|
175
|
+
updatedAt: z.nullable(z.string()),
|
|
176
|
+
}).transform((v) => {
|
|
177
|
+
return remap$(v, {
|
|
178
|
+
limitRemaining: "limit_remaining",
|
|
179
|
+
limitReset: "limit_reset",
|
|
180
|
+
includeByokInLimit: "include_byok_in_limit",
|
|
181
|
+
usageDaily: "usage_daily",
|
|
182
|
+
usageWeekly: "usage_weekly",
|
|
183
|
+
usageMonthly: "usage_monthly",
|
|
184
|
+
byokUsage: "byok_usage",
|
|
185
|
+
byokUsageDaily: "byok_usage_daily",
|
|
186
|
+
byokUsageWeekly: "byok_usage_weekly",
|
|
187
|
+
byokUsageMonthly: "byok_usage_monthly",
|
|
188
|
+
createdAt: "created_at",
|
|
189
|
+
updatedAt: "updated_at",
|
|
190
|
+
});
|
|
191
|
+
});
|
|
192
|
+
|
|
193
|
+
/**
|
|
194
|
+
* @internal
|
|
195
|
+
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
|
|
196
|
+
*/
|
|
197
|
+
export namespace GetAPIKeyData$ {
|
|
198
|
+
/** @deprecated use `GetAPIKeyData$inboundSchema` instead. */
|
|
199
|
+
export const inboundSchema = GetAPIKeyData$inboundSchema;
|
|
200
|
+
/** @deprecated use `GetAPIKeyData$outboundSchema` instead. */
|
|
201
|
+
export const outboundSchema = GetAPIKeyData$outboundSchema;
|
|
202
|
+
/** @deprecated use `GetAPIKeyData$Outbound` instead. */
|
|
203
|
+
export type Outbound = GetAPIKeyData$Outbound;
|
|
204
|
+
}
|
|
205
|
+
|
|
206
|
+
export function getAPIKeyDataToJSON(getAPIKeyData: GetAPIKeyData): string {
|
|
207
|
+
return JSON.stringify(GetAPIKeyData$outboundSchema.parse(getAPIKeyData));
|
|
208
|
+
}
|
|
209
|
+
|
|
210
|
+
export function getAPIKeyDataFromJSON(
|
|
211
|
+
jsonString: string,
|
|
212
|
+
): SafeParseResult<GetAPIKeyData, SDKValidationError> {
|
|
213
|
+
return safeParse(
|
|
214
|
+
jsonString,
|
|
215
|
+
(x) => GetAPIKeyData$inboundSchema.parse(JSON.parse(x)),
|
|
216
|
+
`Failed to parse 'GetAPIKeyData' from JSON`,
|
|
217
|
+
);
|
|
218
|
+
}
|
package/src/models/index.ts
CHANGED
|
@@ -27,13 +27,15 @@ export * from "./completionfinishreason.js";
|
|
|
27
27
|
export * from "./completionlogprobs.js";
|
|
28
28
|
export * from "./completionresponse.js";
|
|
29
29
|
export * from "./completionusage.js";
|
|
30
|
+
export * from "./createapikeydata.js";
|
|
30
31
|
export * from "./endpointslist.js";
|
|
31
32
|
export * from "./errorresponse.js";
|
|
33
|
+
export * from "./getapikeydata.js";
|
|
32
34
|
export * from "./keyinfo.js";
|
|
35
|
+
export * from "./listapikeysdata.js";
|
|
33
36
|
export * from "./message.js";
|
|
34
37
|
export * from "./modelslist.js";
|
|
35
38
|
export * from "./namedtoolchoice.js";
|
|
36
|
-
export * from "./openairesponsesrequest.js";
|
|
37
39
|
export * from "./responseeasyinputmessage.js";
|
|
38
40
|
export * from "./responseformatjsonobject.js";
|
|
39
41
|
export * from "./responseformatjsonschema.js";
|
|
@@ -86,9 +88,8 @@ export * from "./responsetextverbosity.js";
|
|
|
86
88
|
export * from "./security.js";
|
|
87
89
|
export * from "./systemmessage.js";
|
|
88
90
|
export * from "./tool.js";
|
|
89
|
-
export * from "./toolchoice.js";
|
|
90
|
-
export * from "./toolchoicefunction.js";
|
|
91
|
-
export * from "./toolchoicetypes.js";
|
|
92
91
|
export * from "./toolchoicetypeunion.js";
|
|
92
|
+
export * from "./toolchoiceunion.js";
|
|
93
93
|
export * from "./toolresponsemessage.js";
|
|
94
|
+
export * from "./updateapikeydata.js";
|
|
94
95
|
export * from "./usermessage.js";
|
package/src/models/keyinfo.ts
CHANGED
|
@@ -41,35 +41,35 @@ export type KeyInfo = {
|
|
|
41
41
|
*/
|
|
42
42
|
limit: number | null;
|
|
43
43
|
/**
|
|
44
|
-
*
|
|
44
|
+
* Total OpenRouter credit usage (in USD) for the API key
|
|
45
45
|
*/
|
|
46
46
|
usage: number;
|
|
47
47
|
/**
|
|
48
|
-
*
|
|
48
|
+
* OpenRouter credit usage (in USD) for the current UTC day
|
|
49
49
|
*/
|
|
50
50
|
usageDaily: number;
|
|
51
51
|
/**
|
|
52
|
-
*
|
|
52
|
+
* OpenRouter credit usage (in USD) for the current UTC week (Monday-Sunday)
|
|
53
53
|
*/
|
|
54
54
|
usageWeekly: number;
|
|
55
55
|
/**
|
|
56
|
-
*
|
|
56
|
+
* OpenRouter credit usage (in USD) for the current UTC month
|
|
57
57
|
*/
|
|
58
58
|
usageMonthly: number;
|
|
59
59
|
/**
|
|
60
|
-
*
|
|
60
|
+
* Total external BYOK usage (in USD) for the API key
|
|
61
61
|
*/
|
|
62
62
|
byokUsage: number;
|
|
63
63
|
/**
|
|
64
|
-
*
|
|
64
|
+
* External BYOK usage (in USD) for the current UTC day
|
|
65
65
|
*/
|
|
66
66
|
byokUsageDaily: number;
|
|
67
67
|
/**
|
|
68
|
-
*
|
|
68
|
+
* External BYOK usage (in USD) for the current UTC week (Monday-Sunday)
|
|
69
69
|
*/
|
|
70
70
|
byokUsageWeekly: number;
|
|
71
71
|
/**
|
|
72
|
-
*
|
|
72
|
+
* External BYOK usage (in USD) for current UTC month
|
|
73
73
|
*/
|
|
74
74
|
byokUsageMonthly: number;
|
|
75
75
|
/**
|
|
@@ -0,0 +1,217 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import * as z from "zod";
|
|
6
|
+
import { remap as remap$ } from "../lib/primitives.js";
|
|
7
|
+
import { safeParse } from "../lib/schemas.js";
|
|
8
|
+
import { Result as SafeParseResult } from "../types/fp.js";
|
|
9
|
+
import { SDKValidationError } from "./errors/sdkvalidationerror.js";
|
|
10
|
+
|
|
11
|
+
export type ListAPIKeysData = {
|
|
12
|
+
/**
|
|
13
|
+
* Unique hash identifier for the API key
|
|
14
|
+
*/
|
|
15
|
+
hash: string;
|
|
16
|
+
/**
|
|
17
|
+
* Name of the API key
|
|
18
|
+
*/
|
|
19
|
+
name: string;
|
|
20
|
+
/**
|
|
21
|
+
* Human-readable label for the API key
|
|
22
|
+
*/
|
|
23
|
+
label: string;
|
|
24
|
+
/**
|
|
25
|
+
* Whether the API key is disabled
|
|
26
|
+
*/
|
|
27
|
+
disabled: boolean;
|
|
28
|
+
/**
|
|
29
|
+
* Spending limit for the API key in USD
|
|
30
|
+
*/
|
|
31
|
+
limit: number | null;
|
|
32
|
+
/**
|
|
33
|
+
* Remaining spending limit in USD
|
|
34
|
+
*/
|
|
35
|
+
limitRemaining: number | null;
|
|
36
|
+
/**
|
|
37
|
+
* Type of limit reset for the API key
|
|
38
|
+
*/
|
|
39
|
+
limitReset: string | null;
|
|
40
|
+
/**
|
|
41
|
+
* Whether to include external BYOK usage in the credit limit
|
|
42
|
+
*/
|
|
43
|
+
includeByokInLimit: boolean;
|
|
44
|
+
/**
|
|
45
|
+
* Total OpenRouter credit usage (in USD) for the API key
|
|
46
|
+
*/
|
|
47
|
+
usage: number;
|
|
48
|
+
/**
|
|
49
|
+
* OpenRouter credit usage (in USD) for the current UTC day
|
|
50
|
+
*/
|
|
51
|
+
usageDaily: number;
|
|
52
|
+
/**
|
|
53
|
+
* OpenRouter credit usage (in USD) for the current UTC week (Monday-Sunday)
|
|
54
|
+
*/
|
|
55
|
+
usageWeekly: number;
|
|
56
|
+
/**
|
|
57
|
+
* OpenRouter credit usage (in USD) for the current UTC month
|
|
58
|
+
*/
|
|
59
|
+
usageMonthly: number;
|
|
60
|
+
/**
|
|
61
|
+
* Total external BYOK usage (in USD) for the API key
|
|
62
|
+
*/
|
|
63
|
+
byokUsage: number;
|
|
64
|
+
/**
|
|
65
|
+
* External BYOK usage (in USD) for the current UTC day
|
|
66
|
+
*/
|
|
67
|
+
byokUsageDaily: number;
|
|
68
|
+
/**
|
|
69
|
+
* External BYOK usage (in USD) for the current UTC week (Monday-Sunday)
|
|
70
|
+
*/
|
|
71
|
+
byokUsageWeekly: number;
|
|
72
|
+
/**
|
|
73
|
+
* External BYOK usage (in USD) for current UTC month
|
|
74
|
+
*/
|
|
75
|
+
byokUsageMonthly: number;
|
|
76
|
+
/**
|
|
77
|
+
* ISO 8601 timestamp of when the API key was created
|
|
78
|
+
*/
|
|
79
|
+
createdAt: string;
|
|
80
|
+
/**
|
|
81
|
+
* ISO 8601 timestamp of when the API key was last updated
|
|
82
|
+
*/
|
|
83
|
+
updatedAt: string | null;
|
|
84
|
+
};
|
|
85
|
+
|
|
86
|
+
/** @internal */
|
|
87
|
+
export const ListAPIKeysData$inboundSchema: z.ZodType<
|
|
88
|
+
ListAPIKeysData,
|
|
89
|
+
z.ZodTypeDef,
|
|
90
|
+
unknown
|
|
91
|
+
> = z.object({
|
|
92
|
+
hash: z.string(),
|
|
93
|
+
name: z.string(),
|
|
94
|
+
label: z.string(),
|
|
95
|
+
disabled: z.boolean(),
|
|
96
|
+
limit: z.nullable(z.number()),
|
|
97
|
+
limit_remaining: z.nullable(z.number()),
|
|
98
|
+
limit_reset: z.nullable(z.string()),
|
|
99
|
+
include_byok_in_limit: z.boolean(),
|
|
100
|
+
usage: z.number(),
|
|
101
|
+
usage_daily: z.number(),
|
|
102
|
+
usage_weekly: z.number(),
|
|
103
|
+
usage_monthly: z.number(),
|
|
104
|
+
byok_usage: z.number(),
|
|
105
|
+
byok_usage_daily: z.number(),
|
|
106
|
+
byok_usage_weekly: z.number(),
|
|
107
|
+
byok_usage_monthly: z.number(),
|
|
108
|
+
created_at: z.string(),
|
|
109
|
+
updated_at: z.nullable(z.string()),
|
|
110
|
+
}).transform((v) => {
|
|
111
|
+
return remap$(v, {
|
|
112
|
+
"limit_remaining": "limitRemaining",
|
|
113
|
+
"limit_reset": "limitReset",
|
|
114
|
+
"include_byok_in_limit": "includeByokInLimit",
|
|
115
|
+
"usage_daily": "usageDaily",
|
|
116
|
+
"usage_weekly": "usageWeekly",
|
|
117
|
+
"usage_monthly": "usageMonthly",
|
|
118
|
+
"byok_usage": "byokUsage",
|
|
119
|
+
"byok_usage_daily": "byokUsageDaily",
|
|
120
|
+
"byok_usage_weekly": "byokUsageWeekly",
|
|
121
|
+
"byok_usage_monthly": "byokUsageMonthly",
|
|
122
|
+
"created_at": "createdAt",
|
|
123
|
+
"updated_at": "updatedAt",
|
|
124
|
+
});
|
|
125
|
+
});
|
|
126
|
+
|
|
127
|
+
/** @internal */
|
|
128
|
+
export type ListAPIKeysData$Outbound = {
|
|
129
|
+
hash: string;
|
|
130
|
+
name: string;
|
|
131
|
+
label: string;
|
|
132
|
+
disabled: boolean;
|
|
133
|
+
limit: number | null;
|
|
134
|
+
limit_remaining: number | null;
|
|
135
|
+
limit_reset: string | null;
|
|
136
|
+
include_byok_in_limit: boolean;
|
|
137
|
+
usage: number;
|
|
138
|
+
usage_daily: number;
|
|
139
|
+
usage_weekly: number;
|
|
140
|
+
usage_monthly: number;
|
|
141
|
+
byok_usage: number;
|
|
142
|
+
byok_usage_daily: number;
|
|
143
|
+
byok_usage_weekly: number;
|
|
144
|
+
byok_usage_monthly: number;
|
|
145
|
+
created_at: string;
|
|
146
|
+
updated_at: string | null;
|
|
147
|
+
};
|
|
148
|
+
|
|
149
|
+
/** @internal */
|
|
150
|
+
export const ListAPIKeysData$outboundSchema: z.ZodType<
|
|
151
|
+
ListAPIKeysData$Outbound,
|
|
152
|
+
z.ZodTypeDef,
|
|
153
|
+
ListAPIKeysData
|
|
154
|
+
> = z.object({
|
|
155
|
+
hash: z.string(),
|
|
156
|
+
name: z.string(),
|
|
157
|
+
label: z.string(),
|
|
158
|
+
disabled: z.boolean(),
|
|
159
|
+
limit: z.nullable(z.number()),
|
|
160
|
+
limitRemaining: z.nullable(z.number()),
|
|
161
|
+
limitReset: z.nullable(z.string()),
|
|
162
|
+
includeByokInLimit: z.boolean(),
|
|
163
|
+
usage: z.number(),
|
|
164
|
+
usageDaily: z.number(),
|
|
165
|
+
usageWeekly: z.number(),
|
|
166
|
+
usageMonthly: z.number(),
|
|
167
|
+
byokUsage: z.number(),
|
|
168
|
+
byokUsageDaily: z.number(),
|
|
169
|
+
byokUsageWeekly: z.number(),
|
|
170
|
+
byokUsageMonthly: z.number(),
|
|
171
|
+
createdAt: z.string(),
|
|
172
|
+
updatedAt: z.nullable(z.string()),
|
|
173
|
+
}).transform((v) => {
|
|
174
|
+
return remap$(v, {
|
|
175
|
+
limitRemaining: "limit_remaining",
|
|
176
|
+
limitReset: "limit_reset",
|
|
177
|
+
includeByokInLimit: "include_byok_in_limit",
|
|
178
|
+
usageDaily: "usage_daily",
|
|
179
|
+
usageWeekly: "usage_weekly",
|
|
180
|
+
usageMonthly: "usage_monthly",
|
|
181
|
+
byokUsage: "byok_usage",
|
|
182
|
+
byokUsageDaily: "byok_usage_daily",
|
|
183
|
+
byokUsageWeekly: "byok_usage_weekly",
|
|
184
|
+
byokUsageMonthly: "byok_usage_monthly",
|
|
185
|
+
createdAt: "created_at",
|
|
186
|
+
updatedAt: "updated_at",
|
|
187
|
+
});
|
|
188
|
+
});
|
|
189
|
+
|
|
190
|
+
/**
|
|
191
|
+
* @internal
|
|
192
|
+
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
|
|
193
|
+
*/
|
|
194
|
+
export namespace ListAPIKeysData$ {
|
|
195
|
+
/** @deprecated use `ListAPIKeysData$inboundSchema` instead. */
|
|
196
|
+
export const inboundSchema = ListAPIKeysData$inboundSchema;
|
|
197
|
+
/** @deprecated use `ListAPIKeysData$outboundSchema` instead. */
|
|
198
|
+
export const outboundSchema = ListAPIKeysData$outboundSchema;
|
|
199
|
+
/** @deprecated use `ListAPIKeysData$Outbound` instead. */
|
|
200
|
+
export type Outbound = ListAPIKeysData$Outbound;
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
export function listAPIKeysDataToJSON(
|
|
204
|
+
listAPIKeysData: ListAPIKeysData,
|
|
205
|
+
): string {
|
|
206
|
+
return JSON.stringify(ListAPIKeysData$outboundSchema.parse(listAPIKeysData));
|
|
207
|
+
}
|
|
208
|
+
|
|
209
|
+
export function listAPIKeysDataFromJSON(
|
|
210
|
+
jsonString: string,
|
|
211
|
+
): SafeParseResult<ListAPIKeysData, SDKValidationError> {
|
|
212
|
+
return safeParse(
|
|
213
|
+
jsonString,
|
|
214
|
+
(x) => ListAPIKeysData$inboundSchema.parse(JSON.parse(x)),
|
|
215
|
+
`Failed to parse 'ListAPIKeysData' from JSON`,
|
|
216
|
+
);
|
|
217
|
+
}
|