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
27 changes: 15 additions & 12 deletions .speakeasy/gen.lock
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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**
2 changes: 1 addition & 1 deletion .speakeasy/gen.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ generation:
documentation: mintlify
preApplyUnionDiscriminators: true
go:
version: 0.7.81
version: 0.7.82
additionalDependencies: {}
baseErrorName: OpenRouterError
clientServerStatusCodesAsErrors: true
Expand Down
1 change: 1 addition & 0 deletions .speakeasy/out.openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11204,6 +11204,7 @@ components:
type: 'number'
unit:
enum:
- 'request'
- 'image'
- 'megapixel'
- 'token'
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.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
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
Expand Down
2 changes: 1 addition & 1 deletion OVERVIEW.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
> ```

<!-- No Summary [summary] -->
Expand Down
12 changes: 11 additions & 1 deletion RELEASES.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 - .
- [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 - .
2 changes: 1 addition & 1 deletion doc.go
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
3 changes: 2 additions & 1 deletion docs/models/components/unit.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand All @@ -20,6 +20,7 @@ custom := components.Unit("custom_value")

| Name | Value |
| --------------- | --------------- |
| `UnitRequest` | request |
| `UnitImage` | image |
| `UnitMegapixel` | megapixel |
| `UnitToken` | token |
2 changes: 1 addition & 1 deletion example_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
4 changes: 2 additions & 2 deletions examples/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,15 +43,15 @@ 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.

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 .
```

Expand Down
3 changes: 2 additions & 1 deletion models/components/imagepricingentry.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -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
}
}
Expand Down
4 changes: 2 additions & 2 deletions openrouter.go
Original file line number Diff line number Diff line change
Expand Up @@ -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,
},
Expand Down
Loading