diff --git a/.speakeasy/gen.lock b/.speakeasy/gen.lock index 2ca6ff06..1bf017d3 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: d2668cb3dac1aaf82bb1a98d2c5e4f3d + docChecksum: 8f251860df01987599441eb8f5a93429 docVersion: 1.0.0 speakeasyVersion: 1.787.0 generationVersion: 2.914.0 - releaseVersion: 0.8.24 - configChecksum: 19f13b073d978f2a4c8e93a7bb804fda + releaseVersion: 0.8.25 + configChecksum: 42996ce4e6a833d9a4308e40e411f92c repoURL: https://github.com/OpenRouterTeam/go-sdk.git installationURL: https://github.com/OpenRouterTeam/go-sdk persistentEdits: - generation_id: 9df104c7-052b-4a03-8679-adc1bef55cf1 - pristine_commit_hash: 8c18ac8ed4531484af6899fc9c2c918ef6f07c87 - pristine_tree_hash: 9c1a92425ee3865741363776ad827294859589a7 + generation_id: 1361eaf8-4980-4e80-b977-282c37ddb99d + pristine_commit_hash: 2040445c417d8d93f98e3c42292b3fafe6d76202 + pristine_tree_hash: 9b67daa6f9e6eb434a10ae5fc69517cf1a33de89 features: go: acceptHeaders: 2.81.2 @@ -7192,8 +7192,8 @@ trackedFiles: pristine_git_object: 1724a2112a4a244bcdfc24c5c5d264cf2f8e7480 docs/models/operations/listscimgroupsrequest.mdx: id: e55a38cd82ce - last_write_checksum: sha1:b2a6955e16b442eb7cd753ecff88a711ade7b3f2 - pristine_git_object: 5fc427e9903cf95203af0b4f00f29deebd0664c0 + last_write_checksum: sha1:6984848b79d78837f99d750ef3db8d966b197097 + pristine_git_object: e5c722c5e23953eb904d1fa5ec44da3a9c3c41ca docs/models/operations/listscimgroupsresponse.mdx: id: 061ed874493a last_write_checksum: sha1:53d49ae6d78d0b1e7b324b8c6c0d50182854f239 @@ -7656,8 +7656,8 @@ trackedFiles: pristine_git_object: ab1b772c84923c7f22077bc350b5d97519758275 docs/sdks/scim/README.mdx: id: fd6d8a91a053 - last_write_checksum: sha1:dc3f58b10cb0678f0c35ec8dc4b7447a20033329 - pristine_git_object: 0ed9b9d28685a428fd41ef08953116b55a3b8aa5 + last_write_checksum: sha1:1c9120d60770da6bed7c36d7ebb76c7944da7e79 + pristine_git_object: 4ea2865ff500bf1f3332c835270ea49b665bf2d9 docs/sdks/stt/README.mdx: id: 190b0dc9a5d1 last_write_checksum: sha1:2a18efba4544b5922cd10677fecddb9bef20bdce @@ -10916,8 +10916,8 @@ trackedFiles: pristine_git_object: 78c8458de9250b49bec954d268be1bbd9199da17 models/operations/listscimgroups.go: id: 75cbce5df5cc - last_write_checksum: sha1:f13b3925c97d9f089a31f8f19800bef65ef89058 - pristine_git_object: 237eaf4ed9a696b0c2fa717fec644fe54eac8ddf + last_write_checksum: sha1:1ac32f0f37ae0e89ace90d8acce60c2cb6ffe35c + pristine_git_object: d23168fbe3d842e9c7b44d1bff5d2d7d404d026b models/operations/listvaultsecrets.go: id: 0b6e1fecab0f last_write_checksum: sha1:98527a92bbe02efee5cce8fa9279a7db7a93032c @@ -11100,8 +11100,8 @@ trackedFiles: pristine_git_object: 5e3a2cdf8cb4ed4f5378b712293cba9c82074f16 openrouter.go: id: 207ad004b774 - last_write_checksum: sha1:96c03851153ff16070f0d9d8f852b3ba39f35500 - pristine_git_object: 7071aaac18255ce2f93a48ab522573f0ee556a29 + last_write_checksum: sha1:0c6d8713ebefa1bdbb90a3aec0e519bf68dcdfc8 + pristine_git_object: ee53bafedf55662f198d4f7ce328d6f4a3d7b33f optionalnullable/optionalnullable.go: id: ce60f259ead3 last_write_checksum: sha1:d6aff1a420c31e025ea21d46cf056e305ae76fe8 @@ -11136,8 +11136,8 @@ trackedFiles: pristine_git_object: 767002c7898128324d8741ce9c534bd466492169 scim.go: id: 7cae7699a750 - last_write_checksum: sha1:055c85d95551e34f738e8cfe0b6bf0387eae0331 - pristine_git_object: be33cb414fac26eb75fcf10243b1545979d9c092 + last_write_checksum: sha1:48f78ca0c0ba3acd07dcc4fb3309929788ea5c03 + pristine_git_object: ae895792dffbffb4196e495fa980116d14a6ecb0 stt.go: id: 04852909348f last_write_checksum: sha1:01640807e7ad834ffd5dd515c2e2e2324399f5bb @@ -14431,4 +14431,4 @@ examples: examplesVersion: 1.0.2 releaseNotes: | ## Go SDK Changes: - * `OpenRouter.Interns.GetInternDaemonAccess()`: **Added** + * `OpenRouter.Scim.ListGroups()`: `request` **Changed** diff --git a/.speakeasy/gen.yaml b/.speakeasy/gen.yaml index e5a758c1..cf393182 100644 --- a/.speakeasy/gen.yaml +++ b/.speakeasy/gen.yaml @@ -36,7 +36,7 @@ generation: documentation: mintlify preApplyUnionDiscriminators: true go: - version: 0.8.24 + version: 0.8.25 additionalDependencies: {} baseErrorName: OpenRouterError clientServerStatusCodesAsErrors: true diff --git a/.speakeasy/out.openapi.yaml b/.speakeasy/out.openapi.yaml index 6453d6a1..2df19c64 100644 --- a/.speakeasy/out.openapi.yaml +++ b/.speakeasy/out.openapi.yaml @@ -43868,6 +43868,22 @@ paths: maximum: 100 minimum: 1 type: 'integer' + - description: 'Exact match filter on display_name. Omitted or empty returns groups unfiltered by name (subject to offset/limit). When external_id is also present, both must match.' + in: 'query' + name: 'display_name' + required: false + schema: + description: 'Exact match filter on display_name. Omitted or empty returns groups unfiltered by name (subject to offset/limit). When external_id is also present, both must match.' + example: 'Engineering' + type: 'string' + - description: 'Exact match filter on external_id, e.g. the identity provider (such as Entra ID) group object ID. Omitted or empty returns groups unfiltered by external_id (subject to offset/limit). When display_name is also present, both must match.' + in: 'query' + name: 'external_id' + required: false + schema: + description: 'Exact match filter on external_id, e.g. the identity provider (such as Entra ID) group object ID. Omitted or empty returns groups unfiltered by external_id (subject to offset/limit). When display_name is also present, both must match.' + example: 'a1b2c3d4-e5f6-7890-abcd-ef1234567890' + type: 'string' responses: '200': content: diff --git a/.speakeasy/workflow.lock b/.speakeasy/workflow.lock index 894f82e6..2b3094fd 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:b339678d7ad915a42c7c77bcfcd09f3234635189c47712183f93874c8ad765f4 - sourceBlobDigest: sha256:47a9cdd203f016b162de465ee46307f296ce89ad8641e0ce51ba414b22fe7daf + sourceRevisionDigest: sha256:d30bdae32404cf22bc8b66c471a7501242ea3d82f1d07144896a7ffadcd36a0e + sourceBlobDigest: sha256:fed4aea0b2a4fd5d0e383a627d8c6f34ee97763d3eee8b8ca236b0e07facfecc tags: - latest - 1.0.0 @@ -11,10 +11,10 @@ targets: openrouter: source: OpenRouter API sourceNamespace: open-router-chat-completions-api - sourceRevisionDigest: sha256:b339678d7ad915a42c7c77bcfcd09f3234635189c47712183f93874c8ad765f4 - sourceBlobDigest: sha256:47a9cdd203f016b162de465ee46307f296ce89ad8641e0ce51ba414b22fe7daf + sourceRevisionDigest: sha256:d30bdae32404cf22bc8b66c471a7501242ea3d82f1d07144896a7ffadcd36a0e + sourceBlobDigest: sha256:fed4aea0b2a4fd5d0e383a627d8c6f34ee97763d3eee8b8ca236b0e07facfecc codeSamplesNamespace: open-router-chat-completions-api-go-code-samples - codeSamplesRevisionDigest: sha256:8f8cb079290c3ce288548556279d5edaf3f0b14e3e9c004bde4e6523a5017b25 + codeSamplesRevisionDigest: sha256:ab7dff7c2c3e6bf6b25457199f5b351750db42e889d3f788ee8e79af7271519f workflow: workflowVersion: 1.0.0 speakeasyVersion: 1.787.0 diff --git a/OVERVIEW.md b/OVERVIEW.md index 4213c867..7be523e1 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.8.24 +go get github.com/OpenRouterTeam/go-sdk@v0.8.25 ``` **Requirements:** Go 1.25 or higher diff --git a/README.md b/README.md index 660a8a16..8de2bb08 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.8.24 +> go get github.com/OpenRouterTeam/go-sdk@v0.8.25 > ``` diff --git a/RELEASES.md b/RELEASES.md index 92f6649c..7978241d 100644 --- a/RELEASES.md +++ b/RELEASES.md @@ -2398,4 +2398,14 @@ Based on: ### Generated - [go v0.8.24] . ### Releases -- [Go v0.8.24] https://github.com/OpenRouterTeam/go-sdk/releases/tag/v0.8.24 - . \ No newline at end of file +- [Go v0.8.24] https://github.com/OpenRouterTeam/go-sdk/releases/tag/v0.8.24 - . + +## 2026-09-24 19:58:37 +### Changes +Based on: +- OpenAPI Doc +- Speakeasy CLI 1.787.0 (2.914.0) https://github.com/speakeasy-api/speakeasy +### Generated +- [go v0.8.25] . +### Releases +- [Go v0.8.25] https://github.com/OpenRouterTeam/go-sdk/releases/tag/v0.8.25 - . \ No newline at end of file diff --git a/doc.go b/doc.go index 684b2ab6..eb0eed13 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.8.24 + go get github.com/OpenRouterTeam/go-sdk@v0.8.25 For full API documentation, visit: https://openrouter.ai/docs/client-sdks/go/overview diff --git a/docs/models/operations/listscimgroupsrequest.mdx b/docs/models/operations/listscimgroupsrequest.mdx index 5fc427e9..e5c722c5 100644 --- a/docs/models/operations/listscimgroupsrequest.mdx +++ b/docs/models/operations/listscimgroupsrequest.mdx @@ -4,7 +4,9 @@ title: "ListScimGroupsRequest" ## Fields -| Field | Type | Required | Description | Example | -| --------------------------------------------- | --------------------------------------------- | --------------------------------------------- | --------------------------------------------- | --------------------------------------------- | -| `Offset` | optionalnullable.OptionalNullable[`int64`] | :heavy_minus_sign: | Number of records to skip for pagination | 0 | -| `Limit` | `*int64` | :heavy_minus_sign: | Maximum number of records to return (max 100) | 50 | \ No newline at end of file +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `Offset` | optionalnullable.OptionalNullable[`int64`] | :heavy_minus_sign: | Number of records to skip for pagination | 0 | +| `Limit` | `*int64` | :heavy_minus_sign: | Maximum number of records to return (max 100) | 50 | +| `DisplayName` | `*string` | :heavy_minus_sign: | Exact match filter on display_name. Omitted or empty returns groups unfiltered by name (subject to offset/limit). When external_id is also present, both must match. | Engineering | +| `ExternalID` | `*string` | :heavy_minus_sign: | Exact match filter on external_id, e.g. the identity provider (such as Entra ID) group object ID. Omitted or empty returns groups unfiltered by external_id (subject to offset/limit). When display_name is also present, both must match. | a1b2c3d4-e5f6-7890-abcd-ef1234567890 | \ No newline at end of file diff --git a/docs/sdks/scim/README.mdx b/docs/sdks/scim/README.mdx index 0ed9b9d2..4ea2865f 100644 --- a/docs/sdks/scim/README.mdx +++ b/docs/sdks/scim/README.mdx @@ -343,7 +343,7 @@ func main() { openrouter.WithSecurity(os.Getenv("OPENROUTER_API_KEY")), ) - res, err := s.Scim.ListGroups(ctx, optionalnullable.From(openrouter.Pointer[int64](0)), openrouter.Pointer[int64](50)) + res, err := s.Scim.ListGroups(ctx, optionalnullable.From(openrouter.Pointer[int64](0)), openrouter.Pointer[int64](50), nil, nil) if err != nil { log.Fatal(err) } @@ -367,12 +367,14 @@ func main() { ### Parameters -| Parameter | Type | Required | Description | Example | -| -------------------------------------------------------- | -------------------------------------------------------- | -------------------------------------------------------- | -------------------------------------------------------- | -------------------------------------------------------- | -| `ctx` | [context.Context](https://pkg.go.dev/context#Context) | :heavy_check_mark: | The context to use for the request. | | -| `offset` | optionalnullable.OptionalNullable[`int64`] | :heavy_minus_sign: | Number of records to skip for pagination | 0 | -| `limit` | `*int64` | :heavy_minus_sign: | Maximum number of records to return (max 100) | 50 | -| `opts` | [][operations.Option](../../models/operations/option.mdx) | :heavy_minus_sign: | The options for this request. | | +| Parameter | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `ctx` | [context.Context](https://pkg.go.dev/context#Context) | :heavy_check_mark: | The context to use for the request. | | +| `offset` | optionalnullable.OptionalNullable[`int64`] | :heavy_minus_sign: | Number of records to skip for pagination | 0 | +| `limit` | `*int64` | :heavy_minus_sign: | Maximum number of records to return (max 100) | 50 | +| `displayName` | `*string` | :heavy_minus_sign: | Exact match filter on display_name. Omitted or empty returns groups unfiltered by name (subject to offset/limit). When external_id is also present, both must match. | Engineering | +| `externalID` | `*string` | :heavy_minus_sign: | Exact match filter on external_id, e.g. the identity provider (such as Entra ID) group object ID. Omitted or empty returns groups unfiltered by external_id (subject to offset/limit). When display_name is also present, both must match. | a1b2c3d4-e5f6-7890-abcd-ef1234567890 | +| `opts` | [][operations.Option](../../models/operations/option.mdx) | :heavy_minus_sign: | The options for this request. | | ### Response diff --git a/example_test.go b/example_test.go index 5947eb17..ba40d3c2 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.8.24 + // Output: 0.8.25 } // Example demonstrates basic usage of the OpenRouter SDK for chat completions. diff --git a/examples/README.md b/examples/README.md index a7bd6553..1d6e96e8 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.8.24 +require github.com/OpenRouterTeam/go-sdk v0.8.25 ``` 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.8.24 +go get github.com/OpenRouterTeam/go-sdk@v0.8.25 go run . ``` diff --git a/models/operations/listscimgroups.go b/models/operations/listscimgroups.go index 237eaf4e..d23168fb 100644 --- a/models/operations/listscimgroups.go +++ b/models/operations/listscimgroups.go @@ -13,6 +13,10 @@ type ListScimGroupsRequest struct { Offset optionalnullable.OptionalNullable[int64] `default:"0" queryParam:"style=form,explode=true,name=offset"` // Maximum number of records to return (max 100) Limit *int64 `default:"50" queryParam:"style=form,explode=true,name=limit"` + // Exact match filter on display_name. Omitted or empty returns groups unfiltered by name (subject to offset/limit). When external_id is also present, both must match. + DisplayName *string `queryParam:"style=form,explode=true,name=display_name"` + // Exact match filter on external_id, e.g. the identity provider (such as Entra ID) group object ID. Omitted or empty returns groups unfiltered by external_id (subject to offset/limit). When display_name is also present, both must match. + ExternalID *string `queryParam:"style=form,explode=true,name=external_id"` } func (l ListScimGroupsRequest) MarshalJSON() ([]byte, error) { @@ -40,6 +44,20 @@ func (l *ListScimGroupsRequest) GetLimit() *int64 { return l.Limit } +func (l *ListScimGroupsRequest) GetDisplayName() *string { + if l == nil { + return nil + } + return l.DisplayName +} + +func (l *ListScimGroupsRequest) GetExternalID() *string { + if l == nil { + return nil + } + return l.ExternalID +} + type ListScimGroupsResponse struct { Result components.ListScimGroupsResponse diff --git a/openrouter.go b/openrouter.go index 7071aaac..ee53bafe 100644 --- a/openrouter.go +++ b/openrouter.go @@ -71,6 +71,20 @@ type OpenRouter struct { Benchmarks *Benchmarks // BYOK endpoints BYOK *BYOK + // Stream a chat completion with an intern + // Sends a prompt to one of your interns and streams the reply as OpenAI-compatible server-sent events ending with `[DONE]`. The run executes on the intern, which may pause to ask you something. It then streams one `openrouter.provide_input` tool call and finishes with `finish_reason: "tool_calls"`, and the run stays open on the intern. + // + // Every response, whether it ends with `stop`, `tool_calls` or `error`, is followed by a final chunk with empty `choices` that carries `session_id`, then `data: [DONE]`. That chunk carries the `usage` the intern reported for the run, after `stop` or `error`, and `null` when the intern reported none. After `tool_calls` its `usage` is `null` because the turn is not over. Read through `[DONE]`: the `session_id` you need to reply arrives after the `tool_calls` finish chunk. + // + // To answer, send a second request with the same `session_id`, the assistant message echoing that tool call, and a `tool` message whose `tool_call_id` is the tool call id and whose `content` is the answer. The answer is delivered to the run that asked and the stream continues from where it paused. A question stays open for its interaction deadline (5 minutes by default) and the run is cancelled when that passes. Rejected replies do not extend the deadline. + // + // Closing the connection after the `[DONE]` that follows `finish_reason: "tool_calls"` keeps the run alive. Disconnecting while a response is still streaming cancels the run. The stream writes a `: keepalive` comment whenever nothing else has been written for 30 seconds, so a disconnect is noticed within that interval even while the intern is silent. + // + // A run the intern ends while you are still connected, by cancellation or by a deadline, ends the stream with a `finish_reason: "error"` chunk carrying `410` and reason `run_ended`, then the final empty-`choices` chunk and `[DONE]`. That error reports only an ending the intern confirmed. A connection that breaks without that confirmation ends with reason `stream_severed`, and a client that has already disconnected is promised no final event. + // + // Set `approval_mode` to `manual` to have the intern ask before approval-bearing tools such as the shell. Omitted, the run self-drives and consents on your behalf. The mode belongs to the run started by that prompt and must be repeated on later prompts. + // + // Available to interns programme members. Callers outside the programme receive `404` for every path under `/api/v1/interns`. Chat *Chat // Task classification market-share endpoints Classifications *Classifications @@ -212,9 +226,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.8.24", + SDKVersion: "0.8.25", sdkConfiguration: config.SDKConfiguration{ - UserAgent: "speakeasy-sdk/go 0.8.24 2.914.0 1.0.0 github.com/OpenRouterTeam/go-sdk", + UserAgent: "speakeasy-sdk/go 0.8.25 2.914.0 1.0.0 github.com/OpenRouterTeam/go-sdk", Globals: globals.Globals{}, ServerList: ServerList, }, diff --git a/scim.go b/scim.go index be33cb41..ae895792 100644 --- a/scim.go +++ b/scim.go @@ -1549,10 +1549,12 @@ func (s *Scim) Update(ctx context.Context, id string, updateScimGroupMappingRequ // ListGroups - List SCIM groups // List SCIM groups for the organization. [Management key](/docs/guides/overview/auth/management-api-keys) required. -func (s *Scim) ListGroups(ctx context.Context, offset optionalnullable.OptionalNullable[int64], limit *int64, opts ...operations.Option) (*operations.ListScimGroupsResponse, error) { +func (s *Scim) ListGroups(ctx context.Context, offset optionalnullable.OptionalNullable[int64], limit *int64, displayName *string, externalID *string, opts ...operations.Option) (*operations.ListScimGroupsResponse, error) { request := operations.ListScimGroupsRequest{ - Offset: offset, - Limit: limit, + Offset: offset, + Limit: limit, + DisplayName: displayName, + ExternalID: externalID, } o := operations.Options{} @@ -1759,6 +1761,8 @@ func (s *Scim) ListGroups(ctx context.Context, offset optionalnullable.OptionalN ctx, optionalnullable.From(&nOS), limit, + displayName, + externalID, opts..., ) }