mirror of
https://github.com/wassname/openrouter-python-sdk-retry-errors.git
synced 2026-07-30 12:20:57 +08:00
feat: regenerate SDK with updated OpenAPI spec
Speakeasy regeneration with latest schema changes including type renames and new server tool models.
This commit is contained in:
@@ -349,6 +349,8 @@ if TYPE_CHECKING:
|
||||
ListModelsUserSecurityTypedDict,
|
||||
)
|
||||
from .listproviders import (
|
||||
Datacenter,
|
||||
Headquarters,
|
||||
ListProvidersData,
|
||||
ListProvidersDataTypedDict,
|
||||
ListProvidersGlobals,
|
||||
@@ -503,6 +505,7 @@ __all__ = [
|
||||
"CreateResponsesResponseBody",
|
||||
"CreateResponsesResponseBodyTypedDict",
|
||||
"CreateResponsesResponseTypedDict",
|
||||
"Datacenter",
|
||||
"DeleteGuardrailGlobals",
|
||||
"DeleteGuardrailGlobalsTypedDict",
|
||||
"DeleteGuardrailRequest",
|
||||
@@ -578,6 +581,7 @@ __all__ = [
|
||||
"GetUserActivityRequestTypedDict",
|
||||
"GetUserActivityResponse",
|
||||
"GetUserActivityResponseTypedDict",
|
||||
"Headquarters",
|
||||
"ImageURL",
|
||||
"ImageURLTypedDict",
|
||||
"Input",
|
||||
@@ -999,6 +1003,8 @@ _dynamic_imports: dict[str, str] = {
|
||||
"ListModelsUserRequestTypedDict": ".listmodelsuser",
|
||||
"ListModelsUserSecurity": ".listmodelsuser",
|
||||
"ListModelsUserSecurityTypedDict": ".listmodelsuser",
|
||||
"Datacenter": ".listproviders",
|
||||
"Headquarters": ".listproviders",
|
||||
"ListProvidersData": ".listproviders",
|
||||
"ListProvidersDataTypedDict": ".listproviders",
|
||||
"ListProvidersGlobals": ".listproviders",
|
||||
|
||||
@@ -19,10 +19,14 @@ class BulkAssignKeysToGuardrailGlobalsTypedDict(TypedDict):
|
||||
This is used to track API usage per application.
|
||||
|
||||
"""
|
||||
x_title: NotRequired[str]
|
||||
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 BulkAssignKeysToGuardrailGlobals(BaseModel):
|
||||
@@ -36,15 +40,24 @@ class BulkAssignKeysToGuardrailGlobals(BaseModel):
|
||||
|
||||
"""
|
||||
|
||||
x_title: Annotated[
|
||||
x_open_router_title: Annotated[
|
||||
Optional[str],
|
||||
pydantic.Field(alias="X-Title"),
|
||||
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 BulkAssignKeysToGuardrailRequestBodyTypedDict(TypedDict):
|
||||
key_hashes: List[str]
|
||||
@@ -65,10 +78,14 @@ class BulkAssignKeysToGuardrailRequestTypedDict(TypedDict):
|
||||
This is used to track API usage per application.
|
||||
|
||||
"""
|
||||
x_title: NotRequired[str]
|
||||
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 BulkAssignKeysToGuardrailRequest(BaseModel):
|
||||
@@ -92,15 +109,24 @@ class BulkAssignKeysToGuardrailRequest(BaseModel):
|
||||
|
||||
"""
|
||||
|
||||
x_title: Annotated[
|
||||
x_open_router_title: Annotated[
|
||||
Optional[str],
|
||||
pydantic.Field(alias="X-Title"),
|
||||
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 BulkAssignKeysToGuardrailResponseTypedDict(TypedDict):
|
||||
r"""Assignment result"""
|
||||
|
||||
@@ -19,10 +19,14 @@ class BulkAssignMembersToGuardrailGlobalsTypedDict(TypedDict):
|
||||
This is used to track API usage per application.
|
||||
|
||||
"""
|
||||
x_title: NotRequired[str]
|
||||
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 BulkAssignMembersToGuardrailGlobals(BaseModel):
|
||||
@@ -36,15 +40,24 @@ class BulkAssignMembersToGuardrailGlobals(BaseModel):
|
||||
|
||||
"""
|
||||
|
||||
x_title: Annotated[
|
||||
x_open_router_title: Annotated[
|
||||
Optional[str],
|
||||
pydantic.Field(alias="X-Title"),
|
||||
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 BulkAssignMembersToGuardrailRequestBodyTypedDict(TypedDict):
|
||||
member_user_ids: List[str]
|
||||
@@ -65,10 +78,14 @@ class BulkAssignMembersToGuardrailRequestTypedDict(TypedDict):
|
||||
This is used to track API usage per application.
|
||||
|
||||
"""
|
||||
x_title: NotRequired[str]
|
||||
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 BulkAssignMembersToGuardrailRequest(BaseModel):
|
||||
@@ -92,15 +109,24 @@ class BulkAssignMembersToGuardrailRequest(BaseModel):
|
||||
|
||||
"""
|
||||
|
||||
x_title: Annotated[
|
||||
x_open_router_title: Annotated[
|
||||
Optional[str],
|
||||
pydantic.Field(alias="X-Title"),
|
||||
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 BulkAssignMembersToGuardrailResponseTypedDict(TypedDict):
|
||||
r"""Assignment result"""
|
||||
|
||||
@@ -19,10 +19,14 @@ class BulkUnassignKeysFromGuardrailGlobalsTypedDict(TypedDict):
|
||||
This is used to track API usage per application.
|
||||
|
||||
"""
|
||||
x_title: NotRequired[str]
|
||||
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 BulkUnassignKeysFromGuardrailGlobals(BaseModel):
|
||||
@@ -36,15 +40,24 @@ class BulkUnassignKeysFromGuardrailGlobals(BaseModel):
|
||||
|
||||
"""
|
||||
|
||||
x_title: Annotated[
|
||||
x_open_router_title: Annotated[
|
||||
Optional[str],
|
||||
pydantic.Field(alias="X-Title"),
|
||||
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 BulkUnassignKeysFromGuardrailRequestBodyTypedDict(TypedDict):
|
||||
key_hashes: List[str]
|
||||
@@ -65,10 +78,14 @@ class BulkUnassignKeysFromGuardrailRequestTypedDict(TypedDict):
|
||||
This is used to track API usage per application.
|
||||
|
||||
"""
|
||||
x_title: NotRequired[str]
|
||||
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 BulkUnassignKeysFromGuardrailRequest(BaseModel):
|
||||
@@ -92,15 +109,24 @@ class BulkUnassignKeysFromGuardrailRequest(BaseModel):
|
||||
|
||||
"""
|
||||
|
||||
x_title: Annotated[
|
||||
x_open_router_title: Annotated[
|
||||
Optional[str],
|
||||
pydantic.Field(alias="X-Title"),
|
||||
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 BulkUnassignKeysFromGuardrailResponseTypedDict(TypedDict):
|
||||
r"""Unassignment result"""
|
||||
|
||||
@@ -19,10 +19,14 @@ class BulkUnassignMembersFromGuardrailGlobalsTypedDict(TypedDict):
|
||||
This is used to track API usage per application.
|
||||
|
||||
"""
|
||||
x_title: NotRequired[str]
|
||||
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 BulkUnassignMembersFromGuardrailGlobals(BaseModel):
|
||||
@@ -36,15 +40,24 @@ class BulkUnassignMembersFromGuardrailGlobals(BaseModel):
|
||||
|
||||
"""
|
||||
|
||||
x_title: Annotated[
|
||||
x_open_router_title: Annotated[
|
||||
Optional[str],
|
||||
pydantic.Field(alias="X-Title"),
|
||||
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 BulkUnassignMembersFromGuardrailRequestBodyTypedDict(TypedDict):
|
||||
member_user_ids: List[str]
|
||||
@@ -65,10 +78,14 @@ class BulkUnassignMembersFromGuardrailRequestTypedDict(TypedDict):
|
||||
This is used to track API usage per application.
|
||||
|
||||
"""
|
||||
x_title: NotRequired[str]
|
||||
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 BulkUnassignMembersFromGuardrailRequest(BaseModel):
|
||||
@@ -92,15 +109,24 @@ class BulkUnassignMembersFromGuardrailRequest(BaseModel):
|
||||
|
||||
"""
|
||||
|
||||
x_title: Annotated[
|
||||
x_open_router_title: Annotated[
|
||||
Optional[str],
|
||||
pydantic.Field(alias="X-Title"),
|
||||
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 BulkUnassignMembersFromGuardrailResponseTypedDict(TypedDict):
|
||||
r"""Unassignment result"""
|
||||
|
||||
@@ -29,10 +29,14 @@ class CreateAuthKeysCodeGlobalsTypedDict(TypedDict):
|
||||
This is used to track API usage per application.
|
||||
|
||||
"""
|
||||
x_title: NotRequired[str]
|
||||
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 CreateAuthKeysCodeGlobals(BaseModel):
|
||||
@@ -46,15 +50,24 @@ class CreateAuthKeysCodeGlobals(BaseModel):
|
||||
|
||||
"""
|
||||
|
||||
x_title: Annotated[
|
||||
x_open_router_title: Annotated[
|
||||
Optional[str],
|
||||
pydantic.Field(alias="X-Title"),
|
||||
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.
|
||||
|
||||
"""
|
||||
|
||||
|
||||
CreateAuthKeysCodeCodeChallengeMethod = Union[
|
||||
Literal[
|
||||
@@ -166,10 +179,14 @@ class CreateAuthKeysCodeRequestTypedDict(TypedDict):
|
||||
This is used to track API usage per application.
|
||||
|
||||
"""
|
||||
x_title: NotRequired[str]
|
||||
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 CreateAuthKeysCodeRequest(BaseModel):
|
||||
@@ -188,15 +205,24 @@ class CreateAuthKeysCodeRequest(BaseModel):
|
||||
|
||||
"""
|
||||
|
||||
x_title: Annotated[
|
||||
x_open_router_title: Annotated[
|
||||
Optional[str],
|
||||
pydantic.Field(alias="X-Title"),
|
||||
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 CreateAuthKeysCodeDataTypedDict(TypedDict):
|
||||
r"""Auth code data"""
|
||||
|
||||
@@ -20,10 +20,14 @@ class CreateCoinbaseChargeGlobalsTypedDict(TypedDict):
|
||||
This is used to track API usage per application.
|
||||
|
||||
"""
|
||||
x_title: NotRequired[str]
|
||||
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 CreateCoinbaseChargeGlobals(BaseModel):
|
||||
@@ -37,15 +41,24 @@ class CreateCoinbaseChargeGlobals(BaseModel):
|
||||
|
||||
"""
|
||||
|
||||
x_title: Annotated[
|
||||
x_open_router_title: Annotated[
|
||||
Optional[str],
|
||||
pydantic.Field(alias="X-Title"),
|
||||
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 CreateCoinbaseChargeSecurityTypedDict(TypedDict):
|
||||
bearer: str
|
||||
@@ -72,10 +85,14 @@ class CreateCoinbaseChargeRequestTypedDict(TypedDict):
|
||||
This is used to track API usage per application.
|
||||
|
||||
"""
|
||||
x_title: NotRequired[str]
|
||||
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 CreateCoinbaseChargeRequest(BaseModel):
|
||||
@@ -94,15 +111,24 @@ class CreateCoinbaseChargeRequest(BaseModel):
|
||||
|
||||
"""
|
||||
|
||||
x_title: Annotated[
|
||||
x_open_router_title: Annotated[
|
||||
Optional[str],
|
||||
pydantic.Field(alias="X-Title"),
|
||||
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 CallDataTypedDict(TypedDict):
|
||||
deadline: str
|
||||
|
||||
@@ -23,10 +23,14 @@ class CreateEmbeddingsGlobalsTypedDict(TypedDict):
|
||||
This is used to track API usage per application.
|
||||
|
||||
"""
|
||||
x_title: NotRequired[str]
|
||||
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 CreateEmbeddingsGlobals(BaseModel):
|
||||
@@ -40,15 +44,24 @@ class CreateEmbeddingsGlobals(BaseModel):
|
||||
|
||||
"""
|
||||
|
||||
x_title: Annotated[
|
||||
x_open_router_title: Annotated[
|
||||
Optional[str],
|
||||
pydantic.Field(alias="X-Title"),
|
||||
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.
|
||||
|
||||
"""
|
||||
|
||||
|
||||
TypeImageURL = Literal["image_url",]
|
||||
|
||||
@@ -165,10 +178,14 @@ class CreateEmbeddingsRequestTypedDict(TypedDict):
|
||||
This is used to track API usage per application.
|
||||
|
||||
"""
|
||||
x_title: NotRequired[str]
|
||||
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 CreateEmbeddingsRequest(BaseModel):
|
||||
@@ -187,15 +204,24 @@ class CreateEmbeddingsRequest(BaseModel):
|
||||
|
||||
"""
|
||||
|
||||
x_title: Annotated[
|
||||
x_open_router_title: Annotated[
|
||||
Optional[str],
|
||||
pydantic.Field(alias="X-Title"),
|
||||
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.
|
||||
|
||||
"""
|
||||
|
||||
|
||||
Object = Literal["list",]
|
||||
|
||||
|
||||
@@ -28,10 +28,14 @@ class CreateGuardrailGlobalsTypedDict(TypedDict):
|
||||
This is used to track API usage per application.
|
||||
|
||||
"""
|
||||
x_title: NotRequired[str]
|
||||
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 CreateGuardrailGlobals(BaseModel):
|
||||
@@ -45,15 +49,24 @@ class CreateGuardrailGlobals(BaseModel):
|
||||
|
||||
"""
|
||||
|
||||
x_title: Annotated[
|
||||
x_open_router_title: Annotated[
|
||||
Optional[str],
|
||||
pydantic.Field(alias="X-Title"),
|
||||
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.
|
||||
|
||||
"""
|
||||
|
||||
|
||||
CreateGuardrailResetIntervalRequest = Union[
|
||||
Literal[
|
||||
@@ -77,6 +90,8 @@ class CreateGuardrailRequestBodyTypedDict(TypedDict):
|
||||
r"""Interval at which the limit resets (daily, weekly, monthly)"""
|
||||
allowed_providers: NotRequired[Nullable[List[str]]]
|
||||
r"""List of allowed provider IDs"""
|
||||
ignored_providers: NotRequired[Nullable[List[str]]]
|
||||
r"""List of provider IDs to exclude from routing"""
|
||||
allowed_models: NotRequired[Nullable[List[str]]]
|
||||
r"""Array of model identifiers (slug or canonical_slug accepted)"""
|
||||
enforce_zdr: NotRequired[Nullable[bool]]
|
||||
@@ -102,6 +117,9 @@ class CreateGuardrailRequestBody(BaseModel):
|
||||
allowed_providers: OptionalNullable[List[str]] = UNSET
|
||||
r"""List of allowed provider IDs"""
|
||||
|
||||
ignored_providers: OptionalNullable[List[str]] = UNSET
|
||||
r"""List of provider IDs to exclude from routing"""
|
||||
|
||||
allowed_models: OptionalNullable[List[str]] = UNSET
|
||||
r"""Array of model identifiers (slug or canonical_slug accepted)"""
|
||||
|
||||
@@ -115,6 +133,7 @@ class CreateGuardrailRequestBody(BaseModel):
|
||||
"limit_usd",
|
||||
"reset_interval",
|
||||
"allowed_providers",
|
||||
"ignored_providers",
|
||||
"allowed_models",
|
||||
"enforce_zdr",
|
||||
]
|
||||
@@ -123,6 +142,7 @@ class CreateGuardrailRequestBody(BaseModel):
|
||||
"limit_usd",
|
||||
"reset_interval",
|
||||
"allowed_providers",
|
||||
"ignored_providers",
|
||||
"allowed_models",
|
||||
"enforce_zdr",
|
||||
]
|
||||
@@ -160,10 +180,14 @@ class CreateGuardrailRequestTypedDict(TypedDict):
|
||||
This is used to track API usage per application.
|
||||
|
||||
"""
|
||||
x_title: NotRequired[str]
|
||||
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 CreateGuardrailRequest(BaseModel):
|
||||
@@ -182,15 +206,24 @@ class CreateGuardrailRequest(BaseModel):
|
||||
|
||||
"""
|
||||
|
||||
x_title: Annotated[
|
||||
x_open_router_title: Annotated[
|
||||
Optional[str],
|
||||
pydantic.Field(alias="X-Title"),
|
||||
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.
|
||||
|
||||
"""
|
||||
|
||||
|
||||
CreateGuardrailResetIntervalResponse = Union[
|
||||
Literal[
|
||||
@@ -220,6 +253,8 @@ class CreateGuardrailDataTypedDict(TypedDict):
|
||||
r"""Interval at which the limit resets (daily, weekly, monthly)"""
|
||||
allowed_providers: NotRequired[Nullable[List[str]]]
|
||||
r"""List of allowed provider IDs"""
|
||||
ignored_providers: NotRequired[Nullable[List[str]]]
|
||||
r"""List of provider IDs to exclude from routing"""
|
||||
allowed_models: NotRequired[Nullable[List[str]]]
|
||||
r"""Array of model canonical_slugs (immutable identifiers)"""
|
||||
enforce_zdr: NotRequired[Nullable[bool]]
|
||||
@@ -255,6 +290,9 @@ class CreateGuardrailData(BaseModel):
|
||||
allowed_providers: OptionalNullable[List[str]] = UNSET
|
||||
r"""List of allowed provider IDs"""
|
||||
|
||||
ignored_providers: OptionalNullable[List[str]] = UNSET
|
||||
r"""List of provider IDs to exclude from routing"""
|
||||
|
||||
allowed_models: OptionalNullable[List[str]] = UNSET
|
||||
r"""Array of model canonical_slugs (immutable identifiers)"""
|
||||
|
||||
@@ -271,6 +309,7 @@ class CreateGuardrailData(BaseModel):
|
||||
"limit_usd",
|
||||
"reset_interval",
|
||||
"allowed_providers",
|
||||
"ignored_providers",
|
||||
"allowed_models",
|
||||
"enforce_zdr",
|
||||
"updated_at",
|
||||
@@ -280,6 +319,7 @@ class CreateGuardrailData(BaseModel):
|
||||
"limit_usd",
|
||||
"reset_interval",
|
||||
"allowed_providers",
|
||||
"ignored_providers",
|
||||
"allowed_models",
|
||||
"enforce_zdr",
|
||||
"updated_at",
|
||||
|
||||
@@ -29,10 +29,14 @@ class CreateKeysGlobalsTypedDict(TypedDict):
|
||||
This is used to track API usage per application.
|
||||
|
||||
"""
|
||||
x_title: NotRequired[str]
|
||||
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 CreateKeysGlobals(BaseModel):
|
||||
@@ -46,15 +50,24 @@ class CreateKeysGlobals(BaseModel):
|
||||
|
||||
"""
|
||||
|
||||
x_title: Annotated[
|
||||
x_open_router_title: Annotated[
|
||||
Optional[str],
|
||||
pydantic.Field(alias="X-Title"),
|
||||
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.
|
||||
|
||||
"""
|
||||
|
||||
|
||||
CreateKeysLimitReset = Union[
|
||||
Literal[
|
||||
@@ -142,10 +155,14 @@ class CreateKeysRequestTypedDict(TypedDict):
|
||||
This is used to track API usage per application.
|
||||
|
||||
"""
|
||||
x_title: NotRequired[str]
|
||||
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 CreateKeysRequest(BaseModel):
|
||||
@@ -164,15 +181,24 @@ class CreateKeysRequest(BaseModel):
|
||||
|
||||
"""
|
||||
|
||||
x_title: Annotated[
|
||||
x_open_router_title: Annotated[
|
||||
Optional[str],
|
||||
pydantic.Field(alias="X-Title"),
|
||||
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 CreateKeysDataTypedDict(TypedDict):
|
||||
r"""The created API key information"""
|
||||
@@ -213,6 +239,8 @@ class CreateKeysDataTypedDict(TypedDict):
|
||||
r"""ISO 8601 timestamp of when the API key was created"""
|
||||
updated_at: Nullable[str]
|
||||
r"""ISO 8601 timestamp of when the API key was last updated"""
|
||||
creator_user_id: Nullable[str]
|
||||
r"""The user ID of the key creator. For organization-owned keys, this is the member who created the key. For individual users, this is the user's own ID."""
|
||||
expires_at: NotRequired[Nullable[datetime]]
|
||||
r"""ISO 8601 UTC timestamp when the API key expires, or null if no expiration"""
|
||||
|
||||
@@ -274,6 +302,9 @@ class CreateKeysData(BaseModel):
|
||||
updated_at: Nullable[str]
|
||||
r"""ISO 8601 timestamp of when the API key was last updated"""
|
||||
|
||||
creator_user_id: Nullable[str]
|
||||
r"""The user ID of the key creator. For organization-owned keys, this is the member who created the key. For individual users, this is the user's own ID."""
|
||||
|
||||
expires_at: OptionalNullable[datetime] = UNSET
|
||||
r"""ISO 8601 UTC timestamp when the API key expires, or null if no expiration"""
|
||||
|
||||
@@ -286,6 +317,7 @@ class CreateKeysData(BaseModel):
|
||||
"limit_reset",
|
||||
"updated_at",
|
||||
"expires_at",
|
||||
"creator_user_id",
|
||||
]
|
||||
null_default_fields = []
|
||||
|
||||
|
||||
@@ -2,9 +2,9 @@
|
||||
|
||||
from __future__ import annotations
|
||||
from openrouter.components import (
|
||||
openresponsesnonstreamingresponse as components_openresponsesnonstreamingresponse,
|
||||
openresponsesrequest as components_openresponsesrequest,
|
||||
openresponsesstreamevent as components_openresponsesstreamevent,
|
||||
openresponsesresult as components_openresponsesresult,
|
||||
responsesrequest as components_responsesrequest,
|
||||
streamevents as components_streamevents,
|
||||
)
|
||||
from openrouter.types import BaseModel
|
||||
from openrouter.utils import (
|
||||
@@ -24,10 +24,14 @@ class CreateResponsesGlobalsTypedDict(TypedDict):
|
||||
This is used to track API usage per application.
|
||||
|
||||
"""
|
||||
x_title: NotRequired[str]
|
||||
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 CreateResponsesGlobals(BaseModel):
|
||||
@@ -41,34 +45,45 @@ class CreateResponsesGlobals(BaseModel):
|
||||
|
||||
"""
|
||||
|
||||
x_title: Annotated[
|
||||
x_open_router_title: Annotated[
|
||||
Optional[str],
|
||||
pydantic.Field(alias="X-Title"),
|
||||
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 CreateResponsesRequestTypedDict(TypedDict):
|
||||
open_responses_request: (
|
||||
components_openresponsesrequest.OpenResponsesRequestTypedDict
|
||||
)
|
||||
responses_request: components_responsesrequest.ResponsesRequestTypedDict
|
||||
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_title: NotRequired[str]
|
||||
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 CreateResponsesRequest(BaseModel):
|
||||
open_responses_request: Annotated[
|
||||
components_openresponsesrequest.OpenResponsesRequest,
|
||||
responses_request: Annotated[
|
||||
components_responsesrequest.ResponsesRequest,
|
||||
FieldMetadata(request=RequestMetadata(media_type="application/json")),
|
||||
]
|
||||
|
||||
@@ -82,40 +97,47 @@ class CreateResponsesRequest(BaseModel):
|
||||
|
||||
"""
|
||||
|
||||
x_title: Annotated[
|
||||
x_open_router_title: Annotated[
|
||||
Optional[str],
|
||||
pydantic.Field(alias="X-Title"),
|
||||
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 CreateResponsesResponseBodyTypedDict(TypedDict):
|
||||
r"""Successful response"""
|
||||
|
||||
data: components_openresponsesstreamevent.OpenResponsesStreamEventTypedDict
|
||||
data: components_streamevents.StreamEventsTypedDict
|
||||
r"""Union of all possible event types emitted during response streaming"""
|
||||
|
||||
|
||||
class CreateResponsesResponseBody(BaseModel):
|
||||
r"""Successful response"""
|
||||
|
||||
data: components_openresponsesstreamevent.OpenResponsesStreamEvent
|
||||
data: components_streamevents.StreamEvents
|
||||
r"""Union of all possible event types emitted during response streaming"""
|
||||
|
||||
|
||||
CreateResponsesResponseTypedDict = TypeAliasType(
|
||||
"CreateResponsesResponseTypedDict",
|
||||
Union[
|
||||
components_openresponsesnonstreamingresponse.OpenResponsesNonStreamingResponseTypedDict,
|
||||
components_openresponsesresult.OpenResponsesResultTypedDict,
|
||||
Union[
|
||||
eventstreaming.EventStream[
|
||||
components_openresponsesstreamevent.OpenResponsesStreamEventTypedDict
|
||||
],
|
||||
eventstreaming.EventStream[components_streamevents.StreamEventsTypedDict],
|
||||
eventstreaming.EventStreamAsync[
|
||||
components_openresponsesstreamevent.OpenResponsesStreamEventTypedDict
|
||||
components_streamevents.StreamEventsTypedDict
|
||||
],
|
||||
],
|
||||
],
|
||||
@@ -125,14 +147,10 @@ CreateResponsesResponseTypedDict = TypeAliasType(
|
||||
CreateResponsesResponse = TypeAliasType(
|
||||
"CreateResponsesResponse",
|
||||
Union[
|
||||
components_openresponsesnonstreamingresponse.OpenResponsesNonStreamingResponse,
|
||||
components_openresponsesresult.OpenResponsesResult,
|
||||
Union[
|
||||
eventstreaming.EventStream[
|
||||
components_openresponsesstreamevent.OpenResponsesStreamEvent
|
||||
],
|
||||
eventstreaming.EventStreamAsync[
|
||||
components_openresponsesstreamevent.OpenResponsesStreamEvent
|
||||
],
|
||||
eventstreaming.EventStream[components_streamevents.StreamEvents],
|
||||
eventstreaming.EventStreamAsync[components_streamevents.StreamEvents],
|
||||
],
|
||||
],
|
||||
)
|
||||
|
||||
@@ -20,10 +20,14 @@ class DeleteGuardrailGlobalsTypedDict(TypedDict):
|
||||
This is used to track API usage per application.
|
||||
|
||||
"""
|
||||
x_title: NotRequired[str]
|
||||
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 DeleteGuardrailGlobals(BaseModel):
|
||||
@@ -37,15 +41,24 @@ class DeleteGuardrailGlobals(BaseModel):
|
||||
|
||||
"""
|
||||
|
||||
x_title: Annotated[
|
||||
x_open_router_title: Annotated[
|
||||
Optional[str],
|
||||
pydantic.Field(alias="X-Title"),
|
||||
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 DeleteGuardrailRequestTypedDict(TypedDict):
|
||||
id: str
|
||||
@@ -55,10 +68,14 @@ class DeleteGuardrailRequestTypedDict(TypedDict):
|
||||
This is used to track API usage per application.
|
||||
|
||||
"""
|
||||
x_title: NotRequired[str]
|
||||
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 DeleteGuardrailRequest(BaseModel):
|
||||
@@ -77,15 +94,24 @@ class DeleteGuardrailRequest(BaseModel):
|
||||
|
||||
"""
|
||||
|
||||
x_title: Annotated[
|
||||
x_open_router_title: Annotated[
|
||||
Optional[str],
|
||||
pydantic.Field(alias="X-Title"),
|
||||
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 DeleteGuardrailResponseTypedDict(TypedDict):
|
||||
r"""Guardrail deleted successfully"""
|
||||
|
||||
@@ -20,10 +20,14 @@ class DeleteKeysGlobalsTypedDict(TypedDict):
|
||||
This is used to track API usage per application.
|
||||
|
||||
"""
|
||||
x_title: NotRequired[str]
|
||||
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 DeleteKeysGlobals(BaseModel):
|
||||
@@ -37,15 +41,24 @@ class DeleteKeysGlobals(BaseModel):
|
||||
|
||||
"""
|
||||
|
||||
x_title: Annotated[
|
||||
x_open_router_title: Annotated[
|
||||
Optional[str],
|
||||
pydantic.Field(alias="X-Title"),
|
||||
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 DeleteKeysRequestTypedDict(TypedDict):
|
||||
hash: str
|
||||
@@ -55,10 +68,14 @@ class DeleteKeysRequestTypedDict(TypedDict):
|
||||
This is used to track API usage per application.
|
||||
|
||||
"""
|
||||
x_title: NotRequired[str]
|
||||
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 DeleteKeysRequest(BaseModel):
|
||||
@@ -77,15 +94,24 @@ class DeleteKeysRequest(BaseModel):
|
||||
|
||||
"""
|
||||
|
||||
x_title: Annotated[
|
||||
x_open_router_title: Annotated[
|
||||
Optional[str],
|
||||
pydantic.Field(alias="X-Title"),
|
||||
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 DeleteKeysResponseTypedDict(TypedDict):
|
||||
r"""API key deleted successfully"""
|
||||
|
||||
@@ -28,10 +28,14 @@ class ExchangeAuthCodeForAPIKeyGlobalsTypedDict(TypedDict):
|
||||
This is used to track API usage per application.
|
||||
|
||||
"""
|
||||
x_title: NotRequired[str]
|
||||
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 ExchangeAuthCodeForAPIKeyGlobals(BaseModel):
|
||||
@@ -45,15 +49,24 @@ class ExchangeAuthCodeForAPIKeyGlobals(BaseModel):
|
||||
|
||||
"""
|
||||
|
||||
x_title: Annotated[
|
||||
x_open_router_title: Annotated[
|
||||
Optional[str],
|
||||
pydantic.Field(alias="X-Title"),
|
||||
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.
|
||||
|
||||
"""
|
||||
|
||||
|
||||
ExchangeAuthCodeForAPIKeyCodeChallengeMethod = Union[
|
||||
Literal[
|
||||
@@ -127,10 +140,14 @@ class ExchangeAuthCodeForAPIKeyRequestTypedDict(TypedDict):
|
||||
This is used to track API usage per application.
|
||||
|
||||
"""
|
||||
x_title: NotRequired[str]
|
||||
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 ExchangeAuthCodeForAPIKeyRequest(BaseModel):
|
||||
@@ -149,15 +166,24 @@ class ExchangeAuthCodeForAPIKeyRequest(BaseModel):
|
||||
|
||||
"""
|
||||
|
||||
x_title: Annotated[
|
||||
x_open_router_title: Annotated[
|
||||
Optional[str],
|
||||
pydantic.Field(alias="X-Title"),
|
||||
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 ExchangeAuthCodeForAPIKeyResponseTypedDict(TypedDict):
|
||||
r"""Successfully exchanged code for an API key"""
|
||||
|
||||
@@ -14,10 +14,14 @@ class GetCreditsGlobalsTypedDict(TypedDict):
|
||||
This is used to track API usage per application.
|
||||
|
||||
"""
|
||||
x_title: NotRequired[str]
|
||||
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 GetCreditsGlobals(BaseModel):
|
||||
@@ -31,15 +35,24 @@ class GetCreditsGlobals(BaseModel):
|
||||
|
||||
"""
|
||||
|
||||
x_title: Annotated[
|
||||
x_open_router_title: Annotated[
|
||||
Optional[str],
|
||||
pydantic.Field(alias="X-Title"),
|
||||
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 GetCreditsRequestTypedDict(TypedDict):
|
||||
http_referer: NotRequired[str]
|
||||
@@ -47,10 +60,14 @@ class GetCreditsRequestTypedDict(TypedDict):
|
||||
This is used to track API usage per application.
|
||||
|
||||
"""
|
||||
x_title: NotRequired[str]
|
||||
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 GetCreditsRequest(BaseModel):
|
||||
@@ -64,15 +81,24 @@ class GetCreditsRequest(BaseModel):
|
||||
|
||||
"""
|
||||
|
||||
x_title: Annotated[
|
||||
x_open_router_title: Annotated[
|
||||
Optional[str],
|
||||
pydantic.Field(alias="X-Title"),
|
||||
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 GetCreditsDataTypedDict(TypedDict):
|
||||
total_credits: float
|
||||
|
||||
@@ -22,10 +22,14 @@ class GetCurrentKeyGlobalsTypedDict(TypedDict):
|
||||
This is used to track API usage per application.
|
||||
|
||||
"""
|
||||
x_title: NotRequired[str]
|
||||
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 GetCurrentKeyGlobals(BaseModel):
|
||||
@@ -39,15 +43,24 @@ class GetCurrentKeyGlobals(BaseModel):
|
||||
|
||||
"""
|
||||
|
||||
x_title: Annotated[
|
||||
x_open_router_title: Annotated[
|
||||
Optional[str],
|
||||
pydantic.Field(alias="X-Title"),
|
||||
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 GetCurrentKeyRequestTypedDict(TypedDict):
|
||||
http_referer: NotRequired[str]
|
||||
@@ -55,10 +68,14 @@ class GetCurrentKeyRequestTypedDict(TypedDict):
|
||||
This is used to track API usage per application.
|
||||
|
||||
"""
|
||||
x_title: NotRequired[str]
|
||||
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 GetCurrentKeyRequest(BaseModel):
|
||||
@@ -72,15 +89,24 @@ class GetCurrentKeyRequest(BaseModel):
|
||||
|
||||
"""
|
||||
|
||||
x_title: Annotated[
|
||||
x_open_router_title: Annotated[
|
||||
Optional[str],
|
||||
pydantic.Field(alias="X-Title"),
|
||||
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.
|
||||
|
||||
"""
|
||||
|
||||
|
||||
@deprecated(
|
||||
"warning: ** DEPRECATED ** - This will be removed in a future release, please migrate away from it as soon as possible."
|
||||
@@ -147,6 +173,8 @@ class GetCurrentKeyDataTypedDict(TypedDict):
|
||||
r"""Type of limit reset for the API key"""
|
||||
include_byok_in_limit: bool
|
||||
r"""Whether to include external BYOK usage in the credit limit"""
|
||||
creator_user_id: Nullable[str]
|
||||
r"""The user ID of the key creator. For organization-owned keys, this is the member who created the key. For individual users, this is the user's own ID."""
|
||||
rate_limit: RateLimitTypedDict
|
||||
r"""Legacy rate limit information about a key. Will always return -1."""
|
||||
expires_at: NotRequired[Nullable[datetime]]
|
||||
@@ -209,6 +237,9 @@ class GetCurrentKeyData(BaseModel):
|
||||
include_byok_in_limit: bool
|
||||
r"""Whether to include external BYOK usage in the credit limit"""
|
||||
|
||||
creator_user_id: Nullable[str]
|
||||
r"""The user ID of the key creator. For organization-owned keys, this is the member who created the key. For individual users, this is the user's own ID."""
|
||||
|
||||
rate_limit: Annotated[
|
||||
RateLimit,
|
||||
pydantic.Field(
|
||||
@@ -223,7 +254,13 @@ class GetCurrentKeyData(BaseModel):
|
||||
@model_serializer(mode="wrap")
|
||||
def serialize_model(self, handler):
|
||||
optional_fields = ["expires_at"]
|
||||
nullable_fields = ["limit", "limit_remaining", "limit_reset", "expires_at"]
|
||||
nullable_fields = [
|
||||
"limit",
|
||||
"limit_remaining",
|
||||
"limit_reset",
|
||||
"expires_at",
|
||||
"creator_user_id",
|
||||
]
|
||||
null_default_fields = []
|
||||
|
||||
serialized = handler(self)
|
||||
|
||||
@@ -21,10 +21,14 @@ class GetGenerationGlobalsTypedDict(TypedDict):
|
||||
This is used to track API usage per application.
|
||||
|
||||
"""
|
||||
x_title: NotRequired[str]
|
||||
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 GetGenerationGlobals(BaseModel):
|
||||
@@ -38,15 +42,24 @@ class GetGenerationGlobals(BaseModel):
|
||||
|
||||
"""
|
||||
|
||||
x_title: Annotated[
|
||||
x_open_router_title: Annotated[
|
||||
Optional[str],
|
||||
pydantic.Field(alias="X-Title"),
|
||||
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 GetGenerationRequestTypedDict(TypedDict):
|
||||
id: str
|
||||
@@ -55,10 +68,14 @@ class GetGenerationRequestTypedDict(TypedDict):
|
||||
This is used to track API usage per application.
|
||||
|
||||
"""
|
||||
x_title: NotRequired[str]
|
||||
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 GetGenerationRequest(BaseModel):
|
||||
@@ -76,20 +93,30 @@ class GetGenerationRequest(BaseModel):
|
||||
|
||||
"""
|
||||
|
||||
x_title: Annotated[
|
||||
x_open_router_title: Annotated[
|
||||
Optional[str],
|
||||
pydantic.Field(alias="X-Title"),
|
||||
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.
|
||||
|
||||
"""
|
||||
|
||||
|
||||
APIType = Union[
|
||||
Literal[
|
||||
"completions",
|
||||
"embeddings",
|
||||
"video",
|
||||
],
|
||||
UnrecognizedStr,
|
||||
]
|
||||
@@ -126,6 +153,7 @@ ProviderName = Union[
|
||||
"Together 2",
|
||||
"Ubicloud",
|
||||
"01.AI",
|
||||
"AkashML",
|
||||
"AI21",
|
||||
"AionLabs",
|
||||
"Alibaba",
|
||||
@@ -183,6 +211,7 @@ ProviderName = Union[
|
||||
"Parasail",
|
||||
"Perplexity",
|
||||
"Phala",
|
||||
"Reka",
|
||||
"Relace",
|
||||
"SambaNova",
|
||||
"Seed",
|
||||
@@ -341,6 +370,10 @@ class GetGenerationDataTypedDict(TypedDict):
|
||||
r"""Router used for the request (e.g., openrouter/auto)"""
|
||||
provider_responses: Nullable[List[ProviderResponseTypedDict]]
|
||||
r"""List of provider responses for this generation, including fallback attempts"""
|
||||
user_agent: Nullable[str]
|
||||
r"""User-Agent header from the request"""
|
||||
http_referer: Nullable[str]
|
||||
r"""Referer header from the request"""
|
||||
|
||||
|
||||
class GetGenerationData(BaseModel):
|
||||
@@ -448,6 +481,12 @@ class GetGenerationData(BaseModel):
|
||||
provider_responses: Nullable[List[ProviderResponse]]
|
||||
r"""List of provider responses for this generation, including fallback attempts"""
|
||||
|
||||
user_agent: Nullable[str]
|
||||
r"""User-Agent header from the request"""
|
||||
|
||||
http_referer: Nullable[str]
|
||||
r"""Referer header from the request"""
|
||||
|
||||
@model_serializer(mode="wrap")
|
||||
def serialize_model(self, handler):
|
||||
optional_fields = []
|
||||
@@ -479,6 +518,8 @@ class GetGenerationData(BaseModel):
|
||||
"api_type",
|
||||
"router",
|
||||
"provider_responses",
|
||||
"user_agent",
|
||||
"http_referer",
|
||||
]
|
||||
null_default_fields = []
|
||||
|
||||
|
||||
@@ -28,10 +28,14 @@ class GetGuardrailGlobalsTypedDict(TypedDict):
|
||||
This is used to track API usage per application.
|
||||
|
||||
"""
|
||||
x_title: NotRequired[str]
|
||||
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 GetGuardrailGlobals(BaseModel):
|
||||
@@ -45,15 +49,24 @@ class GetGuardrailGlobals(BaseModel):
|
||||
|
||||
"""
|
||||
|
||||
x_title: Annotated[
|
||||
x_open_router_title: Annotated[
|
||||
Optional[str],
|
||||
pydantic.Field(alias="X-Title"),
|
||||
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 GetGuardrailRequestTypedDict(TypedDict):
|
||||
id: str
|
||||
@@ -63,10 +76,14 @@ class GetGuardrailRequestTypedDict(TypedDict):
|
||||
This is used to track API usage per application.
|
||||
|
||||
"""
|
||||
x_title: NotRequired[str]
|
||||
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 GetGuardrailRequest(BaseModel):
|
||||
@@ -85,15 +102,24 @@ class GetGuardrailRequest(BaseModel):
|
||||
|
||||
"""
|
||||
|
||||
x_title: Annotated[
|
||||
x_open_router_title: Annotated[
|
||||
Optional[str],
|
||||
pydantic.Field(alias="X-Title"),
|
||||
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.
|
||||
|
||||
"""
|
||||
|
||||
|
||||
GetGuardrailResetInterval = Union[
|
||||
Literal[
|
||||
@@ -123,6 +149,8 @@ class GetGuardrailDataTypedDict(TypedDict):
|
||||
r"""Interval at which the limit resets (daily, weekly, monthly)"""
|
||||
allowed_providers: NotRequired[Nullable[List[str]]]
|
||||
r"""List of allowed provider IDs"""
|
||||
ignored_providers: NotRequired[Nullable[List[str]]]
|
||||
r"""List of provider IDs to exclude from routing"""
|
||||
allowed_models: NotRequired[Nullable[List[str]]]
|
||||
r"""Array of model canonical_slugs (immutable identifiers)"""
|
||||
enforce_zdr: NotRequired[Nullable[bool]]
|
||||
@@ -158,6 +186,9 @@ class GetGuardrailData(BaseModel):
|
||||
allowed_providers: OptionalNullable[List[str]] = UNSET
|
||||
r"""List of allowed provider IDs"""
|
||||
|
||||
ignored_providers: OptionalNullable[List[str]] = UNSET
|
||||
r"""List of provider IDs to exclude from routing"""
|
||||
|
||||
allowed_models: OptionalNullable[List[str]] = UNSET
|
||||
r"""Array of model canonical_slugs (immutable identifiers)"""
|
||||
|
||||
@@ -174,6 +205,7 @@ class GetGuardrailData(BaseModel):
|
||||
"limit_usd",
|
||||
"reset_interval",
|
||||
"allowed_providers",
|
||||
"ignored_providers",
|
||||
"allowed_models",
|
||||
"enforce_zdr",
|
||||
"updated_at",
|
||||
@@ -183,6 +215,7 @@ class GetGuardrailData(BaseModel):
|
||||
"limit_usd",
|
||||
"reset_interval",
|
||||
"allowed_providers",
|
||||
"ignored_providers",
|
||||
"allowed_models",
|
||||
"enforce_zdr",
|
||||
"updated_at",
|
||||
|
||||
@@ -22,10 +22,14 @@ class GetKeyGlobalsTypedDict(TypedDict):
|
||||
This is used to track API usage per application.
|
||||
|
||||
"""
|
||||
x_title: NotRequired[str]
|
||||
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 GetKeyGlobals(BaseModel):
|
||||
@@ -39,15 +43,24 @@ class GetKeyGlobals(BaseModel):
|
||||
|
||||
"""
|
||||
|
||||
x_title: Annotated[
|
||||
x_open_router_title: Annotated[
|
||||
Optional[str],
|
||||
pydantic.Field(alias="X-Title"),
|
||||
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 GetKeyRequestTypedDict(TypedDict):
|
||||
hash: str
|
||||
@@ -57,10 +70,14 @@ class GetKeyRequestTypedDict(TypedDict):
|
||||
This is used to track API usage per application.
|
||||
|
||||
"""
|
||||
x_title: NotRequired[str]
|
||||
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 GetKeyRequest(BaseModel):
|
||||
@@ -79,15 +96,24 @@ class GetKeyRequest(BaseModel):
|
||||
|
||||
"""
|
||||
|
||||
x_title: Annotated[
|
||||
x_open_router_title: Annotated[
|
||||
Optional[str],
|
||||
pydantic.Field(alias="X-Title"),
|
||||
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 GetKeyDataTypedDict(TypedDict):
|
||||
r"""The API key information"""
|
||||
@@ -128,6 +154,8 @@ class GetKeyDataTypedDict(TypedDict):
|
||||
r"""ISO 8601 timestamp of when the API key was created"""
|
||||
updated_at: Nullable[str]
|
||||
r"""ISO 8601 timestamp of when the API key was last updated"""
|
||||
creator_user_id: Nullable[str]
|
||||
r"""The user ID of the key creator. For organization-owned keys, this is the member who created the key. For individual users, this is the user's own ID."""
|
||||
expires_at: NotRequired[Nullable[datetime]]
|
||||
r"""ISO 8601 UTC timestamp when the API key expires, or null if no expiration"""
|
||||
|
||||
@@ -189,6 +217,9 @@ class GetKeyData(BaseModel):
|
||||
updated_at: Nullable[str]
|
||||
r"""ISO 8601 timestamp of when the API key was last updated"""
|
||||
|
||||
creator_user_id: Nullable[str]
|
||||
r"""The user ID of the key creator. For organization-owned keys, this is the member who created the key. For individual users, this is the user's own ID."""
|
||||
|
||||
expires_at: OptionalNullable[datetime] = UNSET
|
||||
r"""ISO 8601 UTC timestamp when the API key expires, or null if no expiration"""
|
||||
|
||||
@@ -201,6 +232,7 @@ class GetKeyData(BaseModel):
|
||||
"limit_reset",
|
||||
"updated_at",
|
||||
"expires_at",
|
||||
"creator_user_id",
|
||||
]
|
||||
null_default_fields = []
|
||||
|
||||
|
||||
@@ -20,10 +20,14 @@ class GetModelsGlobalsTypedDict(TypedDict):
|
||||
This is used to track API usage per application.
|
||||
|
||||
"""
|
||||
x_title: NotRequired[str]
|
||||
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 GetModelsGlobals(BaseModel):
|
||||
@@ -37,15 +41,24 @@ class GetModelsGlobals(BaseModel):
|
||||
|
||||
"""
|
||||
|
||||
x_title: Annotated[
|
||||
x_open_router_title: Annotated[
|
||||
Optional[str],
|
||||
pydantic.Field(alias="X-Title"),
|
||||
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.
|
||||
|
||||
"""
|
||||
|
||||
|
||||
Category = Union[
|
||||
Literal[
|
||||
@@ -73,13 +86,19 @@ class GetModelsRequestTypedDict(TypedDict):
|
||||
This is used to track API usage per application.
|
||||
|
||||
"""
|
||||
x_title: NotRequired[str]
|
||||
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.
|
||||
|
||||
"""
|
||||
category: NotRequired[Category]
|
||||
r"""Filter models by use case category"""
|
||||
supported_parameters: NotRequired[str]
|
||||
output_modalities: NotRequired[str]
|
||||
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\"."""
|
||||
|
||||
|
||||
class GetModelsRequest(BaseModel):
|
||||
@@ -93,15 +112,24 @@ class GetModelsRequest(BaseModel):
|
||||
|
||||
"""
|
||||
|
||||
x_title: Annotated[
|
||||
x_open_router_title: Annotated[
|
||||
Optional[str],
|
||||
pydantic.Field(alias="X-Title"),
|
||||
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.
|
||||
|
||||
"""
|
||||
|
||||
category: Annotated[
|
||||
Annotated[Optional[Category], PlainValidator(validate_open_enum(False))],
|
||||
FieldMetadata(query=QueryParamMetadata(style="form", explode=True)),
|
||||
@@ -112,3 +140,9 @@ class GetModelsRequest(BaseModel):
|
||||
Optional[str],
|
||||
FieldMetadata(query=QueryParamMetadata(style="form", explode=True)),
|
||||
] = None
|
||||
|
||||
output_modalities: Annotated[
|
||||
Optional[str],
|
||||
FieldMetadata(query=QueryParamMetadata(style="form", explode=True)),
|
||||
] = None
|
||||
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\"."""
|
||||
|
||||
@@ -15,10 +15,14 @@ class GetUserActivityGlobalsTypedDict(TypedDict):
|
||||
This is used to track API usage per application.
|
||||
|
||||
"""
|
||||
x_title: NotRequired[str]
|
||||
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 GetUserActivityGlobals(BaseModel):
|
||||
@@ -32,15 +36,24 @@ class GetUserActivityGlobals(BaseModel):
|
||||
|
||||
"""
|
||||
|
||||
x_title: Annotated[
|
||||
x_open_router_title: Annotated[
|
||||
Optional[str],
|
||||
pydantic.Field(alias="X-Title"),
|
||||
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 GetUserActivityRequestTypedDict(TypedDict):
|
||||
http_referer: NotRequired[str]
|
||||
@@ -48,9 +61,13 @@ class GetUserActivityRequestTypedDict(TypedDict):
|
||||
This is used to track API usage per application.
|
||||
|
||||
"""
|
||||
x_title: NotRequired[str]
|
||||
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.
|
||||
|
||||
"""
|
||||
date_: NotRequired[str]
|
||||
r"""Filter by a single UTC date in the last 30 days (YYYY-MM-DD format)."""
|
||||
@@ -67,15 +84,24 @@ class GetUserActivityRequest(BaseModel):
|
||||
|
||||
"""
|
||||
|
||||
x_title: Annotated[
|
||||
x_open_router_title: Annotated[
|
||||
Optional[str],
|
||||
pydantic.Field(alias="X-Title"),
|
||||
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.
|
||||
|
||||
"""
|
||||
|
||||
date_: Annotated[
|
||||
Optional[str],
|
||||
pydantic.Field(alias="date"),
|
||||
|
||||
@@ -22,10 +22,14 @@ class ListGlobalsTypedDict(TypedDict):
|
||||
This is used to track API usage per application.
|
||||
|
||||
"""
|
||||
x_title: NotRequired[str]
|
||||
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 ListGlobals(BaseModel):
|
||||
@@ -39,15 +43,24 @@ class ListGlobals(BaseModel):
|
||||
|
||||
"""
|
||||
|
||||
x_title: Annotated[
|
||||
x_open_router_title: Annotated[
|
||||
Optional[str],
|
||||
pydantic.Field(alias="X-Title"),
|
||||
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 ListRequestTypedDict(TypedDict):
|
||||
http_referer: NotRequired[str]
|
||||
@@ -55,9 +68,13 @@ class ListRequestTypedDict(TypedDict):
|
||||
This is used to track API usage per application.
|
||||
|
||||
"""
|
||||
x_title: NotRequired[str]
|
||||
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.
|
||||
|
||||
"""
|
||||
include_disabled: NotRequired[str]
|
||||
r"""Whether to include disabled API keys in the response"""
|
||||
@@ -76,15 +93,24 @@ class ListRequest(BaseModel):
|
||||
|
||||
"""
|
||||
|
||||
x_title: Annotated[
|
||||
x_open_router_title: Annotated[
|
||||
Optional[str],
|
||||
pydantic.Field(alias="X-Title"),
|
||||
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.
|
||||
|
||||
"""
|
||||
|
||||
include_disabled: Annotated[
|
||||
Optional[str],
|
||||
FieldMetadata(query=QueryParamMetadata(style="form", explode=True)),
|
||||
@@ -135,6 +161,8 @@ class ListDataTypedDict(TypedDict):
|
||||
r"""ISO 8601 timestamp of when the API key was created"""
|
||||
updated_at: Nullable[str]
|
||||
r"""ISO 8601 timestamp of when the API key was last updated"""
|
||||
creator_user_id: Nullable[str]
|
||||
r"""The user ID of the key creator. For organization-owned keys, this is the member who created the key. For individual users, this is the user's own ID."""
|
||||
expires_at: NotRequired[Nullable[datetime]]
|
||||
r"""ISO 8601 UTC timestamp when the API key expires, or null if no expiration"""
|
||||
|
||||
@@ -194,6 +222,9 @@ class ListData(BaseModel):
|
||||
updated_at: Nullable[str]
|
||||
r"""ISO 8601 timestamp of when the API key was last updated"""
|
||||
|
||||
creator_user_id: Nullable[str]
|
||||
r"""The user ID of the key creator. For organization-owned keys, this is the member who created the key. For individual users, this is the user's own ID."""
|
||||
|
||||
expires_at: OptionalNullable[datetime] = UNSET
|
||||
r"""ISO 8601 UTC timestamp when the API key expires, or null if no expiration"""
|
||||
|
||||
@@ -206,6 +237,7 @@ class ListData(BaseModel):
|
||||
"limit_reset",
|
||||
"updated_at",
|
||||
"expires_at",
|
||||
"creator_user_id",
|
||||
]
|
||||
null_default_fields = []
|
||||
|
||||
|
||||
@@ -14,10 +14,14 @@ class ListEmbeddingsModelsGlobalsTypedDict(TypedDict):
|
||||
This is used to track API usage per application.
|
||||
|
||||
"""
|
||||
x_title: NotRequired[str]
|
||||
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 ListEmbeddingsModelsGlobals(BaseModel):
|
||||
@@ -31,15 +35,24 @@ class ListEmbeddingsModelsGlobals(BaseModel):
|
||||
|
||||
"""
|
||||
|
||||
x_title: Annotated[
|
||||
x_open_router_title: Annotated[
|
||||
Optional[str],
|
||||
pydantic.Field(alias="X-Title"),
|
||||
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 ListEmbeddingsModelsRequestTypedDict(TypedDict):
|
||||
http_referer: NotRequired[str]
|
||||
@@ -47,10 +60,14 @@ class ListEmbeddingsModelsRequestTypedDict(TypedDict):
|
||||
This is used to track API usage per application.
|
||||
|
||||
"""
|
||||
x_title: NotRequired[str]
|
||||
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 ListEmbeddingsModelsRequest(BaseModel):
|
||||
@@ -64,11 +81,20 @@ class ListEmbeddingsModelsRequest(BaseModel):
|
||||
|
||||
"""
|
||||
|
||||
x_title: Annotated[
|
||||
x_open_router_title: Annotated[
|
||||
Optional[str],
|
||||
pydantic.Field(alias="X-Title"),
|
||||
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.
|
||||
|
||||
"""
|
||||
|
||||
@@ -17,10 +17,14 @@ class ListEndpointsGlobalsTypedDict(TypedDict):
|
||||
This is used to track API usage per application.
|
||||
|
||||
"""
|
||||
x_title: NotRequired[str]
|
||||
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 ListEndpointsGlobals(BaseModel):
|
||||
@@ -34,15 +38,24 @@ class ListEndpointsGlobals(BaseModel):
|
||||
|
||||
"""
|
||||
|
||||
x_title: Annotated[
|
||||
x_open_router_title: Annotated[
|
||||
Optional[str],
|
||||
pydantic.Field(alias="X-Title"),
|
||||
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 ListEndpointsRequestTypedDict(TypedDict):
|
||||
author: str
|
||||
@@ -52,10 +65,14 @@ class ListEndpointsRequestTypedDict(TypedDict):
|
||||
This is used to track API usage per application.
|
||||
|
||||
"""
|
||||
x_title: NotRequired[str]
|
||||
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 ListEndpointsRequest(BaseModel):
|
||||
@@ -77,15 +94,24 @@ class ListEndpointsRequest(BaseModel):
|
||||
|
||||
"""
|
||||
|
||||
x_title: Annotated[
|
||||
x_open_router_title: Annotated[
|
||||
Optional[str],
|
||||
pydantic.Field(alias="X-Title"),
|
||||
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 ListEndpointsResponseTypedDict(TypedDict):
|
||||
r"""Returns a list of endpoints"""
|
||||
|
||||
@@ -15,10 +15,14 @@ class ListEndpointsZdrGlobalsTypedDict(TypedDict):
|
||||
This is used to track API usage per application.
|
||||
|
||||
"""
|
||||
x_title: NotRequired[str]
|
||||
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 ListEndpointsZdrGlobals(BaseModel):
|
||||
@@ -32,15 +36,24 @@ class ListEndpointsZdrGlobals(BaseModel):
|
||||
|
||||
"""
|
||||
|
||||
x_title: Annotated[
|
||||
x_open_router_title: Annotated[
|
||||
Optional[str],
|
||||
pydantic.Field(alias="X-Title"),
|
||||
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 ListEndpointsZdrRequestTypedDict(TypedDict):
|
||||
http_referer: NotRequired[str]
|
||||
@@ -48,10 +61,14 @@ class ListEndpointsZdrRequestTypedDict(TypedDict):
|
||||
This is used to track API usage per application.
|
||||
|
||||
"""
|
||||
x_title: NotRequired[str]
|
||||
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 ListEndpointsZdrRequest(BaseModel):
|
||||
@@ -65,15 +82,24 @@ class ListEndpointsZdrRequest(BaseModel):
|
||||
|
||||
"""
|
||||
|
||||
x_title: Annotated[
|
||||
x_open_router_title: Annotated[
|
||||
Optional[str],
|
||||
pydantic.Field(alias="X-Title"),
|
||||
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 ListEndpointsZdrResponseTypedDict(TypedDict):
|
||||
r"""Returns a list of endpoints"""
|
||||
|
||||
@@ -20,10 +20,14 @@ class ListGuardrailKeyAssignmentsGlobalsTypedDict(TypedDict):
|
||||
This is used to track API usage per application.
|
||||
|
||||
"""
|
||||
x_title: NotRequired[str]
|
||||
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 ListGuardrailKeyAssignmentsGlobals(BaseModel):
|
||||
@@ -37,15 +41,24 @@ class ListGuardrailKeyAssignmentsGlobals(BaseModel):
|
||||
|
||||
"""
|
||||
|
||||
x_title: Annotated[
|
||||
x_open_router_title: Annotated[
|
||||
Optional[str],
|
||||
pydantic.Field(alias="X-Title"),
|
||||
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 ListGuardrailKeyAssignmentsRequestTypedDict(TypedDict):
|
||||
id: str
|
||||
@@ -55,9 +68,13 @@ class ListGuardrailKeyAssignmentsRequestTypedDict(TypedDict):
|
||||
This is used to track API usage per application.
|
||||
|
||||
"""
|
||||
x_title: NotRequired[str]
|
||||
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.
|
||||
|
||||
"""
|
||||
offset: NotRequired[str]
|
||||
r"""Number of records to skip for pagination"""
|
||||
@@ -81,15 +98,24 @@ class ListGuardrailKeyAssignmentsRequest(BaseModel):
|
||||
|
||||
"""
|
||||
|
||||
x_title: Annotated[
|
||||
x_open_router_title: Annotated[
|
||||
Optional[str],
|
||||
pydantic.Field(alias="X-Title"),
|
||||
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.
|
||||
|
||||
"""
|
||||
|
||||
offset: Annotated[
|
||||
Optional[str],
|
||||
FieldMetadata(query=QueryParamMetadata(style="form", explode=True)),
|
||||
|
||||
@@ -20,10 +20,14 @@ class ListGuardrailMemberAssignmentsGlobalsTypedDict(TypedDict):
|
||||
This is used to track API usage per application.
|
||||
|
||||
"""
|
||||
x_title: NotRequired[str]
|
||||
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 ListGuardrailMemberAssignmentsGlobals(BaseModel):
|
||||
@@ -37,15 +41,24 @@ class ListGuardrailMemberAssignmentsGlobals(BaseModel):
|
||||
|
||||
"""
|
||||
|
||||
x_title: Annotated[
|
||||
x_open_router_title: Annotated[
|
||||
Optional[str],
|
||||
pydantic.Field(alias="X-Title"),
|
||||
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 ListGuardrailMemberAssignmentsRequestTypedDict(TypedDict):
|
||||
id: str
|
||||
@@ -55,9 +68,13 @@ class ListGuardrailMemberAssignmentsRequestTypedDict(TypedDict):
|
||||
This is used to track API usage per application.
|
||||
|
||||
"""
|
||||
x_title: NotRequired[str]
|
||||
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.
|
||||
|
||||
"""
|
||||
offset: NotRequired[str]
|
||||
r"""Number of records to skip for pagination"""
|
||||
@@ -81,15 +98,24 @@ class ListGuardrailMemberAssignmentsRequest(BaseModel):
|
||||
|
||||
"""
|
||||
|
||||
x_title: Annotated[
|
||||
x_open_router_title: Annotated[
|
||||
Optional[str],
|
||||
pydantic.Field(alias="X-Title"),
|
||||
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.
|
||||
|
||||
"""
|
||||
|
||||
offset: Annotated[
|
||||
Optional[str],
|
||||
FieldMetadata(query=QueryParamMetadata(style="form", explode=True)),
|
||||
|
||||
@@ -28,10 +28,14 @@ class ListGuardrailsGlobalsTypedDict(TypedDict):
|
||||
This is used to track API usage per application.
|
||||
|
||||
"""
|
||||
x_title: NotRequired[str]
|
||||
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 ListGuardrailsGlobals(BaseModel):
|
||||
@@ -45,15 +49,24 @@ class ListGuardrailsGlobals(BaseModel):
|
||||
|
||||
"""
|
||||
|
||||
x_title: Annotated[
|
||||
x_open_router_title: Annotated[
|
||||
Optional[str],
|
||||
pydantic.Field(alias="X-Title"),
|
||||
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 ListGuardrailsRequestTypedDict(TypedDict):
|
||||
http_referer: NotRequired[str]
|
||||
@@ -61,9 +74,13 @@ class ListGuardrailsRequestTypedDict(TypedDict):
|
||||
This is used to track API usage per application.
|
||||
|
||||
"""
|
||||
x_title: NotRequired[str]
|
||||
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.
|
||||
|
||||
"""
|
||||
offset: NotRequired[str]
|
||||
r"""Number of records to skip for pagination"""
|
||||
@@ -82,15 +99,24 @@ class ListGuardrailsRequest(BaseModel):
|
||||
|
||||
"""
|
||||
|
||||
x_title: Annotated[
|
||||
x_open_router_title: Annotated[
|
||||
Optional[str],
|
||||
pydantic.Field(alias="X-Title"),
|
||||
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.
|
||||
|
||||
"""
|
||||
|
||||
offset: Annotated[
|
||||
Optional[str],
|
||||
FieldMetadata(query=QueryParamMetadata(style="form", explode=True)),
|
||||
@@ -130,6 +156,8 @@ class ListGuardrailsDataTypedDict(TypedDict):
|
||||
r"""Interval at which the limit resets (daily, weekly, monthly)"""
|
||||
allowed_providers: NotRequired[Nullable[List[str]]]
|
||||
r"""List of allowed provider IDs"""
|
||||
ignored_providers: NotRequired[Nullable[List[str]]]
|
||||
r"""List of provider IDs to exclude from routing"""
|
||||
allowed_models: NotRequired[Nullable[List[str]]]
|
||||
r"""Array of model canonical_slugs (immutable identifiers)"""
|
||||
enforce_zdr: NotRequired[Nullable[bool]]
|
||||
@@ -163,6 +191,9 @@ class ListGuardrailsData(BaseModel):
|
||||
allowed_providers: OptionalNullable[List[str]] = UNSET
|
||||
r"""List of allowed provider IDs"""
|
||||
|
||||
ignored_providers: OptionalNullable[List[str]] = UNSET
|
||||
r"""List of provider IDs to exclude from routing"""
|
||||
|
||||
allowed_models: OptionalNullable[List[str]] = UNSET
|
||||
r"""Array of model canonical_slugs (immutable identifiers)"""
|
||||
|
||||
@@ -179,6 +210,7 @@ class ListGuardrailsData(BaseModel):
|
||||
"limit_usd",
|
||||
"reset_interval",
|
||||
"allowed_providers",
|
||||
"ignored_providers",
|
||||
"allowed_models",
|
||||
"enforce_zdr",
|
||||
"updated_at",
|
||||
@@ -188,6 +220,7 @@ class ListGuardrailsData(BaseModel):
|
||||
"limit_usd",
|
||||
"reset_interval",
|
||||
"allowed_providers",
|
||||
"ignored_providers",
|
||||
"allowed_models",
|
||||
"enforce_zdr",
|
||||
"updated_at",
|
||||
|
||||
@@ -15,10 +15,14 @@ class ListKeyAssignmentsGlobalsTypedDict(TypedDict):
|
||||
This is used to track API usage per application.
|
||||
|
||||
"""
|
||||
x_title: NotRequired[str]
|
||||
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 ListKeyAssignmentsGlobals(BaseModel):
|
||||
@@ -32,15 +36,24 @@ class ListKeyAssignmentsGlobals(BaseModel):
|
||||
|
||||
"""
|
||||
|
||||
x_title: Annotated[
|
||||
x_open_router_title: Annotated[
|
||||
Optional[str],
|
||||
pydantic.Field(alias="X-Title"),
|
||||
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 ListKeyAssignmentsRequestTypedDict(TypedDict):
|
||||
http_referer: NotRequired[str]
|
||||
@@ -48,9 +61,13 @@ class ListKeyAssignmentsRequestTypedDict(TypedDict):
|
||||
This is used to track API usage per application.
|
||||
|
||||
"""
|
||||
x_title: NotRequired[str]
|
||||
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.
|
||||
|
||||
"""
|
||||
offset: NotRequired[str]
|
||||
r"""Number of records to skip for pagination"""
|
||||
@@ -69,15 +86,24 @@ class ListKeyAssignmentsRequest(BaseModel):
|
||||
|
||||
"""
|
||||
|
||||
x_title: Annotated[
|
||||
x_open_router_title: Annotated[
|
||||
Optional[str],
|
||||
pydantic.Field(alias="X-Title"),
|
||||
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.
|
||||
|
||||
"""
|
||||
|
||||
offset: Annotated[
|
||||
Optional[str],
|
||||
FieldMetadata(query=QueryParamMetadata(style="form", explode=True)),
|
||||
|
||||
@@ -15,10 +15,14 @@ class ListMemberAssignmentsGlobalsTypedDict(TypedDict):
|
||||
This is used to track API usage per application.
|
||||
|
||||
"""
|
||||
x_title: NotRequired[str]
|
||||
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 ListMemberAssignmentsGlobals(BaseModel):
|
||||
@@ -32,15 +36,24 @@ class ListMemberAssignmentsGlobals(BaseModel):
|
||||
|
||||
"""
|
||||
|
||||
x_title: Annotated[
|
||||
x_open_router_title: Annotated[
|
||||
Optional[str],
|
||||
pydantic.Field(alias="X-Title"),
|
||||
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 ListMemberAssignmentsRequestTypedDict(TypedDict):
|
||||
http_referer: NotRequired[str]
|
||||
@@ -48,9 +61,13 @@ class ListMemberAssignmentsRequestTypedDict(TypedDict):
|
||||
This is used to track API usage per application.
|
||||
|
||||
"""
|
||||
x_title: NotRequired[str]
|
||||
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.
|
||||
|
||||
"""
|
||||
offset: NotRequired[str]
|
||||
r"""Number of records to skip for pagination"""
|
||||
@@ -69,15 +86,24 @@ class ListMemberAssignmentsRequest(BaseModel):
|
||||
|
||||
"""
|
||||
|
||||
x_title: Annotated[
|
||||
x_open_router_title: Annotated[
|
||||
Optional[str],
|
||||
pydantic.Field(alias="X-Title"),
|
||||
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.
|
||||
|
||||
"""
|
||||
|
||||
offset: Annotated[
|
||||
Optional[str],
|
||||
FieldMetadata(query=QueryParamMetadata(style="form", explode=True)),
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
from __future__ import annotations
|
||||
from openrouter.types import BaseModel
|
||||
from openrouter.utils import FieldMetadata, HeaderMetadata
|
||||
from openrouter.utils import FieldMetadata, HeaderMetadata, QueryParamMetadata
|
||||
import pydantic
|
||||
from typing import Optional
|
||||
from typing_extensions import Annotated, NotRequired, TypedDict
|
||||
@@ -14,10 +14,14 @@ class ListModelsCountGlobalsTypedDict(TypedDict):
|
||||
This is used to track API usage per application.
|
||||
|
||||
"""
|
||||
x_title: NotRequired[str]
|
||||
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 ListModelsCountGlobals(BaseModel):
|
||||
@@ -31,15 +35,24 @@ class ListModelsCountGlobals(BaseModel):
|
||||
|
||||
"""
|
||||
|
||||
x_title: Annotated[
|
||||
x_open_router_title: Annotated[
|
||||
Optional[str],
|
||||
pydantic.Field(alias="X-Title"),
|
||||
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 ListModelsCountRequestTypedDict(TypedDict):
|
||||
http_referer: NotRequired[str]
|
||||
@@ -47,10 +60,16 @@ class ListModelsCountRequestTypedDict(TypedDict):
|
||||
This is used to track API usage per application.
|
||||
|
||||
"""
|
||||
x_title: NotRequired[str]
|
||||
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.
|
||||
|
||||
"""
|
||||
output_modalities: NotRequired[str]
|
||||
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\"."""
|
||||
|
||||
|
||||
class ListModelsCountRequest(BaseModel):
|
||||
@@ -64,11 +83,26 @@ class ListModelsCountRequest(BaseModel):
|
||||
|
||||
"""
|
||||
|
||||
x_title: Annotated[
|
||||
x_open_router_title: Annotated[
|
||||
Optional[str],
|
||||
pydantic.Field(alias="X-Title"),
|
||||
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.
|
||||
|
||||
"""
|
||||
|
||||
output_modalities: Annotated[
|
||||
Optional[str],
|
||||
FieldMetadata(query=QueryParamMetadata(style="form", explode=True)),
|
||||
] = None
|
||||
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\"."""
|
||||
|
||||
@@ -14,10 +14,14 @@ class ListModelsUserGlobalsTypedDict(TypedDict):
|
||||
This is used to track API usage per application.
|
||||
|
||||
"""
|
||||
x_title: NotRequired[str]
|
||||
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 ListModelsUserGlobals(BaseModel):
|
||||
@@ -31,15 +35,24 @@ class ListModelsUserGlobals(BaseModel):
|
||||
|
||||
"""
|
||||
|
||||
x_title: Annotated[
|
||||
x_open_router_title: Annotated[
|
||||
Optional[str],
|
||||
pydantic.Field(alias="X-Title"),
|
||||
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 ListModelsUserSecurityTypedDict(TypedDict):
|
||||
bearer: str
|
||||
@@ -65,10 +78,14 @@ class ListModelsUserRequestTypedDict(TypedDict):
|
||||
This is used to track API usage per application.
|
||||
|
||||
"""
|
||||
x_title: NotRequired[str]
|
||||
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 ListModelsUserRequest(BaseModel):
|
||||
@@ -82,11 +99,20 @@ class ListModelsUserRequest(BaseModel):
|
||||
|
||||
"""
|
||||
|
||||
x_title: Annotated[
|
||||
x_open_router_title: Annotated[
|
||||
Optional[str],
|
||||
pydantic.Field(alias="X-Title"),
|
||||
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.
|
||||
|
||||
"""
|
||||
|
||||
@@ -7,11 +7,13 @@ from openrouter.types import (
|
||||
OptionalNullable,
|
||||
UNSET,
|
||||
UNSET_SENTINEL,
|
||||
UnrecognizedStr,
|
||||
)
|
||||
from openrouter.utils import FieldMetadata, HeaderMetadata
|
||||
from openrouter.utils import FieldMetadata, HeaderMetadata, validate_open_enum
|
||||
import pydantic
|
||||
from pydantic import model_serializer
|
||||
from typing import List, Optional
|
||||
from pydantic.functional_validators import PlainValidator
|
||||
from typing import List, Literal, Optional, Union
|
||||
from typing_extensions import Annotated, NotRequired, TypedDict
|
||||
|
||||
|
||||
@@ -21,10 +23,14 @@ class ListProvidersGlobalsTypedDict(TypedDict):
|
||||
This is used to track API usage per application.
|
||||
|
||||
"""
|
||||
x_title: NotRequired[str]
|
||||
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 ListProvidersGlobals(BaseModel):
|
||||
@@ -38,15 +44,24 @@ class ListProvidersGlobals(BaseModel):
|
||||
|
||||
"""
|
||||
|
||||
x_title: Annotated[
|
||||
x_open_router_title: Annotated[
|
||||
Optional[str],
|
||||
pydantic.Field(alias="X-Title"),
|
||||
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 ListProvidersRequestTypedDict(TypedDict):
|
||||
http_referer: NotRequired[str]
|
||||
@@ -54,10 +69,14 @@ class ListProvidersRequestTypedDict(TypedDict):
|
||||
This is used to track API usage per application.
|
||||
|
||||
"""
|
||||
x_title: NotRequired[str]
|
||||
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 ListProvidersRequest(BaseModel):
|
||||
@@ -71,15 +90,537 @@ class ListProvidersRequest(BaseModel):
|
||||
|
||||
"""
|
||||
|
||||
x_title: Annotated[
|
||||
x_open_router_title: Annotated[
|
||||
Optional[str],
|
||||
pydantic.Field(alias="X-Title"),
|
||||
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.
|
||||
|
||||
"""
|
||||
|
||||
|
||||
Headquarters = Union[
|
||||
Literal[
|
||||
"AD",
|
||||
"AE",
|
||||
"AF",
|
||||
"AG",
|
||||
"AI",
|
||||
"AL",
|
||||
"AM",
|
||||
"AO",
|
||||
"AQ",
|
||||
"AR",
|
||||
"AS",
|
||||
"AT",
|
||||
"AU",
|
||||
"AW",
|
||||
"AX",
|
||||
"AZ",
|
||||
"BA",
|
||||
"BB",
|
||||
"BD",
|
||||
"BE",
|
||||
"BF",
|
||||
"BG",
|
||||
"BH",
|
||||
"BI",
|
||||
"BJ",
|
||||
"BL",
|
||||
"BM",
|
||||
"BN",
|
||||
"BO",
|
||||
"BQ",
|
||||
"BR",
|
||||
"BS",
|
||||
"BT",
|
||||
"BV",
|
||||
"BW",
|
||||
"BY",
|
||||
"BZ",
|
||||
"CA",
|
||||
"CC",
|
||||
"CD",
|
||||
"CF",
|
||||
"CG",
|
||||
"CH",
|
||||
"CI",
|
||||
"CK",
|
||||
"CL",
|
||||
"CM",
|
||||
"CN",
|
||||
"CO",
|
||||
"CR",
|
||||
"CU",
|
||||
"CV",
|
||||
"CW",
|
||||
"CX",
|
||||
"CY",
|
||||
"CZ",
|
||||
"DE",
|
||||
"DJ",
|
||||
"DK",
|
||||
"DM",
|
||||
"DO",
|
||||
"DZ",
|
||||
"EC",
|
||||
"EE",
|
||||
"EG",
|
||||
"EH",
|
||||
"ER",
|
||||
"ES",
|
||||
"ET",
|
||||
"FI",
|
||||
"FJ",
|
||||
"FK",
|
||||
"FM",
|
||||
"FO",
|
||||
"FR",
|
||||
"GA",
|
||||
"GB",
|
||||
"GD",
|
||||
"GE",
|
||||
"GF",
|
||||
"GG",
|
||||
"GH",
|
||||
"GI",
|
||||
"GL",
|
||||
"GM",
|
||||
"GN",
|
||||
"GP",
|
||||
"GQ",
|
||||
"GR",
|
||||
"GS",
|
||||
"GT",
|
||||
"GU",
|
||||
"GW",
|
||||
"GY",
|
||||
"HK",
|
||||
"HM",
|
||||
"HN",
|
||||
"HR",
|
||||
"HT",
|
||||
"HU",
|
||||
"ID",
|
||||
"IE",
|
||||
"IL",
|
||||
"IM",
|
||||
"IN",
|
||||
"IO",
|
||||
"IQ",
|
||||
"IR",
|
||||
"IS",
|
||||
"IT",
|
||||
"JE",
|
||||
"JM",
|
||||
"JO",
|
||||
"JP",
|
||||
"KE",
|
||||
"KG",
|
||||
"KH",
|
||||
"KI",
|
||||
"KM",
|
||||
"KN",
|
||||
"KP",
|
||||
"KR",
|
||||
"KW",
|
||||
"KY",
|
||||
"KZ",
|
||||
"LA",
|
||||
"LB",
|
||||
"LC",
|
||||
"LI",
|
||||
"LK",
|
||||
"LR",
|
||||
"LS",
|
||||
"LT",
|
||||
"LU",
|
||||
"LV",
|
||||
"LY",
|
||||
"MA",
|
||||
"MC",
|
||||
"MD",
|
||||
"ME",
|
||||
"MF",
|
||||
"MG",
|
||||
"MH",
|
||||
"MK",
|
||||
"ML",
|
||||
"MM",
|
||||
"MN",
|
||||
"MO",
|
||||
"MP",
|
||||
"MQ",
|
||||
"MR",
|
||||
"MS",
|
||||
"MT",
|
||||
"MU",
|
||||
"MV",
|
||||
"MW",
|
||||
"MX",
|
||||
"MY",
|
||||
"MZ",
|
||||
"NA",
|
||||
"NC",
|
||||
"NE",
|
||||
"NF",
|
||||
"NG",
|
||||
"NI",
|
||||
"NL",
|
||||
"NO",
|
||||
"NP",
|
||||
"NR",
|
||||
"NU",
|
||||
"NZ",
|
||||
"OM",
|
||||
"PA",
|
||||
"PE",
|
||||
"PF",
|
||||
"PG",
|
||||
"PH",
|
||||
"PK",
|
||||
"PL",
|
||||
"PM",
|
||||
"PN",
|
||||
"PR",
|
||||
"PS",
|
||||
"PT",
|
||||
"PW",
|
||||
"PY",
|
||||
"QA",
|
||||
"RE",
|
||||
"RO",
|
||||
"RS",
|
||||
"RU",
|
||||
"RW",
|
||||
"SA",
|
||||
"SB",
|
||||
"SC",
|
||||
"SD",
|
||||
"SE",
|
||||
"SG",
|
||||
"SH",
|
||||
"SI",
|
||||
"SJ",
|
||||
"SK",
|
||||
"SL",
|
||||
"SM",
|
||||
"SN",
|
||||
"SO",
|
||||
"SR",
|
||||
"SS",
|
||||
"ST",
|
||||
"SV",
|
||||
"SX",
|
||||
"SY",
|
||||
"SZ",
|
||||
"TC",
|
||||
"TD",
|
||||
"TF",
|
||||
"TG",
|
||||
"TH",
|
||||
"TJ",
|
||||
"TK",
|
||||
"TL",
|
||||
"TM",
|
||||
"TN",
|
||||
"TO",
|
||||
"TR",
|
||||
"TT",
|
||||
"TV",
|
||||
"TW",
|
||||
"TZ",
|
||||
"UA",
|
||||
"UG",
|
||||
"UM",
|
||||
"US",
|
||||
"UY",
|
||||
"UZ",
|
||||
"VA",
|
||||
"VC",
|
||||
"VE",
|
||||
"VG",
|
||||
"VI",
|
||||
"VN",
|
||||
"VU",
|
||||
"WF",
|
||||
"WS",
|
||||
"YE",
|
||||
"YT",
|
||||
"ZA",
|
||||
"ZM",
|
||||
"ZW",
|
||||
],
|
||||
UnrecognizedStr,
|
||||
]
|
||||
r"""ISO 3166-1 Alpha-2 country code of the provider headquarters"""
|
||||
|
||||
|
||||
Datacenter = Union[
|
||||
Literal[
|
||||
"AD",
|
||||
"AE",
|
||||
"AF",
|
||||
"AG",
|
||||
"AI",
|
||||
"AL",
|
||||
"AM",
|
||||
"AO",
|
||||
"AQ",
|
||||
"AR",
|
||||
"AS",
|
||||
"AT",
|
||||
"AU",
|
||||
"AW",
|
||||
"AX",
|
||||
"AZ",
|
||||
"BA",
|
||||
"BB",
|
||||
"BD",
|
||||
"BE",
|
||||
"BF",
|
||||
"BG",
|
||||
"BH",
|
||||
"BI",
|
||||
"BJ",
|
||||
"BL",
|
||||
"BM",
|
||||
"BN",
|
||||
"BO",
|
||||
"BQ",
|
||||
"BR",
|
||||
"BS",
|
||||
"BT",
|
||||
"BV",
|
||||
"BW",
|
||||
"BY",
|
||||
"BZ",
|
||||
"CA",
|
||||
"CC",
|
||||
"CD",
|
||||
"CF",
|
||||
"CG",
|
||||
"CH",
|
||||
"CI",
|
||||
"CK",
|
||||
"CL",
|
||||
"CM",
|
||||
"CN",
|
||||
"CO",
|
||||
"CR",
|
||||
"CU",
|
||||
"CV",
|
||||
"CW",
|
||||
"CX",
|
||||
"CY",
|
||||
"CZ",
|
||||
"DE",
|
||||
"DJ",
|
||||
"DK",
|
||||
"DM",
|
||||
"DO",
|
||||
"DZ",
|
||||
"EC",
|
||||
"EE",
|
||||
"EG",
|
||||
"EH",
|
||||
"ER",
|
||||
"ES",
|
||||
"ET",
|
||||
"FI",
|
||||
"FJ",
|
||||
"FK",
|
||||
"FM",
|
||||
"FO",
|
||||
"FR",
|
||||
"GA",
|
||||
"GB",
|
||||
"GD",
|
||||
"GE",
|
||||
"GF",
|
||||
"GG",
|
||||
"GH",
|
||||
"GI",
|
||||
"GL",
|
||||
"GM",
|
||||
"GN",
|
||||
"GP",
|
||||
"GQ",
|
||||
"GR",
|
||||
"GS",
|
||||
"GT",
|
||||
"GU",
|
||||
"GW",
|
||||
"GY",
|
||||
"HK",
|
||||
"HM",
|
||||
"HN",
|
||||
"HR",
|
||||
"HT",
|
||||
"HU",
|
||||
"ID",
|
||||
"IE",
|
||||
"IL",
|
||||
"IM",
|
||||
"IN",
|
||||
"IO",
|
||||
"IQ",
|
||||
"IR",
|
||||
"IS",
|
||||
"IT",
|
||||
"JE",
|
||||
"JM",
|
||||
"JO",
|
||||
"JP",
|
||||
"KE",
|
||||
"KG",
|
||||
"KH",
|
||||
"KI",
|
||||
"KM",
|
||||
"KN",
|
||||
"KP",
|
||||
"KR",
|
||||
"KW",
|
||||
"KY",
|
||||
"KZ",
|
||||
"LA",
|
||||
"LB",
|
||||
"LC",
|
||||
"LI",
|
||||
"LK",
|
||||
"LR",
|
||||
"LS",
|
||||
"LT",
|
||||
"LU",
|
||||
"LV",
|
||||
"LY",
|
||||
"MA",
|
||||
"MC",
|
||||
"MD",
|
||||
"ME",
|
||||
"MF",
|
||||
"MG",
|
||||
"MH",
|
||||
"MK",
|
||||
"ML",
|
||||
"MM",
|
||||
"MN",
|
||||
"MO",
|
||||
"MP",
|
||||
"MQ",
|
||||
"MR",
|
||||
"MS",
|
||||
"MT",
|
||||
"MU",
|
||||
"MV",
|
||||
"MW",
|
||||
"MX",
|
||||
"MY",
|
||||
"MZ",
|
||||
"NA",
|
||||
"NC",
|
||||
"NE",
|
||||
"NF",
|
||||
"NG",
|
||||
"NI",
|
||||
"NL",
|
||||
"NO",
|
||||
"NP",
|
||||
"NR",
|
||||
"NU",
|
||||
"NZ",
|
||||
"OM",
|
||||
"PA",
|
||||
"PE",
|
||||
"PF",
|
||||
"PG",
|
||||
"PH",
|
||||
"PK",
|
||||
"PL",
|
||||
"PM",
|
||||
"PN",
|
||||
"PR",
|
||||
"PS",
|
||||
"PT",
|
||||
"PW",
|
||||
"PY",
|
||||
"QA",
|
||||
"RE",
|
||||
"RO",
|
||||
"RS",
|
||||
"RU",
|
||||
"RW",
|
||||
"SA",
|
||||
"SB",
|
||||
"SC",
|
||||
"SD",
|
||||
"SE",
|
||||
"SG",
|
||||
"SH",
|
||||
"SI",
|
||||
"SJ",
|
||||
"SK",
|
||||
"SL",
|
||||
"SM",
|
||||
"SN",
|
||||
"SO",
|
||||
"SR",
|
||||
"SS",
|
||||
"ST",
|
||||
"SV",
|
||||
"SX",
|
||||
"SY",
|
||||
"SZ",
|
||||
"TC",
|
||||
"TD",
|
||||
"TF",
|
||||
"TG",
|
||||
"TH",
|
||||
"TJ",
|
||||
"TK",
|
||||
"TL",
|
||||
"TM",
|
||||
"TN",
|
||||
"TO",
|
||||
"TR",
|
||||
"TT",
|
||||
"TV",
|
||||
"TW",
|
||||
"TZ",
|
||||
"UA",
|
||||
"UG",
|
||||
"UM",
|
||||
"US",
|
||||
"UY",
|
||||
"UZ",
|
||||
"VA",
|
||||
"VC",
|
||||
"VE",
|
||||
"VG",
|
||||
"VI",
|
||||
"VN",
|
||||
"VU",
|
||||
"WF",
|
||||
"WS",
|
||||
"YE",
|
||||
"YT",
|
||||
"ZA",
|
||||
"ZM",
|
||||
"ZW",
|
||||
],
|
||||
UnrecognizedStr,
|
||||
]
|
||||
|
||||
|
||||
class ListProvidersDataTypedDict(TypedDict):
|
||||
name: str
|
||||
@@ -92,6 +633,10 @@ class ListProvidersDataTypedDict(TypedDict):
|
||||
r"""URL to the provider's terms of service"""
|
||||
status_page_url: NotRequired[Nullable[str]]
|
||||
r"""URL to the provider's status page"""
|
||||
headquarters: NotRequired[Nullable[Headquarters]]
|
||||
r"""ISO 3166-1 Alpha-2 country code of the provider headquarters"""
|
||||
datacenters: NotRequired[Nullable[List[Datacenter]]]
|
||||
r"""ISO 3166-1 Alpha-2 country codes of the provider datacenter locations"""
|
||||
|
||||
|
||||
class ListProvidersData(BaseModel):
|
||||
@@ -110,13 +655,30 @@ class ListProvidersData(BaseModel):
|
||||
status_page_url: OptionalNullable[str] = UNSET
|
||||
r"""URL to the provider's status page"""
|
||||
|
||||
headquarters: Annotated[
|
||||
OptionalNullable[Headquarters], PlainValidator(validate_open_enum(False))
|
||||
] = UNSET
|
||||
r"""ISO 3166-1 Alpha-2 country code of the provider headquarters"""
|
||||
|
||||
datacenters: OptionalNullable[
|
||||
List[Annotated[Datacenter, PlainValidator(validate_open_enum(False))]]
|
||||
] = UNSET
|
||||
r"""ISO 3166-1 Alpha-2 country codes of the provider datacenter locations"""
|
||||
|
||||
@model_serializer(mode="wrap")
|
||||
def serialize_model(self, handler):
|
||||
optional_fields = ["terms_of_service_url", "status_page_url"]
|
||||
optional_fields = [
|
||||
"terms_of_service_url",
|
||||
"status_page_url",
|
||||
"headquarters",
|
||||
"datacenters",
|
||||
]
|
||||
nullable_fields = [
|
||||
"privacy_policy_url",
|
||||
"terms_of_service_url",
|
||||
"status_page_url",
|
||||
"headquarters",
|
||||
"datacenters",
|
||||
]
|
||||
null_default_fields = []
|
||||
|
||||
|
||||
@@ -2,9 +2,9 @@
|
||||
|
||||
from __future__ import annotations
|
||||
from openrouter.components import (
|
||||
chatgenerationparams as components_chatgenerationparams,
|
||||
chatresponse as components_chatresponse,
|
||||
chatstreamingresponsechunk as components_chatstreamingresponsechunk,
|
||||
chatrequest as components_chatrequest,
|
||||
chatresult as components_chatresult,
|
||||
chatstreamchunk as components_chatstreamchunk,
|
||||
)
|
||||
from openrouter.types import BaseModel
|
||||
from openrouter.utils import (
|
||||
@@ -24,10 +24,14 @@ class SendChatCompletionRequestGlobalsTypedDict(TypedDict):
|
||||
This is used to track API usage per application.
|
||||
|
||||
"""
|
||||
x_title: NotRequired[str]
|
||||
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 SendChatCompletionRequestGlobals(BaseModel):
|
||||
@@ -41,34 +45,45 @@ class SendChatCompletionRequestGlobals(BaseModel):
|
||||
|
||||
"""
|
||||
|
||||
x_title: Annotated[
|
||||
x_open_router_title: Annotated[
|
||||
Optional[str],
|
||||
pydantic.Field(alias="X-Title"),
|
||||
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 SendChatCompletionRequestRequestTypedDict(TypedDict):
|
||||
chat_generation_params: (
|
||||
components_chatgenerationparams.ChatGenerationParamsTypedDict
|
||||
)
|
||||
chat_request: components_chatrequest.ChatRequestTypedDict
|
||||
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_title: NotRequired[str]
|
||||
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 SendChatCompletionRequestRequest(BaseModel):
|
||||
chat_generation_params: Annotated[
|
||||
components_chatgenerationparams.ChatGenerationParams,
|
||||
chat_request: Annotated[
|
||||
components_chatrequest.ChatRequest,
|
||||
FieldMetadata(request=RequestMetadata(media_type="application/json")),
|
||||
]
|
||||
|
||||
@@ -82,40 +97,49 @@ class SendChatCompletionRequestRequest(BaseModel):
|
||||
|
||||
"""
|
||||
|
||||
x_title: Annotated[
|
||||
x_open_router_title: Annotated[
|
||||
Optional[str],
|
||||
pydantic.Field(alias="X-Title"),
|
||||
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 SendChatCompletionRequestResponseBodyTypedDict(TypedDict):
|
||||
r"""Successful chat completion response"""
|
||||
|
||||
data: components_chatstreamingresponsechunk.ChatStreamingResponseChunkTypedDict
|
||||
data: components_chatstreamchunk.ChatStreamChunkTypedDict
|
||||
r"""Streaming chat completion chunk"""
|
||||
|
||||
|
||||
class SendChatCompletionRequestResponseBody(BaseModel):
|
||||
r"""Successful chat completion response"""
|
||||
|
||||
data: components_chatstreamingresponsechunk.ChatStreamingResponseChunk
|
||||
data: components_chatstreamchunk.ChatStreamChunk
|
||||
r"""Streaming chat completion chunk"""
|
||||
|
||||
|
||||
SendChatCompletionRequestResponseTypedDict = TypeAliasType(
|
||||
"SendChatCompletionRequestResponseTypedDict",
|
||||
Union[
|
||||
components_chatresponse.ChatResponseTypedDict,
|
||||
components_chatresult.ChatResultTypedDict,
|
||||
Union[
|
||||
eventstreaming.EventStream[
|
||||
components_chatstreamingresponsechunk.ChatStreamingResponseChunkTypedDict
|
||||
components_chatstreamchunk.ChatStreamChunkTypedDict
|
||||
],
|
||||
eventstreaming.EventStreamAsync[
|
||||
components_chatstreamingresponsechunk.ChatStreamingResponseChunkTypedDict
|
||||
components_chatstreamchunk.ChatStreamChunkTypedDict
|
||||
],
|
||||
],
|
||||
],
|
||||
@@ -125,14 +149,10 @@ SendChatCompletionRequestResponseTypedDict = TypeAliasType(
|
||||
SendChatCompletionRequestResponse = TypeAliasType(
|
||||
"SendChatCompletionRequestResponse",
|
||||
Union[
|
||||
components_chatresponse.ChatResponse,
|
||||
components_chatresult.ChatResult,
|
||||
Union[
|
||||
eventstreaming.EventStream[
|
||||
components_chatstreamingresponsechunk.ChatStreamingResponseChunk
|
||||
],
|
||||
eventstreaming.EventStreamAsync[
|
||||
components_chatstreamingresponsechunk.ChatStreamingResponseChunk
|
||||
],
|
||||
eventstreaming.EventStream[components_chatstreamchunk.ChatStreamChunk],
|
||||
eventstreaming.EventStreamAsync[components_chatstreamchunk.ChatStreamChunk],
|
||||
],
|
||||
],
|
||||
)
|
||||
|
||||
@@ -29,10 +29,14 @@ class UpdateGuardrailGlobalsTypedDict(TypedDict):
|
||||
This is used to track API usage per application.
|
||||
|
||||
"""
|
||||
x_title: NotRequired[str]
|
||||
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 UpdateGuardrailGlobals(BaseModel):
|
||||
@@ -46,15 +50,24 @@ class UpdateGuardrailGlobals(BaseModel):
|
||||
|
||||
"""
|
||||
|
||||
x_title: Annotated[
|
||||
x_open_router_title: Annotated[
|
||||
Optional[str],
|
||||
pydantic.Field(alias="X-Title"),
|
||||
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.
|
||||
|
||||
"""
|
||||
|
||||
|
||||
UpdateGuardrailResetIntervalRequest = Union[
|
||||
Literal[
|
||||
@@ -78,6 +91,8 @@ class UpdateGuardrailRequestBodyTypedDict(TypedDict):
|
||||
r"""Interval at which the limit resets (daily, weekly, monthly)"""
|
||||
allowed_providers: NotRequired[Nullable[List[str]]]
|
||||
r"""New list of allowed provider IDs"""
|
||||
ignored_providers: NotRequired[Nullable[List[str]]]
|
||||
r"""List of provider IDs to exclude from routing"""
|
||||
allowed_models: NotRequired[Nullable[List[str]]]
|
||||
r"""Array of model identifiers (slug or canonical_slug accepted)"""
|
||||
enforce_zdr: NotRequired[Nullable[bool]]
|
||||
@@ -103,6 +118,9 @@ class UpdateGuardrailRequestBody(BaseModel):
|
||||
allowed_providers: OptionalNullable[List[str]] = UNSET
|
||||
r"""New list of allowed provider IDs"""
|
||||
|
||||
ignored_providers: OptionalNullable[List[str]] = UNSET
|
||||
r"""List of provider IDs to exclude from routing"""
|
||||
|
||||
allowed_models: OptionalNullable[List[str]] = UNSET
|
||||
r"""Array of model identifiers (slug or canonical_slug accepted)"""
|
||||
|
||||
@@ -117,6 +135,7 @@ class UpdateGuardrailRequestBody(BaseModel):
|
||||
"limit_usd",
|
||||
"reset_interval",
|
||||
"allowed_providers",
|
||||
"ignored_providers",
|
||||
"allowed_models",
|
||||
"enforce_zdr",
|
||||
]
|
||||
@@ -125,6 +144,7 @@ class UpdateGuardrailRequestBody(BaseModel):
|
||||
"limit_usd",
|
||||
"reset_interval",
|
||||
"allowed_providers",
|
||||
"ignored_providers",
|
||||
"allowed_models",
|
||||
"enforce_zdr",
|
||||
]
|
||||
@@ -164,10 +184,14 @@ class UpdateGuardrailRequestTypedDict(TypedDict):
|
||||
This is used to track API usage per application.
|
||||
|
||||
"""
|
||||
x_title: NotRequired[str]
|
||||
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 UpdateGuardrailRequest(BaseModel):
|
||||
@@ -191,15 +215,24 @@ class UpdateGuardrailRequest(BaseModel):
|
||||
|
||||
"""
|
||||
|
||||
x_title: Annotated[
|
||||
x_open_router_title: Annotated[
|
||||
Optional[str],
|
||||
pydantic.Field(alias="X-Title"),
|
||||
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.
|
||||
|
||||
"""
|
||||
|
||||
|
||||
UpdateGuardrailResetIntervalResponse = Union[
|
||||
Literal[
|
||||
@@ -229,6 +262,8 @@ class UpdateGuardrailDataTypedDict(TypedDict):
|
||||
r"""Interval at which the limit resets (daily, weekly, monthly)"""
|
||||
allowed_providers: NotRequired[Nullable[List[str]]]
|
||||
r"""List of allowed provider IDs"""
|
||||
ignored_providers: NotRequired[Nullable[List[str]]]
|
||||
r"""List of provider IDs to exclude from routing"""
|
||||
allowed_models: NotRequired[Nullable[List[str]]]
|
||||
r"""Array of model canonical_slugs (immutable identifiers)"""
|
||||
enforce_zdr: NotRequired[Nullable[bool]]
|
||||
@@ -264,6 +299,9 @@ class UpdateGuardrailData(BaseModel):
|
||||
allowed_providers: OptionalNullable[List[str]] = UNSET
|
||||
r"""List of allowed provider IDs"""
|
||||
|
||||
ignored_providers: OptionalNullable[List[str]] = UNSET
|
||||
r"""List of provider IDs to exclude from routing"""
|
||||
|
||||
allowed_models: OptionalNullable[List[str]] = UNSET
|
||||
r"""Array of model canonical_slugs (immutable identifiers)"""
|
||||
|
||||
@@ -280,6 +318,7 @@ class UpdateGuardrailData(BaseModel):
|
||||
"limit_usd",
|
||||
"reset_interval",
|
||||
"allowed_providers",
|
||||
"ignored_providers",
|
||||
"allowed_models",
|
||||
"enforce_zdr",
|
||||
"updated_at",
|
||||
@@ -289,6 +328,7 @@ class UpdateGuardrailData(BaseModel):
|
||||
"limit_usd",
|
||||
"reset_interval",
|
||||
"allowed_providers",
|
||||
"ignored_providers",
|
||||
"allowed_models",
|
||||
"enforce_zdr",
|
||||
"updated_at",
|
||||
|
||||
@@ -30,10 +30,14 @@ class UpdateKeysGlobalsTypedDict(TypedDict):
|
||||
This is used to track API usage per application.
|
||||
|
||||
"""
|
||||
x_title: NotRequired[str]
|
||||
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 UpdateKeysGlobals(BaseModel):
|
||||
@@ -47,15 +51,24 @@ class UpdateKeysGlobals(BaseModel):
|
||||
|
||||
"""
|
||||
|
||||
x_title: Annotated[
|
||||
x_open_router_title: Annotated[
|
||||
Optional[str],
|
||||
pydantic.Field(alias="X-Title"),
|
||||
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.
|
||||
|
||||
"""
|
||||
|
||||
|
||||
UpdateKeysLimitReset = Union[
|
||||
Literal[
|
||||
@@ -146,10 +159,14 @@ class UpdateKeysRequestTypedDict(TypedDict):
|
||||
This is used to track API usage per application.
|
||||
|
||||
"""
|
||||
x_title: NotRequired[str]
|
||||
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 UpdateKeysRequest(BaseModel):
|
||||
@@ -173,15 +190,24 @@ class UpdateKeysRequest(BaseModel):
|
||||
|
||||
"""
|
||||
|
||||
x_title: Annotated[
|
||||
x_open_router_title: Annotated[
|
||||
Optional[str],
|
||||
pydantic.Field(alias="X-Title"),
|
||||
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 UpdateKeysDataTypedDict(TypedDict):
|
||||
r"""The updated API key information"""
|
||||
@@ -222,6 +248,8 @@ class UpdateKeysDataTypedDict(TypedDict):
|
||||
r"""ISO 8601 timestamp of when the API key was created"""
|
||||
updated_at: Nullable[str]
|
||||
r"""ISO 8601 timestamp of when the API key was last updated"""
|
||||
creator_user_id: Nullable[str]
|
||||
r"""The user ID of the key creator. For organization-owned keys, this is the member who created the key. For individual users, this is the user's own ID."""
|
||||
expires_at: NotRequired[Nullable[datetime]]
|
||||
r"""ISO 8601 UTC timestamp when the API key expires, or null if no expiration"""
|
||||
|
||||
@@ -283,6 +311,9 @@ class UpdateKeysData(BaseModel):
|
||||
updated_at: Nullable[str]
|
||||
r"""ISO 8601 timestamp of when the API key was last updated"""
|
||||
|
||||
creator_user_id: Nullable[str]
|
||||
r"""The user ID of the key creator. For organization-owned keys, this is the member who created the key. For individual users, this is the user's own ID."""
|
||||
|
||||
expires_at: OptionalNullable[datetime] = UNSET
|
||||
r"""ISO 8601 UTC timestamp when the API key expires, or null if no expiration"""
|
||||
|
||||
@@ -295,6 +326,7 @@ class UpdateKeysData(BaseModel):
|
||||
"limit_reset",
|
||||
"updated_at",
|
||||
"expires_at",
|
||||
"creator_user_id",
|
||||
]
|
||||
null_default_fields = []
|
||||
|
||||
|
||||
Reference in New Issue
Block a user