## Python SDK Changes:

* `open_router.beta.responses.send()`: 
  *  `request` **Changed** **Breaking** ⚠️
  *  `response` **Changed** **Breaking** ⚠️
* `open_router.presets.create_presets_responses()`:  `request` **Changed** **Breaking** ⚠️
* `open_router.presets.create_presets_chat_completions()`:  `request` **Changed** **Breaking** ⚠️
* `open_router.chat.send()`:  `request` **Changed** **Breaking** ⚠️
* `open_router.workspaces.set_budget()`: **Added**
* `open_router.o_auth.create_auth_code()`: 
  *  `request.workspace_id` **Added**
  *  `error.status[403]` **Added**
* `open_router.files.download()`: **Added**
* `open_router.models.get()`: **Added**
* `open_router.workspaces.list_budgets()`: **Added**
* `open_router.workspaces.delete_budget()`: **Added**
* `open_router.datasets.get_benchmarks_artificial_analysis()`: **Added**
* `open_router.beta.analytics.query_analytics()`:  `response.data.warnings` **Added**
* `open_router.files.delete()`: **Added**
* `open_router.files.retrieve()`: **Added**
* `open_router.files.upload()`: **Added**
* `open_router.embeddings.list_models()`:  `response.data.[].benchmarks` **Added**
* `open_router.models.list()`: 
  *  `request` **Changed**
  *  `response.data.[].benchmarks` **Added**
