mirror of
https://github.com/wassname/openrouter-python-sdk-retry-errors.git
synced 2026-07-30 12:20:57 +08:00
fix: add overlay to remove nullable from pagination offset params (#121)
This commit is contained in:
@@ -76,9 +76,9 @@ class ListRequestTypedDict(TypedDict):
|
||||
r"""Comma-separated list of app categories (e.g. \"cli-agent,cloud-agent\"). Used for marketplace rankings.
|
||||
|
||||
"""
|
||||
include_disabled: NotRequired[str]
|
||||
include_disabled: NotRequired[bool]
|
||||
r"""Whether to include disabled API keys in the response"""
|
||||
offset: NotRequired[str]
|
||||
offset: NotRequired[int]
|
||||
r"""Number of API keys to skip for pagination"""
|
||||
|
||||
|
||||
@@ -112,74 +112,92 @@ class ListRequest(BaseModel):
|
||||
"""
|
||||
|
||||
include_disabled: Annotated[
|
||||
Optional[str],
|
||||
Optional[bool],
|
||||
FieldMetadata(query=QueryParamMetadata(style="form", explode=True)),
|
||||
] = None
|
||||
r"""Whether to include disabled API keys in the response"""
|
||||
|
||||
offset: Annotated[
|
||||
Optional[str],
|
||||
Optional[int],
|
||||
FieldMetadata(query=QueryParamMetadata(style="form", explode=True)),
|
||||
] = None
|
||||
r"""Number of API keys to skip for pagination"""
|
||||
|
||||
|
||||
class ListDataTypedDict(TypedDict):
|
||||
hash: str
|
||||
r"""Unique hash identifier for the API key"""
|
||||
name: str
|
||||
r"""Name of the API key"""
|
||||
label: str
|
||||
r"""Human-readable label for the API key"""
|
||||
byok_usage: float
|
||||
r"""Total external BYOK usage (in USD) for the API key"""
|
||||
byok_usage_daily: float
|
||||
r"""External BYOK usage (in USD) for the current UTC day"""
|
||||
byok_usage_monthly: float
|
||||
r"""External BYOK usage (in USD) for current UTC month"""
|
||||
byok_usage_weekly: float
|
||||
r"""External BYOK usage (in USD) for the current UTC week (Monday-Sunday)"""
|
||||
created_at: str
|
||||
r"""ISO 8601 timestamp of when the API key was created"""
|
||||
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."""
|
||||
disabled: bool
|
||||
r"""Whether the API key is disabled"""
|
||||
hash: str
|
||||
r"""Unique hash identifier for the API key"""
|
||||
include_byok_in_limit: bool
|
||||
r"""Whether to include external BYOK usage in the credit limit"""
|
||||
label: str
|
||||
r"""Human-readable label for the API key"""
|
||||
limit: Nullable[float]
|
||||
r"""Spending limit for the API key in USD"""
|
||||
limit_remaining: Nullable[float]
|
||||
r"""Remaining spending limit in USD"""
|
||||
limit_reset: Nullable[str]
|
||||
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"""
|
||||
name: str
|
||||
r"""Name of the API key"""
|
||||
updated_at: Nullable[str]
|
||||
r"""ISO 8601 timestamp of when the API key was last updated"""
|
||||
usage: float
|
||||
r"""Total OpenRouter credit usage (in USD) for the API key"""
|
||||
usage_daily: float
|
||||
r"""OpenRouter credit usage (in USD) for the current UTC day"""
|
||||
usage_weekly: float
|
||||
r"""OpenRouter credit usage (in USD) for the current UTC week (Monday-Sunday)"""
|
||||
usage_monthly: float
|
||||
r"""OpenRouter credit usage (in USD) for the current UTC month"""
|
||||
byok_usage: float
|
||||
r"""Total external BYOK usage (in USD) for the API key"""
|
||||
byok_usage_daily: float
|
||||
r"""External BYOK usage (in USD) for the current UTC day"""
|
||||
byok_usage_weekly: float
|
||||
r"""External BYOK usage (in USD) for the current UTC week (Monday-Sunday)"""
|
||||
byok_usage_monthly: float
|
||||
r"""External BYOK usage (in USD) for current UTC month"""
|
||||
created_at: str
|
||||
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."""
|
||||
usage_weekly: float
|
||||
r"""OpenRouter credit usage (in USD) for the current UTC week (Monday-Sunday)"""
|
||||
expires_at: NotRequired[Nullable[datetime]]
|
||||
r"""ISO 8601 UTC timestamp when the API key expires, or null if no expiration"""
|
||||
|
||||
|
||||
class ListData(BaseModel):
|
||||
hash: str
|
||||
r"""Unique hash identifier for the API key"""
|
||||
byok_usage: float
|
||||
r"""Total external BYOK usage (in USD) for the API key"""
|
||||
|
||||
name: str
|
||||
r"""Name of the API key"""
|
||||
byok_usage_daily: float
|
||||
r"""External BYOK usage (in USD) for the current UTC day"""
|
||||
|
||||
label: str
|
||||
r"""Human-readable label for the API key"""
|
||||
byok_usage_monthly: float
|
||||
r"""External BYOK usage (in USD) for current UTC month"""
|
||||
|
||||
byok_usage_weekly: float
|
||||
r"""External BYOK usage (in USD) for the current UTC week (Monday-Sunday)"""
|
||||
|
||||
created_at: str
|
||||
r"""ISO 8601 timestamp of when the API key was created"""
|
||||
|
||||
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."""
|
||||
|
||||
disabled: bool
|
||||
r"""Whether the API key is disabled"""
|
||||
|
||||
hash: str
|
||||
r"""Unique hash identifier for the API key"""
|
||||
|
||||
include_byok_in_limit: bool
|
||||
r"""Whether to include external BYOK usage in the credit limit"""
|
||||
|
||||
label: str
|
||||
r"""Human-readable label for the API key"""
|
||||
|
||||
limit: Nullable[float]
|
||||
r"""Spending limit for the API key in USD"""
|
||||
|
||||
@@ -189,8 +207,11 @@ class ListData(BaseModel):
|
||||
limit_reset: Nullable[str]
|
||||
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"""
|
||||
name: str
|
||||
r"""Name of the API key"""
|
||||
|
||||
updated_at: Nullable[str]
|
||||
r"""ISO 8601 timestamp of when the API key was last updated"""
|
||||
|
||||
usage: float
|
||||
r"""Total OpenRouter credit usage (in USD) for the API key"""
|
||||
@@ -198,32 +219,11 @@ class ListData(BaseModel):
|
||||
usage_daily: float
|
||||
r"""OpenRouter credit usage (in USD) for the current UTC day"""
|
||||
|
||||
usage_weekly: float
|
||||
r"""OpenRouter credit usage (in USD) for the current UTC week (Monday-Sunday)"""
|
||||
|
||||
usage_monthly: float
|
||||
r"""OpenRouter credit usage (in USD) for the current UTC month"""
|
||||
|
||||
byok_usage: float
|
||||
r"""Total external BYOK usage (in USD) for the API key"""
|
||||
|
||||
byok_usage_daily: float
|
||||
r"""External BYOK usage (in USD) for the current UTC day"""
|
||||
|
||||
byok_usage_weekly: float
|
||||
r"""External BYOK usage (in USD) for the current UTC week (Monday-Sunday)"""
|
||||
|
||||
byok_usage_monthly: float
|
||||
r"""External BYOK usage (in USD) for current UTC month"""
|
||||
|
||||
created_at: str
|
||||
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."""
|
||||
usage_weekly: float
|
||||
r"""OpenRouter credit usage (in USD) for the current UTC week (Monday-Sunday)"""
|
||||
|
||||
expires_at: OptionalNullable[datetime] = UNSET
|
||||
r"""ISO 8601 UTC timestamp when the API key expires, or null if no expiration"""
|
||||
@@ -232,12 +232,12 @@ class ListData(BaseModel):
|
||||
def serialize_model(self, handler):
|
||||
optional_fields = ["expires_at"]
|
||||
nullable_fields = [
|
||||
"creator_user_id",
|
||||
"expires_at",
|
||||
"limit",
|
||||
"limit_remaining",
|
||||
"limit_reset",
|
||||
"updated_at",
|
||||
"expires_at",
|
||||
"creator_user_id",
|
||||
]
|
||||
null_default_fields = []
|
||||
|
||||
|
||||
Reference in New Issue
Block a user