@keystrokehq/openrouter 0.1.0 → 0.1.3
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/dist/action.cjs.map +1 -1
- package/dist/action.mjs.map +1 -1
- package/dist/actions/create-chat-completion.cjs +24 -24
- package/dist/actions/create-chat-completion.cjs.map +1 -1
- package/dist/actions/create-chat-completion.d.cts +92 -3
- package/dist/actions/create-chat-completion.d.cts.map +1 -1
- package/dist/actions/create-chat-completion.d.mts +92 -3
- package/dist/actions/create-chat-completion.d.mts.map +1 -1
- package/dist/actions/create-chat-completion.mjs +24 -24
- package/dist/actions/create-chat-completion.mjs.map +1 -1
- package/dist/actions/create-coinbase-charge.cjs +6 -6
- package/dist/actions/create-coinbase-charge.cjs.map +1 -1
- package/dist/actions/create-coinbase-charge.d.cts +24 -3
- package/dist/actions/create-coinbase-charge.d.cts.map +1 -1
- package/dist/actions/create-coinbase-charge.d.mts +24 -3
- package/dist/actions/create-coinbase-charge.d.mts.map +1 -1
- package/dist/actions/create-coinbase-charge.mjs +6 -6
- package/dist/actions/create-coinbase-charge.mjs.map +1 -1
- package/dist/actions/create-message.cjs +14 -14
- package/dist/actions/create-message.cjs.map +1 -1
- package/dist/actions/create-message.d.cts +148 -3
- package/dist/actions/create-message.d.cts.map +1 -1
- package/dist/actions/create-message.d.mts +148 -3
- package/dist/actions/create-message.d.mts.map +1 -1
- package/dist/actions/create-message.mjs +14 -14
- package/dist/actions/create-message.mjs.map +1 -1
- package/dist/actions/get-credits.cjs +4 -4
- package/dist/actions/get-credits.cjs.map +1 -1
- package/dist/actions/get-credits.d.cts +8 -3
- package/dist/actions/get-credits.d.cts.map +1 -1
- package/dist/actions/get-credits.d.mts +8 -3
- package/dist/actions/get-credits.d.mts.map +1 -1
- package/dist/actions/get-credits.mjs +4 -4
- package/dist/actions/get-credits.mjs.map +1 -1
- package/dist/actions/get-current-key.cjs +19 -19
- package/dist/actions/get-current-key.cjs.map +1 -1
- package/dist/actions/get-current-key.d.cts +34 -3
- package/dist/actions/get-current-key.d.cts.map +1 -1
- package/dist/actions/get-current-key.d.mts +34 -3
- package/dist/actions/get-current-key.d.mts.map +1 -1
- package/dist/actions/get-current-key.mjs +19 -19
- package/dist/actions/get-current-key.mjs.map +1 -1
- package/dist/actions/get-generation.cjs +21 -21
- package/dist/actions/get-generation.cjs.map +1 -1
- package/dist/actions/get-generation.d.cts +37 -3
- package/dist/actions/get-generation.d.cts.map +1 -1
- package/dist/actions/get-generation.d.mts +37 -3
- package/dist/actions/get-generation.d.mts.map +1 -1
- package/dist/actions/get-generation.mjs +21 -21
- package/dist/actions/get-generation.mjs.map +1 -1
- package/dist/actions/get-models-count.cjs +2 -2
- package/dist/actions/get-models-count.cjs.map +1 -1
- package/dist/actions/get-models-count.d.cts +13 -3
- package/dist/actions/get-models-count.d.cts.map +1 -1
- package/dist/actions/get-models-count.d.mts +13 -3
- package/dist/actions/get-models-count.d.mts.map +1 -1
- package/dist/actions/get-models-count.mjs +2 -2
- package/dist/actions/get-models-count.mjs.map +1 -1
- package/dist/actions/list-available-models.cjs +19 -19
- package/dist/actions/list-available-models.cjs.map +1 -1
- package/dist/actions/list-available-models.d.cts +68 -3
- package/dist/actions/list-available-models.d.cts.map +1 -1
- package/dist/actions/list-available-models.d.mts +68 -3
- package/dist/actions/list-available-models.d.mts.map +1 -1
- package/dist/actions/list-available-models.mjs +19 -19
- package/dist/actions/list-available-models.mjs.map +1 -1
- package/dist/actions/list-embedding-models.cjs +17 -17
- package/dist/actions/list-embedding-models.cjs.map +1 -1
- package/dist/actions/list-embedding-models.d.cts +41 -3
- package/dist/actions/list-embedding-models.d.cts.map +1 -1
- package/dist/actions/list-embedding-models.d.mts +41 -3
- package/dist/actions/list-embedding-models.d.mts.map +1 -1
- package/dist/actions/list-embedding-models.mjs +17 -17
- package/dist/actions/list-embedding-models.mjs.map +1 -1
- package/dist/actions/list-model-endpoints.cjs +14 -14
- package/dist/actions/list-model-endpoints.cjs.map +1 -1
- package/dist/actions/list-model-endpoints.d.cts +39 -3
- package/dist/actions/list-model-endpoints.d.cts.map +1 -1
- package/dist/actions/list-model-endpoints.d.mts +39 -3
- package/dist/actions/list-model-endpoints.d.mts.map +1 -1
- package/dist/actions/list-model-endpoints.mjs +14 -14
- package/dist/actions/list-model-endpoints.mjs.map +1 -1
- package/dist/actions/list-providers.cjs +2 -2
- package/dist/actions/list-providers.cjs.map +1 -1
- package/dist/actions/list-providers.d.cts +9 -3
- package/dist/actions/list-providers.d.cts.map +1 -1
- package/dist/actions/list-providers.d.mts +9 -3
- package/dist/actions/list-providers.d.mts.map +1 -1
- package/dist/actions/list-providers.mjs +2 -2
- package/dist/actions/list-providers.mjs.map +1 -1
- package/dist/actions/list-user-models.cjs +15 -15
- package/dist/actions/list-user-models.cjs.map +1 -1
- package/dist/actions/list-user-models.d.cts +45 -3
- package/dist/actions/list-user-models.d.cts.map +1 -1
- package/dist/actions/list-user-models.d.mts +45 -3
- package/dist/actions/list-user-models.d.mts.map +1 -1
- package/dist/actions/list-user-models.mjs +15 -15
- package/dist/actions/list-user-models.mjs.map +1 -1
- package/dist/actions/list-zdr-endpoints.cjs +14 -14
- package/dist/actions/list-zdr-endpoints.cjs.map +1 -1
- package/dist/actions/list-zdr-endpoints.d.cts +43 -3
- package/dist/actions/list-zdr-endpoints.d.cts.map +1 -1
- package/dist/actions/list-zdr-endpoints.d.mts +43 -3
- package/dist/actions/list-zdr-endpoints.d.mts.map +1 -1
- package/dist/actions/list-zdr-endpoints.mjs +14 -14
- package/dist/actions/list-zdr-endpoints.mjs.map +1 -1
- package/dist/catalog.cjs +7 -1
- package/dist/catalog.cjs.map +1 -1
- package/dist/catalog.d.cts +8 -0
- package/dist/catalog.d.mts +8 -0
- package/dist/catalog.mjs +7 -1
- package/dist/catalog.mjs.map +1 -1
- package/package.json +2 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"create-message.mjs","names":[],"sources":["../../src/actions/create-message.ts"],"sourcesContent":["import { z } from \"zod\";\n\nimport { action } from \"../action\";\n\nexport const OpenrouterCreateMessageInput: z.ZodTypeAny = z.object({\n user: z.string().describe(\"Unique identifier for the end-user (max 128 characters).\").optional(),\n model: z.string().describe(\"Model identifier to use for generation. Example: 'anthropic/claude-4.5-sonnet-20250929'.\"),\n tools: z.array(z.object({\n name: z.string().describe(\"Name of the tool.\"),\n type: z.string().describe(\"Type of tool (default: 'function').\").optional(),\n description: z.string().describe(\"Description of the tool.\").optional(),\n input_schema: z.record(z.string(), z.unknown()).describe(\"JSON schema describing the tool's input parameters.\").optional(),\n}).describe(\"Tool definition for function calling.\")).describe(\"List of tools available for the model to call.\").optional(),\n top_k: z.number().int().describe(\"Top-k sampling parameter.\").optional(),\n top_p: z.number().describe(\"Nucleus sampling probability between 0 and 1.\").optional(),\n models: z.array(z.string()).describe(\"List of fallback models to use if primary model fails.\").optional(),\n stream: z.boolean().describe(\"Whether to stream the response. Default false.\").optional(),\n system: z.union([z.string(), z.array(z.record(z.string(), z.unknown()))]).optional(),\n plugins: z.array(z.object({\n id: z.string().describe(\"Plugin identifier.\"),\n enabled: z.boolean().describe(\"Whether the plugin is enabled.\").optional(),\n}).describe(\"Plugin configuration.\")).describe(\"Plugins to enable for this request.\").optional(),\n x_title: z.string().describe(\"App display name for OpenRouter dashboard.\").optional(),\n messages: z.array(z.object({\n role: z.enum([\"user\", \"assistant\"]).describe(\"Role of the message sender.\"),\n content: z.union([z.string(), z.array(z.object({\n text: z.string().nullable().optional(),\n type: z.string().describe(\"Type of content block (e.g., 'text', 'image').\"),\n source: z.record(z.string(), z.unknown()).nullable().optional(),\n}).describe(\"Content block in a message.\"))]),\n}).describe(\"Message in the conversation.\")).describe(\"List of conversation messages. Each message has a role ('user' or 'assistant') and content.\"),\n metadata: z.object({\n user_id: z.string().describe(\"Unique identifier for the user making the request.\").optional(),\n}).describe(\"Metadata for the request.\").optional(),\n provider: z.object({\n zdr: z.boolean().describe(\"Whether to restrict routing to only ZDR (Zero Data Retention) endpoints.\").optional(),\n allow_fallbacks: z.boolean().describe(\"Whether to allow backup providers when primary is unavailable. Default true.\").optional(),\n data_collection: z.enum([\"allow\", \"deny\"]).describe(\"Data collection preference for provider routing.\").optional(),\n require_parameters: z.boolean().describe(\"Whether to filter providers to only those that support all provided parameters.\").optional(),\n enforce_distillable_text: z.boolean().describe(\"Whether to restrict routing to only models that allow text distillation.\").optional(),\n}).describe(\"Provider routing preferences.\").optional(),\n thinking: z.object({\n type: z.string().describe(\"Type of thinking configuration.\"),\n budget_tokens: z.number().int().describe(\"Budget for thinking tokens.\").optional(),\n}).describe(\"Configuration for extended thinking.\").optional(),\n max_tokens: z.number().int().describe(\"Maximum number of tokens to generate in the response.\"),\n session_id: z.string().describe(\"Unique identifier for grouping related requests (max 128 characters).\").optional(),\n temperature: z.number().describe(\"Sampling temperature between 0 and 2.\").optional(),\n tool_choice: z.object({\n name: z.string().describe(\"Name of specific tool to use (when type is 'tool').\").optional(),\n type: z.string().describe(\"Type of tool choice: 'auto', 'any', 'tool', etc.\"),\n disable_parallel_tool_use: z.boolean().describe(\"Whether to disable parallel tool use.\").optional(),\n}).describe(\"Tool choice configuration.\").optional(),\n http_referer: z.string().describe(\"App URL identifier used for tracking API usage per application.\").optional(),\n service_tier: z.enum([\"auto\", \"standard_only\"]).describe(\"Service tier for the request.\").optional(),\n output_config: z.object({\n effort: z.enum([\"low\", \"medium\", \"high\", \"max\"]).describe(\"Effort level for output generation.\").optional(),\n}).describe(\"Configuration for controlling output behavior.\").optional(),\n stop_sequences: z.array(z.string()).describe(\"Sequences where generation should stop.\").optional(),\n}).describe(\"Request to create a message using Anthropic Messages API format.\");\nconst OpenrouterCreateMessage_ResponseUsageSchema: z.ZodTypeAny = z.object({\n input_tokens: z.number().int().describe(\"Number of input tokens.\"),\n output_tokens: z.number().int().describe(\"Number of output tokens.\"),\n cache_read_input_tokens: z.number().int().describe(\"Number of tokens read from cache.\").nullable().optional(),\n cache_creation_input_tokens: z.number().int().describe(\"Number of tokens used for cache creation.\").nullable().optional(),\n}).describe(\"Token usage information.\");\nconst OpenrouterCreateMessage_ContentBlockSchema: z.ZodTypeAny = z.object({\n text: z.string().describe(\"Text content if applicable.\").nullable().optional(),\n type: z.string().describe(\"Type of content block.\"),\n}).describe(\"Content block in the response.\");\nexport const OpenrouterCreateMessageOutput: z.ZodTypeAny = z.object({\n id: z.string().describe(\"Unique identifier for this message.\"),\n role: z.string().describe(\"Role of the response, typically 'assistant'.\"),\n type: z.string().describe(\"Object type, typically 'message'.\"),\n model: z.string().describe(\"Model that generated the response.\"),\n usage: OpenrouterCreateMessage_ResponseUsageSchema.nullable(),\n content: z.array(OpenrouterCreateMessage_ContentBlockSchema).describe(\"List of content blocks in the response.\"),\n stop_reason: z.string().describe(\"Reason why generation stopped.\").nullable().optional(),\n stop_sequence: z.string().describe(\"Stop sequence that triggered generation to stop.\").nullable().optional(),\n}).describe(\"Response from creating a message.\");\n\nexport const openrouterCreateMessage = action(\"OPENROUTER_CREATE_MESSAGE\", {\n slug: \"openrouter-create-message\",\n name: \"Create Message (Anthropic Format)\",\n description: \"Tool to create a message using Anthropic Messages API format via OpenRouter. Use when you need Claude-compatible chat completion with support for text, images, PDFs, tools, and extended thinking.\",\n input: OpenrouterCreateMessageInput,\n output: OpenrouterCreateMessageOutput,\n});\n"],"mappings":";;;AAIA,MAAa,+BAA6C,EAAE,OAAO;CACjE,MAAM,EAAE,OAAO,CAAC,CAAC,SAAS,0DAA0D,CAAC,CAAC,SAAS;CAC/F,OAAO,EAAE,OAAO,CAAC,CAAC,SAAS,0FAA0F;CACrH,OAAO,EAAE,MAAM,EAAE,OAAO;EACxB,MAAM,EAAE,OAAO,CAAC,CAAC,SAAS,mBAAmB;EAC7C,MAAM,EAAE,OAAO,CAAC,CAAC,SAAS,qCAAqC,CAAC,CAAC,SAAS;EAC1E,aAAa,EAAE,OAAO,CAAC,CAAC,SAAS,0BAA0B,CAAC,CAAC,SAAS;EACtE,cAAc,E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C,SAAS,0BAA0B;AACtC,MAAM,6CAA2D,EAAE,OAAO;CACxE,MAAM,EAAE,OAAO,CAAC,CAAC,SAAS,6BAA6B,CAAC,CAAC,SAAS,CAAC,CAAC,SAAS;CAC7E,MAAM,EAAE,OAAO,CAAC,CAAC,SAAS,wBAAwB;AACpD,CAAC,CAAC,CAAC,SAAS,gCAAgC;AAY5C,MAAa,0BAA0B,OAAO,6BAA6B;CACzE,MAAM;CACN,MAAM;CACN,aAAa;CACb,OAAO;CACP,QAhByD,EAAE,OAAO;EAClE,IAAI,EAAE,OAAO,CAAC,CAAC,SAAS,qCAAqC;EAC7D,MAAM,EAAE,OAAO,CAAC,CAAC,SAAS,8CAA8C;EACxE,MAAM,EAAE,OAAO,CAAC,CAAC,SAAS,mCAAmC;EAC7D,OAAO,EAAE,OAAO,CAAC,CAAC,SAAS,oCAAoC;EAC/D,OAAO,4CAA4C,SAAS;EAC5D,SAAS,EAAE,MAAM,0CAA0C,CAAC,CAAC,SAAS,yCAAyC;EAC/G,aAAa,EAAE,OAAO,CAAC,CAAC,SAAS,gCAAgC,CAAC,CAAC,SAAS,CAAC,CAAC,SAAS;EACvF,eAAe,EAAE,OAAO,CAAC,CAAC,SAAS,kDAAkD,CAAC,CAAC,SAAS,CAAC,CAAC,SAAS;CAC7G,CAAC,CAAC,CAAC,SAAS,mCAOF;AACV,CAAC"}
|
|
1
|
+
{"version":3,"file":"create-message.mjs","names":[],"sources":["../../src/actions/create-message.ts"],"sourcesContent":["import { z } from \"zod\";\n\nimport { action } from \"../action\";\n\nexport const OpenrouterCreateMessageInput = z.object({\n user: z.string().describe(\"Unique identifier for the end-user (max 128 characters).\").optional(),\n model: z.string().describe(\"Model identifier to use for generation. Example: 'anthropic/claude-4.5-sonnet-20250929'.\"),\n tools: z.array(z.object({\n name: z.string().describe(\"Name of the tool.\"),\n type: z.string().describe(\"Type of tool (default: 'function').\").optional(),\n description: z.string().describe(\"Description of the tool.\").optional(),\n input_schema: z.record(z.string(), z.unknown()).describe(\"JSON schema describing the tool's input parameters.\").optional(),\n}).passthrough().describe(\"Tool definition for function calling.\")).describe(\"List of tools available for the model to call.\").optional(),\n top_k: z.number().int().describe(\"Top-k sampling parameter.\").optional(),\n top_p: z.number().describe(\"Nucleus sampling probability between 0 and 1.\").optional(),\n models: z.array(z.string()).describe(\"List of fallback models to use if primary model fails.\").optional(),\n stream: z.boolean().describe(\"Whether to stream the response. Default false.\").optional(),\n system: z.union([z.string(), z.array(z.record(z.string(), z.unknown()))]).optional(),\n plugins: z.array(z.object({\n id: z.string().describe(\"Plugin identifier.\"),\n enabled: z.boolean().describe(\"Whether the plugin is enabled.\").optional(),\n}).passthrough().describe(\"Plugin configuration.\")).describe(\"Plugins to enable for this request.\").optional(),\n x_title: z.string().describe(\"App display name for OpenRouter dashboard.\").optional(),\n messages: z.array(z.object({\n role: z.enum([\"user\", \"assistant\"]).describe(\"Role of the message sender.\"),\n content: z.union([z.string(), z.array(z.object({\n text: z.string().nullable().optional(),\n type: z.string().describe(\"Type of content block (e.g., 'text', 'image').\"),\n source: z.record(z.string(), z.unknown()).nullable().optional(),\n}).passthrough().describe(\"Content block in a message.\"))]),\n}).passthrough().describe(\"Message in the conversation.\")).describe(\"List of conversation messages. Each message has a role ('user' or 'assistant') and content.\"),\n metadata: z.object({\n user_id: z.string().describe(\"Unique identifier for the user making the request.\").optional(),\n}).describe(\"Metadata for the request.\").optional(),\n provider: z.object({\n zdr: z.boolean().describe(\"Whether to restrict routing to only ZDR (Zero Data Retention) endpoints.\").optional(),\n allow_fallbacks: z.boolean().describe(\"Whether to allow backup providers when primary is unavailable. Default true.\").optional(),\n data_collection: z.enum([\"allow\", \"deny\"]).describe(\"Data collection preference for provider routing.\").optional(),\n require_parameters: z.boolean().describe(\"Whether to filter providers to only those that support all provided parameters.\").optional(),\n enforce_distillable_text: z.boolean().describe(\"Whether to restrict routing to only models that allow text distillation.\").optional(),\n}).describe(\"Provider routing preferences.\").optional(),\n thinking: z.object({\n type: z.string().describe(\"Type of thinking configuration.\"),\n budget_tokens: z.number().int().describe(\"Budget for thinking tokens.\").optional(),\n}).describe(\"Configuration for extended thinking.\").optional(),\n max_tokens: z.number().int().describe(\"Maximum number of tokens to generate in the response.\"),\n session_id: z.string().describe(\"Unique identifier for grouping related requests (max 128 characters).\").optional(),\n temperature: z.number().describe(\"Sampling temperature between 0 and 2.\").optional(),\n tool_choice: z.object({\n name: z.string().describe(\"Name of specific tool to use (when type is 'tool').\").optional(),\n type: z.string().describe(\"Type of tool choice: 'auto', 'any', 'tool', etc.\"),\n disable_parallel_tool_use: z.boolean().describe(\"Whether to disable parallel tool use.\").optional(),\n}).describe(\"Tool choice configuration.\").optional(),\n http_referer: z.string().describe(\"App URL identifier used for tracking API usage per application.\").optional(),\n service_tier: z.enum([\"auto\", \"standard_only\"]).describe(\"Service tier for the request.\").optional(),\n output_config: z.object({\n effort: z.enum([\"low\", \"medium\", \"high\", \"max\"]).describe(\"Effort level for output generation.\").optional(),\n}).describe(\"Configuration for controlling output behavior.\").optional(),\n stop_sequences: z.array(z.string()).describe(\"Sequences where generation should stop.\").optional(),\n}).describe(\"Request to create a message using Anthropic Messages API format.\");\nconst OpenrouterCreateMessage_ResponseUsageSchema = z.object({\n input_tokens: z.number().int().describe(\"Number of input tokens.\").nullable(),\n output_tokens: z.number().int().describe(\"Number of output tokens.\").nullable(),\n cache_read_input_tokens: z.number().int().describe(\"Number of tokens read from cache.\").nullable().optional(),\n cache_creation_input_tokens: z.number().int().describe(\"Number of tokens used for cache creation.\").nullable().optional(),\n}).passthrough().describe(\"Token usage information.\");\nconst OpenrouterCreateMessage_ContentBlockSchema = z.object({\n text: z.string().describe(\"Text content if applicable.\").nullable().optional(),\n type: z.string().describe(\"Type of content block.\").nullable(),\n}).passthrough().describe(\"Content block in the response.\");\nexport const OpenrouterCreateMessageOutput = z.object({\n id: z.string().describe(\"Unique identifier for this message.\").nullable(),\n role: z.string().describe(\"Role of the response, typically 'assistant'.\").nullable(),\n type: z.string().describe(\"Object type, typically 'message'.\").nullable(),\n model: z.string().describe(\"Model that generated the response.\").nullable(),\n usage: OpenrouterCreateMessage_ResponseUsageSchema.nullable(),\n content: z.array(OpenrouterCreateMessage_ContentBlockSchema).describe(\"List of content blocks in the response.\"),\n stop_reason: z.string().describe(\"Reason why generation stopped.\").nullable().optional(),\n stop_sequence: z.string().describe(\"Stop sequence that triggered generation to stop.\").nullable().optional(),\n}).passthrough().describe(\"Response from creating a message.\");\n\nexport const openrouterCreateMessage = action(\"OPENROUTER_CREATE_MESSAGE\", {\n slug: \"openrouter-create-message\",\n name: \"Create Message (Anthropic Format)\",\n description: \"Tool to create a message using Anthropic Messages API format via OpenRouter. Use when you need Claude-compatible chat completion with support for text, images, PDFs, tools, and extended thinking.\",\n input: OpenrouterCreateMessageInput,\n output: OpenrouterCreateMessageOutput,\n});\n"],"mappings":";;;AAIA,MAAa,+BAA+B,EAAE,OAAO;CACnD,MAAM,EAAE,OAAO,CAAC,CAAC,SAAS,0DAA0D,CAAC,CAAC,SAAS;CAC/F,OAAO,EAAE,OAAO,CAAC,CAAC,SAAS,0FAA0F;CACrH,OAAO,EAAE,MAAM,EAAE,OAAO;EACxB,MAAM,EAAE,OAAO,CAAC,CAAC,SAAS,mBAAmB;EAC7C,MAAM,EAAE,OAAO,CAAC,CAAC,SAAS,qCAAqC,CAAC,CAAC,SAAS;EAC1E,aAAa,EAAE,OAAO,CAAC,CAAC,SAAS,0BAA0B,CAAC,CAAC,SAAS;EACtE,cAAc,EAAE,OAAO,EAAE,OAAO,GAAG,EAAE,QAAQ,CAAC,CAAC,CAAC,SAAS,qDAAqD,CAAC,CAAC,SAAS;CAC3H,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC,SAAS,uCAAuC,CAAC,CAAC,CAAC,SAAS,gDAAgD,CAAC,CAAC,SAAS;CACtI,OAAO,EAAE,OAAO,CAAC,CAAC,IAAI,CAAC,CAAC,SAAS,2BAA2B,CAAC,CAAC,SAAS;CACvE,OAAO,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AAC,SAAS,wBAAwB,CAAC,CAAC,SAAS;AAC/D,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC,SAAS,gCAAgC;AAY1D,MAAa,0BAA0B,OAAO,6BAA6B;CACzE,MAAM;CACN,MAAM;CACN,aAAa;CACb,OAAO;CACP,QAhB2C,EAAE,OAAO;EACpD,IAAI,EAAE,OAAO,CAAC,CAAC,SAAS,qCAAqC,CAAC,CAAC,SAAS;EACxE,MAAM,EAAE,OAAO,CAAC,CAAC,SAAS,8CAA8C,CAAC,CAAC,SAAS;EACnF,MAAM,EAAE,OAAO,CAAC,CAAC,SAAS,mCAAmC,CAAC,CAAC,SAAS;EACxE,OAAO,EAAE,OAAO,CAAC,CAAC,SAAS,oCAAoC,CAAC,CAAC,SAAS;EAC1E,OAAO,4CAA4C,SAAS;EAC5D,SAAS,EAAE,MAAM,0CAA0C,CAAC,CAAC,SAAS,yCAAyC;EAC/G,aAAa,EAAE,OAAO,CAAC,CAAC,SAAS,gCAAgC,CAAC,CAAC,SAAS,CAAC,CAAC,SAAS;EACvF,eAAe,EAAE,OAAO,CAAC,CAAC,SAAS,kDAAkD,CAAC,CAAC,SAAS,CAAC,CAAC,SAAS;CAC7G,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC,SAAS,mCAOhB;AACV,CAAC"}
|
|
@@ -3,10 +3,10 @@ let zod = require("zod");
|
|
|
3
3
|
//#region src/actions/get-credits.ts
|
|
4
4
|
const OpenrouterGetCreditsInput = zod.z.object({}).describe("No parameters for retrieving credit balance.");
|
|
5
5
|
const OpenrouterGetCredits_CreditsDataSchema = zod.z.object({
|
|
6
|
-
total_usage: zod.z.number().describe("Total credits used by the authenticated user"),
|
|
7
|
-
total_credits: zod.z.number().describe("Total credits purchased by the authenticated user")
|
|
8
|
-
});
|
|
9
|
-
const OpenrouterGetCreditsOutput = zod.z.object({ data: OpenrouterGetCredits_CreditsDataSchema.nullable() });
|
|
6
|
+
total_usage: zod.z.number().describe("Total credits used by the authenticated user").nullable(),
|
|
7
|
+
total_credits: zod.z.number().describe("Total credits purchased by the authenticated user").nullable()
|
|
8
|
+
}).passthrough();
|
|
9
|
+
const OpenrouterGetCreditsOutput = zod.z.object({ data: OpenrouterGetCredits_CreditsDataSchema.nullable() }).passthrough();
|
|
10
10
|
const openrouterGetCredits = require_action.action("OPENROUTER_GET_CREDITS", {
|
|
11
11
|
slug: "openrouter-get-credits",
|
|
12
12
|
name: "Get Credits",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"get-credits.cjs","names":["z","action"],"sources":["../../src/actions/get-credits.ts"],"sourcesContent":["import { z } from \"zod\";\n\nimport { action } from \"../action\";\n\nexport const OpenrouterGetCreditsInput
|
|
1
|
+
{"version":3,"file":"get-credits.cjs","names":["z","action"],"sources":["../../src/actions/get-credits.ts"],"sourcesContent":["import { z } from \"zod\";\n\nimport { action } from \"../action\";\n\nexport const OpenrouterGetCreditsInput = z.object({}).describe(\"No parameters for retrieving credit balance.\");\nconst OpenrouterGetCredits_CreditsDataSchema = z.object({\n total_usage: z.number().describe(\"Total credits used by the authenticated user\").nullable(),\n total_credits: z.number().describe(\"Total credits purchased by the authenticated user\").nullable(),\n}).passthrough();\nexport const OpenrouterGetCreditsOutput = z.object({\n data: OpenrouterGetCredits_CreditsDataSchema.nullable(),\n}).passthrough();\n\nexport const openrouterGetCredits = action(\"OPENROUTER_GET_CREDITS\", {\n slug: \"openrouter-get-credits\",\n name: \"Get Credits\",\n description: \"Tool to get the current API credit balance for the authenticated user. Use before large or batch jobs to verify sufficient balance. A successful response may return total_credits=0, which confirms authentication but will cause all paid model generations to fail. Avoid polling this endpoint; call only as needed.\",\n input: OpenrouterGetCreditsInput,\n output: OpenrouterGetCreditsOutput,\n});\n"],"mappings":";;;AAIA,MAAa,4BAA4BA,IAAAA,EAAE,OAAO,CAAC,CAAC,CAAC,CAAC,SAAS,8CAA8C;AAC7G,MAAM,yCAAyCA,IAAAA,EAAE,OAAO;CACtD,aAAaA,IAAAA,EAAE,OAAO,CAAC,CAAC,SAAS,8CAA8C,CAAC,CAAC,SAAS;CAC1F,eAAeA,IAAAA,EAAE,OAAO,CAAC,CAAC,SAAS,mDAAmD,CAAC,CAAC,SAAS;AACnG,CAAC,CAAC,CAAC,YAAY;AACf,MAAa,6BAA6BA,IAAAA,EAAE,OAAO,EACjD,MAAM,uCAAuC,SAAS,EACxD,CAAC,CAAC,CAAC,YAAY;AAEf,MAAa,uBAAuBC,eAAAA,OAAO,0BAA0B;CACnE,MAAM;CACN,MAAM;CACN,aAAa;CACb,OAAO;CACP,QAAQ;AACV,CAAC"}
|
|
@@ -1,9 +1,14 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
2
|
|
|
3
3
|
//#region src/actions/get-credits.d.ts
|
|
4
|
-
declare const OpenrouterGetCreditsInput: z.
|
|
5
|
-
declare const OpenrouterGetCreditsOutput: z.
|
|
6
|
-
|
|
4
|
+
declare const OpenrouterGetCreditsInput: z.ZodObject<{}, z.core.$strip>;
|
|
5
|
+
declare const OpenrouterGetCreditsOutput: z.ZodObject<{
|
|
6
|
+
data: z.ZodNullable<z.ZodObject<{
|
|
7
|
+
total_usage: z.ZodNullable<z.ZodNumber>;
|
|
8
|
+
total_credits: z.ZodNullable<z.ZodNumber>;
|
|
9
|
+
}, z.core.$loose>>;
|
|
10
|
+
}, z.core.$loose>;
|
|
11
|
+
declare const openrouterGetCredits: import("@keystrokehq/action").WorkflowActionDefinition<Record<string, never>, unknown, import("@keystrokehq/shared").ResolvedCredentials<readonly [import("@keystrokehq/shared").Credential]>, readonly [import("@keystrokehq/shared").Credential]>;
|
|
7
12
|
//#endregion
|
|
8
13
|
export { openrouterGetCredits };
|
|
9
14
|
//# sourceMappingURL=get-credits.d.cts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"get-credits.d.cts","names":[],"sources":["../../src/actions/get-credits.ts"],"mappings":";;;cAIa,yBAAA,
|
|
1
|
+
{"version":3,"file":"get-credits.d.cts","names":[],"sources":["../../src/actions/get-credits.ts"],"mappings":";;;cAIa,yBAAA,EAAyB,CAAA,CAAA,SAAA,KAAA,CAAA,CAAA,IAAA,CAAA,MAAA;AAAA,cAKzB,0BAAA,EAA0B,CAAA,CAAA,SAAA;;;;;;cAI1B,oBAAA,gCAAoB,wBAAA,CAAA,MAAA,wDAAA,mBAAA,yCAAA,UAAA,4CAAA,UAAA"}
|
|
@@ -1,9 +1,14 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
2
|
|
|
3
3
|
//#region src/actions/get-credits.d.ts
|
|
4
|
-
declare const OpenrouterGetCreditsInput: z.
|
|
5
|
-
declare const OpenrouterGetCreditsOutput: z.
|
|
6
|
-
|
|
4
|
+
declare const OpenrouterGetCreditsInput: z.ZodObject<{}, z.core.$strip>;
|
|
5
|
+
declare const OpenrouterGetCreditsOutput: z.ZodObject<{
|
|
6
|
+
data: z.ZodNullable<z.ZodObject<{
|
|
7
|
+
total_usage: z.ZodNullable<z.ZodNumber>;
|
|
8
|
+
total_credits: z.ZodNullable<z.ZodNumber>;
|
|
9
|
+
}, z.core.$loose>>;
|
|
10
|
+
}, z.core.$loose>;
|
|
11
|
+
declare const openrouterGetCredits: import("@keystrokehq/action").WorkflowActionDefinition<Record<string, never>, unknown, import("@keystrokehq/shared").ResolvedCredentials<readonly [import("@keystrokehq/shared").Credential]>, readonly [import("@keystrokehq/shared").Credential]>;
|
|
7
12
|
//#endregion
|
|
8
13
|
export { openrouterGetCredits };
|
|
9
14
|
//# sourceMappingURL=get-credits.d.mts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"get-credits.d.mts","names":[],"sources":["../../src/actions/get-credits.ts"],"mappings":";;;cAIa,yBAAA,
|
|
1
|
+
{"version":3,"file":"get-credits.d.mts","names":[],"sources":["../../src/actions/get-credits.ts"],"mappings":";;;cAIa,yBAAA,EAAyB,CAAA,CAAA,SAAA,KAAA,CAAA,CAAA,IAAA,CAAA,MAAA;AAAA,cAKzB,0BAAA,EAA0B,CAAA,CAAA,SAAA;;;;;;cAI1B,oBAAA,gCAAoB,wBAAA,CAAA,MAAA,wDAAA,mBAAA,yCAAA,UAAA,4CAAA,UAAA"}
|
|
@@ -3,15 +3,15 @@ import { z } from "zod";
|
|
|
3
3
|
//#region src/actions/get-credits.ts
|
|
4
4
|
const OpenrouterGetCreditsInput = z.object({}).describe("No parameters for retrieving credit balance.");
|
|
5
5
|
const OpenrouterGetCredits_CreditsDataSchema = z.object({
|
|
6
|
-
total_usage: z.number().describe("Total credits used by the authenticated user"),
|
|
7
|
-
total_credits: z.number().describe("Total credits purchased by the authenticated user")
|
|
8
|
-
});
|
|
6
|
+
total_usage: z.number().describe("Total credits used by the authenticated user").nullable(),
|
|
7
|
+
total_credits: z.number().describe("Total credits purchased by the authenticated user").nullable()
|
|
8
|
+
}).passthrough();
|
|
9
9
|
const openrouterGetCredits = action("OPENROUTER_GET_CREDITS", {
|
|
10
10
|
slug: "openrouter-get-credits",
|
|
11
11
|
name: "Get Credits",
|
|
12
12
|
description: "Tool to get the current API credit balance for the authenticated user. Use before large or batch jobs to verify sufficient balance. A successful response may return total_credits=0, which confirms authentication but will cause all paid model generations to fail. Avoid polling this endpoint; call only as needed.",
|
|
13
13
|
input: OpenrouterGetCreditsInput,
|
|
14
|
-
output: z.object({ data: OpenrouterGetCredits_CreditsDataSchema.nullable() })
|
|
14
|
+
output: z.object({ data: OpenrouterGetCredits_CreditsDataSchema.nullable() }).passthrough()
|
|
15
15
|
});
|
|
16
16
|
//#endregion
|
|
17
17
|
export { openrouterGetCredits };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"get-credits.mjs","names":[],"sources":["../../src/actions/get-credits.ts"],"sourcesContent":["import { z } from \"zod\";\n\nimport { action } from \"../action\";\n\nexport const OpenrouterGetCreditsInput
|
|
1
|
+
{"version":3,"file":"get-credits.mjs","names":[],"sources":["../../src/actions/get-credits.ts"],"sourcesContent":["import { z } from \"zod\";\n\nimport { action } from \"../action\";\n\nexport const OpenrouterGetCreditsInput = z.object({}).describe(\"No parameters for retrieving credit balance.\");\nconst OpenrouterGetCredits_CreditsDataSchema = z.object({\n total_usage: z.number().describe(\"Total credits used by the authenticated user\").nullable(),\n total_credits: z.number().describe(\"Total credits purchased by the authenticated user\").nullable(),\n}).passthrough();\nexport const OpenrouterGetCreditsOutput = z.object({\n data: OpenrouterGetCredits_CreditsDataSchema.nullable(),\n}).passthrough();\n\nexport const openrouterGetCredits = action(\"OPENROUTER_GET_CREDITS\", {\n slug: \"openrouter-get-credits\",\n name: \"Get Credits\",\n description: \"Tool to get the current API credit balance for the authenticated user. Use before large or batch jobs to verify sufficient balance. A successful response may return total_credits=0, which confirms authentication but will cause all paid model generations to fail. Avoid polling this endpoint; call only as needed.\",\n input: OpenrouterGetCreditsInput,\n output: OpenrouterGetCreditsOutput,\n});\n"],"mappings":";;;AAIA,MAAa,4BAA4B,EAAE,OAAO,CAAC,CAAC,CAAC,CAAC,SAAS,8CAA8C;AAC7G,MAAM,yCAAyC,EAAE,OAAO;CACtD,aAAa,EAAE,OAAO,CAAC,CAAC,SAAS,8CAA8C,CAAC,CAAC,SAAS;CAC1F,eAAe,EAAE,OAAO,CAAC,CAAC,SAAS,mDAAmD,CAAC,CAAC,SAAS;AACnG,CAAC,CAAC,CAAC,YAAY;AAKf,MAAa,uBAAuB,OAAO,0BAA0B;CACnE,MAAM;CACN,MAAM;CACN,aAAa;CACb,OAAO;CACP,QATwC,EAAE,OAAO,EACjD,MAAM,uCAAuC,SAAS,EACxD,CAAC,CAAC,CAAC,YAOO;AACV,CAAC"}
|
|
@@ -6,31 +6,31 @@ const OpenrouterGetCurrentKeyInput = zod.z.object({
|
|
|
6
6
|
http_referer: zod.z.string().describe("The app identifier should be your app's URL and is used as the primary identifier for rankings. This is used to track API usage per application.").optional()
|
|
7
7
|
}).describe("Request for retrieving current API key information.");
|
|
8
8
|
const OpenrouterGetCurrentKey_RateLimitSchema = zod.z.object({
|
|
9
|
-
note: zod.z.string().describe("Deprecation note."),
|
|
10
|
-
interval: zod.z.string().describe("Time interval for rate limit."),
|
|
11
|
-
requests: zod.z.number().describe("Number of requests allowed.")
|
|
12
|
-
}).describe("Legacy rate limit information (deprecated).");
|
|
9
|
+
note: zod.z.string().describe("Deprecation note.").nullable(),
|
|
10
|
+
interval: zod.z.string().describe("Time interval for rate limit.").nullable(),
|
|
11
|
+
requests: zod.z.number().describe("Number of requests allowed.").nullable()
|
|
12
|
+
}).passthrough().describe("Legacy rate limit information (deprecated).");
|
|
13
13
|
const OpenrouterGetCurrentKey_KeyDataSchema = zod.z.object({
|
|
14
|
-
label: zod.z.string().describe("Human-readable label for the API key."),
|
|
14
|
+
label: zod.z.string().describe("Human-readable label for the API key.").nullable(),
|
|
15
15
|
limit: zod.z.number().describe("Spending limit for the API key in USD.").nullable().optional(),
|
|
16
|
-
usage: zod.z.number().describe("Total OpenRouter credit usage (in USD) for the API key."),
|
|
17
|
-
byok_usage: zod.z.number().describe("Total external BYOK usage (in USD) for the API key."),
|
|
16
|
+
usage: zod.z.number().describe("Total OpenRouter credit usage (in USD) for the API key.").nullable(),
|
|
17
|
+
byok_usage: zod.z.number().describe("Total external BYOK usage (in USD) for the API key.").nullable(),
|
|
18
18
|
expires_at: zod.z.string().describe("ISO 8601 UTC timestamp when the API key expires, or null if no expiration.").nullable().optional(),
|
|
19
19
|
rate_limit: OpenrouterGetCurrentKey_RateLimitSchema.nullable(),
|
|
20
20
|
limit_reset: zod.z.string().describe("Type of limit reset for the API key.").nullable().optional(),
|
|
21
|
-
usage_daily: zod.z.number().describe("OpenRouter credit usage (in USD) for the current UTC day."),
|
|
22
|
-
is_free_tier: zod.z.boolean().describe("Whether this is a free tier API key."),
|
|
23
|
-
usage_weekly: zod.z.number().describe("OpenRouter credit usage (in USD) for the current UTC week (Monday-Sunday)."),
|
|
24
|
-
usage_monthly: zod.z.number().describe("OpenRouter credit usage (in USD) for the current UTC month."),
|
|
21
|
+
usage_daily: zod.z.number().describe("OpenRouter credit usage (in USD) for the current UTC day.").nullable(),
|
|
22
|
+
is_free_tier: zod.z.boolean().describe("Whether this is a free tier API key.").nullable(),
|
|
23
|
+
usage_weekly: zod.z.number().describe("OpenRouter credit usage (in USD) for the current UTC week (Monday-Sunday).").nullable(),
|
|
24
|
+
usage_monthly: zod.z.number().describe("OpenRouter credit usage (in USD) for the current UTC month.").nullable(),
|
|
25
25
|
limit_remaining: zod.z.number().describe("Remaining spending limit in USD.").nullable().optional(),
|
|
26
|
-
byok_usage_daily: zod.z.number().describe("External BYOK usage (in USD) for the current UTC day."),
|
|
27
|
-
byok_usage_weekly: zod.z.number().describe("External BYOK usage (in USD) for the current UTC week (Monday-Sunday)."),
|
|
28
|
-
is_management_key: zod.z.boolean().describe("Whether this is a management key."),
|
|
29
|
-
byok_usage_monthly: zod.z.number().describe("External BYOK usage (in USD) for current UTC month."),
|
|
30
|
-
is_provisioning_key: zod.z.boolean().describe("Whether this is a provisioning key."),
|
|
31
|
-
include_byok_in_limit: zod.z.boolean().describe("Whether to include external BYOK usage in the credit limit.")
|
|
32
|
-
}).describe("API key information.");
|
|
33
|
-
const OpenrouterGetCurrentKeyOutput = zod.z.object({ data: OpenrouterGetCurrentKey_KeyDataSchema.nullable() }).describe("Response containing current API key information.");
|
|
26
|
+
byok_usage_daily: zod.z.number().describe("External BYOK usage (in USD) for the current UTC day.").nullable(),
|
|
27
|
+
byok_usage_weekly: zod.z.number().describe("External BYOK usage (in USD) for the current UTC week (Monday-Sunday).").nullable(),
|
|
28
|
+
is_management_key: zod.z.boolean().describe("Whether this is a management key.").nullable(),
|
|
29
|
+
byok_usage_monthly: zod.z.number().describe("External BYOK usage (in USD) for current UTC month.").nullable(),
|
|
30
|
+
is_provisioning_key: zod.z.boolean().describe("Whether this is a provisioning key.").nullable(),
|
|
31
|
+
include_byok_in_limit: zod.z.boolean().describe("Whether to include external BYOK usage in the credit limit.").nullable()
|
|
32
|
+
}).passthrough().describe("API key information.");
|
|
33
|
+
const OpenrouterGetCurrentKeyOutput = zod.z.object({ data: OpenrouterGetCurrentKey_KeyDataSchema.nullable() }).passthrough().describe("Response containing current API key information.");
|
|
34
34
|
const openrouterGetCurrentKey = require_action.action("OPENROUTER_GET_CURRENT_KEY", {
|
|
35
35
|
slug: "openrouter-get-current-key",
|
|
36
36
|
name: "Get Current Key",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"get-current-key.cjs","names":["z","action"],"sources":["../../src/actions/get-current-key.ts"],"sourcesContent":["import { z } from \"zod\";\n\nimport { action } from \"../action\";\n\nexport const OpenrouterGetCurrentKeyInput
|
|
1
|
+
{"version":3,"file":"get-current-key.cjs","names":["z","action"],"sources":["../../src/actions/get-current-key.ts"],"sourcesContent":["import { z } from \"zod\";\n\nimport { action } from \"../action\";\n\nexport const OpenrouterGetCurrentKeyInput = z.object({\n x_title: z.string().describe(\"The app display name allows you to customize how your app appears in OpenRouter's dashboard.\").optional(),\n http_referer: z.string().describe(\"The app identifier should be your app's URL and is used as the primary identifier for rankings. This is used to track API usage per application.\").optional(),\n}).describe(\"Request for retrieving current API key information.\");\nconst OpenrouterGetCurrentKey_RateLimitSchema = z.object({\n note: z.string().describe(\"Deprecation note.\").nullable(),\n interval: z.string().describe(\"Time interval for rate limit.\").nullable(),\n requests: z.number().describe(\"Number of requests allowed.\").nullable(),\n}).passthrough().describe(\"Legacy rate limit information (deprecated).\");\nconst OpenrouterGetCurrentKey_KeyDataSchema = z.object({\n label: z.string().describe(\"Human-readable label for the API key.\").nullable(),\n limit: z.number().describe(\"Spending limit for the API key in USD.\").nullable().optional(),\n usage: z.number().describe(\"Total OpenRouter credit usage (in USD) for the API key.\").nullable(),\n byok_usage: z.number().describe(\"Total external BYOK usage (in USD) for the API key.\").nullable(),\n expires_at: z.string().describe(\"ISO 8601 UTC timestamp when the API key expires, or null if no expiration.\").nullable().optional(),\n rate_limit: OpenrouterGetCurrentKey_RateLimitSchema.nullable(),\n limit_reset: z.string().describe(\"Type of limit reset for the API key.\").nullable().optional(),\n usage_daily: z.number().describe(\"OpenRouter credit usage (in USD) for the current UTC day.\").nullable(),\n is_free_tier: z.boolean().describe(\"Whether this is a free tier API key.\").nullable(),\n usage_weekly: z.number().describe(\"OpenRouter credit usage (in USD) for the current UTC week (Monday-Sunday).\").nullable(),\n usage_monthly: z.number().describe(\"OpenRouter credit usage (in USD) for the current UTC month.\").nullable(),\n limit_remaining: z.number().describe(\"Remaining spending limit in USD.\").nullable().optional(),\n byok_usage_daily: z.number().describe(\"External BYOK usage (in USD) for the current UTC day.\").nullable(),\n byok_usage_weekly: z.number().describe(\"External BYOK usage (in USD) for the current UTC week (Monday-Sunday).\").nullable(),\n is_management_key: z.boolean().describe(\"Whether this is a management key.\").nullable(),\n byok_usage_monthly: z.number().describe(\"External BYOK usage (in USD) for current UTC month.\").nullable(),\n is_provisioning_key: z.boolean().describe(\"Whether this is a provisioning key.\").nullable(),\n include_byok_in_limit: z.boolean().describe(\"Whether to include external BYOK usage in the credit limit.\").nullable(),\n}).passthrough().describe(\"API key information.\");\nexport const OpenrouterGetCurrentKeyOutput = z.object({\n data: OpenrouterGetCurrentKey_KeyDataSchema.nullable(),\n}).passthrough().describe(\"Response containing current API key information.\");\n\nexport const openrouterGetCurrentKey = action(\"OPENROUTER_GET_CURRENT_KEY\", {\n slug: \"openrouter-get-current-key\",\n name: \"Get Current Key\",\n description: \"Tool to get information about the currently authenticated API key. Use to check usage limits, spending, and key metadata.\",\n input: OpenrouterGetCurrentKeyInput,\n output: OpenrouterGetCurrentKeyOutput,\n});\n"],"mappings":";;;AAIA,MAAa,+BAA+BA,IAAAA,EAAE,OAAO;CACnD,SAASA,IAAAA,EAAE,OAAO,CAAC,CAAC,SAAS,8FAA8F,CAAC,CAAC,SAAS;CACtI,cAAcA,IAAAA,EAAE,OAAO,CAAC,CAAC,SAAS,kJAAkJ,CAAC,CAAC,SAAS;AACjM,CAAC,CAAC,CAAC,SAAS,qDAAqD;AACjE,MAAM,0CA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A,EAAE,OAAO,CAAC,CAAC,SAAS,kCAAkC,CAAC,CAAC,SAAS,CAAC,CAAC,SAAS;CAC7F,kBAAkBA,IAAAA,EAAE,OAAO,CAAC,CAAC,SAAS,uDAAuD,CAAC,CAAC,SAAS;CACxG,mBAAmBA,IAAAA,EAAE,OAAO,CAAC,CAAC,SAAS,wEAAwE,CAAC,CAAC,SAAS;CAC1H,mBAAmBA,IAAAA,EAAE,QAAQ,CAAC,CAAC,SAAS,mCAAmC,CAAC,CAAC,SAAS;CACtF,oBAAoBA,IAAAA,EAAE,OAAO,CAAC,CAAC,SAAS,qDAAqD,CAAC,CAAC,SAAS;CACxG,qBAAqBA,IAAAA,EAAE,QAAQ,CAAC,CAAC,SAAS,qCAAqC,CAAC,CAAC,SAAS;CAC1F,uBAAuBA,IAAAA,EAAE,QAAQ,CAAC,CAAC,SAAS,6DAA6D,CAAC,CAAC,SAAS;AACtH,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC,SAAS,sBAAsB;AAChD,MAAa,gCAAgCA,IAAAA,EAAE,OAAO,EACpD,MAAM,sCAAsC,SAAS,EACvD,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC,SAAS,kDAAkD;AAE5E,MAAa,0BAA0BC,eAAAA,OAAO,8BAA8B;CAC1E,MAAM;CACN,MAAM;CACN,aAAa;CACb,OAAO;CACP,QAAQ;AACV,CAAC"}
|
|
@@ -1,9 +1,40 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
2
|
|
|
3
3
|
//#region src/actions/get-current-key.d.ts
|
|
4
|
-
declare const OpenrouterGetCurrentKeyInput: z.
|
|
5
|
-
|
|
6
|
-
|
|
4
|
+
declare const OpenrouterGetCurrentKeyInput: z.ZodObject<{
|
|
5
|
+
x_title: z.ZodOptional<z.ZodString>;
|
|
6
|
+
http_referer: z.ZodOptional<z.ZodString>;
|
|
7
|
+
}, z.core.$strip>;
|
|
8
|
+
declare const OpenrouterGetCurrentKeyOutput: z.ZodObject<{
|
|
9
|
+
data: z.ZodNullable<z.ZodObject<{
|
|
10
|
+
label: z.ZodNullable<z.ZodString>;
|
|
11
|
+
limit: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
12
|
+
usage: z.ZodNullable<z.ZodNumber>;
|
|
13
|
+
byok_usage: z.ZodNullable<z.ZodNumber>;
|
|
14
|
+
expires_at: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
15
|
+
rate_limit: z.ZodNullable<z.ZodObject<{
|
|
16
|
+
note: z.ZodNullable<z.ZodString>;
|
|
17
|
+
interval: z.ZodNullable<z.ZodString>;
|
|
18
|
+
requests: z.ZodNullable<z.ZodNumber>;
|
|
19
|
+
}, z.core.$loose>>;
|
|
20
|
+
limit_reset: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
21
|
+
usage_daily: z.ZodNullable<z.ZodNumber>;
|
|
22
|
+
is_free_tier: z.ZodNullable<z.ZodBoolean>;
|
|
23
|
+
usage_weekly: z.ZodNullable<z.ZodNumber>;
|
|
24
|
+
usage_monthly: z.ZodNullable<z.ZodNumber>;
|
|
25
|
+
limit_remaining: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
26
|
+
byok_usage_daily: z.ZodNullable<z.ZodNumber>;
|
|
27
|
+
byok_usage_weekly: z.ZodNullable<z.ZodNumber>;
|
|
28
|
+
is_management_key: z.ZodNullable<z.ZodBoolean>;
|
|
29
|
+
byok_usage_monthly: z.ZodNullable<z.ZodNumber>;
|
|
30
|
+
is_provisioning_key: z.ZodNullable<z.ZodBoolean>;
|
|
31
|
+
include_byok_in_limit: z.ZodNullable<z.ZodBoolean>;
|
|
32
|
+
}, z.core.$loose>>;
|
|
33
|
+
}, z.core.$loose>;
|
|
34
|
+
declare const openrouterGetCurrentKey: import("@keystrokehq/action").WorkflowActionDefinition<{
|
|
35
|
+
x_title?: string | undefined;
|
|
36
|
+
http_referer?: string | undefined;
|
|
37
|
+
}, unknown, import("@keystrokehq/shared").ResolvedCredentials<readonly [import("@keystrokehq/shared").Credential]>, readonly [import("@keystrokehq/shared").Credential]>;
|
|
7
38
|
//#endregion
|
|
8
39
|
export { openrouterGetCurrentKey };
|
|
9
40
|
//# sourceMappingURL=get-current-key.d.cts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"get-current-key.d.cts","names":[],"sources":["../../src/actions/get-current-key.ts"],"mappings":";;;cAIa,4BAAA,
|
|
1
|
+
{"version":3,"file":"get-current-key.d.cts","names":[],"sources":["../../src/actions/get-current-key.ts"],"mappings":";;;cAIa,4BAAA,EAA4B,CAAA,CAAA,SAAA;;;;cA6B5B,6BAAA,EAA6B,CAAA,CAAA,SAAA;;;;;;;;;;;;;;;;;;;;;;;;;;cAI7B,uBAAA,gCAAuB,wBAAA"}
|
|
@@ -1,9 +1,40 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
2
|
|
|
3
3
|
//#region src/actions/get-current-key.d.ts
|
|
4
|
-
declare const OpenrouterGetCurrentKeyInput: z.
|
|
5
|
-
|
|
6
|
-
|
|
4
|
+
declare const OpenrouterGetCurrentKeyInput: z.ZodObject<{
|
|
5
|
+
x_title: z.ZodOptional<z.ZodString>;
|
|
6
|
+
http_referer: z.ZodOptional<z.ZodString>;
|
|
7
|
+
}, z.core.$strip>;
|
|
8
|
+
declare const OpenrouterGetCurrentKeyOutput: z.ZodObject<{
|
|
9
|
+
data: z.ZodNullable<z.ZodObject<{
|
|
10
|
+
label: z.ZodNullable<z.ZodString>;
|
|
11
|
+
limit: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
12
|
+
usage: z.ZodNullable<z.ZodNumber>;
|
|
13
|
+
byok_usage: z.ZodNullable<z.ZodNumber>;
|
|
14
|
+
expires_at: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
15
|
+
rate_limit: z.ZodNullable<z.ZodObject<{
|
|
16
|
+
note: z.ZodNullable<z.ZodString>;
|
|
17
|
+
interval: z.ZodNullable<z.ZodString>;
|
|
18
|
+
requests: z.ZodNullable<z.ZodNumber>;
|
|
19
|
+
}, z.core.$loose>>;
|
|
20
|
+
limit_reset: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
21
|
+
usage_daily: z.ZodNullable<z.ZodNumber>;
|
|
22
|
+
is_free_tier: z.ZodNullable<z.ZodBoolean>;
|
|
23
|
+
usage_weekly: z.ZodNullable<z.ZodNumber>;
|
|
24
|
+
usage_monthly: z.ZodNullable<z.ZodNumber>;
|
|
25
|
+
limit_remaining: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
26
|
+
byok_usage_daily: z.ZodNullable<z.ZodNumber>;
|
|
27
|
+
byok_usage_weekly: z.ZodNullable<z.ZodNumber>;
|
|
28
|
+
is_management_key: z.ZodNullable<z.ZodBoolean>;
|
|
29
|
+
byok_usage_monthly: z.ZodNullable<z.ZodNumber>;
|
|
30
|
+
is_provisioning_key: z.ZodNullable<z.ZodBoolean>;
|
|
31
|
+
include_byok_in_limit: z.ZodNullable<z.ZodBoolean>;
|
|
32
|
+
}, z.core.$loose>>;
|
|
33
|
+
}, z.core.$loose>;
|
|
34
|
+
declare const openrouterGetCurrentKey: import("@keystrokehq/action").WorkflowActionDefinition<{
|
|
35
|
+
x_title?: string | undefined;
|
|
36
|
+
http_referer?: string | undefined;
|
|
37
|
+
}, unknown, import("@keystrokehq/shared").ResolvedCredentials<readonly [import("@keystrokehq/shared").Credential]>, readonly [import("@keystrokehq/shared").Credential]>;
|
|
7
38
|
//#endregion
|
|
8
39
|
export { openrouterGetCurrentKey };
|
|
9
40
|
//# sourceMappingURL=get-current-key.d.mts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"get-current-key.d.mts","names":[],"sources":["../../src/actions/get-current-key.ts"],"mappings":";;;cAIa,4BAAA,
|
|
1
|
+
{"version":3,"file":"get-current-key.d.mts","names":[],"sources":["../../src/actions/get-current-key.ts"],"mappings":";;;cAIa,4BAAA,EAA4B,CAAA,CAAA,SAAA;;;;cA6B5B,6BAAA,EAA6B,CAAA,CAAA,SAAA;;;;;;;;;;;;;;;;;;;;;;;;;;cAI7B,uBAAA,gCAAuB,wBAAA"}
|
|
@@ -6,36 +6,36 @@ const OpenrouterGetCurrentKeyInput = z.object({
|
|
|
6
6
|
http_referer: z.string().describe("The app identifier should be your app's URL and is used as the primary identifier for rankings. This is used to track API usage per application.").optional()
|
|
7
7
|
}).describe("Request for retrieving current API key information.");
|
|
8
8
|
const OpenrouterGetCurrentKey_RateLimitSchema = z.object({
|
|
9
|
-
note: z.string().describe("Deprecation note."),
|
|
10
|
-
interval: z.string().describe("Time interval for rate limit."),
|
|
11
|
-
requests: z.number().describe("Number of requests allowed.")
|
|
12
|
-
}).describe("Legacy rate limit information (deprecated).");
|
|
9
|
+
note: z.string().describe("Deprecation note.").nullable(),
|
|
10
|
+
interval: z.string().describe("Time interval for rate limit.").nullable(),
|
|
11
|
+
requests: z.number().describe("Number of requests allowed.").nullable()
|
|
12
|
+
}).passthrough().describe("Legacy rate limit information (deprecated).");
|
|
13
13
|
const OpenrouterGetCurrentKey_KeyDataSchema = z.object({
|
|
14
|
-
label: z.string().describe("Human-readable label for the API key."),
|
|
14
|
+
label: z.string().describe("Human-readable label for the API key.").nullable(),
|
|
15
15
|
limit: z.number().describe("Spending limit for the API key in USD.").nullable().optional(),
|
|
16
|
-
usage: z.number().describe("Total OpenRouter credit usage (in USD) for the API key."),
|
|
17
|
-
byok_usage: z.number().describe("Total external BYOK usage (in USD) for the API key."),
|
|
16
|
+
usage: z.number().describe("Total OpenRouter credit usage (in USD) for the API key.").nullable(),
|
|
17
|
+
byok_usage: z.number().describe("Total external BYOK usage (in USD) for the API key.").nullable(),
|
|
18
18
|
expires_at: z.string().describe("ISO 8601 UTC timestamp when the API key expires, or null if no expiration.").nullable().optional(),
|
|
19
19
|
rate_limit: OpenrouterGetCurrentKey_RateLimitSchema.nullable(),
|
|
20
20
|
limit_reset: z.string().describe("Type of limit reset for the API key.").nullable().optional(),
|
|
21
|
-
usage_daily: z.number().describe("OpenRouter credit usage (in USD) for the current UTC day."),
|
|
22
|
-
is_free_tier: z.boolean().describe("Whether this is a free tier API key."),
|
|
23
|
-
usage_weekly: z.number().describe("OpenRouter credit usage (in USD) for the current UTC week (Monday-Sunday)."),
|
|
24
|
-
usage_monthly: z.number().describe("OpenRouter credit usage (in USD) for the current UTC month."),
|
|
21
|
+
usage_daily: z.number().describe("OpenRouter credit usage (in USD) for the current UTC day.").nullable(),
|
|
22
|
+
is_free_tier: z.boolean().describe("Whether this is a free tier API key.").nullable(),
|
|
23
|
+
usage_weekly: z.number().describe("OpenRouter credit usage (in USD) for the current UTC week (Monday-Sunday).").nullable(),
|
|
24
|
+
usage_monthly: z.number().describe("OpenRouter credit usage (in USD) for the current UTC month.").nullable(),
|
|
25
25
|
limit_remaining: z.number().describe("Remaining spending limit in USD.").nullable().optional(),
|
|
26
|
-
byok_usage_daily: z.number().describe("External BYOK usage (in USD) for the current UTC day."),
|
|
27
|
-
byok_usage_weekly: z.number().describe("External BYOK usage (in USD) for the current UTC week (Monday-Sunday)."),
|
|
28
|
-
is_management_key: z.boolean().describe("Whether this is a management key."),
|
|
29
|
-
byok_usage_monthly: z.number().describe("External BYOK usage (in USD) for current UTC month."),
|
|
30
|
-
is_provisioning_key: z.boolean().describe("Whether this is a provisioning key."),
|
|
31
|
-
include_byok_in_limit: z.boolean().describe("Whether to include external BYOK usage in the credit limit.")
|
|
32
|
-
}).describe("API key information.");
|
|
26
|
+
byok_usage_daily: z.number().describe("External BYOK usage (in USD) for the current UTC day.").nullable(),
|
|
27
|
+
byok_usage_weekly: z.number().describe("External BYOK usage (in USD) for the current UTC week (Monday-Sunday).").nullable(),
|
|
28
|
+
is_management_key: z.boolean().describe("Whether this is a management key.").nullable(),
|
|
29
|
+
byok_usage_monthly: z.number().describe("External BYOK usage (in USD) for current UTC month.").nullable(),
|
|
30
|
+
is_provisioning_key: z.boolean().describe("Whether this is a provisioning key.").nullable(),
|
|
31
|
+
include_byok_in_limit: z.boolean().describe("Whether to include external BYOK usage in the credit limit.").nullable()
|
|
32
|
+
}).passthrough().describe("API key information.");
|
|
33
33
|
const openrouterGetCurrentKey = action("OPENROUTER_GET_CURRENT_KEY", {
|
|
34
34
|
slug: "openrouter-get-current-key",
|
|
35
35
|
name: "Get Current Key",
|
|
36
36
|
description: "Tool to get information about the currently authenticated API key. Use to check usage limits, spending, and key metadata.",
|
|
37
37
|
input: OpenrouterGetCurrentKeyInput,
|
|
38
|
-
output: z.object({ data: OpenrouterGetCurrentKey_KeyDataSchema.nullable() }).describe("Response containing current API key information.")
|
|
38
|
+
output: z.object({ data: OpenrouterGetCurrentKey_KeyDataSchema.nullable() }).passthrough().describe("Response containing current API key information.")
|
|
39
39
|
});
|
|
40
40
|
//#endregion
|
|
41
41
|
export { openrouterGetCurrentKey };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"get-current-key.mjs","names":[],"sources":["../../src/actions/get-current-key.ts"],"sourcesContent":["import { z } from \"zod\";\n\nimport { action } from \"../action\";\n\nexport const OpenrouterGetCurrentKeyInput
|
|
1
|
+
{"version":3,"file":"get-current-key.mjs","names":[],"sources":["../../src/actions/get-current-key.ts"],"sourcesContent":["import { z } from \"zod\";\n\nimport { action } from \"../action\";\n\nexport const OpenrouterGetCurrentKeyInput = z.object({\n x_title: z.string().describe(\"The app display name allows you to customize how your app appears in OpenRouter's dashboard.\").optional(),\n http_referer: z.string().describe(\"The app identifier should be your app's URL and is used as the primary identifier for rankings. This is used to track API usage per application.\").optional(),\n}).describe(\"Request for retrieving current API key information.\");\nconst OpenrouterGetCurrentKey_RateLimitSchema = z.object({\n note: z.string().describe(\"Deprecation note.\").nullable(),\n interval: z.string().describe(\"Time interval for rate limit.\").nullable(),\n requests: z.number().describe(\"Number of requests allowed.\").nullable(),\n}).passthrough().describe(\"Legacy rate limit information (deprecated).\");\nconst OpenrouterGetCurrentKey_KeyDataSchema = z.object({\n label: z.string().describe(\"Human-readable label for the API key.\").nullable(),\n limit: z.number().describe(\"Spending limit for the API key in USD.\").nullable().optional(),\n usage: z.number().describe(\"Total OpenRouter credit usage (in USD) for the API key.\").nullable(),\n byok_usage: z.number().describe(\"Total external BYOK usage (in USD) for the API key.\").nullable(),\n expires_at: z.string().describe(\"ISO 8601 UTC timestamp when the API key expires, or null if no expiration.\").nullable().optional(),\n rate_limit: OpenrouterGetCurrentKey_RateLimitSchema.nullable(),\n limit_reset: z.string().describe(\"Type of limit reset for the API key.\").nullable().optional(),\n usage_daily: z.number().describe(\"OpenRouter credit usage (in USD) for the current UTC day.\").nullable(),\n is_free_tier: z.boolean().describe(\"Whether this is a free tier API key.\").nullable(),\n usage_weekly: z.number().describe(\"OpenRouter credit usage (in USD) for the current UTC week (Monday-Sunday).\").nullable(),\n usage_monthly: z.number().describe(\"OpenRouter credit usage (in USD) for the current UTC month.\").nullable(),\n limit_remaining: z.number().describe(\"Remaining spending limit in USD.\").nullable().optional(),\n byok_usage_daily: z.number().describe(\"External BYOK usage (in USD) for the current UTC day.\").nullable(),\n byok_usage_weekly: z.number().describe(\"External BYOK usage (in USD) for the current UTC week (Monday-Sunday).\").nullable(),\n is_management_key: z.boolean().describe(\"Whether this is a management key.\").nullable(),\n byok_usage_monthly: z.number().describe(\"External BYOK usage (in USD) for current UTC month.\").nullable(),\n is_provisioning_key: z.boolean().describe(\"Whether this is a provisioning key.\").nullable(),\n include_byok_in_limit: z.boolean().describe(\"Whether to include external BYOK usage in the credit limit.\").nullable(),\n}).passthrough().describe(\"API key information.\");\nexport const OpenrouterGetCurrentKeyOutput = z.object({\n data: OpenrouterGetCurrentKey_KeyDataSchema.nullable(),\n}).passthrough().describe(\"Response containing current API key information.\");\n\nexport const openrouterGetCurrentKey = action(\"OPENROUTER_GET_CURRENT_KEY\", {\n slug: \"openrouter-get-current-key\",\n name: \"Get Current Key\",\n description: \"Tool to get information about the currently authenticated API key. Use to check usage limits, spending, and key metadata.\",\n input: OpenrouterGetCurrentKeyInput,\n output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OAAO,CAAC,CAAC,SAAS,4EAA4E,CAAC,CAAC,SAAS;CACzH,eAAe,EAAE,OAAO,CAAC,CAAC,SAAS,6DAA6D,CAAC,CAAC,SAAS;CAC3G,iBAAiB,EAAE,OAAO,CAAC,CAAC,SAAS,kCAAkC,CAAC,CAAC,SAAS,CAAC,CAAC,SAAS;CAC7F,kBAAkB,EAAE,OAAO,CAAC,CAAC,SAAS,uDAAuD,CAAC,CAAC,SAAS;CACxG,mBAAmB,EAAE,OAAO,CAAC,CAAC,SAAS,wEAAwE,CAAC,CAAC,SAAS;CAC1H,mBAAmB,EAAE,QAAQ,CAAC,CAAC,SAAS,mCAAmC,CAAC,CAAC,SAAS;CACtF,oBAAoB,EAAE,OAAO,CAAC,CAAC,SAAS,qDAAqD,CAAC,CAAC,SAAS;CACxG,qBAAqB,EAAE,QAAQ,CAAC,CAAC,SAAS,qCAAqC,CAAC,CAAC,SAAS;CAC1F,uBAAuB,EAAE,QAAQ,CAAC,CAAC,SAAS,6DAA6D,CAAC,CAAC,SAAS;AACtH,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC,SAAS,sBAAsB;AAKhD,MAAa,0BAA0B,OAAO,8BAA8B;CAC1E,MAAM;CACN,MAAM;CACN,aAAa;CACb,OAAO;CACP,QAT2C,EAAE,OAAO,EACpD,MAAM,sCAAsC,SAAS,EACvD,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC,SAAS,kDAOhB;AACV,CAAC"}
|
|
@@ -3,35 +3,35 @@ let zod = require("zod");
|
|
|
3
3
|
//#region src/actions/get-generation.ts
|
|
4
4
|
const OpenrouterGetGenerationInput = zod.z.object({ id: zod.z.string().describe("Unique identifier of the generation to retrieve.") }).describe("Request model for retrieving a generation by its unique ID.");
|
|
5
5
|
const OpenrouterGetGeneration_GenerationDataSchema = zod.z.object({
|
|
6
|
-
id: zod.z.string().describe("Unique identifier of the generation."),
|
|
7
|
-
model: zod.z.string().describe("Model used to generate the response."),
|
|
8
|
-
usage: zod.z.number().describe("Normalized token usage (sum of prompt and completion tokens)."),
|
|
6
|
+
id: zod.z.string().describe("Unique identifier of the generation.").nullable(),
|
|
7
|
+
model: zod.z.string().describe("Model used to generate the response.").nullable(),
|
|
8
|
+
usage: zod.z.number().describe("Normalized token usage (sum of prompt and completion tokens).").nullable(),
|
|
9
9
|
app_id: zod.z.number().int().describe("Application identifier associated with this generation.").nullable().optional(),
|
|
10
|
-
origin: zod.z.string().describe("Source/origin of the request."),
|
|
11
|
-
is_byok: zod.z.boolean().describe("Indicates if a BYOK key was used."),
|
|
12
|
-
latency: zod.z.number().int().describe("Total latency in milliseconds for response generation."),
|
|
13
|
-
streamed: zod.z.boolean().describe("Whether this generation was streamed."),
|
|
14
|
-
cancelled: zod.z.boolean().describe("Whether this generation was cancelled before completion."),
|
|
15
|
-
created_at: zod.z.string().describe("Timestamp when the generation was created."),
|
|
16
|
-
total_cost: zod.z.number().describe("Total cost incurred for this generation."),
|
|
10
|
+
origin: zod.z.string().describe("Source/origin of the request.").nullable(),
|
|
11
|
+
is_byok: zod.z.boolean().describe("Indicates if a BYOK key was used.").nullable(),
|
|
12
|
+
latency: zod.z.number().int().describe("Total latency in milliseconds for response generation.").nullable(),
|
|
13
|
+
streamed: zod.z.boolean().describe("Whether this generation was streamed.").nullable(),
|
|
14
|
+
cancelled: zod.z.boolean().describe("Whether this generation was cancelled before completion.").nullable(),
|
|
15
|
+
created_at: zod.z.string().describe("Timestamp when the generation was created.").nullable(),
|
|
16
|
+
total_cost: zod.z.number().describe("Total cost incurred for this generation.").nullable(),
|
|
17
17
|
upstream_id: zod.z.string().describe("Upstream provider's generation ID, if any.").nullable().optional(),
|
|
18
|
-
finish_reason: zod.z.string().describe("Normalized finish reason (e.g., 'stop', 'length')."),
|
|
19
|
-
provider_name: zod.z.string().describe("Name of the upstream provider used."),
|
|
20
|
-
tokens_prompt: zod.z.number().int().describe("Number of tokens in the prompt."),
|
|
18
|
+
finish_reason: zod.z.string().describe("Normalized finish reason (e.g., 'stop', 'length').").nullable(),
|
|
19
|
+
provider_name: zod.z.string().describe("Name of the upstream provider used.").nullable(),
|
|
20
|
+
tokens_prompt: zod.z.number().int().describe("Number of tokens in the prompt.").nullable(),
|
|
21
21
|
cache_discount: zod.z.number().describe("Discount applied from cache hits, if any.").nullable().optional(),
|
|
22
|
-
generation_time: zod.z.number().int().describe("Time in milliseconds taken by the model to generate the content."),
|
|
22
|
+
generation_time: zod.z.number().int().describe("Time in milliseconds taken by the model to generate the content.").nullable(),
|
|
23
23
|
num_media_prompt: zod.z.number().int().describe("Number of media items in the prompt.").nullable().optional(),
|
|
24
|
-
tokens_completion: zod.z.number().int().describe("Number of tokens in the completion."),
|
|
24
|
+
tokens_completion: zod.z.number().int().describe("Number of tokens in the completion.").nullable(),
|
|
25
25
|
moderation_latency: zod.z.number().int().describe("Latency in milliseconds spent on moderation, if any.").nullable().optional(),
|
|
26
26
|
num_search_results: zod.z.number().int().describe("Number of search results used, if any.").nullable().optional(),
|
|
27
|
-
native_finish_reason: zod.z.string().describe("Raw finish reason returned by the model."),
|
|
28
|
-
native_tokens_prompt: zod.z.number().int().describe("Prompt tokens counted by the provider's tokenizer."),
|
|
27
|
+
native_finish_reason: zod.z.string().describe("Raw finish reason returned by the model.").nullable(),
|
|
28
|
+
native_tokens_prompt: zod.z.number().int().describe("Prompt tokens counted by the provider's tokenizer.").nullable(),
|
|
29
29
|
num_media_completion: zod.z.number().int().describe("Number of media items in the completion.").nullable().optional(),
|
|
30
|
-
native_tokens_reasoning: zod.z.number().int().describe("Tokens used for internal reasoning by the model."),
|
|
30
|
+
native_tokens_reasoning: zod.z.number().int().describe("Tokens used for internal reasoning by the model.").nullable(),
|
|
31
31
|
upstream_inference_cost: zod.z.number().describe("Cost charged by the upstream provider.").nullable().optional(),
|
|
32
|
-
native_tokens_completion: zod.z.number().int().describe("Completion tokens counted by the provider's tokenizer.")
|
|
33
|
-
}).describe("Detailed metadata for a specific generation request.");
|
|
34
|
-
const OpenrouterGetGenerationOutput = zod.z.object({ data: OpenrouterGetGeneration_GenerationDataSchema.nullable() }).describe("Response model containing the data for a retrieved generation.");
|
|
32
|
+
native_tokens_completion: zod.z.number().int().describe("Completion tokens counted by the provider's tokenizer.").nullable()
|
|
33
|
+
}).passthrough().describe("Detailed metadata for a specific generation request.");
|
|
34
|
+
const OpenrouterGetGenerationOutput = zod.z.object({ data: OpenrouterGetGeneration_GenerationDataSchema.nullable() }).passthrough().describe("Response model containing the data for a retrieved generation.");
|
|
35
35
|
const openrouterGetGeneration = require_action.action("OPENROUTER_GET_GENERATION", {
|
|
36
36
|
slug: "openrouter-get-generation",
|
|
37
37
|
name: "Get Generation",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"get-generation.cjs","names":["z","action"],"sources":["../../src/actions/get-generation.ts"],"sourcesContent":["import { z } from \"zod\";\n\nimport { action } from \"../action\";\n\nexport const OpenrouterGetGenerationInput
|
|
1
|
+
{"version":3,"file":"get-generation.cjs","names":["z","action"],"sources":["../../src/actions/get-generation.ts"],"sourcesContent":["import { z } from \"zod\";\n\nimport { action } from \"../action\";\n\nexport const OpenrouterGetGenerationInput = z.object({\n id: z.string().describe(\"Unique identifier of the generation to retrieve.\"),\n}).describe(\"Request model for retrieving a generation by its unique ID.\");\nconst OpenrouterGetGeneration_GenerationDataSchema = z.object({\n id: z.string().describe(\"Unique identifier of the generation.\").nullable(),\n model: z.string().describe(\"Model used to generate the response.\").nullable(),\n usage: z.number().describe(\"Normalized token usage (sum of prompt and completion tokens).\").nullable(),\n app_id: z.number().int().describe(\"Application identifier associated with this generation.\").nullable().optional(),\n origin: z.string().describe(\"Source/origin of the request.\").nullable(),\n is_byok: z.boolean().describe(\"Indicates if a BYOK key was used.\").nullable(),\n latency: z.number().int().describe(\"Total latency in milliseconds for response generation.\").nullable(),\n streamed: z.boolean().describe(\"Whether this generation was streamed.\").nullable(),\n cancelled: z.boolean().describe(\"Whether this generation was cancelled before completion.\").nullable(),\n created_at: z.string().describe(\"Timestamp when the generation was created.\").nullable(),\n total_cost: z.number().describe(\"Total cost incurred for this generation.\").nullable(),\n upstream_id: z.string().describe(\"Upstream provider's generation ID, if any.\").nullable().optional(),\n finish_reason: z.string().describe(\"Normalized finish reason (e.g., 'stop', 'length').\").nullable(),\n provider_name: z.string().describe(\"Name of the upstream provider used.\").nullable(),\n tokens_prompt: z.number().int().describe(\"Number of tokens in the prompt.\").nullable(),\n cache_discount: z.number().describe(\"Discount applied from cache hits, if any.\").nullable().optional(),\n generation_time: z.number().int().describe(\"Time in milliseconds taken by the model to generate the content.\").nullable(),\n num_media_prompt: z.number().int().describe(\"Number of media items in the prompt.\").nullable().optional(),\n tokens_completion: z.number().int().describe(\"Number of tokens in the completion.\").nullable(),\n moderation_latency: z.number().int().describe(\"Latency in milliseconds spent on moderation, if any.\").nullable().optional(),\n num_search_results: z.number().int().describe(\"Number of search results used, if any.\").nullable().optional(),\n native_finish_reason: z.string().describe(\"Raw finish reason returned by the model.\").nullable(),\n native_tokens_prompt: z.number().int().describe(\"Prompt tokens counted by the provider's tokenizer.\").nullable(),\n num_media_completion: z.number().int().describe(\"Number of media items in the completion.\").nullable().optional(),\n native_tokens_reasoning: z.number().int().describe(\"Tokens used for internal reasoning by the model.\").nullable(),\n upstream_inference_cost: z.number().describe(\"Cost charged by the upstream provider.\").nullable().optional(),\n native_tokens_completion: z.number().int().describe(\"Completion tokens counted by the provider's tokenizer.\").nullable(),\n}).passthrough().describe(\"Detailed metadata for a specific generation request.\");\nexport const OpenrouterGetGenerationOutput = z.object({\n data: OpenrouterGetGeneration_GenerationDataSchema.nullable(),\n}).passthrough().describe(\"Response model containing the data for a retrieved generation.\");\n\nexport const openrouterGetGeneration = action(\"OPENROUTER_GET_GENERATION\", {\n slug: \"openrouter-get-generation\",\n name: \"Get Generation\",\n description: \"Tool to retrieve a generation result by its unique ID. Use after a generation completes to fetch metadata like token counts, cost, and latency.\",\n input: OpenrouterGetGenerationInput,\n output: OpenrouterGetGenerationOutput,\n});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AC,CAAC,SAAS;CAChH,yBAAyBA,IAAAA,EAAE,OAAO,CAAC,CAAC,SAAS,wCAAwC,CAAC,CAAC,SAAS,CAAC,CAAC,SAAS;CAC3G,0BAA0BA,IAAAA,EAAE,OAAO,CAAC,CAAC,IAAI,CAAC,CAAC,SAAS,wDAAwD,CAAC,CAAC,SAAS;AACzH,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC,SAAS,sDAAsD;AAChF,MAAa,gCAAgCA,IAAAA,EAAE,OAAO,EACpD,MAAM,6CAA6C,SAAS,EAC9D,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC,SAAS,gEAAgE;AAE1F,MAAa,0BAA0BC,eAAAA,OAAO,6BAA6B;CACzE,MAAM;CACN,MAAM;CACN,aAAa;CACb,OAAO;CACP,QAAQ;AACV,CAAC"}
|
|
@@ -1,9 +1,43 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
2
|
|
|
3
3
|
//#region src/actions/get-generation.d.ts
|
|
4
|
-
declare const OpenrouterGetGenerationInput: z.
|
|
5
|
-
|
|
6
|
-
|
|
4
|
+
declare const OpenrouterGetGenerationInput: z.ZodObject<{
|
|
5
|
+
id: z.ZodString;
|
|
6
|
+
}, z.core.$strip>;
|
|
7
|
+
declare const OpenrouterGetGenerationOutput: z.ZodObject<{
|
|
8
|
+
data: z.ZodNullable<z.ZodObject<{
|
|
9
|
+
id: z.ZodNullable<z.ZodString>;
|
|
10
|
+
model: z.ZodNullable<z.ZodString>;
|
|
11
|
+
usage: z.ZodNullable<z.ZodNumber>;
|
|
12
|
+
app_id: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
13
|
+
origin: z.ZodNullable<z.ZodString>;
|
|
14
|
+
is_byok: z.ZodNullable<z.ZodBoolean>;
|
|
15
|
+
latency: z.ZodNullable<z.ZodNumber>;
|
|
16
|
+
streamed: z.ZodNullable<z.ZodBoolean>;
|
|
17
|
+
cancelled: z.ZodNullable<z.ZodBoolean>;
|
|
18
|
+
created_at: z.ZodNullable<z.ZodString>;
|
|
19
|
+
total_cost: z.ZodNullable<z.ZodNumber>;
|
|
20
|
+
upstream_id: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
21
|
+
finish_reason: z.ZodNullable<z.ZodString>;
|
|
22
|
+
provider_name: z.ZodNullable<z.ZodString>;
|
|
23
|
+
tokens_prompt: z.ZodNullable<z.ZodNumber>;
|
|
24
|
+
cache_discount: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
25
|
+
generation_time: z.ZodNullable<z.ZodNumber>;
|
|
26
|
+
num_media_prompt: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
27
|
+
tokens_completion: z.ZodNullable<z.ZodNumber>;
|
|
28
|
+
moderation_latency: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
29
|
+
num_search_results: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
30
|
+
native_finish_reason: z.ZodNullable<z.ZodString>;
|
|
31
|
+
native_tokens_prompt: z.ZodNullable<z.ZodNumber>;
|
|
32
|
+
num_media_completion: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
33
|
+
native_tokens_reasoning: z.ZodNullable<z.ZodNumber>;
|
|
34
|
+
upstream_inference_cost: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
35
|
+
native_tokens_completion: z.ZodNullable<z.ZodNumber>;
|
|
36
|
+
}, z.core.$loose>>;
|
|
37
|
+
}, z.core.$loose>;
|
|
38
|
+
declare const openrouterGetGeneration: import("@keystrokehq/action").WorkflowActionDefinition<{
|
|
39
|
+
id: string;
|
|
40
|
+
}, unknown, import("@keystrokehq/shared").ResolvedCredentials<readonly [import("@keystrokehq/shared").Credential]>, readonly [import("@keystrokehq/shared").Credential]>;
|
|
7
41
|
//#endregion
|
|
8
42
|
export { openrouterGetGeneration };
|
|
9
43
|
//# sourceMappingURL=get-generation.d.cts.map
|