Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 7 additions & 3 deletions .speakeasy/gen.lock
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
lockVersion: ""
id: ""
management:
docChecksum: e70e2accb15789ed1d8188205e9e99f4
docChecksum: 5221786825510ab2ed2fb6753a3f7938
docVersion: 1.0.0
speakeasyVersion: 1.808.1
generationVersion: 2.960.8
releaseVersion: 1.5.176
configChecksum: 0f8dc3176c4649e784bfde212a52b8a9
releaseVersion: 1.5.177
configChecksum: 77a2df0fea0b66aa9241821d55f3b0cf
repoURL: https://github.com/OpenRouterTeam/typescript-sdk.git
installationURL: https://github.com/OpenRouterTeam/typescript-sdk
published: true
Expand Down Expand Up @@ -5668,6 +5668,7 @@ trackedFiles:
docs/models/inputimagemask.mdx:
id: f3c5395c02fe
pristine_git_object: 344add2998e705a7765fbdd4beb30ff364db98c5
docs/models/inputimagerole.mdx: {}
docs/models/inputimagetypeenum.md:
id: 0cca56846e94
last_write_checksum: sha1:1a7f77ccee3d3c7962de40074df4a2bfc35cdf2e
Expand Down Expand Up @@ -24218,3 +24219,6 @@ examples:
"500":
application/json: {"error": {"code": 500, "message": "Internal Server Error"}}
examplesVersion: 1.0.2
releaseNotes: |
## Typescript SDK Changes:
* `openrouter.images.listModelEndpoints()`: `response.endpoints[].inputImageRole` **Added**
2 changes: 1 addition & 1 deletion .speakeasy/gen.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ generation:
documentation: mintlify
preApplyUnionDiscriminators: true
typescript:
version: 1.5.176
version: 1.5.177
acceptHeaderEnum: false
additionalDependencies:
dependencies:
Expand Down
8 changes: 8 additions & 0 deletions .speakeasy/out.openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17633,6 +17633,14 @@ components:
items:
type: 'string'
type: 'array'
input_image_role:
description: 'How this endpoint uses input_references: edit transforms the input image; reference guides a new generation.'
enum:
- 'edit'
- 'reference'
example: 'edit'
type: 'string'
x-speakeasy-unknown-values: allow
input_modalities:
description: 'Typed inputs the model accepts, following the Models API V2 document.'
items:
Expand Down
10 changes: 5 additions & 5 deletions .speakeasy/workflow.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,19 @@ speakeasyVersion: 1.808.1
sources:
OpenRouter API:
sourceNamespace: open-router-chat-completions-api
sourceRevisionDigest: sha256:81dde53ef43888d932ce5a8d8c1f2ddf91d0f7af7ff3b12be265a89f1904c9b5
sourceBlobDigest: sha256:3e80adc614afa2806ab0681a6d90d031ed137170f6cd05d7c7dc1c2822796ce3
sourceRevisionDigest: sha256:3bdeec0066fa727df2f03c145586e02660fb6a88ff4e44d22e7e71b7e5e49fc7
sourceBlobDigest: sha256:60f2509c58618167397bc0aee540545494d7a7b6402bbf56e72192befedc5d86
tags:
- latest
- 1.0.0
targets:
openrouter:
source: OpenRouter API
sourceNamespace: open-router-chat-completions-api
sourceRevisionDigest: sha256:81dde53ef43888d932ce5a8d8c1f2ddf91d0f7af7ff3b12be265a89f1904c9b5
sourceBlobDigest: sha256:3e80adc614afa2806ab0681a6d90d031ed137170f6cd05d7c7dc1c2822796ce3
sourceRevisionDigest: sha256:3bdeec0066fa727df2f03c145586e02660fb6a88ff4e44d22e7e71b7e5e49fc7
sourceBlobDigest: sha256:60f2509c58618167397bc0aee540545494d7a7b6402bbf56e72192befedc5d86
codeSamplesNamespace: open-router-chat-completions-api-typescript-code-samples
codeSamplesRevisionDigest: sha256:979de4275f0bc27c7bf635a7231ac1d791668a2b743eb35132c492f6740e56ff
codeSamplesRevisionDigest: sha256:07777671b704fadc2799d9ba1c94c492a9df115cae2b9b4149e1e7a6089dac02
workflow:
workflowVersion: 1.0.0
speakeasyVersion: 1.808.1
Expand Down
12 changes: 11 additions & 1 deletion RELEASES.md
Original file line number Diff line number Diff line change
Expand Up @@ -6136,4 +6136,14 @@ Based on:
### Generated
- [typescript v1.5.176] .
### Releases
- [NPM v1.5.176] https://www.npmjs.com/package/@openrouter/sdk/v/1.5.176 - .
- [NPM v1.5.176] https://www.npmjs.com/package/@openrouter/sdk/v/1.5.176 - .

