diff --git a/.speakeasy/gen.lock b/.speakeasy/gen.lock index d55d1952..eb2b64d5 100644 --- a/.speakeasy/gen.lock +++ b/.speakeasy/gen.lock @@ -1,18 +1,18 @@ lockVersion: 2.0.0 id: 9eea3e30-2722-4060-973b-57b7f1f75dc0 management: - docChecksum: feec084adeee109a80d7d699c2c3933d + docChecksum: cbbd5d542938008beaff4d6e86d102cf docVersion: 1.0.0 speakeasyVersion: 1.787.0 generationVersion: 2.914.0 - releaseVersion: 0.7.81 - configChecksum: 698040ecfebfac20de89d09a0618cb4c + releaseVersion: 0.7.82 + configChecksum: 9896dfac8e380632f597de981ab540b2 repoURL: https://github.com/OpenRouterTeam/go-sdk.git installationURL: https://github.com/OpenRouterTeam/go-sdk persistentEdits: - generation_id: 557ef05c-e797-4148-b8d4-05bcded10102 - pristine_commit_hash: 7adf510fcb0b225c76c988b6aa759d87ebc69be0 - pristine_tree_hash: 361211090e2117c50d148219935a80641ec44020 + generation_id: 969d12aa-86e5-4b5c-aad2-f96610d708d4 + pristine_commit_hash: 1a1e3b1e869279b0fc5dba35488e332ca1b19006 + pristine_tree_hash: f63df7eb6cb60f1c40c8444b9cbbbe0fecd4421c features: go: acceptHeaders: 2.81.2 @@ -5579,8 +5579,8 @@ trackedFiles: pristine_git_object: 859d7df5da8d17fac1b37a1ab02f7cca188e7be9 docs/models/components/unit.mdx: id: 47180a2596be - last_write_checksum: sha1:3f96b84bf2d6ca2cd2aa965e216845f4ed6adec4 - pristine_git_object: c0a67bf4a542c8ad122fcbf9d78a4f194dcc59ae + last_write_checksum: sha1:c5b336db2bfe5a6dfea82ce43e93b87dd5fba6c5 + pristine_git_object: 9a13c6a462f38eb8405a9dfff77f257f2d635d41 docs/models/components/unprocessableentityresponseerrordata.mdx: id: b9a255c3400e last_write_checksum: sha1:7202c4d2ceec8b3af07a78315270181c3c7b42dd @@ -8139,8 +8139,8 @@ trackedFiles: pristine_git_object: 99d69e8d3609a7cba0d679f12c4c081b1f16e916 models/components/imagepricingentry.go: id: b30e0f10bd90 - last_write_checksum: sha1:7296dd4d243354ef177f911ee9e599f770d71f13 - pristine_git_object: 6910fb6979643071fe928bf77cbc8ff3c7aa204c + last_write_checksum: sha1:19f5271c2ca76aaecab0491a08c2a72a9e8ccedc + pristine_git_object: a3072a3584328d4081d1272f0a55c146892023e1 models/components/imagestreamingresponse.go: id: 14779060e400 last_write_checksum: sha1:b906eb7cf55d28ce1786b696f73bdd2630a07a25 @@ -9919,8 +9919,8 @@ trackedFiles: pristine_git_object: 5e3a2cdf8cb4ed4f5378b712293cba9c82074f16 openrouter.go: id: 207ad004b774 - last_write_checksum: sha1:0d4a91c27f7f7f8a3eb84fbb5ad98240b18bddda - pristine_git_object: 6d944ddd9290663e7419234098c334f2a3883dfc + last_write_checksum: sha1:529da82ef45a5110d55f6ddd1f544f69bb0d6e94 + pristine_git_object: 893e42a1d966b8d7a649b3a405af7483bf808de5 optionalnullable/optionalnullable.go: id: ce60f259ead3 last_write_checksum: sha1:d6aff1a420c31e025ea21d46cf056e305ae76fe8 @@ -11846,3 +11846,6 @@ examples: "503": application/json: {"error": {"code": 503, "message": "Service temporarily unavailable"}} examplesVersion: 1.0.2 +releaseNotes: | + ## Go SDK Changes: + * `OpenRouter.Images.ListModelEndpoints()`: `response.Endpoints[].Pricing[].Unit.Enum(request)` **Added** diff --git a/.speakeasy/gen.yaml b/.speakeasy/gen.yaml index e5e51cb3..5526ec2b 100644 --- a/.speakeasy/gen.yaml +++ b/.speakeasy/gen.yaml @@ -36,7 +36,7 @@ generation: documentation: mintlify preApplyUnionDiscriminators: true go: - version: 0.7.81 + version: 0.7.82 additionalDependencies: {} baseErrorName: OpenRouterError clientServerStatusCodesAsErrors: true diff --git a/.speakeasy/out.openapi.yaml b/.speakeasy/out.openapi.yaml index 68c150f3..c84b0f25 100644 --- a/.speakeasy/out.openapi.yaml +++ b/.speakeasy/out.openapi.yaml @@ -11204,6 +11204,7 @@ components: type: 'number' unit: enum: + - 'request' - 'image' - 'megapixel' - 'token' diff --git a/.speakeasy/workflow.lock b/.speakeasy/workflow.lock index 73369d8e..65f37f81 100644 --- a/.speakeasy/workflow.lock +++ b/.speakeasy/workflow.lock @@ -2,8 +2,8 @@ speakeasyVersion: 1.787.0 sources: OpenRouter API: sourceNamespace: open-router-chat-completions-api - sourceRevisionDigest: sha256:f100802d0a4b46d44b48f0177e905a67590be438931eb4df9c380fddf113be35 - sourceBlobDigest: sha256:4d49bcfe8de8bb79e8fc9bd01926b7f82b69b8fc64e33af4e39868d88c5825f7 + sourceRevisionDigest: sha256:1d4902bd89e36b96fa401284367d9fb8810a8171bc882d764639ebcf0235b798 + sourceBlobDigest: sha256:361e32c3d8c6135da4baffc0b72c358a21d8f447ca0ad02112b7e6948519749e tags: - latest - 1.0.0 @@ -11,10 +11,10 @@ targets: openrouter: source: OpenRouter API sourceNamespace: open-router-chat-completions-api - sourceRevisionDigest: sha256:f100802d0a4b46d44b48f0177e905a67590be438931eb4df9c380fddf113be35 - sourceBlobDigest: sha256:4d49bcfe8de8bb79e8fc9bd01926b7f82b69b8fc64e33af4e39868d88c5825f7 + sourceRevisionDigest: sha256:1d4902bd89e36b96fa401284367d9fb8810a8171bc882d764639ebcf0235b798 + sourceBlobDigest: sha256:361e32c3d8c6135da4baffc0b72c358a21d8f447ca0ad02112b7e6948519749e codeSamplesNamespace: open-router-chat-completions-api-go-code-samples - codeSamplesRevisionDigest: sha256:a2bf38e421a16063141c04b07a0467e402b72fdb6a3ced76c545228a0a7a7b17 + codeSamplesRevisionDigest: sha256:f93af3d02f9e52ab116f51aa1c2c6d4594f5729abb263359e55ab226e67fe869 workflow: workflowVersion: 1.0.0 speakeasyVersion: 1.787.0 diff --git a/OVERVIEW.md b/OVERVIEW.md index f8f2e377..9ee8ad87 100644 --- a/OVERVIEW.md +++ b/OVERVIEW.md @@ -117,7 +117,7 @@ go get github.com/OpenRouterTeam/go-sdk For beta releases, pin an explicit version: ```bash -go get github.com/OpenRouterTeam/go-sdk@v0.7.81 +go get github.com/OpenRouterTeam/go-sdk@v0.7.82 ``` **Requirements:** Go 1.25 or higher diff --git a/README.md b/README.md index 37bcff2f..eb111b18 100644 --- a/README.md +++ b/README.md @@ -13,7 +13,7 @@ To learn more, see the [API Reference](https://openrouter.ai/docs/sdks/go/api-re > This SDK is in **beta**. Pin to a specific version to avoid unexpected breaking changes: > > ```bash -> go get github.com/OpenRouterTeam/go-sdk@v0.7.81 +> go get github.com/OpenRouterTeam/go-sdk@v0.7.82 > ``` diff --git a/RELEASES.md b/RELEASES.md index 8914428a..5d16dc06 100644 --- a/RELEASES.md +++ b/RELEASES.md @@ -1338,4 +1338,14 @@ Based on: ### Generated - [go v0.7.81] . ### Releases -- [Go v0.7.81] https://github.com/OpenRouterTeam/go-sdk/releases/tag/v0.7.81 - . \ No newline at end of file +- [Go v0.7.81] https://github.com/OpenRouterTeam/go-sdk/releases/tag/v0.7.81 - . + +## 2026-08-25 20:33:25 +### Changes +Based on: +- OpenAPI Doc +- Speakeasy CLI 1.787.0 (2.914.0) https://github.com/speakeasy-api/speakeasy +### Generated +- [go v0.7.82] . +### Releases +- [Go v0.7.82] https://github.com/OpenRouterTeam/go-sdk/releases/tag/v0.7.82 - . \ No newline at end of file diff --git a/doc.go b/doc.go index 26e2cbea..5b8267c3 100644 --- a/doc.go +++ b/doc.go @@ -6,7 +6,7 @@ provider selection, and unified billing. This SDK is in beta. Pin to a specific module version to avoid unexpected breaking changes: - go get github.com/OpenRouterTeam/go-sdk@v0.7.81 + go get github.com/OpenRouterTeam/go-sdk@v0.7.82 For full API documentation, visit: https://openrouter.ai/docs/client-sdks/go/overview diff --git a/docs/models/components/unit.mdx b/docs/models/components/unit.mdx index c0a67bf4..9a13c6a4 100644 --- a/docs/models/components/unit.mdx +++ b/docs/models/components/unit.mdx @@ -9,7 +9,7 @@ import ( "github.com/OpenRouterTeam/go-sdk/models/components" ) -value := components.UnitImage +value := components.UnitRequest // Open enum: custom values can be created with a direct type cast custom := components.Unit("custom_value") @@ -20,6 +20,7 @@ custom := components.Unit("custom_value") | Name | Value | | --------------- | --------------- | +| `UnitRequest` | request | | `UnitImage` | image | | `UnitMegapixel` | megapixel | | `UnitToken` | token | \ No newline at end of file diff --git a/example_test.go b/example_test.go index 2ca1d53d..7888f0b7 100644 --- a/example_test.go +++ b/example_test.go @@ -18,7 +18,7 @@ func ExampleNew() { openrouter.WithSecurity("your-api-key"), ) fmt.Println(sdk.SDKVersion) - // Output: 0.7.81 + // Output: 0.7.82 } // Example demonstrates basic usage of the OpenRouter SDK for chat completions. diff --git a/examples/README.md b/examples/README.md index 45465931..872dde3b 100644 --- a/examples/README.md +++ b/examples/README.md @@ -43,7 +43,7 @@ cd ../generation && go run . Each example pins a released SDK version in `go.mod`: ```go -require github.com/OpenRouterTeam/go-sdk v0.7.81 +require github.com/OpenRouterTeam/go-sdk v0.7.82 ``` This should match the version in [README.md](../README.md) and `.speakeasy/gen.lock` `releaseVersion`. CI runs `scripts/bump-examples.sh` after releases to keep these in sync. @@ -51,7 +51,7 @@ This should match the version in [README.md](../README.md) and `.speakeasy/gen.l To use a different version: ```bash -go get github.com/OpenRouterTeam/go-sdk@v0.7.81 +go get github.com/OpenRouterTeam/go-sdk@v0.7.82 go run . ``` diff --git a/models/components/imagepricingentry.go b/models/components/imagepricingentry.go index 6910fb69..a3072a35 100644 --- a/models/components/imagepricingentry.go +++ b/models/components/imagepricingentry.go @@ -30,6 +30,7 @@ func (e *Billable) IsExact() bool { type Unit string const ( + UnitRequest Unit = "request" UnitImage Unit = "image" UnitMegapixel Unit = "megapixel" UnitToken Unit = "token" @@ -43,7 +44,7 @@ func (e Unit) ToPointer() *Unit { func (e *Unit) IsExact() bool { if e != nil { switch *e { - case "image", "megapixel", "token": + case "request", "image", "megapixel", "token": return true } } diff --git a/openrouter.go b/openrouter.go index 6d944ddd..893e42a1 100644 --- a/openrouter.go +++ b/openrouter.go @@ -205,9 +205,9 @@ func WithTimeout(timeout time.Duration) SDKOption { // New creates a new instance of the SDK with the provided options func New(opts ...SDKOption) *OpenRouter { sdk := &OpenRouter{ - SDKVersion: "0.7.81", + SDKVersion: "0.7.82", sdkConfiguration: config.SDKConfiguration{ - UserAgent: "speakeasy-sdk/go 0.7.81 2.914.0 1.0.0 github.com/OpenRouterTeam/go-sdk", + UserAgent: "speakeasy-sdk/go 0.7.82 2.914.0 1.0.0 github.com/OpenRouterTeam/go-sdk", Globals: globals.Globals{}, ServerList: ServerList, },