diff --git a/.speakeasy/gen.lock b/.speakeasy/gen.lock index 5a22d768..78574dd2 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: 068c54f4d63cb1efcc887a0dfb86fb85 + docChecksum: c1efa0a41a7796f3b1a7fa6115f95021 docVersion: 1.0.0 speakeasyVersion: 1.787.0 generationVersion: 2.914.0 - releaseVersion: 0.9.79 - configChecksum: b4c4648e1480dd948a0b92bb30e2dd10 + releaseVersion: 0.9.80 + configChecksum: 68d2dafbd74eb16ad33fa9c7b23b4469 repoURL: https://github.com/OpenRouterTeam/go-sdk.git installationURL: https://github.com/OpenRouterTeam/go-sdk persistentEdits: - generation_id: 988b5374-da25-4022-9165-e7627e96d51d - pristine_commit_hash: 731afeb8242d7b016a6dfbd2be4a03d6607dca0d - pristine_tree_hash: ead7ad2264c4a3a5eb0635e9f7041514bc28d1b0 + generation_id: 2e02b1f2-964a-4383-ad36-d3c20d2205df + pristine_commit_hash: b2f916e1b901bfccbe335b524ffcc17451c3a50b + pristine_tree_hash: 659c5436e61a1d458804de95ed66623d7eaf1529 features: go: acceptHeaders: 2.81.2 @@ -2713,8 +2713,8 @@ trackedFiles: pristine_git_object: 1dc095a80002310904b9b3ad17387a53ce87f154 docs/models/components/createprivateendpointrequest.mdx: id: 6276579d0789 - last_write_checksum: sha1:d05d248e84e5ef96406b8b77daebeb333f1aa96f - pristine_git_object: 7a1afd27ab01dc3d01d4e16b2079799e0b836241 + last_write_checksum: sha1:224a3f2edf912f871ec8f4c6f0a1106c96650f18 + pristine_git_object: ebf621a7b37a4b0c3e501f0574e20b1b3e8f6a69 docs/models/components/createprivateendpointrequestdeclaredregion.mdx: id: 3ac51e240905 last_write_checksum: sha1:b423197df0eaae5ee0cd28a301b0e1caccc35bd1 @@ -4277,8 +4277,8 @@ trackedFiles: pristine_git_object: cd0be419deaa4d13dc5402aa08ce40bf72c831d6 docs/models/components/managedprivateendpoint.mdx: id: 091be9d7d450 - last_write_checksum: sha1:58ba0c4f696cf0fe24e766c9c125693640d0a862 - pristine_git_object: e1e30d353de7475caf89c872391f8a887dac3cda + last_write_checksum: sha1:efcd7bfa5fded2c3b94c0796c241c7990ef265d5 + pristine_git_object: 903db46badb6db963d035fbd8beb331f892e43f7 docs/models/components/managedprivateendpointresponse.mdx: id: a7f52cf2930b last_write_checksum: sha1:e43d16cbf219731e8900fc0c61f5ae8d668f3940 @@ -6205,8 +6205,8 @@ trackedFiles: pristine_git_object: b32a2cf13a70604a5354347bfd1a284af37b6f00 docs/models/components/privateendpoint.mdx: id: 85b0f1c39439 - last_write_checksum: sha1:2a6a903337b2a0f1d519ba632ad40cc09daf72fe - pristine_git_object: 898b0654000349c06baf419e7b5e1c73e7bedd4f + last_write_checksum: sha1:c655202cf09630937c7b25581e2b1278309a75d1 + pristine_git_object: 30827533b38df0ee6657540013fe81a9d6ec1e2b docs/models/components/privateendpointactivation.mdx: id: 5490d014ffcc last_write_checksum: sha1:fe5c50aa1b970228ef87daf1cef949fb6ff8b6ab @@ -6219,18 +6219,26 @@ trackedFiles: id: 31d6e9b93d89 last_write_checksum: sha1:a39df321ba52e95e8db80353ff6cf33a1421a263 pristine_git_object: 48f8462b840cc4d180c986ebda0d3fc15030d96d + docs/models/components/privateendpointdeclaredparameter.mdx: + id: 062046b2a870 + last_write_checksum: sha1:213cf82d0297bd6fa157b85ae83e41541d849e4f + pristine_git_object: 159fa1089e7088bebd25da60ced6547ee4ba7685 docs/models/components/privateendpointdeclaredregion.mdx: id: 20d8e30e518c last_write_checksum: sha1:5a6db193b0059a1d203c4ceb9dc866eda0983a30 pristine_git_object: 2ac3f43436e6728e84fbc6390055b85427140ed1 + docs/models/components/privateendpointparametercheck.mdx: + id: 2c8a831e1ab2 + last_write_checksum: sha1:a844ce7a225738dc9f56b1ee86f2582fe9af0c1e + pristine_git_object: b43c617e810ba189085caf0f58bfc6511147cd22 docs/models/components/privateendpointpricing.mdx: id: c8239c97f2aa last_write_checksum: sha1:552d7317cb053b0f2c8f9eed88460ec2e7f1771c pristine_git_object: 5d70b647b0173776cc35bf7ce94692d997cf7d17 docs/models/components/privateendpointresponse.mdx: id: 1cab9b4e1385 - last_write_checksum: sha1:cb352f1c0399a491aed57ec21fa0f9cee1002d42 - pristine_git_object: e2c4af098bb73f847518814df5c8e82880f3ed6e + last_write_checksum: sha1:e6be16ac07872ffc014aadad1fafb206592fcdae + pristine_git_object: 87c62b1b3d3ad5a78268fa29e422f276d48d67ec docs/models/components/privateendpointstatus.mdx: id: 8aeff29388f0 last_write_checksum: sha1:a4d9c6ad54ce85c697de534ef16d555327fc14c0 @@ -6241,12 +6249,12 @@ trackedFiles: pristine_git_object: 9b2b9bc9a50b8a12b0f4dd0a45640adbd1631896 docs/models/components/privateendpointvalidation.mdx: id: aa7e03c6e40e - last_write_checksum: sha1:275d13dee67617f718627df732fc2c19765c305f - pristine_git_object: 275a5325dc797f64bfc218d9f60ee7f90a686e56 + last_write_checksum: sha1:c014e4b5b50216876e4658e1459918ffb2f55f3a + pristine_git_object: ef8ee3fd731af475400cf76f3b3b0a6c0ef8a6f5 docs/models/components/privateendpointvalidationnullable.mdx: id: 0b7697b59643 - last_write_checksum: sha1:954c2b833205f17b5b8e9d82d755dfb926cf05ce - pristine_git_object: 2874980d4b436d62022eea5da136de31fc795c9b + last_write_checksum: sha1:eba2ee787b0482e12ec05b224017eababa9b4bb7 + pristine_git_object: 50b4d31a38d9943a5acd42628147b2bffb6156d4 docs/models/components/privateendpointvalidationresponse.mdx: id: 17e1eb6b5019 last_write_checksum: sha1:54f63a1c5b4e4f9bd26b29cb522da85690902113 @@ -7767,6 +7775,10 @@ trackedFiles: id: d20b9b2dd02d last_write_checksum: sha1:393d64917b1db1c9f376c5fd81b34e70b8eebed9 pristine_git_object: 235c01e6f5965902014aa6601bf991dfa8b22bd0 + docs/models/components/updateprivateendpointparametersrequest.mdx: + id: 00ec1a3ad12a + last_write_checksum: sha1:7bf0c0def198152290f2fd588212a68d3aa732df + pristine_git_object: 49c0377733ebae2229bbe25354e8ddd2d9fd3afc docs/models/components/updateprivateendpointpricingrequest.mdx: id: 88ce9aaaff85 last_write_checksum: sha1:f06a81f525afb634945d201625a01099c000d3ba @@ -8269,8 +8281,8 @@ trackedFiles: pristine_git_object: 6bb668f9e1215ebeb43ad5d362a10ad7d29dc726 docs/models/operations/createprivateendpointrequest.mdx: id: 875d7a8b2217 - last_write_checksum: sha1:5b0e5f7f8c0833fc76379d0614f4a8f480d3f062 - pristine_git_object: fa8fcbf24d6c19bc1fb8643b77a845dc23546373 + last_write_checksum: sha1:76bff0c42f648d2724a42f9242b1aab98e86cac1 + pristine_git_object: 4c32010f8cb43392357cd63ecae4c486838f0c7e docs/models/operations/creatererankrequest.mdx: id: 01a779a95974 last_write_checksum: sha1:dd027a4c59c9c9c1d57bec1ef51d6f95c77531c1 @@ -9095,6 +9107,10 @@ trackedFiles: id: ed5376ad67c3 last_write_checksum: sha1:3aacac054448a19017bf0f5f4f5c34964515244a pristine_git_object: d635bc0725404ff86a57c8ec14e1898b23a49e17 + docs/models/operations/updateprivateendpointparametersrequest.mdx: + id: e4c20c38b57e + last_write_checksum: sha1:32f2e5812456b2b4fbd1418e843926de67acb8f0 + pristine_git_object: ef68d70827f251b50ffbdd9467fa05fe1e2c798e docs/models/operations/updateprivateendpointpricingrequest.mdx: id: 7f47bc0b082e last_write_checksum: sha1:8ab9b7016a554df0fa7147e132614d3e81938d1d @@ -9365,8 +9381,8 @@ trackedFiles: pristine_git_object: 2ef9c9c96d6200ee0577d9ef87c48ef1c13859a6 docs/sdks/privateendpoints/README.mdx: id: 54dee70b8cc7 - last_write_checksum: sha1:87059c5be0e2e4a50917f8f3c185b86e4efe6092 - pristine_git_object: 1eec3acc5fdd0b4d7c47abac96b3fbdc5524d3d5 + last_write_checksum: sha1:cbdbf8fe5f0c0142d876103f1097636eb55a3bf0 + pristine_git_object: 7014d6fe4e8d98171d5016f21b560a14960cafbf docs/sdks/providers/README.mdx: id: 5ea9af111324 last_write_checksum: sha1:ea26a7377de9d03260436dc4494d817c8912e062 @@ -10629,8 +10645,8 @@ trackedFiles: pristine_git_object: f45732edeb348309c2c00f5d8cc71bf2576d7f3c models/components/createprivateendpointrequest.go: id: da2593d248e5 - last_write_checksum: sha1:5f700c1c43d1fbf080f490662b5fb749a54297fb - pristine_git_object: 287560498097c396dfc1719f7f3e39a2e2057fec + last_write_checksum: sha1:54c3f9f6f39f1291d4caf307914e257b3bfa6c66 + pristine_git_object: 13442ad64c6ea6724cec21eaf70d89ac8da3b464 models/components/createprivateendpointvalidationfailedresponseerror.go: id: 56f9c26057bb last_write_checksum: sha1:905af947927baf728041736082b5fe957ac2ad70 @@ -11305,8 +11321,8 @@ trackedFiles: pristine_git_object: 5d38ed298b9ebb0603a6ef5307494645a5712527 models/components/managedprivateendpoint.go: id: da068f5be83c - last_write_checksum: sha1:faa02509aeb9b83d02c6656a69fbe6ad8610183f - pristine_git_object: 6e3ad4ce6aaf9e144146726c927e8c2eaf0c4859 + last_write_checksum: sha1:98d311d5adcf6b877a22a2af268fcd94afbdb827 + pristine_git_object: a2f7cf5bae73cb931d41075621fc5318eae4c10a models/components/managedprivateendpointresponse.go: id: c182c89ae653 last_write_checksum: sha1:8aa7d44acda9cb5eb3b508e1f2d6a52c2966f96d @@ -11961,8 +11977,8 @@ trackedFiles: pristine_git_object: 008512144e9697ac90bee9134cd576fe8e74f66a models/components/privateendpoint.go: id: b36192ae6ca6 - last_write_checksum: sha1:0a645b842f4dbfc388287df6a2f99350b4d8c36a - pristine_git_object: 628164285c4a3bccfa2bbd6b25b0f7d7c2f071bb + last_write_checksum: sha1:f9536ec802ce9e86804ebbdc9500ecfbf8614abc + pristine_git_object: d0665acb9f17de980f272067fa0c2491d33fbec9 models/components/privateendpointactivation.go: id: 187689a6cb98 last_write_checksum: sha1:c9e74cc9ac2c76e3e44ed86a23454e61f0ed1a4b @@ -11975,10 +11991,18 @@ trackedFiles: id: dbd899a35717 last_write_checksum: sha1:83f80f7ca1ba9f26452e841972f03490146ab600 pristine_git_object: 515fa4b45e73ec040a0a9ddf4cacdc3a824d777c + models/components/privateendpointdeclaredparameter.go: + id: b9ed9bdade70 + last_write_checksum: sha1:52e6a5cff199577603f6f0cf8fc9f73db2cba485 + pristine_git_object: 4401fdea935ec20f9eb6e0f9e75a44e234f2703a models/components/privateendpointdeclaredregion.go: id: 8b0483bcc4bc last_write_checksum: sha1:dd4cbd3d71300a882f3f3c242c29b0b9ce4a74ae pristine_git_object: a6c8ff3adaa23bc000d0968cdf416c7138cf1146 + models/components/privateendpointparametercheck.go: + id: e98d4867903d + last_write_checksum: sha1:20c4243d49c01d058a8e6efc527e713282ff80aa + pristine_git_object: a57892f6d6f203f07ddfbea16953c9640c534fb0 models/components/privateendpointpricing.go: id: 566bdb20e41e last_write_checksum: sha1:fc9ee3bce2679ee634dd9abc70c3ca58b83b94e4 @@ -11997,12 +12021,12 @@ trackedFiles: pristine_git_object: af5afe7ace3e00869cfcb79cdf6465d7c3cff8cd models/components/privateendpointvalidation.go: id: be000fefbc39 - last_write_checksum: sha1:fd94de41676aa3fe11ed9762e7470ba2f8ef8ba8 - pristine_git_object: 11f6d5724afba37ba01918281077ddc7df54e8af + last_write_checksum: sha1:ea6f55fc702f43bec7ab425ca6431bf6c17202e0 + pristine_git_object: 0ae2a959ee54e696318a3bc93107a324193956ac models/components/privateendpointvalidationnullable.go: id: 5eda635780cc - last_write_checksum: sha1:e5667837dae18ebde40d40d50d48d1a62197a0b5 - pristine_git_object: 9bb244477d05f19c3a402317e325380c552d4a9b + last_write_checksum: sha1:b540c93fcb57145a3278028d3c1f8dfbc2157a38 + pristine_git_object: 7210c06d5939e78fd6a706749e81d4d1de7f1c61 models/components/privateendpointvalidationresponse.go: id: 2c169f0d87ea last_write_checksum: sha1:65d856da76df32783872a1458571f338a56614f6 @@ -12639,6 +12663,10 @@ trackedFiles: id: 633fb731d574 last_write_checksum: sha1:656575565f335e97fa6798f5fa54ad410a56b16c pristine_git_object: 6789bc29c35a66698f5ab6b905a261bc9607da0f + models/components/updateprivateendpointparametersrequest.go: + id: ddcd7d1bdbcf + last_write_checksum: sha1:ab4f12c85b48fd6085ce25010ad3999f21422e37 + pristine_git_object: 3ffffe419d6cdc9444c633ecae23437d342fb349 models/components/updateprivateendpointpricingrequest.go: id: c22b18c0fbcc last_write_checksum: sha1:8b03c71464d132c0af7b3496b6a4a5fe70d1cde9 @@ -12901,8 +12929,8 @@ trackedFiles: pristine_git_object: 1c31733f07011e5eed25ae005cf1f46296656095 models/operations/createprivateendpoint.go: id: 03c283adffaf - last_write_checksum: sha1:247f79b4cc34980f1f01131f6d398f4d2444c971 - pristine_git_object: 1f238da44de239bb03ad050ce6933101fc83059d + last_write_checksum: sha1:a832ee2654ac9aadb90ddaaf95aa17a90c42d8bc + pristine_git_object: 053911d94f56568766fd3c79d15b7b7c8c249a10 models/operations/creatererank.go: id: 801e27951edc last_write_checksum: sha1:8175a159077590f8c3dc327182deb02ec0bbfd4b @@ -13295,6 +13323,10 @@ trackedFiles: id: 84f9d0d7ce0d last_write_checksum: sha1:ce724476efb18b13477236a0088bfa8ec2dc7c66 pristine_git_object: 88dc20fe1e8befa6ba877a74e8f142196b42c396 + models/operations/updateprivateendpointparameters.go: + id: bf5f30398c10 + last_write_checksum: sha1:1ae6212e1cdd0101f7cbadcf7a672ba227ccf54b + pristine_git_object: aa565930ea0c7413ad4152c9a719930e233a2b11 models/operations/updateprivateendpointpricing.go: id: e3b55a89d25d last_write_checksum: sha1:8f2d75fac1953baec3165261a0ff12cfc85dfca8 @@ -13425,8 +13457,8 @@ trackedFiles: pristine_git_object: 46df65b755cfb5609b7c6763fcbb8e7d3cbd44b4 openrouter.go: id: 207ad004b774 - last_write_checksum: sha1:de7c030b59cd2475a8272deedee1387415e024fe - pristine_git_object: 1106304dd1d89cfbc91c1698956d129d2558d3a0 + last_write_checksum: sha1:4935b7d2a5bd985260e502b7965e172f5bb4d771 + pristine_git_object: 256f746d9098517952988781d798641d8f1596d6 optionalnullable/optionalnullable.go: id: ce60f259ead3 last_write_checksum: sha1:d6aff1a420c31e025ea21d46cf056e305ae76fe8 @@ -13445,8 +13477,8 @@ trackedFiles: pristine_git_object: 0ca54b81a995dd47281cede74247f33471b8964b privateendpoints.go: id: 7d1332a9f3d6 - last_write_checksum: sha1:62e43deb1ff1e8e6ab347538db8ee6ecd2654648 - pristine_git_object: 73887ed9954851a10bb4f5b490077e6bd8533b4a + last_write_checksum: sha1:15a0b6dba116ab5162d43039e63053d2dd84f8b7 + pristine_git_object: e6dad3b1861009d3b914c444eba558ffe665c5ee providers.go: id: e89bb17ecd7b last_write_checksum: sha1:18b0624b4cd205dd08316121e303572a7fdb2f44 @@ -17114,7 +17146,7 @@ examples: id: "5b1c4c4e-7d0a-4a8e-9f3a-2d6c1b0e8a11" responses: "200": - application/json: {"data": {"base_url": "https://contoso.openai.azure.com", "declared_region": "us", "declared_zdr": true, "id": "5b1c4c4e-7d0a-4a8e-9f3a-2d6c1b0e8a11", "model_name": "OpenAI: GPT-4o", "model_permaslug": "openai/gpt-4o-2024-08-06", "model_slug": "openai/gpt-4o", "pricing": {"completion": "0.00001", "prompt": "0.0000025"}, "provider_name": "Azure", "provider_slug": "azure", "status": "active", "upstream_model_id": "gpt-4o-prod"}} + application/json: {"data": {"base_url": "https://contoso.openai.azure.com", "declared_parameters": ["temperature", "seed"], "declared_region": "us", "declared_zdr": true, "id": "5b1c4c4e-7d0a-4a8e-9f3a-2d6c1b0e8a11", "model_name": "OpenAI: GPT-4o", "model_permaslug": "openai/gpt-4o-2024-08-06", "model_slug": "openai/gpt-4o", "pricing": {"completion": "0.00001", "prompt": "0.0000025"}, "provider_name": "Azure", "provider_slug": "azure", "status": "active", "tested_parameters": ["tools", "tool_choice", "response_format"], "upstream_model_id": "gpt-4o-prod"}} "401": application/json: {"error": {"code": 401, "message": "Missing Authentication header"}} "403": @@ -17134,7 +17166,7 @@ examples: application/json: {"upstream_model_id": "gpt-4o-prod"} responses: "200": - application/json: {"data": {"base_url": "https://contoso.openai.azure.com", "declared_region": "us", "declared_zdr": true, "id": "5b1c4c4e-7d0a-4a8e-9f3a-2d6c1b0e8a11", "model_name": "OpenAI: GPT-4o", "model_permaslug": "openai/gpt-4o-2024-08-06", "model_slug": "openai/gpt-4o", "pricing": {"completion": "0.00001", "prompt": "0.0000025"}, "provider_name": "Azure", "provider_slug": "azure", "status": "active", "upstream_model_id": "gpt-4o-prod"}} + application/json: {"data": {"base_url": "https://contoso.openai.azure.com", "declared_parameters": ["temperature", "seed"], "declared_region": "us", "declared_zdr": true, "id": "5b1c4c4e-7d0a-4a8e-9f3a-2d6c1b0e8a11", "model_name": "OpenAI: GPT-4o", "model_permaslug": "openai/gpt-4o-2024-08-06", "model_slug": "openai/gpt-4o", "pricing": {"completion": "0.00001", "prompt": "0.0000025"}, "provider_name": "Azure", "provider_slug": "azure", "status": "active", "tested_parameters": ["tools", "tool_choice", "response_format"], "upstream_model_id": "gpt-4o-prod"}} "400": application/json: {"error": {"code": 400, "message": "Invalid request parameters"}} "401": @@ -17240,7 +17272,7 @@ examples: application/json: {"pricing": {"completion": "0.00001", "prompt": "0.0000025"}} responses: "200": - application/json: {"data": {"base_url": "https://contoso.openai.azure.com", "declared_region": "us", "declared_zdr": true, "id": "5b1c4c4e-7d0a-4a8e-9f3a-2d6c1b0e8a11", "model_name": "OpenAI: GPT-4o", "model_permaslug": "openai/gpt-4o-2024-08-06", "model_slug": "openai/gpt-4o", "pricing": {"completion": "0.00001", "prompt": "0.0000025"}, "provider_name": "Azure", "provider_slug": "azure", "status": "active", "upstream_model_id": "gpt-4o-prod"}} + application/json: {"data": {"base_url": "https://contoso.openai.azure.com", "declared_parameters": ["temperature", "seed"], "declared_region": "us", "declared_zdr": true, "id": "5b1c4c4e-7d0a-4a8e-9f3a-2d6c1b0e8a11", "model_name": "OpenAI: GPT-4o", "model_permaslug": "openai/gpt-4o-2024-08-06", "model_slug": "openai/gpt-4o", "pricing": {"completion": "0.00001", "prompt": "0.0000025"}, "provider_name": "Azure", "provider_slug": "azure", "status": "active", "tested_parameters": ["tools", "tool_choice", "response_format"], "upstream_model_id": "gpt-4o-prod"}} "400": application/json: {"error": {"code": 400, "message": "Invalid request parameters"}} "401": @@ -17873,15 +17905,33 @@ examples: application/json: {"error": {"code": 404, "message": "Intern not found"}} "500": application/json: {"error": {"code": 404, "message": "Intern not found"}} + updatePrivateEndpointParameters: + speakeasy-default-update-private-endpoint-parameters: + parameters: + path: + id: "5b1c4c4e-7d0a-4a8e-9f3a-2d6c1b0e8a11" + requestBody: + application/json: {"declared_parameters": ["temperature", "seed"]} + responses: + "200": + application/json: {"data": {"base_url": "https://contoso.openai.azure.com", "declared_parameters": ["temperature", "seed"], "declared_region": "us", "declared_zdr": true, "id": "5b1c4c4e-7d0a-4a8e-9f3a-2d6c1b0e8a11", "model_name": "OpenAI: GPT-4o", "model_permaslug": "openai/gpt-4o-2024-08-06", "model_slug": "openai/gpt-4o", "pricing": {"completion": "0.00001", "prompt": "0.0000025"}, "provider_name": "Azure", "provider_slug": "azure", "status": "active", "tested_parameters": ["tools", "tool_choice", "response_format"], "upstream_model_id": "gpt-4o-prod"}} + "400": + application/json: {"error": {"code": 400, "message": "Invalid request parameters"}} + "401": + application/json: {"error": {"code": 401, "message": "Missing Authentication header"}} + "403": + application/json: {"error": {"code": 403, "message": "Only management keys can perform this operation"}} + "404": + application/json: {"error": {"code": 404, "message": "Resource not found"}} + "408": + application/json: {"error": {"code": 408, "message": "Operation timed out. Please try again later."}} + "409": + application/json: {"error": {"code": 409, "message": "Resource conflict. Please try again later."}} + "422": + application/json: {"error": {"code": 422, "message": "Invalid argument"}} + "500": + application/json: {"error": {"code": 500, "message": "Internal Server Error"}} + "502": + application/json: {"error": {"code": 502, "message": "Provider returned error"}} examplesVersion: 1.0.2 -releaseNotes: | - ## Go SDK Changes: - * `OpenRouter.Endpoints.ListZdrEndpoints()`: `error.status[503]` **Added** - * `OpenRouter.Endpoints.List()`: `error.status[503]` **Added** - * `OpenRouter.Generations.SubmitFeedback()`: `error` **Changed** - * `OpenRouter.Models.List()`: `error.status[503]` **Added** - * `OpenRouter.Models.ListForUser()`: `error.status[503]` **Added** - * `OpenRouter.Presets.List()`: `error.status[503]` **Added** - * `OpenRouter.Presets.Get()`: `error.status[503]` **Added** - * `OpenRouter.Presets.ListVersions()`: `error.status[503]` **Added** - * `OpenRouter.Presets.GetVersion()`: `error.status[503]` **Added** +releaseNotes: "## Go SDK Changes:\n* `OpenRouter.PrivateEndpoints.UpdateParameters()`: **Added**\n* `OpenRouter.PrivateEndpoints.Create()`: \n * `request.CreatePrivateEndpointRequest` **Changed**\n * `response.Data.MaxCompletionTokens` **Added**\n * `error.union(CreatePrivateEndpointValidationFailedResponse).Data` **Changed**\n* `OpenRouter.PrivateEndpoints.Get()`: `response.Data` **Changed**\n* `OpenRouter.PrivateEndpoints.Update()`: `response.Data` **Changed**\n* `OpenRouter.PrivateEndpoints.Activate()`: `response.Data.MaxCompletionTokens` **Added**\n* `OpenRouter.PrivateEndpoints.Disable()`: `response.Data.MaxCompletionTokens` **Added**\n* `OpenRouter.PrivateEndpoints.Enable()`: `response.Data.MaxCompletionTokens` **Added**\n* `OpenRouter.PrivateEndpoints.UpdatePricing()`: `response.Data` **Changed**\n* `OpenRouter.PrivateEndpoints.Validate()`: `response.Data.Parameters` **Added**\n" diff --git a/.speakeasy/gen.yaml b/.speakeasy/gen.yaml index 2f89e6a8..467a916f 100644 --- a/.speakeasy/gen.yaml +++ b/.speakeasy/gen.yaml @@ -36,7 +36,7 @@ generation: documentation: mintlify preApplyUnionDiscriminators: true go: - version: 0.9.79 + version: 0.9.80 additionalDependencies: {} baseErrorName: OpenRouterError clientServerStatusCodesAsErrors: true diff --git a/.speakeasy/out.openapi.yaml b/.speakeasy/out.openapi.yaml index f3357476..a04aab47 100644 --- a/.speakeasy/out.openapi.yaml +++ b/.speakeasy/out.openapi.yaml @@ -10384,6 +10384,15 @@ components: example: 'https://contoso.openai.azure.com' minLength: 1 type: 'string' + declared_parameters: + description: 'Parameters the upstream supports beyond the tested ones. Replaces the earlier declaration; tested parameters stay. Order and repeated names are ignored, but the list holds at most as many entries as there are declarable parameters, repeats included. `tool_choice` requires `tools` to be tested or declared.' + example: + - 'temperature' + - 'seed' + items: + $ref: '#/components/schemas/PrivateEndpointDeclaredParameter' + maxItems: 25 + type: 'array' declared_region: description: 'Attest where this deployment processes data.' enum: @@ -10401,6 +10410,12 @@ components: type: - 'boolean' - 'null' + max_completion_tokens: + description: 'Cap on completion tokens per request. Requests asking for more skip this endpoint, and the default output length stays within it. When omitted, the cap is copied from the public endpoint for the same model and provider, if there is one.' + example: 131072 + maximum: 2147483647 + minimum: 1 + type: 'integer' model_permaslug: description: 'Permanent slug of the model this endpoint serves.' example: 'openai/gpt-4o-2024-08-06' @@ -16169,6 +16184,12 @@ components: type: - 'boolean' - 'null' + max_completion_tokens: + description: 'Most completion tokens a request routed to this endpoint can produce, or `null` when the endpoint sets no cap beyond the model context length.' + example: 131072 + type: + - 'integer' + - 'null' required: - 'declared_zdr' - 'declared_region' @@ -25577,9 +25598,13 @@ components: PrivateEndpoint: example: base_url: 'https://contoso.openai.azure.com' + declared_parameters: + - 'temperature' + - 'seed' declared_region: 'us' declared_zdr: true id: '5b1c4c4e-7d0a-4a8e-9f3a-2d6c1b0e8a11' + max_completion_tokens: 131072 model_name: 'OpenAI: GPT-4o' model_permaslug: 'openai/gpt-4o-2024-08-06' model_slug: 'openai/gpt-4o' @@ -25591,6 +25616,10 @@ components: provider_name: 'Azure' provider_slug: 'azure' status: 'active' + tested_parameters: + - 'tools' + - 'tool_choice' + - 'response_format' upstream_model_id: 'gpt-4o-prod' properties: base_url: @@ -25599,6 +25628,14 @@ components: type: - 'string' - 'null' + declared_parameters: + description: 'Parameters you declared the upstream supports. Requests that use a parameter only route to this endpoint when it is tested or declared.' + example: + - 'temperature' + - 'seed' + items: + type: 'string' + type: 'array' declared_region: $ref: '#/components/schemas/PrivateEndpointDeclaredRegion' declared_zdr: @@ -25612,6 +25649,12 @@ components: example: '5b1c4c4e-7d0a-4a8e-9f3a-2d6c1b0e8a11' format: 'uuid' type: 'string' + max_completion_tokens: + description: 'Most completion tokens a request routed to this endpoint can produce, or `null` when the endpoint sets no cap beyond the model context length.' + example: 131072 + type: + - 'integer' + - 'null' model_name: description: 'Display name of the model, or `null` when the model is no longer listed.' example: 'OpenAI: GPT-4o' @@ -25642,6 +25685,15 @@ components: - 'null' status: $ref: '#/components/schemas/PrivateEndpointStatus' + tested_parameters: + description: 'Parameters a validation run proved the upstream honors (`tools`, `tool_choice`, `response_format`, `structured_outputs`, `stop`). Read-only; cleared when the upstream configuration changes.' + example: + - 'tools' + - 'tool_choice' + - 'response_format' + items: + type: 'string' + type: 'array' upstream_model_id: description: 'Model or deployment identifier sent to the upstream provider.' example: 'gpt-4o-prod' @@ -25659,6 +25711,8 @@ components: - 'declared_zdr' - 'declared_region' - 'pricing' + - 'tested_parameters' + - 'declared_parameters' type: 'object' PrivateEndpointActivation: description: 'Validate and activate in the same call. On a failed validation the draft is kept and returned with a 422, so fix it and call `/validate` and `/activate` instead of creating it again.' @@ -25727,6 +25781,37 @@ components: example: 'no_byok_key' type: 'string' x-speakeasy-unknown-values: allow + PrivateEndpointDeclaredParameter: + description: 'A chat request parameter the endpoint accepts.' + enum: + - 'temperature' + - 'top_p' + - 'top_k' + - 'min_p' + - 'top_a' + - 'frequency_penalty' + - 'presence_penalty' + - 'repetition_penalty' + - 'max_tokens' + - 'max_completion_tokens' + - 'logit_bias' + - 'logprobs' + - 'top_logprobs' + - 'prediction' + - 'seed' + - 'response_format' + - 'structured_outputs' + - 'stop' + - 'tools' + - 'tool_choice' + - 'parallel_tool_calls' + - 'reasoning' + - 'reasoning_effort' + - 'web_search_options' + - 'verbosity' + example: 'seed' + type: 'string' + x-speakeasy-unknown-values: allow PrivateEndpointDeclaredRegion: description: 'Where you attest this deployment processes data. `global` means not regional; `null` means undeclared.' enum: @@ -25739,6 +25824,20 @@ components: - 'string' - 'null' x-speakeasy-unknown-values: allow + PrivateEndpointParameterCheck: + example: + parameter: 'response_format' + supported: true + properties: + parameter: + example: 'response_format' + type: 'string' + supported: + type: 'boolean' + required: + - 'parameter' + - 'supported' + type: 'object' PrivateEndpointPricing: description: 'Negotiated per-token rates reported for requests routed to this endpoint.' example: @@ -25835,6 +25934,11 @@ components: items: $ref: '#/components/schemas/PrivateEndpointCheck' type: 'array' + parameters: + description: 'Request parameters probed after the checks passed, each with whether the upstream honored it. Supported ones are recorded in `tested_parameters`. Absent on a failed run and for providers that run no parameter probes; empty when every probe group was already proven.' + items: + $ref: '#/components/schemas/PrivateEndpointParameterCheck' + type: 'array' passed: description: 'Whether every check passed.' example: true @@ -25849,6 +25953,11 @@ components: items: $ref: '#/components/schemas/PrivateEndpointCheck' type: 'array' + parameters: + description: 'Request parameters probed after the checks passed, each with whether the upstream honored it. Supported ones are recorded in `tested_parameters`. Absent on a failed run and for providers that run no parameter probes; empty when every probe group was already proven.' + items: + $ref: '#/components/schemas/PrivateEndpointParameterCheck' + type: 'array' passed: description: 'Whether every check passed.' example: true @@ -32196,6 +32305,20 @@ components: required: - 'is_filtered_model_catalog_enabled' type: 'object' + UpdatePrivateEndpointParametersRequest: + properties: + declared_parameters: + description: 'Parameters the upstream supports beyond the tested ones. Replaces the earlier declaration; tested parameters stay. Order and repeated names are ignored, but the list holds at most as many entries as there are declarable parameters, repeats included. `tool_choice` requires `tools` to be tested or declared.' + example: + - 'temperature' + - 'seed' + items: + $ref: '#/components/schemas/PrivateEndpointDeclaredParameter' + maxItems: 25 + type: 'array' + required: + - 'declared_parameters' + type: 'object' UpdatePrivateEndpointPricingRequest: properties: pricing: @@ -46362,12 +46485,12 @@ paths: description: 'Create a private endpoint as a draft. Drafts are not routable: validate one with `POST /private-endpoints/{id}/validate`, then activate it with `POST /private-endpoints/{id}/activate`. Pass `activate` to do all three in one call; if validation fails the draft is kept and returned with the failed checks. Send an `Idempotency-Key` header to make retries safe: a repeated key with the same request returns the endpoint the first request created; reusing it with different fields returns 422 `idempotency_key_reused`. [Management key](/docs/guides/overview/auth/management-api-keys) required.' operationId: 'createPrivateEndpoint' parameters: - - description: 'Retry-safe create: a repeated create with the same key from the same organization returns the endpoint the first request created instead of creating another. The endpoint is returned as it is now. Reusing a key with a different request body (model, provider, base URL, upstream model ID, declared ZDR or region, or pricing) is rejected with 422 `idempotency_key_reused`. `activate` is not compared, and later edits to the endpoint do not affect the comparison.' + - description: 'Retry-safe create: a repeated create with the same key from the same organization returns the endpoint the first request created instead of creating another. The endpoint is returned as it is now. Reusing a key with a different request body (model, provider, base URL, upstream model ID, declared ZDR or region, pricing, or declared parameters) is rejected with 422 `idempotency_key_reused`. Declared parameters are compared as a set, so a retry that reorders or repeats a name replays the endpoint. `activate` and `max_completion_tokens` are not compared, and later edits to the endpoint do not affect the comparison.' in: 'header' name: 'idempotency-key' required: false schema: - description: 'Retry-safe create: a repeated create with the same key from the same organization returns the endpoint the first request created instead of creating another. The endpoint is returned as it is now. Reusing a key with a different request body (model, provider, base URL, upstream model ID, declared ZDR or region, or pricing) is rejected with 422 `idempotency_key_reused`. `activate` is not compared, and later edits to the endpoint do not affect the comparison.' + description: 'Retry-safe create: a repeated create with the same key from the same organization returns the endpoint the first request created instead of creating another. The endpoint is returned as it is now. Reusing a key with a different request body (model, provider, base URL, upstream model ID, declared ZDR or region, pricing, or declared parameters) is rejected with 422 `idempotency_key_reused`. Declared parameters are compared as a set, so a retry that reorders or repeats a name replays the endpoint. `activate` and `max_completion_tokens` are not compared, and later edits to the endpoint do not affect the comparison.' example: 'wayfair-gpt-4o-eastus-2026-09' maxLength: 255 minLength: 1 @@ -47134,6 +47257,127 @@ paths: tags: - 'Private Endpoints' x-speakeasy-name-override: 'enable' + /private-endpoints/{id}/parameters: + put: + description: 'Declare which request parameters the upstream supports beyond the ones validation proved. Applies to drafts and active endpoints; routing picks the change up for subsequent requests. The body replaces the earlier declaration and is read as a set: order and repeated names do not matter, but the list holds at most as many entries as there are declarable parameters, repeats included. `tested_parameters` stay. Returns 400 `parameters_invalid` when `tool_choice` is declared without `tools` being tested or declared. [Management key](/docs/guides/overview/auth/management-api-keys) required.' + operationId: 'updatePrivateEndpointParameters' + parameters: + - description: 'Stable identifier of the private endpoint.' + in: 'path' + name: 'id' + required: true + schema: + description: 'Stable identifier of the private endpoint.' + example: '5b1c4c4e-7d0a-4a8e-9f3a-2d6c1b0e8a11' + format: 'uuid' + type: 'string' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/UpdatePrivateEndpointParametersRequest' + required: true + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/PrivateEndpointResponse' + description: 'The endpoint with its new declared parameters' + '400': + content: + application/json: + example: + error: + code: 400 + message: 'Invalid request parameters' + schema: + $ref: '#/components/schemas/BadRequestResponse' + description: 'Bad Request - Invalid request parameters or malformed input' + '401': + content: + application/json: + example: + error: + code: 401 + message: 'Missing Authentication header' + 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: + example: + error: + code: 404 + message: 'Resource not found' + schema: + $ref: '#/components/schemas/NotFoundResponse' + description: 'Not Found - Resource does not exist' + '408': + content: + application/json: + example: + error: + code: 408 + message: 'Operation timed out. Please try again later.' + schema: + $ref: '#/components/schemas/RequestTimeoutResponse' + description: 'Request Timeout - Operation exceeded time limit' + '409': + content: + application/json: + example: + error: + code: 409 + message: 'Resource conflict. Please try again later.' + schema: + $ref: '#/components/schemas/ConflictResponse' + description: 'Conflict - Resource conflict or concurrent modification' + '422': + content: + application/json: + example: + error: + code: 422 + message: 'Invalid argument' + schema: + $ref: '#/components/schemas/UnprocessableEntityResponse' + description: 'Unprocessable Entity - Semantic validation failure' + '500': + content: + application/json: + example: + error: + code: 500 + message: 'Internal Server Error' + schema: + $ref: '#/components/schemas/InternalServerResponse' + description: 'Internal Server Error - Unexpected server error' + '502': + content: + application/json: + example: + error: + code: 502 + message: 'Provider returned error' + schema: + $ref: '#/components/schemas/BadGatewayResponse' + description: 'Bad Gateway - Provider/upstream API failure' + summary: 'Set private endpoint supported parameters' + tags: + - 'Private Endpoints' + x-speakeasy-name-override: 'updateParameters' /private-endpoints/{id}/pricing: put: description: 'Set the negotiated per-token rates reported for requests routed to this endpoint. Applies to drafts and active endpoints; new rates take effect for subsequent requests. The body replaces the whole pricing object: omitting `cache_read` or `cache_write` reverts that rate to the provider pricing strategy''s default, even if it was set before. [Management key](/docs/guides/overview/auth/management-api-keys) required.' diff --git a/.speakeasy/workflow.lock b/.speakeasy/workflow.lock index 96a6a5c0..3aa0ed6f 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:9a252fab4b49b67f4a969532269b526bf3d378d6581377ec3c9da07a5d36b5bd - sourceBlobDigest: sha256:256d1b1cc0c51003479132cb195468507697c97c3ae139ad8bdc6374715fc712 + sourceRevisionDigest: sha256:bafe162dd0b4da5f3f2d9ca231f9ed585362e4cf79561182acdeefd8e519f362 + sourceBlobDigest: sha256:0862b68119e1b19e5684501ea80e848027bd8876c6a6f06269be12d3bcccc639 tags: - latest - 1.0.0 @@ -11,10 +11,10 @@ targets: openrouter: source: OpenRouter API sourceNamespace: open-router-chat-completions-api - sourceRevisionDigest: sha256:9a252fab4b49b67f4a969532269b526bf3d378d6581377ec3c9da07a5d36b5bd - sourceBlobDigest: sha256:256d1b1cc0c51003479132cb195468507697c97c3ae139ad8bdc6374715fc712 + sourceRevisionDigest: sha256:bafe162dd0b4da5f3f2d9ca231f9ed585362e4cf79561182acdeefd8e519f362 + sourceBlobDigest: sha256:0862b68119e1b19e5684501ea80e848027bd8876c6a6f06269be12d3bcccc639 codeSamplesNamespace: open-router-chat-completions-api-go-code-samples - codeSamplesRevisionDigest: sha256:0998d2e39ccdd195e57a70b27e4e4c77a341bc4f31b373878022a33c3b3c6037 + codeSamplesRevisionDigest: sha256:b87cb258e2720b2b457897c4c09035eef3e0131118ff45864e82f13f9d30a7d0 workflow: workflowVersion: 1.0.0 speakeasyVersion: 1.787.0 diff --git a/OVERVIEW.md b/OVERVIEW.md index 7990f379..7b8a2a08 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.79 +go get github.com/OpenRouterTeam/go-sdk@v0.9.80 ``` **Requirements:** Go 1.25 or higher diff --git a/README.md b/README.md index d6e39327..e66160da 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.79 +> go get github.com/OpenRouterTeam/go-sdk@v0.9.80 > ``` @@ -356,6 +356,7 @@ func main() { * [Activate](docs/sdks/privateendpoints/README.md#activate) - Activate a validated private endpoint * [Disable](docs/sdks/privateendpoints/README.md#disable) - Disable a private endpoint * [Enable](docs/sdks/privateendpoints/README.md#enable) - Enable a private endpoint +* [UpdateParameters](docs/sdks/privateendpoints/README.md#updateparameters) - Set private endpoint supported parameters * [UpdatePricing](docs/sdks/privateendpoints/README.md#updatepricing) - Set private endpoint pricing * [Validate](docs/sdks/privateendpoints/README.md#validate) - Validate a draft private endpoint diff --git a/RELEASES.md b/RELEASES.md index 8c411dc2..a07b61de 100644 --- a/RELEASES.md +++ b/RELEASES.md @@ -3308,4 +3308,14 @@ Based on: ### Generated - [go v0.9.79] . ### Releases -- [Go v0.9.79] https://github.com/OpenRouterTeam/go-sdk/releases/tag/v0.9.79 - . \ No newline at end of file +- [Go v0.9.79] https://github.com/OpenRouterTeam/go-sdk/releases/tag/v0.9.79 - . + +## 2026-10-27 13:51:15 +### Changes +Based on: +- OpenAPI Doc +- Speakeasy CLI 1.787.0 (2.914.0) https://github.com/speakeasy-api/speakeasy +### Generated +- [go v0.9.80] . +### Releases +- [Go v0.9.80] https://github.com/OpenRouterTeam/go-sdk/releases/tag/v0.9.80 - . \ No newline at end of file diff --git a/doc.go b/doc.go index 7d524814..6b2aa97d 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.79 + go get github.com/OpenRouterTeam/go-sdk@v0.9.80 For full API documentation, visit: https://openrouter.ai/docs/client-sdks/go/overview diff --git a/docs/models/components/createprivateendpointrequest.mdx b/docs/models/components/createprivateendpointrequest.mdx index 84099f10..5976ad3e 100644 --- a/docs/models/components/createprivateendpointrequest.mdx +++ b/docs/models/components/createprivateendpointrequest.mdx @@ -4,13 +4,15 @@ title: "CreatePrivateEndpointRequest" ## Fields -| Field | Type | Required | Description | Example | -| -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `Activate` | [*components.PrivateEndpointActivation](../../models/components/privateendpointactivation.mdx) | ➖ | Validate and activate in the same call. On a failed validation the draft is kept and returned with a 422, so fix it and call `/validate` and `/activate` instead of creating it again. | \{
"workspace_id": "550e8400-e29b-41d4-a716-446655440000"
} | -| `BaseURL` | `*string` | ➖ | HTTPS base URL of your deployment. Required unless the provider derives its URL from the BYOK credential (Azure, Amazon Bedrock, Google Vertex). | https://contoso.openai.azure.com | -| `DeclaredRegion` | optionalnullable.OptionalNullable[[components.CreatePrivateEndpointRequestDeclaredRegion](../../models/components/createprivateendpointrequestdeclaredregion.mdx)] | ➖ | Attest where this deployment processes data. | us | -| `DeclaredZdr` | optionalnullable.OptionalNullable[`bool`] | ➖ | Attest that this deployment retains no prompt or completion data. | | -| `ModelPermaslug` | `string` | ✅ | Permanent slug of the model this endpoint serves. | openai/gpt-4o-2024-08-06 | -| `Pricing` | [*components.PrivateEndpointPricing](../../models/components/privateendpointpricing.mdx) | ➖ | Negotiated per-token rates reported for requests routed to this endpoint. | \{
"cache_read": "0.00000025",
"cache_write": "0.000003125",
"completion": "0.00001",
"prompt": "0.0000025"
} | -| `ProviderSlug` | `string` | ✅ | Slug of the upstream provider. | azure | -| `UpstreamModelID` | `string` | ✅ | Model or deployment identifier sent to the upstream provider. | gpt-4o-prod | \ No newline at end of file +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `Activate` | [*components.PrivateEndpointActivation](../../models/components/privateendpointactivation.mdx) | ➖ | Validate and activate in the same call. On a failed validation the draft is kept and returned with a 422, so fix it and call `/validate` and `/activate` instead of creating it again. | \{
"workspace_id": "550e8400-e29b-41d4-a716-446655440000"
} | +| `BaseURL` | `*string` | ➖ | HTTPS base URL of your deployment. Required unless the provider derives its URL from the BYOK credential (Azure, Amazon Bedrock, Google Vertex). | https://contoso.openai.azure.com | +| `DeclaredParameters` | [][components.PrivateEndpointDeclaredParameter](../../models/components/privateendpointdeclaredparameter.mdx) | ➖ | Parameters the upstream supports beyond the tested ones. Replaces the earlier declaration; tested parameters stay. Order and repeated names are ignored, but the list holds at most as many entries as there are declarable parameters, repeats included. `tool_choice` requires `tools` to be tested or declared. | [
"temperature",
"seed"
] | +| `DeclaredRegion` | optionalnullable.OptionalNullable[[components.CreatePrivateEndpointRequestDeclaredRegion](../../models/components/createprivateendpointrequestdeclaredregion.mdx)] | ➖ | Attest where this deployment processes data. | us | +| `DeclaredZdr` | optionalnullable.OptionalNullable[`bool`] | ➖ | Attest that this deployment retains no prompt or completion data. | | +| `MaxCompletionTokens` | `*int64` | ➖ | Cap on completion tokens per request. Requests asking for more skip this endpoint, and the default output length stays within it. When omitted, the cap is copied from the public endpoint for the same model and provider, if there is one. | 131072 | +| `ModelPermaslug` | `string` | ✅ | Permanent slug of the model this endpoint serves. | openai/gpt-4o-2024-08-06 | +| `Pricing` | [*components.PrivateEndpointPricing](../../models/components/privateendpointpricing.mdx) | ➖ | Negotiated per-token rates reported for requests routed to this endpoint. | \{
"cache_read": "0.00000025",
"cache_write": "0.000003125",
"completion": "0.00001",
"prompt": "0.0000025"
} | +| `ProviderSlug` | `string` | ✅ | Slug of the upstream provider. | azure | +| `UpstreamModelID` | `string` | ✅ | Model or deployment identifier sent to the upstream provider. | gpt-4o-prod | \ No newline at end of file diff --git a/docs/models/components/managedprivateendpoint.mdx b/docs/models/components/managedprivateendpoint.mdx index 50614a7a..3d220544 100644 --- a/docs/models/components/managedprivateendpoint.mdx +++ b/docs/models/components/managedprivateendpoint.mdx @@ -14,4 +14,5 @@ title: "ManagedPrivateEndpoint" | `ProviderName` | `string` | ✅ | Display name of the upstream provider. | Azure | | `Status` | [components.PrivateEndpointStatus](../../models/components/privateendpointstatus.mdx) | ✅ | Lifecycle state. `draft` endpoints are not routable until validated and activated; `disabled` endpoints are activated but temporarily not routable. | active | | `DeclaredRegion` | [*components.PrivateEndpointDeclaredRegion](../../models/components/privateendpointdeclaredregion.mdx) | ✅ | Where you attest this deployment processes data. `global` means not regional; `null` means undeclared. | us | -| `DeclaredZdr` | `*bool` | ✅ | Whether you attest this deployment retains no prompt or completion data. `null` means undeclared. | true | \ No newline at end of file +| `DeclaredZdr` | `*bool` | ✅ | Whether you attest this deployment retains no prompt or completion data. `null` means undeclared. | true | +| `MaxCompletionTokens` | optionalnullable.OptionalNullable[`int64`] | ➖ | Most completion tokens a request routed to this endpoint can produce, or `null` when the endpoint sets no cap beyond the model context length. | 131072 | \ No newline at end of file diff --git a/docs/models/components/privateendpoint.mdx b/docs/models/components/privateendpoint.mdx index bf428260..fa1b761b 100644 --- a/docs/models/components/privateendpoint.mdx +++ b/docs/models/components/privateendpoint.mdx @@ -4,17 +4,20 @@ title: "PrivateEndpoint" ## Fields -| Field | Type | Required | Description | Example | -| --------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------- | -| `BaseURL` | `*string` | ✅ | HTTPS base URL of your deployment, or `null` for providers whose URL is derived from the BYOK credential (Azure, Amazon Bedrock, Google Vertex). | https://contoso.openai.azure.com | -| `DeclaredRegion` | [*components.PrivateEndpointDeclaredRegion](../../models/components/privateendpointdeclaredregion.mdx) | ✅ | Where you attest this deployment processes data. `global` means not regional; `null` means undeclared. | us | -| `DeclaredZdr` | `*bool` | ✅ | Whether you attest this deployment retains no prompt or completion data. `null` means undeclared. | true | -| `ID` | `string` | ✅ | Stable identifier of the private endpoint. | 5b1c4c4e-7d0a-4a8e-9f3a-2d6c1b0e8a11 | -| `ModelName` | `*string` | ✅ | Display name of the model, or `null` when the model is no longer listed. | OpenAI: GPT-4o | -| `ModelPermaslug` | `string` | ✅ | Permanent slug of the model this endpoint serves. | openai/gpt-4o-2024-08-06 | -| `ModelSlug` | `*string` | ✅ | Public model slug, or `null` when the model is no longer listed. | openai/gpt-4o | -| `Pricing` | [components.PrivateEndpointPricing](../../models/components/privateendpointpricing.mdx) | ✅ | Negotiated per-token rates reported for requests routed to this endpoint. | \{
"cache_read": "0.00000025",
"cache_write": "0.000003125",
"completion": "0.00001",
"prompt": "0.0000025"
} | -| `ProviderName` | `string` | ✅ | Display name of the upstream provider. | Azure | -| `ProviderSlug` | `*string` | ✅ | Slug of the upstream provider, or `null` when the provider is no longer listed. | azure | -| `Status` | [components.PrivateEndpointStatus](../../models/components/privateendpointstatus.mdx) | ✅ | Lifecycle state. `draft` endpoints are not routable until validated and activated; `disabled` endpoints are activated but temporarily not routable. | active | -| `UpstreamModelID` | `string` | ✅ | Model or deployment identifier sent to the upstream provider. | gpt-4o-prod | \ No newline at end of file +| Field | Type | Required | Description | Example | +| --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `BaseURL` | `*string` | ✅ | HTTPS base URL of your deployment, or `null` for providers whose URL is derived from the BYOK credential (Azure, Amazon Bedrock, Google Vertex). | https://contoso.openai.azure.com | +| `DeclaredParameters` | []`string` | ✅ | Parameters you declared the upstream supports. Requests that use a parameter only route to this endpoint when it is tested or declared. | [
"temperature",
"seed"
] | +| `DeclaredRegion` | [*components.PrivateEndpointDeclaredRegion](../../models/components/privateendpointdeclaredregion.mdx) | ✅ | Where you attest this deployment processes data. `global` means not regional; `null` means undeclared. | us | +| `DeclaredZdr` | `*bool` | ✅ | Whether you attest this deployment retains no prompt or completion data. `null` means undeclared. | true | +| `ID` | `string` | ✅ | Stable identifier of the private endpoint. | 5b1c4c4e-7d0a-4a8e-9f3a-2d6c1b0e8a11 | +| `MaxCompletionTokens` | optionalnullable.OptionalNullable[`int64`] | ➖ | Most completion tokens a request routed to this endpoint can produce, or `null` when the endpoint sets no cap beyond the model context length. | 131072 | +| `ModelName` | `*string` | ✅ | Display name of the model, or `null` when the model is no longer listed. | OpenAI: GPT-4o | +| `ModelPermaslug` | `string` | ✅ | Permanent slug of the model this endpoint serves. | openai/gpt-4o-2024-08-06 | +| `ModelSlug` | `*string` | ✅ | Public model slug, or `null` when the model is no longer listed. | openai/gpt-4o | +| `Pricing` | [components.PrivateEndpointPricing](../../models/components/privateendpointpricing.mdx) | ✅ | Negotiated per-token rates reported for requests routed to this endpoint. | \{
"cache_read": "0.00000025",
"cache_write": "0.000003125",
"completion": "0.00001",
"prompt": "0.0000025"
} | +| `ProviderName` | `string` | ✅ | Display name of the upstream provider. | Azure | +| `ProviderSlug` | `*string` | ✅ | Slug of the upstream provider, or `null` when the provider is no longer listed. | azure | +| `Status` | [components.PrivateEndpointStatus](../../models/components/privateendpointstatus.mdx) | ✅ | Lifecycle state. `draft` endpoints are not routable until validated and activated; `disabled` endpoints are activated but temporarily not routable. | active | +| `TestedParameters` | []`string` | ✅ | Parameters a validation run proved the upstream honors (`tools`, `tool_choice`, `response_format`, `structured_outputs`, `stop`). Read-only; cleared when the upstream configuration changes. | [
"tools",
"tool_choice",
"response_format"
] | +| `UpstreamModelID` | `string` | ✅ | Model or deployment identifier sent to the upstream provider. | gpt-4o-prod | \ No newline at end of file diff --git a/docs/models/components/privateendpointdeclaredparameter.mdx b/docs/models/components/privateendpointdeclaredparameter.mdx new file mode 100644 index 00000000..159fa108 --- /dev/null +++ b/docs/models/components/privateendpointdeclaredparameter.mdx @@ -0,0 +1,49 @@ +--- +title: "PrivateEndpointDeclaredParameter" +--- + +A chat request parameter the endpoint accepts. + +## Example Usage + +```go +import ( + "github.com/OpenRouterTeam/go-sdk/models/components" +) + +value := components.PrivateEndpointDeclaredParameterTemperature + +// Open enum: custom values can be created with a direct type cast +custom := components.PrivateEndpointDeclaredParameter("custom_value") +``` + + +## Values + +| Name | Value | +| ----------------------------------------------------- | ----------------------------------------------------- | +| `PrivateEndpointDeclaredParameterTemperature` | temperature | +| `PrivateEndpointDeclaredParameterTopP` | top_p | +| `PrivateEndpointDeclaredParameterTopK` | top_k | +| `PrivateEndpointDeclaredParameterMinP` | min_p | +| `PrivateEndpointDeclaredParameterTopA` | top_a | +| `PrivateEndpointDeclaredParameterFrequencyPenalty` | frequency_penalty | +| `PrivateEndpointDeclaredParameterPresencePenalty` | presence_penalty | +| `PrivateEndpointDeclaredParameterRepetitionPenalty` | repetition_penalty | +| `PrivateEndpointDeclaredParameterMaxTokens` | max_tokens | +| `PrivateEndpointDeclaredParameterMaxCompletionTokens` | max_completion_tokens | +| `PrivateEndpointDeclaredParameterLogitBias` | logit_bias | +| `PrivateEndpointDeclaredParameterLogprobs` | logprobs | +| `PrivateEndpointDeclaredParameterTopLogprobs` | top_logprobs | +| `PrivateEndpointDeclaredParameterPrediction` | prediction | +| `PrivateEndpointDeclaredParameterSeed` | seed | +| `PrivateEndpointDeclaredParameterResponseFormat` | response_format | +| `PrivateEndpointDeclaredParameterStructuredOutputs` | structured_outputs | +| `PrivateEndpointDeclaredParameterStop` | stop | +| `PrivateEndpointDeclaredParameterTools` | tools | +| `PrivateEndpointDeclaredParameterToolChoice` | tool_choice | +| `PrivateEndpointDeclaredParameterParallelToolCalls` | parallel_tool_calls | +| `PrivateEndpointDeclaredParameterReasoning` | reasoning | +| `PrivateEndpointDeclaredParameterReasoningEffort` | reasoning_effort | +| `PrivateEndpointDeclaredParameterWebSearchOptions` | web_search_options | +| `PrivateEndpointDeclaredParameterVerbosity` | verbosity | \ No newline at end of file diff --git a/docs/models/components/privateendpointparametercheck.mdx b/docs/models/components/privateendpointparametercheck.mdx new file mode 100644 index 00000000..113ab11e --- /dev/null +++ b/docs/models/components/privateendpointparametercheck.mdx @@ -0,0 +1,10 @@ +--- +title: "PrivateEndpointParameterCheck" +--- + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------ | ------------------ | ------------------ | ------------------ | ------------------ | +| `Parameter` | `string` | ✅ | N/A | response_format | +| `Supported` | `bool` | ✅ | N/A | | \ No newline at end of file diff --git a/docs/models/components/privateendpointresponse.mdx b/docs/models/components/privateendpointresponse.mdx index 29c7ea51..976e149b 100644 --- a/docs/models/components/privateendpointresponse.mdx +++ b/docs/models/components/privateendpointresponse.mdx @@ -4,6 +4,6 @@ title: "PrivateEndpointResponse" ## Fields -| Field | Type | Required | Description | Example | -| -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `Data` | [components.PrivateEndpoint](../../models/components/privateendpoint.mdx) | ✅ | N/A | \{
"base_url": "https://contoso.openai.azure.com",
"declared_region": "us",
"declared_zdr": true,
"id": "5b1c4c4e-7d0a-4a8e-9f3a-2d6c1b0e8a11",
"model_name": "OpenAI: GPT-4o",
"model_permaslug": "openai/gpt-4o-2024-08-06",
"model_slug": "openai/gpt-4o",
"pricing": \{
"cache_read": "0.00000025",
"cache_write": "0.000003125",
"completion": "0.00001",
"prompt": "0.0000025"
},
"provider_name": "Azure",
"provider_slug": "azure",
"status": "active",
"upstream_model_id": "gpt-4o-prod"
} | \ No newline at end of file +| Field | Type | Required | Description | Example | +| --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `Data` | [components.PrivateEndpoint](../../models/components/privateendpoint.mdx) | ✅ | N/A | \{
"base_url": "https://contoso.openai.azure.com",
"declared_parameters": [
"temperature",
"seed"
],
"declared_region": "us",
"declared_zdr": true,
"id": "5b1c4c4e-7d0a-4a8e-9f3a-2d6c1b0e8a11",
"max_completion_tokens": 131072,
"model_name": "OpenAI: GPT-4o",
"model_permaslug": "openai/gpt-4o-2024-08-06",
"model_slug": "openai/gpt-4o",
"pricing": \{
"cache_read": "0.00000025",
"cache_write": "0.000003125",
"completion": "0.00001",
"prompt": "0.0000025"
},
"provider_name": "Azure",
"provider_slug": "azure",
"status": "active",
"tested_parameters": [
"tools",
"tool_choice",
"response_format"
],
"upstream_model_id": "gpt-4o-prod"
} | \ No newline at end of file diff --git a/docs/models/components/privateendpointvalidation.mdx b/docs/models/components/privateendpointvalidation.mdx index 31cd81f7..cb0c013c 100644 --- a/docs/models/components/privateendpointvalidation.mdx +++ b/docs/models/components/privateendpointvalidation.mdx @@ -4,7 +4,8 @@ title: "PrivateEndpointValidation" ## Fields -| Field | Type | Required | Description | Example | -| ------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------ | -| `Checks` | [][components.PrivateEndpointCheck](../../models/components/privateendpointcheck.mdx) | ✅ | N/A | | -| `Passed` | `bool` | ✅ | Whether every check passed. | true | \ No newline at end of file +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `Checks` | [][components.PrivateEndpointCheck](../../models/components/privateendpointcheck.mdx) | ✅ | N/A | | +| `Parameters` | [][components.PrivateEndpointParameterCheck](../../models/components/privateendpointparametercheck.mdx) | ➖ | Request parameters probed after the checks passed, each with whether the upstream honored it. Supported ones are recorded in `tested_parameters`. Absent on a failed run and for providers that run no parameter probes; empty when every probe group was already proven. | | +| `Passed` | `bool` | ✅ | Whether every check passed. | true | \ No newline at end of file diff --git a/docs/models/components/privateendpointvalidationnullable.mdx b/docs/models/components/privateendpointvalidationnullable.mdx index 2516ce73..df6a2305 100644 --- a/docs/models/components/privateendpointvalidationnullable.mdx +++ b/docs/models/components/privateendpointvalidationnullable.mdx @@ -4,7 +4,8 @@ title: "PrivateEndpointValidationNullable" ## Fields -| Field | Type | Required | Description | Example | -| ------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------ | -| `Checks` | [][components.PrivateEndpointCheck](../../models/components/privateendpointcheck.mdx) | ✅ | N/A | | -| `Passed` | `bool` | ✅ | Whether every check passed. | true | \ No newline at end of file +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `Checks` | [][components.PrivateEndpointCheck](../../models/components/privateendpointcheck.mdx) | ✅ | N/A | | +| `Parameters` | [][components.PrivateEndpointParameterCheck](../../models/components/privateendpointparametercheck.mdx) | ➖ | Request parameters probed after the checks passed, each with whether the upstream honored it. Supported ones are recorded in `tested_parameters`. Absent on a failed run and for providers that run no parameter probes; empty when every probe group was already proven. | | +| `Passed` | `bool` | ✅ | Whether every check passed. | true | \ No newline at end of file diff --git a/docs/models/components/updateprivateendpointparametersrequest.mdx b/docs/models/components/updateprivateendpointparametersrequest.mdx new file mode 100644 index 00000000..5b481250 --- /dev/null +++ b/docs/models/components/updateprivateendpointparametersrequest.mdx @@ -0,0 +1,9 @@ +--- +title: "UpdatePrivateEndpointParametersRequest" +--- + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `DeclaredParameters` | [][components.PrivateEndpointDeclaredParameter](../../models/components/privateendpointdeclaredparameter.mdx) | ✅ | Parameters the upstream supports beyond the tested ones. Replaces the earlier declaration; tested parameters stay. Order and repeated names are ignored, but the list holds at most as many entries as there are declarable parameters, repeats included. `tool_choice` requires `tools` to be tested or declared. | [
"temperature",
"seed"
] | \ No newline at end of file diff --git a/docs/models/operations/createprivateendpointrequest.mdx b/docs/models/operations/createprivateendpointrequest.mdx index 5e5266d3..99c9de2a 100644 --- a/docs/models/operations/createprivateendpointrequest.mdx +++ b/docs/models/operations/createprivateendpointrequest.mdx @@ -4,7 +4,7 @@ title: "CreatePrivateEndpointRequest" ## Fields -| Field | Type | Required | Description | Example | -| ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `IdempotencyKey` | `*string` | ➖ | Retry-safe create: a repeated create with the same key from the same organization returns the endpoint the first request created instead of creating another. The endpoint is returned as it is now. Reusing a key with a different request body (model, provider, base URL, upstream model ID, declared ZDR or region, or pricing) is rejected with 422 `idempotency_key_reused`. `activate` is not compared, and later edits to the endpoint do not affect the comparison. | wayfair-gpt-4o-eastus-2026-09 | -| `CreatePrivateEndpointRequest` | [components.CreatePrivateEndpointRequest](../../models/components/createprivateendpointrequest.mdx) | ✅ | N/A | | \ No newline at end of file +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `IdempotencyKey` | `*string` | ➖ | Retry-safe create: a repeated create with the same key from the same organization returns the endpoint the first request created instead of creating another. The endpoint is returned as it is now. Reusing a key with a different request body (model, provider, base URL, upstream model ID, declared ZDR or region, pricing, or declared parameters) is rejected with 422 `idempotency_key_reused`. Declared parameters are compared as a set, so a retry that reorders or repeats a name replays the endpoint. `activate` and `max_completion_tokens` are not compared, and later edits to the endpoint do not affect the comparison. | wayfair-gpt-4o-eastus-2026-09 | +| `CreatePrivateEndpointRequest` | [components.CreatePrivateEndpointRequest](../../models/components/createprivateendpointrequest.mdx) | ✅ | N/A | | \ No newline at end of file diff --git a/docs/models/operations/updateprivateendpointparametersrequest.mdx b/docs/models/operations/updateprivateendpointparametersrequest.mdx new file mode 100644 index 00000000..3ea467b9 --- /dev/null +++ b/docs/models/operations/updateprivateendpointparametersrequest.mdx @@ -0,0 +1,10 @@ +--- +title: "UpdatePrivateEndpointParametersRequest" +--- + +## Fields + +| Field | Type | Required | Description | Example | +| ---------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------- | +| `ID` | `string` | ✅ | Stable identifier of the private endpoint. | 5b1c4c4e-7d0a-4a8e-9f3a-2d6c1b0e8a11 | +| `UpdatePrivateEndpointParametersRequest` | [components.UpdatePrivateEndpointParametersRequest](../../models/components/updateprivateendpointparametersrequest.mdx) | ✅ | N/A | | \ No newline at end of file diff --git a/docs/sdks/privateendpoints/README.mdx b/docs/sdks/privateendpoints/README.mdx index f7cbd704..62dd64e9 100644 --- a/docs/sdks/privateendpoints/README.mdx +++ b/docs/sdks/privateendpoints/README.mdx @@ -17,6 +17,7 @@ Private Endpoints endpoints * [Activate](#activate) - Activate a validated private endpoint * [Disable](#disable) - Disable a private endpoint * [Enable](#enable) - Enable a private endpoint +* [UpdateParameters](#updateparameters) - Set private endpoint supported parameters * [UpdatePricing](#updatepricing) - Set private endpoint pricing * [Validate](#validate) - Validate a draft private endpoint @@ -114,12 +115,12 @@ func main() { ### Parameters -| Parameter | Type | Required | Description | Example | -| ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `ctx` | [context.Context](https://pkg.go.dev/context#Context) | ✅ | The context to use for the request. | | -| `createPrivateEndpointRequest` | [components.CreatePrivateEndpointRequest](../../models/components/createprivateendpointrequest.mdx) | ✅ | N/A | | -| `idempotencyKey` | `*string` | ➖ | Retry-safe create: a repeated create with the same key from the same organization returns the endpoint the first request created instead of creating another. The endpoint is returned as it is now. Reusing a key with a different request body (model, provider, base URL, upstream model ID, declared ZDR or region, or pricing) is rejected with 422 `idempotency_key_reused`. `activate` is not compared, and later edits to the endpoint do not affect the comparison. | wayfair-gpt-4o-eastus-2026-09 | -| `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. | | +| `createPrivateEndpointRequest` | [components.CreatePrivateEndpointRequest](../../models/components/createprivateendpointrequest.mdx) | ✅ | N/A | | +| `idempotencyKey` | `*string` | ➖ | Retry-safe create: a repeated create with the same key from the same organization returns the endpoint the first request created instead of creating another. The endpoint is returned as it is now. Reusing a key with a different request body (model, provider, base URL, upstream model ID, declared ZDR or region, pricing, or declared parameters) is rejected with 422 `idempotency_key_reused`. Declared parameters are compared as a set, so a retry that reorders or repeats a name replays the endpoint. `activate` and `max_completion_tokens` are not compared, and later edits to the endpoint do not affect the comparison. | wayfair-gpt-4o-eastus-2026-09 | +| `opts` | [][operations.Option](../../models/operations/option.mdx) | ➖ | The options for this request. | | ### Response @@ -501,6 +502,73 @@ func main() { | sdkerrors.BadGatewayResponseError | 502 | application/json | | sdkerrors.APIError | 4XX, 5XX | \*/\* | +## UpdateParameters + +Declare which request parameters the upstream supports beyond the ones validation proved. Applies to drafts and active endpoints; routing picks the change up for subsequent requests. The body replaces the earlier declaration and is read as a set: order and repeated names do not matter, but the list holds at most as many entries as there are declarable parameters, repeats included. `tested_parameters` stay. Returns 400 `parameters_invalid` when `tool_choice` is declared without `tools` being tested or declared. [Management key](/docs/guides/overview/auth/management-api-keys) required. + +### Example Usage + +```go +package main + +import( + "context" + "os" + openrouter "github.com/OpenRouterTeam/go-sdk" + "github.com/OpenRouterTeam/go-sdk/models/components" + "log" +) + +func main() { + ctx := context.Background() + + s := openrouter.New( + openrouter.WithSecurity(os.Getenv("OPENROUTER_API_KEY")), + ) + + res, err := s.PrivateEndpoints.UpdateParameters(ctx, "5b1c4c4e-7d0a-4a8e-9f3a-2d6c1b0e8a11", components.UpdatePrivateEndpointParametersRequest{ + DeclaredParameters: []components.PrivateEndpointDeclaredParameter{ + components.PrivateEndpointDeclaredParameterTemperature, + components.PrivateEndpointDeclaredParameterSeed, + }, + }) + if err != nil { + log.Fatal(err) + } + if res != nil { + // handle response + } +} +``` + +### Parameters + +| Parameter | Type | Required | Description | Example | +| ---------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------- | +| `ctx` | [context.Context](https://pkg.go.dev/context#Context) | ✅ | The context to use for the request. | | +| `id` | `string` | ✅ | Stable identifier of the private endpoint. | 5b1c4c4e-7d0a-4a8e-9f3a-2d6c1b0e8a11 | +| `updatePrivateEndpointParametersRequest` | [components.UpdatePrivateEndpointParametersRequest](../../models/components/updateprivateendpointparametersrequest.mdx) | ✅ | N/A | | +| `opts` | [][operations.Option](../../models/operations/option.mdx) | ➖ | The options for this request. | | + +### Response + +**[*components.PrivateEndpointResponse](../../models/components/privateendpointresponse.mdx), error** + +### Errors + +| Error Type | Status Code | Content Type | +| ------------------------------------------ | ------------------------------------------ | ------------------------------------------ | +| sdkerrors.BadRequestResponseError | 400 | application/json | +| sdkerrors.UnauthorizedResponseError | 401 | application/json | +| sdkerrors.ForbiddenResponseError | 403 | application/json | +| sdkerrors.NotFoundResponseError | 404 | application/json | +| sdkerrors.RequestTimeoutResponseError | 408 | application/json | +| sdkerrors.ConflictResponseError | 409 | application/json | +| sdkerrors.UnprocessableEntityResponseError | 422 | application/json | +| sdkerrors.InternalServerResponseError | 500 | application/json | +| sdkerrors.BadGatewayResponseError | 502 | application/json | +| sdkerrors.APIError | 4XX, 5XX | \*/\* | + ## UpdatePricing Set the negotiated per-token rates reported for requests routed to this endpoint. Applies to drafts and active endpoints; new rates take effect for subsequent requests. The body replaces the whole pricing object: omitting `cache_read` or `cache_write` reverts that rate to the provider pricing strategy's default, even if it was set before. [Management key](/docs/guides/overview/auth/management-api-keys) required. diff --git a/example_test.go b/example_test.go index c3cde7cd..a7775c84 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.79 + // Output: 0.9.80 } // Example demonstrates basic usage of the OpenRouter SDK for chat completions. diff --git a/examples/README.md b/examples/README.md index 502be4a4..1100dfc4 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.79 +require github.com/OpenRouterTeam/go-sdk v0.9.80 ``` 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.79 +go get github.com/OpenRouterTeam/go-sdk@v0.9.80 go run . ``` diff --git a/models/components/createprivateendpointrequest.go b/models/components/createprivateendpointrequest.go index 28756049..13442ad6 100644 --- a/models/components/createprivateendpointrequest.go +++ b/models/components/createprivateendpointrequest.go @@ -36,10 +36,14 @@ type CreatePrivateEndpointRequest struct { Activate *PrivateEndpointActivation `json:"activate,omitzero"` // HTTPS base URL of your deployment. Required unless the provider derives its URL from the BYOK credential (Azure, Amazon Bedrock, Google Vertex). BaseURL *string `json:"base_url,omitzero"` + // Parameters the upstream supports beyond the tested ones. Replaces the earlier declaration; tested parameters stay. Order and repeated names are ignored, but the list holds at most as many entries as there are declarable parameters, repeats included. `tool_choice` requires `tools` to be tested or declared. + DeclaredParameters []PrivateEndpointDeclaredParameter `json:"declared_parameters,omitzero"` // Attest where this deployment processes data. DeclaredRegion optionalnullable.OptionalNullable[CreatePrivateEndpointRequestDeclaredRegion] `json:"declared_region,omitzero"` // Attest that this deployment retains no prompt or completion data. DeclaredZdr optionalnullable.OptionalNullable[bool] `json:"declared_zdr,omitzero"` + // Cap on completion tokens per request. Requests asking for more skip this endpoint, and the default output length stays within it. When omitted, the cap is copied from the public endpoint for the same model and provider, if there is one. + MaxCompletionTokens *int64 `json:"max_completion_tokens,omitzero"` // Permanent slug of the model this endpoint serves. ModelPermaslug string `json:"model_permaslug"` // Negotiated per-token rates reported for requests routed to this endpoint. @@ -75,6 +79,13 @@ func (c *CreatePrivateEndpointRequest) GetBaseURL() *string { return c.BaseURL } +func (c *CreatePrivateEndpointRequest) GetDeclaredParameters() []PrivateEndpointDeclaredParameter { + if c == nil { + return nil + } + return c.DeclaredParameters +} + func (c *CreatePrivateEndpointRequest) GetDeclaredRegion() optionalnullable.OptionalNullable[CreatePrivateEndpointRequestDeclaredRegion] { if c == nil { return nil @@ -89,6 +100,13 @@ func (c *CreatePrivateEndpointRequest) GetDeclaredZdr() optionalnullable.Optiona return c.DeclaredZdr } +func (c *CreatePrivateEndpointRequest) GetMaxCompletionTokens() *int64 { + if c == nil { + return nil + } + return c.MaxCompletionTokens +} + func (c *CreatePrivateEndpointRequest) GetModelPermaslug() string { if c == nil { return "" diff --git a/models/components/managedprivateendpoint.go b/models/components/managedprivateendpoint.go index 6e3ad4ce..a2f7cf5b 100644 --- a/models/components/managedprivateendpoint.go +++ b/models/components/managedprivateendpoint.go @@ -4,6 +4,7 @@ package components import ( "github.com/OpenRouterTeam/go-sdk/internal/utils" + "github.com/OpenRouterTeam/go-sdk/optionalnullable" ) type ManagedPrivateEndpoint struct { @@ -25,6 +26,8 @@ type ManagedPrivateEndpoint struct { DeclaredRegion *PrivateEndpointDeclaredRegion `json:"declared_region"` // Whether you attest this deployment retains no prompt or completion data. `null` means undeclared. DeclaredZdr *bool `json:"declared_zdr"` + // Most completion tokens a request routed to this endpoint can produce, or `null` when the endpoint sets no cap beyond the model context length. + MaxCompletionTokens optionalnullable.OptionalNullable[int64] `json:"max_completion_tokens,omitzero"` } func (m ManagedPrivateEndpoint) MarshalJSON() ([]byte, error) { @@ -100,3 +103,10 @@ func (m *ManagedPrivateEndpoint) GetDeclaredZdr() *bool { } return m.DeclaredZdr } + +func (m *ManagedPrivateEndpoint) GetMaxCompletionTokens() optionalnullable.OptionalNullable[int64] { + if m == nil { + return nil + } + return m.MaxCompletionTokens +} diff --git a/models/components/privateendpoint.go b/models/components/privateendpoint.go index 62816428..d0665acb 100644 --- a/models/components/privateendpoint.go +++ b/models/components/privateendpoint.go @@ -2,15 +2,23 @@ package components +import ( + "github.com/OpenRouterTeam/go-sdk/optionalnullable" +) + type PrivateEndpoint struct { // HTTPS base URL of your deployment, or `null` for providers whose URL is derived from the BYOK credential (Azure, Amazon Bedrock, Google Vertex). BaseURL *string `json:"base_url"` + // Parameters you declared the upstream supports. Requests that use a parameter only route to this endpoint when it is tested or declared. + DeclaredParameters []string `json:"declared_parameters"` // Where you attest this deployment processes data. `global` means not regional; `null` means undeclared. DeclaredRegion *PrivateEndpointDeclaredRegion `json:"declared_region"` // Whether you attest this deployment retains no prompt or completion data. `null` means undeclared. DeclaredZdr *bool `json:"declared_zdr"` // Stable identifier of the private endpoint. ID string `json:"id"` + // Most completion tokens a request routed to this endpoint can produce, or `null` when the endpoint sets no cap beyond the model context length. + MaxCompletionTokens optionalnullable.OptionalNullable[int64] `json:"max_completion_tokens,omitzero"` // Display name of the model, or `null` when the model is no longer listed. ModelName *string `json:"model_name"` // Permanent slug of the model this endpoint serves. @@ -25,6 +33,8 @@ type PrivateEndpoint struct { ProviderSlug *string `json:"provider_slug"` // Lifecycle state. `draft` endpoints are not routable until validated and activated; `disabled` endpoints are activated but temporarily not routable. Status PrivateEndpointStatus `json:"status"` + // Parameters a validation run proved the upstream honors (`tools`, `tool_choice`, `response_format`, `structured_outputs`, `stop`). Read-only; cleared when the upstream configuration changes. + TestedParameters []string `json:"tested_parameters"` // Model or deployment identifier sent to the upstream provider. UpstreamModelID string `json:"upstream_model_id"` } @@ -36,6 +46,13 @@ func (p *PrivateEndpoint) GetBaseURL() *string { return p.BaseURL } +func (p *PrivateEndpoint) GetDeclaredParameters() []string { + if p == nil { + return []string{} + } + return p.DeclaredParameters +} + func (p *PrivateEndpoint) GetDeclaredRegion() *PrivateEndpointDeclaredRegion { if p == nil { return nil @@ -57,6 +74,13 @@ func (p *PrivateEndpoint) GetID() string { return p.ID } +func (p *PrivateEndpoint) GetMaxCompletionTokens() optionalnullable.OptionalNullable[int64] { + if p == nil { + return nil + } + return p.MaxCompletionTokens +} + func (p *PrivateEndpoint) GetModelName() *string { if p == nil { return nil @@ -106,6 +130,13 @@ func (p *PrivateEndpoint) GetStatus() PrivateEndpointStatus { return p.Status } +func (p *PrivateEndpoint) GetTestedParameters() []string { + if p == nil { + return []string{} + } + return p.TestedParameters +} + func (p *PrivateEndpoint) GetUpstreamModelID() string { if p == nil { return "" diff --git a/models/components/privateendpointdeclaredparameter.go b/models/components/privateendpointdeclaredparameter.go new file mode 100644 index 00000000..4401fdea --- /dev/null +++ b/models/components/privateendpointdeclaredparameter.go @@ -0,0 +1,49 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +// PrivateEndpointDeclaredParameter - A chat request parameter the endpoint accepts. +type PrivateEndpointDeclaredParameter string + +const ( + PrivateEndpointDeclaredParameterTemperature PrivateEndpointDeclaredParameter = "temperature" + PrivateEndpointDeclaredParameterTopP PrivateEndpointDeclaredParameter = "top_p" + PrivateEndpointDeclaredParameterTopK PrivateEndpointDeclaredParameter = "top_k" + PrivateEndpointDeclaredParameterMinP PrivateEndpointDeclaredParameter = "min_p" + PrivateEndpointDeclaredParameterTopA PrivateEndpointDeclaredParameter = "top_a" + PrivateEndpointDeclaredParameterFrequencyPenalty PrivateEndpointDeclaredParameter = "frequency_penalty" + PrivateEndpointDeclaredParameterPresencePenalty PrivateEndpointDeclaredParameter = "presence_penalty" + PrivateEndpointDeclaredParameterRepetitionPenalty PrivateEndpointDeclaredParameter = "repetition_penalty" + PrivateEndpointDeclaredParameterMaxTokens PrivateEndpointDeclaredParameter = "max_tokens" + PrivateEndpointDeclaredParameterMaxCompletionTokens PrivateEndpointDeclaredParameter = "max_completion_tokens" + PrivateEndpointDeclaredParameterLogitBias PrivateEndpointDeclaredParameter = "logit_bias" + PrivateEndpointDeclaredParameterLogprobs PrivateEndpointDeclaredParameter = "logprobs" + PrivateEndpointDeclaredParameterTopLogprobs PrivateEndpointDeclaredParameter = "top_logprobs" + PrivateEndpointDeclaredParameterPrediction PrivateEndpointDeclaredParameter = "prediction" + PrivateEndpointDeclaredParameterSeed PrivateEndpointDeclaredParameter = "seed" + PrivateEndpointDeclaredParameterResponseFormat PrivateEndpointDeclaredParameter = "response_format" + PrivateEndpointDeclaredParameterStructuredOutputs PrivateEndpointDeclaredParameter = "structured_outputs" + PrivateEndpointDeclaredParameterStop PrivateEndpointDeclaredParameter = "stop" + PrivateEndpointDeclaredParameterTools PrivateEndpointDeclaredParameter = "tools" + PrivateEndpointDeclaredParameterToolChoice PrivateEndpointDeclaredParameter = "tool_choice" + PrivateEndpointDeclaredParameterParallelToolCalls PrivateEndpointDeclaredParameter = "parallel_tool_calls" + PrivateEndpointDeclaredParameterReasoning PrivateEndpointDeclaredParameter = "reasoning" + PrivateEndpointDeclaredParameterReasoningEffort PrivateEndpointDeclaredParameter = "reasoning_effort" + PrivateEndpointDeclaredParameterWebSearchOptions PrivateEndpointDeclaredParameter = "web_search_options" + PrivateEndpointDeclaredParameterVerbosity PrivateEndpointDeclaredParameter = "verbosity" +) + +func (e PrivateEndpointDeclaredParameter) ToPointer() *PrivateEndpointDeclaredParameter { + return &e +} + +// IsExact returns true if the value matches a known enum value, false otherwise. +func (e *PrivateEndpointDeclaredParameter) IsExact() bool { + if e != nil { + switch *e { + case "temperature", "top_p", "top_k", "min_p", "top_a", "frequency_penalty", "presence_penalty", "repetition_penalty", "max_tokens", "max_completion_tokens", "logit_bias", "logprobs", "top_logprobs", "prediction", "seed", "response_format", "structured_outputs", "stop", "tools", "tool_choice", "parallel_tool_calls", "reasoning", "reasoning_effort", "web_search_options", "verbosity": + return true + } + } + return false +} diff --git a/models/components/privateendpointparametercheck.go b/models/components/privateendpointparametercheck.go new file mode 100644 index 00000000..a57892f6 --- /dev/null +++ b/models/components/privateendpointparametercheck.go @@ -0,0 +1,37 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +import ( + "github.com/OpenRouterTeam/go-sdk/internal/utils" +) + +type PrivateEndpointParameterCheck struct { + Parameter string `json:"parameter"` + Supported bool `json:"supported"` +} + +func (p PrivateEndpointParameterCheck) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(p, "", false) +} + +func (p *PrivateEndpointParameterCheck) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &p, "", false, nil); err != nil { + return err + } + return nil +} + +func (p *PrivateEndpointParameterCheck) GetParameter() string { + if p == nil { + return "" + } + return p.Parameter +} + +func (p *PrivateEndpointParameterCheck) GetSupported() bool { + if p == nil { + return false + } + return p.Supported +} diff --git a/models/components/privateendpointvalidation.go b/models/components/privateendpointvalidation.go index 11f6d572..0ae2a959 100644 --- a/models/components/privateendpointvalidation.go +++ b/models/components/privateendpointvalidation.go @@ -2,12 +2,29 @@ package components +import ( + "github.com/OpenRouterTeam/go-sdk/internal/utils" +) + type PrivateEndpointValidation struct { Checks []PrivateEndpointCheck `json:"checks"` + // Request parameters probed after the checks passed, each with whether the upstream honored it. Supported ones are recorded in `tested_parameters`. Absent on a failed run and for providers that run no parameter probes; empty when every probe group was already proven. + Parameters []PrivateEndpointParameterCheck `json:"parameters,omitzero"` // Whether every check passed. Passed bool `json:"passed"` } +func (p PrivateEndpointValidation) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(p, "", false) +} + +func (p *PrivateEndpointValidation) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &p, "", false, nil); err != nil { + return err + } + return nil +} + func (p *PrivateEndpointValidation) GetChecks() []PrivateEndpointCheck { if p == nil { return []PrivateEndpointCheck{} @@ -15,6 +32,13 @@ func (p *PrivateEndpointValidation) GetChecks() []PrivateEndpointCheck { return p.Checks } +func (p *PrivateEndpointValidation) GetParameters() []PrivateEndpointParameterCheck { + if p == nil { + return nil + } + return p.Parameters +} + func (p *PrivateEndpointValidation) GetPassed() bool { if p == nil { return false diff --git a/models/components/privateendpointvalidationnullable.go b/models/components/privateendpointvalidationnullable.go index 9bb24447..7210c06d 100644 --- a/models/components/privateendpointvalidationnullable.go +++ b/models/components/privateendpointvalidationnullable.go @@ -8,6 +8,8 @@ import ( type PrivateEndpointValidationNullable struct { Checks []PrivateEndpointCheck `json:"checks"` + // Request parameters probed after the checks passed, each with whether the upstream honored it. Supported ones are recorded in `tested_parameters`. Absent on a failed run and for providers that run no parameter probes; empty when every probe group was already proven. + Parameters []PrivateEndpointParameterCheck `json:"parameters,omitzero"` // Whether every check passed. Passed bool `json:"passed"` } @@ -30,6 +32,13 @@ func (p *PrivateEndpointValidationNullable) GetChecks() []PrivateEndpointCheck { return p.Checks } +func (p *PrivateEndpointValidationNullable) GetParameters() []PrivateEndpointParameterCheck { + if p == nil { + return nil + } + return p.Parameters +} + func (p *PrivateEndpointValidationNullable) GetPassed() bool { if p == nil { return false diff --git a/models/components/updateprivateendpointparametersrequest.go b/models/components/updateprivateendpointparametersrequest.go new file mode 100644 index 00000000..3ffffe41 --- /dev/null +++ b/models/components/updateprivateendpointparametersrequest.go @@ -0,0 +1,15 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +type UpdatePrivateEndpointParametersRequest struct { + // Parameters the upstream supports beyond the tested ones. Replaces the earlier declaration; tested parameters stay. Order and repeated names are ignored, but the list holds at most as many entries as there are declarable parameters, repeats included. `tool_choice` requires `tools` to be tested or declared. + DeclaredParameters []PrivateEndpointDeclaredParameter `json:"declared_parameters"` +} + +func (u *UpdatePrivateEndpointParametersRequest) GetDeclaredParameters() []PrivateEndpointDeclaredParameter { + if u == nil { + return []PrivateEndpointDeclaredParameter{} + } + return u.DeclaredParameters +} diff --git a/models/operations/createprivateendpoint.go b/models/operations/createprivateendpoint.go index 1f238da4..053911d9 100644 --- a/models/operations/createprivateendpoint.go +++ b/models/operations/createprivateendpoint.go @@ -7,7 +7,7 @@ import ( ) type CreatePrivateEndpointRequest struct { - // Retry-safe create: a repeated create with the same key from the same organization returns the endpoint the first request created instead of creating another. The endpoint is returned as it is now. Reusing a key with a different request body (model, provider, base URL, upstream model ID, declared ZDR or region, or pricing) is rejected with 422 `idempotency_key_reused`. `activate` is not compared, and later edits to the endpoint do not affect the comparison. + // Retry-safe create: a repeated create with the same key from the same organization returns the endpoint the first request created instead of creating another. The endpoint is returned as it is now. Reusing a key with a different request body (model, provider, base URL, upstream model ID, declared ZDR or region, pricing, or declared parameters) is rejected with 422 `idempotency_key_reused`. Declared parameters are compared as a set, so a retry that reorders or repeats a name replays the endpoint. `activate` and `max_completion_tokens` are not compared, and later edits to the endpoint do not affect the comparison. IdempotencyKey *string `header:"style=simple,explode=false,name=idempotency-key"` CreatePrivateEndpointRequest components.CreatePrivateEndpointRequest `request:"mediaType=application/json"` } diff --git a/models/operations/updateprivateendpointparameters.go b/models/operations/updateprivateendpointparameters.go new file mode 100644 index 00000000..aa565930 --- /dev/null +++ b/models/operations/updateprivateendpointparameters.go @@ -0,0 +1,27 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package operations + +import ( + "github.com/OpenRouterTeam/go-sdk/models/components" +) + +type UpdatePrivateEndpointParametersRequest struct { + // Stable identifier of the private endpoint. + ID string `pathParam:"style=simple,explode=false,name=id"` + UpdatePrivateEndpointParametersRequest components.UpdatePrivateEndpointParametersRequest `request:"mediaType=application/json"` +} + +func (u *UpdatePrivateEndpointParametersRequest) GetID() string { + if u == nil { + return "" + } + return u.ID +} + +func (u *UpdatePrivateEndpointParametersRequest) GetUpdatePrivateEndpointParametersRequest() components.UpdatePrivateEndpointParametersRequest { + if u == nil { + return components.UpdatePrivateEndpointParametersRequest{} + } + return u.UpdatePrivateEndpointParametersRequest +} diff --git a/openrouter.go b/openrouter.go index 1106304d..256f746d 100644 --- a/openrouter.go +++ b/openrouter.go @@ -217,9 +217,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.9.79", + SDKVersion: "0.9.80", sdkConfiguration: config.SDKConfiguration{ - UserAgent: "speakeasy-sdk/go 0.9.79 2.914.0 1.0.0 github.com/OpenRouterTeam/go-sdk", + UserAgent: "speakeasy-sdk/go 0.9.80 2.914.0 1.0.0 github.com/OpenRouterTeam/go-sdk", Globals: globals.Globals{}, ServerList: ServerList, }, diff --git a/privateendpoints.go b/privateendpoints.go index 73887ed9..e6dad3b1 100644 --- a/privateendpoints.go +++ b/privateendpoints.go @@ -3046,6 +3046,412 @@ func (s *PrivateEndpoints) Enable(ctx context.Context, id string, opts ...operat } +// UpdateParameters - Set private endpoint supported parameters +// Declare which request parameters the upstream supports beyond the ones validation proved. Applies to drafts and active endpoints; routing picks the change up for subsequent requests. The body replaces the earlier declaration and is read as a set: order and repeated names do not matter, but the list holds at most as many entries as there are declarable parameters, repeats included. `tested_parameters` stay. Returns 400 `parameters_invalid` when `tool_choice` is declared without `tools` being tested or declared. [Management key](/docs/guides/overview/auth/management-api-keys) required. +func (s *PrivateEndpoints) UpdateParameters(ctx context.Context, id string, updatePrivateEndpointParametersRequest components.UpdatePrivateEndpointParametersRequest, opts ...operations.Option) (*components.PrivateEndpointResponse, error) { + request := operations.UpdatePrivateEndpointParametersRequest{ + ID: id, + UpdatePrivateEndpointParametersRequest: updatePrivateEndpointParametersRequest, + } + + o := operations.Options{} + supportedOptions := []string{ + operations.SupportedOptionRetries, + operations.SupportedOptionTimeout, + } + + for _, opt := range opts { + if err := opt(&o, supportedOptions...); err != nil { + return nil, fmt.Errorf("error applying option: %w", err) + } + } + + var baseURL string + if o.ServerURL == nil { + baseURL = utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + } else { + baseURL = *o.ServerURL + } + opURL, err := utils.GenerateURL(ctx, baseURL, "/private-endpoints/{id}/parameters", request, nil) + if err != nil { + return nil, fmt.Errorf("error generating URL: %w", err) + } + + hookCtx := hooks.HookContext{ + SDK: s.rootSDK, + SDKConfiguration: s.sdkConfiguration, + BaseURL: baseURL, + Context: ctx, + OperationID: "updatePrivateEndpointParameters", + OAuth2Scopes: nil, + SecuritySource: s.sdkConfiguration.Security, + } + bodyReader, reqContentType, err := utils.SerializeRequestBody(ctx, request, false, false, "UpdatePrivateEndpointParametersRequest", "json", `request:"mediaType=application/json"`) + if err != nil { + return nil, err + } + + timeout := o.Timeout + if timeout == nil { + timeout = s.sdkConfiguration.Timeout + } + + if timeout != nil { + var cancel context.CancelFunc + ctx, cancel = context.WithTimeout(ctx, *timeout) + defer cancel() + } + + req, err := http.NewRequestWithContext(ctx, "PUT", opURL, bodyReader) + if err != nil { + return nil, fmt.Errorf("error creating request: %w", err) + } + req.Header.Set("Accept", "application/json") + req.Header.Set("User-Agent", s.sdkConfiguration.UserAgent) + if reqContentType != "" { + req.Header.Set("Content-Type", reqContentType) + } + + if err := utils.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil { + return nil, err + } + + for k, v := range o.SetHeaders { + req.Header.Set(k, v) + } + + globalRetryConfig := s.sdkConfiguration.RetryConfig + retryConfig := o.Retries + if retryConfig == nil { + if globalRetryConfig != nil { + retryConfig = globalRetryConfig + } else { + retryConfig = &retry.Config{ + Strategy: "backoff", Backoff: &retry.BackoffStrategy{ + InitialInterval: 500, + MaxInterval: 60000, + Exponent: 1.5, + MaxElapsedTime: 3600000, + }, + RetryConnectionErrors: true, + } + } + } + + var httpRes *http.Response + if retryConfig != nil { + httpRes, err = utils.Retry(ctx, utils.Retries{ + Config: retryConfig, + StatusCodes: []string{ + "5XX", + }, + }, func() (*http.Response, error) { + if req.Body != nil && req.Body != http.NoBody && req.GetBody != nil { + copyBody, err := req.GetBody() + + if err != nil { + return nil, err + } + + req.Body = copyBody + } + + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + if retry.IsPermanentError(err) || retry.IsTemporaryError(err) { + return nil, err + } + + return nil, retry.Permanent(err) + } + + httpRes, err := s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + } + return httpRes, err + }) + + if err != nil { + return nil, err + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } else { + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, err + } + + httpRes, err = s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + return nil, err + } else if utils.MatchStatusCodes([]string{"4XX", "5XX"}, httpRes.StatusCode) { + _httpRes, err := s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) + if err != nil { + return nil, err + } else if _httpRes != nil { + httpRes = _httpRes + } + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } + + switch { + case httpRes.StatusCode == 200: + switch { + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + + var out components.PrivateEndpointResponse + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + + return &out, nil + 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 == 400: + 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.BadRequestResponseError + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, 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 == 401: + 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.UnauthorizedResponseError + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, 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, 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 == 404: + 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.NotFoundResponseError + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, 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 == 408: + 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.RequestTimeoutResponseError + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, 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 == 409: + 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.ConflictResponseError + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, 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 == 422: + 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.UnprocessableEntityResponseError + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, 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 == 500: + 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.InternalServerResponseError + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, 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 == 502: + 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.BadGatewayResponseError + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, 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 >= 400 && httpRes.StatusCode < 500: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewAPIError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewAPIError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewAPIError("unknown status code returned", httpRes.StatusCode, string(rawBody), httpRes) + } + + return nil, nil + +} + // UpdatePricing - Set private endpoint pricing // Set the negotiated per-token rates reported for requests routed to this endpoint. Applies to drafts and active endpoints; new rates take effect for subsequent requests. The body replaces the whole pricing object: omitting `cache_read` or `cache_write` reverts that rate to the provider pricing strategy's default, even if it was set before. [Management key](/docs/guides/overview/auth/management-api-keys) required. func (s *PrivateEndpoints) UpdatePricing(ctx context.Context, id string, updatePrivateEndpointPricingRequest components.UpdatePrivateEndpointPricingRequest, opts ...operations.Option) (*components.PrivateEndpointResponse, error) {