diff --git a/.speakeasy/gen.lock b/.speakeasy/gen.lock index d2f1dafa..b8380ffb 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: 1fe21cc86571bd560daf515494eb797c + docChecksum: 4f6e06afe3ad4d84525d6e11f8ca32f6 docVersion: 1.0.0 speakeasyVersion: 1.803.2 generationVersion: 2.950.13 - releaseVersion: 0.9.99 - configChecksum: 02578f66d23e7ba51869a86f7c7b54df + releaseVersion: 0.9.100 + configChecksum: ed0a19f847aa37fd1f9d48cffe5d271a repoURL: https://github.com/OpenRouterTeam/go-sdk.git installationURL: https://github.com/OpenRouterTeam/go-sdk persistentEdits: - generation_id: 2029b28b-bac9-49a2-8f41-4b4119c10c60 - pristine_commit_hash: 75ac1be55ae5299bfcc921b46e90f570e964c0c0 - pristine_tree_hash: b3e2f08c444a87429baaf4600e019e7a7d11147e + generation_id: 0ee23dbd-2c74-4859-817d-afb9bba3c815 + pristine_commit_hash: 872f815723f0175715524010c5574871b2f560da + pristine_tree_hash: cfc8102d10cf17280ea21ae7580a75e0d6a0916e features: go: acceptHeaders: 2.81.2 @@ -81,8 +81,8 @@ trackedFiles: pristine_git_object: d282f70247b71f78cb5de3fffaf5309cf53d20bb apikeys.go: id: 8baafe5dc76e - last_write_checksum: sha1:10e7d71832839752124dc42126c506e5a38f8033 - pristine_git_object: 50aaa23fd612e4f1a1ddf38e577f6c8697cf5588 + last_write_checksum: sha1:a31fb2d52f6ec2b598ec570255766331df353a93 + pristine_git_object: 7c9c7a8523828d46dc176c39c2b031697f9c785e batch.go: id: f0580a64f821 last_write_checksum: sha1:e8487c7c93d14c0c460489742ca284ef6679a509 @@ -8897,8 +8897,8 @@ trackedFiles: pristine_git_object: a788039af51cac4d38db0cf7831446a016ce5c28 docs/models/operations/createkeysrequest.mdx: id: 327228d6b870 - last_write_checksum: sha1:e5d1acb2d241e71ac6128b9255ad9a4f5806f8be - pristine_git_object: d521d44fcc9641b59590cddee227518c64848aaf + last_write_checksum: sha1:3ff4a58b3586b470016283718475832c2e91764d + pristine_git_object: 4843f3430368b90f0c2076f0a691e9c11757e726 docs/models/operations/createkeysresponse.mdx: id: 5135de195ccb last_write_checksum: sha1:4b725e468020ef775bbfa99b74d79773370a09cf @@ -9521,8 +9521,8 @@ trackedFiles: pristine_git_object: 570f74fc698260683ca6fb670630c524292b8996 docs/models/operations/listrequest.mdx: id: dd2bb74c6178 - last_write_checksum: sha1:39a7700cd3245a2fafe09f7084b818401c1cb0ea - pristine_git_object: 9c14a6caf0474871aa7e50b95c61d63bfac69bf8 + last_write_checksum: sha1:227b34639958596c09b38cd4831feb9ab0a9c45b + pristine_git_object: 0b3a06029d7554566f5c8adab82537a254b62639 docs/models/operations/listresponse.mdx: id: 46ed19423815 last_write_checksum: sha1:9a96890a584707ae557123057886a4ce48204734 @@ -9933,8 +9933,8 @@ trackedFiles: pristine_git_object: 232c850560bcebb29b48b0686180c9e6b29912c2 docs/sdks/apikeys/README.mdx: id: 27fcaae1c346 - last_write_checksum: sha1:d5bd4044861ec0db92af1dfc5a26ea7427178dfb - pristine_git_object: 08c487f2a319518b0e89141b4738b3d54af4c56c + last_write_checksum: sha1:607acc0551a81e9519d650d245526713025dfecc + pristine_git_object: 8679745c11eff2a81a64944be8734e1da3e82a90 docs/sdks/batch/README.mdx: id: e367aa4f4295 last_write_checksum: sha1:48c77179383611601f5546a2dc5f1e20c7d51952 @@ -13801,8 +13801,8 @@ trackedFiles: pristine_git_object: 67c548809d55734fe2679131a1ace1e8eb97c6ac models/operations/createkeys.go: id: c511faeda898 - last_write_checksum: sha1:1ff90ca95b903c5fc717b874e2232894994dbf6b - pristine_git_object: 4da316d9067bc785c627795b810651353cdd8d89 + last_write_checksum: sha1:d46c1fa99e25443ac543d5e62240c7d5ede823b7 + pristine_git_object: abbbe7fc5b7d3d95aee9f4cea48216bf324dfae1 models/operations/createpresetschatcompletions.go: id: 46c66731be0e last_write_checksum: sha1:fd2b99954de027a6886cbec87c82b789c4313fb4 @@ -14037,8 +14037,8 @@ trackedFiles: pristine_git_object: 266c243c38d8584bf72082acacd36d31f267eb94 models/operations/list.go: id: 5327f0e32b30 - last_write_checksum: sha1:67a60a2c02f9820b71ee1a98fafd326205105643 - pristine_git_object: b49f064f7a57680a4effc178cb96ebc9b44d5e66 + last_write_checksum: sha1:94d8f8cf1707402d0ee3e5da507b48e1d19f7070 + pristine_git_object: 83a7a31b54de2e0fa38085861e459a68bb1429eb models/operations/listbatches.go: id: eb63754972df last_write_checksum: sha1:aece649645b8a7693971860f89b6901d94702f3a @@ -14369,8 +14369,8 @@ trackedFiles: pristine_git_object: 742ef08e3a695f4aa613fc5f9e2d8ad55ae3d564 openrouter.go: id: 207ad004b774 - last_write_checksum: sha1:3ba3a8ff2b7259f8f81ac607cefb8917588df663 - pristine_git_object: 7d914d28eb351390cb39f8adc9d261975d7a5916 + last_write_checksum: sha1:17101ded535cb4360bd452a471f9bf7c485608b4 + pristine_git_object: 77f903633831854d0a5a3572f93144c9aabf2a0f optionalnullable/optionalnullable.go: id: ce60f259ead3 last_write_checksum: sha1:b828c94c45116e632925027e4e2c211e971e04e2 @@ -14746,6 +14746,8 @@ examples: application/json: {"error": {"code": 400, "message": "Invalid request parameters"}} "404": application/json: {"error": {"code": 404, "message": "Resource not found"}} + "403": + application/json: {"error": {"code": 403, "message": "Only management keys can perform this operation"}} createKeys: speakeasy-default-create-keys: requestBody: @@ -14821,6 +14823,8 @@ examples: application/json: {"error": {"code": 429, "message": "Rate limit exceeded"}} "500": application/json: {"error": {"code": 500, "message": "Internal Server Error"}} + "403": + application/json: {"error": {"code": 403, "message": "Only management keys can perform this operation"}} getKey: speakeasy-default-get-key: parameters: @@ -14837,6 +14841,8 @@ examples: application/json: {"error": {"code": 429, "message": "Rate limit exceeded"}} "500": application/json: {"error": {"code": 500, "message": "Internal Server Error"}} + "403": + application/json: {"error": {"code": 403, "message": "Only management keys can perform this operation"}} getCurrentKey: speakeasy-default-get-current-key: responses: @@ -19011,4 +19017,6 @@ examples: examplesVersion: 1.0.2 releaseNotes: | ## Go SDK Changes: - * `OpenRouter.Endpoints.ListZdrEndpoints()`: `response.Data[].SafetyRetention` **Added** + * `OpenRouter.ApiKeys.List()`: `error.status[403]` **Added** + * `OpenRouter.ApiKeys.Delete()`: `error.status[403]` **Added** + * `OpenRouter.ApiKeys.Get()`: `error.status[403]` **Added** diff --git a/.speakeasy/gen.yaml b/.speakeasy/gen.yaml index 5a845022..3b74c304 100644 --- a/.speakeasy/gen.yaml +++ b/.speakeasy/gen.yaml @@ -37,7 +37,7 @@ generation: documentation: mintlify preApplyUnionDiscriminators: true go: - version: 0.9.99 + version: 0.9.100 additionalDependencies: {} baseErrorName: OpenRouterError clientServerStatusCodesAsErrors: true diff --git a/.speakeasy/out.openapi.yaml b/.speakeasy/out.openapi.yaml index aed65703..2e03510d 100644 --- a/.speakeasy/out.openapi.yaml +++ b/.speakeasy/out.openapi.yaml @@ -44627,12 +44627,12 @@ paths: type: - 'integer' - 'null' - - description: 'Filter API keys by workspace ID. By default, keys in the default workspace are returned.' + - description: 'Filter API keys by workspace ID. By default an organization-scoped management key gets the default workspace; a workspace-scoped management key always gets its own workspace and cannot list another.' in: 'query' name: 'workspace_id' required: false schema: - description: 'Filter API keys by workspace ID. By default, keys in the default workspace are returned.' + description: 'Filter API keys by workspace ID. By default an organization-scoped management key gets the default workspace; a workspace-scoped management key always gets its own workspace and cannot list another.' example: '0df9e665-d932-5740-b2c7-b52af166bc11' format: 'uuid' type: 'string' @@ -44888,6 +44888,16 @@ paths: schema: $ref: '#/components/schemas/UnauthorizedResponse' description: 'Unauthorized - Authentication required or invalid credentials' + '403': + content: + application/json: + example: + error: + code: 403 + message: 'Only management keys can perform this operation' + schema: + $ref: '#/components/schemas/ForbiddenResponse' + description: 'Forbidden - Authentication successful but insufficient permissions' '404': content: application/json: @@ -45005,7 +45015,7 @@ paths: minLength: 1 type: 'string' workspace_id: - description: 'The workspace to create the API key in. Defaults to the default workspace if not provided.' + description: 'The workspace to create the API key in. Defaults to the default workspace for an organization-scoped management key, or to the management key''s own workspace for a workspace-scoped one, which cannot create keys elsewhere.' example: '0df9e665-d932-5740-b2c7-b52af166bc11' format: 'uuid' type: 'string' @@ -45347,6 +45357,16 @@ paths: schema: $ref: '#/components/schemas/UnauthorizedResponse' description: 'Unauthorized - Authentication required or invalid credentials' + '403': + content: + application/json: + example: + error: + code: 403 + message: 'Only management keys can perform this operation' + schema: + $ref: '#/components/schemas/ForbiddenResponse' + description: 'Forbidden - Authentication successful but insufficient permissions' '404': content: application/json: @@ -45633,6 +45653,16 @@ paths: schema: $ref: '#/components/schemas/UnauthorizedResponse' description: 'Unauthorized - Authentication required or invalid credentials' + '403': + content: + application/json: + example: + error: + code: 403 + message: 'Only management keys can perform this operation' + schema: + $ref: '#/components/schemas/ForbiddenResponse' + description: 'Forbidden - Authentication successful but insufficient permissions' '404': content: application/json: diff --git a/.speakeasy/workflow.lock b/.speakeasy/workflow.lock index 64404c8c..b70acc78 100644 --- a/.speakeasy/workflow.lock +++ b/.speakeasy/workflow.lock @@ -2,8 +2,8 @@ speakeasyVersion: 1.803.2 sources: OpenRouter API: sourceNamespace: open-router-chat-completions-api - sourceRevisionDigest: sha256:0cf2f13c3655a835a616a46d0bbb9e5aa3bbf82360d393cf4a078dfceb8bb143 - sourceBlobDigest: sha256:9bd86578f9d62d0d297bc94e56c201d080aed1e3d64e582d823fdd3de77ce91e + sourceRevisionDigest: sha256:0a736adcb21eb998bf8fd2d4c3fe9158a22a54441a26a73d9316f4e0d2ed0c41 + sourceBlobDigest: sha256:416c8ca16790479a78c6c9b64ba490410231a9570d99c7d450ee8c591304063c tags: - latest - 1.0.0 @@ -11,10 +11,10 @@ targets: openrouter: source: OpenRouter API sourceNamespace: open-router-chat-completions-api - sourceRevisionDigest: sha256:0cf2f13c3655a835a616a46d0bbb9e5aa3bbf82360d393cf4a078dfceb8bb143 - sourceBlobDigest: sha256:9bd86578f9d62d0d297bc94e56c201d080aed1e3d64e582d823fdd3de77ce91e + sourceRevisionDigest: sha256:0a736adcb21eb998bf8fd2d4c3fe9158a22a54441a26a73d9316f4e0d2ed0c41 + sourceBlobDigest: sha256:416c8ca16790479a78c6c9b64ba490410231a9570d99c7d450ee8c591304063c codeSamplesNamespace: open-router-chat-completions-api-go-code-samples - codeSamplesRevisionDigest: sha256:567e2e69820a98369864ad0e2fc63fde445155bc804307ec3a3506130183f68e + codeSamplesRevisionDigest: sha256:0e99cd0cb5e258e1af28da5125e8f6c20c6497ea0576ee5aa500c4161ed5181c workflow: workflowVersion: 1.0.0 speakeasyVersion: 1.803.2 diff --git a/OVERVIEW.md b/OVERVIEW.md index 83b15a0f..711cff08 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.9.99 +go get github.com/OpenRouterTeam/go-sdk@v0.9.100 ``` **Requirements:** Go 1.26.10 or higher diff --git a/README.md b/README.md index ef8a70b9..1a629198 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.9.99 +> go get github.com/OpenRouterTeam/go-sdk@v0.9.100 > ``` diff --git a/RELEASES.md b/RELEASES.md index 83ca5824..1ea93a65 100644 --- a/RELEASES.md +++ b/RELEASES.md @@ -3508,4 +3508,14 @@ Based on: ### Generated - [go v0.9.99] . ### Releases -- [Go v0.9.99] https://github.com/OpenRouterTeam/go-sdk/releases/tag/v0.9.99 - . \ No newline at end of file +- [Go v0.9.99] https://github.com/OpenRouterTeam/go-sdk/releases/tag/v0.9.99 - . + +## 2026-10-30 22:06:31 +### Changes +Based on: +- OpenAPI Doc +- Speakeasy CLI 1.803.2 (2.950.13) https://github.com/speakeasy-api/speakeasy +### Generated +- [go v0.9.100] . +### Releases +- [Go v0.9.100] https://github.com/OpenRouterTeam/go-sdk/releases/tag/v0.9.100 - . \ No newline at end of file diff --git a/apikeys.go b/apikeys.go index 50aaa23f..7c9c7a85 100644 --- a/apikeys.go +++ b/apikeys.go @@ -505,6 +505,27 @@ func (s *APIKeys) List(ctx context.Context, includeDisabled *bool, includeExpire return nil, sdkerrors.NewResponseValidationError("response did not match the declared error schema", httpRes.StatusCode, string(rawBody), httpRes, err) } + return nil, &out + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewAPIError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) + } + case httpRes.StatusCode == 403: + switch { + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + + var out sdkerrors.ForbiddenResponseError + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, sdkerrors.NewResponseValidationError("response did not match the declared error schema", httpRes.StatusCode, string(rawBody), httpRes, err) + } + return nil, &out default: rawBody, err := utils.ConsumeRawBody(httpRes) @@ -1115,6 +1136,27 @@ func (s *APIKeys) Delete(ctx context.Context, hash string, opts ...operations.Op return nil, sdkerrors.NewResponseValidationError("response did not match the declared error schema", httpRes.StatusCode, string(rawBody), httpRes, err) } + return nil, &out + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewAPIError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) + } + case httpRes.StatusCode == 403: + switch { + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + + var out sdkerrors.ForbiddenResponseError + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, sdkerrors.NewResponseValidationError("response did not match the declared error schema", httpRes.StatusCode, string(rawBody), httpRes, err) + } + return nil, &out default: rawBody, err := utils.ConsumeRawBody(httpRes) @@ -1408,6 +1450,27 @@ func (s *APIKeys) Get(ctx context.Context, hash string, opts ...operations.Optio return nil, sdkerrors.NewResponseValidationError("response did not match the declared error schema", httpRes.StatusCode, string(rawBody), httpRes, err) } + return nil, &out + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewAPIError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) + } + case httpRes.StatusCode == 403: + switch { + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + + var out sdkerrors.ForbiddenResponseError + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, sdkerrors.NewResponseValidationError("response did not match the declared error schema", httpRes.StatusCode, string(rawBody), httpRes, err) + } + return nil, &out default: rawBody, err := utils.ConsumeRawBody(httpRes) diff --git a/doc.go b/doc.go index 7d33243f..7f75079a 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.9.99 + go get github.com/OpenRouterTeam/go-sdk@v0.9.100 For full API documentation, visit: https://openrouter.ai/docs/client-sdks/go/overview diff --git a/docs/models/operations/createkeysrequest.mdx b/docs/models/operations/createkeysrequest.mdx index d521d44f..4843f343 100644 --- a/docs/models/operations/createkeysrequest.mdx +++ b/docs/models/operations/createkeysrequest.mdx @@ -4,13 +4,13 @@ title: "CreateKeysRequest" ## Fields -| Field | Type | Required | Description | Example | -| --------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `CreatorUserID` | optionalnullable.OptionalNullable[`string`] | ➖ | Optional user ID of the key creator. Only meaningful for organization-owned keys where a specific member is creating the key. | user_2dHFtVWx2n56w6HkM0000000000 | -| `ExpiresAt` | optionalnullable.OptionalNullable[[time.Time](https://pkg.go.dev/time#Time)] | ➖ | Optional ISO 8601 UTC expiration timestamp. Must include seconds (YYYY-MM-DDTHH:MM:SSZ; fractional seconds allowed); minute-precision timestamps are rejected. | 2027-12-31T23:59:59Z | -| `External` | [*operations.External](../../models/operations/external.mdx) | ➖ | Optional partner-defined identity associated with the created API key. | | -| `IncludeBYOKInLimit` | `*bool` | ➖ | Whether to include BYOK usage in the limit | true | -| `Limit` | optionalnullable.OptionalNullable[`float64`] | ➖ | Optional spending limit for the API key in USD | 50 | -| `LimitReset` | optionalnullable.OptionalNullable[[operations.CreateKeysLimitReset](../../models/operations/createkeyslimitreset.mdx)] | ➖ | Type of limit reset for the API key (daily, weekly, monthly, or null for no reset). Resets happen automatically at midnight UTC, and weeks are Monday through Sunday. | monthly | -| `Name` | `string` | ✔️ | Name for the new API key | My New API Key | -| `WorkspaceID` | `*string` | ➖ | The workspace to create the API key in. Defaults to the default workspace if not provided. | 0df9e665-d932-5740-b2c7-b52af166bc11 | \ No newline at end of file +| Field | Type | Required | Description | Example | +| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `CreatorUserID` | optionalnullable.OptionalNullable[`string`] | ➖ | Optional user ID of the key creator. Only meaningful for organization-owned keys where a specific member is creating the key. | user_2dHFtVWx2n56w6HkM0000000000 | +| `ExpiresAt` | optionalnullable.OptionalNullable[[time.Time](https://pkg.go.dev/time#Time)] | ➖ | Optional ISO 8601 UTC expiration timestamp. Must include seconds (YYYY-MM-DDTHH:MM:SSZ; fractional seconds allowed); minute-precision timestamps are rejected. | 2027-12-31T23:59:59Z | +| `External` | [*operations.External](../../models/operations/external.mdx) | ➖ | Optional partner-defined identity associated with the created API key. | | +| `IncludeBYOKInLimit` | `*bool` | ➖ | Whether to include BYOK usage in the limit | true | +| `Limit` | optionalnullable.OptionalNullable[`float64`] | ➖ | Optional spending limit for the API key in USD | 50 | +| `LimitReset` | optionalnullable.OptionalNullable[[operations.CreateKeysLimitReset](../../models/operations/createkeyslimitreset.mdx)] | ➖ | Type of limit reset for the API key (daily, weekly, monthly, or null for no reset). Resets happen automatically at midnight UTC, and weeks are Monday through Sunday. | monthly | +| `Name` | `string` | ✔️ | Name for the new API key | My New API Key | +| `WorkspaceID` | `*string` | ➖ | The workspace to create the API key in. Defaults to the default workspace for an organization-scoped management key, or to the management key's own workspace for a workspace-scoped one, which cannot create keys elsewhere. | 0df9e665-d932-5740-b2c7-b52af166bc11 | \ No newline at end of file diff --git a/docs/models/operations/listrequest.mdx b/docs/models/operations/listrequest.mdx index 9c14a6ca..0b3a0602 100644 --- a/docs/models/operations/listrequest.mdx +++ b/docs/models/operations/listrequest.mdx @@ -4,9 +4,9 @@ title: "ListRequest" ## Fields -| Field | Type | Required | Description | Example | -| ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | -| `IncludeDisabled` | `*bool` | ➖ | Whether to include disabled API keys in the response | false | -| `IncludeExpired` | `*bool` | ➖ | Whether to include expired API keys in the response. Expired keys are excluded by default and returned only when this is true. | false | -| `Offset` | optionalnullable.OptionalNullable[`int64`] | ➖ | Number of API keys to skip for pagination | 0 | -| `WorkspaceID` | `*string` | ➖ | Filter API keys by workspace ID. By default, keys in the default workspace are returned. | 0df9e665-d932-5740-b2c7-b52af166bc11 | \ No newline at end of file +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `IncludeDisabled` | `*bool` | ➖ | Whether to include disabled API keys in the response | false | +| `IncludeExpired` | `*bool` | ➖ | Whether to include expired API keys in the response. Expired keys are excluded by default and returned only when this is true. | false | +| `Offset` | optionalnullable.OptionalNullable[`int64`] | ➖ | Number of API keys to skip for pagination | 0 | +| `WorkspaceID` | `*string` | ➖ | Filter API keys by workspace ID. By default an organization-scoped management key gets the default workspace; a workspace-scoped management key always gets its own workspace and cannot list another. | 0df9e665-d932-5740-b2c7-b52af166bc11 | \ No newline at end of file diff --git a/docs/sdks/apikeys/README.mdx b/docs/sdks/apikeys/README.mdx index 08c487f2..8679745c 100644 --- a/docs/sdks/apikeys/README.mdx +++ b/docs/sdks/apikeys/README.mdx @@ -104,14 +104,14 @@ func main() { ### Parameters -| Parameter | Type | Required | Description | Example | -| ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | -| `ctx` | [context.Context](https://pkg.go.dev/context#Context) | ✔️ | The context to use for the request. | | -| `includeDisabled` | `*bool` | ➖ | Whether to include disabled API keys in the response | false | -| `includeExpired` | `*bool` | ➖ | Whether to include expired API keys in the response. Expired keys are excluded by default and returned only when this is true. | false | -| `offset` | optionalnullable.OptionalNullable[`int64`] | ➖ | Number of API keys to skip for pagination | 0 | -| `workspaceID` | `*string` | ➖ | Filter API keys by workspace ID. By default, keys in the default workspace are returned. | 0df9e665-d932-5740-b2c7-b52af166bc11 | -| `opts` | [][operations.Option](../../models/operations/option.mdx) | ➖ | The options for this request. | | +| Parameter | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `ctx` | [context.Context](https://pkg.go.dev/context#Context) | ✔️ | The context to use for the request. | | +| `includeDisabled` | `*bool` | ➖ | Whether to include disabled API keys in the response | false | +| `includeExpired` | `*bool` | ➖ | Whether to include expired API keys in the response. Expired keys are excluded by default and returned only when this is true. | false | +| `offset` | optionalnullable.OptionalNullable[`int64`] | ➖ | Number of API keys to skip for pagination | 0 | +| `workspaceID` | `*string` | ➖ | Filter API keys by workspace ID. By default an organization-scoped management key gets the default workspace; a workspace-scoped management key always gets its own workspace and cannot list another. | 0df9e665-d932-5740-b2c7-b52af166bc11 | +| `opts` | [][operations.Option](../../models/operations/option.mdx) | ➖ | The options for this request. | | ### Response @@ -123,6 +123,7 @@ func main() { | -------------------------------------- | -------------------------------------- | -------------------------------------- | | sdkerrors.BadRequestResponseError | 400 | application/json | | sdkerrors.UnauthorizedResponseError | 401 | application/json | +| sdkerrors.ForbiddenResponseError | 403 | application/json | | sdkerrors.NotFoundResponseError | 404 | application/json | | sdkerrors.TooManyRequestsResponseError | 429 | application/json | | sdkerrors.InternalServerResponseError | 500 | application/json | @@ -243,6 +244,7 @@ func main() { | Error Type | Status Code | Content Type | | -------------------------------------- | -------------------------------------- | -------------------------------------- | | sdkerrors.UnauthorizedResponseError | 401 | application/json | +| sdkerrors.ForbiddenResponseError | 403 | application/json | | sdkerrors.NotFoundResponseError | 404 | application/json | | sdkerrors.TooManyRequestsResponseError | 429 | application/json | | sdkerrors.InternalServerResponseError | 500 | application/json | @@ -298,6 +300,7 @@ func main() { | Error Type | Status Code | Content Type | | -------------------------------------- | -------------------------------------- | -------------------------------------- | | sdkerrors.UnauthorizedResponseError | 401 | application/json | +| sdkerrors.ForbiddenResponseError | 403 | application/json | | sdkerrors.NotFoundResponseError | 404 | application/json | | sdkerrors.TooManyRequestsResponseError | 429 | application/json | | sdkerrors.InternalServerResponseError | 500 | application/json | diff --git a/example_test.go b/example_test.go index c21680d2..b6a20319 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.9.99 + // Output: 0.9.100 } // Example demonstrates basic usage of the OpenRouter SDK for chat completions. diff --git a/examples/README.md b/examples/README.md index a2ccbe09..de417421 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.9.99 +require github.com/OpenRouterTeam/go-sdk v0.9.100 ``` 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.9.99 +go get github.com/OpenRouterTeam/go-sdk@v0.9.100 go run . ``` diff --git a/models/operations/createkeys.go b/models/operations/createkeys.go index 4da316d9..abbbe7fc 100644 --- a/models/operations/createkeys.go +++ b/models/operations/createkeys.go @@ -69,7 +69,7 @@ type CreateKeysRequest struct { LimitReset optionalnullable.OptionalNullable[CreateKeysLimitReset] `json:"limit_reset,omitzero"` // Name for the new API key Name string `json:"name"` - // The workspace to create the API key in. Defaults to the default workspace if not provided. + // The workspace to create the API key in. Defaults to the default workspace for an organization-scoped management key, or to the management key's own workspace for a workspace-scoped one, which cannot create keys elsewhere. WorkspaceID *string `json:"workspace_id,omitzero"` } diff --git a/models/operations/list.go b/models/operations/list.go index b49f064f..83a7a31b 100644 --- a/models/operations/list.go +++ b/models/operations/list.go @@ -15,7 +15,7 @@ type ListRequest struct { IncludeExpired *bool `queryParam:"style=form,explode=true,name=include_expired"` // Number of API keys to skip for pagination Offset optionalnullable.OptionalNullable[int64] `queryParam:"style=form,explode=true,name=offset"` - // Filter API keys by workspace ID. By default, keys in the default workspace are returned. + // Filter API keys by workspace ID. By default an organization-scoped management key gets the default workspace; a workspace-scoped management key always gets its own workspace and cannot list another. WorkspaceID *string `queryParam:"style=form,explode=true,name=workspace_id"` } diff --git a/openrouter.go b/openrouter.go index 7d914d28..77f90363 100644 --- a/openrouter.go +++ b/openrouter.go @@ -219,10 +219,10 @@ 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.9.99", + SDKVersion: "0.9.100", sdkConfiguration: config.SDKConfiguration{ - UserAgent: "speakeasy-sdk/go 0.9.99 2.950.13 1.0.0 github.com/OpenRouterTeam/go-sdk", - SDKVersion: "0.9.99", + UserAgent: "speakeasy-sdk/go 0.9.100 2.950.13 1.0.0 github.com/OpenRouterTeam/go-sdk", + SDKVersion: "0.9.100", GenVersion: "2.950.13", OpenAPIDocVersion: "1.0.0", Globals: globals.Globals{},