diff --git a/.github/workflows/notify-monorepo.yaml b/.github/workflows/notify-monorepo.yaml deleted file mode 100644 index b233b98c..00000000 --- a/.github/workflows/notify-monorepo.yaml +++ /dev/null @@ -1,46 +0,0 @@ -name: Notify Monorepo of Changes - -on: - push: - branches: - - main - -jobs: - notify-monorepo: - runs-on: ubuntu-latest - steps: - - name: Send repository dispatch to monorepo - run: | - # Determine which event type to send based on repository name - REPO_NAME="${GITHUB_REPOSITORY#*/}" # Gets 'typescript-sdk' from 'OpenRouterTeam/typescript-sdk' - - case "$REPO_NAME" in - "typescript-sdk") - EVENT_TYPE="sync-typescript-sdk" - ;; - "python-sdk") - EVENT_TYPE="sync-python-sdk" - ;; - "ai-sdk-provider") - EVENT_TYPE="sync-ai-sdk-provider" - ;; - "cli") - EVENT_TYPE="sync-cli" - ;; - *) - echo "Unknown repository: $REPO_NAME" - exit 1 - ;; - esac - - echo "Sending repository_dispatch event: $EVENT_TYPE" - - curl -L \ - -X POST \ - -H "Accept: application/vnd.github+json" \ - -H "Authorization: Bearer ${{ secrets.MONOREPO_SYNC_TOKEN }}" \ - -H "X-GitHub-Api-Version: 2022-11-28" \ - https://api.github.com/repos/OpenRouterTeam/openrouter-web/dispatches \ - -d "{\"event_type\":\"$EVENT_TYPE\",\"client_payload\":{\"repository\":\"$GITHUB_REPOSITORY\",\"ref\":\"$GITHUB_REF\",\"sha\":\"$GITHUB_SHA\"}}" - - echo "✅ Notification sent to monorepo" diff --git a/.github/workflows/sdk_generation.yaml b/.github/workflows/sdk_generation.yaml deleted file mode 100644 index 70623aba..00000000 --- a/.github/workflows/sdk_generation.yaml +++ /dev/null @@ -1,35 +0,0 @@ -name: Generate -permissions: - checks: write - contents: write - pull-requests: write - statuses: write - id-token: write -"on": - workflow_dispatch: - inputs: - force: - description: Force generation of SDKs - type: boolean - default: false - set_version: - description: optionally set a specific SDK version - type: string - schedule: - - cron: 0 0 * * * - pull_request: - types: - - labeled - - unlabeled - -jobs: - generate: - uses: speakeasy-api/sdk-generation-action/.github/workflows/workflow-executor.yaml@v15 - with: - force: ${{ github.event.inputs.force }} - mode: pr - set_version: ${{ github.event.inputs.set_version }} - secrets: - github_access_token: ${{ secrets.GITHUB_TOKEN }} - npm_token: ${{ secrets.NPM_TOKEN }} - speakeasy_api_key: ${{ secrets.SPEAKEASY_API_KEY }} diff --git a/.github/workflows/sdk_generation_for_spec_change.yaml b/.github/workflows/sdk_generation_for_spec_change.yaml deleted file mode 100644 index 69ff1898..00000000 --- a/.github/workflows/sdk_generation_for_spec_change.yaml +++ /dev/null @@ -1,36 +0,0 @@ -name: Generate (spec change merged) -permissions: - checks: write - contents: write - pull-requests: write - statuses: write - id-token: write -"on": - workflow_dispatch: - inputs: - force: - description: Force generation of SDKs - type: boolean - default: false - set_version: - description: optionally set a specific SDK version - type: string - pull_request: - types: [closed] - branches: - - main - paths: - - .speakeasy/in.openapi.yaml - -jobs: - generate: - if: github.event.pull_request.merged == true - uses: speakeasy-api/sdk-generation-action/.github/workflows/workflow-executor.yaml@v15 - with: - force: ${{ github.event.inputs.force }} - mode: direct - set_version: ${{ github.event.inputs.set_version }} - secrets: - github_access_token: ${{ secrets.GITHUB_TOKEN }} - npm_token: ${{ secrets.NPM_TOKEN }} - speakeasy_api_key: ${{ secrets.SPEAKEASY_API_KEY }} diff --git a/.github/workflows/speakeasy_run_on_pr.yaml b/.github/workflows/speakeasy_run_on_pr.yaml deleted file mode 100644 index 3f9cf3e7..00000000 --- a/.github/workflows/speakeasy_run_on_pr.yaml +++ /dev/null @@ -1,56 +0,0 @@ -name: Run Speakeasy on PR - -permissions: - contents: write - pull-requests: write - -on: - workflow_dispatch: - pull_request: - paths: - - .speakeasy/in.openapi.yaml - -jobs: - run-speakeasy: - runs-on: ubuntu-latest - steps: - - name: Checkout code - uses: actions/checkout@v4 - with: - ref: ${{ github.event.pull_request.head.ref }} - token: ${{ secrets.GITHUB_TOKEN }} - - - name: Install pnpm - uses: pnpm/action-setup@v4 - - - name: Setup Node.js - uses: actions/setup-node@v4 - with: - node-version: '22' - cache: 'pnpm' - - - name: Install Speakeasy CLI - run: | - curl -fsSL https://raw.githubusercontent.com/speakeasy-api/speakeasy/main/install.sh | sh - # Verify speakeasy command is available - if ! command -v speakeasy &> /dev/null; then - echo "Error: speakeasy command not found after installation" - exit 1 - fi - speakeasy --version - - - name: Run Speakeasy - run: speakeasy run - env: - SPEAKEASY_API_KEY: ${{ secrets.SPEAKEASY_API_KEY }} - - - name: Validate SDK - uses: ./.github/actions/validate-sdk - with: - openrouter-api-key: ${{ secrets.OPENROUTER_API_KEY }} - - - name: Auto-commit generated SDK and API docs - uses: int128/update-generated-files-action@v2 - with: - # Set a custom message to the new commit (optional) - commit-message: 'Chore: auto-generate SDK and API documentation' \ No newline at end of file diff --git a/.speakeasy/gen.lock b/.speakeasy/gen.lock index e514346a..1d87c58b 100644 --- a/.speakeasy/gen.lock +++ b/.speakeasy/gen.lock @@ -1,19 +1,19 @@ lockVersion: 2.0.0 id: 8b6cd71c-ea04-44da-af45-e43968b5928d management: - docChecksum: 120c7bd50799b56de18af00857c12323 + docChecksum: c50f2669e6776c80d7a62a1d66c5731d docVersion: 1.0.0 speakeasyVersion: 1.680.0 generationVersion: 2.788.4 - releaseVersion: 0.3.14 - configChecksum: 87c16d84987e46f9fa5175fdaa9f27d4 + releaseVersion: 0.3.15 + configChecksum: 86e42ece722ff8ae176d12f7307d460e repoURL: https://github.com/OpenRouterTeam/typescript-sdk.git installationURL: https://github.com/OpenRouterTeam/typescript-sdk published: true persistentEdits: - generation_id: ba629f9b-a13d-42b4-ae14-31b3a9f796d0 - pristine_commit_hash: 0c910f8d50c78a8b98dd0f9045160274f66e50e8 - pristine_tree_hash: c610add66b4de63f43b82dc14d6839f5b3c26e68 + generation_id: 3f64101f-9a83-4fa4-82d5-d78cfabf0a4f + pristine_commit_hash: 4729526723c7ff13fb64ff724662126a0f864df6 + pristine_tree_hash: 7927df5636e028780bddba64ceadc5757df2f6bd features: typescript: acceptHeaders: 2.81.2 @@ -88,12 +88,16 @@ trackedFiles: pristine_git_object: 342542484892f40ebac8a4113f6016114e16f3ee docs/models/assistantmessage.md: id: 7e0218023943 - last_write_checksum: sha1:647554fa2083998aba357a6815f14957280e98f7 - pristine_git_object: 93ce87bd103b4883cb3ef2f9f28c41a4c11f7316 + last_write_checksum: sha1:80275e020c8b69ffc7e39513458d711b9d8e70e2 + pristine_git_object: 2dd55da12b6097bd7d6f15565b5c025b1425695a docs/models/assistantmessagecontent.md: id: 9f1795bbe642 last_write_checksum: sha1:dd290dd2754fd452f1ed8c026a00e310bfd7bd03 pristine_git_object: 30a5052e885de59078f12eb3138aaf1a84e5489f + docs/models/assistantmessageimageurl.md: + id: 89b928e0a518 + last_write_checksum: sha1:68c6814ef6cbdb154d8273a74ef4eb24b6500de8 + pristine_git_object: 9d5905789df53eb9c10546de59f7c7fbea379869 docs/models/badgatewayresponseerrordata.md: id: 15451fc8cf63 last_write_checksum: sha1:7d1bd0317b5d98eaf83c5d46b9feca3f7f0b0d59 @@ -216,12 +220,16 @@ trackedFiles: pristine_git_object: 1ed1fa42ecf4d8eae94409b6b9854bbb6550abdc docs/models/chatmessagecontentitemimage.md: id: 1667af650eed - last_write_checksum: sha1:d7323bac24f0bd4cb745f45fe02fec9ad05de4ed - pristine_git_object: 335bfe65d42ef0b4e04a1acf1ca267921cfae001 + last_write_checksum: sha1:57bb5db3f39e53cdfd5fd9d1f1fb58e0e30c1847 + pristine_git_object: 662a771cd4a8a01da0cdbf498d9c9e378148e448 docs/models/chatmessagecontentitemimagedetail.md: id: 272727de90f6 last_write_checksum: sha1:326bb87cf34234ec6cff3b11315fcccf1989480c pristine_git_object: 20db7846d9843b673c46cd0818b981c7c84d6920 + docs/models/chatmessagecontentitemimageimageurl.md: + id: c964e80bffd8 + last_write_checksum: sha1:5314ed41308fb1c30878ed11adbfbcc1d5a5aa99 + pristine_git_object: a3891c144a1b56bae45dd6b2f88d6a0197b24692 docs/models/chatmessagecontentitemtext.md: id: bf54b5b4ee77 last_write_checksum: sha1:eeeba8f13a0abf0c29c7cdcb7aba2a6f1f62e04f @@ -264,16 +272,16 @@ trackedFiles: pristine_git_object: 2cab9bbcc7c800c6ea33f8310009f34dbffa3abc docs/models/chatresponsechoice.md: id: 7248e25b3cf8 - last_write_checksum: sha1:9c6f84a401e8c5f4676c967ee1e9e6ca40a1521c - pristine_git_object: 40a6a234710875566c9421a54328222919aabc32 + last_write_checksum: sha1:5f9fb35a59a0551011befe8c2260a5be6d5c9bcb + pristine_git_object: 58451f44fcb9fc051be685c8bdfde611b37cd0c1 docs/models/chatstreamingchoice.md: id: 0a39074d9acc last_write_checksum: sha1:ff3df385fb1fd9bae1b7060aabcf6c07148eda69 pristine_git_object: 8751bd5a0caaac21f3726acb067e08acd1432776 docs/models/chatstreamingmessagechunk.md: id: f904722b1ed6 - last_write_checksum: sha1:ca0c8a7a9c445fba84cfcd3c311766d0c17de5aa - pristine_git_object: 58e7d665898eafab2c9a3989328ca06ae3505ba2 + last_write_checksum: sha1:c12b4bb78aede7b4137c82519a77377d6495eec5 + pristine_git_object: 0c2e453be129f1ad1d2be28b69da6aaaadd7d556 docs/models/chatstreamingmessagechunkrole.md: id: 570be00c9576 last_write_checksum: sha1:43c1a234e149f4d104ea3403ff0eada9c25a04a9 @@ -466,14 +474,14 @@ trackedFiles: id: dcfaa46a8072 last_write_checksum: sha1:537f35817149cc4ffceb887b02cd81ce8ad5b676 pristine_git_object: 4e7b81d30f9eac494a9e2b5c4167dced3c7f4e0f + docs/models/image.md: + id: 6f8629b533b3 + last_write_checksum: sha1:ea892b9c2a64f521cf80a4be3a54cf55498b1eac + pristine_git_object: 54823863c70d87ea6386213e81363864c1961cde docs/models/imagegenerationstatus.md: id: 3d5a75816868 last_write_checksum: sha1:0c95ad71f4207dfb87bf19129d84b06e4d3cc7e1 pristine_git_object: e302b7849859fdf85389980aa95ce1ab12ae05f7 - docs/models/imageurl.md: - id: e75dd23cec1d - last_write_checksum: sha1:b1ff0c7dce18f9cdbc3215163fee414fb9293f67 - pristine_git_object: ccc845e896efe860357f406dc90d721b3b78a892 docs/models/inputmodality.md: id: 4f5310c12bd7 last_write_checksum: sha1:c9ce83fceb1507d9a18af305456a98cf4eb0f173 @@ -520,8 +528,8 @@ trackedFiles: pristine_git_object: 81727872b2ab71047358eedf339f81f53ed17bcd docs/models/model.md: id: 66e0236ac289 - last_write_checksum: sha1:0838137dd59f66921fd571f3720c5a466aaa6ae4 - pristine_git_object: 0af49977c2eeee7146e494519d18a73e3b7fe937 + last_write_checksum: sha1:eb75b1300cfe9248668c8a0fb9ae8ecf2c5dd7ad + pristine_git_object: cac0629ab55781d3c287887f5c29a5ee06168c88 docs/models/modelarchitecture.md: id: 7eab960e8441 last_write_checksum: sha1:b0fc4a5562c42268752c5da883ccba22e8294b93 @@ -1098,10 +1106,62 @@ trackedFiles: id: e006095ee88d last_write_checksum: sha1:f0f8a359c5ab972efccac02b9fb34a00b5851d03 pristine_git_object: fab31645d46330add55d8d4641a80cd946663b97 + docs/models/operations/bulkassignkeystoguardrailrequest.md: + id: eec92c190ec4 + last_write_checksum: sha1:f9cf743eed8de520b0916b39f0fa3978dbec7234 + pristine_git_object: 9e08721f206b8581f7e28510f804f6a4bd8d51ad + docs/models/operations/bulkassignkeystoguardrailrequestbody.md: + id: 5f4b03d3ad7d + last_write_checksum: sha1:7f7649e3c8a7de3494a0ed89bb2f246688b679d8 + pristine_git_object: a7ed0dcf35cd39db9f4bc40240659ef2856c9f3d + docs/models/operations/bulkassignkeystoguardrailresponse.md: + id: 6a2fd0d5d182 + last_write_checksum: sha1:e516aea1274973906af4353c2b75016471736c88 + pristine_git_object: a9b6b30ca59a9cc937a2c3cf3015d0deb8fbbaab + docs/models/operations/bulkassignmemberstoguardrailrequest.md: + id: 6d07250d41fb + last_write_checksum: sha1:ff7d6d878fafcce3a94b160a5018934f9d3c193b + pristine_git_object: 89f7f48f821727550c006d35d088a70aca6458c8 + docs/models/operations/bulkassignmemberstoguardrailrequestbody.md: + id: 901e5406cc36 + last_write_checksum: sha1:694c378c7fb368a63b8797edbbc31161db92c192 + pristine_git_object: a1b888275fcba9a94c92224ce068bb40cb278bd3 + docs/models/operations/bulkassignmemberstoguardrailresponse.md: + id: d981e5ad2eb4 + last_write_checksum: sha1:5d033baf3b7956b6a774462336204fa1e120a397 + pristine_git_object: 6f83d903b69b867518e6867abebf8fe19a0bdbc8 + docs/models/operations/bulkunassignkeysfromguardrailrequest.md: + id: 11b8284d978b + last_write_checksum: sha1:9d0e41c63e7f8787101f97a2f66df8be2a7fa5d3 + pristine_git_object: 15752856b68dd0ac19ddb3a89ac6a72fe49b412e + docs/models/operations/bulkunassignkeysfromguardrailrequestbody.md: + id: 70c081957fd7 + last_write_checksum: sha1:0ef603ea9b21005fba34c0a16a217cecca35660a + pristine_git_object: 5a1b1ad37d6a0d34603e6e693b1b67ec3854142c + docs/models/operations/bulkunassignkeysfromguardrailresponse.md: + id: 04155d81cc22 + last_write_checksum: sha1:b5085fb21424a2d9c1bc2062e32641dd13378e3c + pristine_git_object: c77c8c7788c83b34e67b96fa4e4ee80b5863f83e + docs/models/operations/bulkunassignmembersfromguardrailrequest.md: + id: 18d0efe64297 + last_write_checksum: sha1:478b83f4d2bc2b9aaea80ba2c05c260abaf52c8f + pristine_git_object: dbae577545a02970a94cd74712111639bf9d2c8d + docs/models/operations/bulkunassignmembersfromguardrailrequestbody.md: + id: 88aa17ef2fc4 + last_write_checksum: sha1:b38c129d01e1da2f5949e0ff0acf1a8e3519a3f0 + pristine_git_object: 82ae5400dd7451710f20dffc0fef90081babb53a + docs/models/operations/bulkunassignmembersfromguardrailresponse.md: + id: cd55826aaa0b + last_write_checksum: sha1:0a20ebfffcac64297a3e144220fd7a6c8fda7155 + pristine_git_object: a35686705068da84815519a0012adcf6f6363359 docs/models/operations/calldata.md: id: 61fd699260b7 last_write_checksum: sha1:59c23ee14134f0af662207b7dfd26978cd9a3675 pristine_git_object: d630cf8a4fb642abcbafa927ff8f4af3218c9f3d + docs/models/operations/category.md: + id: 38b5d89ba971 + last_write_checksum: sha1:47e40498564ccac034911b8a98290de0763f5053 + pristine_git_object: 48e45f3dbb7369b8acffc418f70ae96f9d761661 docs/models/operations/content.md: id: d236fe045b84 last_write_checksum: sha1:fbb1907acac878031d5a41b7fbe49a9d5ef8d0e2 @@ -1158,10 +1218,30 @@ trackedFiles: id: 2b379b986bdb last_write_checksum: sha1:45d20471e0cef861e7707c4fd727764ba64bcf55 pristine_git_object: 18423c1dfd4f45eae5667c74b1b1be2bfd76af72 + docs/models/operations/createguardraildata.md: + id: d3bba8a28f74 + last_write_checksum: sha1:89ca610736996c2170dfebed62f592983b3dd3aa + pristine_git_object: ed6f0ffd882f6d356b7b3ba85b173b00e4fc11d3 + docs/models/operations/createguardrailrequest.md: + id: ff2eac26fe01 + last_write_checksum: sha1:f4c6952f646dcd88d7d0df7233c32fc241eed525 + pristine_git_object: c75ff0c5e750f2d0809a21c8934ba4663a89417c + docs/models/operations/createguardrailresetintervalrequest.md: + id: 939a4d83737f + last_write_checksum: sha1:59ab737443e59659d300208a25fdd2567c8b6941 + pristine_git_object: c0531b1945721a8865e1db239ce121cbd5995ff7 + docs/models/operations/createguardrailresetintervalresponse.md: + id: 20f91ff333af + last_write_checksum: sha1:3ab569e444d3486a2a11f425b2dc56abf9928e80 + pristine_git_object: 303f5c0935f2872bfdd02e5d29b269f106bbceda + docs/models/operations/createguardrailresponse.md: + id: 357ae04b4e21 + last_write_checksum: sha1:a1f157dd8e6bc4469b3f90cd36faf22fdda155aa + pristine_git_object: 72be69503b50661caae78a7804ce948e756c41ed docs/models/operations/createkeysdata.md: id: 9cbfcb7edadb - last_write_checksum: sha1:adb397bedeeae818273dcb30f96407afe7cfd405 - pristine_git_object: eaace6a5211121c2ab7efca0cd4f586995189bdb + last_write_checksum: sha1:4e46484e82eca32ed6521ba1fff6b73fd7cd5688 + pristine_git_object: b8f7e0debe5bad74170e73fa5d608e65cf55d2d0 docs/models/operations/createkeyslimitreset.md: id: 846e23790e8b last_write_checksum: sha1:5c70d714ca82e937445dd086d248625775e4ce6b @@ -1172,8 +1252,8 @@ trackedFiles: pristine_git_object: 8fe9354117f06cfdbb50512d3c65769cbb8281e5 docs/models/operations/createkeysresponse.md: id: dacec48ccb70 - last_write_checksum: sha1:7a69d7b9a6d3cf10af0c9996413acd8caac63032 - pristine_git_object: af927c6418f4bd515b87f52b41a3c7583c3eaff0 + last_write_checksum: sha1:1b021eb7fcb054226665a0ebe2c2765d43a0a14a + pristine_git_object: b71100d6a4167d918e53aeddb2ea473845fde410 docs/models/operations/createresponsesresponse.md: id: c55a819f0ab5 last_write_checksum: sha1:39dbcdedff28909f42372e8b7b9092b3fc225e46 @@ -1182,10 +1262,18 @@ trackedFiles: id: c0639e97c684 last_write_checksum: sha1:484f79490add59bf08bc521b3fc9f87c216f537d pristine_git_object: f546415b3380dad92d605b0d04b0638ae71e5b04 + docs/models/operations/deleteguardrailrequest.md: + id: 1bd1d6b15de5 + last_write_checksum: sha1:5288e6c4a70177749d39ece7c2a4fdab17fa8bcf + pristine_git_object: 76f8f60c67b0b4a1bbad19586f054a884f501b4b + docs/models/operations/deleteguardrailresponse.md: + id: d7079591d587 + last_write_checksum: sha1:b0772ea7a1458a5b463290f731f92c21bcdcff1b + pristine_git_object: ef931107083e4cd826ffb22de9c3dfa7f0070f3f docs/models/operations/deletekeysrequest.md: id: 88cb4c43ad9d - last_write_checksum: sha1:b3645ed005e3c0847c09422ec7b66175f01d927e - pristine_git_object: dee02cfd27403275d348b2bd87bfa500c6b4f00a + last_write_checksum: sha1:554e55711159216a2e79c2b5123c874f2f3d6c58 + pristine_git_object: 31df3c3a928edb71107b2a1f089565d5a1ccd222 docs/models/operations/deletekeysresponse.md: id: b7cb4fb91f4a last_write_checksum: sha1:584251965fcdfd8b0df2b6edafdd4945ac372018 @@ -1220,12 +1308,12 @@ trackedFiles: pristine_git_object: 04088051fb95d6bbbdcc4c7a57de1a806d2d6577 docs/models/operations/getcurrentkeydata.md: id: aac77b8e156f - last_write_checksum: sha1:3aeb26ce6f3efe80f60206759ba3681d805fe7d3 - pristine_git_object: 1cf7463991d59668f7e4a844eb41ca11f6ecf9c1 + last_write_checksum: sha1:26ec23226427f2e55a573ead3bacbdba0a28b4e6 + pristine_git_object: e5022bcc98e9581905b76913147fd62b1bfb99b3 docs/models/operations/getcurrentkeyresponse.md: id: 9477562332d8 - last_write_checksum: sha1:2e854b61cd6aa51a2b22f803f0805e4947209b43 - pristine_git_object: e6872cd11481540174740eb5929f5e84c307bd9c + last_write_checksum: sha1:a7b78f040cc4efd9ffddf7f91fed8455466fa252 + pristine_git_object: 26598ac54c0cb052834ba22240442161765fcd35 docs/models/operations/getgenerationdata.md: id: c47059f62af7 last_write_checksum: sha1:0fd2a05115edc6f810bfde1e821f9a56b5ff29ee @@ -1238,38 +1326,38 @@ trackedFiles: id: edafe5ee4596 last_write_checksum: sha1:90c4e9b37d13e90fa824cbb0de78ec05c0c0d3f0 pristine_git_object: 39a8787a05d52771433495dded2a09167014385e + docs/models/operations/getguardraildata.md: + id: 698e237b3e04 + last_write_checksum: sha1:c14d56c6919231412f80e05e5c882090de3e8c42 + pristine_git_object: 712c360c9d28c7049f48922bf6535cce05ed121d + docs/models/operations/getguardrailrequest.md: + id: 1e8ddf8ef10a + last_write_checksum: sha1:03acbcd430806d2344478317ecf08c360f33751e + pristine_git_object: f2eebd5fecdc22009440f369f30df401187c0c53 + docs/models/operations/getguardrailresetinterval.md: + id: 8f08f64080d1 + last_write_checksum: sha1:44188691a7122b8d67e66a3f2bcbcd05cec9967f + pristine_git_object: 1ab597dca4ee2192b2b5bc486a708218089ae4a6 + docs/models/operations/getguardrailresponse.md: + id: 158ac25881ae + last_write_checksum: sha1:7be991092f55aa8a3ab143910f90ca9a84c2cf12 + pristine_git_object: 8951e641c267958739f4eb76cda14430b3d5b3a2 docs/models/operations/getkeydata.md: id: 359964834be9 - last_write_checksum: sha1:2455639a3e3569807781df591dad86d5cf2e535b - pristine_git_object: 438836b04123f77a589c06af5eb1172e9434f784 + last_write_checksum: sha1:c51e809544752889db15665720f546a6d57ae3bc + pristine_git_object: 268e6252a9f64e00dcdc67536e2ef8f631d41f1a docs/models/operations/getkeyrequest.md: id: 0d12b1ba3d1a - last_write_checksum: sha1:23f4af8bf61680041fd8afffdd88c3801b7f40b9 - pristine_git_object: ceb8170aa6a65c51b933a5baf9d461d10dfbaaec + last_write_checksum: sha1:482b9fd95212808ca77c5f4119bf0bad7dcdefa9 + pristine_git_object: 9c8ac60dd55c64b9404cbe757c0071f262185191 docs/models/operations/getkeyresponse.md: id: f5617e59330f - last_write_checksum: sha1:11e446d985f6b05585e3f96ffeb50631fc21ec02 - pristine_git_object: b61a3fc51d68aec6e3f3588414a9d4d455ccae61 + last_write_checksum: sha1:29152a8d583c16ad1bffe4daca1037e2c074fc86 + pristine_git_object: c88cf75011f7bb8a4a9e0f1bb45fea343c5ffc07 docs/models/operations/getmodelsrequest.md: id: 801c51f5ac65 - last_write_checksum: sha1:afd708752019ec72b03ed25005df48e2aa0460ba - pristine_git_object: 15ad477f1ccb37758dcbfb4270726cedcf38811f - docs/models/operations/getparametersdata.md: - id: 559a072a24f4 - last_write_checksum: sha1:6a877154ee92110caa77c763d16f66456c0e2713 - pristine_git_object: 11b2eb081ecd466443ee9c6262c19bb9a9a4086e - docs/models/operations/getparametersrequest.md: - id: de9758bd0bb3 - last_write_checksum: sha1:3ec438d92c1e623118f37bfe57d90067e6917e66 - pristine_git_object: 15f7280212390e0e354ea254bb243f354f077fef - docs/models/operations/getparametersresponse.md: - id: 913f126a5387 - last_write_checksum: sha1:a71722c75de51aaa54267b9c19029ce03a96a7d0 - pristine_git_object: 21f93e9bf14753e66813c92a4d4de1c243a8ce7c - docs/models/operations/getparameterssecurity.md: - id: 4bf63676c998 - last_write_checksum: sha1:13a84dfe3ac610361af641c7293b7738e0625ee2 - pristine_git_object: 8070db235dcb7e41099306d63d7fccf4e1afb300 + last_write_checksum: sha1:218ecb4c447900eff609d72b19d8c3273ee47f92 + pristine_git_object: 4c0ac2a38470a58b9b57cb7ec6d42c0c27485423 docs/models/operations/getuseractivityrequest.md: id: 094eba1cffb3 last_write_checksum: sha1:31554e7857524860eee318b9642a1d3f8289a31d @@ -1292,8 +1380,8 @@ trackedFiles: pristine_git_object: d9f8b76324d689897fb59610c9a13e1a2d83fad1 docs/models/operations/listdata.md: id: d80bed3b167e - last_write_checksum: sha1:8e2ca8a6b883708f6dff8294c5a64903072bfd46 - pristine_git_object: 82696b400ef7cedd2cb8cdc19dbc727b1a05ad1d + last_write_checksum: sha1:3a43bd4a994a6d0be04cb91163b7307c61930e9b + pristine_git_object: f6a4c6fb9e93f9d5def231e51d4fd64269251044 docs/models/operations/listendpointsrequest.md: id: e52338ef5349 last_write_checksum: sha1:50bdf10df1d6a5bda2de313006b5ba68f7fe29d5 @@ -1306,6 +1394,70 @@ trackedFiles: id: 5c9c93477484 last_write_checksum: sha1:ff7e5de176d8a4e07a34ef0696e31436161f883f pristine_git_object: 5eddc9683f75eba1b619bc96d2e83fe1026bb83e + docs/models/operations/listguardrailkeyassignmentsdata.md: + id: 2449d3e220c5 + last_write_checksum: sha1:90c67668b39d1d9014650badbce2bf6eeaf65811 + pristine_git_object: 14a675121c0711d893ad996b79deee38f168cf3d + docs/models/operations/listguardrailkeyassignmentsrequest.md: + id: 0da98c6ebcd1 + last_write_checksum: sha1:4a83502f95837a2b21d6ae2520e74390321f10e7 + pristine_git_object: 0d59a1393bff873b271ab8f0d506a8c978099974 + docs/models/operations/listguardrailkeyassignmentsresponse.md: + id: e03a3c240b60 + last_write_checksum: sha1:98226493d1e8244993f796c0c315b1410a29c90a + pristine_git_object: 386a0775b25ff248944ee3a897b756b32471b457 + docs/models/operations/listguardrailmemberassignmentsdata.md: + id: 0f48e0c7bf39 + last_write_checksum: sha1:658762757fac748991893029e84f48cab0b72a0f + pristine_git_object: bccd30f3b2250f966048111d7f090554f60d895c + docs/models/operations/listguardrailmemberassignmentsrequest.md: + id: 09467f2fd854 + last_write_checksum: sha1:151bfd8031cce9e8d2a45949c84252b310e73785 + pristine_git_object: 46ad127aa78007ac126887ec616b953632b8935c + docs/models/operations/listguardrailmemberassignmentsresponse.md: + id: 192195db9749 + last_write_checksum: sha1:335f647ad7d76bdd149681bc88fe95c7e79230d4 + pristine_git_object: 297a6a8958e0024e63856f852593cbca1c76e49e + docs/models/operations/listguardrailsdata.md: + id: e3026e27f10f + last_write_checksum: sha1:8a085edd602ce3dbd2bd11a95ec064c94cdd067d + pristine_git_object: 4ff5e67df9b3b116299e795cbb17b7fafd1e7d87 + docs/models/operations/listguardrailsrequest.md: + id: 3ae99ee8cbd8 + last_write_checksum: sha1:934dc344a95e22aec14ba64fafdde789829906a8 + pristine_git_object: 41e0e510982cd64b603e460e407c6316b7d5048b + docs/models/operations/listguardrailsresetinterval.md: + id: 8fcdc9f3b5af + last_write_checksum: sha1:05b0271560f47f013f0c7d071f8c710871138843 + pristine_git_object: 6235d37e86a0ab8b4e0bd8d420e132d2ed113b51 + docs/models/operations/listguardrailsresponse.md: + id: 3d55593e8311 + last_write_checksum: sha1:000d04909a19f19c3ab3e65c775ec85f04378703 + pristine_git_object: f32e01e8003c7d73ab69190ddb7951f658fdb074 + docs/models/operations/listkeyassignmentsdata.md: + id: ba3435f6b2d1 + last_write_checksum: sha1:ff04fa1a32fceb4b46829466dcfe50a170a91c2f + pristine_git_object: e30d8132fdab61f06d909b2207a1e4b7c0924641 + docs/models/operations/listkeyassignmentsrequest.md: + id: cf678e788175 + last_write_checksum: sha1:94009e2928c5d9c18a6c027eb2b9ab5924dc8240 + pristine_git_object: b871e95d1a920d8b8c6656ba9c2fd542f3d84ee1 + docs/models/operations/listkeyassignmentsresponse.md: + id: 55f05a5d20ad + last_write_checksum: sha1:f65bc21e6582db5b85e12637b4a1c1dc185ccb2b + pristine_git_object: bdce9b8ec7692cfcafe0cfd99eb21c5fb074e59a + docs/models/operations/listmemberassignmentsdata.md: + id: ee3f4f34190c + last_write_checksum: sha1:d8161ec7de10c1e0659954fd5f468621be7298a6 + pristine_git_object: 52d097617cd3df704040c550e747a0636b35ff0f + docs/models/operations/listmemberassignmentsrequest.md: + id: 010cf517af0d + last_write_checksum: sha1:c5ebc64286cdffc906d1e2fd95ae6f3bde34f244 + pristine_git_object: 42bc1dfc8a1489e3823603a2baac4d24bbec8bda + docs/models/operations/listmemberassignmentsresponse.md: + id: e8da4e9e6027 + last_write_checksum: sha1:6299d28524846483d818ac55a0ebb93a416f71b7 + pristine_git_object: d9d9bb77d9f221b4586c800442fb88b091c8e3ba docs/models/operations/listmodelsusersecurity.md: id: 07a43f294881 last_write_checksum: sha1:0960a0a6dbece8266f287e905eb5e592024240f8 @@ -1324,8 +1476,8 @@ trackedFiles: pristine_git_object: c61f4c07895999bd03a1624ba768c715d50d784f docs/models/operations/listresponse.md: id: dcc8376da198 - last_write_checksum: sha1:141e0e26a7ec751c326e73e19863bc1a681a09e4 - pristine_git_object: 38ac9eab1c7efca0902dd747e6a4b40f4e4fc290 + last_write_checksum: sha1:fda1e6e94953122d214468da8c839b6d9fd0aa81 + pristine_git_object: e331fdc28e0f022a68b86eabf5c77412f6851b75 docs/models/operations/metadata.md: id: 4c22404ca93c last_write_checksum: sha1:0c48510c4e07e55f79753cd344f3f1270af6c6c8 @@ -1346,34 +1498,54 @@ trackedFiles: id: 3ca0009c143d last_write_checksum: sha1:d980d9f239a33291c75cc23670685caee888f768 pristine_git_object: 0f0bc60ac6266dee949e144880d2b394ab62d419 - docs/models/operations/supportedparameter.md: - id: 56c8589999e7 - last_write_checksum: sha1:a0904de8596819bf0ca997b1938cbd819806dbb6 - pristine_git_object: 46509631daec7c835d6572b38f1306a2f8ef61f6 docs/models/operations/transferintent.md: id: 4585adc299cd last_write_checksum: sha1:20096e1501c818b6229900c48845a340e10301fc pristine_git_object: be14c3de94902289b9f2d74ba7472aff1895bc08 + docs/models/operations/updateguardraildata.md: + id: 5b03440d96da + last_write_checksum: sha1:a23003257c4bf4aca6dddfd611e58c0bd88bbece + pristine_git_object: ca469f5d4264cda47dc0a8afd90735c03fb67348 + docs/models/operations/updateguardrailrequest.md: + id: 4750db2d4690 + last_write_checksum: sha1:e60b2f6668925a834c92bca16fc67bdb660db57f + pristine_git_object: 2213038c3fd29a6f98173df8b11017eb8d40beaf + docs/models/operations/updateguardrailrequestbody.md: + id: c4990d5fd9a9 + last_write_checksum: sha1:70b791be2249fa8cbb749f6bbd210f316c34ee84 + pristine_git_object: dec334ee59964888d99c59db4c43dcde479dfaea + docs/models/operations/updateguardrailresetintervalrequest.md: + id: 8535183822a9 + last_write_checksum: sha1:01433a87acb6eb0c88a1f34ac392d05bac8c62a5 + pristine_git_object: 65e8ee91049f34524ad63333ae2f67db02d7551b + docs/models/operations/updateguardrailresetintervalresponse.md: + id: b3d1e23bf314 + last_write_checksum: sha1:ac541148ce18b748d83ffebdd549fb9434775c69 + pristine_git_object: 0208b727fa6ddc695e52439fbbbbc3919bb9da1e + docs/models/operations/updateguardrailresponse.md: + id: 5c8279466bec + last_write_checksum: sha1:89514828edc7ed7ea47b933adfe9428343ee0752 + pristine_git_object: 2790251cd1e0c4d375772f3af21e7694b15cd0cf docs/models/operations/updatekeysdata.md: id: b58660ebb695 - last_write_checksum: sha1:87f4171ef84ad20124e81e067d4151c401845244 - pristine_git_object: e7eb14f7990a3b8562216d34c4933758c2a44233 + last_write_checksum: sha1:682862fea7bc47e5232a37789270ae125485f3f2 + pristine_git_object: cb9bc482707e82e6fa4c686137f6109c9cc0bff1 docs/models/operations/updatekeyslimitreset.md: id: e2a79a6b9e42 last_write_checksum: sha1:75d1bb1bad2c971834d18b317e073586b4254798 pristine_git_object: e6b17d013c129d585d241b0c468b4d52e42e987c docs/models/operations/updatekeysrequest.md: id: 153c6f74887d - last_write_checksum: sha1:59b91d26cb91b1e9fd3378901e14715b0f2043f7 - pristine_git_object: 1fb14f787ff5f92c7eb833aac94668209e8190b3 + last_write_checksum: sha1:76d15e98a5f3fbf357c401cc76093e017f5e8a62 + pristine_git_object: de2e53a1acf38fba9a4243851bead1eead94d2bb docs/models/operations/updatekeysrequestbody.md: id: 9971c36d6183 last_write_checksum: sha1:fa4431812f2f5f4dca931799fabf5f356d61ba16 pristine_git_object: 6d05aec30d0723da79ffe085c7bed17320dc9f61 docs/models/operations/updatekeysresponse.md: id: fb4d74ed0adc - last_write_checksum: sha1:e8a73ad6192d4c257b284099f1eb1db0273648b8 - pristine_git_object: b807076a24031c922d79ef25ff5af94fc908b3dc + last_write_checksum: sha1:27ea3ab29f6d1ce05bbc8b1d6a3efb011fb840f4 + pristine_git_object: 2fb6f1ed99613b05d5406733bad6b945b5d9f7e4 docs/models/operations/usage.md: id: 735448cf5655 last_write_checksum: sha1:4b96e81e4d478f4f489cc9b24728e5997641200f @@ -1842,26 +2014,26 @@ trackedFiles: id: a6b9414adf87 last_write_checksum: sha1:cb56c840833d6731dbc51fb7693dd4a7e114ba7f pristine_git_object: 387442526b3b98a40ec0c55d9fe005e34bdace67 - docs/models/schema3.md: - id: 082bedbd3961 - last_write_checksum: sha1:4dafe41e5fca394aa3f9d749ec989644176526c5 - pristine_git_object: 36adb6c1adab79b8f0e060efe510f8bd3726e3aa - docs/models/schema3reasoningencrypted.md: - id: c2c2507165de - last_write_checksum: sha1:2ba952dc15ca0ecd3774f2119489042cf303996b - pristine_git_object: c3b20ccc8dd4e0415162a97fc5ceea96dc76eb71 - docs/models/schema3reasoningsummary.md: - id: 3981a2d47866 - last_write_checksum: sha1:d4ce045253508cecb711a05030b53d42e2c02ede - pristine_git_object: 33cd68c6cb68ec2c113b5071c63535054bc46ab0 - docs/models/schema3reasoningtext.md: - id: f61407e89ec2 - last_write_checksum: sha1:cd1c71f0c0a5b24daafa357df29ec42af3930541 - pristine_git_object: b5190d0982fd8378394b8a1686fbd830aa76cead - docs/models/schema5.md: - id: 83e60f793ba8 - last_write_checksum: sha1:bdbc26cbac4dbcb332776887fd570bd6e8c91694 - pristine_git_object: 3c5e2232db08669a23eb7ae8a2a7f9b9fb9387c4 + docs/models/schema2.md: + id: a12cbe99ab08 + last_write_checksum: sha1:640fe4f2da5fedbd541af33afb50d175c05f3334 + pristine_git_object: ab034a0e594fa60709a17e5dce2e17160bcbb666 + docs/models/schema2reasoningencrypted.md: + id: af8a1f5e4e66 + last_write_checksum: sha1:3d8da44afeae72d071158501ecb34a3dabc908d4 + pristine_git_object: 24fb7373cf0404f90af41f5571b5edb458803d8a + docs/models/schema2reasoningsummary.md: + id: 245cacb40d90 + last_write_checksum: sha1:5aa1c379dea9abac494f2b8daf89139c3a19ac73 + pristine_git_object: 1ad716d89eab8b41d63ab2e423311894987815d0 + docs/models/schema2reasoningtext.md: + id: 6a04278d5596 + last_write_checksum: sha1:58d61ebc9d1909124166fb71a9915f7e61cc3036 + pristine_git_object: 4e5cbc9617682295aaf9aa3c2f73e854fbcd46ec + docs/models/schema4.md: + id: 30596726daf9 + last_write_checksum: sha1:4e10abe218c4fce89c8d3d3b1798e81be5287eea + pristine_git_object: 184b02af5ccb949987aedaf22da8610a5ee0b4c4 docs/models/security.md: id: 452e4d4eb67a last_write_checksum: sha1:1978f84a4c782f5ed85eb03074a6fa5e19f103c7 @@ -1984,12 +2156,12 @@ trackedFiles: pristine_git_object: 6b279535767db50cb216c9de64a85a91e0481399 docs/sdks/analytics/README.md: id: 4c84abb05030 - last_write_checksum: sha1:3de4fb474ac850323ff8eebb68a108439c9afc68 - pristine_git_object: 946cf79eda6ec94f03165c6a5070df75fa48489c + last_write_checksum: sha1:0ac8bf3bb425650cf3cf4068182ff63bb6cef729 + pristine_git_object: 57bb7a59c950b285c40752f7732d6efdf7d87689 docs/sdks/apikeys/README.md: id: e2bd25998427 - last_write_checksum: sha1:3269ca59aeba4b39cb62e8fb5d7824d81efd5bd4 - pristine_git_object: 75f9db4da02bcb21080e76413e347fcd8c7aea2f + last_write_checksum: sha1:c1b57e7d8790e752ff4e43eff2fd8366383c4248 + pristine_git_object: 9ec3c12cd1780f6ec2ba913d1d6d2784265be0d1 docs/sdks/chat/README.md: id: 393193527c2c last_write_checksum: sha1:e9835d2ade3798cbb689faf3f799a5c5a81edfee @@ -2000,8 +2172,8 @@ trackedFiles: pristine_git_object: e2dd1f3ed95d6b308853ffb44916fd27a1f8bb62 docs/sdks/credits/README.md: id: 81608135c0ff - last_write_checksum: sha1:2f323d94a0617a2b40d6b2ace42a2633213e5ab1 - pristine_git_object: f27be34f9f4edc7c6bbb95de4355b6e3a5a75c43 + last_write_checksum: sha1:953968e8d68d4142bc90932a9e75e97d1b39399b + pristine_git_object: 7cd662b6f588cf3dec7e4de00f0bb1ef32317ceb docs/sdks/embeddings/README.md: id: 15b5b04486c1 last_write_checksum: sha1:13539e73ec68120196c5ffc76d7598842434f012 @@ -2014,6 +2186,10 @@ trackedFiles: id: a7d12ae95fb1 last_write_checksum: sha1:a734d7a678e5382696096c55c2bd2a9167e4a86b pristine_git_object: 27039869da6346c244f32965ca825a6b4a170d7b + docs/sdks/guardrails/README.md: + id: f72b38a5a2a7 + last_write_checksum: sha1:e362c0c696fa96ac65b26035e83cb3994bd837b2 + pristine_git_object: ac187c2f368f5e034fec99dd00b0fffb00f2ba3e docs/sdks/models/README.md: id: b35bdf4bc7ed last_write_checksum: sha1:df01ecc0f9b06a8deb4e12171a13b8d29f29adc5 @@ -2022,10 +2198,6 @@ trackedFiles: id: 80ad2c1a7b62 last_write_checksum: sha1:029c27a675c3b34c1b2ab85d91e7046ece56a0b0 pristine_git_object: bda2fb7eda2208b18a69a90f48bee57838c2ef5e - docs/sdks/parameters/README.md: - id: bd84c52d4955 - last_write_checksum: sha1:2af13411aa2ae2fe4bbfff70b5e0d1a78fbe7660 - pristine_git_object: 305bad6c6913a4f8f94e239e040c9e0b808b9c6f docs/sdks/providers/README.md: id: b02aa45c0093 last_write_checksum: sha1:87a3ca7fdec1701c7be9c0a6fa7a19dca160fd5f @@ -2056,44 +2228,44 @@ trackedFiles: pristine_git_object: 410efafd6a7f50d91ccb87131fedbe0c3d47e15a jsr.json: id: 7f6ab7767282 - last_write_checksum: sha1:cb28be90286c87c9a525e17b304af1fbabe7a222 - pristine_git_object: afc764505f852c84de632602b3745244b40beb61 + last_write_checksum: sha1:892ef47a2c0421d033cdc45797abe226498b5c18 + pristine_git_object: 0d3a82c7f53be459b784e4a119958959b52ea560 package.json: id: 7030d0b2f71b - last_write_checksum: sha1:733263ddbf2b792126571dd842dcb2b5c3642848 - pristine_git_object: 4a5ade5f00a80b5b48ae48d1eef4fab661060b16 + last_write_checksum: sha1:322f143cdfdffe45e00b86d5e4a953360bcf7b98 + pristine_git_object: a66cfac23e62c0c28583771ad8531a4e54a955bb src/core.ts: id: f431fdbcd144 last_write_checksum: sha1:5aa66b0b6a5964f3eea7f3098c2eb3c0ee9c0131 pristine_git_object: 8747345312bcc83a569602bf521f20f0e1559fb1 src/funcs/analyticsGetUserActivity.ts: id: 6525bcc66ab5 - last_write_checksum: sha1:add74757e0493e18f836f20ad7edb9f3e09ade4b - pristine_git_object: 4768169a8fa36c19b9005244790525da4cacaf11 + last_write_checksum: sha1:eff74d85c6de6c9155c5b1b4bc64d5bd4b9b60d7 + pristine_git_object: 6a1d0231bab2ad54b4e5fa844206c606fdce3b9f src/funcs/apiKeysCreate.ts: id: 133e2c5f487c - last_write_checksum: sha1:a0071d5a8780621c57de720c485118420e48f56b - pristine_git_object: 2f05162d155120d366afe1a9a8733df53ef50d76 + last_write_checksum: sha1:9cd5e6a59326518681b10946d968be21fb422a30 + pristine_git_object: a35ebc9e9943e1c155f8157d4e707b02b2ee37a0 src/funcs/apiKeysDelete.ts: id: c151c399f75f - last_write_checksum: sha1:3fad589d2766f083ea4fce78ce9d434a631cee0e - pristine_git_object: b365c6d47419218607b55902254b17e63a41e09f + last_write_checksum: sha1:df819a6f554d03596b83641142dd54a6a5f9227d + pristine_git_object: c7ca0a5a83d6b109375a7d2b5d4d662559ced97b src/funcs/apiKeysGet.ts: id: 12a5c2abbddd - last_write_checksum: sha1:d539985b64c009767c46e7dafa04e4f70a00c237 - pristine_git_object: f17999907d51da1e1ef18599f360cf9fad0b7961 + last_write_checksum: sha1:0f8fa0afb004ace1c4e583a7120041cec2f764b3 + pristine_git_object: f91160ce4618e7fe2d1e9d334f1663f974428cbc src/funcs/apiKeysGetCurrentKeyMetadata.ts: id: d9449cb31931 last_write_checksum: sha1:a022d7d2ff5bdc0ba1b518f9bde4891da8dd876f pristine_git_object: 1f0aab979cd07afc45d64c9785fa32cb0b147eaf src/funcs/apiKeysList.ts: id: 2afc8d8f1ce0 - last_write_checksum: sha1:8debc5536d58f61a5976d94cc6626551bd350e28 - pristine_git_object: cdce44605188fca3b86be4f00e3bcddea5f83a63 + last_write_checksum: sha1:30101f227505cb9b06a21b6a7af95518e9615e90 + pristine_git_object: 54263571571c36aafb0d067b0a2c4b50db2bbef5 src/funcs/apiKeysUpdate.ts: id: 05700884934b - last_write_checksum: sha1:ba2c4e567f73b013767c99f39a15fb053746e373 - pristine_git_object: b41d43b0b84377f2834bce12265e1dd4cdef2899 + last_write_checksum: sha1:2ca88d97ca82fa23b3a2f35d697e6f6a30bf38a5 + pristine_git_object: 9851cbf5a855be8033bc3c7be20368637e4c7576 src/funcs/betaResponsesSend.ts: id: c5c4ab0c3f76 last_write_checksum: sha1:33b0c402b974f01eb56f5ca7abf80a9fd541af1a @@ -2112,8 +2284,8 @@ trackedFiles: pristine_git_object: 0acd1929c2aebd45f6f3a648e2e9336ac95e2cc1 src/funcs/creditsGetCredits.ts: id: 88fdc1315137 - last_write_checksum: sha1:815cbf4a2903acb91e264b2f1c310127b75e988b - pristine_git_object: 63149dcec7bc36e9502fd7a7140b26375116c540 + last_write_checksum: sha1:b7d6c5d404b06184ad97ec0a0da4ae5fbc6d771a + pristine_git_object: e3e944461a6bffe4d0b620b82d84b418e96ce57b src/funcs/embeddingsGenerate.ts: id: f6455fcfe2c8 last_write_checksum: sha1:05100d7c8466aaff3db0472c736e07e4f7790cd6 @@ -2134,6 +2306,58 @@ trackedFiles: id: dac2d205a08d last_write_checksum: sha1:c24ba6978d270d95c4dcc8368cea039c79afd33d pristine_git_object: b8418b55aef4a6a3459ea23d92746b95d9522146 + src/funcs/guardrailsBulkAssignKeys.ts: + id: a97261f248c8 + last_write_checksum: sha1:0b399adb8e5c8754adc72424d2a9ac4385511e96 + pristine_git_object: 349ed424b9ecc7da3a6640523a2e82a41d01d57c + src/funcs/guardrailsBulkAssignMembers.ts: + id: a1c1e49b5bfc + last_write_checksum: sha1:01267c4742927cccc02e188189beca91402beb59 + pristine_git_object: 671a83612c27cb8eefc5c6e5f2aadfa43e3dd672 + src/funcs/guardrailsBulkUnassignKeys.ts: + id: 605482eb28f5 + last_write_checksum: sha1:4c62d69aabd71809c60f1f4a758d394d830ebcc8 + pristine_git_object: 8187aeb0f715f1cceedad7d20ba145a10ac41239 + src/funcs/guardrailsBulkUnassignMembers.ts: + id: 582edea4287b + last_write_checksum: sha1:1cbede4c633e612575164c73b49f493fea828ce2 + pristine_git_object: c24c713293a4816909382688e3688af9b300bdb7 + src/funcs/guardrailsCreate.ts: + id: 6d61eb74274f + last_write_checksum: sha1:fb7caa59cf9d8fe3d83cb21a3168b3672503ce45 + pristine_git_object: 405792f9f4b8bc74a35c7bf6dc5093caa3169ccc + src/funcs/guardrailsDelete.ts: + id: 2ee7e7eaab9a + last_write_checksum: sha1:bc27081cfc8378dbd5a96c24798c6e0813e0f686 + pristine_git_object: 063eaa270138d60eb8f651df679fd7c8fdebbad6 + src/funcs/guardrailsGet.ts: + id: 259eaa63a20a + last_write_checksum: sha1:2ca1299283b879363b3a8edd53943e5075acb48b + pristine_git_object: 37a461663290a3327dbb32277616735fc4e438b5 + src/funcs/guardrailsList.ts: + id: 5a0c89687e40 + last_write_checksum: sha1:d20a43d3bc6f23cfa7821fb3f5242f3089e12b69 + pristine_git_object: 67b283079493bd4fb3599ec36f013a37eddb7de5 + src/funcs/guardrailsListGuardrailKeyAssignments.ts: + id: 524ae2fd5189 + last_write_checksum: sha1:6482898c40aa8e342e9758291024033a37b7c659 + pristine_git_object: dce5ef0c411b117ef95769466d71e3dcc13be9ca + src/funcs/guardrailsListGuardrailMemberAssignments.ts: + id: fc84c185d2b3 + last_write_checksum: sha1:22c8ad7759e9681f7c771d4decc61f472ebe34bb + pristine_git_object: 921b5c452b36d0c7ce844898281b8b28efa2d976 + src/funcs/guardrailsListKeyAssignments.ts: + id: f654b4f757b2 + last_write_checksum: sha1:b156ece9c760c184330425a500f949923eca1eb9 + pristine_git_object: ea724eca812c42201002cfba78f4824edbdbdc5b + src/funcs/guardrailsListMemberAssignments.ts: + id: c2762783a96a + last_write_checksum: sha1:f05a1ab18da48920150706ccaf0d368423e3bfbf + pristine_git_object: aa50a42b029dd4781c3bb3e06580ae46e9eb1804 + src/funcs/guardrailsUpdate.ts: + id: f8685ead7098 + last_write_checksum: sha1:71c45e34b139a7f99092cb05cdd5a680e0543e94 + pristine_git_object: 6b78c91a56954f855ef865c54ffc054de2bf78e7 src/funcs/modelsCount.ts: id: 371adfc67b48 last_write_checksum: sha1:c14a7b95052f30f2091146b2a2573df4c4ec93b4 @@ -2154,10 +2378,6 @@ trackedFiles: id: 3386ec12d934 last_write_checksum: sha1:214fa6f6b50d4cf65d015d7985379f79c1ee8ee3 pristine_git_object: 22eb8cd4452c452559063034cd2fde75518e57e8 - src/funcs/parametersGetParameters.ts: - id: 565ce9801e34 - last_write_checksum: sha1:ab11a60b9285cc34909b1b768c6058ec065374a0 - pristine_git_object: fe89f6f5f9fbaf9256e5826ef7631324a31ef602 src/funcs/providersList.ts: id: 8ad87e7210ae last_write_checksum: sha1:387318fa9e1d6604f0f64450d137a1041c50bed3 @@ -2176,16 +2396,16 @@ trackedFiles: pristine_git_object: ccd5e5d812cb4d21a1013c89f04daad9d2f72190 src/index.ts: id: c5fb850250c7 - last_write_checksum: sha1:7ed2a5fa061eff70d4a20f33fc3269c60a5b1821 - pristine_git_object: 35c2fb4c999bde2ca2b78b36088b052235d4bdff + last_write_checksum: sha1:8232ceb975ab0ad9abc06fe63c7ce79b18bb47d0 + pristine_git_object: bb0c15148be25feb935e2d50c35c072b516cbcb5 src/lib/base64.ts: id: "598522066688" last_write_checksum: sha1:26b234d589cc15afab76ac7aaba1dd1bd4b4a84c pristine_git_object: a187e58707bdb726ca2aff74941efe7493422d4e src/lib/config.ts: id: 320761608fb3 - last_write_checksum: sha1:aa7c67efe51a310aeb8dc170bd36d8ba2491920a - pristine_git_object: 05f65bba0270b70ffd835233c5233da723e8cece + last_write_checksum: sha1:16d7a26e65cd11dce836188617fe9c3cba2a66de + pristine_git_object: 2aabfd33da3a0cd637c8466f7da6f89ddc0b858e src/lib/dlv.ts: id: b1988214835a last_write_checksum: sha1:eaac763b22717206a6199104e0403ed17a4e2711 @@ -2252,8 +2472,8 @@ trackedFiles: pristine_git_object: c13ce72558d6d7e328189266bca17c00b433ab2a src/models/assistantmessage.ts: id: 2147a953e992 - last_write_checksum: sha1:bdd482fd611591d7a930f858621edf63a42f6526 - pristine_git_object: 6bebeafe2be73485883fe19ecb1a0ab3900339cf + last_write_checksum: sha1:ff3ec4dc627953d4eb85eea1e61838c5d1ef0bc3 + pristine_git_object: d8a2373cc192c952352eb71661d9dda4a940fbe8 src/models/badgatewayresponseerrordata.ts: id: de317517c298 last_write_checksum: sha1:0c142f4aa9e808430a0caffe3c454146875e7c56 @@ -2292,8 +2512,8 @@ trackedFiles: pristine_git_object: c368f9535a4557e2e2b00c847ebce3a97ff7b225 src/models/chatmessagecontentitemimage.ts: id: 3989cdc41817 - last_write_checksum: sha1:1350138399239ceae9e2550f339f808bcdc860b1 - pristine_git_object: 2d47383cd7a16fba7c9f3e967eb8e9d077646e46 + last_write_checksum: sha1:5108f45e6d55502ef909557e10835f2ddb5029ec + pristine_git_object: f5d965e2a0253d9b5a7fb8d01991c235834894cc src/models/chatmessagecontentitemtext.ts: id: 27089860fd98 last_write_checksum: sha1:e5bb74db5c23adf8c3dcc7cee12337dcaa67290b @@ -2320,16 +2540,16 @@ trackedFiles: pristine_git_object: e1e9ede103eab06b70a8e4516485761e20e19640 src/models/chatresponsechoice.ts: id: 7db13c3cc866 - last_write_checksum: sha1:0162303f35fcd1dcabec8202296bb98c825aee76 - pristine_git_object: cfbb8a52398b94fefedc0a67e19efeca3248e9c2 + last_write_checksum: sha1:185c84859c36e961bbe960b6ef3840051fc5d78a + pristine_git_object: 1d46bed8b3eafabe7c03fec2af45959853c6826c src/models/chatstreamingchoice.ts: id: 15346f0b1bc4 last_write_checksum: sha1:253079ffed3d4e533d1ea98f7b752ebe1d0b7bbd pristine_git_object: 43fa1d4cf1de1de8bd7fdd33c8a8260a9f6b3602 src/models/chatstreamingmessagechunk.ts: id: 339ee7e4b920 - last_write_checksum: sha1:12094088ae0cd735b9ffda446baa51486fee1930 - pristine_git_object: 9e132964e29254758e1f809941672f3def5bca56 + last_write_checksum: sha1:c5d55da96c8eee16d15f046e076fb05a4f2e9a2d + pristine_git_object: 2257efb36d7a9a929591d0bfa37902cfa66e2ba8 src/models/chatstreamingmessagetoolcall.ts: id: 74ba154581ba last_write_checksum: sha1:bff3523e97b1d522d79810caaf849509d1d9d280 @@ -2484,8 +2704,8 @@ trackedFiles: pristine_git_object: db61647cd182502b2b3b5333ee3a0bba66542645 src/models/index.ts: id: f93644b0f37e - last_write_checksum: sha1:9b327a6c0bc1a6e25705913d08bf8a861d194f0e - pristine_git_object: 081389c1839fba5dbd2640515092c1c03bfbbe99 + last_write_checksum: sha1:3f2f2cb39f1a66601f77c40fda5dc6b30edf6c04 + pristine_git_object: 9138a499f363feddd2d232e439d66048b0c3dc83 src/models/inputmodality.ts: id: 771d5d4c91ec last_write_checksum: sha1:7f742bf5a1e6b7953ea96df4c4cef29c602accad @@ -2512,8 +2732,8 @@ trackedFiles: pristine_git_object: 9c6974a680e006fc1cb3f31cf6ef42aa828d6af9 src/models/model.ts: id: b99d4c14e794 - last_write_checksum: sha1:bf33e24172cf4069a8bf60dcd70b9076678fa65d - pristine_git_object: 6248dbe49301a0cf6f4e23794b6e0ecd0c1b0ade + last_write_checksum: sha1:da45cdb16ea5dff001077711e43ad96482927b8c + pristine_git_object: bb70d3f4e8f2149838f165311bd0b12a1c1f93fc src/models/modelarchitecture.ts: id: 57607576095f last_write_checksum: sha1:bb77b74a29ec13ae559b909ba2d03b5bbd4bdb42 @@ -2698,6 +2918,22 @@ trackedFiles: id: 510ab58460c2 last_write_checksum: sha1:940de7803d5e9ee96958d6c325adf8ceee7864e6 pristine_git_object: 187fdd5a1ce0b2c67c4b7ea37ef56a02e0c0a0a1 + src/models/operations/bulkassignkeystoguardrail.ts: + id: 643ef16e0881 + last_write_checksum: sha1:fb332a6731ede6d29929dee4945d2afca5d8a544 + pristine_git_object: 405daa2d7b905327613ee8baf11ed9ef421a4f6f + src/models/operations/bulkassignmemberstoguardrail.ts: + id: 5a5257c83899 + last_write_checksum: sha1:b200098fbd4628266c193fb9925a4f68830d4bd5 + pristine_git_object: 3026a4de8dd66b76dd4b7284b436af0680650d68 + src/models/operations/bulkunassignkeysfromguardrail.ts: + id: 7793ffc670a0 + last_write_checksum: sha1:73f9610f7b1eeddfdc25b7d97cdbc37111c9c356 + pristine_git_object: 93994392ab802b746ad892a2a4678f467d1050c9 + src/models/operations/bulkunassignmembersfromguardrail.ts: + id: ea6be9164914 + last_write_checksum: sha1:9779fe200a20e97e6d6a73e51269d41ac053c2ab + pristine_git_object: a600e1b16f6519ccf40c93936c05d099840c99fb src/models/operations/createauthkeyscode.ts: id: 1443f6afbf40 last_write_checksum: sha1:0289820397bbe1c94fc0f2b47f48b43458ffa468 @@ -2710,6 +2946,10 @@ trackedFiles: id: 7c210337fdff last_write_checksum: sha1:9c2714a9345d366f153734691f264ca1b559b67b pristine_git_object: fa8b758697e3e9577e0f6fdf526873d180b1db9b + src/models/operations/createguardrail.ts: + id: 36e5a2696dfd + last_write_checksum: sha1:bffb42cc6d2f8dab476717f170a1dde3a3e62f9f + pristine_git_object: c4a2bebbb2637ac0320cb81f05896c162334667b src/models/operations/createkeys.ts: id: e7a250c8b7bb last_write_checksum: sha1:e63049a8dd410aab8ff447e174f17d8ac9971aac @@ -2718,6 +2958,10 @@ trackedFiles: id: 7ad611b27e9d last_write_checksum: sha1:4352ab9d0ddf017ba89a1ecdc65a68e51a9957a0 pristine_git_object: 5e74e0c6b0f64d536e453cc62fae5f667bbea3a0 + src/models/operations/deleteguardrail.ts: + id: 767137f1b80b + last_write_checksum: sha1:90c15b49de347150dce81fad517e4113430a0f70 + pristine_git_object: a3e141144cd9f3095a8d491da5df6da7a0a623c4 src/models/operations/deletekeys.ts: id: efa22339a3d6 last_write_checksum: sha1:5308578320c5132007d054ce844840c513ee02d0 @@ -2738,26 +2982,26 @@ trackedFiles: id: 5cdb2959d2a5 last_write_checksum: sha1:fd246e3ce1857f743c5d8cad3a30c5b35b51ea58 pristine_git_object: 7ed9f3de4040d8159dc8cb0992e5d2a4e622232d + src/models/operations/getguardrail.ts: + id: 11c366ebdade + last_write_checksum: sha1:6d0718ddef1890cb60d1a26bdf210709d2e2938c + pristine_git_object: f9afb31405ba2649fe810e0f561af233bcb2f363 src/models/operations/getkey.ts: id: 27d0f86c087f last_write_checksum: sha1:c54e8a824da1672c0cd5d1766071a05a14b58ad3 pristine_git_object: 55d4f0f87a4fa655d9ef7a827878853a1ce867c4 src/models/operations/getmodels.ts: id: f1343fbaaed5 - last_write_checksum: sha1:a4144955632abfc56ee7a4e1adae8c2b5e08689d - pristine_git_object: 97bb2f81b0c43907b9169b9ff98a263ed3d6179a - src/models/operations/getparameters.ts: - id: 9b364a4cca61 - last_write_checksum: sha1:1e76a4bfab0e5b7040c36f36e9742ab94a75f793 - pristine_git_object: 8efe05feb1e1ea2bdb180aede9a7fb57e489e65d + last_write_checksum: sha1:ceb49c00b314dcd5db5e80e03f4954b46a6ca02d + pristine_git_object: 8abb67bfdf57adda01f40bcdb9e3378776043f2b src/models/operations/getuseractivity.ts: id: 19535b4511a4 last_write_checksum: sha1:61b5124510cd7e03d75a781a8612de3e47b9a7ec pristine_git_object: fa427fbdf540e037bc53828a462a2ec76d3e99d7 src/models/operations/index.ts: id: 0d9ffaf774d2 - last_write_checksum: sha1:11990dade539ea99185f57a97614573f99dbc58e - pristine_git_object: 5293b3417985d3e85b520f0e56207f90aabbb9ca + last_write_checksum: sha1:6c367c646ea548c20d1c10d1fdd2d75a7f8cafef + pristine_git_object: 4e9fc3063466a2343de1b11195c80cd275d8228e src/models/operations/list.ts: id: ce11386ad30f last_write_checksum: sha1:b07c14174ede31b9179eea67071f40373023ca05 @@ -2770,6 +3014,26 @@ trackedFiles: id: d52e6aeefb5e last_write_checksum: sha1:4d663d82382cb5d8415608811070a481a3fa796a pristine_git_object: 9cbbeba469f117c54877fd746309c7410b2a3b66 + src/models/operations/listguardrailkeyassignments.ts: + id: 6e6e1963f3ec + last_write_checksum: sha1:9212627b92f649330f627bcb2be48385d9569643 + pristine_git_object: 43cccfef0309fc8e26f6df8410652db5dabe9cb3 + src/models/operations/listguardrailmemberassignments.ts: + id: f92502de471d + last_write_checksum: sha1:8f06399d327bcdacd597506f7590a0c036a41a3a + pristine_git_object: 834684e846f6695d9fceebe77fb5546649988893 + src/models/operations/listguardrails.ts: + id: 71455e4e600e + last_write_checksum: sha1:37122818b8b6993818b0f2d0c43115644c69054c + pristine_git_object: d8cb8117d731d9824c807ac50d1d12b6f189a7eb + src/models/operations/listkeyassignments.ts: + id: cf0d2f290052 + last_write_checksum: sha1:f17936c88d39646ef8beff7c521b41225ca8e928 + pristine_git_object: 6e78bcd5c13e0112bd4716cbc70c0338c09d631f + src/models/operations/listmemberassignments.ts: + id: 64c40f6dc5d8 + last_write_checksum: sha1:7ae863049f44892ffc78833a5ca6f676ec7542b3 + pristine_git_object: 98c8903b885359b47f8248b7c733f116e37beb4d src/models/operations/listmodelsuser.ts: id: 0846aac6be02 last_write_checksum: sha1:39e902b313c46fbd5d21d368eb4694f473639e1d @@ -2782,6 +3046,10 @@ trackedFiles: id: 52a55a780d2d last_write_checksum: sha1:e23e1ac47baf5ea366fffcccf576a8c45a801bf8 pristine_git_object: 80091bf56e6274d6cc2debf87ccf5fba40a37370 + src/models/operations/updateguardrail.ts: + id: f9780f5d66dd + last_write_checksum: sha1:4a428e035188965cab21b02c784c89a9bd275db9 + pristine_git_object: c08573285a5640a9da336d66920f8438e44a9eeb src/models/operations/updatekeys.ts: id: 30a0942aa2b9 last_write_checksum: sha1:8c01df0bc39337d7841a647dbfb2f641b9508ed2 @@ -2820,28 +3088,28 @@ trackedFiles: pristine_git_object: d32dc10b8d734d48a15721a479831c4b2ff96ece src/models/percentilelatencycutoffs.ts: id: 92e053096488 - last_write_checksum: sha1:9cb4c885e8af419a7f349713894ee691de8f3903 - pristine_git_object: 8d4f9360509ee1e3e635a632d47a3e7db73609b9 + last_write_checksum: sha1:dd5b3d55d449f6f5074572c359bdca828aea081e + pristine_git_object: aea49c29fe5fa2917845f802780ac181d3573722 src/models/percentilestats.ts: id: 9a6b504d3964 - last_write_checksum: sha1:77a384fc53d104729d80f52437b66dd23ac440f5 - pristine_git_object: 0593bbc95473e72c1d7f3d0ecfd38afb9ce977ae + last_write_checksum: sha1:be5654d2818969037deb62d4b1277439e97ae0ff + pristine_git_object: 9dfb13ad741f08c1d0456b01d01cb5f5047dc514 src/models/percentilethroughputcutoffs.ts: id: 847aba8ff633 - last_write_checksum: sha1:f3806ceafd88e68e4d33fa3fce930d001ca62fe0 - pristine_git_object: c29b848df9c96b99c3755b2d329e886b78aa8234 + last_write_checksum: sha1:6b12d3bcc625d01a7741d60878db1dd2426b65c1 + pristine_git_object: 64350cb96504a94daf1cfb8af7facf5b479c4cf3 src/models/perrequestlimits.ts: id: 2b2b6cf6a019 last_write_checksum: sha1:b301eb57f0a4eef19f3fa62e6a3e54e44dfa3913 pristine_git_object: a5bfb5dc6be9438a7b61dcab0944f70377916862 src/models/preferredmaxlatency.ts: id: e03f33269427 - last_write_checksum: sha1:98ff43d4f7d6a4b518e5887a00168d7fd1be8ac1 - pristine_git_object: 926e0bcebe7ffa72c4fded9a4080a0c7fe0c0d8e + last_write_checksum: sha1:6f468fd441cde7624381267c13f26348a6255bdf + pristine_git_object: 603f7d4a09bb9665ad223367964fc49425db8ffc src/models/preferredminthroughput.ts: id: 5ff9056f1474 - last_write_checksum: sha1:4bde45a30a0de321fa75eeef37405c2a8c31e904 - pristine_git_object: ace60e53dcddb8f1c8b31da35585a548f89c2b2a + last_write_checksum: sha1:27d90a93c83e07533142b1b8cc1d3252c85242d9 + pristine_git_object: d2180d165594e1e5a5cd373ad9b0e03b13acce61 src/models/providername.ts: id: 89e536fb023a last_write_checksum: sha1:3a7c044aafdd7c31905fad0d834d0d2c0d9e0b61 @@ -2924,8 +3192,8 @@ trackedFiles: pristine_git_object: 5b8f3dec6cc58c5d09176bed64ab170881fbbaf2 src/models/responseinputvideo.ts: id: 79bef840e448 - last_write_checksum: sha1:36a914dea8225a7fa43975017ce9617ec9711652 - pristine_git_object: dd76764eca12e9acef64f1e8bcbf31520d635c3e + last_write_checksum: sha1:9d2284098a8d99af7e988f8a446f45f8f61956dd + pristine_git_object: fe53a06318af755ace5086ecf0dcec6ba8966986 src/models/responseoutputtext.ts: id: 2d5e61e53c46 last_write_checksum: sha1:23003d7b339dcce2d8491d395b89503095bc1221 @@ -2972,8 +3240,8 @@ trackedFiles: pristine_git_object: dc3999bae9a4a8783e6273f237cf5ef56c8d0973 src/models/responsesoutputmodality.ts: id: c42840bf36d8 - last_write_checksum: sha1:20d96f3d4b6fba9b617d832a36c54bc1f6230cbd - pristine_git_object: ce35ab6661fc317ffcb4c57b7e80c41c5a7b824b + last_write_checksum: sha1:ef3234c76a79663140ab9d7492bdfefa09d33579 + pristine_git_object: da588971eb5a4dce00c4fc0d93aea23bc41259f4 src/models/responsessearchcontextsize.ts: id: 3c1dd9e04db4 last_write_checksum: sha1:6280fd261d048367d14726add6a077657833f16f @@ -2994,10 +3262,10 @@ trackedFiles: id: 14bff3bd8497 last_write_checksum: sha1:83aca8ee163e14d3f04eb710e25a1c6ed3741fb5 pristine_git_object: 2fc01894cf0abfa06423b13dd78b4a01fa701032 - src/models/schema3.ts: - id: 6f7380bcbcea - last_write_checksum: sha1:e7fc08c524b69f672aa47e78fb9ae41f9380c884 - pristine_git_object: bcd2d06aa9faf4eaf1970562a59a0d825d88c560 + src/models/schema2.ts: + id: 39bd32ae905d + last_write_checksum: sha1:378c8f1e3cbb6ce2e17e383b08d20292d2e936c3 + pristine_git_object: b97a2318f52969b094a135254e51e253821cf0d4 src/models/security.ts: id: d90c6c784ca5 last_write_checksum: sha1:90d7a8903f46cd2ea5428527343a003511fc78c9 @@ -3060,12 +3328,12 @@ trackedFiles: pristine_git_object: 3243a6ae8b530c7944cfda29a0ef1d0eafd88ca1 src/sdk/analytics.ts: id: 411d91261be3 - last_write_checksum: sha1:aa143ca884d9b71df0d4afbb1f9f555ff4e7c14d - pristine_git_object: 41f17bc8dcf4ffd95e21104a983719589a6a5a24 + last_write_checksum: sha1:5e0dcb90aebb885460e0b4e3a82d07a558e0fccf + pristine_git_object: c09f601301c3ad4036074947ba210b15a38ffa3d src/sdk/apikeys.ts: id: 5dda931501e1 - last_write_checksum: sha1:84b76bfe54111f14770b1323e5a4c3f5154f7cac - pristine_git_object: 87017a4d5bcc9a25e2dd68a219b92fa165ce8566 + last_write_checksum: sha1:2eeac8d9d571d1cef1158e2077c2034319b4652a + pristine_git_object: acb5ff6de17f847db4e873adeb57950bb00dbb1e src/sdk/beta.ts: id: afeac65e28f8 last_write_checksum: sha1:a8a8fe18d0fe7dcf8a7ecb6cc56bd9c9af800ad5 @@ -3080,8 +3348,8 @@ trackedFiles: pristine_git_object: ac2caf3a7b882135f1a1154c2de8c3180d1ceabc src/sdk/credits.ts: id: c72074b5f165 - last_write_checksum: sha1:c5c439455cf7544ff67215829ad7ce305da7f501 - pristine_git_object: 9c43c6dd64ff8326107781888462fd3ac8dc925a + last_write_checksum: sha1:dad7d1d73b2425ee03cb6ea3e586a57a1b3f2852 + pristine_git_object: 733ff10700b868eeb20999d13b85ba7824b8aff2 src/sdk/embeddings.ts: id: 70cbb18bedaf last_write_checksum: sha1:ef2acbb69212cea123d5e87380043d8805e52a27 @@ -3094,6 +3362,10 @@ trackedFiles: id: e28b205da063 last_write_checksum: sha1:c012b7fd729854f87471da5eed0712fb7e30fea6 pristine_git_object: ebd85c57507e8982774ccd26c3d9efe4a727bb90 + src/sdk/guardrails.ts: + id: 30ab0b1cc8db + last_write_checksum: sha1:1e3024150086022b946e6cf2bcd34d32a851a18e + pristine_git_object: 6c31150cea095748d316dac360eb523696673393 src/sdk/index.ts: id: a857902a703f last_write_checksum: sha1:54cdd8319bfbee269b54b8c56988fc0a678f2ec3 @@ -3106,10 +3378,6 @@ trackedFiles: id: 37b7f9b2970b last_write_checksum: sha1:9066fa7baf0b904ca1aa96b654fbc79b3d6c3236 pristine_git_object: 12f35868fad83b3b6ce20fa340d2d9f8df7bbbd1 - src/sdk/parameters.ts: - id: 6e4ef00c29b7 - last_write_checksum: sha1:7e24ad2dfe41aa7a22db6db309466433ddf8ebdb - pristine_git_object: f6e0e9338209e5211f4a4b3f3c50b17ea5f8354c src/sdk/providers.ts: id: fb8faa7013d0 last_write_checksum: sha1:a64efc2e527526cca454dee5c09a52cb7da95574 @@ -3120,8 +3388,8 @@ trackedFiles: pristine_git_object: fc8f29b98cfb1a5aaf4e79aa4bf6572f0ca41e53 src/sdk/sdk.ts: id: 784571af2f69 - last_write_checksum: sha1:1c955341adf0b778e6cadd3d2ccdee97397c2624 - pristine_git_object: 8cb195d80a08c0f4fda305cc0ea2ed4e823f7d37 + last_write_checksum: sha1:ef27be52bdae81f8345601f60d6821951731d259 + pristine_git_object: 01d457514530968fcef8a63d6f22e7d6b20afd80 src/types/async.ts: id: fac8da972f86 last_write_checksum: sha1:e2a7c53b428567587741f38e6da489f596de6227 @@ -3622,7 +3890,7 @@ examples: offset: "0" responses: "200": - application/json: {"data": [{"hash": "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", "name": "My Production Key", "label": "Production API Key", "disabled": false, "limit": 100, "limit_remaining": 74.5, "limit_reset": "monthly", "include_byok_in_limit": false, "usage": 25.5, "usage_daily": 25.5, "usage_weekly": 25.5, "usage_monthly": 25.5, "byok_usage": 17.38, "byok_usage_daily": 17.38, "byok_usage_weekly": 17.38, "byok_usage_monthly": 17.38, "created_at": "2025-08-24T10:30:00Z", "updated_at": "2025-08-24T15:45:00Z"}]} + application/json: {"data": [{"hash": "f01d52606dc8f0a8303a7b5cc3fa07109c2e346cec7c0a16b40de462992ce943", "name": "My Production Key", "label": "Production API Key", "disabled": false, "limit": 100, "limit_remaining": 74.5, "limit_reset": "monthly", "include_byok_in_limit": false, "usage": 25.5, "usage_daily": 25.5, "usage_weekly": 25.5, "usage_monthly": 25.5, "byok_usage": 17.38, "byok_usage_daily": 17.38, "byok_usage_weekly": 17.38, "byok_usage_monthly": 17.38, "created_at": "2025-08-24T10:30:00Z", "updated_at": "2025-08-24T15:45:00Z"}]} 4XX: application/json: {"error": {"code": 400, "message": "Invalid request parameters", "metadata": {"field": "temperature", "reason": "Must be between 0 and 2"}}, "user_id": "user-abc123"} 5XX: @@ -3740,7 +4008,7 @@ examples: speakeasy-default-get-current-key: responses: "200": - application/json: {"data": {"label": "sk-or-v1-au78b3456789012345678901234567890", "limit": 100, "usage": 25.5, "usage_daily": 25.5, "usage_weekly": 25.5, "usage_monthly": 25.5, "byok_usage": 17.38, "byok_usage_daily": 17.38, "byok_usage_weekly": 17.38, "byok_usage_monthly": 17.38, "is_free_tier": false, "is_provisioning_key": false, "limit_remaining": 74.5, "limit_reset": "monthly", "include_byok_in_limit": false, "rate_limit": {"requests": 1000, "interval": "1h", "note": "This field is deprecated and safe to ignore."}}} + application/json: {"data": {"label": "sk-or-v1-au7...890", "limit": 100, "usage": 25.5, "usage_daily": 25.5, "usage_weekly": 25.5, "usage_monthly": 25.5, "byok_usage": 17.38, "byok_usage_daily": 17.38, "byok_usage_weekly": 17.38, "byok_usage_monthly": 17.38, "is_free_tier": false, "is_provisioning_key": false, "limit_remaining": 74.5, "limit_reset": "monthly", "include_byok_in_limit": false, "rate_limit": {"requests": 1000, "interval": "1h", "note": "This field is deprecated and safe to ignore."}}} 4XX: application/json: {"error": {"code": 400, "message": "Invalid request parameters", "metadata": {"field": "temperature", "reason": "Must be between 0 and 2"}}, "user_id": "user-abc123"} 5XX: @@ -3975,7 +4243,7 @@ examples: application/json: {"name": "My New API Key"} responses: "201": - application/json: {"data": {"hash": "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", "name": "My New API Key", "label": "My New API Key", "disabled": false, "limit": 50, "limit_remaining": 50, "limit_reset": "monthly", "include_byok_in_limit": true, "usage": 0, "usage_daily": 0, "usage_weekly": 0, "usage_monthly": 0, "byok_usage": 0, "byok_usage_daily": 0, "byok_usage_weekly": 0, "byok_usage_monthly": 0, "created_at": "2025-08-24T10:30:00Z", "updated_at": null}, "key": "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"} + application/json: {"data": {"hash": "f01d52606dc8f0a8303a7b5cc3fa07109c2e346cec7c0a16b40de462992ce943", "name": "My New API Key", "label": "My New API Key", "disabled": false, "limit": 50, "limit_remaining": 50, "limit_reset": "monthly", "include_byok_in_limit": true, "usage": 0, "usage_daily": 0, "usage_weekly": 0, "usage_monthly": 0, "byok_usage": 0, "byok_usage_daily": 0, "byok_usage_weekly": 0, "byok_usage_monthly": 0, "created_at": "2025-08-24T10:30:00Z", "updated_at": null}, "key": "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"} default: application/json: {"error": {"code": 400, "message": "Invalid request parameters", "metadata": {"field": "temperature", "reason": "Must be between 0 and 2"}}, "user_id": "user-abc123"} 4XX: @@ -3994,12 +4262,12 @@ examples: speakeasy-default-update-keys: parameters: path: - hash: "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" + hash: "f01d52606dc8f0a8303a7b5cc3fa07109c2e346cec7c0a16b40de462992ce943" requestBody: application/json: {} responses: "200": - application/json: {"data": {"hash": "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", "name": "Updated API Key Name", "label": "Updated API Key Name", "disabled": false, "limit": 75, "limit_remaining": 49.5, "limit_reset": "daily", "include_byok_in_limit": true, "usage": 25.5, "usage_daily": 25.5, "usage_weekly": 25.5, "usage_monthly": 25.5, "byok_usage": 17.38, "byok_usage_daily": 17.38, "byok_usage_weekly": 17.38, "byok_usage_monthly": 17.38, "created_at": "2025-08-24T10:30:00Z", "updated_at": "2025-08-24T16:00:00Z"}} + application/json: {"data": {"hash": "f01d52606dc8f0a8303a7b5cc3fa07109c2e346cec7c0a16b40de462992ce943", "name": "Updated API Key Name", "label": "Updated API Key Name", "disabled": false, "limit": 75, "limit_remaining": 49.5, "limit_reset": "daily", "include_byok_in_limit": true, "usage": 25.5, "usage_daily": 25.5, "usage_weekly": 25.5, "usage_monthly": 25.5, "byok_usage": 17.38, "byok_usage_daily": 17.38, "byok_usage_weekly": 17.38, "byok_usage_monthly": 17.38, "created_at": "2025-08-24T10:30:00Z", "updated_at": "2025-08-24T16:00:00Z"}} default: application/json: {"error": {"code": 400, "message": "Invalid request parameters", "metadata": {"field": "temperature", "reason": "Must be between 0 and 2"}}, "user_id": "user-abc123"} 4XX: @@ -4020,7 +4288,7 @@ examples: speakeasy-default-delete-keys: parameters: path: - hash: "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" + hash: "f01d52606dc8f0a8303a7b5cc3fa07109c2e346cec7c0a16b40de462992ce943" responses: "200": application/json: {"deleted": true} @@ -4042,10 +4310,10 @@ examples: speakeasy-default-get-key: parameters: path: - hash: "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" + hash: "f01d52606dc8f0a8303a7b5cc3fa07109c2e346cec7c0a16b40de462992ce943" responses: "200": - application/json: {"data": {"hash": "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", "name": "My Production Key", "label": "Production API Key", "disabled": false, "limit": 100, "limit_remaining": 74.5, "limit_reset": "monthly", "include_byok_in_limit": false, "usage": 25.5, "usage_daily": 25.5, "usage_weekly": 25.5, "usage_monthly": 25.5, "byok_usage": 17.38, "byok_usage_daily": 17.38, "byok_usage_weekly": 17.38, "byok_usage_monthly": 17.38, "created_at": "2025-08-24T10:30:00Z", "updated_at": "2025-08-24T15:45:00Z"}} + application/json: {"data": {"hash": "f01d52606dc8f0a8303a7b5cc3fa07109c2e346cec7c0a16b40de462992ce943", "name": "My Production Key", "label": "Production API Key", "disabled": false, "limit": 100, "limit_remaining": 74.5, "limit_reset": "monthly", "include_byok_in_limit": false, "usage": 25.5, "usage_daily": 25.5, "usage_weekly": 25.5, "usage_monthly": 25.5, "byok_usage": 17.38, "byok_usage_daily": 17.38, "byok_usage_weekly": 17.38, "byok_usage_monthly": 17.38, "created_at": "2025-08-24T10:30:00Z", "updated_at": "2025-08-24T15:45:00Z"}} default: application/json: {"error": {"code": 400, "message": "Invalid request parameters", "metadata": {"field": "temperature", "reason": "Must be between 0 and 2"}}, "user_id": "user-abc123"} 4XX: @@ -4066,7 +4334,7 @@ examples: application/json: {"store": false, "service_tier": "auto", "stream": false} responses: "200": - application/json: {"id": "resp-abc123", "object": "response", "created_at": 1704067200, "model": "gpt-4", "status": "completed", "completed_at": 2510.63, "output": [{"id": "msg-abc123", "role": "assistant", "type": "message", "content": [{"type": "output_text", "text": "Hello! How can I help you today?"}]}], "error": null, "incomplete_details": null, "temperature": null, "top_p": null, "presence_penalty": 7468.94, "frequency_penalty": 3967.09, "instructions": null, "metadata": null, "tools": [], "tool_choice": "auto", "parallel_tool_calls": true} + application/json: {"id": "resp-abc123", "object": "response", "created_at": 1704067200, "model": "gpt-4", "status": "completed", "completed_at": 2510.63, "output": [{"id": "msg-abc123", "role": "assistant", "type": "message", "content": [{"type": "output_text", "text": "Hello! How can I help you today?"}]}], "error": null, "incomplete_details": null, "temperature": null, "top_p": null, "presence_penalty": 2510.63, "frequency_penalty": 7468.94, "instructions": null, "metadata": null, "tools": [], "tool_choice": "auto", "parallel_tool_calls": true} "400": application/json: {"error": {"code": 400, "message": "Invalid request parameters"}} "401": @@ -4165,6 +4433,192 @@ examples: application/json: {"error": {"code": 400, "message": "Invalid request parameters"}} "500": application/json: {"error": {"code": 500, "message": "Internal Server Error"}} + listGuardrails: + speakeasy-default-list-guardrails: + responses: + "200": + application/json: {"data": [{"id": "550e8400-e29b-41d4-a716-446655440000", "name": "Production Guardrail", "created_at": "2025-08-24T10:30:00Z"}], "total_count": 1} + "401": + application/json: {"error": {"code": 401, "message": "Missing Authentication header"}} + "500": + application/json: {"error": {"code": 500, "message": "Internal Server Error"}} + createGuardrail: + speakeasy-default-create-guardrail: + requestBody: + application/json: {"name": "My New Guardrail"} + responses: + "201": + application/json: {"data": {"id": "550e8400-e29b-41d4-a716-446655440000", "name": "My New Guardrail", "created_at": "2025-08-24T10:30:00Z"}} + "400": + application/json: {"error": {"code": 400, "message": "Invalid request parameters"}} + "401": + application/json: {"error": {"code": 401, "message": "Missing Authentication header"}} + "500": + application/json: {"error": {"code": 500, "message": "Internal Server Error"}} + getGuardrail: + speakeasy-default-get-guardrail: + parameters: + path: + id: "550e8400-e29b-41d4-a716-446655440000" + responses: + "200": + application/json: {"data": {"id": "550e8400-e29b-41d4-a716-446655440000", "name": "Production Guardrail", "created_at": "2025-08-24T10:30:00Z"}} + "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"}} + updateGuardrail: + speakeasy-default-update-guardrail: + parameters: + path: + id: "550e8400-e29b-41d4-a716-446655440000" + requestBody: + application/json: {} + responses: + "200": + application/json: {"data": {"id": "550e8400-e29b-41d4-a716-446655440000", "name": "Updated Guardrail Name", "created_at": "2025-08-24T10:30:00Z"}} + "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"}} + deleteGuardrail: + speakeasy-default-delete-guardrail: + parameters: + path: + id: "550e8400-e29b-41d4-a716-446655440000" + 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"}} + listKeyAssignments: + speakeasy-default-list-key-assignments: + responses: + "200": + application/json: {"data": [{"id": "550e8400-e29b-41d4-a716-446655440000", "key_hash": "c56454edb818d6b14bc0d61c46025f1450b0f4012d12304ab40aacb519fcbc93", "guardrail_id": "550e8400-e29b-41d4-a716-446655440001", "key_name": "Production Key", "key_label": "prod-key", "assigned_by": "user_abc123", "created_at": "2025-08-24T10:30:00Z"}], "total_count": 25} + "401": + application/json: {"error": {"code": 401, "message": "Missing Authentication header"}} + "500": + application/json: {"error": {"code": 500, "message": "Internal Server Error"}} + listMemberAssignments: + speakeasy-default-list-member-assignments: + responses: + "200": + application/json: {"data": [{"id": "550e8400-e29b-41d4-a716-446655440000", "user_id": "user_abc123", "organization_id": "org_xyz789", "guardrail_id": "550e8400-e29b-41d4-a716-446655440001", "assigned_by": "user_abc123", "created_at": "2025-08-24T10:30:00Z"}], "total_count": 10} + "401": + application/json: {"error": {"code": 401, "message": "Missing Authentication header"}} + "500": + application/json: {"error": {"code": 500, "message": "Internal Server Error"}} + listGuardrailKeyAssignments: + speakeasy-default-list-guardrail-key-assignments: + parameters: + path: + id: "550e8400-e29b-41d4-a716-446655440000" + responses: + "200": + application/json: {"data": [], "total_count": 25} + "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"}} + bulkAssignKeysToGuardrail: + speakeasy-default-bulk-assign-keys-to-guardrail: + parameters: + path: + id: "550e8400-e29b-41d4-a716-446655440000" + requestBody: + application/json: {"key_hashes": ["c56454edb818d6b14bc0d61c46025f1450b0f4012d12304ab40aacb519fcbc93"]} + responses: + "200": + application/json: {"assigned_count": 3} + "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"}} + listGuardrailMemberAssignments: + speakeasy-default-list-guardrail-member-assignments: + parameters: + path: + id: "550e8400-e29b-41d4-a716-446655440000" + responses: + "200": + application/json: {"data": [{"id": "550e8400-e29b-41d4-a716-446655440000", "user_id": "user_abc123", "organization_id": "org_xyz789", "guardrail_id": "550e8400-e29b-41d4-a716-446655440001", "assigned_by": "user_abc123", "created_at": "2025-08-24T10:30:00Z"}], "total_count": 10} + "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"}} + bulkAssignMembersToGuardrail: + speakeasy-default-bulk-assign-members-to-guardrail: + parameters: + path: + id: "550e8400-e29b-41d4-a716-446655440000" + requestBody: + application/json: {"member_user_ids": ["user_abc123", "user_def456"]} + responses: + "200": + application/json: {"assigned_count": 2} + "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"}} + bulkUnassignKeysFromGuardrail: + speakeasy-default-bulk-unassign-keys-from-guardrail: + parameters: + path: + id: "550e8400-e29b-41d4-a716-446655440000" + requestBody: + application/json: {"key_hashes": ["c56454edb818d6b14bc0d61c46025f1450b0f4012d12304ab40aacb519fcbc93"]} + responses: + "200": + application/json: {"unassigned_count": 3} + "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"}} + bulkUnassignMembersFromGuardrail: + speakeasy-default-bulk-unassign-members-from-guardrail: + parameters: + path: + id: "550e8400-e29b-41d4-a716-446655440000" + requestBody: + application/json: {"member_user_ids": ["user_abc123", "user_def456"]} + responses: + "200": + application/json: {"unassigned_count": 2} + "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 generatedFiles: - .devcontainer/README.md diff --git a/.speakeasy/gen.yaml b/.speakeasy/gen.yaml index df48d0e7..aa03b1ad 100644 --- a/.speakeasy/gen.yaml +++ b/.speakeasy/gen.yaml @@ -33,7 +33,7 @@ generation: skipResponseBodyAssertions: false preApplyUnionDiscriminators: true typescript: - version: 0.3.14 + version: 0.3.15 acceptHeaderEnum: false additionalDependencies: dependencies: diff --git a/.speakeasy/in.openapi.yaml b/.speakeasy/in.openapi.yaml index fb85a179..b40279d8 100644 --- a/.speakeasy/in.openapi.yaml +++ b/.speakeasy/in.openapi.yaml @@ -4616,6 +4616,11 @@ components: description: List of supported parameters for this model default_parameters: $ref: '#/components/schemas/DefaultParameters' + expiration_date: + type: string + nullable: true + description: The date after which the model may be removed. ISO 8601 date string (YYYY-MM-DD) or null if no expiration. + example: '2025-06-01' required: - id - canonical_slug @@ -4659,6 +4664,7 @@ components: - top_p - max_tokens default_parameters: null + expiration_date: null ModelsListResponseData: type: array items: @@ -4705,6 +4711,7 @@ components: - frequency_penalty - presence_penalty default_parameters: null + expiration_date: null ModelsCountResponse: type: object properties: @@ -5110,10 +5117,6 @@ components: - type: string - type: number __schema2: - anyOf: - - $ref: '#/components/schemas/ChatCompletionFinishReason' - - type: 'null' - __schema3: oneOf: - type: object properties: @@ -5123,11 +5126,11 @@ components: summary: type: string id: - $ref: '#/components/schemas/__schema4' + $ref: '#/components/schemas/__schema3' format: - $ref: '#/components/schemas/__schema5' + $ref: '#/components/schemas/__schema4' index: - $ref: '#/components/schemas/__schema6' + $ref: '#/components/schemas/__schema5' required: - type - summary @@ -5139,11 +5142,11 @@ components: data: type: string id: - $ref: '#/components/schemas/__schema4' + $ref: '#/components/schemas/__schema3' format: - $ref: '#/components/schemas/__schema5' + $ref: '#/components/schemas/__schema4' index: - $ref: '#/components/schemas/__schema6' + $ref: '#/components/schemas/__schema5' required: - type - data @@ -5161,19 +5164,19 @@ components: - type: string - type: 'null' id: - $ref: '#/components/schemas/__schema4' + $ref: '#/components/schemas/__schema3' format: - $ref: '#/components/schemas/__schema5' + $ref: '#/components/schemas/__schema4' index: - $ref: '#/components/schemas/__schema6' + $ref: '#/components/schemas/__schema5' required: - type type: object - __schema4: + __schema3: anyOf: - type: string - type: 'null' - __schema5: + __schema4: anyOf: - type: string enum: @@ -5184,8 +5187,12 @@ components: - anthropic-claude-v1 - google-gemini-v1 - type: 'null' - __schema6: + __schema5: type: number + __schema6: + anyOf: + - $ref: '#/components/schemas/ChatCompletionFinishReason' + - type: 'null' ModelName: type: string ChatMessageContentItemText: @@ -5538,6 +5545,24 @@ components: anyOf: - type: string - type: 'null' + reasoning_details: + type: array + items: + $ref: '#/components/schemas/__schema2' + images: + type: array + items: + type: object + properties: + image_url: + type: object + properties: + url: + type: string + required: + - url + required: + - image_url required: - role ToolResponseMessage: @@ -6069,15 +6094,11 @@ components: type: object properties: finish_reason: - $ref: '#/components/schemas/__schema2' + $ref: '#/components/schemas/__schema6' index: type: number message: $ref: '#/components/schemas/AssistantMessage' - reasoning_details: - type: array - items: - $ref: '#/components/schemas/__schema3' logprobs: anyOf: - $ref: '#/components/schemas/ChatMessageTokenLogprobs' @@ -6131,14 +6152,14 @@ components: reasoning_details: type: array items: - $ref: '#/components/schemas/__schema3' + $ref: '#/components/schemas/__schema2' ChatStreamingChoice: type: object properties: delta: $ref: '#/components/schemas/ChatStreamingMessageChunk' finish_reason: - $ref: '#/components/schemas/__schema2' + $ref: '#/components/schemas/__schema6' index: type: number logprobs: @@ -6636,7 +6657,9 @@ paths: - Analytics operationId: getUserActivity summary: Get user activity grouped by endpoint - description: Returns user activity data grouped by endpoint for the last 30 (completed) UTC days + description: >- + Returns user activity data grouped by endpoint for the last 30 (completed) UTC days. [Provisioning + key](/docs/guides/overview/auth/provisioning-api-keys) required. parameters: - schema: type: string @@ -6705,7 +6728,9 @@ paths: - Credits summary: Get remaining credits operationId: getCredits - description: Get total credits purchased and used for the authenticated user + description: >- + Get total credits purchased and used for the authenticated user. [Provisioning + key](/docs/guides/overview/auth/provisioning-api-keys) required. responses: '200': description: Returns the total credits purchased and used @@ -7407,7 +7432,23 @@ paths: parameters: - schema: type: string + enum: + - programming + - roleplay + - marketing + - marketing/seo + - technology + - science + - translation + - legal + - finance + - health + - trivia + - academia + description: Filter models by use case category + example: programming required: false + description: Filter models by use case category name: category in: query - schema: @@ -7545,116 +7586,6 @@ paths: schema: $ref: '#/components/schemas/InternalServerResponse' operationId: listEndpointsZdr - /parameters/{author}/{slug}: - get: - tags: - - Parameters - summary: Get a model's supported parameters and data about which are most popular - security: - - bearer: [] - parameters: - - schema: - type: string - required: true - name: author - in: path - - schema: - type: string - required: true - name: slug - in: path - - schema: - $ref: '#/components/schemas/ProviderName' - required: false - name: provider - in: query - responses: - '200': - description: Returns the parameters for the specified model - content: - application/json: - schema: - type: object - properties: - data: - type: object - properties: - model: - type: string - description: Model identifier - example: openai/gpt-4 - supported_parameters: - type: array - items: - type: string - enum: - - temperature - - top_p - - top_k - - min_p - - top_a - - frequency_penalty - - presence_penalty - - repetition_penalty - - max_tokens - - logit_bias - - logprobs - - top_logprobs - - seed - - response_format - - structured_outputs - - stop - - tools - - tool_choice - - parallel_tool_calls - - include_reasoning - - reasoning - - reasoning_effort - - web_search_options - - verbosity - description: List of parameters supported by this model - example: - - temperature - - top_p - - max_tokens - required: - - model - - supported_parameters - example: - model: openai/gpt-4 - supported_parameters: - - temperature - - top_p - - max_tokens - description: Parameter analytics data - required: - - data - example: - data: - model: openai/gpt-4 - supported_parameters: - - temperature - - top_p - - max_tokens - '401': - description: Unauthorized - Authentication required or invalid credentials - content: - application/json: - schema: - $ref: '#/components/schemas/UnauthorizedResponse' - '404': - description: Not Found - Model or provider does not exist - content: - application/json: - schema: - $ref: '#/components/schemas/NotFoundResponse' - '500': - description: Internal Server Error - Unexpected server error - content: - application/json: - schema: - $ref: '#/components/schemas/InternalServerResponse' - operationId: getParameters /providers: get: tags: @@ -7723,6 +7654,9 @@ paths: tags: - API Keys summary: List API keys + description: >- + List all API keys for the authenticated user. [Provisioning + key](/docs/guides/overview/auth/provisioning-api-keys) required. parameters: - schema: type: string @@ -7756,7 +7690,7 @@ paths: hash: type: string description: Unique hash identifier for the API key - example: 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 + example: f01d52606dc8f0a8303a7b5cc3fa07109c2e346cec7c0a16b40de462992ce943 name: type: string description: Name of the API key @@ -7764,7 +7698,7 @@ paths: label: type: string description: Human-readable label for the API key - example: Production API Key + example: sk-or-v1-0e6...1c96 disabled: type: boolean description: Whether the API key is disabled @@ -7855,9 +7789,9 @@ paths: - created_at - updated_at example: - hash: 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 + hash: f01d52606dc8f0a8303a7b5cc3fa07109c2e346cec7c0a16b40de462992ce943 name: My Production Key - label: Production API Key + label: sk-or-v1-0e6...1c96 disabled: false limit: 100 limit_remaining: 74.5 @@ -7879,7 +7813,7 @@ paths: - data example: data: - - hash: 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 + - hash: f01d52606dc8f0a8303a7b5cc3fa07109c2e346cec7c0a16b40de462992ce943 name: My Production Key label: Production API Key disabled: false @@ -7921,6 +7855,9 @@ paths: tags: - API Keys summary: Create a new API key + description: >- + Create a new API key for the authenticated user. [Provisioning + key](/docs/guides/overview/auth/provisioning-api-keys) required. requestBody: content: application/json: @@ -7983,7 +7920,7 @@ paths: hash: type: string description: Unique hash identifier for the API key - example: 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 + example: f01d52606dc8f0a8303a7b5cc3fa07109c2e346cec7c0a16b40de462992ce943 name: type: string description: Name of the API key @@ -7991,7 +7928,7 @@ paths: label: type: string description: Human-readable label for the API key - example: Production API Key + example: sk-or-v1-0e6...1c96 disabled: type: boolean description: Whether the API key is disabled @@ -8082,9 +8019,9 @@ paths: - created_at - updated_at example: - hash: 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 + hash: f01d52606dc8f0a8303a7b5cc3fa07109c2e346cec7c0a16b40de462992ce943 name: My Production Key - label: Production API Key + label: sk-or-v1-0e6...1c96 disabled: false limit: 100 limit_remaining: 74.5 @@ -8111,7 +8048,7 @@ paths: - key example: data: - hash: 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 + hash: f01d52606dc8f0a8303a7b5cc3fa07109c2e346cec7c0a16b40de462992ce943 name: My New API Key label: My New API Key disabled: false @@ -8162,11 +8099,12 @@ paths: tags: - API Keys summary: Update an API key + description: Update an existing API key. [Provisioning key](/docs/guides/overview/auth/provisioning-api-keys) required. parameters: - schema: type: string description: The hash identifier of the API key to update - example: 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 + example: f01d52606dc8f0a8303a7b5cc3fa07109c2e346cec7c0a16b40de462992ce943 required: true description: The hash identifier of the API key to update name: hash @@ -8226,7 +8164,7 @@ paths: hash: type: string description: Unique hash identifier for the API key - example: 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 + example: f01d52606dc8f0a8303a7b5cc3fa07109c2e346cec7c0a16b40de462992ce943 name: type: string description: Name of the API key @@ -8234,7 +8172,7 @@ paths: label: type: string description: Human-readable label for the API key - example: Production API Key + example: sk-or-v1-0e6...1c96 disabled: type: boolean description: Whether the API key is disabled @@ -8325,9 +8263,9 @@ paths: - created_at - updated_at example: - hash: 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 + hash: f01d52606dc8f0a8303a7b5cc3fa07109c2e346cec7c0a16b40de462992ce943 name: My Production Key - label: Production API Key + label: sk-or-v1-0e6...1c96 disabled: false limit: 100 limit_remaining: 74.5 @@ -8349,7 +8287,7 @@ paths: - data example: data: - hash: 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 + hash: f01d52606dc8f0a8303a7b5cc3fa07109c2e346cec7c0a16b40de462992ce943 name: Updated API Key Name label: Updated API Key Name disabled: false @@ -8404,11 +8342,12 @@ paths: tags: - API Keys summary: Delete an API key + description: Delete an existing API key. [Provisioning key](/docs/guides/overview/auth/provisioning-api-keys) required. parameters: - schema: type: string description: The hash identifier of the API key to delete - example: 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 + example: f01d52606dc8f0a8303a7b5cc3fa07109c2e346cec7c0a16b40de462992ce943 required: true description: The hash identifier of the API key to delete name: hash @@ -8461,11 +8400,12 @@ paths: tags: - API Keys summary: Get a single API key + description: Get a single API key by hash. [Provisioning key](/docs/guides/overview/auth/provisioning-api-keys) required. parameters: - schema: type: string description: The hash identifier of the API key to retrieve - example: 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 + example: f01d52606dc8f0a8303a7b5cc3fa07109c2e346cec7c0a16b40de462992ce943 required: true description: The hash identifier of the API key to retrieve name: hash @@ -8484,7 +8424,7 @@ paths: hash: type: string description: Unique hash identifier for the API key - example: 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 + example: f01d52606dc8f0a8303a7b5cc3fa07109c2e346cec7c0a16b40de462992ce943 name: type: string description: Name of the API key @@ -8492,7 +8432,7 @@ paths: label: type: string description: Human-readable label for the API key - example: Production API Key + example: sk-or-v1-0e6...1c96 disabled: type: boolean description: Whether the API key is disabled @@ -8583,9 +8523,9 @@ paths: - created_at - updated_at example: - hash: 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 + hash: f01d52606dc8f0a8303a7b5cc3fa07109c2e346cec7c0a16b40de462992ce943 name: My Production Key - label: Production API Key + label: sk-or-v1-0e6...1c96 disabled: false limit: 100 limit_remaining: 74.5 @@ -8607,7 +8547,7 @@ paths: - data example: data: - hash: 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 + hash: f01d52606dc8f0a8303a7b5cc3fa07109c2e346cec7c0a16b40de462992ce943 name: My Production Key label: Production API Key disabled: false @@ -8650,6 +8590,1511 @@ paths: application/json: schema: $ref: '#/components/schemas/InternalServerResponse' + /guardrails: + get: + operationId: listGuardrails + x-speakeasy-name-override: list + tags: + - Guardrails + summary: List guardrails + description: >- + List all guardrails for the authenticated user. [Provisioning + key](/docs/guides/overview/auth/provisioning-api-keys) required. + parameters: + - schema: + type: string + description: Number of records to skip for pagination + example: '0' + required: false + description: Number of records to skip for pagination + name: offset + in: query + - schema: + type: string + description: Maximum number of records to return (max 100) + example: '50' + required: false + description: Maximum number of records to return (max 100) + name: limit + in: query + responses: + '200': + description: List of guardrails + content: + application/json: + schema: + type: object + properties: + data: + type: array + items: + type: object + properties: + id: + type: string + format: uuid + description: Unique identifier for the guardrail + example: 550e8400-e29b-41d4-a716-446655440000 + name: + type: string + description: Name of the guardrail + example: Production Guardrail + description: + type: string + nullable: true + description: Description of the guardrail + example: Guardrail for production environment + limit_usd: + type: number + nullable: true + minimum: 0 + exclusiveMinimum: true + description: Spending limit in USD + example: 100 + reset_interval: + type: string + nullable: true + enum: + - daily + - weekly + - monthly + description: Interval at which the limit resets (daily, weekly, monthly) + example: monthly + allowed_providers: + type: array + nullable: true + items: + type: string + description: List of allowed provider IDs + example: + - openai + - anthropic + - google + allowed_models: + type: array + nullable: true + items: + type: string + description: Array of model canonical_slugs (immutable identifiers) + example: + - openai/gpt-5.2-20251211 + - anthropic/claude-4.5-opus-20251124 + - deepseek/deepseek-r1-0528:free + enforce_zdr: + type: boolean + nullable: true + description: Whether to enforce zero data retention + example: false + created_at: + type: string + description: ISO 8601 timestamp of when the guardrail was created + example: '2025-08-24T10:30:00Z' + updated_at: + type: string + nullable: true + description: ISO 8601 timestamp of when the guardrail was last updated + example: '2025-08-24T15:45:00Z' + required: + - id + - name + - created_at + example: + id: 550e8400-e29b-41d4-a716-446655440000 + name: Production Guardrail + description: Guardrail for production environment + limit_usd: 100 + reset_interval: monthly + allowed_providers: + - openai + - anthropic + - google + allowed_models: null + enforce_zdr: false + created_at: '2025-08-24T10:30:00Z' + updated_at: '2025-08-24T15:45:00Z' + description: List of guardrails + total_count: + type: number + description: Total number of guardrails + example: 25 + required: + - data + - total_count + example: + data: + - id: 550e8400-e29b-41d4-a716-446655440000 + name: Production Guardrail + description: Guardrail for production environment + limit_usd: 100 + reset_interval: monthly + allowed_providers: + - openai + - anthropic + - google + allowed_models: null + enforce_zdr: false + created_at: '2025-08-24T10:30:00Z' + updated_at: '2025-08-24T15:45:00Z' + total_count: 1 + '401': + description: Unauthorized - Missing or invalid authentication + content: + application/json: + schema: + $ref: '#/components/schemas/UnauthorizedResponse' + '500': + description: Internal Server Error + content: + application/json: + schema: + $ref: '#/components/schemas/InternalServerResponse' + post: + operationId: createGuardrail + x-speakeasy-name-override: create + tags: + - Guardrails + summary: Create a guardrail + description: >- + Create a new guardrail for the authenticated user. [Provisioning + key](/docs/guides/overview/auth/provisioning-api-keys) required. + requestBody: + content: + application/json: + schema: + type: object + properties: + name: + type: string + minLength: 1 + maxLength: 200 + description: Name for the new guardrail + example: My New Guardrail + description: + type: string + nullable: true + maxLength: 1000 + description: Description of the guardrail + example: A guardrail for limiting API usage + limit_usd: + type: number + nullable: true + minimum: 0 + exclusiveMinimum: true + description: Spending limit in USD + example: 50 + reset_interval: + type: string + nullable: true + enum: + - daily + - weekly + - monthly + description: Interval at which the limit resets (daily, weekly, monthly) + example: monthly + allowed_providers: + type: array + nullable: true + items: + type: string + minItems: 1 + description: List of allowed provider IDs + example: + - openai + - anthropic + - deepseek + allowed_models: + type: array + nullable: true + items: + type: string + minItems: 1 + description: Array of model identifiers (slug or canonical_slug accepted) + example: + - openai/gpt-5.2 + - anthropic/claude-4.5-opus-20251124 + - deepseek/deepseek-r1-0528:free + enforce_zdr: + type: boolean + nullable: true + description: Whether to enforce zero data retention + example: false + required: + - name + example: + name: My New Guardrail + description: A guardrail for limiting API usage + limit_usd: 50 + reset_interval: monthly + allowed_providers: + - openai + - anthropic + - deepseek + allowed_models: null + enforce_zdr: false + required: true + responses: + '201': + description: Guardrail created successfully + content: + application/json: + schema: + type: object + properties: + data: + type: object + properties: + id: + type: string + format: uuid + description: Unique identifier for the guardrail + example: 550e8400-e29b-41d4-a716-446655440000 + name: + type: string + description: Name of the guardrail + example: Production Guardrail + description: + type: string + nullable: true + description: Description of the guardrail + example: Guardrail for production environment + limit_usd: + type: number + nullable: true + minimum: 0 + exclusiveMinimum: true + description: Spending limit in USD + example: 100 + reset_interval: + type: string + nullable: true + enum: + - daily + - weekly + - monthly + description: Interval at which the limit resets (daily, weekly, monthly) + example: monthly + allowed_providers: + type: array + nullable: true + items: + type: string + description: List of allowed provider IDs + example: + - openai + - anthropic + - google + allowed_models: + type: array + nullable: true + items: + type: string + description: Array of model canonical_slugs (immutable identifiers) + example: + - openai/gpt-5.2-20251211 + - anthropic/claude-4.5-opus-20251124 + - deepseek/deepseek-r1-0528:free + enforce_zdr: + type: boolean + nullable: true + description: Whether to enforce zero data retention + example: false + created_at: + type: string + description: ISO 8601 timestamp of when the guardrail was created + example: '2025-08-24T10:30:00Z' + updated_at: + type: string + nullable: true + description: ISO 8601 timestamp of when the guardrail was last updated + example: '2025-08-24T15:45:00Z' + required: + - id + - name + - created_at + example: + id: 550e8400-e29b-41d4-a716-446655440000 + name: Production Guardrail + description: Guardrail for production environment + limit_usd: 100 + reset_interval: monthly + allowed_providers: + - openai + - anthropic + - google + allowed_models: null + enforce_zdr: false + created_at: '2025-08-24T10:30:00Z' + updated_at: '2025-08-24T15:45:00Z' + description: The created guardrail + required: + - data + example: + data: + id: 550e8400-e29b-41d4-a716-446655440000 + name: My New Guardrail + description: A guardrail for limiting API usage + limit_usd: 50 + reset_interval: monthly + allowed_providers: + - openai + - anthropic + - google + allowed_models: null + enforce_zdr: false + created_at: '2025-08-24T10:30:00Z' + updated_at: null + '400': + description: Bad Request - Invalid request parameters + content: + application/json: + schema: + $ref: '#/components/schemas/BadRequestResponse' + '401': + description: Unauthorized - Missing or invalid authentication + content: + application/json: + schema: + $ref: '#/components/schemas/UnauthorizedResponse' + '500': + description: Internal Server Error + content: + application/json: + schema: + $ref: '#/components/schemas/InternalServerResponse' + /guardrails/{id}: + get: + operationId: getGuardrail + x-speakeasy-name-override: get + tags: + - Guardrails + summary: Get a guardrail + description: Get a single guardrail by ID. [Provisioning key](/docs/guides/overview/auth/provisioning-api-keys) required. + parameters: + - schema: + type: string + format: uuid + description: The unique identifier of the guardrail to retrieve + example: 550e8400-e29b-41d4-a716-446655440000 + required: true + description: The unique identifier of the guardrail to retrieve + name: id + in: path + responses: + '200': + description: Guardrail details + content: + application/json: + schema: + type: object + properties: + data: + type: object + properties: + id: + type: string + format: uuid + description: Unique identifier for the guardrail + example: 550e8400-e29b-41d4-a716-446655440000 + name: + type: string + description: Name of the guardrail + example: Production Guardrail + description: + type: string + nullable: true + description: Description of the guardrail + example: Guardrail for production environment + limit_usd: + type: number + nullable: true + minimum: 0 + exclusiveMinimum: true + description: Spending limit in USD + example: 100 + reset_interval: + type: string + nullable: true + enum: + - daily + - weekly + - monthly + description: Interval at which the limit resets (daily, weekly, monthly) + example: monthly + allowed_providers: + type: array + nullable: true + items: + type: string + description: List of allowed provider IDs + example: + - openai + - anthropic + - google + allowed_models: + type: array + nullable: true + items: + type: string + description: Array of model canonical_slugs (immutable identifiers) + example: + - openai/gpt-5.2-20251211 + - anthropic/claude-4.5-opus-20251124 + - deepseek/deepseek-r1-0528:free + enforce_zdr: + type: boolean + nullable: true + description: Whether to enforce zero data retention + example: false + created_at: + type: string + description: ISO 8601 timestamp of when the guardrail was created + example: '2025-08-24T10:30:00Z' + updated_at: + type: string + nullable: true + description: ISO 8601 timestamp of when the guardrail was last updated + example: '2025-08-24T15:45:00Z' + required: + - id + - name + - created_at + example: + id: 550e8400-e29b-41d4-a716-446655440000 + name: Production Guardrail + description: Guardrail for production environment + limit_usd: 100 + reset_interval: monthly + allowed_providers: + - openai + - anthropic + - google + allowed_models: null + enforce_zdr: false + created_at: '2025-08-24T10:30:00Z' + updated_at: '2025-08-24T15:45:00Z' + description: The guardrail + required: + - data + example: + data: + id: 550e8400-e29b-41d4-a716-446655440000 + name: Production Guardrail + description: Guardrail for production environment + limit_usd: 100 + reset_interval: monthly + allowed_providers: + - openai + - anthropic + - google + allowed_models: null + enforce_zdr: false + created_at: '2025-08-24T10:30:00Z' + updated_at: '2025-08-24T15:45:00Z' + '401': + description: Unauthorized - Missing or invalid authentication + content: + application/json: + schema: + $ref: '#/components/schemas/UnauthorizedResponse' + '404': + description: Not Found - Guardrail does not exist + content: + application/json: + schema: + $ref: '#/components/schemas/NotFoundResponse' + '500': + description: Internal Server Error + content: + application/json: + schema: + $ref: '#/components/schemas/InternalServerResponse' + patch: + operationId: updateGuardrail + x-speakeasy-name-override: update + tags: + - Guardrails + summary: Update a guardrail + description: Update an existing guardrail. [Provisioning key](/docs/guides/overview/auth/provisioning-api-keys) required. + parameters: + - schema: + type: string + format: uuid + description: The unique identifier of the guardrail to update + example: 550e8400-e29b-41d4-a716-446655440000 + required: true + description: The unique identifier of the guardrail to update + name: id + in: path + requestBody: + content: + application/json: + schema: + type: object + properties: + name: + type: string + minLength: 1 + maxLength: 200 + description: New name for the guardrail + example: Updated Guardrail Name + description: + type: string + nullable: true + maxLength: 1000 + description: New description for the guardrail + example: Updated description + limit_usd: + type: number + nullable: true + minimum: 0 + exclusiveMinimum: true + description: New spending limit in USD + example: 75 + reset_interval: + type: string + nullable: true + enum: + - daily + - weekly + - monthly + description: Interval at which the limit resets (daily, weekly, monthly) + example: monthly + allowed_providers: + type: array + nullable: true + items: + type: string + minItems: 1 + description: New list of allowed provider IDs + example: + - openai + - anthropic + - deepseek + allowed_models: + type: array + nullable: true + items: + type: string + minItems: 1 + description: Array of model identifiers (slug or canonical_slug accepted) + example: + - openai/gpt-5.2 + enforce_zdr: + type: boolean + nullable: true + description: Whether to enforce zero data retention + example: true + example: + name: Updated Guardrail Name + description: Updated description + limit_usd: 75 + reset_interval: weekly + required: true + responses: + '200': + description: Guardrail updated successfully + content: + application/json: + schema: + type: object + properties: + data: + type: object + properties: + id: + type: string + format: uuid + description: Unique identifier for the guardrail + example: 550e8400-e29b-41d4-a716-446655440000 + name: + type: string + description: Name of the guardrail + example: Production Guardrail + description: + type: string + nullable: true + description: Description of the guardrail + example: Guardrail for production environment + limit_usd: + type: number + nullable: true + minimum: 0 + exclusiveMinimum: true + description: Spending limit in USD + example: 100 + reset_interval: + type: string + nullable: true + enum: + - daily + - weekly + - monthly + description: Interval at which the limit resets (daily, weekly, monthly) + example: monthly + allowed_providers: + type: array + nullable: true + items: + type: string + description: List of allowed provider IDs + example: + - openai + - anthropic + - google + allowed_models: + type: array + nullable: true + items: + type: string + description: Array of model canonical_slugs (immutable identifiers) + example: + - openai/gpt-5.2-20251211 + - anthropic/claude-4.5-opus-20251124 + - deepseek/deepseek-r1-0528:free + enforce_zdr: + type: boolean + nullable: true + description: Whether to enforce zero data retention + example: false + created_at: + type: string + description: ISO 8601 timestamp of when the guardrail was created + example: '2025-08-24T10:30:00Z' + updated_at: + type: string + nullable: true + description: ISO 8601 timestamp of when the guardrail was last updated + example: '2025-08-24T15:45:00Z' + required: + - id + - name + - created_at + example: + id: 550e8400-e29b-41d4-a716-446655440000 + name: Production Guardrail + description: Guardrail for production environment + limit_usd: 100 + reset_interval: monthly + allowed_providers: + - openai + - anthropic + - google + allowed_models: null + enforce_zdr: false + created_at: '2025-08-24T10:30:00Z' + updated_at: '2025-08-24T15:45:00Z' + description: The updated guardrail + required: + - data + example: + data: + id: 550e8400-e29b-41d4-a716-446655440000 + name: Updated Guardrail Name + description: Updated description + limit_usd: 75 + reset_interval: weekly + allowed_providers: + - openai + allowed_models: null + enforce_zdr: true + created_at: '2025-08-24T10:30:00Z' + updated_at: '2025-08-24T16:00:00Z' + '400': + description: Bad Request - Invalid request parameters + content: + application/json: + schema: + $ref: '#/components/schemas/BadRequestResponse' + '401': + description: Unauthorized - Missing or invalid authentication + content: + application/json: + schema: + $ref: '#/components/schemas/UnauthorizedResponse' + '404': + description: Not Found - Guardrail does not exist + content: + application/json: + schema: + $ref: '#/components/schemas/NotFoundResponse' + '500': + description: Internal Server Error + content: + application/json: + schema: + $ref: '#/components/schemas/InternalServerResponse' + delete: + operationId: deleteGuardrail + x-speakeasy-name-override: delete + tags: + - Guardrails + summary: Delete a guardrail + description: Delete an existing guardrail. [Provisioning key](/docs/guides/overview/auth/provisioning-api-keys) required. + parameters: + - schema: + type: string + format: uuid + description: The unique identifier of the guardrail to delete + example: 550e8400-e29b-41d4-a716-446655440000 + required: true + description: The unique identifier of the guardrail to delete + name: id + in: path + responses: + '200': + description: Guardrail deleted successfully + content: + application/json: + schema: + type: object + properties: + deleted: + type: boolean + const: true + description: Confirmation that the guardrail was deleted + example: true + required: + - deleted + example: + deleted: true + '401': + description: Unauthorized - Missing or invalid authentication + content: + application/json: + schema: + $ref: '#/components/schemas/UnauthorizedResponse' + '404': + description: Not Found - Guardrail does not exist + content: + application/json: + schema: + $ref: '#/components/schemas/NotFoundResponse' + '500': + description: Internal Server Error + content: + application/json: + schema: + $ref: '#/components/schemas/InternalServerResponse' + /guardrails/assignments/keys: + get: + operationId: listKeyAssignments + x-speakeasy-name-override: listKeyAssignments + tags: + - Guardrails + summary: List all key assignments + description: >- + List all API key guardrail assignments for the authenticated user. [Provisioning + key](/docs/guides/overview/auth/provisioning-api-keys) required. + parameters: + - schema: + type: string + description: Number of records to skip for pagination + example: '0' + required: false + description: Number of records to skip for pagination + name: offset + in: query + - schema: + type: string + description: Maximum number of records to return (max 100) + example: '50' + required: false + description: Maximum number of records to return (max 100) + name: limit + in: query + responses: + '200': + description: List of key assignments + content: + application/json: + schema: + type: object + properties: + data: + type: array + items: + type: object + properties: + id: + type: string + format: uuid + description: Unique identifier for the assignment + example: 550e8400-e29b-41d4-a716-446655440000 + key_hash: + type: string + description: Hash of the assigned API key + example: c56454edb818d6b14bc0d61c46025f1450b0f4012d12304ab40aacb519fcbc93 + guardrail_id: + type: string + format: uuid + description: ID of the guardrail + example: 550e8400-e29b-41d4-a716-446655440001 + key_name: + type: string + description: Name of the API key + example: Production Key + key_label: + type: string + description: Label of the API key + example: prod-key + assigned_by: + type: string + nullable: true + description: User ID of who made the assignment + example: user_abc123 + created_at: + type: string + description: ISO 8601 timestamp of when the assignment was created + example: '2025-08-24T10:30:00Z' + required: + - id + - key_hash + - guardrail_id + - key_name + - key_label + - assigned_by + - created_at + description: List of key assignments + total_count: + type: number + description: Total number of key assignments for this guardrail + example: 25 + required: + - data + - total_count + '401': + description: Unauthorized - Missing or invalid authentication + content: + application/json: + schema: + $ref: '#/components/schemas/UnauthorizedResponse' + '500': + description: Internal Server Error + content: + application/json: + schema: + $ref: '#/components/schemas/InternalServerResponse' + /guardrails/assignments/members: + get: + operationId: listMemberAssignments + x-speakeasy-name-override: listMemberAssignments + tags: + - Guardrails + summary: List all member assignments + description: >- + List all organization member guardrail assignments for the authenticated user. [Provisioning + key](/docs/guides/overview/auth/provisioning-api-keys) required. + parameters: + - schema: + type: string + description: Number of records to skip for pagination + example: '0' + required: false + description: Number of records to skip for pagination + name: offset + in: query + - schema: + type: string + description: Maximum number of records to return (max 100) + example: '50' + required: false + description: Maximum number of records to return (max 100) + name: limit + in: query + responses: + '200': + description: List of member assignments + content: + application/json: + schema: + type: object + properties: + data: + type: array + items: + type: object + properties: + id: + type: string + format: uuid + description: Unique identifier for the assignment + example: 550e8400-e29b-41d4-a716-446655440000 + user_id: + type: string + description: Clerk user ID of the assigned member + example: user_abc123 + organization_id: + type: string + description: Organization ID + example: org_xyz789 + guardrail_id: + type: string + format: uuid + description: ID of the guardrail + example: 550e8400-e29b-41d4-a716-446655440001 + assigned_by: + type: string + nullable: true + description: User ID of who made the assignment + example: user_abc123 + created_at: + type: string + description: ISO 8601 timestamp of when the assignment was created + example: '2025-08-24T10:30:00Z' + required: + - id + - user_id + - organization_id + - guardrail_id + - assigned_by + - created_at + description: List of member assignments + total_count: + type: number + description: Total number of member assignments + example: 10 + required: + - data + - total_count + '401': + description: Unauthorized - Missing or invalid authentication + content: + application/json: + schema: + $ref: '#/components/schemas/UnauthorizedResponse' + '500': + description: Internal Server Error + content: + application/json: + schema: + $ref: '#/components/schemas/InternalServerResponse' + /guardrails/{id}/assignments/keys: + get: + operationId: listGuardrailKeyAssignments + x-speakeasy-name-override: listGuardrailKeyAssignments + tags: + - Guardrails + summary: List key assignments for a guardrail + description: >- + List all API key assignments for a specific guardrail. [Provisioning + key](/docs/guides/overview/auth/provisioning-api-keys) required. + parameters: + - schema: + type: string + format: uuid + description: The unique identifier of the guardrail + example: 550e8400-e29b-41d4-a716-446655440000 + required: true + description: The unique identifier of the guardrail + name: id + in: path + - schema: + type: string + description: Number of records to skip for pagination + example: '0' + required: false + description: Number of records to skip for pagination + name: offset + in: query + - schema: + type: string + description: Maximum number of records to return (max 100) + example: '50' + required: false + description: Maximum number of records to return (max 100) + name: limit + in: query + responses: + '200': + description: List of key assignments + content: + application/json: + schema: + type: object + properties: + data: + type: array + items: + type: object + properties: + id: + type: string + format: uuid + description: Unique identifier for the assignment + example: 550e8400-e29b-41d4-a716-446655440000 + key_hash: + type: string + description: Hash of the assigned API key + example: c56454edb818d6b14bc0d61c46025f1450b0f4012d12304ab40aacb519fcbc93 + guardrail_id: + type: string + format: uuid + description: ID of the guardrail + example: 550e8400-e29b-41d4-a716-446655440001 + key_name: + type: string + description: Name of the API key + example: Production Key + key_label: + type: string + description: Label of the API key + example: prod-key + assigned_by: + type: string + nullable: true + description: User ID of who made the assignment + example: user_abc123 + created_at: + type: string + description: ISO 8601 timestamp of when the assignment was created + example: '2025-08-24T10:30:00Z' + required: + - id + - key_hash + - guardrail_id + - key_name + - key_label + - assigned_by + - created_at + description: List of key assignments + total_count: + type: number + description: Total number of key assignments for this guardrail + example: 25 + required: + - data + - total_count + '401': + description: Unauthorized - Missing or invalid authentication + content: + application/json: + schema: + $ref: '#/components/schemas/UnauthorizedResponse' + '404': + description: Guardrail not found + content: + application/json: + schema: + $ref: '#/components/schemas/NotFoundResponse' + '500': + description: Internal Server Error + content: + application/json: + schema: + $ref: '#/components/schemas/InternalServerResponse' + post: + operationId: bulkAssignKeysToGuardrail + x-speakeasy-name-override: bulkAssignKeys + tags: + - Guardrails + summary: Bulk assign keys to a guardrail + description: >- + Assign multiple API keys to a specific guardrail. [Provisioning + key](/docs/guides/overview/auth/provisioning-api-keys) required. + parameters: + - schema: + type: string + format: uuid + description: The unique identifier of the guardrail + example: 550e8400-e29b-41d4-a716-446655440000 + required: true + description: The unique identifier of the guardrail + name: id + in: path + requestBody: + content: + application/json: + schema: + type: object + properties: + key_hashes: + type: array + items: + type: string + minLength: 1 + minItems: 1 + description: Array of API key hashes to assign to the guardrail + example: + - c56454edb818d6b14bc0d61c46025f1450b0f4012d12304ab40aacb519fcbc93 + required: + - key_hashes + required: true + responses: + '200': + description: Assignment result + content: + application/json: + schema: + type: object + properties: + assigned_count: + type: number + description: Number of keys successfully assigned + example: 3 + required: + - assigned_count + '400': + description: Bad Request - Invalid input + content: + application/json: + schema: + $ref: '#/components/schemas/BadRequestResponse' + '401': + description: Unauthorized - Missing or invalid authentication + content: + application/json: + schema: + $ref: '#/components/schemas/UnauthorizedResponse' + '404': + description: Guardrail not found + content: + application/json: + schema: + $ref: '#/components/schemas/NotFoundResponse' + '500': + description: Internal Server Error + content: + application/json: + schema: + $ref: '#/components/schemas/InternalServerResponse' + /guardrails/{id}/assignments/members: + get: + operationId: listGuardrailMemberAssignments + x-speakeasy-name-override: listGuardrailMemberAssignments + tags: + - Guardrails + summary: List member assignments for a guardrail + description: >- + List all organization member assignments for a specific guardrail. [Provisioning + key](/docs/guides/overview/auth/provisioning-api-keys) required. + parameters: + - schema: + type: string + format: uuid + description: The unique identifier of the guardrail + example: 550e8400-e29b-41d4-a716-446655440000 + required: true + description: The unique identifier of the guardrail + name: id + in: path + - schema: + type: string + description: Number of records to skip for pagination + example: '0' + required: false + description: Number of records to skip for pagination + name: offset + in: query + - schema: + type: string + description: Maximum number of records to return (max 100) + example: '50' + required: false + description: Maximum number of records to return (max 100) + name: limit + in: query + responses: + '200': + description: List of member assignments + content: + application/json: + schema: + type: object + properties: + data: + type: array + items: + type: object + properties: + id: + type: string + format: uuid + description: Unique identifier for the assignment + example: 550e8400-e29b-41d4-a716-446655440000 + user_id: + type: string + description: Clerk user ID of the assigned member + example: user_abc123 + organization_id: + type: string + description: Organization ID + example: org_xyz789 + guardrail_id: + type: string + format: uuid + description: ID of the guardrail + example: 550e8400-e29b-41d4-a716-446655440001 + assigned_by: + type: string + nullable: true + description: User ID of who made the assignment + example: user_abc123 + created_at: + type: string + description: ISO 8601 timestamp of when the assignment was created + example: '2025-08-24T10:30:00Z' + required: + - id + - user_id + - organization_id + - guardrail_id + - assigned_by + - created_at + description: List of member assignments + total_count: + type: number + description: Total number of member assignments + example: 10 + required: + - data + - total_count + '401': + description: Unauthorized - Missing or invalid authentication + content: + application/json: + schema: + $ref: '#/components/schemas/UnauthorizedResponse' + '404': + description: Guardrail not found + content: + application/json: + schema: + $ref: '#/components/schemas/NotFoundResponse' + '500': + description: Internal Server Error + content: + application/json: + schema: + $ref: '#/components/schemas/InternalServerResponse' + post: + operationId: bulkAssignMembersToGuardrail + x-speakeasy-name-override: bulkAssignMembers + tags: + - Guardrails + summary: Bulk assign members to a guardrail + description: >- + Assign multiple organization members to a specific guardrail. [Provisioning + key](/docs/guides/overview/auth/provisioning-api-keys) required. + parameters: + - schema: + type: string + format: uuid + description: The unique identifier of the guardrail + example: 550e8400-e29b-41d4-a716-446655440000 + required: true + description: The unique identifier of the guardrail + name: id + in: path + requestBody: + content: + application/json: + schema: + type: object + properties: + member_user_ids: + type: array + items: + type: string + minLength: 1 + minItems: 1 + description: Array of member user IDs to assign to the guardrail + example: + - user_abc123 + - user_def456 + required: + - member_user_ids + required: true + responses: + '200': + description: Assignment result + content: + application/json: + schema: + type: object + properties: + assigned_count: + type: number + description: Number of members successfully assigned + example: 2 + required: + - assigned_count + '400': + description: Bad Request - Invalid input + content: + application/json: + schema: + $ref: '#/components/schemas/BadRequestResponse' + '401': + description: Unauthorized - Missing or invalid authentication + content: + application/json: + schema: + $ref: '#/components/schemas/UnauthorizedResponse' + '404': + description: Guardrail not found + content: + application/json: + schema: + $ref: '#/components/schemas/NotFoundResponse' + '500': + description: Internal Server Error + content: + application/json: + schema: + $ref: '#/components/schemas/InternalServerResponse' + /guardrails/{id}/assignments/keys/remove: + post: + operationId: bulkUnassignKeysFromGuardrail + x-speakeasy-name-override: bulkUnassignKeys + tags: + - Guardrails + summary: Bulk unassign keys from a guardrail + description: >- + Unassign multiple API keys from a specific guardrail. [Provisioning + key](/docs/guides/overview/auth/provisioning-api-keys) required. + parameters: + - schema: + type: string + format: uuid + description: The unique identifier of the guardrail + example: 550e8400-e29b-41d4-a716-446655440000 + required: true + description: The unique identifier of the guardrail + name: id + in: path + requestBody: + content: + application/json: + schema: + type: object + properties: + key_hashes: + type: array + items: + type: string + minLength: 1 + minItems: 1 + description: Array of API key hashes to unassign from the guardrail + example: + - c56454edb818d6b14bc0d61c46025f1450b0f4012d12304ab40aacb519fcbc93 + required: + - key_hashes + required: true + responses: + '200': + description: Unassignment result + content: + application/json: + schema: + type: object + properties: + unassigned_count: + type: number + description: Number of keys successfully unassigned + example: 3 + required: + - unassigned_count + '400': + description: Bad Request - Invalid input + content: + application/json: + schema: + $ref: '#/components/schemas/BadRequestResponse' + '401': + description: Unauthorized - Missing or invalid authentication + content: + application/json: + schema: + $ref: '#/components/schemas/UnauthorizedResponse' + '404': + description: Guardrail not found + content: + application/json: + schema: + $ref: '#/components/schemas/NotFoundResponse' + '500': + description: Internal Server Error + content: + application/json: + schema: + $ref: '#/components/schemas/InternalServerResponse' + /guardrails/{id}/assignments/members/remove: + post: + operationId: bulkUnassignMembersFromGuardrail + x-speakeasy-name-override: bulkUnassignMembers + tags: + - Guardrails + summary: Bulk unassign members from a guardrail + description: >- + Unassign multiple organization members from a specific guardrail. [Provisioning + key](/docs/guides/overview/auth/provisioning-api-keys) required. + parameters: + - schema: + type: string + format: uuid + description: The unique identifier of the guardrail + example: 550e8400-e29b-41d4-a716-446655440000 + required: true + description: The unique identifier of the guardrail + name: id + in: path + requestBody: + content: + application/json: + schema: + type: object + properties: + member_user_ids: + type: array + items: + type: string + minLength: 1 + minItems: 1 + description: Array of member user IDs to unassign from the guardrail + example: + - user_abc123 + - user_def456 + required: + - member_user_ids + required: true + responses: + '200': + description: Unassignment result + content: + application/json: + schema: + type: object + properties: + unassigned_count: + type: number + description: Number of members successfully unassigned + example: 2 + required: + - unassigned_count + '400': + description: Bad Request - Invalid input + content: + application/json: + schema: + $ref: '#/components/schemas/BadRequestResponse' + '401': + description: Unauthorized - Missing or invalid authentication + content: + application/json: + schema: + $ref: '#/components/schemas/UnauthorizedResponse' + '404': + description: Guardrail not found + content: + application/json: + schema: + $ref: '#/components/schemas/NotFoundResponse' + '500': + description: Internal Server Error + content: + application/json: + schema: + $ref: '#/components/schemas/InternalServerResponse' /key: get: operationId: getCurrentKey @@ -8672,7 +10117,7 @@ paths: label: type: string description: Human-readable label for the API key - example: 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 + example: sk-or-v1-0e6...1c96 limit: type: number nullable: true @@ -8782,7 +10227,7 @@ paths: - rate_limit description: Current API key information example: - label: sk-or-v1-au78b3456789012345678901234567890 + label: sk-or-v1-au7...890 limit: 100 usage: 25.5 usage_daily: 25.5 @@ -8806,7 +10251,7 @@ paths: - data example: data: - label: sk-or-v1-au78b3456789012345678901234567890 + label: sk-or-v1-au7...890 limit: 100 usage: 25.5 usage_daily: 25.5 @@ -9146,12 +10591,12 @@ tags: description: Endpoint information - name: Generations description: Generation history endpoints + - name: Guardrails + description: Guardrails endpoints - name: Models description: Model information endpoints - name: OAuth description: OAuth authentication endpoints - - name: Parameters - description: Parameters endpoints - name: Providers description: Provider information endpoints - name: beta.responses diff --git a/.speakeasy/out.openapi.yaml b/.speakeasy/out.openapi.yaml index ba83473f..9f30d77d 100644 --- a/.speakeasy/out.openapi.yaml +++ b/.speakeasy/out.openapi.yaml @@ -4616,6 +4616,11 @@ components: description: List of supported parameters for this model default_parameters: $ref: '#/components/schemas/DefaultParameters' + expiration_date: + type: string + nullable: true + description: The date after which the model may be removed. ISO 8601 date string (YYYY-MM-DD) or null if no expiration. + example: '2025-06-01' required: - id - canonical_slug @@ -4659,6 +4664,7 @@ components: - top_p - max_tokens default_parameters: null + expiration_date: null ModelsListResponseData: type: array items: @@ -4705,6 +4711,7 @@ components: - frequency_penalty - presence_penalty default_parameters: null + expiration_date: null ModelsCountResponse: type: object properties: @@ -5110,10 +5117,6 @@ components: - type: string - type: number __schema2: - anyOf: - - $ref: '#/components/schemas/ChatCompletionFinishReason' - - type: 'null' - __schema3: oneOf: - type: object properties: @@ -5123,11 +5126,11 @@ components: summary: type: string id: - $ref: '#/components/schemas/__schema4' + $ref: '#/components/schemas/__schema3' format: - $ref: '#/components/schemas/__schema5' + $ref: '#/components/schemas/__schema4' index: - $ref: '#/components/schemas/__schema6' + $ref: '#/components/schemas/__schema5' required: - type - summary @@ -5139,11 +5142,11 @@ components: data: type: string id: - $ref: '#/components/schemas/__schema4' + $ref: '#/components/schemas/__schema3' format: - $ref: '#/components/schemas/__schema5' + $ref: '#/components/schemas/__schema4' index: - $ref: '#/components/schemas/__schema6' + $ref: '#/components/schemas/__schema5' required: - type - data @@ -5161,19 +5164,19 @@ components: - type: string - type: 'null' id: - $ref: '#/components/schemas/__schema4' + $ref: '#/components/schemas/__schema3' format: - $ref: '#/components/schemas/__schema5' + $ref: '#/components/schemas/__schema4' index: - $ref: '#/components/schemas/__schema6' + $ref: '#/components/schemas/__schema5' required: - type type: object - __schema4: + __schema3: anyOf: - type: string - type: 'null' - __schema5: + __schema4: anyOf: - type: string enum: @@ -5185,8 +5188,12 @@ components: - google-gemini-v1 x-speakeasy-unknown-values: allow - type: 'null' - __schema6: + __schema5: type: number + __schema6: + anyOf: + - $ref: '#/components/schemas/ChatCompletionFinishReason' + - type: 'null' ModelName: type: string ChatMessageContentItemText: @@ -5542,6 +5549,24 @@ components: anyOf: - type: string - type: 'null' + reasoning_details: + type: array + items: + $ref: '#/components/schemas/__schema2' + images: + type: array + items: + type: object + properties: + image_url: + type: object + properties: + url: + type: string + required: + - url + required: + - image_url required: - role ToolResponseMessage: @@ -6063,15 +6088,11 @@ components: type: object properties: finish_reason: - $ref: '#/components/schemas/__schema2' + $ref: '#/components/schemas/__schema6' index: type: number message: $ref: '#/components/schemas/AssistantMessage' - reasoning_details: - type: array - items: - $ref: '#/components/schemas/__schema3' logprobs: anyOf: - $ref: '#/components/schemas/ChatMessageTokenLogprobs' @@ -6125,14 +6146,14 @@ components: reasoning_details: type: array items: - $ref: '#/components/schemas/__schema3' + $ref: '#/components/schemas/__schema2' ChatStreamingChoice: type: object properties: delta: $ref: '#/components/schemas/ChatStreamingMessageChunk' finish_reason: - $ref: '#/components/schemas/__schema2' + $ref: '#/components/schemas/__schema6' index: type: number logprobs: @@ -6646,7 +6667,8 @@ paths: - Analytics operationId: getUserActivity summary: Get user activity grouped by endpoint - description: Returns user activity data grouped by endpoint for the last 30 (completed) UTC days + description: >- + Returns user activity data grouped by endpoint for the last 30 (completed) UTC days. [Provisioning key](/docs/guides/overview/auth/provisioning-api-keys) required. parameters: - schema: type: string @@ -6715,7 +6737,8 @@ paths: - Credits summary: Get remaining credits operationId: getCredits - description: Get total credits purchased and used for the authenticated user + description: >- + Get total credits purchased and used for the authenticated user. [Provisioning key](/docs/guides/overview/auth/provisioning-api-keys) required. responses: '200': description: Returns the total credits purchased and used @@ -7419,7 +7442,24 @@ paths: parameters: - schema: type: string + enum: + - programming + - roleplay + - marketing + - marketing/seo + - technology + - science + - translation + - legal + - finance + - health + - trivia + - academia + description: Filter models by use case category + example: programming + x-speakeasy-unknown-values: allow required: false + description: Filter models by use case category name: category in: query - schema: @@ -7544,117 +7584,6 @@ paths: schema: $ref: '#/components/schemas/InternalServerResponse' operationId: listEndpointsZdr - /parameters/{author}/{slug}: - get: - tags: - - Parameters - summary: Get a model's supported parameters and data about which are most popular - security: - - bearer: [] - parameters: - - schema: - type: string - required: true - name: author - in: path - - schema: - type: string - required: true - name: slug - in: path - - schema: - $ref: '#/components/schemas/ProviderName' - required: false - name: provider - in: query - responses: - '200': - description: Returns the parameters for the specified model - content: - application/json: - schema: - type: object - properties: - data: - type: object - properties: - model: - type: string - description: Model identifier - example: openai/gpt-4 - supported_parameters: - type: array - items: - type: string - enum: - - temperature - - top_p - - top_k - - min_p - - top_a - - frequency_penalty - - presence_penalty - - repetition_penalty - - max_tokens - - logit_bias - - logprobs - - top_logprobs - - seed - - response_format - - structured_outputs - - stop - - tools - - tool_choice - - parallel_tool_calls - - include_reasoning - - reasoning - - reasoning_effort - - web_search_options - - verbosity - x-speakeasy-unknown-values: allow - description: List of parameters supported by this model - example: - - temperature - - top_p - - max_tokens - required: - - model - - supported_parameters - example: - model: openai/gpt-4 - supported_parameters: - - temperature - - top_p - - max_tokens - description: Parameter analytics data - required: - - data - example: - data: - model: openai/gpt-4 - supported_parameters: - - temperature - - top_p - - max_tokens - '401': - description: Unauthorized - Authentication required or invalid credentials - content: - application/json: - schema: - $ref: '#/components/schemas/UnauthorizedResponse' - '404': - description: Not Found - Model or provider does not exist - content: - application/json: - schema: - $ref: '#/components/schemas/NotFoundResponse' - '500': - description: Internal Server Error - Unexpected server error - content: - application/json: - schema: - $ref: '#/components/schemas/InternalServerResponse' - operationId: getParameters /providers: get: tags: @@ -7723,6 +7652,8 @@ paths: tags: - API Keys summary: List API keys + description: >- + List all API keys for the authenticated user. [Provisioning key](/docs/guides/overview/auth/provisioning-api-keys) required. parameters: - schema: type: string @@ -7756,7 +7687,7 @@ paths: hash: type: string description: Unique hash identifier for the API key - example: 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 + example: f01d52606dc8f0a8303a7b5cc3fa07109c2e346cec7c0a16b40de462992ce943 name: type: string description: Name of the API key @@ -7764,7 +7695,7 @@ paths: label: type: string description: Human-readable label for the API key - example: Production API Key + example: sk-or-v1-0e6...1c96 disabled: type: boolean description: Whether the API key is disabled @@ -7855,9 +7786,9 @@ paths: - created_at - updated_at example: - hash: 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 + hash: f01d52606dc8f0a8303a7b5cc3fa07109c2e346cec7c0a16b40de462992ce943 name: My Production Key - label: Production API Key + label: sk-or-v1-0e6...1c96 disabled: false limit: 100 limit_remaining: 74.5 @@ -7879,7 +7810,7 @@ paths: - data example: data: - - hash: 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 + - hash: f01d52606dc8f0a8303a7b5cc3fa07109c2e346cec7c0a16b40de462992ce943 name: My Production Key label: Production API Key disabled: false @@ -7921,6 +7852,8 @@ paths: tags: - API Keys summary: Create a new API key + description: >- + Create a new API key for the authenticated user. [Provisioning key](/docs/guides/overview/auth/provisioning-api-keys) required. requestBody: content: application/json: @@ -7982,7 +7915,7 @@ paths: hash: type: string description: Unique hash identifier for the API key - example: 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 + example: f01d52606dc8f0a8303a7b5cc3fa07109c2e346cec7c0a16b40de462992ce943 name: type: string description: Name of the API key @@ -7990,7 +7923,7 @@ paths: label: type: string description: Human-readable label for the API key - example: Production API Key + example: sk-or-v1-0e6...1c96 disabled: type: boolean description: Whether the API key is disabled @@ -8081,9 +8014,9 @@ paths: - created_at - updated_at example: - hash: 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 + hash: f01d52606dc8f0a8303a7b5cc3fa07109c2e346cec7c0a16b40de462992ce943 name: My Production Key - label: Production API Key + label: sk-or-v1-0e6...1c96 disabled: false limit: 100 limit_remaining: 74.5 @@ -8110,7 +8043,7 @@ paths: - key example: data: - hash: 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 + hash: f01d52606dc8f0a8303a7b5cc3fa07109c2e346cec7c0a16b40de462992ce943 name: My New API Key label: My New API Key disabled: false @@ -8161,11 +8094,12 @@ paths: tags: - API Keys summary: Update an API key + description: Update an existing API key. [Provisioning key](/docs/guides/overview/auth/provisioning-api-keys) required. parameters: - schema: type: string description: The hash identifier of the API key to update - example: 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 + example: f01d52606dc8f0a8303a7b5cc3fa07109c2e346cec7c0a16b40de462992ce943 required: true description: The hash identifier of the API key to update name: hash @@ -8225,7 +8159,7 @@ paths: hash: type: string description: Unique hash identifier for the API key - example: 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 + example: f01d52606dc8f0a8303a7b5cc3fa07109c2e346cec7c0a16b40de462992ce943 name: type: string description: Name of the API key @@ -8233,7 +8167,7 @@ paths: label: type: string description: Human-readable label for the API key - example: Production API Key + example: sk-or-v1-0e6...1c96 disabled: type: boolean description: Whether the API key is disabled @@ -8324,9 +8258,9 @@ paths: - created_at - updated_at example: - hash: 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 + hash: f01d52606dc8f0a8303a7b5cc3fa07109c2e346cec7c0a16b40de462992ce943 name: My Production Key - label: Production API Key + label: sk-or-v1-0e6...1c96 disabled: false limit: 100 limit_remaining: 74.5 @@ -8348,7 +8282,7 @@ paths: - data example: data: - hash: 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 + hash: f01d52606dc8f0a8303a7b5cc3fa07109c2e346cec7c0a16b40de462992ce943 name: Updated API Key Name label: Updated API Key Name disabled: false @@ -8403,11 +8337,12 @@ paths: tags: - API Keys summary: Delete an API key + description: Delete an existing API key. [Provisioning key](/docs/guides/overview/auth/provisioning-api-keys) required. parameters: - schema: type: string description: The hash identifier of the API key to delete - example: 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 + example: f01d52606dc8f0a8303a7b5cc3fa07109c2e346cec7c0a16b40de462992ce943 required: true description: The hash identifier of the API key to delete name: hash @@ -8460,11 +8395,12 @@ paths: tags: - API Keys summary: Get a single API key + description: Get a single API key by hash. [Provisioning key](/docs/guides/overview/auth/provisioning-api-keys) required. parameters: - schema: type: string description: The hash identifier of the API key to retrieve - example: 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 + example: f01d52606dc8f0a8303a7b5cc3fa07109c2e346cec7c0a16b40de462992ce943 required: true description: The hash identifier of the API key to retrieve name: hash @@ -8483,7 +8419,7 @@ paths: hash: type: string description: Unique hash identifier for the API key - example: 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 + example: f01d52606dc8f0a8303a7b5cc3fa07109c2e346cec7c0a16b40de462992ce943 name: type: string description: Name of the API key @@ -8491,7 +8427,7 @@ paths: label: type: string description: Human-readable label for the API key - example: Production API Key + example: sk-or-v1-0e6...1c96 disabled: type: boolean description: Whether the API key is disabled @@ -8582,9 +8518,9 @@ paths: - created_at - updated_at example: - hash: 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 + hash: f01d52606dc8f0a8303a7b5cc3fa07109c2e346cec7c0a16b40de462992ce943 name: My Production Key - label: Production API Key + label: sk-or-v1-0e6...1c96 disabled: false limit: 100 limit_remaining: 74.5 @@ -8606,7 +8542,7 @@ paths: - data example: data: - hash: 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 + hash: f01d52606dc8f0a8303a7b5cc3fa07109c2e346cec7c0a16b40de462992ce943 name: My Production Key label: Production API Key disabled: false @@ -8649,6 +8585,1507 @@ paths: application/json: schema: $ref: '#/components/schemas/InternalServerResponse' + /guardrails: + get: + operationId: listGuardrails + x-speakeasy-name-override: list + tags: + - Guardrails + summary: List guardrails + description: >- + List all guardrails for the authenticated user. [Provisioning key](/docs/guides/overview/auth/provisioning-api-keys) required. + parameters: + - schema: + type: string + description: Number of records to skip for pagination + example: '0' + required: false + description: Number of records to skip for pagination + name: offset + in: query + - schema: + type: string + description: Maximum number of records to return (max 100) + example: '50' + required: false + description: Maximum number of records to return (max 100) + name: limit + in: query + responses: + '200': + description: List of guardrails + content: + application/json: + schema: + type: object + properties: + data: + type: array + items: + type: object + properties: + id: + type: string + format: uuid + description: Unique identifier for the guardrail + example: 550e8400-e29b-41d4-a716-446655440000 + name: + type: string + description: Name of the guardrail + example: Production Guardrail + description: + type: string + nullable: true + description: Description of the guardrail + example: Guardrail for production environment + limit_usd: + type: number + nullable: true + minimum: 0 + exclusiveMinimum: true + description: Spending limit in USD + example: 100 + reset_interval: + type: string + nullable: true + enum: + - daily + - weekly + - monthly + description: Interval at which the limit resets (daily, weekly, monthly) + example: monthly + x-speakeasy-unknown-values: allow + allowed_providers: + type: array + nullable: true + items: + type: string + description: List of allowed provider IDs + example: + - openai + - anthropic + - google + allowed_models: + type: array + nullable: true + items: + type: string + description: Array of model canonical_slugs (immutable identifiers) + example: + - openai/gpt-5.2-20251211 + - anthropic/claude-4.5-opus-20251124 + - deepseek/deepseek-r1-0528:free + enforce_zdr: + type: boolean + nullable: true + description: Whether to enforce zero data retention + example: false + created_at: + type: string + description: ISO 8601 timestamp of when the guardrail was created + example: '2025-08-24T10:30:00Z' + updated_at: + type: string + nullable: true + description: ISO 8601 timestamp of when the guardrail was last updated + example: '2025-08-24T15:45:00Z' + required: + - id + - name + - created_at + example: + id: 550e8400-e29b-41d4-a716-446655440000 + name: Production Guardrail + description: Guardrail for production environment + limit_usd: 100 + reset_interval: monthly + allowed_providers: + - openai + - anthropic + - google + allowed_models: null + enforce_zdr: false + created_at: '2025-08-24T10:30:00Z' + updated_at: '2025-08-24T15:45:00Z' + description: List of guardrails + total_count: + type: number + description: Total number of guardrails + example: 25 + required: + - data + - total_count + example: + data: + - id: 550e8400-e29b-41d4-a716-446655440000 + name: Production Guardrail + description: Guardrail for production environment + limit_usd: 100 + reset_interval: monthly + allowed_providers: + - openai + - anthropic + - google + allowed_models: null + enforce_zdr: false + created_at: '2025-08-24T10:30:00Z' + updated_at: '2025-08-24T15:45:00Z' + total_count: 1 + '401': + description: Unauthorized - Missing or invalid authentication + content: + application/json: + schema: + $ref: '#/components/schemas/UnauthorizedResponse' + '500': + description: Internal Server Error + content: + application/json: + schema: + $ref: '#/components/schemas/InternalServerResponse' + post: + operationId: createGuardrail + x-speakeasy-name-override: create + tags: + - Guardrails + summary: Create a guardrail + description: >- + Create a new guardrail for the authenticated user. [Provisioning key](/docs/guides/overview/auth/provisioning-api-keys) required. + requestBody: + content: + application/json: + schema: + type: object + properties: + name: + type: string + minLength: 1 + maxLength: 200 + description: Name for the new guardrail + example: My New Guardrail + description: + type: string + nullable: true + maxLength: 1000 + description: Description of the guardrail + example: A guardrail for limiting API usage + limit_usd: + type: number + nullable: true + minimum: 0 + exclusiveMinimum: true + description: Spending limit in USD + example: 50 + reset_interval: + type: string + nullable: true + enum: + - daily + - weekly + - monthly + description: Interval at which the limit resets (daily, weekly, monthly) + example: monthly + x-speakeasy-unknown-values: allow + allowed_providers: + type: array + nullable: true + items: + type: string + minItems: 1 + description: List of allowed provider IDs + example: + - openai + - anthropic + - deepseek + allowed_models: + type: array + nullable: true + items: + type: string + minItems: 1 + description: Array of model identifiers (slug or canonical_slug accepted) + example: + - openai/gpt-5.2 + - anthropic/claude-4.5-opus-20251124 + - deepseek/deepseek-r1-0528:free + enforce_zdr: + type: boolean + nullable: true + description: Whether to enforce zero data retention + example: false + required: + - name + example: + name: My New Guardrail + description: A guardrail for limiting API usage + limit_usd: 50 + reset_interval: monthly + allowed_providers: + - openai + - anthropic + - deepseek + allowed_models: null + enforce_zdr: false + required: true + responses: + '201': + description: Guardrail created successfully + content: + application/json: + schema: + type: object + properties: + data: + type: object + properties: + id: + type: string + format: uuid + description: Unique identifier for the guardrail + example: 550e8400-e29b-41d4-a716-446655440000 + name: + type: string + description: Name of the guardrail + example: Production Guardrail + description: + type: string + nullable: true + description: Description of the guardrail + example: Guardrail for production environment + limit_usd: + type: number + nullable: true + minimum: 0 + exclusiveMinimum: true + description: Spending limit in USD + example: 100 + reset_interval: + type: string + nullable: true + enum: + - daily + - weekly + - monthly + description: Interval at which the limit resets (daily, weekly, monthly) + example: monthly + x-speakeasy-unknown-values: allow + allowed_providers: + type: array + nullable: true + items: + type: string + description: List of allowed provider IDs + example: + - openai + - anthropic + - google + allowed_models: + type: array + nullable: true + items: + type: string + description: Array of model canonical_slugs (immutable identifiers) + example: + - openai/gpt-5.2-20251211 + - anthropic/claude-4.5-opus-20251124 + - deepseek/deepseek-r1-0528:free + enforce_zdr: + type: boolean + nullable: true + description: Whether to enforce zero data retention + example: false + created_at: + type: string + description: ISO 8601 timestamp of when the guardrail was created + example: '2025-08-24T10:30:00Z' + updated_at: + type: string + nullable: true + description: ISO 8601 timestamp of when the guardrail was last updated + example: '2025-08-24T15:45:00Z' + required: + - id + - name + - created_at + example: + id: 550e8400-e29b-41d4-a716-446655440000 + name: Production Guardrail + description: Guardrail for production environment + limit_usd: 100 + reset_interval: monthly + allowed_providers: + - openai + - anthropic + - google + allowed_models: null + enforce_zdr: false + created_at: '2025-08-24T10:30:00Z' + updated_at: '2025-08-24T15:45:00Z' + description: The created guardrail + required: + - data + example: + data: + id: 550e8400-e29b-41d4-a716-446655440000 + name: My New Guardrail + description: A guardrail for limiting API usage + limit_usd: 50 + reset_interval: monthly + allowed_providers: + - openai + - anthropic + - google + allowed_models: null + enforce_zdr: false + created_at: '2025-08-24T10:30:00Z' + updated_at: null + '400': + description: Bad Request - Invalid request parameters + content: + application/json: + schema: + $ref: '#/components/schemas/BadRequestResponse' + '401': + description: Unauthorized - Missing or invalid authentication + content: + application/json: + schema: + $ref: '#/components/schemas/UnauthorizedResponse' + '500': + description: Internal Server Error + content: + application/json: + schema: + $ref: '#/components/schemas/InternalServerResponse' + /guardrails/{id}: + get: + operationId: getGuardrail + x-speakeasy-name-override: get + tags: + - Guardrails + summary: Get a guardrail + description: Get a single guardrail by ID. [Provisioning key](/docs/guides/overview/auth/provisioning-api-keys) required. + parameters: + - schema: + type: string + format: uuid + description: The unique identifier of the guardrail to retrieve + example: 550e8400-e29b-41d4-a716-446655440000 + required: true + description: The unique identifier of the guardrail to retrieve + name: id + in: path + responses: + '200': + description: Guardrail details + content: + application/json: + schema: + type: object + properties: + data: + type: object + properties: + id: + type: string + format: uuid + description: Unique identifier for the guardrail + example: 550e8400-e29b-41d4-a716-446655440000 + name: + type: string + description: Name of the guardrail + example: Production Guardrail + description: + type: string + nullable: true + description: Description of the guardrail + example: Guardrail for production environment + limit_usd: + type: number + nullable: true + minimum: 0 + exclusiveMinimum: true + description: Spending limit in USD + example: 100 + reset_interval: + type: string + nullable: true + enum: + - daily + - weekly + - monthly + description: Interval at which the limit resets (daily, weekly, monthly) + example: monthly + x-speakeasy-unknown-values: allow + allowed_providers: + type: array + nullable: true + items: + type: string + description: List of allowed provider IDs + example: + - openai + - anthropic + - google + allowed_models: + type: array + nullable: true + items: + type: string + description: Array of model canonical_slugs (immutable identifiers) + example: + - openai/gpt-5.2-20251211 + - anthropic/claude-4.5-opus-20251124 + - deepseek/deepseek-r1-0528:free + enforce_zdr: + type: boolean + nullable: true + description: Whether to enforce zero data retention + example: false + created_at: + type: string + description: ISO 8601 timestamp of when the guardrail was created + example: '2025-08-24T10:30:00Z' + updated_at: + type: string + nullable: true + description: ISO 8601 timestamp of when the guardrail was last updated + example: '2025-08-24T15:45:00Z' + required: + - id + - name + - created_at + example: + id: 550e8400-e29b-41d4-a716-446655440000 + name: Production Guardrail + description: Guardrail for production environment + limit_usd: 100 + reset_interval: monthly + allowed_providers: + - openai + - anthropic + - google + allowed_models: null + enforce_zdr: false + created_at: '2025-08-24T10:30:00Z' + updated_at: '2025-08-24T15:45:00Z' + description: The guardrail + required: + - data + example: + data: + id: 550e8400-e29b-41d4-a716-446655440000 + name: Production Guardrail + description: Guardrail for production environment + limit_usd: 100 + reset_interval: monthly + allowed_providers: + - openai + - anthropic + - google + allowed_models: null + enforce_zdr: false + created_at: '2025-08-24T10:30:00Z' + updated_at: '2025-08-24T15:45:00Z' + '401': + description: Unauthorized - Missing or invalid authentication + content: + application/json: + schema: + $ref: '#/components/schemas/UnauthorizedResponse' + '404': + description: Not Found - Guardrail does not exist + content: + application/json: + schema: + $ref: '#/components/schemas/NotFoundResponse' + '500': + description: Internal Server Error + content: + application/json: + schema: + $ref: '#/components/schemas/InternalServerResponse' + patch: + operationId: updateGuardrail + x-speakeasy-name-override: update + tags: + - Guardrails + summary: Update a guardrail + description: Update an existing guardrail. [Provisioning key](/docs/guides/overview/auth/provisioning-api-keys) required. + parameters: + - schema: + type: string + format: uuid + description: The unique identifier of the guardrail to update + example: 550e8400-e29b-41d4-a716-446655440000 + required: true + description: The unique identifier of the guardrail to update + name: id + in: path + requestBody: + content: + application/json: + schema: + type: object + properties: + name: + type: string + minLength: 1 + maxLength: 200 + description: New name for the guardrail + example: Updated Guardrail Name + description: + type: string + nullable: true + maxLength: 1000 + description: New description for the guardrail + example: Updated description + limit_usd: + type: number + nullable: true + minimum: 0 + exclusiveMinimum: true + description: New spending limit in USD + example: 75 + reset_interval: + type: string + nullable: true + enum: + - daily + - weekly + - monthly + description: Interval at which the limit resets (daily, weekly, monthly) + example: monthly + x-speakeasy-unknown-values: allow + allowed_providers: + type: array + nullable: true + items: + type: string + minItems: 1 + description: New list of allowed provider IDs + example: + - openai + - anthropic + - deepseek + allowed_models: + type: array + nullable: true + items: + type: string + minItems: 1 + description: Array of model identifiers (slug or canonical_slug accepted) + example: + - openai/gpt-5.2 + enforce_zdr: + type: boolean + nullable: true + description: Whether to enforce zero data retention + example: true + example: + name: Updated Guardrail Name + description: Updated description + limit_usd: 75 + reset_interval: weekly + required: true + responses: + '200': + description: Guardrail updated successfully + content: + application/json: + schema: + type: object + properties: + data: + type: object + properties: + id: + type: string + format: uuid + description: Unique identifier for the guardrail + example: 550e8400-e29b-41d4-a716-446655440000 + name: + type: string + description: Name of the guardrail + example: Production Guardrail + description: + type: string + nullable: true + description: Description of the guardrail + example: Guardrail for production environment + limit_usd: + type: number + nullable: true + minimum: 0 + exclusiveMinimum: true + description: Spending limit in USD + example: 100 + reset_interval: + type: string + nullable: true + enum: + - daily + - weekly + - monthly + description: Interval at which the limit resets (daily, weekly, monthly) + example: monthly + x-speakeasy-unknown-values: allow + allowed_providers: + type: array + nullable: true + items: + type: string + description: List of allowed provider IDs + example: + - openai + - anthropic + - google + allowed_models: + type: array + nullable: true + items: + type: string + description: Array of model canonical_slugs (immutable identifiers) + example: + - openai/gpt-5.2-20251211 + - anthropic/claude-4.5-opus-20251124 + - deepseek/deepseek-r1-0528:free + enforce_zdr: + type: boolean + nullable: true + description: Whether to enforce zero data retention + example: false + created_at: + type: string + description: ISO 8601 timestamp of when the guardrail was created + example: '2025-08-24T10:30:00Z' + updated_at: + type: string + nullable: true + description: ISO 8601 timestamp of when the guardrail was last updated + example: '2025-08-24T15:45:00Z' + required: + - id + - name + - created_at + example: + id: 550e8400-e29b-41d4-a716-446655440000 + name: Production Guardrail + description: Guardrail for production environment + limit_usd: 100 + reset_interval: monthly + allowed_providers: + - openai + - anthropic + - google + allowed_models: null + enforce_zdr: false + created_at: '2025-08-24T10:30:00Z' + updated_at: '2025-08-24T15:45:00Z' + description: The updated guardrail + required: + - data + example: + data: + id: 550e8400-e29b-41d4-a716-446655440000 + name: Updated Guardrail Name + description: Updated description + limit_usd: 75 + reset_interval: weekly + allowed_providers: + - openai + allowed_models: null + enforce_zdr: true + created_at: '2025-08-24T10:30:00Z' + updated_at: '2025-08-24T16:00:00Z' + '400': + description: Bad Request - Invalid request parameters + content: + application/json: + schema: + $ref: '#/components/schemas/BadRequestResponse' + '401': + description: Unauthorized - Missing or invalid authentication + content: + application/json: + schema: + $ref: '#/components/schemas/UnauthorizedResponse' + '404': + description: Not Found - Guardrail does not exist + content: + application/json: + schema: + $ref: '#/components/schemas/NotFoundResponse' + '500': + description: Internal Server Error + content: + application/json: + schema: + $ref: '#/components/schemas/InternalServerResponse' + delete: + operationId: deleteGuardrail + x-speakeasy-name-override: delete + tags: + - Guardrails + summary: Delete a guardrail + description: Delete an existing guardrail. [Provisioning key](/docs/guides/overview/auth/provisioning-api-keys) required. + parameters: + - schema: + type: string + format: uuid + description: The unique identifier of the guardrail to delete + example: 550e8400-e29b-41d4-a716-446655440000 + required: true + description: The unique identifier of the guardrail to delete + name: id + in: path + responses: + '200': + description: Guardrail deleted successfully + content: + application/json: + schema: + type: object + properties: + deleted: + type: boolean + const: true + description: Confirmation that the guardrail was deleted + example: true + required: + - deleted + example: + deleted: true + '401': + description: Unauthorized - Missing or invalid authentication + content: + application/json: + schema: + $ref: '#/components/schemas/UnauthorizedResponse' + '404': + description: Not Found - Guardrail does not exist + content: + application/json: + schema: + $ref: '#/components/schemas/NotFoundResponse' + '500': + description: Internal Server Error + content: + application/json: + schema: + $ref: '#/components/schemas/InternalServerResponse' + /guardrails/assignments/keys: + get: + operationId: listKeyAssignments + x-speakeasy-name-override: listKeyAssignments + tags: + - Guardrails + summary: List all key assignments + description: >- + List all API key guardrail assignments for the authenticated user. [Provisioning key](/docs/guides/overview/auth/provisioning-api-keys) required. + parameters: + - schema: + type: string + description: Number of records to skip for pagination + example: '0' + required: false + description: Number of records to skip for pagination + name: offset + in: query + - schema: + type: string + description: Maximum number of records to return (max 100) + example: '50' + required: false + description: Maximum number of records to return (max 100) + name: limit + in: query + responses: + '200': + description: List of key assignments + content: + application/json: + schema: + type: object + properties: + data: + type: array + items: + type: object + properties: + id: + type: string + format: uuid + description: Unique identifier for the assignment + example: 550e8400-e29b-41d4-a716-446655440000 + key_hash: + type: string + description: Hash of the assigned API key + example: c56454edb818d6b14bc0d61c46025f1450b0f4012d12304ab40aacb519fcbc93 + guardrail_id: + type: string + format: uuid + description: ID of the guardrail + example: 550e8400-e29b-41d4-a716-446655440001 + key_name: + type: string + description: Name of the API key + example: Production Key + key_label: + type: string + description: Label of the API key + example: prod-key + assigned_by: + type: string + nullable: true + description: User ID of who made the assignment + example: user_abc123 + created_at: + type: string + description: ISO 8601 timestamp of when the assignment was created + example: '2025-08-24T10:30:00Z' + required: + - id + - key_hash + - guardrail_id + - key_name + - key_label + - assigned_by + - created_at + description: List of key assignments + total_count: + type: number + description: Total number of key assignments for this guardrail + example: 25 + required: + - data + - total_count + '401': + description: Unauthorized - Missing or invalid authentication + content: + application/json: + schema: + $ref: '#/components/schemas/UnauthorizedResponse' + '500': + description: Internal Server Error + content: + application/json: + schema: + $ref: '#/components/schemas/InternalServerResponse' + /guardrails/assignments/members: + get: + operationId: listMemberAssignments + x-speakeasy-name-override: listMemberAssignments + tags: + - Guardrails + summary: List all member assignments + description: >- + List all organization member guardrail assignments for the authenticated user. [Provisioning key](/docs/guides/overview/auth/provisioning-api-keys) required. + parameters: + - schema: + type: string + description: Number of records to skip for pagination + example: '0' + required: false + description: Number of records to skip for pagination + name: offset + in: query + - schema: + type: string + description: Maximum number of records to return (max 100) + example: '50' + required: false + description: Maximum number of records to return (max 100) + name: limit + in: query + responses: + '200': + description: List of member assignments + content: + application/json: + schema: + type: object + properties: + data: + type: array + items: + type: object + properties: + id: + type: string + format: uuid + description: Unique identifier for the assignment + example: 550e8400-e29b-41d4-a716-446655440000 + user_id: + type: string + description: Clerk user ID of the assigned member + example: user_abc123 + organization_id: + type: string + description: Organization ID + example: org_xyz789 + guardrail_id: + type: string + format: uuid + description: ID of the guardrail + example: 550e8400-e29b-41d4-a716-446655440001 + assigned_by: + type: string + nullable: true + description: User ID of who made the assignment + example: user_abc123 + created_at: + type: string + description: ISO 8601 timestamp of when the assignment was created + example: '2025-08-24T10:30:00Z' + required: + - id + - user_id + - organization_id + - guardrail_id + - assigned_by + - created_at + description: List of member assignments + total_count: + type: number + description: Total number of member assignments + example: 10 + required: + - data + - total_count + '401': + description: Unauthorized - Missing or invalid authentication + content: + application/json: + schema: + $ref: '#/components/schemas/UnauthorizedResponse' + '500': + description: Internal Server Error + content: + application/json: + schema: + $ref: '#/components/schemas/InternalServerResponse' + /guardrails/{id}/assignments/keys: + get: + operationId: listGuardrailKeyAssignments + x-speakeasy-name-override: listGuardrailKeyAssignments + tags: + - Guardrails + summary: List key assignments for a guardrail + description: >- + List all API key assignments for a specific guardrail. [Provisioning key](/docs/guides/overview/auth/provisioning-api-keys) required. + parameters: + - schema: + type: string + format: uuid + description: The unique identifier of the guardrail + example: 550e8400-e29b-41d4-a716-446655440000 + required: true + description: The unique identifier of the guardrail + name: id + in: path + - schema: + type: string + description: Number of records to skip for pagination + example: '0' + required: false + description: Number of records to skip for pagination + name: offset + in: query + - schema: + type: string + description: Maximum number of records to return (max 100) + example: '50' + required: false + description: Maximum number of records to return (max 100) + name: limit + in: query + responses: + '200': + description: List of key assignments + content: + application/json: + schema: + type: object + properties: + data: + type: array + items: + type: object + properties: + id: + type: string + format: uuid + description: Unique identifier for the assignment + example: 550e8400-e29b-41d4-a716-446655440000 + key_hash: + type: string + description: Hash of the assigned API key + example: c56454edb818d6b14bc0d61c46025f1450b0f4012d12304ab40aacb519fcbc93 + guardrail_id: + type: string + format: uuid + description: ID of the guardrail + example: 550e8400-e29b-41d4-a716-446655440001 + key_name: + type: string + description: Name of the API key + example: Production Key + key_label: + type: string + description: Label of the API key + example: prod-key + assigned_by: + type: string + nullable: true + description: User ID of who made the assignment + example: user_abc123 + created_at: + type: string + description: ISO 8601 timestamp of when the assignment was created + example: '2025-08-24T10:30:00Z' + required: + - id + - key_hash + - guardrail_id + - key_name + - key_label + - assigned_by + - created_at + description: List of key assignments + total_count: + type: number + description: Total number of key assignments for this guardrail + example: 25 + required: + - data + - total_count + '401': + description: Unauthorized - Missing or invalid authentication + content: + application/json: + schema: + $ref: '#/components/schemas/UnauthorizedResponse' + '404': + description: Guardrail not found + content: + application/json: + schema: + $ref: '#/components/schemas/NotFoundResponse' + '500': + description: Internal Server Error + content: + application/json: + schema: + $ref: '#/components/schemas/InternalServerResponse' + post: + operationId: bulkAssignKeysToGuardrail + x-speakeasy-name-override: bulkAssignKeys + tags: + - Guardrails + summary: Bulk assign keys to a guardrail + description: >- + Assign multiple API keys to a specific guardrail. [Provisioning key](/docs/guides/overview/auth/provisioning-api-keys) required. + parameters: + - schema: + type: string + format: uuid + description: The unique identifier of the guardrail + example: 550e8400-e29b-41d4-a716-446655440000 + required: true + description: The unique identifier of the guardrail + name: id + in: path + requestBody: + content: + application/json: + schema: + type: object + properties: + key_hashes: + type: array + items: + type: string + minLength: 1 + minItems: 1 + description: Array of API key hashes to assign to the guardrail + example: + - c56454edb818d6b14bc0d61c46025f1450b0f4012d12304ab40aacb519fcbc93 + required: + - key_hashes + required: true + responses: + '200': + description: Assignment result + content: + application/json: + schema: + type: object + properties: + assigned_count: + type: number + description: Number of keys successfully assigned + example: 3 + required: + - assigned_count + '400': + description: Bad Request - Invalid input + content: + application/json: + schema: + $ref: '#/components/schemas/BadRequestResponse' + '401': + description: Unauthorized - Missing or invalid authentication + content: + application/json: + schema: + $ref: '#/components/schemas/UnauthorizedResponse' + '404': + description: Guardrail not found + content: + application/json: + schema: + $ref: '#/components/schemas/NotFoundResponse' + '500': + description: Internal Server Error + content: + application/json: + schema: + $ref: '#/components/schemas/InternalServerResponse' + /guardrails/{id}/assignments/members: + get: + operationId: listGuardrailMemberAssignments + x-speakeasy-name-override: listGuardrailMemberAssignments + tags: + - Guardrails + summary: List member assignments for a guardrail + description: >- + List all organization member assignments for a specific guardrail. [Provisioning key](/docs/guides/overview/auth/provisioning-api-keys) required. + parameters: + - schema: + type: string + format: uuid + description: The unique identifier of the guardrail + example: 550e8400-e29b-41d4-a716-446655440000 + required: true + description: The unique identifier of the guardrail + name: id + in: path + - schema: + type: string + description: Number of records to skip for pagination + example: '0' + required: false + description: Number of records to skip for pagination + name: offset + in: query + - schema: + type: string + description: Maximum number of records to return (max 100) + example: '50' + required: false + description: Maximum number of records to return (max 100) + name: limit + in: query + responses: + '200': + description: List of member assignments + content: + application/json: + schema: + type: object + properties: + data: + type: array + items: + type: object + properties: + id: + type: string + format: uuid + description: Unique identifier for the assignment + example: 550e8400-e29b-41d4-a716-446655440000 + user_id: + type: string + description: Clerk user ID of the assigned member + example: user_abc123 + organization_id: + type: string + description: Organization ID + example: org_xyz789 + guardrail_id: + type: string + format: uuid + description: ID of the guardrail + example: 550e8400-e29b-41d4-a716-446655440001 + assigned_by: + type: string + nullable: true + description: User ID of who made the assignment + example: user_abc123 + created_at: + type: string + description: ISO 8601 timestamp of when the assignment was created + example: '2025-08-24T10:30:00Z' + required: + - id + - user_id + - organization_id + - guardrail_id + - assigned_by + - created_at + description: List of member assignments + total_count: + type: number + description: Total number of member assignments + example: 10 + required: + - data + - total_count + '401': + description: Unauthorized - Missing or invalid authentication + content: + application/json: + schema: + $ref: '#/components/schemas/UnauthorizedResponse' + '404': + description: Guardrail not found + content: + application/json: + schema: + $ref: '#/components/schemas/NotFoundResponse' + '500': + description: Internal Server Error + content: + application/json: + schema: + $ref: '#/components/schemas/InternalServerResponse' + post: + operationId: bulkAssignMembersToGuardrail + x-speakeasy-name-override: bulkAssignMembers + tags: + - Guardrails + summary: Bulk assign members to a guardrail + description: >- + Assign multiple organization members to a specific guardrail. [Provisioning key](/docs/guides/overview/auth/provisioning-api-keys) required. + parameters: + - schema: + type: string + format: uuid + description: The unique identifier of the guardrail + example: 550e8400-e29b-41d4-a716-446655440000 + required: true + description: The unique identifier of the guardrail + name: id + in: path + requestBody: + content: + application/json: + schema: + type: object + properties: + member_user_ids: + type: array + items: + type: string + minLength: 1 + minItems: 1 + description: Array of member user IDs to assign to the guardrail + example: + - user_abc123 + - user_def456 + required: + - member_user_ids + required: true + responses: + '200': + description: Assignment result + content: + application/json: + schema: + type: object + properties: + assigned_count: + type: number + description: Number of members successfully assigned + example: 2 + required: + - assigned_count + '400': + description: Bad Request - Invalid input + content: + application/json: + schema: + $ref: '#/components/schemas/BadRequestResponse' + '401': + description: Unauthorized - Missing or invalid authentication + content: + application/json: + schema: + $ref: '#/components/schemas/UnauthorizedResponse' + '404': + description: Guardrail not found + content: + application/json: + schema: + $ref: '#/components/schemas/NotFoundResponse' + '500': + description: Internal Server Error + content: + application/json: + schema: + $ref: '#/components/schemas/InternalServerResponse' + /guardrails/{id}/assignments/keys/remove: + post: + operationId: bulkUnassignKeysFromGuardrail + x-speakeasy-name-override: bulkUnassignKeys + tags: + - Guardrails + summary: Bulk unassign keys from a guardrail + description: >- + Unassign multiple API keys from a specific guardrail. [Provisioning key](/docs/guides/overview/auth/provisioning-api-keys) required. + parameters: + - schema: + type: string + format: uuid + description: The unique identifier of the guardrail + example: 550e8400-e29b-41d4-a716-446655440000 + required: true + description: The unique identifier of the guardrail + name: id + in: path + requestBody: + content: + application/json: + schema: + type: object + properties: + key_hashes: + type: array + items: + type: string + minLength: 1 + minItems: 1 + description: Array of API key hashes to unassign from the guardrail + example: + - c56454edb818d6b14bc0d61c46025f1450b0f4012d12304ab40aacb519fcbc93 + required: + - key_hashes + required: true + responses: + '200': + description: Unassignment result + content: + application/json: + schema: + type: object + properties: + unassigned_count: + type: number + description: Number of keys successfully unassigned + example: 3 + required: + - unassigned_count + '400': + description: Bad Request - Invalid input + content: + application/json: + schema: + $ref: '#/components/schemas/BadRequestResponse' + '401': + description: Unauthorized - Missing or invalid authentication + content: + application/json: + schema: + $ref: '#/components/schemas/UnauthorizedResponse' + '404': + description: Guardrail not found + content: + application/json: + schema: + $ref: '#/components/schemas/NotFoundResponse' + '500': + description: Internal Server Error + content: + application/json: + schema: + $ref: '#/components/schemas/InternalServerResponse' + /guardrails/{id}/assignments/members/remove: + post: + operationId: bulkUnassignMembersFromGuardrail + x-speakeasy-name-override: bulkUnassignMembers + tags: + - Guardrails + summary: Bulk unassign members from a guardrail + description: >- + Unassign multiple organization members from a specific guardrail. [Provisioning key](/docs/guides/overview/auth/provisioning-api-keys) required. + parameters: + - schema: + type: string + format: uuid + description: The unique identifier of the guardrail + example: 550e8400-e29b-41d4-a716-446655440000 + required: true + description: The unique identifier of the guardrail + name: id + in: path + requestBody: + content: + application/json: + schema: + type: object + properties: + member_user_ids: + type: array + items: + type: string + minLength: 1 + minItems: 1 + description: Array of member user IDs to unassign from the guardrail + example: + - user_abc123 + - user_def456 + required: + - member_user_ids + required: true + responses: + '200': + description: Unassignment result + content: + application/json: + schema: + type: object + properties: + unassigned_count: + type: number + description: Number of members successfully unassigned + example: 2 + required: + - unassigned_count + '400': + description: Bad Request - Invalid input + content: + application/json: + schema: + $ref: '#/components/schemas/BadRequestResponse' + '401': + description: Unauthorized - Missing or invalid authentication + content: + application/json: + schema: + $ref: '#/components/schemas/UnauthorizedResponse' + '404': + description: Guardrail not found + content: + application/json: + schema: + $ref: '#/components/schemas/NotFoundResponse' + '500': + description: Internal Server Error + content: + application/json: + schema: + $ref: '#/components/schemas/InternalServerResponse' /key: get: operationId: getCurrentKey @@ -8671,7 +10108,7 @@ paths: label: type: string description: Human-readable label for the API key - example: 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 + example: sk-or-v1-0e6...1c96 limit: type: number nullable: true @@ -8781,7 +10218,7 @@ paths: - rate_limit description: Current API key information example: - label: sk-or-v1-au78b3456789012345678901234567890 + label: sk-or-v1-au7...890 limit: 100 usage: 25.5 usage_daily: 25.5 @@ -8805,7 +10242,7 @@ paths: - data example: data: - label: sk-or-v1-au78b3456789012345678901234567890 + label: sk-or-v1-au7...890 limit: 100 usage: 25.5 usage_daily: 25.5 @@ -9145,12 +10582,12 @@ tags: description: Endpoint information - name: Generations description: Generation history endpoints + - name: Guardrails + description: Guardrails endpoints - name: Models description: Model information endpoints - name: OAuth description: OAuth authentication endpoints - - name: Parameters - description: Parameters endpoints - name: Providers description: Provider information endpoints - name: beta.responses diff --git a/.speakeasy/workflow.lock b/.speakeasy/workflow.lock index 9fb4199d..5a974bb3 100644 --- a/.speakeasy/workflow.lock +++ b/.speakeasy/workflow.lock @@ -2,18 +2,17 @@ speakeasyVersion: 1.680.0 sources: OpenRouter API: sourceNamespace: open-router-chat-completions-api - sourceRevisionDigest: sha256:0aa4be5f9c66d0754b4bf06ded3fc5bcd70847e344936d5fbd381f330da68a9b - sourceBlobDigest: sha256:7947538e5ccee796a2a352fa3abd6dc2b062d18cd8271149028ae1324d132f20 + sourceRevisionDigest: sha256:c95054b92861c0bd346c03ddc4914af8028a8338290829436cd33505e9f1e1de + sourceBlobDigest: sha256:988543349a0b76cd9d601eb6a4b65c038d4a2e2a69703c798696a232267f4baa tags: - latest - - fix-update-openapi-schema - 1.0.0 targets: openrouter: source: OpenRouter API sourceNamespace: open-router-chat-completions-api - sourceRevisionDigest: sha256:0aa4be5f9c66d0754b4bf06ded3fc5bcd70847e344936d5fbd381f330da68a9b - sourceBlobDigest: sha256:7947538e5ccee796a2a352fa3abd6dc2b062d18cd8271149028ae1324d132f20 + sourceRevisionDigest: sha256:c95054b92861c0bd346c03ddc4914af8028a8338290829436cd33505e9f1e1de + sourceBlobDigest: sha256:988543349a0b76cd9d601eb6a4b65c038d4a2e2a69703c798696a232267f4baa workflow: workflowVersion: 1.0.0 speakeasyVersion: 1.680.0 diff --git a/docs/models/assistantmessage.md b/docs/models/assistantmessage.md index 93ce87bd..2dd55da1 100644 --- a/docs/models/assistantmessage.md +++ b/docs/models/assistantmessage.md @@ -19,4 +19,6 @@ let value: AssistantMessage = { | `name` | *string* | :heavy_minus_sign: | N/A | | `toolCalls` | [models.ChatMessageToolCall](../models/chatmessagetoolcall.md)[] | :heavy_minus_sign: | N/A | | `refusal` | *string* | :heavy_minus_sign: | N/A | -| `reasoning` | *string* | :heavy_minus_sign: | N/A | \ No newline at end of file +| `reasoning` | *string* | :heavy_minus_sign: | N/A | +| `reasoningDetails` | *models.Schema2*[] | :heavy_minus_sign: | N/A | +| `images` | [models.Image](../models/image.md)[] | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/operations/getparameterssecurity.md b/docs/models/assistantmessageimageurl.md similarity index 50% rename from docs/models/operations/getparameterssecurity.md rename to docs/models/assistantmessageimageurl.md index 8070db23..9d590578 100644 --- a/docs/models/operations/getparameterssecurity.md +++ b/docs/models/assistantmessageimageurl.md @@ -1,12 +1,12 @@ -# GetParametersSecurity +# AssistantMessageImageUrl ## Example Usage ```typescript -import { GetParametersSecurity } from "@openrouter/sdk/models/operations"; +import { AssistantMessageImageUrl } from "@openrouter/sdk/models"; -let value: GetParametersSecurity = { - bearer: "", +let value: AssistantMessageImageUrl = { + url: "https://winding-fraudster.net", }; ``` @@ -14,4 +14,4 @@ let value: GetParametersSecurity = { | Field | Type | Required | Description | | ------------------ | ------------------ | ------------------ | ------------------ | -| `bearer` | *string* | :heavy_check_mark: | N/A | \ No newline at end of file +| `url` | *string* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/chatmessagecontentitemimage.md b/docs/models/chatmessagecontentitemimage.md index 335bfe65..662a771c 100644 --- a/docs/models/chatmessagecontentitemimage.md +++ b/docs/models/chatmessagecontentitemimage.md @@ -15,7 +15,7 @@ let value: ChatMessageContentItemImage = { ## Fields -| Field | Type | Required | Description | -| ---------------------------------------- | ---------------------------------------- | ---------------------------------------- | ---------------------------------------- | -| `type` | *"image_url"* | :heavy_check_mark: | N/A | -| `imageUrl` | [models.ImageUrl](../models/imageurl.md) | :heavy_check_mark: | N/A | \ No newline at end of file +| Field | Type | Required | Description | +| ---------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------- | +| `type` | *"image_url"* | :heavy_check_mark: | N/A | +| `imageUrl` | [models.ChatMessageContentItemImageImageUrl](../models/chatmessagecontentitemimageimageurl.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/imageurl.md b/docs/models/chatmessagecontentitemimageimageurl.md similarity index 88% rename from docs/models/imageurl.md rename to docs/models/chatmessagecontentitemimageimageurl.md index ccc845e8..a3891c14 100644 --- a/docs/models/imageurl.md +++ b/docs/models/chatmessagecontentitemimageimageurl.md @@ -1,12 +1,12 @@ -# ImageUrl +# ChatMessageContentItemImageImageUrl ## Example Usage ```typescript -import { ImageUrl } from "@openrouter/sdk/models"; +import { ChatMessageContentItemImageImageUrl } from "@openrouter/sdk/models"; -let value: ImageUrl = { - url: "https://sinful-meal.biz", +let value: ChatMessageContentItemImageImageUrl = { + url: "https://agile-battle.info/", }; ``` diff --git a/docs/models/chatresponsechoice.md b/docs/models/chatresponsechoice.md index 40a6a234..58451f44 100644 --- a/docs/models/chatresponsechoice.md +++ b/docs/models/chatresponsechoice.md @@ -21,5 +21,4 @@ let value: ChatResponseChoice = { | `finishReason` | [models.ChatCompletionFinishReason](../models/chatcompletionfinishreason.md) | :heavy_check_mark: | N/A | | `index` | *number* | :heavy_check_mark: | N/A | | `message` | [models.AssistantMessage](../models/assistantmessage.md) | :heavy_check_mark: | N/A | -| `reasoningDetails` | *models.Schema3*[] | :heavy_minus_sign: | N/A | | `logprobs` | [models.ChatMessageTokenLogprobs](../models/chatmessagetokenlogprobs.md) | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/chatstreamingmessagechunk.md b/docs/models/chatstreamingmessagechunk.md index 58e7d665..0c2e453b 100644 --- a/docs/models/chatstreamingmessagechunk.md +++ b/docs/models/chatstreamingmessagechunk.md @@ -17,4 +17,4 @@ let value: ChatStreamingMessageChunk = {}; | `reasoning` | *string* | :heavy_minus_sign: | N/A | | `refusal` | *string* | :heavy_minus_sign: | N/A | | `toolCalls` | [models.ChatStreamingMessageToolCall](../models/chatstreamingmessagetoolcall.md)[] | :heavy_minus_sign: | N/A | -| `reasoningDetails` | *models.Schema3*[] | :heavy_minus_sign: | N/A | \ No newline at end of file +| `reasoningDetails` | *models.Schema2*[] | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/image.md b/docs/models/image.md new file mode 100644 index 00000000..54823863 --- /dev/null +++ b/docs/models/image.md @@ -0,0 +1,19 @@ +# Image + +## Example Usage + +```typescript +import { Image } from "@openrouter/sdk/models"; + +let value: Image = { + imageUrl: { + url: "https://inexperienced-derby.org/", + }, +}; +``` + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------ | ------------------------------------------------------------------------ | ------------------------------------------------------------------------ | ------------------------------------------------------------------------ | +| `imageUrl` | [models.AssistantMessageImageUrl](../models/assistantmessageimageurl.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/model.md b/docs/models/model.md index 0af49977..cac0629a 100644 --- a/docs/models/model.md +++ b/docs/models/model.md @@ -55,4 +55,5 @@ let value: Model = { | `topProvider` | [models.TopProviderInfo](../models/topproviderinfo.md) | :heavy_check_mark: | Information about the top provider for this model | {
"context_length": 8192,
"max_completion_tokens": 4096,
"is_moderated": true
} | | `perRequestLimits` | [models.PerRequestLimits](../models/perrequestlimits.md) | :heavy_check_mark: | Per-request token limits | {
"prompt_tokens": 1000,
"completion_tokens": 1000
} | | `supportedParameters` | [models.Parameter](../models/parameter.md)[] | :heavy_check_mark: | List of supported parameters for this model | | -| `defaultParameters` | [models.DefaultParameters](../models/defaultparameters.md) | :heavy_check_mark: | Default parameters for this model | {
"temperature": 0.7,
"top_p": 0.9,
"frequency_penalty": 0
} | \ No newline at end of file +| `defaultParameters` | [models.DefaultParameters](../models/defaultparameters.md) | :heavy_check_mark: | Default parameters for this model | {
"temperature": 0.7,
"top_p": 0.9,
"frequency_penalty": 0
} | +| `expirationDate` | *string* | :heavy_minus_sign: | The date after which the model may be removed. ISO 8601 date string (YYYY-MM-DD) or null if no expiration. | 2025-06-01 | \ No newline at end of file diff --git a/docs/models/operations/bulkassignkeystoguardrailrequest.md b/docs/models/operations/bulkassignkeystoguardrailrequest.md new file mode 100644 index 00000000..9e08721f --- /dev/null +++ b/docs/models/operations/bulkassignkeystoguardrailrequest.md @@ -0,0 +1,23 @@ +# BulkAssignKeysToGuardrailRequest + +## Example Usage + +```typescript +import { BulkAssignKeysToGuardrailRequest } from "@openrouter/sdk/models/operations"; + +let value: BulkAssignKeysToGuardrailRequest = { + id: "550e8400-e29b-41d4-a716-446655440000", + requestBody: { + keyHashes: [ + "c56454edb818d6b14bc0d61c46025f1450b0f4012d12304ab40aacb519fcbc93", + ], + }, +}; +``` + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------ | +| `id` | *string* | :heavy_check_mark: | The unique identifier of the guardrail | 550e8400-e29b-41d4-a716-446655440000 | +| `requestBody` | [operations.BulkAssignKeysToGuardrailRequestBody](../../models/operations/bulkassignkeystoguardrailrequestbody.md) | :heavy_check_mark: | N/A | | \ No newline at end of file diff --git a/docs/models/operations/bulkassignkeystoguardrailrequestbody.md b/docs/models/operations/bulkassignkeystoguardrailrequestbody.md new file mode 100644 index 00000000..a7ed0dcf --- /dev/null +++ b/docs/models/operations/bulkassignkeystoguardrailrequestbody.md @@ -0,0 +1,19 @@ +# BulkAssignKeysToGuardrailRequestBody + +## Example Usage + +```typescript +import { BulkAssignKeysToGuardrailRequestBody } from "@openrouter/sdk/models/operations"; + +let value: BulkAssignKeysToGuardrailRequestBody = { + keyHashes: [ + "c56454edb818d6b14bc0d61c46025f1450b0f4012d12304ab40aacb519fcbc93", + ], +}; +``` + +## Fields + +| Field | Type | Required | Description | Example | +| ---------------------------------------------------------------------- | ---------------------------------------------------------------------- | ---------------------------------------------------------------------- | ---------------------------------------------------------------------- | ---------------------------------------------------------------------- | +| `keyHashes` | *string*[] | :heavy_check_mark: | Array of API key hashes to assign to the guardrail | [
"c56454edb818d6b14bc0d61c46025f1450b0f4012d12304ab40aacb519fcbc93"
] | \ No newline at end of file diff --git a/docs/models/operations/bulkassignkeystoguardrailresponse.md b/docs/models/operations/bulkassignkeystoguardrailresponse.md new file mode 100644 index 00000000..a9b6b30c --- /dev/null +++ b/docs/models/operations/bulkassignkeystoguardrailresponse.md @@ -0,0 +1,19 @@ +# BulkAssignKeysToGuardrailResponse + +Assignment result + +## Example Usage + +```typescript +import { BulkAssignKeysToGuardrailResponse } from "@openrouter/sdk/models/operations"; + +let value: BulkAssignKeysToGuardrailResponse = { + assignedCount: 3, +}; +``` + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------ | ------------------------------------ | ------------------------------------ | ------------------------------------ | ------------------------------------ | +| `assignedCount` | *number* | :heavy_check_mark: | Number of keys successfully assigned | 3 | \ No newline at end of file diff --git a/docs/models/operations/bulkassignmemberstoguardrailrequest.md b/docs/models/operations/bulkassignmemberstoguardrailrequest.md new file mode 100644 index 00000000..89f7f48f --- /dev/null +++ b/docs/models/operations/bulkassignmemberstoguardrailrequest.md @@ -0,0 +1,24 @@ +# BulkAssignMembersToGuardrailRequest + +## Example Usage + +```typescript +import { BulkAssignMembersToGuardrailRequest } from "@openrouter/sdk/models/operations"; + +let value: BulkAssignMembersToGuardrailRequest = { + id: "550e8400-e29b-41d4-a716-446655440000", + requestBody: { + memberUserIds: [ + "user_abc123", + "user_def456", + ], + }, +}; +``` + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------ | +| `id` | *string* | :heavy_check_mark: | The unique identifier of the guardrail | 550e8400-e29b-41d4-a716-446655440000 | +| `requestBody` | [operations.BulkAssignMembersToGuardrailRequestBody](../../models/operations/bulkassignmemberstoguardrailrequestbody.md) | :heavy_check_mark: | N/A | | \ No newline at end of file diff --git a/docs/models/operations/bulkassignmemberstoguardrailrequestbody.md b/docs/models/operations/bulkassignmemberstoguardrailrequestbody.md new file mode 100644 index 00000000..a1b88827 --- /dev/null +++ b/docs/models/operations/bulkassignmemberstoguardrailrequestbody.md @@ -0,0 +1,20 @@ +# BulkAssignMembersToGuardrailRequestBody + +## Example Usage + +```typescript +import { BulkAssignMembersToGuardrailRequestBody } from "@openrouter/sdk/models/operations"; + +let value: BulkAssignMembersToGuardrailRequestBody = { + memberUserIds: [ + "user_abc123", + "user_def456", + ], +}; +``` + +## Fields + +| Field | Type | Required | Description | Example | +| --------------------------------------------------- | --------------------------------------------------- | --------------------------------------------------- | --------------------------------------------------- | --------------------------------------------------- | +| `memberUserIds` | *string*[] | :heavy_check_mark: | Array of member user IDs to assign to the guardrail | [
"user_abc123",
"user_def456"
] | \ No newline at end of file diff --git a/docs/models/operations/bulkassignmemberstoguardrailresponse.md b/docs/models/operations/bulkassignmemberstoguardrailresponse.md new file mode 100644 index 00000000..6f83d903 --- /dev/null +++ b/docs/models/operations/bulkassignmemberstoguardrailresponse.md @@ -0,0 +1,19 @@ +# BulkAssignMembersToGuardrailResponse + +Assignment result + +## Example Usage + +```typescript +import { BulkAssignMembersToGuardrailResponse } from "@openrouter/sdk/models/operations"; + +let value: BulkAssignMembersToGuardrailResponse = { + assignedCount: 2, +}; +``` + +## Fields + +| Field | Type | Required | Description | Example | +| --------------------------------------- | --------------------------------------- | --------------------------------------- | --------------------------------------- | --------------------------------------- | +| `assignedCount` | *number* | :heavy_check_mark: | Number of members successfully assigned | 2 | \ No newline at end of file diff --git a/docs/models/operations/bulkunassignkeysfromguardrailrequest.md b/docs/models/operations/bulkunassignkeysfromguardrailrequest.md new file mode 100644 index 00000000..15752856 --- /dev/null +++ b/docs/models/operations/bulkunassignkeysfromguardrailrequest.md @@ -0,0 +1,23 @@ +# BulkUnassignKeysFromGuardrailRequest + +## Example Usage + +```typescript +import { BulkUnassignKeysFromGuardrailRequest } from "@openrouter/sdk/models/operations"; + +let value: BulkUnassignKeysFromGuardrailRequest = { + id: "550e8400-e29b-41d4-a716-446655440000", + requestBody: { + keyHashes: [ + "c56454edb818d6b14bc0d61c46025f1450b0f4012d12304ab40aacb519fcbc93", + ], + }, +}; +``` + +## Fields + +| Field | Type | Required | Description | Example | +| -------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------- | +| `id` | *string* | :heavy_check_mark: | The unique identifier of the guardrail | 550e8400-e29b-41d4-a716-446655440000 | +| `requestBody` | [operations.BulkUnassignKeysFromGuardrailRequestBody](../../models/operations/bulkunassignkeysfromguardrailrequestbody.md) | :heavy_check_mark: | N/A | | \ No newline at end of file diff --git a/docs/models/operations/bulkunassignkeysfromguardrailrequestbody.md b/docs/models/operations/bulkunassignkeysfromguardrailrequestbody.md new file mode 100644 index 00000000..5a1b1ad3 --- /dev/null +++ b/docs/models/operations/bulkunassignkeysfromguardrailrequestbody.md @@ -0,0 +1,19 @@ +# BulkUnassignKeysFromGuardrailRequestBody + +## Example Usage + +```typescript +import { BulkUnassignKeysFromGuardrailRequestBody } from "@openrouter/sdk/models/operations"; + +let value: BulkUnassignKeysFromGuardrailRequestBody = { + keyHashes: [ + "c56454edb818d6b14bc0d61c46025f1450b0f4012d12304ab40aacb519fcbc93", + ], +}; +``` + +## Fields + +| Field | Type | Required | Description | Example | +| ---------------------------------------------------------------------- | ---------------------------------------------------------------------- | ---------------------------------------------------------------------- | ---------------------------------------------------------------------- | ---------------------------------------------------------------------- | +| `keyHashes` | *string*[] | :heavy_check_mark: | Array of API key hashes to unassign from the guardrail | [
"c56454edb818d6b14bc0d61c46025f1450b0f4012d12304ab40aacb519fcbc93"
] | \ No newline at end of file diff --git a/docs/models/operations/bulkunassignkeysfromguardrailresponse.md b/docs/models/operations/bulkunassignkeysfromguardrailresponse.md new file mode 100644 index 00000000..c77c8c77 --- /dev/null +++ b/docs/models/operations/bulkunassignkeysfromguardrailresponse.md @@ -0,0 +1,19 @@ +# BulkUnassignKeysFromGuardrailResponse + +Unassignment result + +## Example Usage + +```typescript +import { BulkUnassignKeysFromGuardrailResponse } from "@openrouter/sdk/models/operations"; + +let value: BulkUnassignKeysFromGuardrailResponse = { + unassignedCount: 3, +}; +``` + +## Fields + +| Field | Type | Required | Description | Example | +| -------------------------------------- | -------------------------------------- | -------------------------------------- | -------------------------------------- | -------------------------------------- | +| `unassignedCount` | *number* | :heavy_check_mark: | Number of keys successfully unassigned | 3 | \ No newline at end of file diff --git a/docs/models/operations/bulkunassignmembersfromguardrailrequest.md b/docs/models/operations/bulkunassignmembersfromguardrailrequest.md new file mode 100644 index 00000000..dbae5775 --- /dev/null +++ b/docs/models/operations/bulkunassignmembersfromguardrailrequest.md @@ -0,0 +1,24 @@ +# BulkUnassignMembersFromGuardrailRequest + +## Example Usage + +```typescript +import { BulkUnassignMembersFromGuardrailRequest } from "@openrouter/sdk/models/operations"; + +let value: BulkUnassignMembersFromGuardrailRequest = { + id: "550e8400-e29b-41d4-a716-446655440000", + requestBody: { + memberUserIds: [ + "user_abc123", + "user_def456", + ], + }, +}; +``` + +## Fields + +| Field | Type | Required | Description | Example | +| -------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------- | +| `id` | *string* | :heavy_check_mark: | The unique identifier of the guardrail | 550e8400-e29b-41d4-a716-446655440000 | +| `requestBody` | [operations.BulkUnassignMembersFromGuardrailRequestBody](../../models/operations/bulkunassignmembersfromguardrailrequestbody.md) | :heavy_check_mark: | N/A | | \ No newline at end of file diff --git a/docs/models/operations/bulkunassignmembersfromguardrailrequestbody.md b/docs/models/operations/bulkunassignmembersfromguardrailrequestbody.md new file mode 100644 index 00000000..82ae5400 --- /dev/null +++ b/docs/models/operations/bulkunassignmembersfromguardrailrequestbody.md @@ -0,0 +1,20 @@ +# BulkUnassignMembersFromGuardrailRequestBody + +## Example Usage + +```typescript +import { BulkUnassignMembersFromGuardrailRequestBody } from "@openrouter/sdk/models/operations"; + +let value: BulkUnassignMembersFromGuardrailRequestBody = { + memberUserIds: [ + "user_abc123", + "user_def456", + ], +}; +``` + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------------------------- | ------------------------------------------------------- | ------------------------------------------------------- | ------------------------------------------------------- | ------------------------------------------------------- | +| `memberUserIds` | *string*[] | :heavy_check_mark: | Array of member user IDs to unassign from the guardrail | [
"user_abc123",
"user_def456"
] | \ No newline at end of file diff --git a/docs/models/operations/bulkunassignmembersfromguardrailresponse.md b/docs/models/operations/bulkunassignmembersfromguardrailresponse.md new file mode 100644 index 00000000..a3568670 --- /dev/null +++ b/docs/models/operations/bulkunassignmembersfromguardrailresponse.md @@ -0,0 +1,19 @@ +# BulkUnassignMembersFromGuardrailResponse + +Unassignment result + +## Example Usage + +```typescript +import { BulkUnassignMembersFromGuardrailResponse } from "@openrouter/sdk/models/operations"; + +let value: BulkUnassignMembersFromGuardrailResponse = { + unassignedCount: 2, +}; +``` + +## Fields + +| Field | Type | Required | Description | Example | +| ----------------------------------------- | ----------------------------------------- | ----------------------------------------- | ----------------------------------------- | ----------------------------------------- | +| `unassignedCount` | *number* | :heavy_check_mark: | Number of members successfully unassigned | 2 | \ No newline at end of file diff --git a/docs/models/operations/category.md b/docs/models/operations/category.md new file mode 100644 index 00000000..48e45f3d --- /dev/null +++ b/docs/models/operations/category.md @@ -0,0 +1,19 @@ +# Category + +Filter models by use case category + +## Example Usage + +```typescript +import { Category } from "@openrouter/sdk/models/operations"; + +let value: Category = "programming"; +``` + +## Values + +This is an open enum. Unrecognized values will be captured as the `Unrecognized` branded type. + +```typescript +"programming" | "roleplay" | "marketing" | "marketing/seo" | "technology" | "science" | "translation" | "legal" | "finance" | "health" | "trivia" | "academia" | Unrecognized +``` \ No newline at end of file diff --git a/docs/models/operations/createguardraildata.md b/docs/models/operations/createguardraildata.md new file mode 100644 index 00000000..ed6f0ffd --- /dev/null +++ b/docs/models/operations/createguardraildata.md @@ -0,0 +1,30 @@ +# CreateGuardrailData + +The created guardrail + +## Example Usage + +```typescript +import { CreateGuardrailData } from "@openrouter/sdk/models/operations"; + +let value: CreateGuardrailData = { + id: "550e8400-e29b-41d4-a716-446655440000", + name: "Production Guardrail", + createdAt: "2025-08-24T10:30:00Z", +}; +``` + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------ | +| `id` | *string* | :heavy_check_mark: | Unique identifier for the guardrail | 550e8400-e29b-41d4-a716-446655440000 | +| `name` | *string* | :heavy_check_mark: | Name of the guardrail | Production Guardrail | +| `description` | *string* | :heavy_minus_sign: | Description of the guardrail | Guardrail for production environment | +| `limitUsd` | *number* | :heavy_minus_sign: | Spending limit in USD | 100 | +| `resetInterval` | [operations.CreateGuardrailResetIntervalResponse](../../models/operations/createguardrailresetintervalresponse.md) | :heavy_minus_sign: | Interval at which the limit resets (daily, weekly, monthly) | monthly | +| `allowedProviders` | *string*[] | :heavy_minus_sign: | List of allowed provider IDs | [
"openai",
"anthropic",
"google"
] | +| `allowedModels` | *string*[] | :heavy_minus_sign: | Array of model canonical_slugs (immutable identifiers) | [
"openai/gpt-5.2-20251211",
"anthropic/claude-4.5-opus-20251124",
"deepseek/deepseek-r1-0528:free"
] | +| `enforceZdr` | *boolean* | :heavy_minus_sign: | Whether to enforce zero data retention | false | +| `createdAt` | *string* | :heavy_check_mark: | ISO 8601 timestamp of when the guardrail was created | 2025-08-24T10:30:00Z | +| `updatedAt` | *string* | :heavy_minus_sign: | ISO 8601 timestamp of when the guardrail was last updated | 2025-08-24T15:45:00Z | \ No newline at end of file diff --git a/docs/models/operations/createguardrailrequest.md b/docs/models/operations/createguardrailrequest.md new file mode 100644 index 00000000..c75ff0c5 --- /dev/null +++ b/docs/models/operations/createguardrailrequest.md @@ -0,0 +1,23 @@ +# CreateGuardrailRequest + +## Example Usage + +```typescript +import { CreateGuardrailRequest } from "@openrouter/sdk/models/operations"; + +let value: CreateGuardrailRequest = { + name: "My New Guardrail", +}; +``` + +## Fields + +| Field | Type | Required | Description | Example | +| ---------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------- | +| `name` | *string* | :heavy_check_mark: | Name for the new guardrail | My New Guardrail | +| `description` | *string* | :heavy_minus_sign: | Description of the guardrail | A guardrail for limiting API usage | +| `limitUsd` | *number* | :heavy_minus_sign: | Spending limit in USD | 50 | +| `resetInterval` | [operations.CreateGuardrailResetIntervalRequest](../../models/operations/createguardrailresetintervalrequest.md) | :heavy_minus_sign: | Interval at which the limit resets (daily, weekly, monthly) | monthly | +| `allowedProviders` | *string*[] | :heavy_minus_sign: | List of allowed provider IDs | [
"openai",
"anthropic",
"deepseek"
] | +| `allowedModels` | *string*[] | :heavy_minus_sign: | Array of model identifiers (slug or canonical_slug accepted) | [
"openai/gpt-5.2",
"anthropic/claude-4.5-opus-20251124",
"deepseek/deepseek-r1-0528:free"
] | +| `enforceZdr` | *boolean* | :heavy_minus_sign: | Whether to enforce zero data retention | false | \ No newline at end of file diff --git a/docs/models/operations/createguardrailresetintervalrequest.md b/docs/models/operations/createguardrailresetintervalrequest.md new file mode 100644 index 00000000..c0531b19 --- /dev/null +++ b/docs/models/operations/createguardrailresetintervalrequest.md @@ -0,0 +1,19 @@ +# CreateGuardrailResetIntervalRequest + +Interval at which the limit resets (daily, weekly, monthly) + +## Example Usage + +```typescript +import { CreateGuardrailResetIntervalRequest } from "@openrouter/sdk/models/operations"; + +let value: CreateGuardrailResetIntervalRequest = "monthly"; +``` + +## Values + +This is an open enum. Unrecognized values will be captured as the `Unrecognized` branded type. + +```typescript +"daily" | "weekly" | "monthly" | Unrecognized +``` \ No newline at end of file diff --git a/docs/models/operations/createguardrailresetintervalresponse.md b/docs/models/operations/createguardrailresetintervalresponse.md new file mode 100644 index 00000000..303f5c09 --- /dev/null +++ b/docs/models/operations/createguardrailresetintervalresponse.md @@ -0,0 +1,19 @@ +# CreateGuardrailResetIntervalResponse + +Interval at which the limit resets (daily, weekly, monthly) + +## Example Usage + +```typescript +import { CreateGuardrailResetIntervalResponse } from "@openrouter/sdk/models/operations"; + +let value: CreateGuardrailResetIntervalResponse = "monthly"; +``` + +## Values + +This is an open enum. Unrecognized values will be captured as the `Unrecognized` branded type. + +```typescript +"daily" | "weekly" | "monthly" | Unrecognized +``` \ No newline at end of file diff --git a/docs/models/operations/createguardrailresponse.md b/docs/models/operations/createguardrailresponse.md new file mode 100644 index 00000000..72be6950 --- /dev/null +++ b/docs/models/operations/createguardrailresponse.md @@ -0,0 +1,23 @@ +# CreateGuardrailResponse + +Guardrail created successfully + +## Example Usage + +```typescript +import { CreateGuardrailResponse } from "@openrouter/sdk/models/operations"; + +let value: CreateGuardrailResponse = { + data: { + id: "550e8400-e29b-41d4-a716-446655440000", + name: "My New Guardrail", + createdAt: "2025-08-24T10:30:00Z", + }, +}; +``` + +## Fields + +| Field | Type | Required | Description | Example | +| -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `data` | [operations.CreateGuardrailData](../../models/operations/createguardraildata.md) | :heavy_check_mark: | The created guardrail | {
"id": "550e8400-e29b-41d4-a716-446655440000",
"name": "Production Guardrail",
"description": "Guardrail for production environment",
"limit_usd": 100,
"reset_interval": "monthly",
"allowed_providers": [
"openai",
"anthropic",
"google"
],
"allowed_models": null,
"enforce_zdr": false,
"created_at": "2025-08-24T10:30:00Z",
"updated_at": "2025-08-24T15:45:00Z"
} | \ No newline at end of file diff --git a/docs/models/operations/createkeysdata.md b/docs/models/operations/createkeysdata.md index eaace6a5..b8f7e0de 100644 --- a/docs/models/operations/createkeysdata.md +++ b/docs/models/operations/createkeysdata.md @@ -8,10 +8,9 @@ The created API key information import { CreateKeysData } from "@openrouter/sdk/models/operations"; let value: CreateKeysData = { - hash: - "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", + hash: "f01d52606dc8f0a8303a7b5cc3fa07109c2e346cec7c0a16b40de462992ce943", name: "My Production Key", - label: "Production API Key", + label: "sk-or-v1-0e6...1c96", disabled: false, limit: 100, limitRemaining: 74.5, @@ -34,9 +33,9 @@ let value: CreateKeysData = { | Field | Type | Required | Description | Example | | --------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------- | -| `hash` | *string* | :heavy_check_mark: | Unique hash identifier for the API key | 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 | +| `hash` | *string* | :heavy_check_mark: | Unique hash identifier for the API key | f01d52606dc8f0a8303a7b5cc3fa07109c2e346cec7c0a16b40de462992ce943 | | `name` | *string* | :heavy_check_mark: | Name of the API key | My Production Key | -| `label` | *string* | :heavy_check_mark: | Human-readable label for the API key | Production API Key | +| `label` | *string* | :heavy_check_mark: | Human-readable label for the API key | sk-or-v1-0e6...1c96 | | `disabled` | *boolean* | :heavy_check_mark: | Whether the API key is disabled | false | | `limit` | *number* | :heavy_check_mark: | Spending limit for the API key in USD | 100 | | `limitRemaining` | *number* | :heavy_check_mark: | Remaining spending limit in USD | 74.5 | diff --git a/docs/models/operations/createkeysresponse.md b/docs/models/operations/createkeysresponse.md index af927c64..b71100d6 100644 --- a/docs/models/operations/createkeysresponse.md +++ b/docs/models/operations/createkeysresponse.md @@ -9,8 +9,7 @@ import { CreateKeysResponse } from "@openrouter/sdk/models/operations"; let value: CreateKeysResponse = { data: { - hash: - "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", + hash: "f01d52606dc8f0a8303a7b5cc3fa07109c2e346cec7c0a16b40de462992ce943", name: "My New API Key", label: "My New API Key", disabled: false, @@ -36,7 +35,7 @@ let value: CreateKeysResponse = { ## Fields -| Field | Type | Required | Description | Example | -| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `data` | [operations.CreateKeysData](../../models/operations/createkeysdata.md) | :heavy_check_mark: | The created API key information | {
"hash": "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",
"name": "My Production Key",
"label": "Production API Key",
"disabled": false,
"limit": 100,
"limit_remaining": 74.5,
"limit_reset": "monthly",
"include_byok_in_limit": false,
"usage": 25.5,
"usage_daily": 25.5,
"usage_weekly": 25.5,
"usage_monthly": 25.5,
"byok_usage": 17.38,
"byok_usage_daily": 17.38,
"byok_usage_weekly": 17.38,
"byok_usage_monthly": 17.38,
"created_at": "2025-08-24T10:30:00Z",
"updated_at": "2025-08-24T15:45:00Z",
"expires_at": "2027-12-31T23:59:59Z"
} | -| `key` | *string* | :heavy_check_mark: | The actual API key string (only shown once) | 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 | \ No newline at end of file +| Field | Type | Required | Description | Example | +| --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `data` | [operations.CreateKeysData](../../models/operations/createkeysdata.md) | :heavy_check_mark: | The created API key information | {
"hash": "f01d52606dc8f0a8303a7b5cc3fa07109c2e346cec7c0a16b40de462992ce943",
"name": "My Production Key",
"label": "sk-or-v1-0e6...1c96",
"disabled": false,
"limit": 100,
"limit_remaining": 74.5,
"limit_reset": "monthly",
"include_byok_in_limit": false,
"usage": 25.5,
"usage_daily": 25.5,
"usage_weekly": 25.5,
"usage_monthly": 25.5,
"byok_usage": 17.38,
"byok_usage_daily": 17.38,
"byok_usage_weekly": 17.38,
"byok_usage_monthly": 17.38,
"created_at": "2025-08-24T10:30:00Z",
"updated_at": "2025-08-24T15:45:00Z",
"expires_at": "2027-12-31T23:59:59Z"
} | +| `key` | *string* | :heavy_check_mark: | The actual API key string (only shown once) | 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 | \ No newline at end of file diff --git a/docs/models/operations/deleteguardrailrequest.md b/docs/models/operations/deleteguardrailrequest.md new file mode 100644 index 00000000..76f8f60c --- /dev/null +++ b/docs/models/operations/deleteguardrailrequest.md @@ -0,0 +1,17 @@ +# DeleteGuardrailRequest + +## Example Usage + +```typescript +import { DeleteGuardrailRequest } from "@openrouter/sdk/models/operations"; + +let value: DeleteGuardrailRequest = { + id: "550e8400-e29b-41d4-a716-446655440000", +}; +``` + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------------------ | ------------------------------------------------ | ------------------------------------------------ | ------------------------------------------------ | ------------------------------------------------ | +| `id` | *string* | :heavy_check_mark: | The unique identifier of the guardrail to delete | 550e8400-e29b-41d4-a716-446655440000 | \ No newline at end of file diff --git a/docs/models/operations/deleteguardrailresponse.md b/docs/models/operations/deleteguardrailresponse.md new file mode 100644 index 00000000..ef931107 --- /dev/null +++ b/docs/models/operations/deleteguardrailresponse.md @@ -0,0 +1,19 @@ +# DeleteGuardrailResponse + +Guardrail deleted successfully + +## Example Usage + +```typescript +import { DeleteGuardrailResponse } from "@openrouter/sdk/models/operations"; + +let value: DeleteGuardrailResponse = { + deleted: true, +}; +``` + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------------- | ------------------------------------------- | ------------------------------------------- | ------------------------------------------- | ------------------------------------------- | +| `deleted` | *true* | :heavy_check_mark: | Confirmation that the guardrail was deleted | true | \ No newline at end of file diff --git a/docs/models/operations/deletekeysrequest.md b/docs/models/operations/deletekeysrequest.md index dee02cfd..31df3c3a 100644 --- a/docs/models/operations/deletekeysrequest.md +++ b/docs/models/operations/deletekeysrequest.md @@ -6,13 +6,12 @@ import { DeleteKeysRequest } from "@openrouter/sdk/models/operations"; let value: DeleteKeysRequest = { - hash: - "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", + hash: "f01d52606dc8f0a8303a7b5cc3fa07109c2e346cec7c0a16b40de462992ce943", }; ``` ## Fields -| Field | Type | Required | Description | Example | -| ------------------------------------------------------------------------- | ------------------------------------------------------------------------- | ------------------------------------------------------------------------- | ------------------------------------------------------------------------- | ------------------------------------------------------------------------- | -| `hash` | *string* | :heavy_check_mark: | The hash identifier of the API key to delete | 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 | \ No newline at end of file +| Field | Type | Required | Description | Example | +| ---------------------------------------------------------------- | ---------------------------------------------------------------- | ---------------------------------------------------------------- | ---------------------------------------------------------------- | ---------------------------------------------------------------- | +| `hash` | *string* | :heavy_check_mark: | The hash identifier of the API key to delete | f01d52606dc8f0a8303a7b5cc3fa07109c2e346cec7c0a16b40de462992ce943 | \ No newline at end of file diff --git a/docs/models/operations/getcurrentkeydata.md b/docs/models/operations/getcurrentkeydata.md index 1cf74639..e5022bcc 100644 --- a/docs/models/operations/getcurrentkeydata.md +++ b/docs/models/operations/getcurrentkeydata.md @@ -8,7 +8,7 @@ Current API key information import { GetCurrentKeyData } from "@openrouter/sdk/models/operations"; let value: GetCurrentKeyData = { - label: "sk-or-v1-au78b3456789012345678901234567890", + label: "sk-or-v1-au7...890", limit: 100, usage: 25.5, usageDaily: 25.5, @@ -35,7 +35,7 @@ let value: GetCurrentKeyData = { | Field | Type | Required | Description | Example | | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -| `label` | *string* | :heavy_check_mark: | Human-readable label for the API key | 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 | +| `label` | *string* | :heavy_check_mark: | Human-readable label for the API key | sk-or-v1-0e6...1c96 | | `limit` | *number* | :heavy_check_mark: | Spending limit for the API key in USD | 100 | | `usage` | *number* | :heavy_check_mark: | Total OpenRouter credit usage (in USD) for the API key | 25.5 | | `usageDaily` | *number* | :heavy_check_mark: | OpenRouter credit usage (in USD) for the current UTC day | 25.5 | diff --git a/docs/models/operations/getcurrentkeyresponse.md b/docs/models/operations/getcurrentkeyresponse.md index e6872cd1..26598ac5 100644 --- a/docs/models/operations/getcurrentkeyresponse.md +++ b/docs/models/operations/getcurrentkeyresponse.md @@ -9,7 +9,7 @@ import { GetCurrentKeyResponse } from "@openrouter/sdk/models/operations"; let value: GetCurrentKeyResponse = { data: { - label: "sk-or-v1-au78b3456789012345678901234567890", + label: "sk-or-v1-au7...890", limit: 100, usage: 25.5, usageDaily: 25.5, @@ -35,6 +35,6 @@ let value: GetCurrentKeyResponse = { ## Fields -| Field | Type | Required | Description | Example | -| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `data` | [operations.GetCurrentKeyData](../../models/operations/getcurrentkeydata.md) | :heavy_check_mark: | Current API key information | {
"label": "sk-or-v1-au78b3456789012345678901234567890",
"limit": 100,
"usage": 25.5,
"usage_daily": 25.5,
"usage_weekly": 25.5,
"usage_monthly": 25.5,
"byok_usage": 17.38,
"byok_usage_daily": 17.38,
"byok_usage_weekly": 17.38,
"byok_usage_monthly": 17.38,
"is_free_tier": false,
"is_provisioning_key": false,
"limit_remaining": 74.5,
"limit_reset": "monthly",
"include_byok_in_limit": false,
"expires_at": "2027-12-31T23:59:59Z",
"rate_limit": {
"requests": 1000,
"interval": "1h",
"note": "This field is deprecated and safe to ignore."
}
} | \ No newline at end of file +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `data` | [operations.GetCurrentKeyData](../../models/operations/getcurrentkeydata.md) | :heavy_check_mark: | Current API key information | {
"label": "sk-or-v1-au7...890",
"limit": 100,
"usage": 25.5,
"usage_daily": 25.5,
"usage_weekly": 25.5,
"usage_monthly": 25.5,
"byok_usage": 17.38,
"byok_usage_daily": 17.38,
"byok_usage_weekly": 17.38,
"byok_usage_monthly": 17.38,
"is_free_tier": false,
"is_provisioning_key": false,
"limit_remaining": 74.5,
"limit_reset": "monthly",
"include_byok_in_limit": false,
"expires_at": "2027-12-31T23:59:59Z",
"rate_limit": {
"requests": 1000,
"interval": "1h",
"note": "This field is deprecated and safe to ignore."
}
} | \ No newline at end of file diff --git a/docs/models/operations/getguardraildata.md b/docs/models/operations/getguardraildata.md new file mode 100644 index 00000000..712c360c --- /dev/null +++ b/docs/models/operations/getguardraildata.md @@ -0,0 +1,30 @@ +# GetGuardrailData + +The guardrail + +## Example Usage + +```typescript +import { GetGuardrailData } from "@openrouter/sdk/models/operations"; + +let value: GetGuardrailData = { + id: "550e8400-e29b-41d4-a716-446655440000", + name: "Production Guardrail", + createdAt: "2025-08-24T10:30:00Z", +}; +``` + +## Fields + +| Field | Type | Required | Description | Example | +| ----------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------- | +| `id` | *string* | :heavy_check_mark: | Unique identifier for the guardrail | 550e8400-e29b-41d4-a716-446655440000 | +| `name` | *string* | :heavy_check_mark: | Name of the guardrail | Production Guardrail | +| `description` | *string* | :heavy_minus_sign: | Description of the guardrail | Guardrail for production environment | +| `limitUsd` | *number* | :heavy_minus_sign: | Spending limit in USD | 100 | +| `resetInterval` | [operations.GetGuardrailResetInterval](../../models/operations/getguardrailresetinterval.md) | :heavy_minus_sign: | Interval at which the limit resets (daily, weekly, monthly) | monthly | +| `allowedProviders` | *string*[] | :heavy_minus_sign: | List of allowed provider IDs | [
"openai",
"anthropic",
"google"
] | +| `allowedModels` | *string*[] | :heavy_minus_sign: | Array of model canonical_slugs (immutable identifiers) | [
"openai/gpt-5.2-20251211",
"anthropic/claude-4.5-opus-20251124",
"deepseek/deepseek-r1-0528:free"
] | +| `enforceZdr` | *boolean* | :heavy_minus_sign: | Whether to enforce zero data retention | false | +| `createdAt` | *string* | :heavy_check_mark: | ISO 8601 timestamp of when the guardrail was created | 2025-08-24T10:30:00Z | +| `updatedAt` | *string* | :heavy_minus_sign: | ISO 8601 timestamp of when the guardrail was last updated | 2025-08-24T15:45:00Z | \ No newline at end of file diff --git a/docs/models/operations/getguardrailrequest.md b/docs/models/operations/getguardrailrequest.md new file mode 100644 index 00000000..f2eebd5f --- /dev/null +++ b/docs/models/operations/getguardrailrequest.md @@ -0,0 +1,17 @@ +# GetGuardrailRequest + +## Example Usage + +```typescript +import { GetGuardrailRequest } from "@openrouter/sdk/models/operations"; + +let value: GetGuardrailRequest = { + id: "550e8400-e29b-41d4-a716-446655440000", +}; +``` + +## Fields + +| Field | Type | Required | Description | Example | +| -------------------------------------------------- | -------------------------------------------------- | -------------------------------------------------- | -------------------------------------------------- | -------------------------------------------------- | +| `id` | *string* | :heavy_check_mark: | The unique identifier of the guardrail to retrieve | 550e8400-e29b-41d4-a716-446655440000 | \ No newline at end of file diff --git a/docs/models/operations/getguardrailresetinterval.md b/docs/models/operations/getguardrailresetinterval.md new file mode 100644 index 00000000..1ab597dc --- /dev/null +++ b/docs/models/operations/getguardrailresetinterval.md @@ -0,0 +1,19 @@ +# GetGuardrailResetInterval + +Interval at which the limit resets (daily, weekly, monthly) + +## Example Usage + +```typescript +import { GetGuardrailResetInterval } from "@openrouter/sdk/models/operations"; + +let value: GetGuardrailResetInterval = "monthly"; +``` + +## Values + +This is an open enum. Unrecognized values will be captured as the `Unrecognized` branded type. + +```typescript +"daily" | "weekly" | "monthly" | Unrecognized +``` \ No newline at end of file diff --git a/docs/models/operations/getguardrailresponse.md b/docs/models/operations/getguardrailresponse.md new file mode 100644 index 00000000..8951e641 --- /dev/null +++ b/docs/models/operations/getguardrailresponse.md @@ -0,0 +1,23 @@ +# GetGuardrailResponse + +Guardrail details + +## Example Usage + +```typescript +import { GetGuardrailResponse } from "@openrouter/sdk/models/operations"; + +let value: GetGuardrailResponse = { + data: { + id: "550e8400-e29b-41d4-a716-446655440000", + name: "Production Guardrail", + createdAt: "2025-08-24T10:30:00Z", + }, +}; +``` + +## Fields + +| Field | Type | Required | Description | Example | +| -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `data` | [operations.GetGuardrailData](../../models/operations/getguardraildata.md) | :heavy_check_mark: | The guardrail | {
"id": "550e8400-e29b-41d4-a716-446655440000",
"name": "Production Guardrail",
"description": "Guardrail for production environment",
"limit_usd": 100,
"reset_interval": "monthly",
"allowed_providers": [
"openai",
"anthropic",
"google"
],
"allowed_models": null,
"enforce_zdr": false,
"created_at": "2025-08-24T10:30:00Z",
"updated_at": "2025-08-24T15:45:00Z"
} | \ No newline at end of file diff --git a/docs/models/operations/getkeydata.md b/docs/models/operations/getkeydata.md index 438836b0..268e6252 100644 --- a/docs/models/operations/getkeydata.md +++ b/docs/models/operations/getkeydata.md @@ -8,10 +8,9 @@ The API key information import { GetKeyData } from "@openrouter/sdk/models/operations"; let value: GetKeyData = { - hash: - "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", + hash: "f01d52606dc8f0a8303a7b5cc3fa07109c2e346cec7c0a16b40de462992ce943", name: "My Production Key", - label: "Production API Key", + label: "sk-or-v1-0e6...1c96", disabled: false, limit: 100, limitRemaining: 74.5, @@ -34,9 +33,9 @@ let value: GetKeyData = { | Field | Type | Required | Description | Example | | --------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------- | -| `hash` | *string* | :heavy_check_mark: | Unique hash identifier for the API key | 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 | +| `hash` | *string* | :heavy_check_mark: | Unique hash identifier for the API key | f01d52606dc8f0a8303a7b5cc3fa07109c2e346cec7c0a16b40de462992ce943 | | `name` | *string* | :heavy_check_mark: | Name of the API key | My Production Key | -| `label` | *string* | :heavy_check_mark: | Human-readable label for the API key | Production API Key | +| `label` | *string* | :heavy_check_mark: | Human-readable label for the API key | sk-or-v1-0e6...1c96 | | `disabled` | *boolean* | :heavy_check_mark: | Whether the API key is disabled | false | | `limit` | *number* | :heavy_check_mark: | Spending limit for the API key in USD | 100 | | `limitRemaining` | *number* | :heavy_check_mark: | Remaining spending limit in USD | 74.5 | diff --git a/docs/models/operations/getkeyrequest.md b/docs/models/operations/getkeyrequest.md index ceb8170a..9c8ac60d 100644 --- a/docs/models/operations/getkeyrequest.md +++ b/docs/models/operations/getkeyrequest.md @@ -6,13 +6,12 @@ import { GetKeyRequest } from "@openrouter/sdk/models/operations"; let value: GetKeyRequest = { - hash: - "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", + hash: "f01d52606dc8f0a8303a7b5cc3fa07109c2e346cec7c0a16b40de462992ce943", }; ``` ## Fields -| Field | Type | Required | Description | Example | -| ------------------------------------------------------------------------- | ------------------------------------------------------------------------- | ------------------------------------------------------------------------- | ------------------------------------------------------------------------- | ------------------------------------------------------------------------- | -| `hash` | *string* | :heavy_check_mark: | The hash identifier of the API key to retrieve | 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 | \ No newline at end of file +| Field | Type | Required | Description | Example | +| ---------------------------------------------------------------- | ---------------------------------------------------------------- | ---------------------------------------------------------------- | ---------------------------------------------------------------- | ---------------------------------------------------------------- | +| `hash` | *string* | :heavy_check_mark: | The hash identifier of the API key to retrieve | f01d52606dc8f0a8303a7b5cc3fa07109c2e346cec7c0a16b40de462992ce943 | \ No newline at end of file diff --git a/docs/models/operations/getkeyresponse.md b/docs/models/operations/getkeyresponse.md index b61a3fc5..c88cf750 100644 --- a/docs/models/operations/getkeyresponse.md +++ b/docs/models/operations/getkeyresponse.md @@ -9,8 +9,7 @@ import { GetKeyResponse } from "@openrouter/sdk/models/operations"; let value: GetKeyResponse = { data: { - hash: - "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", + hash: "f01d52606dc8f0a8303a7b5cc3fa07109c2e346cec7c0a16b40de462992ce943", name: "My Production Key", label: "Production API Key", disabled: false, @@ -34,6 +33,6 @@ let value: GetKeyResponse = { ## Fields -| Field | Type | Required | Description | Example | -| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `data` | [operations.GetKeyData](../../models/operations/getkeydata.md) | :heavy_check_mark: | The API key information | {
"hash": "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",
"name": "My Production Key",
"label": "Production API Key",
"disabled": false,
"limit": 100,
"limit_remaining": 74.5,
"limit_reset": "monthly",
"include_byok_in_limit": false,
"usage": 25.5,
"usage_daily": 25.5,
"usage_weekly": 25.5,
"usage_monthly": 25.5,
"byok_usage": 17.38,
"byok_usage_daily": 17.38,
"byok_usage_weekly": 17.38,
"byok_usage_monthly": 17.38,
"created_at": "2025-08-24T10:30:00Z",
"updated_at": "2025-08-24T15:45:00Z",
"expires_at": "2027-12-31T23:59:59Z"
} | \ No newline at end of file +| Field | Type | Required | Description | Example | +| --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `data` | [operations.GetKeyData](../../models/operations/getkeydata.md) | :heavy_check_mark: | The API key information | {
"hash": "f01d52606dc8f0a8303a7b5cc3fa07109c2e346cec7c0a16b40de462992ce943",
"name": "My Production Key",
"label": "sk-or-v1-0e6...1c96",
"disabled": false,
"limit": 100,
"limit_remaining": 74.5,
"limit_reset": "monthly",
"include_byok_in_limit": false,
"usage": 25.5,
"usage_daily": 25.5,
"usage_weekly": 25.5,
"usage_monthly": 25.5,
"byok_usage": 17.38,
"byok_usage_daily": 17.38,
"byok_usage_weekly": 17.38,
"byok_usage_monthly": 17.38,
"created_at": "2025-08-24T10:30:00Z",
"updated_at": "2025-08-24T15:45:00Z",
"expires_at": "2027-12-31T23:59:59Z"
} | \ No newline at end of file diff --git a/docs/models/operations/getmodelsrequest.md b/docs/models/operations/getmodelsrequest.md index 15ad477f..4c0ac2a3 100644 --- a/docs/models/operations/getmodelsrequest.md +++ b/docs/models/operations/getmodelsrequest.md @@ -10,7 +10,7 @@ let value: GetModelsRequest = {}; ## Fields -| Field | Type | Required | Description | -| --------------------- | --------------------- | --------------------- | --------------------- | -| `category` | *string* | :heavy_minus_sign: | N/A | -| `supportedParameters` | *string* | :heavy_minus_sign: | N/A | \ No newline at end of file +| Field | Type | Required | Description | Example | +| ---------------------------------------------------------- | ---------------------------------------------------------- | ---------------------------------------------------------- | ---------------------------------------------------------- | ---------------------------------------------------------- | +| `category` | [operations.Category](../../models/operations/category.md) | :heavy_minus_sign: | Filter models by use case category | programming | +| `supportedParameters` | *string* | :heavy_minus_sign: | N/A | | \ No newline at end of file diff --git a/docs/models/operations/getparametersrequest.md b/docs/models/operations/getparametersrequest.md deleted file mode 100644 index 15f72802..00000000 --- a/docs/models/operations/getparametersrequest.md +++ /dev/null @@ -1,20 +0,0 @@ -# GetParametersRequest - -## Example Usage - -```typescript -import { GetParametersRequest } from "@openrouter/sdk/models/operations"; - -let value: GetParametersRequest = { - author: "", - slug: "", -}; -``` - -## Fields - -| Field | Type | Required | Description | Example | -| --------------------------------------------------- | --------------------------------------------------- | --------------------------------------------------- | --------------------------------------------------- | --------------------------------------------------- | -| `author` | *string* | :heavy_check_mark: | N/A | | -| `slug` | *string* | :heavy_check_mark: | N/A | | -| `provider` | [models.ProviderName](../../models/providername.md) | :heavy_minus_sign: | N/A | OpenAI | \ No newline at end of file diff --git a/docs/models/operations/getparametersresponse.md b/docs/models/operations/getparametersresponse.md deleted file mode 100644 index 21f93e9b..00000000 --- a/docs/models/operations/getparametersresponse.md +++ /dev/null @@ -1,26 +0,0 @@ -# GetParametersResponse - -Returns the parameters for the specified model - -## Example Usage - -```typescript -import { GetParametersResponse } from "@openrouter/sdk/models/operations"; - -let value: GetParametersResponse = { - data: { - model: "openai/gpt-4", - supportedParameters: [ - "temperature", - "top_p", - "max_tokens", - ], - }, -}; -``` - -## Fields - -| Field | Type | Required | Description | Example | -| --------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------- | -| `data` | [operations.GetParametersData](../../models/operations/getparametersdata.md) | :heavy_check_mark: | Parameter analytics data | {
"model": "openai/gpt-4",
"supported_parameters": [
"temperature",
"top_p",
"max_tokens"
]
} | \ No newline at end of file diff --git a/docs/models/operations/listdata.md b/docs/models/operations/listdata.md index 82696b40..f6a4c6fb 100644 --- a/docs/models/operations/listdata.md +++ b/docs/models/operations/listdata.md @@ -6,10 +6,9 @@ import { ListData } from "@openrouter/sdk/models/operations"; let value: ListData = { - hash: - "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", + hash: "f01d52606dc8f0a8303a7b5cc3fa07109c2e346cec7c0a16b40de462992ce943", name: "My Production Key", - label: "Production API Key", + label: "sk-or-v1-0e6...1c96", disabled: false, limit: 100, limitRemaining: 74.5, @@ -32,9 +31,9 @@ let value: ListData = { | Field | Type | Required | Description | Example | | --------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------- | -| `hash` | *string* | :heavy_check_mark: | Unique hash identifier for the API key | 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 | +| `hash` | *string* | :heavy_check_mark: | Unique hash identifier for the API key | f01d52606dc8f0a8303a7b5cc3fa07109c2e346cec7c0a16b40de462992ce943 | | `name` | *string* | :heavy_check_mark: | Name of the API key | My Production Key | -| `label` | *string* | :heavy_check_mark: | Human-readable label for the API key | Production API Key | +| `label` | *string* | :heavy_check_mark: | Human-readable label for the API key | sk-or-v1-0e6...1c96 | | `disabled` | *boolean* | :heavy_check_mark: | Whether the API key is disabled | false | | `limit` | *number* | :heavy_check_mark: | Spending limit for the API key in USD | 100 | | `limitRemaining` | *number* | :heavy_check_mark: | Remaining spending limit in USD | 74.5 | diff --git a/docs/models/operations/listguardrailkeyassignmentsdata.md b/docs/models/operations/listguardrailkeyassignmentsdata.md new file mode 100644 index 00000000..14a67512 --- /dev/null +++ b/docs/models/operations/listguardrailkeyassignmentsdata.md @@ -0,0 +1,29 @@ +# ListGuardrailKeyAssignmentsData + +## Example Usage + +```typescript +import { ListGuardrailKeyAssignmentsData } from "@openrouter/sdk/models/operations"; + +let value: ListGuardrailKeyAssignmentsData = { + id: "550e8400-e29b-41d4-a716-446655440000", + keyHash: "c56454edb818d6b14bc0d61c46025f1450b0f4012d12304ab40aacb519fcbc93", + guardrailId: "550e8400-e29b-41d4-a716-446655440001", + keyName: "Production Key", + keyLabel: "prod-key", + assignedBy: "user_abc123", + createdAt: "2025-08-24T10:30:00Z", +}; +``` + +## Fields + +| Field | Type | Required | Description | Example | +| ---------------------------------------------------------------- | ---------------------------------------------------------------- | ---------------------------------------------------------------- | ---------------------------------------------------------------- | ---------------------------------------------------------------- | +| `id` | *string* | :heavy_check_mark: | Unique identifier for the assignment | 550e8400-e29b-41d4-a716-446655440000 | +| `keyHash` | *string* | :heavy_check_mark: | Hash of the assigned API key | c56454edb818d6b14bc0d61c46025f1450b0f4012d12304ab40aacb519fcbc93 | +| `guardrailId` | *string* | :heavy_check_mark: | ID of the guardrail | 550e8400-e29b-41d4-a716-446655440001 | +| `keyName` | *string* | :heavy_check_mark: | Name of the API key | Production Key | +| `keyLabel` | *string* | :heavy_check_mark: | Label of the API key | prod-key | +| `assignedBy` | *string* | :heavy_check_mark: | User ID of who made the assignment | user_abc123 | +| `createdAt` | *string* | :heavy_check_mark: | ISO 8601 timestamp of when the assignment was created | 2025-08-24T10:30:00Z | \ No newline at end of file diff --git a/docs/models/operations/listguardrailkeyassignmentsrequest.md b/docs/models/operations/listguardrailkeyassignmentsrequest.md new file mode 100644 index 00000000..0d59a139 --- /dev/null +++ b/docs/models/operations/listguardrailkeyassignmentsrequest.md @@ -0,0 +1,19 @@ +# ListGuardrailKeyAssignmentsRequest + +## Example Usage + +```typescript +import { ListGuardrailKeyAssignmentsRequest } from "@openrouter/sdk/models/operations"; + +let value: ListGuardrailKeyAssignmentsRequest = { + id: "550e8400-e29b-41d4-a716-446655440000", +}; +``` + +## Fields + +| Field | Type | Required | Description | Example | +| --------------------------------------------- | --------------------------------------------- | --------------------------------------------- | --------------------------------------------- | --------------------------------------------- | +| `id` | *string* | :heavy_check_mark: | The unique identifier of the guardrail | 550e8400-e29b-41d4-a716-446655440000 | +| `offset` | *string* | :heavy_minus_sign: | Number of records to skip for pagination | 0 | +| `limit` | *string* | :heavy_minus_sign: | Maximum number of records to return (max 100) | 50 | \ No newline at end of file diff --git a/docs/models/operations/listguardrailkeyassignmentsresponse.md b/docs/models/operations/listguardrailkeyassignmentsresponse.md new file mode 100644 index 00000000..386a0775 --- /dev/null +++ b/docs/models/operations/listguardrailkeyassignmentsresponse.md @@ -0,0 +1,32 @@ +# ListGuardrailKeyAssignmentsResponse + +List of key assignments + +## Example Usage + +```typescript +import { ListGuardrailKeyAssignmentsResponse } from "@openrouter/sdk/models/operations"; + +let value: ListGuardrailKeyAssignmentsResponse = { + data: [ + { + id: "550e8400-e29b-41d4-a716-446655440000", + keyHash: + "c56454edb818d6b14bc0d61c46025f1450b0f4012d12304ab40aacb519fcbc93", + guardrailId: "550e8400-e29b-41d4-a716-446655440001", + keyName: "Production Key", + keyLabel: "prod-key", + assignedBy: "user_abc123", + createdAt: "2025-08-24T10:30:00Z", + }, + ], + totalCount: 25, +}; +``` + +## Fields + +| Field | Type | Required | Description | Example | +| ---------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------- | +| `data` | [operations.ListGuardrailKeyAssignmentsData](../../models/operations/listguardrailkeyassignmentsdata.md)[] | :heavy_check_mark: | List of key assignments | | +| `totalCount` | *number* | :heavy_check_mark: | Total number of key assignments for this guardrail | 25 | \ No newline at end of file diff --git a/docs/models/operations/listguardrailmemberassignmentsdata.md b/docs/models/operations/listguardrailmemberassignmentsdata.md new file mode 100644 index 00000000..bccd30f3 --- /dev/null +++ b/docs/models/operations/listguardrailmemberassignmentsdata.md @@ -0,0 +1,27 @@ +# ListGuardrailMemberAssignmentsData + +## Example Usage + +```typescript +import { ListGuardrailMemberAssignmentsData } from "@openrouter/sdk/models/operations"; + +let value: ListGuardrailMemberAssignmentsData = { + id: "550e8400-e29b-41d4-a716-446655440000", + userId: "user_abc123", + organizationId: "org_xyz789", + guardrailId: "550e8400-e29b-41d4-a716-446655440001", + assignedBy: "user_abc123", + createdAt: "2025-08-24T10:30:00Z", +}; +``` + +## Fields + +| Field | Type | Required | Description | Example | +| ----------------------------------------------------- | ----------------------------------------------------- | ----------------------------------------------------- | ----------------------------------------------------- | ----------------------------------------------------- | +| `id` | *string* | :heavy_check_mark: | Unique identifier for the assignment | 550e8400-e29b-41d4-a716-446655440000 | +| `userId` | *string* | :heavy_check_mark: | Clerk user ID of the assigned member | user_abc123 | +| `organizationId` | *string* | :heavy_check_mark: | Organization ID | org_xyz789 | +| `guardrailId` | *string* | :heavy_check_mark: | ID of the guardrail | 550e8400-e29b-41d4-a716-446655440001 | +| `assignedBy` | *string* | :heavy_check_mark: | User ID of who made the assignment | user_abc123 | +| `createdAt` | *string* | :heavy_check_mark: | ISO 8601 timestamp of when the assignment was created | 2025-08-24T10:30:00Z | \ No newline at end of file diff --git a/docs/models/operations/listguardrailmemberassignmentsrequest.md b/docs/models/operations/listguardrailmemberassignmentsrequest.md new file mode 100644 index 00000000..46ad127a --- /dev/null +++ b/docs/models/operations/listguardrailmemberassignmentsrequest.md @@ -0,0 +1,19 @@ +# ListGuardrailMemberAssignmentsRequest + +## Example Usage + +```typescript +import { ListGuardrailMemberAssignmentsRequest } from "@openrouter/sdk/models/operations"; + +let value: ListGuardrailMemberAssignmentsRequest = { + id: "550e8400-e29b-41d4-a716-446655440000", +}; +``` + +## Fields + +| Field | Type | Required | Description | Example | +| --------------------------------------------- | --------------------------------------------- | --------------------------------------------- | --------------------------------------------- | --------------------------------------------- | +| `id` | *string* | :heavy_check_mark: | The unique identifier of the guardrail | 550e8400-e29b-41d4-a716-446655440000 | +| `offset` | *string* | :heavy_minus_sign: | Number of records to skip for pagination | 0 | +| `limit` | *string* | :heavy_minus_sign: | Maximum number of records to return (max 100) | 50 | \ No newline at end of file diff --git a/docs/models/operations/listguardrailmemberassignmentsresponse.md b/docs/models/operations/listguardrailmemberassignmentsresponse.md new file mode 100644 index 00000000..297a6a89 --- /dev/null +++ b/docs/models/operations/listguardrailmemberassignmentsresponse.md @@ -0,0 +1,30 @@ +# ListGuardrailMemberAssignmentsResponse + +List of member assignments + +## Example Usage + +```typescript +import { ListGuardrailMemberAssignmentsResponse } from "@openrouter/sdk/models/operations"; + +let value: ListGuardrailMemberAssignmentsResponse = { + data: [ + { + id: "550e8400-e29b-41d4-a716-446655440000", + userId: "user_abc123", + organizationId: "org_xyz789", + guardrailId: "550e8400-e29b-41d4-a716-446655440001", + assignedBy: "user_abc123", + createdAt: "2025-08-24T10:30:00Z", + }, + ], + totalCount: 10, +}; +``` + +## Fields + +| Field | Type | Required | Description | Example | +| ---------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------- | +| `data` | [operations.ListGuardrailMemberAssignmentsData](../../models/operations/listguardrailmemberassignmentsdata.md)[] | :heavy_check_mark: | List of member assignments | | +| `totalCount` | *number* | :heavy_check_mark: | Total number of member assignments | 10 | \ No newline at end of file diff --git a/docs/models/operations/listguardrailsdata.md b/docs/models/operations/listguardrailsdata.md new file mode 100644 index 00000000..4ff5e67d --- /dev/null +++ b/docs/models/operations/listguardrailsdata.md @@ -0,0 +1,28 @@ +# ListGuardrailsData + +## Example Usage + +```typescript +import { ListGuardrailsData } from "@openrouter/sdk/models/operations"; + +let value: ListGuardrailsData = { + id: "550e8400-e29b-41d4-a716-446655440000", + name: "Production Guardrail", + createdAt: "2025-08-24T10:30:00Z", +}; +``` + +## Fields + +| Field | Type | Required | Description | Example | +| ----------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------- | +| `id` | *string* | :heavy_check_mark: | Unique identifier for the guardrail | 550e8400-e29b-41d4-a716-446655440000 | +| `name` | *string* | :heavy_check_mark: | Name of the guardrail | Production Guardrail | +| `description` | *string* | :heavy_minus_sign: | Description of the guardrail | Guardrail for production environment | +| `limitUsd` | *number* | :heavy_minus_sign: | Spending limit in USD | 100 | +| `resetInterval` | [operations.ListGuardrailsResetInterval](../../models/operations/listguardrailsresetinterval.md) | :heavy_minus_sign: | Interval at which the limit resets (daily, weekly, monthly) | monthly | +| `allowedProviders` | *string*[] | :heavy_minus_sign: | List of allowed provider IDs | [
"openai",
"anthropic",
"google"
] | +| `allowedModels` | *string*[] | :heavy_minus_sign: | Array of model canonical_slugs (immutable identifiers) | [
"openai/gpt-5.2-20251211",
"anthropic/claude-4.5-opus-20251124",
"deepseek/deepseek-r1-0528:free"
] | +| `enforceZdr` | *boolean* | :heavy_minus_sign: | Whether to enforce zero data retention | false | +| `createdAt` | *string* | :heavy_check_mark: | ISO 8601 timestamp of when the guardrail was created | 2025-08-24T10:30:00Z | +| `updatedAt` | *string* | :heavy_minus_sign: | ISO 8601 timestamp of when the guardrail was last updated | 2025-08-24T15:45:00Z | \ No newline at end of file diff --git a/docs/models/operations/listguardrailsrequest.md b/docs/models/operations/listguardrailsrequest.md new file mode 100644 index 00000000..41e0e510 --- /dev/null +++ b/docs/models/operations/listguardrailsrequest.md @@ -0,0 +1,16 @@ +# ListGuardrailsRequest + +## Example Usage + +```typescript +import { ListGuardrailsRequest } from "@openrouter/sdk/models/operations"; + +let value: ListGuardrailsRequest = {}; +``` + +## Fields + +| Field | Type | Required | Description | Example | +| --------------------------------------------- | --------------------------------------------- | --------------------------------------------- | --------------------------------------------- | --------------------------------------------- | +| `offset` | *string* | :heavy_minus_sign: | Number of records to skip for pagination | 0 | +| `limit` | *string* | :heavy_minus_sign: | Maximum number of records to return (max 100) | 50 | \ No newline at end of file diff --git a/docs/models/operations/listguardrailsresetinterval.md b/docs/models/operations/listguardrailsresetinterval.md new file mode 100644 index 00000000..6235d37e --- /dev/null +++ b/docs/models/operations/listguardrailsresetinterval.md @@ -0,0 +1,19 @@ +# ListGuardrailsResetInterval + +Interval at which the limit resets (daily, weekly, monthly) + +## Example Usage + +```typescript +import { ListGuardrailsResetInterval } from "@openrouter/sdk/models/operations"; + +let value: ListGuardrailsResetInterval = "monthly"; +``` + +## Values + +This is an open enum. Unrecognized values will be captured as the `Unrecognized` branded type. + +```typescript +"daily" | "weekly" | "monthly" | Unrecognized +``` \ No newline at end of file diff --git a/docs/models/operations/getparametersdata.md b/docs/models/operations/listguardrailsresponse.md similarity index 51% rename from docs/models/operations/getparametersdata.md rename to docs/models/operations/listguardrailsresponse.md index 11b2eb08..f32e01e8 100644 --- a/docs/models/operations/getparametersdata.md +++ b/docs/models/operations/listguardrailsresponse.md @@ -1,19 +1,21 @@ -# GetParametersData +# ListGuardrailsResponse -Parameter analytics data +List of guardrails ## Example Usage ```typescript -import { GetParametersData } from "@openrouter/sdk/models/operations"; +import { ListGuardrailsResponse } from "@openrouter/sdk/models/operations"; -let value: GetParametersData = { - model: "openai/gpt-4", - supportedParameters: [ - "temperature", - "top_p", - "max_tokens", +let value: ListGuardrailsResponse = { + data: [ + { + id: "550e8400-e29b-41d4-a716-446655440000", + name: "Production Guardrail", + createdAt: "2025-08-24T10:30:00Z", + }, ], + totalCount: 1, }; ``` @@ -21,5 +23,5 @@ let value: GetParametersData = { | Field | Type | Required | Description | Example | | -------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- | -| `model` | *string* | :heavy_check_mark: | Model identifier | openai/gpt-4 | -| `supportedParameters` | [operations.SupportedParameter](../../models/operations/supportedparameter.md)[] | :heavy_check_mark: | List of parameters supported by this model | [
"temperature",
"top_p",
"max_tokens"
] | \ No newline at end of file +| `data` | [operations.ListGuardrailsData](../../models/operations/listguardrailsdata.md)[] | :heavy_check_mark: | List of guardrails | | +| `totalCount` | *number* | :heavy_check_mark: | Total number of guardrails | 25 | \ No newline at end of file diff --git a/docs/models/operations/listkeyassignmentsdata.md b/docs/models/operations/listkeyassignmentsdata.md new file mode 100644 index 00000000..e30d8132 --- /dev/null +++ b/docs/models/operations/listkeyassignmentsdata.md @@ -0,0 +1,29 @@ +# ListKeyAssignmentsData + +## Example Usage + +```typescript +import { ListKeyAssignmentsData } from "@openrouter/sdk/models/operations"; + +let value: ListKeyAssignmentsData = { + id: "550e8400-e29b-41d4-a716-446655440000", + keyHash: "c56454edb818d6b14bc0d61c46025f1450b0f4012d12304ab40aacb519fcbc93", + guardrailId: "550e8400-e29b-41d4-a716-446655440001", + keyName: "Production Key", + keyLabel: "prod-key", + assignedBy: "user_abc123", + createdAt: "2025-08-24T10:30:00Z", +}; +``` + +## Fields + +| Field | Type | Required | Description | Example | +| ---------------------------------------------------------------- | ---------------------------------------------------------------- | ---------------------------------------------------------------- | ---------------------------------------------------------------- | ---------------------------------------------------------------- | +| `id` | *string* | :heavy_check_mark: | Unique identifier for the assignment | 550e8400-e29b-41d4-a716-446655440000 | +| `keyHash` | *string* | :heavy_check_mark: | Hash of the assigned API key | c56454edb818d6b14bc0d61c46025f1450b0f4012d12304ab40aacb519fcbc93 | +| `guardrailId` | *string* | :heavy_check_mark: | ID of the guardrail | 550e8400-e29b-41d4-a716-446655440001 | +| `keyName` | *string* | :heavy_check_mark: | Name of the API key | Production Key | +| `keyLabel` | *string* | :heavy_check_mark: | Label of the API key | prod-key | +| `assignedBy` | *string* | :heavy_check_mark: | User ID of who made the assignment | user_abc123 | +| `createdAt` | *string* | :heavy_check_mark: | ISO 8601 timestamp of when the assignment was created | 2025-08-24T10:30:00Z | \ No newline at end of file diff --git a/docs/models/operations/listkeyassignmentsrequest.md b/docs/models/operations/listkeyassignmentsrequest.md new file mode 100644 index 00000000..b871e95d --- /dev/null +++ b/docs/models/operations/listkeyassignmentsrequest.md @@ -0,0 +1,16 @@ +# ListKeyAssignmentsRequest + +## Example Usage + +```typescript +import { ListKeyAssignmentsRequest } from "@openrouter/sdk/models/operations"; + +let value: ListKeyAssignmentsRequest = {}; +``` + +## Fields + +| Field | Type | Required | Description | Example | +| --------------------------------------------- | --------------------------------------------- | --------------------------------------------- | --------------------------------------------- | --------------------------------------------- | +| `offset` | *string* | :heavy_minus_sign: | Number of records to skip for pagination | 0 | +| `limit` | *string* | :heavy_minus_sign: | Maximum number of records to return (max 100) | 50 | \ No newline at end of file diff --git a/docs/models/operations/listkeyassignmentsresponse.md b/docs/models/operations/listkeyassignmentsresponse.md new file mode 100644 index 00000000..bdce9b8e --- /dev/null +++ b/docs/models/operations/listkeyassignmentsresponse.md @@ -0,0 +1,32 @@ +# ListKeyAssignmentsResponse + +List of key assignments + +## Example Usage + +```typescript +import { ListKeyAssignmentsResponse } from "@openrouter/sdk/models/operations"; + +let value: ListKeyAssignmentsResponse = { + data: [ + { + id: "550e8400-e29b-41d4-a716-446655440000", + keyHash: + "c56454edb818d6b14bc0d61c46025f1450b0f4012d12304ab40aacb519fcbc93", + guardrailId: "550e8400-e29b-41d4-a716-446655440001", + keyName: "Production Key", + keyLabel: "prod-key", + assignedBy: "user_abc123", + createdAt: "2025-08-24T10:30:00Z", + }, + ], + totalCount: 25, +}; +``` + +## Fields + +| Field | Type | Required | Description | Example | +| ---------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- | +| `data` | [operations.ListKeyAssignmentsData](../../models/operations/listkeyassignmentsdata.md)[] | :heavy_check_mark: | List of key assignments | | +| `totalCount` | *number* | :heavy_check_mark: | Total number of key assignments for this guardrail | 25 | \ No newline at end of file diff --git a/docs/models/operations/listmemberassignmentsdata.md b/docs/models/operations/listmemberassignmentsdata.md new file mode 100644 index 00000000..52d09761 --- /dev/null +++ b/docs/models/operations/listmemberassignmentsdata.md @@ -0,0 +1,27 @@ +# ListMemberAssignmentsData + +## Example Usage + +```typescript +import { ListMemberAssignmentsData } from "@openrouter/sdk/models/operations"; + +let value: ListMemberAssignmentsData = { + id: "550e8400-e29b-41d4-a716-446655440000", + userId: "user_abc123", + organizationId: "org_xyz789", + guardrailId: "550e8400-e29b-41d4-a716-446655440001", + assignedBy: "user_abc123", + createdAt: "2025-08-24T10:30:00Z", +}; +``` + +## Fields + +| Field | Type | Required | Description | Example | +| ----------------------------------------------------- | ----------------------------------------------------- | ----------------------------------------------------- | ----------------------------------------------------- | ----------------------------------------------------- | +| `id` | *string* | :heavy_check_mark: | Unique identifier for the assignment | 550e8400-e29b-41d4-a716-446655440000 | +| `userId` | *string* | :heavy_check_mark: | Clerk user ID of the assigned member | user_abc123 | +| `organizationId` | *string* | :heavy_check_mark: | Organization ID | org_xyz789 | +| `guardrailId` | *string* | :heavy_check_mark: | ID of the guardrail | 550e8400-e29b-41d4-a716-446655440001 | +| `assignedBy` | *string* | :heavy_check_mark: | User ID of who made the assignment | user_abc123 | +| `createdAt` | *string* | :heavy_check_mark: | ISO 8601 timestamp of when the assignment was created | 2025-08-24T10:30:00Z | \ No newline at end of file diff --git a/docs/models/operations/listmemberassignmentsrequest.md b/docs/models/operations/listmemberassignmentsrequest.md new file mode 100644 index 00000000..42bc1dfc --- /dev/null +++ b/docs/models/operations/listmemberassignmentsrequest.md @@ -0,0 +1,16 @@ +# ListMemberAssignmentsRequest + +## Example Usage + +```typescript +import { ListMemberAssignmentsRequest } from "@openrouter/sdk/models/operations"; + +let value: ListMemberAssignmentsRequest = {}; +``` + +## Fields + +| Field | Type | Required | Description | Example | +| --------------------------------------------- | --------------------------------------------- | --------------------------------------------- | --------------------------------------------- | --------------------------------------------- | +| `offset` | *string* | :heavy_minus_sign: | Number of records to skip for pagination | 0 | +| `limit` | *string* | :heavy_minus_sign: | Maximum number of records to return (max 100) | 50 | \ No newline at end of file diff --git a/docs/models/operations/listmemberassignmentsresponse.md b/docs/models/operations/listmemberassignmentsresponse.md new file mode 100644 index 00000000..d9d9bb77 --- /dev/null +++ b/docs/models/operations/listmemberassignmentsresponse.md @@ -0,0 +1,21 @@ +# ListMemberAssignmentsResponse + +List of member assignments + +## Example Usage + +```typescript +import { ListMemberAssignmentsResponse } from "@openrouter/sdk/models/operations"; + +let value: ListMemberAssignmentsResponse = { + data: [], + totalCount: 10, +}; +``` + +## Fields + +| Field | Type | Required | Description | Example | +| ---------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------- | +| `data` | [operations.ListMemberAssignmentsData](../../models/operations/listmemberassignmentsdata.md)[] | :heavy_check_mark: | List of member assignments | | +| `totalCount` | *number* | :heavy_check_mark: | Total number of member assignments | 10 | \ No newline at end of file diff --git a/docs/models/operations/listresponse.md b/docs/models/operations/listresponse.md index 38ac9eab..e331fdc2 100644 --- a/docs/models/operations/listresponse.md +++ b/docs/models/operations/listresponse.md @@ -10,8 +10,7 @@ import { ListResponse } from "@openrouter/sdk/models/operations"; let value: ListResponse = { data: [ { - hash: - "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", + hash: "f01d52606dc8f0a8303a7b5cc3fa07109c2e346cec7c0a16b40de462992ce943", name: "My Production Key", label: "Production API Key", disabled: false, diff --git a/docs/models/operations/supportedparameter.md b/docs/models/operations/supportedparameter.md deleted file mode 100644 index 46509631..00000000 --- a/docs/models/operations/supportedparameter.md +++ /dev/null @@ -1,17 +0,0 @@ -# SupportedParameter - -## Example Usage - -```typescript -import { SupportedParameter } from "@openrouter/sdk/models/operations"; - -let value: SupportedParameter = "top_logprobs"; -``` - -## Values - -This is an open enum. Unrecognized values will be captured as the `Unrecognized` branded type. - -```typescript -"temperature" | "top_p" | "top_k" | "min_p" | "top_a" | "frequency_penalty" | "presence_penalty" | "repetition_penalty" | "max_tokens" | "logit_bias" | "logprobs" | "top_logprobs" | "seed" | "response_format" | "structured_outputs" | "stop" | "tools" | "tool_choice" | "parallel_tool_calls" | "include_reasoning" | "reasoning" | "reasoning_effort" | "web_search_options" | "verbosity" | Unrecognized -``` \ No newline at end of file diff --git a/docs/models/operations/updateguardraildata.md b/docs/models/operations/updateguardraildata.md new file mode 100644 index 00000000..ca469f5d --- /dev/null +++ b/docs/models/operations/updateguardraildata.md @@ -0,0 +1,30 @@ +# UpdateGuardrailData + +The updated guardrail + +## Example Usage + +```typescript +import { UpdateGuardrailData } from "@openrouter/sdk/models/operations"; + +let value: UpdateGuardrailData = { + id: "550e8400-e29b-41d4-a716-446655440000", + name: "Production Guardrail", + createdAt: "2025-08-24T10:30:00Z", +}; +``` + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------ | +| `id` | *string* | :heavy_check_mark: | Unique identifier for the guardrail | 550e8400-e29b-41d4-a716-446655440000 | +| `name` | *string* | :heavy_check_mark: | Name of the guardrail | Production Guardrail | +| `description` | *string* | :heavy_minus_sign: | Description of the guardrail | Guardrail for production environment | +| `limitUsd` | *number* | :heavy_minus_sign: | Spending limit in USD | 100 | +| `resetInterval` | [operations.UpdateGuardrailResetIntervalResponse](../../models/operations/updateguardrailresetintervalresponse.md) | :heavy_minus_sign: | Interval at which the limit resets (daily, weekly, monthly) | monthly | +| `allowedProviders` | *string*[] | :heavy_minus_sign: | List of allowed provider IDs | [
"openai",
"anthropic",
"google"
] | +| `allowedModels` | *string*[] | :heavy_minus_sign: | Array of model canonical_slugs (immutable identifiers) | [
"openai/gpt-5.2-20251211",
"anthropic/claude-4.5-opus-20251124",
"deepseek/deepseek-r1-0528:free"
] | +| `enforceZdr` | *boolean* | :heavy_minus_sign: | Whether to enforce zero data retention | false | +| `createdAt` | *string* | :heavy_check_mark: | ISO 8601 timestamp of when the guardrail was created | 2025-08-24T10:30:00Z | +| `updatedAt` | *string* | :heavy_minus_sign: | ISO 8601 timestamp of when the guardrail was last updated | 2025-08-24T15:45:00Z | \ No newline at end of file diff --git a/docs/models/operations/updateguardrailrequest.md b/docs/models/operations/updateguardrailrequest.md new file mode 100644 index 00000000..2213038c --- /dev/null +++ b/docs/models/operations/updateguardrailrequest.md @@ -0,0 +1,19 @@ +# UpdateGuardrailRequest + +## Example Usage + +```typescript +import { UpdateGuardrailRequest } from "@openrouter/sdk/models/operations"; + +let value: UpdateGuardrailRequest = { + id: "550e8400-e29b-41d4-a716-446655440000", + requestBody: {}, +}; +``` + +## Fields + +| Field | Type | Required | Description | Example | +| ----------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------- | +| `id` | *string* | :heavy_check_mark: | The unique identifier of the guardrail to update | 550e8400-e29b-41d4-a716-446655440000 | +| `requestBody` | [operations.UpdateGuardrailRequestBody](../../models/operations/updateguardrailrequestbody.md) | :heavy_check_mark: | N/A | {
"name": "Updated Guardrail Name",
"description": "Updated description",
"limit_usd": 75,
"reset_interval": "weekly"
} | \ No newline at end of file diff --git a/docs/models/operations/updateguardrailrequestbody.md b/docs/models/operations/updateguardrailrequestbody.md new file mode 100644 index 00000000..dec334ee --- /dev/null +++ b/docs/models/operations/updateguardrailrequestbody.md @@ -0,0 +1,21 @@ +# UpdateGuardrailRequestBody + +## Example Usage + +```typescript +import { UpdateGuardrailRequestBody } from "@openrouter/sdk/models/operations"; + +let value: UpdateGuardrailRequestBody = {}; +``` + +## Fields + +| Field | Type | Required | Description | Example | +| ---------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------- | +| `name` | *string* | :heavy_minus_sign: | New name for the guardrail | Updated Guardrail Name | +| `description` | *string* | :heavy_minus_sign: | New description for the guardrail | Updated description | +| `limitUsd` | *number* | :heavy_minus_sign: | New spending limit in USD | 75 | +| `resetInterval` | [operations.UpdateGuardrailResetIntervalRequest](../../models/operations/updateguardrailresetintervalrequest.md) | :heavy_minus_sign: | Interval at which the limit resets (daily, weekly, monthly) | monthly | +| `allowedProviders` | *string*[] | :heavy_minus_sign: | New list of allowed provider IDs | [
"openai",
"anthropic",
"deepseek"
] | +| `allowedModels` | *string*[] | :heavy_minus_sign: | Array of model identifiers (slug or canonical_slug accepted) | [
"openai/gpt-5.2"
] | +| `enforceZdr` | *boolean* | :heavy_minus_sign: | Whether to enforce zero data retention | true | \ No newline at end of file diff --git a/docs/models/operations/updateguardrailresetintervalrequest.md b/docs/models/operations/updateguardrailresetintervalrequest.md new file mode 100644 index 00000000..65e8ee91 --- /dev/null +++ b/docs/models/operations/updateguardrailresetintervalrequest.md @@ -0,0 +1,19 @@ +# UpdateGuardrailResetIntervalRequest + +Interval at which the limit resets (daily, weekly, monthly) + +## Example Usage + +```typescript +import { UpdateGuardrailResetIntervalRequest } from "@openrouter/sdk/models/operations"; + +let value: UpdateGuardrailResetIntervalRequest = "monthly"; +``` + +## Values + +This is an open enum. Unrecognized values will be captured as the `Unrecognized` branded type. + +```typescript +"daily" | "weekly" | "monthly" | Unrecognized +``` \ No newline at end of file diff --git a/docs/models/operations/updateguardrailresetintervalresponse.md b/docs/models/operations/updateguardrailresetintervalresponse.md new file mode 100644 index 00000000..0208b727 --- /dev/null +++ b/docs/models/operations/updateguardrailresetintervalresponse.md @@ -0,0 +1,19 @@ +# UpdateGuardrailResetIntervalResponse + +Interval at which the limit resets (daily, weekly, monthly) + +## Example Usage + +```typescript +import { UpdateGuardrailResetIntervalResponse } from "@openrouter/sdk/models/operations"; + +let value: UpdateGuardrailResetIntervalResponse = "monthly"; +``` + +## Values + +This is an open enum. Unrecognized values will be captured as the `Unrecognized` branded type. + +```typescript +"daily" | "weekly" | "monthly" | Unrecognized +``` \ No newline at end of file diff --git a/docs/models/operations/updateguardrailresponse.md b/docs/models/operations/updateguardrailresponse.md new file mode 100644 index 00000000..2790251c --- /dev/null +++ b/docs/models/operations/updateguardrailresponse.md @@ -0,0 +1,23 @@ +# UpdateGuardrailResponse + +Guardrail updated successfully + +## Example Usage + +```typescript +import { UpdateGuardrailResponse } from "@openrouter/sdk/models/operations"; + +let value: UpdateGuardrailResponse = { + data: { + id: "550e8400-e29b-41d4-a716-446655440000", + name: "Updated Guardrail Name", + createdAt: "2025-08-24T10:30:00Z", + }, +}; +``` + +## Fields + +| Field | Type | Required | Description | Example | +| -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `data` | [operations.UpdateGuardrailData](../../models/operations/updateguardraildata.md) | :heavy_check_mark: | The updated guardrail | {
"id": "550e8400-e29b-41d4-a716-446655440000",
"name": "Production Guardrail",
"description": "Guardrail for production environment",
"limit_usd": 100,
"reset_interval": "monthly",
"allowed_providers": [
"openai",
"anthropic",
"google"
],
"allowed_models": null,
"enforce_zdr": false,
"created_at": "2025-08-24T10:30:00Z",
"updated_at": "2025-08-24T15:45:00Z"
} | \ No newline at end of file diff --git a/docs/models/operations/updatekeysdata.md b/docs/models/operations/updatekeysdata.md index e7eb14f7..cb9bc482 100644 --- a/docs/models/operations/updatekeysdata.md +++ b/docs/models/operations/updatekeysdata.md @@ -8,10 +8,9 @@ The updated API key information import { UpdateKeysData } from "@openrouter/sdk/models/operations"; let value: UpdateKeysData = { - hash: - "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", + hash: "f01d52606dc8f0a8303a7b5cc3fa07109c2e346cec7c0a16b40de462992ce943", name: "My Production Key", - label: "Production API Key", + label: "sk-or-v1-0e6...1c96", disabled: false, limit: 100, limitRemaining: 74.5, @@ -34,9 +33,9 @@ let value: UpdateKeysData = { | Field | Type | Required | Description | Example | | --------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------- | -| `hash` | *string* | :heavy_check_mark: | Unique hash identifier for the API key | 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 | +| `hash` | *string* | :heavy_check_mark: | Unique hash identifier for the API key | f01d52606dc8f0a8303a7b5cc3fa07109c2e346cec7c0a16b40de462992ce943 | | `name` | *string* | :heavy_check_mark: | Name of the API key | My Production Key | -| `label` | *string* | :heavy_check_mark: | Human-readable label for the API key | Production API Key | +| `label` | *string* | :heavy_check_mark: | Human-readable label for the API key | sk-or-v1-0e6...1c96 | | `disabled` | *boolean* | :heavy_check_mark: | Whether the API key is disabled | false | | `limit` | *number* | :heavy_check_mark: | Spending limit for the API key in USD | 100 | | `limitRemaining` | *number* | :heavy_check_mark: | Remaining spending limit in USD | 74.5 | diff --git a/docs/models/operations/updatekeysrequest.md b/docs/models/operations/updatekeysrequest.md index 1fb14f78..de2e53a1 100644 --- a/docs/models/operations/updatekeysrequest.md +++ b/docs/models/operations/updatekeysrequest.md @@ -6,8 +6,7 @@ import { UpdateKeysRequest } from "@openrouter/sdk/models/operations"; let value: UpdateKeysRequest = { - hash: - "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", + hash: "f01d52606dc8f0a8303a7b5cc3fa07109c2e346cec7c0a16b40de462992ce943", requestBody: {}, }; ``` @@ -16,5 +15,5 @@ let value: UpdateKeysRequest = { | Field | Type | Required | Description | Example | | ------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------- | -| `hash` | *string* | :heavy_check_mark: | The hash identifier of the API key to update | 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 | +| `hash` | *string* | :heavy_check_mark: | The hash identifier of the API key to update | f01d52606dc8f0a8303a7b5cc3fa07109c2e346cec7c0a16b40de462992ce943 | | `requestBody` | [operations.UpdateKeysRequestBody](../../models/operations/updatekeysrequestbody.md) | :heavy_check_mark: | N/A | {
"name": "Updated API Key Name",
"disabled": false,
"limit": 75,
"limit_reset": "daily",
"include_byok_in_limit": true
} | \ No newline at end of file diff --git a/docs/models/operations/updatekeysresponse.md b/docs/models/operations/updatekeysresponse.md index b807076a..2fb6f1ed 100644 --- a/docs/models/operations/updatekeysresponse.md +++ b/docs/models/operations/updatekeysresponse.md @@ -9,8 +9,7 @@ import { UpdateKeysResponse } from "@openrouter/sdk/models/operations"; let value: UpdateKeysResponse = { data: { - hash: - "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", + hash: "f01d52606dc8f0a8303a7b5cc3fa07109c2e346cec7c0a16b40de462992ce943", name: "Updated API Key Name", label: "Updated API Key Name", disabled: false, @@ -34,6 +33,6 @@ let value: UpdateKeysResponse = { ## Fields -| Field | Type | Required | Description | Example | -| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `data` | [operations.UpdateKeysData](../../models/operations/updatekeysdata.md) | :heavy_check_mark: | The updated API key information | {
"hash": "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",
"name": "My Production Key",
"label": "Production API Key",
"disabled": false,
"limit": 100,
"limit_remaining": 74.5,
"limit_reset": "monthly",
"include_byok_in_limit": false,
"usage": 25.5,
"usage_daily": 25.5,
"usage_weekly": 25.5,
"usage_monthly": 25.5,
"byok_usage": 17.38,
"byok_usage_daily": 17.38,
"byok_usage_weekly": 17.38,
"byok_usage_monthly": 17.38,
"created_at": "2025-08-24T10:30:00Z",
"updated_at": "2025-08-24T15:45:00Z",
"expires_at": "2027-12-31T23:59:59Z"
} | \ No newline at end of file +| Field | Type | Required | Description | Example | +| --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `data` | [operations.UpdateKeysData](../../models/operations/updatekeysdata.md) | :heavy_check_mark: | The updated API key information | {
"hash": "f01d52606dc8f0a8303a7b5cc3fa07109c2e346cec7c0a16b40de462992ce943",
"name": "My Production Key",
"label": "sk-or-v1-0e6...1c96",
"disabled": false,
"limit": 100,
"limit_remaining": 74.5,
"limit_reset": "monthly",
"include_byok_in_limit": false,
"usage": 25.5,
"usage_daily": 25.5,
"usage_weekly": 25.5,
"usage_monthly": 25.5,
"byok_usage": 17.38,
"byok_usage_daily": 17.38,
"byok_usage_weekly": 17.38,
"byok_usage_monthly": 17.38,
"created_at": "2025-08-24T10:30:00Z",
"updated_at": "2025-08-24T15:45:00Z",
"expires_at": "2027-12-31T23:59:59Z"
} | \ No newline at end of file diff --git a/docs/models/schema2.md b/docs/models/schema2.md new file mode 100644 index 00000000..ab034a0e --- /dev/null +++ b/docs/models/schema2.md @@ -0,0 +1,31 @@ +# Schema2 + + +## Supported Types + +### `models.Schema2ReasoningSummary` + +```typescript +const value: models.Schema2ReasoningSummary = { + type: "reasoning.summary", + summary: "", +}; +``` + +### `models.Schema2ReasoningEncrypted` + +```typescript +const value: models.Schema2ReasoningEncrypted = { + type: "reasoning.encrypted", + data: "", +}; +``` + +### `models.Schema2ReasoningText` + +```typescript +const value: models.Schema2ReasoningText = { + type: "reasoning.text", +}; +``` + diff --git a/docs/models/schema3reasoningencrypted.md b/docs/models/schema2reasoningencrypted.md similarity index 81% rename from docs/models/schema3reasoningencrypted.md rename to docs/models/schema2reasoningencrypted.md index c3b20ccc..24fb7373 100644 --- a/docs/models/schema3reasoningencrypted.md +++ b/docs/models/schema2reasoningencrypted.md @@ -1,11 +1,11 @@ -# Schema3ReasoningEncrypted +# Schema2ReasoningEncrypted ## Example Usage ```typescript -import { Schema3ReasoningEncrypted } from "@openrouter/sdk/models"; +import { Schema2ReasoningEncrypted } from "@openrouter/sdk/models"; -let value: Schema3ReasoningEncrypted = { +let value: Schema2ReasoningEncrypted = { type: "reasoning.encrypted", data: "", }; @@ -18,5 +18,5 @@ let value: Schema3ReasoningEncrypted = { | `type` | *"reasoning.encrypted"* | :heavy_check_mark: | N/A | | `data` | *string* | :heavy_check_mark: | N/A | | `id` | *string* | :heavy_minus_sign: | N/A | -| `format` | [models.Schema5](../models/schema5.md) | :heavy_minus_sign: | N/A | +| `format` | [models.Schema4](../models/schema4.md) | :heavy_minus_sign: | N/A | | `index` | *number* | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/schema3reasoningsummary.md b/docs/models/schema2reasoningsummary.md similarity index 81% rename from docs/models/schema3reasoningsummary.md rename to docs/models/schema2reasoningsummary.md index 33cd68c6..1ad716d8 100644 --- a/docs/models/schema3reasoningsummary.md +++ b/docs/models/schema2reasoningsummary.md @@ -1,11 +1,11 @@ -# Schema3ReasoningSummary +# Schema2ReasoningSummary ## Example Usage ```typescript -import { Schema3ReasoningSummary } from "@openrouter/sdk/models"; +import { Schema2ReasoningSummary } from "@openrouter/sdk/models"; -let value: Schema3ReasoningSummary = { +let value: Schema2ReasoningSummary = { type: "reasoning.summary", summary: "", }; @@ -18,5 +18,5 @@ let value: Schema3ReasoningSummary = { | `type` | *"reasoning.summary"* | :heavy_check_mark: | N/A | | `summary` | *string* | :heavy_check_mark: | N/A | | `id` | *string* | :heavy_minus_sign: | N/A | -| `format` | [models.Schema5](../models/schema5.md) | :heavy_minus_sign: | N/A | +| `format` | [models.Schema4](../models/schema4.md) | :heavy_minus_sign: | N/A | | `index` | *number* | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/schema3reasoningtext.md b/docs/models/schema2reasoningtext.md similarity index 83% rename from docs/models/schema3reasoningtext.md rename to docs/models/schema2reasoningtext.md index b5190d09..4e5cbc96 100644 --- a/docs/models/schema3reasoningtext.md +++ b/docs/models/schema2reasoningtext.md @@ -1,11 +1,11 @@ -# Schema3ReasoningText +# Schema2ReasoningText ## Example Usage ```typescript -import { Schema3ReasoningText } from "@openrouter/sdk/models"; +import { Schema2ReasoningText } from "@openrouter/sdk/models"; -let value: Schema3ReasoningText = { +let value: Schema2ReasoningText = { type: "reasoning.text", }; ``` @@ -18,5 +18,5 @@ let value: Schema3ReasoningText = { | `text` | *string* | :heavy_minus_sign: | N/A | | `signature` | *string* | :heavy_minus_sign: | N/A | | `id` | *string* | :heavy_minus_sign: | N/A | -| `format` | [models.Schema5](../models/schema5.md) | :heavy_minus_sign: | N/A | +| `format` | [models.Schema4](../models/schema4.md) | :heavy_minus_sign: | N/A | | `index` | *number* | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/schema3.md b/docs/models/schema3.md deleted file mode 100644 index 36adb6c1..00000000 --- a/docs/models/schema3.md +++ /dev/null @@ -1,31 +0,0 @@ -# Schema3 - - -## Supported Types - -### `models.Schema3ReasoningSummary` - -```typescript -const value: models.Schema3ReasoningSummary = { - type: "reasoning.summary", - summary: "", -}; -``` - -### `models.Schema3ReasoningEncrypted` - -```typescript -const value: models.Schema3ReasoningEncrypted = { - type: "reasoning.encrypted", - data: "", -}; -``` - -### `models.Schema3ReasoningText` - -```typescript -const value: models.Schema3ReasoningText = { - type: "reasoning.text", -}; -``` - diff --git a/docs/models/schema5.md b/docs/models/schema4.md similarity index 75% rename from docs/models/schema5.md rename to docs/models/schema4.md index 3c5e2232..184b02af 100644 --- a/docs/models/schema5.md +++ b/docs/models/schema4.md @@ -1,11 +1,11 @@ -# Schema5 +# Schema4 ## Example Usage ```typescript -import { Schema5 } from "@openrouter/sdk/models"; +import { Schema4 } from "@openrouter/sdk/models"; -let value: Schema5 = "google-gemini-v1"; +let value: Schema4 = "openai-responses-v1"; ``` ## Values diff --git a/docs/sdks/analytics/README.md b/docs/sdks/analytics/README.md index 946cf79e..57bb7a59 100644 --- a/docs/sdks/analytics/README.md +++ b/docs/sdks/analytics/README.md @@ -10,7 +10,7 @@ Analytics and usage endpoints ## getUserActivity -Returns user activity data grouped by endpoint for the last 30 (completed) UTC days +Returns user activity data grouped by endpoint for the last 30 (completed) UTC days. [Provisioning key](/docs/guides/overview/auth/provisioning-api-keys) required. ### Example Usage diff --git a/docs/sdks/apikeys/README.md b/docs/sdks/apikeys/README.md index 75f9db4d..9ec3c12c 100644 --- a/docs/sdks/apikeys/README.md +++ b/docs/sdks/apikeys/README.md @@ -15,7 +15,7 @@ API key management endpoints ## list -List API keys +List all API keys for the authenticated user. [Provisioning key](/docs/guides/overview/auth/provisioning-api-keys) required. ### Example Usage @@ -87,7 +87,7 @@ run(); ## create -Create a new API key +Create a new API key for the authenticated user. [Provisioning key](/docs/guides/overview/auth/provisioning-api-keys) required. ### Example Usage @@ -164,7 +164,7 @@ run(); ## update -Update an API key +Update an existing API key. [Provisioning key](/docs/guides/overview/auth/provisioning-api-keys) required. ### Example Usage @@ -178,7 +178,7 @@ const openRouter = new OpenRouter({ async function run() { const result = await openRouter.apiKeys.update({ - hash: "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", + hash: "f01d52606dc8f0a8303a7b5cc3fa07109c2e346cec7c0a16b40de462992ce943", requestBody: {}, }); @@ -204,7 +204,7 @@ const openRouter = new OpenRouterCore({ async function run() { const res = await apiKeysUpdate(openRouter, { - hash: "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", + hash: "f01d52606dc8f0a8303a7b5cc3fa07109c2e346cec7c0a16b40de462992ce943", requestBody: {}, }); if (res.ok) { @@ -244,7 +244,7 @@ run(); ## delete -Delete an API key +Delete an existing API key. [Provisioning key](/docs/guides/overview/auth/provisioning-api-keys) required. ### Example Usage @@ -258,7 +258,7 @@ const openRouter = new OpenRouter({ async function run() { const result = await openRouter.apiKeys.delete({ - hash: "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", + hash: "f01d52606dc8f0a8303a7b5cc3fa07109c2e346cec7c0a16b40de462992ce943", }); console.log(result); @@ -283,7 +283,7 @@ const openRouter = new OpenRouterCore({ async function run() { const res = await apiKeysDelete(openRouter, { - hash: "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", + hash: "f01d52606dc8f0a8303a7b5cc3fa07109c2e346cec7c0a16b40de462992ce943", }); if (res.ok) { const { value: result } = res; @@ -321,7 +321,7 @@ run(); ## get -Get a single API key +Get a single API key by hash. [Provisioning key](/docs/guides/overview/auth/provisioning-api-keys) required. ### Example Usage @@ -335,7 +335,7 @@ const openRouter = new OpenRouter({ async function run() { const result = await openRouter.apiKeys.get({ - hash: "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", + hash: "f01d52606dc8f0a8303a7b5cc3fa07109c2e346cec7c0a16b40de462992ce943", }); console.log(result); @@ -360,7 +360,7 @@ const openRouter = new OpenRouterCore({ async function run() { const res = await apiKeysGet(openRouter, { - hash: "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", + hash: "f01d52606dc8f0a8303a7b5cc3fa07109c2e346cec7c0a16b40de462992ce943", }); if (res.ok) { const { value: result } = res; diff --git a/docs/sdks/credits/README.md b/docs/sdks/credits/README.md index f27be34f..7cd662b6 100644 --- a/docs/sdks/credits/README.md +++ b/docs/sdks/credits/README.md @@ -11,7 +11,7 @@ Credit management endpoints ## getCredits -Get total credits purchased and used for the authenticated user +Get total credits purchased and used for the authenticated user. [Provisioning key](/docs/guides/overview/auth/provisioning-api-keys) required. ### Example Usage diff --git a/docs/sdks/guardrails/README.md b/docs/sdks/guardrails/README.md new file mode 100644 index 00000000..ac187c2f --- /dev/null +++ b/docs/sdks/guardrails/README.md @@ -0,0 +1,1045 @@ +# Guardrails + +## Overview + +Guardrails endpoints + +### Available Operations + +* [list](#list) - List guardrails +* [create](#create) - Create a guardrail +* [get](#get) - Get a guardrail +* [update](#update) - Update a guardrail +* [delete](#delete) - Delete a guardrail +* [listKeyAssignments](#listkeyassignments) - List all key assignments +* [listMemberAssignments](#listmemberassignments) - List all member assignments +* [listGuardrailKeyAssignments](#listguardrailkeyassignments) - List key assignments for a guardrail +* [bulkAssignKeys](#bulkassignkeys) - Bulk assign keys to a guardrail +* [listGuardrailMemberAssignments](#listguardrailmemberassignments) - List member assignments for a guardrail +* [bulkAssignMembers](#bulkassignmembers) - Bulk assign members to a guardrail +* [bulkUnassignKeys](#bulkunassignkeys) - Bulk unassign keys from a guardrail +* [bulkUnassignMembers](#bulkunassignmembers) - Bulk unassign members from a guardrail + +## list + +List all guardrails for the authenticated user. [Provisioning key](/docs/guides/overview/auth/provisioning-api-keys) required. + +### Example Usage + + +```typescript +import { OpenRouter } from "@openrouter/sdk"; + +const openRouter = new OpenRouter({ + apiKey: process.env["OPENROUTER_API_KEY"] ?? "", +}); + +async function run() { + const result = await openRouter.guardrails.list(); + + console.log(result); +} + +run(); +``` + +### Standalone function + +The standalone function version of this method: + +```typescript +import { OpenRouterCore } from "@openrouter/sdk/core.js"; +import { guardrailsList } from "@openrouter/sdk/funcs/guardrailsList.js"; + +// Use `OpenRouterCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const openRouter = new OpenRouterCore({ + apiKey: process.env["OPENROUTER_API_KEY"] ?? "", +}); + +async function run() { + const res = await guardrailsList(openRouter); + if (res.ok) { + const { value: result } = res; + console.log(result); + } else { + console.log("guardrailsList failed:", res.error); + } +} + +run(); +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `request` | [operations.ListGuardrailsRequest](../../models/operations/listguardrailsrequest.md) | :heavy_check_mark: | The request object to use for the request. | +| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | +| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | +| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | + +### Response + +**Promise\<[operations.ListGuardrailsResponse](../../models/operations/listguardrailsresponse.md)\>** + +### Errors + +| Error Type | Status Code | Content Type | +| ---------------------------------- | ---------------------------------- | ---------------------------------- | +| errors.UnauthorizedResponseError | 401 | application/json | +| errors.InternalServerResponseError | 500 | application/json | +| errors.OpenRouterDefaultError | 4XX, 5XX | \*/\* | + +## create + +Create a new guardrail for the authenticated user. [Provisioning key](/docs/guides/overview/auth/provisioning-api-keys) required. + +### Example Usage + + +```typescript +import { OpenRouter } from "@openrouter/sdk"; + +const openRouter = new OpenRouter({ + apiKey: process.env["OPENROUTER_API_KEY"] ?? "", +}); + +async function run() { + const result = await openRouter.guardrails.create({ + name: "My New Guardrail", + }); + + console.log(result); +} + +run(); +``` + +### Standalone function + +The standalone function version of this method: + +```typescript +import { OpenRouterCore } from "@openrouter/sdk/core.js"; +import { guardrailsCreate } from "@openrouter/sdk/funcs/guardrailsCreate.js"; + +// Use `OpenRouterCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const openRouter = new OpenRouterCore({ + apiKey: process.env["OPENROUTER_API_KEY"] ?? "", +}); + +async function run() { + const res = await guardrailsCreate(openRouter, { + name: "My New Guardrail", + }); + if (res.ok) { + const { value: result } = res; + console.log(result); + } else { + console.log("guardrailsCreate failed:", res.error); + } +} + +run(); +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `request` | [operations.CreateGuardrailRequest](../../models/operations/createguardrailrequest.md) | :heavy_check_mark: | The request object to use for the request. | +| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | +| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | +| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | + +### Response + +**Promise\<[operations.CreateGuardrailResponse](../../models/operations/createguardrailresponse.md)\>** + +### Errors + +| Error Type | Status Code | Content Type | +| ---------------------------------- | ---------------------------------- | ---------------------------------- | +| errors.BadRequestResponseError | 400 | application/json | +| errors.UnauthorizedResponseError | 401 | application/json | +| errors.InternalServerResponseError | 500 | application/json | +| errors.OpenRouterDefaultError | 4XX, 5XX | \*/\* | + +## get + +Get a single guardrail by ID. [Provisioning key](/docs/guides/overview/auth/provisioning-api-keys) required. + +### Example Usage + + +```typescript +import { OpenRouter } from "@openrouter/sdk"; + +const openRouter = new OpenRouter({ + apiKey: process.env["OPENROUTER_API_KEY"] ?? "", +}); + +async function run() { + const result = await openRouter.guardrails.get({ + id: "550e8400-e29b-41d4-a716-446655440000", + }); + + console.log(result); +} + +run(); +``` + +### Standalone function + +The standalone function version of this method: + +```typescript +import { OpenRouterCore } from "@openrouter/sdk/core.js"; +import { guardrailsGet } from "@openrouter/sdk/funcs/guardrailsGet.js"; + +// Use `OpenRouterCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const openRouter = new OpenRouterCore({ + apiKey: process.env["OPENROUTER_API_KEY"] ?? "", +}); + +async function run() { + const res = await guardrailsGet(openRouter, { + id: "550e8400-e29b-41d4-a716-446655440000", + }); + if (res.ok) { + const { value: result } = res; + console.log(result); + } else { + console.log("guardrailsGet failed:", res.error); + } +} + +run(); +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `request` | [operations.GetGuardrailRequest](../../models/operations/getguardrailrequest.md) | :heavy_check_mark: | The request object to use for the request. | +| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | +| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | +| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | + +### Response + +**Promise\<[operations.GetGuardrailResponse](../../models/operations/getguardrailresponse.md)\>** + +### Errors + +| Error Type | Status Code | Content Type | +| ---------------------------------- | ---------------------------------- | ---------------------------------- | +| errors.UnauthorizedResponseError | 401 | application/json | +| errors.NotFoundResponseError | 404 | application/json | +| errors.InternalServerResponseError | 500 | application/json | +| errors.OpenRouterDefaultError | 4XX, 5XX | \*/\* | + +## update + +Update an existing guardrail. [Provisioning key](/docs/guides/overview/auth/provisioning-api-keys) required. + +### Example Usage + + +```typescript +import { OpenRouter } from "@openrouter/sdk"; + +const openRouter = new OpenRouter({ + apiKey: process.env["OPENROUTER_API_KEY"] ?? "", +}); + +async function run() { + const result = await openRouter.guardrails.update({ + id: "550e8400-e29b-41d4-a716-446655440000", + requestBody: {}, + }); + + console.log(result); +} + +run(); +``` + +### Standalone function + +The standalone function version of this method: + +```typescript +import { OpenRouterCore } from "@openrouter/sdk/core.js"; +import { guardrailsUpdate } from "@openrouter/sdk/funcs/guardrailsUpdate.js"; + +// Use `OpenRouterCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const openRouter = new OpenRouterCore({ + apiKey: process.env["OPENROUTER_API_KEY"] ?? "", +}); + +async function run() { + const res = await guardrailsUpdate(openRouter, { + id: "550e8400-e29b-41d4-a716-446655440000", + requestBody: {}, + }); + if (res.ok) { + const { value: result } = res; + console.log(result); + } else { + console.log("guardrailsUpdate failed:", res.error); + } +} + +run(); +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `request` | [operations.UpdateGuardrailRequest](../../models/operations/updateguardrailrequest.md) | :heavy_check_mark: | The request object to use for the request. | +| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | +| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | +| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | + +### Response + +**Promise\<[operations.UpdateGuardrailResponse](../../models/operations/updateguardrailresponse.md)\>** + +### Errors + +| Error Type | Status Code | Content Type | +| ---------------------------------- | ---------------------------------- | ---------------------------------- | +| errors.BadRequestResponseError | 400 | application/json | +| errors.UnauthorizedResponseError | 401 | application/json | +| errors.NotFoundResponseError | 404 | application/json | +| errors.InternalServerResponseError | 500 | application/json | +| errors.OpenRouterDefaultError | 4XX, 5XX | \*/\* | + +## delete + +Delete an existing guardrail. [Provisioning key](/docs/guides/overview/auth/provisioning-api-keys) required. + +### Example Usage + + +```typescript +import { OpenRouter } from "@openrouter/sdk"; + +const openRouter = new OpenRouter({ + apiKey: process.env["OPENROUTER_API_KEY"] ?? "", +}); + +async function run() { + const result = await openRouter.guardrails.delete({ + id: "550e8400-e29b-41d4-a716-446655440000", + }); + + console.log(result); +} + +run(); +``` + +### Standalone function + +The standalone function version of this method: + +```typescript +import { OpenRouterCore } from "@openrouter/sdk/core.js"; +import { guardrailsDelete } from "@openrouter/sdk/funcs/guardrailsDelete.js"; + +// Use `OpenRouterCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const openRouter = new OpenRouterCore({ + apiKey: process.env["OPENROUTER_API_KEY"] ?? "", +}); + +async function run() { + const res = await guardrailsDelete(openRouter, { + id: "550e8400-e29b-41d4-a716-446655440000", + }); + if (res.ok) { + const { value: result } = res; + console.log(result); + } else { + console.log("guardrailsDelete failed:", res.error); + } +} + +run(); +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `request` | [operations.DeleteGuardrailRequest](../../models/operations/deleteguardrailrequest.md) | :heavy_check_mark: | The request object to use for the request. | +| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | +| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | +| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | + +### Response + +**Promise\<[operations.DeleteGuardrailResponse](../../models/operations/deleteguardrailresponse.md)\>** + +### Errors + +| Error Type | Status Code | Content Type | +| ---------------------------------- | ---------------------------------- | ---------------------------------- | +| errors.UnauthorizedResponseError | 401 | application/json | +| errors.NotFoundResponseError | 404 | application/json | +| errors.InternalServerResponseError | 500 | application/json | +| errors.OpenRouterDefaultError | 4XX, 5XX | \*/\* | + +## listKeyAssignments + +List all API key guardrail assignments for the authenticated user. [Provisioning key](/docs/guides/overview/auth/provisioning-api-keys) required. + +### Example Usage + + +```typescript +import { OpenRouter } from "@openrouter/sdk"; + +const openRouter = new OpenRouter({ + apiKey: process.env["OPENROUTER_API_KEY"] ?? "", +}); + +async function run() { + const result = await openRouter.guardrails.listKeyAssignments(); + + console.log(result); +} + +run(); +``` + +### Standalone function + +The standalone function version of this method: + +```typescript +import { OpenRouterCore } from "@openrouter/sdk/core.js"; +import { guardrailsListKeyAssignments } from "@openrouter/sdk/funcs/guardrailsListKeyAssignments.js"; + +// Use `OpenRouterCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const openRouter = new OpenRouterCore({ + apiKey: process.env["OPENROUTER_API_KEY"] ?? "", +}); + +async function run() { + const res = await guardrailsListKeyAssignments(openRouter); + if (res.ok) { + const { value: result } = res; + console.log(result); + } else { + console.log("guardrailsListKeyAssignments failed:", res.error); + } +} + +run(); +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `request` | [operations.ListKeyAssignmentsRequest](../../models/operations/listkeyassignmentsrequest.md) | :heavy_check_mark: | The request object to use for the request. | +| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | +| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | +| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | + +### Response + +**Promise\<[operations.ListKeyAssignmentsResponse](../../models/operations/listkeyassignmentsresponse.md)\>** + +### Errors + +| Error Type | Status Code | Content Type | +| ---------------------------------- | ---------------------------------- | ---------------------------------- | +| errors.UnauthorizedResponseError | 401 | application/json | +| errors.InternalServerResponseError | 500 | application/json | +| errors.OpenRouterDefaultError | 4XX, 5XX | \*/\* | + +## listMemberAssignments + +List all organization member guardrail assignments for the authenticated user. [Provisioning key](/docs/guides/overview/auth/provisioning-api-keys) required. + +### Example Usage + + +```typescript +import { OpenRouter } from "@openrouter/sdk"; + +const openRouter = new OpenRouter({ + apiKey: process.env["OPENROUTER_API_KEY"] ?? "", +}); + +async function run() { + const result = await openRouter.guardrails.listMemberAssignments(); + + console.log(result); +} + +run(); +``` + +### Standalone function + +The standalone function version of this method: + +```typescript +import { OpenRouterCore } from "@openrouter/sdk/core.js"; +import { guardrailsListMemberAssignments } from "@openrouter/sdk/funcs/guardrailsListMemberAssignments.js"; + +// Use `OpenRouterCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const openRouter = new OpenRouterCore({ + apiKey: process.env["OPENROUTER_API_KEY"] ?? "", +}); + +async function run() { + const res = await guardrailsListMemberAssignments(openRouter); + if (res.ok) { + const { value: result } = res; + console.log(result); + } else { + console.log("guardrailsListMemberAssignments failed:", res.error); + } +} + +run(); +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `request` | [operations.ListMemberAssignmentsRequest](../../models/operations/listmemberassignmentsrequest.md) | :heavy_check_mark: | The request object to use for the request. | +| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | +| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | +| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | + +### Response + +**Promise\<[operations.ListMemberAssignmentsResponse](../../models/operations/listmemberassignmentsresponse.md)\>** + +### Errors + +| Error Type | Status Code | Content Type | +| ---------------------------------- | ---------------------------------- | ---------------------------------- | +| errors.UnauthorizedResponseError | 401 | application/json | +| errors.InternalServerResponseError | 500 | application/json | +| errors.OpenRouterDefaultError | 4XX, 5XX | \*/\* | + +## listGuardrailKeyAssignments + +List all API key assignments for a specific guardrail. [Provisioning key](/docs/guides/overview/auth/provisioning-api-keys) required. + +### Example Usage + + +```typescript +import { OpenRouter } from "@openrouter/sdk"; + +const openRouter = new OpenRouter({ + apiKey: process.env["OPENROUTER_API_KEY"] ?? "", +}); + +async function run() { + const result = await openRouter.guardrails.listGuardrailKeyAssignments({ + id: "550e8400-e29b-41d4-a716-446655440000", + }); + + console.log(result); +} + +run(); +``` + +### Standalone function + +The standalone function version of this method: + +```typescript +import { OpenRouterCore } from "@openrouter/sdk/core.js"; +import { guardrailsListGuardrailKeyAssignments } from "@openrouter/sdk/funcs/guardrailsListGuardrailKeyAssignments.js"; + +// Use `OpenRouterCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const openRouter = new OpenRouterCore({ + apiKey: process.env["OPENROUTER_API_KEY"] ?? "", +}); + +async function run() { + const res = await guardrailsListGuardrailKeyAssignments(openRouter, { + id: "550e8400-e29b-41d4-a716-446655440000", + }); + if (res.ok) { + const { value: result } = res; + console.log(result); + } else { + console.log("guardrailsListGuardrailKeyAssignments failed:", res.error); + } +} + +run(); +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `request` | [operations.ListGuardrailKeyAssignmentsRequest](../../models/operations/listguardrailkeyassignmentsrequest.md) | :heavy_check_mark: | The request object to use for the request. | +| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | +| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | +| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | + +### Response + +**Promise\<[operations.ListGuardrailKeyAssignmentsResponse](../../models/operations/listguardrailkeyassignmentsresponse.md)\>** + +### Errors + +| Error Type | Status Code | Content Type | +| ---------------------------------- | ---------------------------------- | ---------------------------------- | +| errors.UnauthorizedResponseError | 401 | application/json | +| errors.NotFoundResponseError | 404 | application/json | +| errors.InternalServerResponseError | 500 | application/json | +| errors.OpenRouterDefaultError | 4XX, 5XX | \*/\* | + +## bulkAssignKeys + +Assign multiple API keys to a specific guardrail. [Provisioning key](/docs/guides/overview/auth/provisioning-api-keys) required. + +### Example Usage + + +```typescript +import { OpenRouter } from "@openrouter/sdk"; + +const openRouter = new OpenRouter({ + apiKey: process.env["OPENROUTER_API_KEY"] ?? "", +}); + +async function run() { + const result = await openRouter.guardrails.bulkAssignKeys({ + id: "550e8400-e29b-41d4-a716-446655440000", + requestBody: { + keyHashes: [ + "c56454edb818d6b14bc0d61c46025f1450b0f4012d12304ab40aacb519fcbc93", + ], + }, + }); + + console.log(result); +} + +run(); +``` + +### Standalone function + +The standalone function version of this method: + +```typescript +import { OpenRouterCore } from "@openrouter/sdk/core.js"; +import { guardrailsBulkAssignKeys } from "@openrouter/sdk/funcs/guardrailsBulkAssignKeys.js"; + +// Use `OpenRouterCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const openRouter = new OpenRouterCore({ + apiKey: process.env["OPENROUTER_API_KEY"] ?? "", +}); + +async function run() { + const res = await guardrailsBulkAssignKeys(openRouter, { + id: "550e8400-e29b-41d4-a716-446655440000", + requestBody: { + keyHashes: [ + "c56454edb818d6b14bc0d61c46025f1450b0f4012d12304ab40aacb519fcbc93", + ], + }, + }); + if (res.ok) { + const { value: result } = res; + console.log(result); + } else { + console.log("guardrailsBulkAssignKeys failed:", res.error); + } +} + +run(); +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `request` | [operations.BulkAssignKeysToGuardrailRequest](../../models/operations/bulkassignkeystoguardrailrequest.md) | :heavy_check_mark: | The request object to use for the request. | +| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | +| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | +| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | + +### Response + +**Promise\<[operations.BulkAssignKeysToGuardrailResponse](../../models/operations/bulkassignkeystoguardrailresponse.md)\>** + +### Errors + +| Error Type | Status Code | Content Type | +| ---------------------------------- | ---------------------------------- | ---------------------------------- | +| errors.BadRequestResponseError | 400 | application/json | +| errors.UnauthorizedResponseError | 401 | application/json | +| errors.NotFoundResponseError | 404 | application/json | +| errors.InternalServerResponseError | 500 | application/json | +| errors.OpenRouterDefaultError | 4XX, 5XX | \*/\* | + +## listGuardrailMemberAssignments + +List all organization member assignments for a specific guardrail. [Provisioning key](/docs/guides/overview/auth/provisioning-api-keys) required. + +### Example Usage + + +```typescript +import { OpenRouter } from "@openrouter/sdk"; + +const openRouter = new OpenRouter({ + apiKey: process.env["OPENROUTER_API_KEY"] ?? "", +}); + +async function run() { + const result = await openRouter.guardrails.listGuardrailMemberAssignments({ + id: "550e8400-e29b-41d4-a716-446655440000", + }); + + console.log(result); +} + +run(); +``` + +### Standalone function + +The standalone function version of this method: + +```typescript +import { OpenRouterCore } from "@openrouter/sdk/core.js"; +import { guardrailsListGuardrailMemberAssignments } from "@openrouter/sdk/funcs/guardrailsListGuardrailMemberAssignments.js"; + +// Use `OpenRouterCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const openRouter = new OpenRouterCore({ + apiKey: process.env["OPENROUTER_API_KEY"] ?? "", +}); + +async function run() { + const res = await guardrailsListGuardrailMemberAssignments(openRouter, { + id: "550e8400-e29b-41d4-a716-446655440000", + }); + if (res.ok) { + const { value: result } = res; + console.log(result); + } else { + console.log("guardrailsListGuardrailMemberAssignments failed:", res.error); + } +} + +run(); +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `request` | [operations.ListGuardrailMemberAssignmentsRequest](../../models/operations/listguardrailmemberassignmentsrequest.md) | :heavy_check_mark: | The request object to use for the request. | +| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | +| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | +| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | + +### Response + +**Promise\<[operations.ListGuardrailMemberAssignmentsResponse](../../models/operations/listguardrailmemberassignmentsresponse.md)\>** + +### Errors + +| Error Type | Status Code | Content Type | +| ---------------------------------- | ---------------------------------- | ---------------------------------- | +| errors.UnauthorizedResponseError | 401 | application/json | +| errors.NotFoundResponseError | 404 | application/json | +| errors.InternalServerResponseError | 500 | application/json | +| errors.OpenRouterDefaultError | 4XX, 5XX | \*/\* | + +## bulkAssignMembers + +Assign multiple organization members to a specific guardrail. [Provisioning key](/docs/guides/overview/auth/provisioning-api-keys) required. + +### Example Usage + + +```typescript +import { OpenRouter } from "@openrouter/sdk"; + +const openRouter = new OpenRouter({ + apiKey: process.env["OPENROUTER_API_KEY"] ?? "", +}); + +async function run() { + const result = await openRouter.guardrails.bulkAssignMembers({ + id: "550e8400-e29b-41d4-a716-446655440000", + requestBody: { + memberUserIds: [ + "user_abc123", + "user_def456", + ], + }, + }); + + console.log(result); +} + +run(); +``` + +### Standalone function + +The standalone function version of this method: + +```typescript +import { OpenRouterCore } from "@openrouter/sdk/core.js"; +import { guardrailsBulkAssignMembers } from "@openrouter/sdk/funcs/guardrailsBulkAssignMembers.js"; + +// Use `OpenRouterCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const openRouter = new OpenRouterCore({ + apiKey: process.env["OPENROUTER_API_KEY"] ?? "", +}); + +async function run() { + const res = await guardrailsBulkAssignMembers(openRouter, { + id: "550e8400-e29b-41d4-a716-446655440000", + requestBody: { + memberUserIds: [ + "user_abc123", + "user_def456", + ], + }, + }); + if (res.ok) { + const { value: result } = res; + console.log(result); + } else { + console.log("guardrailsBulkAssignMembers failed:", res.error); + } +} + +run(); +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `request` | [operations.BulkAssignMembersToGuardrailRequest](../../models/operations/bulkassignmemberstoguardrailrequest.md) | :heavy_check_mark: | The request object to use for the request. | +| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | +| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | +| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | + +### Response + +**Promise\<[operations.BulkAssignMembersToGuardrailResponse](../../models/operations/bulkassignmemberstoguardrailresponse.md)\>** + +### Errors + +| Error Type | Status Code | Content Type | +| ---------------------------------- | ---------------------------------- | ---------------------------------- | +| errors.BadRequestResponseError | 400 | application/json | +| errors.UnauthorizedResponseError | 401 | application/json | +| errors.NotFoundResponseError | 404 | application/json | +| errors.InternalServerResponseError | 500 | application/json | +| errors.OpenRouterDefaultError | 4XX, 5XX | \*/\* | + +## bulkUnassignKeys + +Unassign multiple API keys from a specific guardrail. [Provisioning key](/docs/guides/overview/auth/provisioning-api-keys) required. + +### Example Usage + + +```typescript +import { OpenRouter } from "@openrouter/sdk"; + +const openRouter = new OpenRouter({ + apiKey: process.env["OPENROUTER_API_KEY"] ?? "", +}); + +async function run() { + const result = await openRouter.guardrails.bulkUnassignKeys({ + id: "550e8400-e29b-41d4-a716-446655440000", + requestBody: { + keyHashes: [ + "c56454edb818d6b14bc0d61c46025f1450b0f4012d12304ab40aacb519fcbc93", + ], + }, + }); + + console.log(result); +} + +run(); +``` + +### Standalone function + +The standalone function version of this method: + +```typescript +import { OpenRouterCore } from "@openrouter/sdk/core.js"; +import { guardrailsBulkUnassignKeys } from "@openrouter/sdk/funcs/guardrailsBulkUnassignKeys.js"; + +// Use `OpenRouterCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const openRouter = new OpenRouterCore({ + apiKey: process.env["OPENROUTER_API_KEY"] ?? "", +}); + +async function run() { + const res = await guardrailsBulkUnassignKeys(openRouter, { + id: "550e8400-e29b-41d4-a716-446655440000", + requestBody: { + keyHashes: [ + "c56454edb818d6b14bc0d61c46025f1450b0f4012d12304ab40aacb519fcbc93", + ], + }, + }); + if (res.ok) { + const { value: result } = res; + console.log(result); + } else { + console.log("guardrailsBulkUnassignKeys failed:", res.error); + } +} + +run(); +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `request` | [operations.BulkUnassignKeysFromGuardrailRequest](../../models/operations/bulkunassignkeysfromguardrailrequest.md) | :heavy_check_mark: | The request object to use for the request. | +| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | +| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | +| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | + +### Response + +**Promise\<[operations.BulkUnassignKeysFromGuardrailResponse](../../models/operations/bulkunassignkeysfromguardrailresponse.md)\>** + +### Errors + +| Error Type | Status Code | Content Type | +| ---------------------------------- | ---------------------------------- | ---------------------------------- | +| errors.BadRequestResponseError | 400 | application/json | +| errors.UnauthorizedResponseError | 401 | application/json | +| errors.NotFoundResponseError | 404 | application/json | +| errors.InternalServerResponseError | 500 | application/json | +| errors.OpenRouterDefaultError | 4XX, 5XX | \*/\* | + +## bulkUnassignMembers + +Unassign multiple organization members from a specific guardrail. [Provisioning key](/docs/guides/overview/auth/provisioning-api-keys) required. + +### Example Usage + + +```typescript +import { OpenRouter } from "@openrouter/sdk"; + +const openRouter = new OpenRouter({ + apiKey: process.env["OPENROUTER_API_KEY"] ?? "", +}); + +async function run() { + const result = await openRouter.guardrails.bulkUnassignMembers({ + id: "550e8400-e29b-41d4-a716-446655440000", + requestBody: { + memberUserIds: [ + "user_abc123", + "user_def456", + ], + }, + }); + + console.log(result); +} + +run(); +``` + +### Standalone function + +The standalone function version of this method: + +```typescript +import { OpenRouterCore } from "@openrouter/sdk/core.js"; +import { guardrailsBulkUnassignMembers } from "@openrouter/sdk/funcs/guardrailsBulkUnassignMembers.js"; + +// Use `OpenRouterCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const openRouter = new OpenRouterCore({ + apiKey: process.env["OPENROUTER_API_KEY"] ?? "", +}); + +async function run() { + const res = await guardrailsBulkUnassignMembers(openRouter, { + id: "550e8400-e29b-41d4-a716-446655440000", + requestBody: { + memberUserIds: [ + "user_abc123", + "user_def456", + ], + }, + }); + if (res.ok) { + const { value: result } = res; + console.log(result); + } else { + console.log("guardrailsBulkUnassignMembers failed:", res.error); + } +} + +run(); +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `request` | [operations.BulkUnassignMembersFromGuardrailRequest](../../models/operations/bulkunassignmembersfromguardrailrequest.md) | :heavy_check_mark: | The request object to use for the request. | +| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | +| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | +| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | + +### Response + +**Promise\<[operations.BulkUnassignMembersFromGuardrailResponse](../../models/operations/bulkunassignmembersfromguardrailresponse.md)\>** + +### Errors + +| Error Type | Status Code | Content Type | +| ---------------------------------- | ---------------------------------- | ---------------------------------- | +| errors.BadRequestResponseError | 400 | application/json | +| errors.UnauthorizedResponseError | 401 | application/json | +| errors.NotFoundResponseError | 404 | application/json | +| errors.InternalServerResponseError | 500 | application/json | +| errors.OpenRouterDefaultError | 4XX, 5XX | \*/\* | \ No newline at end of file diff --git a/docs/sdks/parameters/README.md b/docs/sdks/parameters/README.md deleted file mode 100644 index 305bad6c..00000000 --- a/docs/sdks/parameters/README.md +++ /dev/null @@ -1,90 +0,0 @@ -# Parameters - -## Overview - -Parameters endpoints - -### Available Operations - -* [getParameters](#getparameters) - Get a model's supported parameters and data about which are most popular - -## getParameters - -Get a model's supported parameters and data about which are most popular - -### Example Usage - - -```typescript -import { OpenRouter } from "@openrouter/sdk"; - -const openRouter = new OpenRouter(); - -async function run() { - const result = await openRouter.parameters.getParameters({ - bearer: process.env["OPENROUTER_BEARER"] ?? "", - }, { - author: "", - slug: "", - provider: "Google AI Studio", - }); - - console.log(result); -} - -run(); -``` - -### Standalone function - -The standalone function version of this method: - -```typescript -import { OpenRouterCore } from "@openrouter/sdk/core.js"; -import { parametersGetParameters } from "@openrouter/sdk/funcs/parametersGetParameters.js"; - -// Use `OpenRouterCore` for best tree-shaking performance. -// You can create one instance of it to use across an application. -const openRouter = new OpenRouterCore(); - -async function run() { - const res = await parametersGetParameters(openRouter, { - bearer: process.env["OPENROUTER_BEARER"] ?? "", - }, { - author: "", - slug: "", - provider: "Google AI Studio", - }); - if (res.ok) { - const { value: result } = res; - console.log(result); - } else { - console.log("parametersGetParameters failed:", res.error); - } -} - -run(); -``` - -### Parameters - -| Parameter | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -| `request` | [operations.GetParametersRequest](../../models/operations/getparametersrequest.md) | :heavy_check_mark: | The request object to use for the request. | -| `security` | [operations.GetParametersSecurity](../../models/operations/getparameterssecurity.md) | :heavy_check_mark: | The security requirements to use for the request. | -| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | -| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | -| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | - -### Response - -**Promise\<[operations.GetParametersResponse](../../models/operations/getparametersresponse.md)\>** - -### Errors - -| Error Type | Status Code | Content Type | -| ---------------------------------- | ---------------------------------- | ---------------------------------- | -| errors.UnauthorizedResponseError | 401 | application/json | -| errors.NotFoundResponseError | 404 | application/json | -| errors.InternalServerResponseError | 500 | application/json | -| errors.OpenRouterDefaultError | 4XX, 5XX | \*/\* | \ No newline at end of file diff --git a/jsr.json b/jsr.json index afc76450..0d3a82c7 100644 --- a/jsr.json +++ b/jsr.json @@ -2,7 +2,7 @@ { "name": "@openrouter/sdk", - "version": "0.3.14", + "version": "0.3.15", "exports": { ".": "./src/index.ts", "./models/errors": "./src/models/errors/index.ts", diff --git a/package.json b/package.json index 441a5133..3228aa13 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@openrouter/sdk", - "version": "0.3.14", + "version": "0.3.15", "author": "OpenRouter", "description": "The OpenRouter TypeScript SDK is a type-safe toolkit for building AI applications with access to 300+ language models through a unified API.", "keywords": [ @@ -64,15 +64,17 @@ "type": "git", "url": "https://github.com/OpenRouterTeam/typescript-sdk.git" }, - "scripts": { - "lint": "eslint --cache --max-warnings=0 src", - "build": "tsc", - "typecheck": "tsc --noEmit", - "prepublishOnly": "npm run build", - "test": "vitest --run --project unit", - "test:e2e": "vitest --run --project e2e", - "test:watch": "vitest --watch --project unit" - }, + "scripts": { + "lint": "eslint --cache --max-warnings=0 src", + "build": "tsc", + "typecheck": "tsc --noEmit", + "prepublishOnly": "npm run build", + "postinstall": "node scripts/check-types.js || true", + "test": "vitest --run --project unit", + "test:e2e": "vitest --run --project e2e", + "test:watch": "vitest --watch --project unit" + }, + "peerDependencies": {}, "devDependencies": { "@eslint/js": "^9.19.0", "@types/node": "^22.13.12", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 47fffc88..10c27fb5 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -10,7 +10,7 @@ importers: dependencies: zod: specifier: ^3.25.0 || ^4.0.0 - version: 4.3.5 + version: 4.2.1 devDependencies: '@eslint/js': specifier: ^9.19.0 @@ -1049,8 +1049,8 @@ packages: resolution: {integrity: sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q==} engines: {node: '>=10'} - zod@4.3.5: - resolution: {integrity: sha512-k7Nwx6vuWx1IJ9Bjuf4Zt1PEllcwe7cls3VNzm4CQ1/hgtFUK2bRNG3rvnpPUhFjmqJKAKtjV576KnUkHocg/g==} + zod@4.2.1: + resolution: {integrity: sha512-0wZ1IRqGGhMP76gLqz8EyfBXKk0J2qo2+H3fi4mcUP/KtTocoX08nmIAHl1Z2kJIZbZee8KOpBCSNPRgauucjw==} snapshots: @@ -1981,4 +1981,4 @@ snapshots: yocto-queue@0.1.0: {} - zod@4.3.5: {} + zod@4.2.1: {} diff --git a/scripts/check-types.js b/scripts/check-types.js new file mode 100644 index 00000000..7190ebd1 --- /dev/null +++ b/scripts/check-types.js @@ -0,0 +1,127 @@ +#!/usr/bin/env node +/** + * Postinstall script to check if model types are stale. + * Similar to update-browserslist-db, this warns users when their + * generated types are outdated. + * + * This script: + * 1. Reads the MODEL_HASH from the generated types file + * 2. Fetches current models from the OpenRouter API + * 3. Computes a hash of the current models + * 4. Warns to stderr if the hashes don't match + * + * Exit codes: + * - 0: Types are up to date OR check was skipped + * - Does NOT fail on stale types (to avoid breaking installs) + */ + +import { createHash } from 'node:crypto'; +import { readFile } from 'node:fs/promises'; +import { fileURLToPath } from 'node:url'; +import { dirname, resolve } from 'node:path'; + +const __filename = fileURLToPath(import.meta.url); +const __dirname = dirname(__filename); + +const TYPES_FILE_PATH = resolve(__dirname, '../src/types/models.ts'); +const API_URL = 'https://openrouter.ai/api/v1/models'; +const TIMEOUT_MS = 5000; + +/** + * Type guard for Node.js errors with error codes + * @param {unknown} error + * @returns {error is NodeJS.ErrnoException} + */ +function isNodeError(error) { + return error instanceof Error && 'code' in error; +} + +/** + * Compute SHA-256 hash of sorted model IDs (first 16 chars) + * @param {string[]} modelIds + * @returns {string} + */ +function computeHash(modelIds) { + const sorted = [...modelIds].sort(); + const content = sorted.join('\n'); + const hash = createHash('sha256').update(content).digest('hex'); + return hash.substring(0, 16); +} + +/** + * Extract MODEL_HASH from types file content + * @param {string} content + * @returns {string | null} + */ +function extractHash(content) { + const match = content.match(/export const MODEL_HASH = '([a-f0-9]+)'/); + return match ? match[1] : null; +} + +/** + * Fetch models from API with timeout + * @returns {Promise} + */ +async function fetchModels() { + const controller = new AbortController(); + const timeout = setTimeout(() => controller.abort(), TIMEOUT_MS); + + try { + const response = await fetch(API_URL, { signal: controller.signal }); + if (!response.ok) { + throw new Error(`HTTP ${response.status}`); + } + const data = await response.json(); + if (!data?.data || !Array.isArray(data.data)) { + throw new Error('Invalid API response structure'); + } + return data.data.map((m) => m.id); + } finally { + clearTimeout(timeout); + } +} + +async function main() { + if (process.env.CI) { + return; + } + + if (process.env.OPENROUTER_SKIP_TYPE_CHECK) { + return; + } + + try { + /** @type {string | null} */ + let existingHash; + try { + const content = await readFile(TYPES_FILE_PATH, 'utf-8'); + existingHash = extractHash(content); + } catch (error) { + if (isNodeError(error) && error.code === 'ENOENT') { + return; + } + throw error; + } + + if (!existingHash) { + return; + } + + const modelIds = await fetchModels(); + const currentHash = computeHash(modelIds); + + if (existingHash !== currentHash) { + process.stderr.write( + '\n' + + '\x1b[33m' + + 'OpenRouter model types are outdated.\n' + + 'Run: npx @openrouter/cli types\n' + + '\x1b[0m', + ); + } + } catch { + // Silently ignore errors - we don't want to break installs + } +} + +main(); diff --git a/src/funcs/analyticsGetUserActivity.ts b/src/funcs/analyticsGetUserActivity.ts index 4768169a..6a1d0231 100644 --- a/src/funcs/analyticsGetUserActivity.ts +++ b/src/funcs/analyticsGetUserActivity.ts @@ -30,7 +30,7 @@ import { Result } from "../types/fp.js"; * Get user activity grouped by endpoint * * @remarks - * Returns user activity data grouped by endpoint for the last 30 (completed) UTC days + * Returns user activity data grouped by endpoint for the last 30 (completed) UTC days. [Provisioning key](/docs/guides/overview/auth/provisioning-api-keys) required. */ export function analyticsGetUserActivity( client: OpenRouterCore, diff --git a/src/funcs/apiKeysCreate.ts b/src/funcs/apiKeysCreate.ts index 2f05162d..a35ebc9e 100644 --- a/src/funcs/apiKeysCreate.ts +++ b/src/funcs/apiKeysCreate.ts @@ -28,6 +28,9 @@ import { Result } from "../types/fp.js"; /** * Create a new API key + * + * @remarks + * Create a new API key for the authenticated user. [Provisioning key](/docs/guides/overview/auth/provisioning-api-keys) required. */ export function apiKeysCreate( client: OpenRouterCore, diff --git a/src/funcs/apiKeysDelete.ts b/src/funcs/apiKeysDelete.ts index b365c6d4..c7ca0a5a 100644 --- a/src/funcs/apiKeysDelete.ts +++ b/src/funcs/apiKeysDelete.ts @@ -28,6 +28,9 @@ import { Result } from "../types/fp.js"; /** * Delete an API key + * + * @remarks + * Delete an existing API key. [Provisioning key](/docs/guides/overview/auth/provisioning-api-keys) required. */ export function apiKeysDelete( client: OpenRouterCore, diff --git a/src/funcs/apiKeysGet.ts b/src/funcs/apiKeysGet.ts index f1799990..f91160ce 100644 --- a/src/funcs/apiKeysGet.ts +++ b/src/funcs/apiKeysGet.ts @@ -28,6 +28,9 @@ import { Result } from "../types/fp.js"; /** * Get a single API key + * + * @remarks + * Get a single API key by hash. [Provisioning key](/docs/guides/overview/auth/provisioning-api-keys) required. */ export function apiKeysGet( client: OpenRouterCore, diff --git a/src/funcs/apiKeysList.ts b/src/funcs/apiKeysList.ts index cdce4460..54263571 100644 --- a/src/funcs/apiKeysList.ts +++ b/src/funcs/apiKeysList.ts @@ -28,6 +28,9 @@ import { Result } from "../types/fp.js"; /** * List API keys + * + * @remarks + * List all API keys for the authenticated user. [Provisioning key](/docs/guides/overview/auth/provisioning-api-keys) required. */ export function apiKeysList( client: OpenRouterCore, diff --git a/src/funcs/apiKeysUpdate.ts b/src/funcs/apiKeysUpdate.ts index b41d43b0..9851cbf5 100644 --- a/src/funcs/apiKeysUpdate.ts +++ b/src/funcs/apiKeysUpdate.ts @@ -28,6 +28,9 @@ import { Result } from "../types/fp.js"; /** * Update an API key + * + * @remarks + * Update an existing API key. [Provisioning key](/docs/guides/overview/auth/provisioning-api-keys) required. */ export function apiKeysUpdate( client: OpenRouterCore, diff --git a/src/funcs/creditsGetCredits.ts b/src/funcs/creditsGetCredits.ts index 63149dce..e3e94446 100644 --- a/src/funcs/creditsGetCredits.ts +++ b/src/funcs/creditsGetCredits.ts @@ -28,7 +28,7 @@ import { Result } from "../types/fp.js"; * Get remaining credits * * @remarks - * Get total credits purchased and used for the authenticated user + * Get total credits purchased and used for the authenticated user. [Provisioning key](/docs/guides/overview/auth/provisioning-api-keys) required. */ export function creditsGetCredits( client: OpenRouterCore, diff --git a/src/funcs/guardrailsBulkAssignKeys.ts b/src/funcs/guardrailsBulkAssignKeys.ts new file mode 100644 index 00000000..349ed424 --- /dev/null +++ b/src/funcs/guardrailsBulkAssignKeys.ts @@ -0,0 +1,190 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + * @generated-id: 76294a9da792 + */ + +import { OpenRouterCore } from "../core.js"; +import { encodeJSON, encodeSimple } from "../lib/encodings.js"; +import * as M from "../lib/matchers.js"; +import { compactMap } from "../lib/primitives.js"; +import { safeParse } from "../lib/schemas.js"; +import { RequestOptions } from "../lib/sdks.js"; +import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js"; +import { pathToFunc } from "../lib/url.js"; +import { + ConnectionError, + InvalidRequestError, + RequestAbortedError, + RequestTimeoutError, + UnexpectedClientError, +} from "../models/errors/httpclienterrors.js"; +import * as errors from "../models/errors/index.js"; +import { OpenRouterError } from "../models/errors/openroutererror.js"; +import { ResponseValidationError } from "../models/errors/responsevalidationerror.js"; +import { SDKValidationError } from "../models/errors/sdkvalidationerror.js"; +import * as operations from "../models/operations/index.js"; +import { APICall, APIPromise } from "../types/async.js"; +import { Result } from "../types/fp.js"; + +/** + * Bulk assign keys to a guardrail + * + * @remarks + * Assign multiple API keys to a specific guardrail. [Provisioning key](/docs/guides/overview/auth/provisioning-api-keys) required. + */ +export function guardrailsBulkAssignKeys( + client: OpenRouterCore, + request: operations.BulkAssignKeysToGuardrailRequest, + options?: RequestOptions, +): APIPromise< + Result< + operations.BulkAssignKeysToGuardrailResponse, + | errors.BadRequestResponseError + | errors.UnauthorizedResponseError + | errors.NotFoundResponseError + | errors.InternalServerResponseError + | OpenRouterError + | ResponseValidationError + | ConnectionError + | RequestAbortedError + | RequestTimeoutError + | InvalidRequestError + | UnexpectedClientError + | SDKValidationError + > +> { + return new APIPromise($do( + client, + request, + options, + )); +} + +async function $do( + client: OpenRouterCore, + request: operations.BulkAssignKeysToGuardrailRequest, + options?: RequestOptions, +): Promise< + [ + Result< + operations.BulkAssignKeysToGuardrailResponse, + | errors.BadRequestResponseError + | errors.UnauthorizedResponseError + | errors.NotFoundResponseError + | errors.InternalServerResponseError + | OpenRouterError + | ResponseValidationError + | ConnectionError + | RequestAbortedError + | RequestTimeoutError + | InvalidRequestError + | UnexpectedClientError + | SDKValidationError + >, + APICall, + ] +> { + const parsed = safeParse( + request, + (value) => + operations.BulkAssignKeysToGuardrailRequest$outboundSchema.parse(value), + "Input validation failed", + ); + if (!parsed.ok) { + return [parsed, { status: "invalid" }]; + } + const payload = parsed.value; + const body = encodeJSON("body", payload.RequestBody, { explode: true }); + + const pathParams = { + id: encodeSimple("id", payload.id, { + explode: false, + charEncoding: "percent", + }), + }; + + const path = pathToFunc("/guardrails/{id}/assignments/keys")(pathParams); + + const headers = new Headers(compactMap({ + "Content-Type": "application/json", + Accept: "application/json", + })); + + const secConfig = await extractSecurity(client._options.apiKey); + const securityInput = secConfig == null ? {} : { apiKey: secConfig }; + const requestSecurity = resolveGlobalSecurity(securityInput); + + const context = { + options: client._options, + baseURL: options?.serverURL ?? client._baseURL ?? "", + operationID: "bulkAssignKeysToGuardrail", + oAuth2Scopes: null, + + resolvedSecurity: requestSecurity, + + securitySource: client._options.apiKey, + retryConfig: options?.retries + || client._options.retryConfig + || { strategy: "none" }, + retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"], + }; + + const requestRes = client._createRequest(context, { + security: requestSecurity, + method: "POST", + baseURL: options?.serverURL, + path: path, + headers: headers, + body: body, + userAgent: client._options.userAgent, + timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1, + }, options); + if (!requestRes.ok) { + return [requestRes, { status: "invalid" }]; + } + const req = requestRes.value; + + const doResult = await client._do(req, { + context, + errorCodes: ["400", "401", "404", "4XX", "500", "5XX"], + retryConfig: context.retryConfig, + retryCodes: context.retryCodes, + }); + if (!doResult.ok) { + return [doResult, { status: "request-error", request: req }]; + } + const response = doResult.value; + + const responseFields = { + HttpMeta: { Response: response, Request: req }, + }; + + const [result] = await M.match< + operations.BulkAssignKeysToGuardrailResponse, + | errors.BadRequestResponseError + | errors.UnauthorizedResponseError + | errors.NotFoundResponseError + | errors.InternalServerResponseError + | OpenRouterError + | ResponseValidationError + | ConnectionError + | RequestAbortedError + | RequestTimeoutError + | InvalidRequestError + | UnexpectedClientError + | SDKValidationError + >( + M.json(200, operations.BulkAssignKeysToGuardrailResponse$inboundSchema), + M.jsonErr(400, errors.BadRequestResponseError$inboundSchema), + M.jsonErr(401, errors.UnauthorizedResponseError$inboundSchema), + M.jsonErr(404, errors.NotFoundResponseError$inboundSchema), + M.jsonErr(500, errors.InternalServerResponseError$inboundSchema), + M.fail("4XX"), + M.fail("5XX"), + )(response, req, { extraFields: responseFields }); + if (!result.ok) { + return [result, { status: "complete", request: req, response }]; + } + + return [result, { status: "complete", request: req, response }]; +} diff --git a/src/funcs/guardrailsBulkAssignMembers.ts b/src/funcs/guardrailsBulkAssignMembers.ts new file mode 100644 index 00000000..671a8361 --- /dev/null +++ b/src/funcs/guardrailsBulkAssignMembers.ts @@ -0,0 +1,192 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + * @generated-id: 64be234e5295 + */ + +import { OpenRouterCore } from "../core.js"; +import { encodeJSON, encodeSimple } from "../lib/encodings.js"; +import * as M from "../lib/matchers.js"; +import { compactMap } from "../lib/primitives.js"; +import { safeParse } from "../lib/schemas.js"; +import { RequestOptions } from "../lib/sdks.js"; +import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js"; +import { pathToFunc } from "../lib/url.js"; +import { + ConnectionError, + InvalidRequestError, + RequestAbortedError, + RequestTimeoutError, + UnexpectedClientError, +} from "../models/errors/httpclienterrors.js"; +import * as errors from "../models/errors/index.js"; +import { OpenRouterError } from "../models/errors/openroutererror.js"; +import { ResponseValidationError } from "../models/errors/responsevalidationerror.js"; +import { SDKValidationError } from "../models/errors/sdkvalidationerror.js"; +import * as operations from "../models/operations/index.js"; +import { APICall, APIPromise } from "../types/async.js"; +import { Result } from "../types/fp.js"; + +/** + * Bulk assign members to a guardrail + * + * @remarks + * Assign multiple organization members to a specific guardrail. [Provisioning key](/docs/guides/overview/auth/provisioning-api-keys) required. + */ +export function guardrailsBulkAssignMembers( + client: OpenRouterCore, + request: operations.BulkAssignMembersToGuardrailRequest, + options?: RequestOptions, +): APIPromise< + Result< + operations.BulkAssignMembersToGuardrailResponse, + | errors.BadRequestResponseError + | errors.UnauthorizedResponseError + | errors.NotFoundResponseError + | errors.InternalServerResponseError + | OpenRouterError + | ResponseValidationError + | ConnectionError + | RequestAbortedError + | RequestTimeoutError + | InvalidRequestError + | UnexpectedClientError + | SDKValidationError + > +> { + return new APIPromise($do( + client, + request, + options, + )); +} + +async function $do( + client: OpenRouterCore, + request: operations.BulkAssignMembersToGuardrailRequest, + options?: RequestOptions, +): Promise< + [ + Result< + operations.BulkAssignMembersToGuardrailResponse, + | errors.BadRequestResponseError + | errors.UnauthorizedResponseError + | errors.NotFoundResponseError + | errors.InternalServerResponseError + | OpenRouterError + | ResponseValidationError + | ConnectionError + | RequestAbortedError + | RequestTimeoutError + | InvalidRequestError + | UnexpectedClientError + | SDKValidationError + >, + APICall, + ] +> { + const parsed = safeParse( + request, + (value) => + operations.BulkAssignMembersToGuardrailRequest$outboundSchema.parse( + value, + ), + "Input validation failed", + ); + if (!parsed.ok) { + return [parsed, { status: "invalid" }]; + } + const payload = parsed.value; + const body = encodeJSON("body", payload.RequestBody, { explode: true }); + + const pathParams = { + id: encodeSimple("id", payload.id, { + explode: false, + charEncoding: "percent", + }), + }; + + const path = pathToFunc("/guardrails/{id}/assignments/members")(pathParams); + + const headers = new Headers(compactMap({ + "Content-Type": "application/json", + Accept: "application/json", + })); + + const secConfig = await extractSecurity(client._options.apiKey); + const securityInput = secConfig == null ? {} : { apiKey: secConfig }; + const requestSecurity = resolveGlobalSecurity(securityInput); + + const context = { + options: client._options, + baseURL: options?.serverURL ?? client._baseURL ?? "", + operationID: "bulkAssignMembersToGuardrail", + oAuth2Scopes: null, + + resolvedSecurity: requestSecurity, + + securitySource: client._options.apiKey, + retryConfig: options?.retries + || client._options.retryConfig + || { strategy: "none" }, + retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"], + }; + + const requestRes = client._createRequest(context, { + security: requestSecurity, + method: "POST", + baseURL: options?.serverURL, + path: path, + headers: headers, + body: body, + userAgent: client._options.userAgent, + timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1, + }, options); + if (!requestRes.ok) { + return [requestRes, { status: "invalid" }]; + } + const req = requestRes.value; + + const doResult = await client._do(req, { + context, + errorCodes: ["400", "401", "404", "4XX", "500", "5XX"], + retryConfig: context.retryConfig, + retryCodes: context.retryCodes, + }); + if (!doResult.ok) { + return [doResult, { status: "request-error", request: req }]; + } + const response = doResult.value; + + const responseFields = { + HttpMeta: { Response: response, Request: req }, + }; + + const [result] = await M.match< + operations.BulkAssignMembersToGuardrailResponse, + | errors.BadRequestResponseError + | errors.UnauthorizedResponseError + | errors.NotFoundResponseError + | errors.InternalServerResponseError + | OpenRouterError + | ResponseValidationError + | ConnectionError + | RequestAbortedError + | RequestTimeoutError + | InvalidRequestError + | UnexpectedClientError + | SDKValidationError + >( + M.json(200, operations.BulkAssignMembersToGuardrailResponse$inboundSchema), + M.jsonErr(400, errors.BadRequestResponseError$inboundSchema), + M.jsonErr(401, errors.UnauthorizedResponseError$inboundSchema), + M.jsonErr(404, errors.NotFoundResponseError$inboundSchema), + M.jsonErr(500, errors.InternalServerResponseError$inboundSchema), + M.fail("4XX"), + M.fail("5XX"), + )(response, req, { extraFields: responseFields }); + if (!result.ok) { + return [result, { status: "complete", request: req, response }]; + } + + return [result, { status: "complete", request: req, response }]; +} diff --git a/src/funcs/guardrailsBulkUnassignKeys.ts b/src/funcs/guardrailsBulkUnassignKeys.ts new file mode 100644 index 00000000..8187aeb0 --- /dev/null +++ b/src/funcs/guardrailsBulkUnassignKeys.ts @@ -0,0 +1,194 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + * @generated-id: fd19b36e897d + */ + +import { OpenRouterCore } from "../core.js"; +import { encodeJSON, encodeSimple } from "../lib/encodings.js"; +import * as M from "../lib/matchers.js"; +import { compactMap } from "../lib/primitives.js"; +import { safeParse } from "../lib/schemas.js"; +import { RequestOptions } from "../lib/sdks.js"; +import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js"; +import { pathToFunc } from "../lib/url.js"; +import { + ConnectionError, + InvalidRequestError, + RequestAbortedError, + RequestTimeoutError, + UnexpectedClientError, +} from "../models/errors/httpclienterrors.js"; +import * as errors from "../models/errors/index.js"; +import { OpenRouterError } from "../models/errors/openroutererror.js"; +import { ResponseValidationError } from "../models/errors/responsevalidationerror.js"; +import { SDKValidationError } from "../models/errors/sdkvalidationerror.js"; +import * as operations from "../models/operations/index.js"; +import { APICall, APIPromise } from "../types/async.js"; +import { Result } from "../types/fp.js"; + +/** + * Bulk unassign keys from a guardrail + * + * @remarks + * Unassign multiple API keys from a specific guardrail. [Provisioning key](/docs/guides/overview/auth/provisioning-api-keys) required. + */ +export function guardrailsBulkUnassignKeys( + client: OpenRouterCore, + request: operations.BulkUnassignKeysFromGuardrailRequest, + options?: RequestOptions, +): APIPromise< + Result< + operations.BulkUnassignKeysFromGuardrailResponse, + | errors.BadRequestResponseError + | errors.UnauthorizedResponseError + | errors.NotFoundResponseError + | errors.InternalServerResponseError + | OpenRouterError + | ResponseValidationError + | ConnectionError + | RequestAbortedError + | RequestTimeoutError + | InvalidRequestError + | UnexpectedClientError + | SDKValidationError + > +> { + return new APIPromise($do( + client, + request, + options, + )); +} + +async function $do( + client: OpenRouterCore, + request: operations.BulkUnassignKeysFromGuardrailRequest, + options?: RequestOptions, +): Promise< + [ + Result< + operations.BulkUnassignKeysFromGuardrailResponse, + | errors.BadRequestResponseError + | errors.UnauthorizedResponseError + | errors.NotFoundResponseError + | errors.InternalServerResponseError + | OpenRouterError + | ResponseValidationError + | ConnectionError + | RequestAbortedError + | RequestTimeoutError + | InvalidRequestError + | UnexpectedClientError + | SDKValidationError + >, + APICall, + ] +> { + const parsed = safeParse( + request, + (value) => + operations.BulkUnassignKeysFromGuardrailRequest$outboundSchema.parse( + value, + ), + "Input validation failed", + ); + if (!parsed.ok) { + return [parsed, { status: "invalid" }]; + } + const payload = parsed.value; + const body = encodeJSON("body", payload.RequestBody, { explode: true }); + + const pathParams = { + id: encodeSimple("id", payload.id, { + explode: false, + charEncoding: "percent", + }), + }; + + const path = pathToFunc("/guardrails/{id}/assignments/keys/remove")( + pathParams, + ); + + const headers = new Headers(compactMap({ + "Content-Type": "application/json", + Accept: "application/json", + })); + + const secConfig = await extractSecurity(client._options.apiKey); + const securityInput = secConfig == null ? {} : { apiKey: secConfig }; + const requestSecurity = resolveGlobalSecurity(securityInput); + + const context = { + options: client._options, + baseURL: options?.serverURL ?? client._baseURL ?? "", + operationID: "bulkUnassignKeysFromGuardrail", + oAuth2Scopes: null, + + resolvedSecurity: requestSecurity, + + securitySource: client._options.apiKey, + retryConfig: options?.retries + || client._options.retryConfig + || { strategy: "none" }, + retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"], + }; + + const requestRes = client._createRequest(context, { + security: requestSecurity, + method: "POST", + baseURL: options?.serverURL, + path: path, + headers: headers, + body: body, + userAgent: client._options.userAgent, + timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1, + }, options); + if (!requestRes.ok) { + return [requestRes, { status: "invalid" }]; + } + const req = requestRes.value; + + const doResult = await client._do(req, { + context, + errorCodes: ["400", "401", "404", "4XX", "500", "5XX"], + retryConfig: context.retryConfig, + retryCodes: context.retryCodes, + }); + if (!doResult.ok) { + return [doResult, { status: "request-error", request: req }]; + } + const response = doResult.value; + + const responseFields = { + HttpMeta: { Response: response, Request: req }, + }; + + const [result] = await M.match< + operations.BulkUnassignKeysFromGuardrailResponse, + | errors.BadRequestResponseError + | errors.UnauthorizedResponseError + | errors.NotFoundResponseError + | errors.InternalServerResponseError + | OpenRouterError + | ResponseValidationError + | ConnectionError + | RequestAbortedError + | RequestTimeoutError + | InvalidRequestError + | UnexpectedClientError + | SDKValidationError + >( + M.json(200, operations.BulkUnassignKeysFromGuardrailResponse$inboundSchema), + M.jsonErr(400, errors.BadRequestResponseError$inboundSchema), + M.jsonErr(401, errors.UnauthorizedResponseError$inboundSchema), + M.jsonErr(404, errors.NotFoundResponseError$inboundSchema), + M.jsonErr(500, errors.InternalServerResponseError$inboundSchema), + M.fail("4XX"), + M.fail("5XX"), + )(response, req, { extraFields: responseFields }); + if (!result.ok) { + return [result, { status: "complete", request: req, response }]; + } + + return [result, { status: "complete", request: req, response }]; +} diff --git a/src/funcs/guardrailsBulkUnassignMembers.ts b/src/funcs/guardrailsBulkUnassignMembers.ts new file mode 100644 index 00000000..c24c7132 --- /dev/null +++ b/src/funcs/guardrailsBulkUnassignMembers.ts @@ -0,0 +1,197 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + * @generated-id: 807705779557 + */ + +import { OpenRouterCore } from "../core.js"; +import { encodeJSON, encodeSimple } from "../lib/encodings.js"; +import * as M from "../lib/matchers.js"; +import { compactMap } from "../lib/primitives.js"; +import { safeParse } from "../lib/schemas.js"; +import { RequestOptions } from "../lib/sdks.js"; +import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js"; +import { pathToFunc } from "../lib/url.js"; +import { + ConnectionError, + InvalidRequestError, + RequestAbortedError, + RequestTimeoutError, + UnexpectedClientError, +} from "../models/errors/httpclienterrors.js"; +import * as errors from "../models/errors/index.js"; +import { OpenRouterError } from "../models/errors/openroutererror.js"; +import { ResponseValidationError } from "../models/errors/responsevalidationerror.js"; +import { SDKValidationError } from "../models/errors/sdkvalidationerror.js"; +import * as operations from "../models/operations/index.js"; +import { APICall, APIPromise } from "../types/async.js"; +import { Result } from "../types/fp.js"; + +/** + * Bulk unassign members from a guardrail + * + * @remarks + * Unassign multiple organization members from a specific guardrail. [Provisioning key](/docs/guides/overview/auth/provisioning-api-keys) required. + */ +export function guardrailsBulkUnassignMembers( + client: OpenRouterCore, + request: operations.BulkUnassignMembersFromGuardrailRequest, + options?: RequestOptions, +): APIPromise< + Result< + operations.BulkUnassignMembersFromGuardrailResponse, + | errors.BadRequestResponseError + | errors.UnauthorizedResponseError + | errors.NotFoundResponseError + | errors.InternalServerResponseError + | OpenRouterError + | ResponseValidationError + | ConnectionError + | RequestAbortedError + | RequestTimeoutError + | InvalidRequestError + | UnexpectedClientError + | SDKValidationError + > +> { + return new APIPromise($do( + client, + request, + options, + )); +} + +async function $do( + client: OpenRouterCore, + request: operations.BulkUnassignMembersFromGuardrailRequest, + options?: RequestOptions, +): Promise< + [ + Result< + operations.BulkUnassignMembersFromGuardrailResponse, + | errors.BadRequestResponseError + | errors.UnauthorizedResponseError + | errors.NotFoundResponseError + | errors.InternalServerResponseError + | OpenRouterError + | ResponseValidationError + | ConnectionError + | RequestAbortedError + | RequestTimeoutError + | InvalidRequestError + | UnexpectedClientError + | SDKValidationError + >, + APICall, + ] +> { + const parsed = safeParse( + request, + (value) => + operations.BulkUnassignMembersFromGuardrailRequest$outboundSchema.parse( + value, + ), + "Input validation failed", + ); + if (!parsed.ok) { + return [parsed, { status: "invalid" }]; + } + const payload = parsed.value; + const body = encodeJSON("body", payload.RequestBody, { explode: true }); + + const pathParams = { + id: encodeSimple("id", payload.id, { + explode: false, + charEncoding: "percent", + }), + }; + + const path = pathToFunc("/guardrails/{id}/assignments/members/remove")( + pathParams, + ); + + const headers = new Headers(compactMap({ + "Content-Type": "application/json", + Accept: "application/json", + })); + + const secConfig = await extractSecurity(client._options.apiKey); + const securityInput = secConfig == null ? {} : { apiKey: secConfig }; + const requestSecurity = resolveGlobalSecurity(securityInput); + + const context = { + options: client._options, + baseURL: options?.serverURL ?? client._baseURL ?? "", + operationID: "bulkUnassignMembersFromGuardrail", + oAuth2Scopes: null, + + resolvedSecurity: requestSecurity, + + securitySource: client._options.apiKey, + retryConfig: options?.retries + || client._options.retryConfig + || { strategy: "none" }, + retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"], + }; + + const requestRes = client._createRequest(context, { + security: requestSecurity, + method: "POST", + baseURL: options?.serverURL, + path: path, + headers: headers, + body: body, + userAgent: client._options.userAgent, + timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1, + }, options); + if (!requestRes.ok) { + return [requestRes, { status: "invalid" }]; + } + const req = requestRes.value; + + const doResult = await client._do(req, { + context, + errorCodes: ["400", "401", "404", "4XX", "500", "5XX"], + retryConfig: context.retryConfig, + retryCodes: context.retryCodes, + }); + if (!doResult.ok) { + return [doResult, { status: "request-error", request: req }]; + } + const response = doResult.value; + + const responseFields = { + HttpMeta: { Response: response, Request: req }, + }; + + const [result] = await M.match< + operations.BulkUnassignMembersFromGuardrailResponse, + | errors.BadRequestResponseError + | errors.UnauthorizedResponseError + | errors.NotFoundResponseError + | errors.InternalServerResponseError + | OpenRouterError + | ResponseValidationError + | ConnectionError + | RequestAbortedError + | RequestTimeoutError + | InvalidRequestError + | UnexpectedClientError + | SDKValidationError + >( + M.json( + 200, + operations.BulkUnassignMembersFromGuardrailResponse$inboundSchema, + ), + M.jsonErr(400, errors.BadRequestResponseError$inboundSchema), + M.jsonErr(401, errors.UnauthorizedResponseError$inboundSchema), + M.jsonErr(404, errors.NotFoundResponseError$inboundSchema), + M.jsonErr(500, errors.InternalServerResponseError$inboundSchema), + M.fail("4XX"), + M.fail("5XX"), + )(response, req, { extraFields: responseFields }); + if (!result.ok) { + return [result, { status: "complete", request: req, response }]; + } + + return [result, { status: "complete", request: req, response }]; +} diff --git a/src/funcs/guardrailsCreate.ts b/src/funcs/guardrailsCreate.ts new file mode 100644 index 00000000..405792f9 --- /dev/null +++ b/src/funcs/guardrailsCreate.ts @@ -0,0 +1,178 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + * @generated-id: 5878dd40f5cd + */ + +import { OpenRouterCore } from "../core.js"; +import { encodeJSON } from "../lib/encodings.js"; +import * as M from "../lib/matchers.js"; +import { compactMap } from "../lib/primitives.js"; +import { safeParse } from "../lib/schemas.js"; +import { RequestOptions } from "../lib/sdks.js"; +import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js"; +import { pathToFunc } from "../lib/url.js"; +import { + ConnectionError, + InvalidRequestError, + RequestAbortedError, + RequestTimeoutError, + UnexpectedClientError, +} from "../models/errors/httpclienterrors.js"; +import * as errors from "../models/errors/index.js"; +import { OpenRouterError } from "../models/errors/openroutererror.js"; +import { ResponseValidationError } from "../models/errors/responsevalidationerror.js"; +import { SDKValidationError } from "../models/errors/sdkvalidationerror.js"; +import * as operations from "../models/operations/index.js"; +import { APICall, APIPromise } from "../types/async.js"; +import { Result } from "../types/fp.js"; + +/** + * Create a guardrail + * + * @remarks + * Create a new guardrail for the authenticated user. [Provisioning key](/docs/guides/overview/auth/provisioning-api-keys) required. + */ +export function guardrailsCreate( + client: OpenRouterCore, + request: operations.CreateGuardrailRequest, + options?: RequestOptions, +): APIPromise< + Result< + operations.CreateGuardrailResponse, + | errors.BadRequestResponseError + | errors.UnauthorizedResponseError + | errors.InternalServerResponseError + | OpenRouterError + | ResponseValidationError + | ConnectionError + | RequestAbortedError + | RequestTimeoutError + | InvalidRequestError + | UnexpectedClientError + | SDKValidationError + > +> { + return new APIPromise($do( + client, + request, + options, + )); +} + +async function $do( + client: OpenRouterCore, + request: operations.CreateGuardrailRequest, + options?: RequestOptions, +): Promise< + [ + Result< + operations.CreateGuardrailResponse, + | errors.BadRequestResponseError + | errors.UnauthorizedResponseError + | errors.InternalServerResponseError + | OpenRouterError + | ResponseValidationError + | ConnectionError + | RequestAbortedError + | RequestTimeoutError + | InvalidRequestError + | UnexpectedClientError + | SDKValidationError + >, + APICall, + ] +> { + const parsed = safeParse( + request, + (value) => operations.CreateGuardrailRequest$outboundSchema.parse(value), + "Input validation failed", + ); + if (!parsed.ok) { + return [parsed, { status: "invalid" }]; + } + const payload = parsed.value; + const body = encodeJSON("body", payload, { explode: true }); + + const path = pathToFunc("/guardrails")(); + + const headers = new Headers(compactMap({ + "Content-Type": "application/json", + Accept: "application/json", + })); + + const secConfig = await extractSecurity(client._options.apiKey); + const securityInput = secConfig == null ? {} : { apiKey: secConfig }; + const requestSecurity = resolveGlobalSecurity(securityInput); + + const context = { + options: client._options, + baseURL: options?.serverURL ?? client._baseURL ?? "", + operationID: "createGuardrail", + oAuth2Scopes: null, + + resolvedSecurity: requestSecurity, + + securitySource: client._options.apiKey, + retryConfig: options?.retries + || client._options.retryConfig + || { strategy: "none" }, + retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"], + }; + + const requestRes = client._createRequest(context, { + security: requestSecurity, + method: "POST", + baseURL: options?.serverURL, + path: path, + headers: headers, + body: body, + userAgent: client._options.userAgent, + timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1, + }, options); + if (!requestRes.ok) { + return [requestRes, { status: "invalid" }]; + } + const req = requestRes.value; + + const doResult = await client._do(req, { + context, + errorCodes: ["400", "401", "4XX", "500", "5XX"], + retryConfig: context.retryConfig, + retryCodes: context.retryCodes, + }); + if (!doResult.ok) { + return [doResult, { status: "request-error", request: req }]; + } + const response = doResult.value; + + const responseFields = { + HttpMeta: { Response: response, Request: req }, + }; + + const [result] = await M.match< + operations.CreateGuardrailResponse, + | errors.BadRequestResponseError + | errors.UnauthorizedResponseError + | errors.InternalServerResponseError + | OpenRouterError + | ResponseValidationError + | ConnectionError + | RequestAbortedError + | RequestTimeoutError + | InvalidRequestError + | UnexpectedClientError + | SDKValidationError + >( + M.json(201, operations.CreateGuardrailResponse$inboundSchema), + M.jsonErr(400, errors.BadRequestResponseError$inboundSchema), + M.jsonErr(401, errors.UnauthorizedResponseError$inboundSchema), + M.jsonErr(500, errors.InternalServerResponseError$inboundSchema), + M.fail("4XX"), + M.fail("5XX"), + )(response, req, { extraFields: responseFields }); + if (!result.ok) { + return [result, { status: "complete", request: req, response }]; + } + + return [result, { status: "complete", request: req, response }]; +} diff --git a/src/funcs/guardrailsDelete.ts b/src/funcs/guardrailsDelete.ts new file mode 100644 index 00000000..063eaa27 --- /dev/null +++ b/src/funcs/guardrailsDelete.ts @@ -0,0 +1,184 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + * @generated-id: 3be996456efc + */ + +import { OpenRouterCore } from "../core.js"; +import { encodeSimple } from "../lib/encodings.js"; +import * as M from "../lib/matchers.js"; +import { compactMap } from "../lib/primitives.js"; +import { safeParse } from "../lib/schemas.js"; +import { RequestOptions } from "../lib/sdks.js"; +import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js"; +import { pathToFunc } from "../lib/url.js"; +import { + ConnectionError, + InvalidRequestError, + RequestAbortedError, + RequestTimeoutError, + UnexpectedClientError, +} from "../models/errors/httpclienterrors.js"; +import * as errors from "../models/errors/index.js"; +import { OpenRouterError } from "../models/errors/openroutererror.js"; +import { ResponseValidationError } from "../models/errors/responsevalidationerror.js"; +import { SDKValidationError } from "../models/errors/sdkvalidationerror.js"; +import * as operations from "../models/operations/index.js"; +import { APICall, APIPromise } from "../types/async.js"; +import { Result } from "../types/fp.js"; + +/** + * Delete a guardrail + * + * @remarks + * Delete an existing guardrail. [Provisioning key](/docs/guides/overview/auth/provisioning-api-keys) required. + */ +export function guardrailsDelete( + client: OpenRouterCore, + request: operations.DeleteGuardrailRequest, + options?: RequestOptions, +): APIPromise< + Result< + operations.DeleteGuardrailResponse, + | errors.UnauthorizedResponseError + | errors.NotFoundResponseError + | errors.InternalServerResponseError + | OpenRouterError + | ResponseValidationError + | ConnectionError + | RequestAbortedError + | RequestTimeoutError + | InvalidRequestError + | UnexpectedClientError + | SDKValidationError + > +> { + return new APIPromise($do( + client, + request, + options, + )); +} + +async function $do( + client: OpenRouterCore, + request: operations.DeleteGuardrailRequest, + options?: RequestOptions, +): Promise< + [ + Result< + operations.DeleteGuardrailResponse, + | errors.UnauthorizedResponseError + | errors.NotFoundResponseError + | errors.InternalServerResponseError + | OpenRouterError + | ResponseValidationError + | ConnectionError + | RequestAbortedError + | RequestTimeoutError + | InvalidRequestError + | UnexpectedClientError + | SDKValidationError + >, + APICall, + ] +> { + const parsed = safeParse( + request, + (value) => operations.DeleteGuardrailRequest$outboundSchema.parse(value), + "Input validation failed", + ); + if (!parsed.ok) { + return [parsed, { status: "invalid" }]; + } + const payload = parsed.value; + const body = null; + + const pathParams = { + id: encodeSimple("id", payload.id, { + explode: false, + charEncoding: "percent", + }), + }; + + const path = pathToFunc("/guardrails/{id}")(pathParams); + + const headers = new Headers(compactMap({ + Accept: "application/json", + })); + + const secConfig = await extractSecurity(client._options.apiKey); + const securityInput = secConfig == null ? {} : { apiKey: secConfig }; + const requestSecurity = resolveGlobalSecurity(securityInput); + + const context = { + options: client._options, + baseURL: options?.serverURL ?? client._baseURL ?? "", + operationID: "deleteGuardrail", + oAuth2Scopes: null, + + resolvedSecurity: requestSecurity, + + securitySource: client._options.apiKey, + retryConfig: options?.retries + || client._options.retryConfig + || { strategy: "none" }, + retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"], + }; + + const requestRes = client._createRequest(context, { + security: requestSecurity, + method: "DELETE", + baseURL: options?.serverURL, + path: path, + headers: headers, + body: body, + userAgent: client._options.userAgent, + timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1, + }, options); + if (!requestRes.ok) { + return [requestRes, { status: "invalid" }]; + } + const req = requestRes.value; + + const doResult = await client._do(req, { + context, + errorCodes: ["401", "404", "4XX", "500", "5XX"], + retryConfig: context.retryConfig, + retryCodes: context.retryCodes, + }); + if (!doResult.ok) { + return [doResult, { status: "request-error", request: req }]; + } + const response = doResult.value; + + const responseFields = { + HttpMeta: { Response: response, Request: req }, + }; + + const [result] = await M.match< + operations.DeleteGuardrailResponse, + | errors.UnauthorizedResponseError + | errors.NotFoundResponseError + | errors.InternalServerResponseError + | OpenRouterError + | ResponseValidationError + | ConnectionError + | RequestAbortedError + | RequestTimeoutError + | InvalidRequestError + | UnexpectedClientError + | SDKValidationError + >( + M.json(200, operations.DeleteGuardrailResponse$inboundSchema), + M.jsonErr(401, errors.UnauthorizedResponseError$inboundSchema), + M.jsonErr(404, errors.NotFoundResponseError$inboundSchema), + M.jsonErr(500, errors.InternalServerResponseError$inboundSchema), + M.fail("4XX"), + M.fail("5XX"), + )(response, req, { extraFields: responseFields }); + if (!result.ok) { + return [result, { status: "complete", request: req, response }]; + } + + return [result, { status: "complete", request: req, response }]; +} diff --git a/src/funcs/guardrailsGet.ts b/src/funcs/guardrailsGet.ts new file mode 100644 index 00000000..37a46166 --- /dev/null +++ b/src/funcs/guardrailsGet.ts @@ -0,0 +1,184 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + * @generated-id: d045f0f3c9d1 + */ + +import { OpenRouterCore } from "../core.js"; +import { encodeSimple } from "../lib/encodings.js"; +import * as M from "../lib/matchers.js"; +import { compactMap } from "../lib/primitives.js"; +import { safeParse } from "../lib/schemas.js"; +import { RequestOptions } from "../lib/sdks.js"; +import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js"; +import { pathToFunc } from "../lib/url.js"; +import { + ConnectionError, + InvalidRequestError, + RequestAbortedError, + RequestTimeoutError, + UnexpectedClientError, +} from "../models/errors/httpclienterrors.js"; +import * as errors from "../models/errors/index.js"; +import { OpenRouterError } from "../models/errors/openroutererror.js"; +import { ResponseValidationError } from "../models/errors/responsevalidationerror.js"; +import { SDKValidationError } from "../models/errors/sdkvalidationerror.js"; +import * as operations from "../models/operations/index.js"; +import { APICall, APIPromise } from "../types/async.js"; +import { Result } from "../types/fp.js"; + +/** + * Get a guardrail + * + * @remarks + * Get a single guardrail by ID. [Provisioning key](/docs/guides/overview/auth/provisioning-api-keys) required. + */ +export function guardrailsGet( + client: OpenRouterCore, + request: operations.GetGuardrailRequest, + options?: RequestOptions, +): APIPromise< + Result< + operations.GetGuardrailResponse, + | errors.UnauthorizedResponseError + | errors.NotFoundResponseError + | errors.InternalServerResponseError + | OpenRouterError + | ResponseValidationError + | ConnectionError + | RequestAbortedError + | RequestTimeoutError + | InvalidRequestError + | UnexpectedClientError + | SDKValidationError + > +> { + return new APIPromise($do( + client, + request, + options, + )); +} + +async function $do( + client: OpenRouterCore, + request: operations.GetGuardrailRequest, + options?: RequestOptions, +): Promise< + [ + Result< + operations.GetGuardrailResponse, + | errors.UnauthorizedResponseError + | errors.NotFoundResponseError + | errors.InternalServerResponseError + | OpenRouterError + | ResponseValidationError + | ConnectionError + | RequestAbortedError + | RequestTimeoutError + | InvalidRequestError + | UnexpectedClientError + | SDKValidationError + >, + APICall, + ] +> { + const parsed = safeParse( + request, + (value) => operations.GetGuardrailRequest$outboundSchema.parse(value), + "Input validation failed", + ); + if (!parsed.ok) { + return [parsed, { status: "invalid" }]; + } + const payload = parsed.value; + const body = null; + + const pathParams = { + id: encodeSimple("id", payload.id, { + explode: false, + charEncoding: "percent", + }), + }; + + const path = pathToFunc("/guardrails/{id}")(pathParams); + + const headers = new Headers(compactMap({ + Accept: "application/json", + })); + + const secConfig = await extractSecurity(client._options.apiKey); + const securityInput = secConfig == null ? {} : { apiKey: secConfig }; + const requestSecurity = resolveGlobalSecurity(securityInput); + + const context = { + options: client._options, + baseURL: options?.serverURL ?? client._baseURL ?? "", + operationID: "getGuardrail", + oAuth2Scopes: null, + + resolvedSecurity: requestSecurity, + + securitySource: client._options.apiKey, + retryConfig: options?.retries + || client._options.retryConfig + || { strategy: "none" }, + retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"], + }; + + const requestRes = client._createRequest(context, { + security: requestSecurity, + method: "GET", + baseURL: options?.serverURL, + path: path, + headers: headers, + body: body, + userAgent: client._options.userAgent, + timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1, + }, options); + if (!requestRes.ok) { + return [requestRes, { status: "invalid" }]; + } + const req = requestRes.value; + + const doResult = await client._do(req, { + context, + errorCodes: ["401", "404", "4XX", "500", "5XX"], + retryConfig: context.retryConfig, + retryCodes: context.retryCodes, + }); + if (!doResult.ok) { + return [doResult, { status: "request-error", request: req }]; + } + const response = doResult.value; + + const responseFields = { + HttpMeta: { Response: response, Request: req }, + }; + + const [result] = await M.match< + operations.GetGuardrailResponse, + | errors.UnauthorizedResponseError + | errors.NotFoundResponseError + | errors.InternalServerResponseError + | OpenRouterError + | ResponseValidationError + | ConnectionError + | RequestAbortedError + | RequestTimeoutError + | InvalidRequestError + | UnexpectedClientError + | SDKValidationError + >( + M.json(200, operations.GetGuardrailResponse$inboundSchema), + M.jsonErr(401, errors.UnauthorizedResponseError$inboundSchema), + M.jsonErr(404, errors.NotFoundResponseError$inboundSchema), + M.jsonErr(500, errors.InternalServerResponseError$inboundSchema), + M.fail("4XX"), + M.fail("5XX"), + )(response, req, { extraFields: responseFields }); + if (!result.ok) { + return [result, { status: "complete", request: req, response }]; + } + + return [result, { status: "complete", request: req, response }]; +} diff --git a/src/funcs/guardrailsList.ts b/src/funcs/guardrailsList.ts new file mode 100644 index 00000000..67b28307 --- /dev/null +++ b/src/funcs/guardrailsList.ts @@ -0,0 +1,180 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + * @generated-id: 4c066e741cd8 + */ + +import { OpenRouterCore } from "../core.js"; +import { encodeFormQuery } from "../lib/encodings.js"; +import * as M from "../lib/matchers.js"; +import { compactMap } from "../lib/primitives.js"; +import { safeParse } from "../lib/schemas.js"; +import { RequestOptions } from "../lib/sdks.js"; +import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js"; +import { pathToFunc } from "../lib/url.js"; +import { + ConnectionError, + InvalidRequestError, + RequestAbortedError, + RequestTimeoutError, + UnexpectedClientError, +} from "../models/errors/httpclienterrors.js"; +import * as errors from "../models/errors/index.js"; +import { OpenRouterError } from "../models/errors/openroutererror.js"; +import { ResponseValidationError } from "../models/errors/responsevalidationerror.js"; +import { SDKValidationError } from "../models/errors/sdkvalidationerror.js"; +import * as operations from "../models/operations/index.js"; +import { APICall, APIPromise } from "../types/async.js"; +import { Result } from "../types/fp.js"; + +/** + * List guardrails + * + * @remarks + * List all guardrails for the authenticated user. [Provisioning key](/docs/guides/overview/auth/provisioning-api-keys) required. + */ +export function guardrailsList( + client: OpenRouterCore, + request?: operations.ListGuardrailsRequest | undefined, + options?: RequestOptions, +): APIPromise< + Result< + operations.ListGuardrailsResponse, + | errors.UnauthorizedResponseError + | errors.InternalServerResponseError + | OpenRouterError + | ResponseValidationError + | ConnectionError + | RequestAbortedError + | RequestTimeoutError + | InvalidRequestError + | UnexpectedClientError + | SDKValidationError + > +> { + return new APIPromise($do( + client, + request, + options, + )); +} + +async function $do( + client: OpenRouterCore, + request?: operations.ListGuardrailsRequest | undefined, + options?: RequestOptions, +): Promise< + [ + Result< + operations.ListGuardrailsResponse, + | errors.UnauthorizedResponseError + | errors.InternalServerResponseError + | OpenRouterError + | ResponseValidationError + | ConnectionError + | RequestAbortedError + | RequestTimeoutError + | InvalidRequestError + | UnexpectedClientError + | SDKValidationError + >, + APICall, + ] +> { + const parsed = safeParse( + request, + (value) => + operations.ListGuardrailsRequest$outboundSchema.optional().parse(value), + "Input validation failed", + ); + if (!parsed.ok) { + return [parsed, { status: "invalid" }]; + } + const payload = parsed.value; + const body = null; + + const path = pathToFunc("/guardrails")(); + + const query = encodeFormQuery({ + "limit": payload?.limit, + "offset": payload?.offset, + }); + + const headers = new Headers(compactMap({ + Accept: "application/json", + })); + + const secConfig = await extractSecurity(client._options.apiKey); + const securityInput = secConfig == null ? {} : { apiKey: secConfig }; + const requestSecurity = resolveGlobalSecurity(securityInput); + + const context = { + options: client._options, + baseURL: options?.serverURL ?? client._baseURL ?? "", + operationID: "listGuardrails", + oAuth2Scopes: null, + + resolvedSecurity: requestSecurity, + + securitySource: client._options.apiKey, + retryConfig: options?.retries + || client._options.retryConfig + || { strategy: "none" }, + retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"], + }; + + const requestRes = client._createRequest(context, { + security: requestSecurity, + method: "GET", + baseURL: options?.serverURL, + path: path, + headers: headers, + query: query, + body: body, + userAgent: client._options.userAgent, + timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1, + }, options); + if (!requestRes.ok) { + return [requestRes, { status: "invalid" }]; + } + const req = requestRes.value; + + const doResult = await client._do(req, { + context, + errorCodes: ["401", "4XX", "500", "5XX"], + retryConfig: context.retryConfig, + retryCodes: context.retryCodes, + }); + if (!doResult.ok) { + return [doResult, { status: "request-error", request: req }]; + } + const response = doResult.value; + + const responseFields = { + HttpMeta: { Response: response, Request: req }, + }; + + const [result] = await M.match< + operations.ListGuardrailsResponse, + | errors.UnauthorizedResponseError + | errors.InternalServerResponseError + | OpenRouterError + | ResponseValidationError + | ConnectionError + | RequestAbortedError + | RequestTimeoutError + | InvalidRequestError + | UnexpectedClientError + | SDKValidationError + >( + M.json(200, operations.ListGuardrailsResponse$inboundSchema), + M.jsonErr(401, errors.UnauthorizedResponseError$inboundSchema), + M.jsonErr(500, errors.InternalServerResponseError$inboundSchema), + M.fail("4XX"), + M.fail("5XX"), + )(response, req, { extraFields: responseFields }); + if (!result.ok) { + return [result, { status: "complete", request: req, response }]; + } + + return [result, { status: "complete", request: req, response }]; +} diff --git a/src/funcs/parametersGetParameters.ts b/src/funcs/guardrailsListGuardrailKeyAssignments.ts similarity index 77% rename from src/funcs/parametersGetParameters.ts rename to src/funcs/guardrailsListGuardrailKeyAssignments.ts index fe89f6f5..dce5ef0c 100644 --- a/src/funcs/parametersGetParameters.ts +++ b/src/funcs/guardrailsListGuardrailKeyAssignments.ts @@ -1,6 +1,6 @@ /* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - * @generated-id: 565ce9801e34 + * @generated-id: e0b13763f920 */ import { OpenRouterCore } from "../core.js"; @@ -9,7 +9,7 @@ import * as M from "../lib/matchers.js"; import { compactMap } from "../lib/primitives.js"; import { safeParse } from "../lib/schemas.js"; import { RequestOptions } from "../lib/sdks.js"; -import { resolveSecurity } from "../lib/security.js"; +import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js"; import { pathToFunc } from "../lib/url.js"; import { ConnectionError, @@ -27,16 +27,18 @@ import { APICall, APIPromise } from "../types/async.js"; import { Result } from "../types/fp.js"; /** - * Get a model's supported parameters and data about which are most popular + * List key assignments for a guardrail + * + * @remarks + * List all API key assignments for a specific guardrail. [Provisioning key](/docs/guides/overview/auth/provisioning-api-keys) required. */ -export function parametersGetParameters( +export function guardrailsListGuardrailKeyAssignments( client: OpenRouterCore, - security: operations.GetParametersSecurity, - request: operations.GetParametersRequest, + request: operations.ListGuardrailKeyAssignmentsRequest, options?: RequestOptions, ): APIPromise< Result< - operations.GetParametersResponse, + operations.ListGuardrailKeyAssignmentsResponse, | errors.UnauthorizedResponseError | errors.NotFoundResponseError | errors.InternalServerResponseError @@ -52,7 +54,6 @@ export function parametersGetParameters( > { return new APIPromise($do( client, - security, request, options, )); @@ -60,13 +61,12 @@ export function parametersGetParameters( async function $do( client: OpenRouterCore, - security: operations.GetParametersSecurity, - request: operations.GetParametersRequest, + request: operations.ListGuardrailKeyAssignmentsRequest, options?: RequestOptions, ): Promise< [ Result< - operations.GetParametersResponse, + operations.ListGuardrailKeyAssignmentsResponse, | errors.UnauthorizedResponseError | errors.NotFoundResponseError | errors.InternalServerResponseError @@ -84,7 +84,8 @@ async function $do( > { const parsed = safeParse( request, - (value) => operations.GetParametersRequest$outboundSchema.parse(value), + (value) => + operations.ListGuardrailKeyAssignmentsRequest$outboundSchema.parse(value), "Input validation failed", ); if (!parsed.ok) { @@ -94,45 +95,36 @@ async function $do( const body = null; const pathParams = { - author: encodeSimple("author", payload.author, { - explode: false, - charEncoding: "percent", - }), - slug: encodeSimple("slug", payload.slug, { + id: encodeSimple("id", payload.id, { explode: false, charEncoding: "percent", }), }; - const path = pathToFunc("/parameters/{author}/{slug}")(pathParams); + const path = pathToFunc("/guardrails/{id}/assignments/keys")(pathParams); const query = encodeFormQuery({ - "provider": payload.provider, + "limit": payload.limit, + "offset": payload.offset, }); const headers = new Headers(compactMap({ Accept: "application/json", })); - const requestSecurity = resolveSecurity( - [ - { - fieldName: "Authorization", - type: "http:bearer", - value: security?.bearer, - }, - ], - ); + const secConfig = await extractSecurity(client._options.apiKey); + const securityInput = secConfig == null ? {} : { apiKey: secConfig }; + const requestSecurity = resolveGlobalSecurity(securityInput); const context = { options: client._options, baseURL: options?.serverURL ?? client._baseURL ?? "", - operationID: "getParameters", + operationID: "listGuardrailKeyAssignments", oAuth2Scopes: null, resolvedSecurity: requestSecurity, - securitySource: security, + securitySource: client._options.apiKey, retryConfig: options?.retries || client._options.retryConfig || { strategy: "none" }, @@ -171,7 +163,7 @@ async function $do( }; const [result] = await M.match< - operations.GetParametersResponse, + operations.ListGuardrailKeyAssignmentsResponse, | errors.UnauthorizedResponseError | errors.NotFoundResponseError | errors.InternalServerResponseError @@ -184,7 +176,7 @@ async function $do( | UnexpectedClientError | SDKValidationError >( - M.json(200, operations.GetParametersResponse$inboundSchema), + M.json(200, operations.ListGuardrailKeyAssignmentsResponse$inboundSchema), M.jsonErr(401, errors.UnauthorizedResponseError$inboundSchema), M.jsonErr(404, errors.NotFoundResponseError$inboundSchema), M.jsonErr(500, errors.InternalServerResponseError$inboundSchema), diff --git a/src/funcs/guardrailsListGuardrailMemberAssignments.ts b/src/funcs/guardrailsListGuardrailMemberAssignments.ts new file mode 100644 index 00000000..921b5c45 --- /dev/null +++ b/src/funcs/guardrailsListGuardrailMemberAssignments.ts @@ -0,0 +1,196 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + * @generated-id: f89f2416fbd5 + */ + +import { OpenRouterCore } from "../core.js"; +import { encodeFormQuery, encodeSimple } from "../lib/encodings.js"; +import * as M from "../lib/matchers.js"; +import { compactMap } from "../lib/primitives.js"; +import { safeParse } from "../lib/schemas.js"; +import { RequestOptions } from "../lib/sdks.js"; +import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js"; +import { pathToFunc } from "../lib/url.js"; +import { + ConnectionError, + InvalidRequestError, + RequestAbortedError, + RequestTimeoutError, + UnexpectedClientError, +} from "../models/errors/httpclienterrors.js"; +import * as errors from "../models/errors/index.js"; +import { OpenRouterError } from "../models/errors/openroutererror.js"; +import { ResponseValidationError } from "../models/errors/responsevalidationerror.js"; +import { SDKValidationError } from "../models/errors/sdkvalidationerror.js"; +import * as operations from "../models/operations/index.js"; +import { APICall, APIPromise } from "../types/async.js"; +import { Result } from "../types/fp.js"; + +/** + * List member assignments for a guardrail + * + * @remarks + * List all organization member assignments for a specific guardrail. [Provisioning key](/docs/guides/overview/auth/provisioning-api-keys) required. + */ +export function guardrailsListGuardrailMemberAssignments( + client: OpenRouterCore, + request: operations.ListGuardrailMemberAssignmentsRequest, + options?: RequestOptions, +): APIPromise< + Result< + operations.ListGuardrailMemberAssignmentsResponse, + | errors.UnauthorizedResponseError + | errors.NotFoundResponseError + | errors.InternalServerResponseError + | OpenRouterError + | ResponseValidationError + | ConnectionError + | RequestAbortedError + | RequestTimeoutError + | InvalidRequestError + | UnexpectedClientError + | SDKValidationError + > +> { + return new APIPromise($do( + client, + request, + options, + )); +} + +async function $do( + client: OpenRouterCore, + request: operations.ListGuardrailMemberAssignmentsRequest, + options?: RequestOptions, +): Promise< + [ + Result< + operations.ListGuardrailMemberAssignmentsResponse, + | errors.UnauthorizedResponseError + | errors.NotFoundResponseError + | errors.InternalServerResponseError + | OpenRouterError + | ResponseValidationError + | ConnectionError + | RequestAbortedError + | RequestTimeoutError + | InvalidRequestError + | UnexpectedClientError + | SDKValidationError + >, + APICall, + ] +> { + const parsed = safeParse( + request, + (value) => + operations.ListGuardrailMemberAssignmentsRequest$outboundSchema.parse( + value, + ), + "Input validation failed", + ); + if (!parsed.ok) { + return [parsed, { status: "invalid" }]; + } + const payload = parsed.value; + const body = null; + + const pathParams = { + id: encodeSimple("id", payload.id, { + explode: false, + charEncoding: "percent", + }), + }; + + const path = pathToFunc("/guardrails/{id}/assignments/members")(pathParams); + + const query = encodeFormQuery({ + "limit": payload.limit, + "offset": payload.offset, + }); + + const headers = new Headers(compactMap({ + Accept: "application/json", + })); + + const secConfig = await extractSecurity(client._options.apiKey); + const securityInput = secConfig == null ? {} : { apiKey: secConfig }; + const requestSecurity = resolveGlobalSecurity(securityInput); + + const context = { + options: client._options, + baseURL: options?.serverURL ?? client._baseURL ?? "", + operationID: "listGuardrailMemberAssignments", + oAuth2Scopes: null, + + resolvedSecurity: requestSecurity, + + securitySource: client._options.apiKey, + retryConfig: options?.retries + || client._options.retryConfig + || { strategy: "none" }, + retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"], + }; + + const requestRes = client._createRequest(context, { + security: requestSecurity, + method: "GET", + baseURL: options?.serverURL, + path: path, + headers: headers, + query: query, + body: body, + userAgent: client._options.userAgent, + timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1, + }, options); + if (!requestRes.ok) { + return [requestRes, { status: "invalid" }]; + } + const req = requestRes.value; + + const doResult = await client._do(req, { + context, + errorCodes: ["401", "404", "4XX", "500", "5XX"], + retryConfig: context.retryConfig, + retryCodes: context.retryCodes, + }); + if (!doResult.ok) { + return [doResult, { status: "request-error", request: req }]; + } + const response = doResult.value; + + const responseFields = { + HttpMeta: { Response: response, Request: req }, + }; + + const [result] = await M.match< + operations.ListGuardrailMemberAssignmentsResponse, + | errors.UnauthorizedResponseError + | errors.NotFoundResponseError + | errors.InternalServerResponseError + | OpenRouterError + | ResponseValidationError + | ConnectionError + | RequestAbortedError + | RequestTimeoutError + | InvalidRequestError + | UnexpectedClientError + | SDKValidationError + >( + M.json( + 200, + operations.ListGuardrailMemberAssignmentsResponse$inboundSchema, + ), + M.jsonErr(401, errors.UnauthorizedResponseError$inboundSchema), + M.jsonErr(404, errors.NotFoundResponseError$inboundSchema), + M.jsonErr(500, errors.InternalServerResponseError$inboundSchema), + M.fail("4XX"), + M.fail("5XX"), + )(response, req, { extraFields: responseFields }); + if (!result.ok) { + return [result, { status: "complete", request: req, response }]; + } + + return [result, { status: "complete", request: req, response }]; +} diff --git a/src/funcs/guardrailsListKeyAssignments.ts b/src/funcs/guardrailsListKeyAssignments.ts new file mode 100644 index 00000000..ea724eca --- /dev/null +++ b/src/funcs/guardrailsListKeyAssignments.ts @@ -0,0 +1,182 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + * @generated-id: 09465ee2cc6d + */ + +import { OpenRouterCore } from "../core.js"; +import { encodeFormQuery } from "../lib/encodings.js"; +import * as M from "../lib/matchers.js"; +import { compactMap } from "../lib/primitives.js"; +import { safeParse } from "../lib/schemas.js"; +import { RequestOptions } from "../lib/sdks.js"; +import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js"; +import { pathToFunc } from "../lib/url.js"; +import { + ConnectionError, + InvalidRequestError, + RequestAbortedError, + RequestTimeoutError, + UnexpectedClientError, +} from "../models/errors/httpclienterrors.js"; +import * as errors from "../models/errors/index.js"; +import { OpenRouterError } from "../models/errors/openroutererror.js"; +import { ResponseValidationError } from "../models/errors/responsevalidationerror.js"; +import { SDKValidationError } from "../models/errors/sdkvalidationerror.js"; +import * as operations from "../models/operations/index.js"; +import { APICall, APIPromise } from "../types/async.js"; +import { Result } from "../types/fp.js"; + +/** + * List all key assignments + * + * @remarks + * List all API key guardrail assignments for the authenticated user. [Provisioning key](/docs/guides/overview/auth/provisioning-api-keys) required. + */ +export function guardrailsListKeyAssignments( + client: OpenRouterCore, + request?: operations.ListKeyAssignmentsRequest | undefined, + options?: RequestOptions, +): APIPromise< + Result< + operations.ListKeyAssignmentsResponse, + | errors.UnauthorizedResponseError + | errors.InternalServerResponseError + | OpenRouterError + | ResponseValidationError + | ConnectionError + | RequestAbortedError + | RequestTimeoutError + | InvalidRequestError + | UnexpectedClientError + | SDKValidationError + > +> { + return new APIPromise($do( + client, + request, + options, + )); +} + +async function $do( + client: OpenRouterCore, + request?: operations.ListKeyAssignmentsRequest | undefined, + options?: RequestOptions, +): Promise< + [ + Result< + operations.ListKeyAssignmentsResponse, + | errors.UnauthorizedResponseError + | errors.InternalServerResponseError + | OpenRouterError + | ResponseValidationError + | ConnectionError + | RequestAbortedError + | RequestTimeoutError + | InvalidRequestError + | UnexpectedClientError + | SDKValidationError + >, + APICall, + ] +> { + const parsed = safeParse( + request, + (value) => + operations.ListKeyAssignmentsRequest$outboundSchema.optional().parse( + value, + ), + "Input validation failed", + ); + if (!parsed.ok) { + return [parsed, { status: "invalid" }]; + } + const payload = parsed.value; + const body = null; + + const path = pathToFunc("/guardrails/assignments/keys")(); + + const query = encodeFormQuery({ + "limit": payload?.limit, + "offset": payload?.offset, + }); + + const headers = new Headers(compactMap({ + Accept: "application/json", + })); + + const secConfig = await extractSecurity(client._options.apiKey); + const securityInput = secConfig == null ? {} : { apiKey: secConfig }; + const requestSecurity = resolveGlobalSecurity(securityInput); + + const context = { + options: client._options, + baseURL: options?.serverURL ?? client._baseURL ?? "", + operationID: "listKeyAssignments", + oAuth2Scopes: null, + + resolvedSecurity: requestSecurity, + + securitySource: client._options.apiKey, + retryConfig: options?.retries + || client._options.retryConfig + || { strategy: "none" }, + retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"], + }; + + const requestRes = client._createRequest(context, { + security: requestSecurity, + method: "GET", + baseURL: options?.serverURL, + path: path, + headers: headers, + query: query, + body: body, + userAgent: client._options.userAgent, + timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1, + }, options); + if (!requestRes.ok) { + return [requestRes, { status: "invalid" }]; + } + const req = requestRes.value; + + const doResult = await client._do(req, { + context, + errorCodes: ["401", "4XX", "500", "5XX"], + retryConfig: context.retryConfig, + retryCodes: context.retryCodes, + }); + if (!doResult.ok) { + return [doResult, { status: "request-error", request: req }]; + } + const response = doResult.value; + + const responseFields = { + HttpMeta: { Response: response, Request: req }, + }; + + const [result] = await M.match< + operations.ListKeyAssignmentsResponse, + | errors.UnauthorizedResponseError + | errors.InternalServerResponseError + | OpenRouterError + | ResponseValidationError + | ConnectionError + | RequestAbortedError + | RequestTimeoutError + | InvalidRequestError + | UnexpectedClientError + | SDKValidationError + >( + M.json(200, operations.ListKeyAssignmentsResponse$inboundSchema), + M.jsonErr(401, errors.UnauthorizedResponseError$inboundSchema), + M.jsonErr(500, errors.InternalServerResponseError$inboundSchema), + M.fail("4XX"), + M.fail("5XX"), + )(response, req, { extraFields: responseFields }); + if (!result.ok) { + return [result, { status: "complete", request: req, response }]; + } + + return [result, { status: "complete", request: req, response }]; +} diff --git a/src/funcs/guardrailsListMemberAssignments.ts b/src/funcs/guardrailsListMemberAssignments.ts new file mode 100644 index 00000000..aa50a42b --- /dev/null +++ b/src/funcs/guardrailsListMemberAssignments.ts @@ -0,0 +1,182 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + * @generated-id: f4359f4c7ba4 + */ + +import { OpenRouterCore } from "../core.js"; +import { encodeFormQuery } from "../lib/encodings.js"; +import * as M from "../lib/matchers.js"; +import { compactMap } from "../lib/primitives.js"; +import { safeParse } from "../lib/schemas.js"; +import { RequestOptions } from "../lib/sdks.js"; +import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js"; +import { pathToFunc } from "../lib/url.js"; +import { + ConnectionError, + InvalidRequestError, + RequestAbortedError, + RequestTimeoutError, + UnexpectedClientError, +} from "../models/errors/httpclienterrors.js"; +import * as errors from "../models/errors/index.js"; +import { OpenRouterError } from "../models/errors/openroutererror.js"; +import { ResponseValidationError } from "../models/errors/responsevalidationerror.js"; +import { SDKValidationError } from "../models/errors/sdkvalidationerror.js"; +import * as operations from "../models/operations/index.js"; +import { APICall, APIPromise } from "../types/async.js"; +import { Result } from "../types/fp.js"; + +/** + * List all member assignments + * + * @remarks + * List all organization member guardrail assignments for the authenticated user. [Provisioning key](/docs/guides/overview/auth/provisioning-api-keys) required. + */ +export function guardrailsListMemberAssignments( + client: OpenRouterCore, + request?: operations.ListMemberAssignmentsRequest | undefined, + options?: RequestOptions, +): APIPromise< + Result< + operations.ListMemberAssignmentsResponse, + | errors.UnauthorizedResponseError + | errors.InternalServerResponseError + | OpenRouterError + | ResponseValidationError + | ConnectionError + | RequestAbortedError + | RequestTimeoutError + | InvalidRequestError + | UnexpectedClientError + | SDKValidationError + > +> { + return new APIPromise($do( + client, + request, + options, + )); +} + +async function $do( + client: OpenRouterCore, + request?: operations.ListMemberAssignmentsRequest | undefined, + options?: RequestOptions, +): Promise< + [ + Result< + operations.ListMemberAssignmentsResponse, + | errors.UnauthorizedResponseError + | errors.InternalServerResponseError + | OpenRouterError + | ResponseValidationError + | ConnectionError + | RequestAbortedError + | RequestTimeoutError + | InvalidRequestError + | UnexpectedClientError + | SDKValidationError + >, + APICall, + ] +> { + const parsed = safeParse( + request, + (value) => + operations.ListMemberAssignmentsRequest$outboundSchema.optional().parse( + value, + ), + "Input validation failed", + ); + if (!parsed.ok) { + return [parsed, { status: "invalid" }]; + } + const payload = parsed.value; + const body = null; + + const path = pathToFunc("/guardrails/assignments/members")(); + + const query = encodeFormQuery({ + "limit": payload?.limit, + "offset": payload?.offset, + }); + + const headers = new Headers(compactMap({ + Accept: "application/json", + })); + + const secConfig = await extractSecurity(client._options.apiKey); + const securityInput = secConfig == null ? {} : { apiKey: secConfig }; + const requestSecurity = resolveGlobalSecurity(securityInput); + + const context = { + options: client._options, + baseURL: options?.serverURL ?? client._baseURL ?? "", + operationID: "listMemberAssignments", + oAuth2Scopes: null, + + resolvedSecurity: requestSecurity, + + securitySource: client._options.apiKey, + retryConfig: options?.retries + || client._options.retryConfig + || { strategy: "none" }, + retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"], + }; + + const requestRes = client._createRequest(context, { + security: requestSecurity, + method: "GET", + baseURL: options?.serverURL, + path: path, + headers: headers, + query: query, + body: body, + userAgent: client._options.userAgent, + timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1, + }, options); + if (!requestRes.ok) { + return [requestRes, { status: "invalid" }]; + } + const req = requestRes.value; + + const doResult = await client._do(req, { + context, + errorCodes: ["401", "4XX", "500", "5XX"], + retryConfig: context.retryConfig, + retryCodes: context.retryCodes, + }); + if (!doResult.ok) { + return [doResult, { status: "request-error", request: req }]; + } + const response = doResult.value; + + const responseFields = { + HttpMeta: { Response: response, Request: req }, + }; + + const [result] = await M.match< + operations.ListMemberAssignmentsResponse, + | errors.UnauthorizedResponseError + | errors.InternalServerResponseError + | OpenRouterError + | ResponseValidationError + | ConnectionError + | RequestAbortedError + | RequestTimeoutError + | InvalidRequestError + | UnexpectedClientError + | SDKValidationError + >( + M.json(200, operations.ListMemberAssignmentsResponse$inboundSchema), + M.jsonErr(401, errors.UnauthorizedResponseError$inboundSchema), + M.jsonErr(500, errors.InternalServerResponseError$inboundSchema), + M.fail("4XX"), + M.fail("5XX"), + )(response, req, { extraFields: responseFields }); + if (!result.ok) { + return [result, { status: "complete", request: req, response }]; + } + + return [result, { status: "complete", request: req, response }]; +} diff --git a/src/funcs/guardrailsUpdate.ts b/src/funcs/guardrailsUpdate.ts new file mode 100644 index 00000000..6b78c91a --- /dev/null +++ b/src/funcs/guardrailsUpdate.ts @@ -0,0 +1,189 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + * @generated-id: 383ee7d83fc3 + */ + +import { OpenRouterCore } from "../core.js"; +import { encodeJSON, encodeSimple } from "../lib/encodings.js"; +import * as M from "../lib/matchers.js"; +import { compactMap } from "../lib/primitives.js"; +import { safeParse } from "../lib/schemas.js"; +import { RequestOptions } from "../lib/sdks.js"; +import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js"; +import { pathToFunc } from "../lib/url.js"; +import { + ConnectionError, + InvalidRequestError, + RequestAbortedError, + RequestTimeoutError, + UnexpectedClientError, +} from "../models/errors/httpclienterrors.js"; +import * as errors from "../models/errors/index.js"; +import { OpenRouterError } from "../models/errors/openroutererror.js"; +import { ResponseValidationError } from "../models/errors/responsevalidationerror.js"; +import { SDKValidationError } from "../models/errors/sdkvalidationerror.js"; +import * as operations from "../models/operations/index.js"; +import { APICall, APIPromise } from "../types/async.js"; +import { Result } from "../types/fp.js"; + +/** + * Update a guardrail + * + * @remarks + * Update an existing guardrail. [Provisioning key](/docs/guides/overview/auth/provisioning-api-keys) required. + */ +export function guardrailsUpdate( + client: OpenRouterCore, + request: operations.UpdateGuardrailRequest, + options?: RequestOptions, +): APIPromise< + Result< + operations.UpdateGuardrailResponse, + | errors.BadRequestResponseError + | errors.UnauthorizedResponseError + | errors.NotFoundResponseError + | errors.InternalServerResponseError + | OpenRouterError + | ResponseValidationError + | ConnectionError + | RequestAbortedError + | RequestTimeoutError + | InvalidRequestError + | UnexpectedClientError + | SDKValidationError + > +> { + return new APIPromise($do( + client, + request, + options, + )); +} + +async function $do( + client: OpenRouterCore, + request: operations.UpdateGuardrailRequest, + options?: RequestOptions, +): Promise< + [ + Result< + operations.UpdateGuardrailResponse, + | errors.BadRequestResponseError + | errors.UnauthorizedResponseError + | errors.NotFoundResponseError + | errors.InternalServerResponseError + | OpenRouterError + | ResponseValidationError + | ConnectionError + | RequestAbortedError + | RequestTimeoutError + | InvalidRequestError + | UnexpectedClientError + | SDKValidationError + >, + APICall, + ] +> { + const parsed = safeParse( + request, + (value) => operations.UpdateGuardrailRequest$outboundSchema.parse(value), + "Input validation failed", + ); + if (!parsed.ok) { + return [parsed, { status: "invalid" }]; + } + const payload = parsed.value; + const body = encodeJSON("body", payload.RequestBody, { explode: true }); + + const pathParams = { + id: encodeSimple("id", payload.id, { + explode: false, + charEncoding: "percent", + }), + }; + + const path = pathToFunc("/guardrails/{id}")(pathParams); + + const headers = new Headers(compactMap({ + "Content-Type": "application/json", + Accept: "application/json", + })); + + const secConfig = await extractSecurity(client._options.apiKey); + const securityInput = secConfig == null ? {} : { apiKey: secConfig }; + const requestSecurity = resolveGlobalSecurity(securityInput); + + const context = { + options: client._options, + baseURL: options?.serverURL ?? client._baseURL ?? "", + operationID: "updateGuardrail", + oAuth2Scopes: null, + + resolvedSecurity: requestSecurity, + + securitySource: client._options.apiKey, + retryConfig: options?.retries + || client._options.retryConfig + || { strategy: "none" }, + retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"], + }; + + const requestRes = client._createRequest(context, { + security: requestSecurity, + method: "PATCH", + baseURL: options?.serverURL, + path: path, + headers: headers, + body: body, + userAgent: client._options.userAgent, + timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1, + }, options); + if (!requestRes.ok) { + return [requestRes, { status: "invalid" }]; + } + const req = requestRes.value; + + const doResult = await client._do(req, { + context, + errorCodes: ["400", "401", "404", "4XX", "500", "5XX"], + retryConfig: context.retryConfig, + retryCodes: context.retryCodes, + }); + if (!doResult.ok) { + return [doResult, { status: "request-error", request: req }]; + } + const response = doResult.value; + + const responseFields = { + HttpMeta: { Response: response, Request: req }, + }; + + const [result] = await M.match< + operations.UpdateGuardrailResponse, + | errors.BadRequestResponseError + | errors.UnauthorizedResponseError + | errors.NotFoundResponseError + | errors.InternalServerResponseError + | OpenRouterError + | ResponseValidationError + | ConnectionError + | RequestAbortedError + | RequestTimeoutError + | InvalidRequestError + | UnexpectedClientError + | SDKValidationError + >( + M.json(200, operations.UpdateGuardrailResponse$inboundSchema), + M.jsonErr(400, errors.BadRequestResponseError$inboundSchema), + M.jsonErr(401, errors.UnauthorizedResponseError$inboundSchema), + M.jsonErr(404, errors.NotFoundResponseError$inboundSchema), + M.jsonErr(500, errors.InternalServerResponseError$inboundSchema), + M.fail("4XX"), + M.fail("5XX"), + )(response, req, { extraFields: responseFields }); + if (!result.ok) { + return [result, { status: "complete", request: req, response }]; + } + + return [result, { status: "complete", request: req, response }]; +} diff --git a/src/lib/async-params.ts b/src/lib/async-params.ts index 91a36c96..dc8a918f 100644 --- a/src/lib/async-params.ts +++ b/src/lib/async-params.ts @@ -128,11 +128,20 @@ export async function resolveAsyncFunctions = []; + // Fields that should not be sent to the API (client-side only) + const clientOnlyFields = new Set([ + 'stopWhen', // Handled separately in ModelResult + 'state', // Client-side state management + 'requireApproval', // Client-side approval check function + 'approveToolCalls', // Client-side approval decisions + 'rejectToolCalls', // Client-side rejection decisions + ]); + // Iterate over all keys in the input for (const [key, value] of Object.entries(input)) { - // Skip stopWhen - it's handled separately in ModelResult + // Skip client-only fields - they're handled separately and shouldn't be sent to the API // Note: tools are already in API format at this point (converted in callModel()), so we include them - if (key === 'stopWhen') { + if (clientOnlyFields.has(key)) { continue; } diff --git a/src/lib/config.ts b/src/lib/config.ts index 4903984c..2aabfd33 100644 --- a/src/lib/config.ts +++ b/src/lib/config.ts @@ -3,7 +3,6 @@ * @generated-id: 320761608fb3 */ -import { SDKHooks } from "../hooks/hooks.js"; import { HTTPClient } from "./http.js"; import { Logger } from "./logger.js"; import { RetryConfig } from "./retries.js"; @@ -52,7 +51,6 @@ export type SDKOptions = { retryConfig?: RetryConfig; timeoutMs?: number; debugLogger?: Logger; - hooks?: SDKHooks; }; export function serverURLFromOptions(options: SDKOptions): URL | null { @@ -72,7 +70,7 @@ export function serverURLFromOptions(options: SDKOptions): URL | null { export const SDK_METADATA = { language: "typescript", openapiDocVersion: "1.0.0", - sdkVersion: "0.3.14", + sdkVersion: "0.3.15", genVersion: "2.788.4", - userAgent: "speakeasy-sdk/typescript 0.3.14 2.788.4 1.0.0 @openrouter/sdk", + userAgent: "speakeasy-sdk/typescript 0.3.15 2.788.4 1.0.0 @openrouter/sdk", } as const; diff --git a/src/lib/conversation-state.ts b/src/lib/conversation-state.ts index ea3e7db2..f09da670 100644 --- a/src/lib/conversation-state.ts +++ b/src/lib/conversation-state.ts @@ -248,12 +248,25 @@ export function extractToolCallsFromResponse( for (const item of outputs) { if (item.type === 'function_call') { + let parsedArguments: unknown; + if (typeof item.arguments === 'string') { + try { + parsedArguments = JSON.parse(item.arguments); + } catch (error) { + // Log warning and skip malformed tool call, similar to stream-transformers.ts + console.warn( + `Failed to parse arguments for tool call "${item.name}": ${error instanceof Error ? error.message : String(error)}` + ); + continue; + } + } else { + parsedArguments = item.arguments; + } + const toolCall = { id: item.callId ?? item.id ?? '', name: item.name ?? '', - arguments: typeof item.arguments === 'string' - ? JSON.parse(item.arguments) - : item.arguments, + arguments: parsedArguments, }; if (!isValidParsedToolCall(toolCall)) { throw new Error(`Invalid tool call structure for tool: ${item.name}`); diff --git a/src/lib/model-result.ts b/src/lib/model-result.ts index 45300610..885ac844 100644 --- a/src/lib/model-result.ts +++ b/src/lib/model-result.ts @@ -1219,6 +1219,12 @@ export class ModelResult { */ async getToolCalls(): Promise[]> { await this.initStream(); + + // Handle non-streaming response case - use finalResponse directly + if (this.finalResponse) { + return extractToolCallsFromResponse(this.finalResponse) as ParsedToolCall[]; + } + if (!this.reusableStream) { throw new Error('Stream not initialized'); } diff --git a/src/models/assistantmessage.ts b/src/models/assistantmessage.ts index 6bebeafe..d8a2373c 100644 --- a/src/models/assistantmessage.ts +++ b/src/models/assistantmessage.ts @@ -20,9 +20,23 @@ import { ChatMessageToolCall$outboundSchema, } from "./chatmessagetoolcall.js"; import { SDKValidationError } from "./errors/sdkvalidationerror.js"; +import { + Schema2, + Schema2$inboundSchema, + Schema2$Outbound, + Schema2$outboundSchema, +} from "./schema2.js"; export type AssistantMessageContent = string | Array; +export type AssistantMessageImageUrl = { + url: string; +}; + +export type Image = { + imageUrl: AssistantMessageImageUrl; +}; + export type AssistantMessage = { role: "assistant"; content?: string | Array | null | undefined; @@ -30,6 +44,8 @@ export type AssistantMessage = { toolCalls?: Array | undefined; refusal?: string | null | undefined; reasoning?: string | null | undefined; + reasoningDetails?: Array | undefined; + images?: Array | undefined; }; /** @internal */ @@ -65,6 +81,78 @@ export function assistantMessageContentFromJSON( ); } +/** @internal */ +export const AssistantMessageImageUrl$inboundSchema: z.ZodType< + AssistantMessageImageUrl, + unknown +> = z.object({ + url: z.string(), +}); +/** @internal */ +export type AssistantMessageImageUrl$Outbound = { + url: string; +}; + +/** @internal */ +export const AssistantMessageImageUrl$outboundSchema: z.ZodType< + AssistantMessageImageUrl$Outbound, + AssistantMessageImageUrl +> = z.object({ + url: z.string(), +}); + +export function assistantMessageImageUrlToJSON( + assistantMessageImageUrl: AssistantMessageImageUrl, +): string { + return JSON.stringify( + AssistantMessageImageUrl$outboundSchema.parse(assistantMessageImageUrl), + ); +} +export function assistantMessageImageUrlFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => AssistantMessageImageUrl$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'AssistantMessageImageUrl' from JSON`, + ); +} + +/** @internal */ +export const Image$inboundSchema: z.ZodType = z.object({ + image_url: z.lazy(() => AssistantMessageImageUrl$inboundSchema), +}).transform((v) => { + return remap$(v, { + "image_url": "imageUrl", + }); +}); +/** @internal */ +export type Image$Outbound = { + image_url: AssistantMessageImageUrl$Outbound; +}; + +/** @internal */ +export const Image$outboundSchema: z.ZodType = z.object({ + imageUrl: z.lazy(() => AssistantMessageImageUrl$outboundSchema), +}).transform((v) => { + return remap$(v, { + imageUrl: "image_url", + }); +}); + +export function imageToJSON(image: Image): string { + return JSON.stringify(Image$outboundSchema.parse(image)); +} +export function imageFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => Image$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'Image' from JSON`, + ); +} + /** @internal */ export const AssistantMessage$inboundSchema: z.ZodType< AssistantMessage, @@ -78,9 +166,12 @@ export const AssistantMessage$inboundSchema: z.ZodType< tool_calls: z.array(ChatMessageToolCall$inboundSchema).optional(), refusal: z.nullable(z.string()).optional(), reasoning: z.nullable(z.string()).optional(), + reasoning_details: z.array(Schema2$inboundSchema).optional(), + images: z.array(z.lazy(() => Image$inboundSchema)).optional(), }).transform((v) => { return remap$(v, { "tool_calls": "toolCalls", + "reasoning_details": "reasoningDetails", }); }); /** @internal */ @@ -91,6 +182,8 @@ export type AssistantMessage$Outbound = { tool_calls?: Array | undefined; refusal?: string | null | undefined; reasoning?: string | null | undefined; + reasoning_details?: Array | undefined; + images?: Array | undefined; }; /** @internal */ @@ -106,9 +199,12 @@ export const AssistantMessage$outboundSchema: z.ZodType< toolCalls: z.array(ChatMessageToolCall$outboundSchema).optional(), refusal: z.nullable(z.string()).optional(), reasoning: z.nullable(z.string()).optional(), + reasoningDetails: z.array(Schema2$outboundSchema).optional(), + images: z.array(z.lazy(() => Image$outboundSchema)).optional(), }).transform((v) => { return remap$(v, { toolCalls: "tool_calls", + reasoningDetails: "reasoning_details", }); }); diff --git a/src/models/chatmessagecontentitemimage.ts b/src/models/chatmessagecontentitemimage.ts index 2d47383c..f5d965e2 100644 --- a/src/models/chatmessagecontentitemimage.ts +++ b/src/models/chatmessagecontentitemimage.ts @@ -20,14 +20,14 @@ export type ChatMessageContentItemImageDetail = OpenEnum< typeof ChatMessageContentItemImageDetail >; -export type ImageUrl = { +export type ChatMessageContentItemImageImageUrl = { url: string; detail?: ChatMessageContentItemImageDetail | undefined; }; export type ChatMessageContentItemImage = { type: "image_url"; - imageUrl: ImageUrl; + imageUrl: ChatMessageContentItemImageImageUrl; }; /** @internal */ @@ -42,33 +42,45 @@ export const ChatMessageContentItemImageDetail$outboundSchema: z.ZodType< > = openEnums.outboundSchema(ChatMessageContentItemImageDetail); /** @internal */ -export const ImageUrl$inboundSchema: z.ZodType = z.object({ +export const ChatMessageContentItemImageImageUrl$inboundSchema: z.ZodType< + ChatMessageContentItemImageImageUrl, + unknown +> = z.object({ url: z.string(), detail: ChatMessageContentItemImageDetail$inboundSchema.optional(), }); /** @internal */ -export type ImageUrl$Outbound = { +export type ChatMessageContentItemImageImageUrl$Outbound = { url: string; detail?: string | undefined; }; /** @internal */ -export const ImageUrl$outboundSchema: z.ZodType = z - .object({ - url: z.string(), - detail: ChatMessageContentItemImageDetail$outboundSchema.optional(), - }); +export const ChatMessageContentItemImageImageUrl$outboundSchema: z.ZodType< + ChatMessageContentItemImageImageUrl$Outbound, + ChatMessageContentItemImageImageUrl +> = z.object({ + url: z.string(), + detail: ChatMessageContentItemImageDetail$outboundSchema.optional(), +}); -export function imageUrlToJSON(imageUrl: ImageUrl): string { - return JSON.stringify(ImageUrl$outboundSchema.parse(imageUrl)); +export function chatMessageContentItemImageImageUrlToJSON( + chatMessageContentItemImageImageUrl: ChatMessageContentItemImageImageUrl, +): string { + return JSON.stringify( + ChatMessageContentItemImageImageUrl$outboundSchema.parse( + chatMessageContentItemImageImageUrl, + ), + ); } -export function imageUrlFromJSON( +export function chatMessageContentItemImageImageUrlFromJSON( jsonString: string, -): SafeParseResult { +): SafeParseResult { return safeParse( jsonString, - (x) => ImageUrl$inboundSchema.parse(JSON.parse(x)), - `Failed to parse 'ImageUrl' from JSON`, + (x) => + ChatMessageContentItemImageImageUrl$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'ChatMessageContentItemImageImageUrl' from JSON`, ); } @@ -78,7 +90,7 @@ export const ChatMessageContentItemImage$inboundSchema: z.ZodType< unknown > = z.object({ type: z.literal("image_url"), - image_url: z.lazy(() => ImageUrl$inboundSchema), + image_url: z.lazy(() => ChatMessageContentItemImageImageUrl$inboundSchema), }).transform((v) => { return remap$(v, { "image_url": "imageUrl", @@ -87,7 +99,7 @@ export const ChatMessageContentItemImage$inboundSchema: z.ZodType< /** @internal */ export type ChatMessageContentItemImage$Outbound = { type: "image_url"; - image_url: ImageUrl$Outbound; + image_url: ChatMessageContentItemImageImageUrl$Outbound; }; /** @internal */ @@ -96,7 +108,7 @@ export const ChatMessageContentItemImage$outboundSchema: z.ZodType< ChatMessageContentItemImage > = z.object({ type: z.literal("image_url"), - imageUrl: z.lazy(() => ImageUrl$outboundSchema), + imageUrl: z.lazy(() => ChatMessageContentItemImageImageUrl$outboundSchema), }).transform((v) => { return remap$(v, { imageUrl: "image_url", diff --git a/src/models/chatresponsechoice.ts b/src/models/chatresponsechoice.ts index cfbb8a52..1d46bed8 100644 --- a/src/models/chatresponsechoice.ts +++ b/src/models/chatresponsechoice.ts @@ -20,13 +20,11 @@ import { ChatMessageTokenLogprobs$inboundSchema, } from "./chatmessagetokenlogprobs.js"; import { SDKValidationError } from "./errors/sdkvalidationerror.js"; -import { Schema3, Schema3$inboundSchema } from "./schema3.js"; export type ChatResponseChoice = { finishReason: ChatCompletionFinishReason | null; index: number; message: AssistantMessage; - reasoningDetails?: Array | undefined; logprobs?: ChatMessageTokenLogprobs | null | undefined; }; @@ -38,12 +36,10 @@ export const ChatResponseChoice$inboundSchema: z.ZodType< finish_reason: z.nullable(ChatCompletionFinishReason$inboundSchema), index: z.number(), message: AssistantMessage$inboundSchema, - reasoning_details: z.array(Schema3$inboundSchema).optional(), logprobs: z.nullable(ChatMessageTokenLogprobs$inboundSchema).optional(), }).transform((v) => { return remap$(v, { "finish_reason": "finishReason", - "reasoning_details": "reasoningDetails", }); }); diff --git a/src/models/chatstreamingmessagechunk.ts b/src/models/chatstreamingmessagechunk.ts index 9e132964..2257efb3 100644 --- a/src/models/chatstreamingmessagechunk.ts +++ b/src/models/chatstreamingmessagechunk.ts @@ -13,7 +13,7 @@ import { ChatStreamingMessageToolCall$inboundSchema, } from "./chatstreamingmessagetoolcall.js"; import { SDKValidationError } from "./errors/sdkvalidationerror.js"; -import { Schema3, Schema3$inboundSchema } from "./schema3.js"; +import { Schema2, Schema2$inboundSchema } from "./schema2.js"; export const ChatStreamingMessageChunkRole = { Assistant: "assistant", @@ -28,7 +28,7 @@ export type ChatStreamingMessageChunk = { reasoning?: string | null | undefined; refusal?: string | null | undefined; toolCalls?: Array | undefined; - reasoningDetails?: Array | undefined; + reasoningDetails?: Array | undefined; }; /** @internal */ @@ -46,7 +46,7 @@ export const ChatStreamingMessageChunk$inboundSchema: z.ZodType< reasoning: z.nullable(z.string()).optional(), refusal: z.nullable(z.string()).optional(), tool_calls: z.array(ChatStreamingMessageToolCall$inboundSchema).optional(), - reasoning_details: z.array(Schema3$inboundSchema).optional(), + reasoning_details: z.array(Schema2$inboundSchema).optional(), }).transform((v) => { return remap$(v, { "tool_calls": "toolCalls", diff --git a/src/models/index.ts b/src/models/index.ts index 765d20b9..c9eb3dc8 100644 --- a/src/models/index.ts +++ b/src/models/index.ts @@ -146,7 +146,7 @@ export * from "./responseswebsearchcalloutput.js"; export * from "./responseswebsearchuserlocation.js"; export * from "./responsetextconfig.js"; export * from "./schema0.js"; -export * from "./schema3.js"; +export * from "./schema2.js"; export * from "./security.js"; export * from "./serviceunavailableresponseerrordata.js"; export * from "./systemmessage.js"; diff --git a/src/models/model.ts b/src/models/model.ts index 6248dbe4..bb70d3f4 100644 --- a/src/models/model.ts +++ b/src/models/model.ts @@ -83,6 +83,10 @@ export type Model = { * Default parameters for this model */ defaultParameters: DefaultParameters | null; + /** + * The date after which the model may be removed. ISO 8601 date string (YYYY-MM-DD) or null if no expiration. + */ + expirationDate?: string | null | undefined; }; /** @internal */ @@ -100,6 +104,7 @@ export const Model$inboundSchema: z.ZodType = z.object({ per_request_limits: z.nullable(PerRequestLimits$inboundSchema), supported_parameters: z.array(Parameter$inboundSchema), default_parameters: z.nullable(DefaultParameters$inboundSchema), + expiration_date: z.nullable(z.string()).optional(), }).transform((v) => { return remap$(v, { "canonical_slug": "canonicalSlug", @@ -109,6 +114,7 @@ export const Model$inboundSchema: z.ZodType = z.object({ "per_request_limits": "perRequestLimits", "supported_parameters": "supportedParameters", "default_parameters": "defaultParameters", + "expiration_date": "expirationDate", }); }); diff --git a/src/models/operations/bulkassignkeystoguardrail.ts b/src/models/operations/bulkassignkeystoguardrail.ts new file mode 100644 index 00000000..405daa2d --- /dev/null +++ b/src/models/operations/bulkassignkeystoguardrail.ts @@ -0,0 +1,115 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + * @generated-id: 4f855e3ea589 + */ + +import * as z from "zod/v4"; +import { remap as remap$ } from "../../lib/primitives.js"; +import { safeParse } from "../../lib/schemas.js"; +import { Result as SafeParseResult } from "../../types/fp.js"; +import { SDKValidationError } from "../errors/sdkvalidationerror.js"; + +export type BulkAssignKeysToGuardrailRequestBody = { + /** + * Array of API key hashes to assign to the guardrail + */ + keyHashes: Array; +}; + +export type BulkAssignKeysToGuardrailRequest = { + /** + * The unique identifier of the guardrail + */ + id: string; + requestBody: BulkAssignKeysToGuardrailRequestBody; +}; + +/** + * Assignment result + */ +export type BulkAssignKeysToGuardrailResponse = { + /** + * Number of keys successfully assigned + */ + assignedCount: number; +}; + +/** @internal */ +export type BulkAssignKeysToGuardrailRequestBody$Outbound = { + key_hashes: Array; +}; + +/** @internal */ +export const BulkAssignKeysToGuardrailRequestBody$outboundSchema: z.ZodType< + BulkAssignKeysToGuardrailRequestBody$Outbound, + BulkAssignKeysToGuardrailRequestBody +> = z.object({ + keyHashes: z.array(z.string()), +}).transform((v) => { + return remap$(v, { + keyHashes: "key_hashes", + }); +}); + +export function bulkAssignKeysToGuardrailRequestBodyToJSON( + bulkAssignKeysToGuardrailRequestBody: BulkAssignKeysToGuardrailRequestBody, +): string { + return JSON.stringify( + BulkAssignKeysToGuardrailRequestBody$outboundSchema.parse( + bulkAssignKeysToGuardrailRequestBody, + ), + ); +} + +/** @internal */ +export type BulkAssignKeysToGuardrailRequest$Outbound = { + id: string; + RequestBody: BulkAssignKeysToGuardrailRequestBody$Outbound; +}; + +/** @internal */ +export const BulkAssignKeysToGuardrailRequest$outboundSchema: z.ZodType< + BulkAssignKeysToGuardrailRequest$Outbound, + BulkAssignKeysToGuardrailRequest +> = z.object({ + id: z.string(), + requestBody: z.lazy(() => + BulkAssignKeysToGuardrailRequestBody$outboundSchema + ), +}).transform((v) => { + return remap$(v, { + requestBody: "RequestBody", + }); +}); + +export function bulkAssignKeysToGuardrailRequestToJSON( + bulkAssignKeysToGuardrailRequest: BulkAssignKeysToGuardrailRequest, +): string { + return JSON.stringify( + BulkAssignKeysToGuardrailRequest$outboundSchema.parse( + bulkAssignKeysToGuardrailRequest, + ), + ); +} + +/** @internal */ +export const BulkAssignKeysToGuardrailResponse$inboundSchema: z.ZodType< + BulkAssignKeysToGuardrailResponse, + unknown +> = z.object({ + assigned_count: z.number(), +}).transform((v) => { + return remap$(v, { + "assigned_count": "assignedCount", + }); +}); + +export function bulkAssignKeysToGuardrailResponseFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => BulkAssignKeysToGuardrailResponse$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'BulkAssignKeysToGuardrailResponse' from JSON`, + ); +} diff --git a/src/models/operations/bulkassignmemberstoguardrail.ts b/src/models/operations/bulkassignmemberstoguardrail.ts new file mode 100644 index 00000000..3026a4de --- /dev/null +++ b/src/models/operations/bulkassignmemberstoguardrail.ts @@ -0,0 +1,117 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + * @generated-id: 09a0f06fd33d + */ + +import * as z from "zod/v4"; +import { remap as remap$ } from "../../lib/primitives.js"; +import { safeParse } from "../../lib/schemas.js"; +import { Result as SafeParseResult } from "../../types/fp.js"; +import { SDKValidationError } from "../errors/sdkvalidationerror.js"; + +export type BulkAssignMembersToGuardrailRequestBody = { + /** + * Array of member user IDs to assign to the guardrail + */ + memberUserIds: Array; +}; + +export type BulkAssignMembersToGuardrailRequest = { + /** + * The unique identifier of the guardrail + */ + id: string; + requestBody: BulkAssignMembersToGuardrailRequestBody; +}; + +/** + * Assignment result + */ +export type BulkAssignMembersToGuardrailResponse = { + /** + * Number of members successfully assigned + */ + assignedCount: number; +}; + +/** @internal */ +export type BulkAssignMembersToGuardrailRequestBody$Outbound = { + member_user_ids: Array; +}; + +/** @internal */ +export const BulkAssignMembersToGuardrailRequestBody$outboundSchema: z.ZodType< + BulkAssignMembersToGuardrailRequestBody$Outbound, + BulkAssignMembersToGuardrailRequestBody +> = z.object({ + memberUserIds: z.array(z.string()), +}).transform((v) => { + return remap$(v, { + memberUserIds: "member_user_ids", + }); +}); + +export function bulkAssignMembersToGuardrailRequestBodyToJSON( + bulkAssignMembersToGuardrailRequestBody: + BulkAssignMembersToGuardrailRequestBody, +): string { + return JSON.stringify( + BulkAssignMembersToGuardrailRequestBody$outboundSchema.parse( + bulkAssignMembersToGuardrailRequestBody, + ), + ); +} + +/** @internal */ +export type BulkAssignMembersToGuardrailRequest$Outbound = { + id: string; + RequestBody: BulkAssignMembersToGuardrailRequestBody$Outbound; +}; + +/** @internal */ +export const BulkAssignMembersToGuardrailRequest$outboundSchema: z.ZodType< + BulkAssignMembersToGuardrailRequest$Outbound, + BulkAssignMembersToGuardrailRequest +> = z.object({ + id: z.string(), + requestBody: z.lazy(() => + BulkAssignMembersToGuardrailRequestBody$outboundSchema + ), +}).transform((v) => { + return remap$(v, { + requestBody: "RequestBody", + }); +}); + +export function bulkAssignMembersToGuardrailRequestToJSON( + bulkAssignMembersToGuardrailRequest: BulkAssignMembersToGuardrailRequest, +): string { + return JSON.stringify( + BulkAssignMembersToGuardrailRequest$outboundSchema.parse( + bulkAssignMembersToGuardrailRequest, + ), + ); +} + +/** @internal */ +export const BulkAssignMembersToGuardrailResponse$inboundSchema: z.ZodType< + BulkAssignMembersToGuardrailResponse, + unknown +> = z.object({ + assigned_count: z.number(), +}).transform((v) => { + return remap$(v, { + "assigned_count": "assignedCount", + }); +}); + +export function bulkAssignMembersToGuardrailResponseFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => + BulkAssignMembersToGuardrailResponse$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'BulkAssignMembersToGuardrailResponse' from JSON`, + ); +} diff --git a/src/models/operations/bulkunassignkeysfromguardrail.ts b/src/models/operations/bulkunassignkeysfromguardrail.ts new file mode 100644 index 00000000..93994392 --- /dev/null +++ b/src/models/operations/bulkunassignkeysfromguardrail.ts @@ -0,0 +1,117 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + * @generated-id: 5ff688d2a0f6 + */ + +import * as z from "zod/v4"; +import { remap as remap$ } from "../../lib/primitives.js"; +import { safeParse } from "../../lib/schemas.js"; +import { Result as SafeParseResult } from "../../types/fp.js"; +import { SDKValidationError } from "../errors/sdkvalidationerror.js"; + +export type BulkUnassignKeysFromGuardrailRequestBody = { + /** + * Array of API key hashes to unassign from the guardrail + */ + keyHashes: Array; +}; + +export type BulkUnassignKeysFromGuardrailRequest = { + /** + * The unique identifier of the guardrail + */ + id: string; + requestBody: BulkUnassignKeysFromGuardrailRequestBody; +}; + +/** + * Unassignment result + */ +export type BulkUnassignKeysFromGuardrailResponse = { + /** + * Number of keys successfully unassigned + */ + unassignedCount: number; +}; + +/** @internal */ +export type BulkUnassignKeysFromGuardrailRequestBody$Outbound = { + key_hashes: Array; +}; + +/** @internal */ +export const BulkUnassignKeysFromGuardrailRequestBody$outboundSchema: z.ZodType< + BulkUnassignKeysFromGuardrailRequestBody$Outbound, + BulkUnassignKeysFromGuardrailRequestBody +> = z.object({ + keyHashes: z.array(z.string()), +}).transform((v) => { + return remap$(v, { + keyHashes: "key_hashes", + }); +}); + +export function bulkUnassignKeysFromGuardrailRequestBodyToJSON( + bulkUnassignKeysFromGuardrailRequestBody: + BulkUnassignKeysFromGuardrailRequestBody, +): string { + return JSON.stringify( + BulkUnassignKeysFromGuardrailRequestBody$outboundSchema.parse( + bulkUnassignKeysFromGuardrailRequestBody, + ), + ); +} + +/** @internal */ +export type BulkUnassignKeysFromGuardrailRequest$Outbound = { + id: string; + RequestBody: BulkUnassignKeysFromGuardrailRequestBody$Outbound; +}; + +/** @internal */ +export const BulkUnassignKeysFromGuardrailRequest$outboundSchema: z.ZodType< + BulkUnassignKeysFromGuardrailRequest$Outbound, + BulkUnassignKeysFromGuardrailRequest +> = z.object({ + id: z.string(), + requestBody: z.lazy(() => + BulkUnassignKeysFromGuardrailRequestBody$outboundSchema + ), +}).transform((v) => { + return remap$(v, { + requestBody: "RequestBody", + }); +}); + +export function bulkUnassignKeysFromGuardrailRequestToJSON( + bulkUnassignKeysFromGuardrailRequest: BulkUnassignKeysFromGuardrailRequest, +): string { + return JSON.stringify( + BulkUnassignKeysFromGuardrailRequest$outboundSchema.parse( + bulkUnassignKeysFromGuardrailRequest, + ), + ); +} + +/** @internal */ +export const BulkUnassignKeysFromGuardrailResponse$inboundSchema: z.ZodType< + BulkUnassignKeysFromGuardrailResponse, + unknown +> = z.object({ + unassigned_count: z.number(), +}).transform((v) => { + return remap$(v, { + "unassigned_count": "unassignedCount", + }); +}); + +export function bulkUnassignKeysFromGuardrailResponseFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => + BulkUnassignKeysFromGuardrailResponse$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'BulkUnassignKeysFromGuardrailResponse' from JSON`, + ); +} diff --git a/src/models/operations/bulkunassignmembersfromguardrail.ts b/src/models/operations/bulkunassignmembersfromguardrail.ts new file mode 100644 index 00000000..a600e1b1 --- /dev/null +++ b/src/models/operations/bulkunassignmembersfromguardrail.ts @@ -0,0 +1,124 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + * @generated-id: ab90e9780326 + */ + +import * as z from "zod/v4"; +import { remap as remap$ } from "../../lib/primitives.js"; +import { safeParse } from "../../lib/schemas.js"; +import { Result as SafeParseResult } from "../../types/fp.js"; +import { SDKValidationError } from "../errors/sdkvalidationerror.js"; + +export type BulkUnassignMembersFromGuardrailRequestBody = { + /** + * Array of member user IDs to unassign from the guardrail + */ + memberUserIds: Array; +}; + +export type BulkUnassignMembersFromGuardrailRequest = { + /** + * The unique identifier of the guardrail + */ + id: string; + requestBody: BulkUnassignMembersFromGuardrailRequestBody; +}; + +/** + * Unassignment result + */ +export type BulkUnassignMembersFromGuardrailResponse = { + /** + * Number of members successfully unassigned + */ + unassignedCount: number; +}; + +/** @internal */ +export type BulkUnassignMembersFromGuardrailRequestBody$Outbound = { + member_user_ids: Array; +}; + +/** @internal */ +export const BulkUnassignMembersFromGuardrailRequestBody$outboundSchema: + z.ZodType< + BulkUnassignMembersFromGuardrailRequestBody$Outbound, + BulkUnassignMembersFromGuardrailRequestBody + > = z.object({ + memberUserIds: z.array(z.string()), + }).transform((v) => { + return remap$(v, { + memberUserIds: "member_user_ids", + }); + }); + +export function bulkUnassignMembersFromGuardrailRequestBodyToJSON( + bulkUnassignMembersFromGuardrailRequestBody: + BulkUnassignMembersFromGuardrailRequestBody, +): string { + return JSON.stringify( + BulkUnassignMembersFromGuardrailRequestBody$outboundSchema.parse( + bulkUnassignMembersFromGuardrailRequestBody, + ), + ); +} + +/** @internal */ +export type BulkUnassignMembersFromGuardrailRequest$Outbound = { + id: string; + RequestBody: BulkUnassignMembersFromGuardrailRequestBody$Outbound; +}; + +/** @internal */ +export const BulkUnassignMembersFromGuardrailRequest$outboundSchema: z.ZodType< + BulkUnassignMembersFromGuardrailRequest$Outbound, + BulkUnassignMembersFromGuardrailRequest +> = z.object({ + id: z.string(), + requestBody: z.lazy(() => + BulkUnassignMembersFromGuardrailRequestBody$outboundSchema + ), +}).transform((v) => { + return remap$(v, { + requestBody: "RequestBody", + }); +}); + +export function bulkUnassignMembersFromGuardrailRequestToJSON( + bulkUnassignMembersFromGuardrailRequest: + BulkUnassignMembersFromGuardrailRequest, +): string { + return JSON.stringify( + BulkUnassignMembersFromGuardrailRequest$outboundSchema.parse( + bulkUnassignMembersFromGuardrailRequest, + ), + ); +} + +/** @internal */ +export const BulkUnassignMembersFromGuardrailResponse$inboundSchema: z.ZodType< + BulkUnassignMembersFromGuardrailResponse, + unknown +> = z.object({ + unassigned_count: z.number(), +}).transform((v) => { + return remap$(v, { + "unassigned_count": "unassignedCount", + }); +}); + +export function bulkUnassignMembersFromGuardrailResponseFromJSON( + jsonString: string, +): SafeParseResult< + BulkUnassignMembersFromGuardrailResponse, + SDKValidationError +> { + return safeParse( + jsonString, + (x) => + BulkUnassignMembersFromGuardrailResponse$inboundSchema.parse( + JSON.parse(x), + ), + `Failed to parse 'BulkUnassignMembersFromGuardrailResponse' from JSON`, + ); +} diff --git a/src/models/operations/createguardrail.ts b/src/models/operations/createguardrail.ts new file mode 100644 index 00000000..c4a2bebb --- /dev/null +++ b/src/models/operations/createguardrail.ts @@ -0,0 +1,239 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + * @generated-id: 5f0f56d14d79 + */ + +import * as z from "zod/v4"; +import { remap as remap$ } from "../../lib/primitives.js"; +import { safeParse } from "../../lib/schemas.js"; +import * as openEnums from "../../types/enums.js"; +import { OpenEnum } from "../../types/enums.js"; +import { Result as SafeParseResult } from "../../types/fp.js"; +import { SDKValidationError } from "../errors/sdkvalidationerror.js"; + +/** + * Interval at which the limit resets (daily, weekly, monthly) + */ +export const CreateGuardrailResetIntervalRequest = { + Daily: "daily", + Weekly: "weekly", + Monthly: "monthly", +} as const; +/** + * Interval at which the limit resets (daily, weekly, monthly) + */ +export type CreateGuardrailResetIntervalRequest = OpenEnum< + typeof CreateGuardrailResetIntervalRequest +>; + +export type CreateGuardrailRequest = { + /** + * Name for the new guardrail + */ + name: string; + /** + * Description of the guardrail + */ + description?: string | null | undefined; + /** + * Spending limit in USD + */ + limitUsd?: number | null | undefined; + /** + * Interval at which the limit resets (daily, weekly, monthly) + */ + resetInterval?: CreateGuardrailResetIntervalRequest | null | undefined; + /** + * List of allowed provider IDs + */ + allowedProviders?: Array | null | undefined; + /** + * Array of model identifiers (slug or canonical_slug accepted) + */ + allowedModels?: Array | null | undefined; + /** + * Whether to enforce zero data retention + */ + enforceZdr?: boolean | null | undefined; +}; + +/** + * Interval at which the limit resets (daily, weekly, monthly) + */ +export const CreateGuardrailResetIntervalResponse = { + Daily: "daily", + Weekly: "weekly", + Monthly: "monthly", +} as const; +/** + * Interval at which the limit resets (daily, weekly, monthly) + */ +export type CreateGuardrailResetIntervalResponse = OpenEnum< + typeof CreateGuardrailResetIntervalResponse +>; + +/** + * The created guardrail + */ +export type CreateGuardrailData = { + /** + * Unique identifier for the guardrail + */ + id: string; + /** + * Name of the guardrail + */ + name: string; + /** + * Description of the guardrail + */ + description?: string | null | undefined; + /** + * Spending limit in USD + */ + limitUsd?: number | null | undefined; + /** + * Interval at which the limit resets (daily, weekly, monthly) + */ + resetInterval?: CreateGuardrailResetIntervalResponse | null | undefined; + /** + * List of allowed provider IDs + */ + allowedProviders?: Array | null | undefined; + /** + * Array of model canonical_slugs (immutable identifiers) + */ + allowedModels?: Array | null | undefined; + /** + * Whether to enforce zero data retention + */ + enforceZdr?: boolean | null | undefined; + /** + * ISO 8601 timestamp of when the guardrail was created + */ + createdAt: string; + /** + * ISO 8601 timestamp of when the guardrail was last updated + */ + updatedAt?: string | null | undefined; +}; + +/** + * Guardrail created successfully + */ +export type CreateGuardrailResponse = { + /** + * The created guardrail + */ + data: CreateGuardrailData; +}; + +/** @internal */ +export const CreateGuardrailResetIntervalRequest$outboundSchema: z.ZodType< + string, + CreateGuardrailResetIntervalRequest +> = openEnums.outboundSchema(CreateGuardrailResetIntervalRequest); + +/** @internal */ +export type CreateGuardrailRequest$Outbound = { + name: string; + description?: string | null | undefined; + limit_usd?: number | null | undefined; + reset_interval?: string | null | undefined; + allowed_providers?: Array | null | undefined; + allowed_models?: Array | null | undefined; + enforce_zdr?: boolean | null | undefined; +}; + +/** @internal */ +export const CreateGuardrailRequest$outboundSchema: z.ZodType< + CreateGuardrailRequest$Outbound, + CreateGuardrailRequest +> = z.object({ + name: z.string(), + description: z.nullable(z.string()).optional(), + limitUsd: z.nullable(z.number()).optional(), + resetInterval: z.nullable(CreateGuardrailResetIntervalRequest$outboundSchema) + .optional(), + allowedProviders: z.nullable(z.array(z.string())).optional(), + allowedModels: z.nullable(z.array(z.string())).optional(), + enforceZdr: z.nullable(z.boolean()).optional(), +}).transform((v) => { + return remap$(v, { + limitUsd: "limit_usd", + resetInterval: "reset_interval", + allowedProviders: "allowed_providers", + allowedModels: "allowed_models", + enforceZdr: "enforce_zdr", + }); +}); + +export function createGuardrailRequestToJSON( + createGuardrailRequest: CreateGuardrailRequest, +): string { + return JSON.stringify( + CreateGuardrailRequest$outboundSchema.parse(createGuardrailRequest), + ); +} + +/** @internal */ +export const CreateGuardrailResetIntervalResponse$inboundSchema: z.ZodType< + CreateGuardrailResetIntervalResponse, + unknown +> = openEnums.inboundSchema(CreateGuardrailResetIntervalResponse); + +/** @internal */ +export const CreateGuardrailData$inboundSchema: z.ZodType< + CreateGuardrailData, + unknown +> = z.object({ + id: z.string(), + name: z.string(), + description: z.nullable(z.string()).optional(), + limit_usd: z.nullable(z.number()).optional(), + reset_interval: z.nullable(CreateGuardrailResetIntervalResponse$inboundSchema) + .optional(), + allowed_providers: z.nullable(z.array(z.string())).optional(), + allowed_models: z.nullable(z.array(z.string())).optional(), + enforce_zdr: z.nullable(z.boolean()).optional(), + created_at: z.string(), + updated_at: z.nullable(z.string()).optional(), +}).transform((v) => { + return remap$(v, { + "limit_usd": "limitUsd", + "reset_interval": "resetInterval", + "allowed_providers": "allowedProviders", + "allowed_models": "allowedModels", + "enforce_zdr": "enforceZdr", + "created_at": "createdAt", + "updated_at": "updatedAt", + }); +}); + +export function createGuardrailDataFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => CreateGuardrailData$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'CreateGuardrailData' from JSON`, + ); +} + +/** @internal */ +export const CreateGuardrailResponse$inboundSchema: z.ZodType< + CreateGuardrailResponse, + unknown +> = z.object({ + data: z.lazy(() => CreateGuardrailData$inboundSchema), +}); + +export function createGuardrailResponseFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => CreateGuardrailResponse$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'CreateGuardrailResponse' from JSON`, + ); +} diff --git a/src/models/operations/deleteguardrail.ts b/src/models/operations/deleteguardrail.ts new file mode 100644 index 00000000..a3e14114 --- /dev/null +++ b/src/models/operations/deleteguardrail.ts @@ -0,0 +1,65 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + * @generated-id: 0319276942bf + */ + +import * as z from "zod/v4"; +import { safeParse } from "../../lib/schemas.js"; +import { Result as SafeParseResult } from "../../types/fp.js"; +import { SDKValidationError } from "../errors/sdkvalidationerror.js"; + +export type DeleteGuardrailRequest = { + /** + * The unique identifier of the guardrail to delete + */ + id: string; +}; + +/** + * Guardrail deleted successfully + */ +export type DeleteGuardrailResponse = { + /** + * Confirmation that the guardrail was deleted + */ + deleted: true; +}; + +/** @internal */ +export type DeleteGuardrailRequest$Outbound = { + id: string; +}; + +/** @internal */ +export const DeleteGuardrailRequest$outboundSchema: z.ZodType< + DeleteGuardrailRequest$Outbound, + DeleteGuardrailRequest +> = z.object({ + id: z.string(), +}); + +export function deleteGuardrailRequestToJSON( + deleteGuardrailRequest: DeleteGuardrailRequest, +): string { + return JSON.stringify( + DeleteGuardrailRequest$outboundSchema.parse(deleteGuardrailRequest), + ); +} + +/** @internal */ +export const DeleteGuardrailResponse$inboundSchema: z.ZodType< + DeleteGuardrailResponse, + unknown +> = z.object({ + deleted: z.literal(true), +}); + +export function deleteGuardrailResponseFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => DeleteGuardrailResponse$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'DeleteGuardrailResponse' from JSON`, + ); +} diff --git a/src/models/operations/getguardrail.ts b/src/models/operations/getguardrail.ts new file mode 100644 index 00000000..f9afb314 --- /dev/null +++ b/src/models/operations/getguardrail.ts @@ -0,0 +1,173 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + * @generated-id: 5a16015b4d1f + */ + +import * as z from "zod/v4"; +import { remap as remap$ } from "../../lib/primitives.js"; +import { safeParse } from "../../lib/schemas.js"; +import * as openEnums from "../../types/enums.js"; +import { OpenEnum } from "../../types/enums.js"; +import { Result as SafeParseResult } from "../../types/fp.js"; +import { SDKValidationError } from "../errors/sdkvalidationerror.js"; + +export type GetGuardrailRequest = { + /** + * The unique identifier of the guardrail to retrieve + */ + id: string; +}; + +/** + * Interval at which the limit resets (daily, weekly, monthly) + */ +export const GetGuardrailResetInterval = { + Daily: "daily", + Weekly: "weekly", + Monthly: "monthly", +} as const; +/** + * Interval at which the limit resets (daily, weekly, monthly) + */ +export type GetGuardrailResetInterval = OpenEnum< + typeof GetGuardrailResetInterval +>; + +/** + * The guardrail + */ +export type GetGuardrailData = { + /** + * Unique identifier for the guardrail + */ + id: string; + /** + * Name of the guardrail + */ + name: string; + /** + * Description of the guardrail + */ + description?: string | null | undefined; + /** + * Spending limit in USD + */ + limitUsd?: number | null | undefined; + /** + * Interval at which the limit resets (daily, weekly, monthly) + */ + resetInterval?: GetGuardrailResetInterval | null | undefined; + /** + * List of allowed provider IDs + */ + allowedProviders?: Array | null | undefined; + /** + * Array of model canonical_slugs (immutable identifiers) + */ + allowedModels?: Array | null | undefined; + /** + * Whether to enforce zero data retention + */ + enforceZdr?: boolean | null | undefined; + /** + * ISO 8601 timestamp of when the guardrail was created + */ + createdAt: string; + /** + * ISO 8601 timestamp of when the guardrail was last updated + */ + updatedAt?: string | null | undefined; +}; + +/** + * Guardrail details + */ +export type GetGuardrailResponse = { + /** + * The guardrail + */ + data: GetGuardrailData; +}; + +/** @internal */ +export type GetGuardrailRequest$Outbound = { + id: string; +}; + +/** @internal */ +export const GetGuardrailRequest$outboundSchema: z.ZodType< + GetGuardrailRequest$Outbound, + GetGuardrailRequest +> = z.object({ + id: z.string(), +}); + +export function getGuardrailRequestToJSON( + getGuardrailRequest: GetGuardrailRequest, +): string { + return JSON.stringify( + GetGuardrailRequest$outboundSchema.parse(getGuardrailRequest), + ); +} + +/** @internal */ +export const GetGuardrailResetInterval$inboundSchema: z.ZodType< + GetGuardrailResetInterval, + unknown +> = openEnums.inboundSchema(GetGuardrailResetInterval); + +/** @internal */ +export const GetGuardrailData$inboundSchema: z.ZodType< + GetGuardrailData, + unknown +> = z.object({ + id: z.string(), + name: z.string(), + description: z.nullable(z.string()).optional(), + limit_usd: z.nullable(z.number()).optional(), + reset_interval: z.nullable(GetGuardrailResetInterval$inboundSchema) + .optional(), + allowed_providers: z.nullable(z.array(z.string())).optional(), + allowed_models: z.nullable(z.array(z.string())).optional(), + enforce_zdr: z.nullable(z.boolean()).optional(), + created_at: z.string(), + updated_at: z.nullable(z.string()).optional(), +}).transform((v) => { + return remap$(v, { + "limit_usd": "limitUsd", + "reset_interval": "resetInterval", + "allowed_providers": "allowedProviders", + "allowed_models": "allowedModels", + "enforce_zdr": "enforceZdr", + "created_at": "createdAt", + "updated_at": "updatedAt", + }); +}); + +export function getGuardrailDataFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => GetGuardrailData$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'GetGuardrailData' from JSON`, + ); +} + +/** @internal */ +export const GetGuardrailResponse$inboundSchema: z.ZodType< + GetGuardrailResponse, + unknown +> = z.object({ + data: z.lazy(() => GetGuardrailData$inboundSchema), +}); + +export function getGuardrailResponseFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => GetGuardrailResponse$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'GetGuardrailResponse' from JSON`, + ); +} diff --git a/src/models/operations/getmodels.ts b/src/models/operations/getmodels.ts index 97bb2f81..8abb67bf 100644 --- a/src/models/operations/getmodels.ts +++ b/src/models/operations/getmodels.ts @@ -5,12 +5,43 @@ import * as z from "zod/v4"; import { remap as remap$ } from "../../lib/primitives.js"; +import * as openEnums from "../../types/enums.js"; +import { OpenEnum } from "../../types/enums.js"; + +/** + * Filter models by use case category + */ +export const Category = { + Programming: "programming", + Roleplay: "roleplay", + Marketing: "marketing", + MarketingSeo: "marketing/seo", + Technology: "technology", + Science: "science", + Translation: "translation", + Legal: "legal", + Finance: "finance", + Health: "health", + Trivia: "trivia", + Academia: "academia", +} as const; +/** + * Filter models by use case category + */ +export type Category = OpenEnum; export type GetModelsRequest = { - category?: string | undefined; + /** + * Filter models by use case category + */ + category?: Category | undefined; supportedParameters?: string | undefined; }; +/** @internal */ +export const Category$outboundSchema: z.ZodType = openEnums + .outboundSchema(Category); + /** @internal */ export type GetModelsRequest$Outbound = { category?: string | undefined; @@ -22,7 +53,7 @@ export const GetModelsRequest$outboundSchema: z.ZodType< GetModelsRequest$Outbound, GetModelsRequest > = z.object({ - category: z.string().optional(), + category: Category$outboundSchema.optional(), supportedParameters: z.string().optional(), }).transform((v) => { return remap$(v, { diff --git a/src/models/operations/getparameters.ts b/src/models/operations/getparameters.ts deleted file mode 100644 index 8efe05fe..00000000 --- a/src/models/operations/getparameters.ts +++ /dev/null @@ -1,168 +0,0 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - * @generated-id: 9b364a4cca61 - */ - -import * as z from "zod/v4"; -import { remap as remap$ } from "../../lib/primitives.js"; -import { safeParse } from "../../lib/schemas.js"; -import * as openEnums from "../../types/enums.js"; -import { OpenEnum } from "../../types/enums.js"; -import { Result as SafeParseResult } from "../../types/fp.js"; -import { SDKValidationError } from "../errors/sdkvalidationerror.js"; -import * as models from "../index.js"; - -export type GetParametersSecurity = { - bearer: string; -}; - -export type GetParametersRequest = { - author: string; - slug: string; - provider?: models.ProviderName | undefined; -}; - -export const SupportedParameter = { - Temperature: "temperature", - TopP: "top_p", - TopK: "top_k", - MinP: "min_p", - TopA: "top_a", - FrequencyPenalty: "frequency_penalty", - PresencePenalty: "presence_penalty", - RepetitionPenalty: "repetition_penalty", - MaxTokens: "max_tokens", - LogitBias: "logit_bias", - Logprobs: "logprobs", - TopLogprobs: "top_logprobs", - Seed: "seed", - ResponseFormat: "response_format", - StructuredOutputs: "structured_outputs", - Stop: "stop", - Tools: "tools", - ToolChoice: "tool_choice", - ParallelToolCalls: "parallel_tool_calls", - IncludeReasoning: "include_reasoning", - Reasoning: "reasoning", - ReasoningEffort: "reasoning_effort", - WebSearchOptions: "web_search_options", - Verbosity: "verbosity", -} as const; -export type SupportedParameter = OpenEnum; - -/** - * Parameter analytics data - */ -export type GetParametersData = { - /** - * Model identifier - */ - model: string; - /** - * List of parameters supported by this model - */ - supportedParameters: Array; -}; - -/** - * Returns the parameters for the specified model - */ -export type GetParametersResponse = { - /** - * Parameter analytics data - */ - data: GetParametersData; -}; - -/** @internal */ -export type GetParametersSecurity$Outbound = { - bearer: string; -}; - -/** @internal */ -export const GetParametersSecurity$outboundSchema: z.ZodType< - GetParametersSecurity$Outbound, - GetParametersSecurity -> = z.object({ - bearer: z.string(), -}); - -export function getParametersSecurityToJSON( - getParametersSecurity: GetParametersSecurity, -): string { - return JSON.stringify( - GetParametersSecurity$outboundSchema.parse(getParametersSecurity), - ); -} - -/** @internal */ -export type GetParametersRequest$Outbound = { - author: string; - slug: string; - provider?: string | undefined; -}; - -/** @internal */ -export const GetParametersRequest$outboundSchema: z.ZodType< - GetParametersRequest$Outbound, - GetParametersRequest -> = z.object({ - author: z.string(), - slug: z.string(), - provider: models.ProviderName$outboundSchema.optional(), -}); - -export function getParametersRequestToJSON( - getParametersRequest: GetParametersRequest, -): string { - return JSON.stringify( - GetParametersRequest$outboundSchema.parse(getParametersRequest), - ); -} - -/** @internal */ -export const SupportedParameter$inboundSchema: z.ZodType< - SupportedParameter, - unknown -> = openEnums.inboundSchema(SupportedParameter); - -/** @internal */ -export const GetParametersData$inboundSchema: z.ZodType< - GetParametersData, - unknown -> = z.object({ - model: z.string(), - supported_parameters: z.array(SupportedParameter$inboundSchema), -}).transform((v) => { - return remap$(v, { - "supported_parameters": "supportedParameters", - }); -}); - -export function getParametersDataFromJSON( - jsonString: string, -): SafeParseResult { - return safeParse( - jsonString, - (x) => GetParametersData$inboundSchema.parse(JSON.parse(x)), - `Failed to parse 'GetParametersData' from JSON`, - ); -} - -/** @internal */ -export const GetParametersResponse$inboundSchema: z.ZodType< - GetParametersResponse, - unknown -> = z.object({ - data: z.lazy(() => GetParametersData$inboundSchema), -}); - -export function getParametersResponseFromJSON( - jsonString: string, -): SafeParseResult { - return safeParse( - jsonString, - (x) => GetParametersResponse$inboundSchema.parse(JSON.parse(x)), - `Failed to parse 'GetParametersResponse' from JSON`, - ); -} diff --git a/src/models/operations/index.ts b/src/models/operations/index.ts index 5293b341..4e9fc306 100644 --- a/src/models/operations/index.ts +++ b/src/models/operations/index.ts @@ -3,24 +3,36 @@ * @generated-id: 0d9ffaf774d2 */ +export * from "./bulkassignkeystoguardrail.js"; +export * from "./bulkassignmemberstoguardrail.js"; +export * from "./bulkunassignkeysfromguardrail.js"; +export * from "./bulkunassignmembersfromguardrail.js"; export * from "./createauthkeyscode.js"; export * from "./createcoinbasecharge.js"; export * from "./createembeddings.js"; +export * from "./createguardrail.js"; export * from "./createkeys.js"; export * from "./createresponses.js"; +export * from "./deleteguardrail.js"; export * from "./deletekeys.js"; export * from "./exchangeauthcodeforapikey.js"; export * from "./getcredits.js"; export * from "./getcurrentkey.js"; export * from "./getgeneration.js"; +export * from "./getguardrail.js"; export * from "./getkey.js"; export * from "./getmodels.js"; -export * from "./getparameters.js"; export * from "./getuseractivity.js"; export * from "./list.js"; export * from "./listendpoints.js"; export * from "./listendpointszdr.js"; +export * from "./listguardrailkeyassignments.js"; +export * from "./listguardrailmemberassignments.js"; +export * from "./listguardrails.js"; +export * from "./listkeyassignments.js"; +export * from "./listmemberassignments.js"; export * from "./listmodelsuser.js"; export * from "./listproviders.js"; export * from "./sendchatcompletionrequest.js"; +export * from "./updateguardrail.js"; export * from "./updatekeys.js"; diff --git a/src/models/operations/listguardrailkeyassignments.ts b/src/models/operations/listguardrailkeyassignments.ts new file mode 100644 index 00000000..43cccfef --- /dev/null +++ b/src/models/operations/listguardrailkeyassignments.ts @@ -0,0 +1,154 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + * @generated-id: e616af13fd7a + */ + +import * as z from "zod/v4"; +import { remap as remap$ } from "../../lib/primitives.js"; +import { safeParse } from "../../lib/schemas.js"; +import { Result as SafeParseResult } from "../../types/fp.js"; +import { SDKValidationError } from "../errors/sdkvalidationerror.js"; + +export type ListGuardrailKeyAssignmentsRequest = { + /** + * The unique identifier of the guardrail + */ + id: string; + /** + * Number of records to skip for pagination + */ + offset?: string | undefined; + /** + * Maximum number of records to return (max 100) + */ + limit?: string | undefined; +}; + +export type ListGuardrailKeyAssignmentsData = { + /** + * Unique identifier for the assignment + */ + id: string; + /** + * Hash of the assigned API key + */ + keyHash: string; + /** + * ID of the guardrail + */ + guardrailId: string; + /** + * Name of the API key + */ + keyName: string; + /** + * Label of the API key + */ + keyLabel: string; + /** + * User ID of who made the assignment + */ + assignedBy: string | null; + /** + * ISO 8601 timestamp of when the assignment was created + */ + createdAt: string; +}; + +/** + * List of key assignments + */ +export type ListGuardrailKeyAssignmentsResponse = { + /** + * List of key assignments + */ + data: Array; + /** + * Total number of key assignments for this guardrail + */ + totalCount: number; +}; + +/** @internal */ +export type ListGuardrailKeyAssignmentsRequest$Outbound = { + id: string; + offset?: string | undefined; + limit?: string | undefined; +}; + +/** @internal */ +export const ListGuardrailKeyAssignmentsRequest$outboundSchema: z.ZodType< + ListGuardrailKeyAssignmentsRequest$Outbound, + ListGuardrailKeyAssignmentsRequest +> = z.object({ + id: z.string(), + offset: z.string().optional(), + limit: z.string().optional(), +}); + +export function listGuardrailKeyAssignmentsRequestToJSON( + listGuardrailKeyAssignmentsRequest: ListGuardrailKeyAssignmentsRequest, +): string { + return JSON.stringify( + ListGuardrailKeyAssignmentsRequest$outboundSchema.parse( + listGuardrailKeyAssignmentsRequest, + ), + ); +} + +/** @internal */ +export const ListGuardrailKeyAssignmentsData$inboundSchema: z.ZodType< + ListGuardrailKeyAssignmentsData, + unknown +> = z.object({ + id: z.string(), + key_hash: z.string(), + guardrail_id: z.string(), + key_name: z.string(), + key_label: z.string(), + assigned_by: z.nullable(z.string()), + created_at: z.string(), +}).transform((v) => { + return remap$(v, { + "key_hash": "keyHash", + "guardrail_id": "guardrailId", + "key_name": "keyName", + "key_label": "keyLabel", + "assigned_by": "assignedBy", + "created_at": "createdAt", + }); +}); + +export function listGuardrailKeyAssignmentsDataFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => ListGuardrailKeyAssignmentsData$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'ListGuardrailKeyAssignmentsData' from JSON`, + ); +} + +/** @internal */ +export const ListGuardrailKeyAssignmentsResponse$inboundSchema: z.ZodType< + ListGuardrailKeyAssignmentsResponse, + unknown +> = z.object({ + data: z.array(z.lazy(() => ListGuardrailKeyAssignmentsData$inboundSchema)), + total_count: z.number(), +}).transform((v) => { + return remap$(v, { + "total_count": "totalCount", + }); +}); + +export function listGuardrailKeyAssignmentsResponseFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => + ListGuardrailKeyAssignmentsResponse$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'ListGuardrailKeyAssignmentsResponse' from JSON`, + ); +} diff --git a/src/models/operations/listguardrailmemberassignments.ts b/src/models/operations/listguardrailmemberassignments.ts new file mode 100644 index 00000000..834684e8 --- /dev/null +++ b/src/models/operations/listguardrailmemberassignments.ts @@ -0,0 +1,149 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + * @generated-id: 37ee24c57c33 + */ + +import * as z from "zod/v4"; +import { remap as remap$ } from "../../lib/primitives.js"; +import { safeParse } from "../../lib/schemas.js"; +import { Result as SafeParseResult } from "../../types/fp.js"; +import { SDKValidationError } from "../errors/sdkvalidationerror.js"; + +export type ListGuardrailMemberAssignmentsRequest = { + /** + * The unique identifier of the guardrail + */ + id: string; + /** + * Number of records to skip for pagination + */ + offset?: string | undefined; + /** + * Maximum number of records to return (max 100) + */ + limit?: string | undefined; +}; + +export type ListGuardrailMemberAssignmentsData = { + /** + * Unique identifier for the assignment + */ + id: string; + /** + * Clerk user ID of the assigned member + */ + userId: string; + /** + * Organization ID + */ + organizationId: string; + /** + * ID of the guardrail + */ + guardrailId: string; + /** + * User ID of who made the assignment + */ + assignedBy: string | null; + /** + * ISO 8601 timestamp of when the assignment was created + */ + createdAt: string; +}; + +/** + * List of member assignments + */ +export type ListGuardrailMemberAssignmentsResponse = { + /** + * List of member assignments + */ + data: Array; + /** + * Total number of member assignments + */ + totalCount: number; +}; + +/** @internal */ +export type ListGuardrailMemberAssignmentsRequest$Outbound = { + id: string; + offset?: string | undefined; + limit?: string | undefined; +}; + +/** @internal */ +export const ListGuardrailMemberAssignmentsRequest$outboundSchema: z.ZodType< + ListGuardrailMemberAssignmentsRequest$Outbound, + ListGuardrailMemberAssignmentsRequest +> = z.object({ + id: z.string(), + offset: z.string().optional(), + limit: z.string().optional(), +}); + +export function listGuardrailMemberAssignmentsRequestToJSON( + listGuardrailMemberAssignmentsRequest: ListGuardrailMemberAssignmentsRequest, +): string { + return JSON.stringify( + ListGuardrailMemberAssignmentsRequest$outboundSchema.parse( + listGuardrailMemberAssignmentsRequest, + ), + ); +} + +/** @internal */ +export const ListGuardrailMemberAssignmentsData$inboundSchema: z.ZodType< + ListGuardrailMemberAssignmentsData, + unknown +> = z.object({ + id: z.string(), + user_id: z.string(), + organization_id: z.string(), + guardrail_id: z.string(), + assigned_by: z.nullable(z.string()), + created_at: z.string(), +}).transform((v) => { + return remap$(v, { + "user_id": "userId", + "organization_id": "organizationId", + "guardrail_id": "guardrailId", + "assigned_by": "assignedBy", + "created_at": "createdAt", + }); +}); + +export function listGuardrailMemberAssignmentsDataFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => + ListGuardrailMemberAssignmentsData$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'ListGuardrailMemberAssignmentsData' from JSON`, + ); +} + +/** @internal */ +export const ListGuardrailMemberAssignmentsResponse$inboundSchema: z.ZodType< + ListGuardrailMemberAssignmentsResponse, + unknown +> = z.object({ + data: z.array(z.lazy(() => ListGuardrailMemberAssignmentsData$inboundSchema)), + total_count: z.number(), +}).transform((v) => { + return remap$(v, { + "total_count": "totalCount", + }); +}); + +export function listGuardrailMemberAssignmentsResponseFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => + ListGuardrailMemberAssignmentsResponse$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'ListGuardrailMemberAssignmentsResponse' from JSON`, + ); +} diff --git a/src/models/operations/listguardrails.ts b/src/models/operations/listguardrails.ts new file mode 100644 index 00000000..d8cb8117 --- /dev/null +++ b/src/models/operations/listguardrails.ts @@ -0,0 +1,185 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + * @generated-id: 4c71cf4db173 + */ + +import * as z from "zod/v4"; +import { remap as remap$ } from "../../lib/primitives.js"; +import { safeParse } from "../../lib/schemas.js"; +import * as openEnums from "../../types/enums.js"; +import { OpenEnum } from "../../types/enums.js"; +import { Result as SafeParseResult } from "../../types/fp.js"; +import { SDKValidationError } from "../errors/sdkvalidationerror.js"; + +export type ListGuardrailsRequest = { + /** + * Number of records to skip for pagination + */ + offset?: string | undefined; + /** + * Maximum number of records to return (max 100) + */ + limit?: string | undefined; +}; + +/** + * Interval at which the limit resets (daily, weekly, monthly) + */ +export const ListGuardrailsResetInterval = { + Daily: "daily", + Weekly: "weekly", + Monthly: "monthly", +} as const; +/** + * Interval at which the limit resets (daily, weekly, monthly) + */ +export type ListGuardrailsResetInterval = OpenEnum< + typeof ListGuardrailsResetInterval +>; + +export type ListGuardrailsData = { + /** + * Unique identifier for the guardrail + */ + id: string; + /** + * Name of the guardrail + */ + name: string; + /** + * Description of the guardrail + */ + description?: string | null | undefined; + /** + * Spending limit in USD + */ + limitUsd?: number | null | undefined; + /** + * Interval at which the limit resets (daily, weekly, monthly) + */ + resetInterval?: ListGuardrailsResetInterval | null | undefined; + /** + * List of allowed provider IDs + */ + allowedProviders?: Array | null | undefined; + /** + * Array of model canonical_slugs (immutable identifiers) + */ + allowedModels?: Array | null | undefined; + /** + * Whether to enforce zero data retention + */ + enforceZdr?: boolean | null | undefined; + /** + * ISO 8601 timestamp of when the guardrail was created + */ + createdAt: string; + /** + * ISO 8601 timestamp of when the guardrail was last updated + */ + updatedAt?: string | null | undefined; +}; + +/** + * List of guardrails + */ +export type ListGuardrailsResponse = { + /** + * List of guardrails + */ + data: Array; + /** + * Total number of guardrails + */ + totalCount: number; +}; + +/** @internal */ +export type ListGuardrailsRequest$Outbound = { + offset?: string | undefined; + limit?: string | undefined; +}; + +/** @internal */ +export const ListGuardrailsRequest$outboundSchema: z.ZodType< + ListGuardrailsRequest$Outbound, + ListGuardrailsRequest +> = z.object({ + offset: z.string().optional(), + limit: z.string().optional(), +}); + +export function listGuardrailsRequestToJSON( + listGuardrailsRequest: ListGuardrailsRequest, +): string { + return JSON.stringify( + ListGuardrailsRequest$outboundSchema.parse(listGuardrailsRequest), + ); +} + +/** @internal */ +export const ListGuardrailsResetInterval$inboundSchema: z.ZodType< + ListGuardrailsResetInterval, + unknown +> = openEnums.inboundSchema(ListGuardrailsResetInterval); + +/** @internal */ +export const ListGuardrailsData$inboundSchema: z.ZodType< + ListGuardrailsData, + unknown +> = z.object({ + id: z.string(), + name: z.string(), + description: z.nullable(z.string()).optional(), + limit_usd: z.nullable(z.number()).optional(), + reset_interval: z.nullable(ListGuardrailsResetInterval$inboundSchema) + .optional(), + allowed_providers: z.nullable(z.array(z.string())).optional(), + allowed_models: z.nullable(z.array(z.string())).optional(), + enforce_zdr: z.nullable(z.boolean()).optional(), + created_at: z.string(), + updated_at: z.nullable(z.string()).optional(), +}).transform((v) => { + return remap$(v, { + "limit_usd": "limitUsd", + "reset_interval": "resetInterval", + "allowed_providers": "allowedProviders", + "allowed_models": "allowedModels", + "enforce_zdr": "enforceZdr", + "created_at": "createdAt", + "updated_at": "updatedAt", + }); +}); + +export function listGuardrailsDataFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => ListGuardrailsData$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'ListGuardrailsData' from JSON`, + ); +} + +/** @internal */ +export const ListGuardrailsResponse$inboundSchema: z.ZodType< + ListGuardrailsResponse, + unknown +> = z.object({ + data: z.array(z.lazy(() => ListGuardrailsData$inboundSchema)), + total_count: z.number(), +}).transform((v) => { + return remap$(v, { + "total_count": "totalCount", + }); +}); + +export function listGuardrailsResponseFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => ListGuardrailsResponse$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'ListGuardrailsResponse' from JSON`, + ); +} diff --git a/src/models/operations/listkeyassignments.ts b/src/models/operations/listkeyassignments.ts new file mode 100644 index 00000000..6e78bcd5 --- /dev/null +++ b/src/models/operations/listkeyassignments.ts @@ -0,0 +1,145 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + * @generated-id: c4b0c0303428 + */ + +import * as z from "zod/v4"; +import { remap as remap$ } from "../../lib/primitives.js"; +import { safeParse } from "../../lib/schemas.js"; +import { Result as SafeParseResult } from "../../types/fp.js"; +import { SDKValidationError } from "../errors/sdkvalidationerror.js"; + +export type ListKeyAssignmentsRequest = { + /** + * Number of records to skip for pagination + */ + offset?: string | undefined; + /** + * Maximum number of records to return (max 100) + */ + limit?: string | undefined; +}; + +export type ListKeyAssignmentsData = { + /** + * Unique identifier for the assignment + */ + id: string; + /** + * Hash of the assigned API key + */ + keyHash: string; + /** + * ID of the guardrail + */ + guardrailId: string; + /** + * Name of the API key + */ + keyName: string; + /** + * Label of the API key + */ + keyLabel: string; + /** + * User ID of who made the assignment + */ + assignedBy: string | null; + /** + * ISO 8601 timestamp of when the assignment was created + */ + createdAt: string; +}; + +/** + * List of key assignments + */ +export type ListKeyAssignmentsResponse = { + /** + * List of key assignments + */ + data: Array; + /** + * Total number of key assignments for this guardrail + */ + totalCount: number; +}; + +/** @internal */ +export type ListKeyAssignmentsRequest$Outbound = { + offset?: string | undefined; + limit?: string | undefined; +}; + +/** @internal */ +export const ListKeyAssignmentsRequest$outboundSchema: z.ZodType< + ListKeyAssignmentsRequest$Outbound, + ListKeyAssignmentsRequest +> = z.object({ + offset: z.string().optional(), + limit: z.string().optional(), +}); + +export function listKeyAssignmentsRequestToJSON( + listKeyAssignmentsRequest: ListKeyAssignmentsRequest, +): string { + return JSON.stringify( + ListKeyAssignmentsRequest$outboundSchema.parse(listKeyAssignmentsRequest), + ); +} + +/** @internal */ +export const ListKeyAssignmentsData$inboundSchema: z.ZodType< + ListKeyAssignmentsData, + unknown +> = z.object({ + id: z.string(), + key_hash: z.string(), + guardrail_id: z.string(), + key_name: z.string(), + key_label: z.string(), + assigned_by: z.nullable(z.string()), + created_at: z.string(), +}).transform((v) => { + return remap$(v, { + "key_hash": "keyHash", + "guardrail_id": "guardrailId", + "key_name": "keyName", + "key_label": "keyLabel", + "assigned_by": "assignedBy", + "created_at": "createdAt", + }); +}); + +export function listKeyAssignmentsDataFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => ListKeyAssignmentsData$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'ListKeyAssignmentsData' from JSON`, + ); +} + +/** @internal */ +export const ListKeyAssignmentsResponse$inboundSchema: z.ZodType< + ListKeyAssignmentsResponse, + unknown +> = z.object({ + data: z.array(z.lazy(() => ListKeyAssignmentsData$inboundSchema)), + total_count: z.number(), +}).transform((v) => { + return remap$(v, { + "total_count": "totalCount", + }); +}); + +export function listKeyAssignmentsResponseFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => ListKeyAssignmentsResponse$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'ListKeyAssignmentsResponse' from JSON`, + ); +} diff --git a/src/models/operations/listmemberassignments.ts b/src/models/operations/listmemberassignments.ts new file mode 100644 index 00000000..98c8903b --- /dev/null +++ b/src/models/operations/listmemberassignments.ts @@ -0,0 +1,141 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + * @generated-id: 7d02937e1a11 + */ + +import * as z from "zod/v4"; +import { remap as remap$ } from "../../lib/primitives.js"; +import { safeParse } from "../../lib/schemas.js"; +import { Result as SafeParseResult } from "../../types/fp.js"; +import { SDKValidationError } from "../errors/sdkvalidationerror.js"; + +export type ListMemberAssignmentsRequest = { + /** + * Number of records to skip for pagination + */ + offset?: string | undefined; + /** + * Maximum number of records to return (max 100) + */ + limit?: string | undefined; +}; + +export type ListMemberAssignmentsData = { + /** + * Unique identifier for the assignment + */ + id: string; + /** + * Clerk user ID of the assigned member + */ + userId: string; + /** + * Organization ID + */ + organizationId: string; + /** + * ID of the guardrail + */ + guardrailId: string; + /** + * User ID of who made the assignment + */ + assignedBy: string | null; + /** + * ISO 8601 timestamp of when the assignment was created + */ + createdAt: string; +}; + +/** + * List of member assignments + */ +export type ListMemberAssignmentsResponse = { + /** + * List of member assignments + */ + data: Array; + /** + * Total number of member assignments + */ + totalCount: number; +}; + +/** @internal */ +export type ListMemberAssignmentsRequest$Outbound = { + offset?: string | undefined; + limit?: string | undefined; +}; + +/** @internal */ +export const ListMemberAssignmentsRequest$outboundSchema: z.ZodType< + ListMemberAssignmentsRequest$Outbound, + ListMemberAssignmentsRequest +> = z.object({ + offset: z.string().optional(), + limit: z.string().optional(), +}); + +export function listMemberAssignmentsRequestToJSON( + listMemberAssignmentsRequest: ListMemberAssignmentsRequest, +): string { + return JSON.stringify( + ListMemberAssignmentsRequest$outboundSchema.parse( + listMemberAssignmentsRequest, + ), + ); +} + +/** @internal */ +export const ListMemberAssignmentsData$inboundSchema: z.ZodType< + ListMemberAssignmentsData, + unknown +> = z.object({ + id: z.string(), + user_id: z.string(), + organization_id: z.string(), + guardrail_id: z.string(), + assigned_by: z.nullable(z.string()), + created_at: z.string(), +}).transform((v) => { + return remap$(v, { + "user_id": "userId", + "organization_id": "organizationId", + "guardrail_id": "guardrailId", + "assigned_by": "assignedBy", + "created_at": "createdAt", + }); +}); + +export function listMemberAssignmentsDataFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => ListMemberAssignmentsData$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'ListMemberAssignmentsData' from JSON`, + ); +} + +/** @internal */ +export const ListMemberAssignmentsResponse$inboundSchema: z.ZodType< + ListMemberAssignmentsResponse, + unknown +> = z.object({ + data: z.array(z.lazy(() => ListMemberAssignmentsData$inboundSchema)), + total_count: z.number(), +}).transform((v) => { + return remap$(v, { + "total_count": "totalCount", + }); +}); + +export function listMemberAssignmentsResponseFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => ListMemberAssignmentsResponse$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'ListMemberAssignmentsResponse' from JSON`, + ); +} diff --git a/src/models/operations/updateguardrail.ts b/src/models/operations/updateguardrail.ts new file mode 100644 index 00000000..c0857328 --- /dev/null +++ b/src/models/operations/updateguardrail.ts @@ -0,0 +1,274 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + * @generated-id: d4106fbc6dca + */ + +import * as z from "zod/v4"; +import { remap as remap$ } from "../../lib/primitives.js"; +import { safeParse } from "../../lib/schemas.js"; +import * as openEnums from "../../types/enums.js"; +import { OpenEnum } from "../../types/enums.js"; +import { Result as SafeParseResult } from "../../types/fp.js"; +import { SDKValidationError } from "../errors/sdkvalidationerror.js"; + +/** + * Interval at which the limit resets (daily, weekly, monthly) + */ +export const UpdateGuardrailResetIntervalRequest = { + Daily: "daily", + Weekly: "weekly", + Monthly: "monthly", +} as const; +/** + * Interval at which the limit resets (daily, weekly, monthly) + */ +export type UpdateGuardrailResetIntervalRequest = OpenEnum< + typeof UpdateGuardrailResetIntervalRequest +>; + +export type UpdateGuardrailRequestBody = { + /** + * New name for the guardrail + */ + name?: string | undefined; + /** + * New description for the guardrail + */ + description?: string | null | undefined; + /** + * New spending limit in USD + */ + limitUsd?: number | null | undefined; + /** + * Interval at which the limit resets (daily, weekly, monthly) + */ + resetInterval?: UpdateGuardrailResetIntervalRequest | null | undefined; + /** + * New list of allowed provider IDs + */ + allowedProviders?: Array | null | undefined; + /** + * Array of model identifiers (slug or canonical_slug accepted) + */ + allowedModels?: Array | null | undefined; + /** + * Whether to enforce zero data retention + */ + enforceZdr?: boolean | null | undefined; +}; + +export type UpdateGuardrailRequest = { + /** + * The unique identifier of the guardrail to update + */ + id: string; + requestBody: UpdateGuardrailRequestBody; +}; + +/** + * Interval at which the limit resets (daily, weekly, monthly) + */ +export const UpdateGuardrailResetIntervalResponse = { + Daily: "daily", + Weekly: "weekly", + Monthly: "monthly", +} as const; +/** + * Interval at which the limit resets (daily, weekly, monthly) + */ +export type UpdateGuardrailResetIntervalResponse = OpenEnum< + typeof UpdateGuardrailResetIntervalResponse +>; + +/** + * The updated guardrail + */ +export type UpdateGuardrailData = { + /** + * Unique identifier for the guardrail + */ + id: string; + /** + * Name of the guardrail + */ + name: string; + /** + * Description of the guardrail + */ + description?: string | null | undefined; + /** + * Spending limit in USD + */ + limitUsd?: number | null | undefined; + /** + * Interval at which the limit resets (daily, weekly, monthly) + */ + resetInterval?: UpdateGuardrailResetIntervalResponse | null | undefined; + /** + * List of allowed provider IDs + */ + allowedProviders?: Array | null | undefined; + /** + * Array of model canonical_slugs (immutable identifiers) + */ + allowedModels?: Array | null | undefined; + /** + * Whether to enforce zero data retention + */ + enforceZdr?: boolean | null | undefined; + /** + * ISO 8601 timestamp of when the guardrail was created + */ + createdAt: string; + /** + * ISO 8601 timestamp of when the guardrail was last updated + */ + updatedAt?: string | null | undefined; +}; + +/** + * Guardrail updated successfully + */ +export type UpdateGuardrailResponse = { + /** + * The updated guardrail + */ + data: UpdateGuardrailData; +}; + +/** @internal */ +export const UpdateGuardrailResetIntervalRequest$outboundSchema: z.ZodType< + string, + UpdateGuardrailResetIntervalRequest +> = openEnums.outboundSchema(UpdateGuardrailResetIntervalRequest); + +/** @internal */ +export type UpdateGuardrailRequestBody$Outbound = { + name?: string | undefined; + description?: string | null | undefined; + limit_usd?: number | null | undefined; + reset_interval?: string | null | undefined; + allowed_providers?: Array | null | undefined; + allowed_models?: Array | null | undefined; + enforce_zdr?: boolean | null | undefined; +}; + +/** @internal */ +export const UpdateGuardrailRequestBody$outboundSchema: z.ZodType< + UpdateGuardrailRequestBody$Outbound, + UpdateGuardrailRequestBody +> = z.object({ + name: z.string().optional(), + description: z.nullable(z.string()).optional(), + limitUsd: z.nullable(z.number()).optional(), + resetInterval: z.nullable(UpdateGuardrailResetIntervalRequest$outboundSchema) + .optional(), + allowedProviders: z.nullable(z.array(z.string())).optional(), + allowedModels: z.nullable(z.array(z.string())).optional(), + enforceZdr: z.nullable(z.boolean()).optional(), +}).transform((v) => { + return remap$(v, { + limitUsd: "limit_usd", + resetInterval: "reset_interval", + allowedProviders: "allowed_providers", + allowedModels: "allowed_models", + enforceZdr: "enforce_zdr", + }); +}); + +export function updateGuardrailRequestBodyToJSON( + updateGuardrailRequestBody: UpdateGuardrailRequestBody, +): string { + return JSON.stringify( + UpdateGuardrailRequestBody$outboundSchema.parse(updateGuardrailRequestBody), + ); +} + +/** @internal */ +export type UpdateGuardrailRequest$Outbound = { + id: string; + RequestBody: UpdateGuardrailRequestBody$Outbound; +}; + +/** @internal */ +export const UpdateGuardrailRequest$outboundSchema: z.ZodType< + UpdateGuardrailRequest$Outbound, + UpdateGuardrailRequest +> = z.object({ + id: z.string(), + requestBody: z.lazy(() => UpdateGuardrailRequestBody$outboundSchema), +}).transform((v) => { + return remap$(v, { + requestBody: "RequestBody", + }); +}); + +export function updateGuardrailRequestToJSON( + updateGuardrailRequest: UpdateGuardrailRequest, +): string { + return JSON.stringify( + UpdateGuardrailRequest$outboundSchema.parse(updateGuardrailRequest), + ); +} + +/** @internal */ +export const UpdateGuardrailResetIntervalResponse$inboundSchema: z.ZodType< + UpdateGuardrailResetIntervalResponse, + unknown +> = openEnums.inboundSchema(UpdateGuardrailResetIntervalResponse); + +/** @internal */ +export const UpdateGuardrailData$inboundSchema: z.ZodType< + UpdateGuardrailData, + unknown +> = z.object({ + id: z.string(), + name: z.string(), + description: z.nullable(z.string()).optional(), + limit_usd: z.nullable(z.number()).optional(), + reset_interval: z.nullable(UpdateGuardrailResetIntervalResponse$inboundSchema) + .optional(), + allowed_providers: z.nullable(z.array(z.string())).optional(), + allowed_models: z.nullable(z.array(z.string())).optional(), + enforce_zdr: z.nullable(z.boolean()).optional(), + created_at: z.string(), + updated_at: z.nullable(z.string()).optional(), +}).transform((v) => { + return remap$(v, { + "limit_usd": "limitUsd", + "reset_interval": "resetInterval", + "allowed_providers": "allowedProviders", + "allowed_models": "allowedModels", + "enforce_zdr": "enforceZdr", + "created_at": "createdAt", + "updated_at": "updatedAt", + }); +}); + +export function updateGuardrailDataFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => UpdateGuardrailData$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'UpdateGuardrailData' from JSON`, + ); +} + +/** @internal */ +export const UpdateGuardrailResponse$inboundSchema: z.ZodType< + UpdateGuardrailResponse, + unknown +> = z.object({ + data: z.lazy(() => UpdateGuardrailData$inboundSchema), +}); + +export function updateGuardrailResponseFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => UpdateGuardrailResponse$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'UpdateGuardrailResponse' from JSON`, + ); +} diff --git a/src/models/percentilelatencycutoffs.ts b/src/models/percentilelatencycutoffs.ts index 8d4f9360..aea49c29 100644 --- a/src/models/percentilelatencycutoffs.ts +++ b/src/models/percentilelatencycutoffs.ts @@ -1,6 +1,6 @@ /* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - * @generated-id: 92e053096488 + * @generated-id: ab5ef16080c7 */ import * as z from "zod/v4"; diff --git a/src/models/percentilestats.ts b/src/models/percentilestats.ts index 0593bbc9..9dfb13ad 100644 --- a/src/models/percentilestats.ts +++ b/src/models/percentilestats.ts @@ -1,6 +1,6 @@ /* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - * @generated-id: 9a6b504d3964 + * @generated-id: f8001516363f */ import * as z from "zod/v4"; diff --git a/src/models/percentilethroughputcutoffs.ts b/src/models/percentilethroughputcutoffs.ts index c29b848d..64350cb9 100644 --- a/src/models/percentilethroughputcutoffs.ts +++ b/src/models/percentilethroughputcutoffs.ts @@ -1,6 +1,6 @@ /* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - * @generated-id: 847aba8ff633 + * @generated-id: 366b617b09b4 */ import * as z from "zod/v4"; diff --git a/src/models/preferredmaxlatency.ts b/src/models/preferredmaxlatency.ts index 926e0bce..603f7d4a 100644 --- a/src/models/preferredmaxlatency.ts +++ b/src/models/preferredmaxlatency.ts @@ -1,6 +1,6 @@ /* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - * @generated-id: e03f33269427 + * @generated-id: 17fc19055e19 */ import * as z from "zod/v4"; diff --git a/src/models/preferredminthroughput.ts b/src/models/preferredminthroughput.ts index ace60e53..d2180d16 100644 --- a/src/models/preferredminthroughput.ts +++ b/src/models/preferredminthroughput.ts @@ -1,6 +1,6 @@ /* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - * @generated-id: 5ff9056f1474 + * @generated-id: 04b7597c84f9 */ import * as z from "zod/v4"; diff --git a/src/models/responseinputvideo.ts b/src/models/responseinputvideo.ts index dd76764e..fe53a063 100644 --- a/src/models/responseinputvideo.ts +++ b/src/models/responseinputvideo.ts @@ -1,6 +1,6 @@ /* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - * @generated-id: 79bef840e448 + * @generated-id: be5ad9346721 */ import * as z from "zod/v4"; diff --git a/src/models/responsesoutputmodality.ts b/src/models/responsesoutputmodality.ts index ce35ab66..da588971 100644 --- a/src/models/responsesoutputmodality.ts +++ b/src/models/responsesoutputmodality.ts @@ -1,6 +1,6 @@ /* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - * @generated-id: c42840bf36d8 + * @generated-id: 4f6019babb94 */ import * as z from "zod/v4"; diff --git a/src/models/schema2.ts b/src/models/schema2.ts new file mode 100644 index 00000000..b97a2318 --- /dev/null +++ b/src/models/schema2.ts @@ -0,0 +1,241 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + * @generated-id: f5d5abd15e27 + */ + +import * as z from "zod/v4"; +import { safeParse } from "../lib/schemas.js"; +import * as openEnums from "../types/enums.js"; +import { OpenEnum } from "../types/enums.js"; +import { Result as SafeParseResult } from "../types/fp.js"; +import { SDKValidationError } from "./errors/sdkvalidationerror.js"; + +export const Schema4 = { + Unknown: "unknown", + OpenaiResponsesV1: "openai-responses-v1", + AzureOpenaiResponsesV1: "azure-openai-responses-v1", + XaiResponsesV1: "xai-responses-v1", + AnthropicClaudeV1: "anthropic-claude-v1", + GoogleGeminiV1: "google-gemini-v1", +} as const; +export type Schema4 = OpenEnum; + +export type Schema2ReasoningText = { + type: "reasoning.text"; + text?: string | null | undefined; + signature?: string | null | undefined; + id?: string | null | undefined; + format?: Schema4 | null | undefined; + index?: number | undefined; +}; + +export type Schema2ReasoningEncrypted = { + type: "reasoning.encrypted"; + data: string; + id?: string | null | undefined; + format?: Schema4 | null | undefined; + index?: number | undefined; +}; + +export type Schema2ReasoningSummary = { + type: "reasoning.summary"; + summary: string; + id?: string | null | undefined; + format?: Schema4 | null | undefined; + index?: number | undefined; +}; + +export type Schema2 = + | Schema2ReasoningSummary + | Schema2ReasoningEncrypted + | Schema2ReasoningText; + +/** @internal */ +export const Schema4$inboundSchema: z.ZodType = openEnums + .inboundSchema(Schema4); +/** @internal */ +export const Schema4$outboundSchema: z.ZodType = openEnums + .outboundSchema(Schema4); + +/** @internal */ +export const Schema2ReasoningText$inboundSchema: z.ZodType< + Schema2ReasoningText, + unknown +> = z.object({ + type: z.literal("reasoning.text"), + text: z.nullable(z.string()).optional(), + signature: z.nullable(z.string()).optional(), + id: z.nullable(z.string()).optional(), + format: z.nullable(Schema4$inboundSchema).optional(), + index: z.number().optional(), +}); +/** @internal */ +export type Schema2ReasoningText$Outbound = { + type: "reasoning.text"; + text?: string | null | undefined; + signature?: string | null | undefined; + id?: string | null | undefined; + format?: string | null | undefined; + index?: number | undefined; +}; + +/** @internal */ +export const Schema2ReasoningText$outboundSchema: z.ZodType< + Schema2ReasoningText$Outbound, + Schema2ReasoningText +> = z.object({ + type: z.literal("reasoning.text"), + text: z.nullable(z.string()).optional(), + signature: z.nullable(z.string()).optional(), + id: z.nullable(z.string()).optional(), + format: z.nullable(Schema4$outboundSchema).optional(), + index: z.number().optional(), +}); + +export function schema2ReasoningTextToJSON( + schema2ReasoningText: Schema2ReasoningText, +): string { + return JSON.stringify( + Schema2ReasoningText$outboundSchema.parse(schema2ReasoningText), + ); +} +export function schema2ReasoningTextFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => Schema2ReasoningText$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'Schema2ReasoningText' from JSON`, + ); +} + +/** @internal */ +export const Schema2ReasoningEncrypted$inboundSchema: z.ZodType< + Schema2ReasoningEncrypted, + unknown +> = z.object({ + type: z.literal("reasoning.encrypted"), + data: z.string(), + id: z.nullable(z.string()).optional(), + format: z.nullable(Schema4$inboundSchema).optional(), + index: z.number().optional(), +}); +/** @internal */ +export type Schema2ReasoningEncrypted$Outbound = { + type: "reasoning.encrypted"; + data: string; + id?: string | null | undefined; + format?: string | null | undefined; + index?: number | undefined; +}; + +/** @internal */ +export const Schema2ReasoningEncrypted$outboundSchema: z.ZodType< + Schema2ReasoningEncrypted$Outbound, + Schema2ReasoningEncrypted +> = z.object({ + type: z.literal("reasoning.encrypted"), + data: z.string(), + id: z.nullable(z.string()).optional(), + format: z.nullable(Schema4$outboundSchema).optional(), + index: z.number().optional(), +}); + +export function schema2ReasoningEncryptedToJSON( + schema2ReasoningEncrypted: Schema2ReasoningEncrypted, +): string { + return JSON.stringify( + Schema2ReasoningEncrypted$outboundSchema.parse(schema2ReasoningEncrypted), + ); +} +export function schema2ReasoningEncryptedFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => Schema2ReasoningEncrypted$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'Schema2ReasoningEncrypted' from JSON`, + ); +} + +/** @internal */ +export const Schema2ReasoningSummary$inboundSchema: z.ZodType< + Schema2ReasoningSummary, + unknown +> = z.object({ + type: z.literal("reasoning.summary"), + summary: z.string(), + id: z.nullable(z.string()).optional(), + format: z.nullable(Schema4$inboundSchema).optional(), + index: z.number().optional(), +}); +/** @internal */ +export type Schema2ReasoningSummary$Outbound = { + type: "reasoning.summary"; + summary: string; + id?: string | null | undefined; + format?: string | null | undefined; + index?: number | undefined; +}; + +/** @internal */ +export const Schema2ReasoningSummary$outboundSchema: z.ZodType< + Schema2ReasoningSummary$Outbound, + Schema2ReasoningSummary +> = z.object({ + type: z.literal("reasoning.summary"), + summary: z.string(), + id: z.nullable(z.string()).optional(), + format: z.nullable(Schema4$outboundSchema).optional(), + index: z.number().optional(), +}); + +export function schema2ReasoningSummaryToJSON( + schema2ReasoningSummary: Schema2ReasoningSummary, +): string { + return JSON.stringify( + Schema2ReasoningSummary$outboundSchema.parse(schema2ReasoningSummary), + ); +} +export function schema2ReasoningSummaryFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => Schema2ReasoningSummary$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'Schema2ReasoningSummary' from JSON`, + ); +} + +/** @internal */ +export const Schema2$inboundSchema: z.ZodType = z.union([ + z.lazy(() => Schema2ReasoningSummary$inboundSchema), + z.lazy(() => Schema2ReasoningEncrypted$inboundSchema), + z.lazy(() => Schema2ReasoningText$inboundSchema), +]); +/** @internal */ +export type Schema2$Outbound = + | Schema2ReasoningSummary$Outbound + | Schema2ReasoningEncrypted$Outbound + | Schema2ReasoningText$Outbound; + +/** @internal */ +export const Schema2$outboundSchema: z.ZodType = z + .union([ + z.lazy(() => Schema2ReasoningSummary$outboundSchema), + z.lazy(() => Schema2ReasoningEncrypted$outboundSchema), + z.lazy(() => Schema2ReasoningText$outboundSchema), + ]); + +export function schema2ToJSON(schema2: Schema2): string { + return JSON.stringify(Schema2$outboundSchema.parse(schema2)); +} +export function schema2FromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => Schema2$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'Schema2' from JSON`, + ); +} diff --git a/src/models/schema3.ts b/src/models/schema3.ts deleted file mode 100644 index bcd2d06a..00000000 --- a/src/models/schema3.ts +++ /dev/null @@ -1,139 +0,0 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - * @generated-id: 6f7380bcbcea - */ - -import * as z from "zod/v4"; -import { safeParse } from "../lib/schemas.js"; -import * as openEnums from "../types/enums.js"; -import { OpenEnum } from "../types/enums.js"; -import { Result as SafeParseResult } from "../types/fp.js"; -import { SDKValidationError } from "./errors/sdkvalidationerror.js"; - -export const Schema5 = { - Unknown: "unknown", - OpenaiResponsesV1: "openai-responses-v1", - AzureOpenaiResponsesV1: "azure-openai-responses-v1", - XaiResponsesV1: "xai-responses-v1", - AnthropicClaudeV1: "anthropic-claude-v1", - GoogleGeminiV1: "google-gemini-v1", -} as const; -export type Schema5 = OpenEnum; - -export type Schema3ReasoningText = { - type: "reasoning.text"; - text?: string | null | undefined; - signature?: string | null | undefined; - id?: string | null | undefined; - format?: Schema5 | null | undefined; - index?: number | undefined; -}; - -export type Schema3ReasoningEncrypted = { - type: "reasoning.encrypted"; - data: string; - id?: string | null | undefined; - format?: Schema5 | null | undefined; - index?: number | undefined; -}; - -export type Schema3ReasoningSummary = { - type: "reasoning.summary"; - summary: string; - id?: string | null | undefined; - format?: Schema5 | null | undefined; - index?: number | undefined; -}; - -export type Schema3 = - | Schema3ReasoningSummary - | Schema3ReasoningEncrypted - | Schema3ReasoningText; - -/** @internal */ -export const Schema5$inboundSchema: z.ZodType = openEnums - .inboundSchema(Schema5); - -/** @internal */ -export const Schema3ReasoningText$inboundSchema: z.ZodType< - Schema3ReasoningText, - unknown -> = z.object({ - type: z.literal("reasoning.text"), - text: z.nullable(z.string()).optional(), - signature: z.nullable(z.string()).optional(), - id: z.nullable(z.string()).optional(), - format: z.nullable(Schema5$inboundSchema).optional(), - index: z.number().optional(), -}); - -export function schema3ReasoningTextFromJSON( - jsonString: string, -): SafeParseResult { - return safeParse( - jsonString, - (x) => Schema3ReasoningText$inboundSchema.parse(JSON.parse(x)), - `Failed to parse 'Schema3ReasoningText' from JSON`, - ); -} - -/** @internal */ -export const Schema3ReasoningEncrypted$inboundSchema: z.ZodType< - Schema3ReasoningEncrypted, - unknown -> = z.object({ - type: z.literal("reasoning.encrypted"), - data: z.string(), - id: z.nullable(z.string()).optional(), - format: z.nullable(Schema5$inboundSchema).optional(), - index: z.number().optional(), -}); - -export function schema3ReasoningEncryptedFromJSON( - jsonString: string, -): SafeParseResult { - return safeParse( - jsonString, - (x) => Schema3ReasoningEncrypted$inboundSchema.parse(JSON.parse(x)), - `Failed to parse 'Schema3ReasoningEncrypted' from JSON`, - ); -} - -/** @internal */ -export const Schema3ReasoningSummary$inboundSchema: z.ZodType< - Schema3ReasoningSummary, - unknown -> = z.object({ - type: z.literal("reasoning.summary"), - summary: z.string(), - id: z.nullable(z.string()).optional(), - format: z.nullable(Schema5$inboundSchema).optional(), - index: z.number().optional(), -}); - -export function schema3ReasoningSummaryFromJSON( - jsonString: string, -): SafeParseResult { - return safeParse( - jsonString, - (x) => Schema3ReasoningSummary$inboundSchema.parse(JSON.parse(x)), - `Failed to parse 'Schema3ReasoningSummary' from JSON`, - ); -} - -/** @internal */ -export const Schema3$inboundSchema: z.ZodType = z.union([ - z.lazy(() => Schema3ReasoningSummary$inboundSchema), - z.lazy(() => Schema3ReasoningEncrypted$inboundSchema), - z.lazy(() => Schema3ReasoningText$inboundSchema), -]); - -export function schema3FromJSON( - jsonString: string, -): SafeParseResult { - return safeParse( - jsonString, - (x) => Schema3$inboundSchema.parse(JSON.parse(x)), - `Failed to parse 'Schema3' from JSON`, - ); -} diff --git a/src/sdk/analytics.ts b/src/sdk/analytics.ts index 41f17bc8..c09f6013 100644 --- a/src/sdk/analytics.ts +++ b/src/sdk/analytics.ts @@ -13,7 +13,7 @@ export class Analytics extends ClientSDK { * Get user activity grouped by endpoint * * @remarks - * Returns user activity data grouped by endpoint for the last 30 (completed) UTC days + * Returns user activity data grouped by endpoint for the last 30 (completed) UTC days. [Provisioning key](/docs/guides/overview/auth/provisioning-api-keys) required. */ async getUserActivity( request?: operations.GetUserActivityRequest | undefined, diff --git a/src/sdk/apikeys.ts b/src/sdk/apikeys.ts index 87017a4d..acb5ff6d 100644 --- a/src/sdk/apikeys.ts +++ b/src/sdk/apikeys.ts @@ -16,6 +16,9 @@ import { unwrapAsync } from "../types/fp.js"; export class APIKeys extends ClientSDK { /** * List API keys + * + * @remarks + * List all API keys for the authenticated user. [Provisioning key](/docs/guides/overview/auth/provisioning-api-keys) required. */ async list( request?: operations.ListRequest | undefined, @@ -30,6 +33,9 @@ export class APIKeys extends ClientSDK { /** * Create a new API key + * + * @remarks + * Create a new API key for the authenticated user. [Provisioning key](/docs/guides/overview/auth/provisioning-api-keys) required. */ async create( request: operations.CreateKeysRequest, @@ -44,6 +50,9 @@ export class APIKeys extends ClientSDK { /** * Update an API key + * + * @remarks + * Update an existing API key. [Provisioning key](/docs/guides/overview/auth/provisioning-api-keys) required. */ async update( request: operations.UpdateKeysRequest, @@ -58,6 +67,9 @@ export class APIKeys extends ClientSDK { /** * Delete an API key + * + * @remarks + * Delete an existing API key. [Provisioning key](/docs/guides/overview/auth/provisioning-api-keys) required. */ async delete( request: operations.DeleteKeysRequest, @@ -72,6 +84,9 @@ export class APIKeys extends ClientSDK { /** * Get a single API key + * + * @remarks + * Get a single API key by hash. [Provisioning key](/docs/guides/overview/auth/provisioning-api-keys) required. */ async get( request: operations.GetKeyRequest, diff --git a/src/sdk/credits.ts b/src/sdk/credits.ts index 9c43c6dd..733ff107 100644 --- a/src/sdk/credits.ts +++ b/src/sdk/credits.ts @@ -15,7 +15,7 @@ export class Credits extends ClientSDK { * Get remaining credits * * @remarks - * Get total credits purchased and used for the authenticated user + * Get total credits purchased and used for the authenticated user. [Provisioning key](/docs/guides/overview/auth/provisioning-api-keys) required. */ async getCredits( options?: RequestOptions, diff --git a/src/sdk/guardrails.ts b/src/sdk/guardrails.ts new file mode 100644 index 00000000..6c31150c --- /dev/null +++ b/src/sdk/guardrails.ts @@ -0,0 +1,244 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + * @generated-id: c4e976dbf057 + */ + +import { guardrailsBulkAssignKeys } from "../funcs/guardrailsBulkAssignKeys.js"; +import { guardrailsBulkAssignMembers } from "../funcs/guardrailsBulkAssignMembers.js"; +import { guardrailsBulkUnassignKeys } from "../funcs/guardrailsBulkUnassignKeys.js"; +import { guardrailsBulkUnassignMembers } from "../funcs/guardrailsBulkUnassignMembers.js"; +import { guardrailsCreate } from "../funcs/guardrailsCreate.js"; +import { guardrailsDelete } from "../funcs/guardrailsDelete.js"; +import { guardrailsGet } from "../funcs/guardrailsGet.js"; +import { guardrailsList } from "../funcs/guardrailsList.js"; +import { guardrailsListGuardrailKeyAssignments } from "../funcs/guardrailsListGuardrailKeyAssignments.js"; +import { guardrailsListGuardrailMemberAssignments } from "../funcs/guardrailsListGuardrailMemberAssignments.js"; +import { guardrailsListKeyAssignments } from "../funcs/guardrailsListKeyAssignments.js"; +import { guardrailsListMemberAssignments } from "../funcs/guardrailsListMemberAssignments.js"; +import { guardrailsUpdate } from "../funcs/guardrailsUpdate.js"; +import { ClientSDK, RequestOptions } from "../lib/sdks.js"; +import * as operations from "../models/operations/index.js"; +import { unwrapAsync } from "../types/fp.js"; + +export class Guardrails extends ClientSDK { + /** + * List guardrails + * + * @remarks + * List all guardrails for the authenticated user. [Provisioning key](/docs/guides/overview/auth/provisioning-api-keys) required. + */ + async list( + request?: operations.ListGuardrailsRequest | undefined, + options?: RequestOptions, + ): Promise { + return unwrapAsync(guardrailsList( + this, + request, + options, + )); + } + + /** + * Create a guardrail + * + * @remarks + * Create a new guardrail for the authenticated user. [Provisioning key](/docs/guides/overview/auth/provisioning-api-keys) required. + */ + async create( + request: operations.CreateGuardrailRequest, + options?: RequestOptions, + ): Promise { + return unwrapAsync(guardrailsCreate( + this, + request, + options, + )); + } + + /** + * Get a guardrail + * + * @remarks + * Get a single guardrail by ID. [Provisioning key](/docs/guides/overview/auth/provisioning-api-keys) required. + */ + async get( + request: operations.GetGuardrailRequest, + options?: RequestOptions, + ): Promise { + return unwrapAsync(guardrailsGet( + this, + request, + options, + )); + } + + /** + * Update a guardrail + * + * @remarks + * Update an existing guardrail. [Provisioning key](/docs/guides/overview/auth/provisioning-api-keys) required. + */ + async update( + request: operations.UpdateGuardrailRequest, + options?: RequestOptions, + ): Promise { + return unwrapAsync(guardrailsUpdate( + this, + request, + options, + )); + } + + /** + * Delete a guardrail + * + * @remarks + * Delete an existing guardrail. [Provisioning key](/docs/guides/overview/auth/provisioning-api-keys) required. + */ + async delete( + request: operations.DeleteGuardrailRequest, + options?: RequestOptions, + ): Promise { + return unwrapAsync(guardrailsDelete( + this, + request, + options, + )); + } + + /** + * List all key assignments + * + * @remarks + * List all API key guardrail assignments for the authenticated user. [Provisioning key](/docs/guides/overview/auth/provisioning-api-keys) required. + */ + async listKeyAssignments( + request?: operations.ListKeyAssignmentsRequest | undefined, + options?: RequestOptions, + ): Promise { + return unwrapAsync(guardrailsListKeyAssignments( + this, + request, + options, + )); + } + + /** + * List all member assignments + * + * @remarks + * List all organization member guardrail assignments for the authenticated user. [Provisioning key](/docs/guides/overview/auth/provisioning-api-keys) required. + */ + async listMemberAssignments( + request?: operations.ListMemberAssignmentsRequest | undefined, + options?: RequestOptions, + ): Promise { + return unwrapAsync(guardrailsListMemberAssignments( + this, + request, + options, + )); + } + + /** + * List key assignments for a guardrail + * + * @remarks + * List all API key assignments for a specific guardrail. [Provisioning key](/docs/guides/overview/auth/provisioning-api-keys) required. + */ + async listGuardrailKeyAssignments( + request: operations.ListGuardrailKeyAssignmentsRequest, + options?: RequestOptions, + ): Promise { + return unwrapAsync(guardrailsListGuardrailKeyAssignments( + this, + request, + options, + )); + } + + /** + * Bulk assign keys to a guardrail + * + * @remarks + * Assign multiple API keys to a specific guardrail. [Provisioning key](/docs/guides/overview/auth/provisioning-api-keys) required. + */ + async bulkAssignKeys( + request: operations.BulkAssignKeysToGuardrailRequest, + options?: RequestOptions, + ): Promise { + return unwrapAsync(guardrailsBulkAssignKeys( + this, + request, + options, + )); + } + + /** + * List member assignments for a guardrail + * + * @remarks + * List all organization member assignments for a specific guardrail. [Provisioning key](/docs/guides/overview/auth/provisioning-api-keys) required. + */ + async listGuardrailMemberAssignments( + request: operations.ListGuardrailMemberAssignmentsRequest, + options?: RequestOptions, + ): Promise { + return unwrapAsync(guardrailsListGuardrailMemberAssignments( + this, + request, + options, + )); + } + + /** + * Bulk assign members to a guardrail + * + * @remarks + * Assign multiple organization members to a specific guardrail. [Provisioning key](/docs/guides/overview/auth/provisioning-api-keys) required. + */ + async bulkAssignMembers( + request: operations.BulkAssignMembersToGuardrailRequest, + options?: RequestOptions, + ): Promise { + return unwrapAsync(guardrailsBulkAssignMembers( + this, + request, + options, + )); + } + + /** + * Bulk unassign keys from a guardrail + * + * @remarks + * Unassign multiple API keys from a specific guardrail. [Provisioning key](/docs/guides/overview/auth/provisioning-api-keys) required. + */ + async bulkUnassignKeys( + request: operations.BulkUnassignKeysFromGuardrailRequest, + options?: RequestOptions, + ): Promise { + return unwrapAsync(guardrailsBulkUnassignKeys( + this, + request, + options, + )); + } + + /** + * Bulk unassign members from a guardrail + * + * @remarks + * Unassign multiple organization members from a specific guardrail. [Provisioning key](/docs/guides/overview/auth/provisioning-api-keys) required. + */ + async bulkUnassignMembers( + request: operations.BulkUnassignMembersFromGuardrailRequest, + options?: RequestOptions, + ): Promise { + return unwrapAsync(guardrailsBulkUnassignMembers( + this, + request, + options, + )); + } +} diff --git a/src/sdk/parameters.ts b/src/sdk/parameters.ts deleted file mode 100644 index f6e0e933..00000000 --- a/src/sdk/parameters.ts +++ /dev/null @@ -1,27 +0,0 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - * @generated-id: 6e4ef00c29b7 - */ - -import { parametersGetParameters } from "../funcs/parametersGetParameters.js"; -import { ClientSDK, RequestOptions } from "../lib/sdks.js"; -import * as operations from "../models/operations/index.js"; -import { unwrapAsync } from "../types/fp.js"; - -export class ParametersT extends ClientSDK { - /** - * Get a model's supported parameters and data about which are most popular - */ - async getParameters( - security: operations.GetParametersSecurity, - request: operations.GetParametersRequest, - options?: RequestOptions, - ): Promise { - return unwrapAsync(parametersGetParameters( - this, - security, - request, - options, - )); - } -} diff --git a/src/sdk/sdk.ts b/src/sdk/sdk.ts index 8cb195d8..01d45751 100644 --- a/src/sdk/sdk.ts +++ b/src/sdk/sdk.ts @@ -13,9 +13,9 @@ import { Credits } from "./credits.js"; import { Embeddings } from "./embeddings.js"; import { Endpoints } from "./endpoints.js"; import { Generations } from "./generations.js"; +import { Guardrails } from "./guardrails.js"; import { Models } from "./models.js"; import { OAuth } from "./oauth.js"; -import { ParametersT } from "./parameters.js"; import { Providers } from "./providers.js"; // #region imports import { @@ -65,11 +65,6 @@ export class OpenRouter extends ClientSDK { return (this._endpoints ??= new Endpoints(this._options)); } - private _parameters?: ParametersT; - get parameters(): ParametersT { - return (this._parameters ??= new ParametersT(this._options)); - } - private _providers?: Providers; get providers(): Providers { return (this._providers ??= new Providers(this._options)); @@ -80,6 +75,11 @@ export class OpenRouter extends ClientSDK { return (this._apiKeys ??= new APIKeys(this._options)); } + private _guardrails?: Guardrails; + get guardrails(): Guardrails { + return (this._guardrails ??= new Guardrails(this._options)); + } + private _oAuth?: OAuth; get oAuth(): OAuth { return (this._oAuth ??= new OAuth(this._options)); diff --git a/src/types/index.ts b/src/types/index.ts index dfb23ead..ae8a167d 100644 --- a/src/types/index.ts +++ b/src/types/index.ts @@ -10,3 +10,7 @@ export type { PageIterator, Paginator } from "./operations.js"; export { createPageIterator } from "./operations.js"; export { RFCDate } from "./rfcdate.js"; export * from "./unrecognized.js"; + +// Model types generated by @openrouter/cli types command +export type { ModelId, Variant, StaticVariant, VirtualVariant } from "./models.js"; +export { MODEL_HASH } from "./models.js"; diff --git a/src/types/models.ts b/src/types/models.ts new file mode 100644 index 00000000..ee58c4eb --- /dev/null +++ b/src/types/models.ts @@ -0,0 +1,384 @@ +// Auto-generated by @openrouter/cli types +// Run `npx @openrouter/cli types` to regenerate +// Generated: 2025-12-23T14:49:53.976Z +// Model count: 351 + +/** + * Union type of all available model IDs on OpenRouter. + * Includes base models and their variants (e.g., ":free", ":nitro"). + */ +export type ModelId = + | 'ai21/jamba-large-1.7' + | 'ai21/jamba-mini-1.7' + | 'aion-labs/aion-1.0' + | 'aion-labs/aion-1.0-mini' + | 'aion-labs/aion-rp-llama-3.1-8b' + | 'alfredpros/codellama-7b-instruct-solidity' + | 'alibaba/tongyi-deepresearch-30b-a3b' + | 'alibaba/tongyi-deepresearch-30b-a3b:free' + | 'allenai/olmo-2-0325-32b-instruct' + | 'allenai/olmo-3-32b-think:free' + | 'allenai/olmo-3-7b-instruct' + | 'allenai/olmo-3-7b-think' + | 'allenai/olmo-3.1-32b-think:free' + | 'alpindale/goliath-120b' + | 'amazon/nova-2-lite-v1' + | 'amazon/nova-lite-v1' + | 'amazon/nova-micro-v1' + | 'amazon/nova-premier-v1' + | 'amazon/nova-pro-v1' + | 'anthracite-org/magnum-v4-72b' + | 'anthropic/claude-3-haiku' + | 'anthropic/claude-3-opus' + | 'anthropic/claude-3.5-haiku' + | 'anthropic/claude-3.5-haiku-20241022' + | 'anthropic/claude-3.5-sonnet' + | 'anthropic/claude-3.7-sonnet' + | 'anthropic/claude-3.7-sonnet:thinking' + | 'anthropic/claude-haiku-4.5' + | 'anthropic/claude-opus-4' + | 'anthropic/claude-opus-4.1' + | 'anthropic/claude-opus-4.5' + | 'anthropic/claude-sonnet-4' + | 'anthropic/claude-sonnet-4.5' + | 'arcee-ai/coder-large' + | 'arcee-ai/maestro-reasoning' + | 'arcee-ai/spotlight' + | 'arcee-ai/trinity-mini' + | 'arcee-ai/trinity-mini:free' + | 'arcee-ai/virtuoso-large' + | 'arliai/qwq-32b-arliai-rpr-v1' + | 'baidu/ernie-4.5-21b-a3b' + | 'baidu/ernie-4.5-21b-a3b-thinking' + | 'baidu/ernie-4.5-300b-a47b' + | 'baidu/ernie-4.5-vl-28b-a3b' + | 'baidu/ernie-4.5-vl-424b-a47b' + | 'bytedance/ui-tars-1.5-7b' + | 'cognitivecomputations/dolphin-mistral-24b-venice-edition:free' + | 'cohere/command-a' + | 'cohere/command-r-08-2024' + | 'cohere/command-r-plus-08-2024' + | 'cohere/command-r7b-12-2024' + | 'deepcogito/cogito-v2-preview-llama-109b-moe' + | 'deepcogito/cogito-v2-preview-llama-405b' + | 'deepcogito/cogito-v2-preview-llama-70b' + | 'deepcogito/cogito-v2.1-671b' + | 'deepseek/deepseek-chat' + | 'deepseek/deepseek-chat-v3-0324' + | 'deepseek/deepseek-chat-v3.1' + | 'deepseek/deepseek-prover-v2' + | 'deepseek/deepseek-r1' + | 'deepseek/deepseek-r1-0528' + | 'deepseek/deepseek-r1-0528-qwen3-8b' + | 'deepseek/deepseek-r1-0528:free' + | 'deepseek/deepseek-r1-distill-llama-70b' + | 'deepseek/deepseek-r1-distill-qwen-14b' + | 'deepseek/deepseek-r1-distill-qwen-32b' + | 'deepseek/deepseek-v3.1-terminus' + | 'deepseek/deepseek-v3.1-terminus:exacto' + | 'deepseek/deepseek-v3.2' + | 'deepseek/deepseek-v3.2-exp' + | 'deepseek/deepseek-v3.2-speciale' + | 'eleutherai/llemma_7b' + | 'essentialai/rnj-1-instruct' + | 'google/gemini-2.0-flash-001' + | 'google/gemini-2.0-flash-exp:free' + | 'google/gemini-2.0-flash-lite-001' + | 'google/gemini-2.5-flash' + | 'google/gemini-2.5-flash-image' + | 'google/gemini-2.5-flash-image-preview' + | 'google/gemini-2.5-flash-lite' + | 'google/gemini-2.5-flash-lite-preview-09-2025' + | 'google/gemini-2.5-flash-preview-09-2025' + | 'google/gemini-2.5-pro' + | 'google/gemini-2.5-pro-preview' + | 'google/gemini-2.5-pro-preview-05-06' + | 'google/gemini-3-flash-preview' + | 'google/gemini-3-pro-image-preview' + | 'google/gemini-3-pro-preview' + | 'google/gemma-2-27b-it' + | 'google/gemma-2-9b-it' + | 'google/gemma-3-12b-it' + | 'google/gemma-3-12b-it:free' + | 'google/gemma-3-27b-it' + | 'google/gemma-3-27b-it:free' + | 'google/gemma-3-4b-it' + | 'google/gemma-3-4b-it:free' + | 'google/gemma-3n-e2b-it:free' + | 'google/gemma-3n-e4b-it' + | 'google/gemma-3n-e4b-it:free' + | 'gryphe/mythomax-l2-13b' + | 'ibm-granite/granite-4.0-h-micro' + | 'inception/mercury' + | 'inception/mercury-coder' + | 'inflection/inflection-3-pi' + | 'inflection/inflection-3-productivity' + | 'kwaipilot/kat-coder-pro:free' + | 'liquid/lfm-2.2-6b' + | 'liquid/lfm2-8b-a1b' + | 'mancer/weaver' + | 'meituan/longcat-flash-chat' + | 'meta-llama/llama-3-70b-instruct' + | 'meta-llama/llama-3-8b-instruct' + | 'meta-llama/llama-3.1-405b' + | 'meta-llama/llama-3.1-405b-instruct' + | 'meta-llama/llama-3.1-405b-instruct:free' + | 'meta-llama/llama-3.1-70b-instruct' + | 'meta-llama/llama-3.1-8b-instruct' + | 'meta-llama/llama-3.2-11b-vision-instruct' + | 'meta-llama/llama-3.2-1b-instruct' + | 'meta-llama/llama-3.2-3b-instruct' + | 'meta-llama/llama-3.2-3b-instruct:free' + | 'meta-llama/llama-3.2-90b-vision-instruct' + | 'meta-llama/llama-3.3-70b-instruct' + | 'meta-llama/llama-3.3-70b-instruct:free' + | 'meta-llama/llama-4-maverick' + | 'meta-llama/llama-4-scout' + | 'meta-llama/llama-guard-2-8b' + | 'meta-llama/llama-guard-3-8b' + | 'meta-llama/llama-guard-4-12b' + | 'microsoft/phi-3-medium-128k-instruct' + | 'microsoft/phi-3-mini-128k-instruct' + | 'microsoft/phi-3.5-mini-128k-instruct' + | 'microsoft/phi-4' + | 'microsoft/phi-4-multimodal-instruct' + | 'microsoft/phi-4-reasoning-plus' + | 'microsoft/wizardlm-2-8x22b' + | 'minimax/minimax-01' + | 'minimax/minimax-m1' + | 'minimax/minimax-m2' + | 'minimax/minimax-m2.1' + | 'mistralai/codestral-2508' + | 'mistralai/devstral-2512' + | 'mistralai/devstral-2512:free' + | 'mistralai/devstral-medium' + | 'mistralai/devstral-small' + | 'mistralai/devstral-small-2505' + | 'mistralai/ministral-14b-2512' + | 'mistralai/ministral-3b' + | 'mistralai/ministral-3b-2512' + | 'mistralai/ministral-8b' + | 'mistralai/ministral-8b-2512' + | 'mistralai/mistral-7b-instruct' + | 'mistralai/mistral-7b-instruct-v0.1' + | 'mistralai/mistral-7b-instruct-v0.2' + | 'mistralai/mistral-7b-instruct-v0.3' + | 'mistralai/mistral-7b-instruct:free' + | 'mistralai/mistral-large' + | 'mistralai/mistral-large-2407' + | 'mistralai/mistral-large-2411' + | 'mistralai/mistral-large-2512' + | 'mistralai/mistral-medium-3' + | 'mistralai/mistral-medium-3.1' + | 'mistralai/mistral-nemo' + | 'mistralai/mistral-saba' + | 'mistralai/mistral-small-24b-instruct-2501' + | 'mistralai/mistral-small-3.1-24b-instruct' + | 'mistralai/mistral-small-3.1-24b-instruct:free' + | 'mistralai/mistral-small-3.2-24b-instruct' + | 'mistralai/mistral-small-creative' + | 'mistralai/mistral-tiny' + | 'mistralai/mixtral-8x22b-instruct' + | 'mistralai/mixtral-8x7b-instruct' + | 'mistralai/pixtral-12b' + | 'mistralai/pixtral-large-2411' + | 'mistralai/voxtral-small-24b-2507' + | 'moonshotai/kimi-dev-72b' + | 'moonshotai/kimi-k2' + | 'moonshotai/kimi-k2-0905' + | 'moonshotai/kimi-k2-0905:exacto' + | 'moonshotai/kimi-k2-thinking' + | 'moonshotai/kimi-k2:free' + | 'morph/morph-v3-fast' + | 'morph/morph-v3-large' + | 'neversleep/llama-3.1-lumimaid-8b' + | 'neversleep/noromaid-20b' + | 'nex-agi/deepseek-v3.1-nex-n1:free' + | 'nousresearch/deephermes-3-mistral-24b-preview' + | 'nousresearch/hermes-2-pro-llama-3-8b' + | 'nousresearch/hermes-3-llama-3.1-405b' + | 'nousresearch/hermes-3-llama-3.1-405b:free' + | 'nousresearch/hermes-3-llama-3.1-70b' + | 'nousresearch/hermes-4-405b' + | 'nousresearch/hermes-4-70b' + | 'nvidia/llama-3.1-nemotron-70b-instruct' + | 'nvidia/llama-3.1-nemotron-ultra-253b-v1' + | 'nvidia/llama-3.3-nemotron-super-49b-v1.5' + | 'nvidia/nemotron-3-nano-30b-a3b' + | 'nvidia/nemotron-3-nano-30b-a3b:free' + | 'nvidia/nemotron-nano-12b-v2-vl' + | 'nvidia/nemotron-nano-12b-v2-vl:free' + | 'nvidia/nemotron-nano-9b-v2' + | 'nvidia/nemotron-nano-9b-v2:free' + | 'openai/chatgpt-4o-latest' + | 'openai/codex-mini' + | 'openai/gpt-3.5-turbo' + | 'openai/gpt-3.5-turbo-0613' + | 'openai/gpt-3.5-turbo-16k' + | 'openai/gpt-3.5-turbo-instruct' + | 'openai/gpt-4' + | 'openai/gpt-4-0314' + | 'openai/gpt-4-1106-preview' + | 'openai/gpt-4-turbo' + | 'openai/gpt-4-turbo-preview' + | 'openai/gpt-4.1' + | 'openai/gpt-4.1-mini' + | 'openai/gpt-4.1-nano' + | 'openai/gpt-4o' + | 'openai/gpt-4o-2024-05-13' + | 'openai/gpt-4o-2024-08-06' + | 'openai/gpt-4o-2024-11-20' + | 'openai/gpt-4o-audio-preview' + | 'openai/gpt-4o-mini' + | 'openai/gpt-4o-mini-2024-07-18' + | 'openai/gpt-4o-mini-search-preview' + | 'openai/gpt-4o-search-preview' + | 'openai/gpt-4o:extended' + | 'openai/gpt-5' + | 'openai/gpt-5-chat' + | 'openai/gpt-5-codex' + | 'openai/gpt-5-image' + | 'openai/gpt-5-image-mini' + | 'openai/gpt-5-mini' + | 'openai/gpt-5-nano' + | 'openai/gpt-5-pro' + | 'openai/gpt-5.1' + | 'openai/gpt-5.1-chat' + | 'openai/gpt-5.1-codex' + | 'openai/gpt-5.1-codex-max' + | 'openai/gpt-5.1-codex-mini' + | 'openai/gpt-5.2' + | 'openai/gpt-5.2-chat' + | 'openai/gpt-5.2-pro' + | 'openai/gpt-oss-120b' + | 'openai/gpt-oss-120b:exacto' + | 'openai/gpt-oss-120b:free' + | 'openai/gpt-oss-20b' + | 'openai/gpt-oss-20b:free' + | 'openai/gpt-oss-safeguard-20b' + | 'openai/o1' + | 'openai/o1-pro' + | 'openai/o3' + | 'openai/o3-deep-research' + | 'openai/o3-mini' + | 'openai/o3-mini-high' + | 'openai/o3-pro' + | 'openai/o4-mini' + | 'openai/o4-mini-deep-research' + | 'openai/o4-mini-high' + | 'opengvlab/internvl3-78b' + | 'openrouter/auto' + | 'openrouter/bodybuilder' + | 'perplexity/sonar' + | 'perplexity/sonar-deep-research' + | 'perplexity/sonar-pro' + | 'perplexity/sonar-pro-search' + | 'perplexity/sonar-reasoning' + | 'perplexity/sonar-reasoning-pro' + | 'prime-intellect/intellect-3' + | 'qwen/qwen-2.5-72b-instruct' + | 'qwen/qwen-2.5-7b-instruct' + | 'qwen/qwen-2.5-coder-32b-instruct' + | 'qwen/qwen-2.5-vl-7b-instruct' + | 'qwen/qwen-2.5-vl-7b-instruct:free' + | 'qwen/qwen-max' + | 'qwen/qwen-plus' + | 'qwen/qwen-plus-2025-07-28' + | 'qwen/qwen-plus-2025-07-28:thinking' + | 'qwen/qwen-turbo' + | 'qwen/qwen-vl-max' + | 'qwen/qwen-vl-plus' + | 'qwen/qwen2.5-coder-7b-instruct' + | 'qwen/qwen2.5-vl-32b-instruct' + | 'qwen/qwen2.5-vl-72b-instruct' + | 'qwen/qwen3-14b' + | 'qwen/qwen3-235b-a22b' + | 'qwen/qwen3-235b-a22b-2507' + | 'qwen/qwen3-235b-a22b-thinking-2507' + | 'qwen/qwen3-30b-a3b' + | 'qwen/qwen3-30b-a3b-instruct-2507' + | 'qwen/qwen3-30b-a3b-thinking-2507' + | 'qwen/qwen3-32b' + | 'qwen/qwen3-4b:free' + | 'qwen/qwen3-8b' + | 'qwen/qwen3-coder' + | 'qwen/qwen3-coder-30b-a3b-instruct' + | 'qwen/qwen3-coder-flash' + | 'qwen/qwen3-coder-plus' + | 'qwen/qwen3-coder:exacto' + | 'qwen/qwen3-coder:free' + | 'qwen/qwen3-max' + | 'qwen/qwen3-next-80b-a3b-instruct' + | 'qwen/qwen3-next-80b-a3b-thinking' + | 'qwen/qwen3-vl-235b-a22b-instruct' + | 'qwen/qwen3-vl-235b-a22b-thinking' + | 'qwen/qwen3-vl-30b-a3b-instruct' + | 'qwen/qwen3-vl-30b-a3b-thinking' + | 'qwen/qwen3-vl-32b-instruct' + | 'qwen/qwen3-vl-8b-instruct' + | 'qwen/qwen3-vl-8b-thinking' + | 'qwen/qwq-32b' + | 'raifle/sorcererlm-8x22b' + | 'relace/relace-apply-3' + | 'relace/relace-search' + | 'sao10k/l3-euryale-70b' + | 'sao10k/l3-lunaris-8b' + | 'sao10k/l3.1-70b-hanami-x1' + | 'sao10k/l3.1-euryale-70b' + | 'sao10k/l3.3-euryale-70b' + | 'stepfun-ai/step3' + | 'switchpoint/router' + | 'tencent/hunyuan-a13b-instruct' + | 'thedrummer/cydonia-24b-v4.1' + | 'thedrummer/rocinante-12b' + | 'thedrummer/skyfall-36b-v2' + | 'thedrummer/unslopnemo-12b' + | 'thudm/glm-4.1v-9b-thinking' + | 'tngtech/deepseek-r1t-chimera' + | 'tngtech/deepseek-r1t-chimera:free' + | 'tngtech/deepseek-r1t2-chimera' + | 'tngtech/deepseek-r1t2-chimera:free' + | 'tngtech/tng-r1t-chimera' + | 'tngtech/tng-r1t-chimera:free' + | 'undi95/remm-slerp-l2-13b' + | 'x-ai/grok-3' + | 'x-ai/grok-3-beta' + | 'x-ai/grok-3-mini' + | 'x-ai/grok-3-mini-beta' + | 'x-ai/grok-4' + | 'x-ai/grok-4-fast' + | 'x-ai/grok-4.1-fast' + | 'x-ai/grok-code-fast-1' + | 'xiaomi/mimo-v2-flash:free' + | 'z-ai/glm-4-32b' + | 'z-ai/glm-4.5' + | 'z-ai/glm-4.5-air' + | 'z-ai/glm-4.5-air:free' + | 'z-ai/glm-4.5v' + | 'z-ai/glm-4.6' + | 'z-ai/glm-4.6:exacto' + | 'z-ai/glm-4.6v' + | 'z-ai/glm-4.7'; + +/** + * Static variants that create distinct model IDs. + * These are already present in the API response (e.g., "openai/gpt-4:free"). + */ +export type StaticVariant = 'free' | 'extended' | 'exacto' | 'thinking'; + +/** + * Virtual variants used for routing hints. + * These do not create distinct model IDs but affect routing behavior. + */ +export type VirtualVariant = 'all' | 'online' | 'nitro' | 'floor'; + +/** + * All available variants. + */ +export type Variant = StaticVariant | VirtualVariant; + +/** + * Hash of model IDs for staleness checking. + * Used by postinstall script to detect outdated types. + */ +export const MODEL_HASH = '986e77d89072f654'; diff --git a/tests/e2e/README.md b/tests/e2e/README.md index e4d6d37f..612393e5 100644 --- a/tests/e2e/README.md +++ b/tests/e2e/README.md @@ -74,6 +74,6 @@ The e2e test suite includes: - Tests make real API calls to OpenRouter, so you need a valid API key - Tests may consume API credits -- Chat tests use the `meta-llama/llama-3.2-1b-instruct` model by default +- Chat tests use the `anthropic/claude-haiku-4.5` model by default - Embeddings tests use the `openai/text-embedding-3-small` model by default - The beta responses endpoint has limited test coverage as it's still in development