diff --git a/.speakeasy/gen.lock b/.speakeasy/gen.lock index b72e4349..eede582c 100644 --- a/.speakeasy/gen.lock +++ b/.speakeasy/gen.lock @@ -1,19 +1,19 @@ lockVersion: 2.0.0 id: c48cf606-fb42-4a45-9c23-8f0555307828 management: - docChecksum: c4f0161bb8b792d1609f7d79f4da61dc + docChecksum: 0e7f4e208ef7a971897ac382f8ea3b5f docVersion: 1.0.0 speakeasyVersion: 1.803.2 generationVersion: 2.950.13 - releaseVersion: 1.3.113 - configChecksum: 92dcc734deb2cbb15fd272beb165b04c + releaseVersion: 1.3.114 + configChecksum: 79fd22df293f90d2c231dee9422ac15e repoURL: https://github.com/OpenRouterTeam/python-sdk.git installationURL: https://github.com/OpenRouterTeam/python-sdk.git published: true persistentEdits: - generation_id: 4d16611a-2f95-44eb-9f29-52d649b99b71 - pristine_commit_hash: 62ea270ef914d8d92496a214cccee7e0214417ee - pristine_tree_hash: 54041a4c2887f1fcafa01fe0abb3afea1705f852 + generation_id: e8345be0-7b1d-41e3-a257-b60b3ea1848c + pristine_commit_hash: 80975087d80a373d506d1a8d36724e6997b463f7 + pristine_tree_hash: 745c3d46a2669248c5a69945307011df894fb3f6 features: python: acceptHeaders: 3.0.0 @@ -2700,8 +2700,8 @@ trackedFiles: pristine_git_object: 60a8a9993454283b528ba080749a43d9ba32c94f docs/components/createprivateendpointrequest.mdx: id: 14dbb5bba6c1 - last_write_checksum: sha1:691fd3df0feca19ea6dbaa4fbcd09f652cc64160 - pristine_git_object: 890018a1e978a65d54743bb46d415220601fcd53 + last_write_checksum: sha1:e2d6fc1d3a5c3b0a143b600078c7b2441aedc767 + pristine_git_object: 5df60f46f02fc9d8322144bbe6218567492a8ae2 docs/components/createprivateendpointrequestdeclaredregion.mdx: id: 58cea9c8b74d last_write_checksum: sha1:7b835ef8af060b80af19bbbb1eae9ec24eabf747 @@ -8318,14 +8318,6 @@ trackedFiles: id: 38c4ebf7f509 last_write_checksum: sha1:c412b92e1d6af7963cece5db3f59736cdc41bb0d pristine_git_object: ec3df81fe733a4e648afc6c07b2aa00c830a74b3 - docs/components/updateprivateendpointparametersrequest.mdx: - id: f28148578ff0 - last_write_checksum: sha1:74b71d97ffbd1c992584b3e2587dcea81fa5e871 - pristine_git_object: 632172f89859d6c2d9ec1a31ad0bccacb76fed42 - docs/components/updateprivateendpointpricingrequest.mdx: - id: 1ed6ca2fbacb - last_write_checksum: sha1:61dff44ae36c227021e6eb5d7f466a80598ed5e6 - pristine_git_object: fd379b0a614a61c1db2e3f33c4b1286750e4f99a docs/components/updateprivateendpointrequest.mdx: id: 8a1aa4763af9 last_write_checksum: sha1:594e8a7a7292ab7e7c2e4c4393fc3b5ec7c3e249 @@ -9144,8 +9136,8 @@ trackedFiles: pristine_git_object: f59c981dba0d9addbaafe169f9480725861cb2b0 docs/operations/createprivateendpointrequest.mdx: id: 3cb88260cf95 - last_write_checksum: sha1:a494187187accf2445380fbcd7b0ff971d447e11 - pristine_git_object: bf0ae5803892de36bd914b7c42315d3c1d4eb57d + last_write_checksum: sha1:2ff08be8a21150a463e4892994655537f991aec3 + pristine_git_object: 089e00c9da0bb7b10849a3322d4ba8a3fbcdcb69 docs/operations/createprivateproviderglobals.mdx: id: 9de3624ed338 last_write_checksum: sha1:07e22fd44ba8692f6b64f3bb4c8014db646246c8 @@ -10510,22 +10502,6 @@ trackedFiles: id: fb671a4175d8 last_write_checksum: sha1:0c79aaf6256a62cfdc25ea6aa083f61ba65ed5d2 pristine_git_object: 99aa016014f01e2c960c2b37cef02b662b7089a8 - docs/operations/updateprivateendpointparametersglobals.mdx: - id: d57d2eb9d772 - last_write_checksum: sha1:d04a150621ec3ebdd595ed4e5d18e69673a289c7 - pristine_git_object: 57f4741d5db891f57183f1da12a141ec9ceb2323 - docs/operations/updateprivateendpointparametersrequest.mdx: - id: 7fa38e027542 - last_write_checksum: sha1:e107cfb608fc044799721acac7e35403087c54b2 - pristine_git_object: bef8262d8478847e77d968a804834bc28a2f91ef - docs/operations/updateprivateendpointpricingglobals.mdx: - id: d438b0badcdd - last_write_checksum: sha1:f87f9621c873bbb51140da2fd29023163990c4de - pristine_git_object: 6ad2cba0607f770e206189a793f529547261ac2d - docs/operations/updateprivateendpointpricingrequest.mdx: - id: 29d65219dddb - last_write_checksum: sha1:bc4baddbc573634727e752b4d1b7f907528b642d - pristine_git_object: 5521c5f6c1bf939076e4569d9968468d0f2fd3f3 docs/operations/updateprivateendpointrequest.mdx: id: ecd591dc8dd4 last_write_checksum: sha1:314d0307951bbcc6d95432d192a9d71663e55d81 @@ -10704,8 +10680,8 @@ trackedFiles: pristine_git_object: 10dbc7da31e08f14827c9bab01ff6997b5837094 docs/sdks/privateendpoints/README.mdx: id: 54dee70b8cc7 - last_write_checksum: sha1:d3959235845b4eb2f3ba2893837a13533f4b4329 - pristine_git_object: 4b496d94c6129d50b35fd1d6787afac16f9e49d4 + last_write_checksum: sha1:3ac93193ced7cea4d0acceecdc52f8348d035275 + pristine_git_object: 471a5df2d57e9544e20f44c8086b628fc7d28980 docs/sdks/privateproviders/README.mdx: id: 517c31195442 last_write_checksum: sha1:22379f526020ffa2f754e48de54a7e641778c14e @@ -10760,8 +10736,8 @@ trackedFiles: pristine_git_object: 3e38f1a929f7d6b1d6de74604aa87e3d8f010544 pyproject.toml: id: 5d07e7d72637 - last_write_checksum: sha1:a997da66214801a9a3768f4e8abc0a9197a2520f - pristine_git_object: 29c59aead7647322fe8616416174a497c6ccf2a5 + last_write_checksum: sha1:8c3045c73332b1f2796a1d4cdacd190135990d3e + pristine_git_object: 4c308bfbf348b3bf4058eda95fcc6f3be9bf61c0 scripts/prepare_readme.py: id: e0c5957a6035 last_write_checksum: sha1:77f44b60b98bc126557ec27391f91dfba764bb54 @@ -10788,8 +10764,8 @@ trackedFiles: pristine_git_object: 86713cfea633e09d33b3d4e65281071fe20e6137 src/openrouter/_version.py: id: d8d15ad6c586 - last_write_checksum: sha1:b9a22eac6857417590d8db5aa73c6806ecc4ab36 - pristine_git_object: 1a12206abefda78146c447729eaecc902ff28791 + last_write_checksum: sha1:5a0e4cf9976ffdfcea01bcd1f32f7b7513834159 + pristine_git_object: ecaf3869eb66d8e0ede44dadbf7251985499373a src/openrouter/alpha.py: id: 306c4d93308d last_write_checksum: sha1:80cc0f39649445431cc2247ed0e0765438467766 @@ -10836,8 +10812,8 @@ trackedFiles: pristine_git_object: ad3d247954547814054c01989a2dff3d12b3e4e1 src/openrouter/components/__init__.py: id: 81754e97b3f4 - last_write_checksum: sha1:2682abfadc334567dc3af19450c3e651ab3415bb - pristine_git_object: 0c3a3979f1342560b3badcfdc2f142fc1001d8ff + last_write_checksum: sha1:c407570957aec483d10f0ce582a20266ef185e84 + pristine_git_object: 152d21f436d992456f943776b75fcfa1ace12b24 src/openrouter/components/aabenchmarkentry.py: id: e2e0f0b48c82 last_write_checksum: sha1:fab4d9a24d2cea937bb749d46c5f83941e99d65c @@ -11972,8 +11948,8 @@ trackedFiles: pristine_git_object: ffdb3753adda06f3d93b505ab17657337c66067c src/openrouter/components/createprivateendpointrequest.py: id: b97ebc39b8da - last_write_checksum: sha1:f01cec108a563af2dba128edf89c1fd1b31085f6 - pristine_git_object: f34960b6ef9560cefba8397e43f2c73baaf2e7dd + last_write_checksum: sha1:703473e30face0decf6fc4176263c745b6b991f4 + pristine_git_object: 52e9bdd4b986abf0ef7ab0bcaeee32aaa3d63aca src/openrouter/components/createprivateendpointvalidationfailedresponse_error.py: id: 9960b9ef29f1 last_write_checksum: sha1:337c9b2191e51407481b588d7f47beeba37bc1f1 @@ -14182,14 +14158,6 @@ trackedFiles: id: 2d255d9e4ac4 last_write_checksum: sha1:6b703da8963b0173865bd4692d53bd53b50b42a0 pristine_git_object: add97f9dbdd883540c97aaeffb4a9f227097b07e - src/openrouter/components/updateprivateendpointparametersrequest.py: - id: 5ef821e2e35c - last_write_checksum: sha1:af9d883d7a2df9c6e0ce936aa96bdf0267607a82 - pristine_git_object: 82f068b828e5597f2f8f5e3fbee5b55c32884d26 - src/openrouter/components/updateprivateendpointpricingrequest.py: - id: dc1e04b12316 - last_write_checksum: sha1:9b850873548f0fd6ccba35cc46abe9ecf1618091 - pristine_git_object: 3d096268edfbd2126133cf6da1bb66753ab315d6 src/openrouter/components/updateprivateendpointrequest.py: id: 51a950d71ff3 last_write_checksum: sha1:8cce23bc93220d54540778d40d0dcc615f143e8f @@ -14584,8 +14552,8 @@ trackedFiles: pristine_git_object: 4a35ede011d09dddab042e2c00413ce4f6be655e src/openrouter/operations/__init__.py: id: 9afcea1e7161 - last_write_checksum: sha1:65c7067945cdfa8d1d786cb025055b719bc53611 - pristine_git_object: cd182637308e7104b2eac4488000b9bc8eabceab + last_write_checksum: sha1:3549a224597521d4f1d080a8d9acdfd6a9de3fa7 + pristine_git_object: 7319f555fe88b80496da7b646185e294f6d83d38 src/openrouter/operations/activateprivateendpoint.py: id: 3b39eec5d66f last_write_checksum: sha1:9406e6b3d38c82895fd795f637702ef579cc6d36 @@ -14692,8 +14660,8 @@ trackedFiles: pristine_git_object: becc8c5f5af5402ce510eda9784ba2ff675d6a94 src/openrouter/operations/createprivateendpoint.py: id: 4c2fd54c9685 - last_write_checksum: sha1:67f35439996a6db0ac7c40f65d331d9a5573a3f8 - pristine_git_object: cd6cc2ee4a12a1419bfd134c7bc8b353e040630f + last_write_checksum: sha1:1b90429bdf4fce7a572624bff66ca21bff48b546 + pristine_git_object: d06bbd71cd1af7bc5922b1969b390082d17c99e7 src/openrouter/operations/createprivateprovider.py: id: 0ef86e7ce6bd last_write_checksum: sha1:3fe74d2e24aacf9db45ad38e694a3b1503d7d056 @@ -15134,14 +15102,6 @@ trackedFiles: id: c907f6c383b3 last_write_checksum: sha1:cf6b47a32acb5fda4c5fc29bf9f8b170fa838a76 pristine_git_object: f916dfcbe0f5a459756adbdeda9320c5bab6c0e5 - src/openrouter/operations/updateprivateendpointparameters.py: - id: 3e8cc18ac39c - last_write_checksum: sha1:2cb70245dec21fa448905d5a986cd11d35061971 - pristine_git_object: c2fbf756c061c354b1b3dfcd8d9bd8817df029a8 - src/openrouter/operations/updateprivateendpointpricing.py: - id: 8c04cca6c180 - last_write_checksum: sha1:748d5e531ee17d61982327f319a882bb5492ad4b - pristine_git_object: 144cf09790cbf4d2cdb13d91171d9e7609d32370 src/openrouter/operations/updateprivateprovider.py: id: 50eadba23be0 last_write_checksum: sha1:b4333aa3b53c9cf55bf310174a2c586aacb43a86 @@ -15176,8 +15136,8 @@ trackedFiles: pristine_git_object: 4edc4e886abe1848022ee7931877859e2d809bfb src/openrouter/private_endpoints.py: id: fdbce8846ed0 - last_write_checksum: sha1:1b13e618b76900d06fafa5660126f0cd46f7121e - pristine_git_object: 4407f1f32fc228b47344082d322d1502fc3fbcf1 + last_write_checksum: sha1:c8baf7bd88047e96d693b2d08e37c77fa8607468 + pristine_git_object: a33f9f4f03ba25f7908cdcd47cd056128c734ca2 src/openrouter/private_providers.py: id: d2b888527155 last_write_checksum: sha1:c795b1d9ab2dc4a86055bb1e32430e3832be6cc2 @@ -19870,4 +19830,8 @@ examples: "529": application/json: {"error": {"code": 529, "message": "Provider returned error"}} examplesVersion: 1.0.2 -releaseNotes: "## Python SDK Changes:\n* `open_router.alpha.decisions.create()`: `request.provider` **Changed**\n* `open_router.alpha.extractions.create()`: `request.provider` **Changed**\n* `open_router.tts.create_speech()`: \n * `request.provider.options.antdigital` **Added**\n* `open_router.stt.create_transcription()`: \n * `request.provider.options.antdigital` **Added**\n* `open_router.batch.create_batches()`: \n * `request.provider.only[].union(ProviderName).enum(ant_digital)` **Added**\n* `open_router.byok.list()`: \n * `request.provider` **Changed**\n * `response.data[].provider.enum(antdigital)` **Added**\n* `open_router.byok.create()`: \n * `request.provider.enum(antdigital)` **Added**\n * `response.data.provider.enum(antdigital)` **Added**\n* `open_router.byok.get()`: `response.data.provider.enum(antdigital)` **Added**\n* `open_router.byok.update()`: `response.data.provider.enum(antdigital)` **Added**\n* `open_router.embeddings.generate()`: `request.provider` **Changed**\n* `open_router.endpoints.list_zdr_endpoints()`: `response.data[].provider_name.enum(ant_digital)` **Added**\n* `open_router.endpoints.list()`: `response.data.endpoints[].provider_name.enum(ant_digital)` **Added**\n* `open_router.generations.get_generation()`: `response.data.provider_responses[].provider_name.enum(ant_digital)` **Added**\n* `open_router.models.list()`: `request.endpoints` **Added**\n* `open_router.presets.create_presets_chat_completions()`: `request.provider` **Changed**\n* `open_router.presets.create_presets_messages()`: `request.provider` **Changed**\n* `open_router.presets.create_presets_responses()`: `request.provider` **Changed**\n* `open_router.rerank.rerank()`: `request.provider` **Changed**\n* `open_router.system_one.create()`: `request.provider` **Changed**\n* `open_router.video_generation.generate()`: \n * `request.provider.options.antdigital` **Added**\n" +releaseNotes: | + ## Python SDK Changes: + * `open_router.private_endpoints.create()`: `request.max_completion_tokens` **Removed** (Breaking ⚠️) + * `open_router.private_endpoints.update_parameters()`: **Removed** (Breaking ⚠️) + * `open_router.private_endpoints.update_pricing()`: **Removed** (Breaking ⚠️) diff --git a/.speakeasy/gen.yaml b/.speakeasy/gen.yaml index f53da574..c7e872ed 100644 --- a/.speakeasy/gen.yaml +++ b/.speakeasy/gen.yaml @@ -37,7 +37,7 @@ generation: documentation: mintlify preApplyUnionDiscriminators: true python: - version: 1.3.113 + version: 1.3.114 additionalDependencies: dev: pytest: '>=8.3' diff --git a/.speakeasy/out.openapi.yaml b/.speakeasy/out.openapi.yaml index 5a0c9898..71d6fae5 100644 --- a/.speakeasy/out.openapi.yaml +++ b/.speakeasy/out.openapi.yaml @@ -10495,12 +10495,6 @@ components: type: - 'boolean' - 'null' - max_completion_tokens: - description: 'Cap on completion tokens per request. Requests asking for more skip this endpoint, and the default output length stays within it. When omitted, the cap is copied from the public endpoint for the same model and provider, if there is one.' - example: 131072 - maximum: 2147483647 - minimum: 1 - type: 'integer' model_permaslug: description: 'Permanent slug of the model this endpoint serves.' example: 'openai/gpt-4o-2024-08-06' @@ -33951,27 +33945,6 @@ components: required: - 'is_filtered_model_catalog_enabled' type: 'object' - UpdatePrivateEndpointParametersRequest: - properties: - declared_parameters: - description: 'Parameters the upstream supports beyond the tested ones. Replaces the earlier declaration; tested parameters stay. Order and repeated names are ignored, but the list holds at most as many entries as there are declarable parameters, repeats included. `tool_choice` requires `tools` to be tested or declared.' - example: - - 'temperature' - - 'seed' - items: - $ref: '#/components/schemas/PrivateEndpointDeclaredParameter' - maxItems: 25 - type: 'array' - required: - - 'declared_parameters' - type: 'object' - UpdatePrivateEndpointPricingRequest: - properties: - pricing: - $ref: '#/components/schemas/PrivateEndpointPricing' - required: - - 'pricing' - type: 'object' UpdatePrivateEndpointRequest: description: 'Only the fields present change. `base_url`, `upstream_model_id`, `declared_zdr` and `declared_region` are accepted on a draft only; `pricing` and `declared_parameters` replace their value; `settings` is itself a partial update where `null` clears a limit or restores the provider default.' example: @@ -49274,12 +49247,12 @@ paths: description: 'Create a private endpoint as a draft. Drafts are not routable: validate one with `POST /private-endpoints/{id}/validate`, then activate it with `POST /private-endpoints/{id}/activate`. Pass `activate` to do all three in one call; if validation fails the draft is kept and returned with the failed checks. Send an `Idempotency-Key` header to make retries safe: a repeated key with the same request returns the endpoint the first request created; reusing it with different fields returns 422 `idempotency_key_reused`. Returns 400 `parameters_invalid` when `tool_choice` is declared without `tools`. The response does not echo `declared_parameters` or `tested_parameters`; read them with `GET /private-endpoints/{id}`. [Management key](/docs/guides/overview/auth/management-api-keys) required.' operationId: 'createPrivateEndpoint' parameters: - - description: 'Retry-safe create: a repeated create with the same key from the same organization returns the endpoint the first request created instead of creating another. The endpoint is returned as it is now. Reusing a key with a different request body (model, provider, base URL, upstream model ID, declared ZDR or region, pricing, or declared parameters) is rejected with 422 `idempotency_key_reused`. Declared parameters are compared as a set, so a retry that reorders or repeats a name replays the endpoint. `activate` and `max_completion_tokens` are not compared, and later edits to the endpoint do not affect the comparison.' + - description: 'Retry-safe create: a repeated create with the same key from the same organization returns the endpoint the first request created instead of creating another. The endpoint is returned as it is now. Reusing a key with a different request body (model, provider, base URL, upstream model ID, declared ZDR or region, pricing, or declared parameters) is rejected with 422 `idempotency_key_reused`. Declared parameters are compared as a set, so a retry that reorders or repeats a name replays the endpoint. `activate` and `settings` are not compared, and later edits to the endpoint do not affect the comparison. `settings` is still validated before the replay, so a retry with invalid settings returns 400 `settings_invalid` instead of the endpoint.' in: 'header' name: 'idempotency-key' required: false schema: - description: 'Retry-safe create: a repeated create with the same key from the same organization returns the endpoint the first request created instead of creating another. The endpoint is returned as it is now. Reusing a key with a different request body (model, provider, base URL, upstream model ID, declared ZDR or region, pricing, or declared parameters) is rejected with 422 `idempotency_key_reused`. Declared parameters are compared as a set, so a retry that reorders or repeats a name replays the endpoint. `activate` and `max_completion_tokens` are not compared, and later edits to the endpoint do not affect the comparison.' + description: 'Retry-safe create: a repeated create with the same key from the same organization returns the endpoint the first request created instead of creating another. The endpoint is returned as it is now. Reusing a key with a different request body (model, provider, base URL, upstream model ID, declared ZDR or region, pricing, or declared parameters) is rejected with 422 `idempotency_key_reused`. Declared parameters are compared as a set, so a retry that reorders or repeats a name replays the endpoint. `activate` and `settings` are not compared, and later edits to the endpoint do not affect the comparison. `settings` is still validated before the replay, so a retry with invalid settings returns 400 `settings_invalid` instead of the endpoint.' example: 'wayfair-gpt-4o-eastus-2026-09' maxLength: 255 minLength: 1 @@ -50066,258 +50039,6 @@ paths: - $ref: "#/components/parameters/AppIdentifier" - $ref: "#/components/parameters/AppDisplayName" - $ref: "#/components/parameters/AppCategories" - /private-endpoints/{id}/parameters: - put: - deprecated: true - description: 'Deprecated: send `declared_parameters` to `PATCH /private-endpoints/{id}` instead; this route behaves exactly like that call and will be removed. The body replaces the earlier declaration and is read as a set; `tested_parameters` stay. Returns 400 `parameters_invalid` when `tool_choice` is declared without `tools` being tested or declared. [Management key](/docs/guides/overview/auth/management-api-keys) required.' - operationId: 'updatePrivateEndpointParameters' - parameters: - - description: 'Stable identifier of the private endpoint.' - in: 'path' - name: 'id' - required: true - schema: - description: 'Stable identifier of the private endpoint.' - example: '5b1c4c4e-7d0a-4a8e-9f3a-2d6c1b0e8a11' - format: 'uuid' - type: 'string' - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/UpdatePrivateEndpointParametersRequest' - required: true - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/PrivateEndpointResponse' - description: 'The endpoint with its new declared parameters' - '400': - content: - application/json: - example: - error: - code: 400 - message: 'Invalid request parameters' - schema: - $ref: '#/components/schemas/BadRequestResponse' - description: 'Bad Request - Invalid request parameters or malformed input' - '401': - content: - application/json: - example: - error: - code: 401 - message: 'Missing Authentication header' - schema: - $ref: '#/components/schemas/UnauthorizedResponse' - description: 'Unauthorized - Authentication required or invalid credentials' - '403': - content: - application/json: - example: - error: - code: 403 - message: 'Only management keys can perform this operation' - schema: - $ref: '#/components/schemas/ForbiddenResponse' - description: 'Forbidden - Authentication successful but insufficient permissions' - '404': - content: - application/json: - example: - error: - code: 404 - message: 'Resource not found' - schema: - $ref: '#/components/schemas/NotFoundResponse' - description: 'Not Found - Resource does not exist' - '408': - content: - application/json: - example: - error: - code: 408 - message: 'Operation timed out. Please try again later.' - schema: - $ref: '#/components/schemas/RequestTimeoutResponse' - description: 'Request Timeout - Operation exceeded time limit' - '409': - content: - application/json: - example: - error: - code: 409 - message: 'Resource conflict. Please try again later.' - schema: - $ref: '#/components/schemas/ConflictResponse' - description: 'Conflict - Resource conflict or concurrent modification' - '422': - content: - application/json: - example: - error: - code: 422 - message: 'Invalid argument' - schema: - $ref: '#/components/schemas/UnprocessableEntityResponse' - description: 'Unprocessable Entity - Semantic validation failure' - '500': - content: - application/json: - example: - error: - code: 500 - message: 'Internal Server Error' - schema: - $ref: '#/components/schemas/InternalServerResponse' - description: 'Internal Server Error - Unexpected server error' - '502': - content: - application/json: - example: - error: - code: 502 - message: 'Provider returned error' - schema: - $ref: '#/components/schemas/BadGatewayResponse' - description: 'Bad Gateway - Provider/upstream API failure' - summary: 'Set private endpoint supported parameters (deprecated)' - tags: - - 'Private Endpoints' - x-speakeasy-name-override: 'updateParameters' - parameters: - - $ref: "#/components/parameters/AppIdentifier" - - $ref: "#/components/parameters/AppDisplayName" - - $ref: "#/components/parameters/AppCategories" - /private-endpoints/{id}/pricing: - put: - deprecated: true - description: 'Deprecated: send `pricing` to `PATCH /private-endpoints/{id}` instead; this route behaves exactly like that call and will be removed. The body replaces the whole pricing object: omitting `cache_read` or `cache_write` reverts that rate to the provider pricing strategy default. [Management key](/docs/guides/overview/auth/management-api-keys) required.' - operationId: 'updatePrivateEndpointPricing' - parameters: - - description: 'Stable identifier of the private endpoint.' - in: 'path' - name: 'id' - required: true - schema: - description: 'Stable identifier of the private endpoint.' - example: '5b1c4c4e-7d0a-4a8e-9f3a-2d6c1b0e8a11' - format: 'uuid' - type: 'string' - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/UpdatePrivateEndpointPricingRequest' - required: true - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/PrivateEndpointResponse' - description: 'The endpoint with its new pricing' - '400': - content: - application/json: - example: - error: - code: 400 - message: 'Invalid request parameters' - schema: - $ref: '#/components/schemas/BadRequestResponse' - description: 'Bad Request - Invalid request parameters or malformed input' - '401': - content: - application/json: - example: - error: - code: 401 - message: 'Missing Authentication header' - schema: - $ref: '#/components/schemas/UnauthorizedResponse' - description: 'Unauthorized - Authentication required or invalid credentials' - '403': - content: - application/json: - example: - error: - code: 403 - message: 'Only management keys can perform this operation' - schema: - $ref: '#/components/schemas/ForbiddenResponse' - description: 'Forbidden - Authentication successful but insufficient permissions' - '404': - content: - application/json: - example: - error: - code: 404 - message: 'Resource not found' - schema: - $ref: '#/components/schemas/NotFoundResponse' - description: 'Not Found - Resource does not exist' - '408': - content: - application/json: - example: - error: - code: 408 - message: 'Operation timed out. Please try again later.' - schema: - $ref: '#/components/schemas/RequestTimeoutResponse' - description: 'Request Timeout - Operation exceeded time limit' - '409': - content: - application/json: - example: - error: - code: 409 - message: 'Resource conflict. Please try again later.' - schema: - $ref: '#/components/schemas/ConflictResponse' - description: 'Conflict - Resource conflict or concurrent modification' - '422': - content: - application/json: - example: - error: - code: 422 - message: 'Invalid argument' - schema: - $ref: '#/components/schemas/UnprocessableEntityResponse' - description: 'Unprocessable Entity - Semantic validation failure' - '500': - content: - application/json: - example: - error: - code: 500 - message: 'Internal Server Error' - schema: - $ref: '#/components/schemas/InternalServerResponse' - description: 'Internal Server Error - Unexpected server error' - '502': - content: - application/json: - example: - error: - code: 502 - message: 'Provider returned error' - schema: - $ref: '#/components/schemas/BadGatewayResponse' - description: 'Bad Gateway - Provider/upstream API failure' - summary: 'Set private endpoint pricing (deprecated)' - tags: - - 'Private Endpoints' - x-speakeasy-name-override: 'updatePricing' - parameters: - - $ref: "#/components/parameters/AppIdentifier" - - $ref: "#/components/parameters/AppDisplayName" - - $ref: "#/components/parameters/AppCategories" /private-endpoints/{id}/validate: post: description: 'Send a live test request to the draft endpoint using the given workspace''s BYOK credential for its provider. A passing validation is required before activation. Failed checks return 200 with `passed: false`. [Management key](/docs/guides/overview/auth/management-api-keys) required.' diff --git a/.speakeasy/workflow.lock b/.speakeasy/workflow.lock index 5c8337a9..199dca94 100644 --- a/.speakeasy/workflow.lock +++ b/.speakeasy/workflow.lock @@ -2,8 +2,8 @@ speakeasyVersion: 1.803.2 sources: OpenRouter API: sourceNamespace: open-router-chat-completions-api - sourceRevisionDigest: sha256:b9c241fc1f9aba59afede4f29be10b52b76056871abbdbb3de18c2c415862fdf - sourceBlobDigest: sha256:e3a446331a1b952dcf736352c7277a7b206e623e08111fe3480f817ffaa5e95c + sourceRevisionDigest: sha256:f9a8c8d2b50132a692daacffe8be6581ee08eb79153957237262508e14ad2b59 + sourceBlobDigest: sha256:3021d6a981a1b74e0e70cb8217a0b3fea55e667727e06dcd8ab17a2bfc88c44f tags: - latest - 1.0.0 @@ -11,10 +11,10 @@ targets: open-router: source: OpenRouter API sourceNamespace: open-router-chat-completions-api - sourceRevisionDigest: sha256:b9c241fc1f9aba59afede4f29be10b52b76056871abbdbb3de18c2c415862fdf - sourceBlobDigest: sha256:e3a446331a1b952dcf736352c7277a7b206e623e08111fe3480f817ffaa5e95c + sourceRevisionDigest: sha256:f9a8c8d2b50132a692daacffe8be6581ee08eb79153957237262508e14ad2b59 + sourceBlobDigest: sha256:3021d6a981a1b74e0e70cb8217a0b3fea55e667727e06dcd8ab17a2bfc88c44f codeSamplesNamespace: open-router-python-code-samples - codeSamplesRevisionDigest: sha256:89d03dee077410e8de4f50e684e358f9e8be287956bc05dc7d72a7f3c1fe77df + codeSamplesRevisionDigest: sha256:481254ed1d2d6ab72fbc37b47f3301deaeb6ddce59271f03c231124ce625ee72 workflow: workflowVersion: 1.0.0 speakeasyVersion: 1.803.2 diff --git a/RELEASES.md b/RELEASES.md index c2cf32d7..5513457f 100644 --- a/RELEASES.md +++ b/RELEASES.md @@ -3899,4 +3899,14 @@ Based on: ### Generated - [python v1.3.113] . ### Releases -- [PyPI v1.3.113] https://pypi.org/project/openrouter/1.3.113 - . \ No newline at end of file +- [PyPI v1.3.113] https://pypi.org/project/openrouter/1.3.113 - . + +## 2026-11-04 04:07:02 +### Changes +Based on: +- OpenAPI Doc +- Speakeasy CLI 1.803.2 (2.950.13) https://github.com/speakeasy-api/speakeasy +### Generated +- [python v1.3.114] . +### Releases +- [PyPI v1.3.114] https://pypi.org/project/openrouter/1.3.114 - . \ No newline at end of file diff --git a/docs/components/createprivateendpointrequest.mdx b/docs/components/createprivateendpointrequest.mdx index 890018a1..5df60f46 100644 --- a/docs/components/createprivateendpointrequest.mdx +++ b/docs/components/createprivateendpointrequest.mdx @@ -11,7 +11,6 @@ title: "CreatePrivateEndpointRequest" | `declared_parameters` | List[[components.PrivateEndpointDeclaredParameter](../components/privateendpointdeclaredparameter.mdx)] | ➖ | Parameters the upstream supports beyond the tested ones. Replaces the earlier declaration; tested parameters stay. Order and repeated names are ignored, but the list holds at most as many entries as there are declarable parameters, repeats included. `tool_choice` requires `tools` to be tested or declared. | [
"temperature",
"seed"
] | | `declared_region` | [OptionalNullable[components.CreatePrivateEndpointRequestDeclaredRegion]](../components/createprivateendpointrequestdeclaredregion.mdx) | ➖ | Attest where this deployment processes data. | us | | `declared_zdr` | *OptionalNullable[bool]* | ➖ | Attest that this deployment retains no prompt or completion data. | | -| `max_completion_tokens` | *Optional[int]* | ➖ | Cap on completion tokens per request. Requests asking for more skip this endpoint, and the default output length stays within it. When omitted, the cap is copied from the public endpoint for the same model and provider, if there is one. | 131072 | | `model_permaslug` | *str* | ✔️ | Permanent slug of the model this endpoint serves. | openai/gpt-4o-2024-08-06 | | `pricing` | [Optional[components.PrivateEndpointPricing]](../components/privateendpointpricing.mdx) | ➖ | Negotiated per-token rates reported for requests routed to this endpoint. | \{
"cache_read": "0.00000025",
"cache_write": "0.000003125",
"completion": "0.00001",
"prompt": "0.0000025"
} | | `provider_slug` | *str* | ✔️ | Slug of the upstream provider. | azure | diff --git a/docs/components/updateprivateendpointparametersrequest.mdx b/docs/components/updateprivateendpointparametersrequest.mdx deleted file mode 100644 index 632172f8..00000000 --- a/docs/components/updateprivateendpointparametersrequest.mdx +++ /dev/null @@ -1,9 +0,0 @@ ---- -title: "UpdatePrivateEndpointParametersRequest" ---- - -## Fields - -| Field | Type | Required | Description | Example | -| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -| `declared_parameters` | List[[components.PrivateEndpointDeclaredParameter](../components/privateendpointdeclaredparameter.mdx)] | ✔️ | Parameters the upstream supports beyond the tested ones. Replaces the earlier declaration; tested parameters stay. Order and repeated names are ignored, but the list holds at most as many entries as there are declarable parameters, repeats included. `tool_choice` requires `tools` to be tested or declared. | [
"temperature",
"seed"
] | \ No newline at end of file diff --git a/docs/components/updateprivateendpointpricingrequest.mdx b/docs/components/updateprivateendpointpricingrequest.mdx deleted file mode 100644 index fd379b0a..00000000 --- a/docs/components/updateprivateendpointpricingrequest.mdx +++ /dev/null @@ -1,9 +0,0 @@ ---- -title: "UpdatePrivateEndpointPricingRequest" ---- - -## Fields - -| Field | Type | Required | Description | Example | -| ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | -| `pricing` | [components.PrivateEndpointPricing](../components/privateendpointpricing.mdx) | ✔️ | Negotiated per-token rates reported for requests routed to this endpoint. | \{
"cache_read": "0.00000025",
"cache_write": "0.000003125",
"completion": "0.00001",
"prompt": "0.0000025"
} | \ No newline at end of file diff --git a/docs/operations/createprivateendpointrequest.mdx b/docs/operations/createprivateendpointrequest.mdx index bf0ae580..089e00c9 100644 --- a/docs/operations/createprivateendpointrequest.mdx +++ b/docs/operations/createprivateendpointrequest.mdx @@ -4,10 +4,10 @@ title: "CreatePrivateEndpointRequest" ## Fields -| Field | Type | Required | Description | Example | -| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -| `http_referer` | *Optional[str]* | ➖ | The app identifier should be your app's URL and is used as the primary identifier for rankings.
This is used to track API usage per application.
| | -| `x_open_router_title` | *Optional[str]* | ➖ | The app display name allows you to customize how your app appears in OpenRouter's dashboard.
| | -| `x_open_router_categories` | *Optional[str]* | ➖ | Comma-separated list of app categories (e.g. "cli-agent,cloud-agent"). Used for marketplace rankings.
| | -| `idempotency_key` | *Optional[str]* | ➖ | Retry-safe create: a repeated create with the same key from the same organization returns the endpoint the first request created instead of creating another. The endpoint is returned as it is now. Reusing a key with a different request body (model, provider, base URL, upstream model ID, declared ZDR or region, pricing, or declared parameters) is rejected with 422 `idempotency_key_reused`. Declared parameters are compared as a set, so a retry that reorders or repeats a name replays the endpoint. `activate` and `max_completion_tokens` are not compared, and later edits to the endpoint do not affect the comparison. | wayfair-gpt-4o-eastus-2026-09 | -| `create_private_endpoint_request` | [components.CreatePrivateEndpointRequest](../components/createprivateendpointrequest.mdx) | ✔️ | N/A | | \ No newline at end of file +| Field | Type | Required | Description | Example | +| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `http_referer` | *Optional[str]* | ➖ | The app identifier should be your app's URL and is used as the primary identifier for rankings.
This is used to track API usage per application.
| | +| `x_open_router_title` | *Optional[str]* | ➖ | The app display name allows you to customize how your app appears in OpenRouter's dashboard.
| | +| `x_open_router_categories` | *Optional[str]* | ➖ | Comma-separated list of app categories (e.g. "cli-agent,cloud-agent"). Used for marketplace rankings.
| | +| `idempotency_key` | *Optional[str]* | ➖ | Retry-safe create: a repeated create with the same key from the same organization returns the endpoint the first request created instead of creating another. The endpoint is returned as it is now. Reusing a key with a different request body (model, provider, base URL, upstream model ID, declared ZDR or region, pricing, or declared parameters) is rejected with 422 `idempotency_key_reused`. Declared parameters are compared as a set, so a retry that reorders or repeats a name replays the endpoint. `activate` and `settings` are not compared, and later edits to the endpoint do not affect the comparison. `settings` is still validated before the replay, so a retry with invalid settings returns 400 `settings_invalid` instead of the endpoint. | wayfair-gpt-4o-eastus-2026-09 | +| `create_private_endpoint_request` | [components.CreatePrivateEndpointRequest](../components/createprivateendpointrequest.mdx) | ✔️ | N/A | | \ No newline at end of file diff --git a/docs/operations/updateprivateendpointparametersglobals.mdx b/docs/operations/updateprivateendpointparametersglobals.mdx deleted file mode 100644 index 57f4741d..00000000 --- a/docs/operations/updateprivateendpointparametersglobals.mdx +++ /dev/null @@ -1,11 +0,0 @@ ---- -title: "UpdatePrivateEndpointParametersGlobals" ---- - -## Fields - -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | -| `http_referer` | *Optional[str]* | ➖ | The app identifier should be your app's URL and is used as the primary identifier for rankings.
This is used to track API usage per application.
| -| `x_open_router_title` | *Optional[str]* | ➖ | The app display name allows you to customize how your app appears in OpenRouter's dashboard.
| -| `x_open_router_categories` | *Optional[str]* | ➖ | Comma-separated list of app categories (e.g. "cli-agent,cloud-agent"). Used for marketplace rankings.
| \ No newline at end of file diff --git a/docs/operations/updateprivateendpointparametersrequest.mdx b/docs/operations/updateprivateendpointparametersrequest.mdx deleted file mode 100644 index bef8262d..00000000 --- a/docs/operations/updateprivateendpointparametersrequest.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -title: "UpdatePrivateEndpointParametersRequest" ---- - -## Fields - -| Field | Type | Required | Description | Example | -| ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | -| `http_referer` | *Optional[str]* | ➖ | The app identifier should be your app's URL and is used as the primary identifier for rankings.
This is used to track API usage per application.
| | -| `x_open_router_title` | *Optional[str]* | ➖ | The app display name allows you to customize how your app appears in OpenRouter's dashboard.
| | -| `x_open_router_categories` | *Optional[str]* | ➖ | Comma-separated list of app categories (e.g. "cli-agent,cloud-agent"). Used for marketplace rankings.
| | -| `id` | *str* | ✔️ | Stable identifier of the private endpoint. | 5b1c4c4e-7d0a-4a8e-9f3a-2d6c1b0e8a11 | -| `update_private_endpoint_parameters_request` | [components.UpdatePrivateEndpointParametersRequest](../components/updateprivateendpointparametersrequest.mdx) | ✔️ | N/A | | \ No newline at end of file diff --git a/docs/operations/updateprivateendpointpricingglobals.mdx b/docs/operations/updateprivateendpointpricingglobals.mdx deleted file mode 100644 index 6ad2cba0..00000000 --- a/docs/operations/updateprivateendpointpricingglobals.mdx +++ /dev/null @@ -1,11 +0,0 @@ ---- -title: "UpdatePrivateEndpointPricingGlobals" ---- - -## Fields - -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | -| `http_referer` | *Optional[str]* | ➖ | The app identifier should be your app's URL and is used as the primary identifier for rankings.
This is used to track API usage per application.
| -| `x_open_router_title` | *Optional[str]* | ➖ | The app display name allows you to customize how your app appears in OpenRouter's dashboard.
| -| `x_open_router_categories` | *Optional[str]* | ➖ | Comma-separated list of app categories (e.g. "cli-agent,cloud-agent"). Used for marketplace rankings.
| \ No newline at end of file diff --git a/docs/operations/updateprivateendpointpricingrequest.mdx b/docs/operations/updateprivateendpointpricingrequest.mdx deleted file mode 100644 index 5521c5f6..00000000 --- a/docs/operations/updateprivateendpointpricingrequest.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -title: "UpdatePrivateEndpointPricingRequest" ---- - -## Fields - -| Field | Type | Required | Description | Example | -| ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | -| `http_referer` | *Optional[str]* | ➖ | The app identifier should be your app's URL and is used as the primary identifier for rankings.
This is used to track API usage per application.
| | -| `x_open_router_title` | *Optional[str]* | ➖ | The app display name allows you to customize how your app appears in OpenRouter's dashboard.
| | -| `x_open_router_categories` | *Optional[str]* | ➖ | Comma-separated list of app categories (e.g. "cli-agent,cloud-agent"). Used for marketplace rankings.
| | -| `id` | *str* | ✔️ | Stable identifier of the private endpoint. | 5b1c4c4e-7d0a-4a8e-9f3a-2d6c1b0e8a11 | -| `update_private_endpoint_pricing_request` | [components.UpdatePrivateEndpointPricingRequest](../components/updateprivateendpointpricingrequest.mdx) | ✔️ | N/A | | \ No newline at end of file diff --git a/docs/sdks/privateendpoints/README.mdx b/docs/sdks/privateendpoints/README.mdx index 4b496d94..471a5df2 100644 --- a/docs/sdks/privateendpoints/README.mdx +++ b/docs/sdks/privateendpoints/README.mdx @@ -17,8 +17,6 @@ Private Endpoints endpoints * [activate](#activate) - Activate a validated private endpoint * [disable](#disable) - Disable a private endpoint * [enable](#enable) - Enable a private endpoint -* [~~update_parameters~~](#update_parameters) - Set private endpoint supported parameters (deprecated) ⚠️ **Deprecated** -* [~~update_pricing~~](#update_pricing) - Set private endpoint pricing (deprecated) ⚠️ **Deprecated** * [validate](#validate) - Validate a draft private endpoint ## list @@ -96,24 +94,23 @@ with OpenRouter( ### Parameters -| Parameter | Type | Required | Description | Example | -| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -| `model_permaslug` | *str* | ✔️ | Permanent slug of the model this endpoint serves. | openai/gpt-4o-2024-08-06 | -| `provider_slug` | *str* | ✔️ | Slug of the upstream provider. | azure | -| `upstream_model_id` | *str* | ✔️ | Model or deployment identifier sent to the upstream provider. | gpt-4o-prod | -| `http_referer` | *Optional[str]* | ➖ | The app identifier should be your app's URL and is used as the primary identifier for rankings.
This is used to track API usage per application.
| | -| `x_open_router_title` | *Optional[str]* | ➖ | The app display name allows you to customize how your app appears in OpenRouter's dashboard.
| | -| `x_open_router_categories` | *Optional[str]* | ➖ | Comma-separated list of app categories (e.g. "cli-agent,cloud-agent"). Used for marketplace rankings.
| | -| `idempotency_key` | *Optional[str]* | ➖ | Retry-safe create: a repeated create with the same key from the same organization returns the endpoint the first request created instead of creating another. The endpoint is returned as it is now. Reusing a key with a different request body (model, provider, base URL, upstream model ID, declared ZDR or region, pricing, or declared parameters) is rejected with 422 `idempotency_key_reused`. Declared parameters are compared as a set, so a retry that reorders or repeats a name replays the endpoint. `activate` and `max_completion_tokens` are not compared, and later edits to the endpoint do not affect the comparison. | wayfair-gpt-4o-eastus-2026-09 | -| `activate` | [Optional[components.PrivateEndpointActivation]](../../components/privateendpointactivation.mdx) | ➖ | Validate and activate in the same call. On a failed validation the draft is kept and returned with a 422, so fix it and call `/validate` and `/activate` instead of creating it again. | \{
"workspace_id": "550e8400-e29b-41d4-a716-446655440000"
} | -| `base_url` | *Optional[str]* | ➖ | HTTPS base URL of your deployment. Required unless the provider derives its URL from the BYOK credential (Azure, Amazon Bedrock, Google Vertex). | https://contoso.openai.azure.com | -| `declared_parameters` | List[[components.PrivateEndpointDeclaredParameter](../../components/privateendpointdeclaredparameter.mdx)] | ➖ | Parameters the upstream supports beyond the tested ones. Replaces the earlier declaration; tested parameters stay. Order and repeated names are ignored, but the list holds at most as many entries as there are declarable parameters, repeats included. `tool_choice` requires `tools` to be tested or declared. | [
"temperature",
"seed"
] | -| `declared_region` | [OptionalNullable[components.CreatePrivateEndpointRequestDeclaredRegion]](../../components/createprivateendpointrequestdeclaredregion.mdx) | ➖ | Attest where this deployment processes data. | us | -| `declared_zdr` | *OptionalNullable[bool]* | ➖ | Attest that this deployment retains no prompt or completion data. | | -| `max_completion_tokens` | *Optional[int]* | ➖ | Cap on completion tokens per request. Requests asking for more skip this endpoint, and the default output length stays within it. When omitted, the cap is copied from the public endpoint for the same model and provider, if there is one. | 131072 | -| `pricing` | [Optional[components.PrivateEndpointPricing]](../../components/privateendpointpricing.mdx) | ➖ | Negotiated per-token rates reported for requests routed to this endpoint. | \{
"cache_read": "0.00000025",
"cache_write": "0.000003125",
"completion": "0.00001",
"prompt": "0.0000025"
} | -| `settings` | [Optional[components.UpdatePrivateEndpointSettingsRequest]](../../components/updateprivateendpointsettingsrequest.mdx) | ➖ | Capabilities and limits to set over the ones copied from the public endpoint for this model and provider (or from the model). Omitted fields keep the copied values. | \{
"context_length": 128000,
"reasoning": \{
"supported": true
}
} | -| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.mdx) | ➖ | Configuration to override the default retry behavior of the client. | | +| Parameter | Type | Required | Description | Example | +| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `model_permaslug` | *str* | ✔️ | Permanent slug of the model this endpoint serves. | openai/gpt-4o-2024-08-06 | +| `provider_slug` | *str* | ✔️ | Slug of the upstream provider. | azure | +| `upstream_model_id` | *str* | ✔️ | Model or deployment identifier sent to the upstream provider. | gpt-4o-prod | +| `http_referer` | *Optional[str]* | ➖ | The app identifier should be your app's URL and is used as the primary identifier for rankings.
This is used to track API usage per application.
| | +| `x_open_router_title` | *Optional[str]* | ➖ | The app display name allows you to customize how your app appears in OpenRouter's dashboard.
| | +| `x_open_router_categories` | *Optional[str]* | ➖ | Comma-separated list of app categories (e.g. "cli-agent,cloud-agent"). Used for marketplace rankings.
| | +| `idempotency_key` | *Optional[str]* | ➖ | Retry-safe create: a repeated create with the same key from the same organization returns the endpoint the first request created instead of creating another. The endpoint is returned as it is now. Reusing a key with a different request body (model, provider, base URL, upstream model ID, declared ZDR or region, pricing, or declared parameters) is rejected with 422 `idempotency_key_reused`. Declared parameters are compared as a set, so a retry that reorders or repeats a name replays the endpoint. `activate` and `settings` are not compared, and later edits to the endpoint do not affect the comparison. `settings` is still validated before the replay, so a retry with invalid settings returns 400 `settings_invalid` instead of the endpoint. | wayfair-gpt-4o-eastus-2026-09 | +| `activate` | [Optional[components.PrivateEndpointActivation]](../../components/privateendpointactivation.mdx) | ➖ | Validate and activate in the same call. On a failed validation the draft is kept and returned with a 422, so fix it and call `/validate` and `/activate` instead of creating it again. | \{
"workspace_id": "550e8400-e29b-41d4-a716-446655440000"
} | +| `base_url` | *Optional[str]* | ➖ | HTTPS base URL of your deployment. Required unless the provider derives its URL from the BYOK credential (Azure, Amazon Bedrock, Google Vertex). | https://contoso.openai.azure.com | +| `declared_parameters` | List[[components.PrivateEndpointDeclaredParameter](../../components/privateendpointdeclaredparameter.mdx)] | ➖ | Parameters the upstream supports beyond the tested ones. Replaces the earlier declaration; tested parameters stay. Order and repeated names are ignored, but the list holds at most as many entries as there are declarable parameters, repeats included. `tool_choice` requires `tools` to be tested or declared. | [
"temperature",
"seed"
] | +| `declared_region` | [OptionalNullable[components.CreatePrivateEndpointRequestDeclaredRegion]](../../components/createprivateendpointrequestdeclaredregion.mdx) | ➖ | Attest where this deployment processes data. | us | +| `declared_zdr` | *OptionalNullable[bool]* | ➖ | Attest that this deployment retains no prompt or completion data. | | +| `pricing` | [Optional[components.PrivateEndpointPricing]](../../components/privateendpointpricing.mdx) | ➖ | Negotiated per-token rates reported for requests routed to this endpoint. | \{
"cache_read": "0.00000025",
"cache_write": "0.000003125",
"completion": "0.00001",
"prompt": "0.0000025"
} | +| `settings` | [Optional[components.UpdatePrivateEndpointSettingsRequest]](../../components/updateprivateendpointsettingsrequest.mdx) | ➖ | Capabilities and limits to set over the ones copied from the public endpoint for this model and provider (or from the model). Omitted fields keep the copied values. | \{
"context_length": 128000,
"reasoning": \{
"supported": true
}
} | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.mdx) | ➖ | Configuration to override the default retry behavior of the client. | | ### Response @@ -467,126 +464,6 @@ with OpenRouter( | errors.BadGatewayResponseError | 502 | application/json | | errors.OpenRouterDefaultError | 4XX, 5XX | \*/\* | -## ~~update_parameters~~ - -Deprecated: send `declared_parameters` to `PATCH /private-endpoints/{id}` instead; this route behaves exactly like that call and will be removed. The body replaces the earlier declaration and is read as a set; `tested_parameters` stay. Returns 400 `parameters_invalid` when `tool_choice` is declared without `tools` being tested or declared. [Management key](/docs/guides/overview/auth/management-api-keys) required. - -> ⚠️ **DEPRECATED**: This will be removed in a future release, please migrate away from it as soon as possible. - -### Example Usage - -```python -from openrouter import OpenRouter -import os - - -with OpenRouter( - http_referer="", - x_open_router_title="", - x_open_router_categories="", - api_key=os.getenv("OPENROUTER_API_KEY", ""), -) as open_router: - - res = open_router.private_endpoints.update_parameters(id="5b1c4c4e-7d0a-4a8e-9f3a-2d6c1b0e8a11", declared_parameters=[ - "temperature", - "seed", - ]) - - # Handle response - print(res) - -``` - -### Parameters - -| Parameter | Type | Required | Description | Example | -| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -| `id` | *str* | ✔️ | Stable identifier of the private endpoint. | 5b1c4c4e-7d0a-4a8e-9f3a-2d6c1b0e8a11 | -| `declared_parameters` | List[[components.PrivateEndpointDeclaredParameter](../../components/privateendpointdeclaredparameter.mdx)] | ✔️ | Parameters the upstream supports beyond the tested ones. Replaces the earlier declaration; tested parameters stay. Order and repeated names are ignored, but the list holds at most as many entries as there are declarable parameters, repeats included. `tool_choice` requires `tools` to be tested or declared. | [
"temperature",
"seed"
] | -| `http_referer` | *Optional[str]* | ➖ | The app identifier should be your app's URL and is used as the primary identifier for rankings.
This is used to track API usage per application.
| | -| `x_open_router_title` | *Optional[str]* | ➖ | The app display name allows you to customize how your app appears in OpenRouter's dashboard.
| | -| `x_open_router_categories` | *Optional[str]* | ➖ | Comma-separated list of app categories (e.g. "cli-agent,cloud-agent"). Used for marketplace rankings.
| | -| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.mdx) | ➖ | Configuration to override the default retry behavior of the client. | | - -### Response - -**[components.PrivateEndpointResponse](../../components/privateendpointresponse.mdx)** - -### Errors - -| Error Type | Status Code | Content Type | -| --------------------------------------- | --------------------------------------- | --------------------------------------- | -| errors.BadRequestResponseError | 400 | application/json | -| errors.UnauthorizedResponseError | 401 | application/json | -| errors.ForbiddenResponseError | 403 | application/json | -| errors.NotFoundResponseError | 404 | application/json | -| errors.RequestTimeoutResponseError | 408 | application/json | -| errors.ConflictResponseError | 409 | application/json | -| errors.UnprocessableEntityResponseError | 422 | application/json | -| errors.InternalServerResponseError | 500 | application/json | -| errors.BadGatewayResponseError | 502 | application/json | -| errors.OpenRouterDefaultError | 4XX, 5XX | \*/\* | - -## ~~update_pricing~~ - -Deprecated: send `pricing` to `PATCH /private-endpoints/{id}` instead; this route behaves exactly like that call and will be removed. The body replaces the whole pricing object: omitting `cache_read` or `cache_write` reverts that rate to the provider pricing strategy default. [Management key](/docs/guides/overview/auth/management-api-keys) required. - -> ⚠️ **DEPRECATED**: This will be removed in a future release, please migrate away from it as soon as possible. - -### Example Usage - -```python -from openrouter import OpenRouter -import os - - -with OpenRouter( - http_referer="", - x_open_router_title="", - x_open_router_categories="", - api_key=os.getenv("OPENROUTER_API_KEY", ""), -) as open_router: - - res = open_router.private_endpoints.update_pricing(id="5b1c4c4e-7d0a-4a8e-9f3a-2d6c1b0e8a11", pricing={ - "completion": "0.00001", - "prompt": "0.0000025", - }) - - # Handle response - print(res) - -``` - -### Parameters - -| Parameter | Type | Required | Description | Example | -| ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | -| `id` | *str* | ✔️ | Stable identifier of the private endpoint. | 5b1c4c4e-7d0a-4a8e-9f3a-2d6c1b0e8a11 | -| `pricing` | [components.PrivateEndpointPricing](../../components/privateendpointpricing.mdx) | ✔️ | Negotiated per-token rates reported for requests routed to this endpoint. | \{
"cache_read": "0.00000025",
"cache_write": "0.000003125",
"completion": "0.00001",
"prompt": "0.0000025"
} | -| `http_referer` | *Optional[str]* | ➖ | The app identifier should be your app's URL and is used as the primary identifier for rankings.
This is used to track API usage per application.
| | -| `x_open_router_title` | *Optional[str]* | ➖ | The app display name allows you to customize how your app appears in OpenRouter's dashboard.
| | -| `x_open_router_categories` | *Optional[str]* | ➖ | Comma-separated list of app categories (e.g. "cli-agent,cloud-agent"). Used for marketplace rankings.
| | -| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.mdx) | ➖ | Configuration to override the default retry behavior of the client. | | - -### Response - -**[components.PrivateEndpointResponse](../../components/privateendpointresponse.mdx)** - -### Errors - -| Error Type | Status Code | Content Type | -| --------------------------------------- | --------------------------------------- | --------------------------------------- | -| errors.BadRequestResponseError | 400 | application/json | -| errors.UnauthorizedResponseError | 401 | application/json | -| errors.ForbiddenResponseError | 403 | application/json | -| errors.NotFoundResponseError | 404 | application/json | -| errors.RequestTimeoutResponseError | 408 | application/json | -| errors.ConflictResponseError | 409 | application/json | -| errors.UnprocessableEntityResponseError | 422 | application/json | -| errors.InternalServerResponseError | 500 | application/json | -| errors.BadGatewayResponseError | 502 | application/json | -| errors.OpenRouterDefaultError | 4XX, 5XX | \*/\* | - ## validate Send a live test request to the draft endpoint using the given workspace's BYOK credential for its provider. A passing validation is required before activation. Failed checks return 200 with `passed: false`. [Management key](/docs/guides/overview/auth/management-api-keys) required. diff --git a/pyproject.toml b/pyproject.toml index 29c59aea..4c308bfb 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "openrouter" -version = "1.3.113" +version = "1.3.114" description = "Official Python Client SDK for OpenRouter." authors = [{ name = "OpenRouter" },] readme = "README-PYPI.md" diff --git a/src/openrouter/_version.py b/src/openrouter/_version.py index 1a12206a..ecaf3869 100644 --- a/src/openrouter/_version.py +++ b/src/openrouter/_version.py @@ -3,10 +3,10 @@ import importlib.metadata __title__: str = "openrouter" -__version__: str = "1.3.113" +__version__: str = "1.3.114" __openapi_doc_version__: str = "1.0.0" __gen_version__: str = "2.950.13" -__user_agent__: str = "speakeasy-sdk/python 1.3.113 2.950.13 1.0.0 openrouter" +__user_agent__: str = "speakeasy-sdk/python 1.3.114 2.950.13 1.0.0 openrouter" try: if __package__ is not None: diff --git a/src/openrouter/components/__init__.py b/src/openrouter/components/__init__.py index 0c3a3979..152d21f4 100644 --- a/src/openrouter/components/__init__.py +++ b/src/openrouter/components/__init__.py @@ -4436,14 +4436,6 @@ UpdateOrganizationSettingsRequest, UpdateOrganizationSettingsRequestTypedDict, ) - from .updateprivateendpointparametersrequest import ( - UpdatePrivateEndpointParametersRequest, - UpdatePrivateEndpointParametersRequestTypedDict, - ) - from .updateprivateendpointpricingrequest import ( - UpdatePrivateEndpointPricingRequest, - UpdatePrivateEndpointPricingRequestTypedDict, - ) from .updateprivateendpointrequest import ( UpdatePrivateEndpointRequest, UpdatePrivateEndpointRequestDeclaredRegion, @@ -8008,10 +8000,6 @@ "UpdateObservabilityDestinationResponseTypedDict", "UpdateOrganizationSettingsRequest", "UpdateOrganizationSettingsRequestTypedDict", - "UpdatePrivateEndpointParametersRequest", - "UpdatePrivateEndpointParametersRequestTypedDict", - "UpdatePrivateEndpointPricingRequest", - "UpdatePrivateEndpointPricingRequestTypedDict", "UpdatePrivateEndpointRequest", "UpdatePrivateEndpointRequestDeclaredRegion", "UpdatePrivateEndpointRequestTypedDict", @@ -11445,10 +11433,6 @@ "UpdateObservabilityDestinationResponseTypedDict": ".updateobservabilitydestinationresponse", "UpdateOrganizationSettingsRequest": ".updateorganizationsettingsrequest", "UpdateOrganizationSettingsRequestTypedDict": ".updateorganizationsettingsrequest", - "UpdatePrivateEndpointParametersRequest": ".updateprivateendpointparametersrequest", - "UpdatePrivateEndpointParametersRequestTypedDict": ".updateprivateendpointparametersrequest", - "UpdatePrivateEndpointPricingRequest": ".updateprivateendpointpricingrequest", - "UpdatePrivateEndpointPricingRequestTypedDict": ".updateprivateendpointpricingrequest", "UpdatePrivateEndpointRequest": ".updateprivateendpointrequest", "UpdatePrivateEndpointRequestDeclaredRegion": ".updateprivateendpointrequest", "UpdatePrivateEndpointRequestTypedDict": ".updateprivateendpointrequest", diff --git a/src/openrouter/components/createprivateendpointrequest.py b/src/openrouter/components/createprivateendpointrequest.py index f34960b6..52e9bdd4 100644 --- a/src/openrouter/components/createprivateendpointrequest.py +++ b/src/openrouter/components/createprivateendpointrequest.py @@ -55,8 +55,6 @@ class CreatePrivateEndpointRequestTypedDict(TypedDict): r"""Attest where this deployment processes data.""" declared_zdr: NotRequired[Nullable[bool]] r"""Attest that this deployment retains no prompt or completion data.""" - max_completion_tokens: NotRequired[int] - r"""Cap on completion tokens per request. Requests asking for more skip this endpoint, and the default output length stays within it. When omitted, the cap is copied from the public endpoint for the same model and provider, if there is one.""" pricing: NotRequired[PrivateEndpointPricingTypedDict] r"""Negotiated per-token rates reported for requests routed to this endpoint.""" settings: NotRequired[UpdatePrivateEndpointSettingsRequestTypedDict] @@ -90,9 +88,6 @@ class CreatePrivateEndpointRequest(BaseModel): declared_zdr: OptionalNullable[bool] = UNSET r"""Attest that this deployment retains no prompt or completion data.""" - max_completion_tokens: Optional[int] = None - r"""Cap on completion tokens per request. Requests asking for more skip this endpoint, and the default output length stays within it. When omitted, the cap is copied from the public endpoint for the same model and provider, if there is one.""" - pricing: Optional[PrivateEndpointPricing] = None r"""Negotiated per-token rates reported for requests routed to this endpoint.""" @@ -108,7 +103,6 @@ def serialize_model(self, handler): "declared_parameters", "declared_region", "declared_zdr", - "max_completion_tokens", "pricing", "settings", ] diff --git a/src/openrouter/components/updateprivateendpointparametersrequest.py b/src/openrouter/components/updateprivateendpointparametersrequest.py deleted file mode 100644 index 82f068b8..00000000 --- a/src/openrouter/components/updateprivateendpointparametersrequest.py +++ /dev/null @@ -1,17 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" - -from __future__ import annotations -from .privateendpointdeclaredparameter import PrivateEndpointDeclaredParameter -from openrouter.types import BaseModel -from typing import List -from typing_extensions import TypedDict - - -class UpdatePrivateEndpointParametersRequestTypedDict(TypedDict): - declared_parameters: List[PrivateEndpointDeclaredParameter] - r"""Parameters the upstream supports beyond the tested ones. Replaces the earlier declaration; tested parameters stay. Order and repeated names are ignored, but the list holds at most as many entries as there are declarable parameters, repeats included. `tool_choice` requires `tools` to be tested or declared.""" - - -class UpdatePrivateEndpointParametersRequest(BaseModel): - declared_parameters: List[PrivateEndpointDeclaredParameter] - r"""Parameters the upstream supports beyond the tested ones. Replaces the earlier declaration; tested parameters stay. Order and repeated names are ignored, but the list holds at most as many entries as there are declarable parameters, repeats included. `tool_choice` requires `tools` to be tested or declared.""" diff --git a/src/openrouter/components/updateprivateendpointpricingrequest.py b/src/openrouter/components/updateprivateendpointpricingrequest.py deleted file mode 100644 index 3d096268..00000000 --- a/src/openrouter/components/updateprivateendpointpricingrequest.py +++ /dev/null @@ -1,19 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" - -from __future__ import annotations -from .privateendpointpricing import ( - PrivateEndpointPricing, - PrivateEndpointPricingTypedDict, -) -from openrouter.types import BaseModel -from typing_extensions import TypedDict - - -class UpdatePrivateEndpointPricingRequestTypedDict(TypedDict): - pricing: PrivateEndpointPricingTypedDict - r"""Negotiated per-token rates reported for requests routed to this endpoint.""" - - -class UpdatePrivateEndpointPricingRequest(BaseModel): - pricing: PrivateEndpointPricing - r"""Negotiated per-token rates reported for requests routed to this endpoint.""" diff --git a/src/openrouter/operations/__init__.py b/src/openrouter/operations/__init__.py index cd182637..7319f555 100644 --- a/src/openrouter/operations/__init__.py +++ b/src/openrouter/operations/__init__.py @@ -1086,18 +1086,6 @@ UpdatePrivateEndpointRequest, UpdatePrivateEndpointRequestTypedDict, ) - from .updateprivateendpointparameters import ( - UpdatePrivateEndpointParametersGlobals, - UpdatePrivateEndpointParametersGlobalsTypedDict, - UpdatePrivateEndpointParametersRequest, - UpdatePrivateEndpointParametersRequestTypedDict, - ) - from .updateprivateendpointpricing import ( - UpdatePrivateEndpointPricingGlobals, - UpdatePrivateEndpointPricingGlobalsTypedDict, - UpdatePrivateEndpointPricingRequest, - UpdatePrivateEndpointPricingRequestTypedDict, - ) from .updateprivateprovider import ( UpdatePrivateProviderGlobals, UpdatePrivateProviderGlobalsTypedDict, @@ -1944,14 +1932,6 @@ "UpdateOrganizationSettingsResponseTypedDict", "UpdatePrivateEndpointGlobals", "UpdatePrivateEndpointGlobalsTypedDict", - "UpdatePrivateEndpointParametersGlobals", - "UpdatePrivateEndpointParametersGlobalsTypedDict", - "UpdatePrivateEndpointParametersRequest", - "UpdatePrivateEndpointParametersRequestTypedDict", - "UpdatePrivateEndpointPricingGlobals", - "UpdatePrivateEndpointPricingGlobalsTypedDict", - "UpdatePrivateEndpointPricingRequest", - "UpdatePrivateEndpointPricingRequestTypedDict", "UpdatePrivateEndpointRequest", "UpdatePrivateEndpointRequestTypedDict", "UpdatePrivateProviderGlobals", @@ -2797,14 +2777,6 @@ "UpdatePrivateEndpointGlobalsTypedDict": ".updateprivateendpoint", "UpdatePrivateEndpointRequest": ".updateprivateendpoint", "UpdatePrivateEndpointRequestTypedDict": ".updateprivateendpoint", - "UpdatePrivateEndpointParametersGlobals": ".updateprivateendpointparameters", - "UpdatePrivateEndpointParametersGlobalsTypedDict": ".updateprivateendpointparameters", - "UpdatePrivateEndpointParametersRequest": ".updateprivateendpointparameters", - "UpdatePrivateEndpointParametersRequestTypedDict": ".updateprivateendpointparameters", - "UpdatePrivateEndpointPricingGlobals": ".updateprivateendpointpricing", - "UpdatePrivateEndpointPricingGlobalsTypedDict": ".updateprivateendpointpricing", - "UpdatePrivateEndpointPricingRequest": ".updateprivateendpointpricing", - "UpdatePrivateEndpointPricingRequestTypedDict": ".updateprivateendpointpricing", "UpdatePrivateProviderGlobals": ".updateprivateprovider", "UpdatePrivateProviderGlobalsTypedDict": ".updateprivateprovider", "UpdatePrivateProviderRequest": ".updateprivateprovider", diff --git a/src/openrouter/operations/createprivateendpoint.py b/src/openrouter/operations/createprivateendpoint.py index cd6cc2ee..d06bbd71 100644 --- a/src/openrouter/operations/createprivateendpoint.py +++ b/src/openrouter/operations/createprivateendpoint.py @@ -94,7 +94,7 @@ class CreatePrivateEndpointRequestTypedDict(TypedDict): """ idempotency_key: NotRequired[str] - r"""Retry-safe create: a repeated create with the same key from the same organization returns the endpoint the first request created instead of creating another. The endpoint is returned as it is now. Reusing a key with a different request body (model, provider, base URL, upstream model ID, declared ZDR or region, pricing, or declared parameters) is rejected with 422 `idempotency_key_reused`. Declared parameters are compared as a set, so a retry that reorders or repeats a name replays the endpoint. `activate` and `max_completion_tokens` are not compared, and later edits to the endpoint do not affect the comparison.""" + r"""Retry-safe create: a repeated create with the same key from the same organization returns the endpoint the first request created instead of creating another. The endpoint is returned as it is now. Reusing a key with a different request body (model, provider, base URL, upstream model ID, declared ZDR or region, pricing, or declared parameters) is rejected with 422 `idempotency_key_reused`. Declared parameters are compared as a set, so a retry that reorders or repeats a name replays the endpoint. `activate` and `settings` are not compared, and later edits to the endpoint do not affect the comparison. `settings` is still validated before the replay, so a retry with invalid settings returns 400 `settings_invalid` instead of the endpoint.""" class CreatePrivateEndpointRequest(BaseModel): @@ -136,7 +136,7 @@ class CreatePrivateEndpointRequest(BaseModel): pydantic.Field(alias="idempotency-key"), FieldMetadata(header=HeaderMetadata(style="simple", explode=False)), ] = None - r"""Retry-safe create: a repeated create with the same key from the same organization returns the endpoint the first request created instead of creating another. The endpoint is returned as it is now. Reusing a key with a different request body (model, provider, base URL, upstream model ID, declared ZDR or region, pricing, or declared parameters) is rejected with 422 `idempotency_key_reused`. Declared parameters are compared as a set, so a retry that reorders or repeats a name replays the endpoint. `activate` and `max_completion_tokens` are not compared, and later edits to the endpoint do not affect the comparison.""" + r"""Retry-safe create: a repeated create with the same key from the same organization returns the endpoint the first request created instead of creating another. The endpoint is returned as it is now. Reusing a key with a different request body (model, provider, base URL, upstream model ID, declared ZDR or region, pricing, or declared parameters) is rejected with 422 `idempotency_key_reused`. Declared parameters are compared as a set, so a retry that reorders or repeats a name replays the endpoint. `activate` and `settings` are not compared, and later edits to the endpoint do not affect the comparison. `settings` is still validated before the replay, so a retry with invalid settings returns 400 `settings_invalid` instead of the endpoint.""" @model_serializer(mode="wrap") def serialize_model(self, handler): diff --git a/src/openrouter/operations/updateprivateendpointparameters.py b/src/openrouter/operations/updateprivateendpointparameters.py deleted file mode 100644 index c2fbf756..00000000 --- a/src/openrouter/operations/updateprivateendpointparameters.py +++ /dev/null @@ -1,158 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" - -from __future__ import annotations -from openrouter.components import ( - updateprivateendpointparametersrequest as components_updateprivateendpointparametersrequest, -) -from openrouter.types import BaseModel, UNSET_SENTINEL -from openrouter.utils import ( - FieldMetadata, - HeaderMetadata, - PathParamMetadata, - RequestMetadata, -) -import pydantic -from pydantic import model_serializer -from typing import Optional -from typing_extensions import Annotated, NotRequired, TypedDict - - -class UpdatePrivateEndpointParametersGlobalsTypedDict(TypedDict): - http_referer: NotRequired[str] - r"""The app identifier should be your app's URL and is used as the primary identifier for rankings. - This is used to track API usage per application. - - """ - x_open_router_title: NotRequired[str] - r"""The app display name allows you to customize how your app appears in OpenRouter's dashboard. - - """ - x_open_router_categories: NotRequired[str] - r"""Comma-separated list of app categories (e.g. \"cli-agent,cloud-agent\"). Used for marketplace rankings. - - """ - - -class UpdatePrivateEndpointParametersGlobals(BaseModel): - http_referer: Annotated[ - Optional[str], - pydantic.Field(alias="HTTP-Referer"), - FieldMetadata(header=HeaderMetadata(style="simple", explode=False)), - ] = None - r"""The app identifier should be your app's URL and is used as the primary identifier for rankings. - This is used to track API usage per application. - - """ - - x_open_router_title: Annotated[ - Optional[str], - pydantic.Field(alias="X-OpenRouter-Title"), - FieldMetadata(header=HeaderMetadata(style="simple", explode=False)), - ] = None - r"""The app display name allows you to customize how your app appears in OpenRouter's dashboard. - - """ - - x_open_router_categories: Annotated[ - Optional[str], - pydantic.Field(alias="X-OpenRouter-Categories"), - FieldMetadata(header=HeaderMetadata(style="simple", explode=False)), - ] = None - r"""Comma-separated list of app categories (e.g. \"cli-agent,cloud-agent\"). Used for marketplace rankings. - - """ - - @model_serializer(mode="wrap") - def serialize_model(self, handler): - optional_fields = set( - ["HTTP-Referer", "X-OpenRouter-Title", "X-OpenRouter-Categories"] - ) - serialized = handler(self) - m = {} - - for n, f in type(self).model_fields.items(): - k = f.alias or n - val = serialized.get(k, serialized.get(n)) - - if val != UNSET_SENTINEL: - if val is not None or k not in optional_fields: - m[k] = val - - return m - - -class UpdatePrivateEndpointParametersRequestTypedDict(TypedDict): - id: str - r"""Stable identifier of the private endpoint.""" - update_private_endpoint_parameters_request: components_updateprivateendpointparametersrequest.UpdatePrivateEndpointParametersRequestTypedDict - http_referer: NotRequired[str] - r"""The app identifier should be your app's URL and is used as the primary identifier for rankings. - This is used to track API usage per application. - - """ - x_open_router_title: NotRequired[str] - r"""The app display name allows you to customize how your app appears in OpenRouter's dashboard. - - """ - x_open_router_categories: NotRequired[str] - r"""Comma-separated list of app categories (e.g. \"cli-agent,cloud-agent\"). Used for marketplace rankings. - - """ - - -class UpdatePrivateEndpointParametersRequest(BaseModel): - id: Annotated[ - str, FieldMetadata(path=PathParamMetadata(style="simple", explode=False)) - ] - r"""Stable identifier of the private endpoint.""" - - update_private_endpoint_parameters_request: Annotated[ - components_updateprivateendpointparametersrequest.UpdatePrivateEndpointParametersRequest, - FieldMetadata(request=RequestMetadata(media_type="application/json")), - ] - - http_referer: Annotated[ - Optional[str], - pydantic.Field(alias="HTTP-Referer"), - FieldMetadata(header=HeaderMetadata(style="simple", explode=False)), - ] = None - r"""The app identifier should be your app's URL and is used as the primary identifier for rankings. - This is used to track API usage per application. - - """ - - x_open_router_title: Annotated[ - Optional[str], - pydantic.Field(alias="X-OpenRouter-Title"), - FieldMetadata(header=HeaderMetadata(style="simple", explode=False)), - ] = None - r"""The app display name allows you to customize how your app appears in OpenRouter's dashboard. - - """ - - x_open_router_categories: Annotated[ - Optional[str], - pydantic.Field(alias="X-OpenRouter-Categories"), - FieldMetadata(header=HeaderMetadata(style="simple", explode=False)), - ] = None - r"""Comma-separated list of app categories (e.g. \"cli-agent,cloud-agent\"). Used for marketplace rankings. - - """ - - @model_serializer(mode="wrap") - def serialize_model(self, handler): - optional_fields = set( - ["HTTP-Referer", "X-OpenRouter-Title", "X-OpenRouter-Categories"] - ) - serialized = handler(self) - m = {} - - for n, f in type(self).model_fields.items(): - k = f.alias or n - val = serialized.get(k, serialized.get(n)) - - if val != UNSET_SENTINEL: - if val is not None or k not in optional_fields: - m[k] = val - - return m diff --git a/src/openrouter/operations/updateprivateendpointpricing.py b/src/openrouter/operations/updateprivateendpointpricing.py deleted file mode 100644 index 144cf097..00000000 --- a/src/openrouter/operations/updateprivateendpointpricing.py +++ /dev/null @@ -1,158 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" - -from __future__ import annotations -from openrouter.components import ( - updateprivateendpointpricingrequest as components_updateprivateendpointpricingrequest, -) -from openrouter.types import BaseModel, UNSET_SENTINEL -from openrouter.utils import ( - FieldMetadata, - HeaderMetadata, - PathParamMetadata, - RequestMetadata, -) -import pydantic -from pydantic import model_serializer -from typing import Optional -from typing_extensions import Annotated, NotRequired, TypedDict - - -class UpdatePrivateEndpointPricingGlobalsTypedDict(TypedDict): - http_referer: NotRequired[str] - r"""The app identifier should be your app's URL and is used as the primary identifier for rankings. - This is used to track API usage per application. - - """ - x_open_router_title: NotRequired[str] - r"""The app display name allows you to customize how your app appears in OpenRouter's dashboard. - - """ - x_open_router_categories: NotRequired[str] - r"""Comma-separated list of app categories (e.g. \"cli-agent,cloud-agent\"). Used for marketplace rankings. - - """ - - -class UpdatePrivateEndpointPricingGlobals(BaseModel): - http_referer: Annotated[ - Optional[str], - pydantic.Field(alias="HTTP-Referer"), - FieldMetadata(header=HeaderMetadata(style="simple", explode=False)), - ] = None - r"""The app identifier should be your app's URL and is used as the primary identifier for rankings. - This is used to track API usage per application. - - """ - - x_open_router_title: Annotated[ - Optional[str], - pydantic.Field(alias="X-OpenRouter-Title"), - FieldMetadata(header=HeaderMetadata(style="simple", explode=False)), - ] = None - r"""The app display name allows you to customize how your app appears in OpenRouter's dashboard. - - """ - - x_open_router_categories: Annotated[ - Optional[str], - pydantic.Field(alias="X-OpenRouter-Categories"), - FieldMetadata(header=HeaderMetadata(style="simple", explode=False)), - ] = None - r"""Comma-separated list of app categories (e.g. \"cli-agent,cloud-agent\"). Used for marketplace rankings. - - """ - - @model_serializer(mode="wrap") - def serialize_model(self, handler): - optional_fields = set( - ["HTTP-Referer", "X-OpenRouter-Title", "X-OpenRouter-Categories"] - ) - serialized = handler(self) - m = {} - - for n, f in type(self).model_fields.items(): - k = f.alias or n - val = serialized.get(k, serialized.get(n)) - - if val != UNSET_SENTINEL: - if val is not None or k not in optional_fields: - m[k] = val - - return m - - -class UpdatePrivateEndpointPricingRequestTypedDict(TypedDict): - id: str - r"""Stable identifier of the private endpoint.""" - update_private_endpoint_pricing_request: components_updateprivateendpointpricingrequest.UpdatePrivateEndpointPricingRequestTypedDict - http_referer: NotRequired[str] - r"""The app identifier should be your app's URL and is used as the primary identifier for rankings. - This is used to track API usage per application. - - """ - x_open_router_title: NotRequired[str] - r"""The app display name allows you to customize how your app appears in OpenRouter's dashboard. - - """ - x_open_router_categories: NotRequired[str] - r"""Comma-separated list of app categories (e.g. \"cli-agent,cloud-agent\"). Used for marketplace rankings. - - """ - - -class UpdatePrivateEndpointPricingRequest(BaseModel): - id: Annotated[ - str, FieldMetadata(path=PathParamMetadata(style="simple", explode=False)) - ] - r"""Stable identifier of the private endpoint.""" - - update_private_endpoint_pricing_request: Annotated[ - components_updateprivateendpointpricingrequest.UpdatePrivateEndpointPricingRequest, - FieldMetadata(request=RequestMetadata(media_type="application/json")), - ] - - http_referer: Annotated[ - Optional[str], - pydantic.Field(alias="HTTP-Referer"), - FieldMetadata(header=HeaderMetadata(style="simple", explode=False)), - ] = None - r"""The app identifier should be your app's URL and is used as the primary identifier for rankings. - This is used to track API usage per application. - - """ - - x_open_router_title: Annotated[ - Optional[str], - pydantic.Field(alias="X-OpenRouter-Title"), - FieldMetadata(header=HeaderMetadata(style="simple", explode=False)), - ] = None - r"""The app display name allows you to customize how your app appears in OpenRouter's dashboard. - - """ - - x_open_router_categories: Annotated[ - Optional[str], - pydantic.Field(alias="X-OpenRouter-Categories"), - FieldMetadata(header=HeaderMetadata(style="simple", explode=False)), - ] = None - r"""Comma-separated list of app categories (e.g. \"cli-agent,cloud-agent\"). Used for marketplace rankings. - - """ - - @model_serializer(mode="wrap") - def serialize_model(self, handler): - optional_fields = set( - ["HTTP-Referer", "X-OpenRouter-Title", "X-OpenRouter-Categories"] - ) - serialized = handler(self) - m = {} - - for n, f in type(self).model_fields.items(): - k = f.alias or n - val = serialized.get(k, serialized.get(n)) - - if val != UNSET_SENTINEL: - if val is not None or k not in optional_fields: - m[k] = val - - return m diff --git a/src/openrouter/private_endpoints.py b/src/openrouter/private_endpoints.py index 4407f1f3..a33f9f4f 100644 --- a/src/openrouter/private_endpoints.py +++ b/src/openrouter/private_endpoints.py @@ -7,7 +7,6 @@ from openrouter.utils import get_security_from_env from openrouter.utils.unmarshal_json_response import unmarshal_json_response from typing import Any, Iterable, List, Mapping, Optional, Union -from typing_extensions import deprecated class PrivateEndpoints(BaseSDK): @@ -301,7 +300,6 @@ def create( components.CreatePrivateEndpointRequestDeclaredRegion ] = UNSET, declared_zdr: OptionalNullable[bool] = UNSET, - max_completion_tokens: Optional[int] = None, pricing: Optional[ Union[ components.PrivateEndpointPricing, @@ -333,13 +331,12 @@ def create( :param x_open_router_categories: Comma-separated list of app categories (e.g. \"cli-agent,cloud-agent\"). Used for marketplace rankings. - :param idempotency_key: Retry-safe create: a repeated create with the same key from the same organization returns the endpoint the first request created instead of creating another. The endpoint is returned as it is now. Reusing a key with a different request body (model, provider, base URL, upstream model ID, declared ZDR or region, pricing, or declared parameters) is rejected with 422 `idempotency_key_reused`. Declared parameters are compared as a set, so a retry that reorders or repeats a name replays the endpoint. `activate` and `max_completion_tokens` are not compared, and later edits to the endpoint do not affect the comparison. + :param idempotency_key: Retry-safe create: a repeated create with the same key from the same organization returns the endpoint the first request created instead of creating another. The endpoint is returned as it is now. Reusing a key with a different request body (model, provider, base URL, upstream model ID, declared ZDR or region, pricing, or declared parameters) is rejected with 422 `idempotency_key_reused`. Declared parameters are compared as a set, so a retry that reorders or repeats a name replays the endpoint. `activate` and `settings` are not compared, and later edits to the endpoint do not affect the comparison. `settings` is still validated before the replay, so a retry with invalid settings returns 400 `settings_invalid` instead of the endpoint. :param activate: Validate and activate in the same call. On a failed validation the draft is kept and returned with a 422, so fix it and call `/validate` and `/activate` instead of creating it again. :param base_url: HTTPS base URL of your deployment. Required unless the provider derives its URL from the BYOK credential (Azure, Amazon Bedrock, Google Vertex). :param declared_parameters: Parameters the upstream supports beyond the tested ones. Replaces the earlier declaration; tested parameters stay. Order and repeated names are ignored, but the list holds at most as many entries as there are declarable parameters, repeats included. `tool_choice` requires `tools` to be tested or declared. :param declared_region: Attest where this deployment processes data. :param declared_zdr: Attest that this deployment retains no prompt or completion data. - :param max_completion_tokens: Cap on completion tokens per request. Requests asking for more skip this endpoint, and the default output length stays within it. When omitted, the cap is copied from the public endpoint for the same model and provider, if there is one. :param pricing: Negotiated per-token rates reported for requests routed to this endpoint. :param settings: Capabilities and limits to set over the ones copied from the public endpoint for this model and provider (or from the model). Omitted fields keep the copied values. :param retries: Override the default retry configuration for this method @@ -373,7 +370,6 @@ def create( ), declared_region=declared_region, declared_zdr=declared_zdr, - max_completion_tokens=max_completion_tokens, model_permaslug=model_permaslug, pricing=utils.get_pydantic_model( pricing, Optional[components.PrivateEndpointPricing] @@ -525,7 +521,6 @@ async def create_async( components.CreatePrivateEndpointRequestDeclaredRegion ] = UNSET, declared_zdr: OptionalNullable[bool] = UNSET, - max_completion_tokens: Optional[int] = None, pricing: Optional[ Union[ components.PrivateEndpointPricing, @@ -557,13 +552,12 @@ async def create_async( :param x_open_router_categories: Comma-separated list of app categories (e.g. \"cli-agent,cloud-agent\"). Used for marketplace rankings. - :param idempotency_key: Retry-safe create: a repeated create with the same key from the same organization returns the endpoint the first request created instead of creating another. The endpoint is returned as it is now. Reusing a key with a different request body (model, provider, base URL, upstream model ID, declared ZDR or region, pricing, or declared parameters) is rejected with 422 `idempotency_key_reused`. Declared parameters are compared as a set, so a retry that reorders or repeats a name replays the endpoint. `activate` and `max_completion_tokens` are not compared, and later edits to the endpoint do not affect the comparison. + :param idempotency_key: Retry-safe create: a repeated create with the same key from the same organization returns the endpoint the first request created instead of creating another. The endpoint is returned as it is now. Reusing a key with a different request body (model, provider, base URL, upstream model ID, declared ZDR or region, pricing, or declared parameters) is rejected with 422 `idempotency_key_reused`. Declared parameters are compared as a set, so a retry that reorders or repeats a name replays the endpoint. `activate` and `settings` are not compared, and later edits to the endpoint do not affect the comparison. `settings` is still validated before the replay, so a retry with invalid settings returns 400 `settings_invalid` instead of the endpoint. :param activate: Validate and activate in the same call. On a failed validation the draft is kept and returned with a 422, so fix it and call `/validate` and `/activate` instead of creating it again. :param base_url: HTTPS base URL of your deployment. Required unless the provider derives its URL from the BYOK credential (Azure, Amazon Bedrock, Google Vertex). :param declared_parameters: Parameters the upstream supports beyond the tested ones. Replaces the earlier declaration; tested parameters stay. Order and repeated names are ignored, but the list holds at most as many entries as there are declarable parameters, repeats included. `tool_choice` requires `tools` to be tested or declared. :param declared_region: Attest where this deployment processes data. :param declared_zdr: Attest that this deployment retains no prompt or completion data. - :param max_completion_tokens: Cap on completion tokens per request. Requests asking for more skip this endpoint, and the default output length stays within it. When omitted, the cap is copied from the public endpoint for the same model and provider, if there is one. :param pricing: Negotiated per-token rates reported for requests routed to this endpoint. :param settings: Capabilities and limits to set over the ones copied from the public endpoint for this model and provider (or from the model). Omitted fields keep the copied values. :param retries: Override the default retry configuration for this method @@ -597,7 +591,6 @@ async def create_async( ), declared_region=declared_region, declared_zdr=declared_zdr, - max_completion_tokens=max_completion_tokens, model_permaslug=model_permaslug, pricing=utils.get_pydantic_model( pricing, Optional[components.PrivateEndpointPricing] @@ -2705,714 +2698,6 @@ async def enable_async( raise errors.OpenRouterDefaultError("Unexpected response received", http_res) - @deprecated( - "warning: ** DEPRECATED ** - This will be removed in a future release, please migrate away from it as soon as possible." - ) - def update_parameters( - self, - *, - id: str, - declared_parameters: Iterable[components.PrivateEndpointDeclaredParameter], - http_referer: Optional[str] = None, - x_open_router_title: Optional[str] = None, - x_open_router_categories: Optional[str] = None, - retries: OptionalNullable[utils.RetryConfig] = UNSET, - server_url: Optional[str] = None, - timeout_ms: Optional[int] = None, - http_headers: Optional[Mapping[str, str]] = None, - ) -> components.PrivateEndpointResponse: - r"""Set private endpoint supported parameters (deprecated) - - Deprecated: send `declared_parameters` to `PATCH /private-endpoints/{id}` instead; this route behaves exactly like that call and will be removed. The body replaces the earlier declaration and is read as a set; `tested_parameters` stay. Returns 400 `parameters_invalid` when `tool_choice` is declared without `tools` being tested or declared. [Management key](/docs/guides/overview/auth/management-api-keys) required. - - :param id: Stable identifier of the private endpoint. - :param declared_parameters: Parameters the upstream supports beyond the tested ones. Replaces the earlier declaration; tested parameters stay. Order and repeated names are ignored, but the list holds at most as many entries as there are declarable parameters, repeats included. `tool_choice` requires `tools` to be tested or declared. - :param http_referer: The app identifier should be your app's URL and is used as the primary identifier for rankings. - This is used to track API usage per application. - - :param x_open_router_title: The app display name allows you to customize how your app appears in OpenRouter's dashboard. - - :param x_open_router_categories: Comma-separated list of app categories (e.g. \"cli-agent,cloud-agent\"). Used for marketplace rankings. - - :param retries: Override the default retry configuration for this method - :param server_url: Override the default server URL for this method - :param timeout_ms: Override the default request timeout configuration for this method in milliseconds - :param http_headers: Additional headers to set or replace on requests. - """ - base_url = None - url_variables = None - if timeout_ms is None: - timeout_ms = self.sdk_configuration.timeout_ms - - if server_url is not None: - base_url = server_url - else: - base_url = self._get_url(base_url, url_variables) - - request = operations.UpdatePrivateEndpointParametersRequest( - http_referer=http_referer, - x_open_router_title=x_open_router_title, - x_open_router_categories=x_open_router_categories, - id=id, - update_private_endpoint_parameters_request=components.UpdatePrivateEndpointParametersRequest( - declared_parameters=utils.unmarshal( - declared_parameters, - List[components.PrivateEndpointDeclaredParameter], - ), - ), - ) - - req = self._build_request( - method="PUT", - path="/private-endpoints/{id}/parameters", - base_url=base_url, - url_variables=url_variables, - request=request, - request_body_required=True, - request_has_path_params=True, - request_has_query_params=True, - user_agent_header="user-agent", - accept_header_value="application/json", - http_headers=http_headers, - _globals=operations.UpdatePrivateEndpointParametersGlobals( - http_referer=self.sdk_configuration.globals.http_referer, - x_open_router_title=self.sdk_configuration.globals.x_open_router_title, - x_open_router_categories=self.sdk_configuration.globals.x_open_router_categories, - ), - security=self.sdk_configuration.security, - get_serialized_body=lambda: utils.serialize_request_body( - request.update_private_endpoint_parameters_request, - False, - False, - "json", - components.UpdatePrivateEndpointParametersRequest, - ), - allow_empty_value=None, - timeout_ms=timeout_ms, - ) - - if retries == UNSET: - if self.sdk_configuration.retry_config is not UNSET: - retries = self.sdk_configuration.retry_config - else: - retries = utils.RetryConfig( - "backoff", utils.BackoffStrategy(500, 60000, 1.5, 3600000), True - ) - - retry_config = None - if isinstance(retries, utils.RetryConfig): - retry_config = (retries, ["5XX"]) - - http_res = self.do_request( - hook_ctx=HookContext( - config=self.sdk_configuration, - base_url=base_url or "", - operation_id="updatePrivateEndpointParameters", - oauth2_scopes=None, - security_source=get_security_from_env( - self.sdk_configuration.security, components.Security - ), - tags=["Private Endpoints"], - extensions=None, - ), - request=req, - is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c), - retry_config=retry_config, - ) - - response_data: Any = None - if utils.match_response(http_res, "200", "application/json"): - return unmarshal_json_response(components.PrivateEndpointResponse, http_res) - if utils.match_response(http_res, "400", "application/json"): - response_data = unmarshal_json_response( - errors.BadRequestResponseErrorData, http_res - ) - raise errors.BadRequestResponseError(response_data, http_res) - if utils.match_response(http_res, "401", "application/json"): - response_data = unmarshal_json_response( - errors.UnauthorizedResponseErrorData, http_res - ) - raise errors.UnauthorizedResponseError(response_data, http_res) - if utils.match_response(http_res, "403", "application/json"): - response_data = unmarshal_json_response( - errors.ForbiddenResponseErrorData, http_res - ) - raise errors.ForbiddenResponseError(response_data, http_res) - if utils.match_response(http_res, "404", "application/json"): - response_data = unmarshal_json_response( - errors.NotFoundResponseErrorData, http_res - ) - raise errors.NotFoundResponseError(response_data, http_res) - if utils.match_response(http_res, "408", "application/json"): - response_data = unmarshal_json_response( - errors.RequestTimeoutResponseErrorData, http_res - ) - raise errors.RequestTimeoutResponseError(response_data, http_res) - if utils.match_response(http_res, "409", "application/json"): - response_data = unmarshal_json_response( - errors.ConflictResponseErrorData, http_res - ) - raise errors.ConflictResponseError(response_data, http_res) - if utils.match_response(http_res, "422", "application/json"): - response_data = unmarshal_json_response( - errors.UnprocessableEntityResponseErrorData, http_res - ) - raise errors.UnprocessableEntityResponseError(response_data, http_res) - if utils.match_response(http_res, "500", "application/json"): - response_data = unmarshal_json_response( - errors.InternalServerResponseErrorData, http_res - ) - raise errors.InternalServerResponseError(response_data, http_res) - if utils.match_response(http_res, "502", "application/json"): - response_data = unmarshal_json_response( - errors.BadGatewayResponseErrorData, http_res - ) - raise errors.BadGatewayResponseError(response_data, http_res) - if utils.match_response(http_res, "4XX", "*"): - http_res_text = utils.stream_to_text(http_res) - raise errors.OpenRouterDefaultError( - "API error occurred", http_res, http_res_text - ) - if utils.match_response(http_res, "5XX", "*"): - http_res_text = utils.stream_to_text(http_res) - raise errors.OpenRouterDefaultError( - "API error occurred", http_res, http_res_text - ) - - raise errors.OpenRouterDefaultError("Unexpected response received", http_res) - - @deprecated( - "warning: ** DEPRECATED ** - This will be removed in a future release, please migrate away from it as soon as possible." - ) - async def update_parameters_async( - self, - *, - id: str, - declared_parameters: Iterable[components.PrivateEndpointDeclaredParameter], - http_referer: Optional[str] = None, - x_open_router_title: Optional[str] = None, - x_open_router_categories: Optional[str] = None, - retries: OptionalNullable[utils.RetryConfig] = UNSET, - server_url: Optional[str] = None, - timeout_ms: Optional[int] = None, - http_headers: Optional[Mapping[str, str]] = None, - ) -> components.PrivateEndpointResponse: - r"""Set private endpoint supported parameters (deprecated) - - Deprecated: send `declared_parameters` to `PATCH /private-endpoints/{id}` instead; this route behaves exactly like that call and will be removed. The body replaces the earlier declaration and is read as a set; `tested_parameters` stay. Returns 400 `parameters_invalid` when `tool_choice` is declared without `tools` being tested or declared. [Management key](/docs/guides/overview/auth/management-api-keys) required. - - :param id: Stable identifier of the private endpoint. - :param declared_parameters: Parameters the upstream supports beyond the tested ones. Replaces the earlier declaration; tested parameters stay. Order and repeated names are ignored, but the list holds at most as many entries as there are declarable parameters, repeats included. `tool_choice` requires `tools` to be tested or declared. - :param http_referer: The app identifier should be your app's URL and is used as the primary identifier for rankings. - This is used to track API usage per application. - - :param x_open_router_title: The app display name allows you to customize how your app appears in OpenRouter's dashboard. - - :param x_open_router_categories: Comma-separated list of app categories (e.g. \"cli-agent,cloud-agent\"). Used for marketplace rankings. - - :param retries: Override the default retry configuration for this method - :param server_url: Override the default server URL for this method - :param timeout_ms: Override the default request timeout configuration for this method in milliseconds - :param http_headers: Additional headers to set or replace on requests. - """ - base_url = None - url_variables = None - if timeout_ms is None: - timeout_ms = self.sdk_configuration.timeout_ms - - if server_url is not None: - base_url = server_url - else: - base_url = self._get_url(base_url, url_variables) - - request = operations.UpdatePrivateEndpointParametersRequest( - http_referer=http_referer, - x_open_router_title=x_open_router_title, - x_open_router_categories=x_open_router_categories, - id=id, - update_private_endpoint_parameters_request=components.UpdatePrivateEndpointParametersRequest( - declared_parameters=utils.unmarshal( - declared_parameters, - List[components.PrivateEndpointDeclaredParameter], - ), - ), - ) - - req = self._build_request_async( - method="PUT", - path="/private-endpoints/{id}/parameters", - base_url=base_url, - url_variables=url_variables, - request=request, - request_body_required=True, - request_has_path_params=True, - request_has_query_params=True, - user_agent_header="user-agent", - accept_header_value="application/json", - http_headers=http_headers, - _globals=operations.UpdatePrivateEndpointParametersGlobals( - http_referer=self.sdk_configuration.globals.http_referer, - x_open_router_title=self.sdk_configuration.globals.x_open_router_title, - x_open_router_categories=self.sdk_configuration.globals.x_open_router_categories, - ), - security=self.sdk_configuration.security, - get_serialized_body=lambda: utils.serialize_request_body( - request.update_private_endpoint_parameters_request, - False, - False, - "json", - components.UpdatePrivateEndpointParametersRequest, - ), - allow_empty_value=None, - timeout_ms=timeout_ms, - ) - - if retries == UNSET: - if self.sdk_configuration.retry_config is not UNSET: - retries = self.sdk_configuration.retry_config - else: - retries = utils.RetryConfig( - "backoff", utils.BackoffStrategy(500, 60000, 1.5, 3600000), True - ) - - retry_config = None - if isinstance(retries, utils.RetryConfig): - retry_config = (retries, ["5XX"]) - - http_res = await self.do_request_async( - hook_ctx=HookContext( - config=self.sdk_configuration, - base_url=base_url or "", - operation_id="updatePrivateEndpointParameters", - oauth2_scopes=None, - security_source=get_security_from_env( - self.sdk_configuration.security, components.Security - ), - tags=["Private Endpoints"], - extensions=None, - ), - request=req, - is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c), - retry_config=retry_config, - ) - - response_data: Any = None - if utils.match_response(http_res, "200", "application/json"): - return unmarshal_json_response(components.PrivateEndpointResponse, http_res) - if utils.match_response(http_res, "400", "application/json"): - response_data = unmarshal_json_response( - errors.BadRequestResponseErrorData, http_res - ) - raise errors.BadRequestResponseError(response_data, http_res) - if utils.match_response(http_res, "401", "application/json"): - response_data = unmarshal_json_response( - errors.UnauthorizedResponseErrorData, http_res - ) - raise errors.UnauthorizedResponseError(response_data, http_res) - if utils.match_response(http_res, "403", "application/json"): - response_data = unmarshal_json_response( - errors.ForbiddenResponseErrorData, http_res - ) - raise errors.ForbiddenResponseError(response_data, http_res) - if utils.match_response(http_res, "404", "application/json"): - response_data = unmarshal_json_response( - errors.NotFoundResponseErrorData, http_res - ) - raise errors.NotFoundResponseError(response_data, http_res) - if utils.match_response(http_res, "408", "application/json"): - response_data = unmarshal_json_response( - errors.RequestTimeoutResponseErrorData, http_res - ) - raise errors.RequestTimeoutResponseError(response_data, http_res) - if utils.match_response(http_res, "409", "application/json"): - response_data = unmarshal_json_response( - errors.ConflictResponseErrorData, http_res - ) - raise errors.ConflictResponseError(response_data, http_res) - if utils.match_response(http_res, "422", "application/json"): - response_data = unmarshal_json_response( - errors.UnprocessableEntityResponseErrorData, http_res - ) - raise errors.UnprocessableEntityResponseError(response_data, http_res) - if utils.match_response(http_res, "500", "application/json"): - response_data = unmarshal_json_response( - errors.InternalServerResponseErrorData, http_res - ) - raise errors.InternalServerResponseError(response_data, http_res) - if utils.match_response(http_res, "502", "application/json"): - response_data = unmarshal_json_response( - errors.BadGatewayResponseErrorData, http_res - ) - raise errors.BadGatewayResponseError(response_data, http_res) - if utils.match_response(http_res, "4XX", "*"): - http_res_text = await utils.stream_to_text_async(http_res) - raise errors.OpenRouterDefaultError( - "API error occurred", http_res, http_res_text - ) - if utils.match_response(http_res, "5XX", "*"): - http_res_text = await utils.stream_to_text_async(http_res) - raise errors.OpenRouterDefaultError( - "API error occurred", http_res, http_res_text - ) - - raise errors.OpenRouterDefaultError("Unexpected response received", http_res) - - @deprecated( - "warning: ** DEPRECATED ** - This will be removed in a future release, please migrate away from it as soon as possible." - ) - def update_pricing( - self, - *, - id: str, - pricing: Union[ - components.PrivateEndpointPricing, - components.PrivateEndpointPricingTypedDict, - ], - http_referer: Optional[str] = None, - x_open_router_title: Optional[str] = None, - x_open_router_categories: Optional[str] = None, - retries: OptionalNullable[utils.RetryConfig] = UNSET, - server_url: Optional[str] = None, - timeout_ms: Optional[int] = None, - http_headers: Optional[Mapping[str, str]] = None, - ) -> components.PrivateEndpointResponse: - r"""Set private endpoint pricing (deprecated) - - Deprecated: send `pricing` to `PATCH /private-endpoints/{id}` instead; this route behaves exactly like that call and will be removed. The body replaces the whole pricing object: omitting `cache_read` or `cache_write` reverts that rate to the provider pricing strategy default. [Management key](/docs/guides/overview/auth/management-api-keys) required. - - :param id: Stable identifier of the private endpoint. - :param pricing: Negotiated per-token rates reported for requests routed to this endpoint. - :param http_referer: The app identifier should be your app's URL and is used as the primary identifier for rankings. - This is used to track API usage per application. - - :param x_open_router_title: The app display name allows you to customize how your app appears in OpenRouter's dashboard. - - :param x_open_router_categories: Comma-separated list of app categories (e.g. \"cli-agent,cloud-agent\"). Used for marketplace rankings. - - :param retries: Override the default retry configuration for this method - :param server_url: Override the default server URL for this method - :param timeout_ms: Override the default request timeout configuration for this method in milliseconds - :param http_headers: Additional headers to set or replace on requests. - """ - base_url = None - url_variables = None - if timeout_ms is None: - timeout_ms = self.sdk_configuration.timeout_ms - - if server_url is not None: - base_url = server_url - else: - base_url = self._get_url(base_url, url_variables) - - request = operations.UpdatePrivateEndpointPricingRequest( - http_referer=http_referer, - x_open_router_title=x_open_router_title, - x_open_router_categories=x_open_router_categories, - id=id, - update_private_endpoint_pricing_request=components.UpdatePrivateEndpointPricingRequest( - pricing=utils.get_pydantic_model( - pricing, components.PrivateEndpointPricing - ), - ), - ) - - req = self._build_request( - method="PUT", - path="/private-endpoints/{id}/pricing", - base_url=base_url, - url_variables=url_variables, - request=request, - request_body_required=True, - request_has_path_params=True, - request_has_query_params=True, - user_agent_header="user-agent", - accept_header_value="application/json", - http_headers=http_headers, - _globals=operations.UpdatePrivateEndpointPricingGlobals( - http_referer=self.sdk_configuration.globals.http_referer, - x_open_router_title=self.sdk_configuration.globals.x_open_router_title, - x_open_router_categories=self.sdk_configuration.globals.x_open_router_categories, - ), - security=self.sdk_configuration.security, - get_serialized_body=lambda: utils.serialize_request_body( - request.update_private_endpoint_pricing_request, - False, - False, - "json", - components.UpdatePrivateEndpointPricingRequest, - ), - allow_empty_value=None, - timeout_ms=timeout_ms, - ) - - if retries == UNSET: - if self.sdk_configuration.retry_config is not UNSET: - retries = self.sdk_configuration.retry_config - else: - retries = utils.RetryConfig( - "backoff", utils.BackoffStrategy(500, 60000, 1.5, 3600000), True - ) - - retry_config = None - if isinstance(retries, utils.RetryConfig): - retry_config = (retries, ["5XX"]) - - http_res = self.do_request( - hook_ctx=HookContext( - config=self.sdk_configuration, - base_url=base_url or "", - operation_id="updatePrivateEndpointPricing", - oauth2_scopes=None, - security_source=get_security_from_env( - self.sdk_configuration.security, components.Security - ), - tags=["Private Endpoints"], - extensions=None, - ), - request=req, - is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c), - retry_config=retry_config, - ) - - response_data: Any = None - if utils.match_response(http_res, "200", "application/json"): - return unmarshal_json_response(components.PrivateEndpointResponse, http_res) - if utils.match_response(http_res, "400", "application/json"): - response_data = unmarshal_json_response( - errors.BadRequestResponseErrorData, http_res - ) - raise errors.BadRequestResponseError(response_data, http_res) - if utils.match_response(http_res, "401", "application/json"): - response_data = unmarshal_json_response( - errors.UnauthorizedResponseErrorData, http_res - ) - raise errors.UnauthorizedResponseError(response_data, http_res) - if utils.match_response(http_res, "403", "application/json"): - response_data = unmarshal_json_response( - errors.ForbiddenResponseErrorData, http_res - ) - raise errors.ForbiddenResponseError(response_data, http_res) - if utils.match_response(http_res, "404", "application/json"): - response_data = unmarshal_json_response( - errors.NotFoundResponseErrorData, http_res - ) - raise errors.NotFoundResponseError(response_data, http_res) - if utils.match_response(http_res, "408", "application/json"): - response_data = unmarshal_json_response( - errors.RequestTimeoutResponseErrorData, http_res - ) - raise errors.RequestTimeoutResponseError(response_data, http_res) - if utils.match_response(http_res, "409", "application/json"): - response_data = unmarshal_json_response( - errors.ConflictResponseErrorData, http_res - ) - raise errors.ConflictResponseError(response_data, http_res) - if utils.match_response(http_res, "422", "application/json"): - response_data = unmarshal_json_response( - errors.UnprocessableEntityResponseErrorData, http_res - ) - raise errors.UnprocessableEntityResponseError(response_data, http_res) - if utils.match_response(http_res, "500", "application/json"): - response_data = unmarshal_json_response( - errors.InternalServerResponseErrorData, http_res - ) - raise errors.InternalServerResponseError(response_data, http_res) - if utils.match_response(http_res, "502", "application/json"): - response_data = unmarshal_json_response( - errors.BadGatewayResponseErrorData, http_res - ) - raise errors.BadGatewayResponseError(response_data, http_res) - if utils.match_response(http_res, "4XX", "*"): - http_res_text = utils.stream_to_text(http_res) - raise errors.OpenRouterDefaultError( - "API error occurred", http_res, http_res_text - ) - if utils.match_response(http_res, "5XX", "*"): - http_res_text = utils.stream_to_text(http_res) - raise errors.OpenRouterDefaultError( - "API error occurred", http_res, http_res_text - ) - - raise errors.OpenRouterDefaultError("Unexpected response received", http_res) - - @deprecated( - "warning: ** DEPRECATED ** - This will be removed in a future release, please migrate away from it as soon as possible." - ) - async def update_pricing_async( - self, - *, - id: str, - pricing: Union[ - components.PrivateEndpointPricing, - components.PrivateEndpointPricingTypedDict, - ], - http_referer: Optional[str] = None, - x_open_router_title: Optional[str] = None, - x_open_router_categories: Optional[str] = None, - retries: OptionalNullable[utils.RetryConfig] = UNSET, - server_url: Optional[str] = None, - timeout_ms: Optional[int] = None, - http_headers: Optional[Mapping[str, str]] = None, - ) -> components.PrivateEndpointResponse: - r"""Set private endpoint pricing (deprecated) - - Deprecated: send `pricing` to `PATCH /private-endpoints/{id}` instead; this route behaves exactly like that call and will be removed. The body replaces the whole pricing object: omitting `cache_read` or `cache_write` reverts that rate to the provider pricing strategy default. [Management key](/docs/guides/overview/auth/management-api-keys) required. - - :param id: Stable identifier of the private endpoint. - :param pricing: Negotiated per-token rates reported for requests routed to this endpoint. - :param http_referer: The app identifier should be your app's URL and is used as the primary identifier for rankings. - This is used to track API usage per application. - - :param x_open_router_title: The app display name allows you to customize how your app appears in OpenRouter's dashboard. - - :param x_open_router_categories: Comma-separated list of app categories (e.g. \"cli-agent,cloud-agent\"). Used for marketplace rankings. - - :param retries: Override the default retry configuration for this method - :param server_url: Override the default server URL for this method - :param timeout_ms: Override the default request timeout configuration for this method in milliseconds - :param http_headers: Additional headers to set or replace on requests. - """ - base_url = None - url_variables = None - if timeout_ms is None: - timeout_ms = self.sdk_configuration.timeout_ms - - if server_url is not None: - base_url = server_url - else: - base_url = self._get_url(base_url, url_variables) - - request = operations.UpdatePrivateEndpointPricingRequest( - http_referer=http_referer, - x_open_router_title=x_open_router_title, - x_open_router_categories=x_open_router_categories, - id=id, - update_private_endpoint_pricing_request=components.UpdatePrivateEndpointPricingRequest( - pricing=utils.get_pydantic_model( - pricing, components.PrivateEndpointPricing - ), - ), - ) - - req = self._build_request_async( - method="PUT", - path="/private-endpoints/{id}/pricing", - base_url=base_url, - url_variables=url_variables, - request=request, - request_body_required=True, - request_has_path_params=True, - request_has_query_params=True, - user_agent_header="user-agent", - accept_header_value="application/json", - http_headers=http_headers, - _globals=operations.UpdatePrivateEndpointPricingGlobals( - http_referer=self.sdk_configuration.globals.http_referer, - x_open_router_title=self.sdk_configuration.globals.x_open_router_title, - x_open_router_categories=self.sdk_configuration.globals.x_open_router_categories, - ), - security=self.sdk_configuration.security, - get_serialized_body=lambda: utils.serialize_request_body( - request.update_private_endpoint_pricing_request, - False, - False, - "json", - components.UpdatePrivateEndpointPricingRequest, - ), - allow_empty_value=None, - timeout_ms=timeout_ms, - ) - - if retries == UNSET: - if self.sdk_configuration.retry_config is not UNSET: - retries = self.sdk_configuration.retry_config - else: - retries = utils.RetryConfig( - "backoff", utils.BackoffStrategy(500, 60000, 1.5, 3600000), True - ) - - retry_config = None - if isinstance(retries, utils.RetryConfig): - retry_config = (retries, ["5XX"]) - - http_res = await self.do_request_async( - hook_ctx=HookContext( - config=self.sdk_configuration, - base_url=base_url or "", - operation_id="updatePrivateEndpointPricing", - oauth2_scopes=None, - security_source=get_security_from_env( - self.sdk_configuration.security, components.Security - ), - tags=["Private Endpoints"], - extensions=None, - ), - request=req, - is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c), - retry_config=retry_config, - ) - - response_data: Any = None - if utils.match_response(http_res, "200", "application/json"): - return unmarshal_json_response(components.PrivateEndpointResponse, http_res) - if utils.match_response(http_res, "400", "application/json"): - response_data = unmarshal_json_response( - errors.BadRequestResponseErrorData, http_res - ) - raise errors.BadRequestResponseError(response_data, http_res) - if utils.match_response(http_res, "401", "application/json"): - response_data = unmarshal_json_response( - errors.UnauthorizedResponseErrorData, http_res - ) - raise errors.UnauthorizedResponseError(response_data, http_res) - if utils.match_response(http_res, "403", "application/json"): - response_data = unmarshal_json_response( - errors.ForbiddenResponseErrorData, http_res - ) - raise errors.ForbiddenResponseError(response_data, http_res) - if utils.match_response(http_res, "404", "application/json"): - response_data = unmarshal_json_response( - errors.NotFoundResponseErrorData, http_res - ) - raise errors.NotFoundResponseError(response_data, http_res) - if utils.match_response(http_res, "408", "application/json"): - response_data = unmarshal_json_response( - errors.RequestTimeoutResponseErrorData, http_res - ) - raise errors.RequestTimeoutResponseError(response_data, http_res) - if utils.match_response(http_res, "409", "application/json"): - response_data = unmarshal_json_response( - errors.ConflictResponseErrorData, http_res - ) - raise errors.ConflictResponseError(response_data, http_res) - if utils.match_response(http_res, "422", "application/json"): - response_data = unmarshal_json_response( - errors.UnprocessableEntityResponseErrorData, http_res - ) - raise errors.UnprocessableEntityResponseError(response_data, http_res) - if utils.match_response(http_res, "500", "application/json"): - response_data = unmarshal_json_response( - errors.InternalServerResponseErrorData, http_res - ) - raise errors.InternalServerResponseError(response_data, http_res) - if utils.match_response(http_res, "502", "application/json"): - response_data = unmarshal_json_response( - errors.BadGatewayResponseErrorData, http_res - ) - raise errors.BadGatewayResponseError(response_data, http_res) - if utils.match_response(http_res, "4XX", "*"): - http_res_text = await utils.stream_to_text_async(http_res) - raise errors.OpenRouterDefaultError( - "API error occurred", http_res, http_res_text - ) - if utils.match_response(http_res, "5XX", "*"): - http_res_text = await utils.stream_to_text_async(http_res) - raise errors.OpenRouterDefaultError( - "API error occurred", http_res, http_res_text - ) - - raise errors.OpenRouterDefaultError("Unexpected response received", http_res) - def validate( self, *, diff --git a/uv.lock b/uv.lock index facf39d6..f0219b22 100644 --- a/uv.lock +++ b/uv.lock @@ -231,7 +231,7 @@ wheels = [ [[package]] name = "openrouter" -version = "1.3.113" +version = "1.3.114" source = { editable = "." } dependencies = [ { name = "httpcore" },