* `open_router.models.list_for_user()`:  `response.data.[].benchmarks` **Added**
* `open_router.files.list()`: **Added**
* `open_router.presets.create_presets_messages()`:  `request` **Changed**
* `open_router.datasets.get_benchmarks_design_arena()`: **Added**
This commit is contained in:
speakeasybot
2026-06-17 01:01:09 +00:00
parent cdd4dc7302
commit 4e789208b4
97 changed files with 9804 additions and 391 deletions
+184
View File
@@ -202,6 +202,12 @@ if TYPE_CHECKING:
DeleteBYOKKeyRequest,
DeleteBYOKKeyRequestTypedDict,
)
from .deletefile import (
DeleteFileGlobals,
DeleteFileGlobalsTypedDict,
DeleteFileRequest,
DeleteFileRequestTypedDict,
)
from .deleteguardrail import (
DeleteGuardrailGlobals,
DeleteGuardrailGlobalsTypedDict,
@@ -228,6 +234,18 @@ if TYPE_CHECKING:
DeleteWorkspaceRequest,
DeleteWorkspaceRequestTypedDict,
)
from .deleteworkspacebudget import (
DeleteWorkspaceBudgetGlobals,
DeleteWorkspaceBudgetGlobalsTypedDict,
DeleteWorkspaceBudgetRequest,
DeleteWorkspaceBudgetRequestTypedDict,
)
from .downloadfilecontent import (
DownloadFileContentGlobals,
DownloadFileContentGlobalsTypedDict,
DownloadFileContentRequest,
DownloadFileContentRequestTypedDict,
)
from .exchangeauthcodeforapikey import (
ExchangeAuthCodeForAPIKeyCodeChallengeMethod,
ExchangeAuthCodeForAPIKeyGlobals,
@@ -272,6 +290,19 @@ if TYPE_CHECKING:
GetAppRankingsSort,
Subcategory,
)
from .getbenchmarksartificialanalysis import (
GetBenchmarksArtificialAnalysisGlobals,
GetBenchmarksArtificialAnalysisGlobalsTypedDict,
GetBenchmarksArtificialAnalysisRequest,
GetBenchmarksArtificialAnalysisRequestTypedDict,
)
from .getbenchmarksdesignarena import (
Arena,
GetBenchmarksDesignArenaGlobals,
GetBenchmarksDesignArenaGlobalsTypedDict,
GetBenchmarksDesignArenaRequest,
GetBenchmarksDesignArenaRequestTypedDict,
)
from .getbyokkey import (
GetBYOKKeyGlobals,
GetBYOKKeyGlobalsTypedDict,
@@ -300,6 +331,12 @@ if TYPE_CHECKING:
RateLimit,
RateLimitTypedDict,
)
from .getfilemetadata import (
GetFileMetadataGlobals,
GetFileMetadataGlobalsTypedDict,
GetFileMetadataRequest,
GetFileMetadataRequestTypedDict,
)
from .getgeneration import (
GetGenerationGlobals,
GetGenerationGlobalsTypedDict,
@@ -322,13 +359,22 @@ if TYPE_CHECKING:
GetKeyResponse,
GetKeyResponseTypedDict,
)
from .getmodel import (
GetModelGlobals,
GetModelGlobalsTypedDict,
GetModelRequest,
GetModelRequestTypedDict,
)
from .getmodels import (
Distillable,
GetModelsCategory,
GetModelsGlobals,
GetModelsGlobalsTypedDict,
GetModelsRequest,
GetModelsRequestTypedDict,
GetModelsSort,
Region,
Zdr,
)
from .getobservabilitydestination import (
GetObservabilityDestinationGlobals,
@@ -413,6 +459,14 @@ if TYPE_CHECKING:
ListEndpointsZdrResponse,
ListEndpointsZdrResponseTypedDict,
)
from .listfiles import (
ListFilesGlobals,
ListFilesGlobalsTypedDict,
ListFilesRequest,
ListFilesRequestTypedDict,
ListFilesResponse,
ListFilesResponseTypedDict,
)
from .listgenerationcontent import (
ListGenerationContentGlobals,
ListGenerationContentGlobalsTypedDict,
@@ -534,6 +588,12 @@ if TYPE_CHECKING:
ListVideosModelsRequest,
ListVideosModelsRequestTypedDict,
)
from .listworkspacebudgets import (
ListWorkspaceBudgetsGlobals,
ListWorkspaceBudgetsGlobalsTypedDict,
ListWorkspaceBudgetsRequest,
ListWorkspaceBudgetsRequestTypedDict,
)
from .listworkspaces import (
ListWorkspacesGlobals,
ListWorkspacesGlobalsTypedDict,
@@ -614,8 +674,25 @@ if TYPE_CHECKING:
UpdateWorkspaceRequest,
UpdateWorkspaceRequestTypedDict,
)
from .uploadfile import (
File,
FileTypedDict,
UploadFileGlobals,
UploadFileGlobalsTypedDict,
UploadFileRequest,
UploadFileRequestBody,
UploadFileRequestBodyTypedDict,
UploadFileRequestTypedDict,
)
from .upsertworkspacebudget import (
UpsertWorkspaceBudgetGlobals,
UpsertWorkspaceBudgetGlobalsTypedDict,
UpsertWorkspaceBudgetRequest,
UpsertWorkspaceBudgetRequestTypedDict,
)
__all__ = [
"Arena",
"BulkAddWorkspaceMembersGlobals",
"BulkAddWorkspaceMembersGlobalsTypedDict",
"BulkAddWorkspaceMembersRequest",
@@ -745,6 +822,10 @@ __all__ = [
"DeleteBYOKKeyGlobalsTypedDict",
"DeleteBYOKKeyRequest",
"DeleteBYOKKeyRequestTypedDict",
"DeleteFileGlobals",
"DeleteFileGlobalsTypedDict",
"DeleteFileRequest",
"DeleteFileRequestTypedDict",
"DeleteGuardrailGlobals",
"DeleteGuardrailGlobalsTypedDict",
"DeleteGuardrailRequest",
@@ -759,6 +840,10 @@ __all__ = [
"DeleteObservabilityDestinationGlobalsTypedDict",
"DeleteObservabilityDestinationRequest",
"DeleteObservabilityDestinationRequestTypedDict",
"DeleteWorkspaceBudgetGlobals",
"DeleteWorkspaceBudgetGlobalsTypedDict",
"DeleteWorkspaceBudgetRequest",
"DeleteWorkspaceBudgetRequestTypedDict",
"DeleteWorkspaceGlobals",
"DeleteWorkspaceGlobalsTypedDict",
"DeleteWorkspaceRequest",
@@ -767,12 +852,17 @@ __all__ = [
"DimensionTypedDict",
"Direction",
"DisplayFormat",
"Distillable",
"Document",
"DocumentRequest",
"DocumentRequestTypedDict",
"DocumentResponse",
"DocumentResponseTypedDict",
"DocumentTypedDict",
"DownloadFileContentGlobals",
"DownloadFileContentGlobalsTypedDict",
"DownloadFileContentRequest",
"DownloadFileContentRequestTypedDict",
"Embedding",
"EmbeddingTypedDict",
"EncodingFormat",
@@ -785,6 +875,8 @@ __all__ = [
"ExchangeAuthCodeForAPIKeyRequestTypedDict",
"ExchangeAuthCodeForAPIKeyResponse",
"ExchangeAuthCodeForAPIKeyResponseTypedDict",
"File",
"FileTypedDict",
"Filter",
"FilterTypedDict",
"GetAnalyticsMetaData",
@@ -807,6 +899,14 @@ __all__ = [
"GetBYOKKeyGlobalsTypedDict",
"GetBYOKKeyRequest",
"GetBYOKKeyRequestTypedDict",
"GetBenchmarksArtificialAnalysisGlobals",
"GetBenchmarksArtificialAnalysisGlobalsTypedDict",
"GetBenchmarksArtificialAnalysisRequest",
"GetBenchmarksArtificialAnalysisRequestTypedDict",
"GetBenchmarksDesignArenaGlobals",
"GetBenchmarksDesignArenaGlobalsTypedDict",
"GetBenchmarksDesignArenaRequest",
"GetBenchmarksDesignArenaRequestTypedDict",
"GetCreditsData",
"GetCreditsDataTypedDict",
"GetCreditsGlobals",
@@ -823,6 +923,10 @@ __all__ = [
"GetCurrentKeyRequestTypedDict",
"GetCurrentKeyResponse",
"GetCurrentKeyResponseTypedDict",
"GetFileMetadataGlobals",
"GetFileMetadataGlobalsTypedDict",
"GetFileMetadataRequest",
"GetFileMetadataRequestTypedDict",
"GetGenerationGlobals",
"GetGenerationGlobalsTypedDict",
"GetGenerationRequest",
@@ -839,6 +943,10 @@ __all__ = [
"GetKeyRequestTypedDict",
"GetKeyResponse",
"GetKeyResponseTypedDict",
"GetModelGlobals",
"GetModelGlobalsTypedDict",
"GetModelRequest",
"GetModelRequestTypedDict",
"GetModelsCategory",
"GetModelsGlobals",
"GetModelsGlobalsTypedDict",
@@ -907,6 +1015,12 @@ __all__ = [
"ListEndpointsZdrRequestTypedDict",
"ListEndpointsZdrResponse",
"ListEndpointsZdrResponseTypedDict",
"ListFilesGlobals",
"ListFilesGlobalsTypedDict",
"ListFilesRequest",
"ListFilesRequestTypedDict",
"ListFilesResponse",
"ListFilesResponseTypedDict",
"ListGenerationContentGlobals",
"ListGenerationContentGlobalsTypedDict",
"ListGenerationContentRequest",
@@ -1001,6 +1115,10 @@ __all__ = [
"ListVideosModelsGlobalsTypedDict",
"ListVideosModelsRequest",
"ListVideosModelsRequestTypedDict",
"ListWorkspaceBudgetsGlobals",
"ListWorkspaceBudgetsGlobalsTypedDict",
"ListWorkspaceBudgetsRequest",
"ListWorkspaceBudgetsRequestTypedDict",
"ListWorkspacesGlobals",
"ListWorkspacesGlobalsTypedDict",
"ListWorkspacesRequest",
@@ -1035,6 +1153,7 @@ __all__ = [
"QueryAnalyticsResponseTypedDict",
"RateLimit",
"RateLimitTypedDict",
"Region",
"Result",
"ResultTypedDict",
"Role",
@@ -1076,12 +1195,23 @@ __all__ = [
"UpdateWorkspaceGlobalsTypedDict",
"UpdateWorkspaceRequest",
"UpdateWorkspaceRequestTypedDict",
"UploadFileGlobals",
"UploadFileGlobalsTypedDict",
"UploadFileRequest",
"UploadFileRequestBody",
"UploadFileRequestBodyTypedDict",
"UploadFileRequestTypedDict",
"UpsertWorkspaceBudgetGlobals",
"UpsertWorkspaceBudgetGlobalsTypedDict",
"UpsertWorkspaceBudgetRequest",
"UpsertWorkspaceBudgetRequestTypedDict",
"UsageLimitType",
"Value1",
"Value1TypedDict",
"Value2",
"Value2TypedDict",
"ValueType",
"Zdr",
]
_dynamic_imports: dict[str, str] = {
@@ -1237,6 +1367,10 @@ _dynamic_imports: dict[str, str] = {
"DeleteBYOKKeyGlobalsTypedDict": ".deletebyokkey",
"DeleteBYOKKeyRequest": ".deletebyokkey",
"DeleteBYOKKeyRequestTypedDict": ".deletebyokkey",
"DeleteFileGlobals": ".deletefile",
"DeleteFileGlobalsTypedDict": ".deletefile",
"DeleteFileRequest": ".deletefile",
"DeleteFileRequestTypedDict": ".deletefile",
"DeleteGuardrailGlobals": ".deleteguardrail",
"DeleteGuardrailGlobalsTypedDict": ".deleteguardrail",
"DeleteGuardrailRequest": ".deleteguardrail",
@@ -1255,6 +1389,14 @@ _dynamic_imports: dict[str, str] = {
"DeleteWorkspaceGlobalsTypedDict": ".deleteworkspace",
"DeleteWorkspaceRequest": ".deleteworkspace",
"DeleteWorkspaceRequestTypedDict": ".deleteworkspace",
"DeleteWorkspaceBudgetGlobals": ".deleteworkspacebudget",
"DeleteWorkspaceBudgetGlobalsTypedDict": ".deleteworkspacebudget",
"DeleteWorkspaceBudgetRequest": ".deleteworkspacebudget",
"DeleteWorkspaceBudgetRequestTypedDict": ".deleteworkspacebudget",
"DownloadFileContentGlobals": ".downloadfilecontent",
"DownloadFileContentGlobalsTypedDict": ".downloadfilecontent",
"DownloadFileContentRequest": ".downloadfilecontent",
"DownloadFileContentRequestTypedDict": ".downloadfilecontent",
"ExchangeAuthCodeForAPIKeyCodeChallengeMethod": ".exchangeauthcodeforapikey",
"ExchangeAuthCodeForAPIKeyGlobals": ".exchangeauthcodeforapikey",
"ExchangeAuthCodeForAPIKeyGlobalsTypedDict": ".exchangeauthcodeforapikey",
@@ -1293,6 +1435,15 @@ _dynamic_imports: dict[str, str] = {
"GetAppRankingsResponseTypedDict": ".getapprankings",
"GetAppRankingsSort": ".getapprankings",
"Subcategory": ".getapprankings",
"GetBenchmarksArtificialAnalysisGlobals": ".getbenchmarksartificialanalysis",
"GetBenchmarksArtificialAnalysisGlobalsTypedDict": ".getbenchmarksartificialanalysis",
"GetBenchmarksArtificialAnalysisRequest": ".getbenchmarksartificialanalysis",
"GetBenchmarksArtificialAnalysisRequestTypedDict": ".getbenchmarksartificialanalysis",
"Arena": ".getbenchmarksdesignarena",
"GetBenchmarksDesignArenaGlobals": ".getbenchmarksdesignarena",
"GetBenchmarksDesignArenaGlobalsTypedDict": ".getbenchmarksdesignarena",
"GetBenchmarksDesignArenaRequest": ".getbenchmarksdesignarena",
"GetBenchmarksDesignArenaRequestTypedDict": ".getbenchmarksdesignarena",
"GetBYOKKeyGlobals": ".getbyokkey",
"GetBYOKKeyGlobalsTypedDict": ".getbyokkey",
"GetBYOKKeyRequest": ".getbyokkey",
@@ -1315,6 +1466,10 @@ _dynamic_imports: dict[str, str] = {
"GetCurrentKeyResponseTypedDict": ".getcurrentkey",
"RateLimit": ".getcurrentkey",
"RateLimitTypedDict": ".getcurrentkey",
"GetFileMetadataGlobals": ".getfilemetadata",
"GetFileMetadataGlobalsTypedDict": ".getfilemetadata",
"GetFileMetadataRequest": ".getfilemetadata",
"GetFileMetadataRequestTypedDict": ".getfilemetadata",
"GetGenerationGlobals": ".getgeneration",
"GetGenerationGlobalsTypedDict": ".getgeneration",
"GetGenerationRequest": ".getgeneration",
@@ -1331,12 +1486,19 @@ _dynamic_imports: dict[str, str] = {
"GetKeyRequestTypedDict": ".getkey",
"GetKeyResponse": ".getkey",
"GetKeyResponseTypedDict": ".getkey",
"GetModelGlobals": ".getmodel",
"GetModelGlobalsTypedDict": ".getmodel",
"GetModelRequest": ".getmodel",
"GetModelRequestTypedDict": ".getmodel",
"Distillable": ".getmodels",
"GetModelsCategory": ".getmodels",
"GetModelsGlobals": ".getmodels",
"GetModelsGlobalsTypedDict": ".getmodels",
"GetModelsRequest": ".getmodels",
"GetModelsRequestTypedDict": ".getmodels",
"GetModelsSort": ".getmodels",
"Region": ".getmodels",
"Zdr": ".getmodels",
"GetObservabilityDestinationGlobals": ".getobservabilitydestination",
"GetObservabilityDestinationGlobalsTypedDict": ".getobservabilitydestination",
"GetObservabilityDestinationRequest": ".getobservabilitydestination",
@@ -1396,6 +1558,12 @@ _dynamic_imports: dict[str, str] = {
"ListEndpointsZdrRequestTypedDict": ".listendpointszdr",
"ListEndpointsZdrResponse": ".listendpointszdr",
"ListEndpointsZdrResponseTypedDict": ".listendpointszdr",
"ListFilesGlobals": ".listfiles",
"ListFilesGlobalsTypedDict": ".listfiles",
"ListFilesRequest": ".listfiles",
"ListFilesRequestTypedDict": ".listfiles",
"ListFilesResponse": ".listfiles",
"ListFilesResponseTypedDict": ".listfiles",
"ListGenerationContentGlobals": ".listgenerationcontent",
"ListGenerationContentGlobalsTypedDict": ".listgenerationcontent",
"ListGenerationContentRequest": ".listgenerationcontent",
@@ -1487,6 +1655,10 @@ _dynamic_imports: dict[str, str] = {
"ListVideosModelsGlobalsTypedDict": ".listvideosmodels",
"ListVideosModelsRequest": ".listvideosmodels",
"ListVideosModelsRequestTypedDict": ".listvideosmodels",
"ListWorkspaceBudgetsGlobals": ".listworkspacebudgets",
"ListWorkspaceBudgetsGlobalsTypedDict": ".listworkspacebudgets",
"ListWorkspaceBudgetsRequest": ".listworkspacebudgets",
"ListWorkspaceBudgetsRequestTypedDict": ".listworkspacebudgets",
"ListWorkspacesGlobals": ".listworkspaces",
"ListWorkspacesGlobalsTypedDict": ".listworkspaces",
"ListWorkspacesRequest": ".listworkspaces",
@@ -1551,6 +1723,18 @@ _dynamic_imports: dict[str, str] = {
"UpdateWorkspaceGlobalsTypedDict": ".updateworkspace",
"UpdateWorkspaceRequest": ".updateworkspace",
"UpdateWorkspaceRequestTypedDict": ".updateworkspace",
"File": ".uploadfile",
"FileTypedDict": ".uploadfile",
"UploadFileGlobals": ".uploadfile",
"UploadFileGlobalsTypedDict": ".uploadfile",
"UploadFileRequest": ".uploadfile",
"UploadFileRequestBody": ".uploadfile",
"UploadFileRequestBodyTypedDict": ".uploadfile",
"UploadFileRequestTypedDict": ".uploadfile",
"UpsertWorkspaceBudgetGlobals": ".upsertworkspacebudget",
"UpsertWorkspaceBudgetGlobalsTypedDict": ".upsertworkspacebudget",
"UpsertWorkspaceBudgetRequest": ".upsertworkspacebudget",
"UpsertWorkspaceBudgetRequestTypedDict": ".upsertworkspacebudget",
}
@@ -92,7 +92,7 @@ r"""Optional credit limit reset interval. When set, the credit limit resets on t
class CreateAuthKeysCodeRequestBodyTypedDict(TypedDict):
callback_url: str
r"""The callback URL to redirect to after authorization. Note, only https URLs on ports 443 and 3000 are allowed."""
r"""The callback URL to redirect to after authorization. Supports https URLs and localhost/127.0.0.1 URLs on any port for local CLI tools."""
code_challenge: NotRequired[str]
r"""PKCE code challenge for enhanced security"""
code_challenge_method: NotRequired[CreateAuthKeysCodeCodeChallengeMethod]
@@ -105,11 +105,13 @@ class CreateAuthKeysCodeRequestBodyTypedDict(TypedDict):
r"""Credit limit for the API key to be created"""
usage_limit_type: NotRequired[UsageLimitType]
r"""Optional credit limit reset interval. When set, the credit limit resets on this interval."""
workspace_id: NotRequired[str]
r"""Optional workspace ID to associate the API key with"""
class CreateAuthKeysCodeRequestBody(BaseModel):
callback_url: str
r"""The callback URL to redirect to after authorization. Note, only https URLs on ports 443 and 3000 are allowed."""
r"""The callback URL to redirect to after authorization. Supports https URLs and localhost/127.0.0.1 URLs on any port for local CLI tools."""
code_challenge: Optional[str] = None
r"""PKCE code challenge for enhanced security"""
@@ -134,6 +136,9 @@ class CreateAuthKeysCodeRequestBody(BaseModel):
] = None
r"""Optional credit limit reset interval. When set, the credit limit resets on this interval."""
workspace_id: Optional[str] = None
r"""Optional workspace ID to associate the API key with"""
@model_serializer(mode="wrap")
def serialize_model(self, handler):
optional_fields = [
@@ -143,6 +148,7 @@ class CreateAuthKeysCodeRequestBody(BaseModel):
"key_label",
"limit",
"usage_limit_type",
"workspace_id",
]
nullable_fields = ["expires_at"]
null_default_fields = []
+118
View File
@@ -0,0 +1,118 @@
"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
from __future__ import annotations
from openrouter.types import BaseModel
from openrouter.utils import (
FieldMetadata,
HeaderMetadata,
PathParamMetadata,
QueryParamMetadata,
)
import pydantic
from typing import Optional
from typing_extensions import Annotated, NotRequired, TypedDict
class DeleteFileGlobalsTypedDict(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 DeleteFileGlobals(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.
"""
class DeleteFileRequestTypedDict(TypedDict):
file_id: str
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.
"""
workspace_id: NotRequired[str]
r"""Workspace to scope the request to. Defaults to the callers default workspace."""
class DeleteFileRequest(BaseModel):
file_id: Annotated[
str, FieldMetadata(path=PathParamMetadata(style="simple", explode=False))
]
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.
"""
workspace_id: Annotated[
Optional[str],
FieldMetadata(query=QueryParamMetadata(style="form", explode=True)),
] = None
r"""Workspace to scope the request to. Defaults to the callers default workspace."""
@@ -0,0 +1,127 @@
"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
from __future__ import annotations
from openrouter.components import (
workspacebudgetinterval as components_workspacebudgetinterval,
)
from openrouter.types import BaseModel
from openrouter.utils import (
FieldMetadata,
HeaderMetadata,
PathParamMetadata,
validate_open_enum,
)
import pydantic
from pydantic.functional_validators import PlainValidator
from typing import Optional
from typing_extensions import Annotated, NotRequired, TypedDict
class DeleteWorkspaceBudgetGlobalsTypedDict(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 DeleteWorkspaceBudgetGlobals(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.
"""
class DeleteWorkspaceBudgetRequestTypedDict(TypedDict):
id: str
r"""The workspace ID (UUID) or slug"""
interval: components_workspacebudgetinterval.WorkspaceBudgetInterval
r"""Budget reset interval. Use \"lifetime\" for a one-time budget that never resets."""
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 DeleteWorkspaceBudgetRequest(BaseModel):
id: Annotated[
str, FieldMetadata(path=PathParamMetadata(style="simple", explode=False))
]
r"""The workspace ID (UUID) or slug"""
interval: Annotated[
Annotated[
components_workspacebudgetinterval.WorkspaceBudgetInterval,
PlainValidator(validate_open_enum(False)),
],
FieldMetadata(path=PathParamMetadata(style="simple", explode=False)),
]
r"""Budget reset interval. Use \"lifetime\" for a one-time budget that never resets."""
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.
"""
@@ -0,0 +1,118 @@
"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
from __future__ import annotations
from openrouter.types import BaseModel
from openrouter.utils import (
FieldMetadata,
HeaderMetadata,
PathParamMetadata,
QueryParamMetadata,
)
import pydantic
from typing import Optional
from typing_extensions import Annotated, NotRequired, TypedDict
class DownloadFileContentGlobalsTypedDict(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 DownloadFileContentGlobals(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.
"""
class DownloadFileContentRequestTypedDict(TypedDict):
file_id: str
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.
"""
workspace_id: NotRequired[str]
r"""Workspace to scope the request to. Defaults to the callers default workspace."""
class DownloadFileContentRequest(BaseModel):
file_id: Annotated[
str, FieldMetadata(path=PathParamMetadata(style="simple", explode=False))
]
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.
"""
workspace_id: Annotated[
Optional[str],
FieldMetadata(query=QueryParamMetadata(style="form", explode=True)),
] = None
r"""Workspace to scope the request to. Defaults to the callers default workspace."""
@@ -0,0 +1,108 @@
"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
from __future__ import annotations
from openrouter.types import BaseModel
from openrouter.utils import FieldMetadata, HeaderMetadata, QueryParamMetadata
import pydantic
from typing import Optional
from typing_extensions import Annotated, NotRequired, TypedDict
class GetBenchmarksArtificialAnalysisGlobalsTypedDict(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 GetBenchmarksArtificialAnalysisGlobals(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.
"""
class GetBenchmarksArtificialAnalysisRequestTypedDict(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.
"""
max_results: NotRequired[int]
r"""Max results to return (1100, default 50)."""
class GetBenchmarksArtificialAnalysisRequest(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.
"""
max_results: Annotated[
Optional[int],
FieldMetadata(query=QueryParamMetadata(style="form", explode=True)),
] = 50
r"""Max results to return (1100, default 50)."""
@@ -0,0 +1,141 @@
"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
from __future__ import annotations
from openrouter.types import BaseModel, UnrecognizedStr
from openrouter.utils import (
FieldMetadata,
HeaderMetadata,
QueryParamMetadata,
validate_open_enum,
)
import pydantic
from pydantic.functional_validators import PlainValidator
from typing import Literal, Optional, Union
from typing_extensions import Annotated, NotRequired, TypedDict
class GetBenchmarksDesignArenaGlobalsTypedDict(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 GetBenchmarksDesignArenaGlobals(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.
"""
Arena = Union[
Literal[
"models",
"builders",
"agents",
],
UnrecognizedStr,
]
r"""Arena to query. Defaults to `models`."""
class GetBenchmarksDesignArenaRequestTypedDict(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.
"""
arena: NotRequired[Arena]
r"""Arena to query. Defaults to `models`."""
category: NotRequired[str]
r"""Category within the arena (e.g. `codecategories`, `uicomponent`, `gamedev`, `3d`, `dataviz`, `image`, `video`, `svg`). When omitted, returns all categories."""
max_results: NotRequired[int]
r"""Max results to return: per category when no category filter is applied (1100, default 50)."""
class GetBenchmarksDesignArenaRequest(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.
"""
arena: Annotated[
Annotated[Optional[Arena], PlainValidator(validate_open_enum(False))],
FieldMetadata(query=QueryParamMetadata(style="form", explode=True)),
] = "models"
r"""Arena to query. Defaults to `models`."""
category: Annotated[
Optional[str],
FieldMetadata(query=QueryParamMetadata(style="form", explode=True)),
] = None
r"""Category within the arena (e.g. `codecategories`, `uicomponent`, `gamedev`, `3d`, `dataviz`, `image`, `video`, `svg`). When omitted, returns all categories."""
max_results: Annotated[
Optional[int],
FieldMetadata(query=QueryParamMetadata(style="form", explode=True)),
] = 50
r"""Max results to return: per category when no category filter is applied (1100, default 50)."""
@@ -0,0 +1,118 @@
"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
from __future__ import annotations
from openrouter.types import BaseModel
from openrouter.utils import (
FieldMetadata,
HeaderMetadata,
PathParamMetadata,
QueryParamMetadata,
)
import pydantic
from typing import Optional
from typing_extensions import Annotated, NotRequired, TypedDict
class GetFileMetadataGlobalsTypedDict(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 GetFileMetadataGlobals(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.
"""
class GetFileMetadataRequestTypedDict(TypedDict):
file_id: str
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.
"""
workspace_id: NotRequired[str]
r"""Workspace to scope the request to. Defaults to the callers default workspace."""
class GetFileMetadataRequest(BaseModel):
file_id: Annotated[
str, FieldMetadata(path=PathParamMetadata(style="simple", explode=False))
]
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.
"""
workspace_id: Annotated[
Optional[str],
FieldMetadata(query=QueryParamMetadata(style="form", explode=True)),
] = None
r"""Workspace to scope the request to. Defaults to the callers default workspace."""
+114
View File
@@ -0,0 +1,114 @@
"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
from __future__ import annotations
from openrouter.types import BaseModel
from openrouter.utils import FieldMetadata, HeaderMetadata, PathParamMetadata
import pydantic
from typing import Optional
from typing_extensions import Annotated, NotRequired, TypedDict
class GetModelGlobalsTypedDict(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 GetModelGlobals(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.
"""
class GetModelRequestTypedDict(TypedDict):
author: str
r"""The author/organization of the model"""
slug: str
r"""The model slug, optionally including a variant suffix (e.g. gpt-4 or gpt-4:free)"""
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 GetModelRequest(BaseModel):
author: Annotated[
str, FieldMetadata(path=PathParamMetadata(style="simple", explode=False))
]
r"""The author/organization of the model"""
slug: Annotated[
str, FieldMetadata(path=PathParamMetadata(style="simple", explode=False))
]
r"""The model slug, optionally including a variant suffix (e.g. gpt-4 or gpt-4:free)"""
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.
"""
+164 -1
View File
@@ -1,7 +1,14 @@
"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
from __future__ import annotations
from openrouter.types import BaseModel, UnrecognizedStr
from openrouter.types import (
BaseModel,
Nullable,
OptionalNullable,
UNSET,
UNSET_SENTINEL,
UnrecognizedStr,
)
from openrouter.utils import (
FieldMetadata,
HeaderMetadata,
@@ -9,6 +16,7 @@ from openrouter.utils import (
validate_open_enum,
)
import pydantic
from pydantic import model_serializer
from pydantic.functional_validators import PlainValidator
from typing import Literal, Optional, Union
from typing_extensions import Annotated, NotRequired, TypedDict
@@ -96,6 +104,24 @@ GetModelsSort = Union[
r"""Sort the returned models server-side. Prefer this over fetching the full list and sorting client-side. Options: pricing-low-to-high, pricing-high-to-low (average prompt/completion price), context-high-to-low (context length), throughput-high-to-low, latency-low-to-high (recent median performance), most-popular, top-weekly (tokens processed in the last week), newest (creation date). When omitted, the existing default ordering is preserved."""
Distillable = Union[
Literal[
"true",
"false",
],
UnrecognizedStr,
]
r"""Filter by distillation capability. \"true\" returns only distillable models, \"false\" excludes them."""
Zdr = Literal["true",]
r"""When set to \"true\", return only models with zero data retention endpoints."""
Region = Literal["eu",]
r"""Filter to models with endpoints in the given data region. Currently only \"eu\" is supported."""
class GetModelsRequestTypedDict(TypedDict):
http_referer: NotRequired[str]
r"""The app identifier should be your app's URL and is used as the primary identifier for rankings.
@@ -118,6 +144,28 @@ class GetModelsRequestTypedDict(TypedDict):
r"""Filter models by output modality. Accepts a comma-separated list of modalities (text, image, audio, embeddings) or \"all\" to include all models. Defaults to \"text\"."""
sort: NotRequired[GetModelsSort]
r"""Sort the returned models server-side. Prefer this over fetching the full list and sorting client-side. Options: pricing-low-to-high, pricing-high-to-low (average prompt/completion price), context-high-to-low (context length), throughput-high-to-low, latency-low-to-high (recent median performance), most-popular, top-weekly (tokens processed in the last week), newest (creation date). When omitted, the existing default ordering is preserved."""
q: NotRequired[str]
r"""Free-text search by model name or slug."""
input_modalities: NotRequired[str]
r"""Filter models by input modality. Comma-separated list of: text, image, audio, file."""
context: NotRequired[int]
r"""Minimum context length (tokens). Models with smaller context are excluded."""
min_price: NotRequired[Nullable[float]]
r"""Minimum prompt price in $/M tokens."""
max_price: NotRequired[Nullable[float]]
r"""Maximum prompt price in $/M tokens."""
arch: NotRequired[str]
r"""Filter models by architecture/model family (e.g. GPT, Claude, Gemini, Llama)."""
model_authors: NotRequired[str]
r"""Filter models by the organization that created the model. Comma-separated list of author slugs."""
providers: NotRequired[str]
r"""Filter models by hosting provider. Comma-separated list of provider names."""
distillable: NotRequired[Distillable]
r"""Filter by distillation capability. \"true\" returns only distillable models, \"false\" excludes them."""
zdr: NotRequired[Zdr]
r"""When set to \"true\", return only models with zero data retention endpoints."""
region: NotRequired[Region]
r"""Filter to models with endpoints in the given data region. Currently only \"eu\" is supported."""
class GetModelsRequest(BaseModel):
@@ -174,3 +222,118 @@ class GetModelsRequest(BaseModel):
FieldMetadata(query=QueryParamMetadata(style="form", explode=True)),
] = None
r"""Sort the returned models server-side. Prefer this over fetching the full list and sorting client-side. Options: pricing-low-to-high, pricing-high-to-low (average prompt/completion price), context-high-to-low (context length), throughput-high-to-low, latency-low-to-high (recent median performance), most-popular, top-weekly (tokens processed in the last week), newest (creation date). When omitted, the existing default ordering is preserved."""
q: Annotated[
Optional[str],
FieldMetadata(query=QueryParamMetadata(style="form", explode=True)),
] = None
r"""Free-text search by model name or slug."""
input_modalities: Annotated[
Optional[str],
FieldMetadata(query=QueryParamMetadata(style="form", explode=True)),
] = None
r"""Filter models by input modality. Comma-separated list of: text, image, audio, file."""
context: Annotated[
Optional[int],
FieldMetadata(query=QueryParamMetadata(style="form", explode=True)),
] = None
r"""Minimum context length (tokens). Models with smaller context are excluded."""
min_price: Annotated[
OptionalNullable[float],
FieldMetadata(query=QueryParamMetadata(style="form", explode=True)),
] = UNSET
r"""Minimum prompt price in $/M tokens."""
max_price: Annotated[
OptionalNullable[float],
FieldMetadata(query=QueryParamMetadata(style="form", explode=True)),
] = UNSET
r"""Maximum prompt price in $/M tokens."""
arch: Annotated[
Optional[str],
FieldMetadata(query=QueryParamMetadata(style="form", explode=True)),
] = None
r"""Filter models by architecture/model family (e.g. GPT, Claude, Gemini, Llama)."""
model_authors: Annotated[
Optional[str],
FieldMetadata(query=QueryParamMetadata(style="form", explode=True)),
] = None
r"""Filter models by the organization that created the model. Comma-separated list of author slugs."""
providers: Annotated[
Optional[str],
FieldMetadata(query=QueryParamMetadata(style="form", explode=True)),
] = None
r"""Filter models by hosting provider. Comma-separated list of provider names."""
distillable: Annotated[
Annotated[Optional[Distillable], PlainValidator(validate_open_enum(False))],
FieldMetadata(query=QueryParamMetadata(style="form", explode=True)),
] = None
r"""Filter by distillation capability. \"true\" returns only distillable models, \"false\" excludes them."""
zdr: Annotated[
Optional[Zdr],
FieldMetadata(query=QueryParamMetadata(style="form", explode=True)),
] = None
r"""When set to \"true\", return only models with zero data retention endpoints."""
region: Annotated[
Optional[Region],
FieldMetadata(query=QueryParamMetadata(style="form", explode=True)),
] = None
r"""Filter to models with endpoints in the given data region. Currently only \"eu\" is supported."""
@model_serializer(mode="wrap")
def serialize_model(self, handler):
optional_fields = [
"HTTP-Referer",
"X-OpenRouter-Title",
"X-OpenRouter-Categories",
"category",
"supported_parameters",
"output_modalities",
"sort",
"q",
"input_modalities",
"context",
"min_price",
"max_price",
"arch",
"model_authors",
"providers",
"distillable",
"zdr",
"region",
]
nullable_fields = ["min_price", "max_price"]
null_default_fields = []
serialized = handler(self)
m = {}
for n, f in type(self).model_fields.items():
k = f.alias or n
val = serialized.get(k)
serialized.pop(k, None)
optional_nullable = k in optional_fields and k in nullable_fields
is_set = (
self.__pydantic_fields_set__.intersection({n})
or k in null_default_fields
) # pylint: disable=no-member
if val is not None and val != UNSET_SENTINEL:
m[k] = val
elif val != UNSET_SENTINEL and (
not k in optional_fields or (optional_nullable and is_set)
):
m[k] = val
return m
+138
View File
@@ -0,0 +1,138 @@
"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
from __future__ import annotations
from openrouter.components import filelistresponse as components_filelistresponse
from openrouter.types import BaseModel
from openrouter.utils import FieldMetadata, HeaderMetadata, QueryParamMetadata
import pydantic
from typing import Awaitable, Callable, Optional, Union
from typing_extensions import Annotated, NotRequired, TypedDict
class ListFilesGlobalsTypedDict(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 ListFilesGlobals(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.
"""
class ListFilesRequestTypedDict(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.
"""
limit: NotRequired[int]
r"""Maximum number of files to return (11000)."""
cursor: NotRequired[str]
r"""Opaque pagination cursor from a previous response."""
workspace_id: NotRequired[str]
r"""Workspace to scope the request to. Defaults to the callers default workspace."""
class ListFilesRequest(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.
"""
limit: Annotated[
Optional[int],
FieldMetadata(query=QueryParamMetadata(style="form", explode=True)),
] = None
r"""Maximum number of files to return (11000)."""
cursor: Annotated[
Optional[str],
FieldMetadata(query=QueryParamMetadata(style="form", explode=True)),
] = None
r"""Opaque pagination cursor from a previous response."""
workspace_id: Annotated[
Optional[str],
FieldMetadata(query=QueryParamMetadata(style="form", explode=True)),
] = None
r"""Workspace to scope the request to. Defaults to the callers default workspace."""
class ListFilesResponseTypedDict(TypedDict):
result: components_filelistresponse.FileListResponseTypedDict
class ListFilesResponse(BaseModel):
next: Union[
Callable[[], Optional[ListFilesResponse]],
Callable[[], Awaitable[Optional[ListFilesResponse]]],
]
result: components_filelistresponse.FileListResponse
@@ -0,0 +1,107 @@
"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
from __future__ import annotations
from openrouter.types import BaseModel
from openrouter.utils import FieldMetadata, HeaderMetadata, PathParamMetadata
import pydantic
from typing import Optional
from typing_extensions import Annotated, NotRequired, TypedDict
class ListWorkspaceBudgetsGlobalsTypedDict(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 ListWorkspaceBudgetsGlobals(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.
"""
class ListWorkspaceBudgetsRequestTypedDict(TypedDict):
id: str
r"""The workspace ID (UUID) or slug"""
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 ListWorkspaceBudgetsRequest(BaseModel):
id: Annotated[
str, FieldMetadata(path=PathParamMetadata(style="simple", explode=False))
]
r"""The workspace ID (UUID) or slug"""
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.
"""
+13 -8
View File
@@ -70,31 +70,31 @@ Value2 = TypeAliasType("Value2", Union[str, float])
Value1TypedDict = TypeAliasType(
"Value1TypedDict", Union[str, float, List[Value2TypedDict]]
)
r"""Filter value (scalar or array depending on operator)"""
r"""Filter value (scalar or array depending on operator). Several dimensions are enriched in responses (returned as human-readable labels), but filters must use the underlying ID: `api_key_id` — numeric ID (from generation metadata) or key hash (64-char hex from GET /api/v1/keys, resolved server-side); `user` — Clerk user ID (e.g. \"user_abc123\"), not the display name; `workspace` — workspace UUID, not the workspace name; `app` — numeric app ID, not the app title; `model` — permaslug (e.g. \"openai/gpt-4o\"), not the display name. Other dimensions (provider, origin, country, etc.) are not enriched and accept the value as returned."""
Value1 = TypeAliasType("Value1", Union[str, float, List[Value2]])
r"""Filter value (scalar or array depending on operator)"""
r"""Filter value (scalar or array depending on operator). Several dimensions are enriched in responses (returned as human-readable labels), but filters must use the underlying ID: `api_key_id` — numeric ID (from generation metadata) or key hash (64-char hex from GET /api/v1/keys, resolved server-side); `user` — Clerk user ID (e.g. \"user_abc123\"), not the display name; `workspace` — workspace UUID, not the workspace name; `app` — numeric app ID, not the app title; `model` — permaslug (e.g. \"openai/gpt-4o\"), not the display name. Other dimensions (provider, origin, country, etc.) are not enriched and accept the value as returned."""
class FilterTypedDict(TypedDict):
field: str
r"""Dimension to filter on"""
r"""Dimension to filter on. Use the /meta endpoint for available dimensions."""
operator: str
r"""Filter operator"""
value: Value1TypedDict
r"""Filter value (scalar or array depending on operator)"""
r"""Filter value (scalar or array depending on operator). Several dimensions are enriched in responses (returned as human-readable labels), but filters must use the underlying ID: `api_key_id` — numeric ID (from generation metadata) or key hash (64-char hex from GET /api/v1/keys, resolved server-side); `user` — Clerk user ID (e.g. \"user_abc123\"), not the display name; `workspace` — workspace UUID, not the workspace name; `app` — numeric app ID, not the app title; `model` — permaslug (e.g. \"openai/gpt-4o\"), not the display name. Other dimensions (provider, origin, country, etc.) are not enriched and accept the value as returned."""
class Filter(BaseModel):
field: str
r"""Dimension to filter on"""
r"""Dimension to filter on. Use the /meta endpoint for available dimensions."""
operator: str
r"""Filter operator"""
value: Value1
r"""Filter value (scalar or array depending on operator)"""
r"""Filter value (scalar or array depending on operator). Several dimensions are enriched in responses (returned as human-readable labels), but filters must use the underlying ID: `api_key_id` — numeric ID (from generation metadata) or key hash (64-char hex from GET /api/v1/keys, resolved server-side); `user` — Clerk user ID (e.g. \"user_abc123\"), not the display name; `workspace` — workspace UUID, not the workspace name; `app` — numeric app ID, not the app title; `model` — permaslug (e.g. \"openai/gpt-4o\"), not the display name. Other dimensions (provider, origin, country, etc.) are not enriched and accept the value as returned."""
Direction = Union[
@@ -137,7 +137,7 @@ class QueryAnalyticsRequestBodyTypedDict(TypedDict):
granularity: NotRequired[str]
r"""Time granularity"""
group_limit: NotRequired[int]
r"""Maximum rows per distinct combination of dimensions (ClickHouse LIMIT n BY). When omitted on time-series queries (granularity + dimensions), auto-computed to avoid truncating time windows. Explicit values override the default and may truncate time buckets if set lower than the number of buckets in the range. Ignored when no dimensions are specified."""
r"""Maximum rows per distinct combination of dimensions. When omitted on time-series queries (granularity + dimensions), auto-computed to avoid truncating time windows. Explicit values override the default and may truncate time buckets if set lower than the number of buckets in the range. Ignored when no dimensions are specified."""
limit: NotRequired[int]
r"""Maximum total rows returned. Defaults to 1000. On time-series queries with dimensions and no explicit group_limit, the server may raise this to accommodate the expected number of unique time-bucket/dimension combinations."""
order_by: NotRequired[OrderByTypedDict]
@@ -155,7 +155,7 @@ class QueryAnalyticsRequestBody(BaseModel):
r"""Time granularity"""
group_limit: Optional[int] = None
r"""Maximum rows per distinct combination of dimensions (ClickHouse LIMIT n BY). When omitted on time-series queries (granularity + dimensions), auto-computed to avoid truncating time windows. Explicit values override the default and may truncate time buckets if set lower than the number of buckets in the range. Ignored when no dimensions are specified."""
r"""Maximum rows per distinct combination of dimensions. When omitted on time-series queries (granularity + dimensions), auto-computed to avoid truncating time windows. Explicit values override the default and may truncate time buckets if set lower than the number of buckets in the range. Ignored when no dimensions are specified."""
limit: Optional[int] = None
r"""Maximum total rows returned. Defaults to 1000. On time-series queries with dimensions and no explicit group_limit, the server may raise this to accommodate the expected number of unique time-bucket/dimension combinations."""
@@ -243,6 +243,8 @@ class QueryAnalyticsData2TypedDict(TypedDict):
data: List[QueryAnalyticsData1TypedDict]
metadata: MetadataTypedDict
cached_at: NotRequired[float]
warnings: NotRequired[List[str]]
r"""Warnings about filter resolution issues (e.g. unresolvable api_key_id hashes). The query still runs normally; these inform the caller that some filter values could not be resolved."""
class QueryAnalyticsData2(BaseModel):
@@ -252,6 +254,9 @@ class QueryAnalyticsData2(BaseModel):
cached_at: Annotated[Optional[float], pydantic.Field(alias="cachedAt")] = None
warnings: Optional[List[str]] = None
r"""Warnings about filter resolution issues (e.g. unresolvable api_key_id hashes). The query still runs normally; these inform the caller that some filter values could not be resolved."""
class QueryAnalyticsResponseTypedDict(TypedDict):
r"""Analytics query results"""
+153
View File
@@ -0,0 +1,153 @@
"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
from __future__ import annotations
import io
from openrouter.types import BaseModel
from openrouter.utils import (
FieldMetadata,
HeaderMetadata,
MultipartFormMetadata,
QueryParamMetadata,
RequestMetadata,
)
import pydantic
from typing import IO, Optional, Union
from typing_extensions import Annotated, NotRequired, TypedDict
class UploadFileGlobalsTypedDict(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 UploadFileGlobals(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.
"""
class FileTypedDict(TypedDict):
file_name: str
content: Union[bytes, IO[bytes], io.BufferedReader]
content_type: NotRequired[str]
class File(BaseModel):
file_name: Annotated[
str, pydantic.Field(alias="fileName"), FieldMetadata(multipart=True)
]
content: Annotated[
Union[bytes, IO[bytes], io.BufferedReader],
pydantic.Field(alias=""),
FieldMetadata(multipart=MultipartFormMetadata(content=True)),
]
content_type: Annotated[
Optional[str],
pydantic.Field(alias="Content-Type"),
FieldMetadata(multipart=True),
] = None
class UploadFileRequestBodyTypedDict(TypedDict):
file: FileTypedDict
class UploadFileRequestBody(BaseModel):
file: Annotated[File, FieldMetadata(multipart=MultipartFormMetadata(file=True))]
class UploadFileRequestTypedDict(TypedDict):
request_body: UploadFileRequestBodyTypedDict
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.
"""
workspace_id: NotRequired[str]
r"""Workspace to scope the request to. Defaults to the callers default workspace."""
class UploadFileRequest(BaseModel):
request_body: Annotated[
UploadFileRequestBody,
FieldMetadata(request=RequestMetadata(media_type="multipart/form-data")),
]
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.
"""
workspace_id: Annotated[
Optional[str],
FieldMetadata(query=QueryParamMetadata(style="form", explode=True)),
] = None
r"""Workspace to scope the request to. Defaults to the callers default workspace."""
@@ -0,0 +1,137 @@
"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
from __future__ import annotations
from openrouter.components import (
upsertworkspacebudgetrequest as components_upsertworkspacebudgetrequest,
workspacebudgetinterval as components_workspacebudgetinterval,
)
from openrouter.types import BaseModel
from openrouter.utils import (
FieldMetadata,
HeaderMetadata,
PathParamMetadata,
RequestMetadata,
validate_open_enum,
)
import pydantic
from pydantic.functional_validators import PlainValidator
from typing import Optional
from typing_extensions import Annotated, NotRequired, TypedDict
class UpsertWorkspaceBudgetGlobalsTypedDict(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 UpsertWorkspaceBudgetGlobals(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.
"""
class UpsertWorkspaceBudgetRequestTypedDict(TypedDict):
id: str
r"""The workspace ID (UUID) or slug"""
interval: components_workspacebudgetinterval.WorkspaceBudgetInterval
r"""Budget reset interval. Use \"lifetime\" for a one-time budget that never resets."""
upsert_workspace_budget_request: (
components_upsertworkspacebudgetrequest.UpsertWorkspaceBudgetRequestTypedDict
)
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 UpsertWorkspaceBudgetRequest(BaseModel):
id: Annotated[
str, FieldMetadata(path=PathParamMetadata(style="simple", explode=False))
]
r"""The workspace ID (UUID) or slug"""
interval: Annotated[
Annotated[
components_workspacebudgetinterval.WorkspaceBudgetInterval,
PlainValidator(validate_open_enum(False)),
],
FieldMetadata(path=PathParamMetadata(style="simple", explode=False)),
]
r"""Budget reset interval. Use \"lifetime\" for a one-time budget that never resets."""
upsert_workspace_budget_request: Annotated[
components_upsertworkspacebudgetrequest.UpsertWorkspaceBudgetRequest,
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.
"""