diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index 8f01e56e..92f5ba5b 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -2,7 +2,7 @@ // README at: https://github.com/devcontainers/templates/tree/main/src/go { "name": "Go", - "image": "mcr.microsoft.com/devcontainers/go:1-1.25-bookworm", + "image": "mcr.microsoft.com/devcontainers/go:1-1.22-bullseye", // Features to add to the dev container. More info: https://containers.dev/features. // "features": {}, // Use 'forwardPorts' to make a list of ports inside the container available locally. diff --git a/.speakeasy/gen.lock b/.speakeasy/gen.lock index e4d7d45e..d7eb849f 100644 --- a/.speakeasy/gen.lock +++ b/.speakeasy/gen.lock @@ -1,25 +1,25 @@ lockVersion: 2.0.0 id: 9eea3e30-2722-4060-973b-57b7f1f75dc0 management: - docChecksum: 1e0c98a314677bc490998bdd8faf5b74 + docChecksum: 5ebf82172adb3cf59d6f6843c84378c9 docVersion: 1.0.0 - speakeasyVersion: 1.778.0 - generationVersion: 2.904.2 - releaseVersion: 0.5.0 - configChecksum: a8cd011d0fa84720f7c3504347addacc + speakeasyVersion: 1.761.1 + generationVersion: 2.879.6 + releaseVersion: 0.5.1 + configChecksum: 14dd75ad1e2e171da015ceee46f4f78d repoURL: https://github.com/OpenRouterTeam/go-sdk.git installationURL: https://github.com/OpenRouterTeam/go-sdk persistentEdits: - generation_id: 3f918785-6594-4da0-a699-a5dfef68cbd8 - pristine_commit_hash: 9864e3f0078cf81094ccebf5be4ff47dbe33f888 - pristine_tree_hash: 6cbe3f4d063e6fcbc8113e649924ac0a639b1e2b + generation_id: 8695a653-dd72-4913-ab13-1f3729923540 + pristine_commit_hash: 8a6a210ab7517adc4b8c9e27b289c50d25ab783a + pristine_tree_hash: 83c62f0a95e2ae052986968acb1b226c94654e76 features: go: acceptHeaders: 2.81.2 additionalDependencies: 0.1.0 additionalProperties: 0.1.2 constsAndDefaults: 0.1.14 - core: 3.13.46 + core: 3.13.40 defaultEnabledRetries: 0.2.0 deprecations: 2.81.3 devContainers: 2.90.0 @@ -39,14 +39,14 @@ features: nameOverrides: 2.81.4 nullables: 0.2.1 openEnums: 0.1.0 - pagination: 2.82.7 + pagination: 2.82.6 responseFormat: 0.1.2 retries: 2.84.2 sdkHooks: 0.3.0 - serverEvents: 0.1.9 + serverEvents: 0.1.7 serverEventsSentinels: 0.1.0 serverIDs: 2.81.1 - unions: 2.87.7 + unions: 2.87.6 uploadStreams: 0.1.0 trackedFiles: .devcontainer/README.md: @@ -55,8 +55,8 @@ trackedFiles: pristine_git_object: d910019d1e5caf9d9b00616bfd36adcf508ff5ab .devcontainer/devcontainer.json: id: b34062a34eb1 - last_write_checksum: sha1:00c39389eee01217e51057762bde7339d9e56114 - pristine_git_object: 8f01e56e2f8476fb2a7c79ec6326b3b0d5be8123 + last_write_checksum: sha1:a518b2fc2f92e998593a1dcb935db4ca1eb2e2f1 + pristine_git_object: 92f5ba5b54156225322fb4b09d2acf4abde9abc9 .devcontainer/setup.sh: id: 5f1dfbfeb8eb last_write_checksum: sha1:0443cc8beac352499afd25be90adf28d3736dbe0 @@ -71,36 +71,44 @@ trackedFiles: pristine_git_object: b5feedda6fc44f2f262a6355f91a7901023aaccb analytics.go: id: c71afdf2c49d - last_write_checksum: sha1:f9a7a59244b2189cba7845b1a53a673e2c7540f6 - pristine_git_object: 57da7c77186fbbf55dd87ae8acabcab09ae9cc5e + last_write_checksum: sha1:651ff7a592c338d32d01abe59b31ccf8be5e356a + pristine_git_object: 7f93a20ad266f7e186a2b9ca111374f817ccf2b8 apikeys.go: id: 8baafe5dc76e - last_write_checksum: sha1:2870a7e8e98b3455e8196fc7040d9cefa79d52fe - pristine_git_object: 8195bc8c518389e0932bc2d3a2edaffb7e036a39 + last_write_checksum: sha1:d6951c59eb7c36dbed41840b5fe0ce617d468335 + pristine_git_object: b8731fd19a748fc9b7700491a2b3141459b35519 + benchmarks.go: + id: 645ff3c22b39 + last_write_checksum: sha1:89687194d4ce1211cf8e1ef5140da30d897abaa8 + pristine_git_object: 1d187ee1cfe78e6790aa41c2af0b1d103dbb13f7 beta.go: id: 812d10ba6460 last_write_checksum: sha1:29a9869fb709d85d44a7e6b4042a99519ca12c51 pristine_git_object: cb62d236fdbe9bcc88c2a32038292fe082c4c75d betaanalytics.go: id: 310965b88eac - last_write_checksum: sha1:32edeb7d8708727f9fe9b4e5943a0e14f3dde342 - pristine_git_object: c48c63a64ae8e6b213e79503e08b7610fc017b4d + last_write_checksum: sha1:c36f48778a4db902d04444c3511e3cfece3d46fb + pristine_git_object: 4129c627b02d60bfab44fc7d22ec3d43b464d04d byok.go: id: 020bd36a4af9 - last_write_checksum: sha1:c5e242244e6ac68444caf8f4f264c83be4b55a6e - pristine_git_object: 9870c83f62d4cea61004cf65f25443581751c29d + last_write_checksum: sha1:5612fe1ba2321e5318c876d2af7708c65e4cdaed + pristine_git_object: dafdcbfc8b78282856e21075d07dce46cb5f5ac5 chat.go: id: 81535ccb3ff5 - last_write_checksum: sha1:3fe05c99a2a3f927bac689dc6dd9f0e6c51bc7b3 - pristine_git_object: fedc9b46b5d2a7a4fc521b1af68b563cf4e116d8 + last_write_checksum: sha1:2fc6ca7b5f354eec1e27ca937b6b06dadb590b5f + pristine_git_object: c5e984b9b1effd3984fe71d35510d1a0d82b240d + classifications.go: + id: 711367120ab6 + last_write_checksum: sha1:584fa0198bc24af93049650e6ebb36e7635bf833 + pristine_git_object: 3bd4e424e6ebd673c2f6724ea0836671874efb8c credits.go: id: d01cfe328cc3 - last_write_checksum: sha1:05f6c501b571df83b665e2272a621e502d1e252a - pristine_git_object: cf99d6c57d7afe7c115e688f51ebcf9622abfedf + last_write_checksum: sha1:2fdab75dc2594b3032df151c741adecc61d94a25 + pristine_git_object: 7d475479a46330287ef2ef3f7673cc14f70c1b7e datasets.go: id: 12a7fa09afbc - last_write_checksum: sha1:6aa5253a92c477768f7a5de3bfcc011747493d08 - pristine_git_object: bc4993002ea7a1aa0f336836dcce7003130f96f7 + last_write_checksum: sha1:4eab898e1d4bf2e55b9699f6f9bff5606977a689 + pristine_git_object: 81a193528d256c9b7bad02c70c6a4fd26c2c1336 docs/models/components/aabenchmarkentry.md: id: 01bb0baed40d last_write_checksum: sha1:9bec3fc00cf1e5b5f3d1ff38c22e8e4a9a0f0512 @@ -143,8 +151,8 @@ trackedFiles: pristine_git_object: e8de8b91f9ec4a1d99b85e4d4efa376adbdd7f28 docs/models/components/advisorreasoningeffort.md: id: 61fb865e86e6 - last_write_checksum: sha1:34e357e6d819787ce5b13ee88fdb50c46363e4e4 - pristine_git_object: 0cae415c9615a03d838ff6d00c8520060649a102 + last_write_checksum: sha1:9bfc4d18d7d8316ceb424a63be96a27d0d0a0384 + pristine_git_object: 5a552288dc33ed43701628a8f73f4db7ae6c2c4e docs/models/components/advisorservertoolconfig.md: id: b2f7eb5b468e last_write_checksum: sha1:8d60cfa727c770dec3b3b2c218e39f7e87d7fa47 @@ -177,6 +185,14 @@ trackedFiles: id: 7347b170b520 last_write_checksum: sha1:45109203d2e09e0a033ab47bca5d123b3ab9d9af pristine_git_object: bdd358a83a17ebd8b25cf39adc6b121cb390a885 + docs/models/components/anthropicadvisormessageusageiteration.md: + id: c666566f24d6 + last_write_checksum: sha1:9e0d57c7ba681ebafe73bc312ddb0c7a89fc0f4a + pristine_git_object: b8878a9b3de65e1285854b5fb9daf6d33f4e4f4e + docs/models/components/anthropicadvisormessageusageiterationtype.md: + id: 7a47e3e128db + last_write_checksum: sha1:6907ec68989771f4357bd6597df914dc25f040ff + pristine_git_object: e13f14e2d9f4d9616022fe7daa76f9f769a3f4fa docs/models/components/anthropicallowedcallers.md: id: 0bb3131598a7 last_write_checksum: sha1:57f392d2a607094485936e6f21e0a0c83a977ba3 @@ -253,6 +269,14 @@ trackedFiles: id: d0d4068db256 last_write_checksum: sha1:037db5d9c2cc739d1639265aa80211c1754138a3 pristine_git_object: d40fcdd73bccca1915e306372ea0c5e33bbd8e4d + docs/models/components/anthropiccompactionusageiteration.md: + id: d71b08290935 + last_write_checksum: sha1:f7037784f334f762dc23c6547bf4b9e6041ad41e + pristine_git_object: 1d5d9f77ade8a2e70ad79dc22c48c6fa01f37228 + docs/models/components/anthropiccompactionusageiterationtype.md: + id: d0a74b1b5d0a + last_write_checksum: sha1:1f1eb7f16304c551e1c427cd7167d6f5775ba1e0 + pristine_git_object: 4169954f6c77f972a850dfc0956dfaa1a0993243 docs/models/components/anthropicdocumentblockparam.md: id: 9f3bc7099381 last_write_checksum: sha1:13952476c0fac694718f40cfbaa4232fdcf4c44c @@ -271,8 +295,16 @@ trackedFiles: pristine_git_object: 2e8fe28bf56379cca59104ea51314c5bfd329f6e docs/models/components/anthropicdocumentblockparamsourceunion.md: id: 6b3e324ab5f9 - last_write_checksum: sha1:bff6146d6da910166a98f7f2aefd727bff080d0a - pristine_git_object: 2dd305a9deb7830f9a6ce628355eef1ad50892f5 + last_write_checksum: sha1:55498a02b1060f624becef756b4ff5ee9b477e61 + pristine_git_object: 8b909265a59889ea583939807779c057d0eaf3f0 + docs/models/components/anthropicfiledocumentsource.md: + id: 171f3869829b + last_write_checksum: sha1:daca446b5258343b93d5f6e1c947bdd8e1844c86 + pristine_git_object: c26d674dd57d48675f5e4430172d567865419849 + docs/models/components/anthropicfiledocumentsourcetype.md: + id: 6bf13e084962 + last_write_checksum: sha1:a5260c2f1b8bc16c5da6d1bd1107c7cda79d7a48 + pristine_git_object: 7fdc220dcc1637704ee5038ab5604692e9018380 docs/models/components/anthropicimageblockparam.md: id: f373072020b7 last_write_checksum: sha1:39a9426f29bb56c22f9afee2cf63600b6fa291e5 @@ -305,6 +337,18 @@ trackedFiles: id: d0b23493c6bb last_write_checksum: sha1:346b6531a452114d150894c4f1024a69712c9d17 pristine_git_object: 865594ce70767168c7602c1ece01d09ade70ac19 + docs/models/components/anthropiciterationcachecreation.md: + id: a354b32b01b4 + last_write_checksum: sha1:96dd092d3fc5aa2f745726b1e6c6a00f38598a5d + pristine_git_object: 18c003113b70a1c47a89f5624ba688046dde3646 + docs/models/components/anthropicmessageusageiteration.md: + id: 8d9633f5c618 + last_write_checksum: sha1:e2b8d9231a19a5112c13e5a863bbd30372ff4677 + pristine_git_object: cad82967baa9862acfe2e099fd198c8520d5fc4b + docs/models/components/anthropicmessageusageiterationtype.md: + id: e5220fd63836 + last_write_checksum: sha1:8fae7c4a73bc86a280241b03640a5db92cdb30fa + pristine_git_object: 85a65a112d1b536a065a80fc91036a5be2f67afa docs/models/components/anthropicplaintextsource.md: id: 23dc3bba31d4 last_write_checksum: sha1:061a7c72dc6c53b146440bcec88bca6e80fd05fa @@ -329,6 +373,10 @@ trackedFiles: id: 578a3e4a6d3e last_write_checksum: sha1:0ac3609b0069a909fa20afde322a50f4270d13e1 pristine_git_object: d781d5e49fe4854351343902b25e71187bba66d8 + docs/models/components/anthropicspeed.md: + id: 25616823eca8 + last_write_checksum: sha1:93008d34ce41ba1f5615507c39b92eb3e0eb2198 + pristine_git_object: da8224fa7fd18180d9e765497e49caa4c142b2b5 docs/models/components/anthropictextblockparam.md: id: a32e18ed517f last_write_checksum: sha1:e90806eedb6e8358e57d25968636049e74e4a44b @@ -365,6 +413,10 @@ trackedFiles: id: 9a6226a00218 last_write_checksum: sha1:c0163bb2362171335f66d00c4f066aa76bead2a8 pristine_git_object: 6c8f0880ba36629874cca2e5632d4b180cb0c18a + docs/models/components/anthropicunknownusageiteration.md: + id: 6b96385f3e09 + last_write_checksum: sha1:491bb4817ba0a089f68c9a71b66742e69971447c + pristine_git_object: eec8af3a7d3deb19c52e49def6e4f6e88982e443 docs/models/components/anthropicurlimagesource.md: id: 95782b4ed14b last_write_checksum: sha1:fcc484e5d109c4a26c503f4685b396821d78799b @@ -381,6 +433,10 @@ trackedFiles: id: cc8578ecabb7 last_write_checksum: sha1:fc5754d81c7c96da092c18d108def077c14111af pristine_git_object: 118c27f4b4f1c06efa441ff4b23748b8c21897bf + docs/models/components/anthropicusageiteration.md: + id: 310bddb2dc31 + last_write_checksum: sha1:610651bd99eb3f4c2f125bf220469440590d5c12 + pristine_git_object: 57a296ae0d24735ce8f6c9640e4dafa4d9cb1bdb docs/models/components/anthropicwebsearchresultblockparam.md: id: 848b75b92265 last_write_checksum: sha1:19e0f33942848d0d0b88ad9d5fb0e0509e31878b @@ -397,6 +453,10 @@ trackedFiles: id: ba81be14c816 last_write_checksum: sha1:91d1dbded6d88090281ca609a0da5a8ff0fd13f1 pristine_git_object: 52d72b60e0f48490e1db1635d11f226402387a64 + docs/models/components/apierrortype.md: + id: 57d204b4fba0 + last_write_checksum: sha1:22745825a2d2611a2649776fd64b44ef5a65cb71 + pristine_git_object: e7942385ffd29c2437fe87a2be77dddf557542a6 docs/models/components/apitype.md: id: 94f0b55d89ac last_write_checksum: sha1:1c43f7816e1394477a1c577845ef52a3fca2a1e1 @@ -505,10 +565,6 @@ trackedFiles: id: b6ccbdf25ac0 last_write_checksum: sha1:eeb8bd60b95b7d8c0fc545cffa7a2a1f3a2bd1da pristine_git_object: c841d6a56d3c69ac2d190806f83683b975eeb0b6 - docs/models/components/aspectratio.md: - id: ca4fc75a0469 - last_write_checksum: sha1:057bb1e8af46222465784074f09df07930524929 - pristine_git_object: 30c0b981ad04925d22e478487f2490fd6c16d569 docs/models/components/audiourl.md: id: 4677aec8cc1f last_write_checksum: sha1:761a8eef504897f8413af92217f3664ae8482425 @@ -521,10 +577,6 @@ trackedFiles: id: bc8b88478abc last_write_checksum: sha1:0c57d727433e8b437a72ed0bb26ab141eb809038 pristine_git_object: 9f4e8ebbe1d2aa598564ff376c1b93d8bff33a9d - docs/models/components/background.md: - id: 6fba38110480 - last_write_checksum: sha1:d56b8027a2ec2be173fe5491539c342f85080faa - pristine_git_object: 9224138a62a233a2183441b1c303a64e3e4d8949 docs/models/components/badgatewayresponseerrordata.md: id: c797f7d88dd8 last_write_checksum: sha1:c026ac4809bc2f62e3953934c3e739a22d4157d5 @@ -613,58 +665,18 @@ trackedFiles: id: a431f828244c last_write_checksum: sha1:36049ba8dcace63b19515379a0277692aa6e6a14 pristine_git_object: 7d76c9d0728f3aed82d990ed2eb7ed7ee566e6df - docs/models/components/benchmarkpricing.md: - id: 07b6e0719150 - last_write_checksum: sha1:4320a9c3f9a919423e8c73aad2e6255bda56c30f - pristine_git_object: 3c0d7726ffbab168caf2146c1ff3522e4e44444a - docs/models/components/benchmarksaaitem.md: - id: 5aa6dd44d76b - last_write_checksum: sha1:81b495760536ca493d920f2a9e1149d825b61dcc - pristine_git_object: cfb5382ee846fe53c4d32b3aa91ab15c5df768aa - docs/models/components/benchmarksaameta.md: - id: 0071e8a308ac - last_write_checksum: sha1:22beb109e823eef2f5fd8f4b4f7cff5ef6509561 - pristine_git_object: ae084a5efa1b84d797d2cc28a1f8eea309367dbe - docs/models/components/benchmarksaametasource.md: - id: de9f9b852614 - last_write_checksum: sha1:5fb42813dd4059003bef97df330bdb93e0e90c79 - pristine_git_object: 1fff3fd871ce443e804e6aa0bbb0bd69060ad675 - docs/models/components/benchmarksaametasourceurl.md: - id: 0d289e541257 - last_write_checksum: sha1:c42418e12a9f9eb7b5e13ef9da34b3d881e5c14d - pristine_git_object: 71b7fa02e7f9383ebd461ee4d028913e0ac571df - docs/models/components/benchmarksaametaversion.md: - id: a83ca5df2ca3 - last_write_checksum: sha1:c92b5f1a43fca4ee0abfdc0e281f1ab31a663dd3 - pristine_git_object: d4aaaa1128698afc54f104f371ad81a19ee62405 - docs/models/components/benchmarksaaresponse.md: - id: a37381912ee2 - last_write_checksum: sha1:c09766ecf1514007365d93fbe8304e37f29d4f55 - pristine_git_object: 3961f84ab1d8877cf74faa70863021a5d2cfa1b0 - docs/models/components/benchmarksdaitem.md: - id: dac7dbfccdce - last_write_checksum: sha1:405623f1f9dacae1d9e60c8db722390c7bae0698 - pristine_git_object: 66322fb0a8cb39e58a38285a220d8e1afb015b44 - docs/models/components/benchmarksdameta.md: - id: d754004ac0d7 - last_write_checksum: sha1:fe53d73b9fdd61a7f0e0150b1d9fb8ec6e55d264 - pristine_git_object: b8ba42095d6aa33ea29564a57588df5c99436871 - docs/models/components/benchmarksdametasource.md: - id: 635cddd0531d - last_write_checksum: sha1:7586cf47e59825c714a0fffff7f06c4ead6e2dd6 - pristine_git_object: d6109f39cf52b781aad1138f19abf5888ff14e3c - docs/models/components/benchmarksdametasourceurl.md: - id: 6265b8698fc8 - last_write_checksum: sha1:0e5bc3198fdd99028abdf771be0626452dd1be11 - pristine_git_object: 3eae2e010129978671cf0bdd9b4e76e040f6fdfc - docs/models/components/benchmarksdametaversion.md: - id: 1d8487884b73 - last_write_checksum: sha1:fa290b18b973e93951542a84136efe04c7044b32 - pristine_git_object: db84f1ddab7fc85de302927426e6badbc3756bb8 - docs/models/components/benchmarksdaresponse.md: - id: 24f0adb961d5 - last_write_checksum: sha1:8ee50cef458fdb0326168ccf86b0c5125dc019ad - pristine_git_object: e67e6a75c0af4b5c9e07d2aefa1fef5ba1573110 + docs/models/components/billable.md: + id: 50f2c39876ce + last_write_checksum: sha1:75e5d67e8b3e764c7da9a23cb24682542ecf47c5 + pristine_git_object: 74559d4afbd7ca578d499ba2c250ec9ab68a795b + docs/models/components/booleancapability.md: + id: a3e69cb006ba + last_write_checksum: sha1:e9d53514a14236813475cd8c05676b689070ade9 + pristine_git_object: 5a43167f98eeffd3fd5f6c2cd16bf8a9a94f94d0 + docs/models/components/booleancapabilitytype.md: + id: 89fca6a0c54a + last_write_checksum: sha1:a9859f19c652a80ccc1fb44e4eda5a903521b80b + pristine_git_object: ed377d9afaf270d3dab398536b997cb40387b081 docs/models/components/bulkaddworkspacemembersrequest.md: id: 51fecdefb722 last_write_checksum: sha1:40ef359d1c1aafb34d8a201852ecc492b7325983 @@ -719,16 +731,20 @@ trackedFiles: pristine_git_object: 51bd660c1550adf7bc9f0a83d05615693009d103 docs/models/components/byokkey.md: id: 1e9201eecc79 - last_write_checksum: sha1:464c7c8e24fad8da2ccff011ac70bdcb1cdcf5e7 - pristine_git_object: aac5e0943b1e68102839c5f659bc0b84ec6342bc + last_write_checksum: sha1:f32fd5394937f0340bfb626e6d5a1370694b10f1 + pristine_git_object: 77e6b19b98d4092fd8176268d8cd43136fbb1c57 docs/models/components/byokproviderslug.md: id: c48bc2b1aea9 - last_write_checksum: sha1:538ebe4f8aab194d4373b655da2a997e78d9fb69 - pristine_git_object: bf7e9bd650a432cc84401bee6ad4b5c53fdec546 + last_write_checksum: sha1:a7284bab8713922e24f0ddea09d1f5b6bee6010b + pristine_git_object: dc4ca43206e572c70fb2bfbe49b50aefa4816a67 docs/models/components/caching.md: id: 3dca35b50179 last_write_checksum: sha1:d2c9ed89d9ab7168111f90a92bbe549780424f82 pristine_git_object: 006345aef5292122d05aba96b942a5d953d80bd5 + docs/models/components/capabilitydescriptor.md: + id: f9d1ee04aaae + last_write_checksum: sha1:93b19d6aeea2deb5b8e2be5231a7ea77429903cc + pristine_git_object: a4f9a8faa80959f9b5a165a04871963b3a5c067f docs/models/components/chatassistantimages.md: id: e75bf9e792e1 last_write_checksum: sha1:38a46a07650b7c9eec032e992a1b80c565031b22 @@ -923,8 +939,8 @@ trackedFiles: pristine_git_object: 1c030576b3952019d3f1d4947b325613c0ed4e74 docs/models/components/chatrequesteffort.md: id: 3d949b995266 - last_write_checksum: sha1:91edbd1135261852accfeb2dee641e26237807eb - pristine_git_object: 499c1234ba79e42c4418464b61e0b985bb2a3316 + last_write_checksum: sha1:6f66ae08e63dd0bdfc8832eb4a42f001036553de + pristine_git_object: 9a9789761f3bce5ff1a1942bbfab08dfd9d6fef2 docs/models/components/chatrequestplugin.md: id: 6ea2e614e408 last_write_checksum: sha1:7c044b9f0722eabd9b592edab7a1bc66d16c008c @@ -935,16 +951,16 @@ trackedFiles: pristine_git_object: e8a685e8c002ca09d7999094cf6fbf1f1e417fcf docs/models/components/chatrequestreasoningeffort.md: id: ca2256a2cfd1 - last_write_checksum: sha1:a482b791d0b86ecd63a57652b0b99714690adfff - pristine_git_object: 86722c52dd720760b9a5cfe12bec2a5a661191f1 + last_write_checksum: sha1:68b3984a3c0121de96165777ffd366862286f710 + pristine_git_object: 3e1dad643335e1919151d8cd4aaed5e56819dd2f docs/models/components/chatrequestservicetier.md: id: de1d4f761717 last_write_checksum: sha1:933539b1f157f51b6d8b04dce7bc85215a634c82 pristine_git_object: 4daa72bd28957b5c894b10dc011f27dc027f405a docs/models/components/chatresult.md: id: 716db90a4239 - last_write_checksum: sha1:8a78ea17d8a66e09ed10f401c979214be6328859 - pristine_git_object: 9a6728c79c0f18db845ee3d537dbcffcaab827d8 + last_write_checksum: sha1:b976f2a697526fc366c77a6dc9f0a79f4a7378dc + pristine_git_object: b162ac820fb1389e5bf3d121eb34717c3f73702f docs/models/components/chatresultobject.md: id: 7f4c86ecda3f last_write_checksum: sha1:c1c1f235153e3729972e6a70a9d7d83bc98cd602 @@ -967,16 +983,24 @@ trackedFiles: pristine_git_object: 01e0d64c1908c4ab072e8b809f7f16346b597240 docs/models/components/chatstreamchunk.md: id: 04426300fd4f - last_write_checksum: sha1:077615aa767b0a140992113e56cf0c544bf47d30 - pristine_git_object: 4194e190ca11e1b294860a18fb2a9d426c619f80 + last_write_checksum: sha1:c25914a63059fa93797272862ff545d3166b3c85 + pristine_git_object: e12409c3d5efde09e9a29fd00075c9d4713048b6 + docs/models/components/chatstreamchunkerror.md: + id: a4a8e32f24f3 + last_write_checksum: sha1:d191ece4f6f3f8f82e0717251cf3f8833b13f5b2 + pristine_git_object: a63a16c22f73fb3a3e58c559136b09c7c0ef3ac0 + docs/models/components/chatstreamchunkmetadata.md: + id: 2598ae50c337 + last_write_checksum: sha1:60d5c1532373df39646150b4ad856e25ca6c9208 + pristine_git_object: 5fb096eb6c16f69ece1d9d9ae32dab6035d06df6 docs/models/components/chatstreamchunkobject.md: id: 5d9a9bc6b1b0 last_write_checksum: sha1:31639f7b5f82d0ad86c6a785ed5f3a5cc9d53b92 pristine_git_object: 24a53f25ebd4e31bcbbf229c340b9d39322bfd34 docs/models/components/chatstreamdelta.md: id: c8b510da86c7 - last_write_checksum: sha1:e38ce72be69e8e8fdfad59893426ce4a736f5a8f - pristine_git_object: c33cee9258458e478b5905ef57a716dfe1fb5ae3 + last_write_checksum: sha1:73f2da272e2744d34fc3636ead96d519d03eea33 + pristine_git_object: 5d934c4b7edfa64ac1e9b32e3e733acc54ed9039 docs/models/components/chatstreamdeltarole.md: id: fb27a07377d1 last_write_checksum: sha1:ba1e62b491d95f1907f638bf885511728bf3a139 @@ -1067,8 +1091,16 @@ trackedFiles: pristine_git_object: c9602042d89aa7168d60e81447ccb4bb0e03c3ab docs/models/components/chatusage.md: id: 0488e615ed46 - last_write_checksum: sha1:b3f757b79d6b57c35dac0c24a5124d00aeda137c - pristine_git_object: e540306aa360bf47aa5334de94d44b660064b20d + last_write_checksum: sha1:a9d5a18c5923a919bacb91209ef56827b9d48896 + pristine_git_object: 98e4a2dbdb8db789eabab890fd484b8ef16ea90d + docs/models/components/chatusagecompletiontokensdetails.md: + id: 1181543923cd + last_write_checksum: sha1:153ba90eb6fcf9166b12a617b031c9ab9f452483 + pristine_git_object: e3baf4358b8d98762c84cef96c3fe6661015011d + docs/models/components/chatusageprompttokensdetails.md: + id: c0257f3991d1 + last_write_checksum: sha1:19b6a097d70bd03574de0d9336b02bb9a1f4bbbc + pristine_git_object: 83a90e1f24ac69089466ffc3eeaf17ebe1e4d41e docs/models/components/chatusermessage.md: id: e5c1cc8b5d6c last_write_checksum: sha1:421a50011001694e5d4e7bb42e76ee67c5282806 @@ -1083,8 +1115,8 @@ trackedFiles: pristine_git_object: efec2fbecde464aec7a09237c79e2c9c416db9a8 docs/models/components/chatwebsearchshorthand.md: id: fad82493a2cd - last_write_checksum: sha1:a94fa4a168f301f15eb1931fd138bf699de58be2 - pristine_git_object: b8b2bea75b39267d589d41c2bc97a58822f9693e + last_write_checksum: sha1:3d5c5119e8421a9123a86a05605bbe9d0d958332 + pristine_git_object: 228effbd9b0fb68cd373d4e0f6145ebec360e18f docs/models/components/chatwebsearchshorthandtype.md: id: eaed4e81ffa2 last_write_checksum: sha1:fb2b350e577b17bda819768f881b55de46819298 @@ -1125,10 +1157,6 @@ trackedFiles: id: bf42f31e319f last_write_checksum: sha1:2f795a8ffc12caf74e925d704da862dbb5986824 pristine_git_object: 6420ec316d4325b77b3228ebccae267e153ee510 - docs/models/components/completiontokensdetails.md: - id: c19e8c252f52 - last_write_checksum: sha1:49ec94e47b8f360bed7ad7f6f60f4d84a9a1ba0a - pristine_git_object: d57e78f1a4ff407be6e78ed4e5be9d0e476c087d docs/models/components/compoundfilter.md: id: cb733555792c last_write_checksum: sha1:0e5e5aac1f85ab008b5198aa6c56eae2cc234470 @@ -1343,8 +1371,8 @@ trackedFiles: pristine_git_object: 0021d8f86e8816f3ab839591e2beedc8e6f57d0a docs/models/components/createbyokkeyrequest.md: id: 15a30b7b1c19 - last_write_checksum: sha1:ac1ca287ee5e8cdf04067d8d9fc5b7a2c7f5f019 - pristine_git_object: 317fbd4f2e43491c23355c11d729eaf3ab1b4600 + last_write_checksum: sha1:d152a7764b55ad571087a0fbc6fc10d30bf44eaf + pristine_git_object: cc35eb29b2added4fe52226ff2c52c10d067ae9a docs/models/components/createbyokkeyresponse.md: id: e1c835a00ec2 last_write_checksum: sha1:33e0f05f6b4e9a433757fdeda01e171828c34b68 @@ -1359,8 +1387,8 @@ trackedFiles: pristine_git_object: eebd96425ecdebcb6c20c71c8ab05f6d7ed1004b docs/models/components/createobservabilitydestinationrequest.md: id: 37b77a2a4120 - last_write_checksum: sha1:784ce13d9b0838cf08e2c8b337f17039766581ba - pristine_git_object: ff5f5f4e13485636f9a90bf266967258cb78bc9b + last_write_checksum: sha1:40ec5ccfd9e0dff9525ee5c48719be05f8c00119 + pristine_git_object: 09aa0fcab6a16c40d3df5ec8e95135939cf8dd74 docs/models/components/createobservabilitydestinationrequesttype.md: id: 16691be9330b last_write_checksum: sha1:dd1fcffa747c6dc2352982d131217d78e13c3720 @@ -1375,8 +1403,8 @@ trackedFiles: pristine_git_object: 1f14c0a37522eeecbdbb271972bf0fedfbbd6e48 docs/models/components/createworkspacerequest.md: id: 7c0210437c29 - last_write_checksum: sha1:67e54f551edc0e743986ac634e09b8954bbcfa48 - pristine_git_object: ec9560bf33c2311acb28f1ee723d523650bb6ad2 + last_write_checksum: sha1:73c75a9fad8837edc1393e4706454eb2dce7b2f4 + pristine_git_object: 50b70288f8f234c311d7fb6c4dbe1141a14f0984 docs/models/components/createworkspaceresponse.md: id: 484ad7c9f402 last_write_checksum: sha1:b0f8e9c6fc118a1fdf44aa888c3f8bc711f6a830 @@ -1465,6 +1493,22 @@ trackedFiles: id: 97c816813421 last_write_checksum: sha1:5f69a9fcfd06d088cfbb055c3ec681348958bf81 pristine_git_object: b74afc12446dcdb624997888bab0916aa6e9b5c0 + docs/models/components/debug.md: + id: bc3b5b368b0a + last_write_checksum: sha1:cb948abde9de0a95db51f9a4be2c8d1989b9f610 + pristine_git_object: bbf94c5809bee5654de9a087beacbabd80a6d457 + docs/models/components/debugevent.md: + id: 8fa9a4843e96 + last_write_checksum: sha1:37317cbc2b296b97d0216d8b8bd83e21bde39fe6 + pristine_git_object: 8c72c6ac9696515ef3ad5e1614d09a3dcadb0421 + docs/models/components/debugeventtype.md: + id: 0bef2840cc0e + last_write_checksum: sha1:4c0e9bb898326d0ade00488aac5a1e11da2079fa + pristine_git_object: 76b4a4f883dba0a04cab09532178a78e64a422bb + docs/models/components/defaulteffort.md: + id: ce616685ade1 + last_write_checksum: sha1:94dc2c6f9142422589ceeebc5581bd6aaaa167ec + pristine_git_object: fb918482e2b20036a8ba699a0151ab2d037fcb88 docs/models/components/defaultparameters.md: id: d183ea015bf2 last_write_checksum: sha1:edf52bb6607c00eb6d5b823defbe7cb8c887b67f @@ -1481,6 +1525,10 @@ trackedFiles: id: 7651a6a8298b last_write_checksum: sha1:c22d196ae9974ac937879d21e143fd6f67000f77 pristine_git_object: 5baf708a7785ee316dc0d65c6493cc3f56dc3ea7 + docs/models/components/deleteworkspacebudgetresponse.md: + id: 4acc0b052290 + last_write_checksum: sha1:cc1e7e4da2132b0447b21eb785662c250bcfd84d + pristine_git_object: 183b6a69a780c44dc3220962dd355e714809a27d docs/models/components/deleteworkspaceresponse.md: id: 90ec73ca924f last_write_checksum: sha1:3cbe911844906e014f9527df8428ad34b55c207d @@ -1569,10 +1617,6 @@ trackedFiles: id: 29d7a6df1a96 last_write_checksum: sha1:a3d2cce4077963a894ba42adbe74046bc857de5f pristine_git_object: 04c46d2c4d37ccd1291ca04373ec905cf5313e2b - docs/models/components/elobounds.md: - id: bbcd8669fedf - last_write_checksum: sha1:7cb274f88e1569d83ebe65cdfb1e92d7c7356db3 - pristine_git_object: 2764b5668f3de6f5a30758cb1b8c469d59192563 docs/models/components/endpointinfo.md: id: c31d4a4b3194 last_write_checksum: sha1:1d91536077a993620789678df23a20c36820a031 @@ -1585,14 +1629,18 @@ trackedFiles: id: 66c759e13632 last_write_checksum: sha1:9b8d4e29e9da93a7258195af443c724f13002111 pristine_git_object: 22d663b766c6da0a81af818cd4fb02c701d3ee3b + docs/models/components/enumcapability.md: + id: 4053381406d3 + last_write_checksum: sha1:03e0d24eb22373a9a02b5cb24f5e805d5bb3f879 + pristine_git_object: 3c8c1a0d29faf3c2921c86c83d19c95f374e88dd + docs/models/components/enumcapabilitytype.md: + id: fdc27c0baf45 + last_write_checksum: sha1:84095e10b613256f8442136e4952875b4086b345 + pristine_git_object: 8c9f54500b7a46e816855c93f03a317f865ba1ff docs/models/components/environment.md: id: 2bbd505fcb39 last_write_checksum: sha1:2130e4281d51004ffb9ceec9e30242b815af80eb pristine_git_object: 11b1c6e29c25cb1733223e3c5f14e3c325bcdaac - docs/models/components/error.md: - id: 8ccbea40d025 - last_write_checksum: sha1:c9d91f741c7c138fd4ca6f9068b4cd0ba7730ed1 - pristine_git_object: ca83e4d7fa561f8125647aca9a58ab453ca174ec docs/models/components/errorcode.md: id: e163472f05d6 last_write_checksum: sha1:b3cc45586abe6c17b9e6858164e3417a91d56ad2 @@ -1605,6 +1653,10 @@ trackedFiles: id: a96f404b8cf1 last_write_checksum: sha1:37ec05cc64b1d7eb2fb1f880cfd25cfe56d533e2 pristine_git_object: 7035f119e61053a5a89fe00e375a7481f7fbe452 + docs/models/components/event.md: + id: 0593e0f6a673 + last_write_checksum: sha1:3c815007c1c1feb5a09d8d81c27437d7cea96050 + pristine_git_object: 864a3d762c78af5b8812523a3b3302a165328fd2 docs/models/components/failedmodel.md: id: 79efa8ea2a3b last_write_checksum: sha1:350258a45138e1b6ff21256e160eca7a44c0bef4 @@ -1891,8 +1943,8 @@ trackedFiles: pristine_git_object: 116c36a6acfdfa5279d3596e8256ace4c0fac1da docs/models/components/fusionplugin.md: id: c613af321ccb - last_write_checksum: sha1:68a5d3a63c55eea5da421a33569262076fb8decd - pristine_git_object: ae7186f5237b248c152d3523c503323cd2ac743d + last_write_checksum: sha1:00da164a9a450bc79fdbf168ab7c93491cb2b495 + pristine_git_object: 76f9386b3dc9bcc72aa896ade676274b38c590f0 docs/models/components/fusionpluginid.md: id: cd512b4e857a last_write_checksum: sha1:81a7d7014206ec26a2a495f0d5086a15ab3959ec @@ -1903,12 +1955,12 @@ trackedFiles: pristine_git_object: bba489b172f06f6dbbf54b264824a8f5a696110f docs/models/components/fusionservertoolconfig.md: id: 69df78f2434d - last_write_checksum: sha1:09705615a575ba26e92d3b76ca46181f1f5ed6d3 - pristine_git_object: c8513720d52a456df4571bbc9b291fe4a83b1e9b + last_write_checksum: sha1:13aabfce8122b78004e4b1debd0f5b34ca91d09b + pristine_git_object: f82d8f2b276f8fd9c93f0c12d0f1d08fbf7bc2f4 docs/models/components/fusionservertoolconfigeffort.md: id: 734f8b701071 - last_write_checksum: sha1:1dbf6edd83ec41a864709e98c16ed9276459ad44 - pristine_git_object: bd6d257baf738064d0a81e6c84a70bf4cdf5b8f0 + last_write_checksum: sha1:43d4583b7c5087ba7318ce4a640caa29d712cb8d + pristine_git_object: 0d60d5968175f6e954dfc9740fce4d0d467a9a38 docs/models/components/fusionservertoolconfigreasoning.md: id: ff321b3abb87 last_write_checksum: sha1:25aa412f5abdcc7e1c0aa324ea508d4a890540b5 @@ -1931,8 +1983,8 @@ trackedFiles: pristine_git_object: 57b74f2fa33da412a12430e771380f3ec098ed42 docs/models/components/generationcontentdataoutput.md: id: bbc2f7c41154 - last_write_checksum: sha1:8ad946394ce4e0a5d878dced1ae233364ca373e2 - pristine_git_object: 03ccb3a335fe98ba97c8893bbad6e766bb0a982e + last_write_checksum: sha1:fe15a4788687408588feeec205e8e3f3fe9a1851 + pristine_git_object: d267ae5ca78aabdbdfae899bb86d091c1ad26461 docs/models/components/generationcontentresponse.md: id: 286dacaa187a last_write_checksum: sha1:986259701f1111591a3c8407e3d2440c3cc5836e @@ -1989,6 +2041,10 @@ trackedFiles: id: 6565ed5691e1 last_write_checksum: sha1:e27a4ac59cee64aa441c96e7128ec450820a054c pristine_git_object: 1ebe11e1878c829d3327a48ff66b88579d1860b3 + docs/models/components/imageendpoint.md: + id: 9aa5dc3aec74 + last_write_checksum: sha1:36f03ac20e44dcae530735eb2b26c56dc6b953c6 + pristine_git_object: 47214dd616561ede78200b44b06891fe553cf17a docs/models/components/imagegencallcompletedevent.md: id: 34f635a64d6a last_write_checksum: sha1:21c55aadf6d8396c37d29d1161130cfb2a97f1a8 @@ -2021,10 +2077,62 @@ trackedFiles: id: ce89f77377a3 last_write_checksum: sha1:ce40ac3f654a698d0e0b7890e69999823fcb59ee pristine_git_object: 5230c40a6fd4cef3ce656c200f51bfdb037f1e42 + docs/models/components/imagegencompletedevent.md: + id: 3c79abd694bd + last_write_checksum: sha1:cfddf3876cbda31fc236878837de014ed979701f + pristine_git_object: 09403c920304a997dc7a3c88d1e3b14e26ed3908 + docs/models/components/imagegencompletedeventtype.md: + id: f4abb715f03f + last_write_checksum: sha1:7e20bafbce8d4d9a7f65b63263ea0a549238f220 + pristine_git_object: 2dcc452acf9706a0aec8d96e3c738ce9c5dd560f + docs/models/components/imagegenerationrequest.md: + id: 622ded7de95b + last_write_checksum: sha1:09be2254b59182f752a670d9cc5baf1580477774 + pristine_git_object: ee5ec46bc386a78c341c95e8de995cd4f1ba06e5 + docs/models/components/imagegenerationrequestaspectratio.md: + id: 7fa9258c1120 + last_write_checksum: sha1:9968108e00b6eb5feb9f34b9f07e9fe3d771e892 + pristine_git_object: a1b30d0250e0a0e31fc67d6ea4eb67e9ed5827b7 + docs/models/components/imagegenerationrequestbackground.md: + id: 1315b4adce82 + last_write_checksum: sha1:112c1af4853349ae0a67b4bd0ee692ef40de2d24 + pristine_git_object: 069a10e990f8c89aa100d59f43946f6d2af3bff7 + docs/models/components/imagegenerationrequestoptions.md: + id: 2251134e878e + last_write_checksum: sha1:093200122bb1a03041ec7e54943d6f891c0867a9 + pristine_git_object: 28b0684de8e7490f6d7a941f6902edd8d3b3ccbd + docs/models/components/imagegenerationrequestoutputformat.md: + id: c7f2db8581f4 + last_write_checksum: sha1:1de81a6de44ce573bd7cc03875086ca5fc0eb258 + pristine_git_object: d36b022ad7944a3e89eff15dd68a21e41aacc44b + docs/models/components/imagegenerationrequestprovider.md: + id: f6a850ef7a69 + last_write_checksum: sha1:112d06c2bdaf23bce91db94b51d129b7d40d8070 + pristine_git_object: 71ab16ab88b8743ffb8527c4e11114d4fd5a7195 + docs/models/components/imagegenerationrequestquality.md: + id: 3996f7b209ed + last_write_checksum: sha1:23ccadae065f6255a307b4817edc5677ae7cff75 + pristine_git_object: fceb8cd6db190c3aee1ab6072f34cc1b4190c4a9 + docs/models/components/imagegenerationrequestresolution.md: + id: ffd7e06f7512 + last_write_checksum: sha1:c0f9e51c6d750af2615150be2b3edd8d111597dd + pristine_git_object: 634f11d80446faf0e0e502a2bd2d2c453a5a3881 + docs/models/components/imagegenerationresponse.md: + id: 9e51f61ef05a + last_write_checksum: sha1:d51385707bdbf9e51ba05d2f73a3b7eb154f4a0c + pristine_git_object: 0d64d0b04cd71f9292c0fc6e01f5c9bb9cbb4abf + docs/models/components/imagegenerationresponsedata.md: + id: e5bf680c7579 + last_write_checksum: sha1:1d27db05d971c242c7b4124d186d7e639cef955f + pristine_git_object: 31f605187568ace889a7b704ec6c8c69f5bd7f24 docs/models/components/imagegenerationservertool.md: id: 4a798aa40aa3 - last_write_checksum: sha1:6bf14ee0d73eeea4a98680f9012a6e6b9e205b83 - pristine_git_object: b75ef42f286ba3b7aef1324bba9f69af9214e2d7 + last_write_checksum: sha1:478d9566970159e435a52b8bd2dd4cb541bdf511 + pristine_git_object: c17ea25b3d36be48eee039b21634be505df7a365 + docs/models/components/imagegenerationservertoolbackground.md: + id: b02608045c86 + last_write_checksum: sha1:b4ebf0b5afb09f9f8961a39553f08c8cb8bfca87 + pristine_git_object: 7e167083b3cd05046a910b1578e930dd50241d53 docs/models/components/imagegenerationservertoolconfig.md: id: dcc44d5b5625 last_write_checksum: sha1:eb7d4b385e01dc05faa6cd393f837b32c8afb624 @@ -2041,6 +2149,14 @@ trackedFiles: id: d4ed4ca2df11 last_write_checksum: sha1:829c26f224ad6c062d0c7574a9f66b829b5ff21e pristine_git_object: ff6b8cec739300f862e4692820aaa4195e20cd84 + docs/models/components/imagegenerationservertooloutputformat.md: + id: a56240b2e891 + last_write_checksum: sha1:2501c8b314fd55fcf8f66400e3cc0002e33b40a9 + pristine_git_object: 08ba388e96efa555ad58ba6ba1bd1802cd5b490d + docs/models/components/imagegenerationservertoolquality.md: + id: 0c9fc4f8e2ab + last_write_checksum: sha1:7d827103574938ee569b64ca0657725a93880a64 + pristine_git_object: 9b164c10b4bf42e1ccd253bca7e4e6fd884ba8fd docs/models/components/imagegenerationservertooltype.md: id: 30a27579b05d last_write_checksum: sha1:66e515c84e1dab8df7b5fb0b7c212bf10aa17056 @@ -2049,6 +2165,70 @@ trackedFiles: id: b753bb6cede8 last_write_checksum: sha1:2f9757849757610200d05c73f8aff190e61634e9 pristine_git_object: e990205c9dc9a48264d24bc521a0fbcaa57bd3cd + docs/models/components/imagegenerationusage.md: + id: 9931b856e7d8 + last_write_checksum: sha1:0ecf5a009a3123904b425e1bbfe9bbf0326412a7 + pristine_git_object: e75f1b13dba5e6113a72bb095044cffc2215639b + docs/models/components/imagegenerationusagecompletiontokensdetails.md: + id: f99f36376ab9 + last_write_checksum: sha1:4bc1f584f533b192a5ce5c5c4727aa3f54786d55 + pristine_git_object: 5b728d9a62330f49cb112f30fe1c75827d89d044 + docs/models/components/imagegenerationusageprompttokensdetails.md: + id: 3982ddab8c6a + last_write_checksum: sha1:ba9ffcad63b04f31d4f2879b574f4acc0dea01c6 + pristine_git_object: 4c772fd1926b0f81c23b7d1b4e21bc56f7b44119 + docs/models/components/imagegenpartialimageevent.md: + id: 14fc7d99e7a9 + last_write_checksum: sha1:177372167962805a94962f6572d4066fcedabe05 + pristine_git_object: 7e64544f1ca50e86ecdbea4097df7660833a5659 + docs/models/components/imagegenpartialimageeventtype.md: + id: 7831347fa9f8 + last_write_checksum: sha1:b0ce18651985ffbd182d97e1bce39f81809ba898 + pristine_git_object: 159b25759fd9ce08378e6c333628c7f658d0dc5a + docs/models/components/imagegenstreamerrorevent.md: + id: 29ffde808463 + last_write_checksum: sha1:5eb8060885ece0e01ec09f31bfb6014053869611 + pristine_git_object: cd7fa4f1bb30628232544952e0c93488ca0359c1 + docs/models/components/imagegenstreamerroreventerror.md: + id: 98bb1d75c6e4 + last_write_checksum: sha1:634c6a7ff4af4ed8ad6072693bf73c4b6c7633a0 + pristine_git_object: f02b9b3057f3196aa55be9f5fa87512830de66e1 + docs/models/components/imagegenstreamerroreventtype.md: + id: 34a740e286e7 + last_write_checksum: sha1:8b9b0f469ba9e9f194da3b12330ba4370444300f + pristine_git_object: d587b39f863cb71b85ed73e2878996ccc972743b + docs/models/components/imagemodelarchitecture.md: + id: 0c57f331fda8 + last_write_checksum: sha1:cd17dc103e376a9b2171c3d88f7e0139b6024f61 + pristine_git_object: b8fdb2e06763fd43c609c3d07816c45f58de7d4d + docs/models/components/imagemodelendpointsresponse.md: + id: 0f0fad7b3218 + last_write_checksum: sha1:a1b69af3ba733d80511e304b60a7bdca14276833 + pristine_git_object: 2d605273bc3558010652ec50a8f8db41002129ba + docs/models/components/imagemodellistitem.md: + id: 40aece40b825 + last_write_checksum: sha1:3186bfb08875ffd1e47778c6a78e2adcc090bb45 + pristine_git_object: f164a14b572afc3990a6c686c04cf9aaf6550a02 + docs/models/components/imagemodelslistresponse.md: + id: 767da581c461 + last_write_checksum: sha1:f55991d52900884cacaf972f84da46472189a21b + pristine_git_object: 46dd9da1cba12159dee171e342a9b18466f5d597 + docs/models/components/imageoutputmodality.md: + id: fff2e2c219e3 + last_write_checksum: sha1:011e308fa1ac6d5811c76ad4be9a5e40e2b6fbf7 + pristine_git_object: 76fdc2ce400e9103e1ff72da3d231a0616ac3132 + docs/models/components/imagepricingentry.md: + id: ea615d5743b8 + last_write_checksum: sha1:9008513673a32f5b24153e5092f06e624d1c0f0a + pristine_git_object: 889ac659cffffdb0380c8d822913c7c777c39b77 + docs/models/components/imagestreamingresponse.md: + id: 1fdbaa715bcc + last_write_checksum: sha1:679c1acb01b3ad39022e2b1b57aaa5ea135ff911 + pristine_git_object: 22a2730e04783ce17b6db1093628dfbe163ab0e4 + docs/models/components/imagestreamingresponsedata.md: + id: 7b0381ce1cfb + last_write_checksum: sha1:8064ac9fa613abf2c49f032424076b3bee7ce039 + pristine_git_object: edb06c5db905971fbfdc4cc5f7d5bba69a5a88d9 docs/models/components/incompletedetails.md: id: 38111094d2d0 last_write_checksum: sha1:c4c2af1a2a922dcdce454cb86138239c460ad848 @@ -2231,8 +2411,8 @@ trackedFiles: pristine_git_object: a124896de5195d8ec1598978830b9def241e3b5b docs/models/components/inputsunion1.md: id: d4f8f367ccc7 - last_write_checksum: sha1:259bc79d1c5d9a10cb022230d5b1d33ff59e1f26 - pristine_git_object: 2b792574dd68cddfbf586b3c64761f906107ca98 + last_write_checksum: sha1:fa1ffdf960d9308402e53ed185ce873f90e4b425 + pristine_git_object: bfdc8701de25a03a4213d9d7986a7926d281a764 docs/models/components/inputtext.md: id: 002f3c600e78 last_write_checksum: sha1:ae87be85873c9d60d5b8cf7a9b54ed038056f095 @@ -2303,8 +2483,8 @@ trackedFiles: pristine_git_object: 2b0ceef3a140c2d5d048f535f71fbe1da854bf89 docs/models/components/legacywebsearchservertool.md: id: "0995730880e4" - last_write_checksum: sha1:05610b315ca2b0b5bc777c38414369a0c4da6076 - pristine_git_object: a6f140c0205f274d2f40d38fef18f5f82521f1de + last_write_checksum: sha1:6b572b9d113ff2b36a28d79130ae7ca6c87bec85 + pristine_git_object: 7b47f06619f7b054adce901e14441fdd5c721039 docs/models/components/legacywebsearchservertooltype.md: id: 156a44bc6a24 last_write_checksum: sha1:9bab6c039ae8b8737c1b1a8321987c24a9dfda89 @@ -2341,6 +2521,10 @@ trackedFiles: id: 1e64a874981d last_write_checksum: sha1:a1ff06abecbab0d7a1367b3873213808282aa30b pristine_git_object: 1ab37956dda34a4550c483d86faae467dfa0534d + docs/models/components/listworkspacebudgetsresponse.md: + id: b22ad8b8dc83 + last_write_checksum: sha1:c7c653d25dbb6a1325d926a519104f7f388142ca + pristine_git_object: 20d96d7ee252ab78f5c5b634a81104bb63761087 docs/models/components/listworkspacesresponse.md: id: b2dee94f4d66 last_write_checksum: sha1:a31f3c5c55061571a920e0415d250b0eae9281b0 @@ -2491,8 +2675,12 @@ trackedFiles: pristine_git_object: d9b624b6399f3c074c04e9f25259ad8291bbbc92 docs/models/components/messagesrequest.md: id: e568fd3ac212 - last_write_checksum: sha1:2bd93121c1c80c770723de9e62f6358f1a937bb3 - pristine_git_object: 7b6fd798756c064da61dea2c5c5279745b95256f + last_write_checksum: sha1:61c2fc441be32ff0be076ad03d6faeacd09d76f0 + pristine_git_object: 0ebe164f07e5bb8192f7d5cc4d5f6298f8c778b2 + docs/models/components/messagesrequestmetadata.md: + id: 28745f82ae75 + last_write_checksum: sha1:e23e9476312c967ce127418910b1cfd97b644374 + pristine_git_object: e4db147a8a08628409289989d5665384466555a2 docs/models/components/messagesrequestplugin.md: id: b7e53a809066 last_write_checksum: sha1:3296e4023c7894f71ea676c5b305c2d624ad9846 @@ -2505,10 +2693,6 @@ trackedFiles: id: 9aa8f1c614ae last_write_checksum: sha1:7ed4473e73148e16e0f248678db261fb0cefcb77 pristine_git_object: 05a6ffa7eac8370d7e4a3029b1c380a5dea94283 - docs/models/components/metadata.md: - id: 06867fa888c8 - last_write_checksum: sha1:a7ce49afbde20a23fb8678e89be588ca559a5ee1 - pristine_git_object: abeea6e4325b9ff48eadfb8cb12b387494ecf63a docs/models/components/metadatalevel.md: id: 73f1a495eda2 last_write_checksum: sha1:78d18181cbd0783b99d1f2e94744fe0b1c4d160a @@ -2531,8 +2715,8 @@ trackedFiles: pristine_git_object: 4ffcefce579fec203b8f0be6b8f30153c1ea7cdc docs/models/components/model.md: id: 151d51d140e4 - last_write_checksum: sha1:9cf1d62fdcc27ebb499fb1104b7c5de5f0c86197 - pristine_git_object: 972e522916a979fee91b37f964d4bf9c3222eef5 + last_write_checksum: sha1:ec34447a978ec19bc1482f4499ada36fac66cb09 + pristine_git_object: f9f5bda7e9894d2add46dbb9f883ebf418dec9b9 docs/models/components/modelarchitecture.md: id: 0f7c7fb58809 last_write_checksum: sha1:bd46732cc84d202e850a8507f5ed22b36d54a3d6 @@ -2557,10 +2741,14 @@ trackedFiles: id: f9fa4fa27c15 last_write_checksum: sha1:6675f03dc0bea9e8e8d1c98e645f863f52ffdb88 pristine_git_object: 8661f88dc95e635b2a12efcd7edc95ebc9969f73 + docs/models/components/modelreasoning.md: + id: 374492b973f8 + last_write_checksum: sha1:e5280d8f8a16a84620a89ab83df4522a5f20375d + pristine_git_object: ec778f08456693b28a33125d1104f217423a1034 docs/models/components/modelresponse.md: id: 0fec1f0ad4bb - last_write_checksum: sha1:542c1ec645c17a86855fa2b8aab89eb58201c6bf - pristine_git_object: 819336221a2aec8c0218f6bb9eb886914bccd92f + last_write_checksum: sha1:a0e618737d93a07b141d85f8ebccc025fe50144a + pristine_git_object: 21c232d8306ca73a5779c2e9c87a29d69440cb23 docs/models/components/modelscountresponse.md: id: e959fec5ad35 last_write_checksum: sha1:033e50f8ade3080f2372743128c2799f734f1b01 @@ -2623,20 +2811,20 @@ trackedFiles: pristine_git_object: 558539849df93c043f4f23150742c44ab0fdb6b9 docs/models/components/observabilityarizedestination.md: id: ee2646777d7d - last_write_checksum: sha1:acd7055efd4cb1f2c1ea2a962fdf70b6b55b3222 - pristine_git_object: ab2a41a278d76ee0f1bb0de7c96b8d4f7c3b9061 + last_write_checksum: sha1:6964bab2b707367460f9576fe7fe76f6b71081c1 + pristine_git_object: d6da45bc3d4974c36171e292dcc7aa5fbe1867d2 docs/models/components/observabilityarizedestinationconfig.md: id: 0fa8ab33adcc - last_write_checksum: sha1:446046b4d0cf9f1a334a1972ce8c2debfacd71af - pristine_git_object: 27cf64ee1feed6b6718897dc277a3cb3d63d4902 + last_write_checksum: sha1:1255f9a8c8e6efba289d913ab8f9b5aeec060924 + pristine_git_object: 2930d80526a4d26c61a2f4f92e72fc251c26ba3f docs/models/components/observabilityarizedestinationtype.md: id: c26d0e265de7 last_write_checksum: sha1:153b849816b3d9a7c1cb7e7321955832e68f1ea8 pristine_git_object: 404681cd29459eafa85c8a0f07ae5795274a4926 docs/models/components/observabilitybraintrustdestination.md: id: 8d3f9038f8dd - last_write_checksum: sha1:843c6d26dce03b6964ce8d6cc38e33ae5294d9cd - pristine_git_object: f094ce6f3e1a93bd912a3673af246db03846981c + last_write_checksum: sha1:ee64402cbb5dd6c2a20272e702b1b6fa70f5ac9a + pristine_git_object: b6635b0bebbf56b994254689697186158936cbb2 docs/models/components/observabilitybraintrustdestinationconfig.md: id: 714eebe94ddd last_write_checksum: sha1:edfb6e8cddced16d5ccb463e9e9e34e454696b04 @@ -2647,8 +2835,8 @@ trackedFiles: pristine_git_object: 8653e21a8c8cda9d152e96b83a052c777dc5ec46 docs/models/components/observabilityclickhousedestination.md: id: 7986937dd797 - last_write_checksum: sha1:0541861438e51b33645a685d3d41ec7c724e547e - pristine_git_object: 734b530bfb3967b4d56e3261fb564c0739e47834 + last_write_checksum: sha1:7fbc69839c7d2c7ed0051085143b4df750c0d923 + pristine_git_object: 2f66279a76f5511991333ae1166112e5b31eeca0 docs/models/components/observabilityclickhousedestinationconfig.md: id: 4be563aa981d last_write_checksum: sha1:7b1450bb8803cc1cb0315ab1a6dfbc19b631e04f @@ -2659,8 +2847,8 @@ trackedFiles: pristine_git_object: 0c549d1f0851cc02f00a8a5c0132c114e97800fc docs/models/components/observabilitydatadogdestination.md: id: 4b0e60bcebb4 - last_write_checksum: sha1:dcea321512ea5f2abef3ab0da7c43c9143c20572 - pristine_git_object: 03ccf24303708ec2ff677f03df6b6a5e878f5655 + last_write_checksum: sha1:af509b9bdd0d1a7e3c4e52568f7fe8b0519c395c + pristine_git_object: 2d738fc2633f5fbe3c31169b58490fe92d5da479 docs/models/components/observabilitydatadogdestinationconfig.md: id: d74bdec64f4f last_write_checksum: sha1:244942c69991e7d0f4262438e1ff34b85c68dbbc @@ -2683,8 +2871,8 @@ trackedFiles: pristine_git_object: 331202a71fe477f8dc6aed103976bf030f438ebc docs/models/components/observabilitygrafanadestination.md: id: "092685228225" - last_write_checksum: sha1:f57b1a20af8148b364b40d51a30a62927d2d6616 - pristine_git_object: 31bfc3adcb231cdf7bda13000f7fcdff87af1533 + last_write_checksum: sha1:f66f0fcd9934067c1fc9a1a49aa4691cea76dab0 + pristine_git_object: af342a118a6bd9ed684bcd1c70175bc6332595e0 docs/models/components/observabilitygrafanadestinationconfig.md: id: 93b81480405f last_write_checksum: sha1:ed770405ad09f0bb4c17b4d24c2e1e7bfc4d913a @@ -2695,8 +2883,8 @@ trackedFiles: pristine_git_object: 47d91d563317db56b78e7dac38125dc596a2a992 docs/models/components/observabilitylangfusedestination.md: id: abb1dafb2128 - last_write_checksum: sha1:3c47f0dcbe2030a474f47812e464556ae3751aad - pristine_git_object: 7f43f6c7f5d5048c112fa210787e0a1e31afd90d + last_write_checksum: sha1:a3317b47061ed9e42b139f5011d00d4c78e4cd2d + pristine_git_object: c4863550454b540f9b19b04cb234b5e59585b448 docs/models/components/observabilitylangfusedestinationconfig.md: id: 0bef1957b2e4 last_write_checksum: sha1:e107cb8e0654b59852153f6d6fe4d9be362b24be @@ -2707,8 +2895,8 @@ trackedFiles: pristine_git_object: 87c20422a4a4cc0e47edb1888eeb7360094e94fb docs/models/components/observabilitylangsmithdestination.md: id: 26260cae02b0 - last_write_checksum: sha1:e7379147b7665c41bd84bcf14dc283d201cc21af - pristine_git_object: a1c8b04df20f7291c7c9c882b84e7aa29105bfe3 + last_write_checksum: sha1:0f2447a3123287d9bd967c86989d308ca31fef42 + pristine_git_object: b71aab73ce21202f0e288a7dbb96fd9ea80e44d8 docs/models/components/observabilitylangsmithdestinationconfig.md: id: 8003b06cd6c9 last_write_checksum: sha1:3d4f3148879f6094fbe5f45ec442e95986cfa44d @@ -2719,8 +2907,8 @@ trackedFiles: pristine_git_object: b973da3eaad3fe31dc8180bbc74efb2b50acdff8 docs/models/components/observabilitynewrelicdestination.md: id: 8d2b041d20dc - last_write_checksum: sha1:47f999107c66e158d63cf65d3b5ab4e2e8a17056 - pristine_git_object: d89136a343d65cdf943903c3feb9ce4b65667818 + last_write_checksum: sha1:6c7f36a9091b2cd65d0e7b11cbe5dace222ef627 + pristine_git_object: f62dbe3bb0d260009b72e5c7859f58bce303307b docs/models/components/observabilitynewrelicdestinationconfig.md: id: f04f6b93b824 last_write_checksum: sha1:3646b0f1b07952e7b28cb3cdfaa69f45f192f8bb @@ -2731,8 +2919,8 @@ trackedFiles: pristine_git_object: 8e661d4adf35a5372bcfa43f9e72567fe5fbb3ec docs/models/components/observabilityopikdestination.md: id: e5aa276aa4d0 - last_write_checksum: sha1:b25a55ee600883b6d843549b30ae5c2452daaae3 - pristine_git_object: 648ed93620b893a6b6a3bafc4e2eb23e8209c23f + last_write_checksum: sha1:989299dc8470b8b73c68fafbbbce81c01d3c836e + pristine_git_object: 450e25ffa689cde8225c168474b0f4e96f8aecd2 docs/models/components/observabilityopikdestinationconfig.md: id: c6bf1bb23d94 last_write_checksum: sha1:314a7ab2e633fb6948fff1f66fe64d094031d224 @@ -2743,8 +2931,8 @@ trackedFiles: pristine_git_object: 6e249d59b6056ad9e85581ab7a66ee6d5454a8a6 docs/models/components/observabilityotelcollectordestination.md: id: 4224db1a15af - last_write_checksum: sha1:4bf5de0f1af07aabfcdb2c3e16b3525b1bb185d7 - pristine_git_object: a36b3741e08f5fe076281c6dbdc08b86a283b104 + last_write_checksum: sha1:81565a2b59b241e0d2ef87324adfeed565e237e9 + pristine_git_object: 25239dc8883653ccd3e7aa89bf1949dee6fb5261 docs/models/components/observabilityotelcollectordestinationconfig.md: id: ed4981780fcb last_write_checksum: sha1:a8679cd3365a797cf1a77e55c0341a3603488bbe @@ -2755,8 +2943,8 @@ trackedFiles: pristine_git_object: b1c89d19f69ff3165105aef5f046a0f8953d572c docs/models/components/observabilityposthogdestination.md: id: 76f152650e52 - last_write_checksum: sha1:f23eced9f8e76dbe62dbee103e26c06e869b5311 - pristine_git_object: 3dc1bfa7a766881f53d3dcd00f0d7d3e82bdad9e + last_write_checksum: sha1:806c619d9e520618627eff8be968e64b74eb8777 + pristine_git_object: d55edd814daa03524f8ff3d985382609bde07d57 docs/models/components/observabilityposthogdestinationconfig.md: id: a23cbea68f20 last_write_checksum: sha1:60e7fe3383acd99d49a020283690402fd8714320 @@ -2767,8 +2955,8 @@ trackedFiles: pristine_git_object: d3e82bdfd2cbd430e7488fdf51e165ccfb8dce11 docs/models/components/observabilityrampdestination.md: id: 58b6b330e0c1 - last_write_checksum: sha1:59c2f3793de32b0598e1fd512d3340d76aa0f85e - pristine_git_object: a4479d6853e7fcb93eff71ce9575c54e4169ab58 + last_write_checksum: sha1:58530a054af51ce5249abe69316bdce5f69e9efc + pristine_git_object: e956c140ed32ee6b8bc3577952eb902671e93abf docs/models/components/observabilityrampdestinationconfig.md: id: 5dfaa51da128 last_write_checksum: sha1:b8ade060e0404b1d0e9dba9c283afc914db435ae @@ -2779,8 +2967,8 @@ trackedFiles: pristine_git_object: 391b1b24ba2d48436a60ac8ebc052d909fb88a47 docs/models/components/observabilitys3destination.md: id: b495c4a508dc - last_write_checksum: sha1:98382a12bac1fabda2e5135df24c8d9fc713f436 - pristine_git_object: 979e99a1b97b6d56f319c1bf0d9e5621ce68499f + last_write_checksum: sha1:e96695d13c2b43dfc0668a4233625a2dbb27d41d + pristine_git_object: 87789d2922962144250afdb554fc1594012ea5ba docs/models/components/observabilitys3destinationconfig.md: id: 4ad73bda2527 last_write_checksum: sha1:f7987ed4162eaf98f675e071cd8d97bcf1d05f28 @@ -2791,8 +2979,8 @@ trackedFiles: pristine_git_object: ac59cfec13ab263626d4895023a439bc608640a1 docs/models/components/observabilitysentrydestination.md: id: 1a40ea62b585 - last_write_checksum: sha1:3dbe957efccca685e18bb9f6cc17998bb3581d54 - pristine_git_object: 1b0ba3cf5643a6f9bece3adbc5ce3192a2edc046 + last_write_checksum: sha1:e1aa136cc4d5a043c4916a8b6a5220c17065c83e + pristine_git_object: b39b086fbe1903ed4372267d9ed398da0e60c6dc docs/models/components/observabilitysentrydestinationconfig.md: id: 99718f7486a4 last_write_checksum: sha1:82ef6857d87f836f59f5b51d912267e16e87e667 @@ -2803,8 +2991,8 @@ trackedFiles: pristine_git_object: 5fdd8babce99e54a310e569641e1b2be1383b552 docs/models/components/observabilitysnowflakedestination.md: id: 16a4ff3a08b3 - last_write_checksum: sha1:3fa6d22468581b67ca45be4b594014655927a76b - pristine_git_object: a7ecd0a22602d9d6cc4ba5b959da5c80a5eb9c12 + last_write_checksum: sha1:209e4d08b4564d9396685ea5ea816024f69c8955 + pristine_git_object: 08c58d453f4400917c5e639cdf3b0c4928f63092 docs/models/components/observabilitysnowflakedestinationconfig.md: id: 9dd8a5440b0b last_write_checksum: sha1:3ed2f477f991d7ae87139d3ec3555a8e32d04994 @@ -2815,8 +3003,8 @@ trackedFiles: pristine_git_object: 972b70f8d9d6301a6514d0c1c5f66e8772f8d40b docs/models/components/observabilityweavedestination.md: id: 6241e940d86e - last_write_checksum: sha1:ceaeb14beea9114291eb8c6c9a1e2427818f22fc - pristine_git_object: 92ba6a9e3dbb83bf2954d4ce687e54a8302495ac + last_write_checksum: sha1:0ba49142472b563d077ac687923c50d1aeb68638 + pristine_git_object: f4c4de9866a75c0445de0473df5c2291aba664c6 docs/models/components/observabilityweavedestinationconfig.md: id: 378c8509b70d last_write_checksum: sha1:46dae3e61c88b60622c552af6814f37c94de1846 @@ -2827,8 +3015,8 @@ trackedFiles: pristine_git_object: 0c0cfdbd82f4836df20ca9ea70f7ecfa5d89add7 docs/models/components/observabilitywebhookdestination.md: id: ebb26f114402 - last_write_checksum: sha1:94ae8aba425d5f94083a32714532b925254f46e6 - pristine_git_object: 988bb009068ec83164f070c30a72df374152df10 + last_write_checksum: sha1:24c978583fd9c06c3778aa383a62f1a385750844 + pristine_git_object: 8a0d37937310b40582437e9d24748a0b04e12528 docs/models/components/observabilitywebhookdestinationconfig.md: id: 681e5a73a29b last_write_checksum: sha1:0bcb992c44f2fcd5edc77ddff396c4881aab2535 @@ -3011,8 +3199,8 @@ trackedFiles: pristine_git_object: 5c3f3ef76afbc2a802869b4e3bec156c5c88e9fd docs/models/components/openresponsesresult.md: id: 24ca9fbee83e - last_write_checksum: sha1:19471e26378a48c49e8047211f3b996e233f2f0d - pristine_git_object: 954f4e70d7be0fde4f9ca04e8c4b7ee15c38c080 + last_write_checksum: sha1:daa6a25aeb799671d12bab7fc0102e4ab9fe3232 + pristine_git_object: b2016ff5593abe603e7f42cd2717bdd164ee25a5 docs/models/components/openresponsesresultobject.md: id: a43f77813a18 last_write_checksum: sha1:dd0db5814159c9a0eecfae8f7d6e12bb9aa47a1b @@ -3045,10 +3233,6 @@ trackedFiles: id: 53b616f52014 last_write_checksum: sha1:7177cf7fdff95f706ba2760aeb4758a4dc92defc pristine_git_object: 3f5da38f34e67870f3839a6f220da6e21c5cee7a - docs/models/components/optionsobj.md: - id: de3053f1ad05 - last_write_checksum: sha1:33b97782504ce067e922ef63bbfcec867cef60ad - pristine_git_object: 685624c60e2d4b28bf87e3a081681d0f1fa68f1b docs/models/components/order.md: id: 6e3d74da5756 last_write_checksum: sha1:b0e1880d1a810666b053a41375d6437680132dba @@ -3169,10 +3353,6 @@ trackedFiles: id: 377c483f5de9 last_write_checksum: sha1:956d9c91ca87b5b941ab661c4183de9ffd7ce5ac pristine_git_object: 7316982b8f79beca933ea83199462622462c6429 - docs/models/components/outputformat.md: - id: dfa700b06d34 - last_write_checksum: sha1:eafbea51a40469f12c73e23878b3118d0a70c7e8 - pristine_git_object: 125b8276c39560c9a996a3d3f1688d1958baa4c5 docs/models/components/outputfunctioncallitem.md: id: b51335c14430 last_write_checksum: sha1:64b68a33957e69588e0f0260e0f2641bf4fc0020 @@ -3565,6 +3745,10 @@ trackedFiles: id: 51fb6ea6849e last_write_checksum: sha1:7220422545f5b054d046c85512b8a5768b5b3e3b pristine_git_object: 0b52d2bec500f401c3e61bd5dcf086ee2650370b + docs/models/components/presetenum.md: + id: b2cfd8318fc6 + last_write_checksum: sha1:65bcc414c64170ef170ce45ccd365dc56e56e7eb + pristine_git_object: 872ae6686c0552b9da5de4617222dc78533c8071 docs/models/components/presetstatus.md: id: ccd104168b65 last_write_checksum: sha1:3a63b280cc3a492e6f2ada059208357f537f2a52 @@ -3575,16 +3759,16 @@ trackedFiles: pristine_git_object: 3671689a4470e45c127d171a62409fec15e531a1 docs/models/components/preview20250311websearchservertool.md: id: e24c57d9f4b0 - last_write_checksum: sha1:bce8c1487cadbb06cfd5e8ba17cbec8a3caaa6b7 - pristine_git_object: 4754cf55e09d329cc166a85cd8c1b7694a80f021 + last_write_checksum: sha1:4189a011bc6efd0b5eabd82e9d7564484edf8f2e + pristine_git_object: d32475a59a0e9fd60a08a5eeb4f373b4ae74dcc1 docs/models/components/preview20250311websearchservertooltype.md: id: 8a83d44f8695 last_write_checksum: sha1:89dfd50b34d928a2281cf07963ea265fb8c24631 pristine_git_object: 58ba5cd85f99c387e0524363026c21149600b7e9 docs/models/components/previewwebsearchservertool.md: id: f927c252fa14 - last_write_checksum: sha1:a8df503a0531b5ae4b36a824ff117829a14f61a8 - pristine_git_object: 324f28b93999274a341776a77e28fd51cc1755fd + last_write_checksum: sha1:724f806a446e2b26e5ca39c69d666d9122fd2ba4 + pristine_git_object: c9871fd027b59a577137912115952492a35ab36f docs/models/components/previewwebsearchservertooltype.md: id: 5f4165eb761a last_write_checksum: sha1:bea81711a1497becb99d5458ba2114a0358ec3a3 @@ -3605,18 +3789,14 @@ trackedFiles: id: 7c50b46a550d last_write_checksum: sha1:8bb86edd3636e5f34ea4419f7bb43495b561bb21 pristine_git_object: 3e852eb8443da3be20c29edb8d6b653cb2394f72 - docs/models/components/prompttokensdetails.md: - id: d6124531d751 - last_write_checksum: sha1:393c9e1d1401aec690b10491b362009904abeca7 - pristine_git_object: d1a5b5a38cae3941c6d9f3b9bccc44139a360bb1 docs/models/components/providername.md: id: 0e51a390af7c - last_write_checksum: sha1:85e3ea5dd276830580d26ef48480ecc01fe43e96 - pristine_git_object: f881f9515124b411f0a2b3df8b8acfbe942aadd6 + last_write_checksum: sha1:518117db5229b53164b2d88731ff35e69c46f227 + pristine_git_object: 38815051efa5ec029422c7917c92d63b61b233ba docs/models/components/provideroptions.md: id: ad91483204a0 - last_write_checksum: sha1:899ee6d6a3c17136d54b01d8526ff7fb63d5d36b - pristine_git_object: e27a7066f6ebf72a5c9929ce219af28bf4f82419 + last_write_checksum: sha1:911d6e6dc248c86890ba491765d21273705d57c0 + pristine_git_object: 5ddcf1883c559bc0fec90d42be343fe70207ac54 docs/models/components/provideroverloadedresponseerrordata.md: id: 380ab6674a54 last_write_checksum: sha1:d23bc108199ad8f6d98bb6934db669082c6663dd @@ -3631,8 +3811,8 @@ trackedFiles: pristine_git_object: 27c027bfd8182229c0582473bd0431f57fc79fa5 docs/models/components/providerresponseprovidername.md: id: 3968e328a0d9 - last_write_checksum: sha1:15c8c8893420df04803d9824e7e68fa774b60668 - pristine_git_object: c5ff82d0201a55164d688c2d7b922c142eb1c126 + last_write_checksum: sha1:df011fdcd5b91b93295ca9b4f43e996deceb0c6c + pristine_git_object: 18fb997116525bed7e2e5a8f19119e11ced4cdfc docs/models/components/providersort.md: id: 71c85ab8ce29 last_write_checksum: sha1:0d931a0e0cf1eb4287ff158481cdb0fe12a85f59 @@ -3653,14 +3833,18 @@ trackedFiles: id: 66a96bedf542 last_write_checksum: sha1:6cca04297ce2694fbcab6a7d28e09025461242e3 pristine_git_object: 38c246270b3765f759a973da6ff309b3cbc3c5c5 - docs/models/components/quality.md: - id: 3a64a4a8111d - last_write_checksum: sha1:d5b604f45d81e500dd36bf2b88b08a5cfa6b2593 - pristine_git_object: 54ea4234c6aa657dea13c0b26253ba816feb2660 docs/models/components/quantization.md: id: e461b19658b5 last_write_checksum: sha1:a83bd7aec9da186d0d16467e2bb523c538b46762 pristine_git_object: 0c611e33cd0a4b1e05f46c51bc48062eeb2febea + docs/models/components/rangecapability.md: + id: c27cbc66affc + last_write_checksum: sha1:ca007ec3de51939a9fcc614e0d30c3fc9073da65 + pristine_git_object: 3c4e74cb8d60d8d15e2c57266b2e7c871e4aaf77 + docs/models/components/rangecapabilitytype.md: + id: 06ce0f50752f + last_write_checksum: sha1:602cb09446d3d1266bd7183ff7dc069492c9173e + pristine_git_object: a96db5990c1eb020789aa3b924f36e54f479ffa8 docs/models/components/ranker.md: id: b894b8541696 last_write_checksum: sha1:fe6808d855c182a17240ab4ee8da4264fe2099a3 @@ -3739,8 +3923,8 @@ trackedFiles: pristine_git_object: 605f55bb5230678ab386bf9d0d19c56649f5751f docs/models/components/reasoningeffort.md: id: d0749e80416e - last_write_checksum: sha1:203b1b2cbd9430a19c2afac026da0b992dd7180e - pristine_git_object: 5acf208863e7bead855d5821764babdd7e91767a + last_write_checksum: sha1:4aac8d11f26666e000b1743e30b450b4ddcf5af6 + pristine_git_object: 66700cfbf94b94d2812a19f96d27c2ef4fe1b3b6 docs/models/components/reasoningformat.md: id: 5a3c7787e377 last_write_checksum: sha1:8ab5c8f908e4375498fb375ca80b03b87a529385 @@ -3861,10 +4045,10 @@ trackedFiles: id: 437aa80991b9 last_write_checksum: sha1:a700fa0d15208e318aebadbdf7293bc447467205 pristine_git_object: e4e6b00023d114162418d0030c621246b6ef8a42 - docs/models/components/resolution.md: - id: 5935a819cd6e - last_write_checksum: sha1:ec3eee432bfc0a1c0bcb2980385ef02bdb27a0da - pristine_git_object: e0eb77f6bf1958018a0914c3fe6df8c990671e88 + docs/models/components/resetinterval.md: + id: 6ae225e80924 + last_write_checksum: sha1:6adb1670e4cf87240cb3e4a59ebc6481b61f93b1 + pristine_git_object: b2a19f4339ac251a03f9b99f6f41a6e5adf0c698 docs/models/components/response.md: id: 331de1bd5724 last_write_checksum: sha1:6608ab3ae891646e8c3f098b4f8e2b166d5230bf @@ -3907,8 +4091,8 @@ trackedFiles: pristine_git_object: 6ce38411d7ae7e0423b2e47dec747b50026377ab docs/models/components/responsesrequest.md: id: c8886b84280b - last_write_checksum: sha1:2aa9c273c133cf1c7802db84bc5d11c6fe13bb6b - pristine_git_object: 31fc559c6b0287859ca9e18b379378296fee9cf9 + last_write_checksum: sha1:39f9161c6f0d522be7d6f5f5e6daf29e991b19e9 + pristine_git_object: 49873f5ddf426879e7005cf721973bd5ea937e3d docs/models/components/responsesrequestplugin.md: id: f7298675fe7f last_write_checksum: sha1:6121cb6dbaf9970c35964930f591df916f8ea88d @@ -3965,6 +4149,14 @@ trackedFiles: id: 54906b49ea28 last_write_checksum: sha1:17e398b2abd89b7459f07c9ff820a7cc7c7b7bb7 pristine_git_object: 634e6368385c203eacc61b1d31e40bf72b7dca0e + docs/models/components/servertooluse.md: + id: 6bad647ab895 + last_write_checksum: sha1:a14cb4af27bf37f9782052a25c430baf5a3b58b1 + pristine_git_object: d45229ce6cead9ddd5adfa79b06f40b9f21f2a24 + docs/models/components/servertoolusedetails.md: + id: f6f87cff0914 + last_write_checksum: sha1:a92fe11c4c64ea5c49c521c2ee7c496e6b5170a9 + pristine_git_object: 17e9b1acc979732ed2a50f1767612e63c92feb9c docs/models/components/serviceunavailableresponseerrordata.md: id: e788b90469fe last_write_checksum: sha1:27c421fe06d922073e036090024996c760ac48e7 @@ -4055,8 +4247,8 @@ trackedFiles: pristine_git_object: 7b9517c8001a6b143fe69cd42539c37e5ed461cf docs/models/components/speechrequestprovider.md: id: ab47ab61ffbe - last_write_checksum: sha1:f78c9603532c50f5f129b2ad3ad9b12e2bb03f26 - pristine_git_object: 5eb2fbd1c7b65f4881766857c55dc89168613cc5 + last_write_checksum: sha1:af7a4f3dfd1c3f8c2f2500cc5d486b0de747d824 + pristine_git_object: 74065243155b60e5e3f7735a4a3afe5a01f955d5 docs/models/components/speed.md: id: a75f09df7330 last_write_checksum: sha1:ffeead3a36aeb449dc6af68a533b32cb650da860 @@ -4119,8 +4311,8 @@ trackedFiles: pristine_git_object: 5129f5aab7948d3ba46b2a600ac926a83adfdc02 docs/models/components/streamevents.md: id: b4011a293eba - last_write_checksum: sha1:8193bd58cb5c6f44bb5e03e0729884ade4e62132 - pristine_git_object: 903929d330a6e39472a4649580a48c7e9a1baa39 + last_write_checksum: sha1:ed6c4215ab374e4698a9091423a1cdf83530bce5 + pristine_git_object: 2f02656f3105aa53978ab04033f785ea0b59d1dd docs/models/components/streameventsresponsecompleted.md: id: 63b394474134 last_write_checksum: sha1:5bb2310472d6e6fccb373198fd3fb9fc0875f3d2 @@ -4179,8 +4371,8 @@ trackedFiles: pristine_git_object: d2c36bebeada10a786959ffe1337d48c96ae810c docs/models/components/sttrequestprovider.md: id: 15505a849b11 - last_write_checksum: sha1:3272ef60d16f48e7b81b93e481b09898748f0c15 - pristine_git_object: 9e2700d12240a446f7b2f1cd2c4b16aece01c380 + last_write_checksum: sha1:da879a7ed4494cd6ec972b1f7dcde089d7892cad + pristine_git_object: d6bce5a5299ee959a312d068f8a70272990a73f2 docs/models/components/sttresponse.md: id: 5127df568592 last_write_checksum: sha1:44e7b98fef0a46feb327d42ec546393870380995 @@ -4199,8 +4391,8 @@ trackedFiles: pristine_git_object: 9748930d243bc6b5e4238fc89d78b5bc760c5a59 docs/models/components/subagentreasoningeffort.md: id: 5953b606f718 - last_write_checksum: sha1:9b37b89288ec1cff1bfedcbc21cd5ccb0d553b3c - pristine_git_object: 101dcfa18bf8772db7eb5f81ae6802dea6e990c8 + last_write_checksum: sha1:0f42d89a63435e80f9db62f8f1a3382a40509b70 + pristine_git_object: 64518f5360b70621c37f6c66b0710f57b3e09aa7 docs/models/components/subagentservertoolconfig.md: id: 8bd1bd78db7b last_write_checksum: sha1:906e3593e842319c80014adffd7bd07594cce4bd @@ -4241,6 +4433,26 @@ trackedFiles: id: 1863e9f01421 last_write_checksum: sha1:b9cbd4275b342f018b7fc132a6ed25ea66b5fef5 pristine_git_object: 1f4b73ca44b4743f46400c8d1582fb5f36d5e097 + docs/models/components/taskclassificationitem.md: + id: f78c69444f44 + last_write_checksum: sha1:39d02b38e8f498a0915ca779265ccfe5a735e417 + pristine_git_object: cc32f487e6e9e5c572b5500f1c5fc43a1a26f1d5 + docs/models/components/taskclassificationmacrocategory.md: + id: bd4e0f271ca1 + last_write_checksum: sha1:f10e4f540d8712fb9332182ced9f62218826814c + pristine_git_object: a83dd30ddfd1323a254f9819dbeb814a91461b27 + docs/models/components/taskclassificationmodel.md: + id: b408f15c7660 + last_write_checksum: sha1:a10afa3f2cdc5977f1c1e0e150d9cd1549d01214 + pristine_git_object: 65f8bb7775cff8851fc91ee00a42fbebda05419a + docs/models/components/taskclassificationresponse.md: + id: f0cf017e01bc + last_write_checksum: sha1:47899d2eb0dc754756e690d3b58675201b9600b3 + pristine_git_object: 6facc14d4ffba2d1e47c5ec93918e621dc9943ea + docs/models/components/taskclassificationresponsedata.md: + id: cb3091de789a + last_write_checksum: sha1:bc8db4f5bb75481da8891bffd47b9a1f776b55e8 + pristine_git_object: 15fa61ebe5f45e75f3cf4556612fdb45c37674e4 docs/models/components/textdeltaevent.md: id: ad4a3e160ad6 last_write_checksum: sha1:6dbbf95cd39bc4a27a595fcd3be2144ab02144a1 @@ -4277,6 +4489,10 @@ trackedFiles: id: 10176791991d last_write_checksum: sha1:b6da859c90aee1b0d89d895c27b30aa11dab5060 pristine_git_object: aa41ae79e49661b1c925097ac5607df09aa3f758 + docs/models/components/timings.md: + id: 60e9236d6f6e + last_write_checksum: sha1:f39d00320780e340ef86fe7e1dbb695f5faf5b3a + pristine_git_object: 645098c7fc589fc8595d03bbff9109d9fab5aa4f docs/models/components/tokenizer.md: id: 67b12de83325 last_write_checksum: sha1:6d6597fb22c833e950171cb57e1206ab16f9a700 @@ -4525,46 +4741,98 @@ trackedFiles: id: d0463c62ffdb last_write_checksum: sha1:ed17d69bca64692460f9470d27214562bcd8ca27 pristine_git_object: a8da92547b90f1d9b721d6694dc4e859b718ab7c + docs/models/components/unifiedbenchmarkpricing.md: + id: 1c063937ba50 + last_write_checksum: sha1:9919fa59ab354a4788f884f6d34600e5f5b34a95 + pristine_git_object: 9ccb82ccebc9f7c7baafe2cf3ace48fc263f8897 + docs/models/components/unifiedbenchmarksaaitem.md: + id: 47498c16ee4e + last_write_checksum: sha1:5947a06851b85a02d984d39dac47042de7d4058f + pristine_git_object: e4e79545b90b98d69c126ce3d39fe6846d45532c + docs/models/components/unifiedbenchmarksaaitemsource.md: + id: d5f775fd1817 + last_write_checksum: sha1:ba4e4c46dbba57e39110719106b951afecdcb2c9 + pristine_git_object: 7ff18ebbf61dd61d9d74dce408d9c8fa5b7b28f7 + docs/models/components/unifiedbenchmarksdaitem.md: + id: e05dc09c1794 + last_write_checksum: sha1:8697a3eae9081c9a1cbf80e1e03dbb8c9c84e7c2 + pristine_git_object: 26ff4dc6be637759a9e04af09a25aa9bb41624a5 + docs/models/components/unifiedbenchmarksdaitemsource.md: + id: 0523da684073 + last_write_checksum: sha1:461417d210a4f9f9b5621169938ea3ab232c295b + pristine_git_object: abe0024bbf9793cc961a856176ebd35fc5133114 + docs/models/components/unifiedbenchmarksmeta.md: + id: 76d7efb11de6 + last_write_checksum: sha1:46cb6aae16a57f068224cf73ddd3776e75c029de + pristine_git_object: 0848c4a6bfb12cd7273e447c2280f03a476ec0ca + docs/models/components/unifiedbenchmarksmetasource.md: + id: 5f69db816bc1 + last_write_checksum: sha1:43d58acd3a45300bd54f21bda99d1933736e3a1f + pristine_git_object: 8e3c511d5312c9660a6a36025f640b42929cd33d + docs/models/components/unifiedbenchmarksmetaversion.md: + id: a8ed7730edbe + last_write_checksum: sha1:9e530ad5d058f249896d3e9498214fd7d5877d3d + pristine_git_object: 21fa5936dea17b622ae515c2071a29b9d33fbba9 + docs/models/components/unifiedbenchmarksresponse.md: + id: 01e4c95f30ca + last_write_checksum: sha1:0c6f4b5532227356a99df303049a8e66d1f011b6 + pristine_git_object: f842f6091fd3539a4cc28f56422bcf26b2a7bb6c + docs/models/components/unifiedbenchmarksresponsedata.md: + id: ea2fa22aacca + last_write_checksum: sha1:ede8563fae34c8f2965ff4af78b44b9a10b83b5f + pristine_git_object: 7d7760066fb3e8c6ed1d8a30bd557d735cb415f4 docs/models/components/uniqueinsight.md: id: f5a031084659 last_write_checksum: sha1:5ea016900b17a15d6082bc1b63cc15210d006b94 pristine_git_object: 4a226787e0ee6e617dfb489d03198bd1f8f82b94 + docs/models/components/unit.md: + id: 01afc62b46e5 + last_write_checksum: sha1:b16f227c122faf3d5f100fa35cf2c0569eb6386c + pristine_git_object: b6ebf34e104a141d1cf250fb2f18d3101479041d docs/models/components/unprocessableentityresponseerrordata.md: id: abbf51e08d30 last_write_checksum: sha1:204aca5b0a82d0cc49f12b707d08132d199288ba pristine_git_object: 16118a8a90aa446d1050c3dbce333ff894ab742e docs/models/components/updatebyokkeyrequest.md: id: 3cd8be7ea3cb - last_write_checksum: sha1:70185034effc9449d7382d4fa23b6c1a6de0e014 - pristine_git_object: b4403546e7a991c492fedbdf2ad984c624bb93f8 + last_write_checksum: sha1:f8d91ee77d3833389a7d4ed5aad6d65982f93f22 + pristine_git_object: e8a92dd77f9465f33ad9382abd40f19ce671934f docs/models/components/updatebyokkeyresponse.md: id: 8fa0891f420d last_write_checksum: sha1:50fccf7cffe7eccbe809e0d3eab2d801ccaa13f1 pristine_git_object: 45aaa004552bce6d0bf14a8e06c6ae79d135c7e3 docs/models/components/updateguardrailrequest.md: id: ebcb49eb1b29 - last_write_checksum: sha1:27c9875029b28825f76a37add7eacccb8794c9c2 - pristine_git_object: c01373206d59193cd221b8ecb0ccf05378b09d5b + last_write_checksum: sha1:48901c47c73461209f0b6aa811380b7624de537b + pristine_git_object: 26d0530a5033a7c0af1e48f25d1990fc4aa055d5 docs/models/components/updateguardrailresponse.md: id: cec59127597f last_write_checksum: sha1:d68517d22b52e46a6385299d9493129483fb013a pristine_git_object: b3ade8c30970d70a938ec78601718f23f3fc10ea docs/models/components/updateobservabilitydestinationrequest.md: id: 806a2afce075 - last_write_checksum: sha1:823f7db711ac1e1e9b65038be91e823a6f60f810 - pristine_git_object: 3aa8de7cd2c07411db682231acfb8db56484cc5b + last_write_checksum: sha1:925a3d6be9d42a89ef6da30eb61d07c1e318db5b + pristine_git_object: 68d7c6bbc38e8d3f9870a691313ef281b07826e5 docs/models/components/updateobservabilitydestinationresponse.md: id: c5de55115975 last_write_checksum: sha1:08f445901204587a44e5936bd1295dd2fd77cf21 pristine_git_object: fa1ecfdb17a383205deeadca3f72011b06ed87da docs/models/components/updateworkspacerequest.md: id: 4cb886ed6c9f - last_write_checksum: sha1:7a6347b8c56a4d7cf8bba1994f601456823876ee - pristine_git_object: 83b157b5687a25ca5a10821ddc567890cad3aa10 + last_write_checksum: sha1:eeb492d1f11661f0f916b382530f7b6fcac8460d + pristine_git_object: fe68bb21c60907fa4d553bb44c9933066393fb0c docs/models/components/updateworkspaceresponse.md: id: 7c1800127dc6 last_write_checksum: sha1:1bfc8362e5f905e7745e741f6d1252d6478c3e17 pristine_git_object: 996da2b8ea33b0182aa8b85327d8cb618d1b408f + docs/models/components/upsertworkspacebudgetrequest.md: + id: a7aacf14d71a + last_write_checksum: sha1:f58723270b5467e2845bd955e316b4e21ed5216e + pristine_git_object: 981592ad8667ac146164e2960ab59f0245bc39aa + docs/models/components/upsertworkspacebudgetresponse.md: + id: 5571c28d09d6 + last_write_checksum: sha1:09e73d8eca7e26b77b0d240cacab036a3b8b3d26 + pristine_git_object: c72a201b55deb0e3d1fafc2203e4d8b832183c4e docs/models/components/urlcitation.md: id: 66c2ca1e64c6 last_write_checksum: sha1:84f5f90a99d349e30a7560260c45ff382a2ee8d5 @@ -4595,12 +4863,24 @@ trackedFiles: pristine_git_object: 04ba5e4bbad1c644ffbca571d8403d7402759d52 docs/models/components/videogenerationrequest.md: id: 5522e99e875e - last_write_checksum: sha1:5f939c97efba30490ba066d02eb893a5d40c2226 - pristine_git_object: 42fffa6be2fa4300c7555eaa59495d4a4e7c27a0 + last_write_checksum: sha1:07d600105d5830f47a4d23997ca4c27692c4869c + pristine_git_object: 5cd5d932caf15de7e96291ac4fc54744b656c038 + docs/models/components/videogenerationrequestaspectratio.md: + id: 51734a222221 + last_write_checksum: sha1:ff9a13190ca3e8f476d74fb5bdb984897e2866db + pristine_git_object: 2260c5b2a1f7d1e5b1dc8b4c16bfb8884f30dab6 + docs/models/components/videogenerationrequestoptions.md: + id: dac33c2710a2 + last_write_checksum: sha1:7d64a8d491aec062f5ca927fa8201d9e60fb6011 + pristine_git_object: dc2a0b17b5dc88f920039f90e38048c7ac6927b4 docs/models/components/videogenerationrequestprovider.md: id: bb4a860baf13 - last_write_checksum: sha1:5fd35182a7ebcea734f365934a51d24b1c04dcec - pristine_git_object: 49a8222abc5e373f752718dfbf037a50479a54a7 + last_write_checksum: sha1:fc05557fd07c4eb7334794d30fbdd322cddedeb0 + pristine_git_object: 06acf3feb40e51c3f5b32625829721cb8f4e5ef7 + docs/models/components/videogenerationrequestresolution.md: + id: 49e59c487eac + last_write_checksum: sha1:d6f7031838d75263bf85fb9a1691b0a23d703340 + pristine_git_object: 6a00ba1154364255381a0996d6093f2281a77ba7 docs/models/components/videogenerationresponse.md: id: f0752d2b17db last_write_checksum: sha1:ea3ac8c1fa9d7bdc8ea62071a3737bcfe443e805 @@ -4675,8 +4955,8 @@ trackedFiles: pristine_git_object: d962e4f40190418738b0058910b123717dcbb506 docs/models/components/websearchconfig.md: id: c51df06abb46 - last_write_checksum: sha1:0c58175f7a841ede38451194e1feb548df1aaca8 - pristine_git_object: 61fea616ffe8421fa769b981875204425a87665d + last_write_checksum: sha1:388a364c0028b3202f18f79182bf5e5b7b14a8cd + pristine_git_object: 80dbd8cc854ce853b17038489f96433d6f96acbf docs/models/components/websearchdomainfilter.md: id: a5f82df8f4cb last_write_checksum: sha1:0ebbfe95b7e3d06a3c0fecd3ea872c674f26bc89 @@ -4703,12 +4983,12 @@ trackedFiles: pristine_git_object: 0b97848fffd0612cc503c5e60ec53f2a11c58bd3 docs/models/components/websearchservertool.md: id: 5ab4438a4fdc - last_write_checksum: sha1:0dbdf886860ef2e8db45c26d615419641e7c5b64 - pristine_git_object: 8d7df2c06b389fcd9c78288c4d5fa84d3a2d7a33 + last_write_checksum: sha1:087ab0a3af558ca4dc0d1fbdfd2a31a44824092f + pristine_git_object: e9fd0582e0b53de90add2c0ab7ab1e09fcc36b39 docs/models/components/websearchservertoolconfig.md: id: 5dc4dcc787a6 - last_write_checksum: sha1:ffd22c89464c435b59bb6c20ef0033e185ac1591 - pristine_git_object: 5c15835ad7f70c9cf3120945b3044e65eb1a95ee + last_write_checksum: sha1:feaec815a7dc6203d3cd4d0fdfb7cba86dcfd38a + pristine_git_object: 971bab164c617e6261801040e13e14c9be3daadf docs/models/components/websearchservertoolopenrouter.md: id: 47dfc491b6b6 last_write_checksum: sha1:38d2be9a08e6db7208004b81359897712b17a8e2 @@ -4751,8 +5031,16 @@ trackedFiles: pristine_git_object: 91639db9047dd143c71d657f7dab81a12b456c1c docs/models/components/workspace.md: id: 94cbd88122e7 - last_write_checksum: sha1:6f6e6de4a055b95f057ceff8d7b8808a054cbfe8 - pristine_git_object: d478812b337159f881bb6c95bd43ed9987ef9a4e + last_write_checksum: sha1:cdaab6532d94b097bbd5d9dde9e299becced4cb2 + pristine_git_object: 536d118c770955b0c8f7817b3acd26e269ba224b + docs/models/components/workspacebudget.md: + id: da9ce8fd7ccf + last_write_checksum: sha1:87d22dcb4195dbcd55aa5e5463afbfb560ee6b73 + pristine_git_object: 61d2d0f68bceea534f3cdec44abfdca9e9d02ca3 + docs/models/components/workspacebudgetinterval.md: + id: 97b4c8d55468 + last_write_checksum: sha1:2a08d253b7f36434f0919183550f08d833b28434 + pristine_git_object: d0413b93bd5408b43be954fe5791a2ea8282d739 docs/models/components/workspacemember.md: id: e028587a2b15 last_write_checksum: sha1:0fcb42cdbdf101848f60b0791d14b2df0635bb70 @@ -4763,8 +5051,8 @@ trackedFiles: pristine_git_object: 92fc9b715b70cf57ec33776b976bb436dca653ab docs/models/operations/arena.md: id: 18236c4c4904 - last_write_checksum: sha1:dd3671f40051ffa438c9e525498e955d597fa136 - pristine_git_object: dbf198a11759c8a7fbb5040c3e1b1f65d3ea93ed + last_write_checksum: sha1:ddf89aa89897cd2a3b72997180b21a78759a3a0d + pristine_git_object: a5307471f3c1ccd1483c3beed8eeaa10c938b0d6 docs/models/operations/bulkaddworkspacemembersrequest.md: id: bb82d64c2ba6 last_write_checksum: sha1:dfb166457bbaa86d04d88731e4fc64521b961bb3 @@ -4801,6 +5089,10 @@ trackedFiles: id: 71344e17daa8 last_write_checksum: sha1:62a72f0a074a018d3bde744bc1b5e7009aa030a4 pristine_git_object: 11e964ef27e7993b8cdea025e07aae73cc21c8d3 + docs/models/operations/costdetails.md: + id: 2244d5f1d81e + last_write_checksum: sha1:12e7cc4256ef4085cce07d0d2573fd80fdd613c1 + pristine_git_object: 0021d8f86e8816f3ab839591e2beedc8e6f57d0a docs/models/operations/createauthkeyscodecodechallengemethod.md: id: a68761cecd89 last_write_checksum: sha1:daf71613f1ec344a7fe3d0c342bf31fc7b32d7bb @@ -4835,8 +5127,12 @@ trackedFiles: pristine_git_object: 900f5c6a080844df5b9a9619556b88e30667e65b docs/models/operations/createembeddingsusage.md: id: 55932019377c - last_write_checksum: sha1:3b707238fb2c892c028eac34965f2a89efc91166 - pristine_git_object: 42c827219460124cb38f82be8a0b9b3bf56f6860 + last_write_checksum: sha1:e581deb3f15e3ff4594ee5b8827be9d5e6e61c35 + pristine_git_object: 20f2638d3d680909d2c658d7073cd5478a212aeb + docs/models/operations/createimagesresponse.md: + id: 8c813b16590b + last_write_checksum: sha1:10ece8c939f5aeaaa2eeaf848efb6eb5059eadbc + pristine_git_object: d31f6bca5789bd28023325eaa5bef15659c9f30e docs/models/operations/createkeysdata.md: id: 9cbfcb7edadb last_write_checksum: sha1:f1a22355953412ab007d5f0da6f13ad1d5275948 @@ -4917,6 +5213,10 @@ trackedFiles: id: a70703e67396 last_write_checksum: sha1:8804103c6442495898f2e7046598a974d4cef4c7 pristine_git_object: 83ec94352d5eee2e693617821d45143f3624362c + docs/models/operations/deleteworkspacebudgetrequest.md: + id: fa6bd9e45adb + last_write_checksum: sha1:c349740b8715e03a3a7587f8bb8a36b43338ba4b + pristine_git_object: 1dbfb479faf40c3e68c21e01510180629c066db1 docs/models/operations/deleteworkspacerequest.md: id: c3a6fd8ac219 last_write_checksum: sha1:1a8b25503c486b0794326c0796504663906bb02f @@ -4979,8 +5279,8 @@ trackedFiles: pristine_git_object: cde537f245c884f4055a65b38e4bfe61478d1706 docs/models/operations/filter.md: id: af1deb54d54b - last_write_checksum: sha1:bf04ddb203486b6f3faa0b370dc27d7446d4086a - pristine_git_object: 271d3b5323a00144a89dc25a919c7f0a97921fac + last_write_checksum: sha1:61fe6e0eb791ae35246b67ba6c4d529e785dc53b + pristine_git_object: a958c45ca69f1ad1e18c8f517321705b6bb93e71 docs/models/operations/getanalyticsmetadata.md: id: 1b2cf59402e0 last_write_checksum: sha1:79ffd6769c74daa69056d51964502993ab4bde6a @@ -5005,14 +5305,10 @@ trackedFiles: id: a3c13382631d last_write_checksum: sha1:67f5a2436c2c3ca7d4c2cc923687f956d17c2c00 pristine_git_object: ab76ec61f3f8a714142efd8ea3f02cbfd0182533 - docs/models/operations/getbenchmarksartificialanalysisrequest.md: - id: b8fef1161cb2 - last_write_checksum: sha1:fe89c18cd73d66f08fcd307de22d35238d756cda - pristine_git_object: c539db4be9ad097bf20ef8080b8db7f05f4f649d - docs/models/operations/getbenchmarksdesignarenarequest.md: - id: 752ce897b5f4 - last_write_checksum: sha1:a2123574a3b7ebf2abc03ddb5bc80cee63b6920e - pristine_git_object: 4499b65db08cad021ec209e1af1e443576919a7a + docs/models/operations/getbenchmarksrequest.md: + id: 6f639b6d7f9c + last_write_checksum: sha1:c6652501e66f826b6dff5947242da7369fc2f4f1 + pristine_git_object: fa62105ad281911baf30cec5124a821ce71fa411 docs/models/operations/getbyokkeyrequest.md: id: 893f571066a3 last_write_checksum: sha1:ac0818f7aada9cef85ccc4309d1b9004ee91a553 @@ -5089,6 +5385,10 @@ trackedFiles: id: 9cca6989590a last_write_checksum: sha1:edd4e582a9484ba91e8cdce06bd14d4a4d4295d9 pristine_git_object: 1c4ba3446f26aedbaf39f1f6f1f803fc1cc68f0f + docs/models/operations/gettaskclassificationsrequest.md: + id: c5561ae0b47f + last_write_checksum: sha1:168b37112dc5c88bc9344461f63127eb7aae5903 + pristine_git_object: 8482b4b69a9d7cb847b92557f79f3e8c10b0bdb8 docs/models/operations/getuseractivityrequest.md: id: 094eba1cffb3 last_write_checksum: sha1:70caba64565a8cc2251e8f0a0eaad87ed1c4a8ad @@ -5185,6 +5485,10 @@ trackedFiles: id: 3d55593e8311 last_write_checksum: sha1:e0751ed4d82f5bb2ba505501f9f387f681803b58 pristine_git_object: 9b52aa70c7255e0afe849c09225362794a719c15 + docs/models/operations/listimagemodelendpointsrequest.md: + id: 15af74e4e921 + last_write_checksum: sha1:90a8f5b2c42aee99ec42c46ed15581ccd103d7f3 + pristine_git_object: 2eb93b68dab5adb386fad5717d7db42cc37fcc2f docs/models/operations/listkeyassignmentsrequest.md: id: cf678e788175 last_write_checksum: sha1:03e51ce6d7bcacb79d4d940f1e80499815689180 @@ -5269,6 +5573,10 @@ trackedFiles: id: 82d32e33f752 last_write_checksum: sha1:b32587a582304f0a0da0f7e4c8147da54a989bf2 pristine_git_object: 1cd507fd6c97f0c2044f1393d561a5a620afd611 + docs/models/operations/listworkspacebudgetsrequest.md: + id: 3c4af10b0d1b + last_write_checksum: sha1:18238dc0b270f43ce5624bcb02b6eb67073d01e9 + pristine_git_object: f7b5ed8f5c2ecce5e15a3ac58959f5dbf27506b4 docs/models/operations/listworkspacesrequest.md: id: 52f375a9c031 last_write_checksum: sha1:22bf355b68ca8ac30e313b0ff335db91b8576bd3 @@ -5315,16 +5623,16 @@ trackedFiles: pristine_git_object: d032d3ee22532bb48bca0569e1fcf47e6a569e2d docs/models/operations/provider.md: id: c28b3c085f4e - last_write_checksum: sha1:1a6c861e8dc018a308bc4e095d4b0f61a95e322d - pristine_git_object: c4fb2f323b7fb15f5f65bf9afb76ec83ebe80cd2 + last_write_checksum: sha1:8ac25347584c946106791a4097c7cfec75c9fede + pristine_git_object: a8aeb4812bf9921bbc219f3f6fc7567a01d1a21f docs/models/operations/queryanalyticsdata1.md: id: ecb6e11852f5 last_write_checksum: sha1:a55813c57010d0613c1e70ee1a9232fdcf98775c pristine_git_object: 055291f2e192b8c846b85f04ac19212389d227f0 docs/models/operations/queryanalyticsdata2.md: id: a5a7212a7eee - last_write_checksum: sha1:e96a8387b2692f9fc48c8b3695e18f01d232ceeb - pristine_git_object: 8b00559b444c7e5c161b8ce52a68c3058dd7abbc + last_write_checksum: sha1:20e129880dbb08f5807c7a0c0ecd76a8700b5778 + pristine_git_object: 7c2b0894b82f5d0960878f31bd900bf301a11e4b docs/models/operations/queryanalyticsrequest.md: id: bb134da4457f last_write_checksum: sha1:950bf8d214ca2e5432a19ccc7c62482dce77c238 @@ -5357,10 +5665,18 @@ trackedFiles: id: 3ca0009c143d last_write_checksum: sha1:2b83523f997c5e1fba47d4fe4a923d9b66f01c9d pristine_git_object: 7846dda337fb0a5308972b8df99d5c9df6618210 + docs/models/operations/source.md: + id: 31a3e4b3b2e6 + last_write_checksum: sha1:97d430704a49d749dc3615d2a794b05389acedfb + pristine_git_object: a37d5990a3bab21d201da7d09e71b5a188e839d2 docs/models/operations/subcategory.md: id: 8bb0b30b82e2 last_write_checksum: sha1:81fd25cebef75d4992a0baeb28c280186ea80883 pristine_git_object: ca0251d7db30e462cd6160bb009a0f21f61e4242 + docs/models/operations/tasktype.md: + id: 8c10844969fe + last_write_checksum: sha1:ca27a6b5d0d4f74e38e2f33e4f304ab2515d6216 + pristine_git_object: 0ab7a2e360b7dbb3625d60fe4b4cc3f16dd3ed45 docs/models/operations/timerange.md: id: 1f5778dd63dd last_write_checksum: sha1:7c26a813c27e613eddd931f11d9d0cb1ec15d900 @@ -5417,14 +5733,18 @@ trackedFiles: id: c158ebde379b last_write_checksum: sha1:2c87a31011cf1496533800b33f68865d09508c1f pristine_git_object: 047e417f4e55553993a9198cf7915cfe2fd50975 + docs/models/operations/upsertworkspacebudgetrequest.md: + id: 9c4b77df56d7 + last_write_checksum: sha1:c8031c096f6a6ba994e35e7ac3222cc6558c117b + pristine_git_object: cbd1c9a18e9d67203bb912079b149c45be71c880 docs/models/operations/usagelimittype.md: id: 22ad2742a599 last_write_checksum: sha1:f4aaf105a525df20c1879e3028a9326fcf1dc0a0 pristine_git_object: 106c104c8d0ac29425c8f2de9699a049704b4c5f docs/models/operations/value1.md: id: 523d8c155e57 - last_write_checksum: sha1:186537dbd08ffef3b5f5d7d539e0cf0599d55c42 - pristine_git_object: 0dc6a5914c059c7eade71f3c017851f02217dc25 + last_write_checksum: sha1:4fe1a3a21e0d08d31c35661694d299940d7c6316 + pristine_git_object: d960f673871721f8c64b21684e0201a9272d49d3 docs/models/operations/value2.md: id: ff7c100bc64d last_write_checksum: sha1:dd219ec77a4a8d4bf4f028fe62fb5aa211e0db2b @@ -5433,6 +5753,10 @@ trackedFiles: id: ad6c1c317816 last_write_checksum: sha1:de57739a3b3d3198f0f40a4faf2230a25b1037ee pristine_git_object: b9af9a6d696491f29924b1876d6951a9d17abd94 + docs/models/operations/window.md: + id: 22a97bd1759f + last_write_checksum: sha1:6ec419ec9cf1d79092ed97e6d43dad64408bc055 + pristine_git_object: d0de8aa8826b27ebb82876ad9c54e001f32ce5bc docs/models/operations/zdr.md: id: 6b3f77435a1c last_write_checksum: sha1:9130af1f02c361724a36d89ea6569dae0ce400cb @@ -5505,6 +5829,10 @@ trackedFiles: id: e2bd25998427 last_write_checksum: sha1:26a7ae261dd8384f2594eb8cfc16f69ec1694afa pristine_git_object: 344a37aa8b9b969f232d1d9b0a0ce579bd8a3e4d + docs/sdks/benchmarks/README.md: + id: 61c16262af9b + last_write_checksum: sha1:c00828a346420652cc50cee51ecb6a1da1898acb + pristine_git_object: 58b17b1bcb903efb3057dbdbf5939fcd85f69bfe docs/sdks/betaanalytics/README.md: id: e037af84b386 last_write_checksum: sha1:f345d541fe94f3055102984d50eeb141007e1af6 @@ -5517,14 +5845,18 @@ trackedFiles: id: 393193527c2c last_write_checksum: sha1:b9079c84040f881bcd59bab7d724d5af02fe0fee pristine_git_object: 99c934ac4f065f1f3c58e51260ae164bba03209b + docs/sdks/classifications/README.md: + id: ba3b1f5de071 + last_write_checksum: sha1:0556ba7f524a39b47461eeaf5d0ff302d4866af1 + pristine_git_object: 97759076bcc3a38a4af44c4afe76cd9edfb2ce4a docs/sdks/credits/README.md: id: 81608135c0ff last_write_checksum: sha1:d6765120b556b7f5829821bd5977aa7d0090bba0 pristine_git_object: d7b490e8561ba6e7295b4b1d1168a8b5570ac8fc docs/sdks/datasets/README.md: id: deb5d90f4faf - last_write_checksum: sha1:9b7f3dc54db0dd3c5ce16aba440d983a38e69cd8 - pristine_git_object: 4efd8239041e4d0599c332ce021512807d21dce8 + last_write_checksum: sha1:6a23219d02f5f1c6b19e54ee86aac4dc63a3bbec + pristine_git_object: 618ce0e150b638978911cccc7f4e9650d7bb5874 docs/sdks/embeddings/README.md: id: 15b5b04486c1 last_write_checksum: sha1:a83edff5061a905313d5aa4312ee9e4dbfa0d792 @@ -5545,6 +5877,10 @@ trackedFiles: id: f72b38a5a2a7 last_write_checksum: sha1:452cf941859ee44de443893651ae9ad7bc4bc09e pristine_git_object: 9fdcbcc723ea0b7f2f6344886093a49743755ae8 + docs/sdks/images/README.md: + id: cc752c3524d0 + last_write_checksum: sha1:af19ea6b419a6eb4eb14e082705f00e451db0558 + pristine_git_object: 59fd90f2c876a488556ca13e3782be8e48a89ee4 docs/sdks/models/README.md: id: b35bdf4bc7ed last_write_checksum: sha1:2d14eb55bcb82982104c71c638d43a10e895a3fe @@ -5587,36 +5923,40 @@ trackedFiles: pristine_git_object: 57635c65a31e007d7a2a00ecd905fce5c0d1f3e2 docs/sdks/videogeneration/README.md: id: b6dbf7b0729c - last_write_checksum: sha1:7da37bb7afe5662d69a76ebb7b3593181e4c745b - pristine_git_object: 3ed68602e40878882de0a03d3806215c749a8e2f + last_write_checksum: sha1:6f6168bed74a7c8596b95e21814fa09de296410a + pristine_git_object: 6544a8592b324590784649eadcf515d3f722681d docs/sdks/workspaces/README.md: id: 1f5b051a6380 - last_write_checksum: sha1:01a69b0cd08f051367c1c11af2b8ad1e8c8264df - pristine_git_object: f49178d20b00e1e10b43fc5be58f656938c13d15 + last_write_checksum: sha1:2a73bd7923c7a95707b0223082c4790d720c2a2f + pristine_git_object: 3d5e28ee0790109aa53167e3b729d2f166f7e8fa embeddings.go: id: f7354b2d5b3e - last_write_checksum: sha1:a079e4ccd13549c84cd10eedd718c35283799acb - pristine_git_object: 7133eb10d36b0dfcaf8d9f73d60494ba87b6ed72 + last_write_checksum: sha1:a0ddae9604bdf87b05e111b9e8003be41e5d3967 + pristine_git_object: b5e36e8d08a80ea7842b172d16af6ea6cb2908b8 endpoints.go: id: fca50a3c2336 - last_write_checksum: sha1:2580761728a9574c87bf7356358889d695467bb6 - pristine_git_object: 2ce8a37c30d493fb7576821d578a2d5a9bc869d6 + last_write_checksum: sha1:a2e70f8a05b15728a461bc93bd31b7dd5335749e + pristine_git_object: ba124e6eae96782b300d0734146b1fd92dfcfe23 files.go: id: 2321d71bc458 - last_write_checksum: sha1:38b954d0d68ade28ebbcc10007394b71a780d6d4 - pristine_git_object: 8524208f928833d758f04da467d19a0f61f760d8 + last_write_checksum: sha1:b2b82fb1845c19e843e2aed60d6d981aef32e5a6 + pristine_git_object: bc4caaf5061bca8e12933bb6d479236125271955 generations.go: id: ad539e13a3f6 - last_write_checksum: sha1:3ea9b2f6c4ab38d0e2e41b0bfc0fbc964eabce75 - pristine_git_object: fb4140bf9321ff9b57a769abe1b3e7ddd61c8542 + last_write_checksum: sha1:78b953358c96fe9b4a47f0a20fc0315c19903144 + pristine_git_object: 0fbcab303c1a951e40dc599c5218f91ef710712a go.mod: id: c47645c391ad - last_write_checksum: sha1:4d254fc386e7e933f2bae7d9f025c358595d9a15 - pristine_git_object: ddbd7334856b5023884b94fcf190fa263d27bd30 + last_write_checksum: sha1:d8a871c3a4cd788f167dc9d0664372d6b3061bab + pristine_git_object: 798cc5ddb114dd42db1fbc64cdbe27a057dfe3f7 guardrails.go: id: eb364a316712 - last_write_checksum: sha1:6b842bd9c562fc48496ec7bdbc9eb6f992818c27 - pristine_git_object: dee013153b6a88fb159efc3d1eb7ed7900111996 + last_write_checksum: sha1:74d2bb08e40a29c3ab8adf3cb27d9ca0d3c7d15f + pristine_git_object: d61dc1fa76ec3f34c6f061bf67cd97682d72147e + images.go: + id: d0bc8e6fab7e + last_write_checksum: sha1:6db6df85e968bd1df3563ba2b194d2658fdef618 + pristine_git_object: ae0bf3d38eb97043928ab660d1c48464df3af052 internal/config/sdkconfiguration.go: id: 33b8bfac5265 last_write_checksum: sha1:15e41ba496b469915419bb45c537c9f52592e6f1 @@ -5647,8 +5987,8 @@ trackedFiles: pristine_git_object: bcbf1d9eaad67b4c6b29a32a2d3ec389181fe187 internal/utils/json.go: id: ad03e3c502d8 - last_write_checksum: sha1:b8d30c190d6028adc5a121549d4049073ae3ff16 - pristine_git_object: a5a64183e5295dc9e8aad569a4f3c46d40d9d875 + last_write_checksum: sha1:6e6e382ce62e67a7a5af1fbc92c304d9797d7eb4 + pristine_git_object: 9d1e56ec888487e30c993055af9d0ad6afcaa5ce internal/utils/pathparams.go: id: 1f3e0c30fd90 last_write_checksum: sha1:16164be3ad202edc6bdb01e5ca25034ad06d2393 @@ -5671,20 +6011,20 @@ trackedFiles: pristine_git_object: 7c1a372ae314a9d82ab82c3db610e7ffe67ecfab internal/utils/union.go: id: db86c85746b6 - last_write_checksum: sha1:aaab8873112425ae55c85d873d6e959dae5dc2dd - pristine_git_object: 12348ff4ff46d50a33f8097eaf8a0aaa4be3019d + last_write_checksum: sha1:8394658e4013d8453bc2cba3eb7eb22d94bc9fe5 + pristine_git_object: bc6a1ee161cf1b9f28b6a4542d9d7945bc64d10c internal/utils/union_test.go: id: 4b56247171bd - last_write_checksum: sha1:bd5c7506e1d6238117c1ac4e340314a5a41401b5 - pristine_git_object: 138f7e2a066b10dffd0a9957ecfcab9e00dd26fe + last_write_checksum: sha1:83ac73c1901de4c6db90f65cf5879163f3d47a00 + pristine_git_object: f66814c73ace94d8e71d785fd6161fb405745754 internal/utils/utils.go: id: 1133b2a27019 last_write_checksum: sha1:36a3e6fb95d71868d1755dbb3b924a37340c7ea7 pristine_git_object: b32a14db51857aafab25498ba32fa2905c92b5d8 models.go: id: 3af78faf181b - last_write_checksum: sha1:e20bfd40416909e01bc3548fca8aa913ed3fdce7 - pristine_git_object: 507277c00bde65ee693e18f74170b779de2c10a2 + last_write_checksum: sha1:1ce0d7730b3b1eb62a06d1aeee94cd313ff707be + pristine_git_object: 342a779700729e0fe43226f4113202edad6d5ba4 models/components/aabenchmarkentry.go: id: 4c2460857b24 last_write_checksum: sha1:f1dcb4e0a7a18fc3b6c701e6608ac599c5a0f280 @@ -5703,8 +6043,8 @@ trackedFiles: pristine_git_object: 1b3f6189feac277df2245d637cc2b856efa20c1d models/components/advisorreasoning.go: id: 9fc191f04671 - last_write_checksum: sha1:7e7aca95bc8daa20c38587bb26aac61a4b2ad286 - pristine_git_object: 9cd505e6aebf9e63bda32820981840b5ac8d6b4d + last_write_checksum: sha1:98900941f0c2b858b3abdfcf48924ff1277fde3f + pristine_git_object: e10f3a38b0c12af7ccf719e0d704272623398343 models/components/advisorservertoolconfig.go: id: daeea4cb03ae last_write_checksum: sha1:cc360b168f52ffcc5c91acbb4b29225515e8aa18 @@ -5717,6 +6057,10 @@ trackedFiles: id: b6261fd23c6e last_write_checksum: sha1:9be1280533bb1e12ef6191f6b789dadaed69c94e pristine_git_object: 16dec87b497a0783a55317cbe24de3e3cbc751d0 + models/components/anthropicadvisormessageusageiteration.go: + id: f5349b268ac5 + last_write_checksum: sha1:ee0882c4c77cdb2efd163e04858307af4744be05 + pristine_git_object: d449ab48a1d0e6d870fcb8ab3bb02bff9143401d models/components/anthropicallowedcallers.go: id: 9a7f596270aa last_write_checksum: sha1:1eaa424e68f4383f6e594a94f3e1ce5dc22b13d8 @@ -5757,10 +6101,18 @@ trackedFiles: id: 4fa55e30264f last_write_checksum: sha1:354f65d61c30ca9f51132d6043df68f16793c1f8 pristine_git_object: bf7a4100c50030be9ddff0a383ac07dc83688a15 + models/components/anthropiccompactionusageiteration.go: + id: 42ded30a33ee + last_write_checksum: sha1:8eb8a2741a07fe1ef68e01ff28bb4345e6c01afb + pristine_git_object: 1e8cea32bf93b519d82820b343219dfcfd7340da models/components/anthropicdocumentblockparam.go: id: 44795262246c - last_write_checksum: sha1:57e09a044eb4030badf6c0ed03b8798ec4149325 - pristine_git_object: 3a3eff0a5e2d46e4a002d5db69b8d145ecc964c7 + last_write_checksum: sha1:07e5c762bd98d1e2c904241fa1d24d6939c78711 + pristine_git_object: 333854961aa129a0090cee32145f31e4f89fdfdc + models/components/anthropicfiledocumentsource.go: + id: a246b878394e + last_write_checksum: sha1:0baaa0edb0cde1bd2972451776fdc5ef270d01ac + pristine_git_object: d943045b44f6547ca3feddd9f63c99283383aaa6 models/components/anthropicimageblockparam.go: id: 677ab38ef951 last_write_checksum: sha1:dc8659ce703606cf2218dfa8fe90bde7251e4cac @@ -5777,6 +6129,14 @@ trackedFiles: id: ceeec05b0a94 last_write_checksum: sha1:e926497a5e79a46d73ced3db00a26f8687714575 pristine_git_object: 601fb13fdd44fe2a1102b27a10f6cf5fcfdae66a + models/components/anthropiciterationcachecreation.go: + id: 5d714451dd4c + last_write_checksum: sha1:3503cdd766e99ca92ac64ec23c20dcf802b4d641 + pristine_git_object: b0981ccf61b7c8114737e543d91d8ada0eec1185 + models/components/anthropicmessageusageiteration.go: + id: 83c50e092bb4 + last_write_checksum: sha1:c17507f3417bd874a45f55d4817a535a8142e2b3 + pristine_git_object: 7cfbe1c7812d23f28b9569ca309afd949b92a6e7 models/components/anthropicplaintextsource.go: id: 7a6927bf4a51 last_write_checksum: sha1:576be1dcf563ea9fed9648b13e9873df1a205bbe @@ -5785,6 +6145,10 @@ trackedFiles: id: a00bce8c0b7b last_write_checksum: sha1:ed14bc1bf61e79fd0f384c0256e5e6cb5f10a5c1 pristine_git_object: 15573d5e93e073736aa5a038b2fa94e79109ad67 + models/components/anthropicspeed.go: + id: 81e535a366e5 + last_write_checksum: sha1:876a439b9cff2cea4310bdb31648647079415e76 + pristine_git_object: d38fde5d642228386c82b1139cc59e04a849c2a7 models/components/anthropictextblockparam.go: id: 4e457a2f98eb last_write_checksum: sha1:6e57bd725013284a4da318a8287d1815d647a4db @@ -5805,6 +6169,10 @@ trackedFiles: id: 6579d723109e last_write_checksum: sha1:b343a75fbf51ecffc4c46adc945937db76a7855c pristine_git_object: 6a346067c71ffdaeb7480d03b663b5b7e136b561 + models/components/anthropicunknownusageiteration.go: + id: 5fe51bff7c36 + last_write_checksum: sha1:fd66450c2a74f78d54e160f0e678203bbc58f6f1 + pristine_git_object: d581c2bf7b985b861393f278a244ac35a1ca02e8 models/components/anthropicurlimagesource.go: id: 7766af733ad3 last_write_checksum: sha1:db87c644f65084da510c46a71496172961d57ee3 @@ -5813,6 +6181,10 @@ trackedFiles: id: 4d4f0b7b5f1d last_write_checksum: sha1:1e2eff3f89923f4ecaef7047a6cd1043d8dcddcb pristine_git_object: 35c61a5847777f2dfb354970d54ad6129b67e538 + models/components/anthropicusageiteration.go: + id: 2896a7f2bd2e + last_write_checksum: sha1:4073e5e06454a767254797036955e72ea09391ef + pristine_git_object: 44c845383383fab489457c75325bf9155b5c0533 models/components/anthropicwebsearchresultblockparam.go: id: 9d75d0d86f59 last_write_checksum: sha1:9ebdef5819bf3637d1954ede6e6dec838b8999fb @@ -5821,6 +6193,10 @@ trackedFiles: id: 02e0e6c4f7d0 last_write_checksum: sha1:ccfeb94597d68a62b2d5e44cfa5c2e0352935122 pristine_git_object: b759f472daadc28ffd4187bc741d277b2bd7644b + models/components/apierrortype.go: + id: 5c57172beee9 + last_write_checksum: sha1:7f178d8e03a3f72c2c44313ab3c50199268dc7b8 + pristine_git_object: 2822651ee69ae03784b5dada6d7e5e1859198770 models/components/applypatchcallitem.go: id: 4066ee401823 last_write_checksum: sha1:9ddc34289f4cdc3014e6bbb050ff5e1ca8303769 @@ -5917,34 +6293,10 @@ trackedFiles: id: 0c7bb0f85f5b last_write_checksum: sha1:67ba8d37748e51f231882d5c213f4361d10b60c4 pristine_git_object: 8620c1605cc7ba5cd6c04c51972e48eea4caabc8 - models/components/benchmarkpricing.go: - id: 2ba35fed3293 - last_write_checksum: sha1:0905a7755a3c44f523ac3f1196528018f7ae2155 - pristine_git_object: c09eb349c5acbfd9fbf24544ef9b667acb23425e - models/components/benchmarksaaitem.go: - id: 3cbd54652d85 - last_write_checksum: sha1:7db5f48da9d5a8981065354736e845167467944e - pristine_git_object: 0f7a78942dac8d86de27d917989d4db3e958c012 - models/components/benchmarksaameta.go: - id: d16e67e936c5 - last_write_checksum: sha1:65542d5b9ad1231c13925d9da6a602f075dd3714 - pristine_git_object: a719dc066e6c34ff8d8182b221c70899fe569fa7 - models/components/benchmarksaaresponse.go: - id: 90e35052950a - last_write_checksum: sha1:2f45e0a775cdea7fe884b6d70771b6c63c9d1097 - pristine_git_object: 2ee03e3b6360515937257cd822d17b38b300971e - models/components/benchmarksdaitem.go: - id: b0c4ce44e852 - last_write_checksum: sha1:02e67ba36fcf38789d970c83cc78c1abb0e6268e - pristine_git_object: fea8647b9e9421c4d63001faceb59acc4adb4d71 - models/components/benchmarksdameta.go: - id: 75748931ff52 - last_write_checksum: sha1:a343bbc3a55da10bfbe26565749d928b153f2cac - pristine_git_object: f0e4622877bf7b06791007e534ffcf238a2b26ef - models/components/benchmarksdaresponse.go: - id: afb518fe520a - last_write_checksum: sha1:a1e46cc8c2f69eab9f15a26316406daa4ab06856 - pristine_git_object: 253dfea746fcad4a5e64af0f0ec889de9f75869c + models/components/booleancapability.go: + id: 80cc0854286c + last_write_checksum: sha1:8dc45e20d89992fcd46d714056fcebfee550f1f8 + pristine_git_object: f250679c740df583202027201616f866ce50769c models/components/bulkaddworkspacemembersrequest.go: id: 5746ef7e0134 last_write_checksum: sha1:24a4d4d5141fc0d1b60585eaba64d760ddb28e94 @@ -5999,8 +6351,12 @@ trackedFiles: pristine_git_object: fe179d527f9b877e8812d18c2c8989ada720c7b8 models/components/byokproviderslug.go: id: 13d55e8b344b - last_write_checksum: sha1:ba4e515da13ec806aeed24134acc5587643c01f5 - pristine_git_object: 189516f751f78ec9bc16958a7417fdbb8e9d441f + last_write_checksum: sha1:faf24d21fee6a0c27743f5823ec5e6d4f332c4d8 + pristine_git_object: 0df4797acbe7fd733afdc52359389e15b8f23067 + models/components/capabilitydescriptor.go: + id: 61addd6d2068 + last_write_checksum: sha1:2c89a741740517ea931188941fa2160212d4e75e + pristine_git_object: f144c538db5a8f4cf3410f93102b3ca60b8327dd models/components/chatassistantimages.go: id: fea229766390 last_write_checksum: sha1:15bf317741f174be05eddb1c6e3eddb5c597e276 @@ -6099,8 +6455,8 @@ trackedFiles: pristine_git_object: 01d9b75ce8c5d57a84a8b3eb39f6d803c6396116 models/components/chatrequest.go: id: 3e77961c64d1 - last_write_checksum: sha1:653993113c26e5206d1c6e917ddb434f0b2029f7 - pristine_git_object: 59fc6d48c76b6c6a3bf74efe3f03ea7230fc1c21 + last_write_checksum: sha1:87a787c5f7e922327c4e189dbf30c62aba94d0f2 + pristine_git_object: a161bfb0eecb4f194cf8c5e0024bca54d4f73dbf models/components/chatresult.go: id: c5506a624942 last_write_checksum: sha1:fbc9ac21aee30b5929647d10b305707f3168ce53 @@ -6119,8 +6475,8 @@ trackedFiles: pristine_git_object: f821fbc871d581cf21d7f505082940c7eb284b2a models/components/chatstreamchunk.go: id: 3d9cf5ae4f0a - last_write_checksum: sha1:65ae462bc60e771a476ab3bc77e7f8b6d4d46749 - pristine_git_object: f371c556318cf044cfc534465a96fe152d054d9d + last_write_checksum: sha1:3b25734d2fdbce24c1f3213ef2f0100c76c97519 + pristine_git_object: 2c4cc4592ec72051a8237113a827a9068f14c3c2 models/components/chatstreamdelta.go: id: e9a27de74b82 last_write_checksum: sha1:8e87f2447cdffd56c4ff700663276521b0b81742 @@ -6163,16 +6519,16 @@ trackedFiles: pristine_git_object: de32b6c75b877f725c0b7b8cfa3cfeeffb15d9ca models/components/chatusage.go: id: a16b8067c6dd - last_write_checksum: sha1:5a3246e11fa4d44d6275d31251398b3ce46a9cc7 - pristine_git_object: 9bde0130ecea438a5e5a4cae2c33a0d96c204216 + last_write_checksum: sha1:32564368af55260a3494e41b44d148e842171c79 + pristine_git_object: aa4c28018f6b7647e51ce4125ec73fe5df3cc5b9 models/components/chatusermessage.go: id: a8e46d722323 last_write_checksum: sha1:1086c112d09dfdab87d1493939cfb0b10e248704 pristine_git_object: 0dcfa46f7313951143efcd2a685cd610b1f800fb models/components/chatwebsearchshorthand.go: id: 1b953af26524 - last_write_checksum: sha1:a96c2f1aaf22452b8e01a9ee41b37c8b3837e7a6 - pristine_git_object: b3ccbe5696224fdf7a89d55f4a8f78f321ebc925 + last_write_checksum: sha1:1a6004b07add1dd7d3f1805eb354cf005c475f76 + pristine_git_object: 1da7102d0c342c2c4674ea1d1cc7f29e87b3889c models/components/codeinterpreterservertool.go: id: ad944e4f49d4 last_write_checksum: sha1:2070ae6142f9c69f5dda3dcc43e3499b1367e8dc @@ -6271,8 +6627,8 @@ trackedFiles: pristine_git_object: 7de09d6f066051f3b912fcbe110cd315e7cc71c4 models/components/costdetails.go: id: 7a2de524433d - last_write_checksum: sha1:c3e2b2ef75ac5135767d1e1a756b789d890f415f - pristine_git_object: 67bc4ecb97930b69427d8a9761d2d65f536afd25 + last_write_checksum: sha1:a97e1f8bc5db6b9525efb6d289104771cfd134a0 + pristine_git_object: 064351f779bf52b4160c95d76e6c87b2e8cf7082 models/components/createbyokkeyrequest.go: id: 43a54e33e674 last_write_checksum: sha1:6aca2c75c9c19b16c1822fb6023668f27d627e97 @@ -6341,6 +6697,10 @@ trackedFiles: id: 1f7a2f9e50a4 last_write_checksum: sha1:99655080d90222db9129c0b74f16eb7906add3f7 pristine_git_object: 3c903e1e351f1e15e9fe8c7a35122115f36c5b5b + models/components/debugevent.go: + id: 6026f8be8a88 + last_write_checksum: sha1:58363af635e49f32c35355747848473caa537bcb + pristine_git_object: 7a06ffb9b06ef49b49c3575be910fb9260bf42df models/components/defaultparameters.go: id: 10efe2631c2c last_write_checksum: sha1:5b1129447a5d31e9195bc1770335d78de6d96d9a @@ -6357,6 +6717,10 @@ trackedFiles: id: 0b3e1c42bae2 last_write_checksum: sha1:91bef28ec6f2eadbe775c20e3f8603c397fca250 pristine_git_object: fbf6d743ea2bd022bddfd18327413b2542068a59 + models/components/deleteworkspacebudgetresponse.go: + id: c1586708ba92 + last_write_checksum: sha1:ff5e66bacd74a5105a757027189585596a858cf5 + pristine_git_object: b523dd63d672cb1fbaaca0888b6d595a303cbed9 models/components/deleteworkspaceresponse.go: id: cc2779b9ed54 last_write_checksum: sha1:db55544eddc54f8fe932612c2fed2a2d129562e6 @@ -6381,6 +6745,10 @@ trackedFiles: id: ebfe36c58a5a last_write_checksum: sha1:f67d681fdb81f324585a35cb03893a9847fac4a9 pristine_git_object: 2726eccc5ad1134c26800006a83ed50edbbcb2fd + models/components/enumcapability.go: + id: 06d0c5a0f6de + last_write_checksum: sha1:16d5c0e9442d812f52ac90134eebd56d299d3af2 + pristine_git_object: 73f9e6173a6774ae683d3234e18be0ce05411051 models/components/errorevent.go: id: a4bef7aec62c last_write_checksum: sha1:f1e4f573061ba1a0eee0208e029b32f75212a4dc @@ -6495,12 +6863,12 @@ trackedFiles: pristine_git_object: 1ea5a756a2a475b432b444907ce37354ad60297d models/components/fusionplugin.go: id: ad7a63c688b2 - last_write_checksum: sha1:70ea16709486fcaef6599ffbc705ffb65f0509e9 - pristine_git_object: 79d4b100dad65c96f7741b5312f1f31d90e92497 + last_write_checksum: sha1:1193fdcd08001fb4d07acd02ae312ef86eb483c5 + pristine_git_object: 60c47fec46b501a7be33fbc14320dedd96361c70 models/components/fusionservertoolconfig.go: id: 11a6494de9f7 - last_write_checksum: sha1:1ebadf8a9792e119ae6c49fe2e25d1a98e45ccc6 - pristine_git_object: ad121f2fd7b04360594808277520a11a4a52baeb + last_write_checksum: sha1:0f43a7f8bc0507b879947327db14fe8ea655a404 + pristine_git_object: 33b210663068b1e252af74ea6c5b59af8b8a634c models/components/fusionservertoolopenrouter.go: id: 71c8e6ea7f3c last_write_checksum: sha1:4a1e878958fb2c8482b21504335f48f9d729e515 @@ -6553,6 +6921,10 @@ trackedFiles: id: d7d2f3af7a66 last_write_checksum: sha1:54778baae51a04d543318691c77c9c7e616db448 pristine_git_object: 1e6b1ad85bfec07526e242c3e0dea5207b6be52e + models/components/imageendpoint.go: + id: 6907174f89f5 + last_write_checksum: sha1:60352c0fecee6fafb554850e5e96dc02e4631527 + pristine_git_object: 9ab4c9e59a40fc8cefc4ddccacf68b74676e4535 models/components/imagegencallcompletedevent.go: id: f23e0523ed32 last_write_checksum: sha1:2ca37236f146a07b1a7819361d43d24a251bda56 @@ -6569,10 +6941,22 @@ trackedFiles: id: ff378a1ef566 last_write_checksum: sha1:d88dd611b31429dffe9607b5a3f5d915203416f9 pristine_git_object: ccd898823b4fc8e4083b2c18579191742d8847cf + models/components/imagegencompletedevent.go: + id: 1b8cfd75301e + last_write_checksum: sha1:9755a728f83eeabc20398af68d905e83cc16ee20 + pristine_git_object: 8c49e5d6302ac08c96c0cc610bedd8803a5e3455 + models/components/imagegenerationrequest.go: + id: 2a1c3242c506 + last_write_checksum: sha1:8ff6b3ec1d7da6043115d1e20d7aa5f01c78f203 + pristine_git_object: f261b0d78ccefc88895a6cf0e7dc8c113b82ea9a + models/components/imagegenerationresponse.go: + id: bfcc44d3ad67 + last_write_checksum: sha1:2611ac211acb397b47a0ca26948effc4c559e56d + pristine_git_object: 6ad5d69557f553d8e620221f3c972a66ffa1ac01 models/components/imagegenerationservertool.go: id: 14b49b05209e - last_write_checksum: sha1:eeae885a3cce17305552a2689097929e147776d6 - pristine_git_object: a4335cae56e8b3829907f9981946a7afdecb9471 + last_write_checksum: sha1:7b93a2148f3fece3d2a399db0d8e1d72ab16685e + pristine_git_object: 963b4d4a1dca5e26d4c2e3185aad713fa7c173ce models/components/imagegenerationservertoolconfig.go: id: 5915440f8caf last_write_checksum: sha1:74fdd147e9e634e37afd2c8c1e29d1456be598a9 @@ -6589,6 +6973,46 @@ trackedFiles: id: f0829c096b15 last_write_checksum: sha1:b0538fd85c7deec0f1ec78f233f01792491e37ac pristine_git_object: 540864bf9a36466b675d432426bfc8d0073eb940 + models/components/imagegenerationusage.go: + id: 5e9f4912f698 + last_write_checksum: sha1:1604ef33db23ee706c45ae1001204de3ca5748c6 + pristine_git_object: f6193e2abab4a7f9da67b402d7d9c7bc1a45a405 + models/components/imagegenpartialimageevent.go: + id: 784c79d19ed7 + last_write_checksum: sha1:3bffe75763158e327c938e9e8d7ae66eec758778 + pristine_git_object: 002ab9b229329bdb679c7d7338eb5646cf51858e + models/components/imagegenstreamerrorevent.go: + id: e7dc2bd49b5b + last_write_checksum: sha1:88e00fa68076500e20c4c9f6788a81441d42ce64 + pristine_git_object: 07865cf9fb8e4b9ace46f74cafa3c78d71069ba8 + models/components/imagemodelarchitecture.go: + id: 683640dc8244 + last_write_checksum: sha1:a6c3f78fdc00ab0bdd031a16fdcebf8a9f0befec + pristine_git_object: 77a2c8190189e0dfb9a81c5d37deff7407059e6f + models/components/imagemodelendpointsresponse.go: + id: 95bc278c9a0a + last_write_checksum: sha1:d75ad9019ebf53e05e0822d57e8e8b8f83769766 + pristine_git_object: d079e3e489d767efcab1ad952b326b8d6df7e11e + models/components/imagemodellistitem.go: + id: 9dd8f497e7ba + last_write_checksum: sha1:a8923ca76f0141e92f3afc361d33724d1f4edcf2 + pristine_git_object: 94fb73bce60f8eddbbbe94ae0dffeda65cba52f5 + models/components/imagemodelslistresponse.go: + id: bcffb32e0776 + last_write_checksum: sha1:db874a80a5aa9ea0d4c3a13bba20f65b97b99726 + pristine_git_object: 3ba400f98e926d8fa4f99a27b14c8c0e46f13d3e + models/components/imageoutputmodality.go: + id: 66e4b7000f57 + last_write_checksum: sha1:fbd31a8d6099b3e3fe48975434ab9ad443acfe81 + pristine_git_object: 99d69e8d3609a7cba0d679f12c4c081b1f16e916 + models/components/imagepricingentry.go: + id: b30e0f10bd90 + last_write_checksum: sha1:7296dd4d243354ef177f911ee9e599f770d71f13 + pristine_git_object: 6910fb6979643071fe928bf77cbc8ff3c7aa204c + models/components/imagestreamingresponse.go: + id: 14779060e400 + last_write_checksum: sha1:2a84e7f3df46da625800621330954a280e79be52 + pristine_git_object: f1a91df378c06a499693280c20cc0348f70ddb80 models/components/incompletedetails.go: id: ed9e8e4398f1 last_write_checksum: sha1:834c3c29105a57a3d58d777200dde411a45f3b3c @@ -6619,8 +7043,8 @@ trackedFiles: pristine_git_object: 8e38594648004638203af9762846ed39a7d71c6c models/components/inputsunion.go: id: 9cf7a037c7f6 - last_write_checksum: sha1:f3ee0f6e0d026a2516b4f7c057fd15af66e54fff - pristine_git_object: adf74fb63bf48974a74db453fe5ec962def51c80 + last_write_checksum: sha1:faffa2c7440057c02b603ba8a14d2bd1a2cddb60 + pristine_git_object: 1eb67f71c10c24d6cde76b77eed253ce4ab62ccb models/components/inputtext.go: id: f421355aad33 last_write_checksum: sha1:c8b208412179a4220f702325379237fc47d64979 @@ -6651,8 +7075,8 @@ trackedFiles: pristine_git_object: 12f243851b25ac0dd4997cb7240018aa64de4192 models/components/legacywebsearchservertool.go: id: 368653a391fa - last_write_checksum: sha1:0ac6bf7d6ca74ec76051623663e84924f8e7982d - pristine_git_object: 508cd8f2f081eed27660772adb1fd5aa96834688 + last_write_checksum: sha1:22930d4f12ed0db3f23e4b5621f86f32ecf3f43d + pristine_git_object: 7bb2a874a32c2b04db8ae47477efb7f45cb6601b models/components/listbyokkeysresponse.go: id: de66268703fa last_write_checksum: sha1:7aadfa5921ec0dce645fce7b4a62f1260872bc75 @@ -6685,6 +7109,10 @@ trackedFiles: id: 0a4667273a20 last_write_checksum: sha1:7f13d13e3741950a5b68a22aa734d196f1ad97a9 pristine_git_object: 7063932d4e728d0678c901acc8382e7aa25ac0a8 + models/components/listworkspacebudgetsresponse.go: + id: 5c4fb3fd8183 + last_write_checksum: sha1:f21c95e69ee04aadfc28a433c869d9fbee89371e + pristine_git_object: 995435f531051a0e89462a29f1b6c2af3135da79 models/components/listworkspacesresponse.go: id: 81eba39ab7bf last_write_checksum: sha1:e8839ef3dee6df2c308da509c447d575ad831558 @@ -6739,16 +7167,16 @@ trackedFiles: pristine_git_object: e06eae5ce6d393fe7f279ee8af0509beb2d7c028 models/components/messagesrequest.go: id: c3efb31bbd81 - last_write_checksum: sha1:9bd1ad194821e297f0d4c0b430ce76b15d5a6cb0 - pristine_git_object: 4a25c189ecb676e60898348b275da9133e572be7 + last_write_checksum: sha1:6c5fcfa0bcfbd4d61f451031850039453e41b241 + pristine_git_object: 9edb5873393e19dbcc4b140f5ea6ba66edfe0e93 models/components/metadatalevel.go: id: e1cfcf1b9480 last_write_checksum: sha1:dee5e6934d706fb1d9154b630fbed34b3257e868 pristine_git_object: 2f70d5178b9ad68926c3a8b23eb16629272dcc04 models/components/model.go: id: 8dd64e4e5c29 - last_write_checksum: sha1:566677950e7d020b147c8e6ac0367f73dd7ae5b6 - pristine_git_object: de775ae834ad48d5200fb07ebf635cb8473ab3fa + last_write_checksum: sha1:87c1e7fbb9fc16a0e0ca4f1746949849251bee3d + pristine_git_object: 1ba98e8e9b6cb7cce1b9409f0a8ed997ca9eb77c models/components/modelarchitecture.go: id: f30d391be6de last_write_checksum: sha1:aa7ddde5b83335509846b95facb4d8826ccccbd2 @@ -6765,6 +7193,10 @@ trackedFiles: id: f54a9edc5bed last_write_checksum: sha1:564598c394bc8b823d8105da0ee218f6ec226ae0 pristine_git_object: f6693c8531b1f610b7d460e0a3d77097485b6b08 + models/components/modelreasoning.go: + id: a5e83c843a59 + last_write_checksum: sha1:4fa5359840e59ba7614c144dccd00187d71c18b2 + pristine_git_object: d20dff9fee2a55967703e479e6d9734cbf94156e models/components/modelresponse.go: id: 38393d8a034a last_write_checksum: sha1:e98080ebfd4525128c852a445f1144236c0732af @@ -6791,8 +7223,8 @@ trackedFiles: pristine_git_object: db1ee52fd77b1d1d506e23371cbfb17debe85e1d models/components/observabilityarizedestination.go: id: ed55e9edecf9 - last_write_checksum: sha1:338cc5f5d2cb435494c56391959e5cae4c2f9198 - pristine_git_object: 8084d1233fb9e7a707efce3e0f2d59a98cead00f + last_write_checksum: sha1:f0477a3e15d84e9685e3af7b14d7ecb4e6f140ec + pristine_git_object: 50b7606f80ab6f9eb32e379a684eaed871355204 models/components/observabilitybraintrustdestination.go: id: d6a2616da4de last_write_checksum: sha1:2d8deba05dbeeee49198a75b59367cdf386ff3c1 @@ -6915,8 +7347,8 @@ trackedFiles: pristine_git_object: 5302aafb24e0e2c27115b7f36c32b49f7fda9ad8 models/components/openresponsesresult.go: id: 0e5a110390b5 - last_write_checksum: sha1:431a5ce9c4334e0067d26b1902253b28958271d3 - pristine_git_object: f9cef544dd9442ded79fa3fa0527c83e62c9253a + last_write_checksum: sha1:c5cb9e31081cd6e30686134dbb4a27a9585e5988 + pristine_git_object: e3784ab805333b7620dca56af19be4a808423b4e models/components/openroutermetadata.go: id: 507a9ac36dab last_write_checksum: sha1:6278412ee9fb24864543f185712ed9183705ef83 @@ -7135,12 +7567,12 @@ trackedFiles: pristine_git_object: d12c240e484519e08dcf594aaa48e53219b64f41 models/components/preview20250311websearchservertool.go: id: 2b4bd0b8009f - last_write_checksum: sha1:3573c046f1d9ee182168e8c3ef79d837ecb57ce8 - pristine_git_object: fc6f40e0be51c48bca9606315fa9476ef707b224 + last_write_checksum: sha1:6881038203a1b22e27fff065e0f175d67dbbc122 + pristine_git_object: d7f703de3c2051ff4f792ebd29bb3a385b25d582 models/components/previewwebsearchservertool.go: id: a53edaa8bc47 - last_write_checksum: sha1:a1505f78c4b50ebc19d874e878b47891e9051e18 - pristine_git_object: f22d7fdfc493cb6cb5b1cfc377b54a4085af84e7 + last_write_checksum: sha1:d311554cacd7338ea48de25680351845dcf8c244 + pristine_git_object: ae2c685b5f9bf16db86bdb7a33bc9a42862e0d3d models/components/previewwebsearchuserlocation.go: id: c4cfcd741d0b last_write_checksum: sha1:b22b21f5e3b7584e5c68f03844de38166c2eda9f @@ -7151,12 +7583,12 @@ trackedFiles: pristine_git_object: c50b74b336dc92f3e72e52d5e3954ae9554aeee1 models/components/providername.go: id: 7ecf3a6869c5 - last_write_checksum: sha1:695536e62b7f1d91f6514aefa92b1eb9b2d246a8 - pristine_git_object: dd2b81e07612dc36a68bc9388ca5c00e1a421d16 + last_write_checksum: sha1:1009f4db7a26c55fba40b19a85be6a5c6de0a5f5 + pristine_git_object: e2adc9dd161f866d80c6f5821076c9936fd41793 models/components/provideroptions.go: id: 83f8e5feb563 - last_write_checksum: sha1:8d02af78fb872011e23285b2c9ecb07fd13715be - pristine_git_object: f0b3640b6599a921fb838ff8a8eead39bfe89da2 + last_write_checksum: sha1:90d68f19a6790839a28a1cdc104b9b657c8a3d98 + pristine_git_object: 632088c612b47afa67d6ad61a48665105b0eb90c models/components/provideroverloadedresponseerrordata.go: id: 4e228708c428 last_write_checksum: sha1:4ecd1f1efbdf106340872d720ebb8bb9891be205 @@ -7167,8 +7599,8 @@ trackedFiles: pristine_git_object: 5295c003fb6584b1f083d07ee052e13913b55b58 models/components/providerresponse.go: id: d7f4a6aea47d - last_write_checksum: sha1:a318d1cb76446ee0fc5e545a2f1eb86b8af91921 - pristine_git_object: 78d4b9d2645335ca7e1b004db3a524878ce0c7da + last_write_checksum: sha1:7978b9e408e4a9299b765ca1fce3ea2835b1190a + pristine_git_object: 3ed35f0bd0c8c48bc2261886f3248079a69c398a models/components/providersort.go: id: c183c158e614 last_write_checksum: sha1:d56d1125483e113e3f1c1cb7dc566ef0837b485e @@ -7189,6 +7621,10 @@ trackedFiles: id: 601f1d07ead7 last_write_checksum: sha1:6908b4e7f3d9ae701504858de96ed83e5d9e9283 pristine_git_object: 294b4f82f847f0fc7f4a5bd6ff7be54ae068e5ac + models/components/rangecapability.go: + id: f13340967c64 + last_write_checksum: sha1:b6ea82ff69b530af14728f6860f731a309d11161 + pristine_git_object: 7bbd95b390d4f473e9402f93c27f31a75f8b44de models/components/rankingsdailyitem.go: id: 47e0cc69ff3f last_write_checksum: sha1:68a7f9474646f624844eed7e18417184ec5b2a01 @@ -7231,8 +7667,8 @@ trackedFiles: pristine_git_object: f23b4b8eaaaa0c597e98db0e9e39ad8d59db5d96 models/components/reasoningeffort.go: id: 78b8cd82a1f0 - last_write_checksum: sha1:528486d05ce94ae7441667c02c5403015698d8af - pristine_git_object: 54c76d0e937d92ee86f5e143d7ba75d22c498151 + last_write_checksum: sha1:1971867f3148afda0e26c65e171827058deb9005 + pristine_git_object: d982d284425d408ff3d2cf667432bab97757cc56 models/components/reasoningformat.go: id: e5f348ffa489 last_write_checksum: sha1:23c1a7ca3ce557e617c3c84911433b58905eeae3 @@ -7299,12 +7735,12 @@ trackedFiles: pristine_git_object: 3cf92771c9f58c8259dfda5ea5d91161d0c84519 models/components/responsesrequest.go: id: 3fbf1b29b488 - last_write_checksum: sha1:2625bda6a167a8e245c044007791a4743bb622a8 - pristine_git_object: 0c731d2c68dd2d105351129664afbf8286c0e8c9 + last_write_checksum: sha1:c5042e513d37176305a48e7b3c3adf7dfb205e1d + pristine_git_object: 3b08c5cb781c013b906b566676db08acbffe3a82 models/components/responsesstreamingresponse.go: id: f5d13584dda6 - last_write_checksum: sha1:3d7a6b79b2e44dd826d2a0521c1c8deac009e13b - pristine_git_object: f0261d23c3583aac3cb4adc8649898812aefd678 + last_write_checksum: sha1:42cb41bc27e970f9e5a751daebbb7817f9a12d41 + pristine_git_object: 0c7c96ddf3b1776ce5bec9f75744c7c7c19f78fe models/components/routerattempt.go: id: ea8721067f84 last_write_checksum: sha1:d060e192fae82c13cf52f5fcec30d00891ece0ab @@ -7371,8 +7807,8 @@ trackedFiles: pristine_git_object: 696bbae97193bc399544e814a3e9d99a24522909 models/components/speechrequest.go: id: c5f83d3285eb - last_write_checksum: sha1:91df23f2e273b23983fc0955b1432d9b8596d3d6 - pristine_git_object: 45925c3ef367f98ef2ab6c5450f7c347f50084e8 + last_write_checksum: sha1:7b0adca2923d455e54524689eb1454685a724b4f + pristine_git_object: c09452887824671f186ff5032ed23243fb916ed1 models/components/stopservertoolswhencondition.go: id: 6c12d61377dc last_write_checksum: sha1:600037f2c92bb83b31cc6469a5ce9a169ee82b09 @@ -7403,8 +7839,8 @@ trackedFiles: pristine_git_object: 25117e63eff21537e97558a7bc7b4a8a57adaa54 models/components/streamevents.go: id: 35976ae7fd7e - last_write_checksum: sha1:3a0f5e21adbbd56b2c0884856d6c861775aa3e90 - pristine_git_object: 4bf54407534706d8579e117178864bc948762968 + last_write_checksum: sha1:f5cb31015e5d272287bf957e81b84cc4abccd74c + pristine_git_object: 974d70b1551642e99263a6415fdab76a45872b17 models/components/streameventsresponsecompleted.go: id: 99336b4906b3 last_write_checksum: sha1:ade5a8865c22b50b3101ec4c159a702e2e553643 @@ -7439,8 +7875,8 @@ trackedFiles: pristine_git_object: a9a3a6b0190833aa00b539c335aa763d8a826525 models/components/sttrequest.go: id: 307b6fe641a4 - last_write_checksum: sha1:7365eb3e30c5bf71283fd8d959654156781c111a - pristine_git_object: d54ad24703ee310fcce1c5d9b2f2c6dd6551f6d1 + last_write_checksum: sha1:27c963d5ab02fc644d04f129d92a9e0623d1a3f2 + pristine_git_object: 72c2ae133a056ba2ff9d27ac45aa65c54cc17360 models/components/sttresponse.go: id: 7af2c26acdda last_write_checksum: sha1:a4b1f5e894f1a38e4cbe032f420c4fce3e516f8c @@ -7455,8 +7891,8 @@ trackedFiles: pristine_git_object: 5149eb70a91f2ea5f2b84be607794051ad907f64 models/components/subagentreasoning.go: id: 3df30637fe69 - last_write_checksum: sha1:d454fa724171bc1b3efc17bb98ce131fa3da7c94 - pristine_git_object: dd46843901d96196196a86a5f569d1d3271f7926 + last_write_checksum: sha1:5b7579ca7cdb8b48d0aec4698af5cb9230304c61 + pristine_git_object: 970d48240d0620bc28bfca0324b9e4ea8c9ca868 models/components/subagentservertoolconfig.go: id: 5232e3c874e6 last_write_checksum: sha1:9dbedb3f519978a85bc605dddcef86701f897179 @@ -7465,6 +7901,22 @@ trackedFiles: id: d1d25913d484 last_write_checksum: sha1:cca047030738c9a9dd88d09ae58f64d5b1a81a28 pristine_git_object: b3e5b747c8195cea63581f3fc1dd068df8a512b3 + models/components/taskclassificationitem.go: + id: 760f562ef93a + last_write_checksum: sha1:0bed7435fc8a53352287e79868d2f3bfd105b937 + pristine_git_object: be6a38b60f2b377dfd4e9b9a198f5886112181d6 + models/components/taskclassificationmacrocategory.go: + id: 49b6665c580f + last_write_checksum: sha1:77b82c8027e3d9becae44e889fc568d733c5079c + pristine_git_object: e822cdb21126f5b6841a62fe728f2c8d44855a68 + models/components/taskclassificationmodel.go: + id: 1d719168d705 + last_write_checksum: sha1:d781600026485fbe87bebbb5ab37bbccf117ed86 + pristine_git_object: 96e5cc0372be88df9d95b04e611ce7828a5aa2b0 + models/components/taskclassificationresponse.go: + id: e7d506599cb3 + last_write_checksum: sha1:69a1970dfc3422fe544a394cd34d5e33e57bfcfb + pristine_git_object: 5a8fb8396a9a561b0aec31e333c5e1fdd2c3b89e models/components/textdeltaevent.go: id: 325b05d9f7a2 last_write_checksum: sha1:99ee62814528e0453c96920c3f515fd12235ae5e @@ -7505,6 +7957,26 @@ trackedFiles: id: df4b3fa1c801 last_write_checksum: sha1:794c247ac70111de05f9cff9b72e749ec0f1dba0 pristine_git_object: 7e45efcb057156216477783b59d8294528e42bec + models/components/unifiedbenchmarkpricing.go: + id: acb33ab7b5b5 + last_write_checksum: sha1:34d543ab09b8cb8b02982591b784f037a4400185 + pristine_git_object: 97899b63ebb744da4f82d774efd9eca5b813b5e3 + models/components/unifiedbenchmarksaaitem.go: + id: 41b919e55016 + last_write_checksum: sha1:7b5e9bc4d35026eca969a0f46842476085310ecc + pristine_git_object: 5dd1dbc4f122b6405e53b3dedd909f2f0ba5c403 + models/components/unifiedbenchmarksdaitem.go: + id: 7b63d1f5be4c + last_write_checksum: sha1:69eb90ee7c612bcf63c3e6274e427410998e12b3 + pristine_git_object: 73002bfe54127b1c3eb54fa019914380ae8e3b01 + models/components/unifiedbenchmarksmeta.go: + id: 00d37f9d8f10 + last_write_checksum: sha1:9bd69177a777ac613e81c7158c537ca728b9d43f + pristine_git_object: 787b200e71ca857c088739cbde2ed18a062f71cd + models/components/unifiedbenchmarksresponse.go: + id: a817f78e9766 + last_write_checksum: sha1:3323c37fd945c838b2382a806482ae838089933f + pristine_git_object: b851d024f6aa2b70506ae8eb96be526aebff58ea models/components/unprocessableentityresponseerrordata.go: id: a8d1dd41f07f last_write_checksum: sha1:f530d32e638af837f70983e2ea2d148942b7dedb @@ -7541,6 +8013,14 @@ trackedFiles: id: 878eb246afc8 last_write_checksum: sha1:cb1883a5d50d18a8ec7046dc2b4d8a5ecc3460ab pristine_git_object: c0fdc58cc3b883bf67960e80e21733dc0cf1f3c7 + models/components/upsertworkspacebudgetrequest.go: + id: 3b72201bdde8 + last_write_checksum: sha1:b83eabadd1b77318e08d352015ecb3b66c82a11d + pristine_git_object: 92c3fdb7f9803a73aaedb208be94502132589f6e + models/components/upsertworkspacebudgetresponse.go: + id: b197df70f2de + last_write_checksum: sha1:43e59d6f9a65e4fd87f5ed8b98c280959456b689 + pristine_git_object: b2f0a338e17e18ae689041357c36dbc1a0c322c9 models/components/urlcitation.go: id: 19a2e93fc384 last_write_checksum: sha1:5228e830db457dd3b9178da373cf3470df5f7ba3 @@ -7551,8 +8031,8 @@ trackedFiles: pristine_git_object: e97f0f8d1507e076871b9c3644c5fa556157d209 models/components/videogenerationrequest.go: id: 11162ee57e53 - last_write_checksum: sha1:7e5422d41f412675b1bd63d66c68d85365fd332a - pristine_git_object: a4e976c6fe0099f63c7dc01f45457fd96b4f867a + last_write_checksum: sha1:b2e07a9a3747dd263fd8b2efbfcf0016e30ec9cf + pristine_git_object: 5728f6e9bf6b472cbc8ca604d6e4d0ed764555a4 models/components/videogenerationresponse.go: id: 5841b7ef3de9 last_write_checksum: sha1:b1196ebd395a89b9f03ce3207738055473c33532 @@ -7599,8 +8079,8 @@ trackedFiles: pristine_git_object: 0e22a51a6c62c03461ebdfc1f6599efa446517c4 models/components/websearchconfig.go: id: d3a34a5d31fb - last_write_checksum: sha1:36071cab545bfaf8030d29b2c5e2fb0a3eae9ad7 - pristine_git_object: 333e61f1e8de2397e770996d1262687cdb85a610 + last_write_checksum: sha1:25e20068bbd4ec059de8cf7f4eb3cc1555dbfdd8 + pristine_git_object: 227901c4c64fe3515e4c471131c67cd782f8bd89 models/components/websearchdomainfilter.go: id: 11d415df43eb last_write_checksum: sha1:3c9e152e302d95e428b5d660ebac948d08ab8ef4 @@ -7619,12 +8099,12 @@ trackedFiles: pristine_git_object: 57d22b299a08aa9b656814c0ac63ff868595e4ce models/components/websearchservertool.go: id: ef83237199dd - last_write_checksum: sha1:2852a51161d1eef23dd50a96eff20400789b6bea - pristine_git_object: 566ec60c6cd421e76913a02890609fc71ddfe4d0 + last_write_checksum: sha1:52fb87b2de13df0b5ad34957a7222b6750c80365 + pristine_git_object: 6f2dc2be160f05cca1b4e25cc6de9f692da221b0 models/components/websearchservertoolconfig.go: id: e1ffef2ac665 - last_write_checksum: sha1:0f38b4b62cf5eaa484be138f5c4806c391b4a94f - pristine_git_object: 95cb53ce3ddcdc5e84a82c2ddbb0b2688a4f17a7 + last_write_checksum: sha1:6f6206898e3ec04a66a5cbbcdf6ea61ba251a3f3 + pristine_git_object: bfa27d1303fbe68a8bf70a59153e67f5c4e6cdcc models/components/websearchservertoolopenrouter.go: id: 94059bdab397 last_write_checksum: sha1:14efe1e2bd4fe6643913542d1e82e3f7b3d2b099 @@ -7649,6 +8129,14 @@ trackedFiles: id: "5823361002e2" last_write_checksum: sha1:91369623426b1e7ac18e9e4c069a92981475274b pristine_git_object: 8044ae4444b356e1d59eb464fa0e2d371a1cc5cd + models/components/workspacebudget.go: + id: ecb4d9612e06 + last_write_checksum: sha1:0c7678120abbcabe36f147ff233b10106218975e + pristine_git_object: 5c9d8e5f4d5f751182e8d4826634408d4076500e + models/components/workspacebudgetinterval.go: + id: 005912394dfa + last_write_checksum: sha1:6af08a84eacaab51b2bf209d0f9dddf87a33f23f + pristine_git_object: fa37ab0de3569e26ebb8d04ae2c8ef200902fccd models/components/workspacemember.go: id: 5565c176e512 last_write_checksum: sha1:815c205fdc5811f38e0e912d616af5ebef9207e6 @@ -7683,8 +8171,12 @@ trackedFiles: pristine_git_object: cac06619023d688ec8e4b00396f120c8e8cf6790 models/operations/createembeddings.go: id: 77f55f6edf8b - last_write_checksum: sha1:184a5b05deaf4b0054d80cd3e36118ea5032547f - pristine_git_object: b652c506a93a3600fffad2e499fd2325da98b062 + last_write_checksum: sha1:e22917744884083497a8c91484ff261ba8318036 + pristine_git_object: d0b22149becbfbf25a6ef30655c67a9b5387f781 + models/operations/createimages.go: + id: 5cd6b0de93cd + last_write_checksum: sha1:e8d08a944f81f9fdcb5121143e2c3be7be8a5b48 + pristine_git_object: 876fee75f19d63b104761cad5e90915ddbd0273a models/operations/createkeys.go: id: c511faeda898 last_write_checksum: sha1:b97565974c942ccda2e396ffb7082322b50bdc75 @@ -7733,6 +8225,10 @@ trackedFiles: id: 8f02b59b9869 last_write_checksum: sha1:6c0181481749af01be3d10d14d42c2ebd02dbde2 pristine_git_object: 20af63dfd842ee929546ea2d4f9060e39aa85e9c + models/operations/deleteworkspacebudget.go: + id: 0d7a80f7f117 + last_write_checksum: sha1:0c7e8b238e6cf4c4db21d9d169126056b382a7eb + pristine_git_object: e478ee3772362bf798e8bad605a25822c4978f07 models/operations/downloadfilecontent.go: id: 0687ce8cf88c last_write_checksum: sha1:40ba42049cbdfc0fe1c95c34189f9009089c25ab @@ -7749,14 +8245,10 @@ trackedFiles: id: 377b248e469a last_write_checksum: sha1:e15fefa4f49f20d2cd313ccc59568f4a753d4725 pristine_git_object: 8c787ec067a86e068505e4d2419527601e8cbb3b - models/operations/getbenchmarksartificialanalysis.go: - id: 52f387af0664 - last_write_checksum: sha1:591b12f7a81a8ad1143b6cd2b8417660c8a92c4a - pristine_git_object: 89ace9fc72f7cce42194755da3a969390598297a - models/operations/getbenchmarksdesignarena.go: - id: 99d2e8076edd - last_write_checksum: sha1:e0863c6ba2d3c57ce08b41b50750ab67ac76e1a6 - pristine_git_object: 1034b8ae328e2d663d9f3df1136f17915a0cb158 + models/operations/getbenchmarks.go: + id: ef5ca0f78285 + last_write_checksum: sha1:d57d4af0d84bb1caf90e343e2b8996270d7c3b1e + pristine_git_object: 2d44ae1cdb05d3a94f4e30abc8dd2a9d583ddc8d models/operations/getbyokkey.go: id: 6ca6d60dc861 last_write_checksum: sha1:879b9d77c0f853eee5a4454c8a2acec05a1da3cd @@ -7809,6 +8301,10 @@ trackedFiles: id: 4885c4c3bd9f last_write_checksum: sha1:a0d6a3f4d142d2195eb361f935bdd6b9568e5ef2 pristine_git_object: 9b635c46b61a66a0706eb2137854f0db2d03541d + models/operations/gettaskclassifications.go: + id: 17d586566d2c + last_write_checksum: sha1:809778acd86893bb476c38687234dc600ec0f03d + pristine_git_object: 623ea9514d2e2fdabe284ca185447fe47bb84daf models/operations/getuseractivity.go: id: 8a5bc3bac8e8 last_write_checksum: sha1:dfa64fe3a0d92f466c58dc8f11172d1951e2d5ef @@ -7827,8 +8323,8 @@ trackedFiles: pristine_git_object: 7e8658b39f97e1dfd660939cf59ae0727ae997ba models/operations/listbyokkeys.go: id: e40d557d5875 - last_write_checksum: sha1:a74390a0df202fb0e25372fc1f7c52950c27fa10 - pristine_git_object: ce8aef28ce3b41e715c285c34461a131fd07c22f + last_write_checksum: sha1:23213aebbf7866920b93b350ebd6a05a2fb81f55 + pristine_git_object: 2af8ecb3183842fbe86f557e132eb774c80fc01b models/operations/listendpoints.go: id: c56c221a535d last_write_checksum: sha1:a233c86cd9e267260fc2f3d33dc8990b805aec53 @@ -7857,6 +8353,10 @@ trackedFiles: id: 66d5742e02c6 last_write_checksum: sha1:f5412b1e768c4fe18e97efb4a13fc8decebfde61 pristine_git_object: 3b98ebb4a288a43354afe1598c560fea799871c0 + models/operations/listimagemodelendpoints.go: + id: 7ecdce043f52 + last_write_checksum: sha1:d931901a39c9dec25411192d53eb4bec7dcceb7f + pristine_git_object: 5b013cbc0bcb23305cfce3fc5337c468a5779c14 models/operations/listkeyassignments.go: id: 20795560d720 last_write_checksum: sha1:0c3a76d8f421fd036b1e111b0f3e927c63a8cf23 @@ -7897,6 +8397,10 @@ trackedFiles: id: d1f9f7904625 last_write_checksum: sha1:c24dcb49e6ae76905c5ed7fb4367ad70f718ce4b pristine_git_object: 266e1d5a36eb67b522293596b6b0ec6197d696c0 + models/operations/listworkspacebudgets.go: + id: e9191ff02490 + last_write_checksum: sha1:1424694c8199a8dd401cc238bc0e2bbf6b8aa7cf + pristine_git_object: ed4fa3cddfc70f41d1fb50eff6f53129cbe2bed4 models/operations/listworkspaces.go: id: 7f1148e33437 last_write_checksum: sha1:3e72a65ba1f2a6e6c05b91501ed574a386d45458 @@ -7907,8 +8411,8 @@ trackedFiles: pristine_git_object: f95b33b0def230101497eb79b18187d30cb5f19c models/operations/queryanalytics.go: id: 988cd2db88c0 - last_write_checksum: sha1:3bf7ed1cbcf1a3afd58f9e8ac0e998efa10b02e6 - pristine_git_object: 98e489c1b84d287980dff11f20f3d4b6dc8d1b38 + last_write_checksum: sha1:c31b906edf5ec2c62a413e206359818051881f28 + pristine_git_object: 1f0da2df36153104274dc17fa6724694b4f74c1f models/operations/sendchatcompletionrequest.go: id: 9da92c1f7b53 last_write_checksum: sha1:71b2e7bd747a68d78fbc663d101b0f037e608759 @@ -7937,6 +8441,10 @@ trackedFiles: id: 7cc87dd76f89 last_write_checksum: sha1:b4f14143609a257e02e7f9e90b20d9b7b570bbba pristine_git_object: 58ef1a968b82b84e04b0dff09d6ac83dcb911601 + models/operations/upsertworkspacebudget.go: + id: 248ee705f594 + last_write_checksum: sha1:05cbae21577f4bdbba312e1a35200c687f8588ae + pristine_git_object: 45231901c5f6872e809d546ed9615985096717c2 models/sdkerrors/apierror.go: id: 6571d980f036 last_write_checksum: sha1:ceb1673e00bedaaf6b3f1f986bdc68d7f2ea2a71 @@ -8003,16 +8511,16 @@ trackedFiles: pristine_git_object: dc9953e251f160ae1ddebc4edbaa75611d77ced1 oauth.go: id: a9cad7eb3094 - last_write_checksum: sha1:9f6b1d3e3efe6eff1d5f33dd26990a04ddb94397 - pristine_git_object: 2fe4b5d896597641c3f908fdc0a441ffbded4f8b + last_write_checksum: sha1:9759408338675ee82a37e95986a515b1eaf90569 + pristine_git_object: 8a3a944388609994b9d81194b08b9eeb2e6128fe observability.go: id: 38f7e1f491fb - last_write_checksum: sha1:487b3d35312af87dde69426e38b939b7749fdf16 - pristine_git_object: 3dc1d1bf3c5e7387b73f1bbb0b6b456dd5e7ee9d + last_write_checksum: sha1:b3ff06234c2cbd0321c4d687c2f321242bf3f353 + pristine_git_object: de50129e03ba061879287c7c5790b8dc69174726 openrouter.go: id: 207ad004b774 - last_write_checksum: sha1:869f39b7b7903d7a2e64fc195e9377279007811b - pristine_git_object: 8a4e3724fa6b6279a234ab82b387fd7cfecd9848 + last_write_checksum: sha1:566cd848dd2d6b51cd1349c0f7188e1c7ad35209 + pristine_git_object: 6fd9a05ebdb608bf04383928dd7b7966dfc9788d optionalnullable/optionalnullable.go: id: ce60f259ead3 last_write_checksum: sha1:d6aff1a420c31e025ea21d46cf056e305ae76fe8 @@ -8023,36 +8531,36 @@ trackedFiles: pristine_git_object: e6e5a01c6e721e879e24a38a1f97e3e27d4686d4 organization.go: id: 041fecce87b2 - last_write_checksum: sha1:0ce37cd69d5506814b1224d2cdaaae535911c6ee - pristine_git_object: ffd0ec3265dcce99106ef95bbe02ea3aca1292ab + last_write_checksum: sha1:5375171e6bb36dbb57b54dfdf0cfea082f738fcf + pristine_git_object: 6f6fcf1e6d8c649407c42e75e1e730ff9065b6bf presets.go: id: e1866fc48c6b - last_write_checksum: sha1:b69e250319a32b3cedd523aee0dbaab40455b2c3 - pristine_git_object: dfd0ed5ce40a478bee230bd839ea5bf4cf92d9bd + last_write_checksum: sha1:90695a549e634580e615707c05bdeec0f70d46f0 + pristine_git_object: b8013c89688a0e3a130efb543c88d5264e1c3386 providers.go: id: e89bb17ecd7b - last_write_checksum: sha1:18b0624b4cd205dd08316121e303572a7fdb2f44 - pristine_git_object: 1faa9d7a14b0bced00bd3371a544700a7dbab279 + last_write_checksum: sha1:b4dfaa8a3af0b7d68328b248dd88e9d83e96aefe + pristine_git_object: 2af1cb36de24a000451356888c51e0742f2779fc rerank.go: id: a0df6c09f740 - last_write_checksum: sha1:6aeaea4b0b3ef8daa31600ce8cd8d43fa5264761 - pristine_git_object: 8a8bfc2f563f7f08b46927f547e25216cc35334e + last_write_checksum: sha1:207c567b67237ba308ce2f2747d0a1fc469e52fe + pristine_git_object: d052db0a8fc3b21e2cf39d924db519c1f895cc1c responses.go: id: 1e889220bc3b - last_write_checksum: sha1:4e8411138a3cd61214616ac69dd9656f50f80055 - pristine_git_object: 02ef24cc99adfe0b8b7721b1428e8ea6d3852082 + last_write_checksum: sha1:3a985c50224267a8cd908968c863883dae3c16ec + pristine_git_object: 02a5f694370b16cf0f60aa805d08ecd81d4a8f52 retry/config.go: id: 82d673cb0389 last_write_checksum: sha1:7f7d96b59a18e95bac847ae09c63bbd911ee8432 pristine_git_object: 5b3dc7c122d8ab08905485342d7474f8f163888d stt.go: id: 04852909348f - last_write_checksum: sha1:c297d6d12f22e9df8b086d517699a04ab2b2ac80 - pristine_git_object: fbedf08ea6b782a62c31f48d3598ced42ccc5b85 + last_write_checksum: sha1:c0461281035fc4acc1e5d59df3950666f1b978bd + pristine_git_object: 09bd5923688db5b7feb7763173e7a14dbed4aec1 tts.go: id: 9feb76579e2d - last_write_checksum: sha1:f6fe4448d9c98d380dce16a84b586e65c45501c2 - pristine_git_object: 03d77d7930ce63d972d33fe9a4721d41cd09d4fb + last_write_checksum: sha1:ca1528ebff04cd900238b4068599ca293f6ffa2d + pristine_git_object: 94743b3de3394f0492ab7c24183833759e483203 types/bigint.go: id: 6f911e1a03c3 last_write_checksum: sha1:49b004005d0461fb04b846eca062b070b0360b31 @@ -8071,16 +8579,16 @@ trackedFiles: pristine_git_object: 35c439d2661e08fcb6a854096fd7b9a8561b3938 types/stream/stream.go: id: acfb7ceec2c9 - last_write_checksum: sha1:6d127e5cb94378b3e97640d6bbd004522f8a4bb7 - pristine_git_object: f590f26543adbbb82e2fe183b8051b1ff1ab49c6 + last_write_checksum: sha1:a93d55dd6863059b21f647a016747a4a60bfc839 + pristine_git_object: dcc0d374709530364d2bf27ea59cad64b0c3207d videogeneration.go: id: cb32a6d68bf0 - last_write_checksum: sha1:094f30bc2a9fa48838c6d7812438dc9054e23d36 - pristine_git_object: f0a742ea39355b30db71e190c8ad67279e17a3d1 + last_write_checksum: sha1:1776b0cd158e7545f53a2c64cb4be7e752c4e340 + pristine_git_object: aec763c42c7a623b57b675b249cfccb3b27c93d2 workspaces.go: id: 643517773c6f - last_write_checksum: sha1:c619c2771ff999b6fb4970d5730a1d57fea24639 - pristine_git_object: 1a1aa836bdf53da67f9683098d55940e66529dbb + last_write_checksum: sha1:8ec3f574ee7d88b31f35f7a3b30238ef398d319e + pristine_git_object: f9f69295f8100b772a6ed6c6b7c2398942feda34 examples: createResponses: speakeasy-default-create-responses: @@ -9395,5 +9903,129 @@ examples: application/json: {"error": {"code": 404, "message": "Resource not found"}} "500": application/json: {"error": {"code": 500, "message": "Internal Server Error"}} + getBenchmarks: + speakeasy-default-get-benchmarks: + responses: + "200": + application/json: {"data": [{"agentic_index": 58.3, "coding_index": 65.8, "display_name": "GPT-4o", "intelligence_index": 71.2, "model_permaslug": "openai/gpt-4o", "pricing": {"completion": "0.00001", "prompt": "0.0000025"}, "source": "artificial-analysis"}], "meta": {"as_of": "2026-06-03T12:00:00Z", "citation": null, "model_count": 1, "source": null, "source_url": null, "task_type": null, "version": "v1"}} + "400": + application/json: {"error": {"code": 400, "message": "Invalid request parameters"}} + "401": + application/json: {"error": {"code": 401, "message": "Missing Authentication header"}} + "429": + application/json: {"error": {"code": 429, "message": "Rate limit exceeded"}} + "500": + application/json: {"error": {"code": 500, "message": "Internal Server Error"}} + getTaskClassifications: + speakeasy-default-get-task-classifications: + parameters: + query: + window: "7d" + responses: + "200": + application/json: {"data": {"as_of": "2026-06-17", "classifications": [{"category_token_share": 0.48, "category_usage_share": 0.51, "display_name": "Code Generation", "macro_category": "code", "models": [{"id": "openai/gpt-4.1-mini", "tag_token_share": 0.75, "tag_usage_share": 0.55}], "tag": "code:general_impl", "token_share": 0.31, "usage_share": 0.23}], "macro_categories": [{"key": "code", "label": "Code", "token_share": 0.52, "usage_share": 0.45}], "window_days": 7}} + "400": + application/json: {"error": {"code": 400, "message": "Invalid request parameters"}} + "401": + application/json: {"error": {"code": 401, "message": "Missing Authentication header"}} + "429": + application/json: {"error": {"code": 429, "message": "Rate limit exceeded"}} + "500": + application/json: {"error": {"code": 500, "message": "Internal Server Error"}} + createImages: + speakeasy-default-create-images: + requestBody: + application/json: {"model": "bytedance-seed/seedream-4.5", "prompt": "a red panda astronaut floating in space, studio lighting"} + responses: + "200": + application/json: {"created": 1748372400, "data": [{"b64_json": ""}]} + "400": + application/json: {"error": {"code": 400, "message": "Invalid request parameters"}} + "401": + application/json: {"error": {"code": 401, "message": "Missing Authentication header"}} + "402": + application/json: {"error": {"code": 402, "message": "Insufficient credits. Add more using https://openrouter.ai/credits"}} + "403": + application/json: {"error": {"code": 403, "message": "Only management keys can perform this operation"}} + "404": + application/json: {"error": {"code": 404, "message": "Resource not found"}} + "429": + application/json: {"error": {"code": 429, "message": "Rate limit exceeded"}} + "500": + application/json: {"error": {"code": 500, "message": "Internal Server Error"}} + "502": + application/json: {"error": {"code": 502, "message": "Provider returned error"}} + "524": + application/json: {"error": {"code": 524, "message": "Request timed out. Please try again later."}} + "529": + application/json: {"error": {"code": 529, "message": "Provider returned error"}} + listImageModels: + speakeasy-default-list-image-models: + responses: + "200": + application/json: {"data": [{"architecture": {"input_modalities": ["text"], "output_modalities": ["image"]}, "created": 1692901234, "description": "A text-to-image model.", "endpoints": "/api/v1/images/models/bytedance-seed/seedream-4.5/endpoints", "id": "bytedance-seed/seedream-4.5", "name": "Seedream 4.5", "supported_parameters": {"resolution": {"type": "enum", "values": ["1K", "2K", "4K"]}}, "supports_streaming": false}]} + "500": + application/json: {"error": {"code": 500, "message": "Internal Server Error"}} + listImageModelEndpoints: + speakeasy-default-list-image-model-endpoints: + parameters: + path: + author: "bytedance-seed" + slug: "seedream-4.5" + responses: + "200": + application/json: {"endpoints": [{"allowed_passthrough_parameters": [], "pricing": [{"billable": "output_image", "cost_usd": 0.05, "unit": "image"}], "provider_name": "Bytedance", "provider_slug": "bytedance", "provider_tag": "bytedance", "supported_parameters": {"resolution": {"type": "enum", "values": ["1K", "2K", "4K"]}}, "supports_streaming": false}], "id": "bytedance-seed/seedream-4.5"} + "404": + application/json: {"error": {"code": 404, "message": "Resource not found"}} + "500": + application/json: {"error": {"code": 500, "message": "Internal Server Error"}} + listWorkspaceBudgets: + speakeasy-default-list-workspace-budgets: + parameters: + path: + id: "production" + responses: + "200": + application/json: {"data": [{"created_at": "2025-08-24T10:30:00Z", "id": "770e8400-e29b-41d4-a716-446655440000", "limit_usd": 100, "reset_interval": "monthly", "updated_at": "2025-08-24T15:45:00Z", "workspace_id": "550e8400-e29b-41d4-a716-446655440000"}]} + "401": + application/json: {"error": {"code": 401, "message": "Missing Authentication header"}} + "404": + application/json: {"error": {"code": 404, "message": "Resource not found"}} + "500": + application/json: {"error": {"code": 500, "message": "Internal Server Error"}} + deleteWorkspaceBudget: + speakeasy-default-delete-workspace-budget: + parameters: + path: + id: "production" + interval: "monthly" + responses: + "200": + application/json: {"deleted": true} + "401": + application/json: {"error": {"code": 401, "message": "Missing Authentication header"}} + "404": + application/json: {"error": {"code": 404, "message": "Resource not found"}} + "500": + application/json: {"error": {"code": 500, "message": "Internal Server Error"}} + upsertWorkspaceBudget: + speakeasy-default-upsert-workspace-budget: + parameters: + path: + id: "production" + interval: "monthly" + requestBody: + application/json: {"limit_usd": 100} + responses: + "200": + application/json: {"data": {"created_at": "2025-08-24T10:30:00Z", "id": "770e8400-e29b-41d4-a716-446655440000", "limit_usd": 100, "reset_interval": "monthly", "updated_at": "2025-08-24T15:45:00Z", "workspace_id": "550e8400-e29b-41d4-a716-446655440000"}} + "400": + application/json: {"error": {"code": 400, "message": "Invalid request parameters"}} + "401": + application/json: {"error": {"code": 401, "message": "Missing Authentication header"}} + "404": + application/json: {"error": {"code": 404, "message": "Resource not found"}} + "500": + application/json: {"error": {"code": 500, "message": "Internal Server Error"}} examplesVersion: 1.0.2 -releaseNotes: "## Go SDK Changes:\n* `OpenRouter.Chat.Send()`: \n * `request` **Changed** (Breaking ⚠️)\n * `response` **Changed**\n * `error` **Changed**\n* `OpenRouter.VideoGeneration.Generate()`: \n * `request.Request` **Changed** (Breaking ⚠️)\n * `error.OpenrouterMetadata` **Added**\n* `OpenRouter.Beta.Responses.Send()`: \n * `request` **Changed** (Breaking ⚠️)\n * `response` **Changed** (Breaking ⚠️)\n * `error` **Changed**\n* `OpenRouter.Rerank.Rerank()`: \n * `request.Request` **Changed** (Breaking ⚠️)\n * `response.Results[].Document` **Changed**\n * `error.OpenrouterMetadata` **Added**\n* `OpenRouter.Models.ListForUser()`: \n * `response.Data[]` **Changed** (Breaking ⚠️)\n * `error.OpenrouterMetadata` **Added**\n* `OpenRouter.Models.List()`: \n * `request` **Changed** (Breaking ⚠️)\n * `response.Data[]` **Changed** (Breaking ⚠️)\n * `error.OpenrouterMetadata` **Added**\n* `OpenRouter.Generations.GetGeneration()`: \n * `response.Data` **Changed** (Breaking ⚠️)\n * `error.OpenrouterMetadata` **Added**\n* `OpenRouter.Endpoints.List()`: \n * `response.Data` **Changed** (Breaking ⚠️)\n * `error.OpenrouterMetadata` **Added**\n* `OpenRouter.Endpoints.ListZdrEndpoints()`: \n * `response.Data[].ProviderName` **Changed** (Breaking ⚠️)\n * `error.OpenrouterMetadata` **Added**\n* `OpenRouter.Embeddings.ListModels()`: \n * `response.Data[]` **Changed** (Breaking ⚠️)\n * `error.OpenrouterMetadata` **Added**\n* `OpenRouter.Embeddings.Generate()`: \n * `request.Request` **Changed** (Breaking ⚠️)\n * `response.Usage.PromptTokensDetails.FileTokens` **Added**\n * `error.OpenrouterMetadata` **Added**\n* `OpenRouter.Observability.Create()`: **Added**\n* `OpenRouter.Guardrails.Delete()`: `error.OpenrouterMetadata` **Added**\n* `OpenRouter.Files.Upload()`: **Added**\n* `OpenRouter.Files.Delete()`: **Added**\n* `OpenRouter.Files.Retrieve()`: **Added**\n* `OpenRouter.Files.Download()`: **Added**\n* `OpenRouter.Models.Get()`: **Added**\n* `OpenRouter.Observability.List()`: **Added**\n* `OpenRouter.Beta.Analytics.GetAnalyticsMeta()`: **Added**\n* `OpenRouter.Observability.Delete()`: **Added**\n* `OpenRouter.Observability.Get()`: **Added**\n* `OpenRouter.Observability.Update()`: **Added**\n* `OpenRouter.Presets.List()`: **Added**\n* `OpenRouter.Presets.Get()`: **Added**\n* `OpenRouter.Presets.CreatePresetsChatCompletions()`: **Added**\n* `OpenRouter.Presets.CreatePresetsMessages()`: **Added**\n* `OpenRouter.Presets.CreatePresetsResponses()`: **Added**\n* `OpenRouter.Presets.ListVersions()`: **Added**\n* `OpenRouter.Presets.GetVersion()`: **Added**\n* `OpenRouter.Analytics.GetUserActivity()`: `error.OpenrouterMetadata` **Added**\n* `OpenRouter.Tts.CreateSpeech()`: \n * `request.Request.Provider.Options` **Changed**\n * `error.OpenrouterMetadata` **Added**\n* `OpenRouter.OAuth.ExchangeAuthCodeForApiKey()`: `error.OpenrouterMetadata` **Added**\n* `OpenRouter.OAuth.CreateAuthCode()`: \n * `request.Request.WorkspaceId` **Added**\n * `error` **Changed**\n* `OpenRouter.Datasets.GetRankingsDaily()`: **Added**\n* `OpenRouter.Credits.GetCredits()`: `error.OpenrouterMetadata` **Added**\n* `OpenRouter.Datasets.GetBenchmarksDesignArena()`: **Added**\n* `OpenRouter.Datasets.GetBenchmarksArtificialAnalysis()`: **Added**\n* `OpenRouter.Datasets.GetAppRankings()`: **Added**\n* `OpenRouter.Byok.Update()`: **Added**\n* `OpenRouter.Byok.Get()`: **Added**\n* `OpenRouter.Generations.ListGenerationContent()`: `error.OpenrouterMetadata` **Added**\n* `OpenRouter.Guardrails.List()`: \n * `response.Data[]` **Changed**\n * `error.OpenrouterMetadata` **Added**\n* `OpenRouter.Guardrails.Create()`: \n * `request.Request` **Changed**\n * `response.Data` **Changed**\n * `error.OpenrouterMetadata` **Added**\n* `OpenRouter.Files.List()`: **Added**\n* `OpenRouter.Guardrails.Get()`: \n * `response.Data` **Changed**\n * `error.OpenrouterMetadata` **Added**\n* `OpenRouter.Guardrails.Update()`: \n * `request.UpdateGuardrailRequest` **Changed**\n * `response.Data` **Changed**\n * `error.OpenrouterMetadata` **Added**\n* `OpenRouter.Guardrails.ListGuardrailKeyAssignments()`: `error.OpenrouterMetadata` **Added**\n* `OpenRouter.Guardrails.BulkAssignKeys()`: `error.OpenrouterMetadata` **Added**\n* `OpenRouter.Guardrails.BulkUnassignKeys()`: `error.OpenrouterMetadata` **Added**\n* `OpenRouter.Guardrails.ListGuardrailMemberAssignments()`: `error.OpenrouterMetadata` **Added**\n* `OpenRouter.Guardrails.BulkAssignMembers()`: `error.OpenrouterMetadata` **Added**\n* `OpenRouter.Guardrails.BulkUnassignMembers()`: `error.OpenrouterMetadata` **Added**\n* `OpenRouter.Guardrails.ListKeyAssignments()`: `error.OpenrouterMetadata` **Added**\n* `OpenRouter.Guardrails.ListMemberAssignments()`: `error.OpenrouterMetadata` **Added**\n* `OpenRouter.ApiKeys.GetCurrentKeyMetadata()`: `error.OpenrouterMetadata` **Added**\n* `OpenRouter.ApiKeys.List()`: `error.OpenrouterMetadata` **Added**\n* `OpenRouter.ApiKeys.Create()`: `error.OpenrouterMetadata` **Added**\n* `OpenRouter.ApiKeys.Delete()`: `error.OpenrouterMetadata` **Added**\n* `OpenRouter.ApiKeys.Get()`: `error.OpenrouterMetadata` **Added**\n* `OpenRouter.ApiKeys.Update()`: `error.OpenrouterMetadata` **Added**\n* `OpenRouter.Byok.Delete()`: **Added**\n* `OpenRouter.Models.Count()`: `error.OpenrouterMetadata` **Added**\n* `OpenRouter.Byok.Create()`: **Added**\n* `OpenRouter.Organization.ListMembers()`: `error.OpenrouterMetadata` **Added**\n* `OpenRouter.Providers.List()`: `error.OpenrouterMetadata` **Added**\n* `OpenRouter.Byok.List()`: **Added**\n* `OpenRouter.Stt.CreateTranscription()`: **Added**\n* `OpenRouter.Beta.Analytics.QueryAnalytics()`: **Added**\n* `OpenRouter.VideoGeneration.GetGeneration()`: `error.OpenrouterMetadata` **Added**\n* `OpenRouter.VideoGeneration.GetVideoContent()`: `error.OpenrouterMetadata` **Added**\n* `OpenRouter.VideoGeneration.ListVideosModels()`: \n * `response.Data[]` **Changed**\n * `error.OpenrouterMetadata` **Added**\n* `OpenRouter.Workspaces.List()`: \n * `response.Data[]` **Changed**\n * `error.OpenrouterMetadata` **Added**\n* `OpenRouter.Workspaces.Create()`: \n * `request.Request` **Changed**\n * `response.Data` **Changed**\n * `error.OpenrouterMetadata` **Added**\n* `OpenRouter.Workspaces.Delete()`: `error.OpenrouterMetadata` **Added**\n* `OpenRouter.Workspaces.Get()`: \n * `response.Data` **Changed**\n * `error.OpenrouterMetadata` **Added**\n* `OpenRouter.Workspaces.Update()`: \n * `request.UpdateWorkspaceRequest` **Changed**\n * `response.Data` **Changed**\n * `error.OpenrouterMetadata` **Added**\n* `OpenRouter.Workspaces.BulkAddMembers()`: `error.OpenrouterMetadata` **Added**\n* `OpenRouter.Workspaces.BulkRemoveMembers()`: `error.OpenrouterMetadata` **Added**\n" +releaseNotes: "## Go SDK Changes:\n* `OpenRouter.Benchmarks.GetBenchmarks()`: **Added**\n* `OpenRouter.Classifications.GetTaskClassifications()`: **Added**\n* `OpenRouter.Images.Generate()`: **Added**\n* `OpenRouter.Images.ListModels()`: **Added**\n* `OpenRouter.Images.ListModelEndpoints()`: **Added**\n* `OpenRouter.Workspaces.ListBudgets()`: **Added**\n* `OpenRouter.Workspaces.DeleteBudget()`: **Added**\n* `OpenRouter.Workspaces.SetBudget()`: **Added**\n* `OpenRouter.Datasets.GetBenchmarksArtificialAnalysis()`: **Removed** (Breaking ⚠️)\n* `OpenRouter.Datasets.GetBenchmarksDesignArena()`: **Removed** (Breaking ⚠️)\n* `OpenRouter.Beta.Analytics.QueryAnalytics()`: `response.Data.Warnings` **Added**\n* `OpenRouter.Beta.Responses.Send()`: \n * `request.ResponsesRequest` **Changed**\n * `response` **Changed**\n* `OpenRouter.Tts.CreateSpeech()`: \n * `request.Request.Provider.Options.Tenstorrent` **Added**\n* `OpenRouter.Stt.CreateTranscription()`: \n * `request.Request.Provider.Options.Tenstorrent` **Added**\n* `OpenRouter.Byok.List()`: \n * `request.Provider` **Changed**\n * `response.Data[].Provider.Enum(tenstorrent)` **Added**\n* `OpenRouter.Byok.Create()`: \n * `request.Request.Provider.Enum(tenstorrent)` **Added**\n * `response.Data.Provider.Enum(tenstorrent)` **Added**\n* `OpenRouter.Byok.Get()`: `response.Data.Provider.Enum(tenstorrent)` **Added**\n* `OpenRouter.Byok.Update()`: `response.Data.Provider.Enum(tenstorrent)` **Added**\n* `OpenRouter.Chat.Send()`: \n * `request.ChatRequest` **Changed**\n * `response` **Changed**\n* `OpenRouter.Embeddings.Generate()`: \n * `request.Request.Provider.Ignore[].union(ProviderName).Enum(tenstorrent)` **Added**\n * `response.Usage` **Changed**\n* `OpenRouter.Embeddings.ListModels()`: `response.Data[].Reasoning` **Added**\n* `OpenRouter.Endpoints.ListZdrEndpoints()`: `response.Data[].ProviderName.Enum(tenstorrent)` **Added**\n* `OpenRouter.Endpoints.List()`: `response.Data.Endpoints[].ProviderName.Enum(tenstorrent)` **Added**\n* `OpenRouter.Generations.GetGeneration()`: `response.Data.ProviderResponses[].ProviderName.Enum(tenstorrent)` **Added**\n* `OpenRouter.Models.Get()`: `response.Data.Reasoning` **Added**\n* `OpenRouter.Models.List()`: `response.Data[].Reasoning` **Added**\n* `OpenRouter.Models.ListForUser()`: `response.Data[].Reasoning` **Added**\n* `OpenRouter.Presets.CreatePresetsChatCompletions()`: `request.ChatRequest` **Changed**\n* `OpenRouter.Presets.CreatePresetsMessages()`: `request.MessagesRequest` **Changed**\n* `OpenRouter.Presets.CreatePresetsResponses()`: `request.ResponsesRequest` **Changed**\n* `OpenRouter.Rerank.Rerank()`: \n * `request.Request.Provider.Ignore[].union(ProviderName).Enum(tenstorrent)` **Added**\n* `OpenRouter.VideoGeneration.Generate()`: \n * `request.Request.Provider.Options.Tenstorrent` **Added**\n" diff --git a/.speakeasy/gen.yaml b/.speakeasy/gen.yaml index 26b11705..f51fa78a 100644 --- a/.speakeasy/gen.yaml +++ b/.speakeasy/gen.yaml @@ -35,7 +35,7 @@ generation: skipResponseBodyAssertions: false preApplyUnionDiscriminators: true go: - version: 0.5.0 + version: 0.5.1 additionalDependencies: {} baseErrorName: OpenRouterError clientServerStatusCodesAsErrors: true diff --git a/.speakeasy/out.openapi.yaml b/.speakeasy/out.openapi.yaml index d89c5db4..c8ee6455 100644 --- a/.speakeasy/out.openapi.yaml +++ b/.speakeasy/out.openapi.yaml @@ -168,6 +168,7 @@ components: effort: description: Reasoning effort level for the advisor call. enum: + - max - xhigh - high - medium @@ -1106,6 +1107,7 @@ components: - content type: object - $ref: '#/components/schemas/AnthropicUrlPdfSource' + - $ref: '#/components/schemas/AnthropicFileDocumentSource' title: nullable: true type: string @@ -1146,6 +1148,21 @@ components: - stderr - type type: object + AnthropicFileDocumentSource: + example: + file_id: file_011CNha8iCJcU1wXNR6q4V8w + type: file + properties: + file_id: + type: string + type: + enum: + - file + type: string + required: + - type + - file_id + type: object AnthropicImageBlockParam: example: source: @@ -2179,6 +2196,39 @@ components: required: - type type: object + ApiErrorType: + description: Canonical OpenRouter error type, stable across all API formats + enum: + - context_length_exceeded + - max_tokens_exceeded + - token_limit_exceeded + - string_too_long + - authentication + - permission_denied + - payment_required + - rate_limit_exceeded + - provider_overloaded + - provider_unavailable + - invalid_request + - invalid_prompt + - not_found + - precondition_failed + - payload_too_large + - unprocessable + - content_policy_violation + - refusal + - invalid_image + - image_too_large + - image_too_small + - unsupported_image_format + - image_not_found + - image_download_failed + - server + - timeout + - unmapped + example: rate_limit_exceeded + type: string + x-speakeasy-unknown-values: allow ApplyPatchCallItem: description: >- A tool call emitted by the model requesting a V4A patch operation. The client applies the patch and echoes an `apply_patch_call_output` on the next turn. @@ -3619,413 +3669,82 @@ components: oneOf: - $ref: '#/components/schemas/ContainerAutoEnvironment' - $ref: '#/components/schemas/ContainerReferenceEnvironment' - BenchmarkPricing: - description: OpenRouter pricing per token for this model. Null if pricing is unavailable. - example: - completion: '0.000015' - prompt: '0.000003' - nullable: true - properties: - completion: - description: Cost per output token (USD, decimal string). - example: '0.000015' - type: string - prompt: - description: Cost per input token (USD, decimal string). - example: '0.000003' - type: string - required: - - prompt - - completion - type: object - BenchmarksAAItem: + BigNumberUnion: + description: Price per million prompt tokens + example: 1000 + type: string + BooleanCapability: + description: A supported-or-not flag. Present means the parameter is accepted. example: - aa_name: GPT-4o - agentic_index: 58.3 - coding_index: 65.8 - intelligence_index: 71.2 - model_permaslug: openai/gpt-4o - pricing: - completion: '0.00001' - prompt: '0.0000025' + type: boolean properties: - aa_name: - description: Model name as listed on Artificial Analysis. - example: GPT-4o - type: string - agentic_index: - description: Artificial Analysis Agentic Index composite score. Higher is better. - example: 58.3 - format: double - nullable: true - type: number - coding_index: - description: Artificial Analysis Coding Index composite score. Higher is better. - example: 65.8 - format: double - nullable: true - type: number - intelligence_index: - description: Artificial Analysis Intelligence Index composite score. Higher is better. - example: 71.2 - format: double - nullable: true - type: number - model_permaslug: - description: Stable OpenRouter model identifier. - example: openai/gpt-4o + type: + enum: + - boolean type: string - pricing: - $ref: '#/components/schemas/BenchmarkPricing' required: - - model_permaslug - - aa_name - - intelligence_index - - coding_index - - agentic_index - - pricing + - type type: object - BenchmarksAAMeta: + BulkAddWorkspaceMembersRequest: example: - as_of: '2026-06-03T12:00:00Z' - citation: 'Source: Artificial Analysis (artificialanalysis.ai) via OpenRouter (openrouter.ai/rankings).' - model_count: 50 - source: artificial-analysis - source_url: https://artificialanalysis.ai - version: v1 + user_ids: + - user_abc123 + - user_def456 properties: - as_of: - description: ISO-8601 timestamp of when this data was last updated. - example: '2026-06-03T12:00:00Z' - type: string - citation: - description: Required attribution when republishing this data. - example: 'Source: Artificial Analysis (artificialanalysis.ai) via OpenRouter (openrouter.ai/rankings).' - type: string - model_count: - description: Number of unique models in the response. - type: integer - source: - description: Data source identifier. - enum: - - artificial-analysis - type: string - source_url: - description: URL of the upstream data source. - enum: - - https://artificialanalysis.ai - type: string - version: - description: Dataset version. - enum: - - v1 - type: string + user_ids: + description: List of user IDs to add to the workspace. Members are assigned the same role they hold in the organization. + example: + - user_abc123 + - user_def456 + items: + type: string + maxItems: 100 + minItems: 1 + type: array required: - - as_of - - version - - source - - source_url - - citation - - model_count + - user_ids type: object - BenchmarksAAResponse: + BulkAddWorkspaceMembersResponse: example: + added_count: 1 data: - - aa_name: GPT-4o - agentic_index: 58.3 - coding_index: 65.8 - intelligence_index: 71.2 - model_permaslug: openai/gpt-4o - pricing: - completion: '0.00001' - prompt: '0.0000025' - meta: - as_of: '2026-06-03T12:00:00Z' - citation: 'Source: Artificial Analysis (artificialanalysis.ai) via OpenRouter (openrouter.ai/rankings).' - model_count: 1 - source: artificial-analysis - source_url: https://artificialanalysis.ai - version: v1 + - created_at: '2025-08-24T10:30:00Z' + id: 660e8400-e29b-41d4-a716-446655440000 + role: member + user_id: user_abc123 + workspace_id: 550e8400-e29b-41d4-a716-446655440000 properties: + added_count: + description: Number of workspace memberships created or updated + example: 2 + type: integer data: + description: List of added workspace memberships items: - $ref: '#/components/schemas/BenchmarksAAItem' + $ref: '#/components/schemas/WorkspaceMember' type: array - meta: - $ref: '#/components/schemas/BenchmarksAAMeta' required: - data - - meta + - added_count type: object - BenchmarksDAItem: + BulkAssignKeysRequest: example: - arena: models - avg_generation_time_ms: 3200 - category: codecategories - display_name: Claude Sonnet 4 - elo: 1423 - model_permaslug: anthropic/claude-sonnet-4 - pricing: - completion: '0.000015' - prompt: '0.000003' - tournament_stats: - first_place: 12 - fourth_place: 2 - second_place: 8 - third_place: 5 - total: 27 - win_rate: 72 + key_hashes: + - c56454edb818d6b14bc0d61c46025f1450b0f4012d12304ab40aacb519fcbc93 properties: - arena: - description: Arena this ranking belongs to. - example: models - type: string - avg_generation_time_ms: - description: Average generation time in milliseconds. - example: 3200 - format: double - nullable: true - type: number - category: - description: Category within the arena. - example: codecategories - type: string - display_name: - description: Human-readable model name from Design Arena. - example: Claude Sonnet 4 - type: string - elo: - description: ELO rating from head-to-head arena battles. - example: 1423 - format: double - type: number - model_permaslug: - description: >- - Stable OpenRouter model identifier when the model is on OpenRouter; otherwise the upstream Design Arena model id. Use pricing != null to detect OpenRouter-mapped models. - example: anthropic/claude-sonnet-4 - type: string - pricing: - $ref: '#/components/schemas/BenchmarkPricing' - tournament_stats: - description: Placement distribution from tournament matches. - properties: - first_place: - nullable: true - type: integer - fourth_place: - nullable: true - type: integer - second_place: - nullable: true - type: integer - third_place: - nullable: true - type: integer - total: - nullable: true - type: integer - required: - - first_place - - second_place - - third_place - - fourth_place - - total - type: object - win_rate: - description: Win rate as a percentage (0–100). - example: 72 - format: double - type: number + key_hashes: + description: Array of API key hashes to assign to the guardrail + example: + - c56454edb818d6b14bc0d61c46025f1450b0f4012d12304ab40aacb519fcbc93 + items: + minLength: 1 + type: string + minItems: 1 + type: array required: - - model_permaslug - - display_name - - arena - - category - - elo - - win_rate - - avg_generation_time_ms - - tournament_stats - - pricing + - key_hashes type: object - BenchmarksDAMeta: - example: - arena: models - as_of: '2026-06-03T12:00:00Z' - category: null - citation: 'Source: Design Arena (www.designarena.ai) via OpenRouter (openrouter.ai/rankings).' - elo_bounds: - max: 1600 - min: 900 - model_count: 50 - source: design-arena - source_url: https://www.designarena.ai - version: v1 - properties: - arena: - description: The arena filter applied. - type: string - as_of: - description: ISO-8601 timestamp of when this data was generated. - example: '2026-06-03T12:00:00Z' - type: string - category: - description: The category filter applied, or null if showing all. - nullable: true - type: string - citation: - description: Required attribution when republishing this data. - example: 'Source: Design Arena (www.designarena.ai) via OpenRouter (openrouter.ai/rankings).' - type: string - elo_bounds: - description: ELO range across all returned models for normalization. - properties: - max: - description: Maximum ELO in the result set. - format: double - type: number - min: - description: Minimum ELO in the result set. - format: double - type: number - required: - - min - - max - type: object - model_count: - description: Number of unique models in the response. - type: integer - source: - description: Data source identifier. - enum: - - design-arena - type: string - source_url: - description: URL of the upstream data source. - enum: - - https://www.designarena.ai - type: string - version: - description: Dataset version. - enum: - - v1 - type: string - required: - - as_of - - version - - source - - source_url - - citation - - model_count - - arena - - category - - elo_bounds - type: object - BenchmarksDAResponse: - example: - data: - - arena: models - avg_generation_time_ms: 3200 - category: codecategories - display_name: Claude Sonnet 4 - elo: 1423 - model_permaslug: anthropic/claude-sonnet-4 - pricing: - completion: '0.000015' - prompt: '0.000003' - tournament_stats: - first_place: 12 - fourth_place: 2 - second_place: 8 - third_place: 5 - total: 27 - win_rate: 72 - meta: - arena: models - as_of: '2026-06-03T12:00:00Z' - category: null - citation: 'Source: Design Arena (www.designarena.ai) via OpenRouter (openrouter.ai/rankings).' - elo_bounds: - max: 1600 - min: 900 - model_count: 1 - source: design-arena - source_url: https://www.designarena.ai - version: v1 - properties: - data: - items: - $ref: '#/components/schemas/BenchmarksDAItem' - type: array - meta: - $ref: '#/components/schemas/BenchmarksDAMeta' - required: - - data - - meta - type: object - BigNumberUnion: - description: Price per million prompt tokens - example: 1000 - type: string - BulkAddWorkspaceMembersRequest: - example: - user_ids: - - user_abc123 - - user_def456 - properties: - user_ids: - description: List of user IDs to add to the workspace. Members are assigned the same role they hold in the organization. - example: - - user_abc123 - - user_def456 - items: - type: string - maxItems: 100 - minItems: 1 - type: array - required: - - user_ids - type: object - BulkAddWorkspaceMembersResponse: - example: - added_count: 1 - data: - - created_at: '2025-08-24T10:30:00Z' - id: 660e8400-e29b-41d4-a716-446655440000 - role: member - user_id: user_abc123 - workspace_id: 550e8400-e29b-41d4-a716-446655440000 - properties: - added_count: - description: Number of workspace memberships created or updated - example: 2 - type: integer - data: - description: List of added workspace memberships - items: - $ref: '#/components/schemas/WorkspaceMember' - type: array - required: - - data - - added_count - type: object - BulkAssignKeysRequest: - example: - key_hashes: - - c56454edb818d6b14bc0d61c46025f1450b0f4012d12304ab40aacb519fcbc93 - properties: - key_hashes: - description: Array of API key hashes to assign to the guardrail - example: - - c56454edb818d6b14bc0d61c46025f1450b0f4012d12304ab40aacb519fcbc93 - items: - minLength: 1 - type: string - minItems: 1 - type: array - required: - - key_hashes - type: object - BulkAssignKeysResponse: + BulkAssignKeysResponse: example: assigned_count: 3 properties: @@ -4325,6 +4044,7 @@ components: - stepfun - streamlake - switchpoint + - tenstorrent - together - upstage - venice @@ -4336,6 +4056,25 @@ components: example: openai type: string x-speakeasy-unknown-values: allow + CapabilityDescriptor: + description: A typed descriptor for one supported request parameter. + discriminator: + mapping: + boolean: '#/components/schemas/BooleanCapability' + enum: '#/components/schemas/EnumCapability' + range: '#/components/schemas/RangeCapability' + x-speakeasy-unknown-values: allow + propertyName: type + example: + type: enum + values: + - 1K + - 2K + - 4K + oneOf: + - $ref: '#/components/schemas/EnumCapability' + - $ref: '#/components/schemas/RangeCapability' + - $ref: '#/components/schemas/BooleanCapability' ChatAssistantImages: description: Generated images from image generation models example: @@ -5062,6 +4801,7 @@ components: effort: description: Constrains effort on reasoning for reasoning models enum: + - max - xhigh - high - medium @@ -5080,6 +4820,7 @@ components: description: >- Shorthand for setting reasoning effort. Equivalent to setting reasoning.effort. Cannot be used simultaneously with reasoning.effort if they differ. enum: + - max - xhigh - high - medium @@ -5354,6 +5095,8 @@ components: example: code: 429 message: Rate limit exceeded + metadata: + error_type: rate_limit_exceeded properties: code: description: Error code @@ -5364,6 +5107,17 @@ components: description: Error message example: Rate limit exceeded type: string + metadata: + description: Structured error metadata + properties: + error_type: + $ref: '#/components/schemas/ApiErrorType' + provider_code: + description: Upstream provider-specific error code, when available + type: string + required: + - error_type + type: object required: - message - code @@ -5712,6 +5466,9 @@ components: prompt_tokens: 10 prompt_tokens_details: cached_tokens: 2 + server_tool_use_details: + tool_calls_executed: 2 + tool_calls_requested: 2 total_tokens: 25 properties: completion_tokens: @@ -5768,6 +5525,25 @@ components: description: Video input tokens type: integer type: object + server_tool_use_details: + description: Usage for server-side tool execution (e.g., web search) + nullable: true + properties: + tool_calls_executed: + description: Number of OpenRouter server tool calls that executed and produced a result + nullable: true + type: integer + tool_calls_requested: + description: >- + Total number of OpenRouter server-orchestrated tool calls the model requested, across all tool types. Provider-native tools (e.g. native web search) are not counted here. + nullable: true + type: integer + web_search_requests: + description: >- + Number of web searches performed by server-side tools. For server-orchestrated tool calls a web search is also counted in tool_calls_requested; provider-native web search may report web_search_requests only. Do not sum the two. + nullable: true + type: integer + type: object total_tokens: description: Total number of tokens type: integer @@ -5828,7 +5604,7 @@ components: type: integer max_results: description: >- - Maximum number of search results to return per search call. Defaults to 5. Applies to Exa, Firecrawl, Parallel, and Perplexity engines; ignored with native provider search. + Maximum number of search results to return per search call. Defaults to 5. Applies to Exa, Firecrawl, Parallel, and Perplexity engines; ignored with native provider search. Perplexity supports a maximum of 20; values above 20 are clamped. example: 5 type: integer max_total_results: @@ -7181,6 +6957,54 @@ components: example: America/New_York type: string type: object + DebugEvent: + description: >- + Debug event emitted when debug.echo_upstream_body is true. Contains the transformed upstream request body or timing milestones. + example: + debug: + echo_upstream_body: + messages: [] + model: anthropic/claude-sonnet-4 + sequence_number: 1 + type: response.debug + properties: + debug: + properties: + echo_upstream_body: + additionalProperties: + nullable: true + type: object + timings: + properties: + epoch_ms: + type: integer + event: + enum: + - adapter_request + - upstream_headers_received + - first_token_received + - upstream_body_ended + type: string + x-speakeasy-unknown-values: allow + start_ms: + type: integer + required: + - start_ms + - event + - epoch_ms + type: object + type: object + sequence_number: + type: integer + type: + enum: + - response.debug + type: string + required: + - type + - debug + - sequence_number + type: object DefaultParameters: additionalProperties: false description: Default parameters for this model @@ -7252,6 +7076,18 @@ components: required: - deleted type: object + DeleteWorkspaceBudgetResponse: + example: + deleted: true + properties: + deleted: + const: true + description: Confirmation that the budget was deleted (or did not exist) + example: true + type: boolean + required: + - deleted + type: object DeleteWorkspaceResponse: example: deleted: true @@ -7422,6 +7258,27 @@ components: example: 0 type: integer x-speakeasy-unknown-values: allow + EnumCapability: + description: A parameter that accepts one of a discrete set of string values. + example: + type: enum + values: + - 1K + - 2K + - 4K + properties: + type: + enum: + - enum + type: string + values: + items: + type: string + type: array + required: + - type + - values + type: object ErrorEvent: allOf: - $ref: '#/components/schemas/BaseErrorEvent' @@ -8321,6 +8178,15 @@ components: Slug of the model that performs both the judge step (with web_search + web_fetch) and the final synthesis. When omitted, defaults to the first model in the Quality preset. example: ~anthropic/claude-opus-latest type: string + preset: + description: >- + A curated OpenRouter fusion preset (slugs follow `-`, e.g. `general-high`). Expands server-side into the preset's analysis_models panel and judge model, so callers never name individual models. Explicitly provided `analysis_models` / `model` take precedence. + enum: + - general-high + - general-budget + example: general-high + type: string + x-speakeasy-unknown-values: allow tools: description: >- Server tools available to panelist and judge inner calls. Each entry uses the same `{ type, parameters? }` shorthand as the outer Chat Completions request. When omitted, defaults to `[{ type: "openrouter:web_search" }, { type: "openrouter:web_fetch" }]`. Pass an empty array to disable tools entirely (panelists answer from parametric knowledge only). @@ -8411,6 +8277,8 @@ components: maxItems: 8 minItems: 1 type: array + cache_control: + $ref: '#/components/schemas/AnthropicCacheControlDirective' max_completion_tokens: description: >- Maximum number of output tokens (including reasoning tokens) each panelist and the judge model may produce per inner call. Controls the total output budget so reasoning-heavy models like GPT-5.5 do not exhaust their token allowance before producing visible text. When omitted, the provider's default applies. @@ -8435,6 +8303,7 @@ components: effort: description: Reasoning effort level for panelist and judge inner calls. enum: + - max - xhigh - high - medium @@ -9255,6 +9124,73 @@ components: aspect_ratio: '16:9' quality: high type: object + ImageEndpoint: + description: An endpoint that serves a given image model. + example: + allowed_passthrough_parameters: [] + pricing: + - billable: output_image + cost_usd: 0.05 + unit: image + provider_name: Bytedance + provider_slug: bytedance + provider_tag: bytedance + supported_parameters: + resolution: + type: enum + values: + - 1K + - 2K + - 4K + seed: + type: boolean + supports_streaming: false + properties: + allowed_passthrough_parameters: + description: Provider-specific options accepted under provider.options[provider_slug]. + example: [] + items: + type: string + type: array + pricing: + description: Billable pricing lines for this endpoint. + example: + - billable: output_image + cost_usd: 0.05 + unit: image + items: + $ref: '#/components/schemas/ImagePricingEntry' + type: array + provider_name: + description: Provider display name + example: Bytedance + type: string + provider_slug: + description: Provider slug + example: bytedance + type: string + provider_tag: + description: Provider tag for request-side selection + example: bytedance + nullable: true + type: string + supported_parameters: + allOf: + - $ref: '#/components/schemas/SupportedParameters' + - description: The definitive set of parameters this endpoint accepts for this model. + supports_streaming: + description: 'Whether this endpoint supports native SSE streaming (`stream: true` in the request).' + example: false + type: boolean + required: + - provider_name + - provider_slug + - provider_tag + - supported_parameters + - allowed_passthrough_parameters + - supports_streaming + - pricing + type: object ImageGenCallCompletedEvent: allOf: - $ref: '#/components/schemas/OpenAIResponsesImageGenCallCompleted' @@ -9301,24 +9237,210 @@ components: partial_image_index: 0 sequence_number: 3 type: response.image_generation_call.partial_image - ImageGenerationServerTool: - description: Image generation tool configuration + ImageGenCompletedEvent: + description: Emitted when generation completes and the final image is available example: - quality: high - type: image_generation + b64_json: + created: 1748372400 + type: image_generation.completed + usage: + completion_tokens: 4175 + cost: 0.04 + prompt_tokens: 0 + total_tokens: 4175 properties: - background: - enum: - - transparent - - opaque - - auto + b64_json: + description: Base64-encoded final image data type: string - x-speakeasy-unknown-values: allow - input_fidelity: + created: + description: Unix timestamp (seconds) when the image was generated + type: integer + type: + description: The event type enum: - - high - - low - - null + - image_generation.completed + type: string + usage: + $ref: '#/components/schemas/ImageGenerationUsage' + required: + - type + - b64_json + - created + type: object + ImageGenerationRequest: + description: Image generation request input + example: + model: bytedance-seed/seedream-4.5 + prompt: a red panda astronaut floating in space, studio lighting + properties: + aspect_ratio: + description: Normalized aspect ratio of the generated image. Providers clamp to their supported subset. + enum: + - '1:1' + - '1:2' + - '1:4' + - '1:8' + - '2:1' + - '2:3' + - '3:2' + - '3:4' + - '4:1' + - '4:3' + - '4:5' + - '5:4' + - '8:1' + - '9:16' + - '16:9' + - '9:19.5' + - 19.5:9 + - '9:20' + - '20:9' + - '9:21' + - '21:9' + - auto + example: '16:9' + type: string + x-speakeasy-unknown-values: allow + background: + description: Background treatment. `transparent` requires an output_format that supports alpha (png or webp). + enum: + - auto + - transparent + - opaque + example: auto + type: string + x-speakeasy-unknown-values: allow + input_references: + description: Reference images to guide image-to-image generation, as base64 data URLs or HTTP(S) URLs. + items: + $ref: '#/components/schemas/ContentPartImage' + maxItems: 16 + type: array + model: + description: The image generation model to use + example: bytedance-seed/seedream-4.5 + type: string + 'n': + description: Number of images to generate (1-10). Providers that only support single-image generation reject n > 1. + example: 1 + type: integer + output_compression: + description: Compression level (0-100) for webp/jpeg output. Ignored for png and by providers without a compression knob. + example: 100 + type: integer + output_format: + description: Encoding of the returned image bytes. + enum: + - png + - jpeg + - webp + example: png + type: string + x-speakeasy-unknown-values: allow + prompt: + description: Text description of the desired image + example: a red panda astronaut floating in space, studio lighting + minLength: 1 + type: string + provider: + description: Provider-specific passthrough configuration + properties: + options: + allOf: + - $ref: '#/components/schemas/ProviderOptions' + - example: + black-forest-labs: + guidance: 3 + steps: 40 + type: object + quality: + description: Rendering quality. Providers without a quality knob ignore this. + enum: + - auto + - low + - medium + - high + example: high + type: string + x-speakeasy-unknown-values: allow + resolution: + description: Normalized resolution tier of the generated image. Concrete pixel dimensions are derived per-provider. + enum: + - '512' + - 1K + - 2K + - 4K + example: 2K + type: string + x-speakeasy-unknown-values: allow + seed: + description: >- + If specified, the generation will sample deterministically, such that repeated requests with the same seed and parameters should return the same result. Determinism is not guaranteed for all providers. + type: integer + size: + description: >- + Optional. A convenience shorthand for output dimensions — pass a tier ("2K", "4K") or explicit pixels ("2048x2048") and we normalize it to the right dimensions for the chosen provider. Interchangeable with resolution + aspect_ratio; use those directly for enumerated, per-model discoverable values. Conflicting size + resolution/aspect_ratio is rejected. + example: 2K + type: string + stream: + description: >- + If true, partial images are streamed as SSE events as they become available. Only supported by providers with native streaming (currently OpenAI). Non-streaming providers ignore this flag and return a buffered response. + type: boolean + required: + - model + - prompt + type: object + ImageGenerationResponse: + description: Image generation response + example: + created: 1748372400 + data: + - b64_json: + usage: + completion_tokens: 4175 + cost: 0.04 + prompt_tokens: 0 + total_tokens: 4175 + properties: + created: + description: Unix timestamp (seconds) when the image was generated + example: 1748372400 + type: integer + data: + description: Generated images + items: + properties: + b64_json: + description: Base64-encoded image bytes + type: string + required: + - b64_json + type: object + type: array + usage: + $ref: '#/components/schemas/ImageGenerationUsage' + required: + - created + - data + type: object + ImageGenerationServerTool: + description: Image generation tool configuration + example: + quality: high + type: image_generation + properties: + background: + enum: + - transparent + - opaque + - auto + type: string + x-speakeasy-unknown-values: allow + input_fidelity: + enum: + - high + - low + - null nullable: true type: string x-speakeasy-unknown-values: allow @@ -9423,6 +9545,382 @@ components: example: completed type: string x-speakeasy-unknown-values: allow + ImageGenerationUsage: + description: Token and cost usage for the image generation request, when available + example: + completion_tokens: 4175 + cost: 0.04 + prompt_tokens: 0 + total_tokens: 4175 + properties: + completion_tokens: + description: The tokens generated + type: integer + completion_tokens_details: + nullable: true + properties: + audio_tokens: + description: Tokens generated by the model for audio output. + nullable: true + type: integer + image_tokens: + description: Tokens generated by the model for image output. + nullable: true + type: integer + reasoning_tokens: + description: Tokens generated by the model for reasoning. + nullable: true + type: integer + type: object + cost: + description: Cost of the completion + format: double + nullable: true + type: number + cost_details: + $ref: '#/components/schemas/CostDetails' + is_byok: + description: Whether a request was made using a Bring Your Own Key configuration + type: boolean + iterations: + items: + $ref: '#/components/schemas/AnthropicUsageIteration' + nullable: true + type: array + prompt_tokens: + description: Including images, input audio, and tools if any + type: integer + prompt_tokens_details: + description: Breakdown of tokens used in the prompt. + nullable: true + properties: + audio_tokens: + description: Tokens used for input audio. + nullable: true + type: integer + cache_write_tokens: + description: Tokens written to cache. Only returned for models with explicit caching and cache write pricing. + nullable: true + type: integer + cached_tokens: + description: Tokens cached by the endpoint. + nullable: true + type: integer + file_tokens: + description: Tokens used for input files/documents. + nullable: true + type: integer + video_tokens: + description: Tokens used for input video. + nullable: true + type: integer + type: object + server_tool_use: + description: Usage for server-side tool execution (e.g., web search) + nullable: true + properties: + tool_calls_executed: + description: Number of OpenRouter server tool calls that executed and produced a result. + nullable: true + type: integer + tool_calls_requested: + description: >- + Total number of OpenRouter server-orchestrated tool calls the model requested, across all tool types. Provider-native tools (e.g. native web search) are not counted here. + nullable: true + type: integer + web_search_requests: + description: >- + Number of web searches performed by server-side tools. For server-orchestrated tool calls a web search is also counted in tool_calls_requested; provider-native web search may report web_search_requests only. Do not sum the two. + nullable: true + type: integer + type: object + service_tier: + description: The service tier used by the upstream provider for this request + nullable: true + type: string + speed: + $ref: '#/components/schemas/AnthropicSpeed' + total_tokens: + description: Sum of the above two fields + type: integer + required: + - prompt_tokens + - completion_tokens + - total_tokens + type: object + ImageGenPartialImageEvent: + description: Emitted when a partial image becomes available during streaming generation + example: + b64_json: + partial_image_index: 0 + type: image_generation.partial_image + properties: + b64_json: + description: Base64-encoded partial image data + type: string + partial_image_index: + description: 0-based index indicating which partial image this is in the sequence + type: integer + type: + description: The event type + enum: + - image_generation.partial_image + type: string + required: + - type + - partial_image_index + - b64_json + type: object + ImageGenStreamErrorEvent: + description: Emitted when streaming generation fails after the SSE response starts + example: + error: + code: upstream_error + message: The upstream provider returned an error + param: null + type: provider_error + type: error + properties: + error: + description: Provider error details + properties: + code: + description: Provider error code, when supplied + nullable: true + type: string + message: + description: Provider error message + type: string + param: + description: Request parameter associated with the error, when supplied + nullable: true + type: string + type: + description: Provider error type, when supplied + nullable: true + type: string + required: + - message + type: object + type: + description: The event type + enum: + - error + type: string + required: + - type + - error + type: object + ImageModelArchitecture: + example: + input_modalities: + - text + - image + output_modalities: + - image + properties: + input_modalities: + description: Supported input modalities + items: + $ref: '#/components/schemas/InputModality' + type: array + output_modalities: + description: Supported output modalities + items: + $ref: '#/components/schemas/ImageOutputModality' + type: array + required: + - input_modalities + - output_modalities + type: object + ImageModelEndpointsResponse: + description: The full per-endpoint records for an image model. + example: + endpoints: + - allowed_passthrough_parameters: [] + pricing: + - billable: output_image + cost_usd: 0.05 + unit: image + provider_name: Bytedance + provider_slug: bytedance + provider_tag: bytedance + supported_parameters: + resolution: + type: enum + values: + - 1K + - 2K + - 4K + supports_streaming: false + id: bytedance-seed/seedream-4.5 + properties: + endpoints: + items: + $ref: '#/components/schemas/ImageEndpoint' + type: array + id: + description: Model slug + example: bytedance-seed/seedream-4.5 + type: string + required: + - id + - endpoints + type: object + ImageModelListItem: + description: A single image model in the discovery listing. + example: + architecture: + input_modalities: + - text + - image + output_modalities: + - image + created: 1692901234 + description: A text-to-image model. + endpoints: /api/v1/images/models/bytedance-seed/seedream-4.5/endpoints + id: bytedance-seed/seedream-4.5 + name: Seedream 4.5 + supported_parameters: + resolution: + type: enum + values: + - 1K + - 2K + - 4K + seed: + type: boolean + supports_streaming: false + properties: + architecture: + $ref: '#/components/schemas/ImageModelArchitecture' + created: + description: Unix timestamp (seconds) of when the model was created + example: 1692901234 + type: integer + description: + example: A text-to-image model. + type: string + endpoints: + description: Relative URL to the full per-endpoint records for this model + example: /api/v1/images/models/bytedance-seed/seedream-4.5/endpoints + type: string + id: + description: Model slug + example: bytedance-seed/seedream-4.5 + type: string + name: + description: Display name + example: Seedream 4.5 + type: string + supported_parameters: + $ref: '#/components/schemas/SupportedParameters' + supports_streaming: + description: >- + Whether any endpoint of this model supports native SSE streaming on the dedicated Image API (i.e. `stream: true` in the request). OR across endpoints. + example: false + type: boolean + required: + - id + - name + - description + - created + - architecture + - supported_parameters + - supports_streaming + - endpoints + type: object + ImageModelsListResponse: + description: List of image generation models. + example: + data: + - architecture: + input_modalities: + - text + output_modalities: + - image + created: 1692901234 + description: A text-to-image model. + endpoints: /api/v1/images/models/bytedance-seed/seedream-4.5/endpoints + id: bytedance-seed/seedream-4.5 + name: Seedream 4.5 + supported_parameters: + resolution: + type: enum + values: + - 1K + - 2K + - 4K + supports_streaming: false + properties: + data: + items: + $ref: '#/components/schemas/ImageModelListItem' + type: array + required: + - data + type: object + ImageOutputModality: + enum: + - text + - image + - embeddings + - audio + - video + - rerank + - speech + - transcription + example: image + type: string + x-speakeasy-unknown-values: allow + ImagePricingEntry: + description: One billable pricing line for an image provider. + example: + billable: output_image + cost_usd: 0.05 + unit: image + properties: + billable: + enum: + - output_image + - input_image + - input_font + - input_reference + - input_text + type: string + x-speakeasy-unknown-values: allow + cost_usd: + format: double + type: number + unit: + enum: + - image + - megapixel + - token + type: string + x-speakeasy-unknown-values: allow + variant: + type: string + required: + - billable + - unit + - cost_usd + type: object + ImageStreamingResponse: + example: + data: + b64_json: + partial_image_index: 0 + type: image_generation.partial_image + properties: + data: + anyOf: + - $ref: '#/components/schemas/ImageGenPartialImageEvent' + - $ref: '#/components/schemas/ImageGenCompletedEvent' + - $ref: '#/components/schemas/ImageGenStreamErrorEvent' + required: + - data + type: object IncompleteDetails: example: reason: max_output_tokens @@ -9738,6 +10236,7 @@ components: - $ref: '#/components/schemas/OutputMemoryServerToolItem' - $ref: '#/components/schemas/OutputMcpServerToolItem' - $ref: '#/components/schemas/OutputSearchModelsServerToolItem' + - $ref: '#/components/schemas/OutputFusionServerToolItem' - $ref: '#/components/schemas/OutputAdvisorServerToolItem' - $ref: '#/components/schemas/OutputSubagentServerToolItem' - $ref: '#/components/schemas/LocalShellCallItem' @@ -9958,7 +10457,7 @@ components: $ref: '#/components/schemas/WebSearchDomainFilter' max_results: description: >- - Maximum number of search results to return per search call. Defaults to 5. Applies to Exa, Firecrawl, Parallel, and Perplexity engines; ignored with native provider search. + Maximum number of search results to return per search call. Defaults to 5. Applies to Exa, Firecrawl, Parallel, and Perplexity engines; ignored with native provider search. Perplexity supports a maximum of 20; values above 20 are clamped. example: 5 type: integer search_context_size: @@ -10295,6 +10794,24 @@ components: - data - total_count type: object + ListWorkspaceBudgetsResponse: + example: + data: + - created_at: '2025-08-24T10:30:00Z' + id: 770e8400-e29b-41d4-a716-446655440000 + limit_usd: 100 + reset_interval: monthly + updated_at: '2025-08-24T15:45:00Z' + workspace_id: 550e8400-e29b-41d4-a716-446655440000 + properties: + data: + description: List of budgets configured for the workspace + items: + $ref: '#/components/schemas/WorkspaceBudget' + type: array + required: + - data + type: object ListWorkspacesResponse: example: data: @@ -10948,9 +11465,12 @@ components: type: object MessagesErrorDetail: example: + error_type: invalid_request message: Invalid request parameters type: invalid_request_error properties: + error_type: + $ref: '#/components/schemas/ApiErrorType' message: type: string type: @@ -10963,12 +11483,15 @@ components: description: Error event in the stream example: error: + error_type: provider_overloaded message: Overloaded type: overloaded_error type: error properties: error: properties: + error_type: + $ref: '#/components/schemas/ApiErrorType' message: type: string type: @@ -10977,6 +11500,8 @@ components: - type - message type: object + openrouter_metadata: + $ref: '#/components/schemas/OpenRouterMetadata' type: enum: - error @@ -11927,6 +12452,7 @@ components: - Stealth - StreamLake - Switchpoint + - Tenstorrent - Together - Upstage - Venice @@ -12088,6 +12614,15 @@ components: image: '0' prompt: '0.00003' request: '0' + reasoning: + default_effort: medium + default_enabled: true + mandatory: false + supported_efforts: + - high + - medium + - low + - minimal supported_parameters: - temperature - top_p @@ -12150,6 +12685,8 @@ components: $ref: '#/components/schemas/PerRequestLimits' pricing: $ref: '#/components/schemas/PublicPricing' + reasoning: + $ref: '#/components/schemas/ModelReasoning' supported_parameters: description: List of supported parameters for this model items: @@ -12314,6 +12851,43 @@ components: description: Model to use for completion example: openai/gpt-4 type: string + ModelReasoning: + description: Reasoning effort configuration. Omitted for non-reasoning models and dynamic router models. + example: + default_effort: medium + default_enabled: true + mandatory: false + supported_efforts: + - high + - medium + - low + - minimal + properties: + default_effort: + allOf: + - $ref: '#/components/schemas/ReasoningEffort' + - description: >- + Default reasoning effort when the client enables reasoning without specifying effort. Maps to `reasoning.effort` in chat requests. When `"none"`, prefer omitting effort unless the user explicitly disables reasoning. + default_enabled: + description: Default reasoning enabled state when the client does not set `reasoning.enabled`. + type: boolean + mandatory: + description: When true, reasoning cannot be disabled and effort "none" is rejected. + type: boolean + supported_efforts: + description: >- + Allowed reasoning effort values for this model, in descending effort order (highest first). Null means no allowlist — all gateway effort values are accepted. + items: + $ref: '#/components/schemas/ReasoningEffort' + nullable: true + type: array + supports_max_tokens: + description: >- + Present and `true` when the model accepts `reasoning.max_tokens` in requests (Anthropic-style) instead of or in addition to `reasoning.effort`. Omitted otherwise. + type: boolean + required: + - mandatory + type: object ModelResponse: description: Single model response example: @@ -12561,6 +13135,7 @@ components: description: Custom HTTP headers to include in requests to this destination. type: object modelId: + description: The name of the tracing project in Arize AX minLength: 1 type: string spaceKey: @@ -14978,6 +15553,8 @@ components: allOf: - $ref: '#/components/schemas/BaseResponsesResult' - properties: + error_type: + $ref: '#/components/schemas/ApiErrorType' openrouter_metadata: $ref: '#/components/schemas/OpenRouterMetadata' output: @@ -17092,7 +17669,7 @@ components: $ref: '#/components/schemas/WebSearchDomainFilter' max_results: description: >- - Maximum number of search results to return per search call. Defaults to 5. Applies to Exa, Firecrawl, Parallel, and Perplexity engines; ignored with native provider search. + Maximum number of search results to return per search call. Defaults to 5. Applies to Exa, Firecrawl, Parallel, and Perplexity engines; ignored with native provider search. Perplexity supports a maximum of 20; values above 20 are clamped. example: 5 type: integer search_context_size: @@ -17117,7 +17694,7 @@ components: $ref: '#/components/schemas/WebSearchDomainFilter' max_results: description: >- - Maximum number of search results to return per search call. Defaults to 5. Applies to Exa, Firecrawl, Parallel, and Perplexity engines; ignored with native provider search. + Maximum number of search results to return per search call. Defaults to 5. Applies to Exa, Firecrawl, Parallel, and Perplexity engines; ignored with native provider search. Perplexity supports a maximum of 20; values above 20 are clamped. example: 5 type: integer search_context_size: @@ -17247,6 +17824,7 @@ components: - Stealth - StreamLake - Switchpoint + - Tenstorrent - Together - Upstage - Venice @@ -17261,7 +17839,7 @@ components: x-speakeasy-unknown-values: allow ProviderOptions: description: >- - Provider-specific options keyed by provider slug. The options for the matched provider are spread into the upstream request body. + Provider-specific options keyed by provider slug. Only options for the matched provider are forwarded; the rest are ignored. Unrecognized keys are silently dropped. example: openai: max_tokens: 1000 @@ -17686,6 +18264,10 @@ components: additionalProperties: nullable: true type: object + tenstorrent: + additionalProperties: + nullable: true + type: object together: additionalProperties: nullable: true @@ -18035,6 +18617,7 @@ components: - Stealth - StreamLake - Switchpoint + - Tenstorrent - Together - Upstage - Venice @@ -18348,6 +18931,26 @@ components: example: fp16 type: string x-speakeasy-unknown-values: allow + RangeCapability: + description: A parameter that accepts any value within an inclusive numeric range. + example: + max: 100 + min: 0 + type: range + properties: + max: + type: number + min: + type: number + type: + enum: + - range + type: string + required: + - type + - min + - max + type: object RankingsDailyItem: example: date: '2026-05-11' @@ -18563,6 +19166,7 @@ components: type: response.reasoning_text.done ReasoningEffort: enum: + - max - xhigh - high - medium @@ -18928,6 +19532,8 @@ components: type: boolean cache_control: $ref: '#/components/schemas/AnthropicCacheControlDirective' + debug: + $ref: '#/components/schemas/ChatDebugOptions' frequency_penalty: format: double nullable: true @@ -19629,6 +20235,7 @@ components: response.created: '#/components/schemas/OpenResponsesCreatedEvent' response.custom_tool_call_input.delta: '#/components/schemas/CustomToolCallInputDeltaEvent' response.custom_tool_call_input.done: '#/components/schemas/CustomToolCallInputDoneEvent' + response.debug: '#/components/schemas/DebugEvent' response.failed: '#/components/schemas/StreamEventsResponseFailed' response.function_call_arguments.delta: '#/components/schemas/FunctionCallArgsDeltaEvent' response.function_call_arguments.done: '#/components/schemas/FunctionCallArgsDoneEvent' @@ -19728,6 +20335,7 @@ components: - $ref: '#/components/schemas/FusionCallAnalysisInProgressEvent' - $ref: '#/components/schemas/FusionCallAnalysisCompletedEvent' - $ref: '#/components/schemas/FusionCallCompletedEvent' + - $ref: '#/components/schemas/DebugEvent' StreamEventsResponseCompleted: allOf: - $ref: '#/components/schemas/CompletedEvent' @@ -20015,6 +20623,7 @@ components: effort: description: Reasoning effort level for the subagent call. enum: + - max - xhigh - high - medium @@ -20043,47 +20652,246 @@ components: - openrouter:subagent type: string required: - - type + - type + type: object + SubagentServerToolConfig: + description: Configuration for the openrouter:subagent server tool. + example: + model: ~anthropic/claude-haiku-latest + properties: + instructions: + description: System instructions for the subagent. When omitted, the subagent responds with no system prompt of its own. + example: You are a fast, focused worker. Complete the task exactly as described. + type: string + max_completion_tokens: + description: >- + Maximum number of output tokens (including reasoning) the subagent may produce. When omitted, the provider's default applies. + example: 2048 + type: integer + max_tool_calls: + description: >- + Maximum number of tool-calling steps the subagent may take during its agentic loop. Capped at 25. Only relevant when the subagent is given tools. Accepted and validated but not yet enforced on the subagent call. + example: 5 + maximum: 25 + minimum: 1 + type: integer + model: + description: >- + Slug of the model that executes delegated tasks (any OpenRouter model). Typically a smaller, cheaper, faster model than the one delegating. When omitted, the model from the outer API request is used. The subagent tool itself cannot be the subagent model. + example: ~anthropic/claude-haiku-latest + type: string + reasoning: + $ref: '#/components/schemas/SubagentReasoning' + temperature: + description: Sampling temperature forwarded to the subagent call. When omitted, the provider's default applies. + example: 0.7 + format: double + type: number + tools: + description: >- + Tools the subagent may use while executing a delegated task. The subagent runs as an agentic sub-agent over these tools, then returns its outcome. Only OpenRouter server tools are supported — function tools are rejected — and the list must not include the subagent tool itself. + items: + $ref: '#/components/schemas/SubagentNestedTool' + type: array + type: object + SupportedParameters: + additionalProperties: + $ref: '#/components/schemas/CapabilityDescriptor' + description: >- + Union of supported parameters across every endpoint of this model. Coarse discovery aid; the definitive per-endpoint set is behind the endpoints URL. + example: + output_compression: + max: 100 + min: 0 + type: range + resolution: + type: enum + values: + - 1K + - 2K + - 4K + seed: + type: boolean + type: object + TaskClassificationItem: + example: + category_token_share: 0.48 + category_usage_share: 0.51 + display_name: Code Generation + macro_category: code + models: + - id: openai/gpt-4.1-mini + tag_token_share: 0.75 + tag_usage_share: 0.55 + - id: anthropic/claude-sonnet-4 + tag_token_share: 0.12 + tag_usage_share: 0.2 + tag: code:general_impl + token_share: 0.31 + usage_share: 0.23 + properties: + category_token_share: + description: >- + Fraction of this classification's token volume within its macro-category (0–1). Sums to 1 across all classifications sharing the same `macro_category`. + example: 0.48 + format: double + type: number + category_usage_share: + description: >- + Fraction of this classification's usage within its macro-category (0–1). Sums to 1 across all classifications sharing the same `macro_category`. + example: 0.51 + format: double + type: number + display_name: + description: Human-readable label for the classification. + example: Code Generation + type: string + macro_category: + description: 'Coarse grouping derived from the tag prefix: `code`, `data`, `agent`, or `general`.' + example: code + type: string + models: + description: >- + Top models for this classification by request volume, sorted descending. Each entry reports the model's share of this classification's requests and tokens. + items: + $ref: '#/components/schemas/TaskClassificationModel' + type: array + tag: + description: Classification tag identifier (e.g. `code:general_impl`, `agent:web_search`). + example: code:general_impl + type: string + token_share: + description: >- + Fraction of classified sampled token volume (prompt + completion) attributed to this classification (0–1). The unclassified `other` bucket is excluded from the denominator. + example: 0.31 + format: double + type: number + usage_share: + description: >- + Fraction of classified sampled requests attributed to this classification (0–1). The unclassified `other` bucket is excluded from the denominator. + example: 0.23 + format: double + type: number + required: + - tag + - display_name + - macro_category + - usage_share + - token_share + - category_usage_share + - category_token_share + - models + type: object + TaskClassificationMacroCategory: + example: + key: code + label: Code + token_share: 0.52 + usage_share: 0.45 + properties: + key: + description: Macro-category identifier. + example: code + type: string + label: + description: Human-readable label for the macro-category. + example: Code + type: string + token_share: + description: Combined token share of all classifications in this macro-category (0–1). + example: 0.52 + format: double + type: number + usage_share: + description: Combined usage share of all classifications in this macro-category (0–1). + example: 0.45 + format: double + type: number + required: + - key + - label + - usage_share + - token_share type: object - SubagentServerToolConfig: - description: Configuration for the openrouter:subagent server tool. + TaskClassificationModel: example: - model: ~anthropic/claude-haiku-latest + id: openai/gpt-4.1-mini + tag_token_share: 0.75 + tag_usage_share: 0.55 properties: - instructions: - description: System instructions for the subagent. When omitted, the subagent responds with no system prompt of its own. - example: You are a fast, focused worker. Complete the task exactly as described. + id: + description: Model identifier (permaslug). + example: openai/gpt-4.1-mini type: string - max_completion_tokens: - description: >- - Maximum number of output tokens (including reasoning) the subagent may produce. When omitted, the provider's default applies. - example: 2048 - type: integer - max_tool_calls: - description: >- - Maximum number of tool-calling steps the subagent may take during its agentic loop. Capped at 25. Only relevant when the subagent is given tools. Accepted and validated but not yet enforced on the subagent call. - example: 5 - maximum: 25 - minimum: 1 - type: integer - model: + tag_token_share: description: >- - Slug of the model that executes delegated tasks (any OpenRouter model). Typically a smaller, cheaper, faster model than the one delegating. When omitted, the model from the outer API request is used. The subagent tool itself cannot be the subagent model. - example: ~anthropic/claude-haiku-latest - type: string - reasoning: - $ref: '#/components/schemas/SubagentReasoning' - temperature: - description: Sampling temperature forwarded to the subagent call. When omitted, the provider's default applies. - example: 0.7 + Fraction of this classification's sampled token volume attributed to this model (0–1). Sums to ≤1 across the returned models (only top-N are included and unattributed requests are excluded). + example: 0.75 format: double type: number - tools: + tag_usage_share: description: >- - Tools the subagent may use while executing a delegated task. The subagent runs as an agentic sub-agent over these tools, then returns its outcome. Only OpenRouter server tools are supported — function tools are rejected — and the list must not include the subagent tool itself. - items: - $ref: '#/components/schemas/SubagentNestedTool' - type: array + Fraction of this classification's sampled requests attributed to this model (0–1). Sums to ≤1 across the returned models (only top-N are included and unattributed requests are excluded). + example: 0.55 + format: double + type: number + required: + - id + - tag_usage_share + - tag_token_share + type: object + TaskClassificationResponse: + example: + data: + as_of: '2026-06-17' + classifications: + - category_token_share: 0.48 + category_usage_share: 0.51 + display_name: Code Generation + macro_category: code + models: + - id: openai/gpt-4.1-mini + tag_token_share: 0.75 + tag_usage_share: 0.55 + tag: code:general_impl + token_share: 0.31 + usage_share: 0.23 + macro_categories: + - key: code + label: Code + token_share: 0.52 + usage_share: 0.45 + window_days: 7 + properties: + data: + properties: + as_of: + description: >- + UTC date (YYYY-MM-DD) of the window upper bound (yesterday). Data is exclusive of the current incomplete UTC day. This is the expected latest date in the snapshot; it does not confirm data presence for that date. + example: '2026-06-17' + type: string + classifications: + description: Per-task classification market-share data, sorted by usage_share descending. + items: + $ref: '#/components/schemas/TaskClassificationItem' + type: array + macro_categories: + description: Aggregate market-share data per macro-category (code, data, agent, general). + items: + $ref: '#/components/schemas/TaskClassificationMacroCategory' + type: array + window_days: + description: Number of trailing days covered by this snapshot. + example: 7 + type: integer + required: + - window_days + - as_of + - classifications + - macro_categories + type: object + required: + - data type: object TextConfig: description: Text output configuration including format and verbosity @@ -20299,37 +21107,300 @@ components: code: 401 message: Missing Authentication header properties: - error: - $ref: '#/components/schemas/UnauthorizedResponseErrorData' - openrouter_metadata: - additionalProperties: - nullable: true + error: + $ref: '#/components/schemas/UnauthorizedResponseErrorData' + openrouter_metadata: + additionalProperties: + nullable: true + nullable: true + type: object + user_id: + nullable: true + type: string + required: + - error + type: object + UnauthorizedResponseErrorData: + description: Error data for UnauthorizedResponse + example: + code: 401 + message: Missing Authentication header + properties: + code: + type: integer + message: + type: string + metadata: + additionalProperties: + nullable: true + nullable: true + type: object + required: + - code + - message + type: object + UnifiedBenchmarkPricing: + description: OpenRouter pricing per token for this model. Null if pricing is unavailable. + example: + completion: '0.000015' + prompt: '0.000003' + nullable: true + properties: + completion: + description: Cost per output token (USD, decimal string). + example: '0.000015' + type: string + prompt: + description: Cost per input token (USD, decimal string). + example: '0.000003' + type: string + required: + - prompt + - completion + type: object + UnifiedBenchmarksAAItem: + example: + agentic_index: 58.3 + coding_index: 65.8 + display_name: GPT-4o + intelligence_index: 71.2 + model_permaslug: openai/gpt-4o + pricing: + completion: '0.00001' + prompt: '0.0000025' + source: artificial-analysis + properties: + agentic_index: + description: Artificial Analysis Agentic Index composite score. Higher is better. + example: 58.3 + format: double + nullable: true + type: number + coding_index: + description: Artificial Analysis Coding Index composite score. Higher is better. + example: 65.8 + format: double + nullable: true + type: number + display_name: + description: Model name as listed on Artificial Analysis. + example: GPT-4o + type: string + intelligence_index: + description: Artificial Analysis Intelligence Index composite score. Higher is better. + example: 71.2 + format: double + nullable: true + type: number + model_permaslug: + description: Stable OpenRouter model identifier. + example: openai/gpt-4o + type: string + pricing: + $ref: '#/components/schemas/UnifiedBenchmarkPricing' + source: + description: Benchmark source discriminator. + enum: + - artificial-analysis + type: string + required: + - source + - model_permaslug + - display_name + - intelligence_index + - coding_index + - agentic_index + - pricing + type: object + UnifiedBenchmarksDAItem: + example: + arena: models + avg_generation_time_ms: 3200 + category: codecategories + display_name: Claude Sonnet 4 + elo: 1423 + model_permaslug: anthropic/claude-sonnet-4 + pricing: + completion: '0.000015' + prompt: '0.000003' + source: design-arena + tournament_stats: + first_place: 12 + fourth_place: 2 + second_place: 8 + third_place: 5 + total: 27 + win_rate: 72 + properties: + arena: + description: Arena this ranking belongs to. + example: models + type: string + avg_generation_time_ms: + description: Average generation time in milliseconds. + example: 3200 + format: double + nullable: true + type: number + category: + description: Category within the arena. + example: codecategories + type: string + display_name: + description: Human-readable model name from Design Arena. + example: Claude Sonnet 4 + type: string + elo: + description: ELO rating from head-to-head arena battles. + example: 1423 + format: double + type: number + model_permaslug: + description: Stable OpenRouter model identifier when mapped; otherwise the upstream Design Arena model id. + example: anthropic/claude-sonnet-4 + type: string + pricing: + $ref: '#/components/schemas/UnifiedBenchmarkPricing' + source: + description: Benchmark source discriminator. + enum: + - design-arena + type: string + tournament_stats: + description: Placement distribution from tournament matches. + properties: + first_place: + nullable: true + type: integer + fourth_place: + nullable: true + type: integer + second_place: + nullable: true + type: integer + third_place: + nullable: true + type: integer + total: + nullable: true + type: integer + required: + - first_place + - second_place + - third_place + - fourth_place + - total + type: object + win_rate: + description: Win rate as a percentage (0–100). + example: 72 + format: double + type: number + required: + - source + - model_permaslug + - display_name + - arena + - category + - elo + - win_rate + - avg_generation_time_ms + - tournament_stats + - pricing + type: object + UnifiedBenchmarksMeta: + example: + as_of: '2026-06-03T12:00:00Z' + citation: 'Source: Artificial Analysis (artificialanalysis.ai) via OpenRouter (openrouter.ai/rankings).' + model_count: 50 + source: artificial-analysis + source_url: https://artificialanalysis.ai + task_type: null + version: v1 + properties: + as_of: + description: ISO-8601 timestamp of when this data was last updated. + example: '2026-06-03T12:00:00Z' + type: string + citation: + description: >- + Required attribution when republishing this data, or null when results span multiple sources (attribute each item individually by its `source` discriminator). + example: 'Source: Artificial Analysis (artificialanalysis.ai) via OpenRouter (openrouter.ai/rankings).' nullable: true - type: object - user_id: + type: string + model_count: + description: Number of unique models in the response. + type: integer + source: + description: The source filter applied, or null when all sources are returned. + enum: + - artificial-analysis + - design-arena + - null + example: artificial-analysis + nullable: true + type: string + x-speakeasy-unknown-values: allow + source_url: + description: URL of the upstream data source, or null when results span multiple sources. + example: https://artificialanalysis.ai + nullable: true + type: string + task_type: + description: The task_type filter applied, or null if showing all. nullable: true type: string + version: + description: Dataset version. + enum: + - v1 + type: string required: - - error + - as_of + - version + - source + - source_url + - citation + - model_count + - task_type type: object - UnauthorizedResponseErrorData: - description: Error data for UnauthorizedResponse + UnifiedBenchmarksResponse: example: - code: 401 - message: Missing Authentication header + data: + - agentic_index: 58.3 + coding_index: 65.8 + display_name: GPT-4o + intelligence_index: 71.2 + model_permaslug: openai/gpt-4o + pricing: + completion: '0.00001' + prompt: '0.0000025' + source: artificial-analysis + meta: + as_of: '2026-06-03T12:00:00Z' + citation: null + model_count: 1 + source: null + source_url: null + task_type: null + version: v1 properties: - code: - type: integer - message: - type: string - metadata: - additionalProperties: - nullable: true - nullable: true - type: object + data: + items: + discriminator: + mapping: + artificial-analysis: '#/components/schemas/UnifiedBenchmarksAAItem' + design-arena: '#/components/schemas/UnifiedBenchmarksDAItem' + propertyName: source + oneOf: + - $ref: '#/components/schemas/UnifiedBenchmarksAAItem' + - $ref: '#/components/schemas/UnifiedBenchmarksDAItem' + type: array + meta: + $ref: '#/components/schemas/UnifiedBenchmarksMeta' required: - - code - - message + - data + - meta type: object UnprocessableEntityResponse: description: Unprocessable Entity - Semantic validation failure @@ -20744,6 +21815,35 @@ components: required: - data type: object + UpsertWorkspaceBudgetRequest: + example: + limit_usd: 100 + properties: + limit_usd: + description: Spending limit in USD. Must be greater than 0. + example: 100 + format: double + type: number + required: + - limit_usd + type: object + UpsertWorkspaceBudgetResponse: + example: + data: + created_at: '2025-08-24T10:30:00Z' + id: 770e8400-e29b-41d4-a716-446655440000 + limit_usd: 100 + reset_interval: monthly + updated_at: '2025-08-24T15:45:00Z' + workspace_id: 550e8400-e29b-41d4-a716-446655440000 + properties: + data: + allOf: + - $ref: '#/components/schemas/WorkspaceBudget' + - description: The created or updated budget + required: + - data + type: object URLCitation: example: content: OpenRouter provides a unified API for accessing LLMs from multiple providers. @@ -21309,7 +22409,7 @@ components: type: integer max_results: description: >- - Maximum number of search results to return per search call. Defaults to 5. Applies to Exa, Firecrawl, Parallel, and Perplexity engines; ignored with native provider search. + Maximum number of search results to return per search call. Defaults to 5. Applies to Exa, Firecrawl, Parallel, and Perplexity engines; ignored with native provider search. Perplexity supports a maximum of 20; values above 20 are clamped. example: 5 type: integer max_total_results: @@ -21439,7 +22539,7 @@ components: $ref: '#/components/schemas/WebSearchDomainFilter' max_results: description: >- - Maximum number of search results to return per search call. Defaults to 5. Applies to Exa, Firecrawl, Parallel, and Perplexity engines; ignored with native provider search. + Maximum number of search results to return per search call. Defaults to 5. Applies to Exa, Firecrawl, Parallel, and Perplexity engines; ignored with native provider search. Perplexity supports a maximum of 20; values above 20 are clamped. example: 5 type: integer search_context_size: @@ -21496,7 +22596,7 @@ components: type: integer max_results: description: >- - Maximum number of search results to return per search call. Defaults to 5. Applies to Exa, Firecrawl, Parallel, and Perplexity engines; ignored with native provider search. + Maximum number of search results to return per search call. Defaults to 5. Applies to Exa, Firecrawl, Parallel, and Perplexity engines; ignored with native provider search. Perplexity supports a maximum of 20; values above 20 are clamped. example: 5 type: integer max_total_results: @@ -21692,6 +22792,67 @@ components: - updated_at - created_by type: object + WorkspaceBudget: + example: + created_at: '2025-08-24T10:30:00Z' + id: 770e8400-e29b-41d4-a716-446655440000 + limit_usd: 100 + reset_interval: monthly + updated_at: '2025-08-24T15:45:00Z' + workspace_id: 550e8400-e29b-41d4-a716-446655440000 + properties: + created_at: + description: ISO 8601 timestamp of when the budget was created + example: '2025-08-24T10:30:00Z' + type: string + id: + description: Unique identifier for the budget + example: 770e8400-e29b-41d4-a716-446655440000 + format: uuid + type: string + limit_usd: + description: Spending limit in USD for this interval + example: 100 + format: double + type: number + reset_interval: + description: Interval at which spend resets. Null means a lifetime (one-time) budget. + enum: + - daily + - weekly + - monthly + - null + example: monthly + nullable: true + type: string + x-speakeasy-unknown-values: allow + updated_at: + description: ISO 8601 timestamp of when the budget was last updated + example: '2025-08-24T15:45:00Z' + type: string + workspace_id: + description: ID of the workspace the budget belongs to + example: 550e8400-e29b-41d4-a716-446655440000 + format: uuid + type: string + required: + - id + - workspace_id + - limit_usd + - reset_interval + - created_at + - updated_at + type: object + WorkspaceBudgetInterval: + description: Budget reset interval. Use "lifetime" for a one-time budget that never resets. + enum: + - daily + - weekly + - monthly + - lifetime + example: monthly + type: string + x-speakeasy-unknown-values: allow WorkspaceMember: example: created_at: '2025-08-24T10:30:00Z' @@ -22056,7 +23217,7 @@ paths: properties: dimensions: items: - description: Dimension name + description: Dimension to group by (up to 2). Use the /meta endpoint for available dimensions. example: model type: string maxItems: 2 @@ -22065,7 +23226,7 @@ paths: items: properties: field: - description: Dimension to filter on + description: Dimension to filter on. Use the /meta endpoint for available dimensions. example: model type: string operator: @@ -22083,7 +23244,8 @@ paths: - format: double type: number type: array - description: Filter value (scalar or array depending on operator) + description: >- + Filter value (scalar or array depending on operator). Several dimensions are enriched in responses (returned as human-readable labels), but filters must use the underlying ID: `api_key_id` — numeric ID (from generation metadata) or key hash (64-char hex from GET /api/v1/keys, resolved server-side); `user` — Clerk user ID (e.g. "user_abc123"), not the display name; `workspace` — workspace UUID, not the workspace name; `app` — numeric app ID, not the app title; `model` — permaslug (e.g. "openai/gpt-4o"), not the display name. Other dimensions (provider, origin, country, etc.) are not enriched and accept the value as returned. required: - field - operator @@ -22182,6 +23344,12 @@ paths: - row_count - truncated type: object + warnings: + description: >- + Warnings about filter resolution issues (e.g. unresolvable api_key_id hashes). The query still runs normally; these inform the caller that some filter values could not be resolved. + items: + type: string + type: array required: - data - metadata @@ -22764,18 +23932,155 @@ paths: code: 403 message: Only management keys can perform this operation schema: - $ref: '#/components/schemas/ForbiddenResponse' - description: Forbidden - Authentication successful but insufficient permissions - '409': + $ref: '#/components/schemas/ForbiddenResponse' + description: Forbidden - Authentication successful but insufficient permissions + '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 + '500': + content: + application/json: + example: + error: + code: 500 + message: Internal Server Error + schema: + $ref: '#/components/schemas/InternalServerResponse' + description: Internal Server Error - Unexpected server error + summary: Create authorization code + tags: + - OAuth + x-speakeasy-name-override: createAuthCode + /benchmarks: + get: + description: >- + Unified benchmark endpoint that aggregates scores from multiple benchmark sources (Artificial Analysis, Design Arena). Filter by source to reproduce the exact shapes from the legacy per-source endpoints, or use task_type to find models suited for specific workloads. Authenticate with any valid OpenRouter API key. Rate-limited to 30 requests/minute per key and 500 requests/day per account. + operationId: getBenchmarks + parameters: + - description: >- + Benchmark source to query. Determines the shape of the returned items. When omitted, returns results from all sources. + in: query + name: source + required: false + schema: + description: >- + Benchmark source to query. Determines the shape of the returned items. When omitted, returns results from all sources. + enum: + - artificial-analysis + - design-arena + example: artificial-analysis + type: string + x-speakeasy-unknown-values: allow + - description: >- + Filter results by task type. For Artificial Analysis, maps to the corresponding index. For Design Arena, maps to the matching category. + in: query + name: task_type + required: false + schema: + description: >- + Filter results by task type. For Artificial Analysis, maps to the corresponding index. For Design Arena, maps to the matching category. + enum: + - coding + - intelligence + - agentic + example: coding + type: string + x-speakeasy-unknown-values: allow + - description: 'Design Arena only: arena to query. Defaults to `models` when source is `design-arena`.' + in: query + name: arena + required: false + schema: + description: 'Design Arena only: arena to query. Defaults to `models` when source is `design-arena`.' + enum: + - models + - builders + - agents + example: models + type: string + x-speakeasy-unknown-values: allow + - description: >- + Design Arena only: category within the arena (e.g. `codecategories`, `uicomponent`, `gamedev`, `3d`, `dataviz`, `image`, `video`, `svg`). When omitted, returns all categories. + in: query + name: category + required: false + schema: + description: >- + Design Arena only: category within the arena (e.g. `codecategories`, `uicomponent`, `gamedev`, `3d`, `dataviz`, `image`, `video`, `svg`). When omitted, returns all categories. + example: codecategories + type: string + - description: Maximum number of items to return. When omitted, all matching results are returned. + in: query + name: max_results + required: false + schema: + description: Maximum number of items to return. When omitted, all matching results are returned. + example: 50 + minimum: 1 + type: integer + responses: + '200': + content: + application/json: + example: + data: + - agentic_index: 58.3 + coding_index: 65.8 + display_name: GPT-4o + intelligence_index: 71.2 + model_permaslug: openai/gpt-4o + pricing: + completion: '0.00001' + prompt: '0.0000025' + source: artificial-analysis + meta: + as_of: '2026-06-03T12:00:00Z' + citation: null + model_count: 1 + source: null + source_url: null + task_type: null + version: v1 + schema: + $ref: '#/components/schemas/UnifiedBenchmarksResponse' + description: Benchmark results filtered by the specified source and optional task type. + '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 + '429': content: application/json: example: error: - code: 409 - message: Resource conflict. Please try again later. + code: 429 + message: Rate limit exceeded schema: - $ref: '#/components/schemas/ConflictResponse' - description: Conflict - Resource conflict or concurrent modification + $ref: '#/components/schemas/TooManyRequestsResponse' + description: Too Many Requests - Rate limit exceeded '500': content: application/json: @@ -22786,10 +24091,9 @@ paths: schema: $ref: '#/components/schemas/InternalServerResponse' description: Internal Server Error - Unexpected server error - summary: Create authorization code + summary: List Benchmarks tags: - - OAuth - x-speakeasy-name-override: createAuthCode + - Benchmarks /byok: get: description: >- @@ -22907,6 +24211,7 @@ paths: - stepfun - streamlake - switchpoint + - tenstorrent - together - upstage - venice @@ -23521,6 +24826,112 @@ paths: x-speakeasy-group: chat x-speakeasy-name-override: send x-speakeasy-stream-request-field: stream + /classifications/task: + get: + description: |- + Returns the market-share breakdown of OpenRouter traffic by task classification + (e.g. code generation, web search, summarization) over a trailing time window. + + Each classification reports its share of classified sampled requests (`usage_share`) + and classified sampled token volume (`token_share`) as fractions between 0 and 1. + The unclassified `other` bucket is excluded. Absolute volumes are not exposed + because the underlying data is sampled. + + Each classification also includes a `models` array listing the top models by + request volume within that classification, with their within-tag usage and token shares. + + Classifications are grouped into macro-categories (Code, Data, Agent, General) + with aggregate shares provided for each. + + Authenticate with any valid OpenRouter API key (same key used for inference). + Rate-limited to 30 requests/minute per key and 500 requests/day per account. + + When republishing or quoting this data, cite as: + "Source: OpenRouter (openrouter.ai/rankings), as of {as_of}." + operationId: getTaskClassifications + parameters: + - description: Trailing time window for the classification data. Currently only `7d` (trailing 7 days) is supported. + in: query + name: window + required: false + schema: + default: 7d + description: Trailing time window for the classification data. Currently only `7d` (trailing 7 days) is supported. + enum: + - 7d + example: 7d + type: string + responses: + '200': + content: + application/json: + example: + data: + as_of: '2026-06-17' + classifications: + - category_token_share: 0.48 + category_usage_share: 0.51 + display_name: Code Generation + macro_category: code + models: + - id: openai/gpt-4.1-mini + tag_token_share: 0.75 + tag_usage_share: 0.55 + tag: code:general_impl + token_share: 0.31 + usage_share: 0.23 + macro_categories: + - key: code + label: Code + token_share: 0.52 + usage_share: 0.45 + window_days: 7 + schema: + $ref: '#/components/schemas/TaskClassificationResponse' + description: Task classification market-share data for the requested trailing window. + '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 + '429': + content: + application/json: + example: + error: + code: 429 + message: Rate limit exceeded + schema: + $ref: '#/components/schemas/TooManyRequestsResponse' + description: Too Many Requests - Rate limit exceeded + '500': + content: + application/json: + example: + error: + code: 500 + message: Internal Server Error + schema: + $ref: '#/components/schemas/InternalServerResponse' + description: Internal Server Error - Unexpected server error + summary: Task classification market share + tags: + - Classifications /credits: get: description: >- @@ -23769,236 +25180,20 @@ paths: rank: 1 total_requests: 4321 total_tokens: '12345678' - - app_id: 67890 - app_name: Roo Code - rank: 2 - total_requests: 2109 - total_tokens: '9876543' - meta: - as_of: '2026-05-12T02:00:00Z' - end_date: '2026-05-11' - start_date: '2026-04-12' - version: v1 - schema: - $ref: '#/components/schemas/AppRankingsResponse' - description: >- - Apps ranked per the requested `sort`, re-numbered 1..N. `popular` sorts by `total_tokens` descending; `trending` sorts by absolute excess token growth descending and may return fewer than `limit` rows. - '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 - '429': - content: - application/json: - example: - error: - code: 429 - message: Rate limit exceeded - schema: - $ref: '#/components/schemas/TooManyRequestsResponse' - description: Too Many Requests - Rate limit exceeded - '500': - content: - application/json: - example: - error: - code: 500 - message: Internal Server Error - schema: - $ref: '#/components/schemas/InternalServerResponse' - description: Internal Server Error - Unexpected server error - summary: Top apps by token usage - tags: - - Datasets - x-speakeasy-pagination: - inputs: - - in: parameters - name: offset - type: offset - - in: parameters - name: limit - type: limit - outputs: - results: $.data - type: offsetLimit - /datasets/benchmarks/artificial-analysis: - get: - description: >- - Returns composite index scores (Intelligence, Coding, Agentic) from Artificial Analysis for LLM models. Includes OpenRouter pricing per model. Authenticate with any valid OpenRouter API key. Rate-limited to 30 requests/minute per key and 500 requests/day per account. - operationId: getBenchmarksArtificialAnalysis - parameters: - - description: Max results to return (1–100, default 50). - in: query - name: max_results - required: false - schema: - default: 50 - description: Max results to return (1–100, default 50). - example: 20 - maximum: 100 - minimum: 1 - type: integer - responses: - '200': - content: - application/json: - example: - data: - - aa_name: GPT-4o - agentic_index: 58.3 - coding_index: 65.8 - intelligence_index: 71.2 - model_permaslug: openai/gpt-4o - pricing: - completion: '0.00001' - prompt: '0.0000025' - meta: - as_of: '2026-06-03T12:00:00Z' - citation: 'Source: Artificial Analysis (artificialanalysis.ai) via OpenRouter (openrouter.ai/rankings).' - model_count: 1 - source: artificial-analysis - source_url: https://artificialanalysis.ai - version: v1 - schema: - $ref: '#/components/schemas/BenchmarksAAResponse' - description: Artificial Analysis composite index scores with pricing and attribution metadata. - '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 - '429': - content: - application/json: - example: - error: - code: 429 - message: Rate limit exceeded - schema: - $ref: '#/components/schemas/TooManyRequestsResponse' - description: Too Many Requests - Rate limit exceeded - '500': - content: - application/json: - example: - error: - code: 500 - message: Internal Server Error - schema: - $ref: '#/components/schemas/InternalServerResponse' - description: Internal Server Error - Unexpected server error - summary: Artificial Analysis Benchmark Indices - tags: - - Datasets - /datasets/benchmarks/design-arena: - get: - description: >- - Returns ELO ratings from head-to-head arena battles on Design Arena. Filterable by arena (models/builders/agents) and category. Includes OpenRouter pricing per model. Authenticate with any valid OpenRouter API key. Rate-limited to 30 requests/minute per key and 500 requests/day per account. - operationId: getBenchmarksDesignArena - parameters: - - description: Arena to query. Defaults to `models`. - in: query - name: arena - required: false - schema: - default: models - description: Arena to query. Defaults to `models`. - enum: - - models - - builders - - agents - example: models - type: string - x-speakeasy-unknown-values: allow - - description: >- - Category within the arena (e.g. `codecategories`, `uicomponent`, `gamedev`, `3d`, `dataviz`, `image`, `video`, `svg`). When omitted, returns all categories. - in: query - name: category - required: false - schema: - description: >- - Category within the arena (e.g. `codecategories`, `uicomponent`, `gamedev`, `3d`, `dataviz`, `image`, `video`, `svg`). When omitted, returns all categories. - example: codecategories - type: string - - description: 'Max results to return: per category when no category filter is applied (1–100, default 50).' - in: query - name: max_results - required: false - schema: - default: 50 - description: 'Max results to return: per category when no category filter is applied (1–100, default 50).' - example: 20 - maximum: 100 - minimum: 1 - type: integer - responses: - '200': - content: - application/json: - example: - data: - - arena: models - avg_generation_time_ms: 3200 - category: codecategories - display_name: Claude Sonnet 4 - elo: 1423 - model_permaslug: anthropic/claude-sonnet-4 - pricing: - completion: '0.000015' - prompt: '0.000003' - tournament_stats: - first_place: 12 - fourth_place: 2 - second_place: 8 - third_place: 5 - total: 27 - win_rate: 72 + - app_id: 67890 + app_name: Roo Code + rank: 2 + total_requests: 2109 + total_tokens: '9876543' meta: - arena: models - as_of: '2026-06-03T12:00:00Z' - category: null - citation: 'Source: Design Arena (www.designarena.ai) via OpenRouter (openrouter.ai/rankings).' - elo_bounds: - max: 1600 - min: 900 - model_count: 1 - source: design-arena - source_url: https://www.designarena.ai + as_of: '2026-05-12T02:00:00Z' + end_date: '2026-05-11' + start_date: '2026-04-12' version: v1 schema: - $ref: '#/components/schemas/BenchmarksDAResponse' - description: Design Arena ELO rankings with pricing and attribution metadata. + $ref: '#/components/schemas/AppRankingsResponse' + description: >- + Apps ranked per the requested `sort`, re-numbered 1..N. `popular` sorts by `total_tokens` descending; `trending` sorts by absolute excess token growth descending and may return fewer than `limit` rows. '400': content: application/json: @@ -24039,9 +25234,20 @@ paths: schema: $ref: '#/components/schemas/InternalServerResponse' description: Internal Server Error - Unexpected server error - summary: Design Arena Benchmark Rankings + summary: Top apps by token usage tags: - Datasets + x-speakeasy-pagination: + inputs: + - in: parameters + name: offset + type: offset + - in: parameters + name: limit + type: limit + outputs: + results: $.data + type: offsetLimit /datasets/rankings-daily: get: description: |- @@ -24345,6 +25551,31 @@ paths: example: 0.0001 format: double type: number + cost_details: + description: Breakdown of upstream inference costs + example: + upstream_inference_completions_cost: 0.0004 + upstream_inference_cost: null + upstream_inference_prompt_cost: 0.0008 + nullable: true + properties: + upstream_inference_completions_cost: + format: double + type: number + upstream_inference_cost: + format: double + nullable: true + type: number + upstream_inference_prompt_cost: + format: double + type: number + required: + - upstream_inference_prompt_cost + - upstream_inference_completions_cost + type: object + is_byok: + description: Whether a request was made using a Bring Your Own Key configuration + type: boolean prompt_tokens: description: Number of tokens in the input example: 8 @@ -26367,55 +27598,326 @@ paths: /guardrails/assignments/members: get: description: >- - List all organization member guardrail assignments for the authenticated user. [Management key](/docs/guides/overview/auth/management-api-keys) required. - operationId: listMemberAssignments + List all organization member guardrail assignments for the authenticated user. [Management key](/docs/guides/overview/auth/management-api-keys) required. + operationId: listMemberAssignments + parameters: + - description: Number of records to skip for pagination + in: query + name: offset + required: false + schema: + description: Number of records to skip for pagination + example: 0 + minimum: 0 + nullable: true + type: integer + - description: Maximum number of records to return (max 100) + in: query + name: limit + required: false + schema: + description: Maximum number of records to return (max 100) + example: 50 + maximum: 100 + minimum: 1 + type: integer + responses: + '200': + content: + application/json: + example: + data: + - assigned_by: user_abc123 + created_at: '2025-08-24T10:30:00Z' + guardrail_id: 550e8400-e29b-41d4-a716-446655440001 + id: 550e8400-e29b-41d4-a716-446655440000 + organization_id: org_xyz789 + user_id: user_abc123 + total_count: 1 + schema: + $ref: '#/components/schemas/ListMemberAssignmentsResponse' + description: List of member assignments + '401': + content: + application/json: + example: + error: + code: 401 + message: Missing Authentication header + schema: + $ref: '#/components/schemas/UnauthorizedResponse' + description: Unauthorized - Authentication required or invalid credentials + '500': + content: + application/json: + example: + error: + code: 500 + message: Internal Server Error + schema: + $ref: '#/components/schemas/InternalServerResponse' + description: Internal Server Error - Unexpected server error + summary: List all member assignments + tags: + - Guardrails + x-speakeasy-name-override: listMemberAssignments + x-speakeasy-pagination: + inputs: + - in: parameters + name: offset + type: offset + - in: parameters + name: limit + type: limit + outputs: + results: $.data + type: offsetLimit + /images: + post: + description: Generates an image from a text prompt via the image generation router + operationId: createImages + requestBody: + content: + application/json: + example: + model: bytedance-seed/seedream-4.5 + prompt: a red panda astronaut floating in space, studio lighting + schema: + $ref: '#/components/schemas/ImageGenerationRequest' + required: true + responses: + '200': + content: + application/json: + example: + created: 1748372400 + data: + - b64_json: + usage: + completion_tokens: 4175 + cost: 0.04 + prompt_tokens: 0 + total_tokens: 4175 + schema: + $ref: '#/components/schemas/ImageGenerationResponse' + text/event-stream: + example: + data: + b64_json: + partial_image_index: 0 + type: image_generation.partial_image + schema: + $ref: '#/components/schemas/ImageStreamingResponse' + x-speakeasy-sse-sentinel: '[DONE]' + description: Image generation response + '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 + '402': + content: + application/json: + example: + error: + code: 402 + message: Insufficient credits. Add more using https://openrouter.ai/credits + schema: + $ref: '#/components/schemas/PaymentRequiredResponse' + description: Payment Required - Insufficient credits or quota to complete request + '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 + '429': + content: + application/json: + example: + error: + code: 429 + message: Rate limit exceeded + schema: + $ref: '#/components/schemas/TooManyRequestsResponse' + description: Too Many Requests - Rate limit exceeded + '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 + '524': + content: + application/json: + example: + error: + code: 524 + message: Request timed out. Please try again later. + schema: + $ref: '#/components/schemas/EdgeNetworkTimeoutResponse' + description: Infrastructure Timeout - Provider request timed out at edge network + '529': + content: + application/json: + example: + error: + code: 529 + message: Provider returned error + schema: + $ref: '#/components/schemas/ProviderOverloadedResponse' + description: Provider Overloaded - Provider is temporarily overloaded + summary: Generate an image + tags: + - Images + x-speakeasy-name-override: generate + /images/models: + get: + description: >- + Lists every image generation model with its top-level supported-parameter superset and a URL to its full per-endpoint records. + operationId: listImageModels + responses: + '200': + content: + application/json: + example: + data: + - architecture: + input_modalities: + - text + output_modalities: + - image + created: 1692901234 + description: A text-to-image model. + endpoints: /api/v1/images/models/bytedance-seed/seedream-4.5/endpoints + id: bytedance-seed/seedream-4.5 + name: Seedream 4.5 + supported_parameters: + resolution: + type: enum + values: + - 1K + - 2K + - 4K + supports_streaming: false + schema: + $ref: '#/components/schemas/ImageModelsListResponse' + description: List of image generation models + '500': + content: + application/json: + example: + error: + code: 500 + message: Internal Server Error + schema: + $ref: '#/components/schemas/InternalServerResponse' + description: Internal Server Error - Unexpected server error + summary: List image generation models + tags: + - Images + x-speakeasy-name-override: listModels + /images/models/{author}/{slug}/endpoints: + get: + description: >- + Returns the full per-endpoint records for an image model: each endpoint's definitive supported parameters, pricing, and passthrough allowlist. + operationId: listImageModelEndpoints parameters: - - description: Number of records to skip for pagination - in: query - name: offset - required: false + - description: Model author/organization + in: path + name: author + required: true schema: - description: Number of records to skip for pagination - example: 0 - minimum: 0 - nullable: true - type: integer - - description: Maximum number of records to return (max 100) - in: query - name: limit - required: false + description: Model author/organization + example: bytedance-seed + type: string + - description: Model slug + in: path + name: slug + required: true schema: - description: Maximum number of records to return (max 100) - example: 50 - maximum: 100 - minimum: 1 - type: integer + description: Model slug + example: seedream-4.5 + type: string responses: '200': content: application/json: example: - data: - - assigned_by: user_abc123 - created_at: '2025-08-24T10:30:00Z' - guardrail_id: 550e8400-e29b-41d4-a716-446655440001 - id: 550e8400-e29b-41d4-a716-446655440000 - organization_id: org_xyz789 - user_id: user_abc123 - total_count: 1 - schema: - $ref: '#/components/schemas/ListMemberAssignmentsResponse' - description: List of member assignments - '401': + endpoints: + - allowed_passthrough_parameters: [] + pricing: + - billable: output_image + cost_usd: 0.05 + unit: image + provider_name: Bytedance + provider_slug: bytedance + provider_tag: bytedance + supported_parameters: + resolution: + type: enum + values: + - 1K + - 2K + - 4K + supports_streaming: false + id: bytedance-seed/seedream-4.5 + schema: + $ref: '#/components/schemas/ImageModelEndpointsResponse' + description: The full per-endpoint records for an image model + '404': content: application/json: example: error: - code: 401 - message: Missing Authentication header + code: 404 + message: Resource not found schema: - $ref: '#/components/schemas/UnauthorizedResponse' - description: Unauthorized - Authentication required or invalid credentials + $ref: '#/components/schemas/NotFoundResponse' + description: Not Found - Resource does not exist '500': content: application/json: @@ -26426,21 +27928,10 @@ paths: schema: $ref: '#/components/schemas/InternalServerResponse' description: Internal Server Error - Unexpected server error - summary: List all member assignments + summary: List endpoints for an image model tags: - - Guardrails - x-speakeasy-name-override: listMemberAssignments - x-speakeasy-pagination: - inputs: - - in: parameters - name: offset - type: offset - - in: parameters - name: limit - type: limit - outputs: - results: $.data - type: offsetLimit + - Images + x-speakeasy-name-override: listModelEndpoints /key: get: description: Get information on the API key associated with the current authentication session @@ -28417,7 +29908,7 @@ paths: id: openai/gpt-4 knowledge_cutoff: null links: - details: /api/v1/models/openai/gpt-5.4/endpoints + details: /api/v1/models/openai/gpt-4/endpoints name: GPT-4 per_request_limits: null pricing: @@ -31851,6 +33342,223 @@ paths: tags: - Workspaces x-speakeasy-name-override: update + /workspaces/{id}/budgets: + get: + description: >- + List all budgets configured for a workspace. [Management key](/docs/guides/overview/auth/management-api-keys) required. + operationId: listWorkspaceBudgets + parameters: + - description: The workspace ID (UUID) or slug + in: path + name: id + required: true + schema: + description: The workspace ID (UUID) or slug + example: production + minLength: 1 + type: string + responses: + '200': + content: + application/json: + example: + data: + - created_at: '2025-08-24T10:30:00Z' + id: 770e8400-e29b-41d4-a716-446655440000 + limit_usd: 100 + reset_interval: monthly + updated_at: '2025-08-24T15:45:00Z' + workspace_id: 550e8400-e29b-41d4-a716-446655440000 + schema: + $ref: '#/components/schemas/ListWorkspaceBudgetsResponse' + description: Budgets retrieved successfully + '401': + content: + application/json: + example: + error: + code: 401 + message: Missing Authentication header + schema: + $ref: '#/components/schemas/UnauthorizedResponse' + description: Unauthorized - Authentication required or invalid credentials + '404': + content: + application/json: + example: + error: + code: 404 + message: Resource not found + schema: + $ref: '#/components/schemas/NotFoundResponse' + description: Not Found - Resource does not exist + '500': + content: + application/json: + example: + error: + code: 500 + message: Internal Server Error + schema: + $ref: '#/components/schemas/InternalServerResponse' + description: Internal Server Error - Unexpected server error + summary: List workspace budgets + tags: + - Workspaces + x-speakeasy-name-override: listBudgets + /workspaces/{id}/budgets/{interval}: + delete: + description: >- + Remove the budget for a given interval. [Management key](/docs/guides/overview/auth/management-api-keys) required. + operationId: deleteWorkspaceBudget + parameters: + - description: The workspace ID (UUID) or slug + in: path + name: id + required: true + schema: + description: The workspace ID (UUID) or slug + example: production + minLength: 1 + type: string + - description: Budget reset interval. Use "lifetime" for a one-time budget that never resets. + example: monthly + in: path + name: interval + required: true + schema: + $ref: '#/components/schemas/WorkspaceBudgetInterval' + responses: + '200': + content: + application/json: + example: + deleted: true + schema: + $ref: '#/components/schemas/DeleteWorkspaceBudgetResponse' + description: Budget deleted successfully + '401': + content: + application/json: + example: + error: + code: 401 + message: Missing Authentication header + schema: + $ref: '#/components/schemas/UnauthorizedResponse' + description: Unauthorized - Authentication required or invalid credentials + '404': + content: + application/json: + example: + error: + code: 404 + message: Resource not found + schema: + $ref: '#/components/schemas/NotFoundResponse' + description: Not Found - Resource does not exist + '500': + content: + application/json: + example: + error: + code: 500 + message: Internal Server Error + schema: + $ref: '#/components/schemas/InternalServerResponse' + description: Internal Server Error - Unexpected server error + summary: Delete a workspace budget + tags: + - Workspaces + x-speakeasy-name-override: deleteBudget + put: + description: >- + Create or update the budget for a given interval. Budget limits must strictly decrease as the interval narrows (lifetime > monthly > weekly > daily). [Management key](/docs/guides/overview/auth/management-api-keys) required. + operationId: upsertWorkspaceBudget + parameters: + - description: The workspace ID (UUID) or slug + in: path + name: id + required: true + schema: + description: The workspace ID (UUID) or slug + example: production + minLength: 1 + type: string + - description: Budget reset interval. Use "lifetime" for a one-time budget that never resets. + example: monthly + in: path + name: interval + required: true + schema: + $ref: '#/components/schemas/WorkspaceBudgetInterval' + requestBody: + content: + application/json: + example: + limit_usd: 100 + schema: + $ref: '#/components/schemas/UpsertWorkspaceBudgetRequest' + required: true + responses: + '200': + content: + application/json: + example: + data: + created_at: '2025-08-24T10:30:00Z' + id: 770e8400-e29b-41d4-a716-446655440000 + limit_usd: 100 + reset_interval: monthly + updated_at: '2025-08-24T15:45:00Z' + workspace_id: 550e8400-e29b-41d4-a716-446655440000 + schema: + $ref: '#/components/schemas/UpsertWorkspaceBudgetResponse' + description: Budget created or updated successfully + '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 + '404': + content: + application/json: + example: + error: + code: 404 + message: Resource not found + schema: + $ref: '#/components/schemas/NotFoundResponse' + description: Not Found - Resource does not exist + '500': + content: + application/json: + example: + error: + code: 500 + message: Internal Server Error + schema: + $ref: '#/components/schemas/InternalServerResponse' + description: Internal Server Error - Unexpected server error + summary: Create or update a workspace budget + tags: + - Workspaces + x-speakeasy-name-override: setBudget /workspaces/{id}/members/add: post: description: >- @@ -32048,8 +33756,12 @@ tags: name: Anthropic Messages - description: BYOK endpoints name: BYOK + - description: Benchmarks endpoints + name: Benchmarks - description: Chat completion endpoints name: Chat + - description: Task classification market-share endpoints + name: Classifications - description: Credit management endpoints name: Credits - description: Datasets endpoints @@ -32064,6 +33776,8 @@ tags: name: Generations - description: Guardrails endpoints name: Guardrails + - description: Images endpoints + name: Images - description: Model information endpoints name: Models - description: OAuth authentication endpoints diff --git a/.speakeasy/workflow.lock b/.speakeasy/workflow.lock index 4a071506..69de522a 100644 --- a/.speakeasy/workflow.lock +++ b/.speakeasy/workflow.lock @@ -1,9 +1,9 @@ -speakeasyVersion: 1.778.0 +speakeasyVersion: 1.761.1 sources: OpenRouter API: sourceNamespace: open-router-chat-completions-api - sourceRevisionDigest: sha256:f86ec5826e5979caeb7d63b95605c7f3d04a89ba87865fd1e842b97cc1b050f7 - sourceBlobDigest: sha256:9d3070733f3d96784a38b93bbd2efd93f091738828ef3f9c306caf987a39b9ba + sourceRevisionDigest: sha256:866006f761e6bf56234d42050cbc3da0b17d32263edfb130511aa44029e03f39 + sourceBlobDigest: sha256:1c32cbca74732421ef43c83796ea2b1509d6b58484fb51e2c6a3a7fe1013cd6f tags: - latest - 1.0.0 @@ -11,10 +11,10 @@ targets: openrouter: source: OpenRouter API sourceNamespace: open-router-chat-completions-api - sourceRevisionDigest: sha256:f86ec5826e5979caeb7d63b95605c7f3d04a89ba87865fd1e842b97cc1b050f7 - sourceBlobDigest: sha256:9d3070733f3d96784a38b93bbd2efd93f091738828ef3f9c306caf987a39b9ba + sourceRevisionDigest: sha256:866006f761e6bf56234d42050cbc3da0b17d32263edfb130511aa44029e03f39 + sourceBlobDigest: sha256:1c32cbca74732421ef43c83796ea2b1509d6b58484fb51e2c6a3a7fe1013cd6f codeSamplesNamespace: open-router-chat-completions-api-go-code-samples - codeSamplesRevisionDigest: sha256:ee3cbebfde57eae967da0aed27919ff5dea440d30c0638f1c608f1491550dc19 + codeSamplesRevisionDigest: sha256:e3ac0404628fb81db36acfb578df0dee0b4fad63c2ee3e834775b43e0dd37798 workflow: workflowVersion: 1.0.0 speakeasyVersion: 1.761.1 diff --git a/README.md b/README.md index 73e23b1e..93f6a0c3 100644 --- a/README.md +++ b/README.md @@ -38,18 +38,6 @@ See [examples/README.md](examples/README.md) for runnable examples, starting wit ## Table of Contents * [OpenRouter Go SDK](#openrouter-go-sdk) - * [Overview](#overview) - * [SDK Installation](#sdk-installation) - * [Requirements](#requirements) - * [SDK Example Usage](#sdk-example-usage) - * [Authentication](#authentication) - * [Available Resources and Operations](#available-resources-and-operations) - * [Server-sent event streaming](#server-sent-event-streaming) - * [Pagination](#pagination) - * [Retries](#retries) - * [Error Handling](#error-handling) - * [Server Selection](#server-selection) - * [Custom HTTP Client](#custom-http-client) * [Development](#development) * [Maturity](#maturity) * [Contributions](#contributions) @@ -59,17 +47,10 @@ See [examples/README.md](examples/README.md) for runnable examples, starting wit ## SDK Installation -Add the SDK to your module: - +To add the SDK as a dependency to your project: ```bash go get github.com/OpenRouterTeam/go-sdk ``` - -For beta releases, pin an explicit version: - -```bash -go get github.com/OpenRouterTeam/go-sdk@v0.5.0 -``` @@ -88,12 +69,9 @@ package main import ( "context" + openrouter "github.com/OpenRouterTeam/go-sdk" "log" "os" - - openrouter "github.com/OpenRouterTeam/go-sdk" - "github.com/OpenRouterTeam/go-sdk/models/components" - "github.com/OpenRouterTeam/go-sdk/optionalnullable" ) func main() { @@ -103,25 +81,12 @@ func main() { openrouter.WithSecurity(os.Getenv("OPENROUTER_API_KEY")), ) - res, err := s.Chat.Send(ctx, components.ChatRequest{ - Model: openrouter.Pointer("openai/gpt-4o"), - Messages: []components.ChatMessages{ - components.CreateChatMessagesUser( - components.ChatUserMessage{ - Role: components.ChatUserMessageRoleUser, - Content: components.CreateChatUserMessageContentStr( - "Hello, how are you?", - ), - }, - ), - }, - Temperature: optionalnullable.From(openrouter.Pointer(0.7)), - }, nil) + res, err := s.Analytics.GetUserActivity(ctx, nil, nil, nil) if err != nil { log.Fatal(err) } - if res != nil && res.ChatResult != nil { - log.Println(res.ChatResult.Choices) + if res != nil { + // handle response } } @@ -220,6 +185,10 @@ func main() { * [Get](docs/sdks/apikeys/README.md#get) - Get a single API key * [Update](docs/sdks/apikeys/README.md#update) - Update an API key +### [Benchmarks](docs/sdks/benchmarks/README.md) + +* [GetBenchmarks](docs/sdks/benchmarks/README.md#getbenchmarks) - List Benchmarks + ### [Beta.Analytics](docs/sdks/betaanalytics/README.md) * [GetAnalyticsMeta](docs/sdks/betaanalytics/README.md#getanalyticsmeta) - Get available analytics metrics and dimensions @@ -241,6 +210,10 @@ func main() { * [Send](docs/sdks/chat/README.md#send) - Create a chat completion +### [Classifications](docs/sdks/classifications/README.md) + +* [GetTaskClassifications](docs/sdks/classifications/README.md#gettaskclassifications) - Task classification market share + ### [Credits](docs/sdks/credits/README.md) * [GetCredits](docs/sdks/credits/README.md#getcredits) - Get remaining credits @@ -248,8 +221,6 @@ func main() { ### [Datasets](docs/sdks/datasets/README.md) * [GetAppRankings](docs/sdks/datasets/README.md#getapprankings) - Top apps by token usage -* [GetBenchmarksArtificialAnalysis](docs/sdks/datasets/README.md#getbenchmarksartificialanalysis) - Artificial Analysis Benchmark Indices -* [GetBenchmarksDesignArena](docs/sdks/datasets/README.md#getbenchmarksdesignarena) - Design Arena Benchmark Rankings * [GetRankingsDaily](docs/sdks/datasets/README.md#getrankingsdaily) - Daily token totals for top 50 models ### [Embeddings](docs/sdks/embeddings/README.md) @@ -291,6 +262,12 @@ func main() { * [ListKeyAssignments](docs/sdks/guardrails/README.md#listkeyassignments) - List all key assignments * [ListMemberAssignments](docs/sdks/guardrails/README.md#listmemberassignments) - List all member assignments +### [Images](docs/sdks/images/README.md) + +* [Generate](docs/sdks/images/README.md#generate) - Generate an image +* [ListModels](docs/sdks/images/README.md#listmodels) - List image generation models +* [ListModelEndpoints](docs/sdks/images/README.md#listmodelendpoints) - List endpoints for an image model + ### [Models](docs/sdks/models/README.md) * [Get](docs/sdks/models/README.md#get) - Get a model by its slug @@ -355,6 +332,9 @@ func main() { * [Delete](docs/sdks/workspaces/README.md#delete) - Delete a workspace * [Get](docs/sdks/workspaces/README.md#get) - Get a workspace * [Update](docs/sdks/workspaces/README.md#update) - Update a workspace +* [ListBudgets](docs/sdks/workspaces/README.md#listbudgets) - List workspace budgets +* [DeleteBudget](docs/sdks/workspaces/README.md#deletebudget) - Delete a workspace budget +* [SetBudget](docs/sdks/workspaces/README.md#setbudget) - Create or update a workspace budget * [BulkAddMembers](docs/sdks/workspaces/README.md#bulkaddmembers) - Bulk add members to a workspace * [BulkRemoveMembers](docs/sdks/workspaces/README.md#bulkremovemembers) - Bulk remove members from a workspace @@ -370,8 +350,6 @@ can be consumed using a simple `for` loop. The loop will terminate when the server no longer has any events to send and closes the underlying connection. -For chat completions, check `res.EventStream` after setting `Stream: openrouter.Pointer(true)` on `components.ChatRequest`. See [examples/chat-stream](examples/chat-stream) for a runnable example. - ```go package main @@ -477,9 +455,9 @@ package main import ( "context" openrouter "github.com/OpenRouterTeam/go-sdk" - "github.com/OpenRouterTeam/go-sdk/models/operations" "github.com/OpenRouterTeam/go-sdk/retry" "log" + "models/operations" "os" ) diff --git a/RELEASES.md b/RELEASES.md index d6ee140e..c32a4f1d 100644 --- a/RELEASES.md +++ b/RELEASES.md @@ -48,4 +48,14 @@ Based on: ### Generated - [go v0.5.0] . ### Releases -- [Go v0.5.0] https://github.com/OpenRouterTeam/go-sdk/releases/tag/v0.5.0 - . \ No newline at end of file +- [Go v0.5.0] https://github.com/OpenRouterTeam/go-sdk/releases/tag/v0.5.0 - . + +## 2026-06-24 00:38:19 +### Changes +Based on: +- OpenAPI Doc +- Speakeasy CLI 1.761.1 (2.879.6) https://github.com/speakeasy-api/speakeasy +### Generated +- [go v0.5.1] . +### Releases +- [Go v0.5.1] https://github.com/OpenRouterTeam/go-sdk/releases/tag/v0.5.1 - . \ No newline at end of file diff --git a/USAGE.md b/USAGE.md index 3843a958..b5feedda 100644 --- a/USAGE.md +++ b/USAGE.md @@ -4,12 +4,9 @@ package main import ( "context" + openrouter "github.com/OpenRouterTeam/go-sdk" "log" "os" - - openrouter "github.com/OpenRouterTeam/go-sdk" - "github.com/OpenRouterTeam/go-sdk/models/components" - "github.com/OpenRouterTeam/go-sdk/optionalnullable" ) func main() { @@ -19,25 +16,12 @@ func main() { openrouter.WithSecurity(os.Getenv("OPENROUTER_API_KEY")), ) - res, err := s.Chat.Send(ctx, components.ChatRequest{ - Model: openrouter.Pointer("openai/gpt-4o"), - Messages: []components.ChatMessages{ - components.CreateChatMessagesUser( - components.ChatUserMessage{ - Role: components.ChatUserMessageRoleUser, - Content: components.CreateChatUserMessageContentStr( - "Hello, how are you?", - ), - }, - ), - }, - Temperature: optionalnullable.From(openrouter.Pointer(0.7)), - }, nil) + res, err := s.Analytics.GetUserActivity(ctx, nil, nil, nil) if err != nil { log.Fatal(err) } - if res != nil && res.ChatResult != nil { - log.Println(res.ChatResult.Choices) + if res != nil { + // handle response } } diff --git a/analytics.go b/analytics.go index 57da7c77..7f93a20a 100644 --- a/analytics.go +++ b/analytics.go @@ -186,7 +186,7 @@ func (s *Analytics) GetUserActivity(ctx context.Context, date *string, apiKeyHas _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) return nil, err - } else if utils.MatchStatusCodes([]string{"4XX", "5XX"}, httpRes.StatusCode) { + } else if utils.MatchStatusCodes([]string{"400", "401", "403", "404", "4XX", "500", "5XX"}, httpRes.StatusCode) { _httpRes, err := s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) if err != nil { return nil, err diff --git a/apikeys.go b/apikeys.go index 8195bc8c..b8731fd1 100644 --- a/apikeys.go +++ b/apikeys.go @@ -176,7 +176,7 @@ func (s *APIKeys) GetCurrentKeyMetadata(ctx context.Context, opts ...operations. _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) return nil, err - } else if utils.MatchStatusCodes([]string{"4XX", "5XX"}, httpRes.StatusCode) { + } else if utils.MatchStatusCodes([]string{"401", "4XX", "500", "5XX"}, httpRes.StatusCode) { _httpRes, err := s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) if err != nil { return nil, err @@ -433,7 +433,7 @@ func (s *APIKeys) List(ctx context.Context, includeDisabled *bool, offset option _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) return nil, err - } else if utils.MatchStatusCodes([]string{"4XX", "5XX"}, httpRes.StatusCode) { + } else if utils.MatchStatusCodes([]string{"401", "429", "4XX", "500", "5XX"}, httpRes.StatusCode) { _httpRes, err := s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) if err != nil { return nil, err @@ -708,7 +708,7 @@ func (s *APIKeys) Create(ctx context.Context, request operations.CreateKeysReque _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) return nil, err - } else if utils.MatchStatusCodes([]string{"4XX", "5XX"}, httpRes.StatusCode) { + } else if utils.MatchStatusCodes([]string{"400", "401", "403", "429", "4XX", "500", "5XX"}, httpRes.StatusCode) { _httpRes, err := s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) if err != nil { return nil, err @@ -1022,7 +1022,7 @@ func (s *APIKeys) Delete(ctx context.Context, hash string, opts ...operations.Op _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) return nil, err - } else if utils.MatchStatusCodes([]string{"4XX", "5XX"}, httpRes.StatusCode) { + } else if utils.MatchStatusCodes([]string{"401", "404", "429", "4XX", "500", "5XX"}, httpRes.StatusCode) { _httpRes, err := s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) if err != nil { return nil, err @@ -1315,7 +1315,7 @@ func (s *APIKeys) Get(ctx context.Context, hash string, opts ...operations.Optio _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) return nil, err - } else if utils.MatchStatusCodes([]string{"4XX", "5XX"}, httpRes.StatusCode) { + } else if utils.MatchStatusCodes([]string{"401", "404", "429", "4XX", "500", "5XX"}, httpRes.StatusCode) { _httpRes, err := s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) if err != nil { return nil, err @@ -1616,7 +1616,7 @@ func (s *APIKeys) Update(ctx context.Context, hash string, requestBody operation _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) return nil, err - } else if utils.MatchStatusCodes([]string{"4XX", "5XX"}, httpRes.StatusCode) { + } else if utils.MatchStatusCodes([]string{"400", "401", "404", "429", "4XX", "500", "5XX"}, httpRes.StatusCode) { _httpRes, err := s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) if err != nil { return nil, err diff --git a/benchmarks.go b/benchmarks.go new file mode 100644 index 00000000..1d187ee1 --- /dev/null +++ b/benchmarks.go @@ -0,0 +1,326 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package openrouter + +import ( + "bytes" + "context" + "fmt" + "github.com/OpenRouterTeam/go-sdk/internal/config" + "github.com/OpenRouterTeam/go-sdk/internal/hooks" + "github.com/OpenRouterTeam/go-sdk/internal/utils" + "github.com/OpenRouterTeam/go-sdk/models/components" + "github.com/OpenRouterTeam/go-sdk/models/operations" + "github.com/OpenRouterTeam/go-sdk/models/sdkerrors" + "github.com/OpenRouterTeam/go-sdk/retry" + "net/http" + "net/url" +) + +// Benchmarks endpoints +type Benchmarks struct { + rootSDK *OpenRouter + sdkConfiguration config.SDKConfiguration + hooks *hooks.Hooks +} + +func newBenchmarks(rootSDK *OpenRouter, sdkConfig config.SDKConfiguration, hooks *hooks.Hooks) *Benchmarks { + return &Benchmarks{ + rootSDK: rootSDK, + sdkConfiguration: sdkConfig, + hooks: hooks, + } +} + +// GetBenchmarks - List Benchmarks +// Unified benchmark endpoint that aggregates scores from multiple benchmark sources (Artificial Analysis, Design Arena). Filter by source to reproduce the exact shapes from the legacy per-source endpoints, or use task_type to find models suited for specific workloads. Authenticate with any valid OpenRouter API key. Rate-limited to 30 requests/minute per key and 500 requests/day per account. +func (s *Benchmarks) GetBenchmarks(ctx context.Context, request *operations.GetBenchmarksRequest, opts ...operations.Option) (*components.UnifiedBenchmarksResponse, error) { + 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 := url.JoinPath(baseURL, "/benchmarks") + 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: "getBenchmarks", + OAuth2Scopes: nil, + SecuritySource: s.sdkConfiguration.Security, + } + + 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, "GET", opURL, nil) + 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 err := utils.PopulateQueryParams(ctx, req, request, nil, nil); err != nil { + return nil, fmt.Errorf("error populating query params: %w", err) + } + + 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{"400", "401", "429", "4XX", "500", "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.UnifiedBenchmarksResponse + 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 == 429: + 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.TooManyRequestsResponseError + 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 >= 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 + +} diff --git a/betaanalytics.go b/betaanalytics.go index c48c63a6..4129c627 100644 --- a/betaanalytics.go +++ b/betaanalytics.go @@ -175,7 +175,7 @@ func (s *BetaAnalytics) GetAnalyticsMeta(ctx context.Context, opts ...operations _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) return nil, err - } else if utils.MatchStatusCodes([]string{"4XX", "5XX"}, httpRes.StatusCode) { + } else if utils.MatchStatusCodes([]string{"401", "403", "4XX", "500", "5XX"}, httpRes.StatusCode) { _httpRes, err := s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) if err != nil { return nil, err @@ -450,7 +450,7 @@ func (s *BetaAnalytics) QueryAnalytics(ctx context.Context, request operations.Q _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) return nil, err - } else if utils.MatchStatusCodes([]string{"4XX", "5XX"}, httpRes.StatusCode) { + } else if utils.MatchStatusCodes([]string{"400", "401", "403", "408", "4XX", "500", "5XX"}, httpRes.StatusCode) { _httpRes, err := s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) if err != nil { return nil, err diff --git a/byok.go b/byok.go index 9870c83f..dafdcbfc 100644 --- a/byok.go +++ b/byok.go @@ -189,7 +189,7 @@ func (s *Byok) List(ctx context.Context, offset optionalnullable.OptionalNullabl _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) return nil, err - } else if utils.MatchStatusCodes([]string{"4XX", "5XX"}, httpRes.StatusCode) { + } else if utils.MatchStatusCodes([]string{"401", "4XX", "500", "5XX"}, httpRes.StatusCode) { _httpRes, err := s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) if err != nil { return nil, err @@ -493,7 +493,7 @@ func (s *Byok) Create(ctx context.Context, request components.CreateBYOKKeyReque _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) return nil, err - } else if utils.MatchStatusCodes([]string{"4XX", "5XX"}, httpRes.StatusCode) { + } else if utils.MatchStatusCodes([]string{"400", "401", "403", "4XX", "500", "5XX"}, httpRes.StatusCode) { _httpRes, err := s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) if err != nil { return nil, err @@ -786,7 +786,7 @@ func (s *Byok) Delete(ctx context.Context, id string, opts ...operations.Option) _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) return nil, err - } else if utils.MatchStatusCodes([]string{"4XX", "5XX"}, httpRes.StatusCode) { + } else if utils.MatchStatusCodes([]string{"401", "404", "4XX", "500", "5XX"}, httpRes.StatusCode) { _httpRes, err := s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) if err != nil { return nil, err @@ -1058,7 +1058,7 @@ func (s *Byok) Get(ctx context.Context, id string, opts ...operations.Option) (* _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) return nil, err - } else if utils.MatchStatusCodes([]string{"4XX", "5XX"}, httpRes.StatusCode) { + } else if utils.MatchStatusCodes([]string{"401", "404", "4XX", "500", "5XX"}, httpRes.StatusCode) { _httpRes, err := s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) if err != nil { return nil, err @@ -1338,7 +1338,7 @@ func (s *Byok) Update(ctx context.Context, id string, updateBYOKKeyRequest compo _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) return nil, err - } else if utils.MatchStatusCodes([]string{"4XX", "5XX"}, httpRes.StatusCode) { + } else if utils.MatchStatusCodes([]string{"400", "401", "404", "4XX", "500", "5XX"}, httpRes.StatusCode) { _httpRes, err := s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) if err != nil { return nil, err diff --git a/chat.go b/chat.go index fedc9b46..c5e984b9 100644 --- a/chat.go +++ b/chat.go @@ -196,7 +196,7 @@ func (s *Chat) Send(ctx context.Context, chatRequest components.ChatRequest, xOp _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) return nil, err - } else if utils.MatchStatusCodes([]string{"4XX", "5XX"}, httpRes.StatusCode) { + } else if utils.MatchStatusCodes([]string{"400", "401", "402", "403", "404", "408", "413", "422", "429", "4XX", "500", "502", "503", "524", "529", "5XX"}, httpRes.StatusCode) { _httpRes, err := s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) if err != nil { return nil, err diff --git a/classifications.go b/classifications.go new file mode 100644 index 00000000..3bd4e424 --- /dev/null +++ b/classifications.go @@ -0,0 +1,348 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package openrouter + +import ( + "bytes" + "context" + "fmt" + "github.com/OpenRouterTeam/go-sdk/internal/config" + "github.com/OpenRouterTeam/go-sdk/internal/hooks" + "github.com/OpenRouterTeam/go-sdk/internal/utils" + "github.com/OpenRouterTeam/go-sdk/models/components" + "github.com/OpenRouterTeam/go-sdk/models/operations" + "github.com/OpenRouterTeam/go-sdk/models/sdkerrors" + "github.com/OpenRouterTeam/go-sdk/retry" + "net/http" + "net/url" +) + +// Classifications - Task classification market-share endpoints +type Classifications struct { + rootSDK *OpenRouter + sdkConfiguration config.SDKConfiguration + hooks *hooks.Hooks +} + +func newClassifications(rootSDK *OpenRouter, sdkConfig config.SDKConfiguration, hooks *hooks.Hooks) *Classifications { + return &Classifications{ + rootSDK: rootSDK, + sdkConfiguration: sdkConfig, + hooks: hooks, + } +} + +// GetTaskClassifications - Task classification market share +// Returns the market-share breakdown of OpenRouter traffic by task classification +// (e.g. code generation, web search, summarization) over a trailing time window. +// +// Each classification reports its share of classified sampled requests (`usage_share`) +// and classified sampled token volume (`token_share`) as fractions between 0 and 1. +// The unclassified `other` bucket is excluded. Absolute volumes are not exposed +// because the underlying data is sampled. +// +// Each classification also includes a `models` array listing the top models by +// request volume within that classification, with their within-tag usage and token shares. +// +// Classifications are grouped into macro-categories (Code, Data, Agent, General) +// with aggregate shares provided for each. +// +// Authenticate with any valid OpenRouter API key (same key used for inference). +// Rate-limited to 30 requests/minute per key and 500 requests/day per account. +// +// When republishing or quoting this data, cite as: +// "Source: OpenRouter (openrouter.ai/rankings), as of {as_of}." +func (s *Classifications) GetTaskClassifications(ctx context.Context, window *operations.Window, opts ...operations.Option) (*components.TaskClassificationResponse, error) { + request := operations.GetTaskClassificationsRequest{ + Window: window, + } + + 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 := url.JoinPath(baseURL, "/classifications/task") + 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: "getTaskClassifications", + OAuth2Scopes: nil, + SecuritySource: s.sdkConfiguration.Security, + } + + 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, "GET", opURL, nil) + 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 err := utils.PopulateQueryParams(ctx, req, request, nil, nil); err != nil { + return nil, fmt.Errorf("error populating query params: %w", err) + } + + 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{"400", "401", "429", "4XX", "500", "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.TaskClassificationResponse + 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 == 429: + 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.TooManyRequestsResponseError + 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 >= 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 + +} diff --git a/credits.go b/credits.go index cf99d6c5..7d475479 100644 --- a/credits.go +++ b/credits.go @@ -175,7 +175,7 @@ func (s *Credits) GetCredits(ctx context.Context, opts ...operations.Option) (*o _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) return nil, err - } else if utils.MatchStatusCodes([]string{"4XX", "5XX"}, httpRes.StatusCode) { + } else if utils.MatchStatusCodes([]string{"401", "403", "4XX", "500", "5XX"}, httpRes.StatusCode) { _httpRes, err := s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) if err != nil { return nil, err diff --git a/datasets.go b/datasets.go index bc499300..81a19352 100644 --- a/datasets.go +++ b/datasets.go @@ -204,7 +204,7 @@ func (s *Datasets) GetAppRankings(ctx context.Context, request *operations.GetAp _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) return nil, err - } else if utils.MatchStatusCodes([]string{"4XX", "5XX"}, httpRes.StatusCode) { + } else if utils.MatchStatusCodes([]string{"400", "401", "429", "4XX", "500", "5XX"}, httpRes.StatusCode) { _httpRes, err := s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) if err != nil { return nil, err @@ -397,602 +397,6 @@ func (s *Datasets) GetAppRankings(ctx context.Context, request *operations.GetAp } -// GetBenchmarksArtificialAnalysis - Artificial Analysis Benchmark Indices -// Returns composite index scores (Intelligence, Coding, Agentic) from Artificial Analysis for LLM models. Includes OpenRouter pricing per model. Authenticate with any valid OpenRouter API key. Rate-limited to 30 requests/minute per key and 500 requests/day per account. -func (s *Datasets) GetBenchmarksArtificialAnalysis(ctx context.Context, maxResults *int64, opts ...operations.Option) (*components.BenchmarksAAResponse, error) { - request := operations.GetBenchmarksArtificialAnalysisRequest{ - MaxResults: maxResults, - } - - 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 := url.JoinPath(baseURL, "/datasets/benchmarks/artificial-analysis") - 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: "getBenchmarksArtificialAnalysis", - OAuth2Scopes: nil, - SecuritySource: s.sdkConfiguration.Security, - } - - 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, "GET", opURL, nil) - 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 err := utils.PopulateQueryParams(ctx, req, request, nil, nil); err != nil { - return nil, fmt.Errorf("error populating query params: %w", err) - } - - 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.BenchmarksAAResponse - 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 == 429: - 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.TooManyRequestsResponseError - 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 >= 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 - -} - -// GetBenchmarksDesignArena - Design Arena Benchmark Rankings -// Returns ELO ratings from head-to-head arena battles on Design Arena. Filterable by arena (models/builders/agents) and category. Includes OpenRouter pricing per model. Authenticate with any valid OpenRouter API key. Rate-limited to 30 requests/minute per key and 500 requests/day per account. -func (s *Datasets) GetBenchmarksDesignArena(ctx context.Context, arena *operations.Arena, category *string, maxResults *int64, opts ...operations.Option) (*components.BenchmarksDAResponse, error) { - request := operations.GetBenchmarksDesignArenaRequest{ - Arena: arena, - Category: category, - MaxResults: maxResults, - } - - 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 := url.JoinPath(baseURL, "/datasets/benchmarks/design-arena") - 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: "getBenchmarksDesignArena", - OAuth2Scopes: nil, - SecuritySource: s.sdkConfiguration.Security, - } - - 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, "GET", opURL, nil) - 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 err := utils.PopulateQueryParams(ctx, req, request, nil, nil); err != nil { - return nil, fmt.Errorf("error populating query params: %w", err) - } - - 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.BenchmarksDAResponse - 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 == 429: - 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.TooManyRequestsResponseError - 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 >= 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 - -} - // GetRankingsDaily - Daily token totals for top 50 models // Returns the top 50 public models per day by total token usage on OpenRouter, plus a // single aggregated `other` row per day that sums every model outside that top 50. @@ -1164,7 +568,7 @@ func (s *Datasets) GetRankingsDaily(ctx context.Context, startDate *string, endD _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) return nil, err - } else if utils.MatchStatusCodes([]string{"4XX", "5XX"}, httpRes.StatusCode) { + } else if utils.MatchStatusCodes([]string{"400", "401", "429", "4XX", "500", "5XX"}, httpRes.StatusCode) { _httpRes, err := s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) if err != nil { return nil, err diff --git a/docs/models/components/advisorreasoningeffort.md b/docs/models/components/advisorreasoningeffort.md index 0cae415c..5a552288 100644 --- a/docs/models/components/advisorreasoningeffort.md +++ b/docs/models/components/advisorreasoningeffort.md @@ -9,7 +9,7 @@ import ( "github.com/OpenRouterTeam/go-sdk/models/components" ) -value := components.AdvisorReasoningEffortXhigh +value := components.AdvisorReasoningEffortMax // Open enum: custom values can be created with a direct type cast custom := components.AdvisorReasoningEffort("custom_value") @@ -20,6 +20,7 @@ custom := components.AdvisorReasoningEffort("custom_value") | Name | Value | | ------------------------------- | ------------------------------- | +| `AdvisorReasoningEffortMax` | max | | `AdvisorReasoningEffortXhigh` | xhigh | | `AdvisorReasoningEffortHigh` | high | | `AdvisorReasoningEffortMedium` | medium | diff --git a/docs/models/components/anthropicadvisormessageusageiteration.md b/docs/models/components/anthropicadvisormessageusageiteration.md new file mode 100644 index 00000000..b8878a9b --- /dev/null +++ b/docs/models/components/anthropicadvisormessageusageiteration.md @@ -0,0 +1,14 @@ +# AnthropicAdvisorMessageUsageIteration + + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------- | +| `CacheCreation` | optionalnullable.OptionalNullable[[components.AnthropicIterationCacheCreation](../../models/components/anthropiciterationcachecreation.md)] | :heavy_minus_sign: | N/A | {
"ephemeral_1h_input_tokens": 0,
"ephemeral_5m_input_tokens": 0
} | +| `CacheCreationInputTokens` | `*int64` | :heavy_minus_sign: | N/A | | +| `CacheReadInputTokens` | `*int64` | :heavy_minus_sign: | N/A | | +| `InputTokens` | `*int64` | :heavy_minus_sign: | N/A | | +| `OutputTokens` | `*int64` | :heavy_minus_sign: | N/A | | +| `Model` | `string` | :heavy_check_mark: | N/A | | +| `Type` | [components.AnthropicAdvisorMessageUsageIterationType](../../models/components/anthropicadvisormessageusageiterationtype.md) | :heavy_check_mark: | N/A | | \ No newline at end of file diff --git a/docs/models/components/anthropicadvisormessageusageiterationtype.md b/docs/models/components/anthropicadvisormessageusageiterationtype.md new file mode 100644 index 00000000..e13f14e2 --- /dev/null +++ b/docs/models/components/anthropicadvisormessageusageiterationtype.md @@ -0,0 +1,18 @@ +# AnthropicAdvisorMessageUsageIterationType + +## Example Usage + +```go +import ( + "github.com/OpenRouterTeam/go-sdk/models/components" +) + +value := components.AnthropicAdvisorMessageUsageIterationTypeAdvisorMessage +``` + + +## Values + +| Name | Value | +| --------------------------------------------------------- | --------------------------------------------------------- | +| `AnthropicAdvisorMessageUsageIterationTypeAdvisorMessage` | advisor_message | \ No newline at end of file diff --git a/docs/models/components/anthropiccompactionusageiteration.md b/docs/models/components/anthropiccompactionusageiteration.md new file mode 100644 index 00000000..1d5d9f77 --- /dev/null +++ b/docs/models/components/anthropiccompactionusageiteration.md @@ -0,0 +1,13 @@ +# AnthropicCompactionUsageIteration + + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------- | +| `CacheCreation` | optionalnullable.OptionalNullable[[components.AnthropicIterationCacheCreation](../../models/components/anthropiciterationcachecreation.md)] | :heavy_minus_sign: | N/A | {
"ephemeral_1h_input_tokens": 0,
"ephemeral_5m_input_tokens": 0
} | +| `CacheCreationInputTokens` | `*int64` | :heavy_minus_sign: | N/A | | +| `CacheReadInputTokens` | `*int64` | :heavy_minus_sign: | N/A | | +| `InputTokens` | `*int64` | :heavy_minus_sign: | N/A | | +| `OutputTokens` | `*int64` | :heavy_minus_sign: | N/A | | +| `Type` | [components.AnthropicCompactionUsageIterationType](../../models/components/anthropiccompactionusageiterationtype.md) | :heavy_check_mark: | N/A | | \ No newline at end of file diff --git a/docs/models/components/anthropiccompactionusageiterationtype.md b/docs/models/components/anthropiccompactionusageiterationtype.md new file mode 100644 index 00000000..4169954f --- /dev/null +++ b/docs/models/components/anthropiccompactionusageiterationtype.md @@ -0,0 +1,18 @@ +# AnthropicCompactionUsageIterationType + +## Example Usage + +```go +import ( + "github.com/OpenRouterTeam/go-sdk/models/components" +) + +value := components.AnthropicCompactionUsageIterationTypeCompaction +``` + + +## Values + +| Name | Value | +| ------------------------------------------------- | ------------------------------------------------- | +| `AnthropicCompactionUsageIterationTypeCompaction` | compaction | \ No newline at end of file diff --git a/docs/models/components/anthropicdocumentblockparamsourceunion.md b/docs/models/components/anthropicdocumentblockparamsourceunion.md index 2dd305a9..8b909265 100644 --- a/docs/models/components/anthropicdocumentblockparamsourceunion.md +++ b/docs/models/components/anthropicdocumentblockparamsourceunion.md @@ -27,6 +27,12 @@ anthropicDocumentBlockParamSourceUnion := components.CreateAnthropicDocumentBloc anthropicDocumentBlockParamSourceUnion := components.CreateAnthropicDocumentBlockParamSourceUnionURLObj(components.AnthropicURLPdfSource{/* values here */}) ``` +### AnthropicFileDocumentSource + +```go +anthropicDocumentBlockParamSourceUnion := components.CreateAnthropicDocumentBlockParamSourceUnionFile(components.AnthropicFileDocumentSource{/* values here */}) +``` + ## Union Discrimination Use the `Type` field to determine which variant is active, then access the corresponding field: @@ -41,5 +47,7 @@ switch anthropicDocumentBlockParamSourceUnion.Type { // anthropicDocumentBlockParamSourceUnion.SourceContent is populated case components.AnthropicDocumentBlockParamSourceUnionTypeURLObj: // anthropicDocumentBlockParamSourceUnion.AnthropicURLPdfSource is populated + case components.AnthropicDocumentBlockParamSourceUnionTypeFile: + // anthropicDocumentBlockParamSourceUnion.AnthropicFileDocumentSource is populated } ``` diff --git a/docs/models/components/anthropicfiledocumentsource.md b/docs/models/components/anthropicfiledocumentsource.md new file mode 100644 index 00000000..c26d674d --- /dev/null +++ b/docs/models/components/anthropicfiledocumentsource.md @@ -0,0 +1,9 @@ +# AnthropicFileDocumentSource + + +## Fields + +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------- | +| `FileID` | `string` | :heavy_check_mark: | N/A | +| `Type` | [components.AnthropicFileDocumentSourceType](../../models/components/anthropicfiledocumentsourcetype.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/components/anthropicfiledocumentsourcetype.md b/docs/models/components/anthropicfiledocumentsourcetype.md new file mode 100644 index 00000000..7fdc220d --- /dev/null +++ b/docs/models/components/anthropicfiledocumentsourcetype.md @@ -0,0 +1,18 @@ +# AnthropicFileDocumentSourceType + +## Example Usage + +```go +import ( + "github.com/OpenRouterTeam/go-sdk/models/components" +) + +value := components.AnthropicFileDocumentSourceTypeFile +``` + + +## Values + +| Name | Value | +| ------------------------------------- | ------------------------------------- | +| `AnthropicFileDocumentSourceTypeFile` | file | \ No newline at end of file diff --git a/docs/models/components/anthropiciterationcachecreation.md b/docs/models/components/anthropiciterationcachecreation.md new file mode 100644 index 00000000..18c00311 --- /dev/null +++ b/docs/models/components/anthropiciterationcachecreation.md @@ -0,0 +1,9 @@ +# AnthropicIterationCacheCreation + + +## Fields + +| Field | Type | Required | Description | +| ------------------------ | ------------------------ | ------------------------ | ------------------------ | +| `Ephemeral1hInputTokens` | `*int64` | :heavy_minus_sign: | N/A | +| `Ephemeral5mInputTokens` | `*int64` | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/components/anthropicmessageusageiteration.md b/docs/models/components/anthropicmessageusageiteration.md new file mode 100644 index 00000000..cad82967 --- /dev/null +++ b/docs/models/components/anthropicmessageusageiteration.md @@ -0,0 +1,14 @@ +# AnthropicMessageUsageIteration + + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------- | +| `CacheCreation` | optionalnullable.OptionalNullable[[components.AnthropicIterationCacheCreation](../../models/components/anthropiciterationcachecreation.md)] | :heavy_minus_sign: | N/A | {
"ephemeral_1h_input_tokens": 0,
"ephemeral_5m_input_tokens": 0
} | +| `CacheCreationInputTokens` | `*int64` | :heavy_minus_sign: | N/A | | +| `CacheReadInputTokens` | `*int64` | :heavy_minus_sign: | N/A | | +| `InputTokens` | `*int64` | :heavy_minus_sign: | N/A | | +| `OutputTokens` | `*int64` | :heavy_minus_sign: | N/A | | +| `Model` | `*string` | :heavy_minus_sign: | N/A | | +| `Type` | [components.AnthropicMessageUsageIterationType](../../models/components/anthropicmessageusageiterationtype.md) | :heavy_check_mark: | N/A | | \ No newline at end of file diff --git a/docs/models/components/anthropicmessageusageiterationtype.md b/docs/models/components/anthropicmessageusageiterationtype.md new file mode 100644 index 00000000..85a65a11 --- /dev/null +++ b/docs/models/components/anthropicmessageusageiterationtype.md @@ -0,0 +1,18 @@ +# AnthropicMessageUsageIterationType + +## Example Usage + +```go +import ( + "github.com/OpenRouterTeam/go-sdk/models/components" +) + +value := components.AnthropicMessageUsageIterationTypeMessage +``` + + +## Values + +| Name | Value | +| ------------------------------------------- | ------------------------------------------- | +| `AnthropicMessageUsageIterationTypeMessage` | message | \ No newline at end of file diff --git a/docs/models/components/anthropicspeed.md b/docs/models/components/anthropicspeed.md new file mode 100644 index 00000000..da8224fa --- /dev/null +++ b/docs/models/components/anthropicspeed.md @@ -0,0 +1,22 @@ +# AnthropicSpeed + +## Example Usage + +```go +import ( + "github.com/OpenRouterTeam/go-sdk/models/components" +) + +value := components.AnthropicSpeedFast + +// Open enum: custom values can be created with a direct type cast +custom := components.AnthropicSpeed("custom_value") +``` + + +## Values + +| Name | Value | +| ------------------------ | ------------------------ | +| `AnthropicSpeedFast` | fast | +| `AnthropicSpeedStandard` | standard | \ No newline at end of file diff --git a/docs/models/components/anthropicunknownusageiteration.md b/docs/models/components/anthropicunknownusageiteration.md new file mode 100644 index 00000000..eec8af3a --- /dev/null +++ b/docs/models/components/anthropicunknownusageiteration.md @@ -0,0 +1,13 @@ +# AnthropicUnknownUsageIteration + + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------- | +| `CacheCreation` | optionalnullable.OptionalNullable[[components.AnthropicIterationCacheCreation](../../models/components/anthropiciterationcachecreation.md)] | :heavy_minus_sign: | N/A | {
"ephemeral_1h_input_tokens": 0,
"ephemeral_5m_input_tokens": 0
} | +| `CacheCreationInputTokens` | `*int64` | :heavy_minus_sign: | N/A | | +| `CacheReadInputTokens` | `*int64` | :heavy_minus_sign: | N/A | | +| `InputTokens` | `*int64` | :heavy_minus_sign: | N/A | | +| `OutputTokens` | `*int64` | :heavy_minus_sign: | N/A | | +| `Type` | `string` | :heavy_check_mark: | N/A | | \ No newline at end of file diff --git a/docs/models/components/anthropicusageiteration.md b/docs/models/components/anthropicusageiteration.md new file mode 100644 index 00000000..57a296ae --- /dev/null +++ b/docs/models/components/anthropicusageiteration.md @@ -0,0 +1,45 @@ +# AnthropicUsageIteration + + +## Supported Types + +### AnthropicCompactionUsageIteration + +```go +anthropicUsageIteration := components.CreateAnthropicUsageIterationAnthropicCompactionUsageIteration(components.AnthropicCompactionUsageIteration{/* values here */}) +``` + +### AnthropicMessageUsageIteration + +```go +anthropicUsageIteration := components.CreateAnthropicUsageIterationAnthropicMessageUsageIteration(components.AnthropicMessageUsageIteration{/* values here */}) +``` + +### AnthropicAdvisorMessageUsageIteration + +```go +anthropicUsageIteration := components.CreateAnthropicUsageIterationAnthropicAdvisorMessageUsageIteration(components.AnthropicAdvisorMessageUsageIteration{/* values here */}) +``` + +### AnthropicUnknownUsageIteration + +```go +anthropicUsageIteration := components.CreateAnthropicUsageIterationAnthropicUnknownUsageIteration(components.AnthropicUnknownUsageIteration{/* values here */}) +``` + +## Union Discrimination + +Use the `Type` field to determine which variant is active, then access the corresponding field: + +```go +switch anthropicUsageIteration.Type { + case components.AnthropicUsageIterationTypeAnthropicCompactionUsageIteration: + // anthropicUsageIteration.AnthropicCompactionUsageIteration is populated + case components.AnthropicUsageIterationTypeAnthropicMessageUsageIteration: + // anthropicUsageIteration.AnthropicMessageUsageIteration is populated + case components.AnthropicUsageIterationTypeAnthropicAdvisorMessageUsageIteration: + // anthropicUsageIteration.AnthropicAdvisorMessageUsageIteration is populated + case components.AnthropicUsageIterationTypeAnthropicUnknownUsageIteration: + // anthropicUsageIteration.AnthropicUnknownUsageIteration is populated +} +``` diff --git a/docs/models/components/apierrortype.md b/docs/models/components/apierrortype.md new file mode 100644 index 00000000..e7942385 --- /dev/null +++ b/docs/models/components/apierrortype.md @@ -0,0 +1,49 @@ +# APIErrorType + +Canonical OpenRouter error type, stable across all API formats + +## Example Usage + +```go +import ( + "github.com/OpenRouterTeam/go-sdk/models/components" +) + +value := components.APIErrorTypeContextLengthExceeded + +// Open enum: custom values can be created with a direct type cast +custom := components.APIErrorType("custom_value") +``` + + +## Values + +| Name | Value | +| ------------------------------------ | ------------------------------------ | +| `APIErrorTypeContextLengthExceeded` | context_length_exceeded | +| `APIErrorTypeMaxTokensExceeded` | max_tokens_exceeded | +| `APIErrorTypeTokenLimitExceeded` | token_limit_exceeded | +| `APIErrorTypeStringTooLong` | string_too_long | +| `APIErrorTypeAuthentication` | authentication | +| `APIErrorTypePermissionDenied` | permission_denied | +| `APIErrorTypePaymentRequired` | payment_required | +| `APIErrorTypeRateLimitExceeded` | rate_limit_exceeded | +| `APIErrorTypeProviderOverloaded` | provider_overloaded | +| `APIErrorTypeProviderUnavailable` | provider_unavailable | +| `APIErrorTypeInvalidRequest` | invalid_request | +| `APIErrorTypeInvalidPrompt` | invalid_prompt | +| `APIErrorTypeNotFound` | not_found | +| `APIErrorTypePreconditionFailed` | precondition_failed | +| `APIErrorTypePayloadTooLarge` | payload_too_large | +| `APIErrorTypeUnprocessable` | unprocessable | +| `APIErrorTypeContentPolicyViolation` | content_policy_violation | +| `APIErrorTypeRefusal` | refusal | +| `APIErrorTypeInvalidImage` | invalid_image | +| `APIErrorTypeImageTooLarge` | image_too_large | +| `APIErrorTypeImageTooSmall` | image_too_small | +| `APIErrorTypeUnsupportedImageFormat` | unsupported_image_format | +| `APIErrorTypeImageNotFound` | image_not_found | +| `APIErrorTypeImageDownloadFailed` | image_download_failed | +| `APIErrorTypeServer` | server | +| `APIErrorTypeTimeout` | timeout | +| `APIErrorTypeUnmapped` | unmapped | \ No newline at end of file diff --git a/docs/models/components/aspectratio.md b/docs/models/components/aspectratio.md deleted file mode 100644 index 30c0b981..00000000 --- a/docs/models/components/aspectratio.md +++ /dev/null @@ -1,31 +0,0 @@ -# AspectRatio - -Aspect ratio of the generated video - -## Example Usage - -```go -import ( - "github.com/OpenRouterTeam/go-sdk/models/components" -) - -value := components.AspectRatioOneHundredAndSixtyNine - -// Open enum: custom values can be created with a direct type cast -custom := components.AspectRatio("custom_value") -``` - - -## Values - -| Name | Value | -| ------------------------------------ | ------------------------------------ | -| `AspectRatioOneHundredAndSixtyNine` | 16:9 | -| `AspectRatioNineHundredAndSixteen` | 9:16 | -| `AspectRatioEleven` | 1:1 | -| `AspectRatioFortyThree` | 4:3 | -| `AspectRatioThirtyFour` | 3:4 | -| `AspectRatioThirtyTwo` | 3:2 | -| `AspectRatioTwentyThree` | 2:3 | -| `AspectRatioTwoHundredAndNineteen` | 21:9 | -| `AspectRatioNineHundredAndTwentyOne` | 9:21 | \ No newline at end of file diff --git a/docs/models/components/background.md b/docs/models/components/background.md deleted file mode 100644 index 9224138a..00000000 --- a/docs/models/components/background.md +++ /dev/null @@ -1,23 +0,0 @@ -# Background - -## Example Usage - -```go -import ( - "github.com/OpenRouterTeam/go-sdk/models/components" -) - -value := components.BackgroundTransparent - -// Open enum: custom values can be created with a direct type cast -custom := components.Background("custom_value") -``` - - -## Values - -| Name | Value | -| ----------------------- | ----------------------- | -| `BackgroundTransparent` | transparent | -| `BackgroundOpaque` | opaque | -| `BackgroundAuto` | auto | \ No newline at end of file diff --git a/docs/models/components/benchmarksaaitem.md b/docs/models/components/benchmarksaaitem.md deleted file mode 100644 index cfb5382e..00000000 --- a/docs/models/components/benchmarksaaitem.md +++ /dev/null @@ -1,13 +0,0 @@ -# BenchmarksAAItem - - -## Fields - -| Field | Type | Required | Description | Example | -| ---------------------------------------------------------------------------- | ---------------------------------------------------------------------------- | ---------------------------------------------------------------------------- | ---------------------------------------------------------------------------- | ---------------------------------------------------------------------------- | -| `AaName` | `string` | :heavy_check_mark: | Model name as listed on Artificial Analysis. | GPT-4o | -| `AgenticIndex` | `*float64` | :heavy_check_mark: | Artificial Analysis Agentic Index composite score. Higher is better. | 58.3 | -| `CodingIndex` | `*float64` | :heavy_check_mark: | Artificial Analysis Coding Index composite score. Higher is better. | 65.8 | -| `IntelligenceIndex` | `*float64` | :heavy_check_mark: | Artificial Analysis Intelligence Index composite score. Higher is better. | 71.2 | -| `ModelPermaslug` | `string` | :heavy_check_mark: | Stable OpenRouter model identifier. | openai/gpt-4o | -| `Pricing` | [*components.BenchmarkPricing](../../models/components/benchmarkpricing.md) | :heavy_check_mark: | OpenRouter pricing per token for this model. Null if pricing is unavailable. | {
"completion": "0.000015",
"prompt": "0.000003"
} | \ No newline at end of file diff --git a/docs/models/components/benchmarksaameta.md b/docs/models/components/benchmarksaameta.md deleted file mode 100644 index ae084a5e..00000000 --- a/docs/models/components/benchmarksaameta.md +++ /dev/null @@ -1,13 +0,0 @@ -# BenchmarksAAMeta - - -## Fields - -| Field | Type | Required | Description | Example | -| -------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------- | -| `AsOf` | `string` | :heavy_check_mark: | ISO-8601 timestamp of when this data was last updated. | 2026-06-03T12:00:00Z | -| `Citation` | `string` | :heavy_check_mark: | Required attribution when republishing this data. | Source: Artificial Analysis (artificialanalysis.ai) via OpenRouter (openrouter.ai/rankings). | -| `ModelCount` | `int64` | :heavy_check_mark: | Number of unique models in the response. | | -| `Source` | [components.BenchmarksAAMetaSource](../../models/components/benchmarksaametasource.md) | :heavy_check_mark: | Data source identifier. | | -| `SourceURL` | [components.BenchmarksAAMetaSourceURL](../../models/components/benchmarksaametasourceurl.md) | :heavy_check_mark: | URL of the upstream data source. | | -| `Version` | [components.BenchmarksAAMetaVersion](../../models/components/benchmarksaametaversion.md) | :heavy_check_mark: | Dataset version. | | \ No newline at end of file diff --git a/docs/models/components/benchmarksaametaversion.md b/docs/models/components/benchmarksaametaversion.md deleted file mode 100644 index d4aaaa11..00000000 --- a/docs/models/components/benchmarksaametaversion.md +++ /dev/null @@ -1,20 +0,0 @@ -# BenchmarksAAMetaVersion - -Dataset version. - -## Example Usage - -```go -import ( - "github.com/OpenRouterTeam/go-sdk/models/components" -) - -value := components.BenchmarksAAMetaVersionV1 -``` - - -## Values - -| Name | Value | -| --------------------------- | --------------------------- | -| `BenchmarksAAMetaVersionV1` | v1 | \ No newline at end of file diff --git a/docs/models/components/benchmarksdaitem.md b/docs/models/components/benchmarksdaitem.md deleted file mode 100644 index 66322fb0..00000000 --- a/docs/models/components/benchmarksdaitem.md +++ /dev/null @@ -1,16 +0,0 @@ -# BenchmarksDAItem - - -## Fields - -| Field | Type | Required | Description | Example | -| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `Arena` | `string` | :heavy_check_mark: | Arena this ranking belongs to. | models | -| `AvgGenerationTimeMs` | `*float64` | :heavy_check_mark: | Average generation time in milliseconds. | 3200 | -| `Category` | `string` | :heavy_check_mark: | Category within the arena. | codecategories | -| `DisplayName` | `string` | :heavy_check_mark: | Human-readable model name from Design Arena. | Claude Sonnet 4 | -| `Elo` | `float64` | :heavy_check_mark: | ELO rating from head-to-head arena battles. | 1423 | -| `ModelPermaslug` | `string` | :heavy_check_mark: | Stable OpenRouter model identifier when the model is on OpenRouter; otherwise the upstream Design Arena model id. Use pricing != null to detect OpenRouter-mapped models. | anthropic/claude-sonnet-4 | -| `Pricing` | [*components.BenchmarkPricing](../../models/components/benchmarkpricing.md) | :heavy_check_mark: | OpenRouter pricing per token for this model. Null if pricing is unavailable. | {
"completion": "0.000015",
"prompt": "0.000003"
} | -| `TournamentStats` | [components.TournamentStats](../../models/components/tournamentstats.md) | :heavy_check_mark: | Placement distribution from tournament matches. | | -| `WinRate` | `float64` | :heavy_check_mark: | Win rate as a percentage (0–100). | 72 | \ No newline at end of file diff --git a/docs/models/components/benchmarksdameta.md b/docs/models/components/benchmarksdameta.md deleted file mode 100644 index b8ba4209..00000000 --- a/docs/models/components/benchmarksdameta.md +++ /dev/null @@ -1,16 +0,0 @@ -# BenchmarksDAMeta - - -## Fields - -| Field | Type | Required | Description | Example | -| -------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------- | -| `Arena` | `string` | :heavy_check_mark: | The arena filter applied. | | -| `AsOf` | `string` | :heavy_check_mark: | ISO-8601 timestamp of when this data was generated. | 2026-06-03T12:00:00Z | -| `Category` | `*string` | :heavy_check_mark: | The category filter applied, or null if showing all. | | -| `Citation` | `string` | :heavy_check_mark: | Required attribution when republishing this data. | Source: Design Arena (www.designarena.ai) via OpenRouter (openrouter.ai/rankings). | -| `EloBounds` | [components.EloBounds](../../models/components/elobounds.md) | :heavy_check_mark: | ELO range across all returned models for normalization. | | -| `ModelCount` | `int64` | :heavy_check_mark: | Number of unique models in the response. | | -| `Source` | [components.BenchmarksDAMetaSource](../../models/components/benchmarksdametasource.md) | :heavy_check_mark: | Data source identifier. | | -| `SourceURL` | [components.BenchmarksDAMetaSourceURL](../../models/components/benchmarksdametasourceurl.md) | :heavy_check_mark: | URL of the upstream data source. | | -| `Version` | [components.BenchmarksDAMetaVersion](../../models/components/benchmarksdametaversion.md) | :heavy_check_mark: | Dataset version. | | \ No newline at end of file diff --git a/docs/models/components/benchmarksdametasourceurl.md b/docs/models/components/benchmarksdametasourceurl.md deleted file mode 100644 index 3eae2e01..00000000 --- a/docs/models/components/benchmarksdametasourceurl.md +++ /dev/null @@ -1,20 +0,0 @@ -# BenchmarksDAMetaSourceURL - -URL of the upstream data source. - -## Example Usage - -```go -import ( - "github.com/OpenRouterTeam/go-sdk/models/components" -) - -value := components.BenchmarksDAMetaSourceURLHTTPSWwwDesignarenaAi -``` - - -## Values - -| Name | Value | -| ------------------------------------------------ | ------------------------------------------------ | -| `BenchmarksDAMetaSourceURLHTTPSWwwDesignarenaAi` | https://www.designarena.ai | \ No newline at end of file diff --git a/docs/models/components/benchmarksdametaversion.md b/docs/models/components/benchmarksdametaversion.md deleted file mode 100644 index db84f1dd..00000000 --- a/docs/models/components/benchmarksdametaversion.md +++ /dev/null @@ -1,20 +0,0 @@ -# BenchmarksDAMetaVersion - -Dataset version. - -## Example Usage - -```go -import ( - "github.com/OpenRouterTeam/go-sdk/models/components" -) - -value := components.BenchmarksDAMetaVersionV1 -``` - - -## Values - -| Name | Value | -| --------------------------- | --------------------------- | -| `BenchmarksDAMetaVersionV1` | v1 | \ No newline at end of file diff --git a/docs/models/components/billable.md b/docs/models/components/billable.md new file mode 100644 index 00000000..74559d4a --- /dev/null +++ b/docs/models/components/billable.md @@ -0,0 +1,25 @@ +# Billable + +## Example Usage + +```go +import ( + "github.com/OpenRouterTeam/go-sdk/models/components" +) + +value := components.BillableOutputImage + +// Open enum: custom values can be created with a direct type cast +custom := components.Billable("custom_value") +``` + + +## Values + +| Name | Value | +| ------------------------ | ------------------------ | +| `BillableOutputImage` | output_image | +| `BillableInputImage` | input_image | +| `BillableInputFont` | input_font | +| `BillableInputReference` | input_reference | +| `BillableInputText` | input_text | \ No newline at end of file diff --git a/docs/models/components/booleancapability.md b/docs/models/components/booleancapability.md new file mode 100644 index 00000000..5a43167f --- /dev/null +++ b/docs/models/components/booleancapability.md @@ -0,0 +1,10 @@ +# BooleanCapability + +A supported-or-not flag. Present means the parameter is accepted. + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------ | +| `Type` | [components.BooleanCapabilityType](../../models/components/booleancapabilitytype.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/components/booleancapabilitytype.md b/docs/models/components/booleancapabilitytype.md new file mode 100644 index 00000000..ed377d9a --- /dev/null +++ b/docs/models/components/booleancapabilitytype.md @@ -0,0 +1,18 @@ +# BooleanCapabilityType + +## Example Usage + +```go +import ( + "github.com/OpenRouterTeam/go-sdk/models/components" +) + +value := components.BooleanCapabilityTypeBoolean +``` + + +## Values + +| Name | Value | +| ------------------------------ | ------------------------------ | +| `BooleanCapabilityTypeBoolean` | boolean | \ No newline at end of file diff --git a/docs/models/components/byokkey.md b/docs/models/components/byokkey.md index aac5e094..77e6b19b 100644 --- a/docs/models/components/byokkey.md +++ b/docs/models/components/byokkey.md @@ -6,8 +6,8 @@ | Field | Type | Required | Description | Example | | -------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------- | | `AllowedAPIKeyHashes` | []`string` | :heavy_check_mark: | Optional allowlist of OpenRouter API key hashes (`api_keys.hash`) that may use this credential. `null` means no restriction. | [
"f01d52606dc8f0a8303a7b5cc3fa07109c2e346cec7c0a16b40de462992ce943"
] | -| `AllowedModels` | []`string` | :heavy_check_mark: | Optional allowlist of model slugs this credential may be used for. `null` means no restriction. | null | -| `AllowedUserIds` | []`string` | :heavy_check_mark: | Optional allowlist of user IDs that may use this credential. `null` means no restriction. | null | +| `AllowedModels` | []`string` | :heavy_check_mark: | Optional allowlist of model slugs this credential may be used for. `null` means no restriction. | | +| `AllowedUserIds` | []`string` | :heavy_check_mark: | Optional allowlist of user IDs that may use this credential. `null` means no restriction. | | | `CreatedAt` | `string` | :heavy_check_mark: | ISO timestamp of when the credential was created. | 2025-08-24T10:30:00Z | | `Disabled` | `bool` | :heavy_check_mark: | Whether this credential is currently disabled. | false | | `ID` | `string` | :heavy_check_mark: | Stable public identifier for this BYOK credential. | 11111111-2222-3333-4444-555555555555 | diff --git a/docs/models/components/byokproviderslug.md b/docs/models/components/byokproviderslug.md index bf7e9bd6..dc4ca432 100644 --- a/docs/models/components/byokproviderslug.md +++ b/docs/models/components/byokproviderslug.md @@ -95,6 +95,7 @@ custom := components.BYOKProviderSlug("custom_value") | `BYOKProviderSlugStepfun` | stepfun | | `BYOKProviderSlugStreamlake` | streamlake | | `BYOKProviderSlugSwitchpoint` | switchpoint | +| `BYOKProviderSlugTenstorrent` | tenstorrent | | `BYOKProviderSlugTogether` | together | | `BYOKProviderSlugUpstage` | upstage | | `BYOKProviderSlugVenice` | venice | diff --git a/docs/models/components/capabilitydescriptor.md b/docs/models/components/capabilitydescriptor.md new file mode 100644 index 00000000..a4f9a8fa --- /dev/null +++ b/docs/models/components/capabilitydescriptor.md @@ -0,0 +1,41 @@ +# CapabilityDescriptor + +A typed descriptor for one supported request parameter. + + +## Supported Types + +### EnumCapability + +```go +capabilityDescriptor := components.CreateCapabilityDescriptorEnum(components.EnumCapability{/* values here */}) +``` + +### RangeCapability + +```go +capabilityDescriptor := components.CreateCapabilityDescriptorRange(components.RangeCapability{/* values here */}) +``` + +### BooleanCapability + +```go +capabilityDescriptor := components.CreateCapabilityDescriptorBoolean(components.BooleanCapability{/* values here */}) +``` + +## Union Discrimination + +Use the `Type` field to determine which variant is active, then access the corresponding field: + +```go +switch capabilityDescriptor.Type { + case components.CapabilityDescriptorTypeEnum: + // capabilityDescriptor.EnumCapability is populated + case components.CapabilityDescriptorTypeRange: + // capabilityDescriptor.RangeCapability is populated + case components.CapabilityDescriptorTypeBoolean: + // capabilityDescriptor.BooleanCapability is populated + default: + // Unknown type - use capabilityDescriptor.GetUnknownRaw() for raw JSON +} +``` diff --git a/docs/models/components/chatrequesteffort.md b/docs/models/components/chatrequesteffort.md index 499c1234..9a978976 100644 --- a/docs/models/components/chatrequesteffort.md +++ b/docs/models/components/chatrequesteffort.md @@ -9,7 +9,7 @@ import ( "github.com/OpenRouterTeam/go-sdk/models/components" ) -value := components.ChatRequestEffortXhigh +value := components.ChatRequestEffortMax // Open enum: custom values can be created with a direct type cast custom := components.ChatRequestEffort("custom_value") @@ -20,6 +20,7 @@ custom := components.ChatRequestEffort("custom_value") | Name | Value | | -------------------------- | -------------------------- | +| `ChatRequestEffortMax` | max | | `ChatRequestEffortXhigh` | xhigh | | `ChatRequestEffortHigh` | high | | `ChatRequestEffortMedium` | medium | diff --git a/docs/models/components/chatrequestreasoningeffort.md b/docs/models/components/chatrequestreasoningeffort.md index 86722c52..3e1dad64 100644 --- a/docs/models/components/chatrequestreasoningeffort.md +++ b/docs/models/components/chatrequestreasoningeffort.md @@ -9,7 +9,7 @@ import ( "github.com/OpenRouterTeam/go-sdk/models/components" ) -value := components.ChatRequestReasoningEffortXhigh +value := components.ChatRequestReasoningEffortMax // Open enum: custom values can be created with a direct type cast custom := components.ChatRequestReasoningEffort("custom_value") @@ -20,6 +20,7 @@ custom := components.ChatRequestReasoningEffort("custom_value") | Name | Value | | ----------------------------------- | ----------------------------------- | +| `ChatRequestReasoningEffortMax` | max | | `ChatRequestReasoningEffortXhigh` | xhigh | | `ChatRequestReasoningEffortHigh` | high | | `ChatRequestReasoningEffortMedium` | medium | diff --git a/docs/models/components/chatresult.md b/docs/models/components/chatresult.md index 9a6728c7..b162ac82 100644 --- a/docs/models/components/chatresult.md +++ b/docs/models/components/chatresult.md @@ -5,14 +5,14 @@ Chat completion response ## Fields -| Field | Type | Required | Description | Example | -| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `Choices` | [][components.ChatChoice](../../models/components/chatchoice.md) | :heavy_check_mark: | List of completion choices | | -| `Created` | `int64` | :heavy_check_mark: | Unix timestamp of creation | 1677652288 | -| `ID` | `string` | :heavy_check_mark: | Unique completion identifier | chatcmpl-123 | -| `Model` | `string` | :heavy_check_mark: | Model used for completion | openai/gpt-4 | -| `Object` | [components.ChatResultObject](../../models/components/chatresultobject.md) | :heavy_check_mark: | N/A | | -| `OpenrouterMetadata` | [*components.OpenRouterMetadata](../../models/components/openroutermetadata.md) | :heavy_minus_sign: | N/A | {
"attempt": 1,
"endpoints": {
"available": [
{
"model": "openai/gpt-4o",
"provider": "OpenAI",
"selected": true
}
],
"total": 1
},
"is_byok": false,
"region": "iad",
"requested": "openai/gpt-4o",
"strategy": "direct",
"summary": "available=1, selected=OpenAI"
} | -| `ServiceTier` | optionalnullable.OptionalNullable[`string`] | :heavy_minus_sign: | The service tier used by the upstream provider for this request | default | -| `SystemFingerprint` | `*string` | :heavy_check_mark: | System fingerprint | fp_44709d6fcb | -| `Usage` | [*components.ChatUsage](../../models/components/chatusage.md) | :heavy_minus_sign: | Token usage statistics | {
"completion_tokens": 15,
"completion_tokens_details": {
"reasoning_tokens": 5
},
"cost": 0.0012,
"cost_details": {
"upstream_inference_completions_cost": 0.0004,
"upstream_inference_cost": null,
"upstream_inference_prompt_cost": 0.0008
},
"is_byok": false,
"prompt_tokens": 10,
"prompt_tokens_details": {
"cached_tokens": 2
},
"total_tokens": 25
} | \ No newline at end of file +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `Choices` | [][components.ChatChoice](../../models/components/chatchoice.md) | :heavy_check_mark: | List of completion choices | | +| `Created` | `int64` | :heavy_check_mark: | Unix timestamp of creation | 1677652288 | +| `ID` | `string` | :heavy_check_mark: | Unique completion identifier | chatcmpl-123 | +| `Model` | `string` | :heavy_check_mark: | Model used for completion | openai/gpt-4 | +| `Object` | [components.ChatResultObject](../../models/components/chatresultobject.md) | :heavy_check_mark: | N/A | | +| `OpenrouterMetadata` | [*components.OpenRouterMetadata](../../models/components/openroutermetadata.md) | :heavy_minus_sign: | N/A | {
"attempt": 1,
"endpoints": {
"available": [
{
"model": "openai/gpt-4o",
"provider": "OpenAI",
"selected": true
}
],
"total": 1
},
"is_byok": false,
"region": "iad",
"requested": "openai/gpt-4o",
"strategy": "direct",
"summary": "available=1, selected=OpenAI"
} | +| `ServiceTier` | optionalnullable.OptionalNullable[`string`] | :heavy_minus_sign: | The service tier used by the upstream provider for this request | default | +| `SystemFingerprint` | `*string` | :heavy_check_mark: | System fingerprint | fp_44709d6fcb | +| `Usage` | [*components.ChatUsage](../../models/components/chatusage.md) | :heavy_minus_sign: | Token usage statistics | {
"completion_tokens": 15,
"completion_tokens_details": {
"reasoning_tokens": 5
},
"cost": 0.0012,
"cost_details": {
"upstream_inference_completions_cost": 0.0004,
"upstream_inference_cost": null,
"upstream_inference_prompt_cost": 0.0008
},
"is_byok": false,
"prompt_tokens": 10,
"prompt_tokens_details": {
"cached_tokens": 2
},
"server_tool_use_details": {
"tool_calls_executed": 2,
"tool_calls_requested": 2
},
"total_tokens": 25
} | \ No newline at end of file diff --git a/docs/models/components/chatstreamchunk.md b/docs/models/components/chatstreamchunk.md index 4194e190..e12409c3 100644 --- a/docs/models/components/chatstreamchunk.md +++ b/docs/models/components/chatstreamchunk.md @@ -5,15 +5,15 @@ Streaming chat completion chunk ## Fields -| Field | Type | Required | Description | Example | -| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `Choices` | [][components.ChatStreamChoice](../../models/components/chatstreamchoice.md) | :heavy_check_mark: | List of streaming chunk choices | | -| `Created` | `int64` | :heavy_check_mark: | Unix timestamp of creation | 1677652288 | -| `Error` | [*components.Error](../../models/components/error.md) | :heavy_minus_sign: | Error information | {
"code": 429,
"message": "Rate limit exceeded"
} | -| `ID` | `string` | :heavy_check_mark: | Unique chunk identifier | chatcmpl-123 | -| `Model` | `string` | :heavy_check_mark: | Model used for completion | openai/gpt-4 | -| `Object` | [components.ChatStreamChunkObject](../../models/components/chatstreamchunkobject.md) | :heavy_check_mark: | N/A | | -| `OpenrouterMetadata` | [*components.OpenRouterMetadata](../../models/components/openroutermetadata.md) | :heavy_minus_sign: | N/A | {
"attempt": 1,
"endpoints": {
"available": [
{
"model": "openai/gpt-4o",
"provider": "OpenAI",
"selected": true
}
],
"total": 1
},
"is_byok": false,
"region": "iad",
"requested": "openai/gpt-4o",
"strategy": "direct",
"summary": "available=1, selected=OpenAI"
} | -| `ServiceTier` | optionalnullable.OptionalNullable[`string`] | :heavy_minus_sign: | The service tier used by the upstream provider for this request | default | -| `SystemFingerprint` | `*string` | :heavy_minus_sign: | System fingerprint | fp_44709d6fcb | -| `Usage` | [*components.ChatUsage](../../models/components/chatusage.md) | :heavy_minus_sign: | Token usage statistics | {
"completion_tokens": 15,
"completion_tokens_details": {
"reasoning_tokens": 5
},
"cost": 0.0012,
"cost_details": {
"upstream_inference_completions_cost": 0.0004,
"upstream_inference_cost": null,
"upstream_inference_prompt_cost": 0.0008
},
"is_byok": false,
"prompt_tokens": 10,
"prompt_tokens_details": {
"cached_tokens": 2
},
"total_tokens": 25
} | \ No newline at end of file +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `Choices` | [][components.ChatStreamChoice](../../models/components/chatstreamchoice.md) | :heavy_check_mark: | List of streaming chunk choices | | +| `Created` | `int64` | :heavy_check_mark: | Unix timestamp of creation | 1677652288 | +| `Error` | [*components.ChatStreamChunkError](../../models/components/chatstreamchunkerror.md) | :heavy_minus_sign: | Error information | {
"code": 429,
"message": "Rate limit exceeded",
"metadata": {
"error_type": "rate_limit_exceeded"
}
} | +| `ID` | `string` | :heavy_check_mark: | Unique chunk identifier | chatcmpl-123 | +| `Model` | `string` | :heavy_check_mark: | Model used for completion | openai/gpt-4 | +| `Object` | [components.ChatStreamChunkObject](../../models/components/chatstreamchunkobject.md) | :heavy_check_mark: | N/A | | +| `OpenrouterMetadata` | [*components.OpenRouterMetadata](../../models/components/openroutermetadata.md) | :heavy_minus_sign: | N/A | {
"attempt": 1,
"endpoints": {
"available": [
{
"model": "openai/gpt-4o",
"provider": "OpenAI",
"selected": true
}
],
"total": 1
},
"is_byok": false,
"region": "iad",
"requested": "openai/gpt-4o",
"strategy": "direct",
"summary": "available=1, selected=OpenAI"
} | +| `ServiceTier` | optionalnullable.OptionalNullable[`string`] | :heavy_minus_sign: | The service tier used by the upstream provider for this request | default | +| `SystemFingerprint` | `*string` | :heavy_minus_sign: | System fingerprint | fp_44709d6fcb | +| `Usage` | [*components.ChatUsage](../../models/components/chatusage.md) | :heavy_minus_sign: | Token usage statistics | {
"completion_tokens": 15,
"completion_tokens_details": {
"reasoning_tokens": 5
},
"cost": 0.0012,
"cost_details": {
"upstream_inference_completions_cost": 0.0004,
"upstream_inference_cost": null,
"upstream_inference_prompt_cost": 0.0008
},
"is_byok": false,
"prompt_tokens": 10,
"prompt_tokens_details": {
"cached_tokens": 2
},
"server_tool_use_details": {
"tool_calls_executed": 2,
"tool_calls_requested": 2
},
"total_tokens": 25
} | \ No newline at end of file diff --git a/docs/models/components/chatstreamchunkerror.md b/docs/models/components/chatstreamchunkerror.md new file mode 100644 index 00000000..a63a16c2 --- /dev/null +++ b/docs/models/components/chatstreamchunkerror.md @@ -0,0 +1,12 @@ +# ChatStreamChunkError + +Error information + + +## Fields + +| Field | Type | Required | Description | Example | +| ----------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------- | +| `Code` | `int` | :heavy_check_mark: | Error code | 429 | +| `Message` | `string` | :heavy_check_mark: | Error message | Rate limit exceeded | +| `Metadata` | [*components.ChatStreamChunkMetadata](../../models/components/chatstreamchunkmetadata.md) | :heavy_minus_sign: | Structured error metadata | | \ No newline at end of file diff --git a/docs/models/components/chatstreamchunkmetadata.md b/docs/models/components/chatstreamchunkmetadata.md new file mode 100644 index 00000000..5fb096eb --- /dev/null +++ b/docs/models/components/chatstreamchunkmetadata.md @@ -0,0 +1,11 @@ +# ChatStreamChunkMetadata + +Structured error metadata + + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------ | ------------------------------------------------------------------ | ------------------------------------------------------------------ | ------------------------------------------------------------------ | ------------------------------------------------------------------ | +| `ErrorType` | [components.APIErrorType](../../models/components/apierrortype.md) | :heavy_check_mark: | Canonical OpenRouter error type, stable across all API formats | rate_limit_exceeded | +| `ProviderCode` | `*string` | :heavy_minus_sign: | Upstream provider-specific error code, when available | | \ No newline at end of file diff --git a/docs/models/components/chatstreamdelta.md b/docs/models/components/chatstreamdelta.md index c33cee92..5d934c4b 100644 --- a/docs/models/components/chatstreamdelta.md +++ b/docs/models/components/chatstreamdelta.md @@ -11,6 +11,6 @@ Delta changes in streaming response | `Content` | optionalnullable.OptionalNullable[`string`] | :heavy_minus_sign: | Message content delta | Hello | | `Reasoning` | optionalnullable.OptionalNullable[`string`] | :heavy_minus_sign: | Reasoning content delta | I need to | | `ReasoningDetails` | [][components.ReasoningDetailUnion](../../models/components/reasoningdetailunion.md) | :heavy_minus_sign: | Reasoning details for extended thinking models | [
{
"text": "Let me think about this...",
"type": "text"
}
] | -| `Refusal` | optionalnullable.OptionalNullable[`string`] | :heavy_minus_sign: | Refusal message delta | null | +| `Refusal` | optionalnullable.OptionalNullable[`string`] | :heavy_minus_sign: | Refusal message delta | | | `Role` | [*components.ChatStreamDeltaRole](../../models/components/chatstreamdeltarole.md) | :heavy_minus_sign: | The role of the message author | assistant | | `ToolCalls` | [][components.ChatStreamToolCall](../../models/components/chatstreamtoolcall.md) | :heavy_minus_sign: | Tool calls delta | | \ No newline at end of file diff --git a/docs/models/components/chatusage.md b/docs/models/components/chatusage.md index e540306a..98e4a2db 100644 --- a/docs/models/components/chatusage.md +++ b/docs/models/components/chatusage.md @@ -5,13 +5,14 @@ Token usage statistics ## Fields -| Field | Type | Required | Description | Example | -| ---------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------- | -| `CompletionTokens` | `int64` | :heavy_check_mark: | Number of tokens in the completion | | -| `CompletionTokensDetails` | optionalnullable.OptionalNullable[[components.CompletionTokensDetails](../../models/components/completiontokensdetails.md)] | :heavy_minus_sign: | Detailed completion token usage | | -| `Cost` | optionalnullable.OptionalNullable[`float64`] | :heavy_minus_sign: | Cost of the completion | | -| `CostDetails` | optionalnullable.OptionalNullable[[components.CostDetails](../../models/components/costdetails.md)] | :heavy_minus_sign: | Breakdown of upstream inference costs | {
"upstream_inference_completions_cost": 0.0004,
"upstream_inference_cost": null,
"upstream_inference_prompt_cost": 0.0008
} | -| `IsByok` | `*bool` | :heavy_minus_sign: | Whether a request was made using a Bring Your Own Key configuration | | -| `PromptTokens` | `int64` | :heavy_check_mark: | Number of tokens in the prompt | | -| `PromptTokensDetails` | optionalnullable.OptionalNullable[[components.PromptTokensDetails](../../models/components/prompttokensdetails.md)] | :heavy_minus_sign: | Detailed prompt token usage | | -| `TotalTokens` | `int64` | :heavy_check_mark: | Total number of tokens | | \ No newline at end of file +| Field | Type | Required | Description | Example | +| --------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------- | +| `CompletionTokens` | `int64` | :heavy_check_mark: | Number of tokens in the completion | | +| `CompletionTokensDetails` | optionalnullable.OptionalNullable[[components.ChatUsageCompletionTokensDetails](../../models/components/chatusagecompletiontokensdetails.md)] | :heavy_minus_sign: | Detailed completion token usage | | +| `Cost` | optionalnullable.OptionalNullable[`float64`] | :heavy_minus_sign: | Cost of the completion | | +| `CostDetails` | optionalnullable.OptionalNullable[[components.CostDetails](../../models/components/costdetails.md)] | :heavy_minus_sign: | Breakdown of upstream inference costs | {
"upstream_inference_completions_cost": 0.0004,
"upstream_inference_cost": null,
"upstream_inference_prompt_cost": 0.0008
} | +| `IsByok` | `*bool` | :heavy_minus_sign: | Whether a request was made using a Bring Your Own Key configuration | | +| `PromptTokens` | `int64` | :heavy_check_mark: | Number of tokens in the prompt | | +| `PromptTokensDetails` | optionalnullable.OptionalNullable[[components.ChatUsagePromptTokensDetails](../../models/components/chatusageprompttokensdetails.md)] | :heavy_minus_sign: | Detailed prompt token usage | | +| `ServerToolUseDetails` | optionalnullable.OptionalNullable[[components.ServerToolUseDetails](../../models/components/servertoolusedetails.md)] | :heavy_minus_sign: | Usage for server-side tool execution (e.g., web search) | | +| `TotalTokens` | `int64` | :heavy_check_mark: | Total number of tokens | | \ No newline at end of file diff --git a/docs/models/components/completiontokensdetails.md b/docs/models/components/chatusagecompletiontokensdetails.md similarity index 97% rename from docs/models/components/completiontokensdetails.md rename to docs/models/components/chatusagecompletiontokensdetails.md index d57e78f1..e3baf435 100644 --- a/docs/models/components/completiontokensdetails.md +++ b/docs/models/components/chatusagecompletiontokensdetails.md @@ -1,4 +1,4 @@ -# CompletionTokensDetails +# ChatUsageCompletionTokensDetails Detailed completion token usage diff --git a/docs/models/components/prompttokensdetails.md b/docs/models/components/chatusageprompttokensdetails.md similarity index 98% rename from docs/models/components/prompttokensdetails.md rename to docs/models/components/chatusageprompttokensdetails.md index d1a5b5a3..83a90e1f 100644 --- a/docs/models/components/prompttokensdetails.md +++ b/docs/models/components/chatusageprompttokensdetails.md @@ -1,4 +1,4 @@ -# PromptTokensDetails +# ChatUsagePromptTokensDetails Detailed prompt token usage diff --git a/docs/models/components/chatwebsearchshorthand.md b/docs/models/components/chatwebsearchshorthand.md index b8b2bea7..228effbd 100644 --- a/docs/models/components/chatwebsearchshorthand.md +++ b/docs/models/components/chatwebsearchshorthand.md @@ -11,7 +11,7 @@ Web search tool using OpenAI Responses API syntax. Automatically converted to op | `Engine` | [*components.WebSearchEngineEnum](../../models/components/websearchengineenum.md) | :heavy_minus_sign: | Which search engine to use. "auto" (default) uses native if the provider supports it, otherwise Exa. "native" forces the provider's built-in search. "exa" forces the Exa search API. "firecrawl" uses Firecrawl (requires BYOK). "parallel" uses the Parallel search API. "perplexity" uses the Perplexity Search API (raw ranked results). | auto | | `ExcludedDomains` | []`string` | :heavy_minus_sign: | Exclude search results from these domains. Supported by Exa, Firecrawl, Parallel, Perplexity, Anthropic, and xAI. Not supported with OpenAI (silently ignored). Cannot be used with allowed_domains. | | | `MaxCharacters` | `*int64` | :heavy_minus_sign: | Exact maximum number of characters of content per search result. Applies to the Exa, Parallel, and Perplexity engines; ignored with native provider search and Firecrawl. For Exa, caps highlight content per result. For Parallel, caps excerpt content per result (default 1,500 when omitted). For Perplexity, maps to the native `max_tokens_per_page` parameter (converted from characters to tokens) and trims the response to the exact character cap. When both `max_characters` and `search_context_size` are set, `max_characters` takes precedence. When omitted, falls back to `search_context_size` mapping (Exa) or engine defaults (Parallel, Perplexity). | 2000 | -| `MaxResults` | `*int64` | :heavy_minus_sign: | Maximum number of search results to return per search call. Defaults to 5. Applies to Exa, Firecrawl, Parallel, and Perplexity engines; ignored with native provider search. | 5 | +| `MaxResults` | `*int64` | :heavy_minus_sign: | Maximum number of search results to return per search call. Defaults to 5. Applies to Exa, Firecrawl, Parallel, and Perplexity engines; ignored with native provider search. Perplexity supports a maximum of 20; values above 20 are clamped. | 5 | | `MaxTotalResults` | `*int64` | :heavy_minus_sign: | Maximum total number of search results across all search calls in a single request. Once this limit is reached, the tool will stop returning new results. Useful for controlling cost and context size in agentic loops. Defaults to 50 when not specified. | 50 | | `Parameters` | [*components.WebSearchConfig](../../models/components/websearchconfig.md) | :heavy_minus_sign: | N/A | {
"max_results": 5,
"search_context_size": "medium"
} | | `SearchContextSize` | [*components.SearchQualityLevel](../../models/components/searchqualitylevel.md) | :heavy_minus_sign: | How much context to retrieve per result. Applies to Exa, Parallel, and Perplexity engines; ignored with native provider search and Firecrawl. For Exa, pins a fixed per-result character cap (low=5,000, medium=15,000, high=30,000); when omitted, Exa picks an adaptive size per query and document (typically ~2,000–4,000 characters per result). For Parallel, controls the total characters across all results; when omitted, Parallel uses its own default size. For Perplexity, maps directly to the Search API's native search_context_size parameter. Overridden by `max_characters` when both are set. | medium | diff --git a/docs/models/components/createbyokkeyrequest.md b/docs/models/components/createbyokkeyrequest.md index 317fbd4f..cc35eb29 100644 --- a/docs/models/components/createbyokkeyrequest.md +++ b/docs/models/components/createbyokkeyrequest.md @@ -5,8 +5,8 @@ | Field | Type | Required | Description | Example | | -------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------- | -| `AllowedModels` | optionalnullable.OptionalNullable[[]`string`] | :heavy_minus_sign: | Optional allowlist of model slugs this credential may be used for. `null` means no restriction. | null | -| `AllowedUserIds` | optionalnullable.OptionalNullable[[]`string`] | :heavy_minus_sign: | Optional allowlist of user IDs that may use this credential. `null` means no restriction. | null | +| `AllowedModels` | optionalnullable.OptionalNullable[[]`string`] | :heavy_minus_sign: | Optional allowlist of model slugs this credential may be used for. `null` means no restriction. | | +| `AllowedUserIds` | optionalnullable.OptionalNullable[[]`string`] | :heavy_minus_sign: | Optional allowlist of user IDs that may use this credential. `null` means no restriction. | | | `Disabled` | `*bool` | :heavy_minus_sign: | Whether this credential should be created in a disabled state. | false | | `IsFallback` | `*bool` | :heavy_minus_sign: | Whether this credential is treated as a fallback — used only after non-fallback keys for the same provider have been tried. | false | | `Key` | `string` | :heavy_check_mark: | The raw provider API key or credential. This value is encrypted at rest and never returned in API responses. | sk-proj-abc123... | diff --git a/docs/models/components/createobservabilitydestinationrequest.md b/docs/models/components/createobservabilitydestinationrequest.md index ff5f5f4e..09aa0fca 100644 --- a/docs/models/components/createobservabilitydestinationrequest.md +++ b/docs/models/components/createobservabilitydestinationrequest.md @@ -5,10 +5,10 @@ | Field | Type | Required | Description | Example | | --------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `APIKeyHashes` | optionalnullable.OptionalNullable[[]`string`] | :heavy_minus_sign: | Optional allowlist of OpenRouter API key hashes whose traffic is forwarded. `null` or omitted means all keys. Must contain at least one hash if provided. | null | +| `APIKeyHashes` | optionalnullable.OptionalNullable[[]`string`] | :heavy_minus_sign: | Optional allowlist of OpenRouter API key hashes whose traffic is forwarded. `null` or omitted means all keys. Must contain at least one hash if provided. | | | `Config` | map[string]`any` | :heavy_check_mark: | Provider-specific configuration. The shape depends on `type` and is validated server-side. | {
"baseUrl": "https://us.cloud.langfuse.com",
"publicKey": "pk-l...EfGh",
"secretKey": "sk-l...AbCd"
} | | `Enabled` | `*bool` | :heavy_minus_sign: | Whether this destination should be enabled immediately. | true | -| `FilterRules` | optionalnullable.OptionalNullable[[components.ObservabilityFilterRulesConfig](../../models/components/observabilityfilterrulesconfig.md)] | :heavy_minus_sign: | Optional structured filter rules controlling which events are forwarded. | null | +| `FilterRules` | optionalnullable.OptionalNullable[[components.ObservabilityFilterRulesConfig](../../models/components/observabilityfilterrulesconfig.md)] | :heavy_minus_sign: | Optional structured filter rules controlling which events are forwarded. | | | `Name` | `string` | :heavy_check_mark: | Human-readable name for the destination. | Production Langfuse | | `PrivacyMode` | `*bool` | :heavy_minus_sign: | When true, request/response bodies are not forwarded — only metadata. | false | | `SamplingRate` | `*float64` | :heavy_minus_sign: | Sampling rate between 0.0001 and 1 (1 = 100%). | 1 | diff --git a/docs/models/components/createworkspacerequest.md b/docs/models/components/createworkspacerequest.md index ec9560bf..50b70288 100644 --- a/docs/models/components/createworkspacerequest.md +++ b/docs/models/components/createworkspacerequest.md @@ -9,7 +9,7 @@ | `DefaultProviderSort` | optionalnullable.OptionalNullable[`string`] | :heavy_minus_sign: | Default provider sort preference (price, throughput, latency, exacto) | price | | `DefaultTextModel` | optionalnullable.OptionalNullable[`string`] | :heavy_minus_sign: | Default text model for this workspace | openai/gpt-4o | | `Description` | optionalnullable.OptionalNullable[`string`] | :heavy_minus_sign: | Description of the workspace | Production environment workspace | -| `IoLoggingAPIKeyIds` | optionalnullable.OptionalNullable[[]`int64`] | :heavy_minus_sign: | Optional array of API key IDs to filter I/O logging | null | +| `IoLoggingAPIKeyIds` | optionalnullable.OptionalNullable[[]`int64`] | :heavy_minus_sign: | Optional array of API key IDs to filter I/O logging | | | `IoLoggingSamplingRate` | `*float64` | :heavy_minus_sign: | Sampling rate for I/O logging (0.0001-1) | 1 | | `IsDataDiscountLoggingEnabled` | `*bool` | :heavy_minus_sign: | Whether data discount logging is enabled | true | | `IsObservabilityBroadcastEnabled` | `*bool` | :heavy_minus_sign: | Whether broadcast is enabled | false | diff --git a/docs/models/components/debug.md b/docs/models/components/debug.md new file mode 100644 index 00000000..bbf94c58 --- /dev/null +++ b/docs/models/components/debug.md @@ -0,0 +1,9 @@ +# Debug + + +## Fields + +| Field | Type | Required | Description | +| --------------------------------------------------------- | --------------------------------------------------------- | --------------------------------------------------------- | --------------------------------------------------------- | +| `EchoUpstreamBody` | map[string]`any` | :heavy_minus_sign: | N/A | +| `Timings` | [*components.Timings](../../models/components/timings.md) | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/components/debugevent.md b/docs/models/components/debugevent.md new file mode 100644 index 00000000..8c72c6ac --- /dev/null +++ b/docs/models/components/debugevent.md @@ -0,0 +1,12 @@ +# DebugEvent + +Debug event emitted when debug.echo_upstream_body is true. Contains the transformed upstream request body or timing milestones. + + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------------------------------------- | ---------------------------------------------------------------------- | ---------------------------------------------------------------------- | ---------------------------------------------------------------------- | +| `Debug` | [components.Debug](../../models/components/debug.md) | :heavy_check_mark: | N/A | +| `SequenceNumber` | `int64` | :heavy_check_mark: | N/A | +| `Type` | [components.DebugEventType](../../models/components/debugeventtype.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/components/debugeventtype.md b/docs/models/components/debugeventtype.md new file mode 100644 index 00000000..76b4a4f8 --- /dev/null +++ b/docs/models/components/debugeventtype.md @@ -0,0 +1,18 @@ +# DebugEventType + +## Example Usage + +```go +import ( + "github.com/OpenRouterTeam/go-sdk/models/components" +) + +value := components.DebugEventTypeResponseDebug +``` + + +## Values + +| Name | Value | +| ----------------------------- | ----------------------------- | +| `DebugEventTypeResponseDebug` | response.debug | \ No newline at end of file diff --git a/docs/models/components/defaulteffort.md b/docs/models/components/defaulteffort.md new file mode 100644 index 00000000..fb918482 --- /dev/null +++ b/docs/models/components/defaulteffort.md @@ -0,0 +1,29 @@ +# DefaultEffort + +Default reasoning effort when the client enables reasoning without specifying effort. Maps to `reasoning.effort` in chat requests. When `"none"`, prefer omitting effort unless the user explicitly disables reasoning. + +## Example Usage + +```go +import ( + "github.com/OpenRouterTeam/go-sdk/models/components" +) + +value := components.DefaultEffortMax + +// Open enum: custom values can be created with a direct type cast +custom := components.DefaultEffort("custom_value") +``` + + +## Values + +| Name | Value | +| ---------------------- | ---------------------- | +| `DefaultEffortMax` | max | +| `DefaultEffortXhigh` | xhigh | +| `DefaultEffortHigh` | high | +| `DefaultEffortMedium` | medium | +| `DefaultEffortLow` | low | +| `DefaultEffortMinimal` | minimal | +| `DefaultEffortNone` | none | \ No newline at end of file diff --git a/docs/models/components/deleteworkspacebudgetresponse.md b/docs/models/components/deleteworkspacebudgetresponse.md new file mode 100644 index 00000000..183b6a69 --- /dev/null +++ b/docs/models/components/deleteworkspacebudgetresponse.md @@ -0,0 +1,8 @@ +# DeleteWorkspaceBudgetResponse + + +## Fields + +| Field | Type | Required | Description | Example | +| ----------------------------------------------------------- | ----------------------------------------------------------- | ----------------------------------------------------------- | ----------------------------------------------------------- | ----------------------------------------------------------- | +| `Deleted` | `bool` | :heavy_check_mark: | Confirmation that the budget was deleted (or did not exist) | true | \ No newline at end of file diff --git a/docs/models/components/elobounds.md b/docs/models/components/elobounds.md deleted file mode 100644 index 2764b566..00000000 --- a/docs/models/components/elobounds.md +++ /dev/null @@ -1,11 +0,0 @@ -# EloBounds - -ELO range across all returned models for normalization. - - -## Fields - -| Field | Type | Required | Description | -| ------------------------------ | ------------------------------ | ------------------------------ | ------------------------------ | -| `Max` | `float64` | :heavy_check_mark: | Maximum ELO in the result set. | -| `Min` | `float64` | :heavy_check_mark: | Minimum ELO in the result set. | \ No newline at end of file diff --git a/docs/models/components/enumcapability.md b/docs/models/components/enumcapability.md new file mode 100644 index 00000000..3c8c1a0d --- /dev/null +++ b/docs/models/components/enumcapability.md @@ -0,0 +1,11 @@ +# EnumCapability + +A parameter that accepts one of a discrete set of string values. + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | +| `Type` | [components.EnumCapabilityType](../../models/components/enumcapabilitytype.md) | :heavy_check_mark: | N/A | +| `Values` | []`string` | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/components/enumcapabilitytype.md b/docs/models/components/enumcapabilitytype.md new file mode 100644 index 00000000..8c9f5450 --- /dev/null +++ b/docs/models/components/enumcapabilitytype.md @@ -0,0 +1,18 @@ +# EnumCapabilityType + +## Example Usage + +```go +import ( + "github.com/OpenRouterTeam/go-sdk/models/components" +) + +value := components.EnumCapabilityTypeEnum +``` + + +## Values + +| Name | Value | +| ------------------------ | ------------------------ | +| `EnumCapabilityTypeEnum` | enum | \ No newline at end of file diff --git a/docs/models/components/error.md b/docs/models/components/error.md deleted file mode 100644 index ca83e4d7..00000000 --- a/docs/models/components/error.md +++ /dev/null @@ -1,11 +0,0 @@ -# Error - -Error information - - -## Fields - -| Field | Type | Required | Description | Example | -| ------------------- | ------------------- | ------------------- | ------------------- | ------------------- | -| `Code` | `int` | :heavy_check_mark: | Error code | 429 | -| `Message` | `string` | :heavy_check_mark: | Error message | Rate limit exceeded | \ No newline at end of file diff --git a/docs/models/components/event.md b/docs/models/components/event.md new file mode 100644 index 00000000..864a3d76 --- /dev/null +++ b/docs/models/components/event.md @@ -0,0 +1,24 @@ +# Event + +## Example Usage + +```go +import ( + "github.com/OpenRouterTeam/go-sdk/models/components" +) + +value := components.EventAdapterRequest + +// Open enum: custom values can be created with a direct type cast +custom := components.Event("custom_value") +``` + + +## Values + +| Name | Value | +| ------------------------------ | ------------------------------ | +| `EventAdapterRequest` | adapter_request | +| `EventUpstreamHeadersReceived` | upstream_headers_received | +| `EventFirstTokenReceived` | first_token_received | +| `EventUpstreamBodyEnded` | upstream_body_ended | \ No newline at end of file diff --git a/docs/models/components/fusionplugin.md b/docs/models/components/fusionplugin.md index ae7186f5..76f9386b 100644 --- a/docs/models/components/fusionplugin.md +++ b/docs/models/components/fusionplugin.md @@ -10,4 +10,5 @@ | `ID` | [components.FusionPluginID](../../models/components/fusionpluginid.md) | :heavy_check_mark: | N/A | | | `MaxToolCalls` | `*int64` | :heavy_minus_sign: | Maximum number of tool-calling steps each panelist (analysis model) and the judge model may take during their agentic web-research loop. Models with web_search/web_fetch enabled iterate until they produce a text response or hit this ceiling. Defaults to 8. Capped at 16. | 12 | | `Model` | `*string` | :heavy_minus_sign: | Slug of the model that performs both the judge step (with web_search + web_fetch) and the final synthesis. When omitted, defaults to the first model in the Quality preset. | ~anthropic/claude-opus-latest | +| `Preset` | [*components.PresetEnum](../../models/components/presetenum.md) | :heavy_minus_sign: | A curated OpenRouter fusion preset (slugs follow `-`, e.g. `general-high`). Expands server-side into the preset's analysis_models panel and judge model, so callers never name individual models. Explicitly provided `analysis_models` / `model` take precedence. | general-high | | `Tools` | [][components.FusionPluginTool](../../models/components/fusionplugintool.md) | :heavy_minus_sign: | Server tools available to panelist and judge inner calls. Each entry uses the same `{ type, parameters? }` shorthand as the outer Chat Completions request. When omitted, defaults to `[{ type: "openrouter:web_search" }, { type: "openrouter:web_fetch" }]`. Pass an empty array to disable tools entirely (panelists answer from parametric knowledge only). | [
{
"parameters": {
"excluded_domains": [
"example.com"
]
},
"type": "openrouter:web_search"
},
{
"type": "openrouter:web_fetch"
}
] | \ No newline at end of file diff --git a/docs/models/components/fusionservertoolconfig.md b/docs/models/components/fusionservertoolconfig.md index c8513720..f82d8f2b 100644 --- a/docs/models/components/fusionservertoolconfig.md +++ b/docs/models/components/fusionservertoolconfig.md @@ -8,6 +8,7 @@ Configuration for the openrouter:fusion server tool. | Field | Type | Required | Description | Example | | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `AnalysisModels` | []`string` | :heavy_minus_sign: | Slugs of models to run in parallel as the analysis panel. Each model receives the user prompt with openrouter:web_search and openrouter:web_fetch enabled, then a judge model summarizes the collective output into structured analysis JSON. Capped at 8 models to bound cost amplification. Defaults to the Quality preset from /labs/fusion. | [
"~anthropic/claude-opus-latest",
"~openai/gpt-latest",
"~google/gemini-pro-latest"
] | +| `CacheControl` | [*components.AnthropicCacheControlDirective](../../models/components/anthropiccachecontroldirective.md) | :heavy_minus_sign: | Enable automatic prompt caching. When set at the top level, the system automatically applies cache breakpoints to the last cacheable block in the request. Currently supported for Anthropic Claude models. | {
"type": "ephemeral"
} | | `MaxCompletionTokens` | `*int64` | :heavy_minus_sign: | Maximum number of output tokens (including reasoning tokens) each panelist and the judge model may produce per inner call. Controls the total output budget so reasoning-heavy models like GPT-5.5 do not exhaust their token allowance before producing visible text. When omitted, the provider's default applies. | 16384 | | `MaxToolCalls` | `*int64` | :heavy_minus_sign: | Maximum number of tool-calling steps each panelist (analysis model) and the judge model may take during their agentic web-research loop. Models with web_search/web_fetch enabled iterate until they produce a text response or hit this ceiling. Defaults to 8. Capped at 16. | 12 | | `Model` | `*string` | :heavy_minus_sign: | Slug of the judge model that produces the structured analysis JSON. Defaults to the model used in the outer API request. | ~anthropic/claude-opus-latest | diff --git a/docs/models/components/fusionservertoolconfigeffort.md b/docs/models/components/fusionservertoolconfigeffort.md index bd6d257b..0d60d596 100644 --- a/docs/models/components/fusionservertoolconfigeffort.md +++ b/docs/models/components/fusionservertoolconfigeffort.md @@ -9,7 +9,7 @@ import ( "github.com/OpenRouterTeam/go-sdk/models/components" ) -value := components.FusionServerToolConfigEffortXhigh +value := components.FusionServerToolConfigEffortMax // Open enum: custom values can be created with a direct type cast custom := components.FusionServerToolConfigEffort("custom_value") @@ -20,6 +20,7 @@ custom := components.FusionServerToolConfigEffort("custom_value") | Name | Value | | ------------------------------------- | ------------------------------------- | +| `FusionServerToolConfigEffortMax` | max | | `FusionServerToolConfigEffortXhigh` | xhigh | | `FusionServerToolConfigEffortHigh` | high | | `FusionServerToolConfigEffortMedium` | medium | diff --git a/docs/models/components/generationcontentdataoutput.md b/docs/models/components/generationcontentdataoutput.md index 03ccb3a3..d267ae5c 100644 --- a/docs/models/components/generationcontentdataoutput.md +++ b/docs/models/components/generationcontentdataoutput.md @@ -8,4 +8,4 @@ The output from the generation | Field | Type | Required | Description | Example | | -------------------------------------------------- | -------------------------------------------------- | -------------------------------------------------- | -------------------------------------------------- | -------------------------------------------------- | | `Completion` | `*string` | :heavy_check_mark: | The completion output | The meaning of life is a philosophical question... | -| `Reasoning` | `*string` | :heavy_check_mark: | Reasoning/thinking output, if any | null | \ No newline at end of file +| `Reasoning` | `*string` | :heavy_check_mark: | Reasoning/thinking output, if any | | \ No newline at end of file diff --git a/docs/models/components/imageendpoint.md b/docs/models/components/imageendpoint.md new file mode 100644 index 00000000..47214dd6 --- /dev/null +++ b/docs/models/components/imageendpoint.md @@ -0,0 +1,16 @@ +# ImageEndpoint + +An endpoint that serves a given image model. + + +## Fields + +| Field | Type | Required | Description | Example | +| -------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `AllowedPassthroughParameters` | []`string` | :heavy_check_mark: | Provider-specific options accepted under provider.options[provider_slug]. | [] | +| `Pricing` | [][components.ImagePricingEntry](../../models/components/imagepricingentry.md) | :heavy_check_mark: | Billable pricing lines for this endpoint. | [
{
"billable": "output_image",
"cost_usd": 0.05,
"unit": "image"
}
] | +| `ProviderName` | `string` | :heavy_check_mark: | Provider display name | Bytedance | +| `ProviderSlug` | `string` | :heavy_check_mark: | Provider slug | bytedance | +| `ProviderTag` | `*string` | :heavy_check_mark: | Provider tag for request-side selection | bytedance | +| `SupportedParameters` | map[string][components.CapabilityDescriptor](../../models/components/capabilitydescriptor.md) | :heavy_check_mark: | N/A | {
"output_compression": {
"max": 100,
"min": 0,
"type": "range"
},
"resolution": {
"type": "enum",
"values": [
"1K",
"2K",
"4K"
]
},
"seed": {
"type": "boolean"
}
} | +| `SupportsStreaming` | `bool` | :heavy_check_mark: | Whether this endpoint supports native SSE streaming (`stream: true` in the request). | false | \ No newline at end of file diff --git a/docs/models/components/imagegencompletedevent.md b/docs/models/components/imagegencompletedevent.md new file mode 100644 index 00000000..09403c92 --- /dev/null +++ b/docs/models/components/imagegencompletedevent.md @@ -0,0 +1,13 @@ +# ImageGenCompletedEvent + +Emitted when generation completes and the final image is available + + +## Fields + +| Field | Type | Required | Description | Example | +| ---------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------- | +| `B64JSON` | `string` | :heavy_check_mark: | Base64-encoded final image data | | +| `Created` | `int64` | :heavy_check_mark: | Unix timestamp (seconds) when the image was generated | | +| `Type` | [components.ImageGenCompletedEventType](../../models/components/imagegencompletedeventtype.md) | :heavy_check_mark: | The event type | | +| `Usage` | [*components.ImageGenerationUsage](../../models/components/imagegenerationusage.md) | :heavy_minus_sign: | Token and cost usage for the image generation request, when available | {
"completion_tokens": 4175,
"cost": 0.04,
"prompt_tokens": 0,
"total_tokens": 4175
} | \ No newline at end of file diff --git a/docs/models/components/benchmarksaametasourceurl.md b/docs/models/components/imagegencompletedeventtype.md similarity index 57% rename from docs/models/components/benchmarksaametasourceurl.md rename to docs/models/components/imagegencompletedeventtype.md index 71b7fa02..2dcc452a 100644 --- a/docs/models/components/benchmarksaametasourceurl.md +++ b/docs/models/components/imagegencompletedeventtype.md @@ -1,6 +1,6 @@ -# BenchmarksAAMetaSourceURL +# ImageGenCompletedEventType -URL of the upstream data source. +The event type ## Example Usage @@ -9,7 +9,7 @@ import ( "github.com/OpenRouterTeam/go-sdk/models/components" ) -value := components.BenchmarksAAMetaSourceURLHTTPSArtificialanalysisAi +value := components.ImageGenCompletedEventTypeImageGenerationCompleted ``` @@ -17,4 +17,4 @@ value := components.BenchmarksAAMetaSourceURLHTTPSArtificialanalysisAi | Name | Value | | ---------------------------------------------------- | ---------------------------------------------------- | -| `BenchmarksAAMetaSourceURLHTTPSArtificialanalysisAi` | https://artificialanalysis.ai | \ No newline at end of file +| `ImageGenCompletedEventTypeImageGenerationCompleted` | image_generation.completed | \ No newline at end of file diff --git a/docs/models/components/imagegenerationrequest.md b/docs/models/components/imagegenerationrequest.md new file mode 100644 index 00000000..ee5ec46b --- /dev/null +++ b/docs/models/components/imagegenerationrequest.md @@ -0,0 +1,23 @@ +# ImageGenerationRequest + +Image generation request input + + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `AspectRatio` | [*components.ImageGenerationRequestAspectRatio](../../models/components/imagegenerationrequestaspectratio.md) | :heavy_minus_sign: | Normalized aspect ratio of the generated image. Providers clamp to their supported subset. | 16:9 | +| `Background` | [*components.ImageGenerationRequestBackground](../../models/components/imagegenerationrequestbackground.md) | :heavy_minus_sign: | Background treatment. `transparent` requires an output_format that supports alpha (png or webp). | auto | +| `InputReferences` | [][components.ContentPartImage](../../models/components/contentpartimage.md) | :heavy_minus_sign: | Reference images to guide image-to-image generation, as base64 data URLs or HTTP(S) URLs. | | +| `Model` | `string` | :heavy_check_mark: | The image generation model to use | bytedance-seed/seedream-4.5 | +| `N` | `*int64` | :heavy_minus_sign: | Number of images to generate (1-10). Providers that only support single-image generation reject n > 1. | 1 | +| `OutputCompression` | `*int64` | :heavy_minus_sign: | Compression level (0-100) for webp/jpeg output. Ignored for png and by providers without a compression knob. | 100 | +| `OutputFormat` | [*components.ImageGenerationRequestOutputFormat](../../models/components/imagegenerationrequestoutputformat.md) | :heavy_minus_sign: | Encoding of the returned image bytes. | png | +| `Prompt` | `string` | :heavy_check_mark: | Text description of the desired image | a red panda astronaut floating in space, studio lighting | +| `Provider` | [*components.ImageGenerationRequestProvider](../../models/components/imagegenerationrequestprovider.md) | :heavy_minus_sign: | Provider-specific passthrough configuration | | +| `Quality` | [*components.ImageGenerationRequestQuality](../../models/components/imagegenerationrequestquality.md) | :heavy_minus_sign: | Rendering quality. Providers without a quality knob ignore this. | high | +| `Resolution` | [*components.ImageGenerationRequestResolution](../../models/components/imagegenerationrequestresolution.md) | :heavy_minus_sign: | Normalized resolution tier of the generated image. Concrete pixel dimensions are derived per-provider. | 2K | +| `Seed` | `*int64` | :heavy_minus_sign: | If specified, the generation will sample deterministically, such that repeated requests with the same seed and parameters should return the same result. Determinism is not guaranteed for all providers. | | +| `Size` | `*string` | :heavy_minus_sign: | Optional. A convenience shorthand for output dimensions — pass a tier ("2K", "4K") or explicit pixels ("2048x2048") and we normalize it to the right dimensions for the chosen provider. Interchangeable with resolution + aspect_ratio; use those directly for enumerated, per-model discoverable values. Conflicting size + resolution/aspect_ratio is rejected. | 2K | +| `Stream` | `*bool` | :heavy_minus_sign: | If true, partial images are streamed as SSE events as they become available. Only supported by providers with native streaming (currently OpenAI). Non-streaming providers ignore this flag and return a buffered response. | | \ No newline at end of file diff --git a/docs/models/components/imagegenerationrequestaspectratio.md b/docs/models/components/imagegenerationrequestaspectratio.md new file mode 100644 index 00000000..a1b30d02 --- /dev/null +++ b/docs/models/components/imagegenerationrequestaspectratio.md @@ -0,0 +1,44 @@ +# ImageGenerationRequestAspectRatio + +Normalized aspect ratio of the generated image. Providers clamp to their supported subset. + +## Example Usage + +```go +import ( + "github.com/OpenRouterTeam/go-sdk/models/components" +) + +value := components.ImageGenerationRequestAspectRatioEleven + +// Open enum: custom values can be created with a direct type cast +custom := components.ImageGenerationRequestAspectRatio("custom_value") +``` + + +## Values + +| Name | Value | +| ------------------------------------------------------------- | ------------------------------------------------------------- | +| `ImageGenerationRequestAspectRatioEleven` | 1:1 | +| `ImageGenerationRequestAspectRatioTwelve` | 1:2 | +| `ImageGenerationRequestAspectRatioFourteen` | 1:4 | +| `ImageGenerationRequestAspectRatioEighteen` | 1:8 | +| `ImageGenerationRequestAspectRatioTwentyOne` | 2:1 | +| `ImageGenerationRequestAspectRatioTwentyThree` | 2:3 | +| `ImageGenerationRequestAspectRatioThirtyTwo` | 3:2 | +| `ImageGenerationRequestAspectRatioThirtyFour` | 3:4 | +| `ImageGenerationRequestAspectRatioFortyOne` | 4:1 | +| `ImageGenerationRequestAspectRatioFortyThree` | 4:3 | +| `ImageGenerationRequestAspectRatioFortyFive` | 4:5 | +| `ImageGenerationRequestAspectRatioFiftyFour` | 5:4 | +| `ImageGenerationRequestAspectRatioEightyOne` | 8:1 | +| `ImageGenerationRequestAspectRatioNineHundredAndSixteen` | 9:16 | +| `ImageGenerationRequestAspectRatioOneHundredAndSixtyNine` | 16:9 | +| `ImageGenerationRequestAspectRatioNineHundredAndNineteenDot5` | 9:19.5 | +| `ImageGenerationRequestAspectRatioNineteenDot59` | 19.5:9 | +| `ImageGenerationRequestAspectRatioNineHundredAndTwenty` | 9:20 | +| `ImageGenerationRequestAspectRatioTwoHundredAndNine` | 20:9 | +| `ImageGenerationRequestAspectRatioNineHundredAndTwentyOne` | 9:21 | +| `ImageGenerationRequestAspectRatioTwoHundredAndNineteen` | 21:9 | +| `ImageGenerationRequestAspectRatioAuto` | auto | \ No newline at end of file diff --git a/docs/models/components/imagegenerationrequestbackground.md b/docs/models/components/imagegenerationrequestbackground.md new file mode 100644 index 00000000..069a10e9 --- /dev/null +++ b/docs/models/components/imagegenerationrequestbackground.md @@ -0,0 +1,25 @@ +# ImageGenerationRequestBackground + +Background treatment. `transparent` requires an output_format that supports alpha (png or webp). + +## Example Usage + +```go +import ( + "github.com/OpenRouterTeam/go-sdk/models/components" +) + +value := components.ImageGenerationRequestBackgroundAuto + +// Open enum: custom values can be created with a direct type cast +custom := components.ImageGenerationRequestBackground("custom_value") +``` + + +## Values + +| Name | Value | +| --------------------------------------------- | --------------------------------------------- | +| `ImageGenerationRequestBackgroundAuto` | auto | +| `ImageGenerationRequestBackgroundTransparent` | transparent | +| `ImageGenerationRequestBackgroundOpaque` | opaque | \ No newline at end of file diff --git a/docs/models/components/optionsobj.md b/docs/models/components/imagegenerationrequestoptions.md similarity index 97% rename from docs/models/components/optionsobj.md rename to docs/models/components/imagegenerationrequestoptions.md index 685624c6..28b0684d 100644 --- a/docs/models/components/optionsobj.md +++ b/docs/models/components/imagegenerationrequestoptions.md @@ -1,6 +1,6 @@ -# OptionsObj +# ImageGenerationRequestOptions -Provider-specific options keyed by provider slug. The options for the matched provider are spread into the upstream request body. +Provider-specific options keyed by provider slug. Only options for the matched provider are forwarded; the rest are ignored. Unrecognized keys are silently dropped. ## Fields @@ -112,6 +112,7 @@ Provider-specific options keyed by provider slug. The options for the matched pr | `Streamlake` | map[string]`any` | :heavy_minus_sign: | N/A | | `Switchpoint` | map[string]`any` | :heavy_minus_sign: | N/A | | `Targon` | map[string]`any` | :heavy_minus_sign: | N/A | +| `Tenstorrent` | map[string]`any` | :heavy_minus_sign: | N/A | | `Together` | map[string]`any` | :heavy_minus_sign: | N/A | | `TogetherLite` | map[string]`any` | :heavy_minus_sign: | N/A | | `Ubicloud` | map[string]`any` | :heavy_minus_sign: | N/A | diff --git a/docs/models/components/imagegenerationrequestoutputformat.md b/docs/models/components/imagegenerationrequestoutputformat.md new file mode 100644 index 00000000..d36b022a --- /dev/null +++ b/docs/models/components/imagegenerationrequestoutputformat.md @@ -0,0 +1,25 @@ +# ImageGenerationRequestOutputFormat + +Encoding of the returned image bytes. + +## Example Usage + +```go +import ( + "github.com/OpenRouterTeam/go-sdk/models/components" +) + +value := components.ImageGenerationRequestOutputFormatPng + +// Open enum: custom values can be created with a direct type cast +custom := components.ImageGenerationRequestOutputFormat("custom_value") +``` + + +## Values + +| Name | Value | +| ---------------------------------------- | ---------------------------------------- | +| `ImageGenerationRequestOutputFormatPng` | png | +| `ImageGenerationRequestOutputFormatJpeg` | jpeg | +| `ImageGenerationRequestOutputFormatWebp` | webp | \ No newline at end of file diff --git a/docs/models/components/imagegenerationrequestprovider.md b/docs/models/components/imagegenerationrequestprovider.md new file mode 100644 index 00000000..71ab16ab --- /dev/null +++ b/docs/models/components/imagegenerationrequestprovider.md @@ -0,0 +1,10 @@ +# ImageGenerationRequestProvider + +Provider-specific passthrough configuration + + +## Fields + +| Field | Type | Required | Description | Example | +| ----------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------- | +| `Options` | [*components.ImageGenerationRequestOptions](../../models/components/imagegenerationrequestoptions.md) | :heavy_minus_sign: | N/A | {
"black-forest-labs": {
"guidance": 3,
"steps": 40
}
} | \ No newline at end of file diff --git a/docs/models/components/imagegenerationrequestquality.md b/docs/models/components/imagegenerationrequestquality.md new file mode 100644 index 00000000..fceb8cd6 --- /dev/null +++ b/docs/models/components/imagegenerationrequestquality.md @@ -0,0 +1,26 @@ +# ImageGenerationRequestQuality + +Rendering quality. Providers without a quality knob ignore this. + +## Example Usage + +```go +import ( + "github.com/OpenRouterTeam/go-sdk/models/components" +) + +value := components.ImageGenerationRequestQualityAuto + +// Open enum: custom values can be created with a direct type cast +custom := components.ImageGenerationRequestQuality("custom_value") +``` + + +## Values + +| Name | Value | +| ------------------------------------- | ------------------------------------- | +| `ImageGenerationRequestQualityAuto` | auto | +| `ImageGenerationRequestQualityLow` | low | +| `ImageGenerationRequestQualityMedium` | medium | +| `ImageGenerationRequestQualityHigh` | high | \ No newline at end of file diff --git a/docs/models/components/imagegenerationrequestresolution.md b/docs/models/components/imagegenerationrequestresolution.md new file mode 100644 index 00000000..634f11d8 --- /dev/null +++ b/docs/models/components/imagegenerationrequestresolution.md @@ -0,0 +1,26 @@ +# ImageGenerationRequestResolution + +Normalized resolution tier of the generated image. Concrete pixel dimensions are derived per-provider. + +## Example Usage + +```go +import ( + "github.com/OpenRouterTeam/go-sdk/models/components" +) + +value := components.ImageGenerationRequestResolutionFiveHundredAndTwelve + +// Open enum: custom values can be created with a direct type cast +custom := components.ImageGenerationRequestResolution("custom_value") +``` + + +## Values + +| Name | Value | +| ------------------------------------------------------ | ------------------------------------------------------ | +| `ImageGenerationRequestResolutionFiveHundredAndTwelve` | 512 | +| `ImageGenerationRequestResolutionOneK` | 1K | +| `ImageGenerationRequestResolutionTwoK` | 2K | +| `ImageGenerationRequestResolutionFourK` | 4K | \ No newline at end of file diff --git a/docs/models/components/imagegenerationresponse.md b/docs/models/components/imagegenerationresponse.md new file mode 100644 index 00000000..0d64d0b0 --- /dev/null +++ b/docs/models/components/imagegenerationresponse.md @@ -0,0 +1,12 @@ +# ImageGenerationResponse + +Image generation response + + +## Fields + +| Field | Type | Required | Description | Example | +| -------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------- | +| `Created` | `int64` | :heavy_check_mark: | Unix timestamp (seconds) when the image was generated | 1748372400 | +| `Data` | [][components.ImageGenerationResponseData](../../models/components/imagegenerationresponsedata.md) | :heavy_check_mark: | Generated images | | +| `Usage` | [*components.ImageGenerationUsage](../../models/components/imagegenerationusage.md) | :heavy_minus_sign: | Token and cost usage for the image generation request, when available | {
"completion_tokens": 4175,
"cost": 0.04,
"prompt_tokens": 0,
"total_tokens": 4175
} | \ No newline at end of file diff --git a/docs/models/components/imagegenerationresponsedata.md b/docs/models/components/imagegenerationresponsedata.md new file mode 100644 index 00000000..31f60518 --- /dev/null +++ b/docs/models/components/imagegenerationresponsedata.md @@ -0,0 +1,8 @@ +# ImageGenerationResponseData + + +## Fields + +| Field | Type | Required | Description | +| -------------------------- | -------------------------- | -------------------------- | -------------------------- | +| `B64JSON` | `string` | :heavy_check_mark: | Base64-encoded image bytes | \ No newline at end of file diff --git a/docs/models/components/imagegenerationservertool.md b/docs/models/components/imagegenerationservertool.md index b75ef42f..c17ea25b 100644 --- a/docs/models/components/imagegenerationservertool.md +++ b/docs/models/components/imagegenerationservertool.md @@ -5,16 +5,16 @@ Image generation tool configuration ## Fields -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------- | -| `Background` | [*components.Background](../../models/components/background.md) | :heavy_minus_sign: | N/A | -| `InputFidelity` | optionalnullable.OptionalNullable[[components.InputFidelity](../../models/components/inputfidelity.md)] | :heavy_minus_sign: | N/A | -| `InputImageMask` | [*components.InputImageMask](../../models/components/inputimagemask.md) | :heavy_minus_sign: | N/A | -| `Model` | [*components.ModelEnum](../../models/components/modelenum.md) | :heavy_minus_sign: | N/A | -| `Moderation` | [*components.Moderation](../../models/components/moderation.md) | :heavy_minus_sign: | N/A | -| `OutputCompression` | `*int64` | :heavy_minus_sign: | N/A | -| `OutputFormat` | [*components.OutputFormat](../../models/components/outputformat.md) | :heavy_minus_sign: | N/A | -| `PartialImages` | `*int64` | :heavy_minus_sign: | N/A | -| `Quality` | [*components.Quality](../../models/components/quality.md) | :heavy_minus_sign: | N/A | -| `Size` | [*components.Size](../../models/components/size.md) | :heavy_minus_sign: | N/A | -| `Type` | [components.ImageGenerationServerToolType](../../models/components/imagegenerationservertooltype.md) | :heavy_check_mark: | N/A | \ No newline at end of file +| Field | Type | Required | Description | +| --------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------- | +| `Background` | [*components.ImageGenerationServerToolBackground](../../models/components/imagegenerationservertoolbackground.md) | :heavy_minus_sign: | N/A | +| `InputFidelity` | optionalnullable.OptionalNullable[[components.InputFidelity](../../models/components/inputfidelity.md)] | :heavy_minus_sign: | N/A | +| `InputImageMask` | [*components.InputImageMask](../../models/components/inputimagemask.md) | :heavy_minus_sign: | N/A | +| `Model` | [*components.ModelEnum](../../models/components/modelenum.md) | :heavy_minus_sign: | N/A | +| `Moderation` | [*components.Moderation](../../models/components/moderation.md) | :heavy_minus_sign: | N/A | +| `OutputCompression` | `*int64` | :heavy_minus_sign: | N/A | +| `OutputFormat` | [*components.ImageGenerationServerToolOutputFormat](../../models/components/imagegenerationservertooloutputformat.md) | :heavy_minus_sign: | N/A | +| `PartialImages` | `*int64` | :heavy_minus_sign: | N/A | +| `Quality` | [*components.ImageGenerationServerToolQuality](../../models/components/imagegenerationservertoolquality.md) | :heavy_minus_sign: | N/A | +| `Size` | [*components.Size](../../models/components/size.md) | :heavy_minus_sign: | N/A | +| `Type` | [components.ImageGenerationServerToolType](../../models/components/imagegenerationservertooltype.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/components/imagegenerationservertoolbackground.md b/docs/models/components/imagegenerationservertoolbackground.md new file mode 100644 index 00000000..7e167083 --- /dev/null +++ b/docs/models/components/imagegenerationservertoolbackground.md @@ -0,0 +1,23 @@ +# ImageGenerationServerToolBackground + +## Example Usage + +```go +import ( + "github.com/OpenRouterTeam/go-sdk/models/components" +) + +value := components.ImageGenerationServerToolBackgroundTransparent + +// Open enum: custom values can be created with a direct type cast +custom := components.ImageGenerationServerToolBackground("custom_value") +``` + + +## Values + +| Name | Value | +| ------------------------------------------------ | ------------------------------------------------ | +| `ImageGenerationServerToolBackgroundTransparent` | transparent | +| `ImageGenerationServerToolBackgroundOpaque` | opaque | +| `ImageGenerationServerToolBackgroundAuto` | auto | \ No newline at end of file diff --git a/docs/models/components/imagegenerationservertooloutputformat.md b/docs/models/components/imagegenerationservertooloutputformat.md new file mode 100644 index 00000000..08ba388e --- /dev/null +++ b/docs/models/components/imagegenerationservertooloutputformat.md @@ -0,0 +1,23 @@ +# ImageGenerationServerToolOutputFormat + +## Example Usage + +```go +import ( + "github.com/OpenRouterTeam/go-sdk/models/components" +) + +value := components.ImageGenerationServerToolOutputFormatPng + +// Open enum: custom values can be created with a direct type cast +custom := components.ImageGenerationServerToolOutputFormat("custom_value") +``` + + +## Values + +| Name | Value | +| ------------------------------------------- | ------------------------------------------- | +| `ImageGenerationServerToolOutputFormatPng` | png | +| `ImageGenerationServerToolOutputFormatWebp` | webp | +| `ImageGenerationServerToolOutputFormatJpeg` | jpeg | \ No newline at end of file diff --git a/docs/models/components/imagegenerationservertoolquality.md b/docs/models/components/imagegenerationservertoolquality.md new file mode 100644 index 00000000..9b164c10 --- /dev/null +++ b/docs/models/components/imagegenerationservertoolquality.md @@ -0,0 +1,24 @@ +# ImageGenerationServerToolQuality + +## Example Usage + +```go +import ( + "github.com/OpenRouterTeam/go-sdk/models/components" +) + +value := components.ImageGenerationServerToolQualityLow + +// Open enum: custom values can be created with a direct type cast +custom := components.ImageGenerationServerToolQuality("custom_value") +``` + + +## Values + +| Name | Value | +| ---------------------------------------- | ---------------------------------------- | +| `ImageGenerationServerToolQualityLow` | low | +| `ImageGenerationServerToolQualityMedium` | medium | +| `ImageGenerationServerToolQualityHigh` | high | +| `ImageGenerationServerToolQualityAuto` | auto | \ No newline at end of file diff --git a/docs/models/components/imagegenerationusage.md b/docs/models/components/imagegenerationusage.md new file mode 100644 index 00000000..e75f1b13 --- /dev/null +++ b/docs/models/components/imagegenerationusage.md @@ -0,0 +1,21 @@ +# ImageGenerationUsage + +Token and cost usage for the image generation request, when available + + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `CompletionTokens` | `int64` | :heavy_check_mark: | The tokens generated | | +| `CompletionTokensDetails` | optionalnullable.OptionalNullable[[components.ImageGenerationUsageCompletionTokensDetails](../../models/components/imagegenerationusagecompletiontokensdetails.md)] | :heavy_minus_sign: | N/A | | +| `Cost` | optionalnullable.OptionalNullable[`float64`] | :heavy_minus_sign: | Cost of the completion | | +| `CostDetails` | optionalnullable.OptionalNullable[[components.CostDetails](../../models/components/costdetails.md)] | :heavy_minus_sign: | Breakdown of upstream inference costs | {
"upstream_inference_completions_cost": 0.0004,
"upstream_inference_cost": null,
"upstream_inference_prompt_cost": 0.0008
} | +| `IsByok` | `*bool` | :heavy_minus_sign: | Whether a request was made using a Bring Your Own Key configuration | | +| `Iterations` | optionalnullable.OptionalNullable[[][components.AnthropicUsageIteration](../../models/components/anthropicusageiteration.md)] | :heavy_minus_sign: | N/A | | +| `PromptTokens` | `int64` | :heavy_check_mark: | Including images, input audio, and tools if any | | +| `PromptTokensDetails` | optionalnullable.OptionalNullable[[components.ImageGenerationUsagePromptTokensDetails](../../models/components/imagegenerationusageprompttokensdetails.md)] | :heavy_minus_sign: | Breakdown of tokens used in the prompt. | | +| `ServerToolUse` | optionalnullable.OptionalNullable[[components.ServerToolUse](../../models/components/servertooluse.md)] | :heavy_minus_sign: | Usage for server-side tool execution (e.g., web search) | | +| `ServiceTier` | optionalnullable.OptionalNullable[`string`] | :heavy_minus_sign: | The service tier used by the upstream provider for this request | | +| `Speed` | optionalnullable.OptionalNullable[[components.AnthropicSpeed](../../models/components/anthropicspeed.md)] | :heavy_minus_sign: | N/A | standard | +| `TotalTokens` | `int64` | :heavy_check_mark: | Sum of the above two fields | | \ No newline at end of file diff --git a/docs/models/components/imagegenerationusagecompletiontokensdetails.md b/docs/models/components/imagegenerationusagecompletiontokensdetails.md new file mode 100644 index 00000000..5b728d9a --- /dev/null +++ b/docs/models/components/imagegenerationusagecompletiontokensdetails.md @@ -0,0 +1,10 @@ +# ImageGenerationUsageCompletionTokensDetails + + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------- | ----------------------------------------------- | ----------------------------------------------- | ----------------------------------------------- | +| `AudioTokens` | optionalnullable.OptionalNullable[`int64`] | :heavy_minus_sign: | Tokens generated by the model for audio output. | +| `ImageTokens` | optionalnullable.OptionalNullable[`int64`] | :heavy_minus_sign: | Tokens generated by the model for image output. | +| `ReasoningTokens` | optionalnullable.OptionalNullable[`int64`] | :heavy_minus_sign: | Tokens generated by the model for reasoning. | \ No newline at end of file diff --git a/docs/models/components/imagegenerationusageprompttokensdetails.md b/docs/models/components/imagegenerationusageprompttokensdetails.md new file mode 100644 index 00000000..4c772fd1 --- /dev/null +++ b/docs/models/components/imagegenerationusageprompttokensdetails.md @@ -0,0 +1,14 @@ +# ImageGenerationUsagePromptTokensDetails + +Breakdown of tokens used in the prompt. + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------ | +| `AudioTokens` | optionalnullable.OptionalNullable[`int64`] | :heavy_minus_sign: | Tokens used for input audio. | +| `CacheWriteTokens` | optionalnullable.OptionalNullable[`int64`] | :heavy_minus_sign: | Tokens written to cache. Only returned for models with explicit caching and cache write pricing. | +| `CachedTokens` | optionalnullable.OptionalNullable[`int64`] | :heavy_minus_sign: | Tokens cached by the endpoint. | +| `FileTokens` | optionalnullable.OptionalNullable[`int64`] | :heavy_minus_sign: | Tokens used for input files/documents. | +| `VideoTokens` | optionalnullable.OptionalNullable[`int64`] | :heavy_minus_sign: | Tokens used for input video. | \ No newline at end of file diff --git a/docs/models/components/imagegenpartialimageevent.md b/docs/models/components/imagegenpartialimageevent.md new file mode 100644 index 00000000..7e64544f --- /dev/null +++ b/docs/models/components/imagegenpartialimageevent.md @@ -0,0 +1,12 @@ +# ImageGenPartialImageEvent + +Emitted when a partial image becomes available during streaming generation + + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------- | +| `B64JSON` | `string` | :heavy_check_mark: | Base64-encoded partial image data | +| `PartialImageIndex` | `int64` | :heavy_check_mark: | 0-based index indicating which partial image this is in the sequence | +| `Type` | [components.ImageGenPartialImageEventType](../../models/components/imagegenpartialimageeventtype.md) | :heavy_check_mark: | The event type | \ No newline at end of file diff --git a/docs/models/components/imagegenpartialimageeventtype.md b/docs/models/components/imagegenpartialimageeventtype.md new file mode 100644 index 00000000..159b2575 --- /dev/null +++ b/docs/models/components/imagegenpartialimageeventtype.md @@ -0,0 +1,20 @@ +# ImageGenPartialImageEventType + +The event type + +## Example Usage + +```go +import ( + "github.com/OpenRouterTeam/go-sdk/models/components" +) + +value := components.ImageGenPartialImageEventTypeImageGenerationPartialImage +``` + + +## Values + +| Name | Value | +| ---------------------------------------------------------- | ---------------------------------------------------------- | +| `ImageGenPartialImageEventTypeImageGenerationPartialImage` | image_generation.partial_image | \ No newline at end of file diff --git a/docs/models/components/imagegenstreamerrorevent.md b/docs/models/components/imagegenstreamerrorevent.md new file mode 100644 index 00000000..cd7fa4f1 --- /dev/null +++ b/docs/models/components/imagegenstreamerrorevent.md @@ -0,0 +1,11 @@ +# ImageGenStreamErrorEvent + +Emitted when streaming generation fails after the SSE response starts + + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------- | +| `Error` | [components.ImageGenStreamErrorEventError](../../models/components/imagegenstreamerroreventerror.md) | :heavy_check_mark: | Provider error details | +| `Type` | [components.ImageGenStreamErrorEventType](../../models/components/imagegenstreamerroreventtype.md) | :heavy_check_mark: | The event type | \ No newline at end of file diff --git a/docs/models/components/imagegenstreamerroreventerror.md b/docs/models/components/imagegenstreamerroreventerror.md new file mode 100644 index 00000000..f02b9b30 --- /dev/null +++ b/docs/models/components/imagegenstreamerroreventerror.md @@ -0,0 +1,13 @@ +# ImageGenStreamErrorEventError + +Provider error details + + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------------------------- | ---------------------------------------------------------- | ---------------------------------------------------------- | ---------------------------------------------------------- | +| `Code` | optionalnullable.OptionalNullable[`string`] | :heavy_minus_sign: | Provider error code, when supplied | +| `Message` | `string` | :heavy_check_mark: | Provider error message | +| `Param` | optionalnullable.OptionalNullable[`string`] | :heavy_minus_sign: | Request parameter associated with the error, when supplied | +| `Type` | optionalnullable.OptionalNullable[`string`] | :heavy_minus_sign: | Provider error type, when supplied | \ No newline at end of file diff --git a/docs/models/components/benchmarksdametasource.md b/docs/models/components/imagegenstreamerroreventtype.md similarity index 62% rename from docs/models/components/benchmarksdametasource.md rename to docs/models/components/imagegenstreamerroreventtype.md index d6109f39..d587b39f 100644 --- a/docs/models/components/benchmarksdametasource.md +++ b/docs/models/components/imagegenstreamerroreventtype.md @@ -1,6 +1,6 @@ -# BenchmarksDAMetaSource +# ImageGenStreamErrorEventType -Data source identifier. +The event type ## Example Usage @@ -9,7 +9,7 @@ import ( "github.com/OpenRouterTeam/go-sdk/models/components" ) -value := components.BenchmarksDAMetaSourceDesignArena +value := components.ImageGenStreamErrorEventTypeError ``` @@ -17,4 +17,4 @@ value := components.BenchmarksDAMetaSourceDesignArena | Name | Value | | ----------------------------------- | ----------------------------------- | -| `BenchmarksDAMetaSourceDesignArena` | design-arena | \ No newline at end of file +| `ImageGenStreamErrorEventTypeError` | error | \ No newline at end of file diff --git a/docs/models/components/imagemodelarchitecture.md b/docs/models/components/imagemodelarchitecture.md new file mode 100644 index 00000000..b8fdb2e0 --- /dev/null +++ b/docs/models/components/imagemodelarchitecture.md @@ -0,0 +1,9 @@ +# ImageModelArchitecture + + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | +| `InputModalities` | [][components.InputModality](../../models/components/inputmodality.md) | :heavy_check_mark: | Supported input modalities | +| `OutputModalities` | [][components.ImageOutputModality](../../models/components/imageoutputmodality.md) | :heavy_check_mark: | Supported output modalities | \ No newline at end of file diff --git a/docs/models/components/imagemodelendpointsresponse.md b/docs/models/components/imagemodelendpointsresponse.md new file mode 100644 index 00000000..2d605273 --- /dev/null +++ b/docs/models/components/imagemodelendpointsresponse.md @@ -0,0 +1,11 @@ +# ImageModelEndpointsResponse + +The full per-endpoint records for an image model. + + +## Fields + +| Field | Type | Required | Description | Example | +| ---------------------------------------------------------------------- | ---------------------------------------------------------------------- | ---------------------------------------------------------------------- | ---------------------------------------------------------------------- | ---------------------------------------------------------------------- | +| `Endpoints` | [][components.ImageEndpoint](../../models/components/imageendpoint.md) | :heavy_check_mark: | N/A | | +| `ID` | `string` | :heavy_check_mark: | Model slug | bytedance-seed/seedream-4.5 | \ No newline at end of file diff --git a/docs/models/components/imagemodellistitem.md b/docs/models/components/imagemodellistitem.md new file mode 100644 index 00000000..f164a14b --- /dev/null +++ b/docs/models/components/imagemodellistitem.md @@ -0,0 +1,17 @@ +# ImageModelListItem + +A single image model in the discovery listing. + + +## Fields + +| Field | Type | Required | Description | Example | +| -------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `Architecture` | [components.ImageModelArchitecture](../../models/components/imagemodelarchitecture.md) | :heavy_check_mark: | N/A | {
"input_modalities": [
"text",
"image"
],
"output_modalities": [
"image"
]
} | +| `Created` | `int64` | :heavy_check_mark: | Unix timestamp (seconds) of when the model was created | 1692901234 | +| `Description` | `string` | :heavy_check_mark: | N/A | A text-to-image model. | +| `Endpoints` | `string` | :heavy_check_mark: | Relative URL to the full per-endpoint records for this model | /api/v1/images/models/bytedance-seed/seedream-4.5/endpoints | +| `ID` | `string` | :heavy_check_mark: | Model slug | bytedance-seed/seedream-4.5 | +| `Name` | `string` | :heavy_check_mark: | Display name | Seedream 4.5 | +| `SupportedParameters` | map[string][components.CapabilityDescriptor](../../models/components/capabilitydescriptor.md) | :heavy_check_mark: | Union of supported parameters across every endpoint of this model. Coarse discovery aid; the definitive per-endpoint set is behind the endpoints URL. | {
"output_compression": {
"max": 100,
"min": 0,
"type": "range"
},
"resolution": {
"type": "enum",
"values": [
"1K",
"2K",
"4K"
]
},
"seed": {
"type": "boolean"
}
} | +| `SupportsStreaming` | `bool` | :heavy_check_mark: | Whether any endpoint of this model supports native SSE streaming on the dedicated Image API (i.e. `stream: true` in the request). OR across endpoints. | false | \ No newline at end of file diff --git a/docs/models/components/imagemodelslistresponse.md b/docs/models/components/imagemodelslistresponse.md new file mode 100644 index 00000000..46dd9da1 --- /dev/null +++ b/docs/models/components/imagemodelslistresponse.md @@ -0,0 +1,10 @@ +# ImageModelsListResponse + +List of image generation models. + + +## Fields + +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- | +| `Data` | [][components.ImageModelListItem](../../models/components/imagemodellistitem.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/components/imageoutputmodality.md b/docs/models/components/imageoutputmodality.md new file mode 100644 index 00000000..76fdc2ce --- /dev/null +++ b/docs/models/components/imageoutputmodality.md @@ -0,0 +1,28 @@ +# ImageOutputModality + +## Example Usage + +```go +import ( + "github.com/OpenRouterTeam/go-sdk/models/components" +) + +value := components.ImageOutputModalityText + +// Open enum: custom values can be created with a direct type cast +custom := components.ImageOutputModality("custom_value") +``` + + +## Values + +| Name | Value | +| ---------------------------------- | ---------------------------------- | +| `ImageOutputModalityText` | text | +| `ImageOutputModalityImage` | image | +| `ImageOutputModalityEmbeddings` | embeddings | +| `ImageOutputModalityAudio` | audio | +| `ImageOutputModalityVideo` | video | +| `ImageOutputModalityRerank` | rerank | +| `ImageOutputModalitySpeech` | speech | +| `ImageOutputModalityTranscription` | transcription | \ No newline at end of file diff --git a/docs/models/components/imagepricingentry.md b/docs/models/components/imagepricingentry.md new file mode 100644 index 00000000..889ac659 --- /dev/null +++ b/docs/models/components/imagepricingentry.md @@ -0,0 +1,13 @@ +# ImagePricingEntry + +One billable pricing line for an image provider. + + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------------------------- | ---------------------------------------------------------- | ---------------------------------------------------------- | ---------------------------------------------------------- | +| `Billable` | [components.Billable](../../models/components/billable.md) | :heavy_check_mark: | N/A | +| `CostUsd` | `float64` | :heavy_check_mark: | N/A | +| `Unit` | [components.Unit](../../models/components/unit.md) | :heavy_check_mark: | N/A | +| `Variant` | `*string` | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/components/imagestreamingresponse.md b/docs/models/components/imagestreamingresponse.md new file mode 100644 index 00000000..22a2730e --- /dev/null +++ b/docs/models/components/imagestreamingresponse.md @@ -0,0 +1,8 @@ +# ImageStreamingResponse + + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------- | +| `Data` | [components.ImageStreamingResponseData](../../models/components/imagestreamingresponsedata.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/components/imagestreamingresponsedata.md b/docs/models/components/imagestreamingresponsedata.md new file mode 100644 index 00000000..edb06c5d --- /dev/null +++ b/docs/models/components/imagestreamingresponsedata.md @@ -0,0 +1,39 @@ +# ImageStreamingResponseData + + +## Supported Types + +### ImageGenPartialImageEvent + +```go +imageStreamingResponseData := components.CreateImageStreamingResponseDataImageGenerationPartialImage(components.ImageGenPartialImageEvent{/* values here */}) +``` + +### ImageGenCompletedEvent + +```go +imageStreamingResponseData := components.CreateImageStreamingResponseDataImageGenerationCompleted(components.ImageGenCompletedEvent{/* values here */}) +``` + +### ImageGenStreamErrorEvent + +```go +imageStreamingResponseData := components.CreateImageStreamingResponseDataError(components.ImageGenStreamErrorEvent{/* values here */}) +``` + +## Union Discrimination + +Use the `Type` field to determine which variant is active, then access the corresponding field: + +```go +switch imageStreamingResponseData.Type { + case components.ImageStreamingResponseDataTypeImageGenerationPartialImage: + // imageStreamingResponseData.ImageGenPartialImageEvent is populated + case components.ImageStreamingResponseDataTypeImageGenerationCompleted: + // imageStreamingResponseData.ImageGenCompletedEvent is populated + case components.ImageStreamingResponseDataTypeError: + // imageStreamingResponseData.ImageGenStreamErrorEvent is populated + default: + // Unknown type - use imageStreamingResponseData.GetUnknownRaw() for raw JSON +} +``` diff --git a/docs/models/components/inputsunion1.md b/docs/models/components/inputsunion1.md index 2b792574..bfdc8701 100644 --- a/docs/models/components/inputsunion1.md +++ b/docs/models/components/inputsunion1.md @@ -183,6 +183,12 @@ inputsUnion1 := components.CreateInputsUnion1OutputMcpServerToolItem(components. inputsUnion1 := components.CreateInputsUnion1OutputSearchModelsServerToolItem(components.OutputSearchModelsServerToolItem{/* values here */}) ``` +### OutputFusionServerToolItem + +```go +inputsUnion1 := components.CreateInputsUnion1OutputFusionServerToolItem(components.OutputFusionServerToolItem{/* values here */}) +``` + ### OutputAdvisorServerToolItem ```go @@ -333,6 +339,8 @@ switch inputsUnion1.Type { // inputsUnion1.OutputMcpServerToolItem is populated case components.InputsUnion1TypeOutputSearchModelsServerToolItem: // inputsUnion1.OutputSearchModelsServerToolItem is populated + case components.InputsUnion1TypeOutputFusionServerToolItem: + // inputsUnion1.OutputFusionServerToolItem is populated case components.InputsUnion1TypeOutputAdvisorServerToolItem: // inputsUnion1.OutputAdvisorServerToolItem is populated case components.InputsUnion1TypeOutputSubagentServerToolItem: diff --git a/docs/models/components/legacywebsearchservertool.md b/docs/models/components/legacywebsearchservertool.md index a6f140c0..7b47f066 100644 --- a/docs/models/components/legacywebsearchservertool.md +++ b/docs/models/components/legacywebsearchservertool.md @@ -9,7 +9,7 @@ Web search tool configuration | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `Engine` | [*components.WebSearchEngineEnum](../../models/components/websearchengineenum.md) | :heavy_minus_sign: | Which search engine to use. "auto" (default) uses native if the provider supports it, otherwise Exa. "native" forces the provider's built-in search. "exa" forces the Exa search API. "firecrawl" uses Firecrawl (requires BYOK). "parallel" uses the Parallel search API. "perplexity" uses the Perplexity Search API (raw ranked results). | auto | | `Filters` | optionalnullable.OptionalNullable[[components.WebSearchDomainFilter](../../models/components/websearchdomainfilter.md)] | :heavy_minus_sign: | N/A | {
"allowed_domains": [
"example.com"
],
"excluded_domains": [
"spam.com"
]
} | -| `MaxResults` | `*int64` | :heavy_minus_sign: | Maximum number of search results to return per search call. Defaults to 5. Applies to Exa, Firecrawl, Parallel, and Perplexity engines; ignored with native provider search. | 5 | +| `MaxResults` | `*int64` | :heavy_minus_sign: | Maximum number of search results to return per search call. Defaults to 5. Applies to Exa, Firecrawl, Parallel, and Perplexity engines; ignored with native provider search. Perplexity supports a maximum of 20; values above 20 are clamped. | 5 | | `SearchContextSize` | [*components.SearchContextSizeEnum](../../models/components/searchcontextsizeenum.md) | :heavy_minus_sign: | Size of the search context for web search tools | medium | | `Type` | [components.LegacyWebSearchServerToolType](../../models/components/legacywebsearchservertooltype.md) | :heavy_check_mark: | N/A | | | `UserLocation` | optionalnullable.OptionalNullable[[components.WebSearchUserLocation](../../models/components/websearchuserlocation.md)] | :heavy_minus_sign: | User location information for web search | {
"city": "San Francisco",
"country": "USA",
"region": "California",
"timezone": "America/Los_Angeles",
"type": "approximate"
} | \ No newline at end of file diff --git a/docs/models/components/listworkspacebudgetsresponse.md b/docs/models/components/listworkspacebudgetsresponse.md new file mode 100644 index 00000000..20d96d7e --- /dev/null +++ b/docs/models/components/listworkspacebudgetsresponse.md @@ -0,0 +1,8 @@ +# ListWorkspaceBudgetsResponse + + +## Fields + +| Field | Type | Required | Description | +| -------------------------------------------------------------------------- | -------------------------------------------------------------------------- | -------------------------------------------------------------------------- | -------------------------------------------------------------------------- | +| `Data` | [][components.WorkspaceBudget](../../models/components/workspacebudget.md) | :heavy_check_mark: | List of budgets configured for the workspace | \ No newline at end of file diff --git a/docs/models/components/messagesrequest.md b/docs/models/components/messagesrequest.md index 7b6fd798..0ebe164f 100644 --- a/docs/models/components/messagesrequest.md +++ b/docs/models/components/messagesrequest.md @@ -12,7 +12,7 @@ Request schema for Anthropic Messages API endpoint | `Fallbacks` | optionalnullable.OptionalNullable[[][components.MessagesFallbackParam](../../models/components/messagesfallbackparam.md)] | :heavy_minus_sign: | Fallback models to try if the primary model fails or refuses, in order. Handled by OpenRouter multi-model routing rather than Anthropic server-side fallbacks; cannot be combined with `models`. Each entry accepts only `model`. Maximum of 3 entries. | [
{
"model": "claude-opus-4-8"
}
] | | `MaxTokens` | `*int64` | :heavy_minus_sign: | N/A | | | `Messages` | [][components.MessagesMessageParam](../../models/components/messagesmessageparam.md) | :heavy_check_mark: | N/A | | -| `Metadata` | [*components.Metadata](../../models/components/metadata.md) | :heavy_minus_sign: | N/A | | +| `Metadata` | [*components.MessagesRequestMetadata](../../models/components/messagesrequestmetadata.md) | :heavy_minus_sign: | N/A | | | `Model` | `string` | :heavy_check_mark: | N/A | | | `Models` | []`string` | :heavy_minus_sign: | N/A | | | `OutputConfig` | [*components.MessagesOutputConfig](../../models/components/messagesoutputconfig.md) | :heavy_minus_sign: | Configuration for controlling output behavior. Supports the effort parameter and structured output format. | {
"effort": "medium"
} | diff --git a/docs/models/components/metadata.md b/docs/models/components/messagesrequestmetadata.md similarity index 95% rename from docs/models/components/metadata.md rename to docs/models/components/messagesrequestmetadata.md index abeea6e4..e4db147a 100644 --- a/docs/models/components/metadata.md +++ b/docs/models/components/messagesrequestmetadata.md @@ -1,4 +1,4 @@ -# Metadata +# MessagesRequestMetadata ## Fields diff --git a/docs/models/components/model.md b/docs/models/components/model.md index 972e5229..f9f5bda7 100644 --- a/docs/models/components/model.md +++ b/docs/models/components/model.md @@ -22,6 +22,7 @@ Information about an AI model available on OpenRouter | `Name` | `string` | :heavy_check_mark: | Display name of the model | GPT-4 | | `PerRequestLimits` | [*components.PerRequestLimits](../../models/components/perrequestlimits.md) | :heavy_check_mark: | Per-request token limits | {
"completion_tokens": 1000,
"prompt_tokens": 1000
} | | `Pricing` | [components.PublicPricing](../../models/components/publicpricing.md) | :heavy_check_mark: | Pricing information for the model | {
"completion": "0.00006",
"image": "0",
"prompt": "0.00003",
"request": "0"
} | +| `Reasoning` | [*components.ModelReasoning](../../models/components/modelreasoning.md) | :heavy_minus_sign: | Reasoning effort configuration. Omitted for non-reasoning models and dynamic router models. | {
"default_effort": "medium",
"default_enabled": true,
"mandatory": false,
"supported_efforts": [
"high",
"medium",
"low",
"minimal"
]
} | | `SupportedParameters` | [][components.Parameter](../../models/components/parameter.md) | :heavy_check_mark: | List of supported parameters for this model | | -| `SupportedVoices` | []`string` | :heavy_check_mark: | List of supported voice identifiers for TTS models. Null for non-TTS models. | null | +| `SupportedVoices` | []`string` | :heavy_check_mark: | List of supported voice identifiers for TTS models. Null for non-TTS models. | | | `TopProvider` | [components.TopProviderInfo](../../models/components/topproviderinfo.md) | :heavy_check_mark: | Information about the top provider for this model | {
"context_length": 8192,
"is_moderated": true,
"max_completion_tokens": 4096
} | \ No newline at end of file diff --git a/docs/models/components/modelreasoning.md b/docs/models/components/modelreasoning.md new file mode 100644 index 00000000..ec778f08 --- /dev/null +++ b/docs/models/components/modelreasoning.md @@ -0,0 +1,14 @@ +# ModelReasoning + +Reasoning effort configuration. Omitted for non-reasoning models and dynamic router models. + + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `DefaultEffort` | optionalnullable.OptionalNullable[[components.DefaultEffort](../../models/components/defaulteffort.md)] | :heavy_minus_sign: | N/A | medium | +| `DefaultEnabled` | `*bool` | :heavy_minus_sign: | Default reasoning enabled state when the client does not set `reasoning.enabled`. | | +| `Mandatory` | `bool` | :heavy_check_mark: | When true, reasoning cannot be disabled and effort "none" is rejected. | | +| `SupportedEfforts` | optionalnullable.OptionalNullable[[][*components.ReasoningEffort](../../models/components/reasoningeffort.md)] | :heavy_minus_sign: | Allowed reasoning effort values for this model, in descending effort order (highest first). Null means no allowlist — all gateway effort values are accepted. | | +| `SupportsMaxTokens` | `*bool` | :heavy_minus_sign: | Present and `true` when the model accepts `reasoning.max_tokens` in requests (Anthropic-style) instead of or in addition to `reasoning.effort`. Omitted otherwise. | | \ No newline at end of file diff --git a/docs/models/components/modelresponse.md b/docs/models/components/modelresponse.md index 81933622..21c232d8 100644 --- a/docs/models/components/modelresponse.md +++ b/docs/models/components/modelresponse.md @@ -5,6 +5,6 @@ Single model response ## Fields -| Field | Type | Required | Description | Example | -| -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `Data` | [components.Model](../../models/components/model.md) | :heavy_check_mark: | Information about an AI model available on OpenRouter | {
"architecture": {
"input_modalities": [
"text"
],
"instruct_type": "chatml",
"modality": "text-\u003etext",
"output_modalities": [
"text"
],
"tokenizer": "GPT"
},
"canonical_slug": "openai/gpt-4",
"context_length": 8192,
"created": 1692901234,
"default_parameters": null,
"description": "GPT-4 is a large multimodal model that can solve difficult problems with greater accuracy.",
"expiration_date": null,
"id": "openai/gpt-4",
"knowledge_cutoff": null,
"links": {
"details": "/api/v1/models/openai/gpt-5.4/endpoints"
},
"name": "GPT-4",
"per_request_limits": null,
"pricing": {
"completion": "0.00006",
"image": "0",
"prompt": "0.00003",
"request": "0"
},
"supported_parameters": [
"temperature",
"top_p",
"max_tokens"
],
"supported_voices": null,
"top_provider": {
"context_length": 8192,
"is_moderated": true,
"max_completion_tokens": 4096
}
} | \ No newline at end of file +| Field | Type | Required | Description | Example | +| --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `Data` | [components.Model](../../models/components/model.md) | :heavy_check_mark: | Information about an AI model available on OpenRouter | {
"architecture": {
"input_modalities": [
"text"
],
"instruct_type": "chatml",
"modality": "text-\u003etext",
"output_modalities": [
"text"
],
"tokenizer": "GPT"
},
"canonical_slug": "openai/gpt-4",
"context_length": 8192,
"created": 1692901234,
"default_parameters": null,
"description": "GPT-4 is a large multimodal model that can solve difficult problems with greater accuracy.",
"expiration_date": null,
"id": "openai/gpt-4",
"knowledge_cutoff": null,
"links": {
"details": "/api/v1/models/openai/gpt-5.4/endpoints"
},
"name": "GPT-4",
"per_request_limits": null,
"pricing": {
"completion": "0.00006",
"image": "0",
"prompt": "0.00003",
"request": "0"
},
"reasoning": {
"default_effort": "medium",
"default_enabled": true,
"mandatory": false,
"supported_efforts": [
"high",
"medium",
"low",
"minimal"
]
},
"supported_parameters": [
"temperature",
"top_p",
"max_tokens"
],
"supported_voices": null,
"top_provider": {
"context_length": 8192,
"is_moderated": true,
"max_completion_tokens": 4096
}
} | \ No newline at end of file diff --git a/docs/models/components/observabilityarizedestination.md b/docs/models/components/observabilityarizedestination.md index ab2a41a2..d6da45bc 100644 --- a/docs/models/components/observabilityarizedestination.md +++ b/docs/models/components/observabilityarizedestination.md @@ -5,11 +5,11 @@ | Field | Type | Required | Description | Example | | ---------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------- | -| `APIKeyHashes` | []`string` | :heavy_check_mark: | Optional allowlist of OpenRouter API key hashes (`api_keys.hash`) whose traffic is forwarded to this destination. `null` means all keys. | null | +| `APIKeyHashes` | []`string` | :heavy_check_mark: | Optional allowlist of OpenRouter API key hashes (`api_keys.hash`) whose traffic is forwarded to this destination. `null` means all keys. | | | `Config` | [components.ObservabilityArizeDestinationConfig](../../models/components/observabilityarizedestinationconfig.md) | :heavy_check_mark: | N/A | | | `CreatedAt` | `string` | :heavy_check_mark: | ISO timestamp of when the destination was created. | 2025-08-24T10:30:00Z | | `Enabled` | `bool` | :heavy_check_mark: | Whether this destination is currently enabled. | true | -| `FilterRules` | [*components.ObservabilityFilterRulesConfig](../../models/components/observabilityfilterrulesconfig.md) | :heavy_check_mark: | Optional structured filter rules controlling which events are forwarded. | null | +| `FilterRules` | [*components.ObservabilityFilterRulesConfig](../../models/components/observabilityfilterrulesconfig.md) | :heavy_check_mark: | Optional structured filter rules controlling which events are forwarded. | | | `ID` | `string` | :heavy_check_mark: | Stable public identifier for this destination. | 99999999-aaaa-bbbb-cccc-dddddddddddd | | `Name` | `*string` | :heavy_check_mark: | Human-readable name for the destination. | Production Langfuse | | `PrivacyMode` | `bool` | :heavy_check_mark: | When true, request/response bodies are not forwarded to this destination — only metadata. | false | diff --git a/docs/models/components/observabilityarizedestinationconfig.md b/docs/models/components/observabilityarizedestinationconfig.md index 27cf64ee..2930d805 100644 --- a/docs/models/components/observabilityarizedestinationconfig.md +++ b/docs/models/components/observabilityarizedestinationconfig.md @@ -8,5 +8,5 @@ | `APIKey` | `string` | :heavy_check_mark: | N/A | | `BaseURL` | `*string` | :heavy_minus_sign: | N/A | | `Headers` | map[string]`string` | :heavy_minus_sign: | Custom HTTP headers to include in requests to this destination. | -| `ModelID` | `string` | :heavy_check_mark: | N/A | +| `ModelID` | `string` | :heavy_check_mark: | The name of the tracing project in Arize AX | | `SpaceKey` | `string` | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/components/observabilitybraintrustdestination.md b/docs/models/components/observabilitybraintrustdestination.md index f094ce6f..b6635b0b 100644 --- a/docs/models/components/observabilitybraintrustdestination.md +++ b/docs/models/components/observabilitybraintrustdestination.md @@ -5,11 +5,11 @@ | Field | Type | Required | Description | Example | | ---------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------- | -| `APIKeyHashes` | []`string` | :heavy_check_mark: | Optional allowlist of OpenRouter API key hashes (`api_keys.hash`) whose traffic is forwarded to this destination. `null` means all keys. | null | +| `APIKeyHashes` | []`string` | :heavy_check_mark: | Optional allowlist of OpenRouter API key hashes (`api_keys.hash`) whose traffic is forwarded to this destination. `null` means all keys. | | | `Config` | [components.ObservabilityBraintrustDestinationConfig](../../models/components/observabilitybraintrustdestinationconfig.md) | :heavy_check_mark: | N/A | | | `CreatedAt` | `string` | :heavy_check_mark: | ISO timestamp of when the destination was created. | 2025-08-24T10:30:00Z | | `Enabled` | `bool` | :heavy_check_mark: | Whether this destination is currently enabled. | true | -| `FilterRules` | [*components.ObservabilityFilterRulesConfig](../../models/components/observabilityfilterrulesconfig.md) | :heavy_check_mark: | Optional structured filter rules controlling which events are forwarded. | null | +| `FilterRules` | [*components.ObservabilityFilterRulesConfig](../../models/components/observabilityfilterrulesconfig.md) | :heavy_check_mark: | Optional structured filter rules controlling which events are forwarded. | | | `ID` | `string` | :heavy_check_mark: | Stable public identifier for this destination. | 99999999-aaaa-bbbb-cccc-dddddddddddd | | `Name` | `*string` | :heavy_check_mark: | Human-readable name for the destination. | Production Langfuse | | `PrivacyMode` | `bool` | :heavy_check_mark: | When true, request/response bodies are not forwarded to this destination — only metadata. | false | diff --git a/docs/models/components/observabilityclickhousedestination.md b/docs/models/components/observabilityclickhousedestination.md index 734b530b..2f66279a 100644 --- a/docs/models/components/observabilityclickhousedestination.md +++ b/docs/models/components/observabilityclickhousedestination.md @@ -5,11 +5,11 @@ | Field | Type | Required | Description | Example | | ---------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------- | -| `APIKeyHashes` | []`string` | :heavy_check_mark: | Optional allowlist of OpenRouter API key hashes (`api_keys.hash`) whose traffic is forwarded to this destination. `null` means all keys. | null | +| `APIKeyHashes` | []`string` | :heavy_check_mark: | Optional allowlist of OpenRouter API key hashes (`api_keys.hash`) whose traffic is forwarded to this destination. `null` means all keys. | | | `Config` | [components.ObservabilityClickhouseDestinationConfig](../../models/components/observabilityclickhousedestinationconfig.md) | :heavy_check_mark: | N/A | | | `CreatedAt` | `string` | :heavy_check_mark: | ISO timestamp of when the destination was created. | 2025-08-24T10:30:00Z | | `Enabled` | `bool` | :heavy_check_mark: | Whether this destination is currently enabled. | true | -| `FilterRules` | [*components.ObservabilityFilterRulesConfig](../../models/components/observabilityfilterrulesconfig.md) | :heavy_check_mark: | Optional structured filter rules controlling which events are forwarded. | null | +| `FilterRules` | [*components.ObservabilityFilterRulesConfig](../../models/components/observabilityfilterrulesconfig.md) | :heavy_check_mark: | Optional structured filter rules controlling which events are forwarded. | | | `ID` | `string` | :heavy_check_mark: | Stable public identifier for this destination. | 99999999-aaaa-bbbb-cccc-dddddddddddd | | `Name` | `*string` | :heavy_check_mark: | Human-readable name for the destination. | Production Langfuse | | `PrivacyMode` | `bool` | :heavy_check_mark: | When true, request/response bodies are not forwarded to this destination — only metadata. | false | diff --git a/docs/models/components/observabilitydatadogdestination.md b/docs/models/components/observabilitydatadogdestination.md index 03ccf243..2d738fc2 100644 --- a/docs/models/components/observabilitydatadogdestination.md +++ b/docs/models/components/observabilitydatadogdestination.md @@ -5,11 +5,11 @@ | Field | Type | Required | Description | Example | | ---------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------- | -| `APIKeyHashes` | []`string` | :heavy_check_mark: | Optional allowlist of OpenRouter API key hashes (`api_keys.hash`) whose traffic is forwarded to this destination. `null` means all keys. | null | +| `APIKeyHashes` | []`string` | :heavy_check_mark: | Optional allowlist of OpenRouter API key hashes (`api_keys.hash`) whose traffic is forwarded to this destination. `null` means all keys. | | | `Config` | [components.ObservabilityDatadogDestinationConfig](../../models/components/observabilitydatadogdestinationconfig.md) | :heavy_check_mark: | N/A | | | `CreatedAt` | `string` | :heavy_check_mark: | ISO timestamp of when the destination was created. | 2025-08-24T10:30:00Z | | `Enabled` | `bool` | :heavy_check_mark: | Whether this destination is currently enabled. | true | -| `FilterRules` | [*components.ObservabilityFilterRulesConfig](../../models/components/observabilityfilterrulesconfig.md) | :heavy_check_mark: | Optional structured filter rules controlling which events are forwarded. | null | +| `FilterRules` | [*components.ObservabilityFilterRulesConfig](../../models/components/observabilityfilterrulesconfig.md) | :heavy_check_mark: | Optional structured filter rules controlling which events are forwarded. | | | `ID` | `string` | :heavy_check_mark: | Stable public identifier for this destination. | 99999999-aaaa-bbbb-cccc-dddddddddddd | | `Name` | `*string` | :heavy_check_mark: | Human-readable name for the destination. | Production Langfuse | | `PrivacyMode` | `bool` | :heavy_check_mark: | When true, request/response bodies are not forwarded to this destination — only metadata. | false | diff --git a/docs/models/components/observabilitygrafanadestination.md b/docs/models/components/observabilitygrafanadestination.md index 31bfc3ad..af342a11 100644 --- a/docs/models/components/observabilitygrafanadestination.md +++ b/docs/models/components/observabilitygrafanadestination.md @@ -5,11 +5,11 @@ | Field | Type | Required | Description | Example | | ---------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------- | -| `APIKeyHashes` | []`string` | :heavy_check_mark: | Optional allowlist of OpenRouter API key hashes (`api_keys.hash`) whose traffic is forwarded to this destination. `null` means all keys. | null | +| `APIKeyHashes` | []`string` | :heavy_check_mark: | Optional allowlist of OpenRouter API key hashes (`api_keys.hash`) whose traffic is forwarded to this destination. `null` means all keys. | | | `Config` | [components.ObservabilityGrafanaDestinationConfig](../../models/components/observabilitygrafanadestinationconfig.md) | :heavy_check_mark: | N/A | | | `CreatedAt` | `string` | :heavy_check_mark: | ISO timestamp of when the destination was created. | 2025-08-24T10:30:00Z | | `Enabled` | `bool` | :heavy_check_mark: | Whether this destination is currently enabled. | true | -| `FilterRules` | [*components.ObservabilityFilterRulesConfig](../../models/components/observabilityfilterrulesconfig.md) | :heavy_check_mark: | Optional structured filter rules controlling which events are forwarded. | null | +| `FilterRules` | [*components.ObservabilityFilterRulesConfig](../../models/components/observabilityfilterrulesconfig.md) | :heavy_check_mark: | Optional structured filter rules controlling which events are forwarded. | | | `ID` | `string` | :heavy_check_mark: | Stable public identifier for this destination. | 99999999-aaaa-bbbb-cccc-dddddddddddd | | `Name` | `*string` | :heavy_check_mark: | Human-readable name for the destination. | Production Langfuse | | `PrivacyMode` | `bool` | :heavy_check_mark: | When true, request/response bodies are not forwarded to this destination — only metadata. | false | diff --git a/docs/models/components/observabilitylangfusedestination.md b/docs/models/components/observabilitylangfusedestination.md index 7f43f6c7..c4863550 100644 --- a/docs/models/components/observabilitylangfusedestination.md +++ b/docs/models/components/observabilitylangfusedestination.md @@ -5,11 +5,11 @@ | Field | Type | Required | Description | Example | | ---------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------- | -| `APIKeyHashes` | []`string` | :heavy_check_mark: | Optional allowlist of OpenRouter API key hashes (`api_keys.hash`) whose traffic is forwarded to this destination. `null` means all keys. | null | +| `APIKeyHashes` | []`string` | :heavy_check_mark: | Optional allowlist of OpenRouter API key hashes (`api_keys.hash`) whose traffic is forwarded to this destination. `null` means all keys. | | | `Config` | [components.ObservabilityLangfuseDestinationConfig](../../models/components/observabilitylangfusedestinationconfig.md) | :heavy_check_mark: | N/A | | | `CreatedAt` | `string` | :heavy_check_mark: | ISO timestamp of when the destination was created. | 2025-08-24T10:30:00Z | | `Enabled` | `bool` | :heavy_check_mark: | Whether this destination is currently enabled. | true | -| `FilterRules` | [*components.ObservabilityFilterRulesConfig](../../models/components/observabilityfilterrulesconfig.md) | :heavy_check_mark: | Optional structured filter rules controlling which events are forwarded. | null | +| `FilterRules` | [*components.ObservabilityFilterRulesConfig](../../models/components/observabilityfilterrulesconfig.md) | :heavy_check_mark: | Optional structured filter rules controlling which events are forwarded. | | | `ID` | `string` | :heavy_check_mark: | Stable public identifier for this destination. | 99999999-aaaa-bbbb-cccc-dddddddddddd | | `Name` | `*string` | :heavy_check_mark: | Human-readable name for the destination. | Production Langfuse | | `PrivacyMode` | `bool` | :heavy_check_mark: | When true, request/response bodies are not forwarded to this destination — only metadata. | false | diff --git a/docs/models/components/observabilitylangsmithdestination.md b/docs/models/components/observabilitylangsmithdestination.md index a1c8b04d..b71aab73 100644 --- a/docs/models/components/observabilitylangsmithdestination.md +++ b/docs/models/components/observabilitylangsmithdestination.md @@ -5,11 +5,11 @@ | Field | Type | Required | Description | Example | | ---------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------- | -| `APIKeyHashes` | []`string` | :heavy_check_mark: | Optional allowlist of OpenRouter API key hashes (`api_keys.hash`) whose traffic is forwarded to this destination. `null` means all keys. | null | +| `APIKeyHashes` | []`string` | :heavy_check_mark: | Optional allowlist of OpenRouter API key hashes (`api_keys.hash`) whose traffic is forwarded to this destination. `null` means all keys. | | | `Config` | [components.ObservabilityLangsmithDestinationConfig](../../models/components/observabilitylangsmithdestinationconfig.md) | :heavy_check_mark: | N/A | | | `CreatedAt` | `string` | :heavy_check_mark: | ISO timestamp of when the destination was created. | 2025-08-24T10:30:00Z | | `Enabled` | `bool` | :heavy_check_mark: | Whether this destination is currently enabled. | true | -| `FilterRules` | [*components.ObservabilityFilterRulesConfig](../../models/components/observabilityfilterrulesconfig.md) | :heavy_check_mark: | Optional structured filter rules controlling which events are forwarded. | null | +| `FilterRules` | [*components.ObservabilityFilterRulesConfig](../../models/components/observabilityfilterrulesconfig.md) | :heavy_check_mark: | Optional structured filter rules controlling which events are forwarded. | | | `ID` | `string` | :heavy_check_mark: | Stable public identifier for this destination. | 99999999-aaaa-bbbb-cccc-dddddddddddd | | `Name` | `*string` | :heavy_check_mark: | Human-readable name for the destination. | Production Langfuse | | `PrivacyMode` | `bool` | :heavy_check_mark: | When true, request/response bodies are not forwarded to this destination — only metadata. | false | diff --git a/docs/models/components/observabilitynewrelicdestination.md b/docs/models/components/observabilitynewrelicdestination.md index d89136a3..f62dbe3b 100644 --- a/docs/models/components/observabilitynewrelicdestination.md +++ b/docs/models/components/observabilitynewrelicdestination.md @@ -5,11 +5,11 @@ | Field | Type | Required | Description | Example | | ---------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------- | -| `APIKeyHashes` | []`string` | :heavy_check_mark: | Optional allowlist of OpenRouter API key hashes (`api_keys.hash`) whose traffic is forwarded to this destination. `null` means all keys. | null | +| `APIKeyHashes` | []`string` | :heavy_check_mark: | Optional allowlist of OpenRouter API key hashes (`api_keys.hash`) whose traffic is forwarded to this destination. `null` means all keys. | | | `Config` | [components.ObservabilityNewrelicDestinationConfig](../../models/components/observabilitynewrelicdestinationconfig.md) | :heavy_check_mark: | N/A | | | `CreatedAt` | `string` | :heavy_check_mark: | ISO timestamp of when the destination was created. | 2025-08-24T10:30:00Z | | `Enabled` | `bool` | :heavy_check_mark: | Whether this destination is currently enabled. | true | -| `FilterRules` | [*components.ObservabilityFilterRulesConfig](../../models/components/observabilityfilterrulesconfig.md) | :heavy_check_mark: | Optional structured filter rules controlling which events are forwarded. | null | +| `FilterRules` | [*components.ObservabilityFilterRulesConfig](../../models/components/observabilityfilterrulesconfig.md) | :heavy_check_mark: | Optional structured filter rules controlling which events are forwarded. | | | `ID` | `string` | :heavy_check_mark: | Stable public identifier for this destination. | 99999999-aaaa-bbbb-cccc-dddddddddddd | | `Name` | `*string` | :heavy_check_mark: | Human-readable name for the destination. | Production Langfuse | | `PrivacyMode` | `bool` | :heavy_check_mark: | When true, request/response bodies are not forwarded to this destination — only metadata. | false | diff --git a/docs/models/components/observabilityopikdestination.md b/docs/models/components/observabilityopikdestination.md index 648ed936..450e25ff 100644 --- a/docs/models/components/observabilityopikdestination.md +++ b/docs/models/components/observabilityopikdestination.md @@ -5,11 +5,11 @@ | Field | Type | Required | Description | Example | | ---------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------- | -| `APIKeyHashes` | []`string` | :heavy_check_mark: | Optional allowlist of OpenRouter API key hashes (`api_keys.hash`) whose traffic is forwarded to this destination. `null` means all keys. | null | +| `APIKeyHashes` | []`string` | :heavy_check_mark: | Optional allowlist of OpenRouter API key hashes (`api_keys.hash`) whose traffic is forwarded to this destination. `null` means all keys. | | | `Config` | [components.ObservabilityOpikDestinationConfig](../../models/components/observabilityopikdestinationconfig.md) | :heavy_check_mark: | N/A | | | `CreatedAt` | `string` | :heavy_check_mark: | ISO timestamp of when the destination was created. | 2025-08-24T10:30:00Z | | `Enabled` | `bool` | :heavy_check_mark: | Whether this destination is currently enabled. | true | -| `FilterRules` | [*components.ObservabilityFilterRulesConfig](../../models/components/observabilityfilterrulesconfig.md) | :heavy_check_mark: | Optional structured filter rules controlling which events are forwarded. | null | +| `FilterRules` | [*components.ObservabilityFilterRulesConfig](../../models/components/observabilityfilterrulesconfig.md) | :heavy_check_mark: | Optional structured filter rules controlling which events are forwarded. | | | `ID` | `string` | :heavy_check_mark: | Stable public identifier for this destination. | 99999999-aaaa-bbbb-cccc-dddddddddddd | | `Name` | `*string` | :heavy_check_mark: | Human-readable name for the destination. | Production Langfuse | | `PrivacyMode` | `bool` | :heavy_check_mark: | When true, request/response bodies are not forwarded to this destination — only metadata. | false | diff --git a/docs/models/components/observabilityotelcollectordestination.md b/docs/models/components/observabilityotelcollectordestination.md index a36b3741..25239dc8 100644 --- a/docs/models/components/observabilityotelcollectordestination.md +++ b/docs/models/components/observabilityotelcollectordestination.md @@ -5,11 +5,11 @@ | Field | Type | Required | Description | Example | | ---------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------- | -| `APIKeyHashes` | []`string` | :heavy_check_mark: | Optional allowlist of OpenRouter API key hashes (`api_keys.hash`) whose traffic is forwarded to this destination. `null` means all keys. | null | +| `APIKeyHashes` | []`string` | :heavy_check_mark: | Optional allowlist of OpenRouter API key hashes (`api_keys.hash`) whose traffic is forwarded to this destination. `null` means all keys. | | | `Config` | [components.ObservabilityOtelCollectorDestinationConfig](../../models/components/observabilityotelcollectordestinationconfig.md) | :heavy_check_mark: | N/A | | | `CreatedAt` | `string` | :heavy_check_mark: | ISO timestamp of when the destination was created. | 2025-08-24T10:30:00Z | | `Enabled` | `bool` | :heavy_check_mark: | Whether this destination is currently enabled. | true | -| `FilterRules` | [*components.ObservabilityFilterRulesConfig](../../models/components/observabilityfilterrulesconfig.md) | :heavy_check_mark: | Optional structured filter rules controlling which events are forwarded. | null | +| `FilterRules` | [*components.ObservabilityFilterRulesConfig](../../models/components/observabilityfilterrulesconfig.md) | :heavy_check_mark: | Optional structured filter rules controlling which events are forwarded. | | | `ID` | `string` | :heavy_check_mark: | Stable public identifier for this destination. | 99999999-aaaa-bbbb-cccc-dddddddddddd | | `Name` | `*string` | :heavy_check_mark: | Human-readable name for the destination. | Production Langfuse | | `PrivacyMode` | `bool` | :heavy_check_mark: | When true, request/response bodies are not forwarded to this destination — only metadata. | false | diff --git a/docs/models/components/observabilityposthogdestination.md b/docs/models/components/observabilityposthogdestination.md index 3dc1bfa7..d55edd81 100644 --- a/docs/models/components/observabilityposthogdestination.md +++ b/docs/models/components/observabilityposthogdestination.md @@ -5,11 +5,11 @@ | Field | Type | Required | Description | Example | | ---------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------- | -| `APIKeyHashes` | []`string` | :heavy_check_mark: | Optional allowlist of OpenRouter API key hashes (`api_keys.hash`) whose traffic is forwarded to this destination. `null` means all keys. | null | +| `APIKeyHashes` | []`string` | :heavy_check_mark: | Optional allowlist of OpenRouter API key hashes (`api_keys.hash`) whose traffic is forwarded to this destination. `null` means all keys. | | | `Config` | [components.ObservabilityPosthogDestinationConfig](../../models/components/observabilityposthogdestinationconfig.md) | :heavy_check_mark: | N/A | | | `CreatedAt` | `string` | :heavy_check_mark: | ISO timestamp of when the destination was created. | 2025-08-24T10:30:00Z | | `Enabled` | `bool` | :heavy_check_mark: | Whether this destination is currently enabled. | true | -| `FilterRules` | [*components.ObservabilityFilterRulesConfig](../../models/components/observabilityfilterrulesconfig.md) | :heavy_check_mark: | Optional structured filter rules controlling which events are forwarded. | null | +| `FilterRules` | [*components.ObservabilityFilterRulesConfig](../../models/components/observabilityfilterrulesconfig.md) | :heavy_check_mark: | Optional structured filter rules controlling which events are forwarded. | | | `ID` | `string` | :heavy_check_mark: | Stable public identifier for this destination. | 99999999-aaaa-bbbb-cccc-dddddddddddd | | `Name` | `*string` | :heavy_check_mark: | Human-readable name for the destination. | Production Langfuse | | `PrivacyMode` | `bool` | :heavy_check_mark: | When true, request/response bodies are not forwarded to this destination — only metadata. | false | diff --git a/docs/models/components/observabilityrampdestination.md b/docs/models/components/observabilityrampdestination.md index a4479d68..e956c140 100644 --- a/docs/models/components/observabilityrampdestination.md +++ b/docs/models/components/observabilityrampdestination.md @@ -5,11 +5,11 @@ | Field | Type | Required | Description | Example | | ---------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------- | -| `APIKeyHashes` | []`string` | :heavy_check_mark: | Optional allowlist of OpenRouter API key hashes (`api_keys.hash`) whose traffic is forwarded to this destination. `null` means all keys. | null | +| `APIKeyHashes` | []`string` | :heavy_check_mark: | Optional allowlist of OpenRouter API key hashes (`api_keys.hash`) whose traffic is forwarded to this destination. `null` means all keys. | | | `Config` | [components.ObservabilityRampDestinationConfig](../../models/components/observabilityrampdestinationconfig.md) | :heavy_check_mark: | N/A | | | `CreatedAt` | `string` | :heavy_check_mark: | ISO timestamp of when the destination was created. | 2025-08-24T10:30:00Z | | `Enabled` | `bool` | :heavy_check_mark: | Whether this destination is currently enabled. | true | -| `FilterRules` | [*components.ObservabilityFilterRulesConfig](../../models/components/observabilityfilterrulesconfig.md) | :heavy_check_mark: | Optional structured filter rules controlling which events are forwarded. | null | +| `FilterRules` | [*components.ObservabilityFilterRulesConfig](../../models/components/observabilityfilterrulesconfig.md) | :heavy_check_mark: | Optional structured filter rules controlling which events are forwarded. | | | `ID` | `string` | :heavy_check_mark: | Stable public identifier for this destination. | 99999999-aaaa-bbbb-cccc-dddddddddddd | | `Name` | `*string` | :heavy_check_mark: | Human-readable name for the destination. | Production Langfuse | | `PrivacyMode` | `bool` | :heavy_check_mark: | When true, request/response bodies are not forwarded to this destination — only metadata. | false | diff --git a/docs/models/components/observabilitys3destination.md b/docs/models/components/observabilitys3destination.md index 979e99a1..87789d29 100644 --- a/docs/models/components/observabilitys3destination.md +++ b/docs/models/components/observabilitys3destination.md @@ -5,11 +5,11 @@ | Field | Type | Required | Description | Example | | ---------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------- | -| `APIKeyHashes` | []`string` | :heavy_check_mark: | Optional allowlist of OpenRouter API key hashes (`api_keys.hash`) whose traffic is forwarded to this destination. `null` means all keys. | null | +| `APIKeyHashes` | []`string` | :heavy_check_mark: | Optional allowlist of OpenRouter API key hashes (`api_keys.hash`) whose traffic is forwarded to this destination. `null` means all keys. | | | `Config` | [components.ObservabilityS3DestinationConfig](../../models/components/observabilitys3destinationconfig.md) | :heavy_check_mark: | N/A | | | `CreatedAt` | `string` | :heavy_check_mark: | ISO timestamp of when the destination was created. | 2025-08-24T10:30:00Z | | `Enabled` | `bool` | :heavy_check_mark: | Whether this destination is currently enabled. | true | -| `FilterRules` | [*components.ObservabilityFilterRulesConfig](../../models/components/observabilityfilterrulesconfig.md) | :heavy_check_mark: | Optional structured filter rules controlling which events are forwarded. | null | +| `FilterRules` | [*components.ObservabilityFilterRulesConfig](../../models/components/observabilityfilterrulesconfig.md) | :heavy_check_mark: | Optional structured filter rules controlling which events are forwarded. | | | `ID` | `string` | :heavy_check_mark: | Stable public identifier for this destination. | 99999999-aaaa-bbbb-cccc-dddddddddddd | | `Name` | `*string` | :heavy_check_mark: | Human-readable name for the destination. | Production Langfuse | | `PrivacyMode` | `bool` | :heavy_check_mark: | When true, request/response bodies are not forwarded to this destination — only metadata. | false | diff --git a/docs/models/components/observabilitysentrydestination.md b/docs/models/components/observabilitysentrydestination.md index 1b0ba3cf..b39b086f 100644 --- a/docs/models/components/observabilitysentrydestination.md +++ b/docs/models/components/observabilitysentrydestination.md @@ -5,11 +5,11 @@ | Field | Type | Required | Description | Example | | ---------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------- | -| `APIKeyHashes` | []`string` | :heavy_check_mark: | Optional allowlist of OpenRouter API key hashes (`api_keys.hash`) whose traffic is forwarded to this destination. `null` means all keys. | null | +| `APIKeyHashes` | []`string` | :heavy_check_mark: | Optional allowlist of OpenRouter API key hashes (`api_keys.hash`) whose traffic is forwarded to this destination. `null` means all keys. | | | `Config` | [components.ObservabilitySentryDestinationConfig](../../models/components/observabilitysentrydestinationconfig.md) | :heavy_check_mark: | N/A | | | `CreatedAt` | `string` | :heavy_check_mark: | ISO timestamp of when the destination was created. | 2025-08-24T10:30:00Z | | `Enabled` | `bool` | :heavy_check_mark: | Whether this destination is currently enabled. | true | -| `FilterRules` | [*components.ObservabilityFilterRulesConfig](../../models/components/observabilityfilterrulesconfig.md) | :heavy_check_mark: | Optional structured filter rules controlling which events are forwarded. | null | +| `FilterRules` | [*components.ObservabilityFilterRulesConfig](../../models/components/observabilityfilterrulesconfig.md) | :heavy_check_mark: | Optional structured filter rules controlling which events are forwarded. | | | `ID` | `string` | :heavy_check_mark: | Stable public identifier for this destination. | 99999999-aaaa-bbbb-cccc-dddddddddddd | | `Name` | `*string` | :heavy_check_mark: | Human-readable name for the destination. | Production Langfuse | | `PrivacyMode` | `bool` | :heavy_check_mark: | When true, request/response bodies are not forwarded to this destination — only metadata. | false | diff --git a/docs/models/components/observabilitysnowflakedestination.md b/docs/models/components/observabilitysnowflakedestination.md index a7ecd0a2..08c58d45 100644 --- a/docs/models/components/observabilitysnowflakedestination.md +++ b/docs/models/components/observabilitysnowflakedestination.md @@ -5,11 +5,11 @@ | Field | Type | Required | Description | Example | | ---------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------- | -| `APIKeyHashes` | []`string` | :heavy_check_mark: | Optional allowlist of OpenRouter API key hashes (`api_keys.hash`) whose traffic is forwarded to this destination. `null` means all keys. | null | +| `APIKeyHashes` | []`string` | :heavy_check_mark: | Optional allowlist of OpenRouter API key hashes (`api_keys.hash`) whose traffic is forwarded to this destination. `null` means all keys. | | | `Config` | [components.ObservabilitySnowflakeDestinationConfig](../../models/components/observabilitysnowflakedestinationconfig.md) | :heavy_check_mark: | N/A | | | `CreatedAt` | `string` | :heavy_check_mark: | ISO timestamp of when the destination was created. | 2025-08-24T10:30:00Z | | `Enabled` | `bool` | :heavy_check_mark: | Whether this destination is currently enabled. | true | -| `FilterRules` | [*components.ObservabilityFilterRulesConfig](../../models/components/observabilityfilterrulesconfig.md) | :heavy_check_mark: | Optional structured filter rules controlling which events are forwarded. | null | +| `FilterRules` | [*components.ObservabilityFilterRulesConfig](../../models/components/observabilityfilterrulesconfig.md) | :heavy_check_mark: | Optional structured filter rules controlling which events are forwarded. | | | `ID` | `string` | :heavy_check_mark: | Stable public identifier for this destination. | 99999999-aaaa-bbbb-cccc-dddddddddddd | | `Name` | `*string` | :heavy_check_mark: | Human-readable name for the destination. | Production Langfuse | | `PrivacyMode` | `bool` | :heavy_check_mark: | When true, request/response bodies are not forwarded to this destination — only metadata. | false | diff --git a/docs/models/components/observabilityweavedestination.md b/docs/models/components/observabilityweavedestination.md index 92ba6a9e..f4c4de98 100644 --- a/docs/models/components/observabilityweavedestination.md +++ b/docs/models/components/observabilityweavedestination.md @@ -5,11 +5,11 @@ | Field | Type | Required | Description | Example | | ---------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------- | -| `APIKeyHashes` | []`string` | :heavy_check_mark: | Optional allowlist of OpenRouter API key hashes (`api_keys.hash`) whose traffic is forwarded to this destination. `null` means all keys. | null | +| `APIKeyHashes` | []`string` | :heavy_check_mark: | Optional allowlist of OpenRouter API key hashes (`api_keys.hash`) whose traffic is forwarded to this destination. `null` means all keys. | | | `Config` | [components.ObservabilityWeaveDestinationConfig](../../models/components/observabilityweavedestinationconfig.md) | :heavy_check_mark: | N/A | | | `CreatedAt` | `string` | :heavy_check_mark: | ISO timestamp of when the destination was created. | 2025-08-24T10:30:00Z | | `Enabled` | `bool` | :heavy_check_mark: | Whether this destination is currently enabled. | true | -| `FilterRules` | [*components.ObservabilityFilterRulesConfig](../../models/components/observabilityfilterrulesconfig.md) | :heavy_check_mark: | Optional structured filter rules controlling which events are forwarded. | null | +| `FilterRules` | [*components.ObservabilityFilterRulesConfig](../../models/components/observabilityfilterrulesconfig.md) | :heavy_check_mark: | Optional structured filter rules controlling which events are forwarded. | | | `ID` | `string` | :heavy_check_mark: | Stable public identifier for this destination. | 99999999-aaaa-bbbb-cccc-dddddddddddd | | `Name` | `*string` | :heavy_check_mark: | Human-readable name for the destination. | Production Langfuse | | `PrivacyMode` | `bool` | :heavy_check_mark: | When true, request/response bodies are not forwarded to this destination — only metadata. | false | diff --git a/docs/models/components/observabilitywebhookdestination.md b/docs/models/components/observabilitywebhookdestination.md index 988bb009..8a0d3793 100644 --- a/docs/models/components/observabilitywebhookdestination.md +++ b/docs/models/components/observabilitywebhookdestination.md @@ -5,11 +5,11 @@ | Field | Type | Required | Description | Example | | ---------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------- | -| `APIKeyHashes` | []`string` | :heavy_check_mark: | Optional allowlist of OpenRouter API key hashes (`api_keys.hash`) whose traffic is forwarded to this destination. `null` means all keys. | null | +| `APIKeyHashes` | []`string` | :heavy_check_mark: | Optional allowlist of OpenRouter API key hashes (`api_keys.hash`) whose traffic is forwarded to this destination. `null` means all keys. | | | `Config` | [components.ObservabilityWebhookDestinationConfig](../../models/components/observabilitywebhookdestinationconfig.md) | :heavy_check_mark: | N/A | | | `CreatedAt` | `string` | :heavy_check_mark: | ISO timestamp of when the destination was created. | 2025-08-24T10:30:00Z | | `Enabled` | `bool` | :heavy_check_mark: | Whether this destination is currently enabled. | true | -| `FilterRules` | [*components.ObservabilityFilterRulesConfig](../../models/components/observabilityfilterrulesconfig.md) | :heavy_check_mark: | Optional structured filter rules controlling which events are forwarded. | null | +| `FilterRules` | [*components.ObservabilityFilterRulesConfig](../../models/components/observabilityfilterrulesconfig.md) | :heavy_check_mark: | Optional structured filter rules controlling which events are forwarded. | | | `ID` | `string` | :heavy_check_mark: | Stable public identifier for this destination. | 99999999-aaaa-bbbb-cccc-dddddddddddd | | `Name` | `*string` | :heavy_check_mark: | Human-readable name for the destination. | Production Langfuse | | `PrivacyMode` | `bool` | :heavy_check_mark: | When true, request/response bodies are not forwarded to this destination — only metadata. | false | diff --git a/docs/models/components/openresponsesresult.md b/docs/models/components/openresponsesresult.md index 954f4e70..b2016ff5 100644 --- a/docs/models/components/openresponsesresult.md +++ b/docs/models/components/openresponsesresult.md @@ -41,4 +41,5 @@ Complete non-streaming response from the Responses API | `Truncation` | optionalnullable.OptionalNullable[[components.Truncation](../../models/components/truncation.md)] | :heavy_minus_sign: | N/A | auto | | `Usage` | optionalnullable.OptionalNullable[[components.Usage](../../models/components/usage.md)] | :heavy_minus_sign: | Token usage information for the response | {
"cost": 0.0012,
"cost_details": {
"upstream_inference_cost": null,
"upstream_inference_input_cost": 0.0008,
"upstream_inference_output_cost": 0.0004
},
"input_tokens": 10,
"input_tokens_details": {
"cached_tokens": 0
},
"output_tokens": 25,
"output_tokens_details": {
"reasoning_tokens": 0
},
"total_tokens": 35
} | | `User` | optionalnullable.OptionalNullable[`string`] | :heavy_minus_sign: | N/A | | +| `ErrorType` | [*components.APIErrorType](../../models/components/apierrortype.md) | :heavy_minus_sign: | Canonical OpenRouter error type, stable across all API formats | rate_limit_exceeded | | `OpenrouterMetadata` | [*components.OpenRouterMetadata](../../models/components/openroutermetadata.md) | :heavy_minus_sign: | N/A | {
"attempt": 1,
"endpoints": {
"available": [
{
"model": "openai/gpt-4o",
"provider": "OpenAI",
"selected": true
}
],
"total": 1
},
"is_byok": false,
"region": "iad",
"requested": "openai/gpt-4o",
"strategy": "direct",
"summary": "available=1, selected=OpenAI"
} | \ No newline at end of file diff --git a/docs/models/components/outputformat.md b/docs/models/components/outputformat.md deleted file mode 100644 index 125b8276..00000000 --- a/docs/models/components/outputformat.md +++ /dev/null @@ -1,23 +0,0 @@ -# OutputFormat - -## Example Usage - -```go -import ( - "github.com/OpenRouterTeam/go-sdk/models/components" -) - -value := components.OutputFormatPng - -// Open enum: custom values can be created with a direct type cast -custom := components.OutputFormat("custom_value") -``` - - -## Values - -| Name | Value | -| ------------------ | ------------------ | -| `OutputFormatPng` | png | -| `OutputFormatWebp` | webp | -| `OutputFormatJpeg` | jpeg | \ No newline at end of file diff --git a/docs/models/components/presetenum.md b/docs/models/components/presetenum.md new file mode 100644 index 00000000..872ae668 --- /dev/null +++ b/docs/models/components/presetenum.md @@ -0,0 +1,24 @@ +# PresetEnum + +A curated OpenRouter fusion preset (slugs follow `-`, e.g. `general-high`). Expands server-side into the preset's analysis_models panel and judge model, so callers never name individual models. Explicitly provided `analysis_models` / `model` take precedence. + +## Example Usage + +```go +import ( + "github.com/OpenRouterTeam/go-sdk/models/components" +) + +value := components.PresetEnumGeneralHigh + +// Open enum: custom values can be created with a direct type cast +custom := components.PresetEnum("custom_value") +``` + + +## Values + +| Name | Value | +| ------------------------- | ------------------------- | +| `PresetEnumGeneralHigh` | general-high | +| `PresetEnumGeneralBudget` | general-budget | \ No newline at end of file diff --git a/docs/models/components/preview20250311websearchservertool.md b/docs/models/components/preview20250311websearchservertool.md index 4754cf55..d32475a5 100644 --- a/docs/models/components/preview20250311websearchservertool.md +++ b/docs/models/components/preview20250311websearchservertool.md @@ -9,7 +9,7 @@ Web search preview tool configuration (2025-03-11 version) | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `Engine` | [*components.WebSearchEngineEnum](../../models/components/websearchengineenum.md) | :heavy_minus_sign: | Which search engine to use. "auto" (default) uses native if the provider supports it, otherwise Exa. "native" forces the provider's built-in search. "exa" forces the Exa search API. "firecrawl" uses Firecrawl (requires BYOK). "parallel" uses the Parallel search API. "perplexity" uses the Perplexity Search API (raw ranked results). | auto | | `Filters` | optionalnullable.OptionalNullable[[components.WebSearchDomainFilter](../../models/components/websearchdomainfilter.md)] | :heavy_minus_sign: | N/A | {
"allowed_domains": [
"example.com"
],
"excluded_domains": [
"spam.com"
]
} | -| `MaxResults` | `*int64` | :heavy_minus_sign: | Maximum number of search results to return per search call. Defaults to 5. Applies to Exa, Firecrawl, Parallel, and Perplexity engines; ignored with native provider search. | 5 | +| `MaxResults` | `*int64` | :heavy_minus_sign: | Maximum number of search results to return per search call. Defaults to 5. Applies to Exa, Firecrawl, Parallel, and Perplexity engines; ignored with native provider search. Perplexity supports a maximum of 20; values above 20 are clamped. | 5 | | `SearchContextSize` | [*components.SearchContextSizeEnum](../../models/components/searchcontextsizeenum.md) | :heavy_minus_sign: | Size of the search context for web search tools | medium | | `Type` | [components.Preview20250311WebSearchServerToolType](../../models/components/preview20250311websearchservertooltype.md) | :heavy_check_mark: | N/A | | | `UserLocation` | optionalnullable.OptionalNullable[[components.PreviewWebSearchUserLocation](../../models/components/previewwebsearchuserlocation.md)] | :heavy_minus_sign: | N/A | {
"city": "San Francisco",
"country": "USA",
"region": "California",
"timezone": "America/Los_Angeles",
"type": "approximate"
} | \ No newline at end of file diff --git a/docs/models/components/previewwebsearchservertool.md b/docs/models/components/previewwebsearchservertool.md index 324f28b9..c9871fd0 100644 --- a/docs/models/components/previewwebsearchservertool.md +++ b/docs/models/components/previewwebsearchservertool.md @@ -9,7 +9,7 @@ Web search preview tool configuration | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `Engine` | [*components.WebSearchEngineEnum](../../models/components/websearchengineenum.md) | :heavy_minus_sign: | Which search engine to use. "auto" (default) uses native if the provider supports it, otherwise Exa. "native" forces the provider's built-in search. "exa" forces the Exa search API. "firecrawl" uses Firecrawl (requires BYOK). "parallel" uses the Parallel search API. "perplexity" uses the Perplexity Search API (raw ranked results). | auto | | `Filters` | optionalnullable.OptionalNullable[[components.WebSearchDomainFilter](../../models/components/websearchdomainfilter.md)] | :heavy_minus_sign: | N/A | {
"allowed_domains": [
"example.com"
],
"excluded_domains": [
"spam.com"
]
} | -| `MaxResults` | `*int64` | :heavy_minus_sign: | Maximum number of search results to return per search call. Defaults to 5. Applies to Exa, Firecrawl, Parallel, and Perplexity engines; ignored with native provider search. | 5 | +| `MaxResults` | `*int64` | :heavy_minus_sign: | Maximum number of search results to return per search call. Defaults to 5. Applies to Exa, Firecrawl, Parallel, and Perplexity engines; ignored with native provider search. Perplexity supports a maximum of 20; values above 20 are clamped. | 5 | | `SearchContextSize` | [*components.SearchContextSizeEnum](../../models/components/searchcontextsizeenum.md) | :heavy_minus_sign: | Size of the search context for web search tools | medium | | `Type` | [components.PreviewWebSearchServerToolType](../../models/components/previewwebsearchservertooltype.md) | :heavy_check_mark: | N/A | | | `UserLocation` | optionalnullable.OptionalNullable[[components.PreviewWebSearchUserLocation](../../models/components/previewwebsearchuserlocation.md)] | :heavy_minus_sign: | N/A | {
"city": "San Francisco",
"country": "USA",
"region": "California",
"timezone": "America/Los_Angeles",
"type": "approximate"
} | \ No newline at end of file diff --git a/docs/models/components/providername.md b/docs/models/components/providername.md index f881f951..38815051 100644 --- a/docs/models/components/providername.md +++ b/docs/models/components/providername.md @@ -95,6 +95,7 @@ custom := components.ProviderName("custom_value") | `ProviderNameStealth` | Stealth | | `ProviderNameStreamLake` | StreamLake | | `ProviderNameSwitchpoint` | Switchpoint | +| `ProviderNameTenstorrent` | Tenstorrent | | `ProviderNameTogether` | Together | | `ProviderNameUpstage` | Upstage | | `ProviderNameVenice` | Venice | diff --git a/docs/models/components/provideroptions.md b/docs/models/components/provideroptions.md index e27a7066..5ddcf188 100644 --- a/docs/models/components/provideroptions.md +++ b/docs/models/components/provideroptions.md @@ -1,6 +1,6 @@ # ProviderOptions -Provider-specific options keyed by provider slug. The options for the matched provider are spread into the upstream request body. +Provider-specific options keyed by provider slug. Only options for the matched provider are forwarded; the rest are ignored. Unrecognized keys are silently dropped. ## Fields @@ -112,6 +112,7 @@ Provider-specific options keyed by provider slug. The options for the matched pr | `Streamlake` | map[string]`any` | :heavy_minus_sign: | N/A | | `Switchpoint` | map[string]`any` | :heavy_minus_sign: | N/A | | `Targon` | map[string]`any` | :heavy_minus_sign: | N/A | +| `Tenstorrent` | map[string]`any` | :heavy_minus_sign: | N/A | | `Together` | map[string]`any` | :heavy_minus_sign: | N/A | | `TogetherLite` | map[string]`any` | :heavy_minus_sign: | N/A | | `Ubicloud` | map[string]`any` | :heavy_minus_sign: | N/A | diff --git a/docs/models/components/providerresponseprovidername.md b/docs/models/components/providerresponseprovidername.md index c5ff82d0..18fb9971 100644 --- a/docs/models/components/providerresponseprovidername.md +++ b/docs/models/components/providerresponseprovidername.md @@ -126,6 +126,7 @@ custom := components.ProviderResponseProviderName("custom_value") | `ProviderResponseProviderNameStealth` | Stealth | | `ProviderResponseProviderNameStreamLake` | StreamLake | | `ProviderResponseProviderNameSwitchpoint` | Switchpoint | +| `ProviderResponseProviderNameTenstorrent` | Tenstorrent | | `ProviderResponseProviderNameTogether` | Together | | `ProviderResponseProviderNameUpstage` | Upstage | | `ProviderResponseProviderNameVenice` | Venice | diff --git a/docs/models/components/rangecapability.md b/docs/models/components/rangecapability.md new file mode 100644 index 00000000..3c4e74cb --- /dev/null +++ b/docs/models/components/rangecapability.md @@ -0,0 +1,12 @@ +# RangeCapability + +A parameter that accepts any value within an inclusive numeric range. + + +## Fields + +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- | +| `Max` | `float64` | :heavy_check_mark: | N/A | +| `Min` | `float64` | :heavy_check_mark: | N/A | +| `Type` | [components.RangeCapabilityType](../../models/components/rangecapabilitytype.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/components/rangecapabilitytype.md b/docs/models/components/rangecapabilitytype.md new file mode 100644 index 00000000..a96db599 --- /dev/null +++ b/docs/models/components/rangecapabilitytype.md @@ -0,0 +1,18 @@ +# RangeCapabilityType + +## Example Usage + +```go +import ( + "github.com/OpenRouterTeam/go-sdk/models/components" +) + +value := components.RangeCapabilityTypeRange +``` + + +## Values + +| Name | Value | +| -------------------------- | -------------------------- | +| `RangeCapabilityTypeRange` | range | \ No newline at end of file diff --git a/docs/models/components/reasoningeffort.md b/docs/models/components/reasoningeffort.md index 5acf2088..66700cfb 100644 --- a/docs/models/components/reasoningeffort.md +++ b/docs/models/components/reasoningeffort.md @@ -7,7 +7,7 @@ import ( "github.com/OpenRouterTeam/go-sdk/models/components" ) -value := components.ReasoningEffortXhigh +value := components.ReasoningEffortMax // Open enum: custom values can be created with a direct type cast custom := components.ReasoningEffort("custom_value") @@ -18,6 +18,7 @@ custom := components.ReasoningEffort("custom_value") | Name | Value | | ------------------------ | ------------------------ | +| `ReasoningEffortMax` | max | | `ReasoningEffortXhigh` | xhigh | | `ReasoningEffortHigh` | high | | `ReasoningEffortMedium` | medium | diff --git a/docs/models/components/resetinterval.md b/docs/models/components/resetinterval.md new file mode 100644 index 00000000..b2a19f43 --- /dev/null +++ b/docs/models/components/resetinterval.md @@ -0,0 +1,25 @@ +# ResetInterval + +Interval at which spend resets. Null means a lifetime (one-time) budget. + +## Example Usage + +```go +import ( + "github.com/OpenRouterTeam/go-sdk/models/components" +) + +value := components.ResetIntervalDaily + +// Open enum: custom values can be created with a direct type cast +custom := components.ResetInterval("custom_value") +``` + + +## Values + +| Name | Value | +| ---------------------- | ---------------------- | +| `ResetIntervalDaily` | daily | +| `ResetIntervalWeekly` | weekly | +| `ResetIntervalMonthly` | monthly | \ No newline at end of file diff --git a/docs/models/components/resolution.md b/docs/models/components/resolution.md deleted file mode 100644 index e0eb77f6..00000000 --- a/docs/models/components/resolution.md +++ /dev/null @@ -1,28 +0,0 @@ -# Resolution - -Resolution of the generated video - -## Example Usage - -```go -import ( - "github.com/OpenRouterTeam/go-sdk/models/components" -) - -value := components.ResolutionFourHundredAndEightyp - -// Open enum: custom values can be created with a direct type cast -custom := components.Resolution("custom_value") -``` - - -## Values - -| Name | Value | -| ---------------------------------- | ---------------------------------- | -| `ResolutionFourHundredAndEightyp` | 480p | -| `ResolutionSevenHundredAndTwentyp` | 720p | -| `ResolutionOneThousandAndEightyp` | 1080p | -| `ResolutionOneK` | 1K | -| `ResolutionTwoK` | 2K | -| `ResolutionFourK` | 4K | \ No newline at end of file diff --git a/docs/models/components/responsesrequest.md b/docs/models/components/responsesrequest.md index 31fc559c..49873f5d 100644 --- a/docs/models/components/responsesrequest.md +++ b/docs/models/components/responsesrequest.md @@ -9,6 +9,7 @@ Request schema for Responses endpoint | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `Background` | optionalnullable.OptionalNullable[`bool`] | :heavy_minus_sign: | N/A | | | `CacheControl` | [*components.AnthropicCacheControlDirective](../../models/components/anthropiccachecontroldirective.md) | :heavy_minus_sign: | Enable automatic prompt caching. When set at the top level, the system automatically applies cache breakpoints to the last cacheable block in the request. Currently supported for Anthropic Claude models. | {
"type": "ephemeral"
} | +| `Debug` | [*components.ChatDebugOptions](../../models/components/chatdebugoptions.md) | :heavy_minus_sign: | Debug options for inspecting request transformations (streaming only) | {
"echo_upstream_body": true
} | | `FrequencyPenalty` | optionalnullable.OptionalNullable[`float64`] | :heavy_minus_sign: | N/A | | | `ImageConfig` | map[string][components.ImageConfig](../../models/components/imageconfig.md) | :heavy_minus_sign: | Provider-specific image configuration options. Keys and values vary by model/provider. See https://openrouter.ai/docs/guides/overview/multimodal/image-generation for more details. | {
"aspect_ratio": "16:9",
"quality": "high"
} | | `Include` | optionalnullable.OptionalNullable[[][components.ResponseIncludesEnum](../../models/components/responseincludesenum.md)] | :heavy_minus_sign: | N/A | | diff --git a/docs/models/components/servertooluse.md b/docs/models/components/servertooluse.md new file mode 100644 index 00000000..d45229ce --- /dev/null +++ b/docs/models/components/servertooluse.md @@ -0,0 +1,12 @@ +# ServerToolUse + +Usage for server-side tool execution (e.g., web search) + + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `ToolCallsExecuted` | optionalnullable.OptionalNullable[`int64`] | :heavy_minus_sign: | Number of OpenRouter server tool calls that executed and produced a result. | +| `ToolCallsRequested` | optionalnullable.OptionalNullable[`int64`] | :heavy_minus_sign: | Total number of OpenRouter server-orchestrated tool calls the model requested, across all tool types. Provider-native tools (e.g. native web search) are not counted here. | +| `WebSearchRequests` | optionalnullable.OptionalNullable[`int64`] | :heavy_minus_sign: | Number of web searches performed by server-side tools. For server-orchestrated tool calls a web search is also counted in tool_calls_requested; provider-native web search may report web_search_requests only. Do not sum the two. | \ No newline at end of file diff --git a/docs/models/components/servertoolusedetails.md b/docs/models/components/servertoolusedetails.md new file mode 100644 index 00000000..17e9b1ac --- /dev/null +++ b/docs/models/components/servertoolusedetails.md @@ -0,0 +1,12 @@ +# ServerToolUseDetails + +Usage for server-side tool execution (e.g., web search) + + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `ToolCallsExecuted` | optionalnullable.OptionalNullable[`int64`] | :heavy_minus_sign: | Number of OpenRouter server tool calls that executed and produced a result | +| `ToolCallsRequested` | optionalnullable.OptionalNullable[`int64`] | :heavy_minus_sign: | Total number of OpenRouter server-orchestrated tool calls the model requested, across all tool types. Provider-native tools (e.g. native web search) are not counted here. | +| `WebSearchRequests` | optionalnullable.OptionalNullable[`int64`] | :heavy_minus_sign: | Number of web searches performed by server-side tools. For server-orchestrated tool calls a web search is also counted in tool_calls_requested; provider-native web search may report web_search_requests only. Do not sum the two. | \ No newline at end of file diff --git a/docs/models/components/speechrequestprovider.md b/docs/models/components/speechrequestprovider.md index 5eb2fbd1..74065243 100644 --- a/docs/models/components/speechrequestprovider.md +++ b/docs/models/components/speechrequestprovider.md @@ -5,6 +5,6 @@ Provider-specific passthrough configuration ## Fields -| Field | Type | Required | Description | Example | -| --------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------- | -| `Options` | [*components.ProviderOptions](../../models/components/provideroptions.md) | :heavy_minus_sign: | Provider-specific options keyed by provider slug. The options for the matched provider are spread into the upstream request body. | {
"openai": {
"max_tokens": 1000
}
} | \ No newline at end of file +| Field | Type | Required | Description | Example | +| -------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `Options` | [*components.ProviderOptions](../../models/components/provideroptions.md) | :heavy_minus_sign: | Provider-specific options keyed by provider slug. Only options for the matched provider are forwarded; the rest are ignored. Unrecognized keys are silently dropped. | {
"openai": {
"max_tokens": 1000
}
} | \ No newline at end of file diff --git a/docs/models/components/streamevents.md b/docs/models/components/streamevents.md index 903929d3..2f02656f 100644 --- a/docs/models/components/streamevents.md +++ b/docs/models/components/streamevents.md @@ -59,6 +59,12 @@ streamEvents := components.CreateStreamEventsResponseCustomToolCallInputDelta(co streamEvents := components.CreateStreamEventsResponseCustomToolCallInputDone(components.CustomToolCallInputDoneEvent{/* values here */}) ``` +### DebugEvent + +```go +streamEvents := components.CreateStreamEventsResponseDebug(components.DebugEvent{/* values here */}) +``` + ### StreamEventsResponseFailed ```go @@ -287,6 +293,8 @@ switch streamEvents.Type { // streamEvents.CustomToolCallInputDeltaEvent is populated case components.StreamEventsTypeResponseCustomToolCallInputDone: // streamEvents.CustomToolCallInputDoneEvent is populated + case components.StreamEventsTypeResponseDebug: + // streamEvents.DebugEvent is populated case components.StreamEventsTypeResponseFailed: // streamEvents.StreamEventsResponseFailed is populated case components.StreamEventsTypeResponseFunctionCallArgumentsDelta: diff --git a/docs/models/components/sttrequestprovider.md b/docs/models/components/sttrequestprovider.md index 9e2700d1..d6bce5a5 100644 --- a/docs/models/components/sttrequestprovider.md +++ b/docs/models/components/sttrequestprovider.md @@ -5,6 +5,6 @@ Provider-specific passthrough configuration ## Fields -| Field | Type | Required | Description | Example | -| --------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------- | -| `Options` | [*components.ProviderOptions](../../models/components/provideroptions.md) | :heavy_minus_sign: | Provider-specific options keyed by provider slug. The options for the matched provider are spread into the upstream request body. | {
"openai": {
"max_tokens": 1000
}
} | \ No newline at end of file +| Field | Type | Required | Description | Example | +| -------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `Options` | [*components.ProviderOptions](../../models/components/provideroptions.md) | :heavy_minus_sign: | Provider-specific options keyed by provider slug. Only options for the matched provider are forwarded; the rest are ignored. Unrecognized keys are silently dropped. | {
"openai": {
"max_tokens": 1000
}
} | \ No newline at end of file diff --git a/docs/models/components/subagentreasoningeffort.md b/docs/models/components/subagentreasoningeffort.md index 101dcfa1..64518f53 100644 --- a/docs/models/components/subagentreasoningeffort.md +++ b/docs/models/components/subagentreasoningeffort.md @@ -9,7 +9,7 @@ import ( "github.com/OpenRouterTeam/go-sdk/models/components" ) -value := components.SubagentReasoningEffortXhigh +value := components.SubagentReasoningEffortMax // Open enum: custom values can be created with a direct type cast custom := components.SubagentReasoningEffort("custom_value") @@ -20,6 +20,7 @@ custom := components.SubagentReasoningEffort("custom_value") | Name | Value | | -------------------------------- | -------------------------------- | +| `SubagentReasoningEffortMax` | max | | `SubagentReasoningEffortXhigh` | xhigh | | `SubagentReasoningEffortHigh` | high | | `SubagentReasoningEffortMedium` | medium | diff --git a/docs/models/components/taskclassificationitem.md b/docs/models/components/taskclassificationitem.md new file mode 100644 index 00000000..cc32f487 --- /dev/null +++ b/docs/models/components/taskclassificationitem.md @@ -0,0 +1,15 @@ +# TaskClassificationItem + + +## Fields + +| Field | Type | Required | Description | Example | +| ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `CategoryTokenShare` | `float64` | :heavy_check_mark: | Fraction of this classification's token volume within its macro-category (0–1). Sums to 1 across all classifications sharing the same `macro_category`. | 0.48 | +| `CategoryUsageShare` | `float64` | :heavy_check_mark: | Fraction of this classification's usage within its macro-category (0–1). Sums to 1 across all classifications sharing the same `macro_category`. | 0.51 | +| `DisplayName` | `string` | :heavy_check_mark: | Human-readable label for the classification. | Code Generation | +| `MacroCategory` | `string` | :heavy_check_mark: | Coarse grouping derived from the tag prefix: `code`, `data`, `agent`, or `general`. | code | +| `Models` | [][components.TaskClassificationModel](../../models/components/taskclassificationmodel.md) | :heavy_check_mark: | Top models for this classification by request volume, sorted descending. Each entry reports the model's share of this classification's requests and tokens. | | +| `Tag` | `string` | :heavy_check_mark: | Classification tag identifier (e.g. `code:general_impl`, `agent:web_search`). | code:general_impl | +| `TokenShare` | `float64` | :heavy_check_mark: | Fraction of classified sampled token volume (prompt + completion) attributed to this classification (0–1). The unclassified `other` bucket is excluded from the denominator. | 0.31 | +| `UsageShare` | `float64` | :heavy_check_mark: | Fraction of classified sampled requests attributed to this classification (0–1). The unclassified `other` bucket is excluded from the denominator. | 0.23 | \ No newline at end of file diff --git a/docs/models/components/taskclassificationmacrocategory.md b/docs/models/components/taskclassificationmacrocategory.md new file mode 100644 index 00000000..a83dd30d --- /dev/null +++ b/docs/models/components/taskclassificationmacrocategory.md @@ -0,0 +1,11 @@ +# TaskClassificationMacroCategory + + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------- | ------------------------------------------------------------------------- | ------------------------------------------------------------------------- | ------------------------------------------------------------------------- | ------------------------------------------------------------------------- | +| `Key` | `string` | :heavy_check_mark: | Macro-category identifier. | code | +| `Label` | `string` | :heavy_check_mark: | Human-readable label for the macro-category. | Code | +| `TokenShare` | `float64` | :heavy_check_mark: | Combined token share of all classifications in this macro-category (0–1). | 0.52 | +| `UsageShare` | `float64` | :heavy_check_mark: | Combined usage share of all classifications in this macro-category (0–1). | 0.45 | \ No newline at end of file diff --git a/docs/models/components/taskclassificationmodel.md b/docs/models/components/taskclassificationmodel.md new file mode 100644 index 00000000..65f8bb77 --- /dev/null +++ b/docs/models/components/taskclassificationmodel.md @@ -0,0 +1,10 @@ +# TaskClassificationModel + + +## Fields + +| Field | Type | Required | Description | Example | +| ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `ID` | `string` | :heavy_check_mark: | Model identifier (permaslug). | openai/gpt-4.1-mini | +| `TagTokenShare` | `float64` | :heavy_check_mark: | Fraction of this classification's sampled token volume attributed to this model (0–1). Sums to ≤1 across the returned models (only top-N are included and unattributed requests are excluded). | 0.75 | +| `TagUsageShare` | `float64` | :heavy_check_mark: | Fraction of this classification's sampled requests attributed to this model (0–1). Sums to ≤1 across the returned models (only top-N are included and unattributed requests are excluded). | 0.55 | \ No newline at end of file diff --git a/docs/models/components/taskclassificationresponse.md b/docs/models/components/taskclassificationresponse.md new file mode 100644 index 00000000..6facc14d --- /dev/null +++ b/docs/models/components/taskclassificationresponse.md @@ -0,0 +1,8 @@ +# TaskClassificationResponse + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------ | +| `Data` | [components.TaskClassificationResponseData](../../models/components/taskclassificationresponsedata.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/components/benchmarksdaresponse.md b/docs/models/components/taskclassificationresponsedata.md similarity index 56% rename from docs/models/components/benchmarksdaresponse.md rename to docs/models/components/taskclassificationresponsedata.md index e67e6a75..15fa61eb 100644 --- a/docs/models/components/benchmarksdaresponse.md +++ b/docs/models/components/taskclassificationresponsedata.md @@ -1,9 +1,11 @@ -# BenchmarksDAResponse +# TaskClassificationResponseData ## Fields -| Field | Type | Required | Description | Example | -| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `Data` | [][components.BenchmarksDAItem](../../models/components/benchmarksdaitem.md) | :heavy_check_mark: | N/A | | -| `Meta` | [components.BenchmarksDAMeta](../../models/components/benchmarksdameta.md) | :heavy_check_mark: | N/A | {
"arena": "models",
"as_of": "2026-06-03T12:00:00Z",
"category": null,
"citation": "Source: Design Arena (www.designarena.ai) via OpenRouter (openrouter.ai/rankings).",
"elo_bounds": {
"max": 1600,
"min": 900
},
"model_count": 50,
"source": "design-arena",
"source_url": "https://www.designarena.ai",
"version": "v1"
} | \ No newline at end of file +| Field | Type | Required | Description | Example | +| -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `AsOf` | `string` | :heavy_check_mark: | UTC date (YYYY-MM-DD) of the window upper bound (yesterday). Data is exclusive of the current incomplete UTC day. This is the expected latest date in the snapshot; it does not confirm data presence for that date. | 2026-06-17 | +| `Classifications` | [][components.TaskClassificationItem](../../models/components/taskclassificationitem.md) | :heavy_check_mark: | Per-task classification market-share data, sorted by usage_share descending. | | +| `MacroCategories` | [][components.TaskClassificationMacroCategory](../../models/components/taskclassificationmacrocategory.md) | :heavy_check_mark: | Aggregate market-share data per macro-category (code, data, agent, general). | | +| `WindowDays` | `int64` | :heavy_check_mark: | Number of trailing days covered by this snapshot. | 7 | \ No newline at end of file diff --git a/docs/models/components/timings.md b/docs/models/components/timings.md new file mode 100644 index 00000000..645098c7 --- /dev/null +++ b/docs/models/components/timings.md @@ -0,0 +1,10 @@ +# Timings + + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------------------- | ---------------------------------------------------- | ---------------------------------------------------- | ---------------------------------------------------- | +| `EpochMs` | `int64` | :heavy_check_mark: | N/A | +| `Event` | [components.Event](../../models/components/event.md) | :heavy_check_mark: | N/A | +| `StartMs` | `int64` | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/components/benchmarkpricing.md b/docs/models/components/unifiedbenchmarkpricing.md similarity index 97% rename from docs/models/components/benchmarkpricing.md rename to docs/models/components/unifiedbenchmarkpricing.md index 3c0d7726..9ccb82cc 100644 --- a/docs/models/components/benchmarkpricing.md +++ b/docs/models/components/unifiedbenchmarkpricing.md @@ -1,4 +1,4 @@ -# BenchmarkPricing +# UnifiedBenchmarkPricing OpenRouter pricing per token for this model. Null if pricing is unavailable. diff --git a/docs/models/components/unifiedbenchmarksaaitem.md b/docs/models/components/unifiedbenchmarksaaitem.md new file mode 100644 index 00000000..e4e79545 --- /dev/null +++ b/docs/models/components/unifiedbenchmarksaaitem.md @@ -0,0 +1,14 @@ +# UnifiedBenchmarksAAItem + + +## Fields + +| Field | Type | Required | Description | Example | +| ---------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------- | +| `AgenticIndex` | `*float64` | :heavy_check_mark: | Artificial Analysis Agentic Index composite score. Higher is better. | 58.3 | +| `CodingIndex` | `*float64` | :heavy_check_mark: | Artificial Analysis Coding Index composite score. Higher is better. | 65.8 | +| `DisplayName` | `string` | :heavy_check_mark: | Model name as listed on Artificial Analysis. | GPT-4o | +| `IntelligenceIndex` | `*float64` | :heavy_check_mark: | Artificial Analysis Intelligence Index composite score. Higher is better. | 71.2 | +| `ModelPermaslug` | `string` | :heavy_check_mark: | Stable OpenRouter model identifier. | openai/gpt-4o | +| `Pricing` | [*components.UnifiedBenchmarkPricing](../../models/components/unifiedbenchmarkpricing.md) | :heavy_check_mark: | OpenRouter pricing per token for this model. Null if pricing is unavailable. | {
"completion": "0.000015",
"prompt": "0.000003"
} | +| `Source` | [components.UnifiedBenchmarksAAItemSource](../../models/components/unifiedbenchmarksaaitemsource.md) | :heavy_check_mark: | Benchmark source discriminator. | | \ No newline at end of file diff --git a/docs/models/components/unifiedbenchmarksaaitemsource.md b/docs/models/components/unifiedbenchmarksaaitemsource.md new file mode 100644 index 00000000..7ff18ebb --- /dev/null +++ b/docs/models/components/unifiedbenchmarksaaitemsource.md @@ -0,0 +1,20 @@ +# UnifiedBenchmarksAAItemSource + +Benchmark source discriminator. + +## Example Usage + +```go +import ( + "github.com/OpenRouterTeam/go-sdk/models/components" +) + +value := components.UnifiedBenchmarksAAItemSourceArtificialAnalysis +``` + + +## Values + +| Name | Value | +| ------------------------------------------------- | ------------------------------------------------- | +| `UnifiedBenchmarksAAItemSourceArtificialAnalysis` | artificial-analysis | \ No newline at end of file diff --git a/docs/models/components/unifiedbenchmarksdaitem.md b/docs/models/components/unifiedbenchmarksdaitem.md new file mode 100644 index 00000000..26ff4dc6 --- /dev/null +++ b/docs/models/components/unifiedbenchmarksdaitem.md @@ -0,0 +1,17 @@ +# UnifiedBenchmarksDAItem + + +## Fields + +| Field | Type | Required | Description | Example | +| ---------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------- | +| `Arena` | `string` | :heavy_check_mark: | Arena this ranking belongs to. | models | +| `AvgGenerationTimeMs` | `*float64` | :heavy_check_mark: | Average generation time in milliseconds. | 3200 | +| `Category` | `string` | :heavy_check_mark: | Category within the arena. | codecategories | +| `DisplayName` | `string` | :heavy_check_mark: | Human-readable model name from Design Arena. | Claude Sonnet 4 | +| `Elo` | `float64` | :heavy_check_mark: | ELO rating from head-to-head arena battles. | 1423 | +| `ModelPermaslug` | `string` | :heavy_check_mark: | Stable OpenRouter model identifier when mapped; otherwise the upstream Design Arena model id. | anthropic/claude-sonnet-4 | +| `Pricing` | [*components.UnifiedBenchmarkPricing](../../models/components/unifiedbenchmarkpricing.md) | :heavy_check_mark: | OpenRouter pricing per token for this model. Null if pricing is unavailable. | {
"completion": "0.000015",
"prompt": "0.000003"
} | +| `Source` | [components.UnifiedBenchmarksDAItemSource](../../models/components/unifiedbenchmarksdaitemsource.md) | :heavy_check_mark: | Benchmark source discriminator. | | +| `TournamentStats` | [components.TournamentStats](../../models/components/tournamentstats.md) | :heavy_check_mark: | Placement distribution from tournament matches. | | +| `WinRate` | `float64` | :heavy_check_mark: | Win rate as a percentage (0–100). | 72 | \ No newline at end of file diff --git a/docs/models/components/benchmarksaametasource.md b/docs/models/components/unifiedbenchmarksdaitemsource.md similarity index 57% rename from docs/models/components/benchmarksaametasource.md rename to docs/models/components/unifiedbenchmarksdaitemsource.md index 1fff3fd8..abe0024b 100644 --- a/docs/models/components/benchmarksaametasource.md +++ b/docs/models/components/unifiedbenchmarksdaitemsource.md @@ -1,6 +1,6 @@ -# BenchmarksAAMetaSource +# UnifiedBenchmarksDAItemSource -Data source identifier. +Benchmark source discriminator. ## Example Usage @@ -9,7 +9,7 @@ import ( "github.com/OpenRouterTeam/go-sdk/models/components" ) -value := components.BenchmarksAAMetaSourceArtificialAnalysis +value := components.UnifiedBenchmarksDAItemSourceDesignArena ``` @@ -17,4 +17,4 @@ value := components.BenchmarksAAMetaSourceArtificialAnalysis | Name | Value | | ------------------------------------------ | ------------------------------------------ | -| `BenchmarksAAMetaSourceArtificialAnalysis` | artificial-analysis | \ No newline at end of file +| `UnifiedBenchmarksDAItemSourceDesignArena` | design-arena | \ No newline at end of file diff --git a/docs/models/components/unifiedbenchmarksmeta.md b/docs/models/components/unifiedbenchmarksmeta.md new file mode 100644 index 00000000..0848c4a6 --- /dev/null +++ b/docs/models/components/unifiedbenchmarksmeta.md @@ -0,0 +1,14 @@ +# UnifiedBenchmarksMeta + + +## Fields + +| Field | Type | Required | Description | Example | +| -------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `AsOf` | `string` | :heavy_check_mark: | ISO-8601 timestamp of when this data was last updated. | 2026-06-03T12:00:00Z | +| `Citation` | `*string` | :heavy_check_mark: | Required attribution when republishing this data, or null when results span multiple sources (attribute each item individually by its `source` discriminator). | Source: Artificial Analysis (artificialanalysis.ai) via OpenRouter (openrouter.ai/rankings). | +| `ModelCount` | `int64` | :heavy_check_mark: | Number of unique models in the response. | | +| `Source` | [*components.UnifiedBenchmarksMetaSource](../../models/components/unifiedbenchmarksmetasource.md) | :heavy_check_mark: | The source filter applied, or null when all sources are returned. | artificial-analysis | +| `SourceURL` | `*string` | :heavy_check_mark: | URL of the upstream data source, or null when results span multiple sources. | https://artificialanalysis.ai | +| `TaskType` | `*string` | :heavy_check_mark: | The task_type filter applied, or null if showing all. | | +| `Version` | [components.UnifiedBenchmarksMetaVersion](../../models/components/unifiedbenchmarksmetaversion.md) | :heavy_check_mark: | Dataset version. | | \ No newline at end of file diff --git a/docs/models/components/unifiedbenchmarksmetasource.md b/docs/models/components/unifiedbenchmarksmetasource.md new file mode 100644 index 00000000..8e3c511d --- /dev/null +++ b/docs/models/components/unifiedbenchmarksmetasource.md @@ -0,0 +1,24 @@ +# UnifiedBenchmarksMetaSource + +The source filter applied, or null when all sources are returned. + +## Example Usage + +```go +import ( + "github.com/OpenRouterTeam/go-sdk/models/components" +) + +value := components.UnifiedBenchmarksMetaSourceArtificialAnalysis + +// Open enum: custom values can be created with a direct type cast +custom := components.UnifiedBenchmarksMetaSource("custom_value") +``` + + +## Values + +| Name | Value | +| ----------------------------------------------- | ----------------------------------------------- | +| `UnifiedBenchmarksMetaSourceArtificialAnalysis` | artificial-analysis | +| `UnifiedBenchmarksMetaSourceDesignArena` | design-arena | \ No newline at end of file diff --git a/docs/models/components/unifiedbenchmarksmetaversion.md b/docs/models/components/unifiedbenchmarksmetaversion.md new file mode 100644 index 00000000..21fa5936 --- /dev/null +++ b/docs/models/components/unifiedbenchmarksmetaversion.md @@ -0,0 +1,20 @@ +# UnifiedBenchmarksMetaVersion + +Dataset version. + +## Example Usage + +```go +import ( + "github.com/OpenRouterTeam/go-sdk/models/components" +) + +value := components.UnifiedBenchmarksMetaVersionV1 +``` + + +## Values + +| Name | Value | +| -------------------------------- | -------------------------------- | +| `UnifiedBenchmarksMetaVersionV1` | v1 | \ No newline at end of file diff --git a/docs/models/components/benchmarksaaresponse.md b/docs/models/components/unifiedbenchmarksresponse.md similarity index 66% rename from docs/models/components/benchmarksaaresponse.md rename to docs/models/components/unifiedbenchmarksresponse.md index 3961f84a..f842f609 100644 --- a/docs/models/components/benchmarksaaresponse.md +++ b/docs/models/components/unifiedbenchmarksresponse.md @@ -1,9 +1,9 @@ -# BenchmarksAAResponse +# UnifiedBenchmarksResponse ## Fields -| Field | Type | Required | Description | Example | -| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `Data` | [][components.BenchmarksAAItem](../../models/components/benchmarksaaitem.md) | :heavy_check_mark: | N/A | | -| `Meta` | [components.BenchmarksAAMeta](../../models/components/benchmarksaameta.md) | :heavy_check_mark: | N/A | {
"as_of": "2026-06-03T12:00:00Z",
"citation": "Source: Artificial Analysis (artificialanalysis.ai) via OpenRouter (openrouter.ai/rankings).",
"model_count": 50,
"source": "artificial-analysis",
"source_url": "https://artificialanalysis.ai",
"version": "v1"
} | \ No newline at end of file +| Field | Type | Required | Description | Example | +| -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `Data` | [][components.UnifiedBenchmarksResponseData](../../models/components/unifiedbenchmarksresponsedata.md) | :heavy_check_mark: | N/A | | +| `Meta` | [components.UnifiedBenchmarksMeta](../../models/components/unifiedbenchmarksmeta.md) | :heavy_check_mark: | N/A | {
"as_of": "2026-06-03T12:00:00Z",
"citation": "Source: Artificial Analysis (artificialanalysis.ai) via OpenRouter (openrouter.ai/rankings).",
"model_count": 50,
"source": "artificial-analysis",
"source_url": "https://artificialanalysis.ai",
"task_type": null,
"version": "v1"
} | \ No newline at end of file diff --git a/docs/models/components/unifiedbenchmarksresponsedata.md b/docs/models/components/unifiedbenchmarksresponsedata.md new file mode 100644 index 00000000..7d776006 --- /dev/null +++ b/docs/models/components/unifiedbenchmarksresponsedata.md @@ -0,0 +1,31 @@ +# UnifiedBenchmarksResponseData + + +## Supported Types + +### UnifiedBenchmarksAAItem + +```go +unifiedBenchmarksResponseData := components.CreateUnifiedBenchmarksResponseDataArtificialAnalysis(components.UnifiedBenchmarksAAItem{/* values here */}) +``` + +### UnifiedBenchmarksDAItem + +```go +unifiedBenchmarksResponseData := components.CreateUnifiedBenchmarksResponseDataDesignArena(components.UnifiedBenchmarksDAItem{/* values here */}) +``` + +## Union Discrimination + +Use the `Type` field to determine which variant is active, then access the corresponding field: + +```go +switch unifiedBenchmarksResponseData.Type { + case components.UnifiedBenchmarksResponseDataTypeArtificialAnalysis: + // unifiedBenchmarksResponseData.UnifiedBenchmarksAAItem is populated + case components.UnifiedBenchmarksResponseDataTypeDesignArena: + // unifiedBenchmarksResponseData.UnifiedBenchmarksDAItem is populated + default: + // Unknown type - use unifiedBenchmarksResponseData.GetUnknownRaw() for raw JSON +} +``` diff --git a/docs/models/components/quality.md b/docs/models/components/unit.md similarity index 51% rename from docs/models/components/quality.md rename to docs/models/components/unit.md index 54ea4234..b6ebf34e 100644 --- a/docs/models/components/quality.md +++ b/docs/models/components/unit.md @@ -1,4 +1,4 @@ -# Quality +# Unit ## Example Usage @@ -7,10 +7,10 @@ import ( "github.com/OpenRouterTeam/go-sdk/models/components" ) -value := components.QualityLow +value := components.UnitImage // Open enum: custom values can be created with a direct type cast -custom := components.Quality("custom_value") +custom := components.Unit("custom_value") ``` @@ -18,7 +18,6 @@ custom := components.Quality("custom_value") | Name | Value | | --------------- | --------------- | -| `QualityLow` | low | -| `QualityMedium` | medium | -| `QualityHigh` | high | -| `QualityAuto` | auto | \ No newline at end of file +| `UnitImage` | image | +| `UnitMegapixel` | megapixel | +| `UnitToken` | token | \ No newline at end of file diff --git a/docs/models/components/updatebyokkeyrequest.md b/docs/models/components/updatebyokkeyrequest.md index b4403546..e8a92dd7 100644 --- a/docs/models/components/updatebyokkeyrequest.md +++ b/docs/models/components/updatebyokkeyrequest.md @@ -5,8 +5,8 @@ | Field | Type | Required | Description | Example | | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `AllowedModels` | optionalnullable.OptionalNullable[[]`string`] | :heavy_minus_sign: | Optional allowlist of model slugs this credential may be used for. `null` means no restriction. | null | -| `AllowedUserIds` | optionalnullable.OptionalNullable[[]`string`] | :heavy_minus_sign: | Optional allowlist of user IDs that may use this credential. `null` means no restriction. | null | +| `AllowedModels` | optionalnullable.OptionalNullable[[]`string`] | :heavy_minus_sign: | Optional allowlist of model slugs this credential may be used for. `null` means no restriction. | | +| `AllowedUserIds` | optionalnullable.OptionalNullable[[]`string`] | :heavy_minus_sign: | Optional allowlist of user IDs that may use this credential. `null` means no restriction. | | | `Disabled` | `*bool` | :heavy_minus_sign: | Whether this credential is disabled. | false | | `IsFallback` | `*bool` | :heavy_minus_sign: | Whether this credential is treated as a fallback — used only after non-fallback keys for the same provider have been tried. | false | | `Key` | `*string` | :heavy_minus_sign: | A new raw provider API key to rotate the credential in-place. The previous key material is overwritten and the masked label is regenerated. Encrypted at rest and never returned in API responses. | sk-proj-newkey456... | diff --git a/docs/models/components/updateguardrailrequest.md b/docs/models/components/updateguardrailrequest.md index c0137320..26d0530a 100644 --- a/docs/models/components/updateguardrailrequest.md +++ b/docs/models/components/updateguardrailrequest.md @@ -8,7 +8,7 @@ | `AllowedModels` | optionalnullable.OptionalNullable[[]`string`] | :heavy_minus_sign: | Array of model identifiers (slug or canonical_slug accepted) | [
"openai/gpt-5.2"
] | | `AllowedProviders` | optionalnullable.OptionalNullable[[]`string`] | :heavy_minus_sign: | New list of allowed provider IDs | [
"openai",
"anthropic",
"deepseek"
] | | `ContentFilterBuiltins` | optionalnullable.OptionalNullable[[][components.ContentFilterBuiltinEntryInput](../../models/components/contentfilterbuiltinentryinput.md)] | :heavy_minus_sign: | Builtin content filters to apply. Set to null to remove. The "flag" action is only supported for "regex-prompt-injection"; PII slugs (email, phone, ssn, credit-card, ip-address, person-name, address) accept "block" or "redact" only. | [
{
"action": "block",
"slug": "regex-prompt-injection"
}
] | -| `ContentFilters` | optionalnullable.OptionalNullable[[][components.ContentFilterEntry](../../models/components/contentfilterentry.md)] | :heavy_minus_sign: | Custom regex content filters to apply. Set to null to remove. | null | +| `ContentFilters` | optionalnullable.OptionalNullable[[][components.ContentFilterEntry](../../models/components/contentfilterentry.md)] | :heavy_minus_sign: | Custom regex content filters to apply. Set to null to remove. | | | `Description` | optionalnullable.OptionalNullable[`string`] | :heavy_minus_sign: | New description for the guardrail | Updated description | | ~~`EnforceZdr`~~ | optionalnullable.OptionalNullable[`bool`] | :heavy_minus_sign: | : warning: ** DEPRECATED **: This will be removed in a future release, please migrate away from it as soon as possible.

Deprecated. Use enforce_zdr_anthropic, enforce_zdr_openai, enforce_zdr_google, and enforce_zdr_other instead. When provided, its value is copied into any of those per-provider fields that are not explicitly specified on the request. | true | | `EnforceZdrAnthropic` | optionalnullable.OptionalNullable[`bool`] | :heavy_minus_sign: | Whether to enforce zero data retention for Anthropic models. Falls back to enforce_zdr when not provided. | true | diff --git a/docs/models/components/updateobservabilitydestinationrequest.md b/docs/models/components/updateobservabilitydestinationrequest.md index 3aa8de7c..68d7c6bb 100644 --- a/docs/models/components/updateobservabilitydestinationrequest.md +++ b/docs/models/components/updateobservabilitydestinationrequest.md @@ -5,10 +5,10 @@ | Field | Type | Required | Description | Example | | -------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `APIKeyHashes` | optionalnullable.OptionalNullable[[]`string`] | :heavy_minus_sign: | Optional allowlist of OpenRouter API key hashes. `null` clears the filter (all keys). Omitting leaves the current value. Must contain at least one hash if provided. | null | +| `APIKeyHashes` | optionalnullable.OptionalNullable[[]`string`] | :heavy_minus_sign: | Optional allowlist of OpenRouter API key hashes. `null` clears the filter (all keys). Omitting leaves the current value. Must contain at least one hash if provided. | | | `Config` | map[string]`any` | :heavy_minus_sign: | Provider-specific configuration fields to update. Masked values are ignored; unset fields keep their current value. | {
"baseUrl": "https://us.cloud.langfuse.com",
"publicKey": "pk-l...EfGh",
"secretKey": "sk-l...AbCd"
} | | `Enabled` | `*bool` | :heavy_minus_sign: | Whether the destination is enabled. | true | -| `FilterRules` | optionalnullable.OptionalNullable[[components.ObservabilityFilterRulesConfig](../../models/components/observabilityfilterrulesconfig.md)] | :heavy_minus_sign: | N/A | null | +| `FilterRules` | optionalnullable.OptionalNullable[[components.ObservabilityFilterRulesConfig](../../models/components/observabilityfilterrulesconfig.md)] | :heavy_minus_sign: | N/A | | | `Name` | `*string` | :heavy_minus_sign: | Human-readable name for the destination. | Production Langfuse | | `PrivacyMode` | `*bool` | :heavy_minus_sign: | When true, request/response bodies are not forwarded — only metadata. | false | | `SamplingRate` | `*float64` | :heavy_minus_sign: | Sampling rate between 0.0001 and 1 (1 = 100%). | 1 | \ No newline at end of file diff --git a/docs/models/components/updateworkspacerequest.md b/docs/models/components/updateworkspacerequest.md index 83b157b5..fe68bb21 100644 --- a/docs/models/components/updateworkspacerequest.md +++ b/docs/models/components/updateworkspacerequest.md @@ -9,7 +9,7 @@ | `DefaultProviderSort` | optionalnullable.OptionalNullable[`string`] | :heavy_minus_sign: | Default provider sort preference (price, throughput, latency, exacto) | price | | `DefaultTextModel` | optionalnullable.OptionalNullable[`string`] | :heavy_minus_sign: | Default text model for this workspace | openai/gpt-4o | | `Description` | optionalnullable.OptionalNullable[`string`] | :heavy_minus_sign: | New description for the workspace | Updated description | -| `IoLoggingAPIKeyIds` | optionalnullable.OptionalNullable[[]`int64`] | :heavy_minus_sign: | Optional array of API key IDs to filter I/O logging | null | +| `IoLoggingAPIKeyIds` | optionalnullable.OptionalNullable[[]`int64`] | :heavy_minus_sign: | Optional array of API key IDs to filter I/O logging | | | `IoLoggingSamplingRate` | `*float64` | :heavy_minus_sign: | Sampling rate for I/O logging (0.0001-1) | 1 | | `IsDataDiscountLoggingEnabled` | `*bool` | :heavy_minus_sign: | Whether data discount logging is enabled | true | | `IsObservabilityBroadcastEnabled` | `*bool` | :heavy_minus_sign: | Whether broadcast is enabled | false | diff --git a/docs/models/components/upsertworkspacebudgetrequest.md b/docs/models/components/upsertworkspacebudgetrequest.md new file mode 100644 index 00000000..981592ad --- /dev/null +++ b/docs/models/components/upsertworkspacebudgetrequest.md @@ -0,0 +1,8 @@ +# UpsertWorkspaceBudgetRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| ---------------------------------------------- | ---------------------------------------------- | ---------------------------------------------- | ---------------------------------------------- | ---------------------------------------------- | +| `LimitUsd` | `float64` | :heavy_check_mark: | Spending limit in USD. Must be greater than 0. | 100 | \ No newline at end of file diff --git a/docs/models/components/upsertworkspacebudgetresponse.md b/docs/models/components/upsertworkspacebudgetresponse.md new file mode 100644 index 00000000..c72a201b --- /dev/null +++ b/docs/models/components/upsertworkspacebudgetresponse.md @@ -0,0 +1,8 @@ +# UpsertWorkspaceBudgetResponse + + +## Fields + +| Field | Type | Required | Description | Example | +| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `Data` | [components.WorkspaceBudget](../../models/components/workspacebudget.md) | :heavy_check_mark: | N/A | {
"created_at": "2025-08-24T10:30:00Z",
"id": "770e8400-e29b-41d4-a716-446655440000",
"limit_usd": 100,
"reset_interval": "monthly",
"updated_at": "2025-08-24T15:45:00Z",
"workspace_id": "550e8400-e29b-41d4-a716-446655440000"
} | \ No newline at end of file diff --git a/docs/models/components/videogenerationrequest.md b/docs/models/components/videogenerationrequest.md index 42fffa6b..5cd5d932 100644 --- a/docs/models/components/videogenerationrequest.md +++ b/docs/models/components/videogenerationrequest.md @@ -5,7 +5,7 @@ | Field | Type | Required | Description | Example | | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `AspectRatio` | [*components.AspectRatio](../../models/components/aspectratio.md) | :heavy_minus_sign: | Aspect ratio of the generated video | 16:9 | +| `AspectRatio` | [*components.VideoGenerationRequestAspectRatio](../../models/components/videogenerationrequestaspectratio.md) | :heavy_minus_sign: | Aspect ratio of the generated video | 16:9 | | `CallbackURL` | `*string` | :heavy_minus_sign: | URL to receive a webhook notification when the video generation job completes. Overrides the workspace-level default callback URL if set. Must be HTTPS. | https://example.com/webhook | | `Duration` | `*int64` | :heavy_minus_sign: | Duration of the generated video in seconds | 8 | | `FrameImages` | [][components.FrameImage](../../models/components/frameimage.md) | :heavy_minus_sign: | Images to use as the first and/or last frame of the generated video. Each image must specify a frame_type of first_frame or last_frame. | | @@ -14,6 +14,6 @@ | `Model` | `string` | :heavy_check_mark: | N/A | | | `Prompt` | `string` | :heavy_check_mark: | N/A | | | `Provider` | [*components.VideoGenerationRequestProvider](../../models/components/videogenerationrequestprovider.md) | :heavy_minus_sign: | Provider-specific passthrough configuration | | -| `Resolution` | [*components.Resolution](../../models/components/resolution.md) | :heavy_minus_sign: | Resolution of the generated video | 720p | +| `Resolution` | [*components.VideoGenerationRequestResolution](../../models/components/videogenerationrequestresolution.md) | :heavy_minus_sign: | Resolution of the generated video | 720p | | `Seed` | `*int64` | :heavy_minus_sign: | If specified, the generation will sample deterministically, such that repeated requests with the same seed and parameters should return the same result. Determinism is not guaranteed for all providers. | | | `Size` | `*string` | :heavy_minus_sign: | Exact pixel dimensions of the generated video in "WIDTHxHEIGHT" format (e.g. "1280x720"). Interchangeable with resolution + aspect_ratio. | 1280x720 | \ No newline at end of file diff --git a/docs/models/components/videogenerationrequestaspectratio.md b/docs/models/components/videogenerationrequestaspectratio.md new file mode 100644 index 00000000..2260c5b2 --- /dev/null +++ b/docs/models/components/videogenerationrequestaspectratio.md @@ -0,0 +1,31 @@ +# VideoGenerationRequestAspectRatio + +Aspect ratio of the generated video + +## Example Usage + +```go +import ( + "github.com/OpenRouterTeam/go-sdk/models/components" +) + +value := components.VideoGenerationRequestAspectRatioOneHundredAndSixtyNine + +// Open enum: custom values can be created with a direct type cast +custom := components.VideoGenerationRequestAspectRatio("custom_value") +``` + + +## Values + +| Name | Value | +| ---------------------------------------------------------- | ---------------------------------------------------------- | +| `VideoGenerationRequestAspectRatioOneHundredAndSixtyNine` | 16:9 | +| `VideoGenerationRequestAspectRatioNineHundredAndSixteen` | 9:16 | +| `VideoGenerationRequestAspectRatioEleven` | 1:1 | +| `VideoGenerationRequestAspectRatioFortyThree` | 4:3 | +| `VideoGenerationRequestAspectRatioThirtyFour` | 3:4 | +| `VideoGenerationRequestAspectRatioThirtyTwo` | 3:2 | +| `VideoGenerationRequestAspectRatioTwentyThree` | 2:3 | +| `VideoGenerationRequestAspectRatioTwoHundredAndNineteen` | 21:9 | +| `VideoGenerationRequestAspectRatioNineHundredAndTwentyOne` | 9:21 | \ No newline at end of file diff --git a/docs/models/components/videogenerationrequestoptions.md b/docs/models/components/videogenerationrequestoptions.md new file mode 100644 index 00000000..dc2a0b17 --- /dev/null +++ b/docs/models/components/videogenerationrequestoptions.md @@ -0,0 +1,125 @@ +# VideoGenerationRequestOptions + +Provider-specific options keyed by provider slug. Only options for the matched provider are forwarded; the rest are ignored. Unrecognized keys are silently dropped. + + +## Fields + +| Field | Type | Required | Description | +| --------------------- | --------------------- | --------------------- | --------------------- | +| `Oneai` | map[string]`any` | :heavy_minus_sign: | N/A | +| `Ai21` | map[string]`any` | :heavy_minus_sign: | N/A | +| `AionLabs` | map[string]`any` | :heavy_minus_sign: | N/A | +| `Akashml` | map[string]`any` | :heavy_minus_sign: | N/A | +| `Alibaba` | map[string]`any` | :heavy_minus_sign: | N/A | +| `AmazonBedrock` | map[string]`any` | :heavy_minus_sign: | N/A | +| `AmazonNova` | map[string]`any` | :heavy_minus_sign: | N/A | +| `Ambient` | map[string]`any` | :heavy_minus_sign: | N/A | +| `Anthropic` | map[string]`any` | :heavy_minus_sign: | N/A | +| `Anyscale` | map[string]`any` | :heavy_minus_sign: | N/A | +| `ArceeAi` | map[string]`any` | :heavy_minus_sign: | N/A | +| `AtlasCloud` | map[string]`any` | :heavy_minus_sign: | N/A | +| `Atoma` | map[string]`any` | :heavy_minus_sign: | N/A | +| `Avian` | map[string]`any` | :heavy_minus_sign: | N/A | +| `Azure` | map[string]`any` | :heavy_minus_sign: | N/A | +| `Baidu` | map[string]`any` | :heavy_minus_sign: | N/A | +| `Baseten` | map[string]`any` | :heavy_minus_sign: | N/A | +| `BlackForestLabs` | map[string]`any` | :heavy_minus_sign: | N/A | +| `Byteplus` | map[string]`any` | :heavy_minus_sign: | N/A | +| `Centml` | map[string]`any` | :heavy_minus_sign: | N/A | +| `Cerebras` | map[string]`any` | :heavy_minus_sign: | N/A | +| `Chutes` | map[string]`any` | :heavy_minus_sign: | N/A | +| `Cirrascale` | map[string]`any` | :heavy_minus_sign: | N/A | +| `Clarifai` | map[string]`any` | :heavy_minus_sign: | N/A | +| `Cloudflare` | map[string]`any` | :heavy_minus_sign: | N/A | +| `Cohere` | map[string]`any` | :heavy_minus_sign: | N/A | +| `Crofai` | map[string]`any` | :heavy_minus_sign: | N/A | +| `Crucible` | map[string]`any` | :heavy_minus_sign: | N/A | +| `Crusoe` | map[string]`any` | :heavy_minus_sign: | N/A | +| `Darkbloom` | map[string]`any` | :heavy_minus_sign: | N/A | +| `Decart` | map[string]`any` | :heavy_minus_sign: | N/A | +| `Deepinfra` | map[string]`any` | :heavy_minus_sign: | N/A | +| `Deepseek` | map[string]`any` | :heavy_minus_sign: | N/A | +| `Dekallm` | map[string]`any` | :heavy_minus_sign: | N/A | +| `Digitalocean` | map[string]`any` | :heavy_minus_sign: | N/A | +| `Enfer` | map[string]`any` | :heavy_minus_sign: | N/A | +| `FakeProvider` | map[string]`any` | :heavy_minus_sign: | N/A | +| `Featherless` | map[string]`any` | :heavy_minus_sign: | N/A | +| `Fireworks` | map[string]`any` | :heavy_minus_sign: | N/A | +| `Friendli` | map[string]`any` | :heavy_minus_sign: | N/A | +| `Gmicloud` | map[string]`any` | :heavy_minus_sign: | N/A | +| `GoogleAiStudio` | map[string]`any` | :heavy_minus_sign: | N/A | +| `GoogleVertex` | map[string]`any` | :heavy_minus_sign: | N/A | +| `Gopomelo` | map[string]`any` | :heavy_minus_sign: | N/A | +| `Groq` | map[string]`any` | :heavy_minus_sign: | N/A | +| `Huggingface` | map[string]`any` | :heavy_minus_sign: | N/A | +| `Hyperbolic` | map[string]`any` | :heavy_minus_sign: | N/A | +| `HyperbolicQuantized` | map[string]`any` | :heavy_minus_sign: | N/A | +| `Inception` | map[string]`any` | :heavy_minus_sign: | N/A | +| `Inceptron` | map[string]`any` | :heavy_minus_sign: | N/A | +| `InferenceNet` | map[string]`any` | :heavy_minus_sign: | N/A | +| `Infermatic` | map[string]`any` | :heavy_minus_sign: | N/A | +| `Inflection` | map[string]`any` | :heavy_minus_sign: | N/A | +| `Inocloud` | map[string]`any` | :heavy_minus_sign: | N/A | +| `IoNet` | map[string]`any` | :heavy_minus_sign: | N/A | +| `Ionstream` | map[string]`any` | :heavy_minus_sign: | N/A | +| `Klusterai` | map[string]`any` | :heavy_minus_sign: | N/A | +| `Lambda` | map[string]`any` | :heavy_minus_sign: | N/A | +| `Lepton` | map[string]`any` | :heavy_minus_sign: | N/A | +| `Liquid` | map[string]`any` | :heavy_minus_sign: | N/A | +| `Lynn` | map[string]`any` | :heavy_minus_sign: | N/A | +| `LynnPrivate` | map[string]`any` | :heavy_minus_sign: | N/A | +| `Mancer` | map[string]`any` | :heavy_minus_sign: | N/A | +| `MancerOld` | map[string]`any` | :heavy_minus_sign: | N/A | +| `Mara` | map[string]`any` | :heavy_minus_sign: | N/A | +| `Meta` | map[string]`any` | :heavy_minus_sign: | N/A | +| `Minimax` | map[string]`any` | :heavy_minus_sign: | N/A | +| `Mistral` | map[string]`any` | :heavy_minus_sign: | N/A | +| `Modal` | map[string]`any` | :heavy_minus_sign: | N/A | +| `Modelrun` | map[string]`any` | :heavy_minus_sign: | N/A | +| `Modular` | map[string]`any` | :heavy_minus_sign: | N/A | +| `Moonshotai` | map[string]`any` | :heavy_minus_sign: | N/A | +| `Morph` | map[string]`any` | :heavy_minus_sign: | N/A | +| `Ncompass` | map[string]`any` | :heavy_minus_sign: | N/A | +| `Nebius` | map[string]`any` | :heavy_minus_sign: | N/A | +| `NexAgi` | map[string]`any` | :heavy_minus_sign: | N/A | +| `Nextbit` | map[string]`any` | :heavy_minus_sign: | N/A | +| `Nineteen` | map[string]`any` | :heavy_minus_sign: | N/A | +| `Novita` | map[string]`any` | :heavy_minus_sign: | N/A | +| `Nvidia` | map[string]`any` | :heavy_minus_sign: | N/A | +| `Octoai` | map[string]`any` | :heavy_minus_sign: | N/A | +| `OpenInference` | map[string]`any` | :heavy_minus_sign: | N/A | +| `Openai` | map[string]`any` | :heavy_minus_sign: | N/A | +| `Parasail` | map[string]`any` | :heavy_minus_sign: | N/A | +| `Perceptron` | map[string]`any` | :heavy_minus_sign: | N/A | +| `Perplexity` | map[string]`any` | :heavy_minus_sign: | N/A | +| `Phala` | map[string]`any` | :heavy_minus_sign: | N/A | +| `Poolside` | map[string]`any` | :heavy_minus_sign: | N/A | +| `Recraft` | map[string]`any` | :heavy_minus_sign: | N/A | +| `Recursal` | map[string]`any` | :heavy_minus_sign: | N/A | +| `Reflection` | map[string]`any` | :heavy_minus_sign: | N/A | +| `Reka` | map[string]`any` | :heavy_minus_sign: | N/A | +| `Relace` | map[string]`any` | :heavy_minus_sign: | N/A | +| `Replicate` | map[string]`any` | :heavy_minus_sign: | N/A | +| `Sambanova` | map[string]`any` | :heavy_minus_sign: | N/A | +| `SambanovaCloaked` | map[string]`any` | :heavy_minus_sign: | N/A | +| `Seed` | map[string]`any` | :heavy_minus_sign: | N/A | +| `SfCompute` | map[string]`any` | :heavy_minus_sign: | N/A | +| `Siliconflow` | map[string]`any` | :heavy_minus_sign: | N/A | +| `Sourceful` | map[string]`any` | :heavy_minus_sign: | N/A | +| `Stealth` | map[string]`any` | :heavy_minus_sign: | N/A | +| `Stepfun` | map[string]`any` | :heavy_minus_sign: | N/A | +| `Streamlake` | map[string]`any` | :heavy_minus_sign: | N/A | +| `Switchpoint` | map[string]`any` | :heavy_minus_sign: | N/A | +| `Targon` | map[string]`any` | :heavy_minus_sign: | N/A | +| `Tenstorrent` | map[string]`any` | :heavy_minus_sign: | N/A | +| `Together` | map[string]`any` | :heavy_minus_sign: | N/A | +| `TogetherLite` | map[string]`any` | :heavy_minus_sign: | N/A | +| `Ubicloud` | map[string]`any` | :heavy_minus_sign: | N/A | +| `Upstage` | map[string]`any` | :heavy_minus_sign: | N/A | +| `Venice` | map[string]`any` | :heavy_minus_sign: | N/A | +| `Wafer` | map[string]`any` | :heavy_minus_sign: | N/A | +| `Wandb` | map[string]`any` | :heavy_minus_sign: | N/A | +| `Xai` | map[string]`any` | :heavy_minus_sign: | N/A | +| `Xiaomi` | map[string]`any` | :heavy_minus_sign: | N/A | +| `ZAi` | map[string]`any` | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/components/videogenerationrequestprovider.md b/docs/models/components/videogenerationrequestprovider.md index 49a8222a..06acf3fe 100644 --- a/docs/models/components/videogenerationrequestprovider.md +++ b/docs/models/components/videogenerationrequestprovider.md @@ -5,6 +5,6 @@ Provider-specific passthrough configuration ## Fields -| Field | Type | Required | Description | Example | -| --------------------------------------------------------------- | --------------------------------------------------------------- | --------------------------------------------------------------- | --------------------------------------------------------------- | --------------------------------------------------------------- | -| `Options` | [*components.OptionsObj](../../models/components/optionsobj.md) | :heavy_minus_sign: | N/A | {
"google-vertex": {
"output_config": {
"effort": "low"
}
}
} | \ No newline at end of file +| Field | Type | Required | Description | Example | +| ----------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------- | +| `Options` | [*components.VideoGenerationRequestOptions](../../models/components/videogenerationrequestoptions.md) | :heavy_minus_sign: | N/A | {
"google-vertex": {
"output_config": {
"effort": "low"
}
}
} | \ No newline at end of file diff --git a/docs/models/components/videogenerationrequestresolution.md b/docs/models/components/videogenerationrequestresolution.md new file mode 100644 index 00000000..6a00ba11 --- /dev/null +++ b/docs/models/components/videogenerationrequestresolution.md @@ -0,0 +1,28 @@ +# VideoGenerationRequestResolution + +Resolution of the generated video + +## Example Usage + +```go +import ( + "github.com/OpenRouterTeam/go-sdk/models/components" +) + +value := components.VideoGenerationRequestResolutionFourHundredAndEightyp + +// Open enum: custom values can be created with a direct type cast +custom := components.VideoGenerationRequestResolution("custom_value") +``` + + +## Values + +| Name | Value | +| -------------------------------------------------------- | -------------------------------------------------------- | +| `VideoGenerationRequestResolutionFourHundredAndEightyp` | 480p | +| `VideoGenerationRequestResolutionSevenHundredAndTwentyp` | 720p | +| `VideoGenerationRequestResolutionOneThousandAndEightyp` | 1080p | +| `VideoGenerationRequestResolutionOneK` | 1K | +| `VideoGenerationRequestResolutionTwoK` | 2K | +| `VideoGenerationRequestResolutionFourK` | 4K | \ No newline at end of file diff --git a/docs/models/components/websearchconfig.md b/docs/models/components/websearchconfig.md index 61fea616..80dbd8cc 100644 --- a/docs/models/components/websearchconfig.md +++ b/docs/models/components/websearchconfig.md @@ -9,7 +9,7 @@ | `Engine` | [*components.WebSearchEngineEnum](../../models/components/websearchengineenum.md) | :heavy_minus_sign: | Which search engine to use. "auto" (default) uses native if the provider supports it, otherwise Exa. "native" forces the provider's built-in search. "exa" forces the Exa search API. "firecrawl" uses Firecrawl (requires BYOK). "parallel" uses the Parallel search API. "perplexity" uses the Perplexity Search API (raw ranked results). | auto | | `ExcludedDomains` | []`string` | :heavy_minus_sign: | Exclude search results from these domains. Supported by Exa, Firecrawl, Parallel, Perplexity, Anthropic, and xAI. Not supported with OpenAI (silently ignored). Cannot be used with allowed_domains. | | | `MaxCharacters` | `*int64` | :heavy_minus_sign: | Exact maximum number of characters of content per search result. Applies to the Exa, Parallel, and Perplexity engines; ignored with native provider search and Firecrawl. For Exa, caps highlight content per result. For Parallel, caps excerpt content per result (default 1,500 when omitted). For Perplexity, maps to the native `max_tokens_per_page` parameter (converted from characters to tokens) and trims the response to the exact character cap. When both `max_characters` and `search_context_size` are set, `max_characters` takes precedence. When omitted, falls back to `search_context_size` mapping (Exa) or engine defaults (Parallel, Perplexity). | 2000 | -| `MaxResults` | `*int64` | :heavy_minus_sign: | Maximum number of search results to return per search call. Defaults to 5. Applies to Exa, Firecrawl, Parallel, and Perplexity engines; ignored with native provider search. | 5 | +| `MaxResults` | `*int64` | :heavy_minus_sign: | Maximum number of search results to return per search call. Defaults to 5. Applies to Exa, Firecrawl, Parallel, and Perplexity engines; ignored with native provider search. Perplexity supports a maximum of 20; values above 20 are clamped. | 5 | | `MaxTotalResults` | `*int64` | :heavy_minus_sign: | Maximum total number of search results across all search calls in a single request. Once this limit is reached, the tool will stop returning new results. Useful for controlling cost and context size in agentic loops. Defaults to 50 when not specified. | 50 | | `SearchContextSize` | [*components.SearchQualityLevel](../../models/components/searchqualitylevel.md) | :heavy_minus_sign: | How much context to retrieve per result. Applies to Exa, Parallel, and Perplexity engines; ignored with native provider search and Firecrawl. For Exa, pins a fixed per-result character cap (low=5,000, medium=15,000, high=30,000); when omitted, Exa picks an adaptive size per query and document (typically ~2,000–4,000 characters per result). For Parallel, controls the total characters across all results; when omitted, Parallel uses its own default size. For Perplexity, maps directly to the Search API's native search_context_size parameter. Overridden by `max_characters` when both are set. | medium | | `UserLocation` | [*components.WebSearchUserLocationServerTool](../../models/components/websearchuserlocationservertool.md) | :heavy_minus_sign: | Approximate user location for location-biased results. | {
"city": "San Francisco",
"country": "US",
"region": "California",
"timezone": "America/Los_Angeles",
"type": "approximate"
} | \ No newline at end of file diff --git a/docs/models/components/websearchservertool.md b/docs/models/components/websearchservertool.md index 8d7df2c0..e9fd0582 100644 --- a/docs/models/components/websearchservertool.md +++ b/docs/models/components/websearchservertool.md @@ -9,7 +9,7 @@ Web search tool configuration (2025-08-26 version) | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `Engine` | [*components.WebSearchEngineEnum](../../models/components/websearchengineenum.md) | :heavy_minus_sign: | Which search engine to use. "auto" (default) uses native if the provider supports it, otherwise Exa. "native" forces the provider's built-in search. "exa" forces the Exa search API. "firecrawl" uses Firecrawl (requires BYOK). "parallel" uses the Parallel search API. "perplexity" uses the Perplexity Search API (raw ranked results). | auto | | `Filters` | optionalnullable.OptionalNullable[[components.WebSearchDomainFilter](../../models/components/websearchdomainfilter.md)] | :heavy_minus_sign: | N/A | {
"allowed_domains": [
"example.com"
],
"excluded_domains": [
"spam.com"
]
} | -| `MaxResults` | `*int64` | :heavy_minus_sign: | Maximum number of search results to return per search call. Defaults to 5. Applies to Exa, Firecrawl, Parallel, and Perplexity engines; ignored with native provider search. | 5 | +| `MaxResults` | `*int64` | :heavy_minus_sign: | Maximum number of search results to return per search call. Defaults to 5. Applies to Exa, Firecrawl, Parallel, and Perplexity engines; ignored with native provider search. Perplexity supports a maximum of 20; values above 20 are clamped. | 5 | | `SearchContextSize` | [*components.SearchContextSizeEnum](../../models/components/searchcontextsizeenum.md) | :heavy_minus_sign: | Size of the search context for web search tools | medium | | `Type` | [components.WebSearchServerToolType](../../models/components/websearchservertooltype.md) | :heavy_check_mark: | N/A | | | `UserLocation` | optionalnullable.OptionalNullable[[components.WebSearchUserLocation](../../models/components/websearchuserlocation.md)] | :heavy_minus_sign: | User location information for web search | {
"city": "San Francisco",
"country": "USA",
"region": "California",
"timezone": "America/Los_Angeles",
"type": "approximate"
} | \ No newline at end of file diff --git a/docs/models/components/websearchservertoolconfig.md b/docs/models/components/websearchservertoolconfig.md index 5c15835a..971bab16 100644 --- a/docs/models/components/websearchservertoolconfig.md +++ b/docs/models/components/websearchservertoolconfig.md @@ -11,7 +11,7 @@ Configuration for the openrouter:web_search server tool | `Engine` | [*components.WebSearchEngineEnum](../../models/components/websearchengineenum.md) | :heavy_minus_sign: | Which search engine to use. "auto" (default) uses native if the provider supports it, otherwise Exa. "native" forces the provider's built-in search. "exa" forces the Exa search API. "firecrawl" uses Firecrawl (requires BYOK). "parallel" uses the Parallel search API. "perplexity" uses the Perplexity Search API (raw ranked results). | auto | | `ExcludedDomains` | []`string` | :heavy_minus_sign: | Exclude search results from these domains. Supported by Exa, Firecrawl, Parallel, Perplexity, Anthropic, and xAI. Not supported with OpenAI (silently ignored). Cannot be used with allowed_domains. | | | `MaxCharacters` | `*int64` | :heavy_minus_sign: | Exact maximum number of characters of content per search result. Applies to the Exa, Parallel, and Perplexity engines; ignored with native provider search and Firecrawl. For Exa, caps highlight content per result. For Parallel, caps excerpt content per result (default 1,500 when omitted). For Perplexity, maps to the native `max_tokens_per_page` parameter (converted from characters to tokens) and trims the response to the exact character cap. When both `max_characters` and `search_context_size` are set, `max_characters` takes precedence. When omitted, falls back to `search_context_size` mapping (Exa) or engine defaults (Parallel, Perplexity). | 2000 | -| `MaxResults` | `*int64` | :heavy_minus_sign: | Maximum number of search results to return per search call. Defaults to 5. Applies to Exa, Firecrawl, Parallel, and Perplexity engines; ignored with native provider search. | 5 | +| `MaxResults` | `*int64` | :heavy_minus_sign: | Maximum number of search results to return per search call. Defaults to 5. Applies to Exa, Firecrawl, Parallel, and Perplexity engines; ignored with native provider search. Perplexity supports a maximum of 20; values above 20 are clamped. | 5 | | `MaxTotalResults` | `*int64` | :heavy_minus_sign: | Maximum total number of search results across all search calls in a single request. Once this limit is reached, the tool will stop returning new results. Useful for controlling cost and context size in agentic loops. Defaults to 50 when not specified. | 50 | | `SearchContextSize` | [*components.SearchQualityLevel](../../models/components/searchqualitylevel.md) | :heavy_minus_sign: | How much context to retrieve per result. Applies to Exa, Parallel, and Perplexity engines; ignored with native provider search and Firecrawl. For Exa, pins a fixed per-result character cap (low=5,000, medium=15,000, high=30,000); when omitted, Exa picks an adaptive size per query and document (typically ~2,000–4,000 characters per result). For Parallel, controls the total characters across all results; when omitted, Parallel uses its own default size. For Perplexity, maps directly to the Search API's native search_context_size parameter. Overridden by `max_characters` when both are set. | medium | | `UserLocation` | [*components.WebSearchUserLocationServerTool](../../models/components/websearchuserlocationservertool.md) | :heavy_minus_sign: | Approximate user location for location-biased results. | {
"city": "San Francisco",
"country": "US",
"region": "California",
"timezone": "America/Los_Angeles",
"type": "approximate"
} | \ No newline at end of file diff --git a/docs/models/components/workspace.md b/docs/models/components/workspace.md index d478812b..536d118c 100644 --- a/docs/models/components/workspace.md +++ b/docs/models/components/workspace.md @@ -12,7 +12,7 @@ | `DefaultTextModel` | `*string` | :heavy_check_mark: | Default text model for this workspace | openai/gpt-4o | | `Description` | `*string` | :heavy_check_mark: | Description of the workspace | Production environment workspace | | `ID` | `string` | :heavy_check_mark: | Unique identifier for the workspace | 550e8400-e29b-41d4-a716-446655440000 | -| `IoLoggingAPIKeyIds` | []`int64` | :heavy_check_mark: | Optional array of API key IDs to filter I/O logging. Null means all keys are logged. | null | +| `IoLoggingAPIKeyIds` | []`int64` | :heavy_check_mark: | Optional array of API key IDs to filter I/O logging. Null means all keys are logged. | | | `IoLoggingSamplingRate` | `float64` | :heavy_check_mark: | Sampling rate for I/O logging (0.0001-1). 1 means 100% of requests are logged. | 1 | | `IsDataDiscountLoggingEnabled` | `bool` | :heavy_check_mark: | Whether data discount logging is enabled for this workspace | true | | `IsObservabilityBroadcastEnabled` | `bool` | :heavy_check_mark: | Whether broadcast is enabled for this workspace | false | diff --git a/docs/models/components/workspacebudget.md b/docs/models/components/workspacebudget.md new file mode 100644 index 00000000..61d2d0f6 --- /dev/null +++ b/docs/models/components/workspacebudget.md @@ -0,0 +1,13 @@ +# WorkspaceBudget + + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------ | ------------------------------------------------------------------------ | ------------------------------------------------------------------------ | ------------------------------------------------------------------------ | ------------------------------------------------------------------------ | +| `CreatedAt` | `string` | :heavy_check_mark: | ISO 8601 timestamp of when the budget was created | 2025-08-24T10:30:00Z | +| `ID` | `string` | :heavy_check_mark: | Unique identifier for the budget | 770e8400-e29b-41d4-a716-446655440000 | +| `LimitUsd` | `float64` | :heavy_check_mark: | Spending limit in USD for this interval | 100 | +| `ResetInterval` | [*components.ResetInterval](../../models/components/resetinterval.md) | :heavy_check_mark: | Interval at which spend resets. Null means a lifetime (one-time) budget. | monthly | +| `UpdatedAt` | `string` | :heavy_check_mark: | ISO 8601 timestamp of when the budget was last updated | 2025-08-24T15:45:00Z | +| `WorkspaceID` | `string` | :heavy_check_mark: | ID of the workspace the budget belongs to | 550e8400-e29b-41d4-a716-446655440000 | \ No newline at end of file diff --git a/docs/models/components/workspacebudgetinterval.md b/docs/models/components/workspacebudgetinterval.md new file mode 100644 index 00000000..d0413b93 --- /dev/null +++ b/docs/models/components/workspacebudgetinterval.md @@ -0,0 +1,26 @@ +# WorkspaceBudgetInterval + +Budget reset interval. Use "lifetime" for a one-time budget that never resets. + +## Example Usage + +```go +import ( + "github.com/OpenRouterTeam/go-sdk/models/components" +) + +value := components.WorkspaceBudgetIntervalDaily + +// Open enum: custom values can be created with a direct type cast +custom := components.WorkspaceBudgetInterval("custom_value") +``` + + +## Values + +| Name | Value | +| --------------------------------- | --------------------------------- | +| `WorkspaceBudgetIntervalDaily` | daily | +| `WorkspaceBudgetIntervalWeekly` | weekly | +| `WorkspaceBudgetIntervalMonthly` | monthly | +| `WorkspaceBudgetIntervalLifetime` | lifetime | \ No newline at end of file diff --git a/docs/models/operations/arena.md b/docs/models/operations/arena.md index dbf198a1..a5307471 100644 --- a/docs/models/operations/arena.md +++ b/docs/models/operations/arena.md @@ -1,6 +1,6 @@ # Arena -Arena to query. Defaults to `models`. +Design Arena only: arena to query. Defaults to `models` when source is `design-arena`. ## Example Usage diff --git a/docs/models/operations/costdetails.md b/docs/models/operations/costdetails.md new file mode 100644 index 00000000..0021d8f8 --- /dev/null +++ b/docs/models/operations/costdetails.md @@ -0,0 +1,12 @@ +# CostDetails + +Breakdown of upstream inference costs + + +## Fields + +| Field | Type | Required | Description | +| -------------------------------------------- | -------------------------------------------- | -------------------------------------------- | -------------------------------------------- | +| `UpstreamInferenceCompletionsCost` | `float64` | :heavy_check_mark: | N/A | +| `UpstreamInferenceCost` | optionalnullable.OptionalNullable[`float64`] | :heavy_minus_sign: | N/A | +| `UpstreamInferencePromptCost` | `float64` | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/operations/createembeddingsusage.md b/docs/models/operations/createembeddingsusage.md index 42c82721..20f2638d 100644 --- a/docs/models/operations/createembeddingsusage.md +++ b/docs/models/operations/createembeddingsusage.md @@ -8,6 +8,8 @@ Token usage statistics | Field | Type | Required | Description | Example | | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `Cost` | `*float64` | :heavy_minus_sign: | Cost of the request in credits | 0.0001 | +| `CostDetails` | optionalnullable.OptionalNullable[[operations.CostDetails](../../models/operations/costdetails.md)] | :heavy_minus_sign: | Breakdown of upstream inference costs | {
"upstream_inference_completions_cost": 0.0004,
"upstream_inference_cost": null,
"upstream_inference_prompt_cost": 0.0008
} | +| `IsByok` | `*bool` | :heavy_minus_sign: | Whether a request was made using a Bring Your Own Key configuration | | | `PromptTokens` | `int64` | :heavy_check_mark: | Number of tokens in the input | 8 | | `PromptTokensDetails` | [*operations.PromptTokensDetails](../../models/operations/prompttokensdetails.md) | :heavy_minus_sign: | Per-modality token breakdown. Only present when the input contains 2+ modalities (e.g. text + image) and the upstream provider returns modality-level usage data. Only non-zero modality counts are included. | | | `TotalTokens` | `int64` | :heavy_check_mark: | Total number of tokens used | 8 | \ No newline at end of file diff --git a/docs/models/operations/createimagesresponse.md b/docs/models/operations/createimagesresponse.md new file mode 100644 index 00000000..d31f6bca --- /dev/null +++ b/docs/models/operations/createimagesresponse.md @@ -0,0 +1,29 @@ +# CreateImagesResponse + + +## Supported Types + +### ImageGenerationResponse + +```go +createImagesResponse := operations.CreateCreateImagesResponseImageGenerationResponse(components.ImageGenerationResponse{/* values here */}) +``` + +### + +```go +createImagesResponse := operations.CreateCreateImagesResponseEventStream(*stream.EventStream[components.ImageStreamingResponse]{/* values here */}) +``` + +## Union Discrimination + +Use the `Type` field to determine which variant is active, then access the corresponding field: + +```go +switch createImagesResponse.Type { + case operations.CreateImagesResponseTypeImageGenerationResponse: + // createImagesResponse.ImageGenerationResponse is populated + case operations.CreateImagesResponseTypeEventStream: + // createImagesResponse.EventStream is populated +} +``` diff --git a/docs/models/operations/deleteworkspacebudgetrequest.md b/docs/models/operations/deleteworkspacebudgetrequest.md new file mode 100644 index 00000000..1dbfb479 --- /dev/null +++ b/docs/models/operations/deleteworkspacebudgetrequest.md @@ -0,0 +1,9 @@ +# DeleteWorkspaceBudgetRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| ---------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- | +| `ID` | `string` | :heavy_check_mark: | The workspace ID (UUID) or slug | production | +| `Interval` | [components.WorkspaceBudgetInterval](../../models/components/workspacebudgetinterval.md) | :heavy_check_mark: | Budget reset interval. Use "lifetime" for a one-time budget that never resets. | monthly | \ No newline at end of file diff --git a/docs/models/operations/filter.md b/docs/models/operations/filter.md index 271d3b53..a958c45c 100644 --- a/docs/models/operations/filter.md +++ b/docs/models/operations/filter.md @@ -3,8 +3,8 @@ ## Fields -| Field | Type | Required | Description | Example | -| ------------------------------------------------------ | ------------------------------------------------------ | ------------------------------------------------------ | ------------------------------------------------------ | ------------------------------------------------------ | -| `Field` | `string` | :heavy_check_mark: | Dimension to filter on | model | -| `Operator` | `string` | :heavy_check_mark: | Filter operator | eq | -| `Value` | [operations.Value1](../../models/operations/value1.md) | :heavy_check_mark: | Filter value (scalar or array depending on operator) | | \ No newline at end of file +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `Field` | `string` | :heavy_check_mark: | Dimension to filter on. Use the /meta endpoint for available dimensions. | model | +| `Operator` | `string` | :heavy_check_mark: | Filter operator | eq | +| `Value` | [operations.Value1](../../models/operations/value1.md) | :heavy_check_mark: | Filter value (scalar or array depending on operator). Several dimensions are enriched in responses (returned as human-readable labels), but filters must use the underlying ID: `api_key_id` — numeric ID (from generation metadata) or key hash (64-char hex from GET /api/v1/keys, resolved server-side); `user` — Clerk user ID (e.g. "user_abc123"), not the display name; `workspace` — workspace UUID, not the workspace name; `app` — numeric app ID, not the app title; `model` — permaslug (e.g. "openai/gpt-4o"), not the display name. Other dimensions (provider, origin, country, etc.) are not enriched and accept the value as returned. | | \ No newline at end of file diff --git a/docs/models/operations/getbenchmarksartificialanalysisrequest.md b/docs/models/operations/getbenchmarksartificialanalysisrequest.md deleted file mode 100644 index c539db4b..00000000 --- a/docs/models/operations/getbenchmarksartificialanalysisrequest.md +++ /dev/null @@ -1,8 +0,0 @@ -# GetBenchmarksArtificialAnalysisRequest - - -## Fields - -| Field | Type | Required | Description | Example | -| ------------------------------------------ | ------------------------------------------ | ------------------------------------------ | ------------------------------------------ | ------------------------------------------ | -| `MaxResults` | `*int64` | :heavy_minus_sign: | Max results to return (1–100, default 50). | 20 | \ No newline at end of file diff --git a/docs/models/operations/getbenchmarksdesignarenarequest.md b/docs/models/operations/getbenchmarksdesignarenarequest.md deleted file mode 100644 index 4499b65d..00000000 --- a/docs/models/operations/getbenchmarksdesignarenarequest.md +++ /dev/null @@ -1,10 +0,0 @@ -# GetBenchmarksDesignArenaRequest - - -## Fields - -| Field | Type | Required | Description | Example | -| ------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------ | -| `Arena` | [*operations.Arena](../../models/operations/arena.md) | :heavy_minus_sign: | Arena to query. Defaults to `models`. | models | -| `Category` | `*string` | :heavy_minus_sign: | Category within the arena (e.g. `codecategories`, `uicomponent`, `gamedev`, `3d`, `dataviz`, `image`, `video`, `svg`). When omitted, returns all categories. | codecategories | -| `MaxResults` | `*int64` | :heavy_minus_sign: | Max results to return: per category when no category filter is applied (1–100, default 50). | 20 | \ No newline at end of file diff --git a/docs/models/operations/getbenchmarksrequest.md b/docs/models/operations/getbenchmarksrequest.md new file mode 100644 index 00000000..fa62105a --- /dev/null +++ b/docs/models/operations/getbenchmarksrequest.md @@ -0,0 +1,12 @@ +# GetBenchmarksRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `Source` | [*operations.Source](../../models/operations/source.md) | :heavy_minus_sign: | Benchmark source to query. Determines the shape of the returned items. When omitted, returns results from all sources. | artificial-analysis | +| `TaskType` | [*operations.TaskType](../../models/operations/tasktype.md) | :heavy_minus_sign: | Filter results by task type. For Artificial Analysis, maps to the corresponding index. For Design Arena, maps to the matching category. | coding | +| `Arena` | [*operations.Arena](../../models/operations/arena.md) | :heavy_minus_sign: | Design Arena only: arena to query. Defaults to `models` when source is `design-arena`. | models | +| `Category` | `*string` | :heavy_minus_sign: | Design Arena only: category within the arena (e.g. `codecategories`, `uicomponent`, `gamedev`, `3d`, `dataviz`, `image`, `video`, `svg`). When omitted, returns all categories. | codecategories | +| `MaxResults` | `*int64` | :heavy_minus_sign: | Maximum number of items to return. When omitted, all matching results are returned. | 50 | \ No newline at end of file diff --git a/docs/models/operations/gettaskclassificationsrequest.md b/docs/models/operations/gettaskclassificationsrequest.md new file mode 100644 index 00000000..8482b4b6 --- /dev/null +++ b/docs/models/operations/gettaskclassificationsrequest.md @@ -0,0 +1,8 @@ +# GetTaskClassificationsRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| ----------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------- | +| `Window` | [*operations.Window](../../models/operations/window.md) | :heavy_minus_sign: | Trailing time window for the classification data. Currently only `7d` (trailing 7 days) is supported. | 7d | \ No newline at end of file diff --git a/docs/models/operations/listimagemodelendpointsrequest.md b/docs/models/operations/listimagemodelendpointsrequest.md new file mode 100644 index 00000000..2eb93b68 --- /dev/null +++ b/docs/models/operations/listimagemodelendpointsrequest.md @@ -0,0 +1,9 @@ +# ListImageModelEndpointsRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------- | ------------------------- | ------------------------- | ------------------------- | ------------------------- | +| `Author` | `string` | :heavy_check_mark: | Model author/organization | bytedance-seed | +| `Slug` | `string` | :heavy_check_mark: | Model slug | seedream-4.5 | \ No newline at end of file diff --git a/docs/models/operations/listworkspacebudgetsrequest.md b/docs/models/operations/listworkspacebudgetsrequest.md new file mode 100644 index 00000000..f7b5ed8f --- /dev/null +++ b/docs/models/operations/listworkspacebudgetsrequest.md @@ -0,0 +1,8 @@ +# ListWorkspaceBudgetsRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------- | ------------------------------- | ------------------------------- | ------------------------------- | ------------------------------- | +| `ID` | `string` | :heavy_check_mark: | The workspace ID (UUID) or slug | production | \ No newline at end of file diff --git a/docs/models/operations/provider.md b/docs/models/operations/provider.md index c4fb2f32..a8aeb481 100644 --- a/docs/models/operations/provider.md +++ b/docs/models/operations/provider.md @@ -95,6 +95,7 @@ custom := operations.Provider("custom_value") | `ProviderStepfun` | stepfun | | `ProviderStreamlake` | streamlake | | `ProviderSwitchpoint` | switchpoint | +| `ProviderTenstorrent` | tenstorrent | | `ProviderTogether` | together | | `ProviderUpstage` | upstage | | `ProviderVenice` | venice | diff --git a/docs/models/operations/queryanalyticsdata2.md b/docs/models/operations/queryanalyticsdata2.md index 8b00559b..7c2b0894 100644 --- a/docs/models/operations/queryanalyticsdata2.md +++ b/docs/models/operations/queryanalyticsdata2.md @@ -3,8 +3,9 @@ ## Fields -| Field | Type | Required | Description | -| ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | -| `CachedAt` | `*float64` | :heavy_minus_sign: | N/A | -| `Data` | [][operations.QueryAnalyticsData1](../../models/operations/queryanalyticsdata1.md) | :heavy_check_mark: | N/A | -| `Metadata` | [operations.Metadata](../../models/operations/metadata.md) | :heavy_check_mark: | N/A | \ No newline at end of file +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `CachedAt` | `*float64` | :heavy_minus_sign: | N/A | +| `Data` | [][operations.QueryAnalyticsData1](../../models/operations/queryanalyticsdata1.md) | :heavy_check_mark: | N/A | +| `Metadata` | [operations.Metadata](../../models/operations/metadata.md) | :heavy_check_mark: | N/A | +| `Warnings` | []`string` | :heavy_minus_sign: | Warnings about filter resolution issues (e.g. unresolvable api_key_id hashes). The query still runs normally; these inform the caller that some filter values could not be resolved. | \ No newline at end of file diff --git a/docs/models/operations/source.md b/docs/models/operations/source.md new file mode 100644 index 00000000..a37d5990 --- /dev/null +++ b/docs/models/operations/source.md @@ -0,0 +1,24 @@ +# Source + +Benchmark source to query. Determines the shape of the returned items. When omitted, returns results from all sources. + +## Example Usage + +```go +import ( + "github.com/OpenRouterTeam/go-sdk/models/operations" +) + +value := operations.SourceArtificialAnalysis + +// Open enum: custom values can be created with a direct type cast +custom := operations.Source("custom_value") +``` + + +## Values + +| Name | Value | +| -------------------------- | -------------------------- | +| `SourceArtificialAnalysis` | artificial-analysis | +| `SourceDesignArena` | design-arena | \ No newline at end of file diff --git a/docs/models/operations/tasktype.md b/docs/models/operations/tasktype.md new file mode 100644 index 00000000..0ab7a2e3 --- /dev/null +++ b/docs/models/operations/tasktype.md @@ -0,0 +1,25 @@ +# TaskType + +Filter results by task type. For Artificial Analysis, maps to the corresponding index. For Design Arena, maps to the matching category. + +## Example Usage + +```go +import ( + "github.com/OpenRouterTeam/go-sdk/models/operations" +) + +value := operations.TaskTypeCoding + +// Open enum: custom values can be created with a direct type cast +custom := operations.TaskType("custom_value") +``` + + +## Values + +| Name | Value | +| ---------------------- | ---------------------- | +| `TaskTypeCoding` | coding | +| `TaskTypeIntelligence` | intelligence | +| `TaskTypeAgentic` | agentic | \ No newline at end of file diff --git a/docs/models/operations/upsertworkspacebudgetrequest.md b/docs/models/operations/upsertworkspacebudgetrequest.md new file mode 100644 index 00000000..cbd1c9a1 --- /dev/null +++ b/docs/models/operations/upsertworkspacebudgetrequest.md @@ -0,0 +1,10 @@ +# UpsertWorkspaceBudgetRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| -------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------- | +| `ID` | `string` | :heavy_check_mark: | The workspace ID (UUID) or slug | production | +| `Interval` | [components.WorkspaceBudgetInterval](../../models/components/workspacebudgetinterval.md) | :heavy_check_mark: | Budget reset interval. Use "lifetime" for a one-time budget that never resets. | monthly | +| `UpsertWorkspaceBudgetRequest` | [components.UpsertWorkspaceBudgetRequest](../../models/components/upsertworkspacebudgetrequest.md) | :heavy_check_mark: | N/A | {
"limit_usd": 100
} | \ No newline at end of file diff --git a/docs/models/operations/value1.md b/docs/models/operations/value1.md index 0dc6a591..d960f673 100644 --- a/docs/models/operations/value1.md +++ b/docs/models/operations/value1.md @@ -1,6 +1,6 @@ # Value1 -Filter value (scalar or array depending on operator) +Filter value (scalar or array depending on operator). Several dimensions are enriched in responses (returned as human-readable labels), but filters must use the underlying ID: `api_key_id` — numeric ID (from generation metadata) or key hash (64-char hex from GET /api/v1/keys, resolved server-side); `user` — Clerk user ID (e.g. "user_abc123"), not the display name; `workspace` — workspace UUID, not the workspace name; `app` — numeric app ID, not the app title; `model` — permaslug (e.g. "openai/gpt-4o"), not the display name. Other dimensions (provider, origin, country, etc.) are not enriched and accept the value as returned. ## Supported Types diff --git a/docs/models/operations/window.md b/docs/models/operations/window.md new file mode 100644 index 00000000..d0de8aa8 --- /dev/null +++ b/docs/models/operations/window.md @@ -0,0 +1,20 @@ +# Window + +Trailing time window for the classification data. Currently only `7d` (trailing 7 days) is supported. + +## Example Usage + +```go +import ( + "github.com/OpenRouterTeam/go-sdk/models/operations" +) + +value := operations.WindowSevend +``` + + +## Values + +| Name | Value | +| -------------- | -------------- | +| `WindowSevend` | 7d | \ No newline at end of file diff --git a/docs/sdks/benchmarks/README.md b/docs/sdks/benchmarks/README.md new file mode 100644 index 00000000..58b17b1b --- /dev/null +++ b/docs/sdks/benchmarks/README.md @@ -0,0 +1,65 @@ +# Benchmarks + +## Overview + +Benchmarks endpoints + +### Available Operations + +* [GetBenchmarks](#getbenchmarks) - List Benchmarks + +## GetBenchmarks + +Unified benchmark endpoint that aggregates scores from multiple benchmark sources (Artificial Analysis, Design Arena). Filter by source to reproduce the exact shapes from the legacy per-source endpoints, or use task_type to find models suited for specific workloads. Authenticate with any valid OpenRouter API key. Rate-limited to 30 requests/minute per key and 500 requests/day per account. + +### Example Usage + + +```go +package main + +import( + "context" + "os" + openrouter "github.com/OpenRouterTeam/go-sdk" + "log" +) + +func main() { + ctx := context.Background() + + s := openrouter.New( + openrouter.WithSecurity(os.Getenv("OPENROUTER_API_KEY")), + ) + + res, err := s.Benchmarks.GetBenchmarks(ctx, nil) + if err != nil { + log.Fatal(err) + } + if res != nil { + // handle response + } +} +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | +| `ctx` | [context.Context](https://pkg.go.dev/context#Context) | :heavy_check_mark: | The context to use for the request. | +| `request` | [operations.GetBenchmarksRequest](../../models/operations/getbenchmarksrequest.md) | :heavy_check_mark: | The request object to use for the request. | +| `opts` | [][operations.Option](../../models/operations/option.md) | :heavy_minus_sign: | The options for this request. | + +### Response + +**[*components.UnifiedBenchmarksResponse](../../models/components/unifiedbenchmarksresponse.md), error** + +### Errors + +| Error Type | Status Code | Content Type | +| -------------------------------------- | -------------------------------------- | -------------------------------------- | +| sdkerrors.BadRequestResponseError | 400 | application/json | +| sdkerrors.UnauthorizedResponseError | 401 | application/json | +| sdkerrors.TooManyRequestsResponseError | 429 | application/json | +| sdkerrors.InternalServerResponseError | 500 | application/json | +| sdkerrors.APIError | 4XX, 5XX | \*/\* | \ No newline at end of file diff --git a/docs/sdks/chat/README.md b/docs/sdks/chat/README.md index 5a268cb0..99c934ac 100644 --- a/docs/sdks/chat/README.md +++ b/docs/sdks/chat/README.md @@ -18,47 +18,51 @@ package main import( "context" - "log" "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.Chat.Send(ctx, components.ChatRequest{ - Model: openrouter.Pointer("openai/gpt-4o"), - Messages: []components.ChatMessages{ - components.CreateChatMessagesSystem( - components.ChatSystemMessage{ - Content: components.CreateChatSystemMessageContentStr( - "You are a helpful assistant.", - ), - Role: components.ChatSystemMessageRoleSystem, - }, - ), - components.CreateChatMessagesUser( - components.ChatUserMessage{ - Content: components.CreateChatUserMessageContentStr( - "What is the capital of France?", - ), - Role: components.ChatUserMessageRoleUser, - }, - ), - }, - }, nil) - if err != nil { - log.Fatal(err) - } - if res != nil && res.ChatResult != nil { - log.Println(res.ChatResult.Choices) - } + ctx := context.Background() + + s := openrouter.New( + openrouter.WithSecurity(os.Getenv("OPENROUTER_API_KEY")), + ) + + res, err := s.Chat.Send(ctx, components.ChatRequest{ + Messages: []components.ChatMessages{ + components.CreateChatMessagesSystem( + components.ChatSystemMessage{ + Content: components.CreateChatSystemMessageContentStr( + "You are a helpful assistant.", + ), + Role: components.ChatSystemMessageRoleSystem, + }, + ), + components.CreateChatMessagesUser( + components.ChatUserMessage{ + Content: components.CreateChatUserMessageContentStr( + "What is the capital of France?", + ), + Role: components.ChatUserMessageRoleUser, + }, + ), + }, + }, nil) + if err != nil { + log.Fatal(err) + } + if res != nil { + defer res.ChatStreamingResponse.Close() + + for res.ChatStreamingResponse.Next() { + event := res.ChatStreamingResponse.Value() + log.Print(event) + // Handle the event + } + } } ``` ### Example Usage: insufficient-permissions @@ -69,52 +73,54 @@ package main import( "context" - "log" "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.Chat.Send(ctx, components.ChatRequest{ - Model: openrouter.Pointer("openai/gpt-4o"), - Messages: []components.ChatMessages{ - components.CreateChatMessagesSystem( - components.ChatSystemMessage{ - Content: components.CreateChatSystemMessageContentStr( - "You are a helpful assistant.", - ), - Role: components.ChatSystemMessageRoleSystem, - }, - ), - components.CreateChatMessagesUser( - components.ChatUserMessage{ - Content: components.CreateChatUserMessageContentStr( - "What is the capital of France?", - ), - Role: components.ChatUserMessageRoleUser, - }, - ), - }, - }, nil) - if err != nil { - log.Fatal(err) - } - if res != nil && res.ChatResult != nil { - log.Println(res.ChatResult.Choices) - } + ctx := context.Background() + + s := openrouter.New( + openrouter.WithSecurity(os.Getenv("OPENROUTER_API_KEY")), + ) + + res, err := s.Chat.Send(ctx, components.ChatRequest{ + Messages: []components.ChatMessages{ + components.CreateChatMessagesSystem( + components.ChatSystemMessage{ + Content: components.CreateChatSystemMessageContentStr( + "You are a helpful assistant.", + ), + Role: components.ChatSystemMessageRoleSystem, + }, + ), + components.CreateChatMessagesUser( + components.ChatUserMessage{ + Content: components.CreateChatUserMessageContentStr( + "What is the capital of France?", + ), + Role: components.ChatUserMessageRoleUser, + }, + ), + }, + }, nil) + if err != nil { + log.Fatal(err) + } + if res != nil { + defer res.ChatStreamingResponse.Close() + + for res.ChatStreamingResponse.Next() { + event := res.ChatStreamingResponse.Value() + log.Print(event) + // Handle the event + } + } } ``` -For streaming responses, set `Stream: openrouter.Pointer(true)` and read from `res.EventStream`. See [examples/chat-stream](../../../examples/chat-stream/main.go). - ### Parameters | Parameter | Type | Required | Description | Example | @@ -128,8 +134,6 @@ For streaming responses, set `Stream: openrouter.Pointer(true)` and read from `r **[*operations.SendChatCompletionRequestResponse](../../models/operations/sendchatcompletionrequestresponse.md), error** -Non-streaming responses populate `ChatResult`. Streaming responses populate `EventStream`. - ### Errors | Error Type | Status Code | Content Type | @@ -148,4 +152,4 @@ Non-streaming responses populate `ChatResult`. Streaming responses populate `Eve | sdkerrors.ServiceUnavailableResponseError | 503 | application/json | | sdkerrors.EdgeNetworkTimeoutResponseError | 524 | application/json | | sdkerrors.ProviderOverloadedResponseError | 529 | application/json | -| sdkerrors.APIError | 4XX, 5XX | \*/\* | +| sdkerrors.APIError | 4XX, 5XX | \*/\* | \ No newline at end of file diff --git a/docs/sdks/classifications/README.md b/docs/sdks/classifications/README.md new file mode 100644 index 00000000..97759076 --- /dev/null +++ b/docs/sdks/classifications/README.md @@ -0,0 +1,84 @@ +# Classifications + +## Overview + +Task classification market-share endpoints + +### Available Operations + +* [GetTaskClassifications](#gettaskclassifications) - Task classification market share + +## GetTaskClassifications + +Returns the market-share breakdown of OpenRouter traffic by task classification +(e.g. code generation, web search, summarization) over a trailing time window. + +Each classification reports its share of classified sampled requests (`usage_share`) +and classified sampled token volume (`token_share`) as fractions between 0 and 1. +The unclassified `other` bucket is excluded. Absolute volumes are not exposed +because the underlying data is sampled. + +Each classification also includes a `models` array listing the top models by +request volume within that classification, with their within-tag usage and token shares. + +Classifications are grouped into macro-categories (Code, Data, Agent, General) +with aggregate shares provided for each. + +Authenticate with any valid OpenRouter API key (same key used for inference). +Rate-limited to 30 requests/minute per key and 500 requests/day per account. + +When republishing or quoting this data, cite as: +"Source: OpenRouter (openrouter.ai/rankings), as of {as_of}." + +### Example Usage + + +```go +package main + +import( + "context" + "os" + openrouter "github.com/OpenRouterTeam/go-sdk" + "github.com/OpenRouterTeam/go-sdk/models/operations" + "log" +) + +func main() { + ctx := context.Background() + + s := openrouter.New( + openrouter.WithSecurity(os.Getenv("OPENROUTER_API_KEY")), + ) + + res, err := s.Classifications.GetTaskClassifications(ctx, operations.WindowSevend.ToPointer()) + 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) | :heavy_check_mark: | The context to use for the request. | | +| `window` | [*operations.Window](../../models/operations/window.md) | :heavy_minus_sign: | Trailing time window for the classification data. Currently only `7d` (trailing 7 days) is supported. | 7d | +| `opts` | [][operations.Option](../../models/operations/option.md) | :heavy_minus_sign: | The options for this request. | | + +### Response + +**[*components.TaskClassificationResponse](../../models/components/taskclassificationresponse.md), error** + +### Errors + +| Error Type | Status Code | Content Type | +| -------------------------------------- | -------------------------------------- | -------------------------------------- | +| sdkerrors.BadRequestResponseError | 400 | application/json | +| sdkerrors.UnauthorizedResponseError | 401 | application/json | +| sdkerrors.TooManyRequestsResponseError | 429 | application/json | +| sdkerrors.InternalServerResponseError | 500 | application/json | +| sdkerrors.APIError | 4XX, 5XX | \*/\* | \ No newline at end of file diff --git a/docs/sdks/datasets/README.md b/docs/sdks/datasets/README.md index 4efd8239..618ce0e1 100644 --- a/docs/sdks/datasets/README.md +++ b/docs/sdks/datasets/README.md @@ -7,8 +7,6 @@ Datasets endpoints ### Available Operations * [GetAppRankings](#getapprankings) - Top apps by token usage -* [GetBenchmarksArtificialAnalysis](#getbenchmarksartificialanalysis) - Artificial Analysis Benchmark Indices -* [GetBenchmarksDesignArena](#getbenchmarksdesignarena) - Design Arena Benchmark Rankings * [GetRankingsDaily](#getrankingsdaily) - Daily token totals for top 50 models ## GetAppRankings @@ -102,121 +100,6 @@ func main() { | sdkerrors.InternalServerResponseError | 500 | application/json | | sdkerrors.APIError | 4XX, 5XX | \*/\* | -## GetBenchmarksArtificialAnalysis - -Returns composite index scores (Intelligence, Coding, Agentic) from Artificial Analysis for LLM models. Includes OpenRouter pricing per model. Authenticate with any valid OpenRouter API key. Rate-limited to 30 requests/minute per key and 500 requests/day per account. - -### Example Usage - - -```go -package main - -import( - "context" - "os" - openrouter "github.com/OpenRouterTeam/go-sdk" - "log" -) - -func main() { - ctx := context.Background() - - s := openrouter.New( - openrouter.WithSecurity(os.Getenv("OPENROUTER_API_KEY")), - ) - - res, err := s.Datasets.GetBenchmarksArtificialAnalysis(ctx, openrouter.Pointer[int64](20)) - 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) | :heavy_check_mark: | The context to use for the request. | | -| `maxResults` | `*int64` | :heavy_minus_sign: | Max results to return (1–100, default 50). | 20 | -| `opts` | [][operations.Option](../../models/operations/option.md) | :heavy_minus_sign: | The options for this request. | | - -### Response - -**[*components.BenchmarksAAResponse](../../models/components/benchmarksaaresponse.md), error** - -### Errors - -| Error Type | Status Code | Content Type | -| -------------------------------------- | -------------------------------------- | -------------------------------------- | -| sdkerrors.BadRequestResponseError | 400 | application/json | -| sdkerrors.UnauthorizedResponseError | 401 | application/json | -| sdkerrors.TooManyRequestsResponseError | 429 | application/json | -| sdkerrors.InternalServerResponseError | 500 | application/json | -| sdkerrors.APIError | 4XX, 5XX | \*/\* | - -## GetBenchmarksDesignArena - -Returns ELO ratings from head-to-head arena battles on Design Arena. Filterable by arena (models/builders/agents) and category. Includes OpenRouter pricing per model. Authenticate with any valid OpenRouter API key. Rate-limited to 30 requests/minute per key and 500 requests/day per account. - -### Example Usage - - -```go -package main - -import( - "context" - "os" - openrouter "github.com/OpenRouterTeam/go-sdk" - "github.com/OpenRouterTeam/go-sdk/models/operations" - "log" -) - -func main() { - ctx := context.Background() - - s := openrouter.New( - openrouter.WithSecurity(os.Getenv("OPENROUTER_API_KEY")), - ) - - res, err := s.Datasets.GetBenchmarksDesignArena(ctx, operations.ArenaModels.ToPointer(), nil, openrouter.Pointer[int64](20)) - 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) | :heavy_check_mark: | The context to use for the request. | | -| `arena` | [*operations.Arena](../../models/operations/arena.md) | :heavy_minus_sign: | Arena to query. Defaults to `models`. | models | -| `category` | `*string` | :heavy_minus_sign: | Category within the arena (e.g. `codecategories`, `uicomponent`, `gamedev`, `3d`, `dataviz`, `image`, `video`, `svg`). When omitted, returns all categories. | codecategories | -| `maxResults` | `*int64` | :heavy_minus_sign: | Max results to return: per category when no category filter is applied (1–100, default 50). | 20 | -| `opts` | [][operations.Option](../../models/operations/option.md) | :heavy_minus_sign: | The options for this request. | | - -### Response - -**[*components.BenchmarksDAResponse](../../models/components/benchmarksdaresponse.md), error** - -### Errors - -| Error Type | Status Code | Content Type | -| -------------------------------------- | -------------------------------------- | -------------------------------------- | -| sdkerrors.BadRequestResponseError | 400 | application/json | -| sdkerrors.UnauthorizedResponseError | 401 | application/json | -| sdkerrors.TooManyRequestsResponseError | 429 | application/json | -| sdkerrors.InternalServerResponseError | 500 | application/json | -| sdkerrors.APIError | 4XX, 5XX | \*/\* | - ## GetRankingsDaily Returns the top 50 public models per day by total token usage on OpenRouter, plus a diff --git a/docs/sdks/images/README.md b/docs/sdks/images/README.md new file mode 100644 index 00000000..59fd90f2 --- /dev/null +++ b/docs/sdks/images/README.md @@ -0,0 +1,190 @@ +# Images + +## Overview + +Images endpoints + +### Available Operations + +* [Generate](#generate) - Generate an image +* [ListModels](#listmodels) - List image generation models +* [ListModelEndpoints](#listmodelendpoints) - List endpoints for an image model + +## Generate + +Generates an image from a text prompt via the image generation router + +### 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.Images.Generate(ctx, components.ImageGenerationRequest{ + Model: "bytedance-seed/seedream-4.5", + Prompt: "a red panda astronaut floating in space, studio lighting", + }) + if err != nil { + log.Fatal(err) + } + if res != nil { + defer res.ImageStreamingResponse.Close() + + for res.ImageStreamingResponse.Next() { + event := res.ImageStreamingResponse.Value() + log.Print(event) + // Handle the event + } + } +} +``` + +### Parameters + +| Parameter | Type | Required | Description | +| -------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------- | +| `ctx` | [context.Context](https://pkg.go.dev/context#Context) | :heavy_check_mark: | The context to use for the request. | +| `request` | [components.ImageGenerationRequest](../../models/components/imagegenerationrequest.md) | :heavy_check_mark: | The request object to use for the request. | +| `opts` | [][operations.Option](../../models/operations/option.md) | :heavy_minus_sign: | The options for this request. | + +### Response + +**[*operations.CreateImagesResponse](../../models/operations/createimagesresponse.md), error** + +### Errors + +| Error Type | Status Code | Content Type | +| ----------------------------------------- | ----------------------------------------- | ----------------------------------------- | +| sdkerrors.BadRequestResponseError | 400 | application/json | +| sdkerrors.UnauthorizedResponseError | 401 | application/json | +| sdkerrors.PaymentRequiredResponseError | 402 | application/json | +| sdkerrors.ForbiddenResponseError | 403 | application/json | +| sdkerrors.NotFoundResponseError | 404 | application/json | +| sdkerrors.TooManyRequestsResponseError | 429 | application/json | +| sdkerrors.InternalServerResponseError | 500 | application/json | +| sdkerrors.BadGatewayResponseError | 502 | application/json | +| sdkerrors.EdgeNetworkTimeoutResponseError | 524 | application/json | +| sdkerrors.ProviderOverloadedResponseError | 529 | application/json | +| sdkerrors.APIError | 4XX, 5XX | \*/\* | + +## ListModels + +Lists every image generation model with its top-level supported-parameter superset and a URL to its full per-endpoint records. + +### Example Usage + + +```go +package main + +import( + "context" + "os" + openrouter "github.com/OpenRouterTeam/go-sdk" + "log" +) + +func main() { + ctx := context.Background() + + s := openrouter.New( + openrouter.WithSecurity(os.Getenv("OPENROUTER_API_KEY")), + ) + + res, err := s.Images.ListModels(ctx) + if err != nil { + log.Fatal(err) + } + if res != nil { + // handle response + } +} +``` + +### Parameters + +| Parameter | Type | Required | Description | +| -------------------------------------------------------- | -------------------------------------------------------- | -------------------------------------------------------- | -------------------------------------------------------- | +| `ctx` | [context.Context](https://pkg.go.dev/context#Context) | :heavy_check_mark: | The context to use for the request. | +| `opts` | [][operations.Option](../../models/operations/option.md) | :heavy_minus_sign: | The options for this request. | + +### Response + +**[*components.ImageModelsListResponse](../../models/components/imagemodelslistresponse.md), error** + +### Errors + +| Error Type | Status Code | Content Type | +| ------------------------------------- | ------------------------------------- | ------------------------------------- | +| sdkerrors.InternalServerResponseError | 500 | application/json | +| sdkerrors.APIError | 4XX, 5XX | \*/\* | + +## ListModelEndpoints + +Returns the full per-endpoint records for an image model: each endpoint's definitive supported parameters, pricing, and passthrough allowlist. + +### Example Usage + + +```go +package main + +import( + "context" + "os" + openrouter "github.com/OpenRouterTeam/go-sdk" + "log" +) + +func main() { + ctx := context.Background() + + s := openrouter.New( + openrouter.WithSecurity(os.Getenv("OPENROUTER_API_KEY")), + ) + + res, err := s.Images.ListModelEndpoints(ctx, "bytedance-seed", "seedream-4.5") + 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) | :heavy_check_mark: | The context to use for the request. | | +| `author` | `string` | :heavy_check_mark: | Model author/organization | bytedance-seed | +| `slug` | `string` | :heavy_check_mark: | Model slug | seedream-4.5 | +| `opts` | [][operations.Option](../../models/operations/option.md) | :heavy_minus_sign: | The options for this request. | | + +### Response + +**[*components.ImageModelEndpointsResponse](../../models/components/imagemodelendpointsresponse.md), error** + +### Errors + +| Error Type | Status Code | Content Type | +| ------------------------------------- | ------------------------------------- | ------------------------------------- | +| sdkerrors.NotFoundResponseError | 404 | application/json | +| sdkerrors.InternalServerResponseError | 500 | application/json | +| sdkerrors.APIError | 4XX, 5XX | \*/\* | \ No newline at end of file diff --git a/docs/sdks/videogeneration/README.md b/docs/sdks/videogeneration/README.md index 3ed68602..6544a859 100644 --- a/docs/sdks/videogeneration/README.md +++ b/docs/sdks/videogeneration/README.md @@ -37,11 +37,11 @@ func main() { ) res, err := s.VideoGeneration.Generate(ctx, components.VideoGenerationRequest{ - AspectRatio: components.AspectRatioOneHundredAndSixtyNine.ToPointer(), + AspectRatio: components.VideoGenerationRequestAspectRatioOneHundredAndSixtyNine.ToPointer(), Duration: openrouter.Pointer[int64](8), Model: "google/veo-3.1", Prompt: "A serene mountain landscape at sunset", - Resolution: components.ResolutionSevenHundredAndTwentyp.ToPointer(), + Resolution: components.VideoGenerationRequestResolutionSevenHundredAndTwentyp.ToPointer(), }) if err != nil { log.Fatal(err) diff --git a/docs/sdks/workspaces/README.md b/docs/sdks/workspaces/README.md index f49178d2..3d5e28ee 100644 --- a/docs/sdks/workspaces/README.md +++ b/docs/sdks/workspaces/README.md @@ -11,6 +11,9 @@ Workspaces endpoints * [Delete](#delete) - Delete a workspace * [Get](#get) - Get a workspace * [Update](#update) - Update a workspace +* [ListBudgets](#listbudgets) - List workspace budgets +* [DeleteBudget](#deletebudget) - Delete a workspace budget +* [SetBudget](#setbudget) - Create or update a workspace budget * [BulkAddMembers](#bulkaddmembers) - Bulk add members to a workspace * [BulkRemoveMembers](#bulkremovemembers) - Bulk remove members from a workspace @@ -321,6 +324,179 @@ func main() { | sdkerrors.InternalServerResponseError | 500 | application/json | | sdkerrors.APIError | 4XX, 5XX | \*/\* | +## ListBudgets + +List all budgets configured for a workspace. [Management key](/docs/guides/overview/auth/management-api-keys) required. + +### Example Usage + + +```go +package main + +import( + "context" + "os" + openrouter "github.com/OpenRouterTeam/go-sdk" + "log" +) + +func main() { + ctx := context.Background() + + s := openrouter.New( + openrouter.WithSecurity(os.Getenv("OPENROUTER_API_KEY")), + ) + + res, err := s.Workspaces.ListBudgets(ctx, "production") + 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) | :heavy_check_mark: | The context to use for the request. | | +| `id` | `string` | :heavy_check_mark: | The workspace ID (UUID) or slug | production | +| `opts` | [][operations.Option](../../models/operations/option.md) | :heavy_minus_sign: | The options for this request. | | + +### Response + +**[*components.ListWorkspaceBudgetsResponse](../../models/components/listworkspacebudgetsresponse.md), error** + +### Errors + +| Error Type | Status Code | Content Type | +| ------------------------------------- | ------------------------------------- | ------------------------------------- | +| sdkerrors.UnauthorizedResponseError | 401 | application/json | +| sdkerrors.NotFoundResponseError | 404 | application/json | +| sdkerrors.InternalServerResponseError | 500 | application/json | +| sdkerrors.APIError | 4XX, 5XX | \*/\* | + +## DeleteBudget + +Remove the budget for a given interval. [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.Workspaces.DeleteBudget(ctx, "production", components.WorkspaceBudgetIntervalMonthly) + 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) | :heavy_check_mark: | The context to use for the request. | | +| `id` | `string` | :heavy_check_mark: | The workspace ID (UUID) or slug | production | +| `interval` | [components.WorkspaceBudgetInterval](../../models/components/workspacebudgetinterval.md) | :heavy_check_mark: | Budget reset interval. Use "lifetime" for a one-time budget that never resets. | monthly | +| `opts` | [][operations.Option](../../models/operations/option.md) | :heavy_minus_sign: | The options for this request. | | + +### Response + +**[*components.DeleteWorkspaceBudgetResponse](../../models/components/deleteworkspacebudgetresponse.md), error** + +### Errors + +| Error Type | Status Code | Content Type | +| ------------------------------------- | ------------------------------------- | ------------------------------------- | +| sdkerrors.UnauthorizedResponseError | 401 | application/json | +| sdkerrors.NotFoundResponseError | 404 | application/json | +| sdkerrors.InternalServerResponseError | 500 | application/json | +| sdkerrors.APIError | 4XX, 5XX | \*/\* | + +## SetBudget + +Create or update the budget for a given interval. Budget limits must strictly decrease as the interval narrows (lifetime > monthly > weekly > daily). [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.Workspaces.SetBudget(ctx, "production", components.WorkspaceBudgetIntervalMonthly, components.UpsertWorkspaceBudgetRequest{ + LimitUsd: 100.0, + }) + 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) | :heavy_check_mark: | The context to use for the request. | | +| `id` | `string` | :heavy_check_mark: | The workspace ID (UUID) or slug | production | +| `interval` | [components.WorkspaceBudgetInterval](../../models/components/workspacebudgetinterval.md) | :heavy_check_mark: | Budget reset interval. Use "lifetime" for a one-time budget that never resets. | monthly | +| `upsertWorkspaceBudgetRequest` | [components.UpsertWorkspaceBudgetRequest](../../models/components/upsertworkspacebudgetrequest.md) | :heavy_check_mark: | N/A | {
"limit_usd": 100
} | +| `opts` | [][operations.Option](../../models/operations/option.md) | :heavy_minus_sign: | The options for this request. | | + +### Response + +**[*components.UpsertWorkspaceBudgetResponse](../../models/components/upsertworkspacebudgetresponse.md), error** + +### Errors + +| Error Type | Status Code | Content Type | +| ------------------------------------- | ------------------------------------- | ------------------------------------- | +| sdkerrors.BadRequestResponseError | 400 | application/json | +| sdkerrors.UnauthorizedResponseError | 401 | application/json | +| sdkerrors.NotFoundResponseError | 404 | application/json | +| sdkerrors.InternalServerResponseError | 500 | application/json | +| sdkerrors.APIError | 4XX, 5XX | \*/\* | + ## BulkAddMembers Add multiple organization members to a workspace. Members are assigned the same role they hold in the organization. [Management key](/docs/guides/overview/auth/management-api-keys) required. diff --git a/embeddings.go b/embeddings.go index 7133eb10..b5e36e8d 100644 --- a/embeddings.go +++ b/embeddings.go @@ -189,7 +189,7 @@ func (s *Embeddings) Generate(ctx context.Context, request operations.CreateEmbe _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) return nil, err - } else if utils.MatchStatusCodes([]string{"4XX", "5XX"}, httpRes.StatusCode) { + } else if utils.MatchStatusCodes([]string{"400", "401", "402", "404", "429", "4XX", "500", "502", "503", "524", "529", "5XX"}, httpRes.StatusCode) { _httpRes, err := s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) if err != nil { return nil, err @@ -613,7 +613,7 @@ func (s *Embeddings) ListModels(ctx context.Context, opts ...operations.Option) _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) return nil, err - } else if utils.MatchStatusCodes([]string{"4XX", "5XX"}, httpRes.StatusCode) { + } else if utils.MatchStatusCodes([]string{"400", "4XX", "500", "5XX"}, httpRes.StatusCode) { _httpRes, err := s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) if err != nil { return nil, err diff --git a/endpoints.go b/endpoints.go index 2ce8a37c..ba124e6e 100644 --- a/endpoints.go +++ b/endpoints.go @@ -174,7 +174,7 @@ func (s *Endpoints) ListZdrEndpoints(ctx context.Context, opts ...operations.Opt _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) return nil, err - } else if utils.MatchStatusCodes([]string{"4XX", "5XX"}, httpRes.StatusCode) { + } else if utils.MatchStatusCodes([]string{"4XX", "500", "5XX"}, httpRes.StatusCode) { _httpRes, err := s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) if err != nil { return nil, err @@ -404,7 +404,7 @@ func (s *Endpoints) List(ctx context.Context, author string, slug string, opts . _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) return nil, err - } else if utils.MatchStatusCodes([]string{"4XX", "5XX"}, httpRes.StatusCode) { + } else if utils.MatchStatusCodes([]string{"404", "4XX", "500", "5XX"}, httpRes.StatusCode) { _httpRes, err := s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) if err != nil { return nil, err diff --git a/files.go b/files.go index 8524208f..bc4caaf5 100644 --- a/files.go +++ b/files.go @@ -190,7 +190,7 @@ func (s *Files) List(ctx context.Context, limit *int64, cursor *string, workspac _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) return nil, err - } else if utils.MatchStatusCodes([]string{"4XX", "5XX"}, httpRes.StatusCode) { + } else if utils.MatchStatusCodes([]string{"400", "401", "429", "4XX", "500", "5XX"}, httpRes.StatusCode) { _httpRes, err := s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) if err != nil { return nil, err @@ -556,7 +556,7 @@ func (s *Files) Upload(ctx context.Context, requestBody operations.UploadFileReq _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) return nil, err - } else if utils.MatchStatusCodes([]string{"4XX", "5XX"}, httpRes.StatusCode) { + } else if utils.MatchStatusCodes([]string{"400", "401", "403", "413", "429", "4XX", "500", "5XX"}, httpRes.StatusCode) { _httpRes, err := s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) if err != nil { return nil, err @@ -896,7 +896,7 @@ func (s *Files) Delete(ctx context.Context, fileID string, workspaceID *string, _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) return nil, err - } else if utils.MatchStatusCodes([]string{"4XX", "5XX"}, httpRes.StatusCode) { + } else if utils.MatchStatusCodes([]string{"401", "404", "429", "4XX", "500", "5XX"}, httpRes.StatusCode) { _httpRes, err := s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) if err != nil { return nil, err @@ -1194,7 +1194,7 @@ func (s *Files) Retrieve(ctx context.Context, fileID string, workspaceID *string _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) return nil, err - } else if utils.MatchStatusCodes([]string{"4XX", "5XX"}, httpRes.StatusCode) { + } else if utils.MatchStatusCodes([]string{"401", "404", "429", "4XX", "500", "5XX"}, httpRes.StatusCode) { _httpRes, err := s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) if err != nil { return nil, err @@ -1492,7 +1492,7 @@ func (s *Files) Download(ctx context.Context, fileID string, workspaceID *string _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) return nil, err - } else if utils.MatchStatusCodes([]string{"4XX", "5XX"}, httpRes.StatusCode) { + } else if utils.MatchStatusCodes([]string{"400", "401", "404", "429", "4XX", "500", "5XX"}, httpRes.StatusCode) { _httpRes, err := s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) if err != nil { return nil, err diff --git a/generations.go b/generations.go index fb4140bf..0fbcab30 100644 --- a/generations.go +++ b/generations.go @@ -183,7 +183,7 @@ func (s *Generations) GetGeneration(ctx context.Context, id string, opts ...oper _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) return nil, err - } else if utils.MatchStatusCodes([]string{"4XX", "5XX"}, httpRes.StatusCode) { + } else if utils.MatchStatusCodes([]string{"401", "402", "404", "429", "4XX", "500", "502", "524", "529", "5XX"}, httpRes.StatusCode) { _httpRes, err := s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) if err != nil { return nil, err @@ -563,7 +563,7 @@ func (s *Generations) ListGenerationContent(ctx context.Context, id string, opts _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) return nil, err - } else if utils.MatchStatusCodes([]string{"4XX", "5XX"}, httpRes.StatusCode) { + } else if utils.MatchStatusCodes([]string{"401", "403", "404", "429", "4XX", "500", "502", "524", "529", "5XX"}, httpRes.StatusCode) { _httpRes, err := s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) if err != nil { return nil, err diff --git a/go.mod b/go.mod index ddbd7334..798cc5dd 100644 --- a/go.mod +++ b/go.mod @@ -1,6 +1,6 @@ module github.com/OpenRouterTeam/go-sdk -go 1.25.10 +go 1.22 require ( github.com/spyzhov/ajson v0.8.0 diff --git a/guardrails.go b/guardrails.go index dee01315..d61dc1fa 100644 --- a/guardrails.go +++ b/guardrails.go @@ -188,7 +188,7 @@ func (s *Guardrails) List(ctx context.Context, offset optionalnullable.OptionalN _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) return nil, err - } else if utils.MatchStatusCodes([]string{"4XX", "5XX"}, httpRes.StatusCode) { + } else if utils.MatchStatusCodes([]string{"401", "4XX", "500", "5XX"}, httpRes.StatusCode) { _httpRes, err := s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) if err != nil { return nil, err @@ -491,7 +491,7 @@ func (s *Guardrails) Create(ctx context.Context, request components.CreateGuardr _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) return nil, err - } else if utils.MatchStatusCodes([]string{"4XX", "5XX"}, httpRes.StatusCode) { + } else if utils.MatchStatusCodes([]string{"400", "401", "403", "4XX", "500", "5XX"}, httpRes.StatusCode) { _httpRes, err := s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) if err != nil { return nil, err @@ -784,7 +784,7 @@ func (s *Guardrails) Delete(ctx context.Context, id string, opts ...operations.O _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) return nil, err - } else if utils.MatchStatusCodes([]string{"4XX", "5XX"}, httpRes.StatusCode) { + } else if utils.MatchStatusCodes([]string{"401", "404", "4XX", "500", "5XX"}, httpRes.StatusCode) { _httpRes, err := s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) if err != nil { return nil, err @@ -1056,7 +1056,7 @@ func (s *Guardrails) Get(ctx context.Context, id string, opts ...operations.Opti _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) return nil, err - } else if utils.MatchStatusCodes([]string{"4XX", "5XX"}, httpRes.StatusCode) { + } else if utils.MatchStatusCodes([]string{"401", "404", "4XX", "500", "5XX"}, httpRes.StatusCode) { _httpRes, err := s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) if err != nil { return nil, err @@ -1336,7 +1336,7 @@ func (s *Guardrails) Update(ctx context.Context, id string, updateGuardrailReque _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) return nil, err - } else if utils.MatchStatusCodes([]string{"4XX", "5XX"}, httpRes.StatusCode) { + } else if utils.MatchStatusCodes([]string{"400", "401", "404", "4XX", "500", "5XX"}, httpRes.StatusCode) { _httpRes, err := s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) if err != nil { return nil, err @@ -1635,7 +1635,7 @@ func (s *Guardrails) ListGuardrailKeyAssignments(ctx context.Context, id string, _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) return nil, err - } else if utils.MatchStatusCodes([]string{"4XX", "5XX"}, httpRes.StatusCode) { + } else if utils.MatchStatusCodes([]string{"401", "404", "4XX", "500", "5XX"}, httpRes.StatusCode) { _httpRes, err := s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) if err != nil { return nil, err @@ -1964,7 +1964,7 @@ func (s *Guardrails) BulkAssignKeys(ctx context.Context, id string, bulkAssignKe _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) return nil, err - } else if utils.MatchStatusCodes([]string{"4XX", "5XX"}, httpRes.StatusCode) { + } else if utils.MatchStatusCodes([]string{"400", "401", "404", "4XX", "500", "5XX"}, httpRes.StatusCode) { _httpRes, err := s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) if err != nil { return nil, err @@ -2265,7 +2265,7 @@ func (s *Guardrails) BulkUnassignKeys(ctx context.Context, id string, bulkUnassi _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) return nil, err - } else if utils.MatchStatusCodes([]string{"4XX", "5XX"}, httpRes.StatusCode) { + } else if utils.MatchStatusCodes([]string{"400", "401", "404", "4XX", "500", "5XX"}, httpRes.StatusCode) { _httpRes, err := s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) if err != nil { return nil, err @@ -2564,7 +2564,7 @@ func (s *Guardrails) ListGuardrailMemberAssignments(ctx context.Context, id stri _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) return nil, err - } else if utils.MatchStatusCodes([]string{"4XX", "5XX"}, httpRes.StatusCode) { + } else if utils.MatchStatusCodes([]string{"401", "404", "4XX", "500", "5XX"}, httpRes.StatusCode) { _httpRes, err := s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) if err != nil { return nil, err @@ -2893,7 +2893,7 @@ func (s *Guardrails) BulkAssignMembers(ctx context.Context, id string, bulkAssig _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) return nil, err - } else if utils.MatchStatusCodes([]string{"4XX", "5XX"}, httpRes.StatusCode) { + } else if utils.MatchStatusCodes([]string{"400", "401", "404", "4XX", "500", "5XX"}, httpRes.StatusCode) { _httpRes, err := s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) if err != nil { return nil, err @@ -3194,7 +3194,7 @@ func (s *Guardrails) BulkUnassignMembers(ctx context.Context, id string, bulkUna _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) return nil, err - } else if utils.MatchStatusCodes([]string{"4XX", "5XX"}, httpRes.StatusCode) { + } else if utils.MatchStatusCodes([]string{"400", "401", "404", "4XX", "500", "5XX"}, httpRes.StatusCode) { _httpRes, err := s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) if err != nil { return nil, err @@ -3492,7 +3492,7 @@ func (s *Guardrails) ListKeyAssignments(ctx context.Context, offset optionalnull _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) return nil, err - } else if utils.MatchStatusCodes([]string{"4XX", "5XX"}, httpRes.StatusCode) { + } else if utils.MatchStatusCodes([]string{"401", "4XX", "500", "5XX"}, httpRes.StatusCode) { _httpRes, err := s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) if err != nil { return nil, err @@ -3796,7 +3796,7 @@ func (s *Guardrails) ListMemberAssignments(ctx context.Context, offset optionaln _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) return nil, err - } else if utils.MatchStatusCodes([]string{"4XX", "5XX"}, httpRes.StatusCode) { + } else if utils.MatchStatusCodes([]string{"401", "4XX", "500", "5XX"}, httpRes.StatusCode) { _httpRes, err := s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) if err != nil { return nil, err diff --git a/images.go b/images.go new file mode 100644 index 00000000..ae0bf3d3 --- /dev/null +++ b/images.go @@ -0,0 +1,951 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package openrouter + +import ( + "bytes" + "context" + "fmt" + "github.com/OpenRouterTeam/go-sdk/internal/config" + "github.com/OpenRouterTeam/go-sdk/internal/hooks" + "github.com/OpenRouterTeam/go-sdk/internal/utils" + "github.com/OpenRouterTeam/go-sdk/models/components" + "github.com/OpenRouterTeam/go-sdk/models/operations" + "github.com/OpenRouterTeam/go-sdk/models/sdkerrors" + "github.com/OpenRouterTeam/go-sdk/retry" + "github.com/OpenRouterTeam/go-sdk/types/stream" + "net/http" + "net/url" +) + +// Images endpoints +type Images struct { + rootSDK *OpenRouter + sdkConfiguration config.SDKConfiguration + hooks *hooks.Hooks +} + +func newImages(rootSDK *OpenRouter, sdkConfig config.SDKConfiguration, hooks *hooks.Hooks) *Images { + return &Images{ + rootSDK: rootSDK, + sdkConfiguration: sdkConfig, + hooks: hooks, + } +} + +// Generate an image +// Generates an image from a text prompt via the image generation router +func (s *Images) Generate(ctx context.Context, request components.ImageGenerationRequest, opts ...operations.Option) (*operations.CreateImagesResponse, error) { + o := operations.Options{} + supportedOptions := []string{ + operations.SupportedOptionRetries, + operations.SupportedOptionTimeout, + operations.SupportedOptionAcceptHeaderOverride, + } + + 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 := url.JoinPath(baseURL, "/images") + 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: "createImages", + OAuth2Scopes: nil, + SecuritySource: s.sdkConfiguration.Security, + } + bodyReader, reqContentType, err := utils.SerializeRequestBody(ctx, request, false, false, "Request", "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, "POST", opURL, bodyReader) + if err != nil { + return nil, fmt.Errorf("error creating request: %w", err) + } + if o.AcceptHeaderOverride != nil { + req.Header.Set("Accept", string(*o.AcceptHeaderOverride)) + } else { + req.Header.Set("Accept", "application/json;q=1, text/event-stream;q=0") + } + + 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{"400", "401", "402", "403", "404", "429", "4XX", "500", "502", "524", "529", "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.ImageGenerationResponse + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + + result := operations.CreateCreateImagesResponseImageGenerationResponse(out) + return &result, nil + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `text/event-stream`): + out := stream.NewEventStream(ctx, httpRes.Body, func(se []byte) (components.ImageStreamingResponse, error) { + var e components.ImageStreamingResponse + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(se), &e, ""); err != nil { + return components.ImageStreamingResponse{}, err + } + return e, nil + }, "[DONE]") + result := operations.CreateCreateImagesResponseEventStream(out) + return &result, 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 == 402: + 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.PaymentRequiredResponseError + 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 == 429: + 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.TooManyRequestsResponseError + 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 == 524: + 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.EdgeNetworkTimeoutResponseError + 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 == 529: + 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.ProviderOverloadedResponseError + 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 + +} + +// ListModels - List image generation models +// Lists every image generation model with its top-level supported-parameter superset and a URL to its full per-endpoint records. +func (s *Images) ListModels(ctx context.Context, opts ...operations.Option) (*components.ImageModelsListResponse, error) { + 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 := url.JoinPath(baseURL, "/images/models") + 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: "listImageModels", + OAuth2Scopes: nil, + SecuritySource: s.sdkConfiguration.Security, + } + + 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, "GET", opURL, nil) + 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 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", "500", "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.ImageModelsListResponse + 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 == 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 >= 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 + +} + +// ListModelEndpoints - List endpoints for an image model +// Returns the full per-endpoint records for an image model: each endpoint's definitive supported parameters, pricing, and passthrough allowlist. +func (s *Images) ListModelEndpoints(ctx context.Context, author string, slug string, opts ...operations.Option) (*components.ImageModelEndpointsResponse, error) { + request := operations.ListImageModelEndpointsRequest{ + Author: author, + Slug: slug, + } + + 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, "/images/models/{author}/{slug}/endpoints", 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: "listImageModelEndpoints", + OAuth2Scopes: nil, + SecuritySource: s.sdkConfiguration.Security, + } + + 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, "GET", opURL, nil) + 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 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{"404", "4XX", "500", "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.ImageModelEndpointsResponse + 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 == 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 == 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 >= 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 + +} diff --git a/internal/utils/json.go b/internal/utils/json.go index a5a64183..9d1e56ec 100644 --- a/internal/utils/json.go +++ b/internal/utils/json.go @@ -512,13 +512,6 @@ func unmarshalValue(value json.RawMessage, v reflect.Value, tag reflect.StructTa return nil } case reflect.Map: - if implementsJSONUnmarshaler(v.Type()) { - if v.CanAddr() { - return json.Unmarshal(value, v.Addr().Interface()) - } - return json.Unmarshal(value, v.Interface()) - } - if bytes.Equal(value, []byte("null")) || !isComplexValueType(dereferenceTypePointer(typ.Elem())) { if v.CanAddr() { return json.Unmarshal(value, v.Addr().Interface()) diff --git a/internal/utils/union.go b/internal/utils/union.go index 12348ff4..bc6a1ee1 100644 --- a/internal/utils/union.go +++ b/internal/utils/union.go @@ -128,8 +128,8 @@ func countFieldsRecursive(candidate *UnionCandidate, typ reflect.Type, val refle // Handle unions if isUnion, activeVariant, variantVal := findActiveUnionVariant(typ, val); isUnion { - if activeVariant != nil { - countFieldsRecursive(candidate, activeVariant.Type, variantVal, raw) + if activeVariant != nil && !variantVal.IsNil() { + countFieldsRecursive(candidate, activeVariant.Type.Elem(), variantVal.Elem(), raw) } return } @@ -253,6 +253,7 @@ func findActiveUnionVariant(typ reflect.Type, val reflect.Value) (bool, *reflect isUnion = true + // All union variants are pointers - only set active if non-nil fieldVal := val.Field(i) if !fieldVal.IsNil() { activeVariant = &field diff --git a/internal/utils/union_test.go b/internal/utils/union_test.go index 138f7e2a..f66814c7 100644 --- a/internal/utils/union_test.go +++ b/internal/utils/union_test.go @@ -585,73 +585,3 @@ func TestPickBestUnionCandidate_AnyFieldType(t *testing.T) { require.NotNil(t, result) assert.IsType(t, B{}, result.Type) } - -func TestPickBestUnionCandidate_NonPointerUnionVariants(t *testing.T) { - type Inner struct { - Foo string `json:"foo"` - } - type SliceUnion struct { - AsObject *Inner `union:"member"` - AsList []string `union:"member"` - } - type MapUnion struct { - AsObject *Inner `union:"member"` - AsMap map[string]string `union:"member"` - } - type AnyUnion struct { - AsObject *Inner `union:"member"` - AsAny any `union:"member"` - } - - cases := []struct { - name string - payload string - candidates []UnionCandidate - wantType string - }{ - { - name: "slice variant wins for array payload", - payload: `["a", "b"]`, - candidates: []UnionCandidate{ - {Type: "object", Value: SliceUnion{AsObject: &Inner{}}}, - {Type: "list", Value: SliceUnion{AsList: []string{"a", "b"}}}, - }, - wantType: "list", - }, - { - name: "map variant wins for object payload with no matching struct fields", - payload: `{"k1": "v1", "k2": "v2"}`, - candidates: []UnionCandidate{ - {Type: "object", Value: MapUnion{AsObject: &Inner{}}}, - {Type: "map", Value: MapUnion{AsMap: map[string]string{"k1": "v1", "k2": "v2"}}}, - }, - wantType: "map", - }, - { - name: "any variant wins as catch-all when struct can't fit a scalar", - payload: `"scalar"`, - candidates: []UnionCandidate{ - {Type: "object", Value: AnyUnion{AsObject: &Inner{}}}, - {Type: "any", Value: AnyUnion{AsAny: "scalar"}}, - }, - wantType: "any", - }, - { - name: "structured variant beats any on a matching object payload", - payload: `{"foo": "x"}`, - candidates: []UnionCandidate{ - {Type: "object", Value: AnyUnion{AsObject: &Inner{Foo: "x"}}}, - {Type: "any", Value: AnyUnion{AsAny: map[string]any{"foo": "x"}}}, - }, - wantType: "object", - }, - } - - for _, tc := range cases { - t.Run(tc.name, func(t *testing.T) { - result := PickBestUnionCandidate(tc.candidates, []byte(tc.payload)) - require.NotNil(t, result) - assert.Equal(t, tc.wantType, result.Type) - }) - } -} diff --git a/models.go b/models.go index 507277c0..342a7797 100644 --- a/models.go +++ b/models.go @@ -181,7 +181,7 @@ func (s *Models) Get(ctx context.Context, author string, slug string, opts ...op _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) return nil, err - } else if utils.MatchStatusCodes([]string{"4XX", "5XX"}, httpRes.StatusCode) { + } else if utils.MatchStatusCodes([]string{"404", "4XX", "500", "5XX"}, httpRes.StatusCode) { _httpRes, err := s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) if err != nil { return nil, err @@ -431,7 +431,7 @@ func (s *Models) List(ctx context.Context, request *operations.GetModelsRequest, _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) return nil, err - } else if utils.MatchStatusCodes([]string{"4XX", "5XX"}, httpRes.StatusCode) { + } else if utils.MatchStatusCodes([]string{"400", "4XX", "500", "5XX"}, httpRes.StatusCode) { _httpRes, err := s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) if err != nil { return nil, err @@ -685,7 +685,7 @@ func (s *Models) Count(ctx context.Context, outputModalities *string, opts ...op _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) return nil, err - } else if utils.MatchStatusCodes([]string{"4XX", "5XX"}, httpRes.StatusCode) { + } else if utils.MatchStatusCodes([]string{"400", "4XX", "500", "5XX"}, httpRes.StatusCode) { _httpRes, err := s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) if err != nil { return nil, err @@ -932,7 +932,7 @@ func (s *Models) ListForUser(ctx context.Context, security operations.ListModels _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) return nil, err - } else if utils.MatchStatusCodes([]string{"4XX", "5XX"}, httpRes.StatusCode) { + } else if utils.MatchStatusCodes([]string{"401", "404", "4XX", "500", "5XX"}, httpRes.StatusCode) { _httpRes, err := s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) if err != nil { return nil, err diff --git a/models/components/advisorreasoning.go b/models/components/advisorreasoning.go index 9cd505e6..e10f3a38 100644 --- a/models/components/advisorreasoning.go +++ b/models/components/advisorreasoning.go @@ -10,6 +10,7 @@ import ( type AdvisorReasoningEffort string const ( + AdvisorReasoningEffortMax AdvisorReasoningEffort = "max" AdvisorReasoningEffortXhigh AdvisorReasoningEffort = "xhigh" AdvisorReasoningEffortHigh AdvisorReasoningEffort = "high" AdvisorReasoningEffortMedium AdvisorReasoningEffort = "medium" @@ -26,7 +27,7 @@ func (e AdvisorReasoningEffort) ToPointer() *AdvisorReasoningEffort { func (e *AdvisorReasoningEffort) IsExact() bool { if e != nil { switch *e { - case "xhigh", "high", "medium", "low", "minimal", "none": + case "max", "xhigh", "high", "medium", "low", "minimal", "none": return true } } diff --git a/models/components/anthropicadvisormessageusageiteration.go b/models/components/anthropicadvisormessageusageiteration.go new file mode 100644 index 00000000..d449ab48 --- /dev/null +++ b/models/components/anthropicadvisormessageusageiteration.go @@ -0,0 +1,103 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +import ( + "encoding/json" + "fmt" + "github.com/OpenRouterTeam/go-sdk/internal/utils" + "github.com/OpenRouterTeam/go-sdk/optionalnullable" +) + +type AnthropicAdvisorMessageUsageIterationType string + +const ( + AnthropicAdvisorMessageUsageIterationTypeAdvisorMessage AnthropicAdvisorMessageUsageIterationType = "advisor_message" +) + +func (e AnthropicAdvisorMessageUsageIterationType) ToPointer() *AnthropicAdvisorMessageUsageIterationType { + return &e +} +func (e *AnthropicAdvisorMessageUsageIterationType) UnmarshalJSON(data []byte) error { + var v string + if err := json.Unmarshal(data, &v); err != nil { + return err + } + switch v { + case "advisor_message": + *e = AnthropicAdvisorMessageUsageIterationType(v) + return nil + default: + return fmt.Errorf("invalid value for AnthropicAdvisorMessageUsageIterationType: %v", v) + } +} + +type AnthropicAdvisorMessageUsageIteration struct { + CacheCreation optionalnullable.OptionalNullable[AnthropicIterationCacheCreation] `json:"cache_creation,omitzero"` + CacheCreationInputTokens *int64 `json:"cache_creation_input_tokens,omitzero"` + CacheReadInputTokens *int64 `json:"cache_read_input_tokens,omitzero"` + InputTokens *int64 `json:"input_tokens,omitzero"` + OutputTokens *int64 `json:"output_tokens,omitzero"` + Model string `json:"model"` + Type AnthropicAdvisorMessageUsageIterationType `json:"type"` +} + +func (a AnthropicAdvisorMessageUsageIteration) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(a, "", false) +} + +func (a *AnthropicAdvisorMessageUsageIteration) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &a, "", false, nil); err != nil { + return err + } + return nil +} + +func (a *AnthropicAdvisorMessageUsageIteration) GetCacheCreation() optionalnullable.OptionalNullable[AnthropicIterationCacheCreation] { + if a == nil { + return nil + } + return a.CacheCreation +} + +func (a *AnthropicAdvisorMessageUsageIteration) GetCacheCreationInputTokens() *int64 { + if a == nil { + return nil + } + return a.CacheCreationInputTokens +} + +func (a *AnthropicAdvisorMessageUsageIteration) GetCacheReadInputTokens() *int64 { + if a == nil { + return nil + } + return a.CacheReadInputTokens +} + +func (a *AnthropicAdvisorMessageUsageIteration) GetInputTokens() *int64 { + if a == nil { + return nil + } + return a.InputTokens +} + +func (a *AnthropicAdvisorMessageUsageIteration) GetOutputTokens() *int64 { + if a == nil { + return nil + } + return a.OutputTokens +} + +func (a *AnthropicAdvisorMessageUsageIteration) GetModel() string { + if a == nil { + return "" + } + return a.Model +} + +func (a *AnthropicAdvisorMessageUsageIteration) GetType() AnthropicAdvisorMessageUsageIterationType { + if a == nil { + return AnthropicAdvisorMessageUsageIterationType("") + } + return a.Type +} diff --git a/models/components/anthropiccompactionusageiteration.go b/models/components/anthropiccompactionusageiteration.go new file mode 100644 index 00000000..1e8cea32 --- /dev/null +++ b/models/components/anthropiccompactionusageiteration.go @@ -0,0 +1,95 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +import ( + "encoding/json" + "fmt" + "github.com/OpenRouterTeam/go-sdk/internal/utils" + "github.com/OpenRouterTeam/go-sdk/optionalnullable" +) + +type AnthropicCompactionUsageIterationType string + +const ( + AnthropicCompactionUsageIterationTypeCompaction AnthropicCompactionUsageIterationType = "compaction" +) + +func (e AnthropicCompactionUsageIterationType) ToPointer() *AnthropicCompactionUsageIterationType { + return &e +} +func (e *AnthropicCompactionUsageIterationType) UnmarshalJSON(data []byte) error { + var v string + if err := json.Unmarshal(data, &v); err != nil { + return err + } + switch v { + case "compaction": + *e = AnthropicCompactionUsageIterationType(v) + return nil + default: + return fmt.Errorf("invalid value for AnthropicCompactionUsageIterationType: %v", v) + } +} + +type AnthropicCompactionUsageIteration struct { + CacheCreation optionalnullable.OptionalNullable[AnthropicIterationCacheCreation] `json:"cache_creation,omitzero"` + CacheCreationInputTokens *int64 `json:"cache_creation_input_tokens,omitzero"` + CacheReadInputTokens *int64 `json:"cache_read_input_tokens,omitzero"` + InputTokens *int64 `json:"input_tokens,omitzero"` + OutputTokens *int64 `json:"output_tokens,omitzero"` + Type AnthropicCompactionUsageIterationType `json:"type"` +} + +func (a AnthropicCompactionUsageIteration) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(a, "", false) +} + +func (a *AnthropicCompactionUsageIteration) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &a, "", false, nil); err != nil { + return err + } + return nil +} + +func (a *AnthropicCompactionUsageIteration) GetCacheCreation() optionalnullable.OptionalNullable[AnthropicIterationCacheCreation] { + if a == nil { + return nil + } + return a.CacheCreation +} + +func (a *AnthropicCompactionUsageIteration) GetCacheCreationInputTokens() *int64 { + if a == nil { + return nil + } + return a.CacheCreationInputTokens +} + +func (a *AnthropicCompactionUsageIteration) GetCacheReadInputTokens() *int64 { + if a == nil { + return nil + } + return a.CacheReadInputTokens +} + +func (a *AnthropicCompactionUsageIteration) GetInputTokens() *int64 { + if a == nil { + return nil + } + return a.InputTokens +} + +func (a *AnthropicCompactionUsageIteration) GetOutputTokens() *int64 { + if a == nil { + return nil + } + return a.OutputTokens +} + +func (a *AnthropicCompactionUsageIteration) GetType() AnthropicCompactionUsageIterationType { + if a == nil { + return AnthropicCompactionUsageIterationType("") + } + return a.Type +} diff --git a/models/components/anthropicdocumentblockparam.go b/models/components/anthropicdocumentblockparam.go index 3a3eff0a..33385496 100644 --- a/models/components/anthropicdocumentblockparam.go +++ b/models/components/anthropicdocumentblockparam.go @@ -266,13 +266,15 @@ const ( AnthropicDocumentBlockParamSourceUnionTypeText AnthropicDocumentBlockParamSourceUnionType = "text" AnthropicDocumentBlockParamSourceUnionTypeContent AnthropicDocumentBlockParamSourceUnionType = "content" AnthropicDocumentBlockParamSourceUnionTypeURLObj AnthropicDocumentBlockParamSourceUnionType = "url" + AnthropicDocumentBlockParamSourceUnionTypeFile AnthropicDocumentBlockParamSourceUnionType = "file" ) type AnthropicDocumentBlockParamSourceUnion struct { - AnthropicBase64PdfSource *AnthropicBase64PdfSource `queryParam:"inline" union:"member"` - AnthropicPlainTextSource *AnthropicPlainTextSource `queryParam:"inline" union:"member"` - SourceContent *SourceContent `queryParam:"inline" union:"member"` - AnthropicURLPdfSource *AnthropicURLPdfSource `queryParam:"inline" union:"member"` + AnthropicBase64PdfSource *AnthropicBase64PdfSource `queryParam:"inline" union:"member"` + AnthropicPlainTextSource *AnthropicPlainTextSource `queryParam:"inline" union:"member"` + SourceContent *SourceContent `queryParam:"inline" union:"member"` + AnthropicURLPdfSource *AnthropicURLPdfSource `queryParam:"inline" union:"member"` + AnthropicFileDocumentSource *AnthropicFileDocumentSource `queryParam:"inline" union:"member"` Type AnthropicDocumentBlockParamSourceUnionType } @@ -325,6 +327,18 @@ func CreateAnthropicDocumentBlockParamSourceUnionURLObj(urlT AnthropicURLPdfSour } } +func CreateAnthropicDocumentBlockParamSourceUnionFile(file AnthropicFileDocumentSource) AnthropicDocumentBlockParamSourceUnion { + typ := AnthropicDocumentBlockParamSourceUnionTypeFile + + typStr := AnthropicFileDocumentSourceType(typ) + file.Type = typStr + + return AnthropicDocumentBlockParamSourceUnion{ + AnthropicFileDocumentSource: &file, + Type: typ, + } +} + func (u *AnthropicDocumentBlockParamSourceUnion) UnmarshalJSON(data []byte) error { type discriminator struct { @@ -373,6 +387,15 @@ func (u *AnthropicDocumentBlockParamSourceUnion) UnmarshalJSON(data []byte) erro u.AnthropicURLPdfSource = anthropicURLPdfSource u.Type = AnthropicDocumentBlockParamSourceUnionTypeURLObj return nil + case "file": + anthropicFileDocumentSource := new(AnthropicFileDocumentSource) + if err := utils.UnmarshalJSON(data, &anthropicFileDocumentSource, "", true, nil); err != nil { + return fmt.Errorf("could not unmarshal `%s` into expected (Type == file) type AnthropicFileDocumentSource within AnthropicDocumentBlockParamSourceUnion: %w", string(data), err) + } + + u.AnthropicFileDocumentSource = anthropicFileDocumentSource + u.Type = AnthropicDocumentBlockParamSourceUnionTypeFile + return nil } return fmt.Errorf("could not unmarshal `%s` into any supported union types for AnthropicDocumentBlockParamSourceUnion", string(data)) @@ -395,6 +418,10 @@ func (u AnthropicDocumentBlockParamSourceUnion) MarshalJSON() ([]byte, error) { return utils.MarshalJSON(u.AnthropicURLPdfSource, "", true) } + if u.AnthropicFileDocumentSource != nil { + return utils.MarshalJSON(u.AnthropicFileDocumentSource, "", true) + } + return nil, errors.New("could not marshal union type AnthropicDocumentBlockParamSourceUnion: all fields are null") } @@ -486,6 +513,10 @@ func (a *AnthropicDocumentBlockParam) GetSourceURLObj() *AnthropicURLPdfSource { return a.GetSource().AnthropicURLPdfSource } +func (a *AnthropicDocumentBlockParam) GetSourceFile() *AnthropicFileDocumentSource { + return a.GetSource().AnthropicFileDocumentSource +} + func (a *AnthropicDocumentBlockParam) GetTitle() optionalnullable.OptionalNullable[string] { if a == nil { return nil diff --git a/models/components/anthropicfiledocumentsource.go b/models/components/anthropicfiledocumentsource.go new file mode 100644 index 00000000..d943045b --- /dev/null +++ b/models/components/anthropicfiledocumentsource.go @@ -0,0 +1,62 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +import ( + "encoding/json" + "fmt" + "github.com/OpenRouterTeam/go-sdk/internal/utils" +) + +type AnthropicFileDocumentSourceType string + +const ( + AnthropicFileDocumentSourceTypeFile AnthropicFileDocumentSourceType = "file" +) + +func (e AnthropicFileDocumentSourceType) ToPointer() *AnthropicFileDocumentSourceType { + return &e +} +func (e *AnthropicFileDocumentSourceType) UnmarshalJSON(data []byte) error { + var v string + if err := json.Unmarshal(data, &v); err != nil { + return err + } + switch v { + case "file": + *e = AnthropicFileDocumentSourceType(v) + return nil + default: + return fmt.Errorf("invalid value for AnthropicFileDocumentSourceType: %v", v) + } +} + +type AnthropicFileDocumentSource struct { + FileID string `json:"file_id"` + Type AnthropicFileDocumentSourceType `json:"type"` +} + +func (a AnthropicFileDocumentSource) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(a, "", false) +} + +func (a *AnthropicFileDocumentSource) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &a, "", false, nil); err != nil { + return err + } + return nil +} + +func (a *AnthropicFileDocumentSource) GetFileID() string { + if a == nil { + return "" + } + return a.FileID +} + +func (a *AnthropicFileDocumentSource) GetType() AnthropicFileDocumentSourceType { + if a == nil { + return AnthropicFileDocumentSourceType("") + } + return a.Type +} diff --git a/models/components/anthropiciterationcachecreation.go b/models/components/anthropiciterationcachecreation.go new file mode 100644 index 00000000..b0981ccf --- /dev/null +++ b/models/components/anthropiciterationcachecreation.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 AnthropicIterationCacheCreation struct { + Ephemeral1hInputTokens *int64 `json:"ephemeral_1h_input_tokens,omitzero"` + Ephemeral5mInputTokens *int64 `json:"ephemeral_5m_input_tokens,omitzero"` +} + +func (a AnthropicIterationCacheCreation) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(a, "", false) +} + +func (a *AnthropicIterationCacheCreation) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &a, "", false, nil); err != nil { + return err + } + return nil +} + +func (a *AnthropicIterationCacheCreation) GetEphemeral1hInputTokens() *int64 { + if a == nil { + return nil + } + return a.Ephemeral1hInputTokens +} + +func (a *AnthropicIterationCacheCreation) GetEphemeral5mInputTokens() *int64 { + if a == nil { + return nil + } + return a.Ephemeral5mInputTokens +} diff --git a/models/components/anthropicmessageusageiteration.go b/models/components/anthropicmessageusageiteration.go new file mode 100644 index 00000000..7cfbe1c7 --- /dev/null +++ b/models/components/anthropicmessageusageiteration.go @@ -0,0 +1,103 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +import ( + "encoding/json" + "fmt" + "github.com/OpenRouterTeam/go-sdk/internal/utils" + "github.com/OpenRouterTeam/go-sdk/optionalnullable" +) + +type AnthropicMessageUsageIterationType string + +const ( + AnthropicMessageUsageIterationTypeMessage AnthropicMessageUsageIterationType = "message" +) + +func (e AnthropicMessageUsageIterationType) ToPointer() *AnthropicMessageUsageIterationType { + return &e +} +func (e *AnthropicMessageUsageIterationType) UnmarshalJSON(data []byte) error { + var v string + if err := json.Unmarshal(data, &v); err != nil { + return err + } + switch v { + case "message": + *e = AnthropicMessageUsageIterationType(v) + return nil + default: + return fmt.Errorf("invalid value for AnthropicMessageUsageIterationType: %v", v) + } +} + +type AnthropicMessageUsageIteration struct { + CacheCreation optionalnullable.OptionalNullable[AnthropicIterationCacheCreation] `json:"cache_creation,omitzero"` + CacheCreationInputTokens *int64 `json:"cache_creation_input_tokens,omitzero"` + CacheReadInputTokens *int64 `json:"cache_read_input_tokens,omitzero"` + InputTokens *int64 `json:"input_tokens,omitzero"` + OutputTokens *int64 `json:"output_tokens,omitzero"` + Model *string `json:"model,omitzero"` + Type AnthropicMessageUsageIterationType `json:"type"` +} + +func (a AnthropicMessageUsageIteration) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(a, "", false) +} + +func (a *AnthropicMessageUsageIteration) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &a, "", false, nil); err != nil { + return err + } + return nil +} + +func (a *AnthropicMessageUsageIteration) GetCacheCreation() optionalnullable.OptionalNullable[AnthropicIterationCacheCreation] { + if a == nil { + return nil + } + return a.CacheCreation +} + +func (a *AnthropicMessageUsageIteration) GetCacheCreationInputTokens() *int64 { + if a == nil { + return nil + } + return a.CacheCreationInputTokens +} + +func (a *AnthropicMessageUsageIteration) GetCacheReadInputTokens() *int64 { + if a == nil { + return nil + } + return a.CacheReadInputTokens +} + +func (a *AnthropicMessageUsageIteration) GetInputTokens() *int64 { + if a == nil { + return nil + } + return a.InputTokens +} + +func (a *AnthropicMessageUsageIteration) GetOutputTokens() *int64 { + if a == nil { + return nil + } + return a.OutputTokens +} + +func (a *AnthropicMessageUsageIteration) GetModel() *string { + if a == nil { + return nil + } + return a.Model +} + +func (a *AnthropicMessageUsageIteration) GetType() AnthropicMessageUsageIterationType { + if a == nil { + return AnthropicMessageUsageIterationType("") + } + return a.Type +} diff --git a/models/components/anthropicspeed.go b/models/components/anthropicspeed.go new file mode 100644 index 00000000..d38fde5d --- /dev/null +++ b/models/components/anthropicspeed.go @@ -0,0 +1,25 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +type AnthropicSpeed string + +const ( + AnthropicSpeedFast AnthropicSpeed = "fast" + AnthropicSpeedStandard AnthropicSpeed = "standard" +) + +func (e AnthropicSpeed) ToPointer() *AnthropicSpeed { + return &e +} + +// IsExact returns true if the value matches a known enum value, false otherwise. +func (e *AnthropicSpeed) IsExact() bool { + if e != nil { + switch *e { + case "fast", "standard": + return true + } + } + return false +} diff --git a/models/components/anthropicunknownusageiteration.go b/models/components/anthropicunknownusageiteration.go new file mode 100644 index 00000000..d581c2bf --- /dev/null +++ b/models/components/anthropicunknownusageiteration.go @@ -0,0 +1,70 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +import ( + "github.com/OpenRouterTeam/go-sdk/internal/utils" + "github.com/OpenRouterTeam/go-sdk/optionalnullable" +) + +type AnthropicUnknownUsageIteration struct { + CacheCreation optionalnullable.OptionalNullable[AnthropicIterationCacheCreation] `json:"cache_creation,omitzero"` + CacheCreationInputTokens *int64 `json:"cache_creation_input_tokens,omitzero"` + CacheReadInputTokens *int64 `json:"cache_read_input_tokens,omitzero"` + InputTokens *int64 `json:"input_tokens,omitzero"` + OutputTokens *int64 `json:"output_tokens,omitzero"` + Type string `json:"type"` +} + +func (a AnthropicUnknownUsageIteration) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(a, "", false) +} + +func (a *AnthropicUnknownUsageIteration) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &a, "", false, nil); err != nil { + return err + } + return nil +} + +func (a *AnthropicUnknownUsageIteration) GetCacheCreation() optionalnullable.OptionalNullable[AnthropicIterationCacheCreation] { + if a == nil { + return nil + } + return a.CacheCreation +} + +func (a *AnthropicUnknownUsageIteration) GetCacheCreationInputTokens() *int64 { + if a == nil { + return nil + } + return a.CacheCreationInputTokens +} + +func (a *AnthropicUnknownUsageIteration) GetCacheReadInputTokens() *int64 { + if a == nil { + return nil + } + return a.CacheReadInputTokens +} + +func (a *AnthropicUnknownUsageIteration) GetInputTokens() *int64 { + if a == nil { + return nil + } + return a.InputTokens +} + +func (a *AnthropicUnknownUsageIteration) GetOutputTokens() *int64 { + if a == nil { + return nil + } + return a.OutputTokens +} + +func (a *AnthropicUnknownUsageIteration) GetType() string { + if a == nil { + return "" + } + return a.Type +} diff --git a/models/components/anthropicusageiteration.go b/models/components/anthropicusageiteration.go new file mode 100644 index 00000000..44c84538 --- /dev/null +++ b/models/components/anthropicusageiteration.go @@ -0,0 +1,150 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +import ( + "errors" + "fmt" + "github.com/OpenRouterTeam/go-sdk/internal/utils" +) + +type AnthropicUsageIterationType string + +const ( + AnthropicUsageIterationTypeAnthropicCompactionUsageIteration AnthropicUsageIterationType = "AnthropicCompactionUsageIteration" + AnthropicUsageIterationTypeAnthropicMessageUsageIteration AnthropicUsageIterationType = "AnthropicMessageUsageIteration" + AnthropicUsageIterationTypeAnthropicAdvisorMessageUsageIteration AnthropicUsageIterationType = "AnthropicAdvisorMessageUsageIteration" + AnthropicUsageIterationTypeAnthropicUnknownUsageIteration AnthropicUsageIterationType = "AnthropicUnknownUsageIteration" +) + +type AnthropicUsageIteration struct { + AnthropicCompactionUsageIteration *AnthropicCompactionUsageIteration `queryParam:"inline" union:"member"` + AnthropicMessageUsageIteration *AnthropicMessageUsageIteration `queryParam:"inline" union:"member"` + AnthropicAdvisorMessageUsageIteration *AnthropicAdvisorMessageUsageIteration `queryParam:"inline" union:"member"` + AnthropicUnknownUsageIteration *AnthropicUnknownUsageIteration `queryParam:"inline" union:"member"` + + Type AnthropicUsageIterationType +} + +func CreateAnthropicUsageIterationAnthropicCompactionUsageIteration(anthropicCompactionUsageIteration AnthropicCompactionUsageIteration) AnthropicUsageIteration { + typ := AnthropicUsageIterationTypeAnthropicCompactionUsageIteration + + return AnthropicUsageIteration{ + AnthropicCompactionUsageIteration: &anthropicCompactionUsageIteration, + Type: typ, + } +} + +func CreateAnthropicUsageIterationAnthropicMessageUsageIteration(anthropicMessageUsageIteration AnthropicMessageUsageIteration) AnthropicUsageIteration { + typ := AnthropicUsageIterationTypeAnthropicMessageUsageIteration + + return AnthropicUsageIteration{ + AnthropicMessageUsageIteration: &anthropicMessageUsageIteration, + Type: typ, + } +} + +func CreateAnthropicUsageIterationAnthropicAdvisorMessageUsageIteration(anthropicAdvisorMessageUsageIteration AnthropicAdvisorMessageUsageIteration) AnthropicUsageIteration { + typ := AnthropicUsageIterationTypeAnthropicAdvisorMessageUsageIteration + + return AnthropicUsageIteration{ + AnthropicAdvisorMessageUsageIteration: &anthropicAdvisorMessageUsageIteration, + Type: typ, + } +} + +func CreateAnthropicUsageIterationAnthropicUnknownUsageIteration(anthropicUnknownUsageIteration AnthropicUnknownUsageIteration) AnthropicUsageIteration { + typ := AnthropicUsageIterationTypeAnthropicUnknownUsageIteration + + return AnthropicUsageIteration{ + AnthropicUnknownUsageIteration: &anthropicUnknownUsageIteration, + Type: typ, + } +} + +func (u *AnthropicUsageIteration) UnmarshalJSON(data []byte) error { + + var candidates []utils.UnionCandidate + + // Collect all valid candidates + var anthropicCompactionUsageIteration AnthropicCompactionUsageIteration = AnthropicCompactionUsageIteration{} + if err := utils.UnmarshalJSON(data, &anthropicCompactionUsageIteration, "", true, nil); err == nil { + candidates = append(candidates, utils.UnionCandidate{ + Type: AnthropicUsageIterationTypeAnthropicCompactionUsageIteration, + Value: &anthropicCompactionUsageIteration, + }) + } + + var anthropicMessageUsageIteration AnthropicMessageUsageIteration = AnthropicMessageUsageIteration{} + if err := utils.UnmarshalJSON(data, &anthropicMessageUsageIteration, "", true, nil); err == nil { + candidates = append(candidates, utils.UnionCandidate{ + Type: AnthropicUsageIterationTypeAnthropicMessageUsageIteration, + Value: &anthropicMessageUsageIteration, + }) + } + + var anthropicAdvisorMessageUsageIteration AnthropicAdvisorMessageUsageIteration = AnthropicAdvisorMessageUsageIteration{} + if err := utils.UnmarshalJSON(data, &anthropicAdvisorMessageUsageIteration, "", true, nil); err == nil { + candidates = append(candidates, utils.UnionCandidate{ + Type: AnthropicUsageIterationTypeAnthropicAdvisorMessageUsageIteration, + Value: &anthropicAdvisorMessageUsageIteration, + }) + } + + var anthropicUnknownUsageIteration AnthropicUnknownUsageIteration = AnthropicUnknownUsageIteration{} + if err := utils.UnmarshalJSON(data, &anthropicUnknownUsageIteration, "", true, nil); err == nil { + candidates = append(candidates, utils.UnionCandidate{ + Type: AnthropicUsageIterationTypeAnthropicUnknownUsageIteration, + Value: &anthropicUnknownUsageIteration, + }) + } + + if len(candidates) == 0 { + return fmt.Errorf("could not unmarshal `%s` into any supported union types for AnthropicUsageIteration", string(data)) + } + + // Pick the best candidate using multi-stage filtering + best := utils.PickBestUnionCandidate(candidates, data) + if best == nil { + return fmt.Errorf("could not unmarshal `%s` into any supported union types for AnthropicUsageIteration", string(data)) + } + + // Set the union type and value based on the best candidate + u.Type = best.Type.(AnthropicUsageIterationType) + switch best.Type { + case AnthropicUsageIterationTypeAnthropicCompactionUsageIteration: + u.AnthropicCompactionUsageIteration = best.Value.(*AnthropicCompactionUsageIteration) + return nil + case AnthropicUsageIterationTypeAnthropicMessageUsageIteration: + u.AnthropicMessageUsageIteration = best.Value.(*AnthropicMessageUsageIteration) + return nil + case AnthropicUsageIterationTypeAnthropicAdvisorMessageUsageIteration: + u.AnthropicAdvisorMessageUsageIteration = best.Value.(*AnthropicAdvisorMessageUsageIteration) + return nil + case AnthropicUsageIterationTypeAnthropicUnknownUsageIteration: + u.AnthropicUnknownUsageIteration = best.Value.(*AnthropicUnknownUsageIteration) + return nil + } + + return fmt.Errorf("could not unmarshal `%s` into any supported union types for AnthropicUsageIteration", string(data)) +} + +func (u AnthropicUsageIteration) MarshalJSON() ([]byte, error) { + if u.AnthropicCompactionUsageIteration != nil { + return utils.MarshalJSON(u.AnthropicCompactionUsageIteration, "", true) + } + + if u.AnthropicMessageUsageIteration != nil { + return utils.MarshalJSON(u.AnthropicMessageUsageIteration, "", true) + } + + if u.AnthropicAdvisorMessageUsageIteration != nil { + return utils.MarshalJSON(u.AnthropicAdvisorMessageUsageIteration, "", true) + } + + if u.AnthropicUnknownUsageIteration != nil { + return utils.MarshalJSON(u.AnthropicUnknownUsageIteration, "", true) + } + + return nil, errors.New("could not marshal union type AnthropicUsageIteration: all fields are null") +} diff --git a/models/components/apierrortype.go b/models/components/apierrortype.go new file mode 100644 index 00000000..2822651e --- /dev/null +++ b/models/components/apierrortype.go @@ -0,0 +1,51 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +// APIErrorType - Canonical OpenRouter error type, stable across all API formats +type APIErrorType string + +const ( + APIErrorTypeContextLengthExceeded APIErrorType = "context_length_exceeded" + APIErrorTypeMaxTokensExceeded APIErrorType = "max_tokens_exceeded" + APIErrorTypeTokenLimitExceeded APIErrorType = "token_limit_exceeded" + APIErrorTypeStringTooLong APIErrorType = "string_too_long" + APIErrorTypeAuthentication APIErrorType = "authentication" + APIErrorTypePermissionDenied APIErrorType = "permission_denied" + APIErrorTypePaymentRequired APIErrorType = "payment_required" + APIErrorTypeRateLimitExceeded APIErrorType = "rate_limit_exceeded" + APIErrorTypeProviderOverloaded APIErrorType = "provider_overloaded" + APIErrorTypeProviderUnavailable APIErrorType = "provider_unavailable" + APIErrorTypeInvalidRequest APIErrorType = "invalid_request" + APIErrorTypeInvalidPrompt APIErrorType = "invalid_prompt" + APIErrorTypeNotFound APIErrorType = "not_found" + APIErrorTypePreconditionFailed APIErrorType = "precondition_failed" + APIErrorTypePayloadTooLarge APIErrorType = "payload_too_large" + APIErrorTypeUnprocessable APIErrorType = "unprocessable" + APIErrorTypeContentPolicyViolation APIErrorType = "content_policy_violation" + APIErrorTypeRefusal APIErrorType = "refusal" + APIErrorTypeInvalidImage APIErrorType = "invalid_image" + APIErrorTypeImageTooLarge APIErrorType = "image_too_large" + APIErrorTypeImageTooSmall APIErrorType = "image_too_small" + APIErrorTypeUnsupportedImageFormat APIErrorType = "unsupported_image_format" + APIErrorTypeImageNotFound APIErrorType = "image_not_found" + APIErrorTypeImageDownloadFailed APIErrorType = "image_download_failed" + APIErrorTypeServer APIErrorType = "server" + APIErrorTypeTimeout APIErrorType = "timeout" + APIErrorTypeUnmapped APIErrorType = "unmapped" +) + +func (e APIErrorType) ToPointer() *APIErrorType { + return &e +} + +// IsExact returns true if the value matches a known enum value, false otherwise. +func (e *APIErrorType) IsExact() bool { + if e != nil { + switch *e { + case "context_length_exceeded", "max_tokens_exceeded", "token_limit_exceeded", "string_too_long", "authentication", "permission_denied", "payment_required", "rate_limit_exceeded", "provider_overloaded", "provider_unavailable", "invalid_request", "invalid_prompt", "not_found", "precondition_failed", "payload_too_large", "unprocessable", "content_policy_violation", "refusal", "invalid_image", "image_too_large", "image_too_small", "unsupported_image_format", "image_not_found", "image_download_failed", "server", "timeout", "unmapped": + return true + } + } + return false +} diff --git a/models/components/benchmarkpricing.go b/models/components/benchmarkpricing.go deleted file mode 100644 index c09eb349..00000000 --- a/models/components/benchmarkpricing.go +++ /dev/null @@ -1,25 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -// BenchmarkPricing - OpenRouter pricing per token for this model. Null if pricing is unavailable. -type BenchmarkPricing struct { - // Cost per output token (USD, decimal string). - Completion string `json:"completion"` - // Cost per input token (USD, decimal string). - Prompt string `json:"prompt"` -} - -func (b *BenchmarkPricing) GetCompletion() string { - if b == nil { - return "" - } - return b.Completion -} - -func (b *BenchmarkPricing) GetPrompt() string { - if b == nil { - return "" - } - return b.Prompt -} diff --git a/models/components/benchmarksaaitem.go b/models/components/benchmarksaaitem.go deleted file mode 100644 index 0f7a7894..00000000 --- a/models/components/benchmarksaaitem.go +++ /dev/null @@ -1,60 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -type BenchmarksAAItem struct { - // Model name as listed on Artificial Analysis. - AaName string `json:"aa_name"` - // Artificial Analysis Agentic Index composite score. Higher is better. - AgenticIndex *float64 `json:"agentic_index"` - // Artificial Analysis Coding Index composite score. Higher is better. - CodingIndex *float64 `json:"coding_index"` - // Artificial Analysis Intelligence Index composite score. Higher is better. - IntelligenceIndex *float64 `json:"intelligence_index"` - // Stable OpenRouter model identifier. - ModelPermaslug string `json:"model_permaslug"` - // OpenRouter pricing per token for this model. Null if pricing is unavailable. - Pricing *BenchmarkPricing `json:"pricing"` -} - -func (b *BenchmarksAAItem) GetAaName() string { - if b == nil { - return "" - } - return b.AaName -} - -func (b *BenchmarksAAItem) GetAgenticIndex() *float64 { - if b == nil { - return nil - } - return b.AgenticIndex -} - -func (b *BenchmarksAAItem) GetCodingIndex() *float64 { - if b == nil { - return nil - } - return b.CodingIndex -} - -func (b *BenchmarksAAItem) GetIntelligenceIndex() *float64 { - if b == nil { - return nil - } - return b.IntelligenceIndex -} - -func (b *BenchmarksAAItem) GetModelPermaslug() string { - if b == nil { - return "" - } - return b.ModelPermaslug -} - -func (b *BenchmarksAAItem) GetPricing() *BenchmarkPricing { - if b == nil { - return nil - } - return b.Pricing -} diff --git a/models/components/benchmarksaameta.go b/models/components/benchmarksaameta.go deleted file mode 100644 index a719dc06..00000000 --- a/models/components/benchmarksaameta.go +++ /dev/null @@ -1,137 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -import ( - "encoding/json" - "fmt" -) - -// BenchmarksAAMetaSource - Data source identifier. -type BenchmarksAAMetaSource string - -const ( - BenchmarksAAMetaSourceArtificialAnalysis BenchmarksAAMetaSource = "artificial-analysis" -) - -func (e BenchmarksAAMetaSource) ToPointer() *BenchmarksAAMetaSource { - return &e -} -func (e *BenchmarksAAMetaSource) UnmarshalJSON(data []byte) error { - var v string - if err := json.Unmarshal(data, &v); err != nil { - return err - } - switch v { - case "artificial-analysis": - *e = BenchmarksAAMetaSource(v) - return nil - default: - return fmt.Errorf("invalid value for BenchmarksAAMetaSource: %v", v) - } -} - -// BenchmarksAAMetaSourceURL - URL of the upstream data source. -type BenchmarksAAMetaSourceURL string - -const ( - BenchmarksAAMetaSourceURLHTTPSArtificialanalysisAi BenchmarksAAMetaSourceURL = "https://artificialanalysis.ai" -) - -func (e BenchmarksAAMetaSourceURL) ToPointer() *BenchmarksAAMetaSourceURL { - return &e -} -func (e *BenchmarksAAMetaSourceURL) UnmarshalJSON(data []byte) error { - var v string - if err := json.Unmarshal(data, &v); err != nil { - return err - } - switch v { - case "https://artificialanalysis.ai": - *e = BenchmarksAAMetaSourceURL(v) - return nil - default: - return fmt.Errorf("invalid value for BenchmarksAAMetaSourceURL: %v", v) - } -} - -// BenchmarksAAMetaVersion - Dataset version. -type BenchmarksAAMetaVersion string - -const ( - BenchmarksAAMetaVersionV1 BenchmarksAAMetaVersion = "v1" -) - -func (e BenchmarksAAMetaVersion) ToPointer() *BenchmarksAAMetaVersion { - return &e -} -func (e *BenchmarksAAMetaVersion) UnmarshalJSON(data []byte) error { - var v string - if err := json.Unmarshal(data, &v); err != nil { - return err - } - switch v { - case "v1": - *e = BenchmarksAAMetaVersion(v) - return nil - default: - return fmt.Errorf("invalid value for BenchmarksAAMetaVersion: %v", v) - } -} - -type BenchmarksAAMeta struct { - // ISO-8601 timestamp of when this data was last updated. - AsOf string `json:"as_of"` - // Required attribution when republishing this data. - Citation string `json:"citation"` - // Number of unique models in the response. - ModelCount int64 `json:"model_count"` - // Data source identifier. - Source BenchmarksAAMetaSource `json:"source"` - // URL of the upstream data source. - SourceURL BenchmarksAAMetaSourceURL `json:"source_url"` - // Dataset version. - Version BenchmarksAAMetaVersion `json:"version"` -} - -func (b *BenchmarksAAMeta) GetAsOf() string { - if b == nil { - return "" - } - return b.AsOf -} - -func (b *BenchmarksAAMeta) GetCitation() string { - if b == nil { - return "" - } - return b.Citation -} - -func (b *BenchmarksAAMeta) GetModelCount() int64 { - if b == nil { - return 0 - } - return b.ModelCount -} - -func (b *BenchmarksAAMeta) GetSource() BenchmarksAAMetaSource { - if b == nil { - return BenchmarksAAMetaSource("") - } - return b.Source -} - -func (b *BenchmarksAAMeta) GetSourceURL() BenchmarksAAMetaSourceURL { - if b == nil { - return BenchmarksAAMetaSourceURL("") - } - return b.SourceURL -} - -func (b *BenchmarksAAMeta) GetVersion() BenchmarksAAMetaVersion { - if b == nil { - return BenchmarksAAMetaVersion("") - } - return b.Version -} diff --git a/models/components/benchmarksaaresponse.go b/models/components/benchmarksaaresponse.go deleted file mode 100644 index 2ee03e3b..00000000 --- a/models/components/benchmarksaaresponse.go +++ /dev/null @@ -1,22 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -type BenchmarksAAResponse struct { - Data []BenchmarksAAItem `json:"data"` - Meta BenchmarksAAMeta `json:"meta"` -} - -func (b *BenchmarksAAResponse) GetData() []BenchmarksAAItem { - if b == nil { - return []BenchmarksAAItem{} - } - return b.Data -} - -func (b *BenchmarksAAResponse) GetMeta() BenchmarksAAMeta { - if b == nil { - return BenchmarksAAMeta{} - } - return b.Meta -} diff --git a/models/components/benchmarksdaitem.go b/models/components/benchmarksdaitem.go deleted file mode 100644 index fea8647b..00000000 --- a/models/components/benchmarksdaitem.go +++ /dev/null @@ -1,131 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -// TournamentStats - Placement distribution from tournament matches. -type TournamentStats struct { - FirstPlace *int64 `json:"first_place"` - FourthPlace *int64 `json:"fourth_place"` - SecondPlace *int64 `json:"second_place"` - ThirdPlace *int64 `json:"third_place"` - Total *int64 `json:"total"` -} - -func (t *TournamentStats) GetFirstPlace() *int64 { - if t == nil { - return nil - } - return t.FirstPlace -} - -func (t *TournamentStats) GetFourthPlace() *int64 { - if t == nil { - return nil - } - return t.FourthPlace -} - -func (t *TournamentStats) GetSecondPlace() *int64 { - if t == nil { - return nil - } - return t.SecondPlace -} - -func (t *TournamentStats) GetThirdPlace() *int64 { - if t == nil { - return nil - } - return t.ThirdPlace -} - -func (t *TournamentStats) GetTotal() *int64 { - if t == nil { - return nil - } - return t.Total -} - -type BenchmarksDAItem struct { - // Arena this ranking belongs to. - Arena string `json:"arena"` - // Average generation time in milliseconds. - AvgGenerationTimeMs *float64 `json:"avg_generation_time_ms"` - // Category within the arena. - Category string `json:"category"` - // Human-readable model name from Design Arena. - DisplayName string `json:"display_name"` - // ELO rating from head-to-head arena battles. - Elo float64 `json:"elo"` - // Stable OpenRouter model identifier when the model is on OpenRouter; otherwise the upstream Design Arena model id. Use pricing != null to detect OpenRouter-mapped models. - ModelPermaslug string `json:"model_permaslug"` - // OpenRouter pricing per token for this model. Null if pricing is unavailable. - Pricing *BenchmarkPricing `json:"pricing"` - // Placement distribution from tournament matches. - TournamentStats TournamentStats `json:"tournament_stats"` - // Win rate as a percentage (0–100). - WinRate float64 `json:"win_rate"` -} - -func (b *BenchmarksDAItem) GetArena() string { - if b == nil { - return "" - } - return b.Arena -} - -func (b *BenchmarksDAItem) GetAvgGenerationTimeMs() *float64 { - if b == nil { - return nil - } - return b.AvgGenerationTimeMs -} - -func (b *BenchmarksDAItem) GetCategory() string { - if b == nil { - return "" - } - return b.Category -} - -func (b *BenchmarksDAItem) GetDisplayName() string { - if b == nil { - return "" - } - return b.DisplayName -} - -func (b *BenchmarksDAItem) GetElo() float64 { - if b == nil { - return 0.0 - } - return b.Elo -} - -func (b *BenchmarksDAItem) GetModelPermaslug() string { - if b == nil { - return "" - } - return b.ModelPermaslug -} - -func (b *BenchmarksDAItem) GetPricing() *BenchmarkPricing { - if b == nil { - return nil - } - return b.Pricing -} - -func (b *BenchmarksDAItem) GetTournamentStats() TournamentStats { - if b == nil { - return TournamentStats{} - } - return b.TournamentStats -} - -func (b *BenchmarksDAItem) GetWinRate() float64 { - if b == nil { - return 0.0 - } - return b.WinRate -} diff --git a/models/components/benchmarksdameta.go b/models/components/benchmarksdameta.go deleted file mode 100644 index f0e46228..00000000 --- a/models/components/benchmarksdameta.go +++ /dev/null @@ -1,186 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -import ( - "encoding/json" - "fmt" -) - -// EloBounds - ELO range across all returned models for normalization. -type EloBounds struct { - // Maximum ELO in the result set. - Max float64 `json:"max"` - // Minimum ELO in the result set. - Min float64 `json:"min"` -} - -func (e *EloBounds) GetMax() float64 { - if e == nil { - return 0.0 - } - return e.Max -} - -func (e *EloBounds) GetMin() float64 { - if e == nil { - return 0.0 - } - return e.Min -} - -// BenchmarksDAMetaSource - Data source identifier. -type BenchmarksDAMetaSource string - -const ( - BenchmarksDAMetaSourceDesignArena BenchmarksDAMetaSource = "design-arena" -) - -func (e BenchmarksDAMetaSource) ToPointer() *BenchmarksDAMetaSource { - return &e -} -func (e *BenchmarksDAMetaSource) UnmarshalJSON(data []byte) error { - var v string - if err := json.Unmarshal(data, &v); err != nil { - return err - } - switch v { - case "design-arena": - *e = BenchmarksDAMetaSource(v) - return nil - default: - return fmt.Errorf("invalid value for BenchmarksDAMetaSource: %v", v) - } -} - -// BenchmarksDAMetaSourceURL - URL of the upstream data source. -type BenchmarksDAMetaSourceURL string - -const ( - BenchmarksDAMetaSourceURLHTTPSWwwDesignarenaAi BenchmarksDAMetaSourceURL = "https://www.designarena.ai" -) - -func (e BenchmarksDAMetaSourceURL) ToPointer() *BenchmarksDAMetaSourceURL { - return &e -} -func (e *BenchmarksDAMetaSourceURL) UnmarshalJSON(data []byte) error { - var v string - if err := json.Unmarshal(data, &v); err != nil { - return err - } - switch v { - case "https://www.designarena.ai": - *e = BenchmarksDAMetaSourceURL(v) - return nil - default: - return fmt.Errorf("invalid value for BenchmarksDAMetaSourceURL: %v", v) - } -} - -// BenchmarksDAMetaVersion - Dataset version. -type BenchmarksDAMetaVersion string - -const ( - BenchmarksDAMetaVersionV1 BenchmarksDAMetaVersion = "v1" -) - -func (e BenchmarksDAMetaVersion) ToPointer() *BenchmarksDAMetaVersion { - return &e -} -func (e *BenchmarksDAMetaVersion) UnmarshalJSON(data []byte) error { - var v string - if err := json.Unmarshal(data, &v); err != nil { - return err - } - switch v { - case "v1": - *e = BenchmarksDAMetaVersion(v) - return nil - default: - return fmt.Errorf("invalid value for BenchmarksDAMetaVersion: %v", v) - } -} - -type BenchmarksDAMeta struct { - // The arena filter applied. - Arena string `json:"arena"` - // ISO-8601 timestamp of when this data was generated. - AsOf string `json:"as_of"` - // The category filter applied, or null if showing all. - Category *string `json:"category"` - // Required attribution when republishing this data. - Citation string `json:"citation"` - // ELO range across all returned models for normalization. - EloBounds EloBounds `json:"elo_bounds"` - // Number of unique models in the response. - ModelCount int64 `json:"model_count"` - // Data source identifier. - Source BenchmarksDAMetaSource `json:"source"` - // URL of the upstream data source. - SourceURL BenchmarksDAMetaSourceURL `json:"source_url"` - // Dataset version. - Version BenchmarksDAMetaVersion `json:"version"` -} - -func (b *BenchmarksDAMeta) GetArena() string { - if b == nil { - return "" - } - return b.Arena -} - -func (b *BenchmarksDAMeta) GetAsOf() string { - if b == nil { - return "" - } - return b.AsOf -} - -func (b *BenchmarksDAMeta) GetCategory() *string { - if b == nil { - return nil - } - return b.Category -} - -func (b *BenchmarksDAMeta) GetCitation() string { - if b == nil { - return "" - } - return b.Citation -} - -func (b *BenchmarksDAMeta) GetEloBounds() EloBounds { - if b == nil { - return EloBounds{} - } - return b.EloBounds -} - -func (b *BenchmarksDAMeta) GetModelCount() int64 { - if b == nil { - return 0 - } - return b.ModelCount -} - -func (b *BenchmarksDAMeta) GetSource() BenchmarksDAMetaSource { - if b == nil { - return BenchmarksDAMetaSource("") - } - return b.Source -} - -func (b *BenchmarksDAMeta) GetSourceURL() BenchmarksDAMetaSourceURL { - if b == nil { - return BenchmarksDAMetaSourceURL("") - } - return b.SourceURL -} - -func (b *BenchmarksDAMeta) GetVersion() BenchmarksDAMetaVersion { - if b == nil { - return BenchmarksDAMetaVersion("") - } - return b.Version -} diff --git a/models/components/benchmarksdaresponse.go b/models/components/benchmarksdaresponse.go deleted file mode 100644 index 253dfea7..00000000 --- a/models/components/benchmarksdaresponse.go +++ /dev/null @@ -1,22 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -type BenchmarksDAResponse struct { - Data []BenchmarksDAItem `json:"data"` - Meta BenchmarksDAMeta `json:"meta"` -} - -func (b *BenchmarksDAResponse) GetData() []BenchmarksDAItem { - if b == nil { - return []BenchmarksDAItem{} - } - return b.Data -} - -func (b *BenchmarksDAResponse) GetMeta() BenchmarksDAMeta { - if b == nil { - return BenchmarksDAMeta{} - } - return b.Meta -} diff --git a/models/components/booleancapability.go b/models/components/booleancapability.go new file mode 100644 index 00000000..f250679c --- /dev/null +++ b/models/components/booleancapability.go @@ -0,0 +1,55 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +import ( + "encoding/json" + "fmt" + "github.com/OpenRouterTeam/go-sdk/internal/utils" +) + +type BooleanCapabilityType string + +const ( + BooleanCapabilityTypeBoolean BooleanCapabilityType = "boolean" +) + +func (e BooleanCapabilityType) ToPointer() *BooleanCapabilityType { + return &e +} +func (e *BooleanCapabilityType) UnmarshalJSON(data []byte) error { + var v string + if err := json.Unmarshal(data, &v); err != nil { + return err + } + switch v { + case "boolean": + *e = BooleanCapabilityType(v) + return nil + default: + return fmt.Errorf("invalid value for BooleanCapabilityType: %v", v) + } +} + +// BooleanCapability - A supported-or-not flag. Present means the parameter is accepted. +type BooleanCapability struct { + Type BooleanCapabilityType `json:"type"` +} + +func (b BooleanCapability) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(b, "", false) +} + +func (b *BooleanCapability) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &b, "", false, nil); err != nil { + return err + } + return nil +} + +func (b *BooleanCapability) GetType() BooleanCapabilityType { + if b == nil { + return BooleanCapabilityType("") + } + return b.Type +} diff --git a/models/components/byokproviderslug.go b/models/components/byokproviderslug.go index 189516f7..0df4797a 100644 --- a/models/components/byokproviderslug.go +++ b/models/components/byokproviderslug.go @@ -81,6 +81,7 @@ const ( BYOKProviderSlugStepfun BYOKProviderSlug = "stepfun" BYOKProviderSlugStreamlake BYOKProviderSlug = "streamlake" BYOKProviderSlugSwitchpoint BYOKProviderSlug = "switchpoint" + BYOKProviderSlugTenstorrent BYOKProviderSlug = "tenstorrent" BYOKProviderSlugTogether BYOKProviderSlug = "together" BYOKProviderSlugUpstage BYOKProviderSlug = "upstage" BYOKProviderSlugVenice BYOKProviderSlug = "venice" @@ -99,7 +100,7 @@ func (e BYOKProviderSlug) ToPointer() *BYOKProviderSlug { func (e *BYOKProviderSlug) IsExact() bool { if e != nil { switch *e { - case "ai21", "aion-labs", "akashml", "alibaba", "amazon-bedrock", "amazon-nova", "ambient", "anthropic", "arcee-ai", "atlas-cloud", "avian", "azure", "baidu", "baseten", "black-forest-labs", "byteplus", "cerebras", "chutes", "cirrascale", "clarifai", "cloudflare", "cohere", "crusoe", "darkbloom", "decart", "deepinfra", "deepseek", "dekallm", "digitalocean", "featherless", "fireworks", "friendli", "gmicloud", "google-ai-studio", "google-vertex", "groq", "inception", "inceptron", "inference-net", "infermatic", "inflection", "io-net", "ionstream", "liquid", "mancer", "mara", "minimax", "mistral", "modelrun", "modular", "moonshotai", "morph", "ncompass", "nebius", "nex-agi", "nextbit", "novita", "nvidia", "open-inference", "openai", "parasail", "perceptron", "perplexity", "phala", "poolside", "recraft", "reka", "relace", "sambanova", "seed", "siliconflow", "sourceful", "stepfun", "streamlake", "switchpoint", "together", "upstage", "venice", "wafer", "wandb", "xai", "xiaomi", "z-ai": + case "ai21", "aion-labs", "akashml", "alibaba", "amazon-bedrock", "amazon-nova", "ambient", "anthropic", "arcee-ai", "atlas-cloud", "avian", "azure", "baidu", "baseten", "black-forest-labs", "byteplus", "cerebras", "chutes", "cirrascale", "clarifai", "cloudflare", "cohere", "crusoe", "darkbloom", "decart", "deepinfra", "deepseek", "dekallm", "digitalocean", "featherless", "fireworks", "friendli", "gmicloud", "google-ai-studio", "google-vertex", "groq", "inception", "inceptron", "inference-net", "infermatic", "inflection", "io-net", "ionstream", "liquid", "mancer", "mara", "minimax", "mistral", "modelrun", "modular", "moonshotai", "morph", "ncompass", "nebius", "nex-agi", "nextbit", "novita", "nvidia", "open-inference", "openai", "parasail", "perceptron", "perplexity", "phala", "poolside", "recraft", "reka", "relace", "sambanova", "seed", "siliconflow", "sourceful", "stepfun", "streamlake", "switchpoint", "tenstorrent", "together", "upstage", "venice", "wafer", "wandb", "xai", "xiaomi", "z-ai": return true } } diff --git a/models/components/capabilitydescriptor.go b/models/components/capabilitydescriptor.go new file mode 100644 index 00000000..f144c538 --- /dev/null +++ b/models/components/capabilitydescriptor.go @@ -0,0 +1,153 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +import ( + "encoding/json" + "errors" + "fmt" + "github.com/OpenRouterTeam/go-sdk/internal/utils" +) + +type CapabilityDescriptorType string + +const ( + CapabilityDescriptorTypeEnum CapabilityDescriptorType = "enum" + CapabilityDescriptorTypeRange CapabilityDescriptorType = "range" + CapabilityDescriptorTypeBoolean CapabilityDescriptorType = "boolean" + CapabilityDescriptorTypeUnknown CapabilityDescriptorType = "UNKNOWN" +) + +// CapabilityDescriptor - A typed descriptor for one supported request parameter. +type CapabilityDescriptor struct { + EnumCapability *EnumCapability `queryParam:"inline" union:"member"` + RangeCapability *RangeCapability `queryParam:"inline" union:"member"` + BooleanCapability *BooleanCapability `queryParam:"inline" union:"member"` + UnknownRaw json.RawMessage `json:"-" union:"unknown"` + + Type CapabilityDescriptorType +} + +func CreateCapabilityDescriptorEnum(enum EnumCapability) CapabilityDescriptor { + typ := CapabilityDescriptorTypeEnum + + typStr := EnumCapabilityType(typ) + enum.Type = typStr + + return CapabilityDescriptor{ + EnumCapability: &enum, + Type: typ, + } +} + +func CreateCapabilityDescriptorRange(rangeT RangeCapability) CapabilityDescriptor { + typ := CapabilityDescriptorTypeRange + + typStr := RangeCapabilityType(typ) + rangeT.Type = typStr + + return CapabilityDescriptor{ + RangeCapability: &rangeT, + Type: typ, + } +} + +func CreateCapabilityDescriptorBoolean(boolean BooleanCapability) CapabilityDescriptor { + typ := CapabilityDescriptorTypeBoolean + + typStr := BooleanCapabilityType(typ) + boolean.Type = typStr + + return CapabilityDescriptor{ + BooleanCapability: &boolean, + Type: typ, + } +} + +func CreateCapabilityDescriptorUnknown(raw json.RawMessage) CapabilityDescriptor { + return CapabilityDescriptor{ + UnknownRaw: raw, + Type: CapabilityDescriptorTypeUnknown, + } +} + +func (u CapabilityDescriptor) GetUnknownRaw() json.RawMessage { + return u.UnknownRaw +} + +func (u CapabilityDescriptor) IsUnknown() bool { + return u.Type == CapabilityDescriptorTypeUnknown +} + +func (u *CapabilityDescriptor) UnmarshalJSON(data []byte) error { + + type discriminator struct { + Type string `json:"type"` + } + + dis := new(discriminator) + if err := json.Unmarshal(data, &dis); err != nil { + u.UnknownRaw = json.RawMessage(data) + u.Type = CapabilityDescriptorTypeUnknown + return nil + } + if dis == nil { + u.UnknownRaw = json.RawMessage(data) + u.Type = CapabilityDescriptorTypeUnknown + return nil + } + + switch dis.Type { + case "enum": + enumCapability := new(EnumCapability) + if err := utils.UnmarshalJSON(data, &enumCapability, "", true, nil); err != nil { + return fmt.Errorf("could not unmarshal `%s` into expected (Type == enum) type EnumCapability within CapabilityDescriptor: %w", string(data), err) + } + + u.EnumCapability = enumCapability + u.Type = CapabilityDescriptorTypeEnum + return nil + case "range": + rangeCapability := new(RangeCapability) + if err := utils.UnmarshalJSON(data, &rangeCapability, "", true, nil); err != nil { + return fmt.Errorf("could not unmarshal `%s` into expected (Type == range) type RangeCapability within CapabilityDescriptor: %w", string(data), err) + } + + u.RangeCapability = rangeCapability + u.Type = CapabilityDescriptorTypeRange + return nil + case "boolean": + booleanCapability := new(BooleanCapability) + if err := utils.UnmarshalJSON(data, &booleanCapability, "", true, nil); err != nil { + return fmt.Errorf("could not unmarshal `%s` into expected (Type == boolean) type BooleanCapability within CapabilityDescriptor: %w", string(data), err) + } + + u.BooleanCapability = booleanCapability + u.Type = CapabilityDescriptorTypeBoolean + return nil + default: + u.UnknownRaw = json.RawMessage(data) + u.Type = CapabilityDescriptorTypeUnknown + return nil + } + +} + +func (u CapabilityDescriptor) MarshalJSON() ([]byte, error) { + if u.EnumCapability != nil { + return utils.MarshalJSON(u.EnumCapability, "", true) + } + + if u.RangeCapability != nil { + return utils.MarshalJSON(u.RangeCapability, "", true) + } + + if u.BooleanCapability != nil { + return utils.MarshalJSON(u.BooleanCapability, "", true) + } + + if u.UnknownRaw != nil { + return json.RawMessage(u.UnknownRaw), nil + } + return nil, errors.New("could not marshal union type CapabilityDescriptor: all fields are null") +} diff --git a/models/components/chatrequest.go b/models/components/chatrequest.go index 59fc6d48..a161bfb0 100644 --- a/models/components/chatrequest.go +++ b/models/components/chatrequest.go @@ -311,6 +311,7 @@ func (u ChatRequestPlugin) MarshalJSON() ([]byte, error) { type ChatRequestEffort string const ( + ChatRequestEffortMax ChatRequestEffort = "max" ChatRequestEffortXhigh ChatRequestEffort = "xhigh" ChatRequestEffortHigh ChatRequestEffort = "high" ChatRequestEffortMedium ChatRequestEffort = "medium" @@ -327,7 +328,7 @@ func (e ChatRequestEffort) ToPointer() *ChatRequestEffort { func (e *ChatRequestEffort) IsExact() bool { if e != nil { switch *e { - case "xhigh", "high", "medium", "low", "minimal", "none": + case "max", "xhigh", "high", "medium", "low", "minimal", "none": return true } } @@ -359,6 +360,7 @@ func (c *ChatRequestReasoning) GetSummary() optionalnullable.OptionalNullable[Ch type ChatRequestReasoningEffort string const ( + ChatRequestReasoningEffortMax ChatRequestReasoningEffort = "max" ChatRequestReasoningEffortXhigh ChatRequestReasoningEffort = "xhigh" ChatRequestReasoningEffortHigh ChatRequestReasoningEffort = "high" ChatRequestReasoningEffortMedium ChatRequestReasoningEffort = "medium" @@ -375,7 +377,7 @@ func (e ChatRequestReasoningEffort) ToPointer() *ChatRequestReasoningEffort { func (e *ChatRequestReasoningEffort) IsExact() bool { if e != nil { switch *e { - case "xhigh", "high", "medium", "low", "minimal", "none": + case "max", "xhigh", "high", "medium", "low", "minimal", "none": return true } } diff --git a/models/components/chatstreamchunk.go b/models/components/chatstreamchunk.go index f371c556..2c4cc459 100644 --- a/models/components/chatstreamchunk.go +++ b/models/components/chatstreamchunk.go @@ -9,26 +9,68 @@ import ( "github.com/OpenRouterTeam/go-sdk/optionalnullable" ) -// Error information -type Error struct { +// ChatStreamChunkMetadata - Structured error metadata +type ChatStreamChunkMetadata struct { + // Canonical OpenRouter error type, stable across all API formats + ErrorType APIErrorType `json:"error_type"` + // Upstream provider-specific error code, when available + ProviderCode *string `json:"provider_code,omitzero"` +} + +func (c *ChatStreamChunkMetadata) GetErrorType() APIErrorType { + if c == nil { + return APIErrorType("") + } + return c.ErrorType +} + +func (c *ChatStreamChunkMetadata) GetProviderCode() *string { + if c == nil { + return nil + } + return c.ProviderCode +} + +// ChatStreamChunkError - Error information +type ChatStreamChunkError struct { // Error code Code int `json:"code"` // Error message Message string `json:"message"` + // Structured error metadata + Metadata *ChatStreamChunkMetadata `json:"metadata,omitzero"` +} + +func (c ChatStreamChunkError) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(c, "", false) } -func (e *Error) GetCode() int { - if e == nil { +func (c *ChatStreamChunkError) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &c, "", false, nil); err != nil { + return err + } + return nil +} + +func (c *ChatStreamChunkError) GetCode() int { + if c == nil { return 0 } - return e.Code + return c.Code } -func (e *Error) GetMessage() string { - if e == nil { +func (c *ChatStreamChunkError) GetMessage() string { + if c == nil { return "" } - return e.Message + return c.Message +} + +func (c *ChatStreamChunkError) GetMetadata() *ChatStreamChunkMetadata { + if c == nil { + return nil + } + return c.Metadata } type ChatStreamChunkObject string @@ -61,7 +103,7 @@ type ChatStreamChunk struct { // Unix timestamp of creation Created int64 `json:"created"` // Error information - Error *Error `json:"error,omitzero"` + Error *ChatStreamChunkError `json:"error,omitzero"` // Unique chunk identifier ID string `json:"id"` // Model used for completion @@ -101,7 +143,7 @@ func (c *ChatStreamChunk) GetCreated() int64 { return c.Created } -func (c *ChatStreamChunk) GetError() *Error { +func (c *ChatStreamChunk) GetError() *ChatStreamChunkError { if c == nil { return nil } diff --git a/models/components/chatusage.go b/models/components/chatusage.go index 9bde0130..aa4c2801 100644 --- a/models/components/chatusage.go +++ b/models/components/chatusage.go @@ -7,8 +7,8 @@ import ( "github.com/OpenRouterTeam/go-sdk/optionalnullable" ) -// CompletionTokensDetails - Detailed completion token usage -type CompletionTokensDetails struct { +// ChatUsageCompletionTokensDetails - Detailed completion token usage +type ChatUsageCompletionTokensDetails struct { // Accepted prediction tokens AcceptedPredictionTokens optionalnullable.OptionalNullable[int64] `json:"accepted_prediction_tokens,omitzero"` // Tokens used for audio output @@ -19,36 +19,36 @@ type CompletionTokensDetails struct { RejectedPredictionTokens optionalnullable.OptionalNullable[int64] `json:"rejected_prediction_tokens,omitzero"` } -func (c *CompletionTokensDetails) GetAcceptedPredictionTokens() optionalnullable.OptionalNullable[int64] { +func (c *ChatUsageCompletionTokensDetails) GetAcceptedPredictionTokens() optionalnullable.OptionalNullable[int64] { if c == nil { return nil } return c.AcceptedPredictionTokens } -func (c *CompletionTokensDetails) GetAudioTokens() optionalnullable.OptionalNullable[int64] { +func (c *ChatUsageCompletionTokensDetails) GetAudioTokens() optionalnullable.OptionalNullable[int64] { if c == nil { return nil } return c.AudioTokens } -func (c *CompletionTokensDetails) GetReasoningTokens() optionalnullable.OptionalNullable[int64] { +func (c *ChatUsageCompletionTokensDetails) GetReasoningTokens() optionalnullable.OptionalNullable[int64] { if c == nil { return nil } return c.ReasoningTokens } -func (c *CompletionTokensDetails) GetRejectedPredictionTokens() optionalnullable.OptionalNullable[int64] { +func (c *ChatUsageCompletionTokensDetails) GetRejectedPredictionTokens() optionalnullable.OptionalNullable[int64] { if c == nil { return nil } return c.RejectedPredictionTokens } -// PromptTokensDetails - Detailed prompt token usage -type PromptTokensDetails struct { +// ChatUsagePromptTokensDetails - Detailed prompt token usage +type ChatUsagePromptTokensDetails struct { // Audio input tokens AudioTokens *int64 `json:"audio_tokens,omitzero"` // Tokens written to cache. Only returned for models with explicit caching and cache write pricing. @@ -59,32 +59,63 @@ type PromptTokensDetails struct { VideoTokens *int64 `json:"video_tokens,omitzero"` } -func (p *PromptTokensDetails) GetAudioTokens() *int64 { - if p == nil { +func (c *ChatUsagePromptTokensDetails) GetAudioTokens() *int64 { + if c == nil { + return nil + } + return c.AudioTokens +} + +func (c *ChatUsagePromptTokensDetails) GetCacheWriteTokens() *int64 { + if c == nil { + return nil + } + return c.CacheWriteTokens +} + +func (c *ChatUsagePromptTokensDetails) GetCachedTokens() *int64 { + if c == nil { return nil } - return p.AudioTokens + return c.CachedTokens } -func (p *PromptTokensDetails) GetCacheWriteTokens() *int64 { - if p == nil { +func (c *ChatUsagePromptTokensDetails) GetVideoTokens() *int64 { + if c == nil { + return nil + } + return c.VideoTokens +} + +// ServerToolUseDetails - Usage for server-side tool execution (e.g., web search) +type ServerToolUseDetails struct { + // Number of OpenRouter server tool calls that executed and produced a result + ToolCallsExecuted optionalnullable.OptionalNullable[int64] `json:"tool_calls_executed,omitzero"` + // Total number of OpenRouter server-orchestrated tool calls the model requested, across all tool types. Provider-native tools (e.g. native web search) are not counted here. + ToolCallsRequested optionalnullable.OptionalNullable[int64] `json:"tool_calls_requested,omitzero"` + // Number of web searches performed by server-side tools. For server-orchestrated tool calls a web search is also counted in tool_calls_requested; provider-native web search may report web_search_requests only. Do not sum the two. + WebSearchRequests optionalnullable.OptionalNullable[int64] `json:"web_search_requests,omitzero"` +} + +func (s *ServerToolUseDetails) GetToolCallsExecuted() optionalnullable.OptionalNullable[int64] { + if s == nil { return nil } - return p.CacheWriteTokens + return s.ToolCallsExecuted } -func (p *PromptTokensDetails) GetCachedTokens() *int64 { - if p == nil { +func (s *ServerToolUseDetails) GetToolCallsRequested() optionalnullable.OptionalNullable[int64] { + if s == nil { return nil } - return p.CachedTokens + return s.ToolCallsRequested } -func (p *PromptTokensDetails) GetVideoTokens() *int64 { - if p == nil { +func (s *ServerToolUseDetails) GetWebSearchRequests() optionalnullable.OptionalNullable[int64] { + if s == nil { return nil } - return p.VideoTokens + return s.WebSearchRequests } // ChatUsage - Token usage statistics @@ -92,7 +123,7 @@ type ChatUsage struct { // Number of tokens in the completion CompletionTokens int64 `json:"completion_tokens"` // Detailed completion token usage - CompletionTokensDetails optionalnullable.OptionalNullable[CompletionTokensDetails] `json:"completion_tokens_details,omitzero"` + CompletionTokensDetails optionalnullable.OptionalNullable[ChatUsageCompletionTokensDetails] `json:"completion_tokens_details,omitzero"` // Cost of the completion Cost optionalnullable.OptionalNullable[float64] `json:"cost,omitzero"` // Breakdown of upstream inference costs @@ -102,7 +133,9 @@ type ChatUsage struct { // Number of tokens in the prompt PromptTokens int64 `json:"prompt_tokens"` // Detailed prompt token usage - PromptTokensDetails optionalnullable.OptionalNullable[PromptTokensDetails] `json:"prompt_tokens_details,omitzero"` + PromptTokensDetails optionalnullable.OptionalNullable[ChatUsagePromptTokensDetails] `json:"prompt_tokens_details,omitzero"` + // Usage for server-side tool execution (e.g., web search) + ServerToolUseDetails optionalnullable.OptionalNullable[ServerToolUseDetails] `json:"server_tool_use_details,omitzero"` // Total number of tokens TotalTokens int64 `json:"total_tokens"` } @@ -125,7 +158,7 @@ func (c *ChatUsage) GetCompletionTokens() int64 { return c.CompletionTokens } -func (c *ChatUsage) GetCompletionTokensDetails() optionalnullable.OptionalNullable[CompletionTokensDetails] { +func (c *ChatUsage) GetCompletionTokensDetails() optionalnullable.OptionalNullable[ChatUsageCompletionTokensDetails] { if c == nil { return nil } @@ -160,13 +193,20 @@ func (c *ChatUsage) GetPromptTokens() int64 { return c.PromptTokens } -func (c *ChatUsage) GetPromptTokensDetails() optionalnullable.OptionalNullable[PromptTokensDetails] { +func (c *ChatUsage) GetPromptTokensDetails() optionalnullable.OptionalNullable[ChatUsagePromptTokensDetails] { if c == nil { return nil } return c.PromptTokensDetails } +func (c *ChatUsage) GetServerToolUseDetails() optionalnullable.OptionalNullable[ServerToolUseDetails] { + if c == nil { + return nil + } + return c.ServerToolUseDetails +} + func (c *ChatUsage) GetTotalTokens() int64 { if c == nil { return 0 diff --git a/models/components/chatwebsearchshorthand.go b/models/components/chatwebsearchshorthand.go index b3ccbe56..1da7102d 100644 --- a/models/components/chatwebsearchshorthand.go +++ b/models/components/chatwebsearchshorthand.go @@ -40,7 +40,7 @@ type ChatWebSearchShorthand struct { ExcludedDomains []string `json:"excluded_domains,omitzero"` // Exact maximum number of characters of content per search result. Applies to the Exa, Parallel, and Perplexity engines; ignored with native provider search and Firecrawl. For Exa, caps highlight content per result. For Parallel, caps excerpt content per result (default 1,500 when omitted). For Perplexity, maps to the native `max_tokens_per_page` parameter (converted from characters to tokens) and trims the response to the exact character cap. When both `max_characters` and `search_context_size` are set, `max_characters` takes precedence. When omitted, falls back to `search_context_size` mapping (Exa) or engine defaults (Parallel, Perplexity). MaxCharacters *int64 `json:"max_characters,omitzero"` - // Maximum number of search results to return per search call. Defaults to 5. Applies to Exa, Firecrawl, Parallel, and Perplexity engines; ignored with native provider search. + // Maximum number of search results to return per search call. Defaults to 5. Applies to Exa, Firecrawl, Parallel, and Perplexity engines; ignored with native provider search. Perplexity supports a maximum of 20; values above 20 are clamped. MaxResults *int64 `json:"max_results,omitzero"` // Maximum total number of search results across all search calls in a single request. Once this limit is reached, the tool will stop returning new results. Useful for controlling cost and context size in agentic loops. Defaults to 50 when not specified. MaxTotalResults *int64 `json:"max_total_results,omitzero"` diff --git a/models/components/costdetails.go b/models/components/costdetails.go index 67bc4ecb..064351f7 100644 --- a/models/components/costdetails.go +++ b/models/components/costdetails.go @@ -3,6 +3,7 @@ package components import ( + "github.com/OpenRouterTeam/go-sdk/internal/utils" "github.com/OpenRouterTeam/go-sdk/optionalnullable" ) @@ -13,6 +14,17 @@ type CostDetails struct { UpstreamInferencePromptCost float64 `json:"upstream_inference_prompt_cost"` } +func (c CostDetails) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(c, "", false) +} + +func (c *CostDetails) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &c, "", false, nil); err != nil { + return err + } + return nil +} + func (c *CostDetails) GetUpstreamInferenceCompletionsCost() float64 { if c == nil { return 0.0 diff --git a/models/components/debugevent.go b/models/components/debugevent.go new file mode 100644 index 00000000..7a06ffb9 --- /dev/null +++ b/models/components/debugevent.go @@ -0,0 +1,163 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +import ( + "encoding/json" + "fmt" + "github.com/OpenRouterTeam/go-sdk/internal/utils" +) + +type Event string + +const ( + EventAdapterRequest Event = "adapter_request" + EventUpstreamHeadersReceived Event = "upstream_headers_received" + EventFirstTokenReceived Event = "first_token_received" + EventUpstreamBodyEnded Event = "upstream_body_ended" +) + +func (e Event) ToPointer() *Event { + return &e +} + +// IsExact returns true if the value matches a known enum value, false otherwise. +func (e *Event) IsExact() bool { + if e != nil { + switch *e { + case "adapter_request", "upstream_headers_received", "first_token_received", "upstream_body_ended": + return true + } + } + return false +} + +type Timings struct { + EpochMs int64 `json:"epoch_ms"` + Event Event `json:"event"` + StartMs int64 `json:"start_ms"` +} + +func (t Timings) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(t, "", false) +} + +func (t *Timings) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &t, "", false, nil); err != nil { + return err + } + return nil +} + +func (t *Timings) GetEpochMs() int64 { + if t == nil { + return 0 + } + return t.EpochMs +} + +func (t *Timings) GetEvent() Event { + if t == nil { + return Event("") + } + return t.Event +} + +func (t *Timings) GetStartMs() int64 { + if t == nil { + return 0 + } + return t.StartMs +} + +type Debug struct { + EchoUpstreamBody map[string]any `json:"echo_upstream_body,omitzero"` + Timings *Timings `json:"timings,omitzero"` +} + +func (d Debug) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(d, "", false) +} + +func (d *Debug) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &d, "", false, nil); err != nil { + return err + } + return nil +} + +func (d *Debug) GetEchoUpstreamBody() map[string]any { + if d == nil { + return nil + } + return d.EchoUpstreamBody +} + +func (d *Debug) GetTimings() *Timings { + if d == nil { + return nil + } + return d.Timings +} + +type DebugEventType string + +const ( + DebugEventTypeResponseDebug DebugEventType = "response.debug" +) + +func (e DebugEventType) ToPointer() *DebugEventType { + return &e +} +func (e *DebugEventType) UnmarshalJSON(data []byte) error { + var v string + if err := json.Unmarshal(data, &v); err != nil { + return err + } + switch v { + case "response.debug": + *e = DebugEventType(v) + return nil + default: + return fmt.Errorf("invalid value for DebugEventType: %v", v) + } +} + +// DebugEvent - Debug event emitted when debug.echo_upstream_body is true. Contains the transformed upstream request body or timing milestones. +type DebugEvent struct { + Debug Debug `json:"debug"` + SequenceNumber int64 `json:"sequence_number"` + Type DebugEventType `json:"type"` +} + +func (d DebugEvent) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(d, "", false) +} + +func (d *DebugEvent) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &d, "", false, nil); err != nil { + return err + } + return nil +} + +func (d *DebugEvent) GetDebug() Debug { + if d == nil { + return Debug{} + } + return d.Debug +} + +func (d *DebugEvent) GetSequenceNumber() int64 { + if d == nil { + return 0 + } + return d.SequenceNumber +} + +func (d *DebugEvent) GetType() DebugEventType { + if d == nil { + return DebugEventType("") + } + return d.Type +} diff --git a/models/components/deleteworkspacebudgetresponse.go b/models/components/deleteworkspacebudgetresponse.go new file mode 100644 index 00000000..b523dd63 --- /dev/null +++ b/models/components/deleteworkspacebudgetresponse.go @@ -0,0 +1,28 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +import ( + "github.com/OpenRouterTeam/go-sdk/internal/utils" +) + +type DeleteWorkspaceBudgetResponse struct { + // Confirmation that the budget was deleted (or did not exist) + //lint:ignore U1000 accessed via reflection for JSON marshaling + deleted bool `const:"true" json:"deleted"` +} + +func (d DeleteWorkspaceBudgetResponse) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(d, "", false) +} + +func (d *DeleteWorkspaceBudgetResponse) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &d, "", false, nil); err != nil { + return err + } + return nil +} + +func (d *DeleteWorkspaceBudgetResponse) GetDeleted() bool { + return true +} diff --git a/models/components/enumcapability.go b/models/components/enumcapability.go new file mode 100644 index 00000000..73f9e617 --- /dev/null +++ b/models/components/enumcapability.go @@ -0,0 +1,63 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +import ( + "encoding/json" + "fmt" + "github.com/OpenRouterTeam/go-sdk/internal/utils" +) + +type EnumCapabilityType string + +const ( + EnumCapabilityTypeEnum EnumCapabilityType = "enum" +) + +func (e EnumCapabilityType) ToPointer() *EnumCapabilityType { + return &e +} +func (e *EnumCapabilityType) UnmarshalJSON(data []byte) error { + var v string + if err := json.Unmarshal(data, &v); err != nil { + return err + } + switch v { + case "enum": + *e = EnumCapabilityType(v) + return nil + default: + return fmt.Errorf("invalid value for EnumCapabilityType: %v", v) + } +} + +// EnumCapability - A parameter that accepts one of a discrete set of string values. +type EnumCapability struct { + Type EnumCapabilityType `json:"type"` + Values []string `json:"values"` +} + +func (e EnumCapability) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(e, "", false) +} + +func (e *EnumCapability) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &e, "", false, nil); err != nil { + return err + } + return nil +} + +func (e *EnumCapability) GetType() EnumCapabilityType { + if e == nil { + return EnumCapabilityType("") + } + return e.Type +} + +func (e *EnumCapability) GetValues() []string { + if e == nil { + return []string{} + } + return e.Values +} diff --git a/models/components/fusionplugin.go b/models/components/fusionplugin.go index 79d4b100..60c47fec 100644 --- a/models/components/fusionplugin.go +++ b/models/components/fusionplugin.go @@ -31,6 +31,29 @@ func (e *FusionPluginID) UnmarshalJSON(data []byte) error { } } +// PresetEnum - A curated OpenRouter fusion preset (slugs follow `-`, e.g. `general-high`). Expands server-side into the preset's analysis_models panel and judge model, so callers never name individual models. Explicitly provided `analysis_models` / `model` take precedence. +type PresetEnum string + +const ( + PresetEnumGeneralHigh PresetEnum = "general-high" + PresetEnumGeneralBudget PresetEnum = "general-budget" +) + +func (e PresetEnum) ToPointer() *PresetEnum { + return &e +} + +// IsExact returns true if the value matches a known enum value, false otherwise. +func (e *PresetEnum) IsExact() bool { + if e != nil { + switch *e { + case "general-high", "general-budget": + return true + } + } + return false +} + type FusionPluginTool struct { // Optional configuration forwarded as the tool's `parameters` object. Parameters map[string]any `json:"parameters,omitzero"` @@ -73,6 +96,8 @@ type FusionPlugin struct { MaxToolCalls *int64 `json:"max_tool_calls,omitzero"` // Slug of the model that performs both the judge step (with web_search + web_fetch) and the final synthesis. When omitted, defaults to the first model in the Quality preset. Model *string `json:"model,omitzero"` + // A curated OpenRouter fusion preset (slugs follow `-`, e.g. `general-high`). Expands server-side into the preset's analysis_models panel and judge model, so callers never name individual models. Explicitly provided `analysis_models` / `model` take precedence. + Preset *PresetEnum `json:"preset,omitzero"` // Server tools available to panelist and judge inner calls. Each entry uses the same `{ type, parameters? }` shorthand as the outer Chat Completions request. When omitted, defaults to `[{ type: "openrouter:web_search" }, { type: "openrouter:web_fetch" }]`. Pass an empty array to disable tools entirely (panelists answer from parametric knowledge only). Tools []FusionPluginTool `json:"tools,omitzero"` } @@ -123,6 +148,13 @@ func (f *FusionPlugin) GetModel() *string { return f.Model } +func (f *FusionPlugin) GetPreset() *PresetEnum { + if f == nil { + return nil + } + return f.Preset +} + func (f *FusionPlugin) GetTools() []FusionPluginTool { if f == nil { return nil diff --git a/models/components/fusionservertoolconfig.go b/models/components/fusionservertoolconfig.go index ad121f2f..33b21066 100644 --- a/models/components/fusionservertoolconfig.go +++ b/models/components/fusionservertoolconfig.go @@ -10,6 +10,7 @@ import ( type FusionServerToolConfigEffort string const ( + FusionServerToolConfigEffortMax FusionServerToolConfigEffort = "max" FusionServerToolConfigEffortXhigh FusionServerToolConfigEffort = "xhigh" FusionServerToolConfigEffortHigh FusionServerToolConfigEffort = "high" FusionServerToolConfigEffortMedium FusionServerToolConfigEffort = "medium" @@ -26,7 +27,7 @@ func (e FusionServerToolConfigEffort) ToPointer() *FusionServerToolConfigEffort func (e *FusionServerToolConfigEffort) IsExact() bool { if e != nil { switch *e { - case "xhigh", "high", "medium", "low", "minimal", "none": + case "max", "xhigh", "high", "medium", "low", "minimal", "none": return true } } @@ -102,6 +103,8 @@ func (f *FusionServerToolConfigTool) GetType() string { type FusionServerToolConfig struct { // Slugs of models to run in parallel as the analysis panel. Each model receives the user prompt with openrouter:web_search and openrouter:web_fetch enabled, then a judge model summarizes the collective output into structured analysis JSON. Capped at 8 models to bound cost amplification. Defaults to the Quality preset from /labs/fusion. AnalysisModels []string `json:"analysis_models,omitzero"` + // Enable automatic prompt caching. When set at the top level, the system automatically applies cache breakpoints to the last cacheable block in the request. Currently supported for Anthropic Claude models. + CacheControl *AnthropicCacheControlDirective `json:"cache_control,omitzero"` // Maximum number of output tokens (including reasoning tokens) each panelist and the judge model may produce per inner call. Controls the total output budget so reasoning-heavy models like GPT-5.5 do not exhaust their token allowance before producing visible text. When omitted, the provider's default applies. MaxCompletionTokens *int64 `json:"max_completion_tokens,omitzero"` // Maximum number of tool-calling steps each panelist (analysis model) and the judge model may take during their agentic web-research loop. Models with web_search/web_fetch enabled iterate until they produce a text response or hit this ceiling. Defaults to 8. Capped at 16. @@ -134,6 +137,13 @@ func (f *FusionServerToolConfig) GetAnalysisModels() []string { return f.AnalysisModels } +func (f *FusionServerToolConfig) GetCacheControl() *AnthropicCacheControlDirective { + if f == nil { + return nil + } + return f.CacheControl +} + func (f *FusionServerToolConfig) GetMaxCompletionTokens() *int64 { if f == nil { return nil diff --git a/models/components/imageendpoint.go b/models/components/imageendpoint.go new file mode 100644 index 00000000..9ab4c9e5 --- /dev/null +++ b/models/components/imageendpoint.go @@ -0,0 +1,69 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +// ImageEndpoint - An endpoint that serves a given image model. +type ImageEndpoint struct { + // Provider-specific options accepted under provider.options[provider_slug]. + AllowedPassthroughParameters []string `json:"allowed_passthrough_parameters"` + // Billable pricing lines for this endpoint. + Pricing []ImagePricingEntry `json:"pricing"` + // Provider display name + ProviderName string `json:"provider_name"` + // Provider slug + ProviderSlug string `json:"provider_slug"` + // Provider tag for request-side selection + ProviderTag *string `json:"provider_tag"` + SupportedParameters map[string]CapabilityDescriptor `json:"supported_parameters"` + // Whether this endpoint supports native SSE streaming (`stream: true` in the request). + SupportsStreaming bool `json:"supports_streaming"` +} + +func (i *ImageEndpoint) GetAllowedPassthroughParameters() []string { + if i == nil { + return []string{} + } + return i.AllowedPassthroughParameters +} + +func (i *ImageEndpoint) GetPricing() []ImagePricingEntry { + if i == nil { + return []ImagePricingEntry{} + } + return i.Pricing +} + +func (i *ImageEndpoint) GetProviderName() string { + if i == nil { + return "" + } + return i.ProviderName +} + +func (i *ImageEndpoint) GetProviderSlug() string { + if i == nil { + return "" + } + return i.ProviderSlug +} + +func (i *ImageEndpoint) GetProviderTag() *string { + if i == nil { + return nil + } + return i.ProviderTag +} + +func (i *ImageEndpoint) GetSupportedParameters() map[string]CapabilityDescriptor { + if i == nil { + return map[string]CapabilityDescriptor{} + } + return i.SupportedParameters +} + +func (i *ImageEndpoint) GetSupportsStreaming() bool { + if i == nil { + return false + } + return i.SupportsStreaming +} diff --git a/models/components/imagegencompletedevent.go b/models/components/imagegencompletedevent.go new file mode 100644 index 00000000..8c49e5d6 --- /dev/null +++ b/models/components/imagegencompletedevent.go @@ -0,0 +1,84 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +import ( + "encoding/json" + "fmt" + "github.com/OpenRouterTeam/go-sdk/internal/utils" +) + +// ImageGenCompletedEventType - The event type +type ImageGenCompletedEventType string + +const ( + ImageGenCompletedEventTypeImageGenerationCompleted ImageGenCompletedEventType = "image_generation.completed" +) + +func (e ImageGenCompletedEventType) ToPointer() *ImageGenCompletedEventType { + return &e +} +func (e *ImageGenCompletedEventType) UnmarshalJSON(data []byte) error { + var v string + if err := json.Unmarshal(data, &v); err != nil { + return err + } + switch v { + case "image_generation.completed": + *e = ImageGenCompletedEventType(v) + return nil + default: + return fmt.Errorf("invalid value for ImageGenCompletedEventType: %v", v) + } +} + +// ImageGenCompletedEvent - Emitted when generation completes and the final image is available +type ImageGenCompletedEvent struct { + // Base64-encoded final image data + B64JSON string `json:"b64_json"` + // Unix timestamp (seconds) when the image was generated + Created int64 `json:"created"` + // The event type + Type ImageGenCompletedEventType `json:"type"` + // Token and cost usage for the image generation request, when available + Usage *ImageGenerationUsage `json:"usage,omitzero"` +} + +func (i ImageGenCompletedEvent) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(i, "", false) +} + +func (i *ImageGenCompletedEvent) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &i, "", false, nil); err != nil { + return err + } + return nil +} + +func (i *ImageGenCompletedEvent) GetB64JSON() string { + if i == nil { + return "" + } + return i.B64JSON +} + +func (i *ImageGenCompletedEvent) GetCreated() int64 { + if i == nil { + return 0 + } + return i.Created +} + +func (i *ImageGenCompletedEvent) GetType() ImageGenCompletedEventType { + if i == nil { + return ImageGenCompletedEventType("") + } + return i.Type +} + +func (i *ImageGenCompletedEvent) GetUsage() *ImageGenerationUsage { + if i == nil { + return nil + } + return i.Usage +} diff --git a/models/components/imagegenerationrequest.go b/models/components/imagegenerationrequest.go new file mode 100644 index 00000000..f261b0d7 --- /dev/null +++ b/models/components/imagegenerationrequest.go @@ -0,0 +1,1255 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +import ( + "github.com/OpenRouterTeam/go-sdk/internal/utils" +) + +// ImageGenerationRequestAspectRatio - Normalized aspect ratio of the generated image. Providers clamp to their supported subset. +type ImageGenerationRequestAspectRatio string + +const ( + ImageGenerationRequestAspectRatioEleven ImageGenerationRequestAspectRatio = "1:1" + ImageGenerationRequestAspectRatioTwelve ImageGenerationRequestAspectRatio = "1:2" + ImageGenerationRequestAspectRatioFourteen ImageGenerationRequestAspectRatio = "1:4" + ImageGenerationRequestAspectRatioEighteen ImageGenerationRequestAspectRatio = "1:8" + ImageGenerationRequestAspectRatioTwentyOne ImageGenerationRequestAspectRatio = "2:1" + ImageGenerationRequestAspectRatioTwentyThree ImageGenerationRequestAspectRatio = "2:3" + ImageGenerationRequestAspectRatioThirtyTwo ImageGenerationRequestAspectRatio = "3:2" + ImageGenerationRequestAspectRatioThirtyFour ImageGenerationRequestAspectRatio = "3:4" + ImageGenerationRequestAspectRatioFortyOne ImageGenerationRequestAspectRatio = "4:1" + ImageGenerationRequestAspectRatioFortyThree ImageGenerationRequestAspectRatio = "4:3" + ImageGenerationRequestAspectRatioFortyFive ImageGenerationRequestAspectRatio = "4:5" + ImageGenerationRequestAspectRatioFiftyFour ImageGenerationRequestAspectRatio = "5:4" + ImageGenerationRequestAspectRatioEightyOne ImageGenerationRequestAspectRatio = "8:1" + ImageGenerationRequestAspectRatioNineHundredAndSixteen ImageGenerationRequestAspectRatio = "9:16" + ImageGenerationRequestAspectRatioOneHundredAndSixtyNine ImageGenerationRequestAspectRatio = "16:9" + ImageGenerationRequestAspectRatioNineHundredAndNineteenDot5 ImageGenerationRequestAspectRatio = "9:19.5" + ImageGenerationRequestAspectRatioNineteenDot59 ImageGenerationRequestAspectRatio = "19.5:9" + ImageGenerationRequestAspectRatioNineHundredAndTwenty ImageGenerationRequestAspectRatio = "9:20" + ImageGenerationRequestAspectRatioTwoHundredAndNine ImageGenerationRequestAspectRatio = "20:9" + ImageGenerationRequestAspectRatioNineHundredAndTwentyOne ImageGenerationRequestAspectRatio = "9:21" + ImageGenerationRequestAspectRatioTwoHundredAndNineteen ImageGenerationRequestAspectRatio = "21:9" + ImageGenerationRequestAspectRatioAuto ImageGenerationRequestAspectRatio = "auto" +) + +func (e ImageGenerationRequestAspectRatio) ToPointer() *ImageGenerationRequestAspectRatio { + return &e +} + +// IsExact returns true if the value matches a known enum value, false otherwise. +func (e *ImageGenerationRequestAspectRatio) IsExact() bool { + if e != nil { + switch *e { + case "1:1", "1:2", "1:4", "1:8", "2:1", "2:3", "3:2", "3:4", "4:1", "4:3", "4:5", "5:4", "8:1", "9:16", "16:9", "9:19.5", "19.5:9", "9:20", "20:9", "9:21", "21:9", "auto": + return true + } + } + return false +} + +// ImageGenerationRequestBackground - Background treatment. `transparent` requires an output_format that supports alpha (png or webp). +type ImageGenerationRequestBackground string + +const ( + ImageGenerationRequestBackgroundAuto ImageGenerationRequestBackground = "auto" + ImageGenerationRequestBackgroundTransparent ImageGenerationRequestBackground = "transparent" + ImageGenerationRequestBackgroundOpaque ImageGenerationRequestBackground = "opaque" +) + +func (e ImageGenerationRequestBackground) ToPointer() *ImageGenerationRequestBackground { + return &e +} + +// IsExact returns true if the value matches a known enum value, false otherwise. +func (e *ImageGenerationRequestBackground) IsExact() bool { + if e != nil { + switch *e { + case "auto", "transparent", "opaque": + return true + } + } + return false +} + +// ImageGenerationRequestOutputFormat - Encoding of the returned image bytes. +type ImageGenerationRequestOutputFormat string + +const ( + ImageGenerationRequestOutputFormatPng ImageGenerationRequestOutputFormat = "png" + ImageGenerationRequestOutputFormatJpeg ImageGenerationRequestOutputFormat = "jpeg" + ImageGenerationRequestOutputFormatWebp ImageGenerationRequestOutputFormat = "webp" +) + +func (e ImageGenerationRequestOutputFormat) ToPointer() *ImageGenerationRequestOutputFormat { + return &e +} + +// IsExact returns true if the value matches a known enum value, false otherwise. +func (e *ImageGenerationRequestOutputFormat) IsExact() bool { + if e != nil { + switch *e { + case "png", "jpeg", "webp": + return true + } + } + return false +} + +// ImageGenerationRequestOptions - Provider-specific options keyed by provider slug. Only options for the matched provider are forwarded; the rest are ignored. Unrecognized keys are silently dropped. +type ImageGenerationRequestOptions struct { + Oneai map[string]any `json:"01ai,omitzero"` + Ai21 map[string]any `json:"ai21,omitzero"` + AionLabs map[string]any `json:"aion-labs,omitzero"` + Akashml map[string]any `json:"akashml,omitzero"` + Alibaba map[string]any `json:"alibaba,omitzero"` + AmazonBedrock map[string]any `json:"amazon-bedrock,omitzero"` + AmazonNova map[string]any `json:"amazon-nova,omitzero"` + Ambient map[string]any `json:"ambient,omitzero"` + Anthropic map[string]any `json:"anthropic,omitzero"` + Anyscale map[string]any `json:"anyscale,omitzero"` + ArceeAi map[string]any `json:"arcee-ai,omitzero"` + AtlasCloud map[string]any `json:"atlas-cloud,omitzero"` + Atoma map[string]any `json:"atoma,omitzero"` + Avian map[string]any `json:"avian,omitzero"` + Azure map[string]any `json:"azure,omitzero"` + Baidu map[string]any `json:"baidu,omitzero"` + Baseten map[string]any `json:"baseten,omitzero"` + BlackForestLabs map[string]any `json:"black-forest-labs,omitzero"` + Byteplus map[string]any `json:"byteplus,omitzero"` + Centml map[string]any `json:"centml,omitzero"` + Cerebras map[string]any `json:"cerebras,omitzero"` + Chutes map[string]any `json:"chutes,omitzero"` + Cirrascale map[string]any `json:"cirrascale,omitzero"` + Clarifai map[string]any `json:"clarifai,omitzero"` + Cloudflare map[string]any `json:"cloudflare,omitzero"` + Cohere map[string]any `json:"cohere,omitzero"` + Crofai map[string]any `json:"crofai,omitzero"` + Crucible map[string]any `json:"crucible,omitzero"` + Crusoe map[string]any `json:"crusoe,omitzero"` + Darkbloom map[string]any `json:"darkbloom,omitzero"` + Decart map[string]any `json:"decart,omitzero"` + Deepinfra map[string]any `json:"deepinfra,omitzero"` + Deepseek map[string]any `json:"deepseek,omitzero"` + Dekallm map[string]any `json:"dekallm,omitzero"` + Digitalocean map[string]any `json:"digitalocean,omitzero"` + Enfer map[string]any `json:"enfer,omitzero"` + FakeProvider map[string]any `json:"fake-provider,omitzero"` + Featherless map[string]any `json:"featherless,omitzero"` + Fireworks map[string]any `json:"fireworks,omitzero"` + Friendli map[string]any `json:"friendli,omitzero"` + Gmicloud map[string]any `json:"gmicloud,omitzero"` + GoogleAiStudio map[string]any `json:"google-ai-studio,omitzero"` + GoogleVertex map[string]any `json:"google-vertex,omitzero"` + Gopomelo map[string]any `json:"gopomelo,omitzero"` + Groq map[string]any `json:"groq,omitzero"` + Huggingface map[string]any `json:"huggingface,omitzero"` + Hyperbolic map[string]any `json:"hyperbolic,omitzero"` + HyperbolicQuantized map[string]any `json:"hyperbolic-quantized,omitzero"` + Inception map[string]any `json:"inception,omitzero"` + Inceptron map[string]any `json:"inceptron,omitzero"` + InferenceNet map[string]any `json:"inference-net,omitzero"` + Infermatic map[string]any `json:"infermatic,omitzero"` + Inflection map[string]any `json:"inflection,omitzero"` + Inocloud map[string]any `json:"inocloud,omitzero"` + IoNet map[string]any `json:"io-net,omitzero"` + Ionstream map[string]any `json:"ionstream,omitzero"` + Klusterai map[string]any `json:"klusterai,omitzero"` + Lambda map[string]any `json:"lambda,omitzero"` + Lepton map[string]any `json:"lepton,omitzero"` + Liquid map[string]any `json:"liquid,omitzero"` + Lynn map[string]any `json:"lynn,omitzero"` + LynnPrivate map[string]any `json:"lynn-private,omitzero"` + Mancer map[string]any `json:"mancer,omitzero"` + MancerOld map[string]any `json:"mancer-old,omitzero"` + Mara map[string]any `json:"mara,omitzero"` + Meta map[string]any `json:"meta,omitzero"` + Minimax map[string]any `json:"minimax,omitzero"` + Mistral map[string]any `json:"mistral,omitzero"` + Modal map[string]any `json:"modal,omitzero"` + Modelrun map[string]any `json:"modelrun,omitzero"` + Modular map[string]any `json:"modular,omitzero"` + Moonshotai map[string]any `json:"moonshotai,omitzero"` + Morph map[string]any `json:"morph,omitzero"` + Ncompass map[string]any `json:"ncompass,omitzero"` + Nebius map[string]any `json:"nebius,omitzero"` + NexAgi map[string]any `json:"nex-agi,omitzero"` + Nextbit map[string]any `json:"nextbit,omitzero"` + Nineteen map[string]any `json:"nineteen,omitzero"` + Novita map[string]any `json:"novita,omitzero"` + Nvidia map[string]any `json:"nvidia,omitzero"` + Octoai map[string]any `json:"octoai,omitzero"` + OpenInference map[string]any `json:"open-inference,omitzero"` + Openai map[string]any `json:"openai,omitzero"` + Parasail map[string]any `json:"parasail,omitzero"` + Perceptron map[string]any `json:"perceptron,omitzero"` + Perplexity map[string]any `json:"perplexity,omitzero"` + Phala map[string]any `json:"phala,omitzero"` + Poolside map[string]any `json:"poolside,omitzero"` + Recraft map[string]any `json:"recraft,omitzero"` + Recursal map[string]any `json:"recursal,omitzero"` + Reflection map[string]any `json:"reflection,omitzero"` + Reka map[string]any `json:"reka,omitzero"` + Relace map[string]any `json:"relace,omitzero"` + Replicate map[string]any `json:"replicate,omitzero"` + Sambanova map[string]any `json:"sambanova,omitzero"` + SambanovaCloaked map[string]any `json:"sambanova-cloaked,omitzero"` + Seed map[string]any `json:"seed,omitzero"` + SfCompute map[string]any `json:"sf-compute,omitzero"` + Siliconflow map[string]any `json:"siliconflow,omitzero"` + Sourceful map[string]any `json:"sourceful,omitzero"` + Stealth map[string]any `json:"stealth,omitzero"` + Stepfun map[string]any `json:"stepfun,omitzero"` + Streamlake map[string]any `json:"streamlake,omitzero"` + Switchpoint map[string]any `json:"switchpoint,omitzero"` + Targon map[string]any `json:"targon,omitzero"` + Tenstorrent map[string]any `json:"tenstorrent,omitzero"` + Together map[string]any `json:"together,omitzero"` + TogetherLite map[string]any `json:"together-lite,omitzero"` + Ubicloud map[string]any `json:"ubicloud,omitzero"` + Upstage map[string]any `json:"upstage,omitzero"` + Venice map[string]any `json:"venice,omitzero"` + Wafer map[string]any `json:"wafer,omitzero"` + Wandb map[string]any `json:"wandb,omitzero"` + Xai map[string]any `json:"xai,omitzero"` + Xiaomi map[string]any `json:"xiaomi,omitzero"` + ZAi map[string]any `json:"z-ai,omitzero"` +} + +func (i ImageGenerationRequestOptions) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(i, "", false) +} + +func (i *ImageGenerationRequestOptions) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &i, "", false, nil); err != nil { + return err + } + return nil +} + +func (i *ImageGenerationRequestOptions) GetOneai() map[string]any { + if i == nil { + return nil + } + return i.Oneai +} + +func (i *ImageGenerationRequestOptions) GetAi21() map[string]any { + if i == nil { + return nil + } + return i.Ai21 +} + +func (i *ImageGenerationRequestOptions) GetAionLabs() map[string]any { + if i == nil { + return nil + } + return i.AionLabs +} + +func (i *ImageGenerationRequestOptions) GetAkashml() map[string]any { + if i == nil { + return nil + } + return i.Akashml +} + +func (i *ImageGenerationRequestOptions) GetAlibaba() map[string]any { + if i == nil { + return nil + } + return i.Alibaba +} + +func (i *ImageGenerationRequestOptions) GetAmazonBedrock() map[string]any { + if i == nil { + return nil + } + return i.AmazonBedrock +} + +func (i *ImageGenerationRequestOptions) GetAmazonNova() map[string]any { + if i == nil { + return nil + } + return i.AmazonNova +} + +func (i *ImageGenerationRequestOptions) GetAmbient() map[string]any { + if i == nil { + return nil + } + return i.Ambient +} + +func (i *ImageGenerationRequestOptions) GetAnthropic() map[string]any { + if i == nil { + return nil + } + return i.Anthropic +} + +func (i *ImageGenerationRequestOptions) GetAnyscale() map[string]any { + if i == nil { + return nil + } + return i.Anyscale +} + +func (i *ImageGenerationRequestOptions) GetArceeAi() map[string]any { + if i == nil { + return nil + } + return i.ArceeAi +} + +func (i *ImageGenerationRequestOptions) GetAtlasCloud() map[string]any { + if i == nil { + return nil + } + return i.AtlasCloud +} + +func (i *ImageGenerationRequestOptions) GetAtoma() map[string]any { + if i == nil { + return nil + } + return i.Atoma +} + +func (i *ImageGenerationRequestOptions) GetAvian() map[string]any { + if i == nil { + return nil + } + return i.Avian +} + +func (i *ImageGenerationRequestOptions) GetAzure() map[string]any { + if i == nil { + return nil + } + return i.Azure +} + +func (i *ImageGenerationRequestOptions) GetBaidu() map[string]any { + if i == nil { + return nil + } + return i.Baidu +} + +func (i *ImageGenerationRequestOptions) GetBaseten() map[string]any { + if i == nil { + return nil + } + return i.Baseten +} + +func (i *ImageGenerationRequestOptions) GetBlackForestLabs() map[string]any { + if i == nil { + return nil + } + return i.BlackForestLabs +} + +func (i *ImageGenerationRequestOptions) GetByteplus() map[string]any { + if i == nil { + return nil + } + return i.Byteplus +} + +func (i *ImageGenerationRequestOptions) GetCentml() map[string]any { + if i == nil { + return nil + } + return i.Centml +} + +func (i *ImageGenerationRequestOptions) GetCerebras() map[string]any { + if i == nil { + return nil + } + return i.Cerebras +} + +func (i *ImageGenerationRequestOptions) GetChutes() map[string]any { + if i == nil { + return nil + } + return i.Chutes +} + +func (i *ImageGenerationRequestOptions) GetCirrascale() map[string]any { + if i == nil { + return nil + } + return i.Cirrascale +} + +func (i *ImageGenerationRequestOptions) GetClarifai() map[string]any { + if i == nil { + return nil + } + return i.Clarifai +} + +func (i *ImageGenerationRequestOptions) GetCloudflare() map[string]any { + if i == nil { + return nil + } + return i.Cloudflare +} + +func (i *ImageGenerationRequestOptions) GetCohere() map[string]any { + if i == nil { + return nil + } + return i.Cohere +} + +func (i *ImageGenerationRequestOptions) GetCrofai() map[string]any { + if i == nil { + return nil + } + return i.Crofai +} + +func (i *ImageGenerationRequestOptions) GetCrucible() map[string]any { + if i == nil { + return nil + } + return i.Crucible +} + +func (i *ImageGenerationRequestOptions) GetCrusoe() map[string]any { + if i == nil { + return nil + } + return i.Crusoe +} + +func (i *ImageGenerationRequestOptions) GetDarkbloom() map[string]any { + if i == nil { + return nil + } + return i.Darkbloom +} + +func (i *ImageGenerationRequestOptions) GetDecart() map[string]any { + if i == nil { + return nil + } + return i.Decart +} + +func (i *ImageGenerationRequestOptions) GetDeepinfra() map[string]any { + if i == nil { + return nil + } + return i.Deepinfra +} + +func (i *ImageGenerationRequestOptions) GetDeepseek() map[string]any { + if i == nil { + return nil + } + return i.Deepseek +} + +func (i *ImageGenerationRequestOptions) GetDekallm() map[string]any { + if i == nil { + return nil + } + return i.Dekallm +} + +func (i *ImageGenerationRequestOptions) GetDigitalocean() map[string]any { + if i == nil { + return nil + } + return i.Digitalocean +} + +func (i *ImageGenerationRequestOptions) GetEnfer() map[string]any { + if i == nil { + return nil + } + return i.Enfer +} + +func (i *ImageGenerationRequestOptions) GetFakeProvider() map[string]any { + if i == nil { + return nil + } + return i.FakeProvider +} + +func (i *ImageGenerationRequestOptions) GetFeatherless() map[string]any { + if i == nil { + return nil + } + return i.Featherless +} + +func (i *ImageGenerationRequestOptions) GetFireworks() map[string]any { + if i == nil { + return nil + } + return i.Fireworks +} + +func (i *ImageGenerationRequestOptions) GetFriendli() map[string]any { + if i == nil { + return nil + } + return i.Friendli +} + +func (i *ImageGenerationRequestOptions) GetGmicloud() map[string]any { + if i == nil { + return nil + } + return i.Gmicloud +} + +func (i *ImageGenerationRequestOptions) GetGoogleAiStudio() map[string]any { + if i == nil { + return nil + } + return i.GoogleAiStudio +} + +func (i *ImageGenerationRequestOptions) GetGoogleVertex() map[string]any { + if i == nil { + return nil + } + return i.GoogleVertex +} + +func (i *ImageGenerationRequestOptions) GetGopomelo() map[string]any { + if i == nil { + return nil + } + return i.Gopomelo +} + +func (i *ImageGenerationRequestOptions) GetGroq() map[string]any { + if i == nil { + return nil + } + return i.Groq +} + +func (i *ImageGenerationRequestOptions) GetHuggingface() map[string]any { + if i == nil { + return nil + } + return i.Huggingface +} + +func (i *ImageGenerationRequestOptions) GetHyperbolic() map[string]any { + if i == nil { + return nil + } + return i.Hyperbolic +} + +func (i *ImageGenerationRequestOptions) GetHyperbolicQuantized() map[string]any { + if i == nil { + return nil + } + return i.HyperbolicQuantized +} + +func (i *ImageGenerationRequestOptions) GetInception() map[string]any { + if i == nil { + return nil + } + return i.Inception +} + +func (i *ImageGenerationRequestOptions) GetInceptron() map[string]any { + if i == nil { + return nil + } + return i.Inceptron +} + +func (i *ImageGenerationRequestOptions) GetInferenceNet() map[string]any { + if i == nil { + return nil + } + return i.InferenceNet +} + +func (i *ImageGenerationRequestOptions) GetInfermatic() map[string]any { + if i == nil { + return nil + } + return i.Infermatic +} + +func (i *ImageGenerationRequestOptions) GetInflection() map[string]any { + if i == nil { + return nil + } + return i.Inflection +} + +func (i *ImageGenerationRequestOptions) GetInocloud() map[string]any { + if i == nil { + return nil + } + return i.Inocloud +} + +func (i *ImageGenerationRequestOptions) GetIoNet() map[string]any { + if i == nil { + return nil + } + return i.IoNet +} + +func (i *ImageGenerationRequestOptions) GetIonstream() map[string]any { + if i == nil { + return nil + } + return i.Ionstream +} + +func (i *ImageGenerationRequestOptions) GetKlusterai() map[string]any { + if i == nil { + return nil + } + return i.Klusterai +} + +func (i *ImageGenerationRequestOptions) GetLambda() map[string]any { + if i == nil { + return nil + } + return i.Lambda +} + +func (i *ImageGenerationRequestOptions) GetLepton() map[string]any { + if i == nil { + return nil + } + return i.Lepton +} + +func (i *ImageGenerationRequestOptions) GetLiquid() map[string]any { + if i == nil { + return nil + } + return i.Liquid +} + +func (i *ImageGenerationRequestOptions) GetLynn() map[string]any { + if i == nil { + return nil + } + return i.Lynn +} + +func (i *ImageGenerationRequestOptions) GetLynnPrivate() map[string]any { + if i == nil { + return nil + } + return i.LynnPrivate +} + +func (i *ImageGenerationRequestOptions) GetMancer() map[string]any { + if i == nil { + return nil + } + return i.Mancer +} + +func (i *ImageGenerationRequestOptions) GetMancerOld() map[string]any { + if i == nil { + return nil + } + return i.MancerOld +} + +func (i *ImageGenerationRequestOptions) GetMara() map[string]any { + if i == nil { + return nil + } + return i.Mara +} + +func (i *ImageGenerationRequestOptions) GetMeta() map[string]any { + if i == nil { + return nil + } + return i.Meta +} + +func (i *ImageGenerationRequestOptions) GetMinimax() map[string]any { + if i == nil { + return nil + } + return i.Minimax +} + +func (i *ImageGenerationRequestOptions) GetMistral() map[string]any { + if i == nil { + return nil + } + return i.Mistral +} + +func (i *ImageGenerationRequestOptions) GetModal() map[string]any { + if i == nil { + return nil + } + return i.Modal +} + +func (i *ImageGenerationRequestOptions) GetModelrun() map[string]any { + if i == nil { + return nil + } + return i.Modelrun +} + +func (i *ImageGenerationRequestOptions) GetModular() map[string]any { + if i == nil { + return nil + } + return i.Modular +} + +func (i *ImageGenerationRequestOptions) GetMoonshotai() map[string]any { + if i == nil { + return nil + } + return i.Moonshotai +} + +func (i *ImageGenerationRequestOptions) GetMorph() map[string]any { + if i == nil { + return nil + } + return i.Morph +} + +func (i *ImageGenerationRequestOptions) GetNcompass() map[string]any { + if i == nil { + return nil + } + return i.Ncompass +} + +func (i *ImageGenerationRequestOptions) GetNebius() map[string]any { + if i == nil { + return nil + } + return i.Nebius +} + +func (i *ImageGenerationRequestOptions) GetNexAgi() map[string]any { + if i == nil { + return nil + } + return i.NexAgi +} + +func (i *ImageGenerationRequestOptions) GetNextbit() map[string]any { + if i == nil { + return nil + } + return i.Nextbit +} + +func (i *ImageGenerationRequestOptions) GetNineteen() map[string]any { + if i == nil { + return nil + } + return i.Nineteen +} + +func (i *ImageGenerationRequestOptions) GetNovita() map[string]any { + if i == nil { + return nil + } + return i.Novita +} + +func (i *ImageGenerationRequestOptions) GetNvidia() map[string]any { + if i == nil { + return nil + } + return i.Nvidia +} + +func (i *ImageGenerationRequestOptions) GetOctoai() map[string]any { + if i == nil { + return nil + } + return i.Octoai +} + +func (i *ImageGenerationRequestOptions) GetOpenInference() map[string]any { + if i == nil { + return nil + } + return i.OpenInference +} + +func (i *ImageGenerationRequestOptions) GetOpenai() map[string]any { + if i == nil { + return nil + } + return i.Openai +} + +func (i *ImageGenerationRequestOptions) GetParasail() map[string]any { + if i == nil { + return nil + } + return i.Parasail +} + +func (i *ImageGenerationRequestOptions) GetPerceptron() map[string]any { + if i == nil { + return nil + } + return i.Perceptron +} + +func (i *ImageGenerationRequestOptions) GetPerplexity() map[string]any { + if i == nil { + return nil + } + return i.Perplexity +} + +func (i *ImageGenerationRequestOptions) GetPhala() map[string]any { + if i == nil { + return nil + } + return i.Phala +} + +func (i *ImageGenerationRequestOptions) GetPoolside() map[string]any { + if i == nil { + return nil + } + return i.Poolside +} + +func (i *ImageGenerationRequestOptions) GetRecraft() map[string]any { + if i == nil { + return nil + } + return i.Recraft +} + +func (i *ImageGenerationRequestOptions) GetRecursal() map[string]any { + if i == nil { + return nil + } + return i.Recursal +} + +func (i *ImageGenerationRequestOptions) GetReflection() map[string]any { + if i == nil { + return nil + } + return i.Reflection +} + +func (i *ImageGenerationRequestOptions) GetReka() map[string]any { + if i == nil { + return nil + } + return i.Reka +} + +func (i *ImageGenerationRequestOptions) GetRelace() map[string]any { + if i == nil { + return nil + } + return i.Relace +} + +func (i *ImageGenerationRequestOptions) GetReplicate() map[string]any { + if i == nil { + return nil + } + return i.Replicate +} + +func (i *ImageGenerationRequestOptions) GetSambanova() map[string]any { + if i == nil { + return nil + } + return i.Sambanova +} + +func (i *ImageGenerationRequestOptions) GetSambanovaCloaked() map[string]any { + if i == nil { + return nil + } + return i.SambanovaCloaked +} + +func (i *ImageGenerationRequestOptions) GetSeed() map[string]any { + if i == nil { + return nil + } + return i.Seed +} + +func (i *ImageGenerationRequestOptions) GetSfCompute() map[string]any { + if i == nil { + return nil + } + return i.SfCompute +} + +func (i *ImageGenerationRequestOptions) GetSiliconflow() map[string]any { + if i == nil { + return nil + } + return i.Siliconflow +} + +func (i *ImageGenerationRequestOptions) GetSourceful() map[string]any { + if i == nil { + return nil + } + return i.Sourceful +} + +func (i *ImageGenerationRequestOptions) GetStealth() map[string]any { + if i == nil { + return nil + } + return i.Stealth +} + +func (i *ImageGenerationRequestOptions) GetStepfun() map[string]any { + if i == nil { + return nil + } + return i.Stepfun +} + +func (i *ImageGenerationRequestOptions) GetStreamlake() map[string]any { + if i == nil { + return nil + } + return i.Streamlake +} + +func (i *ImageGenerationRequestOptions) GetSwitchpoint() map[string]any { + if i == nil { + return nil + } + return i.Switchpoint +} + +func (i *ImageGenerationRequestOptions) GetTargon() map[string]any { + if i == nil { + return nil + } + return i.Targon +} + +func (i *ImageGenerationRequestOptions) GetTenstorrent() map[string]any { + if i == nil { + return nil + } + return i.Tenstorrent +} + +func (i *ImageGenerationRequestOptions) GetTogether() map[string]any { + if i == nil { + return nil + } + return i.Together +} + +func (i *ImageGenerationRequestOptions) GetTogetherLite() map[string]any { + if i == nil { + return nil + } + return i.TogetherLite +} + +func (i *ImageGenerationRequestOptions) GetUbicloud() map[string]any { + if i == nil { + return nil + } + return i.Ubicloud +} + +func (i *ImageGenerationRequestOptions) GetUpstage() map[string]any { + if i == nil { + return nil + } + return i.Upstage +} + +func (i *ImageGenerationRequestOptions) GetVenice() map[string]any { + if i == nil { + return nil + } + return i.Venice +} + +func (i *ImageGenerationRequestOptions) GetWafer() map[string]any { + if i == nil { + return nil + } + return i.Wafer +} + +func (i *ImageGenerationRequestOptions) GetWandb() map[string]any { + if i == nil { + return nil + } + return i.Wandb +} + +func (i *ImageGenerationRequestOptions) GetXai() map[string]any { + if i == nil { + return nil + } + return i.Xai +} + +func (i *ImageGenerationRequestOptions) GetXiaomi() map[string]any { + if i == nil { + return nil + } + return i.Xiaomi +} + +func (i *ImageGenerationRequestOptions) GetZAi() map[string]any { + if i == nil { + return nil + } + return i.ZAi +} + +// ImageGenerationRequestProvider - Provider-specific passthrough configuration +type ImageGenerationRequestProvider struct { + Options *ImageGenerationRequestOptions `json:"options,omitzero"` +} + +func (i ImageGenerationRequestProvider) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(i, "", false) +} + +func (i *ImageGenerationRequestProvider) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &i, "", false, nil); err != nil { + return err + } + return nil +} + +func (i *ImageGenerationRequestProvider) GetOptions() *ImageGenerationRequestOptions { + if i == nil { + return nil + } + return i.Options +} + +// ImageGenerationRequestQuality - Rendering quality. Providers without a quality knob ignore this. +type ImageGenerationRequestQuality string + +const ( + ImageGenerationRequestQualityAuto ImageGenerationRequestQuality = "auto" + ImageGenerationRequestQualityLow ImageGenerationRequestQuality = "low" + ImageGenerationRequestQualityMedium ImageGenerationRequestQuality = "medium" + ImageGenerationRequestQualityHigh ImageGenerationRequestQuality = "high" +) + +func (e ImageGenerationRequestQuality) ToPointer() *ImageGenerationRequestQuality { + return &e +} + +// IsExact returns true if the value matches a known enum value, false otherwise. +func (e *ImageGenerationRequestQuality) IsExact() bool { + if e != nil { + switch *e { + case "auto", "low", "medium", "high": + return true + } + } + return false +} + +// ImageGenerationRequestResolution - Normalized resolution tier of the generated image. Concrete pixel dimensions are derived per-provider. +type ImageGenerationRequestResolution string + +const ( + ImageGenerationRequestResolutionFiveHundredAndTwelve ImageGenerationRequestResolution = "512" + ImageGenerationRequestResolutionOneK ImageGenerationRequestResolution = "1K" + ImageGenerationRequestResolutionTwoK ImageGenerationRequestResolution = "2K" + ImageGenerationRequestResolutionFourK ImageGenerationRequestResolution = "4K" +) + +func (e ImageGenerationRequestResolution) ToPointer() *ImageGenerationRequestResolution { + return &e +} + +// IsExact returns true if the value matches a known enum value, false otherwise. +func (e *ImageGenerationRequestResolution) IsExact() bool { + if e != nil { + switch *e { + case "512", "1K", "2K", "4K": + return true + } + } + return false +} + +// ImageGenerationRequest - Image generation request input +type ImageGenerationRequest struct { + // Normalized aspect ratio of the generated image. Providers clamp to their supported subset. + AspectRatio *ImageGenerationRequestAspectRatio `json:"aspect_ratio,omitzero"` + // Background treatment. `transparent` requires an output_format that supports alpha (png or webp). + Background *ImageGenerationRequestBackground `json:"background,omitzero"` + // Reference images to guide image-to-image generation, as base64 data URLs or HTTP(S) URLs. + InputReferences []ContentPartImage `json:"input_references,omitzero"` + // The image generation model to use + Model string `json:"model"` + // Number of images to generate (1-10). Providers that only support single-image generation reject n > 1. + N *int64 `json:"n,omitzero"` + // Compression level (0-100) for webp/jpeg output. Ignored for png and by providers without a compression knob. + OutputCompression *int64 `json:"output_compression,omitzero"` + // Encoding of the returned image bytes. + OutputFormat *ImageGenerationRequestOutputFormat `json:"output_format,omitzero"` + // Text description of the desired image + Prompt string `json:"prompt"` + // Provider-specific passthrough configuration + Provider *ImageGenerationRequestProvider `json:"provider,omitzero"` + // Rendering quality. Providers without a quality knob ignore this. + Quality *ImageGenerationRequestQuality `json:"quality,omitzero"` + // Normalized resolution tier of the generated image. Concrete pixel dimensions are derived per-provider. + Resolution *ImageGenerationRequestResolution `json:"resolution,omitzero"` + // If specified, the generation will sample deterministically, such that repeated requests with the same seed and parameters should return the same result. Determinism is not guaranteed for all providers. + Seed *int64 `json:"seed,omitzero"` + // Optional. A convenience shorthand for output dimensions — pass a tier ("2K", "4K") or explicit pixels ("2048x2048") and we normalize it to the right dimensions for the chosen provider. Interchangeable with resolution + aspect_ratio; use those directly for enumerated, per-model discoverable values. Conflicting size + resolution/aspect_ratio is rejected. + Size *string `json:"size,omitzero"` + // If true, partial images are streamed as SSE events as they become available. Only supported by providers with native streaming (currently OpenAI). Non-streaming providers ignore this flag and return a buffered response. + Stream *bool `json:"stream,omitzero"` +} + +func (i ImageGenerationRequest) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(i, "", false) +} + +func (i *ImageGenerationRequest) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &i, "", false, nil); err != nil { + return err + } + return nil +} + +func (i *ImageGenerationRequest) GetAspectRatio() *ImageGenerationRequestAspectRatio { + if i == nil { + return nil + } + return i.AspectRatio +} + +func (i *ImageGenerationRequest) GetBackground() *ImageGenerationRequestBackground { + if i == nil { + return nil + } + return i.Background +} + +func (i *ImageGenerationRequest) GetInputReferences() []ContentPartImage { + if i == nil { + return nil + } + return i.InputReferences +} + +func (i *ImageGenerationRequest) GetModel() string { + if i == nil { + return "" + } + return i.Model +} + +func (i *ImageGenerationRequest) GetN() *int64 { + if i == nil { + return nil + } + return i.N +} + +func (i *ImageGenerationRequest) GetOutputCompression() *int64 { + if i == nil { + return nil + } + return i.OutputCompression +} + +func (i *ImageGenerationRequest) GetOutputFormat() *ImageGenerationRequestOutputFormat { + if i == nil { + return nil + } + return i.OutputFormat +} + +func (i *ImageGenerationRequest) GetPrompt() string { + if i == nil { + return "" + } + return i.Prompt +} + +func (i *ImageGenerationRequest) GetProvider() *ImageGenerationRequestProvider { + if i == nil { + return nil + } + return i.Provider +} + +func (i *ImageGenerationRequest) GetQuality() *ImageGenerationRequestQuality { + if i == nil { + return nil + } + return i.Quality +} + +func (i *ImageGenerationRequest) GetResolution() *ImageGenerationRequestResolution { + if i == nil { + return nil + } + return i.Resolution +} + +func (i *ImageGenerationRequest) GetSeed() *int64 { + if i == nil { + return nil + } + return i.Seed +} + +func (i *ImageGenerationRequest) GetSize() *string { + if i == nil { + return nil + } + return i.Size +} + +func (i *ImageGenerationRequest) GetStream() *bool { + if i == nil { + return nil + } + return i.Stream +} diff --git a/models/components/imagegenerationresponse.go b/models/components/imagegenerationresponse.go new file mode 100644 index 00000000..6ad5d695 --- /dev/null +++ b/models/components/imagegenerationresponse.go @@ -0,0 +1,61 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +import ( + "github.com/OpenRouterTeam/go-sdk/internal/utils" +) + +type ImageGenerationResponseData struct { + // Base64-encoded image bytes + B64JSON string `json:"b64_json"` +} + +func (i *ImageGenerationResponseData) GetB64JSON() string { + if i == nil { + return "" + } + return i.B64JSON +} + +// ImageGenerationResponse - Image generation response +type ImageGenerationResponse struct { + // Unix timestamp (seconds) when the image was generated + Created int64 `json:"created"` + // Generated images + Data []ImageGenerationResponseData `json:"data"` + // Token and cost usage for the image generation request, when available + Usage *ImageGenerationUsage `json:"usage,omitzero"` +} + +func (i ImageGenerationResponse) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(i, "", false) +} + +func (i *ImageGenerationResponse) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &i, "", false, nil); err != nil { + return err + } + return nil +} + +func (i *ImageGenerationResponse) GetCreated() int64 { + if i == nil { + return 0 + } + return i.Created +} + +func (i *ImageGenerationResponse) GetData() []ImageGenerationResponseData { + if i == nil { + return []ImageGenerationResponseData{} + } + return i.Data +} + +func (i *ImageGenerationResponse) GetUsage() *ImageGenerationUsage { + if i == nil { + return nil + } + return i.Usage +} diff --git a/models/components/imagegenerationservertool.go b/models/components/imagegenerationservertool.go index a4335cae..963b4d4a 100644 --- a/models/components/imagegenerationservertool.go +++ b/models/components/imagegenerationservertool.go @@ -9,20 +9,20 @@ import ( "github.com/OpenRouterTeam/go-sdk/optionalnullable" ) -type Background string +type ImageGenerationServerToolBackground string const ( - BackgroundTransparent Background = "transparent" - BackgroundOpaque Background = "opaque" - BackgroundAuto Background = "auto" + ImageGenerationServerToolBackgroundTransparent ImageGenerationServerToolBackground = "transparent" + ImageGenerationServerToolBackgroundOpaque ImageGenerationServerToolBackground = "opaque" + ImageGenerationServerToolBackgroundAuto ImageGenerationServerToolBackground = "auto" ) -func (e Background) ToPointer() *Background { +func (e ImageGenerationServerToolBackground) ToPointer() *ImageGenerationServerToolBackground { return &e } // IsExact returns true if the value matches a known enum value, false otherwise. -func (e *Background) IsExact() bool { +func (e *ImageGenerationServerToolBackground) IsExact() bool { if e != nil { switch *e { case "transparent", "opaque", "auto": @@ -128,20 +128,20 @@ func (e *Moderation) IsExact() bool { return false } -type OutputFormat string +type ImageGenerationServerToolOutputFormat string const ( - OutputFormatPng OutputFormat = "png" - OutputFormatWebp OutputFormat = "webp" - OutputFormatJpeg OutputFormat = "jpeg" + ImageGenerationServerToolOutputFormatPng ImageGenerationServerToolOutputFormat = "png" + ImageGenerationServerToolOutputFormatWebp ImageGenerationServerToolOutputFormat = "webp" + ImageGenerationServerToolOutputFormatJpeg ImageGenerationServerToolOutputFormat = "jpeg" ) -func (e OutputFormat) ToPointer() *OutputFormat { +func (e ImageGenerationServerToolOutputFormat) ToPointer() *ImageGenerationServerToolOutputFormat { return &e } // IsExact returns true if the value matches a known enum value, false otherwise. -func (e *OutputFormat) IsExact() bool { +func (e *ImageGenerationServerToolOutputFormat) IsExact() bool { if e != nil { switch *e { case "png", "webp", "jpeg": @@ -151,21 +151,21 @@ func (e *OutputFormat) IsExact() bool { return false } -type Quality string +type ImageGenerationServerToolQuality string const ( - QualityLow Quality = "low" - QualityMedium Quality = "medium" - QualityHigh Quality = "high" - QualityAuto Quality = "auto" + ImageGenerationServerToolQualityLow ImageGenerationServerToolQuality = "low" + ImageGenerationServerToolQualityMedium ImageGenerationServerToolQuality = "medium" + ImageGenerationServerToolQualityHigh ImageGenerationServerToolQuality = "high" + ImageGenerationServerToolQualityAuto ImageGenerationServerToolQuality = "auto" ) -func (e Quality) ToPointer() *Quality { +func (e ImageGenerationServerToolQuality) ToPointer() *ImageGenerationServerToolQuality { return &e } // IsExact returns true if the value matches a known enum value, false otherwise. -func (e *Quality) IsExact() bool { +func (e *ImageGenerationServerToolQuality) IsExact() bool { if e != nil { switch *e { case "low", "medium", "high", "auto": @@ -224,15 +224,15 @@ func (e *ImageGenerationServerToolType) UnmarshalJSON(data []byte) error { // ImageGenerationServerTool - Image generation tool configuration type ImageGenerationServerTool struct { - Background *Background `json:"background,omitzero"` + Background *ImageGenerationServerToolBackground `json:"background,omitzero"` InputFidelity optionalnullable.OptionalNullable[InputFidelity] `json:"input_fidelity,omitzero"` InputImageMask *InputImageMask `json:"input_image_mask,omitzero"` Model *ModelEnum `json:"model,omitzero"` Moderation *Moderation `json:"moderation,omitzero"` OutputCompression *int64 `json:"output_compression,omitzero"` - OutputFormat *OutputFormat `json:"output_format,omitzero"` + OutputFormat *ImageGenerationServerToolOutputFormat `json:"output_format,omitzero"` PartialImages *int64 `json:"partial_images,omitzero"` - Quality *Quality `json:"quality,omitzero"` + Quality *ImageGenerationServerToolQuality `json:"quality,omitzero"` Size *Size `json:"size,omitzero"` Type ImageGenerationServerToolType `json:"type"` } @@ -248,7 +248,7 @@ func (i *ImageGenerationServerTool) UnmarshalJSON(data []byte) error { return nil } -func (i *ImageGenerationServerTool) GetBackground() *Background { +func (i *ImageGenerationServerTool) GetBackground() *ImageGenerationServerToolBackground { if i == nil { return nil } @@ -290,7 +290,7 @@ func (i *ImageGenerationServerTool) GetOutputCompression() *int64 { return i.OutputCompression } -func (i *ImageGenerationServerTool) GetOutputFormat() *OutputFormat { +func (i *ImageGenerationServerTool) GetOutputFormat() *ImageGenerationServerToolOutputFormat { if i == nil { return nil } @@ -304,7 +304,7 @@ func (i *ImageGenerationServerTool) GetPartialImages() *int64 { return i.PartialImages } -func (i *ImageGenerationServerTool) GetQuality() *Quality { +func (i *ImageGenerationServerTool) GetQuality() *ImageGenerationServerToolQuality { if i == nil { return nil } diff --git a/models/components/imagegenerationusage.go b/models/components/imagegenerationusage.go new file mode 100644 index 00000000..f6193e2a --- /dev/null +++ b/models/components/imagegenerationusage.go @@ -0,0 +1,271 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +import ( + "github.com/OpenRouterTeam/go-sdk/internal/utils" + "github.com/OpenRouterTeam/go-sdk/optionalnullable" +) + +type ImageGenerationUsageCompletionTokensDetails struct { + // Tokens generated by the model for audio output. + AudioTokens optionalnullable.OptionalNullable[int64] `json:"audio_tokens,omitzero"` + // Tokens generated by the model for image output. + ImageTokens optionalnullable.OptionalNullable[int64] `json:"image_tokens,omitzero"` + // Tokens generated by the model for reasoning. + ReasoningTokens optionalnullable.OptionalNullable[int64] `json:"reasoning_tokens,omitzero"` +} + +func (i ImageGenerationUsageCompletionTokensDetails) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(i, "", false) +} + +func (i *ImageGenerationUsageCompletionTokensDetails) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &i, "", false, nil); err != nil { + return err + } + return nil +} + +func (i *ImageGenerationUsageCompletionTokensDetails) GetAudioTokens() optionalnullable.OptionalNullable[int64] { + if i == nil { + return nil + } + return i.AudioTokens +} + +func (i *ImageGenerationUsageCompletionTokensDetails) GetImageTokens() optionalnullable.OptionalNullable[int64] { + if i == nil { + return nil + } + return i.ImageTokens +} + +func (i *ImageGenerationUsageCompletionTokensDetails) GetReasoningTokens() optionalnullable.OptionalNullable[int64] { + if i == nil { + return nil + } + return i.ReasoningTokens +} + +// ImageGenerationUsagePromptTokensDetails - Breakdown of tokens used in the prompt. +type ImageGenerationUsagePromptTokensDetails struct { + // Tokens used for input audio. + AudioTokens optionalnullable.OptionalNullable[int64] `json:"audio_tokens,omitzero"` + // Tokens written to cache. Only returned for models with explicit caching and cache write pricing. + CacheWriteTokens optionalnullable.OptionalNullable[int64] `json:"cache_write_tokens,omitzero"` + // Tokens cached by the endpoint. + CachedTokens optionalnullable.OptionalNullable[int64] `json:"cached_tokens,omitzero"` + // Tokens used for input files/documents. + FileTokens optionalnullable.OptionalNullable[int64] `json:"file_tokens,omitzero"` + // Tokens used for input video. + VideoTokens optionalnullable.OptionalNullable[int64] `json:"video_tokens,omitzero"` +} + +func (i ImageGenerationUsagePromptTokensDetails) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(i, "", false) +} + +func (i *ImageGenerationUsagePromptTokensDetails) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &i, "", false, nil); err != nil { + return err + } + return nil +} + +func (i *ImageGenerationUsagePromptTokensDetails) GetAudioTokens() optionalnullable.OptionalNullable[int64] { + if i == nil { + return nil + } + return i.AudioTokens +} + +func (i *ImageGenerationUsagePromptTokensDetails) GetCacheWriteTokens() optionalnullable.OptionalNullable[int64] { + if i == nil { + return nil + } + return i.CacheWriteTokens +} + +func (i *ImageGenerationUsagePromptTokensDetails) GetCachedTokens() optionalnullable.OptionalNullable[int64] { + if i == nil { + return nil + } + return i.CachedTokens +} + +func (i *ImageGenerationUsagePromptTokensDetails) GetFileTokens() optionalnullable.OptionalNullable[int64] { + if i == nil { + return nil + } + return i.FileTokens +} + +func (i *ImageGenerationUsagePromptTokensDetails) GetVideoTokens() optionalnullable.OptionalNullable[int64] { + if i == nil { + return nil + } + return i.VideoTokens +} + +// ServerToolUse - Usage for server-side tool execution (e.g., web search) +type ServerToolUse struct { + // Number of OpenRouter server tool calls that executed and produced a result. + ToolCallsExecuted optionalnullable.OptionalNullable[int64] `json:"tool_calls_executed,omitzero"` + // Total number of OpenRouter server-orchestrated tool calls the model requested, across all tool types. Provider-native tools (e.g. native web search) are not counted here. + ToolCallsRequested optionalnullable.OptionalNullable[int64] `json:"tool_calls_requested,omitzero"` + // Number of web searches performed by server-side tools. For server-orchestrated tool calls a web search is also counted in tool_calls_requested; provider-native web search may report web_search_requests only. Do not sum the two. + WebSearchRequests optionalnullable.OptionalNullable[int64] `json:"web_search_requests,omitzero"` +} + +func (s ServerToolUse) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(s, "", false) +} + +func (s *ServerToolUse) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &s, "", false, nil); err != nil { + return err + } + return nil +} + +func (s *ServerToolUse) GetToolCallsExecuted() optionalnullable.OptionalNullable[int64] { + if s == nil { + return nil + } + return s.ToolCallsExecuted +} + +func (s *ServerToolUse) GetToolCallsRequested() optionalnullable.OptionalNullable[int64] { + if s == nil { + return nil + } + return s.ToolCallsRequested +} + +func (s *ServerToolUse) GetWebSearchRequests() optionalnullable.OptionalNullable[int64] { + if s == nil { + return nil + } + return s.WebSearchRequests +} + +// ImageGenerationUsage - Token and cost usage for the image generation request, when available +type ImageGenerationUsage struct { + // The tokens generated + CompletionTokens int64 `json:"completion_tokens"` + CompletionTokensDetails optionalnullable.OptionalNullable[ImageGenerationUsageCompletionTokensDetails] `json:"completion_tokens_details,omitzero"` + // Cost of the completion + Cost optionalnullable.OptionalNullable[float64] `json:"cost,omitzero"` + // Breakdown of upstream inference costs + CostDetails optionalnullable.OptionalNullable[CostDetails] `json:"cost_details,omitzero"` + // Whether a request was made using a Bring Your Own Key configuration + IsByok *bool `json:"is_byok,omitzero"` + Iterations optionalnullable.OptionalNullable[[]AnthropicUsageIteration] `json:"iterations,omitzero"` + // Including images, input audio, and tools if any + PromptTokens int64 `json:"prompt_tokens"` + // Breakdown of tokens used in the prompt. + PromptTokensDetails optionalnullable.OptionalNullable[ImageGenerationUsagePromptTokensDetails] `json:"prompt_tokens_details,omitzero"` + // Usage for server-side tool execution (e.g., web search) + ServerToolUse optionalnullable.OptionalNullable[ServerToolUse] `json:"server_tool_use,omitzero"` + // The service tier used by the upstream provider for this request + ServiceTier optionalnullable.OptionalNullable[string] `json:"service_tier,omitzero"` + Speed optionalnullable.OptionalNullable[AnthropicSpeed] `json:"speed,omitzero"` + // Sum of the above two fields + TotalTokens int64 `json:"total_tokens"` +} + +func (i ImageGenerationUsage) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(i, "", false) +} + +func (i *ImageGenerationUsage) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &i, "", false, nil); err != nil { + return err + } + return nil +} + +func (i *ImageGenerationUsage) GetCompletionTokens() int64 { + if i == nil { + return 0 + } + return i.CompletionTokens +} + +func (i *ImageGenerationUsage) GetCompletionTokensDetails() optionalnullable.OptionalNullable[ImageGenerationUsageCompletionTokensDetails] { + if i == nil { + return nil + } + return i.CompletionTokensDetails +} + +func (i *ImageGenerationUsage) GetCost() optionalnullable.OptionalNullable[float64] { + if i == nil { + return nil + } + return i.Cost +} + +func (i *ImageGenerationUsage) GetCostDetails() optionalnullable.OptionalNullable[CostDetails] { + if i == nil { + return nil + } + return i.CostDetails +} + +func (i *ImageGenerationUsage) GetIsByok() *bool { + if i == nil { + return nil + } + return i.IsByok +} + +func (i *ImageGenerationUsage) GetIterations() optionalnullable.OptionalNullable[[]AnthropicUsageIteration] { + if i == nil { + return nil + } + return i.Iterations +} + +func (i *ImageGenerationUsage) GetPromptTokens() int64 { + if i == nil { + return 0 + } + return i.PromptTokens +} + +func (i *ImageGenerationUsage) GetPromptTokensDetails() optionalnullable.OptionalNullable[ImageGenerationUsagePromptTokensDetails] { + if i == nil { + return nil + } + return i.PromptTokensDetails +} + +func (i *ImageGenerationUsage) GetServerToolUse() optionalnullable.OptionalNullable[ServerToolUse] { + if i == nil { + return nil + } + return i.ServerToolUse +} + +func (i *ImageGenerationUsage) GetServiceTier() optionalnullable.OptionalNullable[string] { + if i == nil { + return nil + } + return i.ServiceTier +} + +func (i *ImageGenerationUsage) GetSpeed() optionalnullable.OptionalNullable[AnthropicSpeed] { + if i == nil { + return nil + } + return i.Speed +} + +func (i *ImageGenerationUsage) GetTotalTokens() int64 { + if i == nil { + return 0 + } + return i.TotalTokens +} diff --git a/models/components/imagegenpartialimageevent.go b/models/components/imagegenpartialimageevent.go new file mode 100644 index 00000000..002ab9b2 --- /dev/null +++ b/models/components/imagegenpartialimageevent.go @@ -0,0 +1,75 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +import ( + "encoding/json" + "fmt" + "github.com/OpenRouterTeam/go-sdk/internal/utils" +) + +// ImageGenPartialImageEventType - The event type +type ImageGenPartialImageEventType string + +const ( + ImageGenPartialImageEventTypeImageGenerationPartialImage ImageGenPartialImageEventType = "image_generation.partial_image" +) + +func (e ImageGenPartialImageEventType) ToPointer() *ImageGenPartialImageEventType { + return &e +} +func (e *ImageGenPartialImageEventType) UnmarshalJSON(data []byte) error { + var v string + if err := json.Unmarshal(data, &v); err != nil { + return err + } + switch v { + case "image_generation.partial_image": + *e = ImageGenPartialImageEventType(v) + return nil + default: + return fmt.Errorf("invalid value for ImageGenPartialImageEventType: %v", v) + } +} + +// ImageGenPartialImageEvent - Emitted when a partial image becomes available during streaming generation +type ImageGenPartialImageEvent struct { + // Base64-encoded partial image data + B64JSON string `json:"b64_json"` + // 0-based index indicating which partial image this is in the sequence + PartialImageIndex int64 `json:"partial_image_index"` + // The event type + Type ImageGenPartialImageEventType `json:"type"` +} + +func (i ImageGenPartialImageEvent) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(i, "", false) +} + +func (i *ImageGenPartialImageEvent) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &i, "", false, nil); err != nil { + return err + } + return nil +} + +func (i *ImageGenPartialImageEvent) GetB64JSON() string { + if i == nil { + return "" + } + return i.B64JSON +} + +func (i *ImageGenPartialImageEvent) GetPartialImageIndex() int64 { + if i == nil { + return 0 + } + return i.PartialImageIndex +} + +func (i *ImageGenPartialImageEvent) GetType() ImageGenPartialImageEventType { + if i == nil { + return ImageGenPartialImageEventType("") + } + return i.Type +} diff --git a/models/components/imagegenstreamerrorevent.go b/models/components/imagegenstreamerrorevent.go new file mode 100644 index 00000000..07865cf9 --- /dev/null +++ b/models/components/imagegenstreamerrorevent.go @@ -0,0 +1,118 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +import ( + "encoding/json" + "fmt" + "github.com/OpenRouterTeam/go-sdk/internal/utils" + "github.com/OpenRouterTeam/go-sdk/optionalnullable" +) + +// ImageGenStreamErrorEventError - Provider error details +type ImageGenStreamErrorEventError struct { + // Provider error code, when supplied + Code optionalnullable.OptionalNullable[string] `json:"code,omitzero"` + // Provider error message + Message string `json:"message"` + // Request parameter associated with the error, when supplied + Param optionalnullable.OptionalNullable[string] `json:"param,omitzero"` + // Provider error type, when supplied + Type optionalnullable.OptionalNullable[string] `json:"type,omitzero"` +} + +func (i ImageGenStreamErrorEventError) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(i, "", false) +} + +func (i *ImageGenStreamErrorEventError) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &i, "", false, nil); err != nil { + return err + } + return nil +} + +func (i *ImageGenStreamErrorEventError) GetCode() optionalnullable.OptionalNullable[string] { + if i == nil { + return nil + } + return i.Code +} + +func (i *ImageGenStreamErrorEventError) GetMessage() string { + if i == nil { + return "" + } + return i.Message +} + +func (i *ImageGenStreamErrorEventError) GetParam() optionalnullable.OptionalNullable[string] { + if i == nil { + return nil + } + return i.Param +} + +func (i *ImageGenStreamErrorEventError) GetType() optionalnullable.OptionalNullable[string] { + if i == nil { + return nil + } + return i.Type +} + +// ImageGenStreamErrorEventType - The event type +type ImageGenStreamErrorEventType string + +const ( + ImageGenStreamErrorEventTypeError ImageGenStreamErrorEventType = "error" +) + +func (e ImageGenStreamErrorEventType) ToPointer() *ImageGenStreamErrorEventType { + return &e +} +func (e *ImageGenStreamErrorEventType) UnmarshalJSON(data []byte) error { + var v string + if err := json.Unmarshal(data, &v); err != nil { + return err + } + switch v { + case "error": + *e = ImageGenStreamErrorEventType(v) + return nil + default: + return fmt.Errorf("invalid value for ImageGenStreamErrorEventType: %v", v) + } +} + +// ImageGenStreamErrorEvent - Emitted when streaming generation fails after the SSE response starts +type ImageGenStreamErrorEvent struct { + // Provider error details + Error ImageGenStreamErrorEventError `json:"error"` + // The event type + Type ImageGenStreamErrorEventType `json:"type"` +} + +func (i ImageGenStreamErrorEvent) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(i, "", false) +} + +func (i *ImageGenStreamErrorEvent) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &i, "", false, nil); err != nil { + return err + } + return nil +} + +func (i *ImageGenStreamErrorEvent) GetError() ImageGenStreamErrorEventError { + if i == nil { + return ImageGenStreamErrorEventError{} + } + return i.Error +} + +func (i *ImageGenStreamErrorEvent) GetType() ImageGenStreamErrorEventType { + if i == nil { + return ImageGenStreamErrorEventType("") + } + return i.Type +} diff --git a/models/components/imagemodelarchitecture.go b/models/components/imagemodelarchitecture.go new file mode 100644 index 00000000..77a2c819 --- /dev/null +++ b/models/components/imagemodelarchitecture.go @@ -0,0 +1,24 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +type ImageModelArchitecture struct { + // Supported input modalities + InputModalities []InputModality `json:"input_modalities"` + // Supported output modalities + OutputModalities []ImageOutputModality `json:"output_modalities"` +} + +func (i *ImageModelArchitecture) GetInputModalities() []InputModality { + if i == nil { + return []InputModality{} + } + return i.InputModalities +} + +func (i *ImageModelArchitecture) GetOutputModalities() []ImageOutputModality { + if i == nil { + return []ImageOutputModality{} + } + return i.OutputModalities +} diff --git a/models/components/imagemodelendpointsresponse.go b/models/components/imagemodelendpointsresponse.go new file mode 100644 index 00000000..d079e3e4 --- /dev/null +++ b/models/components/imagemodelendpointsresponse.go @@ -0,0 +1,24 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +// ImageModelEndpointsResponse - The full per-endpoint records for an image model. +type ImageModelEndpointsResponse struct { + Endpoints []ImageEndpoint `json:"endpoints"` + // Model slug + ID string `json:"id"` +} + +func (i *ImageModelEndpointsResponse) GetEndpoints() []ImageEndpoint { + if i == nil { + return []ImageEndpoint{} + } + return i.Endpoints +} + +func (i *ImageModelEndpointsResponse) GetID() string { + if i == nil { + return "" + } + return i.ID +} diff --git a/models/components/imagemodellistitem.go b/models/components/imagemodellistitem.go new file mode 100644 index 00000000..94fb73bc --- /dev/null +++ b/models/components/imagemodellistitem.go @@ -0,0 +1,77 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +// ImageModelListItem - A single image model in the discovery listing. +type ImageModelListItem struct { + Architecture ImageModelArchitecture `json:"architecture"` + // Unix timestamp (seconds) of when the model was created + Created int64 `json:"created"` + Description string `json:"description"` + // Relative URL to the full per-endpoint records for this model + Endpoints string `json:"endpoints"` + // Model slug + ID string `json:"id"` + // Display name + Name string `json:"name"` + // Union of supported parameters across every endpoint of this model. Coarse discovery aid; the definitive per-endpoint set is behind the endpoints URL. + SupportedParameters map[string]CapabilityDescriptor `json:"supported_parameters"` + // Whether any endpoint of this model supports native SSE streaming on the dedicated Image API (i.e. `stream: true` in the request). OR across endpoints. + SupportsStreaming bool `json:"supports_streaming"` +} + +func (i *ImageModelListItem) GetArchitecture() ImageModelArchitecture { + if i == nil { + return ImageModelArchitecture{} + } + return i.Architecture +} + +func (i *ImageModelListItem) GetCreated() int64 { + if i == nil { + return 0 + } + return i.Created +} + +func (i *ImageModelListItem) GetDescription() string { + if i == nil { + return "" + } + return i.Description +} + +func (i *ImageModelListItem) GetEndpoints() string { + if i == nil { + return "" + } + return i.Endpoints +} + +func (i *ImageModelListItem) GetID() string { + if i == nil { + return "" + } + return i.ID +} + +func (i *ImageModelListItem) GetName() string { + if i == nil { + return "" + } + return i.Name +} + +func (i *ImageModelListItem) GetSupportedParameters() map[string]CapabilityDescriptor { + if i == nil { + return map[string]CapabilityDescriptor{} + } + return i.SupportedParameters +} + +func (i *ImageModelListItem) GetSupportsStreaming() bool { + if i == nil { + return false + } + return i.SupportsStreaming +} diff --git a/models/components/imagemodelslistresponse.go b/models/components/imagemodelslistresponse.go new file mode 100644 index 00000000..3ba400f9 --- /dev/null +++ b/models/components/imagemodelslistresponse.go @@ -0,0 +1,15 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +// ImageModelsListResponse - List of image generation models. +type ImageModelsListResponse struct { + Data []ImageModelListItem `json:"data"` +} + +func (i *ImageModelsListResponse) GetData() []ImageModelListItem { + if i == nil { + return []ImageModelListItem{} + } + return i.Data +} diff --git a/models/components/imageoutputmodality.go b/models/components/imageoutputmodality.go new file mode 100644 index 00000000..99d69e8d --- /dev/null +++ b/models/components/imageoutputmodality.go @@ -0,0 +1,31 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +type ImageOutputModality string + +const ( + ImageOutputModalityText ImageOutputModality = "text" + ImageOutputModalityImage ImageOutputModality = "image" + ImageOutputModalityEmbeddings ImageOutputModality = "embeddings" + ImageOutputModalityAudio ImageOutputModality = "audio" + ImageOutputModalityVideo ImageOutputModality = "video" + ImageOutputModalityRerank ImageOutputModality = "rerank" + ImageOutputModalitySpeech ImageOutputModality = "speech" + ImageOutputModalityTranscription ImageOutputModality = "transcription" +) + +func (e ImageOutputModality) ToPointer() *ImageOutputModality { + return &e +} + +// IsExact returns true if the value matches a known enum value, false otherwise. +func (e *ImageOutputModality) IsExact() bool { + if e != nil { + switch *e { + case "text", "image", "embeddings", "audio", "video", "rerank", "speech", "transcription": + return true + } + } + return false +} diff --git a/models/components/imagepricingentry.go b/models/components/imagepricingentry.go new file mode 100644 index 00000000..6910fb69 --- /dev/null +++ b/models/components/imagepricingentry.go @@ -0,0 +1,87 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +type Billable string + +const ( + BillableOutputImage Billable = "output_image" + BillableInputImage Billable = "input_image" + BillableInputFont Billable = "input_font" + BillableInputReference Billable = "input_reference" + BillableInputText Billable = "input_text" +) + +func (e Billable) ToPointer() *Billable { + return &e +} + +// IsExact returns true if the value matches a known enum value, false otherwise. +func (e *Billable) IsExact() bool { + if e != nil { + switch *e { + case "output_image", "input_image", "input_font", "input_reference", "input_text": + return true + } + } + return false +} + +type Unit string + +const ( + UnitImage Unit = "image" + UnitMegapixel Unit = "megapixel" + UnitToken Unit = "token" +) + +func (e Unit) ToPointer() *Unit { + return &e +} + +// IsExact returns true if the value matches a known enum value, false otherwise. +func (e *Unit) IsExact() bool { + if e != nil { + switch *e { + case "image", "megapixel", "token": + return true + } + } + return false +} + +// ImagePricingEntry - One billable pricing line for an image provider. +type ImagePricingEntry struct { + Billable Billable `json:"billable"` + CostUsd float64 `json:"cost_usd"` + Unit Unit `json:"unit"` + Variant *string `json:"variant,omitzero"` +} + +func (i *ImagePricingEntry) GetBillable() Billable { + if i == nil { + return Billable("") + } + return i.Billable +} + +func (i *ImagePricingEntry) GetCostUsd() float64 { + if i == nil { + return 0.0 + } + return i.CostUsd +} + +func (i *ImagePricingEntry) GetUnit() Unit { + if i == nil { + return Unit("") + } + return i.Unit +} + +func (i *ImagePricingEntry) GetVariant() *string { + if i == nil { + return nil + } + return i.Variant +} diff --git a/models/components/imagestreamingresponse.go b/models/components/imagestreamingresponse.go new file mode 100644 index 00000000..f1a91df3 --- /dev/null +++ b/models/components/imagestreamingresponse.go @@ -0,0 +1,179 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +import ( + "encoding/json" + "errors" + "fmt" + "github.com/OpenRouterTeam/go-sdk/internal/utils" +) + +type ImageStreamingResponseDataType string + +const ( + ImageStreamingResponseDataTypeImageGenerationPartialImage ImageStreamingResponseDataType = "image_generation.partial_image" + ImageStreamingResponseDataTypeImageGenerationCompleted ImageStreamingResponseDataType = "image_generation.completed" + ImageStreamingResponseDataTypeError ImageStreamingResponseDataType = "error" + ImageStreamingResponseDataTypeUnknown ImageStreamingResponseDataType = "UNKNOWN" +) + +type ImageStreamingResponseData struct { + ImageGenPartialImageEvent *ImageGenPartialImageEvent `queryParam:"inline" union:"member"` + ImageGenCompletedEvent *ImageGenCompletedEvent `queryParam:"inline" union:"member"` + ImageGenStreamErrorEvent *ImageGenStreamErrorEvent `queryParam:"inline" union:"member"` + UnknownRaw json.RawMessage `json:"-" union:"unknown"` + + Type ImageStreamingResponseDataType +} + +func CreateImageStreamingResponseDataImageGenerationPartialImage(imageGenerationPartialImage ImageGenPartialImageEvent) ImageStreamingResponseData { + typ := ImageStreamingResponseDataTypeImageGenerationPartialImage + + typStr := ImageGenPartialImageEventType(typ) + imageGenerationPartialImage.Type = typStr + + return ImageStreamingResponseData{ + ImageGenPartialImageEvent: &imageGenerationPartialImage, + Type: typ, + } +} + +func CreateImageStreamingResponseDataImageGenerationCompleted(imageGenerationCompleted ImageGenCompletedEvent) ImageStreamingResponseData { + typ := ImageStreamingResponseDataTypeImageGenerationCompleted + + typStr := ImageGenCompletedEventType(typ) + imageGenerationCompleted.Type = typStr + + return ImageStreamingResponseData{ + ImageGenCompletedEvent: &imageGenerationCompleted, + Type: typ, + } +} + +func CreateImageStreamingResponseDataError(errorT ImageGenStreamErrorEvent) ImageStreamingResponseData { + typ := ImageStreamingResponseDataTypeError + + typStr := ImageGenStreamErrorEventType(typ) + errorT.Type = typStr + + return ImageStreamingResponseData{ + ImageGenStreamErrorEvent: &errorT, + Type: typ, + } +} + +func CreateImageStreamingResponseDataUnknown(raw json.RawMessage) ImageStreamingResponseData { + return ImageStreamingResponseData{ + UnknownRaw: raw, + Type: ImageStreamingResponseDataTypeUnknown, + } +} + +func (u ImageStreamingResponseData) GetUnknownRaw() json.RawMessage { + return u.UnknownRaw +} + +func (u ImageStreamingResponseData) IsUnknown() bool { + return u.Type == ImageStreamingResponseDataTypeUnknown +} + +func (u *ImageStreamingResponseData) UnmarshalJSON(data []byte) error { + + type discriminator struct { + Type string `json:"type"` + } + + dis := new(discriminator) + if err := json.Unmarshal(data, &dis); err != nil { + u.UnknownRaw = json.RawMessage(data) + u.Type = ImageStreamingResponseDataTypeUnknown + return nil + } + if dis == nil { + u.UnknownRaw = json.RawMessage(data) + u.Type = ImageStreamingResponseDataTypeUnknown + return nil + } + + switch dis.Type { + case "image_generation.partial_image": + imageGenPartialImageEvent := new(ImageGenPartialImageEvent) + if err := utils.UnmarshalJSON(data, &imageGenPartialImageEvent, "", true, nil); err != nil { + return fmt.Errorf("could not unmarshal `%s` into expected (Type == image_generation.partial_image) type ImageGenPartialImageEvent within ImageStreamingResponseData: %w", string(data), err) + } + + u.ImageGenPartialImageEvent = imageGenPartialImageEvent + u.Type = ImageStreamingResponseDataTypeImageGenerationPartialImage + return nil + case "image_generation.completed": + imageGenCompletedEvent := new(ImageGenCompletedEvent) + if err := utils.UnmarshalJSON(data, &imageGenCompletedEvent, "", true, nil); err != nil { + return fmt.Errorf("could not unmarshal `%s` into expected (Type == image_generation.completed) type ImageGenCompletedEvent within ImageStreamingResponseData: %w", string(data), err) + } + + u.ImageGenCompletedEvent = imageGenCompletedEvent + u.Type = ImageStreamingResponseDataTypeImageGenerationCompleted + return nil + case "error": + imageGenStreamErrorEvent := new(ImageGenStreamErrorEvent) + if err := utils.UnmarshalJSON(data, &imageGenStreamErrorEvent, "", true, nil); err != nil { + return fmt.Errorf("could not unmarshal `%s` into expected (Type == error) type ImageGenStreamErrorEvent within ImageStreamingResponseData: %w", string(data), err) + } + + u.ImageGenStreamErrorEvent = imageGenStreamErrorEvent + u.Type = ImageStreamingResponseDataTypeError + return nil + default: + u.UnknownRaw = json.RawMessage(data) + u.Type = ImageStreamingResponseDataTypeUnknown + return nil + } + +} + +func (u ImageStreamingResponseData) MarshalJSON() ([]byte, error) { + if u.ImageGenPartialImageEvent != nil { + return utils.MarshalJSON(u.ImageGenPartialImageEvent, "", true) + } + + if u.ImageGenCompletedEvent != nil { + return utils.MarshalJSON(u.ImageGenCompletedEvent, "", true) + } + + if u.ImageGenStreamErrorEvent != nil { + return utils.MarshalJSON(u.ImageGenStreamErrorEvent, "", true) + } + + if u.UnknownRaw != nil { + return json.RawMessage(u.UnknownRaw), nil + } + return nil, errors.New("could not marshal union type ImageStreamingResponseData: all fields are null") +} + +type ImageStreamingResponse struct { + Data ImageStreamingResponseData `json:"data"` +} + +func (i *ImageStreamingResponse) GetData() ImageStreamingResponseData { + if i == nil { + return ImageStreamingResponseData{} + } + return i.Data +} + +func (i *ImageStreamingResponse) GetDataImageGenerationPartialImage() *ImageGenPartialImageEvent { + return i.GetData().ImageGenPartialImageEvent +} + +func (i *ImageStreamingResponse) GetDataImageGenerationCompleted() *ImageGenCompletedEvent { + return i.GetData().ImageGenCompletedEvent +} + +func (i *ImageStreamingResponse) GetDataError() *ImageGenStreamErrorEvent { + return i.GetData().ImageGenStreamErrorEvent +} + +func (i ImageStreamingResponse) GetEventEncoding(event string) (string, error) { + return "application/json", nil +} diff --git a/models/components/inputsunion.go b/models/components/inputsunion.go index adf74fb6..1eb67f71 100644 --- a/models/components/inputsunion.go +++ b/models/components/inputsunion.go @@ -986,6 +986,7 @@ const ( InputsUnion1TypeOutputMemoryServerToolItem InputsUnion1Type = "OutputMemoryServerToolItem" InputsUnion1TypeOutputMcpServerToolItem InputsUnion1Type = "OutputMcpServerToolItem" InputsUnion1TypeOutputSearchModelsServerToolItem InputsUnion1Type = "OutputSearchModelsServerToolItem" + InputsUnion1TypeOutputFusionServerToolItem InputsUnion1Type = "OutputFusionServerToolItem" InputsUnion1TypeOutputAdvisorServerToolItem InputsUnion1Type = "OutputAdvisorServerToolItem" InputsUnion1TypeOutputSubagentServerToolItem InputsUnion1Type = "OutputSubagentServerToolItem" InputsUnion1TypeLocalShellCallItem InputsUnion1Type = "LocalShellCallItem" @@ -1033,6 +1034,7 @@ type InputsUnion1 struct { OutputMemoryServerToolItem *OutputMemoryServerToolItem `queryParam:"inline" union:"member"` OutputMcpServerToolItem *OutputMcpServerToolItem `queryParam:"inline" union:"member"` OutputSearchModelsServerToolItem *OutputSearchModelsServerToolItem `queryParam:"inline" union:"member"` + OutputFusionServerToolItem *OutputFusionServerToolItem `queryParam:"inline" union:"member"` OutputAdvisorServerToolItem *OutputAdvisorServerToolItem `queryParam:"inline" union:"member"` OutputSubagentServerToolItem *OutputSubagentServerToolItem `queryParam:"inline" union:"member"` LocalShellCallItem *LocalShellCallItem `queryParam:"inline" union:"member"` @@ -1321,6 +1323,15 @@ func CreateInputsUnion1OutputSearchModelsServerToolItem(outputSearchModelsServer } } +func CreateInputsUnion1OutputFusionServerToolItem(outputFusionServerToolItem OutputFusionServerToolItem) InputsUnion1 { + typ := InputsUnion1TypeOutputFusionServerToolItem + + return InputsUnion1{ + OutputFusionServerToolItem: &outputFusionServerToolItem, + Type: typ, + } +} + func CreateInputsUnion1OutputAdvisorServerToolItem(outputAdvisorServerToolItem OutputAdvisorServerToolItem) InputsUnion1 { typ := InputsUnion1TypeOutputAdvisorServerToolItem @@ -1692,6 +1703,14 @@ func (u *InputsUnion1) UnmarshalJSON(data []byte) error { }) } + var outputFusionServerToolItem OutputFusionServerToolItem = OutputFusionServerToolItem{} + if err := utils.UnmarshalJSON(data, &outputFusionServerToolItem, "", true, nil); err == nil { + candidates = append(candidates, utils.UnionCandidate{ + Type: InputsUnion1TypeOutputFusionServerToolItem, + Value: &outputFusionServerToolItem, + }) + } + var outputAdvisorServerToolItem OutputAdvisorServerToolItem = OutputAdvisorServerToolItem{} if err := utils.UnmarshalJSON(data, &outputAdvisorServerToolItem, "", true, nil); err == nil { candidates = append(candidates, utils.UnionCandidate{ @@ -1907,6 +1926,9 @@ func (u *InputsUnion1) UnmarshalJSON(data []byte) error { case InputsUnion1TypeOutputSearchModelsServerToolItem: u.OutputSearchModelsServerToolItem = best.Value.(*OutputSearchModelsServerToolItem) return nil + case InputsUnion1TypeOutputFusionServerToolItem: + u.OutputFusionServerToolItem = best.Value.(*OutputFusionServerToolItem) + return nil case InputsUnion1TypeOutputAdvisorServerToolItem: u.OutputAdvisorServerToolItem = best.Value.(*OutputAdvisorServerToolItem) return nil @@ -2075,6 +2097,10 @@ func (u InputsUnion1) MarshalJSON() ([]byte, error) { return utils.MarshalJSON(u.OutputSearchModelsServerToolItem, "", true) } + if u.OutputFusionServerToolItem != nil { + return utils.MarshalJSON(u.OutputFusionServerToolItem, "", true) + } + if u.OutputAdvisorServerToolItem != nil { return utils.MarshalJSON(u.OutputAdvisorServerToolItem, "", true) } diff --git a/models/components/legacywebsearchservertool.go b/models/components/legacywebsearchservertool.go index 508cd8f2..7bb2a874 100644 --- a/models/components/legacywebsearchservertool.go +++ b/models/components/legacywebsearchservertool.go @@ -37,7 +37,7 @@ type LegacyWebSearchServerTool struct { // Which search engine to use. "auto" (default) uses native if the provider supports it, otherwise Exa. "native" forces the provider's built-in search. "exa" forces the Exa search API. "firecrawl" uses Firecrawl (requires BYOK). "parallel" uses the Parallel search API. "perplexity" uses the Perplexity Search API (raw ranked results). Engine *WebSearchEngineEnum `json:"engine,omitzero"` Filters optionalnullable.OptionalNullable[WebSearchDomainFilter] `json:"filters,omitzero"` - // Maximum number of search results to return per search call. Defaults to 5. Applies to Exa, Firecrawl, Parallel, and Perplexity engines; ignored with native provider search. + // Maximum number of search results to return per search call. Defaults to 5. Applies to Exa, Firecrawl, Parallel, and Perplexity engines; ignored with native provider search. Perplexity supports a maximum of 20; values above 20 are clamped. MaxResults *int64 `json:"max_results,omitzero"` // Size of the search context for web search tools SearchContextSize *SearchContextSizeEnum `json:"search_context_size,omitzero"` diff --git a/models/components/listworkspacebudgetsresponse.go b/models/components/listworkspacebudgetsresponse.go new file mode 100644 index 00000000..995435f5 --- /dev/null +++ b/models/components/listworkspacebudgetsresponse.go @@ -0,0 +1,15 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +type ListWorkspaceBudgetsResponse struct { + // List of budgets configured for the workspace + Data []WorkspaceBudget `json:"data"` +} + +func (l *ListWorkspaceBudgetsResponse) GetData() []WorkspaceBudget { + if l == nil { + return []WorkspaceBudget{} + } + return l.Data +} diff --git a/models/components/messagesrequest.go b/models/components/messagesrequest.go index 4a25c189..9edb5873 100644 --- a/models/components/messagesrequest.go +++ b/models/components/messagesrequest.go @@ -810,11 +810,11 @@ func (c *ContextManagement) GetEdits() []Edit { return c.Edits } -type Metadata struct { +type MessagesRequestMetadata struct { UserID optionalnullable.OptionalNullable[string] `json:"user_id,omitzero"` } -func (m *Metadata) GetUserID() optionalnullable.OptionalNullable[string] { +func (m *MessagesRequestMetadata) GetUserID() optionalnullable.OptionalNullable[string] { if m == nil { return nil } @@ -2973,7 +2973,7 @@ type MessagesRequest struct { Fallbacks optionalnullable.OptionalNullable[[]MessagesFallbackParam] `json:"fallbacks,omitzero"` MaxTokens *int64 `json:"max_tokens,omitzero"` Messages []MessagesMessageParam `json:"messages"` - Metadata *Metadata `json:"metadata,omitzero"` + Metadata *MessagesRequestMetadata `json:"metadata,omitzero"` Model string `json:"model"` Models []string `json:"models,omitzero"` // Configuration for controlling output behavior. Supports the effort parameter and structured output format. @@ -3049,7 +3049,7 @@ func (m *MessagesRequest) GetMessages() []MessagesMessageParam { return m.Messages } -func (m *MessagesRequest) GetMetadata() *Metadata { +func (m *MessagesRequest) GetMetadata() *MessagesRequestMetadata { if m == nil { return nil } diff --git a/models/components/model.go b/models/components/model.go index de775ae8..1ba98e8e 100644 --- a/models/components/model.go +++ b/models/components/model.go @@ -39,6 +39,8 @@ type Model struct { PerRequestLimits *PerRequestLimits `json:"per_request_limits"` // Pricing information for the model Pricing PublicPricing `json:"pricing"` + // Reasoning effort configuration. Omitted for non-reasoning models and dynamic router models. + Reasoning *ModelReasoning `json:"reasoning,omitzero"` // List of supported parameters for this model SupportedParameters []Parameter `json:"supported_parameters"` // List of supported voice identifiers for TTS models. Null for non-TTS models. @@ -163,6 +165,13 @@ func (m *Model) GetPricing() PublicPricing { return m.Pricing } +func (m *Model) GetReasoning() *ModelReasoning { + if m == nil { + return nil + } + return m.Reasoning +} + func (m *Model) GetSupportedParameters() []Parameter { if m == nil { return []Parameter{} diff --git a/models/components/modelreasoning.go b/models/components/modelreasoning.go new file mode 100644 index 00000000..d20dff9f --- /dev/null +++ b/models/components/modelreasoning.go @@ -0,0 +1,95 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +import ( + "github.com/OpenRouterTeam/go-sdk/internal/utils" + "github.com/OpenRouterTeam/go-sdk/optionalnullable" +) + +// DefaultEffort - Default reasoning effort when the client enables reasoning without specifying effort. Maps to `reasoning.effort` in chat requests. When `"none"`, prefer omitting effort unless the user explicitly disables reasoning. +type DefaultEffort string + +const ( + DefaultEffortMax DefaultEffort = "max" + DefaultEffortXhigh DefaultEffort = "xhigh" + DefaultEffortHigh DefaultEffort = "high" + DefaultEffortMedium DefaultEffort = "medium" + DefaultEffortLow DefaultEffort = "low" + DefaultEffortMinimal DefaultEffort = "minimal" + DefaultEffortNone DefaultEffort = "none" +) + +func (e DefaultEffort) ToPointer() *DefaultEffort { + return &e +} + +// IsExact returns true if the value matches a known enum value, false otherwise. +func (e *DefaultEffort) IsExact() bool { + if e != nil { + switch *e { + case "max", "xhigh", "high", "medium", "low", "minimal", "none": + return true + } + } + return false +} + +// ModelReasoning - Reasoning effort configuration. Omitted for non-reasoning models and dynamic router models. +type ModelReasoning struct { + DefaultEffort optionalnullable.OptionalNullable[DefaultEffort] `json:"default_effort,omitzero"` + // Default reasoning enabled state when the client does not set `reasoning.enabled`. + DefaultEnabled *bool `json:"default_enabled,omitzero"` + // When true, reasoning cannot be disabled and effort "none" is rejected. + Mandatory bool `json:"mandatory"` + // Allowed reasoning effort values for this model, in descending effort order (highest first). Null means no allowlist — all gateway effort values are accepted. + SupportedEfforts optionalnullable.OptionalNullable[[]*ReasoningEffort] `json:"supported_efforts,omitzero"` + // Present and `true` when the model accepts `reasoning.max_tokens` in requests (Anthropic-style) instead of or in addition to `reasoning.effort`. Omitted otherwise. + SupportsMaxTokens *bool `json:"supports_max_tokens,omitzero"` +} + +func (m ModelReasoning) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(m, "", false) +} + +func (m *ModelReasoning) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &m, "", false, nil); err != nil { + return err + } + return nil +} + +func (m *ModelReasoning) GetDefaultEffort() optionalnullable.OptionalNullable[DefaultEffort] { + if m == nil { + return nil + } + return m.DefaultEffort +} + +func (m *ModelReasoning) GetDefaultEnabled() *bool { + if m == nil { + return nil + } + return m.DefaultEnabled +} + +func (m *ModelReasoning) GetMandatory() bool { + if m == nil { + return false + } + return m.Mandatory +} + +func (m *ModelReasoning) GetSupportedEfforts() optionalnullable.OptionalNullable[[]*ReasoningEffort] { + if m == nil { + return nil + } + return m.SupportedEfforts +} + +func (m *ModelReasoning) GetSupportsMaxTokens() *bool { + if m == nil { + return nil + } + return m.SupportsMaxTokens +} diff --git a/models/components/observabilityarizedestination.go b/models/components/observabilityarizedestination.go index 8084d123..50b7606f 100644 --- a/models/components/observabilityarizedestination.go +++ b/models/components/observabilityarizedestination.go @@ -12,9 +12,10 @@ type ObservabilityArizeDestinationConfig struct { APIKey string `json:"apiKey"` BaseURL *string `default:"https://otlp.arize.com" json:"baseUrl"` // Custom HTTP headers to include in requests to this destination. - Headers map[string]string `json:"headers,omitzero"` - ModelID string `json:"modelId"` - SpaceKey string `json:"spaceKey"` + Headers map[string]string `json:"headers,omitzero"` + // The name of the tracing project in Arize AX + ModelID string `json:"modelId"` + SpaceKey string `json:"spaceKey"` } func (o ObservabilityArizeDestinationConfig) MarshalJSON() ([]byte, error) { diff --git a/models/components/openresponsesresult.go b/models/components/openresponsesresult.go index f9cef544..e3784ab8 100644 --- a/models/components/openresponsesresult.go +++ b/models/components/openresponsesresult.go @@ -588,9 +588,11 @@ type OpenResponsesResult struct { TopP *float64 `json:"top_p"` Truncation optionalnullable.OptionalNullable[Truncation] `json:"truncation,omitzero"` // Token usage information for the response - Usage optionalnullable.OptionalNullable[Usage] `json:"usage,omitzero"` - User optionalnullable.OptionalNullable[string] `json:"user,omitzero"` - OpenrouterMetadata *OpenRouterMetadata `json:"openrouter_metadata,omitzero"` + Usage optionalnullable.OptionalNullable[Usage] `json:"usage,omitzero"` + User optionalnullable.OptionalNullable[string] `json:"user,omitzero"` + // Canonical OpenRouter error type, stable across all API formats + ErrorType *APIErrorType `json:"error_type,omitzero"` + OpenrouterMetadata *OpenRouterMetadata `json:"openrouter_metadata,omitzero"` } func (o OpenResponsesResult) MarshalJSON() ([]byte, error) { @@ -842,6 +844,13 @@ func (o *OpenResponsesResult) GetUser() optionalnullable.OptionalNullable[string return o.User } +func (o *OpenResponsesResult) GetErrorType() *APIErrorType { + if o == nil { + return nil + } + return o.ErrorType +} + func (o *OpenResponsesResult) GetOpenrouterMetadata() *OpenRouterMetadata { if o == nil { return nil diff --git a/models/components/preview20250311websearchservertool.go b/models/components/preview20250311websearchservertool.go index fc6f40e0..d7f703de 100644 --- a/models/components/preview20250311websearchservertool.go +++ b/models/components/preview20250311websearchservertool.go @@ -37,7 +37,7 @@ type Preview20250311WebSearchServerTool struct { // Which search engine to use. "auto" (default) uses native if the provider supports it, otherwise Exa. "native" forces the provider's built-in search. "exa" forces the Exa search API. "firecrawl" uses Firecrawl (requires BYOK). "parallel" uses the Parallel search API. "perplexity" uses the Perplexity Search API (raw ranked results). Engine *WebSearchEngineEnum `json:"engine,omitzero"` Filters optionalnullable.OptionalNullable[WebSearchDomainFilter] `json:"filters,omitzero"` - // Maximum number of search results to return per search call. Defaults to 5. Applies to Exa, Firecrawl, Parallel, and Perplexity engines; ignored with native provider search. + // Maximum number of search results to return per search call. Defaults to 5. Applies to Exa, Firecrawl, Parallel, and Perplexity engines; ignored with native provider search. Perplexity supports a maximum of 20; values above 20 are clamped. MaxResults *int64 `json:"max_results,omitzero"` // Size of the search context for web search tools SearchContextSize *SearchContextSizeEnum `json:"search_context_size,omitzero"` diff --git a/models/components/previewwebsearchservertool.go b/models/components/previewwebsearchservertool.go index f22d7fdf..ae2c685b 100644 --- a/models/components/previewwebsearchservertool.go +++ b/models/components/previewwebsearchservertool.go @@ -37,7 +37,7 @@ type PreviewWebSearchServerTool struct { // Which search engine to use. "auto" (default) uses native if the provider supports it, otherwise Exa. "native" forces the provider's built-in search. "exa" forces the Exa search API. "firecrawl" uses Firecrawl (requires BYOK). "parallel" uses the Parallel search API. "perplexity" uses the Perplexity Search API (raw ranked results). Engine *WebSearchEngineEnum `json:"engine,omitzero"` Filters optionalnullable.OptionalNullable[WebSearchDomainFilter] `json:"filters,omitzero"` - // Maximum number of search results to return per search call. Defaults to 5. Applies to Exa, Firecrawl, Parallel, and Perplexity engines; ignored with native provider search. + // Maximum number of search results to return per search call. Defaults to 5. Applies to Exa, Firecrawl, Parallel, and Perplexity engines; ignored with native provider search. Perplexity supports a maximum of 20; values above 20 are clamped. MaxResults *int64 `json:"max_results,omitzero"` // Size of the search context for web search tools SearchContextSize *SearchContextSizeEnum `json:"search_context_size,omitzero"` diff --git a/models/components/providername.go b/models/components/providername.go index dd2b81e0..e2adc9dd 100644 --- a/models/components/providername.go +++ b/models/components/providername.go @@ -82,6 +82,7 @@ const ( ProviderNameStealth ProviderName = "Stealth" ProviderNameStreamLake ProviderName = "StreamLake" ProviderNameSwitchpoint ProviderName = "Switchpoint" + ProviderNameTenstorrent ProviderName = "Tenstorrent" ProviderNameTogether ProviderName = "Together" ProviderNameUpstage ProviderName = "Upstage" ProviderNameVenice ProviderName = "Venice" @@ -101,7 +102,7 @@ func (e ProviderName) ToPointer() *ProviderName { func (e *ProviderName) IsExact() bool { if e != nil { switch *e { - case "AkashML", "AI21", "AionLabs", "Alibaba", "Ambient", "Baidu", "Amazon Bedrock", "Amazon Nova", "Anthropic", "Arcee AI", "AtlasCloud", "Avian", "Azure", "BaseTen", "BytePlus", "Black Forest Labs", "Cerebras", "Chutes", "Cirrascale", "Clarifai", "Cloudflare", "Cohere", "Crucible", "Crusoe", "Darkbloom", "Decart", "DeepInfra", "DeepSeek", "DekaLLM", "DigitalOcean", "Featherless", "Fireworks", "Friendli", "GMICloud", "Google", "Google AI Studio", "Groq", "Inception", "Inceptron", "InferenceNet", "Ionstream", "Infermatic", "Io Net", "Inflection", "Liquid", "Mara", "Mancer 2", "Minimax", "ModelRun", "Mistral", "Modular", "Moonshot AI", "Morph", "NCompass", "Nebius", "Nex AGI", "NextBit", "Novita", "Nvidia", "OpenAI", "OpenInference", "Parasail", "Poolside", "Perceptron", "Perplexity", "Phala", "Recraft", "Reka", "Relace", "SambaNova", "Seed", "SiliconFlow", "Sourceful", "StepFun", "Stealth", "StreamLake", "Switchpoint", "Together", "Upstage", "Venice", "Wafer", "WandB", "Xiaomi", "xAI", "Z.AI", "FakeProvider": + case "AkashML", "AI21", "AionLabs", "Alibaba", "Ambient", "Baidu", "Amazon Bedrock", "Amazon Nova", "Anthropic", "Arcee AI", "AtlasCloud", "Avian", "Azure", "BaseTen", "BytePlus", "Black Forest Labs", "Cerebras", "Chutes", "Cirrascale", "Clarifai", "Cloudflare", "Cohere", "Crucible", "Crusoe", "Darkbloom", "Decart", "DeepInfra", "DeepSeek", "DekaLLM", "DigitalOcean", "Featherless", "Fireworks", "Friendli", "GMICloud", "Google", "Google AI Studio", "Groq", "Inception", "Inceptron", "InferenceNet", "Ionstream", "Infermatic", "Io Net", "Inflection", "Liquid", "Mara", "Mancer 2", "Minimax", "ModelRun", "Mistral", "Modular", "Moonshot AI", "Morph", "NCompass", "Nebius", "Nex AGI", "NextBit", "Novita", "Nvidia", "OpenAI", "OpenInference", "Parasail", "Poolside", "Perceptron", "Perplexity", "Phala", "Recraft", "Reka", "Relace", "SambaNova", "Seed", "SiliconFlow", "Sourceful", "StepFun", "Stealth", "StreamLake", "Switchpoint", "Tenstorrent", "Together", "Upstage", "Venice", "Wafer", "WandB", "Xiaomi", "xAI", "Z.AI", "FakeProvider": return true } } diff --git a/models/components/provideroptions.go b/models/components/provideroptions.go index f0b3640b..632088c6 100644 --- a/models/components/provideroptions.go +++ b/models/components/provideroptions.go @@ -6,7 +6,7 @@ import ( "github.com/OpenRouterTeam/go-sdk/internal/utils" ) -// ProviderOptions - Provider-specific options keyed by provider slug. The options for the matched provider are spread into the upstream request body. +// ProviderOptions - Provider-specific options keyed by provider slug. Only options for the matched provider are forwarded; the rest are ignored. Unrecognized keys are silently dropped. type ProviderOptions struct { Oneai map[string]any `json:"01ai,omitzero"` Ai21 map[string]any `json:"ai21,omitzero"` @@ -113,6 +113,7 @@ type ProviderOptions struct { Streamlake map[string]any `json:"streamlake,omitzero"` Switchpoint map[string]any `json:"switchpoint,omitzero"` Targon map[string]any `json:"targon,omitzero"` + Tenstorrent map[string]any `json:"tenstorrent,omitzero"` Together map[string]any `json:"together,omitzero"` TogetherLite map[string]any `json:"together-lite,omitzero"` Ubicloud map[string]any `json:"ubicloud,omitzero"` @@ -871,6 +872,13 @@ func (p *ProviderOptions) GetTargon() map[string]any { return p.Targon } +func (p *ProviderOptions) GetTenstorrent() map[string]any { + if p == nil { + return nil + } + return p.Tenstorrent +} + func (p *ProviderOptions) GetTogether() map[string]any { if p == nil { return nil diff --git a/models/components/providerresponse.go b/models/components/providerresponse.go index 78d4b9d2..3ed35f0b 100644 --- a/models/components/providerresponse.go +++ b/models/components/providerresponse.go @@ -112,6 +112,7 @@ const ( ProviderResponseProviderNameStealth ProviderResponseProviderName = "Stealth" ProviderResponseProviderNameStreamLake ProviderResponseProviderName = "StreamLake" ProviderResponseProviderNameSwitchpoint ProviderResponseProviderName = "Switchpoint" + ProviderResponseProviderNameTenstorrent ProviderResponseProviderName = "Tenstorrent" ProviderResponseProviderNameTogether ProviderResponseProviderName = "Together" ProviderResponseProviderNameUpstage ProviderResponseProviderName = "Upstage" ProviderResponseProviderNameVenice ProviderResponseProviderName = "Venice" @@ -131,7 +132,7 @@ func (e ProviderResponseProviderName) ToPointer() *ProviderResponseProviderName func (e *ProviderResponseProviderName) IsExact() bool { if e != nil { switch *e { - case "AnyScale", "Atoma", "Cent-ML", "CrofAI", "Enfer", "GoPomelo", "HuggingFace", "Hyperbolic", "Hyperbolic 2", "InoCloud", "Kluster", "Lambda", "Lepton", "Lynn 2", "Lynn", "Mancer", "Meta", "Modal", "Nineteen", "OctoAI", "Recursal", "Reflection", "Replicate", "SambaNova 2", "SF Compute", "Targon", "Together 2", "Ubicloud", "01.AI", "AkashML", "AI21", "AionLabs", "Alibaba", "Ambient", "Baidu", "Amazon Bedrock", "Amazon Nova", "Anthropic", "Arcee AI", "AtlasCloud", "Avian", "Azure", "BaseTen", "BytePlus", "Black Forest Labs", "Cerebras", "Chutes", "Cirrascale", "Clarifai", "Cloudflare", "Cohere", "Crucible", "Crusoe", "Darkbloom", "Decart", "DeepInfra", "DeepSeek", "DekaLLM", "DigitalOcean", "Featherless", "Fireworks", "Friendli", "GMICloud", "Google", "Google AI Studio", "Groq", "Inception", "Inceptron", "InferenceNet", "Ionstream", "Infermatic", "Io Net", "Inflection", "Liquid", "Mara", "Mancer 2", "Minimax", "ModelRun", "Mistral", "Modular", "Moonshot AI", "Morph", "NCompass", "Nebius", "Nex AGI", "NextBit", "Novita", "Nvidia", "OpenAI", "OpenInference", "Parasail", "Poolside", "Perceptron", "Perplexity", "Phala", "Recraft", "Reka", "Relace", "SambaNova", "Seed", "SiliconFlow", "Sourceful", "StepFun", "Stealth", "StreamLake", "Switchpoint", "Together", "Upstage", "Venice", "Wafer", "WandB", "Xiaomi", "xAI", "Z.AI", "FakeProvider": + case "AnyScale", "Atoma", "Cent-ML", "CrofAI", "Enfer", "GoPomelo", "HuggingFace", "Hyperbolic", "Hyperbolic 2", "InoCloud", "Kluster", "Lambda", "Lepton", "Lynn 2", "Lynn", "Mancer", "Meta", "Modal", "Nineteen", "OctoAI", "Recursal", "Reflection", "Replicate", "SambaNova 2", "SF Compute", "Targon", "Together 2", "Ubicloud", "01.AI", "AkashML", "AI21", "AionLabs", "Alibaba", "Ambient", "Baidu", "Amazon Bedrock", "Amazon Nova", "Anthropic", "Arcee AI", "AtlasCloud", "Avian", "Azure", "BaseTen", "BytePlus", "Black Forest Labs", "Cerebras", "Chutes", "Cirrascale", "Clarifai", "Cloudflare", "Cohere", "Crucible", "Crusoe", "Darkbloom", "Decart", "DeepInfra", "DeepSeek", "DekaLLM", "DigitalOcean", "Featherless", "Fireworks", "Friendli", "GMICloud", "Google", "Google AI Studio", "Groq", "Inception", "Inceptron", "InferenceNet", "Ionstream", "Infermatic", "Io Net", "Inflection", "Liquid", "Mara", "Mancer 2", "Minimax", "ModelRun", "Mistral", "Modular", "Moonshot AI", "Morph", "NCompass", "Nebius", "Nex AGI", "NextBit", "Novita", "Nvidia", "OpenAI", "OpenInference", "Parasail", "Poolside", "Perceptron", "Perplexity", "Phala", "Recraft", "Reka", "Relace", "SambaNova", "Seed", "SiliconFlow", "Sourceful", "StepFun", "Stealth", "StreamLake", "Switchpoint", "Tenstorrent", "Together", "Upstage", "Venice", "Wafer", "WandB", "Xiaomi", "xAI", "Z.AI", "FakeProvider": return true } } diff --git a/models/components/rangecapability.go b/models/components/rangecapability.go new file mode 100644 index 00000000..7bbd95b3 --- /dev/null +++ b/models/components/rangecapability.go @@ -0,0 +1,71 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +import ( + "encoding/json" + "fmt" + "github.com/OpenRouterTeam/go-sdk/internal/utils" +) + +type RangeCapabilityType string + +const ( + RangeCapabilityTypeRange RangeCapabilityType = "range" +) + +func (e RangeCapabilityType) ToPointer() *RangeCapabilityType { + return &e +} +func (e *RangeCapabilityType) UnmarshalJSON(data []byte) error { + var v string + if err := json.Unmarshal(data, &v); err != nil { + return err + } + switch v { + case "range": + *e = RangeCapabilityType(v) + return nil + default: + return fmt.Errorf("invalid value for RangeCapabilityType: %v", v) + } +} + +// RangeCapability - A parameter that accepts any value within an inclusive numeric range. +type RangeCapability struct { + Max float64 `json:"max"` + Min float64 `json:"min"` + Type RangeCapabilityType `json:"type"` +} + +func (r RangeCapability) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(r, "", false) +} + +func (r *RangeCapability) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &r, "", false, nil); err != nil { + return err + } + return nil +} + +func (r *RangeCapability) GetMax() float64 { + if r == nil { + return 0.0 + } + return r.Max +} + +func (r *RangeCapability) GetMin() float64 { + if r == nil { + return 0.0 + } + return r.Min +} + +func (r *RangeCapability) GetType() RangeCapabilityType { + if r == nil { + return RangeCapabilityType("") + } + return r.Type +} diff --git a/models/components/reasoningeffort.go b/models/components/reasoningeffort.go index 54c76d0e..d982d284 100644 --- a/models/components/reasoningeffort.go +++ b/models/components/reasoningeffort.go @@ -5,6 +5,7 @@ package components type ReasoningEffort string const ( + ReasoningEffortMax ReasoningEffort = "max" ReasoningEffortXhigh ReasoningEffort = "xhigh" ReasoningEffortHigh ReasoningEffort = "high" ReasoningEffortMedium ReasoningEffort = "medium" @@ -21,7 +22,7 @@ func (e ReasoningEffort) ToPointer() *ReasoningEffort { func (e *ReasoningEffort) IsExact() bool { if e != nil { switch *e { - case "xhigh", "high", "medium", "low", "minimal", "none": + case "max", "xhigh", "high", "medium", "low", "minimal", "none": return true } } diff --git a/models/components/responsesrequest.go b/models/components/responsesrequest.go index 0c731d2c..3b08c5cb 100644 --- a/models/components/responsesrequest.go +++ b/models/components/responsesrequest.go @@ -1098,7 +1098,9 @@ func (u ResponsesRequestToolUnion) MarshalJSON() ([]byte, error) { type ResponsesRequest struct { Background optionalnullable.OptionalNullable[bool] `json:"background,omitzero"` // Enable automatic prompt caching. When set at the top level, the system automatically applies cache breakpoints to the last cacheable block in the request. Currently supported for Anthropic Claude models. - CacheControl *AnthropicCacheControlDirective `json:"cache_control,omitzero"` + CacheControl *AnthropicCacheControlDirective `json:"cache_control,omitzero"` + // Debug options for inspecting request transformations (streaming only) + Debug *ChatDebugOptions `json:"debug,omitzero"` FrequencyPenalty optionalnullable.OptionalNullable[float64] `json:"frequency_penalty,omitzero"` // Provider-specific image configuration options. Keys and values vary by model/provider. See https://openrouter.ai/docs/guides/overview/multimodal/image-generation for more details. ImageConfig map[string]ImageConfig `json:"image_config,omitzero"` @@ -1174,6 +1176,13 @@ func (r *ResponsesRequest) GetCacheControl() *AnthropicCacheControlDirective { return r.CacheControl } +func (r *ResponsesRequest) GetDebug() *ChatDebugOptions { + if r == nil { + return nil + } + return r.Debug +} + func (r *ResponsesRequest) GetFrequencyPenalty() optionalnullable.OptionalNullable[float64] { if r == nil { return nil diff --git a/models/components/responsesstreamingresponse.go b/models/components/responsesstreamingresponse.go index f0261d23..0c7c96dd 100644 --- a/models/components/responsesstreamingresponse.go +++ b/models/components/responsesstreamingresponse.go @@ -50,6 +50,10 @@ func (r *ResponsesStreamingResponse) GetDataResponseCustomToolCallInputDone() *C return r.GetData().CustomToolCallInputDoneEvent } +func (r *ResponsesStreamingResponse) GetDataResponseDebug() *DebugEvent { + return r.GetData().DebugEvent +} + func (r *ResponsesStreamingResponse) GetDataResponseFailed() *StreamEventsResponseFailed { return r.GetData().StreamEventsResponseFailed } diff --git a/models/components/speechrequest.go b/models/components/speechrequest.go index 45925c3e..c0945288 100644 --- a/models/components/speechrequest.go +++ b/models/components/speechrequest.go @@ -8,7 +8,7 @@ import ( // SpeechRequestProvider - Provider-specific passthrough configuration type SpeechRequestProvider struct { - // Provider-specific options keyed by provider slug. The options for the matched provider are spread into the upstream request body. + // Provider-specific options keyed by provider slug. Only options for the matched provider are forwarded; the rest are ignored. Unrecognized keys are silently dropped. Options *ProviderOptions `json:"options,omitzero"` } diff --git a/models/components/streamevents.go b/models/components/streamevents.go index 4bf54407..974d70b1 100644 --- a/models/components/streamevents.go +++ b/models/components/streamevents.go @@ -21,6 +21,7 @@ const ( StreamEventsTypeResponseCreated StreamEventsType = "response.created" StreamEventsTypeResponseCustomToolCallInputDelta StreamEventsType = "response.custom_tool_call_input.delta" StreamEventsTypeResponseCustomToolCallInputDone StreamEventsType = "response.custom_tool_call_input.done" + StreamEventsTypeResponseDebug StreamEventsType = "response.debug" StreamEventsTypeResponseFailed StreamEventsType = "response.failed" StreamEventsTypeResponseFunctionCallArgumentsDelta StreamEventsType = "response.function_call_arguments.delta" StreamEventsTypeResponseFunctionCallArgumentsDone StreamEventsType = "response.function_call_arguments.done" @@ -103,6 +104,7 @@ type StreamEvents struct { FusionCallAnalysisInProgressEvent *FusionCallAnalysisInProgressEvent `queryParam:"inline" union:"member"` FusionCallAnalysisCompletedEvent *FusionCallAnalysisCompletedEvent `queryParam:"inline" union:"member"` FusionCallCompletedEvent *FusionCallCompletedEvent `queryParam:"inline" union:"member"` + DebugEvent *DebugEvent `queryParam:"inline" union:"member"` UnknownRaw json.RawMessage `json:"-" union:"unknown"` Type StreamEventsType @@ -216,6 +218,18 @@ func CreateStreamEventsResponseCustomToolCallInputDone(responseCustomToolCallInp } } +func CreateStreamEventsResponseDebug(responseDebug DebugEvent) StreamEvents { + typ := StreamEventsTypeResponseDebug + + typStr := DebugEventType(typ) + responseDebug.Type = typStr + + return StreamEvents{ + DebugEvent: &responseDebug, + Type: typ, + } +} + func CreateStreamEventsResponseFailed(responseFailed StreamEventsResponseFailed) StreamEvents { typ := StreamEventsTypeResponseFailed @@ -739,6 +753,15 @@ func (u *StreamEvents) UnmarshalJSON(data []byte) error { u.CustomToolCallInputDoneEvent = customToolCallInputDoneEvent u.Type = StreamEventsTypeResponseCustomToolCallInputDone return nil + case "response.debug": + debugEvent := new(DebugEvent) + if err := utils.UnmarshalJSON(data, &debugEvent, "", true, nil); err != nil { + return fmt.Errorf("could not unmarshal `%s` into expected (Type == response.debug) type DebugEvent within StreamEvents: %w", string(data), err) + } + + u.DebugEvent = debugEvent + u.Type = StreamEventsTypeResponseDebug + return nil case "response.failed": streamEventsResponseFailed := new(StreamEventsResponseFailed) if err := utils.UnmarshalJSON(data, &streamEventsResponseFailed, "", true, nil); err != nil { @@ -1226,6 +1249,10 @@ func (u StreamEvents) MarshalJSON() ([]byte, error) { return utils.MarshalJSON(u.FusionCallCompletedEvent, "", true) } + if u.DebugEvent != nil { + return utils.MarshalJSON(u.DebugEvent, "", true) + } + if u.UnknownRaw != nil { return json.RawMessage(u.UnknownRaw), nil } diff --git a/models/components/sttrequest.go b/models/components/sttrequest.go index d54ad247..72c2ae13 100644 --- a/models/components/sttrequest.go +++ b/models/components/sttrequest.go @@ -8,7 +8,7 @@ import ( // STTRequestProvider - Provider-specific passthrough configuration type STTRequestProvider struct { - // Provider-specific options keyed by provider slug. The options for the matched provider are spread into the upstream request body. + // Provider-specific options keyed by provider slug. Only options for the matched provider are forwarded; the rest are ignored. Unrecognized keys are silently dropped. Options *ProviderOptions `json:"options,omitzero"` } diff --git a/models/components/subagentreasoning.go b/models/components/subagentreasoning.go index dd468439..970d4824 100644 --- a/models/components/subagentreasoning.go +++ b/models/components/subagentreasoning.go @@ -10,6 +10,7 @@ import ( type SubagentReasoningEffort string const ( + SubagentReasoningEffortMax SubagentReasoningEffort = "max" SubagentReasoningEffortXhigh SubagentReasoningEffort = "xhigh" SubagentReasoningEffortHigh SubagentReasoningEffort = "high" SubagentReasoningEffortMedium SubagentReasoningEffort = "medium" @@ -26,7 +27,7 @@ func (e SubagentReasoningEffort) ToPointer() *SubagentReasoningEffort { func (e *SubagentReasoningEffort) IsExact() bool { if e != nil { switch *e { - case "xhigh", "high", "medium", "low", "minimal", "none": + case "max", "xhigh", "high", "medium", "low", "minimal", "none": return true } } diff --git a/models/components/taskclassificationitem.go b/models/components/taskclassificationitem.go new file mode 100644 index 00000000..be6a38b6 --- /dev/null +++ b/models/components/taskclassificationitem.go @@ -0,0 +1,78 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +type TaskClassificationItem struct { + // Fraction of this classification's token volume within its macro-category (0–1). Sums to 1 across all classifications sharing the same `macro_category`. + CategoryTokenShare float64 `json:"category_token_share"` + // Fraction of this classification's usage within its macro-category (0–1). Sums to 1 across all classifications sharing the same `macro_category`. + CategoryUsageShare float64 `json:"category_usage_share"` + // Human-readable label for the classification. + DisplayName string `json:"display_name"` + // Coarse grouping derived from the tag prefix: `code`, `data`, `agent`, or `general`. + MacroCategory string `json:"macro_category"` + // Top models for this classification by request volume, sorted descending. Each entry reports the model's share of this classification's requests and tokens. + Models []TaskClassificationModel `json:"models"` + // Classification tag identifier (e.g. `code:general_impl`, `agent:web_search`). + Tag string `json:"tag"` + // Fraction of classified sampled token volume (prompt + completion) attributed to this classification (0–1). The unclassified `other` bucket is excluded from the denominator. + TokenShare float64 `json:"token_share"` + // Fraction of classified sampled requests attributed to this classification (0–1). The unclassified `other` bucket is excluded from the denominator. + UsageShare float64 `json:"usage_share"` +} + +func (t *TaskClassificationItem) GetCategoryTokenShare() float64 { + if t == nil { + return 0.0 + } + return t.CategoryTokenShare +} + +func (t *TaskClassificationItem) GetCategoryUsageShare() float64 { + if t == nil { + return 0.0 + } + return t.CategoryUsageShare +} + +func (t *TaskClassificationItem) GetDisplayName() string { + if t == nil { + return "" + } + return t.DisplayName +} + +func (t *TaskClassificationItem) GetMacroCategory() string { + if t == nil { + return "" + } + return t.MacroCategory +} + +func (t *TaskClassificationItem) GetModels() []TaskClassificationModel { + if t == nil { + return []TaskClassificationModel{} + } + return t.Models +} + +func (t *TaskClassificationItem) GetTag() string { + if t == nil { + return "" + } + return t.Tag +} + +func (t *TaskClassificationItem) GetTokenShare() float64 { + if t == nil { + return 0.0 + } + return t.TokenShare +} + +func (t *TaskClassificationItem) GetUsageShare() float64 { + if t == nil { + return 0.0 + } + return t.UsageShare +} diff --git a/models/components/taskclassificationmacrocategory.go b/models/components/taskclassificationmacrocategory.go new file mode 100644 index 00000000..e822cdb2 --- /dev/null +++ b/models/components/taskclassificationmacrocategory.go @@ -0,0 +1,42 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +type TaskClassificationMacroCategory struct { + // Macro-category identifier. + Key string `json:"key"` + // Human-readable label for the macro-category. + Label string `json:"label"` + // Combined token share of all classifications in this macro-category (0–1). + TokenShare float64 `json:"token_share"` + // Combined usage share of all classifications in this macro-category (0–1). + UsageShare float64 `json:"usage_share"` +} + +func (t *TaskClassificationMacroCategory) GetKey() string { + if t == nil { + return "" + } + return t.Key +} + +func (t *TaskClassificationMacroCategory) GetLabel() string { + if t == nil { + return "" + } + return t.Label +} + +func (t *TaskClassificationMacroCategory) GetTokenShare() float64 { + if t == nil { + return 0.0 + } + return t.TokenShare +} + +func (t *TaskClassificationMacroCategory) GetUsageShare() float64 { + if t == nil { + return 0.0 + } + return t.UsageShare +} diff --git a/models/components/taskclassificationmodel.go b/models/components/taskclassificationmodel.go new file mode 100644 index 00000000..96e5cc03 --- /dev/null +++ b/models/components/taskclassificationmodel.go @@ -0,0 +1,33 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +type TaskClassificationModel struct { + // Model identifier (permaslug). + ID string `json:"id"` + // Fraction of this classification's sampled token volume attributed to this model (0–1). Sums to ≤1 across the returned models (only top-N are included and unattributed requests are excluded). + TagTokenShare float64 `json:"tag_token_share"` + // Fraction of this classification's sampled requests attributed to this model (0–1). Sums to ≤1 across the returned models (only top-N are included and unattributed requests are excluded). + TagUsageShare float64 `json:"tag_usage_share"` +} + +func (t *TaskClassificationModel) GetID() string { + if t == nil { + return "" + } + return t.ID +} + +func (t *TaskClassificationModel) GetTagTokenShare() float64 { + if t == nil { + return 0.0 + } + return t.TagTokenShare +} + +func (t *TaskClassificationModel) GetTagUsageShare() float64 { + if t == nil { + return 0.0 + } + return t.TagUsageShare +} diff --git a/models/components/taskclassificationresponse.go b/models/components/taskclassificationresponse.go new file mode 100644 index 00000000..5a8fb839 --- /dev/null +++ b/models/components/taskclassificationresponse.go @@ -0,0 +1,53 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +type TaskClassificationResponseData struct { + // UTC date (YYYY-MM-DD) of the window upper bound (yesterday). Data is exclusive of the current incomplete UTC day. This is the expected latest date in the snapshot; it does not confirm data presence for that date. + AsOf string `json:"as_of"` + // Per-task classification market-share data, sorted by usage_share descending. + Classifications []TaskClassificationItem `json:"classifications"` + // Aggregate market-share data per macro-category (code, data, agent, general). + MacroCategories []TaskClassificationMacroCategory `json:"macro_categories"` + // Number of trailing days covered by this snapshot. + WindowDays int64 `json:"window_days"` +} + +func (t *TaskClassificationResponseData) GetAsOf() string { + if t == nil { + return "" + } + return t.AsOf +} + +func (t *TaskClassificationResponseData) GetClassifications() []TaskClassificationItem { + if t == nil { + return []TaskClassificationItem{} + } + return t.Classifications +} + +func (t *TaskClassificationResponseData) GetMacroCategories() []TaskClassificationMacroCategory { + if t == nil { + return []TaskClassificationMacroCategory{} + } + return t.MacroCategories +} + +func (t *TaskClassificationResponseData) GetWindowDays() int64 { + if t == nil { + return 0 + } + return t.WindowDays +} + +type TaskClassificationResponse struct { + Data TaskClassificationResponseData `json:"data"` +} + +func (t *TaskClassificationResponse) GetData() TaskClassificationResponseData { + if t == nil { + return TaskClassificationResponseData{} + } + return t.Data +} diff --git a/models/components/unifiedbenchmarkpricing.go b/models/components/unifiedbenchmarkpricing.go new file mode 100644 index 00000000..97899b63 --- /dev/null +++ b/models/components/unifiedbenchmarkpricing.go @@ -0,0 +1,40 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +import ( + "github.com/OpenRouterTeam/go-sdk/internal/utils" +) + +// UnifiedBenchmarkPricing - OpenRouter pricing per token for this model. Null if pricing is unavailable. +type UnifiedBenchmarkPricing struct { + // Cost per output token (USD, decimal string). + Completion string `json:"completion"` + // Cost per input token (USD, decimal string). + Prompt string `json:"prompt"` +} + +func (u UnifiedBenchmarkPricing) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(u, "", false) +} + +func (u *UnifiedBenchmarkPricing) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &u, "", false, nil); err != nil { + return err + } + return nil +} + +func (u *UnifiedBenchmarkPricing) GetCompletion() string { + if u == nil { + return "" + } + return u.Completion +} + +func (u *UnifiedBenchmarkPricing) GetPrompt() string { + if u == nil { + return "" + } + return u.Prompt +} diff --git a/models/components/unifiedbenchmarksaaitem.go b/models/components/unifiedbenchmarksaaitem.go new file mode 100644 index 00000000..5dd1dbc4 --- /dev/null +++ b/models/components/unifiedbenchmarksaaitem.go @@ -0,0 +1,110 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +import ( + "encoding/json" + "fmt" + "github.com/OpenRouterTeam/go-sdk/internal/utils" +) + +// UnifiedBenchmarksAAItemSource - Benchmark source discriminator. +type UnifiedBenchmarksAAItemSource string + +const ( + UnifiedBenchmarksAAItemSourceArtificialAnalysis UnifiedBenchmarksAAItemSource = "artificial-analysis" +) + +func (e UnifiedBenchmarksAAItemSource) ToPointer() *UnifiedBenchmarksAAItemSource { + return &e +} +func (e *UnifiedBenchmarksAAItemSource) UnmarshalJSON(data []byte) error { + var v string + if err := json.Unmarshal(data, &v); err != nil { + return err + } + switch v { + case "artificial-analysis": + *e = UnifiedBenchmarksAAItemSource(v) + return nil + default: + return fmt.Errorf("invalid value for UnifiedBenchmarksAAItemSource: %v", v) + } +} + +type UnifiedBenchmarksAAItem struct { + // Artificial Analysis Agentic Index composite score. Higher is better. + AgenticIndex *float64 `json:"agentic_index"` + // Artificial Analysis Coding Index composite score. Higher is better. + CodingIndex *float64 `json:"coding_index"` + // Model name as listed on Artificial Analysis. + DisplayName string `json:"display_name"` + // Artificial Analysis Intelligence Index composite score. Higher is better. + IntelligenceIndex *float64 `json:"intelligence_index"` + // Stable OpenRouter model identifier. + ModelPermaslug string `json:"model_permaslug"` + // OpenRouter pricing per token for this model. Null if pricing is unavailable. + Pricing *UnifiedBenchmarkPricing `json:"pricing"` + // Benchmark source discriminator. + Source UnifiedBenchmarksAAItemSource `json:"source"` +} + +func (u UnifiedBenchmarksAAItem) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(u, "", false) +} + +func (u *UnifiedBenchmarksAAItem) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &u, "", false, nil); err != nil { + return err + } + return nil +} + +func (u *UnifiedBenchmarksAAItem) GetAgenticIndex() *float64 { + if u == nil { + return nil + } + return u.AgenticIndex +} + +func (u *UnifiedBenchmarksAAItem) GetCodingIndex() *float64 { + if u == nil { + return nil + } + return u.CodingIndex +} + +func (u *UnifiedBenchmarksAAItem) GetDisplayName() string { + if u == nil { + return "" + } + return u.DisplayName +} + +func (u *UnifiedBenchmarksAAItem) GetIntelligenceIndex() *float64 { + if u == nil { + return nil + } + return u.IntelligenceIndex +} + +func (u *UnifiedBenchmarksAAItem) GetModelPermaslug() string { + if u == nil { + return "" + } + return u.ModelPermaslug +} + +func (u *UnifiedBenchmarksAAItem) GetPricing() *UnifiedBenchmarkPricing { + if u == nil { + return nil + } + return u.Pricing +} + +func (u *UnifiedBenchmarksAAItem) GetSource() UnifiedBenchmarksAAItemSource { + if u == nil { + return UnifiedBenchmarksAAItemSource("") + } + return u.Source +} diff --git a/models/components/unifiedbenchmarksdaitem.go b/models/components/unifiedbenchmarksdaitem.go new file mode 100644 index 00000000..73002bfe --- /dev/null +++ b/models/components/unifiedbenchmarksdaitem.go @@ -0,0 +1,192 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +import ( + "encoding/json" + "fmt" + "github.com/OpenRouterTeam/go-sdk/internal/utils" +) + +// UnifiedBenchmarksDAItemSource - Benchmark source discriminator. +type UnifiedBenchmarksDAItemSource string + +const ( + UnifiedBenchmarksDAItemSourceDesignArena UnifiedBenchmarksDAItemSource = "design-arena" +) + +func (e UnifiedBenchmarksDAItemSource) ToPointer() *UnifiedBenchmarksDAItemSource { + return &e +} +func (e *UnifiedBenchmarksDAItemSource) UnmarshalJSON(data []byte) error { + var v string + if err := json.Unmarshal(data, &v); err != nil { + return err + } + switch v { + case "design-arena": + *e = UnifiedBenchmarksDAItemSource(v) + return nil + default: + return fmt.Errorf("invalid value for UnifiedBenchmarksDAItemSource: %v", v) + } +} + +// TournamentStats - Placement distribution from tournament matches. +type TournamentStats struct { + FirstPlace *int64 `json:"first_place"` + FourthPlace *int64 `json:"fourth_place"` + SecondPlace *int64 `json:"second_place"` + ThirdPlace *int64 `json:"third_place"` + Total *int64 `json:"total"` +} + +func (t TournamentStats) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(t, "", false) +} + +func (t *TournamentStats) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &t, "", false, nil); err != nil { + return err + } + return nil +} + +func (t *TournamentStats) GetFirstPlace() *int64 { + if t == nil { + return nil + } + return t.FirstPlace +} + +func (t *TournamentStats) GetFourthPlace() *int64 { + if t == nil { + return nil + } + return t.FourthPlace +} + +func (t *TournamentStats) GetSecondPlace() *int64 { + if t == nil { + return nil + } + return t.SecondPlace +} + +func (t *TournamentStats) GetThirdPlace() *int64 { + if t == nil { + return nil + } + return t.ThirdPlace +} + +func (t *TournamentStats) GetTotal() *int64 { + if t == nil { + return nil + } + return t.Total +} + +type UnifiedBenchmarksDAItem struct { + // Arena this ranking belongs to. + Arena string `json:"arena"` + // Average generation time in milliseconds. + AvgGenerationTimeMs *float64 `json:"avg_generation_time_ms"` + // Category within the arena. + Category string `json:"category"` + // Human-readable model name from Design Arena. + DisplayName string `json:"display_name"` + // ELO rating from head-to-head arena battles. + Elo float64 `json:"elo"` + // Stable OpenRouter model identifier when mapped; otherwise the upstream Design Arena model id. + ModelPermaslug string `json:"model_permaslug"` + // OpenRouter pricing per token for this model. Null if pricing is unavailable. + Pricing *UnifiedBenchmarkPricing `json:"pricing"` + // Benchmark source discriminator. + Source UnifiedBenchmarksDAItemSource `json:"source"` + // Placement distribution from tournament matches. + TournamentStats TournamentStats `json:"tournament_stats"` + // Win rate as a percentage (0–100). + WinRate float64 `json:"win_rate"` +} + +func (u UnifiedBenchmarksDAItem) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(u, "", false) +} + +func (u *UnifiedBenchmarksDAItem) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &u, "", false, nil); err != nil { + return err + } + return nil +} + +func (u *UnifiedBenchmarksDAItem) GetArena() string { + if u == nil { + return "" + } + return u.Arena +} + +func (u *UnifiedBenchmarksDAItem) GetAvgGenerationTimeMs() *float64 { + if u == nil { + return nil + } + return u.AvgGenerationTimeMs +} + +func (u *UnifiedBenchmarksDAItem) GetCategory() string { + if u == nil { + return "" + } + return u.Category +} + +func (u *UnifiedBenchmarksDAItem) GetDisplayName() string { + if u == nil { + return "" + } + return u.DisplayName +} + +func (u *UnifiedBenchmarksDAItem) GetElo() float64 { + if u == nil { + return 0.0 + } + return u.Elo +} + +func (u *UnifiedBenchmarksDAItem) GetModelPermaslug() string { + if u == nil { + return "" + } + return u.ModelPermaslug +} + +func (u *UnifiedBenchmarksDAItem) GetPricing() *UnifiedBenchmarkPricing { + if u == nil { + return nil + } + return u.Pricing +} + +func (u *UnifiedBenchmarksDAItem) GetSource() UnifiedBenchmarksDAItemSource { + if u == nil { + return UnifiedBenchmarksDAItemSource("") + } + return u.Source +} + +func (u *UnifiedBenchmarksDAItem) GetTournamentStats() TournamentStats { + if u == nil { + return TournamentStats{} + } + return u.TournamentStats +} + +func (u *UnifiedBenchmarksDAItem) GetWinRate() float64 { + if u == nil { + return 0.0 + } + return u.WinRate +} diff --git a/models/components/unifiedbenchmarksmeta.go b/models/components/unifiedbenchmarksmeta.go new file mode 100644 index 00000000..787b200e --- /dev/null +++ b/models/components/unifiedbenchmarksmeta.go @@ -0,0 +1,121 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +import ( + "encoding/json" + "fmt" +) + +// UnifiedBenchmarksMetaSource - The source filter applied, or null when all sources are returned. +type UnifiedBenchmarksMetaSource string + +const ( + UnifiedBenchmarksMetaSourceArtificialAnalysis UnifiedBenchmarksMetaSource = "artificial-analysis" + UnifiedBenchmarksMetaSourceDesignArena UnifiedBenchmarksMetaSource = "design-arena" +) + +func (e UnifiedBenchmarksMetaSource) ToPointer() *UnifiedBenchmarksMetaSource { + return &e +} + +// IsExact returns true if the value matches a known enum value, false otherwise. +func (e *UnifiedBenchmarksMetaSource) IsExact() bool { + if e != nil { + switch *e { + case "artificial-analysis", "design-arena": + return true + } + } + return false +} + +// UnifiedBenchmarksMetaVersion - Dataset version. +type UnifiedBenchmarksMetaVersion string + +const ( + UnifiedBenchmarksMetaVersionV1 UnifiedBenchmarksMetaVersion = "v1" +) + +func (e UnifiedBenchmarksMetaVersion) ToPointer() *UnifiedBenchmarksMetaVersion { + return &e +} +func (e *UnifiedBenchmarksMetaVersion) UnmarshalJSON(data []byte) error { + var v string + if err := json.Unmarshal(data, &v); err != nil { + return err + } + switch v { + case "v1": + *e = UnifiedBenchmarksMetaVersion(v) + return nil + default: + return fmt.Errorf("invalid value for UnifiedBenchmarksMetaVersion: %v", v) + } +} + +type UnifiedBenchmarksMeta struct { + // ISO-8601 timestamp of when this data was last updated. + AsOf string `json:"as_of"` + // Required attribution when republishing this data, or null when results span multiple sources (attribute each item individually by its `source` discriminator). + Citation *string `json:"citation"` + // Number of unique models in the response. + ModelCount int64 `json:"model_count"` + // The source filter applied, or null when all sources are returned. + Source *UnifiedBenchmarksMetaSource `json:"source"` + // URL of the upstream data source, or null when results span multiple sources. + SourceURL *string `json:"source_url"` + // The task_type filter applied, or null if showing all. + TaskType *string `json:"task_type"` + // Dataset version. + Version UnifiedBenchmarksMetaVersion `json:"version"` +} + +func (u *UnifiedBenchmarksMeta) GetAsOf() string { + if u == nil { + return "" + } + return u.AsOf +} + +func (u *UnifiedBenchmarksMeta) GetCitation() *string { + if u == nil { + return nil + } + return u.Citation +} + +func (u *UnifiedBenchmarksMeta) GetModelCount() int64 { + if u == nil { + return 0 + } + return u.ModelCount +} + +func (u *UnifiedBenchmarksMeta) GetSource() *UnifiedBenchmarksMetaSource { + if u == nil { + return nil + } + return u.Source +} + +func (u *UnifiedBenchmarksMeta) GetSourceURL() *string { + if u == nil { + return nil + } + return u.SourceURL +} + +func (u *UnifiedBenchmarksMeta) GetTaskType() *string { + if u == nil { + return nil + } + return u.TaskType +} + +func (u *UnifiedBenchmarksMeta) GetVersion() UnifiedBenchmarksMetaVersion { + if u == nil { + return UnifiedBenchmarksMetaVersion("") + } + return u.Version +} diff --git a/models/components/unifiedbenchmarksresponse.go b/models/components/unifiedbenchmarksresponse.go new file mode 100644 index 00000000..b851d024 --- /dev/null +++ b/models/components/unifiedbenchmarksresponse.go @@ -0,0 +1,144 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +import ( + "encoding/json" + "errors" + "fmt" + "github.com/OpenRouterTeam/go-sdk/internal/utils" +) + +type UnifiedBenchmarksResponseDataType string + +const ( + UnifiedBenchmarksResponseDataTypeArtificialAnalysis UnifiedBenchmarksResponseDataType = "artificial-analysis" + UnifiedBenchmarksResponseDataTypeDesignArena UnifiedBenchmarksResponseDataType = "design-arena" + UnifiedBenchmarksResponseDataTypeUnknown UnifiedBenchmarksResponseDataType = "UNKNOWN" +) + +type UnifiedBenchmarksResponseData struct { + UnifiedBenchmarksAAItem *UnifiedBenchmarksAAItem `queryParam:"inline" union:"member"` + UnifiedBenchmarksDAItem *UnifiedBenchmarksDAItem `queryParam:"inline" union:"member"` + UnknownRaw json.RawMessage `json:"-" union:"unknown"` + + Type UnifiedBenchmarksResponseDataType +} + +func CreateUnifiedBenchmarksResponseDataArtificialAnalysis(artificialAnalysis UnifiedBenchmarksAAItem) UnifiedBenchmarksResponseData { + typ := UnifiedBenchmarksResponseDataTypeArtificialAnalysis + + typStr := UnifiedBenchmarksAAItemSource(typ) + artificialAnalysis.Source = typStr + + return UnifiedBenchmarksResponseData{ + UnifiedBenchmarksAAItem: &artificialAnalysis, + Type: typ, + } +} + +func CreateUnifiedBenchmarksResponseDataDesignArena(designArena UnifiedBenchmarksDAItem) UnifiedBenchmarksResponseData { + typ := UnifiedBenchmarksResponseDataTypeDesignArena + + typStr := UnifiedBenchmarksDAItemSource(typ) + designArena.Source = typStr + + return UnifiedBenchmarksResponseData{ + UnifiedBenchmarksDAItem: &designArena, + Type: typ, + } +} + +func CreateUnifiedBenchmarksResponseDataUnknown(raw json.RawMessage) UnifiedBenchmarksResponseData { + return UnifiedBenchmarksResponseData{ + UnknownRaw: raw, + Type: UnifiedBenchmarksResponseDataTypeUnknown, + } +} + +func (u UnifiedBenchmarksResponseData) GetUnknownRaw() json.RawMessage { + return u.UnknownRaw +} + +func (u UnifiedBenchmarksResponseData) IsUnknown() bool { + return u.Type == UnifiedBenchmarksResponseDataTypeUnknown +} + +func (u *UnifiedBenchmarksResponseData) UnmarshalJSON(data []byte) error { + + type discriminator struct { + Source string `json:"source"` + } + + dis := new(discriminator) + if err := json.Unmarshal(data, &dis); err != nil { + u.UnknownRaw = json.RawMessage(data) + u.Type = UnifiedBenchmarksResponseDataTypeUnknown + return nil + } + if dis == nil { + u.UnknownRaw = json.RawMessage(data) + u.Type = UnifiedBenchmarksResponseDataTypeUnknown + return nil + } + + switch dis.Source { + case "artificial-analysis": + unifiedBenchmarksAAItem := new(UnifiedBenchmarksAAItem) + if err := utils.UnmarshalJSON(data, &unifiedBenchmarksAAItem, "", true, nil); err != nil { + return fmt.Errorf("could not unmarshal `%s` into expected (Source == artificial-analysis) type UnifiedBenchmarksAAItem within UnifiedBenchmarksResponseData: %w", string(data), err) + } + + u.UnifiedBenchmarksAAItem = unifiedBenchmarksAAItem + u.Type = UnifiedBenchmarksResponseDataTypeArtificialAnalysis + return nil + case "design-arena": + unifiedBenchmarksDAItem := new(UnifiedBenchmarksDAItem) + if err := utils.UnmarshalJSON(data, &unifiedBenchmarksDAItem, "", true, nil); err != nil { + return fmt.Errorf("could not unmarshal `%s` into expected (Source == design-arena) type UnifiedBenchmarksDAItem within UnifiedBenchmarksResponseData: %w", string(data), err) + } + + u.UnifiedBenchmarksDAItem = unifiedBenchmarksDAItem + u.Type = UnifiedBenchmarksResponseDataTypeDesignArena + return nil + default: + u.UnknownRaw = json.RawMessage(data) + u.Type = UnifiedBenchmarksResponseDataTypeUnknown + return nil + } + +} + +func (u UnifiedBenchmarksResponseData) MarshalJSON() ([]byte, error) { + if u.UnifiedBenchmarksAAItem != nil { + return utils.MarshalJSON(u.UnifiedBenchmarksAAItem, "", true) + } + + if u.UnifiedBenchmarksDAItem != nil { + return utils.MarshalJSON(u.UnifiedBenchmarksDAItem, "", true) + } + + if u.UnknownRaw != nil { + return json.RawMessage(u.UnknownRaw), nil + } + return nil, errors.New("could not marshal union type UnifiedBenchmarksResponseData: all fields are null") +} + +type UnifiedBenchmarksResponse struct { + Data []UnifiedBenchmarksResponseData `json:"data"` + Meta UnifiedBenchmarksMeta `json:"meta"` +} + +func (u *UnifiedBenchmarksResponse) GetData() []UnifiedBenchmarksResponseData { + if u == nil { + return []UnifiedBenchmarksResponseData{} + } + return u.Data +} + +func (u *UnifiedBenchmarksResponse) GetMeta() UnifiedBenchmarksMeta { + if u == nil { + return UnifiedBenchmarksMeta{} + } + return u.Meta +} diff --git a/models/components/upsertworkspacebudgetrequest.go b/models/components/upsertworkspacebudgetrequest.go new file mode 100644 index 00000000..92c3fdb7 --- /dev/null +++ b/models/components/upsertworkspacebudgetrequest.go @@ -0,0 +1,15 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +type UpsertWorkspaceBudgetRequest struct { + // Spending limit in USD. Must be greater than 0. + LimitUsd float64 `json:"limit_usd"` +} + +func (u *UpsertWorkspaceBudgetRequest) GetLimitUsd() float64 { + if u == nil { + return 0.0 + } + return u.LimitUsd +} diff --git a/models/components/upsertworkspacebudgetresponse.go b/models/components/upsertworkspacebudgetresponse.go new file mode 100644 index 00000000..b2f0a338 --- /dev/null +++ b/models/components/upsertworkspacebudgetresponse.go @@ -0,0 +1,14 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +type UpsertWorkspaceBudgetResponse struct { + Data WorkspaceBudget `json:"data"` +} + +func (u *UpsertWorkspaceBudgetResponse) GetData() WorkspaceBudget { + if u == nil { + return WorkspaceBudget{} + } + return u.Data +} diff --git a/models/components/videogenerationrequest.go b/models/components/videogenerationrequest.go index a4e976c6..5728f6e9 100644 --- a/models/components/videogenerationrequest.go +++ b/models/components/videogenerationrequest.go @@ -6,27 +6,27 @@ import ( "github.com/OpenRouterTeam/go-sdk/internal/utils" ) -// AspectRatio - Aspect ratio of the generated video -type AspectRatio string +// VideoGenerationRequestAspectRatio - Aspect ratio of the generated video +type VideoGenerationRequestAspectRatio string const ( - AspectRatioOneHundredAndSixtyNine AspectRatio = "16:9" - AspectRatioNineHundredAndSixteen AspectRatio = "9:16" - AspectRatioEleven AspectRatio = "1:1" - AspectRatioFortyThree AspectRatio = "4:3" - AspectRatioThirtyFour AspectRatio = "3:4" - AspectRatioThirtyTwo AspectRatio = "3:2" - AspectRatioTwentyThree AspectRatio = "2:3" - AspectRatioTwoHundredAndNineteen AspectRatio = "21:9" - AspectRatioNineHundredAndTwentyOne AspectRatio = "9:21" + VideoGenerationRequestAspectRatioOneHundredAndSixtyNine VideoGenerationRequestAspectRatio = "16:9" + VideoGenerationRequestAspectRatioNineHundredAndSixteen VideoGenerationRequestAspectRatio = "9:16" + VideoGenerationRequestAspectRatioEleven VideoGenerationRequestAspectRatio = "1:1" + VideoGenerationRequestAspectRatioFortyThree VideoGenerationRequestAspectRatio = "4:3" + VideoGenerationRequestAspectRatioThirtyFour VideoGenerationRequestAspectRatio = "3:4" + VideoGenerationRequestAspectRatioThirtyTwo VideoGenerationRequestAspectRatio = "3:2" + VideoGenerationRequestAspectRatioTwentyThree VideoGenerationRequestAspectRatio = "2:3" + VideoGenerationRequestAspectRatioTwoHundredAndNineteen VideoGenerationRequestAspectRatio = "21:9" + VideoGenerationRequestAspectRatioNineHundredAndTwentyOne VideoGenerationRequestAspectRatio = "9:21" ) -func (e AspectRatio) ToPointer() *AspectRatio { +func (e VideoGenerationRequestAspectRatio) ToPointer() *VideoGenerationRequestAspectRatio { return &e } // IsExact returns true if the value matches a known enum value, false otherwise. -func (e *AspectRatio) IsExact() bool { +func (e *VideoGenerationRequestAspectRatio) IsExact() bool { if e != nil { switch *e { case "16:9", "9:16", "1:1", "4:3", "3:4", "3:2", "2:3", "21:9", "9:21": @@ -36,8 +36,8 @@ func (e *AspectRatio) IsExact() bool { return false } -// OptionsObj - Provider-specific options keyed by provider slug. The options for the matched provider are spread into the upstream request body. -type OptionsObj struct { +// VideoGenerationRequestOptions - Provider-specific options keyed by provider slug. Only options for the matched provider are forwarded; the rest are ignored. Unrecognized keys are silently dropped. +type VideoGenerationRequestOptions struct { Oneai map[string]any `json:"01ai,omitzero"` Ai21 map[string]any `json:"ai21,omitzero"` AionLabs map[string]any `json:"aion-labs,omitzero"` @@ -143,6 +143,7 @@ type OptionsObj struct { Streamlake map[string]any `json:"streamlake,omitzero"` Switchpoint map[string]any `json:"switchpoint,omitzero"` Targon map[string]any `json:"targon,omitzero"` + Tenstorrent map[string]any `json:"tenstorrent,omitzero"` Together map[string]any `json:"together,omitzero"` TogetherLite map[string]any `json:"together-lite,omitzero"` Ubicloud map[string]any `json:"ubicloud,omitzero"` @@ -155,825 +156,832 @@ type OptionsObj struct { ZAi map[string]any `json:"z-ai,omitzero"` } -func (o OptionsObj) MarshalJSON() ([]byte, error) { - return utils.MarshalJSON(o, "", false) +func (v VideoGenerationRequestOptions) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(v, "", false) } -func (o *OptionsObj) UnmarshalJSON(data []byte) error { - if err := utils.UnmarshalJSON(data, &o, "", false, nil); err != nil { +func (v *VideoGenerationRequestOptions) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &v, "", false, nil); err != nil { return err } return nil } -func (o *OptionsObj) GetOneai() map[string]any { - if o == nil { +func (v *VideoGenerationRequestOptions) GetOneai() map[string]any { + if v == nil { return nil } - return o.Oneai + return v.Oneai } -func (o *OptionsObj) GetAi21() map[string]any { - if o == nil { +func (v *VideoGenerationRequestOptions) GetAi21() map[string]any { + if v == nil { return nil } - return o.Ai21 + return v.Ai21 } -func (o *OptionsObj) GetAionLabs() map[string]any { - if o == nil { +func (v *VideoGenerationRequestOptions) GetAionLabs() map[string]any { + if v == nil { return nil } - return o.AionLabs + return v.AionLabs } -func (o *OptionsObj) GetAkashml() map[string]any { - if o == nil { +func (v *VideoGenerationRequestOptions) GetAkashml() map[string]any { + if v == nil { return nil } - return o.Akashml + return v.Akashml } -func (o *OptionsObj) GetAlibaba() map[string]any { - if o == nil { +func (v *VideoGenerationRequestOptions) GetAlibaba() map[string]any { + if v == nil { return nil } - return o.Alibaba + return v.Alibaba } -func (o *OptionsObj) GetAmazonBedrock() map[string]any { - if o == nil { +func (v *VideoGenerationRequestOptions) GetAmazonBedrock() map[string]any { + if v == nil { return nil } - return o.AmazonBedrock + return v.AmazonBedrock } -func (o *OptionsObj) GetAmazonNova() map[string]any { - if o == nil { +func (v *VideoGenerationRequestOptions) GetAmazonNova() map[string]any { + if v == nil { return nil } - return o.AmazonNova + return v.AmazonNova } -func (o *OptionsObj) GetAmbient() map[string]any { - if o == nil { +func (v *VideoGenerationRequestOptions) GetAmbient() map[string]any { + if v == nil { return nil } - return o.Ambient + return v.Ambient } -func (o *OptionsObj) GetAnthropic() map[string]any { - if o == nil { +func (v *VideoGenerationRequestOptions) GetAnthropic() map[string]any { + if v == nil { return nil } - return o.Anthropic + return v.Anthropic } -func (o *OptionsObj) GetAnyscale() map[string]any { - if o == nil { +func (v *VideoGenerationRequestOptions) GetAnyscale() map[string]any { + if v == nil { return nil } - return o.Anyscale + return v.Anyscale } -func (o *OptionsObj) GetArceeAi() map[string]any { - if o == nil { +func (v *VideoGenerationRequestOptions) GetArceeAi() map[string]any { + if v == nil { return nil } - return o.ArceeAi + return v.ArceeAi } -func (o *OptionsObj) GetAtlasCloud() map[string]any { - if o == nil { +func (v *VideoGenerationRequestOptions) GetAtlasCloud() map[string]any { + if v == nil { return nil } - return o.AtlasCloud + return v.AtlasCloud } -func (o *OptionsObj) GetAtoma() map[string]any { - if o == nil { +func (v *VideoGenerationRequestOptions) GetAtoma() map[string]any { + if v == nil { return nil } - return o.Atoma + return v.Atoma } -func (o *OptionsObj) GetAvian() map[string]any { - if o == nil { +func (v *VideoGenerationRequestOptions) GetAvian() map[string]any { + if v == nil { return nil } - return o.Avian + return v.Avian } -func (o *OptionsObj) GetAzure() map[string]any { - if o == nil { +func (v *VideoGenerationRequestOptions) GetAzure() map[string]any { + if v == nil { return nil } - return o.Azure + return v.Azure } -func (o *OptionsObj) GetBaidu() map[string]any { - if o == nil { +func (v *VideoGenerationRequestOptions) GetBaidu() map[string]any { + if v == nil { return nil } - return o.Baidu + return v.Baidu } -func (o *OptionsObj) GetBaseten() map[string]any { - if o == nil { +func (v *VideoGenerationRequestOptions) GetBaseten() map[string]any { + if v == nil { return nil } - return o.Baseten + return v.Baseten } -func (o *OptionsObj) GetBlackForestLabs() map[string]any { - if o == nil { +func (v *VideoGenerationRequestOptions) GetBlackForestLabs() map[string]any { + if v == nil { return nil } - return o.BlackForestLabs + return v.BlackForestLabs } -func (o *OptionsObj) GetByteplus() map[string]any { - if o == nil { +func (v *VideoGenerationRequestOptions) GetByteplus() map[string]any { + if v == nil { return nil } - return o.Byteplus + return v.Byteplus } -func (o *OptionsObj) GetCentml() map[string]any { - if o == nil { +func (v *VideoGenerationRequestOptions) GetCentml() map[string]any { + if v == nil { return nil } - return o.Centml + return v.Centml } -func (o *OptionsObj) GetCerebras() map[string]any { - if o == nil { +func (v *VideoGenerationRequestOptions) GetCerebras() map[string]any { + if v == nil { return nil } - return o.Cerebras + return v.Cerebras } -func (o *OptionsObj) GetChutes() map[string]any { - if o == nil { +func (v *VideoGenerationRequestOptions) GetChutes() map[string]any { + if v == nil { return nil } - return o.Chutes + return v.Chutes } -func (o *OptionsObj) GetCirrascale() map[string]any { - if o == nil { +func (v *VideoGenerationRequestOptions) GetCirrascale() map[string]any { + if v == nil { return nil } - return o.Cirrascale + return v.Cirrascale } -func (o *OptionsObj) GetClarifai() map[string]any { - if o == nil { +func (v *VideoGenerationRequestOptions) GetClarifai() map[string]any { + if v == nil { return nil } - return o.Clarifai + return v.Clarifai } -func (o *OptionsObj) GetCloudflare() map[string]any { - if o == nil { +func (v *VideoGenerationRequestOptions) GetCloudflare() map[string]any { + if v == nil { return nil } - return o.Cloudflare + return v.Cloudflare } -func (o *OptionsObj) GetCohere() map[string]any { - if o == nil { +func (v *VideoGenerationRequestOptions) GetCohere() map[string]any { + if v == nil { return nil } - return o.Cohere + return v.Cohere } -func (o *OptionsObj) GetCrofai() map[string]any { - if o == nil { +func (v *VideoGenerationRequestOptions) GetCrofai() map[string]any { + if v == nil { return nil } - return o.Crofai + return v.Crofai } -func (o *OptionsObj) GetCrucible() map[string]any { - if o == nil { +func (v *VideoGenerationRequestOptions) GetCrucible() map[string]any { + if v == nil { return nil } - return o.Crucible + return v.Crucible } -func (o *OptionsObj) GetCrusoe() map[string]any { - if o == nil { +func (v *VideoGenerationRequestOptions) GetCrusoe() map[string]any { + if v == nil { return nil } - return o.Crusoe + return v.Crusoe } -func (o *OptionsObj) GetDarkbloom() map[string]any { - if o == nil { +func (v *VideoGenerationRequestOptions) GetDarkbloom() map[string]any { + if v == nil { return nil } - return o.Darkbloom + return v.Darkbloom } -func (o *OptionsObj) GetDecart() map[string]any { - if o == nil { +func (v *VideoGenerationRequestOptions) GetDecart() map[string]any { + if v == nil { return nil } - return o.Decart + return v.Decart } -func (o *OptionsObj) GetDeepinfra() map[string]any { - if o == nil { +func (v *VideoGenerationRequestOptions) GetDeepinfra() map[string]any { + if v == nil { return nil } - return o.Deepinfra + return v.Deepinfra } -func (o *OptionsObj) GetDeepseek() map[string]any { - if o == nil { +func (v *VideoGenerationRequestOptions) GetDeepseek() map[string]any { + if v == nil { return nil } - return o.Deepseek + return v.Deepseek } -func (o *OptionsObj) GetDekallm() map[string]any { - if o == nil { +func (v *VideoGenerationRequestOptions) GetDekallm() map[string]any { + if v == nil { return nil } - return o.Dekallm + return v.Dekallm } -func (o *OptionsObj) GetDigitalocean() map[string]any { - if o == nil { +func (v *VideoGenerationRequestOptions) GetDigitalocean() map[string]any { + if v == nil { return nil } - return o.Digitalocean + return v.Digitalocean } -func (o *OptionsObj) GetEnfer() map[string]any { - if o == nil { +func (v *VideoGenerationRequestOptions) GetEnfer() map[string]any { + if v == nil { return nil } - return o.Enfer + return v.Enfer } -func (o *OptionsObj) GetFakeProvider() map[string]any { - if o == nil { +func (v *VideoGenerationRequestOptions) GetFakeProvider() map[string]any { + if v == nil { return nil } - return o.FakeProvider + return v.FakeProvider } -func (o *OptionsObj) GetFeatherless() map[string]any { - if o == nil { +func (v *VideoGenerationRequestOptions) GetFeatherless() map[string]any { + if v == nil { return nil } - return o.Featherless + return v.Featherless } -func (o *OptionsObj) GetFireworks() map[string]any { - if o == nil { +func (v *VideoGenerationRequestOptions) GetFireworks() map[string]any { + if v == nil { return nil } - return o.Fireworks + return v.Fireworks } -func (o *OptionsObj) GetFriendli() map[string]any { - if o == nil { +func (v *VideoGenerationRequestOptions) GetFriendli() map[string]any { + if v == nil { return nil } - return o.Friendli + return v.Friendli } -func (o *OptionsObj) GetGmicloud() map[string]any { - if o == nil { +func (v *VideoGenerationRequestOptions) GetGmicloud() map[string]any { + if v == nil { return nil } - return o.Gmicloud + return v.Gmicloud } -func (o *OptionsObj) GetGoogleAiStudio() map[string]any { - if o == nil { +func (v *VideoGenerationRequestOptions) GetGoogleAiStudio() map[string]any { + if v == nil { return nil } - return o.GoogleAiStudio + return v.GoogleAiStudio } -func (o *OptionsObj) GetGoogleVertex() map[string]any { - if o == nil { +func (v *VideoGenerationRequestOptions) GetGoogleVertex() map[string]any { + if v == nil { return nil } - return o.GoogleVertex + return v.GoogleVertex } -func (o *OptionsObj) GetGopomelo() map[string]any { - if o == nil { +func (v *VideoGenerationRequestOptions) GetGopomelo() map[string]any { + if v == nil { return nil } - return o.Gopomelo + return v.Gopomelo } -func (o *OptionsObj) GetGroq() map[string]any { - if o == nil { +func (v *VideoGenerationRequestOptions) GetGroq() map[string]any { + if v == nil { return nil } - return o.Groq + return v.Groq } -func (o *OptionsObj) GetHuggingface() map[string]any { - if o == nil { +func (v *VideoGenerationRequestOptions) GetHuggingface() map[string]any { + if v == nil { return nil } - return o.Huggingface + return v.Huggingface } -func (o *OptionsObj) GetHyperbolic() map[string]any { - if o == nil { +func (v *VideoGenerationRequestOptions) GetHyperbolic() map[string]any { + if v == nil { return nil } - return o.Hyperbolic + return v.Hyperbolic } -func (o *OptionsObj) GetHyperbolicQuantized() map[string]any { - if o == nil { +func (v *VideoGenerationRequestOptions) GetHyperbolicQuantized() map[string]any { + if v == nil { return nil } - return o.HyperbolicQuantized + return v.HyperbolicQuantized } -func (o *OptionsObj) GetInception() map[string]any { - if o == nil { +func (v *VideoGenerationRequestOptions) GetInception() map[string]any { + if v == nil { return nil } - return o.Inception + return v.Inception } -func (o *OptionsObj) GetInceptron() map[string]any { - if o == nil { +func (v *VideoGenerationRequestOptions) GetInceptron() map[string]any { + if v == nil { return nil } - return o.Inceptron + return v.Inceptron } -func (o *OptionsObj) GetInferenceNet() map[string]any { - if o == nil { +func (v *VideoGenerationRequestOptions) GetInferenceNet() map[string]any { + if v == nil { return nil } - return o.InferenceNet + return v.InferenceNet } -func (o *OptionsObj) GetInfermatic() map[string]any { - if o == nil { +func (v *VideoGenerationRequestOptions) GetInfermatic() map[string]any { + if v == nil { return nil } - return o.Infermatic + return v.Infermatic } -func (o *OptionsObj) GetInflection() map[string]any { - if o == nil { +func (v *VideoGenerationRequestOptions) GetInflection() map[string]any { + if v == nil { return nil } - return o.Inflection + return v.Inflection } -func (o *OptionsObj) GetInocloud() map[string]any { - if o == nil { +func (v *VideoGenerationRequestOptions) GetInocloud() map[string]any { + if v == nil { return nil } - return o.Inocloud + return v.Inocloud } -func (o *OptionsObj) GetIoNet() map[string]any { - if o == nil { +func (v *VideoGenerationRequestOptions) GetIoNet() map[string]any { + if v == nil { return nil } - return o.IoNet + return v.IoNet } -func (o *OptionsObj) GetIonstream() map[string]any { - if o == nil { +func (v *VideoGenerationRequestOptions) GetIonstream() map[string]any { + if v == nil { return nil } - return o.Ionstream + return v.Ionstream } -func (o *OptionsObj) GetKlusterai() map[string]any { - if o == nil { +func (v *VideoGenerationRequestOptions) GetKlusterai() map[string]any { + if v == nil { return nil } - return o.Klusterai + return v.Klusterai } -func (o *OptionsObj) GetLambda() map[string]any { - if o == nil { +func (v *VideoGenerationRequestOptions) GetLambda() map[string]any { + if v == nil { return nil } - return o.Lambda + return v.Lambda } -func (o *OptionsObj) GetLepton() map[string]any { - if o == nil { +func (v *VideoGenerationRequestOptions) GetLepton() map[string]any { + if v == nil { return nil } - return o.Lepton + return v.Lepton } -func (o *OptionsObj) GetLiquid() map[string]any { - if o == nil { +func (v *VideoGenerationRequestOptions) GetLiquid() map[string]any { + if v == nil { return nil } - return o.Liquid + return v.Liquid } -func (o *OptionsObj) GetLynn() map[string]any { - if o == nil { +func (v *VideoGenerationRequestOptions) GetLynn() map[string]any { + if v == nil { return nil } - return o.Lynn + return v.Lynn } -func (o *OptionsObj) GetLynnPrivate() map[string]any { - if o == nil { +func (v *VideoGenerationRequestOptions) GetLynnPrivate() map[string]any { + if v == nil { return nil } - return o.LynnPrivate + return v.LynnPrivate } -func (o *OptionsObj) GetMancer() map[string]any { - if o == nil { +func (v *VideoGenerationRequestOptions) GetMancer() map[string]any { + if v == nil { return nil } - return o.Mancer + return v.Mancer } -func (o *OptionsObj) GetMancerOld() map[string]any { - if o == nil { +func (v *VideoGenerationRequestOptions) GetMancerOld() map[string]any { + if v == nil { return nil } - return o.MancerOld + return v.MancerOld } -func (o *OptionsObj) GetMara() map[string]any { - if o == nil { +func (v *VideoGenerationRequestOptions) GetMara() map[string]any { + if v == nil { return nil } - return o.Mara + return v.Mara } -func (o *OptionsObj) GetMeta() map[string]any { - if o == nil { +func (v *VideoGenerationRequestOptions) GetMeta() map[string]any { + if v == nil { return nil } - return o.Meta + return v.Meta } -func (o *OptionsObj) GetMinimax() map[string]any { - if o == nil { +func (v *VideoGenerationRequestOptions) GetMinimax() map[string]any { + if v == nil { return nil } - return o.Minimax + return v.Minimax } -func (o *OptionsObj) GetMistral() map[string]any { - if o == nil { +func (v *VideoGenerationRequestOptions) GetMistral() map[string]any { + if v == nil { return nil } - return o.Mistral + return v.Mistral } -func (o *OptionsObj) GetModal() map[string]any { - if o == nil { +func (v *VideoGenerationRequestOptions) GetModal() map[string]any { + if v == nil { return nil } - return o.Modal + return v.Modal } -func (o *OptionsObj) GetModelrun() map[string]any { - if o == nil { +func (v *VideoGenerationRequestOptions) GetModelrun() map[string]any { + if v == nil { return nil } - return o.Modelrun + return v.Modelrun } -func (o *OptionsObj) GetModular() map[string]any { - if o == nil { +func (v *VideoGenerationRequestOptions) GetModular() map[string]any { + if v == nil { return nil } - return o.Modular + return v.Modular } -func (o *OptionsObj) GetMoonshotai() map[string]any { - if o == nil { +func (v *VideoGenerationRequestOptions) GetMoonshotai() map[string]any { + if v == nil { return nil } - return o.Moonshotai + return v.Moonshotai } -func (o *OptionsObj) GetMorph() map[string]any { - if o == nil { +func (v *VideoGenerationRequestOptions) GetMorph() map[string]any { + if v == nil { return nil } - return o.Morph + return v.Morph } -func (o *OptionsObj) GetNcompass() map[string]any { - if o == nil { +func (v *VideoGenerationRequestOptions) GetNcompass() map[string]any { + if v == nil { return nil } - return o.Ncompass + return v.Ncompass } -func (o *OptionsObj) GetNebius() map[string]any { - if o == nil { +func (v *VideoGenerationRequestOptions) GetNebius() map[string]any { + if v == nil { return nil } - return o.Nebius + return v.Nebius } -func (o *OptionsObj) GetNexAgi() map[string]any { - if o == nil { +func (v *VideoGenerationRequestOptions) GetNexAgi() map[string]any { + if v == nil { return nil } - return o.NexAgi + return v.NexAgi } -func (o *OptionsObj) GetNextbit() map[string]any { - if o == nil { +func (v *VideoGenerationRequestOptions) GetNextbit() map[string]any { + if v == nil { return nil } - return o.Nextbit + return v.Nextbit } -func (o *OptionsObj) GetNineteen() map[string]any { - if o == nil { +func (v *VideoGenerationRequestOptions) GetNineteen() map[string]any { + if v == nil { return nil } - return o.Nineteen + return v.Nineteen } -func (o *OptionsObj) GetNovita() map[string]any { - if o == nil { +func (v *VideoGenerationRequestOptions) GetNovita() map[string]any { + if v == nil { return nil } - return o.Novita + return v.Novita } -func (o *OptionsObj) GetNvidia() map[string]any { - if o == nil { +func (v *VideoGenerationRequestOptions) GetNvidia() map[string]any { + if v == nil { return nil } - return o.Nvidia + return v.Nvidia } -func (o *OptionsObj) GetOctoai() map[string]any { - if o == nil { +func (v *VideoGenerationRequestOptions) GetOctoai() map[string]any { + if v == nil { return nil } - return o.Octoai + return v.Octoai } -func (o *OptionsObj) GetOpenInference() map[string]any { - if o == nil { +func (v *VideoGenerationRequestOptions) GetOpenInference() map[string]any { + if v == nil { return nil } - return o.OpenInference + return v.OpenInference } -func (o *OptionsObj) GetOpenai() map[string]any { - if o == nil { +func (v *VideoGenerationRequestOptions) GetOpenai() map[string]any { + if v == nil { return nil } - return o.Openai + return v.Openai } -func (o *OptionsObj) GetParasail() map[string]any { - if o == nil { +func (v *VideoGenerationRequestOptions) GetParasail() map[string]any { + if v == nil { return nil } - return o.Parasail + return v.Parasail } -func (o *OptionsObj) GetPerceptron() map[string]any { - if o == nil { +func (v *VideoGenerationRequestOptions) GetPerceptron() map[string]any { + if v == nil { return nil } - return o.Perceptron + return v.Perceptron } -func (o *OptionsObj) GetPerplexity() map[string]any { - if o == nil { +func (v *VideoGenerationRequestOptions) GetPerplexity() map[string]any { + if v == nil { return nil } - return o.Perplexity + return v.Perplexity } -func (o *OptionsObj) GetPhala() map[string]any { - if o == nil { +func (v *VideoGenerationRequestOptions) GetPhala() map[string]any { + if v == nil { return nil } - return o.Phala + return v.Phala } -func (o *OptionsObj) GetPoolside() map[string]any { - if o == nil { +func (v *VideoGenerationRequestOptions) GetPoolside() map[string]any { + if v == nil { return nil } - return o.Poolside + return v.Poolside } -func (o *OptionsObj) GetRecraft() map[string]any { - if o == nil { +func (v *VideoGenerationRequestOptions) GetRecraft() map[string]any { + if v == nil { return nil } - return o.Recraft + return v.Recraft } -func (o *OptionsObj) GetRecursal() map[string]any { - if o == nil { +func (v *VideoGenerationRequestOptions) GetRecursal() map[string]any { + if v == nil { return nil } - return o.Recursal + return v.Recursal } -func (o *OptionsObj) GetReflection() map[string]any { - if o == nil { +func (v *VideoGenerationRequestOptions) GetReflection() map[string]any { + if v == nil { return nil } - return o.Reflection + return v.Reflection } -func (o *OptionsObj) GetReka() map[string]any { - if o == nil { +func (v *VideoGenerationRequestOptions) GetReka() map[string]any { + if v == nil { return nil } - return o.Reka + return v.Reka } -func (o *OptionsObj) GetRelace() map[string]any { - if o == nil { +func (v *VideoGenerationRequestOptions) GetRelace() map[string]any { + if v == nil { return nil } - return o.Relace + return v.Relace } -func (o *OptionsObj) GetReplicate() map[string]any { - if o == nil { +func (v *VideoGenerationRequestOptions) GetReplicate() map[string]any { + if v == nil { return nil } - return o.Replicate + return v.Replicate } -func (o *OptionsObj) GetSambanova() map[string]any { - if o == nil { +func (v *VideoGenerationRequestOptions) GetSambanova() map[string]any { + if v == nil { return nil } - return o.Sambanova + return v.Sambanova } -func (o *OptionsObj) GetSambanovaCloaked() map[string]any { - if o == nil { +func (v *VideoGenerationRequestOptions) GetSambanovaCloaked() map[string]any { + if v == nil { return nil } - return o.SambanovaCloaked + return v.SambanovaCloaked } -func (o *OptionsObj) GetSeed() map[string]any { - if o == nil { +func (v *VideoGenerationRequestOptions) GetSeed() map[string]any { + if v == nil { return nil } - return o.Seed + return v.Seed } -func (o *OptionsObj) GetSfCompute() map[string]any { - if o == nil { +func (v *VideoGenerationRequestOptions) GetSfCompute() map[string]any { + if v == nil { return nil } - return o.SfCompute + return v.SfCompute } -func (o *OptionsObj) GetSiliconflow() map[string]any { - if o == nil { +func (v *VideoGenerationRequestOptions) GetSiliconflow() map[string]any { + if v == nil { return nil } - return o.Siliconflow + return v.Siliconflow } -func (o *OptionsObj) GetSourceful() map[string]any { - if o == nil { +func (v *VideoGenerationRequestOptions) GetSourceful() map[string]any { + if v == nil { + return nil + } + return v.Sourceful +} + +func (v *VideoGenerationRequestOptions) GetStealth() map[string]any { + if v == nil { return nil } - return o.Sourceful + return v.Stealth } -func (o *OptionsObj) GetStealth() map[string]any { - if o == nil { +func (v *VideoGenerationRequestOptions) GetStepfun() map[string]any { + if v == nil { return nil } - return o.Stealth + return v.Stepfun } -func (o *OptionsObj) GetStepfun() map[string]any { - if o == nil { +func (v *VideoGenerationRequestOptions) GetStreamlake() map[string]any { + if v == nil { return nil } - return o.Stepfun + return v.Streamlake } -func (o *OptionsObj) GetStreamlake() map[string]any { - if o == nil { +func (v *VideoGenerationRequestOptions) GetSwitchpoint() map[string]any { + if v == nil { return nil } - return o.Streamlake + return v.Switchpoint } -func (o *OptionsObj) GetSwitchpoint() map[string]any { - if o == nil { +func (v *VideoGenerationRequestOptions) GetTargon() map[string]any { + if v == nil { return nil } - return o.Switchpoint + return v.Targon } -func (o *OptionsObj) GetTargon() map[string]any { - if o == nil { +func (v *VideoGenerationRequestOptions) GetTenstorrent() map[string]any { + if v == nil { return nil } - return o.Targon + return v.Tenstorrent } -func (o *OptionsObj) GetTogether() map[string]any { - if o == nil { +func (v *VideoGenerationRequestOptions) GetTogether() map[string]any { + if v == nil { return nil } - return o.Together + return v.Together } -func (o *OptionsObj) GetTogetherLite() map[string]any { - if o == nil { +func (v *VideoGenerationRequestOptions) GetTogetherLite() map[string]any { + if v == nil { return nil } - return o.TogetherLite + return v.TogetherLite } -func (o *OptionsObj) GetUbicloud() map[string]any { - if o == nil { +func (v *VideoGenerationRequestOptions) GetUbicloud() map[string]any { + if v == nil { return nil } - return o.Ubicloud + return v.Ubicloud } -func (o *OptionsObj) GetUpstage() map[string]any { - if o == nil { +func (v *VideoGenerationRequestOptions) GetUpstage() map[string]any { + if v == nil { return nil } - return o.Upstage + return v.Upstage } -func (o *OptionsObj) GetVenice() map[string]any { - if o == nil { +func (v *VideoGenerationRequestOptions) GetVenice() map[string]any { + if v == nil { return nil } - return o.Venice + return v.Venice } -func (o *OptionsObj) GetWafer() map[string]any { - if o == nil { +func (v *VideoGenerationRequestOptions) GetWafer() map[string]any { + if v == nil { return nil } - return o.Wafer + return v.Wafer } -func (o *OptionsObj) GetWandb() map[string]any { - if o == nil { +func (v *VideoGenerationRequestOptions) GetWandb() map[string]any { + if v == nil { return nil } - return o.Wandb + return v.Wandb } -func (o *OptionsObj) GetXai() map[string]any { - if o == nil { +func (v *VideoGenerationRequestOptions) GetXai() map[string]any { + if v == nil { return nil } - return o.Xai + return v.Xai } -func (o *OptionsObj) GetXiaomi() map[string]any { - if o == nil { +func (v *VideoGenerationRequestOptions) GetXiaomi() map[string]any { + if v == nil { return nil } - return o.Xiaomi + return v.Xiaomi } -func (o *OptionsObj) GetZAi() map[string]any { - if o == nil { +func (v *VideoGenerationRequestOptions) GetZAi() map[string]any { + if v == nil { return nil } - return o.ZAi + return v.ZAi } // VideoGenerationRequestProvider - Provider-specific passthrough configuration type VideoGenerationRequestProvider struct { - Options *OptionsObj `json:"options,omitzero"` + Options *VideoGenerationRequestOptions `json:"options,omitzero"` } func (v VideoGenerationRequestProvider) MarshalJSON() ([]byte, error) { @@ -987,31 +995,31 @@ func (v *VideoGenerationRequestProvider) UnmarshalJSON(data []byte) error { return nil } -func (v *VideoGenerationRequestProvider) GetOptions() *OptionsObj { +func (v *VideoGenerationRequestProvider) GetOptions() *VideoGenerationRequestOptions { if v == nil { return nil } return v.Options } -// Resolution of the generated video -type Resolution string +// VideoGenerationRequestResolution - Resolution of the generated video +type VideoGenerationRequestResolution string const ( - ResolutionFourHundredAndEightyp Resolution = "480p" - ResolutionSevenHundredAndTwentyp Resolution = "720p" - ResolutionOneThousandAndEightyp Resolution = "1080p" - ResolutionOneK Resolution = "1K" - ResolutionTwoK Resolution = "2K" - ResolutionFourK Resolution = "4K" + VideoGenerationRequestResolutionFourHundredAndEightyp VideoGenerationRequestResolution = "480p" + VideoGenerationRequestResolutionSevenHundredAndTwentyp VideoGenerationRequestResolution = "720p" + VideoGenerationRequestResolutionOneThousandAndEightyp VideoGenerationRequestResolution = "1080p" + VideoGenerationRequestResolutionOneK VideoGenerationRequestResolution = "1K" + VideoGenerationRequestResolutionTwoK VideoGenerationRequestResolution = "2K" + VideoGenerationRequestResolutionFourK VideoGenerationRequestResolution = "4K" ) -func (e Resolution) ToPointer() *Resolution { +func (e VideoGenerationRequestResolution) ToPointer() *VideoGenerationRequestResolution { return &e } // IsExact returns true if the value matches a known enum value, false otherwise. -func (e *Resolution) IsExact() bool { +func (e *VideoGenerationRequestResolution) IsExact() bool { if e != nil { switch *e { case "480p", "720p", "1080p", "1K", "2K", "4K": @@ -1023,7 +1031,7 @@ func (e *Resolution) IsExact() bool { type VideoGenerationRequest struct { // Aspect ratio of the generated video - AspectRatio *AspectRatio `json:"aspect_ratio,omitzero"` + AspectRatio *VideoGenerationRequestAspectRatio `json:"aspect_ratio,omitzero"` // URL to receive a webhook notification when the video generation job completes. Overrides the workspace-level default callback URL if set. Must be HTTPS. CallbackURL *string `json:"callback_url,omitzero"` // Duration of the generated video in seconds @@ -1039,7 +1047,7 @@ type VideoGenerationRequest struct { // Provider-specific passthrough configuration Provider *VideoGenerationRequestProvider `json:"provider,omitzero"` // Resolution of the generated video - Resolution *Resolution `json:"resolution,omitzero"` + Resolution *VideoGenerationRequestResolution `json:"resolution,omitzero"` // If specified, the generation will sample deterministically, such that repeated requests with the same seed and parameters should return the same result. Determinism is not guaranteed for all providers. Seed *int64 `json:"seed,omitzero"` // Exact pixel dimensions of the generated video in "WIDTHxHEIGHT" format (e.g. "1280x720"). Interchangeable with resolution + aspect_ratio. @@ -1057,7 +1065,7 @@ func (v *VideoGenerationRequest) UnmarshalJSON(data []byte) error { return nil } -func (v *VideoGenerationRequest) GetAspectRatio() *AspectRatio { +func (v *VideoGenerationRequest) GetAspectRatio() *VideoGenerationRequestAspectRatio { if v == nil { return nil } @@ -1120,7 +1128,7 @@ func (v *VideoGenerationRequest) GetProvider() *VideoGenerationRequestProvider { return v.Provider } -func (v *VideoGenerationRequest) GetResolution() *Resolution { +func (v *VideoGenerationRequest) GetResolution() *VideoGenerationRequestResolution { if v == nil { return nil } diff --git a/models/components/websearchconfig.go b/models/components/websearchconfig.go index 333e61f1..227901c4 100644 --- a/models/components/websearchconfig.go +++ b/models/components/websearchconfig.go @@ -15,7 +15,7 @@ type WebSearchConfig struct { ExcludedDomains []string `json:"excluded_domains,omitzero"` // Exact maximum number of characters of content per search result. Applies to the Exa, Parallel, and Perplexity engines; ignored with native provider search and Firecrawl. For Exa, caps highlight content per result. For Parallel, caps excerpt content per result (default 1,500 when omitted). For Perplexity, maps to the native `max_tokens_per_page` parameter (converted from characters to tokens) and trims the response to the exact character cap. When both `max_characters` and `search_context_size` are set, `max_characters` takes precedence. When omitted, falls back to `search_context_size` mapping (Exa) or engine defaults (Parallel, Perplexity). MaxCharacters *int64 `json:"max_characters,omitzero"` - // Maximum number of search results to return per search call. Defaults to 5. Applies to Exa, Firecrawl, Parallel, and Perplexity engines; ignored with native provider search. + // Maximum number of search results to return per search call. Defaults to 5. Applies to Exa, Firecrawl, Parallel, and Perplexity engines; ignored with native provider search. Perplexity supports a maximum of 20; values above 20 are clamped. MaxResults *int64 `json:"max_results,omitzero"` // Maximum total number of search results across all search calls in a single request. Once this limit is reached, the tool will stop returning new results. Useful for controlling cost and context size in agentic loops. Defaults to 50 when not specified. MaxTotalResults *int64 `json:"max_total_results,omitzero"` diff --git a/models/components/websearchservertool.go b/models/components/websearchservertool.go index 566ec60c..6f2dc2be 100644 --- a/models/components/websearchservertool.go +++ b/models/components/websearchservertool.go @@ -37,7 +37,7 @@ type WebSearchServerTool struct { // Which search engine to use. "auto" (default) uses native if the provider supports it, otherwise Exa. "native" forces the provider's built-in search. "exa" forces the Exa search API. "firecrawl" uses Firecrawl (requires BYOK). "parallel" uses the Parallel search API. "perplexity" uses the Perplexity Search API (raw ranked results). Engine *WebSearchEngineEnum `json:"engine,omitzero"` Filters optionalnullable.OptionalNullable[WebSearchDomainFilter] `json:"filters,omitzero"` - // Maximum number of search results to return per search call. Defaults to 5. Applies to Exa, Firecrawl, Parallel, and Perplexity engines; ignored with native provider search. + // Maximum number of search results to return per search call. Defaults to 5. Applies to Exa, Firecrawl, Parallel, and Perplexity engines; ignored with native provider search. Perplexity supports a maximum of 20; values above 20 are clamped. MaxResults *int64 `json:"max_results,omitzero"` // Size of the search context for web search tools SearchContextSize *SearchContextSizeEnum `json:"search_context_size,omitzero"` diff --git a/models/components/websearchservertoolconfig.go b/models/components/websearchservertoolconfig.go index 95cb53ce..bfa27d13 100644 --- a/models/components/websearchservertoolconfig.go +++ b/models/components/websearchservertoolconfig.go @@ -16,7 +16,7 @@ type WebSearchServerToolConfig struct { ExcludedDomains []string `json:"excluded_domains,omitzero"` // Exact maximum number of characters of content per search result. Applies to the Exa, Parallel, and Perplexity engines; ignored with native provider search and Firecrawl. For Exa, caps highlight content per result. For Parallel, caps excerpt content per result (default 1,500 when omitted). For Perplexity, maps to the native `max_tokens_per_page` parameter (converted from characters to tokens) and trims the response to the exact character cap. When both `max_characters` and `search_context_size` are set, `max_characters` takes precedence. When omitted, falls back to `search_context_size` mapping (Exa) or engine defaults (Parallel, Perplexity). MaxCharacters *int64 `json:"max_characters,omitzero"` - // Maximum number of search results to return per search call. Defaults to 5. Applies to Exa, Firecrawl, Parallel, and Perplexity engines; ignored with native provider search. + // Maximum number of search results to return per search call. Defaults to 5. Applies to Exa, Firecrawl, Parallel, and Perplexity engines; ignored with native provider search. Perplexity supports a maximum of 20; values above 20 are clamped. MaxResults *int64 `json:"max_results,omitzero"` // Maximum total number of search results across all search calls in a single request. Once this limit is reached, the tool will stop returning new results. Useful for controlling cost and context size in agentic loops. Defaults to 50 when not specified. MaxTotalResults *int64 `json:"max_total_results,omitzero"` diff --git a/models/components/workspacebudget.go b/models/components/workspacebudget.go new file mode 100644 index 00000000..5c9d8e5f --- /dev/null +++ b/models/components/workspacebudget.go @@ -0,0 +1,84 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +// ResetInterval - Interval at which spend resets. Null means a lifetime (one-time) budget. +type ResetInterval string + +const ( + ResetIntervalDaily ResetInterval = "daily" + ResetIntervalWeekly ResetInterval = "weekly" + ResetIntervalMonthly ResetInterval = "monthly" +) + +func (e ResetInterval) ToPointer() *ResetInterval { + return &e +} + +// IsExact returns true if the value matches a known enum value, false otherwise. +func (e *ResetInterval) IsExact() bool { + if e != nil { + switch *e { + case "daily", "weekly", "monthly": + return true + } + } + return false +} + +type WorkspaceBudget struct { + // ISO 8601 timestamp of when the budget was created + CreatedAt string `json:"created_at"` + // Unique identifier for the budget + ID string `json:"id"` + // Spending limit in USD for this interval + LimitUsd float64 `json:"limit_usd"` + // Interval at which spend resets. Null means a lifetime (one-time) budget. + ResetInterval *ResetInterval `json:"reset_interval"` + // ISO 8601 timestamp of when the budget was last updated + UpdatedAt string `json:"updated_at"` + // ID of the workspace the budget belongs to + WorkspaceID string `json:"workspace_id"` +} + +func (w *WorkspaceBudget) GetCreatedAt() string { + if w == nil { + return "" + } + return w.CreatedAt +} + +func (w *WorkspaceBudget) GetID() string { + if w == nil { + return "" + } + return w.ID +} + +func (w *WorkspaceBudget) GetLimitUsd() float64 { + if w == nil { + return 0.0 + } + return w.LimitUsd +} + +func (w *WorkspaceBudget) GetResetInterval() *ResetInterval { + if w == nil { + return nil + } + return w.ResetInterval +} + +func (w *WorkspaceBudget) GetUpdatedAt() string { + if w == nil { + return "" + } + return w.UpdatedAt +} + +func (w *WorkspaceBudget) GetWorkspaceID() string { + if w == nil { + return "" + } + return w.WorkspaceID +} diff --git a/models/components/workspacebudgetinterval.go b/models/components/workspacebudgetinterval.go new file mode 100644 index 00000000..fa37ab0d --- /dev/null +++ b/models/components/workspacebudgetinterval.go @@ -0,0 +1,28 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +// WorkspaceBudgetInterval - Budget reset interval. Use "lifetime" for a one-time budget that never resets. +type WorkspaceBudgetInterval string + +const ( + WorkspaceBudgetIntervalDaily WorkspaceBudgetInterval = "daily" + WorkspaceBudgetIntervalWeekly WorkspaceBudgetInterval = "weekly" + WorkspaceBudgetIntervalMonthly WorkspaceBudgetInterval = "monthly" + WorkspaceBudgetIntervalLifetime WorkspaceBudgetInterval = "lifetime" +) + +func (e WorkspaceBudgetInterval) ToPointer() *WorkspaceBudgetInterval { + return &e +} + +// IsExact returns true if the value matches a known enum value, false otherwise. +func (e *WorkspaceBudgetInterval) IsExact() bool { + if e != nil { + switch *e { + case "daily", "weekly", "monthly", "lifetime": + return true + } + } + return false +} diff --git a/models/operations/createembeddings.go b/models/operations/createembeddings.go index b652c506..d0b22149 100644 --- a/models/operations/createembeddings.go +++ b/models/operations/createembeddings.go @@ -761,6 +761,34 @@ func (e *Object) UnmarshalJSON(data []byte) error { } } +// CostDetails - Breakdown of upstream inference costs +type CostDetails struct { + UpstreamInferenceCompletionsCost float64 `json:"upstream_inference_completions_cost"` + UpstreamInferenceCost optionalnullable.OptionalNullable[float64] `json:"upstream_inference_cost,omitzero"` + UpstreamInferencePromptCost float64 `json:"upstream_inference_prompt_cost"` +} + +func (c *CostDetails) GetUpstreamInferenceCompletionsCost() float64 { + if c == nil { + return 0.0 + } + return c.UpstreamInferenceCompletionsCost +} + +func (c *CostDetails) GetUpstreamInferenceCost() optionalnullable.OptionalNullable[float64] { + if c == nil { + return nil + } + return c.UpstreamInferenceCost +} + +func (c *CostDetails) GetUpstreamInferencePromptCost() float64 { + if c == nil { + return 0.0 + } + return c.UpstreamInferencePromptCost +} + // PromptTokensDetails - Per-modality token breakdown. Only present when the input contains 2+ modalities (e.g. text + image) and the upstream provider returns modality-level usage data. Only non-zero modality counts are included. type PromptTokensDetails struct { // Number of audio tokens in the input @@ -814,6 +842,10 @@ func (p *PromptTokensDetails) GetVideoTokens() *int64 { type CreateEmbeddingsUsage struct { // Cost of the request in credits Cost *float64 `json:"cost,omitzero"` + // Breakdown of upstream inference costs + CostDetails optionalnullable.OptionalNullable[CostDetails] `json:"cost_details,omitzero"` + // Whether a request was made using a Bring Your Own Key configuration + IsByok *bool `json:"is_byok,omitzero"` // Number of tokens in the input PromptTokens int64 `json:"prompt_tokens"` // Per-modality token breakdown. Only present when the input contains 2+ modalities (e.g. text + image) and the upstream provider returns modality-level usage data. Only non-zero modality counts are included. @@ -840,6 +872,20 @@ func (c *CreateEmbeddingsUsage) GetCost() *float64 { return c.Cost } +func (c *CreateEmbeddingsUsage) GetCostDetails() optionalnullable.OptionalNullable[CostDetails] { + if c == nil { + return nil + } + return c.CostDetails +} + +func (c *CreateEmbeddingsUsage) GetIsByok() *bool { + if c == nil { + return nil + } + return c.IsByok +} + func (c *CreateEmbeddingsUsage) GetPromptTokens() int64 { if c == nil { return 0 diff --git a/models/operations/createimages.go b/models/operations/createimages.go new file mode 100644 index 00000000..876fee75 --- /dev/null +++ b/models/operations/createimages.go @@ -0,0 +1,100 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package operations + +import ( + "errors" + "fmt" + "github.com/OpenRouterTeam/go-sdk/internal/utils" + "github.com/OpenRouterTeam/go-sdk/models/components" + "github.com/OpenRouterTeam/go-sdk/types/stream" +) + +type CreateImagesResponseType string + +const ( + CreateImagesResponseTypeImageGenerationResponse CreateImagesResponseType = "ImageGenerationResponse" + CreateImagesResponseTypeEventStream CreateImagesResponseType = "event-stream" +) + +type CreateImagesResponse struct { + ImageGenerationResponse *components.ImageGenerationResponse `queryParam:"inline" union:"member"` + EventStream *stream.EventStream[components.ImageStreamingResponse] `queryParam:"inline" union:"member"` + + Type CreateImagesResponseType +} + +func CreateCreateImagesResponseImageGenerationResponse(imageGenerationResponse components.ImageGenerationResponse) CreateImagesResponse { + typ := CreateImagesResponseTypeImageGenerationResponse + + return CreateImagesResponse{ + ImageGenerationResponse: &imageGenerationResponse, + Type: typ, + } +} + +func CreateCreateImagesResponseEventStream(eventStream *stream.EventStream[components.ImageStreamingResponse]) CreateImagesResponse { + typ := CreateImagesResponseTypeEventStream + + return CreateImagesResponse{ + EventStream: eventStream, + Type: typ, + } +} + +func (u *CreateImagesResponse) UnmarshalJSON(data []byte) error { + + var candidates []utils.UnionCandidate + + // Collect all valid candidates + var imageGenerationResponse components.ImageGenerationResponse = components.ImageGenerationResponse{} + if err := utils.UnmarshalJSON(data, &imageGenerationResponse, "", true, nil); err == nil { + candidates = append(candidates, utils.UnionCandidate{ + Type: CreateImagesResponseTypeImageGenerationResponse, + Value: &imageGenerationResponse, + }) + } + + var eventStream *stream.EventStream[components.ImageStreamingResponse] = &stream.EventStream[components.ImageStreamingResponse]{} + if err := utils.UnmarshalJSON(data, &eventStream, "", true, nil); err == nil { + candidates = append(candidates, utils.UnionCandidate{ + Type: CreateImagesResponseTypeEventStream, + Value: eventStream, + }) + } + + if len(candidates) == 0 { + return fmt.Errorf("could not unmarshal `%s` into any supported union types for CreateImagesResponse", string(data)) + } + + // Pick the best candidate using multi-stage filtering + best := utils.PickBestUnionCandidate(candidates, data) + if best == nil { + return fmt.Errorf("could not unmarshal `%s` into any supported union types for CreateImagesResponse", string(data)) + } + + // Set the union type and value based on the best candidate + u.Type = best.Type.(CreateImagesResponseType) + switch best.Type { + case CreateImagesResponseTypeImageGenerationResponse: + u.ImageGenerationResponse = best.Value.(*components.ImageGenerationResponse) + return nil + case CreateImagesResponseTypeEventStream: + u.EventStream = best.Value.(*stream.EventStream[components.ImageStreamingResponse]) + return nil + } + + return fmt.Errorf("could not unmarshal `%s` into any supported union types for CreateImagesResponse", string(data)) +} + +func (u CreateImagesResponse) MarshalJSON() ([]byte, error) { + if u.ImageGenerationResponse != nil { + return utils.MarshalJSON(u.ImageGenerationResponse, "", true) + } + + if u.EventStream != nil { + return utils.MarshalJSON(u.EventStream, "", true) + } + + return nil, errors.New("could not marshal union type CreateImagesResponse: all fields are null") +} diff --git a/models/operations/deleteworkspacebudget.go b/models/operations/deleteworkspacebudget.go new file mode 100644 index 00000000..e478ee37 --- /dev/null +++ b/models/operations/deleteworkspacebudget.go @@ -0,0 +1,28 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package operations + +import ( + "github.com/OpenRouterTeam/go-sdk/models/components" +) + +type DeleteWorkspaceBudgetRequest struct { + // The workspace ID (UUID) or slug + ID string `pathParam:"style=simple,explode=false,name=id"` + // Budget reset interval. Use "lifetime" for a one-time budget that never resets. + Interval components.WorkspaceBudgetInterval `pathParam:"style=simple,explode=false,name=interval"` +} + +func (d *DeleteWorkspaceBudgetRequest) GetID() string { + if d == nil { + return "" + } + return d.ID +} + +func (d *DeleteWorkspaceBudgetRequest) GetInterval() components.WorkspaceBudgetInterval { + if d == nil { + return components.WorkspaceBudgetInterval("") + } + return d.Interval +} diff --git a/models/operations/getbenchmarks.go b/models/operations/getbenchmarks.go new file mode 100644 index 00000000..2d44ae1c --- /dev/null +++ b/models/operations/getbenchmarks.go @@ -0,0 +1,122 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package operations + +// Source - Benchmark source to query. Determines the shape of the returned items. When omitted, returns results from all sources. +type Source string + +const ( + SourceArtificialAnalysis Source = "artificial-analysis" + SourceDesignArena Source = "design-arena" +) + +func (e Source) ToPointer() *Source { + return &e +} + +// IsExact returns true if the value matches a known enum value, false otherwise. +func (e *Source) IsExact() bool { + if e != nil { + switch *e { + case "artificial-analysis", "design-arena": + return true + } + } + return false +} + +// TaskType - Filter results by task type. For Artificial Analysis, maps to the corresponding index. For Design Arena, maps to the matching category. +type TaskType string + +const ( + TaskTypeCoding TaskType = "coding" + TaskTypeIntelligence TaskType = "intelligence" + TaskTypeAgentic TaskType = "agentic" +) + +func (e TaskType) ToPointer() *TaskType { + return &e +} + +// IsExact returns true if the value matches a known enum value, false otherwise. +func (e *TaskType) IsExact() bool { + if e != nil { + switch *e { + case "coding", "intelligence", "agentic": + return true + } + } + return false +} + +// Design Arena only: arena to query. Defaults to `models` when source is `design-arena`. +type Arena string + +const ( + ArenaModels Arena = "models" + ArenaBuilders Arena = "builders" + ArenaAgents Arena = "agents" +) + +func (e Arena) ToPointer() *Arena { + return &e +} + +// IsExact returns true if the value matches a known enum value, false otherwise. +func (e *Arena) IsExact() bool { + if e != nil { + switch *e { + case "models", "builders", "agents": + return true + } + } + return false +} + +type GetBenchmarksRequest struct { + // Benchmark source to query. Determines the shape of the returned items. When omitted, returns results from all sources. + Source *Source `queryParam:"style=form,explode=true,name=source"` + // Filter results by task type. For Artificial Analysis, maps to the corresponding index. For Design Arena, maps to the matching category. + TaskType *TaskType `queryParam:"style=form,explode=true,name=task_type"` + // Design Arena only: arena to query. Defaults to `models` when source is `design-arena`. + Arena *Arena `queryParam:"style=form,explode=true,name=arena"` + // Design Arena only: category within the arena (e.g. `codecategories`, `uicomponent`, `gamedev`, `3d`, `dataviz`, `image`, `video`, `svg`). When omitted, returns all categories. + Category *string `queryParam:"style=form,explode=true,name=category"` + // Maximum number of items to return. When omitted, all matching results are returned. + MaxResults *int64 `queryParam:"style=form,explode=true,name=max_results"` +} + +func (g *GetBenchmarksRequest) GetSource() *Source { + if g == nil { + return nil + } + return g.Source +} + +func (g *GetBenchmarksRequest) GetTaskType() *TaskType { + if g == nil { + return nil + } + return g.TaskType +} + +func (g *GetBenchmarksRequest) GetArena() *Arena { + if g == nil { + return nil + } + return g.Arena +} + +func (g *GetBenchmarksRequest) GetCategory() *string { + if g == nil { + return nil + } + return g.Category +} + +func (g *GetBenchmarksRequest) GetMaxResults() *int64 { + if g == nil { + return nil + } + return g.MaxResults +} diff --git a/models/operations/getbenchmarksartificialanalysis.go b/models/operations/getbenchmarksartificialanalysis.go deleted file mode 100644 index 89ace9fc..00000000 --- a/models/operations/getbenchmarksartificialanalysis.go +++ /dev/null @@ -1,30 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package operations - -import ( - "github.com/OpenRouterTeam/go-sdk/internal/utils" -) - -type GetBenchmarksArtificialAnalysisRequest struct { - // Max results to return (1–100, default 50). - MaxResults *int64 `default:"50" queryParam:"style=form,explode=true,name=max_results"` -} - -func (g GetBenchmarksArtificialAnalysisRequest) MarshalJSON() ([]byte, error) { - return utils.MarshalJSON(g, "", false) -} - -func (g *GetBenchmarksArtificialAnalysisRequest) UnmarshalJSON(data []byte) error { - if err := utils.UnmarshalJSON(data, &g, "", false, nil); err != nil { - return err - } - return nil -} - -func (g *GetBenchmarksArtificialAnalysisRequest) GetMaxResults() *int64 { - if g == nil { - return nil - } - return g.MaxResults -} diff --git a/models/operations/getbenchmarksdesignarena.go b/models/operations/getbenchmarksdesignarena.go deleted file mode 100644 index 1034b8ae..00000000 --- a/models/operations/getbenchmarksdesignarena.go +++ /dev/null @@ -1,72 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package operations - -import ( - "github.com/OpenRouterTeam/go-sdk/internal/utils" -) - -// Arena to query. Defaults to `models`. -type Arena string - -const ( - ArenaModels Arena = "models" - ArenaBuilders Arena = "builders" - ArenaAgents Arena = "agents" -) - -func (e Arena) ToPointer() *Arena { - return &e -} - -// IsExact returns true if the value matches a known enum value, false otherwise. -func (e *Arena) IsExact() bool { - if e != nil { - switch *e { - case "models", "builders", "agents": - return true - } - } - return false -} - -type GetBenchmarksDesignArenaRequest struct { - // Arena to query. Defaults to `models`. - Arena *Arena `default:"models" queryParam:"style=form,explode=true,name=arena"` - // Category within the arena (e.g. `codecategories`, `uicomponent`, `gamedev`, `3d`, `dataviz`, `image`, `video`, `svg`). When omitted, returns all categories. - Category *string `queryParam:"style=form,explode=true,name=category"` - // Max results to return: per category when no category filter is applied (1–100, default 50). - MaxResults *int64 `default:"50" queryParam:"style=form,explode=true,name=max_results"` -} - -func (g GetBenchmarksDesignArenaRequest) MarshalJSON() ([]byte, error) { - return utils.MarshalJSON(g, "", false) -} - -func (g *GetBenchmarksDesignArenaRequest) UnmarshalJSON(data []byte) error { - if err := utils.UnmarshalJSON(data, &g, "", false, nil); err != nil { - return err - } - return nil -} - -func (g *GetBenchmarksDesignArenaRequest) GetArena() *Arena { - if g == nil { - return nil - } - return g.Arena -} - -func (g *GetBenchmarksDesignArenaRequest) GetCategory() *string { - if g == nil { - return nil - } - return g.Category -} - -func (g *GetBenchmarksDesignArenaRequest) GetMaxResults() *int64 { - if g == nil { - return nil - } - return g.MaxResults -} diff --git a/models/operations/gettaskclassifications.go b/models/operations/gettaskclassifications.go new file mode 100644 index 00000000..623ea951 --- /dev/null +++ b/models/operations/gettaskclassifications.go @@ -0,0 +1,56 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package operations + +import ( + "encoding/json" + "fmt" + "github.com/OpenRouterTeam/go-sdk/internal/utils" +) + +// Window - Trailing time window for the classification data. Currently only `7d` (trailing 7 days) is supported. +type Window string + +const ( + WindowSevend Window = "7d" +) + +func (e Window) ToPointer() *Window { + return &e +} +func (e *Window) UnmarshalJSON(data []byte) error { + var v string + if err := json.Unmarshal(data, &v); err != nil { + return err + } + switch v { + case "7d": + *e = Window(v) + return nil + default: + return fmt.Errorf("invalid value for Window: %v", v) + } +} + +type GetTaskClassificationsRequest struct { + // Trailing time window for the classification data. Currently only `7d` (trailing 7 days) is supported. + Window *Window `default:"7d" queryParam:"style=form,explode=true,name=window"` +} + +func (g GetTaskClassificationsRequest) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(g, "", false) +} + +func (g *GetTaskClassificationsRequest) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &g, "", false, nil); err != nil { + return err + } + return nil +} + +func (g *GetTaskClassificationsRequest) GetWindow() *Window { + if g == nil { + return nil + } + return g.Window +} diff --git a/models/operations/listbyokkeys.go b/models/operations/listbyokkeys.go index ce8aef28..2af8ecb3 100644 --- a/models/operations/listbyokkeys.go +++ b/models/operations/listbyokkeys.go @@ -86,6 +86,7 @@ const ( ProviderStepfun Provider = "stepfun" ProviderStreamlake Provider = "streamlake" ProviderSwitchpoint Provider = "switchpoint" + ProviderTenstorrent Provider = "tenstorrent" ProviderTogether Provider = "together" ProviderUpstage Provider = "upstage" ProviderVenice Provider = "venice" @@ -104,7 +105,7 @@ func (e Provider) ToPointer() *Provider { func (e *Provider) IsExact() bool { if e != nil { switch *e { - case "ai21", "aion-labs", "akashml", "alibaba", "amazon-bedrock", "amazon-nova", "ambient", "anthropic", "arcee-ai", "atlas-cloud", "avian", "azure", "baidu", "baseten", "black-forest-labs", "byteplus", "cerebras", "chutes", "cirrascale", "clarifai", "cloudflare", "cohere", "crusoe", "darkbloom", "decart", "deepinfra", "deepseek", "dekallm", "digitalocean", "featherless", "fireworks", "friendli", "gmicloud", "google-ai-studio", "google-vertex", "groq", "inception", "inceptron", "inference-net", "infermatic", "inflection", "io-net", "ionstream", "liquid", "mancer", "mara", "minimax", "mistral", "modelrun", "modular", "moonshotai", "morph", "ncompass", "nebius", "nex-agi", "nextbit", "novita", "nvidia", "open-inference", "openai", "parasail", "perceptron", "perplexity", "phala", "poolside", "recraft", "reka", "relace", "sambanova", "seed", "siliconflow", "sourceful", "stepfun", "streamlake", "switchpoint", "together", "upstage", "venice", "wafer", "wandb", "xai", "xiaomi", "z-ai": + case "ai21", "aion-labs", "akashml", "alibaba", "amazon-bedrock", "amazon-nova", "ambient", "anthropic", "arcee-ai", "atlas-cloud", "avian", "azure", "baidu", "baseten", "black-forest-labs", "byteplus", "cerebras", "chutes", "cirrascale", "clarifai", "cloudflare", "cohere", "crusoe", "darkbloom", "decart", "deepinfra", "deepseek", "dekallm", "digitalocean", "featherless", "fireworks", "friendli", "gmicloud", "google-ai-studio", "google-vertex", "groq", "inception", "inceptron", "inference-net", "infermatic", "inflection", "io-net", "ionstream", "liquid", "mancer", "mara", "minimax", "mistral", "modelrun", "modular", "moonshotai", "morph", "ncompass", "nebius", "nex-agi", "nextbit", "novita", "nvidia", "open-inference", "openai", "parasail", "perceptron", "perplexity", "phala", "poolside", "recraft", "reka", "relace", "sambanova", "seed", "siliconflow", "sourceful", "stepfun", "streamlake", "switchpoint", "tenstorrent", "together", "upstage", "venice", "wafer", "wandb", "xai", "xiaomi", "z-ai": return true } } diff --git a/models/operations/listimagemodelendpoints.go b/models/operations/listimagemodelendpoints.go new file mode 100644 index 00000000..5b013cbc --- /dev/null +++ b/models/operations/listimagemodelendpoints.go @@ -0,0 +1,24 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package operations + +type ListImageModelEndpointsRequest struct { + // Model author/organization + Author string `pathParam:"style=simple,explode=false,name=author"` + // Model slug + Slug string `pathParam:"style=simple,explode=false,name=slug"` +} + +func (l *ListImageModelEndpointsRequest) GetAuthor() string { + if l == nil { + return "" + } + return l.Author +} + +func (l *ListImageModelEndpointsRequest) GetSlug() string { + if l == nil { + return "" + } + return l.Slug +} diff --git a/models/operations/listworkspacebudgets.go b/models/operations/listworkspacebudgets.go new file mode 100644 index 00000000..ed4fa3cd --- /dev/null +++ b/models/operations/listworkspacebudgets.go @@ -0,0 +1,15 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package operations + +type ListWorkspaceBudgetsRequest struct { + // The workspace ID (UUID) or slug + ID string `pathParam:"style=simple,explode=false,name=id"` +} + +func (l *ListWorkspaceBudgetsRequest) GetID() string { + if l == nil { + return "" + } + return l.ID +} diff --git a/models/operations/queryanalytics.go b/models/operations/queryanalytics.go index 98e489c1..1f0da2df 100644 --- a/models/operations/queryanalytics.go +++ b/models/operations/queryanalytics.go @@ -106,7 +106,7 @@ const ( Value1TypeArrayOfValue2 Value1Type = "arrayOfValue2" ) -// Value1 - Filter value (scalar or array depending on operator) +// Value1 - Filter value (scalar or array depending on operator). Several dimensions are enriched in responses (returned as human-readable labels), but filters must use the underlying ID: `api_key_id` — numeric ID (from generation metadata) or key hash (64-char hex from GET /api/v1/keys, resolved server-side); `user` — Clerk user ID (e.g. "user_abc123"), not the display name; `workspace` — workspace UUID, not the workspace name; `app` — numeric app ID, not the app title; `model` — permaslug (e.g. "openai/gpt-4o"), not the display name. Other dimensions (provider, origin, country, etc.) are not enriched and accept the value as returned. type Value1 struct { Str *string `queryParam:"inline" union:"member"` Number *float64 `queryParam:"inline" union:"member"` @@ -215,11 +215,11 @@ func (u Value1) MarshalJSON() ([]byte, error) { } type Filter struct { - // Dimension to filter on + // Dimension to filter on. Use the /meta endpoint for available dimensions. Field string `json:"field"` // Filter operator Operator string `json:"operator"` - // Filter value (scalar or array depending on operator) + // Filter value (scalar or array depending on operator). Several dimensions are enriched in responses (returned as human-readable labels), but filters must use the underlying ID: `api_key_id` — numeric ID (from generation metadata) or key hash (64-char hex from GET /api/v1/keys, resolved server-side); `user` — Clerk user ID (e.g. "user_abc123"), not the display name; `workspace` — workspace UUID, not the workspace name; `app` — numeric app ID, not the app title; `model` — permaslug (e.g. "openai/gpt-4o"), not the display name. Other dimensions (provider, origin, country, etc.) are not enriched and accept the value as returned. Value Value1 `json:"value"` } @@ -435,6 +435,19 @@ type QueryAnalyticsData2 struct { CachedAt *float64 `json:"cachedAt,omitzero"` Data []QueryAnalyticsData1 `json:"data"` Metadata Metadata `json:"metadata"` + // Warnings about filter resolution issues (e.g. unresolvable api_key_id hashes). The query still runs normally; these inform the caller that some filter values could not be resolved. + Warnings []string `json:"warnings,omitzero"` +} + +func (q QueryAnalyticsData2) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(q, "", false) +} + +func (q *QueryAnalyticsData2) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &q, "", false, nil); err != nil { + return err + } + return nil } func (q *QueryAnalyticsData2) GetCachedAt() *float64 { @@ -458,6 +471,13 @@ func (q *QueryAnalyticsData2) GetMetadata() Metadata { return q.Metadata } +func (q *QueryAnalyticsData2) GetWarnings() []string { + if q == nil { + return nil + } + return q.Warnings +} + // #region class-body-queryanalyticsdata2 // #endregion class-body-queryanalyticsdata2 diff --git a/models/operations/upsertworkspacebudget.go b/models/operations/upsertworkspacebudget.go new file mode 100644 index 00000000..45231901 --- /dev/null +++ b/models/operations/upsertworkspacebudget.go @@ -0,0 +1,36 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package operations + +import ( + "github.com/OpenRouterTeam/go-sdk/models/components" +) + +type UpsertWorkspaceBudgetRequest struct { + // The workspace ID (UUID) or slug + ID string `pathParam:"style=simple,explode=false,name=id"` + // Budget reset interval. Use "lifetime" for a one-time budget that never resets. + Interval components.WorkspaceBudgetInterval `pathParam:"style=simple,explode=false,name=interval"` + UpsertWorkspaceBudgetRequest components.UpsertWorkspaceBudgetRequest `request:"mediaType=application/json"` +} + +func (u *UpsertWorkspaceBudgetRequest) GetID() string { + if u == nil { + return "" + } + return u.ID +} + +func (u *UpsertWorkspaceBudgetRequest) GetInterval() components.WorkspaceBudgetInterval { + if u == nil { + return components.WorkspaceBudgetInterval("") + } + return u.Interval +} + +func (u *UpsertWorkspaceBudgetRequest) GetUpsertWorkspaceBudgetRequest() components.UpsertWorkspaceBudgetRequest { + if u == nil { + return components.UpsertWorkspaceBudgetRequest{} + } + return u.UpsertWorkspaceBudgetRequest +} diff --git a/oauth.go b/oauth.go index 2fe4b5d8..8a3a9443 100644 --- a/oauth.go +++ b/oauth.go @@ -182,7 +182,7 @@ func (s *OAuth) ExchangeAuthCodeForAPIKey(ctx context.Context, request operation _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) return nil, err - } else if utils.MatchStatusCodes([]string{"4XX", "5XX"}, httpRes.StatusCode) { + } else if utils.MatchStatusCodes([]string{"400", "403", "4XX", "500", "5XX"}, httpRes.StatusCode) { _httpRes, err := s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) if err != nil { return nil, err @@ -457,7 +457,7 @@ func (s *OAuth) CreateAuthCode(ctx context.Context, request operations.CreateAut _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) return nil, err - } else if utils.MatchStatusCodes([]string{"4XX", "5XX"}, httpRes.StatusCode) { + } else if utils.MatchStatusCodes([]string{"400", "401", "403", "409", "4XX", "500", "5XX"}, httpRes.StatusCode) { _httpRes, err := s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) if err != nil { return nil, err diff --git a/observability.go b/observability.go index 3dc1d1bf..de50129e 100644 --- a/observability.go +++ b/observability.go @@ -188,7 +188,7 @@ func (s *Observability) List(ctx context.Context, offset optionalnullable.Option _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) return nil, err - } else if utils.MatchStatusCodes([]string{"4XX", "5XX"}, httpRes.StatusCode) { + } else if utils.MatchStatusCodes([]string{"401", "4XX", "500", "5XX"}, httpRes.StatusCode) { _httpRes, err := s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) if err != nil { return nil, err @@ -491,7 +491,7 @@ func (s *Observability) Create(ctx context.Context, request components.CreateObs _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) return nil, err - } else if utils.MatchStatusCodes([]string{"4XX", "5XX"}, httpRes.StatusCode) { + } else if utils.MatchStatusCodes([]string{"400", "401", "403", "409", "4XX", "500", "5XX"}, httpRes.StatusCode) { _httpRes, err := s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) if err != nil { return nil, err @@ -805,7 +805,7 @@ func (s *Observability) Delete(ctx context.Context, id string, opts ...operation _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) return nil, err - } else if utils.MatchStatusCodes([]string{"4XX", "5XX"}, httpRes.StatusCode) { + } else if utils.MatchStatusCodes([]string{"401", "404", "4XX", "500", "5XX"}, httpRes.StatusCode) { _httpRes, err := s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) if err != nil { return nil, err @@ -1077,7 +1077,7 @@ func (s *Observability) Get(ctx context.Context, id string, opts ...operations.O _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) return nil, err - } else if utils.MatchStatusCodes([]string{"4XX", "5XX"}, httpRes.StatusCode) { + } else if utils.MatchStatusCodes([]string{"401", "404", "4XX", "500", "5XX"}, httpRes.StatusCode) { _httpRes, err := s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) if err != nil { return nil, err @@ -1357,7 +1357,7 @@ func (s *Observability) Update(ctx context.Context, id string, updateObservabili _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) return nil, err - } else if utils.MatchStatusCodes([]string{"4XX", "5XX"}, httpRes.StatusCode) { + } else if utils.MatchStatusCodes([]string{"400", "401", "404", "409", "4XX", "500", "5XX"}, httpRes.StatusCode) { _httpRes, err := s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) if err != nil { return nil, err diff --git a/openrouter.go b/openrouter.go index 8a4e3724..6fd9a05e 100644 --- a/openrouter.go +++ b/openrouter.go @@ -2,7 +2,7 @@ package openrouter -// Generated from OpenAPI doc version 1.0.0 and generator version 2.904.2 +// Generated from OpenAPI doc version 1.0.0 and generator version 2.879.6 import ( "context" @@ -67,9 +67,13 @@ type OpenRouter struct { Stt *Stt // OAuth authentication endpoints OAuth *OAuth + // Benchmarks endpoints + Benchmarks *Benchmarks // BYOK endpoints Byok *Byok Chat *Chat + // Task classification market-share endpoints + Classifications *Classifications // Credit management endpoints Credits *Credits // Datasets endpoints @@ -84,6 +88,8 @@ type OpenRouter struct { Generations *Generations // Guardrails endpoints Guardrails *Guardrails + // Images endpoints + Images *Images // API key management endpoints APIKeys *APIKeys // Model information endpoints @@ -193,9 +199,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.5.0", + SDKVersion: "0.5.1", sdkConfiguration: config.SDKConfiguration{ - UserAgent: "speakeasy-sdk/go 0.5.0 2.904.2 1.0.0 github.com/OpenRouterTeam/go-sdk", + UserAgent: "speakeasy-sdk/go 0.5.1 2.879.6 1.0.0 github.com/OpenRouterTeam/go-sdk", Globals: globals.Globals{}, ServerList: ServerList, }, @@ -226,8 +232,10 @@ func New(opts ...SDKOption) *OpenRouter { sdk.Tts = newTts(sdk, sdk.sdkConfiguration, sdk.hooks) sdk.Stt = newStt(sdk, sdk.sdkConfiguration, sdk.hooks) sdk.OAuth = newOAuth(sdk, sdk.sdkConfiguration, sdk.hooks) + sdk.Benchmarks = newBenchmarks(sdk, sdk.sdkConfiguration, sdk.hooks) sdk.Byok = newByok(sdk, sdk.sdkConfiguration, sdk.hooks) sdk.Chat = newChat(sdk, sdk.sdkConfiguration, sdk.hooks) + sdk.Classifications = newClassifications(sdk, sdk.sdkConfiguration, sdk.hooks) sdk.Credits = newCredits(sdk, sdk.sdkConfiguration, sdk.hooks) sdk.Datasets = newDatasets(sdk, sdk.sdkConfiguration, sdk.hooks) sdk.Embeddings = newEmbeddings(sdk, sdk.sdkConfiguration, sdk.hooks) @@ -235,6 +243,7 @@ func New(opts ...SDKOption) *OpenRouter { sdk.Files = newFiles(sdk, sdk.sdkConfiguration, sdk.hooks) sdk.Generations = newGenerations(sdk, sdk.sdkConfiguration, sdk.hooks) sdk.Guardrails = newGuardrails(sdk, sdk.sdkConfiguration, sdk.hooks) + sdk.Images = newImages(sdk, sdk.sdkConfiguration, sdk.hooks) sdk.APIKeys = newAPIKeys(sdk, sdk.sdkConfiguration, sdk.hooks) sdk.Models = newModels(sdk, sdk.sdkConfiguration, sdk.hooks) sdk.Observability = newObservability(sdk, sdk.sdkConfiguration, sdk.hooks) diff --git a/organization.go b/organization.go index ffd0ec32..6f6fcf1e 100644 --- a/organization.go +++ b/organization.go @@ -186,7 +186,7 @@ func (s *Organization) ListMembers(ctx context.Context, offset optionalnullable. _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) return nil, err - } else if utils.MatchStatusCodes([]string{"4XX", "5XX"}, httpRes.StatusCode) { + } else if utils.MatchStatusCodes([]string{"401", "404", "4XX", "500", "5XX"}, httpRes.StatusCode) { _httpRes, err := s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) if err != nil { return nil, err diff --git a/presets.go b/presets.go index dfd0ed5c..b8013c89 100644 --- a/presets.go +++ b/presets.go @@ -189,7 +189,7 @@ func (s *Presets) List(ctx context.Context, offset optionalnullable.OptionalNull _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) return nil, err - } else if utils.MatchStatusCodes([]string{"4XX", "5XX"}, httpRes.StatusCode) { + } else if utils.MatchStatusCodes([]string{"400", "401", "4XX", "500", "5XX"}, httpRes.StatusCode) { _httpRes, err := s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) if err != nil { return nil, err @@ -511,7 +511,7 @@ func (s *Presets) Get(ctx context.Context, slug string, opts ...operations.Optio _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) return nil, err - } else if utils.MatchStatusCodes([]string{"4XX", "5XX"}, httpRes.StatusCode) { + } else if utils.MatchStatusCodes([]string{"400", "401", "404", "4XX", "500", "5XX"}, httpRes.StatusCode) { _httpRes, err := s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) if err != nil { return nil, err @@ -814,7 +814,7 @@ func (s *Presets) CreatePresetsChatCompletions(ctx context.Context, slug string, _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) return nil, err - } else if utils.MatchStatusCodes([]string{"4XX", "5XX"}, httpRes.StatusCode) { + } else if utils.MatchStatusCodes([]string{"400", "401", "403", "404", "409", "4XX", "500", "5XX"}, httpRes.StatusCode) { _httpRes, err := s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) if err != nil { return nil, err @@ -1159,7 +1159,7 @@ func (s *Presets) CreatePresetsMessages(ctx context.Context, slug string, messag _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) return nil, err - } else if utils.MatchStatusCodes([]string{"4XX", "5XX"}, httpRes.StatusCode) { + } else if utils.MatchStatusCodes([]string{"400", "401", "403", "404", "409", "4XX", "500", "5XX"}, httpRes.StatusCode) { _httpRes, err := s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) if err != nil { return nil, err @@ -1504,7 +1504,7 @@ func (s *Presets) CreatePresetsResponses(ctx context.Context, slug string, respo _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) return nil, err - } else if utils.MatchStatusCodes([]string{"4XX", "5XX"}, httpRes.StatusCode) { + } else if utils.MatchStatusCodes([]string{"400", "401", "403", "404", "409", "4XX", "500", "5XX"}, httpRes.StatusCode) { _httpRes, err := s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) if err != nil { return nil, err @@ -1847,7 +1847,7 @@ func (s *Presets) ListVersions(ctx context.Context, slug string, offset optional _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) return nil, err - } else if utils.MatchStatusCodes([]string{"4XX", "5XX"}, httpRes.StatusCode) { + } else if utils.MatchStatusCodes([]string{"400", "401", "404", "4XX", "500", "5XX"}, httpRes.StatusCode) { _httpRes, err := s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) if err != nil { return nil, err @@ -2192,7 +2192,7 @@ func (s *Presets) GetVersion(ctx context.Context, slug string, version string, o _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) return nil, err - } else if utils.MatchStatusCodes([]string{"4XX", "5XX"}, httpRes.StatusCode) { + } else if utils.MatchStatusCodes([]string{"400", "401", "404", "4XX", "500", "5XX"}, httpRes.StatusCode) { _httpRes, err := s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) if err != nil { return nil, err diff --git a/providers.go b/providers.go index 1faa9d7a..2af1cb36 100644 --- a/providers.go +++ b/providers.go @@ -174,7 +174,7 @@ func (s *Providers) List(ctx context.Context, opts ...operations.Option) (*opera _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) return nil, err - } else if utils.MatchStatusCodes([]string{"4XX", "5XX"}, httpRes.StatusCode) { + } else if utils.MatchStatusCodes([]string{"4XX", "500", "5XX"}, httpRes.StatusCode) { _httpRes, err := s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) if err != nil { return nil, err diff --git a/rerank.go b/rerank.go index 8a8bfc2f..d052db0a 100644 --- a/rerank.go +++ b/rerank.go @@ -188,7 +188,7 @@ func (s *Rerank) Rerank(ctx context.Context, request operations.CreateRerankRequ _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) return nil, err - } else if utils.MatchStatusCodes([]string{"4XX", "5XX"}, httpRes.StatusCode) { + } else if utils.MatchStatusCodes([]string{"400", "401", "402", "404", "429", "4XX", "500", "502", "503", "524", "529", "5XX"}, httpRes.StatusCode) { _httpRes, err := s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) if err != nil { return nil, err diff --git a/responses.go b/responses.go index 02ef24cc..02a5f694 100644 --- a/responses.go +++ b/responses.go @@ -197,7 +197,7 @@ func (s *Responses) Send(ctx context.Context, responsesRequest components.Respon _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) return nil, err - } else if utils.MatchStatusCodes([]string{"4XX", "5XX"}, httpRes.StatusCode) { + } else if utils.MatchStatusCodes([]string{"400", "401", "402", "403", "404", "408", "413", "422", "429", "4XX", "500", "502", "503", "524", "529", "5XX"}, httpRes.StatusCode) { _httpRes, err := s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) if err != nil { return nil, err diff --git a/stt.go b/stt.go index fbedf08e..09bd5923 100644 --- a/stt.go +++ b/stt.go @@ -183,7 +183,7 @@ func (s *Stt) CreateTranscription(ctx context.Context, request components.STTReq _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) return nil, err - } else if utils.MatchStatusCodes([]string{"4XX", "5XX"}, httpRes.StatusCode) { + } else if utils.MatchStatusCodes([]string{"400", "401", "402", "404", "429", "4XX", "500", "502", "503", "524", "529", "5XX"}, httpRes.StatusCode) { _httpRes, err := s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) if err != nil { return nil, err diff --git a/tts.go b/tts.go index 03d77d79..94743b3d 100644 --- a/tts.go +++ b/tts.go @@ -184,7 +184,7 @@ func (s *Tts) CreateSpeech(ctx context.Context, request components.SpeechRequest _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) return nil, err - } else if utils.MatchStatusCodes([]string{"4XX", "5XX"}, httpRes.StatusCode) { + } else if utils.MatchStatusCodes([]string{"400", "401", "402", "404", "429", "4XX", "500", "502", "503", "524", "529", "5XX"}, httpRes.StatusCode) { _httpRes, err := s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) if err != nil { return nil, err diff --git a/types/stream/stream.go b/types/stream/stream.go index f590f265..dcc0d374 100644 --- a/types/stream/stream.go +++ b/types/stream/stream.go @@ -26,41 +26,21 @@ var ( bom = "\uFEFF" ) -// maxBoundaryLen is the length of the longest message boundary (\r\n\r\n). -const maxBoundaryLen = 4 - -// maxEventSize bounds a single server-sent event. The scanner buffer grows on -// demand, so this caps pathological streams without reserving memory up front. -const maxEventSize = 1 << 30 - -// newServerEventSplitter returns a stateful bufio.SplitFunc that only re-scans -// the trailing maxBoundaryLen-1 bytes across reads. That keeps large events -// linear to parse while still finding boundaries split across two chunks. -func newServerEventSplitter() bufio.SplitFunc { - scanned := 0 - return func(data []byte, atEOF bool) (advance int, token []byte, err error) { - if atEOF && len(data) == 0 { - return 0, nil, nil - } - - start := scanned - (maxBoundaryLen - 1) - if start < 0 { - start = 0 - } - - if result := boundary.FindIndex(data[start:]); result != nil { - scanned = 0 - return start + result[1], data[:start+result[0]], nil - } +func scanServerEvents(data []byte, atEOF bool) (advance int, token []byte, err error) { + if atEOF && len(data) == 0 { + return 0, nil, nil + } - if atEOF { - scanned = 0 - return len(data), bytes.TrimRight(data, "\r\n"), nil - } + result := boundary.FindIndex(data) + if result != nil { + return result[1], data[:result[0]], nil + } - scanned = len(data) - return 0, nil, nil + if atEOF { + return len(data), bytes.TrimRight(data, "\r\n"), nil } + + return 0, nil, nil } type EventType interface { @@ -90,8 +70,7 @@ func NewEventStream[T any]( opts ...func(*EventStream[T]), ) *EventStream[T] { scanner := bufio.NewScanner(source) - scanner.Buffer(nil, maxEventSize) - scanner.Split(newServerEventSplitter()) + scanner.Split(scanServerEvents) var src io.ReadCloser if s, ok := source.(io.ReadCloser); ok { diff --git a/videogeneration.go b/videogeneration.go index f0a742ea..aec763c4 100644 --- a/videogeneration.go +++ b/videogeneration.go @@ -185,7 +185,7 @@ func (s *VideoGeneration) Generate(ctx context.Context, request components.Video _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) return nil, err - } else if utils.MatchStatusCodes([]string{"4XX", "5XX"}, httpRes.StatusCode) { + } else if utils.MatchStatusCodes([]string{"400", "401", "402", "404", "429", "4XX", "500", "5XX"}, httpRes.StatusCode) { _httpRes, err := s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) if err != nil { return nil, err @@ -520,7 +520,7 @@ func (s *VideoGeneration) GetGeneration(ctx context.Context, jobID string, opts _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) return nil, err - } else if utils.MatchStatusCodes([]string{"4XX", "5XX"}, httpRes.StatusCode) { + } else if utils.MatchStatusCodes([]string{"401", "404", "4XX", "500", "5XX"}, httpRes.StatusCode) { _httpRes, err := s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) if err != nil { return nil, err @@ -797,7 +797,7 @@ func (s *VideoGeneration) GetVideoContent(ctx context.Context, jobID string, ind _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) return nil, err - } else if utils.MatchStatusCodes([]string{"4XX", "5XX"}, httpRes.StatusCode) { + } else if utils.MatchStatusCodes([]string{"400", "401", "404", "4XX", "500", "502", "5XX"}, httpRes.StatusCode) { _httpRes, err := s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) if err != nil { return nil, err @@ -1097,7 +1097,7 @@ func (s *VideoGeneration) ListVideosModels(ctx context.Context, opts ...operatio _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) return nil, err - } else if utils.MatchStatusCodes([]string{"4XX", "5XX"}, httpRes.StatusCode) { + } else if utils.MatchStatusCodes([]string{"400", "4XX", "500", "5XX"}, httpRes.StatusCode) { _httpRes, err := s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) if err != nil { return nil, err diff --git a/workspaces.go b/workspaces.go index 1a1aa836..f9f69295 100644 --- a/workspaces.go +++ b/workspaces.go @@ -187,7 +187,7 @@ func (s *Workspaces) List(ctx context.Context, offset optionalnullable.OptionalN _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) return nil, err - } else if utils.MatchStatusCodes([]string{"4XX", "5XX"}, httpRes.StatusCode) { + } else if utils.MatchStatusCodes([]string{"401", "4XX", "500", "5XX"}, httpRes.StatusCode) { _httpRes, err := s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) if err != nil { return nil, err @@ -489,7 +489,7 @@ func (s *Workspaces) Create(ctx context.Context, request components.CreateWorksp _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) return nil, err - } else if utils.MatchStatusCodes([]string{"4XX", "5XX"}, httpRes.StatusCode) { + } else if utils.MatchStatusCodes([]string{"400", "401", "403", "4XX", "500", "5XX"}, httpRes.StatusCode) { _httpRes, err := s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) if err != nil { return nil, err @@ -782,7 +782,7 @@ func (s *Workspaces) Delete(ctx context.Context, id string, opts ...operations.O _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) return nil, err - } else if utils.MatchStatusCodes([]string{"4XX", "5XX"}, httpRes.StatusCode) { + } else if utils.MatchStatusCodes([]string{"400", "401", "403", "404", "4XX", "500", "5XX"}, httpRes.StatusCode) { _httpRes, err := s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) if err != nil { return nil, err @@ -1096,7 +1096,7 @@ func (s *Workspaces) Get(ctx context.Context, id string, opts ...operations.Opti _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) return nil, err - } else if utils.MatchStatusCodes([]string{"4XX", "5XX"}, httpRes.StatusCode) { + } else if utils.MatchStatusCodes([]string{"401", "404", "4XX", "500", "5XX"}, httpRes.StatusCode) { _httpRes, err := s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) if err != nil { return nil, err @@ -1376,7 +1376,7 @@ func (s *Workspaces) Update(ctx context.Context, id string, updateWorkspaceReque _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) return nil, err - } else if utils.MatchStatusCodes([]string{"4XX", "5XX"}, httpRes.StatusCode) { + } else if utils.MatchStatusCodes([]string{"400", "401", "403", "404", "4XX", "500", "5XX"}, httpRes.StatusCode) { _httpRes, err := s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) if err != nil { return nil, err @@ -1542,6 +1542,853 @@ func (s *Workspaces) Update(ctx context.Context, id string, updateWorkspaceReque } +// ListBudgets - List workspace budgets +// List all budgets configured for a workspace. [Management key](/docs/guides/overview/auth/management-api-keys) required. +func (s *Workspaces) ListBudgets(ctx context.Context, id string, opts ...operations.Option) (*components.ListWorkspaceBudgetsResponse, error) { + request := operations.ListWorkspaceBudgetsRequest{ + ID: id, + } + + 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, "/workspaces/{id}/budgets", 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: "listWorkspaceBudgets", + OAuth2Scopes: nil, + SecuritySource: s.sdkConfiguration.Security, + } + + 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, "GET", opURL, nil) + 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 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{"401", "404", "4XX", "500", "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.ListWorkspaceBudgetsResponse + 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 == 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 == 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 == 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 >= 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 + +} + +// DeleteBudget - Delete a workspace budget +// Remove the budget for a given interval. [Management key](/docs/guides/overview/auth/management-api-keys) required. +func (s *Workspaces) DeleteBudget(ctx context.Context, id string, interval components.WorkspaceBudgetInterval, opts ...operations.Option) (*components.DeleteWorkspaceBudgetResponse, error) { + request := operations.DeleteWorkspaceBudgetRequest{ + ID: id, + Interval: interval, + } + + 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, "/workspaces/{id}/budgets/{interval}", 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: "deleteWorkspaceBudget", + OAuth2Scopes: nil, + SecuritySource: s.sdkConfiguration.Security, + } + + 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, "DELETE", opURL, nil) + 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 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{"401", "404", "4XX", "500", "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.DeleteWorkspaceBudgetResponse + 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 == 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 == 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 == 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 >= 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 + +} + +// SetBudget - Create or update a workspace budget +// Create or update the budget for a given interval. Budget limits must strictly decrease as the interval narrows (lifetime > monthly > weekly > daily). [Management key](/docs/guides/overview/auth/management-api-keys) required. +func (s *Workspaces) SetBudget(ctx context.Context, id string, interval components.WorkspaceBudgetInterval, upsertWorkspaceBudgetRequest components.UpsertWorkspaceBudgetRequest, opts ...operations.Option) (*components.UpsertWorkspaceBudgetResponse, error) { + request := operations.UpsertWorkspaceBudgetRequest{ + ID: id, + Interval: interval, + UpsertWorkspaceBudgetRequest: upsertWorkspaceBudgetRequest, + } + + 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, "/workspaces/{id}/budgets/{interval}", 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: "upsertWorkspaceBudget", + OAuth2Scopes: nil, + SecuritySource: s.sdkConfiguration.Security, + } + bodyReader, reqContentType, err := utils.SerializeRequestBody(ctx, request, false, false, "UpsertWorkspaceBudgetRequest", "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{"400", "401", "404", "4XX", "500", "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.UpsertWorkspaceBudgetResponse + 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 == 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 == 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 >= 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 + +} + // BulkAddMembers - Bulk add members to a workspace // Add multiple organization members to a workspace. Members are assigned the same role they hold in the organization. [Management key](/docs/guides/overview/auth/management-api-keys) required. func (s *Workspaces) BulkAddMembers(ctx context.Context, id string, bulkAddWorkspaceMembersRequest components.BulkAddWorkspaceMembersRequest, opts ...operations.Option) (*components.BulkAddWorkspaceMembersResponse, error) { @@ -1698,7 +2545,7 @@ func (s *Workspaces) BulkAddMembers(ctx context.Context, id string, bulkAddWorks _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) return nil, err - } else if utils.MatchStatusCodes([]string{"4XX", "5XX"}, httpRes.StatusCode) { + } else if utils.MatchStatusCodes([]string{"400", "401", "403", "404", "4XX", "500", "5XX"}, httpRes.StatusCode) { _httpRes, err := s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) if err != nil { return nil, err @@ -2020,7 +2867,7 @@ func (s *Workspaces) BulkRemoveMembers(ctx context.Context, id string, bulkRemov _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) return nil, err - } else if utils.MatchStatusCodes([]string{"4XX", "5XX"}, httpRes.StatusCode) { + } else if utils.MatchStatusCodes([]string{"400", "401", "403", "404", "4XX", "500", "5XX"}, httpRes.StatusCode) { _httpRes, err := s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) if err != nil { return nil, err