## 2026-12-04 11:13:33
### Changes
Based on:
- OpenAPI Doc
- Speakeasy CLI 1.808.1 (2.960.8) https://github.com/speakeasy-api/speakeasy
### Generated
- [typescript v1.5.177] .
### Releases
- [NPM v1.5.177] https://www.npmjs.com/package/@openrouter/sdk/v/1.5.177 - .
1 change: 1 addition & 0 deletions docs/models/imageendpoint.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ let value: ImageEndpoint = {
| Field | Type | Required | Description | Example |
| -------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `allowedPassthroughParameters` | *string*[] | ✔️ | Provider-specific options accepted under provider.options[provider_slug]. | [] |
| `inputImageRole` | [models.InputImageRole](../models/inputimagerole.mdx) | ➖ | How this endpoint uses input_references: edit transforms the input image; reference guides a new generation. | edit |
| `inputModalities` | *models.ModelInputModalityV2*[] | ➖ | Typed inputs the model accepts, following the Models API V2 document. | |
| `outputModalities` | *models.ModelOutputModalityV2*[] | ➖ | Typed outputs with the request fields each accepts, following the Models API V2 document. | |
| `pricing` | [models.ImagePricingEntry](../models/imagepricingentry.mdx)[] | ✔️ | Billable pricing lines for this endpoint. | [<br/>\{<br/>"billable": "output_image",<br/>"cost_usd": 0.05,<br/>"unit": "image"<br/>}<br/>] |
Expand Down
21 changes: 21 additions & 0 deletions docs/models/inputimagerole.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
---
title: "InputImageRole"
---

How this endpoint uses input_references: edit transforms the input image; reference guides a new generation.

## Example Usage

```typescript
import { InputImageRole } from "@openrouter/sdk/models";

let value: InputImageRole = "edit";

// Open enum: unrecognized values are captured as Unrecognized<string>
```

## Values

```typescript
"edit" | "reference" | Unrecognized<string>
```
2 changes: 1 addition & 1 deletion jsr.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

{
"name": "@openrouter/sdk",
"version": "1.5.176",
"version": "1.5.177",
"exports": {
".": "./src/index.ts",
"./models/errors": "./src/models/errors/index.ts",
Expand Down
12 changes: 6 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@openrouter/sdk",
"version": "1.5.176",
"version": "1.5.177",
"author": "OpenRouter",
"description": "The OpenRouter TypeScript SDK is a type-safe toolkit for building AI applications with access to 400+ language models through a unified API.",
"keywords": [
Expand Down Expand Up @@ -73,15 +73,15 @@
"lint": "eslint --cache --max-warnings=0 src",
"build": "node --max-old-space-size=8192 ./node_modules/typescript/bin/tsc && node scripts/unbarrel-imports.js",
"prepublishOnly": "npm run build",
"postinstall": "node scripts/check-types.js || true",
"prepare": "npm run build",
"test": "vitest --run --project unit",
"test:e2e": "vitest --run --project e2e",
"test:transit": "exit 0",
"test:watch": "vitest --watch --project unit",
"typecheck": "tsc --noEmit",
"typecheck:transit": "exit 0",
"compile": "node --max-old-space-size=8192 ./node_modules/typescript/bin/tsc && node scripts/unbarrel-imports.js",
"test": "vitest --run --project unit",
"typecheck:transit": "exit 0"
"prepare": "npm run build",
"test:transit": "exit 0",
"postinstall": "node scripts/check-types.js || true"
},
"peerDependencies": {

Expand Down
4 changes: 2 additions & 2 deletions src/lib/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ export function serverURLFromOptions(options: SDKOptions): URL | null {
export const SDK_METADATA = {
language: "typescript",
openapiDocVersion: "1.0.0",
sdkVersion: "1.5.176",
sdkVersion: "1.5.177",
genVersion: "2.960.8",
userAgent: "speakeasy-sdk/typescript 1.5.176 2.960.8 1.0.0 @openrouter/sdk",
userAgent: "speakeasy-sdk/typescript 1.5.177 2.960.8 1.0.0 @openrouter/sdk",
} as const;
24 changes: 24 additions & 0 deletions src/models/imageendpoint.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
import * as z from "zod/v4";
import { remap as remap$ } from "../lib/primitives.js";
import { safeParse } from "../lib/schemas.js";
import * as openEnums from "../types/enums.js";
import { OpenEnum } from "../types/enums.js";
import { Result as SafeParseResult } from "../types/fp.js";
import {
CapabilityDescriptor,
Expand All @@ -24,6 +26,18 @@ import {
ModelOutputModalityV2$inboundSchema,
} from "./modeloutputmodalityv2.js";

/**
* How this endpoint uses input_references: edit transforms the input image; reference guides a new generation.
*/
export const InputImageRole = {
Edit: "edit",
Reference: "reference",
} as const;
/**
* How this endpoint uses input_references: edit transforms the input image; reference guides a new generation.
*/
export type InputImageRole = OpenEnum<typeof InputImageRole>;

/**
* An endpoint that serves a given image model.
*/
Expand All @@ -32,6 +46,10 @@ export type ImageEndpoint = {
* Provider-specific options accepted under provider.options[provider_slug].
*/
allowedPassthroughParameters: Array<string>;
/**
* How this endpoint uses input_references: edit transforms the input image; reference guides a new generation.
*/
inputImageRole?: InputImageRole | undefined;
/**
* Typed inputs the model accepts, following the Models API V2 document.
*/
Expand Down Expand Up @@ -63,10 +81,15 @@ export type ImageEndpoint = {
supportsStreaming: boolean;
};

/** @internal */
export const InputImageRole$inboundSchema: z.ZodType<InputImageRole, unknown> =
openEnums.inboundSchema(InputImageRole);

/** @internal */
export const ImageEndpoint$inboundSchema: z.ZodType<ImageEndpoint, unknown> = z
.object({
allowed_passthrough_parameters: z.array(z.string()),
input_image_role: InputImageRole$inboundSchema.optional(),
input_modalities: z.array(ModelInputModalityV2$inboundSchema).optional(),
output_modalities: z.array(ModelOutputModalityV2$inboundSchema).optional(),
pricing: z.array(ImagePricingEntry$inboundSchema),
Expand All @@ -81,6 +104,7 @@ export const ImageEndpoint$inboundSchema: z.ZodType<ImageEndpoint, unknown> = z
}).transform((v) => {
return remap$(v, {
"allowed_passthrough_parameters": "allowedPassthroughParameters",
"input_image_role": "inputImageRole",
"input_modalities": "inputModalities",
"output_modalities": "outputModalities",
"provider_name": "providerName",
Expand Down