mirror of
https://github.com/wassname/openrouter-python-sdk-retry-errors.git
synced 2026-07-30 12:20:57 +08:00
Project import generated by Copybara.
GitOrigin-RevId: 2592bdc8b4b7c695a3d689390aedc9a42914acc8
This commit is contained in:
@@ -3,10 +3,10 @@
|
||||
import importlib.metadata
|
||||
|
||||
__title__: str = "openrouter"
|
||||
__version__: str = "0.1.2"
|
||||
__version__: str = "0.1.3"
|
||||
__openapi_doc_version__: str = "1.0.0"
|
||||
__gen_version__: str = "2.768.0"
|
||||
__user_agent__: str = "speakeasy-sdk/python 0.1.2 2.768.0 1.0.0 openrouter"
|
||||
__user_agent__: str = "speakeasy-sdk/python 0.1.3 2.768.0 1.0.0 openrouter"
|
||||
|
||||
try:
|
||||
if __package__ is not None:
|
||||
|
||||
@@ -23,7 +23,7 @@ class Analytics(BaseSDK):
|
||||
) -> operations.GetUserActivityResponse:
|
||||
r"""Get user activity grouped by endpoint
|
||||
|
||||
Returns user activity data grouped by endpoint for the last 30 (completed) UTC days
|
||||
Returns user activity data grouped by endpoint for the last 30 (completed) UTC days. [Provisioning key](/docs/guides/overview/auth/provisioning-api-keys) required.
|
||||
|
||||
:param date_: Filter by a single UTC date in the last 30 days (YYYY-MM-DD format).
|
||||
:param retries: Override the default retry configuration for this method
|
||||
@@ -132,7 +132,7 @@ class Analytics(BaseSDK):
|
||||
) -> operations.GetUserActivityResponse:
|
||||
r"""Get user activity grouped by endpoint
|
||||
|
||||
Returns user activity data grouped by endpoint for the last 30 (completed) UTC days
|
||||
Returns user activity data grouped by endpoint for the last 30 (completed) UTC days. [Provisioning key](/docs/guides/overview/auth/provisioning-api-keys) required.
|
||||
|
||||
:param date_: Filter by a single UTC date in the last 30 days (YYYY-MM-DD format).
|
||||
:param retries: Override the default retry configuration for this method
|
||||
|
||||
@@ -25,6 +25,8 @@ class APIKeys(BaseSDK):
|
||||
) -> operations.ListResponse:
|
||||
r"""List API keys
|
||||
|
||||
List all API keys for the authenticated user. [Provisioning key](/docs/guides/overview/auth/provisioning-api-keys) required.
|
||||
|
||||
:param include_disabled: Whether to include disabled API keys in the response
|
||||
:param offset: Number of API keys to skip for pagination
|
||||
:param retries: Override the default retry configuration for this method
|
||||
@@ -130,6 +132,8 @@ class APIKeys(BaseSDK):
|
||||
) -> operations.ListResponse:
|
||||
r"""List API keys
|
||||
|
||||
List all API keys for the authenticated user. [Provisioning key](/docs/guides/overview/auth/provisioning-api-keys) required.
|
||||
|
||||
:param include_disabled: Whether to include disabled API keys in the response
|
||||
:param offset: Number of API keys to skip for pagination
|
||||
:param retries: Override the default retry configuration for this method
|
||||
@@ -238,6 +242,8 @@ class APIKeys(BaseSDK):
|
||||
) -> operations.CreateKeysResponse:
|
||||
r"""Create a new API key
|
||||
|
||||
Create a new API key for the authenticated user. [Provisioning key](/docs/guides/overview/auth/provisioning-api-keys) required.
|
||||
|
||||
:param name: Name for the new API key
|
||||
:param limit: Optional spending limit for the API key in USD
|
||||
:param limit_reset: Type of limit reset for the API key (daily, weekly, monthly, or null for no reset). Resets happen automatically at midnight UTC, and weeks are Monday through Sunday.
|
||||
@@ -360,6 +366,8 @@ class APIKeys(BaseSDK):
|
||||
) -> operations.CreateKeysResponse:
|
||||
r"""Create a new API key
|
||||
|
||||
Create a new API key for the authenticated user. [Provisioning key](/docs/guides/overview/auth/provisioning-api-keys) required.
|
||||
|
||||
:param name: Name for the new API key
|
||||
:param limit: Optional spending limit for the API key in USD
|
||||
:param limit_reset: Type of limit reset for the API key (daily, weekly, monthly, or null for no reset). Resets happen automatically at midnight UTC, and weeks are Monday through Sunday.
|
||||
@@ -483,6 +491,8 @@ class APIKeys(BaseSDK):
|
||||
) -> operations.UpdateKeysResponse:
|
||||
r"""Update an API key
|
||||
|
||||
Update an existing API key. [Provisioning key](/docs/guides/overview/auth/provisioning-api-keys) required.
|
||||
|
||||
:param hash: The hash identifier of the API key to update
|
||||
:param name: New name for the API key
|
||||
:param disabled: Whether to disable the API key
|
||||
@@ -619,6 +629,8 @@ class APIKeys(BaseSDK):
|
||||
) -> operations.UpdateKeysResponse:
|
||||
r"""Update an API key
|
||||
|
||||
Update an existing API key. [Provisioning key](/docs/guides/overview/auth/provisioning-api-keys) required.
|
||||
|
||||
:param hash: The hash identifier of the API key to update
|
||||
:param name: New name for the API key
|
||||
:param disabled: Whether to disable the API key
|
||||
@@ -750,6 +762,8 @@ class APIKeys(BaseSDK):
|
||||
) -> operations.DeleteKeysResponse:
|
||||
r"""Delete an API key
|
||||
|
||||
Delete an existing API key. [Provisioning key](/docs/guides/overview/auth/provisioning-api-keys) required.
|
||||
|
||||
:param hash: The hash identifier of the API key to delete
|
||||
:param retries: Override the default retry configuration for this method
|
||||
:param server_url: Override the default server URL for this method
|
||||
@@ -857,6 +871,8 @@ class APIKeys(BaseSDK):
|
||||
) -> operations.DeleteKeysResponse:
|
||||
r"""Delete an API key
|
||||
|
||||
Delete an existing API key. [Provisioning key](/docs/guides/overview/auth/provisioning-api-keys) required.
|
||||
|
||||
:param hash: The hash identifier of the API key to delete
|
||||
:param retries: Override the default retry configuration for this method
|
||||
:param server_url: Override the default server URL for this method
|
||||
@@ -964,6 +980,8 @@ class APIKeys(BaseSDK):
|
||||
) -> operations.GetKeyResponse:
|
||||
r"""Get a single API key
|
||||
|
||||
Get a single API key by hash. [Provisioning key](/docs/guides/overview/auth/provisioning-api-keys) required.
|
||||
|
||||
:param hash: The hash identifier of the API key to retrieve
|
||||
:param retries: Override the default retry configuration for this method
|
||||
:param server_url: Override the default server URL for this method
|
||||
@@ -1071,6 +1089,8 @@ class APIKeys(BaseSDK):
|
||||
) -> operations.GetKeyResponse:
|
||||
r"""Get a single API key
|
||||
|
||||
Get a single API key by hash. [Provisioning key](/docs/guides/overview/auth/provisioning-api-keys) required.
|
||||
|
||||
:param hash: The hash identifier of the API key to retrieve
|
||||
:param retries: Override the default retry configuration for this method
|
||||
:param server_url: Override the default server URL for this method
|
||||
|
||||
@@ -7,23 +7,27 @@ import sys
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from ._schema0 import Schema0, Schema0Enum, Schema0TypedDict
|
||||
from ._schema3 import (
|
||||
Schema3,
|
||||
Schema3ReasoningEncrypted,
|
||||
Schema3ReasoningEncryptedTypedDict,
|
||||
Schema3ReasoningSummary,
|
||||
Schema3ReasoningSummaryTypedDict,
|
||||
Schema3ReasoningText,
|
||||
Schema3ReasoningTextTypedDict,
|
||||
Schema3TypedDict,
|
||||
Schema5,
|
||||
from ._schema2 import (
|
||||
Schema2,
|
||||
Schema2ReasoningEncrypted,
|
||||
Schema2ReasoningEncryptedTypedDict,
|
||||
Schema2ReasoningSummary,
|
||||
Schema2ReasoningSummaryTypedDict,
|
||||
Schema2ReasoningText,
|
||||
Schema2ReasoningTextTypedDict,
|
||||
Schema2TypedDict,
|
||||
Schema4,
|
||||
)
|
||||
from .activityitem import ActivityItem, ActivityItemTypedDict
|
||||
from .assistantmessage import (
|
||||
AssistantMessage,
|
||||
AssistantMessageContent,
|
||||
AssistantMessageContentTypedDict,
|
||||
AssistantMessageImageURL,
|
||||
AssistantMessageImageURLTypedDict,
|
||||
AssistantMessageTypedDict,
|
||||
Image,
|
||||
ImageTypedDict,
|
||||
)
|
||||
from .badgatewayresponseerrordata import (
|
||||
BadGatewayResponseErrorData,
|
||||
@@ -114,9 +118,9 @@ if TYPE_CHECKING:
|
||||
from .chatmessagecontentitemimage import (
|
||||
ChatMessageContentItemImage,
|
||||
ChatMessageContentItemImageDetail,
|
||||
ChatMessageContentItemImageImageURL,
|
||||
ChatMessageContentItemImageImageURLTypedDict,
|
||||
ChatMessageContentItemImageTypedDict,
|
||||
ImageURL,
|
||||
ImageURLTypedDict,
|
||||
)
|
||||
from .chatmessagecontentitemtext import (
|
||||
ChatMessageContentItemText,
|
||||
@@ -913,6 +917,8 @@ __all__ = [
|
||||
"AssistantMessage",
|
||||
"AssistantMessageContent",
|
||||
"AssistantMessageContentTypedDict",
|
||||
"AssistantMessageImageURL",
|
||||
"AssistantMessageImageURLTypedDict",
|
||||
"AssistantMessageTypedDict",
|
||||
"BadGatewayResponseErrorData",
|
||||
"BadGatewayResponseErrorDataTypedDict",
|
||||
@@ -972,6 +978,8 @@ __all__ = [
|
||||
"ChatMessageContentItemCacheControlTypedDict",
|
||||
"ChatMessageContentItemImage",
|
||||
"ChatMessageContentItemImageDetail",
|
||||
"ChatMessageContentItemImageImageURL",
|
||||
"ChatMessageContentItemImageImageURLTypedDict",
|
||||
"ChatMessageContentItemImageTypedDict",
|
||||
"ChatMessageContentItemText",
|
||||
"ChatMessageContentItemTextTypedDict",
|
||||
@@ -1066,9 +1074,9 @@ __all__ = [
|
||||
"IDModeration",
|
||||
"IDResponseHealing",
|
||||
"IDWeb",
|
||||
"Image",
|
||||
"ImageGenerationStatus",
|
||||
"ImageURL",
|
||||
"ImageURLTypedDict",
|
||||
"ImageTypedDict",
|
||||
"InputModality",
|
||||
"InputTokensDetails",
|
||||
"InputTokensDetailsTypedDict",
|
||||
@@ -1540,15 +1548,15 @@ __all__ = [
|
||||
"Schema0",
|
||||
"Schema0Enum",
|
||||
"Schema0TypedDict",
|
||||
"Schema3",
|
||||
"Schema3ReasoningEncrypted",
|
||||
"Schema3ReasoningEncryptedTypedDict",
|
||||
"Schema3ReasoningSummary",
|
||||
"Schema3ReasoningSummaryTypedDict",
|
||||
"Schema3ReasoningText",
|
||||
"Schema3ReasoningTextTypedDict",
|
||||
"Schema3TypedDict",
|
||||
"Schema5",
|
||||
"Schema2",
|
||||
"Schema2ReasoningEncrypted",
|
||||
"Schema2ReasoningEncryptedTypedDict",
|
||||
"Schema2ReasoningSummary",
|
||||
"Schema2ReasoningSummaryTypedDict",
|
||||
"Schema2ReasoningText",
|
||||
"Schema2ReasoningTextTypedDict",
|
||||
"Schema2TypedDict",
|
||||
"Schema4",
|
||||
"Security",
|
||||
"SecurityTypedDict",
|
||||
"ServiceTier",
|
||||
@@ -1624,21 +1632,25 @@ _dynamic_imports: dict[str, str] = {
|
||||
"Schema0": "._schema0",
|
||||
"Schema0Enum": "._schema0",
|
||||
"Schema0TypedDict": "._schema0",
|
||||
"Schema3": "._schema3",
|
||||
"Schema3ReasoningEncrypted": "._schema3",
|
||||
"Schema3ReasoningEncryptedTypedDict": "._schema3",
|
||||
"Schema3ReasoningSummary": "._schema3",
|
||||
"Schema3ReasoningSummaryTypedDict": "._schema3",
|
||||
"Schema3ReasoningText": "._schema3",
|
||||
"Schema3ReasoningTextTypedDict": "._schema3",
|
||||
"Schema3TypedDict": "._schema3",
|
||||
"Schema5": "._schema3",
|
||||
"Schema2": "._schema2",
|
||||
"Schema2ReasoningEncrypted": "._schema2",
|
||||
"Schema2ReasoningEncryptedTypedDict": "._schema2",
|
||||
"Schema2ReasoningSummary": "._schema2",
|
||||
"Schema2ReasoningSummaryTypedDict": "._schema2",
|
||||
"Schema2ReasoningText": "._schema2",
|
||||
"Schema2ReasoningTextTypedDict": "._schema2",
|
||||
"Schema2TypedDict": "._schema2",
|
||||
"Schema4": "._schema2",
|
||||
"ActivityItem": ".activityitem",
|
||||
"ActivityItemTypedDict": ".activityitem",
|
||||
"AssistantMessage": ".assistantmessage",
|
||||
"AssistantMessageContent": ".assistantmessage",
|
||||
"AssistantMessageContentTypedDict": ".assistantmessage",
|
||||
"AssistantMessageImageURL": ".assistantmessage",
|
||||
"AssistantMessageImageURLTypedDict": ".assistantmessage",
|
||||
"AssistantMessageTypedDict": ".assistantmessage",
|
||||
"Image": ".assistantmessage",
|
||||
"ImageTypedDict": ".assistantmessage",
|
||||
"BadGatewayResponseErrorData": ".badgatewayresponseerrordata",
|
||||
"BadGatewayResponseErrorDataTypedDict": ".badgatewayresponseerrordata",
|
||||
"BadRequestResponseErrorData": ".badrequestresponseerrordata",
|
||||
@@ -1716,9 +1728,9 @@ _dynamic_imports: dict[str, str] = {
|
||||
"TTL": ".chatmessagecontentitemcachecontrol",
|
||||
"ChatMessageContentItemImage": ".chatmessagecontentitemimage",
|
||||
"ChatMessageContentItemImageDetail": ".chatmessagecontentitemimage",
|
||||
"ChatMessageContentItemImageImageURL": ".chatmessagecontentitemimage",
|
||||
"ChatMessageContentItemImageImageURLTypedDict": ".chatmessagecontentitemimage",
|
||||
"ChatMessageContentItemImageTypedDict": ".chatmessagecontentitemimage",
|
||||
"ImageURL": ".chatmessagecontentitemimage",
|
||||
"ImageURLTypedDict": ".chatmessagecontentitemimage",
|
||||
"ChatMessageContentItemText": ".chatmessagecontentitemtext",
|
||||
"ChatMessageContentItemTextTypedDict": ".chatmessagecontentitemtext",
|
||||
"ChatMessageContentItemVideo": ".chatmessagecontentitemvideo",
|
||||
|
||||
@@ -17,7 +17,7 @@ from typing import Literal, Optional, Union
|
||||
from typing_extensions import Annotated, NotRequired, TypeAliasType, TypedDict
|
||||
|
||||
|
||||
Schema5 = Union[
|
||||
Schema4 = Union[
|
||||
Literal[
|
||||
"unknown",
|
||||
"openai-responses-v1",
|
||||
@@ -30,16 +30,16 @@ Schema5 = Union[
|
||||
]
|
||||
|
||||
|
||||
class Schema3ReasoningTextTypedDict(TypedDict):
|
||||
class Schema2ReasoningTextTypedDict(TypedDict):
|
||||
type: Literal["reasoning.text"]
|
||||
text: NotRequired[Nullable[str]]
|
||||
signature: NotRequired[Nullable[str]]
|
||||
id: NotRequired[Nullable[str]]
|
||||
format_: NotRequired[Nullable[Schema5]]
|
||||
format_: NotRequired[Nullable[Schema4]]
|
||||
index: NotRequired[float]
|
||||
|
||||
|
||||
class Schema3ReasoningText(BaseModel):
|
||||
class Schema2ReasoningText(BaseModel):
|
||||
TYPE: Annotated[
|
||||
Annotated[
|
||||
Literal["reasoning.text"], AfterValidator(validate_const("reasoning.text"))
|
||||
@@ -54,7 +54,7 @@ class Schema3ReasoningText(BaseModel):
|
||||
id: OptionalNullable[str] = UNSET
|
||||
|
||||
format_: Annotated[
|
||||
Annotated[OptionalNullable[Schema5], PlainValidator(validate_open_enum(False))],
|
||||
Annotated[OptionalNullable[Schema4], PlainValidator(validate_open_enum(False))],
|
||||
pydantic.Field(alias="format"),
|
||||
] = UNSET
|
||||
|
||||
@@ -91,15 +91,15 @@ class Schema3ReasoningText(BaseModel):
|
||||
return m
|
||||
|
||||
|
||||
class Schema3ReasoningEncryptedTypedDict(TypedDict):
|
||||
class Schema2ReasoningEncryptedTypedDict(TypedDict):
|
||||
data: str
|
||||
type: Literal["reasoning.encrypted"]
|
||||
id: NotRequired[Nullable[str]]
|
||||
format_: NotRequired[Nullable[Schema5]]
|
||||
format_: NotRequired[Nullable[Schema4]]
|
||||
index: NotRequired[float]
|
||||
|
||||
|
||||
class Schema3ReasoningEncrypted(BaseModel):
|
||||
class Schema2ReasoningEncrypted(BaseModel):
|
||||
data: str
|
||||
|
||||
TYPE: Annotated[
|
||||
@@ -113,7 +113,7 @@ class Schema3ReasoningEncrypted(BaseModel):
|
||||
id: OptionalNullable[str] = UNSET
|
||||
|
||||
format_: Annotated[
|
||||
Annotated[OptionalNullable[Schema5], PlainValidator(validate_open_enum(False))],
|
||||
Annotated[OptionalNullable[Schema4], PlainValidator(validate_open_enum(False))],
|
||||
pydantic.Field(alias="format"),
|
||||
] = UNSET
|
||||
|
||||
@@ -150,15 +150,15 @@ class Schema3ReasoningEncrypted(BaseModel):
|
||||
return m
|
||||
|
||||
|
||||
class Schema3ReasoningSummaryTypedDict(TypedDict):
|
||||
class Schema2ReasoningSummaryTypedDict(TypedDict):
|
||||
summary: str
|
||||
type: Literal["reasoning.summary"]
|
||||
id: NotRequired[Nullable[str]]
|
||||
format_: NotRequired[Nullable[Schema5]]
|
||||
format_: NotRequired[Nullable[Schema4]]
|
||||
index: NotRequired[float]
|
||||
|
||||
|
||||
class Schema3ReasoningSummary(BaseModel):
|
||||
class Schema2ReasoningSummary(BaseModel):
|
||||
summary: str
|
||||
|
||||
TYPE: Annotated[
|
||||
@@ -172,7 +172,7 @@ class Schema3ReasoningSummary(BaseModel):
|
||||
id: OptionalNullable[str] = UNSET
|
||||
|
||||
format_: Annotated[
|
||||
Annotated[OptionalNullable[Schema5], PlainValidator(validate_open_enum(False))],
|
||||
Annotated[OptionalNullable[Schema4], PlainValidator(validate_open_enum(False))],
|
||||
pydantic.Field(alias="format"),
|
||||
] = UNSET
|
||||
|
||||
@@ -209,21 +209,21 @@ class Schema3ReasoningSummary(BaseModel):
|
||||
return m
|
||||
|
||||
|
||||
Schema3TypedDict = TypeAliasType(
|
||||
"Schema3TypedDict",
|
||||
Schema2TypedDict = TypeAliasType(
|
||||
"Schema2TypedDict",
|
||||
Union[
|
||||
Schema3ReasoningSummaryTypedDict,
|
||||
Schema3ReasoningEncryptedTypedDict,
|
||||
Schema3ReasoningTextTypedDict,
|
||||
Schema2ReasoningSummaryTypedDict,
|
||||
Schema2ReasoningEncryptedTypedDict,
|
||||
Schema2ReasoningTextTypedDict,
|
||||
],
|
||||
)
|
||||
|
||||
|
||||
Schema3 = Annotated[
|
||||
Schema2 = Annotated[
|
||||
Union[
|
||||
Annotated[Schema3ReasoningSummary, Tag("reasoning.summary")],
|
||||
Annotated[Schema3ReasoningEncrypted, Tag("reasoning.encrypted")],
|
||||
Annotated[Schema3ReasoningText, Tag("reasoning.text")],
|
||||
Annotated[Schema2ReasoningSummary, Tag("reasoning.summary")],
|
||||
Annotated[Schema2ReasoningEncrypted, Tag("reasoning.encrypted")],
|
||||
Annotated[Schema2ReasoningText, Tag("reasoning.text")],
|
||||
],
|
||||
Discriminator(lambda m: get_discriminator(m, "type", "type")),
|
||||
]
|
||||
@@ -1,6 +1,7 @@
|
||||
"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
|
||||
|
||||
from __future__ import annotations
|
||||
from ._schema2 import Schema2, Schema2TypedDict
|
||||
from .chatmessagecontentitem import (
|
||||
ChatMessageContentItem,
|
||||
ChatMessageContentItemTypedDict,
|
||||
@@ -32,6 +33,22 @@ AssistantMessageContent = TypeAliasType(
|
||||
)
|
||||
|
||||
|
||||
class AssistantMessageImageURLTypedDict(TypedDict):
|
||||
url: str
|
||||
|
||||
|
||||
class AssistantMessageImageURL(BaseModel):
|
||||
url: str
|
||||
|
||||
|
||||
class ImageTypedDict(TypedDict):
|
||||
image_url: AssistantMessageImageURLTypedDict
|
||||
|
||||
|
||||
class Image(BaseModel):
|
||||
image_url: AssistantMessageImageURL
|
||||
|
||||
|
||||
class AssistantMessageTypedDict(TypedDict):
|
||||
role: Literal["assistant"]
|
||||
content: NotRequired[Nullable[AssistantMessageContentTypedDict]]
|
||||
@@ -39,6 +56,8 @@ class AssistantMessageTypedDict(TypedDict):
|
||||
tool_calls: NotRequired[List[ChatMessageToolCallTypedDict]]
|
||||
refusal: NotRequired[Nullable[str]]
|
||||
reasoning: NotRequired[Nullable[str]]
|
||||
reasoning_details: NotRequired[List[Schema2TypedDict]]
|
||||
images: NotRequired[List[ImageTypedDict]]
|
||||
|
||||
|
||||
class AssistantMessage(BaseModel):
|
||||
@@ -57,9 +76,21 @@ class AssistantMessage(BaseModel):
|
||||
|
||||
reasoning: OptionalNullable[str] = UNSET
|
||||
|
||||
reasoning_details: Optional[List[Schema2]] = None
|
||||
|
||||
images: Optional[List[Image]] = None
|
||||
|
||||
@model_serializer(mode="wrap")
|
||||
def serialize_model(self, handler):
|
||||
optional_fields = ["content", "name", "tool_calls", "refusal", "reasoning"]
|
||||
optional_fields = [
|
||||
"content",
|
||||
"name",
|
||||
"tool_calls",
|
||||
"refusal",
|
||||
"reasoning",
|
||||
"reasoning_details",
|
||||
"images",
|
||||
]
|
||||
nullable_fields = ["content", "refusal", "reasoning"]
|
||||
null_default_fields = []
|
||||
|
||||
|
||||
@@ -19,12 +19,12 @@ ChatMessageContentItemImageDetail = Union[
|
||||
]
|
||||
|
||||
|
||||
class ImageURLTypedDict(TypedDict):
|
||||
class ChatMessageContentItemImageImageURLTypedDict(TypedDict):
|
||||
url: str
|
||||
detail: NotRequired[ChatMessageContentItemImageDetail]
|
||||
|
||||
|
||||
class ImageURL(BaseModel):
|
||||
class ChatMessageContentItemImageImageURL(BaseModel):
|
||||
url: str
|
||||
|
||||
detail: Annotated[
|
||||
@@ -34,12 +34,12 @@ class ImageURL(BaseModel):
|
||||
|
||||
|
||||
class ChatMessageContentItemImageTypedDict(TypedDict):
|
||||
image_url: ImageURLTypedDict
|
||||
image_url: ChatMessageContentItemImageImageURLTypedDict
|
||||
type: Literal["image_url"]
|
||||
|
||||
|
||||
class ChatMessageContentItemImage(BaseModel):
|
||||
image_url: ImageURL
|
||||
image_url: ChatMessageContentItemImageImageURL
|
||||
|
||||
TYPE: Annotated[
|
||||
Annotated[Literal["image_url"], AfterValidator(validate_const("image_url"))],
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
|
||||
|
||||
from __future__ import annotations
|
||||
from ._schema3 import Schema3, Schema3TypedDict
|
||||
from .assistantmessage import AssistantMessage, AssistantMessageTypedDict
|
||||
from .chatcompletionfinishreason import ChatCompletionFinishReason
|
||||
from .chatmessagetokenlogprobs import (
|
||||
@@ -18,7 +17,6 @@ from openrouter.types import (
|
||||
from openrouter.utils import validate_open_enum
|
||||
from pydantic import model_serializer
|
||||
from pydantic.functional_validators import PlainValidator
|
||||
from typing import List, Optional
|
||||
from typing_extensions import Annotated, NotRequired, TypedDict
|
||||
|
||||
|
||||
@@ -26,7 +24,6 @@ class ChatResponseChoiceTypedDict(TypedDict):
|
||||
finish_reason: Nullable[ChatCompletionFinishReason]
|
||||
index: float
|
||||
message: AssistantMessageTypedDict
|
||||
reasoning_details: NotRequired[List[Schema3TypedDict]]
|
||||
logprobs: NotRequired[Nullable[ChatMessageTokenLogprobsTypedDict]]
|
||||
|
||||
|
||||
@@ -39,13 +36,11 @@ class ChatResponseChoice(BaseModel):
|
||||
|
||||
message: AssistantMessage
|
||||
|
||||
reasoning_details: Optional[List[Schema3]] = None
|
||||
|
||||
logprobs: OptionalNullable[ChatMessageTokenLogprobs] = UNSET
|
||||
|
||||
@model_serializer(mode="wrap")
|
||||
def serialize_model(self, handler):
|
||||
optional_fields = ["reasoning_details", "logprobs"]
|
||||
optional_fields = ["logprobs"]
|
||||
nullable_fields = ["finish_reason", "logprobs"]
|
||||
null_default_fields = []
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
|
||||
|
||||
from __future__ import annotations
|
||||
from ._schema3 import Schema3, Schema3TypedDict
|
||||
from ._schema2 import Schema2, Schema2TypedDict
|
||||
from .chatstreamingmessagetoolcall import (
|
||||
ChatStreamingMessageToolCall,
|
||||
ChatStreamingMessageToolCallTypedDict,
|
||||
@@ -27,7 +27,7 @@ class ChatStreamingMessageChunkTypedDict(TypedDict):
|
||||
reasoning: NotRequired[Nullable[str]]
|
||||
refusal: NotRequired[Nullable[str]]
|
||||
tool_calls: NotRequired[List[ChatStreamingMessageToolCallTypedDict]]
|
||||
reasoning_details: NotRequired[List[Schema3TypedDict]]
|
||||
reasoning_details: NotRequired[List[Schema2TypedDict]]
|
||||
|
||||
|
||||
class ChatStreamingMessageChunk(BaseModel):
|
||||
@@ -41,7 +41,7 @@ class ChatStreamingMessageChunk(BaseModel):
|
||||
|
||||
tool_calls: Optional[List[ChatStreamingMessageToolCall]] = None
|
||||
|
||||
reasoning_details: Optional[List[Schema3]] = None
|
||||
reasoning_details: Optional[List[Schema2]] = None
|
||||
|
||||
@model_serializer(mode="wrap")
|
||||
def serialize_model(self, handler):
|
||||
|
||||
@@ -50,6 +50,8 @@ class ModelTypedDict(TypedDict):
|
||||
r"""Hugging Face model identifier, if applicable"""
|
||||
description: NotRequired[str]
|
||||
r"""Description of the model"""
|
||||
expiration_date: NotRequired[Nullable[str]]
|
||||
r"""The date after which the model may be removed. ISO 8601 date string (YYYY-MM-DD) or null if no expiration."""
|
||||
|
||||
|
||||
class Model(BaseModel):
|
||||
@@ -96,14 +98,18 @@ class Model(BaseModel):
|
||||
description: Optional[str] = None
|
||||
r"""Description of the model"""
|
||||
|
||||
expiration_date: OptionalNullable[str] = UNSET
|
||||
r"""The date after which the model may be removed. ISO 8601 date string (YYYY-MM-DD) or null if no expiration."""
|
||||
|
||||
@model_serializer(mode="wrap")
|
||||
def serialize_model(self, handler):
|
||||
optional_fields = ["hugging_face_id", "description"]
|
||||
optional_fields = ["hugging_face_id", "description", "expiration_date"]
|
||||
nullable_fields = [
|
||||
"hugging_face_id",
|
||||
"context_length",
|
||||
"per_request_limits",
|
||||
"default_parameters",
|
||||
"expiration_date",
|
||||
]
|
||||
null_default_fields = []
|
||||
|
||||
|
||||
@@ -10,6 +10,7 @@ OutputModality = Union[
|
||||
"text",
|
||||
"image",
|
||||
"embeddings",
|
||||
"audio",
|
||||
],
|
||||
UnrecognizedStr,
|
||||
]
|
||||
|
||||
@@ -28,6 +28,8 @@ class PricingTypedDict(TypedDict):
|
||||
r"""A value in string format that is a large number"""
|
||||
audio: NotRequired[str]
|
||||
r"""A value in string format that is a large number"""
|
||||
audio_output: NotRequired[str]
|
||||
r"""A value in string format that is a large number"""
|
||||
input_audio_cache: NotRequired[str]
|
||||
r"""A value in string format that is a large number"""
|
||||
web_search: NotRequired[str]
|
||||
@@ -63,6 +65,9 @@ class Pricing(BaseModel):
|
||||
audio: Optional[str] = None
|
||||
r"""A value in string format that is a large number"""
|
||||
|
||||
audio_output: Optional[str] = None
|
||||
r"""A value in string format that is a large number"""
|
||||
|
||||
input_audio_cache: Optional[str] = None
|
||||
r"""A value in string format that is a large number"""
|
||||
|
||||
@@ -101,6 +106,8 @@ class PublicEndpointTypedDict(TypedDict):
|
||||
r"""Information about a specific model endpoint"""
|
||||
|
||||
name: str
|
||||
model_id: str
|
||||
r"""The unique identifier for the model (permaslug)"""
|
||||
model_name: str
|
||||
context_length: float
|
||||
pricing: PricingTypedDict
|
||||
@@ -123,6 +130,9 @@ class PublicEndpoint(BaseModel):
|
||||
|
||||
name: str
|
||||
|
||||
model_id: str
|
||||
r"""The unique identifier for the model (permaslug)"""
|
||||
|
||||
model_name: str
|
||||
|
||||
context_length: float
|
||||
|
||||
@@ -23,6 +23,8 @@ class PublicPricingTypedDict(TypedDict):
|
||||
r"""A value in string format that is a large number"""
|
||||
audio: NotRequired[str]
|
||||
r"""A value in string format that is a large number"""
|
||||
audio_output: NotRequired[str]
|
||||
r"""A value in string format that is a large number"""
|
||||
input_audio_cache: NotRequired[str]
|
||||
r"""A value in string format that is a large number"""
|
||||
web_search: NotRequired[str]
|
||||
@@ -60,6 +62,9 @@ class PublicPricing(BaseModel):
|
||||
audio: Optional[str] = None
|
||||
r"""A value in string format that is a large number"""
|
||||
|
||||
audio_output: Optional[str] = None
|
||||
r"""A value in string format that is a large number"""
|
||||
|
||||
input_audio_cache: Optional[str] = None
|
||||
r"""A value in string format that is a large number"""
|
||||
|
||||
|
||||
@@ -22,7 +22,7 @@ class Credits(BaseSDK):
|
||||
) -> operations.GetCreditsResponse:
|
||||
r"""Get remaining credits
|
||||
|
||||
Get total credits purchased and used for the authenticated user
|
||||
Get total credits purchased and used for the authenticated user. [Provisioning key](/docs/guides/overview/auth/provisioning-api-keys) required.
|
||||
|
||||
:param retries: Override the default retry configuration for this method
|
||||
:param server_url: Override the default server URL for this method
|
||||
@@ -119,7 +119,7 @@ class Credits(BaseSDK):
|
||||
) -> operations.GetCreditsResponse:
|
||||
r"""Get remaining credits
|
||||
|
||||
Get total credits purchased and used for the authenticated user
|
||||
Get total credits purchased and used for the authenticated user. [Provisioning key](/docs/guides/overview/auth/provisioning-api-keys) required.
|
||||
|
||||
:param retries: Override the default retry configuration for this method
|
||||
:param server_url: Override the default server URL for this method
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -185,7 +185,7 @@ class Models(BaseSDK):
|
||||
def list(
|
||||
self,
|
||||
*,
|
||||
category: Optional[str] = None,
|
||||
category: Optional[operations.Category] = None,
|
||||
supported_parameters: Optional[str] = None,
|
||||
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
||||
server_url: Optional[str] = None,
|
||||
@@ -194,7 +194,7 @@ class Models(BaseSDK):
|
||||
) -> components.ModelsListResponse:
|
||||
r"""List all models and their properties
|
||||
|
||||
:param category:
|
||||
:param category: Filter models by use case category
|
||||
:param supported_parameters:
|
||||
:param retries: Override the default retry configuration for this method
|
||||
:param server_url: Override the default server URL for this method
|
||||
@@ -285,7 +285,7 @@ class Models(BaseSDK):
|
||||
async def list_async(
|
||||
self,
|
||||
*,
|
||||
category: Optional[str] = None,
|
||||
category: Optional[operations.Category] = None,
|
||||
supported_parameters: Optional[str] = None,
|
||||
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
||||
server_url: Optional[str] = None,
|
||||
@@ -294,7 +294,7 @@ class Models(BaseSDK):
|
||||
) -> components.ModelsListResponse:
|
||||
r"""List all models and their properties
|
||||
|
||||
:param category:
|
||||
:param category: Filter models by use case category
|
||||
:param supported_parameters:
|
||||
:param retries: Override the default retry configuration for this method
|
||||
:param server_url: Override the default server URL for this method
|
||||
|
||||
@@ -6,6 +6,38 @@ import builtins
|
||||
import sys
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from .bulkassignkeystoguardrail import (
|
||||
BulkAssignKeysToGuardrailRequest,
|
||||
BulkAssignKeysToGuardrailRequestBody,
|
||||
BulkAssignKeysToGuardrailRequestBodyTypedDict,
|
||||
BulkAssignKeysToGuardrailRequestTypedDict,
|
||||
BulkAssignKeysToGuardrailResponse,
|
||||
BulkAssignKeysToGuardrailResponseTypedDict,
|
||||
)
|
||||
from .bulkassignmemberstoguardrail import (
|
||||
BulkAssignMembersToGuardrailRequest,
|
||||
BulkAssignMembersToGuardrailRequestBody,
|
||||
BulkAssignMembersToGuardrailRequestBodyTypedDict,
|
||||
BulkAssignMembersToGuardrailRequestTypedDict,
|
||||
BulkAssignMembersToGuardrailResponse,
|
||||
BulkAssignMembersToGuardrailResponseTypedDict,
|
||||
)
|
||||
from .bulkunassignkeysfromguardrail import (
|
||||
BulkUnassignKeysFromGuardrailRequest,
|
||||
BulkUnassignKeysFromGuardrailRequestBody,
|
||||
BulkUnassignKeysFromGuardrailRequestBodyTypedDict,
|
||||
BulkUnassignKeysFromGuardrailRequestTypedDict,
|
||||
BulkUnassignKeysFromGuardrailResponse,
|
||||
BulkUnassignKeysFromGuardrailResponseTypedDict,
|
||||
)
|
||||
from .bulkunassignmembersfromguardrail import (
|
||||
BulkUnassignMembersFromGuardrailRequest,
|
||||
BulkUnassignMembersFromGuardrailRequestBody,
|
||||
BulkUnassignMembersFromGuardrailRequestBodyTypedDict,
|
||||
BulkUnassignMembersFromGuardrailRequestTypedDict,
|
||||
BulkUnassignMembersFromGuardrailResponse,
|
||||
BulkUnassignMembersFromGuardrailResponseTypedDict,
|
||||
)
|
||||
from .createauthkeyscode import (
|
||||
CreateAuthKeysCodeCodeChallengeMethod,
|
||||
CreateAuthKeysCodeData,
|
||||
@@ -62,6 +94,16 @@ if TYPE_CHECKING:
|
||||
Usage,
|
||||
UsageTypedDict,
|
||||
)
|
||||
from .createguardrail import (
|
||||
CreateGuardrailData,
|
||||
CreateGuardrailDataTypedDict,
|
||||
CreateGuardrailRequest,
|
||||
CreateGuardrailRequestTypedDict,
|
||||
CreateGuardrailResetIntervalRequest,
|
||||
CreateGuardrailResetIntervalResponse,
|
||||
CreateGuardrailResponse,
|
||||
CreateGuardrailResponseTypedDict,
|
||||
)
|
||||
from .createkeys import (
|
||||
CreateKeysData,
|
||||
CreateKeysDataTypedDict,
|
||||
@@ -77,6 +119,12 @@ if TYPE_CHECKING:
|
||||
CreateResponsesResponseBodyTypedDict,
|
||||
CreateResponsesResponseTypedDict,
|
||||
)
|
||||
from .deleteguardrail import (
|
||||
DeleteGuardrailRequest,
|
||||
DeleteGuardrailRequestTypedDict,
|
||||
DeleteGuardrailResponse,
|
||||
DeleteGuardrailResponseTypedDict,
|
||||
)
|
||||
from .deletekeys import (
|
||||
DeleteKeysRequest,
|
||||
DeleteKeysRequestTypedDict,
|
||||
@@ -113,6 +161,15 @@ if TYPE_CHECKING:
|
||||
GetGenerationResponse,
|
||||
GetGenerationResponseTypedDict,
|
||||
)
|
||||
from .getguardrail import (
|
||||
GetGuardrailData,
|
||||
GetGuardrailDataTypedDict,
|
||||
GetGuardrailRequest,
|
||||
GetGuardrailRequestTypedDict,
|
||||
GetGuardrailResetInterval,
|
||||
GetGuardrailResponse,
|
||||
GetGuardrailResponseTypedDict,
|
||||
)
|
||||
from .getkey import (
|
||||
GetKeyData,
|
||||
GetKeyDataTypedDict,
|
||||
@@ -121,18 +178,7 @@ if TYPE_CHECKING:
|
||||
GetKeyResponse,
|
||||
GetKeyResponseTypedDict,
|
||||
)
|
||||
from .getmodels import GetModelsRequest, GetModelsRequestTypedDict
|
||||
from .getparameters import (
|
||||
GetParametersData,
|
||||
GetParametersDataTypedDict,
|
||||
GetParametersRequest,
|
||||
GetParametersRequestTypedDict,
|
||||
GetParametersResponse,
|
||||
GetParametersResponseTypedDict,
|
||||
GetParametersSecurity,
|
||||
GetParametersSecurityTypedDict,
|
||||
SupportedParameter,
|
||||
)
|
||||
from .getmodels import Category, GetModelsRequest, GetModelsRequestTypedDict
|
||||
from .getuseractivity import (
|
||||
GetUserActivityRequest,
|
||||
GetUserActivityRequestTypedDict,
|
||||
@@ -157,6 +203,47 @@ if TYPE_CHECKING:
|
||||
ListEndpointsZdrResponse,
|
||||
ListEndpointsZdrResponseTypedDict,
|
||||
)
|
||||
from .listguardrailkeyassignments import (
|
||||
ListGuardrailKeyAssignmentsData,
|
||||
ListGuardrailKeyAssignmentsDataTypedDict,
|
||||
ListGuardrailKeyAssignmentsRequest,
|
||||
ListGuardrailKeyAssignmentsRequestTypedDict,
|
||||
ListGuardrailKeyAssignmentsResponse,
|
||||
ListGuardrailKeyAssignmentsResponseTypedDict,
|
||||
)
|
||||
from .listguardrailmemberassignments import (
|
||||
ListGuardrailMemberAssignmentsData,
|
||||
ListGuardrailMemberAssignmentsDataTypedDict,
|
||||
ListGuardrailMemberAssignmentsRequest,
|
||||
ListGuardrailMemberAssignmentsRequestTypedDict,
|
||||
ListGuardrailMemberAssignmentsResponse,
|
||||
ListGuardrailMemberAssignmentsResponseTypedDict,
|
||||
)
|
||||
from .listguardrails import (
|
||||
ListGuardrailsData,
|
||||
ListGuardrailsDataTypedDict,
|
||||
ListGuardrailsRequest,
|
||||
ListGuardrailsRequestTypedDict,
|
||||
ListGuardrailsResetInterval,
|
||||
ListGuardrailsResponse,
|
||||
ListGuardrailsResponseTypedDict,
|
||||
)
|
||||
from .listkeyassignments import (
|
||||
ListKeyAssignmentsData,
|
||||
ListKeyAssignmentsDataTypedDict,
|
||||
ListKeyAssignmentsRequest,
|
||||
ListKeyAssignmentsRequestTypedDict,
|
||||
ListKeyAssignmentsResponse,
|
||||
ListKeyAssignmentsResponseTypedDict,
|
||||
)
|
||||
from .listmemberassignments import (
|
||||
ListMemberAssignmentsData,
|
||||
ListMemberAssignmentsDataTypedDict,
|
||||
ListMemberAssignmentsRequest,
|
||||
ListMemberAssignmentsRequestTypedDict,
|
||||
ListMemberAssignmentsResponse,
|
||||
ListMemberAssignmentsResponseTypedDict,
|
||||
)
|
||||
from .listmodelsuser import ListModelsUserSecurity, ListModelsUserSecurityTypedDict
|
||||
from .listproviders import (
|
||||
ListProvidersData,
|
||||
@@ -168,6 +255,18 @@ if TYPE_CHECKING:
|
||||
SendChatCompletionRequestResponse,
|
||||
SendChatCompletionRequestResponseTypedDict,
|
||||
)
|
||||
from .updateguardrail import (
|
||||
UpdateGuardrailData,
|
||||
UpdateGuardrailDataTypedDict,
|
||||
UpdateGuardrailRequest,
|
||||
UpdateGuardrailRequestBody,
|
||||
UpdateGuardrailRequestBodyTypedDict,
|
||||
UpdateGuardrailRequestTypedDict,
|
||||
UpdateGuardrailResetIntervalRequest,
|
||||
UpdateGuardrailResetIntervalResponse,
|
||||
UpdateGuardrailResponse,
|
||||
UpdateGuardrailResponseTypedDict,
|
||||
)
|
||||
from .updatekeys import (
|
||||
UpdateKeysData,
|
||||
UpdateKeysDataTypedDict,
|
||||
@@ -182,8 +281,33 @@ if TYPE_CHECKING:
|
||||
|
||||
__all__ = [
|
||||
"APIType",
|
||||
"BulkAssignKeysToGuardrailRequest",
|
||||
"BulkAssignKeysToGuardrailRequestBody",
|
||||
"BulkAssignKeysToGuardrailRequestBodyTypedDict",
|
||||
"BulkAssignKeysToGuardrailRequestTypedDict",
|
||||
"BulkAssignKeysToGuardrailResponse",
|
||||
"BulkAssignKeysToGuardrailResponseTypedDict",
|
||||
"BulkAssignMembersToGuardrailRequest",
|
||||
"BulkAssignMembersToGuardrailRequestBody",
|
||||
"BulkAssignMembersToGuardrailRequestBodyTypedDict",
|
||||
"BulkAssignMembersToGuardrailRequestTypedDict",
|
||||
"BulkAssignMembersToGuardrailResponse",
|
||||
"BulkAssignMembersToGuardrailResponseTypedDict",
|
||||
"BulkUnassignKeysFromGuardrailRequest",
|
||||
"BulkUnassignKeysFromGuardrailRequestBody",
|
||||
"BulkUnassignKeysFromGuardrailRequestBodyTypedDict",
|
||||
"BulkUnassignKeysFromGuardrailRequestTypedDict",
|
||||
"BulkUnassignKeysFromGuardrailResponse",
|
||||
"BulkUnassignKeysFromGuardrailResponseTypedDict",
|
||||
"BulkUnassignMembersFromGuardrailRequest",
|
||||
"BulkUnassignMembersFromGuardrailRequestBody",
|
||||
"BulkUnassignMembersFromGuardrailRequestBodyTypedDict",
|
||||
"BulkUnassignMembersFromGuardrailRequestTypedDict",
|
||||
"BulkUnassignMembersFromGuardrailResponse",
|
||||
"BulkUnassignMembersFromGuardrailResponseTypedDict",
|
||||
"CallData",
|
||||
"CallDataTypedDict",
|
||||
"Category",
|
||||
"Content",
|
||||
"ContentImageURL",
|
||||
"ContentImageURLTypedDict",
|
||||
@@ -211,6 +335,14 @@ __all__ = [
|
||||
"CreateEmbeddingsResponseBody",
|
||||
"CreateEmbeddingsResponseBodyTypedDict",
|
||||
"CreateEmbeddingsResponseTypedDict",
|
||||
"CreateGuardrailData",
|
||||
"CreateGuardrailDataTypedDict",
|
||||
"CreateGuardrailRequest",
|
||||
"CreateGuardrailRequestTypedDict",
|
||||
"CreateGuardrailResetIntervalRequest",
|
||||
"CreateGuardrailResetIntervalResponse",
|
||||
"CreateGuardrailResponse",
|
||||
"CreateGuardrailResponseTypedDict",
|
||||
"CreateKeysData",
|
||||
"CreateKeysDataTypedDict",
|
||||
"CreateKeysLimitReset",
|
||||
@@ -222,6 +354,10 @@ __all__ = [
|
||||
"CreateResponsesResponseBody",
|
||||
"CreateResponsesResponseBodyTypedDict",
|
||||
"CreateResponsesResponseTypedDict",
|
||||
"DeleteGuardrailRequest",
|
||||
"DeleteGuardrailRequestTypedDict",
|
||||
"DeleteGuardrailResponse",
|
||||
"DeleteGuardrailResponseTypedDict",
|
||||
"DeleteKeysRequest",
|
||||
"DeleteKeysRequestTypedDict",
|
||||
"DeleteKeysResponse",
|
||||
@@ -248,6 +384,13 @@ __all__ = [
|
||||
"GetGenerationRequestTypedDict",
|
||||
"GetGenerationResponse",
|
||||
"GetGenerationResponseTypedDict",
|
||||
"GetGuardrailData",
|
||||
"GetGuardrailDataTypedDict",
|
||||
"GetGuardrailRequest",
|
||||
"GetGuardrailRequestTypedDict",
|
||||
"GetGuardrailResetInterval",
|
||||
"GetGuardrailResponse",
|
||||
"GetGuardrailResponseTypedDict",
|
||||
"GetKeyData",
|
||||
"GetKeyDataTypedDict",
|
||||
"GetKeyRequest",
|
||||
@@ -256,14 +399,6 @@ __all__ = [
|
||||
"GetKeyResponseTypedDict",
|
||||
"GetModelsRequest",
|
||||
"GetModelsRequestTypedDict",
|
||||
"GetParametersData",
|
||||
"GetParametersDataTypedDict",
|
||||
"GetParametersRequest",
|
||||
"GetParametersRequestTypedDict",
|
||||
"GetParametersResponse",
|
||||
"GetParametersResponseTypedDict",
|
||||
"GetParametersSecurity",
|
||||
"GetParametersSecurityTypedDict",
|
||||
"GetUserActivityRequest",
|
||||
"GetUserActivityRequestTypedDict",
|
||||
"GetUserActivityResponse",
|
||||
@@ -282,6 +417,37 @@ __all__ = [
|
||||
"ListEndpointsResponseTypedDict",
|
||||
"ListEndpointsZdrResponse",
|
||||
"ListEndpointsZdrResponseTypedDict",
|
||||
"ListGuardrailKeyAssignmentsData",
|
||||
"ListGuardrailKeyAssignmentsDataTypedDict",
|
||||
"ListGuardrailKeyAssignmentsRequest",
|
||||
"ListGuardrailKeyAssignmentsRequestTypedDict",
|
||||
"ListGuardrailKeyAssignmentsResponse",
|
||||
"ListGuardrailKeyAssignmentsResponseTypedDict",
|
||||
"ListGuardrailMemberAssignmentsData",
|
||||
"ListGuardrailMemberAssignmentsDataTypedDict",
|
||||
"ListGuardrailMemberAssignmentsRequest",
|
||||
"ListGuardrailMemberAssignmentsRequestTypedDict",
|
||||
"ListGuardrailMemberAssignmentsResponse",
|
||||
"ListGuardrailMemberAssignmentsResponseTypedDict",
|
||||
"ListGuardrailsData",
|
||||
"ListGuardrailsDataTypedDict",
|
||||
"ListGuardrailsRequest",
|
||||
"ListGuardrailsRequestTypedDict",
|
||||
"ListGuardrailsResetInterval",
|
||||
"ListGuardrailsResponse",
|
||||
"ListGuardrailsResponseTypedDict",
|
||||
"ListKeyAssignmentsData",
|
||||
"ListKeyAssignmentsDataTypedDict",
|
||||
"ListKeyAssignmentsRequest",
|
||||
"ListKeyAssignmentsRequestTypedDict",
|
||||
"ListKeyAssignmentsResponse",
|
||||
"ListKeyAssignmentsResponseTypedDict",
|
||||
"ListMemberAssignmentsData",
|
||||
"ListMemberAssignmentsDataTypedDict",
|
||||
"ListMemberAssignmentsRequest",
|
||||
"ListMemberAssignmentsRequestTypedDict",
|
||||
"ListMemberAssignmentsResponse",
|
||||
"ListMemberAssignmentsResponseTypedDict",
|
||||
"ListModelsUserSecurity",
|
||||
"ListModelsUserSecurityTypedDict",
|
||||
"ListProvidersData",
|
||||
@@ -300,11 +466,20 @@ __all__ = [
|
||||
"RateLimitTypedDict",
|
||||
"SendChatCompletionRequestResponse",
|
||||
"SendChatCompletionRequestResponseTypedDict",
|
||||
"SupportedParameter",
|
||||
"TransferIntent",
|
||||
"TransferIntentTypedDict",
|
||||
"TypeImageURL",
|
||||
"TypeText",
|
||||
"UpdateGuardrailData",
|
||||
"UpdateGuardrailDataTypedDict",
|
||||
"UpdateGuardrailRequest",
|
||||
"UpdateGuardrailRequestBody",
|
||||
"UpdateGuardrailRequestBodyTypedDict",
|
||||
"UpdateGuardrailRequestTypedDict",
|
||||
"UpdateGuardrailResetIntervalRequest",
|
||||
"UpdateGuardrailResetIntervalResponse",
|
||||
"UpdateGuardrailResponse",
|
||||
"UpdateGuardrailResponseTypedDict",
|
||||
"UpdateKeysData",
|
||||
"UpdateKeysDataTypedDict",
|
||||
"UpdateKeysLimitReset",
|
||||
@@ -321,6 +496,30 @@ __all__ = [
|
||||
]
|
||||
|
||||
_dynamic_imports: dict[str, str] = {
|
||||
"BulkAssignKeysToGuardrailRequest": ".bulkassignkeystoguardrail",
|
||||
"BulkAssignKeysToGuardrailRequestBody": ".bulkassignkeystoguardrail",
|
||||
"BulkAssignKeysToGuardrailRequestBodyTypedDict": ".bulkassignkeystoguardrail",
|
||||
"BulkAssignKeysToGuardrailRequestTypedDict": ".bulkassignkeystoguardrail",
|
||||
"BulkAssignKeysToGuardrailResponse": ".bulkassignkeystoguardrail",
|
||||
"BulkAssignKeysToGuardrailResponseTypedDict": ".bulkassignkeystoguardrail",
|
||||
"BulkAssignMembersToGuardrailRequest": ".bulkassignmemberstoguardrail",
|
||||
"BulkAssignMembersToGuardrailRequestBody": ".bulkassignmemberstoguardrail",
|
||||
"BulkAssignMembersToGuardrailRequestBodyTypedDict": ".bulkassignmemberstoguardrail",
|
||||
"BulkAssignMembersToGuardrailRequestTypedDict": ".bulkassignmemberstoguardrail",
|
||||
"BulkAssignMembersToGuardrailResponse": ".bulkassignmemberstoguardrail",
|
||||
"BulkAssignMembersToGuardrailResponseTypedDict": ".bulkassignmemberstoguardrail",
|
||||
"BulkUnassignKeysFromGuardrailRequest": ".bulkunassignkeysfromguardrail",
|
||||
"BulkUnassignKeysFromGuardrailRequestBody": ".bulkunassignkeysfromguardrail",
|
||||
"BulkUnassignKeysFromGuardrailRequestBodyTypedDict": ".bulkunassignkeysfromguardrail",
|
||||
"BulkUnassignKeysFromGuardrailRequestTypedDict": ".bulkunassignkeysfromguardrail",
|
||||
"BulkUnassignKeysFromGuardrailResponse": ".bulkunassignkeysfromguardrail",
|
||||
"BulkUnassignKeysFromGuardrailResponseTypedDict": ".bulkunassignkeysfromguardrail",
|
||||
"BulkUnassignMembersFromGuardrailRequest": ".bulkunassignmembersfromguardrail",
|
||||
"BulkUnassignMembersFromGuardrailRequestBody": ".bulkunassignmembersfromguardrail",
|
||||
"BulkUnassignMembersFromGuardrailRequestBodyTypedDict": ".bulkunassignmembersfromguardrail",
|
||||
"BulkUnassignMembersFromGuardrailRequestTypedDict": ".bulkunassignmembersfromguardrail",
|
||||
"BulkUnassignMembersFromGuardrailResponse": ".bulkunassignmembersfromguardrail",
|
||||
"BulkUnassignMembersFromGuardrailResponseTypedDict": ".bulkunassignmembersfromguardrail",
|
||||
"CreateAuthKeysCodeCodeChallengeMethod": ".createauthkeyscode",
|
||||
"CreateAuthKeysCodeData": ".createauthkeyscode",
|
||||
"CreateAuthKeysCodeDataTypedDict": ".createauthkeyscode",
|
||||
@@ -371,6 +570,14 @@ _dynamic_imports: dict[str, str] = {
|
||||
"TypeText": ".createembeddings",
|
||||
"Usage": ".createembeddings",
|
||||
"UsageTypedDict": ".createembeddings",
|
||||
"CreateGuardrailData": ".createguardrail",
|
||||
"CreateGuardrailDataTypedDict": ".createguardrail",
|
||||
"CreateGuardrailRequest": ".createguardrail",
|
||||
"CreateGuardrailRequestTypedDict": ".createguardrail",
|
||||
"CreateGuardrailResetIntervalRequest": ".createguardrail",
|
||||
"CreateGuardrailResetIntervalResponse": ".createguardrail",
|
||||
"CreateGuardrailResponse": ".createguardrail",
|
||||
"CreateGuardrailResponseTypedDict": ".createguardrail",
|
||||
"CreateKeysData": ".createkeys",
|
||||
"CreateKeysDataTypedDict": ".createkeys",
|
||||
"CreateKeysLimitReset": ".createkeys",
|
||||
@@ -382,6 +589,10 @@ _dynamic_imports: dict[str, str] = {
|
||||
"CreateResponsesResponseBody": ".createresponses",
|
||||
"CreateResponsesResponseBodyTypedDict": ".createresponses",
|
||||
"CreateResponsesResponseTypedDict": ".createresponses",
|
||||
"DeleteGuardrailRequest": ".deleteguardrail",
|
||||
"DeleteGuardrailRequestTypedDict": ".deleteguardrail",
|
||||
"DeleteGuardrailResponse": ".deleteguardrail",
|
||||
"DeleteGuardrailResponseTypedDict": ".deleteguardrail",
|
||||
"DeleteKeysRequest": ".deletekeys",
|
||||
"DeleteKeysRequestTypedDict": ".deletekeys",
|
||||
"DeleteKeysResponse": ".deletekeys",
|
||||
@@ -408,23 +619,22 @@ _dynamic_imports: dict[str, str] = {
|
||||
"GetGenerationRequestTypedDict": ".getgeneration",
|
||||
"GetGenerationResponse": ".getgeneration",
|
||||
"GetGenerationResponseTypedDict": ".getgeneration",
|
||||
"GetGuardrailData": ".getguardrail",
|
||||
"GetGuardrailDataTypedDict": ".getguardrail",
|
||||
"GetGuardrailRequest": ".getguardrail",
|
||||
"GetGuardrailRequestTypedDict": ".getguardrail",
|
||||
"GetGuardrailResetInterval": ".getguardrail",
|
||||
"GetGuardrailResponse": ".getguardrail",
|
||||
"GetGuardrailResponseTypedDict": ".getguardrail",
|
||||
"GetKeyData": ".getkey",
|
||||
"GetKeyDataTypedDict": ".getkey",
|
||||
"GetKeyRequest": ".getkey",
|
||||
"GetKeyRequestTypedDict": ".getkey",
|
||||
"GetKeyResponse": ".getkey",
|
||||
"GetKeyResponseTypedDict": ".getkey",
|
||||
"Category": ".getmodels",
|
||||
"GetModelsRequest": ".getmodels",
|
||||
"GetModelsRequestTypedDict": ".getmodels",
|
||||
"GetParametersData": ".getparameters",
|
||||
"GetParametersDataTypedDict": ".getparameters",
|
||||
"GetParametersRequest": ".getparameters",
|
||||
"GetParametersRequestTypedDict": ".getparameters",
|
||||
"GetParametersResponse": ".getparameters",
|
||||
"GetParametersResponseTypedDict": ".getparameters",
|
||||
"GetParametersSecurity": ".getparameters",
|
||||
"GetParametersSecurityTypedDict": ".getparameters",
|
||||
"SupportedParameter": ".getparameters",
|
||||
"GetUserActivityRequest": ".getuseractivity",
|
||||
"GetUserActivityRequestTypedDict": ".getuseractivity",
|
||||
"GetUserActivityResponse": ".getuseractivity",
|
||||
@@ -441,6 +651,37 @@ _dynamic_imports: dict[str, str] = {
|
||||
"ListEndpointsResponseTypedDict": ".listendpoints",
|
||||
"ListEndpointsZdrResponse": ".listendpointszdr",
|
||||
"ListEndpointsZdrResponseTypedDict": ".listendpointszdr",
|
||||
"ListGuardrailKeyAssignmentsData": ".listguardrailkeyassignments",
|
||||
"ListGuardrailKeyAssignmentsDataTypedDict": ".listguardrailkeyassignments",
|
||||
"ListGuardrailKeyAssignmentsRequest": ".listguardrailkeyassignments",
|
||||
"ListGuardrailKeyAssignmentsRequestTypedDict": ".listguardrailkeyassignments",
|
||||
"ListGuardrailKeyAssignmentsResponse": ".listguardrailkeyassignments",
|
||||
"ListGuardrailKeyAssignmentsResponseTypedDict": ".listguardrailkeyassignments",
|
||||
"ListGuardrailMemberAssignmentsData": ".listguardrailmemberassignments",
|
||||
"ListGuardrailMemberAssignmentsDataTypedDict": ".listguardrailmemberassignments",
|
||||
"ListGuardrailMemberAssignmentsRequest": ".listguardrailmemberassignments",
|
||||
"ListGuardrailMemberAssignmentsRequestTypedDict": ".listguardrailmemberassignments",
|
||||
"ListGuardrailMemberAssignmentsResponse": ".listguardrailmemberassignments",
|
||||
"ListGuardrailMemberAssignmentsResponseTypedDict": ".listguardrailmemberassignments",
|
||||
"ListGuardrailsData": ".listguardrails",
|
||||
"ListGuardrailsDataTypedDict": ".listguardrails",
|
||||
"ListGuardrailsRequest": ".listguardrails",
|
||||
"ListGuardrailsRequestTypedDict": ".listguardrails",
|
||||
"ListGuardrailsResetInterval": ".listguardrails",
|
||||
"ListGuardrailsResponse": ".listguardrails",
|
||||
"ListGuardrailsResponseTypedDict": ".listguardrails",
|
||||
"ListKeyAssignmentsData": ".listkeyassignments",
|
||||
"ListKeyAssignmentsDataTypedDict": ".listkeyassignments",
|
||||
"ListKeyAssignmentsRequest": ".listkeyassignments",
|
||||
"ListKeyAssignmentsRequestTypedDict": ".listkeyassignments",
|
||||
"ListKeyAssignmentsResponse": ".listkeyassignments",
|
||||
"ListKeyAssignmentsResponseTypedDict": ".listkeyassignments",
|
||||
"ListMemberAssignmentsData": ".listmemberassignments",
|
||||
"ListMemberAssignmentsDataTypedDict": ".listmemberassignments",
|
||||
"ListMemberAssignmentsRequest": ".listmemberassignments",
|
||||
"ListMemberAssignmentsRequestTypedDict": ".listmemberassignments",
|
||||
"ListMemberAssignmentsResponse": ".listmemberassignments",
|
||||
"ListMemberAssignmentsResponseTypedDict": ".listmemberassignments",
|
||||
"ListModelsUserSecurity": ".listmodelsuser",
|
||||
"ListModelsUserSecurityTypedDict": ".listmodelsuser",
|
||||
"ListProvidersData": ".listproviders",
|
||||
@@ -449,6 +690,16 @@ _dynamic_imports: dict[str, str] = {
|
||||
"ListProvidersResponseTypedDict": ".listproviders",
|
||||
"SendChatCompletionRequestResponse": ".sendchatcompletionrequest",
|
||||
"SendChatCompletionRequestResponseTypedDict": ".sendchatcompletionrequest",
|
||||
"UpdateGuardrailData": ".updateguardrail",
|
||||
"UpdateGuardrailDataTypedDict": ".updateguardrail",
|
||||
"UpdateGuardrailRequest": ".updateguardrail",
|
||||
"UpdateGuardrailRequestBody": ".updateguardrail",
|
||||
"UpdateGuardrailRequestBodyTypedDict": ".updateguardrail",
|
||||
"UpdateGuardrailRequestTypedDict": ".updateguardrail",
|
||||
"UpdateGuardrailResetIntervalRequest": ".updateguardrail",
|
||||
"UpdateGuardrailResetIntervalResponse": ".updateguardrail",
|
||||
"UpdateGuardrailResponse": ".updateguardrail",
|
||||
"UpdateGuardrailResponseTypedDict": ".updateguardrail",
|
||||
"UpdateKeysData": ".updatekeys",
|
||||
"UpdateKeysDataTypedDict": ".updatekeys",
|
||||
"UpdateKeysLimitReset": ".updatekeys",
|
||||
|
||||
@@ -0,0 +1,49 @@
|
||||
"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
|
||||
|
||||
from __future__ import annotations
|
||||
from openrouter.types import BaseModel
|
||||
from openrouter.utils import FieldMetadata, PathParamMetadata, RequestMetadata
|
||||
from typing import List
|
||||
from typing_extensions import Annotated, TypedDict
|
||||
|
||||
|
||||
class BulkAssignKeysToGuardrailRequestBodyTypedDict(TypedDict):
|
||||
key_hashes: List[str]
|
||||
r"""Array of API key hashes to assign to the guardrail"""
|
||||
|
||||
|
||||
class BulkAssignKeysToGuardrailRequestBody(BaseModel):
|
||||
key_hashes: List[str]
|
||||
r"""Array of API key hashes to assign to the guardrail"""
|
||||
|
||||
|
||||
class BulkAssignKeysToGuardrailRequestTypedDict(TypedDict):
|
||||
id: str
|
||||
r"""The unique identifier of the guardrail"""
|
||||
request_body: BulkAssignKeysToGuardrailRequestBodyTypedDict
|
||||
|
||||
|
||||
class BulkAssignKeysToGuardrailRequest(BaseModel):
|
||||
id: Annotated[
|
||||
str, FieldMetadata(path=PathParamMetadata(style="simple", explode=False))
|
||||
]
|
||||
r"""The unique identifier of the guardrail"""
|
||||
|
||||
request_body: Annotated[
|
||||
BulkAssignKeysToGuardrailRequestBody,
|
||||
FieldMetadata(request=RequestMetadata(media_type="application/json")),
|
||||
]
|
||||
|
||||
|
||||
class BulkAssignKeysToGuardrailResponseTypedDict(TypedDict):
|
||||
r"""Assignment result"""
|
||||
|
||||
assigned_count: float
|
||||
r"""Number of keys successfully assigned"""
|
||||
|
||||
|
||||
class BulkAssignKeysToGuardrailResponse(BaseModel):
|
||||
r"""Assignment result"""
|
||||
|
||||
assigned_count: float
|
||||
r"""Number of keys successfully assigned"""
|
||||
@@ -0,0 +1,49 @@
|
||||
"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
|
||||
|
||||
from __future__ import annotations
|
||||
from openrouter.types import BaseModel
|
||||
from openrouter.utils import FieldMetadata, PathParamMetadata, RequestMetadata
|
||||
from typing import List
|
||||
from typing_extensions import Annotated, TypedDict
|
||||
|
||||
|
||||
class BulkAssignMembersToGuardrailRequestBodyTypedDict(TypedDict):
|
||||
member_user_ids: List[str]
|
||||
r"""Array of member user IDs to assign to the guardrail"""
|
||||
|
||||
|
||||
class BulkAssignMembersToGuardrailRequestBody(BaseModel):
|
||||
member_user_ids: List[str]
|
||||
r"""Array of member user IDs to assign to the guardrail"""
|
||||
|
||||
|
||||
class BulkAssignMembersToGuardrailRequestTypedDict(TypedDict):
|
||||
id: str
|
||||
r"""The unique identifier of the guardrail"""
|
||||
request_body: BulkAssignMembersToGuardrailRequestBodyTypedDict
|
||||
|
||||
|
||||
class BulkAssignMembersToGuardrailRequest(BaseModel):
|
||||
id: Annotated[
|
||||
str, FieldMetadata(path=PathParamMetadata(style="simple", explode=False))
|
||||
]
|
||||
r"""The unique identifier of the guardrail"""
|
||||
|
||||
request_body: Annotated[
|
||||
BulkAssignMembersToGuardrailRequestBody,
|
||||
FieldMetadata(request=RequestMetadata(media_type="application/json")),
|
||||
]
|
||||
|
||||
|
||||
class BulkAssignMembersToGuardrailResponseTypedDict(TypedDict):
|
||||
r"""Assignment result"""
|
||||
|
||||
assigned_count: float
|
||||
r"""Number of members successfully assigned"""
|
||||
|
||||
|
||||
class BulkAssignMembersToGuardrailResponse(BaseModel):
|
||||
r"""Assignment result"""
|
||||
|
||||
assigned_count: float
|
||||
r"""Number of members successfully assigned"""
|
||||
@@ -0,0 +1,49 @@
|
||||
"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
|
||||
|
||||
from __future__ import annotations
|
||||
from openrouter.types import BaseModel
|
||||
from openrouter.utils import FieldMetadata, PathParamMetadata, RequestMetadata
|
||||
from typing import List
|
||||
from typing_extensions import Annotated, TypedDict
|
||||
|
||||
|
||||
class BulkUnassignKeysFromGuardrailRequestBodyTypedDict(TypedDict):
|
||||
key_hashes: List[str]
|
||||
r"""Array of API key hashes to unassign from the guardrail"""
|
||||
|
||||
|
||||
class BulkUnassignKeysFromGuardrailRequestBody(BaseModel):
|
||||
key_hashes: List[str]
|
||||
r"""Array of API key hashes to unassign from the guardrail"""
|
||||
|
||||
|
||||
class BulkUnassignKeysFromGuardrailRequestTypedDict(TypedDict):
|
||||
id: str
|
||||
r"""The unique identifier of the guardrail"""
|
||||
request_body: BulkUnassignKeysFromGuardrailRequestBodyTypedDict
|
||||
|
||||
|
||||
class BulkUnassignKeysFromGuardrailRequest(BaseModel):
|
||||
id: Annotated[
|
||||
str, FieldMetadata(path=PathParamMetadata(style="simple", explode=False))
|
||||
]
|
||||
r"""The unique identifier of the guardrail"""
|
||||
|
||||
request_body: Annotated[
|
||||
BulkUnassignKeysFromGuardrailRequestBody,
|
||||
FieldMetadata(request=RequestMetadata(media_type="application/json")),
|
||||
]
|
||||
|
||||
|
||||
class BulkUnassignKeysFromGuardrailResponseTypedDict(TypedDict):
|
||||
r"""Unassignment result"""
|
||||
|
||||
unassigned_count: float
|
||||
r"""Number of keys successfully unassigned"""
|
||||
|
||||
|
||||
class BulkUnassignKeysFromGuardrailResponse(BaseModel):
|
||||
r"""Unassignment result"""
|
||||
|
||||
unassigned_count: float
|
||||
r"""Number of keys successfully unassigned"""
|
||||
@@ -0,0 +1,49 @@
|
||||
"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
|
||||
|
||||
from __future__ import annotations
|
||||
from openrouter.types import BaseModel
|
||||
from openrouter.utils import FieldMetadata, PathParamMetadata, RequestMetadata
|
||||
from typing import List
|
||||
from typing_extensions import Annotated, TypedDict
|
||||
|
||||
|
||||
class BulkUnassignMembersFromGuardrailRequestBodyTypedDict(TypedDict):
|
||||
member_user_ids: List[str]
|
||||
r"""Array of member user IDs to unassign from the guardrail"""
|
||||
|
||||
|
||||
class BulkUnassignMembersFromGuardrailRequestBody(BaseModel):
|
||||
member_user_ids: List[str]
|
||||
r"""Array of member user IDs to unassign from the guardrail"""
|
||||
|
||||
|
||||
class BulkUnassignMembersFromGuardrailRequestTypedDict(TypedDict):
|
||||
id: str
|
||||
r"""The unique identifier of the guardrail"""
|
||||
request_body: BulkUnassignMembersFromGuardrailRequestBodyTypedDict
|
||||
|
||||
|
||||
class BulkUnassignMembersFromGuardrailRequest(BaseModel):
|
||||
id: Annotated[
|
||||
str, FieldMetadata(path=PathParamMetadata(style="simple", explode=False))
|
||||
]
|
||||
r"""The unique identifier of the guardrail"""
|
||||
|
||||
request_body: Annotated[
|
||||
BulkUnassignMembersFromGuardrailRequestBody,
|
||||
FieldMetadata(request=RequestMetadata(media_type="application/json")),
|
||||
]
|
||||
|
||||
|
||||
class BulkUnassignMembersFromGuardrailResponseTypedDict(TypedDict):
|
||||
r"""Unassignment result"""
|
||||
|
||||
unassigned_count: float
|
||||
r"""Number of members successfully unassigned"""
|
||||
|
||||
|
||||
class BulkUnassignMembersFromGuardrailResponse(BaseModel):
|
||||
r"""Unassignment result"""
|
||||
|
||||
unassigned_count: float
|
||||
r"""Number of members successfully unassigned"""
|
||||
@@ -0,0 +1,247 @@
|
||||
"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
|
||||
|
||||
from __future__ import annotations
|
||||
from openrouter.types import (
|
||||
BaseModel,
|
||||
Nullable,
|
||||
OptionalNullable,
|
||||
UNSET,
|
||||
UNSET_SENTINEL,
|
||||
UnrecognizedStr,
|
||||
)
|
||||
from openrouter.utils import validate_open_enum
|
||||
from pydantic import model_serializer
|
||||
from pydantic.functional_validators import PlainValidator
|
||||
from typing import List, Literal, Union
|
||||
from typing_extensions import Annotated, NotRequired, TypedDict
|
||||
|
||||
|
||||
CreateGuardrailResetIntervalRequest = Union[
|
||||
Literal[
|
||||
"daily",
|
||||
"weekly",
|
||||
"monthly",
|
||||
],
|
||||
UnrecognizedStr,
|
||||
]
|
||||
r"""Interval at which the limit resets (daily, weekly, monthly)"""
|
||||
|
||||
|
||||
class CreateGuardrailRequestTypedDict(TypedDict):
|
||||
name: str
|
||||
r"""Name for the new guardrail"""
|
||||
description: NotRequired[Nullable[str]]
|
||||
r"""Description of the guardrail"""
|
||||
limit_usd: NotRequired[Nullable[float]]
|
||||
r"""Spending limit in USD"""
|
||||
reset_interval: NotRequired[Nullable[CreateGuardrailResetIntervalRequest]]
|
||||
r"""Interval at which the limit resets (daily, weekly, monthly)"""
|
||||
allowed_providers: NotRequired[Nullable[List[str]]]
|
||||
r"""List of allowed provider IDs"""
|
||||
allowed_models: NotRequired[Nullable[List[str]]]
|
||||
r"""Array of model identifiers (slug or canonical_slug accepted)"""
|
||||
enforce_zdr: NotRequired[Nullable[bool]]
|
||||
r"""Whether to enforce zero data retention"""
|
||||
|
||||
|
||||
class CreateGuardrailRequest(BaseModel):
|
||||
name: str
|
||||
r"""Name for the new guardrail"""
|
||||
|
||||
description: OptionalNullable[str] = UNSET
|
||||
r"""Description of the guardrail"""
|
||||
|
||||
limit_usd: OptionalNullable[float] = UNSET
|
||||
r"""Spending limit in USD"""
|
||||
|
||||
reset_interval: Annotated[
|
||||
OptionalNullable[CreateGuardrailResetIntervalRequest],
|
||||
PlainValidator(validate_open_enum(False)),
|
||||
] = UNSET
|
||||
r"""Interval at which the limit resets (daily, weekly, monthly)"""
|
||||
|
||||
allowed_providers: OptionalNullable[List[str]] = UNSET
|
||||
r"""List of allowed provider IDs"""
|
||||
|
||||
allowed_models: OptionalNullable[List[str]] = UNSET
|
||||
r"""Array of model identifiers (slug or canonical_slug accepted)"""
|
||||
|
||||
enforce_zdr: OptionalNullable[bool] = UNSET
|
||||
r"""Whether to enforce zero data retention"""
|
||||
|
||||
@model_serializer(mode="wrap")
|
||||
def serialize_model(self, handler):
|
||||
optional_fields = [
|
||||
"description",
|
||||
"limit_usd",
|
||||
"reset_interval",
|
||||
"allowed_providers",
|
||||
"allowed_models",
|
||||
"enforce_zdr",
|
||||
]
|
||||
nullable_fields = [
|
||||
"description",
|
||||
"limit_usd",
|
||||
"reset_interval",
|
||||
"allowed_providers",
|
||||
"allowed_models",
|
||||
"enforce_zdr",
|
||||
]
|
||||
null_default_fields = []
|
||||
|
||||
serialized = handler(self)
|
||||
|
||||
m = {}
|
||||
|
||||
for n, f in type(self).model_fields.items():
|
||||
k = f.alias or n
|
||||
val = serialized.get(k)
|
||||
serialized.pop(k, None)
|
||||
|
||||
optional_nullable = k in optional_fields and k in nullable_fields
|
||||
is_set = (
|
||||
self.__pydantic_fields_set__.intersection({n})
|
||||
or k in null_default_fields
|
||||
) # pylint: disable=no-member
|
||||
|
||||
if val is not None and val != UNSET_SENTINEL:
|
||||
m[k] = val
|
||||
elif val != UNSET_SENTINEL and (
|
||||
not k in optional_fields or (optional_nullable and is_set)
|
||||
):
|
||||
m[k] = val
|
||||
|
||||
return m
|
||||
|
||||
|
||||
CreateGuardrailResetIntervalResponse = Union[
|
||||
Literal[
|
||||
"daily",
|
||||
"weekly",
|
||||
"monthly",
|
||||
],
|
||||
UnrecognizedStr,
|
||||
]
|
||||
r"""Interval at which the limit resets (daily, weekly, monthly)"""
|
||||
|
||||
|
||||
class CreateGuardrailDataTypedDict(TypedDict):
|
||||
r"""The created guardrail"""
|
||||
|
||||
id: str
|
||||
r"""Unique identifier for the guardrail"""
|
||||
name: str
|
||||
r"""Name of the guardrail"""
|
||||
created_at: str
|
||||
r"""ISO 8601 timestamp of when the guardrail was created"""
|
||||
description: NotRequired[Nullable[str]]
|
||||
r"""Description of the guardrail"""
|
||||
limit_usd: NotRequired[Nullable[float]]
|
||||
r"""Spending limit in USD"""
|
||||
reset_interval: NotRequired[Nullable[CreateGuardrailResetIntervalResponse]]
|
||||
r"""Interval at which the limit resets (daily, weekly, monthly)"""
|
||||
allowed_providers: NotRequired[Nullable[List[str]]]
|
||||
r"""List of allowed provider IDs"""
|
||||
allowed_models: NotRequired[Nullable[List[str]]]
|
||||
r"""Array of model canonical_slugs (immutable identifiers)"""
|
||||
enforce_zdr: NotRequired[Nullable[bool]]
|
||||
r"""Whether to enforce zero data retention"""
|
||||
updated_at: NotRequired[Nullable[str]]
|
||||
r"""ISO 8601 timestamp of when the guardrail was last updated"""
|
||||
|
||||
|
||||
class CreateGuardrailData(BaseModel):
|
||||
r"""The created guardrail"""
|
||||
|
||||
id: str
|
||||
r"""Unique identifier for the guardrail"""
|
||||
|
||||
name: str
|
||||
r"""Name of the guardrail"""
|
||||
|
||||
created_at: str
|
||||
r"""ISO 8601 timestamp of when the guardrail was created"""
|
||||
|
||||
description: OptionalNullable[str] = UNSET
|
||||
r"""Description of the guardrail"""
|
||||
|
||||
limit_usd: OptionalNullable[float] = UNSET
|
||||
r"""Spending limit in USD"""
|
||||
|
||||
reset_interval: Annotated[
|
||||
OptionalNullable[CreateGuardrailResetIntervalResponse],
|
||||
PlainValidator(validate_open_enum(False)),
|
||||
] = UNSET
|
||||
r"""Interval at which the limit resets (daily, weekly, monthly)"""
|
||||
|
||||
allowed_providers: OptionalNullable[List[str]] = UNSET
|
||||
r"""List of allowed provider IDs"""
|
||||
|
||||
allowed_models: OptionalNullable[List[str]] = UNSET
|
||||
r"""Array of model canonical_slugs (immutable identifiers)"""
|
||||
|
||||
enforce_zdr: OptionalNullable[bool] = UNSET
|
||||
r"""Whether to enforce zero data retention"""
|
||||
|
||||
updated_at: OptionalNullable[str] = UNSET
|
||||
r"""ISO 8601 timestamp of when the guardrail was last updated"""
|
||||
|
||||
@model_serializer(mode="wrap")
|
||||
def serialize_model(self, handler):
|
||||
optional_fields = [
|
||||
"description",
|
||||
"limit_usd",
|
||||
"reset_interval",
|
||||
"allowed_providers",
|
||||
"allowed_models",
|
||||
"enforce_zdr",
|
||||
"updated_at",
|
||||
]
|
||||
nullable_fields = [
|
||||
"description",
|
||||
"limit_usd",
|
||||
"reset_interval",
|
||||
"allowed_providers",
|
||||
"allowed_models",
|
||||
"enforce_zdr",
|
||||
"updated_at",
|
||||
]
|
||||
null_default_fields = []
|
||||
|
||||
serialized = handler(self)
|
||||
|
||||
m = {}
|
||||
|
||||
for n, f in type(self).model_fields.items():
|
||||
k = f.alias or n
|
||||
val = serialized.get(k)
|
||||
serialized.pop(k, None)
|
||||
|
||||
optional_nullable = k in optional_fields and k in nullable_fields
|
||||
is_set = (
|
||||
self.__pydantic_fields_set__.intersection({n})
|
||||
or k in null_default_fields
|
||||
) # pylint: disable=no-member
|
||||
|
||||
if val is not None and val != UNSET_SENTINEL:
|
||||
m[k] = val
|
||||
elif val != UNSET_SENTINEL and (
|
||||
not k in optional_fields or (optional_nullable and is_set)
|
||||
):
|
||||
m[k] = val
|
||||
|
||||
return m
|
||||
|
||||
|
||||
class CreateGuardrailResponseTypedDict(TypedDict):
|
||||
r"""Guardrail created successfully"""
|
||||
|
||||
data: CreateGuardrailDataTypedDict
|
||||
r"""The created guardrail"""
|
||||
|
||||
|
||||
class CreateGuardrailResponse(BaseModel):
|
||||
r"""Guardrail created successfully"""
|
||||
|
||||
data: CreateGuardrailData
|
||||
r"""The created guardrail"""
|
||||
@@ -0,0 +1,38 @@
|
||||
"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
|
||||
|
||||
from __future__ import annotations
|
||||
from openrouter.types import BaseModel
|
||||
from openrouter.utils import FieldMetadata, PathParamMetadata, validate_const
|
||||
import pydantic
|
||||
from pydantic.functional_validators import AfterValidator
|
||||
from typing import Literal
|
||||
from typing_extensions import Annotated, TypedDict
|
||||
|
||||
|
||||
class DeleteGuardrailRequestTypedDict(TypedDict):
|
||||
id: str
|
||||
r"""The unique identifier of the guardrail to delete"""
|
||||
|
||||
|
||||
class DeleteGuardrailRequest(BaseModel):
|
||||
id: Annotated[
|
||||
str, FieldMetadata(path=PathParamMetadata(style="simple", explode=False))
|
||||
]
|
||||
r"""The unique identifier of the guardrail to delete"""
|
||||
|
||||
|
||||
class DeleteGuardrailResponseTypedDict(TypedDict):
|
||||
r"""Guardrail deleted successfully"""
|
||||
|
||||
deleted: Literal[True]
|
||||
r"""Confirmation that the guardrail was deleted"""
|
||||
|
||||
|
||||
class DeleteGuardrailResponse(BaseModel):
|
||||
r"""Guardrail deleted successfully"""
|
||||
|
||||
DELETED: Annotated[
|
||||
Annotated[Literal[True], AfterValidator(validate_const(True))],
|
||||
pydantic.Field(alias="deleted"),
|
||||
] = True
|
||||
r"""Confirmation that the guardrail was deleted"""
|
||||
@@ -0,0 +1,161 @@
|
||||
"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
|
||||
|
||||
from __future__ import annotations
|
||||
from openrouter.types import (
|
||||
BaseModel,
|
||||
Nullable,
|
||||
OptionalNullable,
|
||||
UNSET,
|
||||
UNSET_SENTINEL,
|
||||
UnrecognizedStr,
|
||||
)
|
||||
from openrouter.utils import FieldMetadata, PathParamMetadata, validate_open_enum
|
||||
from pydantic import model_serializer
|
||||
from pydantic.functional_validators import PlainValidator
|
||||
from typing import List, Literal, Union
|
||||
from typing_extensions import Annotated, NotRequired, TypedDict
|
||||
|
||||
|
||||
class GetGuardrailRequestTypedDict(TypedDict):
|
||||
id: str
|
||||
r"""The unique identifier of the guardrail to retrieve"""
|
||||
|
||||
|
||||
class GetGuardrailRequest(BaseModel):
|
||||
id: Annotated[
|
||||
str, FieldMetadata(path=PathParamMetadata(style="simple", explode=False))
|
||||
]
|
||||
r"""The unique identifier of the guardrail to retrieve"""
|
||||
|
||||
|
||||
GetGuardrailResetInterval = Union[
|
||||
Literal[
|
||||
"daily",
|
||||
"weekly",
|
||||
"monthly",
|
||||
],
|
||||
UnrecognizedStr,
|
||||
]
|
||||
r"""Interval at which the limit resets (daily, weekly, monthly)"""
|
||||
|
||||
|
||||
class GetGuardrailDataTypedDict(TypedDict):
|
||||
r"""The guardrail"""
|
||||
|
||||
id: str
|
||||
r"""Unique identifier for the guardrail"""
|
||||
name: str
|
||||
r"""Name of the guardrail"""
|
||||
created_at: str
|
||||
r"""ISO 8601 timestamp of when the guardrail was created"""
|
||||
description: NotRequired[Nullable[str]]
|
||||
r"""Description of the guardrail"""
|
||||
limit_usd: NotRequired[Nullable[float]]
|
||||
r"""Spending limit in USD"""
|
||||
reset_interval: NotRequired[Nullable[GetGuardrailResetInterval]]
|
||||
r"""Interval at which the limit resets (daily, weekly, monthly)"""
|
||||
allowed_providers: NotRequired[Nullable[List[str]]]
|
||||
r"""List of allowed provider IDs"""
|
||||
allowed_models: NotRequired[Nullable[List[str]]]
|
||||
r"""Array of model canonical_slugs (immutable identifiers)"""
|
||||
enforce_zdr: NotRequired[Nullable[bool]]
|
||||
r"""Whether to enforce zero data retention"""
|
||||
updated_at: NotRequired[Nullable[str]]
|
||||
r"""ISO 8601 timestamp of when the guardrail was last updated"""
|
||||
|
||||
|
||||
class GetGuardrailData(BaseModel):
|
||||
r"""The guardrail"""
|
||||
|
||||
id: str
|
||||
r"""Unique identifier for the guardrail"""
|
||||
|
||||
name: str
|
||||
r"""Name of the guardrail"""
|
||||
|
||||
created_at: str
|
||||
r"""ISO 8601 timestamp of when the guardrail was created"""
|
||||
|
||||
description: OptionalNullable[str] = UNSET
|
||||
r"""Description of the guardrail"""
|
||||
|
||||
limit_usd: OptionalNullable[float] = UNSET
|
||||
r"""Spending limit in USD"""
|
||||
|
||||
reset_interval: Annotated[
|
||||
OptionalNullable[GetGuardrailResetInterval],
|
||||
PlainValidator(validate_open_enum(False)),
|
||||
] = UNSET
|
||||
r"""Interval at which the limit resets (daily, weekly, monthly)"""
|
||||
|
||||
allowed_providers: OptionalNullable[List[str]] = UNSET
|
||||
r"""List of allowed provider IDs"""
|
||||
|
||||
allowed_models: OptionalNullable[List[str]] = UNSET
|
||||
r"""Array of model canonical_slugs (immutable identifiers)"""
|
||||
|
||||
enforce_zdr: OptionalNullable[bool] = UNSET
|
||||
r"""Whether to enforce zero data retention"""
|
||||
|
||||
updated_at: OptionalNullable[str] = UNSET
|
||||
r"""ISO 8601 timestamp of when the guardrail was last updated"""
|
||||
|
||||
@model_serializer(mode="wrap")
|
||||
def serialize_model(self, handler):
|
||||
optional_fields = [
|
||||
"description",
|
||||
"limit_usd",
|
||||
"reset_interval",
|
||||
"allowed_providers",
|
||||
"allowed_models",
|
||||
"enforce_zdr",
|
||||
"updated_at",
|
||||
]
|
||||
nullable_fields = [
|
||||
"description",
|
||||
"limit_usd",
|
||||
"reset_interval",
|
||||
"allowed_providers",
|
||||
"allowed_models",
|
||||
"enforce_zdr",
|
||||
"updated_at",
|
||||
]
|
||||
null_default_fields = []
|
||||
|
||||
serialized = handler(self)
|
||||
|
||||
m = {}
|
||||
|
||||
for n, f in type(self).model_fields.items():
|
||||
k = f.alias or n
|
||||
val = serialized.get(k)
|
||||
serialized.pop(k, None)
|
||||
|
||||
optional_nullable = k in optional_fields and k in nullable_fields
|
||||
is_set = (
|
||||
self.__pydantic_fields_set__.intersection({n})
|
||||
or k in null_default_fields
|
||||
) # pylint: disable=no-member
|
||||
|
||||
if val is not None and val != UNSET_SENTINEL:
|
||||
m[k] = val
|
||||
elif val != UNSET_SENTINEL and (
|
||||
not k in optional_fields or (optional_nullable and is_set)
|
||||
):
|
||||
m[k] = val
|
||||
|
||||
return m
|
||||
|
||||
|
||||
class GetGuardrailResponseTypedDict(TypedDict):
|
||||
r"""Guardrail details"""
|
||||
|
||||
data: GetGuardrailDataTypedDict
|
||||
r"""The guardrail"""
|
||||
|
||||
|
||||
class GetGuardrailResponse(BaseModel):
|
||||
r"""Guardrail details"""
|
||||
|
||||
data: GetGuardrailData
|
||||
r"""The guardrail"""
|
||||
@@ -1,22 +1,45 @@
|
||||
"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
|
||||
|
||||
from __future__ import annotations
|
||||
from openrouter.types import BaseModel
|
||||
from openrouter.utils import FieldMetadata, QueryParamMetadata
|
||||
from typing import Optional
|
||||
from openrouter.types import BaseModel, UnrecognizedStr
|
||||
from openrouter.utils import FieldMetadata, QueryParamMetadata, validate_open_enum
|
||||
from pydantic.functional_validators import PlainValidator
|
||||
from typing import Literal, Optional, Union
|
||||
from typing_extensions import Annotated, NotRequired, TypedDict
|
||||
|
||||
|
||||
Category = Union[
|
||||
Literal[
|
||||
"programming",
|
||||
"roleplay",
|
||||
"marketing",
|
||||
"marketing/seo",
|
||||
"technology",
|
||||
"science",
|
||||
"translation",
|
||||
"legal",
|
||||
"finance",
|
||||
"health",
|
||||
"trivia",
|
||||
"academia",
|
||||
],
|
||||
UnrecognizedStr,
|
||||
]
|
||||
r"""Filter models by use case category"""
|
||||
|
||||
|
||||
class GetModelsRequestTypedDict(TypedDict):
|
||||
category: NotRequired[str]
|
||||
category: NotRequired[Category]
|
||||
r"""Filter models by use case category"""
|
||||
supported_parameters: NotRequired[str]
|
||||
|
||||
|
||||
class GetModelsRequest(BaseModel):
|
||||
category: Annotated[
|
||||
Optional[str],
|
||||
Annotated[Optional[Category], PlainValidator(validate_open_enum(False))],
|
||||
FieldMetadata(query=QueryParamMetadata(style="form", explode=True)),
|
||||
] = None
|
||||
r"""Filter models by use case category"""
|
||||
|
||||
supported_parameters: Annotated[
|
||||
Optional[str],
|
||||
|
||||
@@ -1,123 +0,0 @@
|
||||
"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
|
||||
|
||||
from __future__ import annotations
|
||||
from openrouter.components import providername as components_providername
|
||||
from openrouter.types import BaseModel, UnrecognizedStr
|
||||
from openrouter.utils import (
|
||||
FieldMetadata,
|
||||
PathParamMetadata,
|
||||
QueryParamMetadata,
|
||||
SecurityMetadata,
|
||||
validate_open_enum,
|
||||
)
|
||||
from pydantic.functional_validators import PlainValidator
|
||||
from typing import List, Literal, Optional, Union
|
||||
from typing_extensions import Annotated, NotRequired, TypedDict
|
||||
|
||||
|
||||
class GetParametersSecurityTypedDict(TypedDict):
|
||||
bearer: str
|
||||
|
||||
|
||||
class GetParametersSecurity(BaseModel):
|
||||
bearer: Annotated[
|
||||
str,
|
||||
FieldMetadata(
|
||||
security=SecurityMetadata(
|
||||
scheme=True,
|
||||
scheme_type="http",
|
||||
sub_type="bearer",
|
||||
field_name="Authorization",
|
||||
)
|
||||
),
|
||||
]
|
||||
|
||||
|
||||
class GetParametersRequestTypedDict(TypedDict):
|
||||
author: str
|
||||
slug: str
|
||||
provider: NotRequired[components_providername.ProviderName]
|
||||
|
||||
|
||||
class GetParametersRequest(BaseModel):
|
||||
author: Annotated[
|
||||
str, FieldMetadata(path=PathParamMetadata(style="simple", explode=False))
|
||||
]
|
||||
|
||||
slug: Annotated[
|
||||
str, FieldMetadata(path=PathParamMetadata(style="simple", explode=False))
|
||||
]
|
||||
|
||||
provider: Annotated[
|
||||
Annotated[
|
||||
Optional[components_providername.ProviderName],
|
||||
PlainValidator(validate_open_enum(False)),
|
||||
],
|
||||
FieldMetadata(query=QueryParamMetadata(style="form", explode=True)),
|
||||
] = None
|
||||
|
||||
|
||||
SupportedParameter = Union[
|
||||
Literal[
|
||||
"temperature",
|
||||
"top_p",
|
||||
"top_k",
|
||||
"min_p",
|
||||
"top_a",
|
||||
"frequency_penalty",
|
||||
"presence_penalty",
|
||||
"repetition_penalty",
|
||||
"max_tokens",
|
||||
"logit_bias",
|
||||
"logprobs",
|
||||
"top_logprobs",
|
||||
"seed",
|
||||
"response_format",
|
||||
"structured_outputs",
|
||||
"stop",
|
||||
"tools",
|
||||
"tool_choice",
|
||||
"parallel_tool_calls",
|
||||
"include_reasoning",
|
||||
"reasoning",
|
||||
"reasoning_effort",
|
||||
"web_search_options",
|
||||
"verbosity",
|
||||
],
|
||||
UnrecognizedStr,
|
||||
]
|
||||
|
||||
|
||||
class GetParametersDataTypedDict(TypedDict):
|
||||
r"""Parameter analytics data"""
|
||||
|
||||
model: str
|
||||
r"""Model identifier"""
|
||||
supported_parameters: List[SupportedParameter]
|
||||
r"""List of parameters supported by this model"""
|
||||
|
||||
|
||||
class GetParametersData(BaseModel):
|
||||
r"""Parameter analytics data"""
|
||||
|
||||
model: str
|
||||
r"""Model identifier"""
|
||||
|
||||
supported_parameters: List[
|
||||
Annotated[SupportedParameter, PlainValidator(validate_open_enum(False))]
|
||||
]
|
||||
r"""List of parameters supported by this model"""
|
||||
|
||||
|
||||
class GetParametersResponseTypedDict(TypedDict):
|
||||
r"""Returns the parameters for the specified model"""
|
||||
|
||||
data: GetParametersDataTypedDict
|
||||
r"""Parameter analytics data"""
|
||||
|
||||
|
||||
class GetParametersResponse(BaseModel):
|
||||
r"""Returns the parameters for the specified model"""
|
||||
|
||||
data: GetParametersData
|
||||
r"""Parameter analytics data"""
|
||||
@@ -0,0 +1,125 @@
|
||||
"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
|
||||
|
||||
from __future__ import annotations
|
||||
from openrouter.types import BaseModel, Nullable, UNSET_SENTINEL
|
||||
from openrouter.utils import FieldMetadata, PathParamMetadata, QueryParamMetadata
|
||||
from pydantic import model_serializer
|
||||
from typing import List, Optional
|
||||
from typing_extensions import Annotated, NotRequired, TypedDict
|
||||
|
||||
|
||||
class ListGuardrailKeyAssignmentsRequestTypedDict(TypedDict):
|
||||
id: str
|
||||
r"""The unique identifier of the guardrail"""
|
||||
offset: NotRequired[str]
|
||||
r"""Number of records to skip for pagination"""
|
||||
limit: NotRequired[str]
|
||||
r"""Maximum number of records to return (max 100)"""
|
||||
|
||||
|
||||
class ListGuardrailKeyAssignmentsRequest(BaseModel):
|
||||
id: Annotated[
|
||||
str, FieldMetadata(path=PathParamMetadata(style="simple", explode=False))
|
||||
]
|
||||
r"""The unique identifier of the guardrail"""
|
||||
|
||||
offset: Annotated[
|
||||
Optional[str],
|
||||
FieldMetadata(query=QueryParamMetadata(style="form", explode=True)),
|
||||
] = None
|
||||
r"""Number of records to skip for pagination"""
|
||||
|
||||
limit: Annotated[
|
||||
Optional[str],
|
||||
FieldMetadata(query=QueryParamMetadata(style="form", explode=True)),
|
||||
] = None
|
||||
r"""Maximum number of records to return (max 100)"""
|
||||
|
||||
|
||||
class ListGuardrailKeyAssignmentsDataTypedDict(TypedDict):
|
||||
id: str
|
||||
r"""Unique identifier for the assignment"""
|
||||
key_hash: str
|
||||
r"""Hash of the assigned API key"""
|
||||
guardrail_id: str
|
||||
r"""ID of the guardrail"""
|
||||
key_name: str
|
||||
r"""Name of the API key"""
|
||||
key_label: str
|
||||
r"""Label of the API key"""
|
||||
assigned_by: Nullable[str]
|
||||
r"""User ID of who made the assignment"""
|
||||
created_at: str
|
||||
r"""ISO 8601 timestamp of when the assignment was created"""
|
||||
|
||||
|
||||
class ListGuardrailKeyAssignmentsData(BaseModel):
|
||||
id: str
|
||||
r"""Unique identifier for the assignment"""
|
||||
|
||||
key_hash: str
|
||||
r"""Hash of the assigned API key"""
|
||||
|
||||
guardrail_id: str
|
||||
r"""ID of the guardrail"""
|
||||
|
||||
key_name: str
|
||||
r"""Name of the API key"""
|
||||
|
||||
key_label: str
|
||||
r"""Label of the API key"""
|
||||
|
||||
assigned_by: Nullable[str]
|
||||
r"""User ID of who made the assignment"""
|
||||
|
||||
created_at: str
|
||||
r"""ISO 8601 timestamp of when the assignment was created"""
|
||||
|
||||
@model_serializer(mode="wrap")
|
||||
def serialize_model(self, handler):
|
||||
optional_fields = []
|
||||
nullable_fields = ["assigned_by"]
|
||||
null_default_fields = []
|
||||
|
||||
serialized = handler(self)
|
||||
|
||||
m = {}
|
||||
|
||||
for n, f in type(self).model_fields.items():
|
||||
k = f.alias or n
|
||||
val = serialized.get(k)
|
||||
serialized.pop(k, None)
|
||||
|
||||
optional_nullable = k in optional_fields and k in nullable_fields
|
||||
is_set = (
|
||||
self.__pydantic_fields_set__.intersection({n})
|
||||
or k in null_default_fields
|
||||
) # pylint: disable=no-member
|
||||
|
||||
if val is not None and val != UNSET_SENTINEL:
|
||||
m[k] = val
|
||||
elif val != UNSET_SENTINEL and (
|
||||
not k in optional_fields or (optional_nullable and is_set)
|
||||
):
|
||||
m[k] = val
|
||||
|
||||
return m
|
||||
|
||||
|
||||
class ListGuardrailKeyAssignmentsResponseTypedDict(TypedDict):
|
||||
r"""List of key assignments"""
|
||||
|
||||
data: List[ListGuardrailKeyAssignmentsDataTypedDict]
|
||||
r"""List of key assignments"""
|
||||
total_count: float
|
||||
r"""Total number of key assignments for this guardrail"""
|
||||
|
||||
|
||||
class ListGuardrailKeyAssignmentsResponse(BaseModel):
|
||||
r"""List of key assignments"""
|
||||
|
||||
data: List[ListGuardrailKeyAssignmentsData]
|
||||
r"""List of key assignments"""
|
||||
|
||||
total_count: float
|
||||
r"""Total number of key assignments for this guardrail"""
|
||||
@@ -0,0 +1,120 @@
|
||||
"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
|
||||
|
||||
from __future__ import annotations
|
||||
from openrouter.types import BaseModel, Nullable, UNSET_SENTINEL
|
||||
from openrouter.utils import FieldMetadata, PathParamMetadata, QueryParamMetadata
|
||||
from pydantic import model_serializer
|
||||
from typing import List, Optional
|
||||
from typing_extensions import Annotated, NotRequired, TypedDict
|
||||
|
||||
|
||||
class ListGuardrailMemberAssignmentsRequestTypedDict(TypedDict):
|
||||
id: str
|
||||
r"""The unique identifier of the guardrail"""
|
||||
offset: NotRequired[str]
|
||||
r"""Number of records to skip for pagination"""
|
||||
limit: NotRequired[str]
|
||||
r"""Maximum number of records to return (max 100)"""
|
||||
|
||||
|
||||
class ListGuardrailMemberAssignmentsRequest(BaseModel):
|
||||
id: Annotated[
|
||||
str, FieldMetadata(path=PathParamMetadata(style="simple", explode=False))
|
||||
]
|
||||
r"""The unique identifier of the guardrail"""
|
||||
|
||||
offset: Annotated[
|
||||
Optional[str],
|
||||
FieldMetadata(query=QueryParamMetadata(style="form", explode=True)),
|
||||
] = None
|
||||
r"""Number of records to skip for pagination"""
|
||||
|
||||
limit: Annotated[
|
||||
Optional[str],
|
||||
FieldMetadata(query=QueryParamMetadata(style="form", explode=True)),
|
||||
] = None
|
||||
r"""Maximum number of records to return (max 100)"""
|
||||
|
||||
|
||||
class ListGuardrailMemberAssignmentsDataTypedDict(TypedDict):
|
||||
id: str
|
||||
r"""Unique identifier for the assignment"""
|
||||
user_id: str
|
||||
r"""Clerk user ID of the assigned member"""
|
||||
organization_id: str
|
||||
r"""Organization ID"""
|
||||
guardrail_id: str
|
||||
r"""ID of the guardrail"""
|
||||
assigned_by: Nullable[str]
|
||||
r"""User ID of who made the assignment"""
|
||||
created_at: str
|
||||
r"""ISO 8601 timestamp of when the assignment was created"""
|
||||
|
||||
|
||||
class ListGuardrailMemberAssignmentsData(BaseModel):
|
||||
id: str
|
||||
r"""Unique identifier for the assignment"""
|
||||
|
||||
user_id: str
|
||||
r"""Clerk user ID of the assigned member"""
|
||||
|
||||
organization_id: str
|
||||
r"""Organization ID"""
|
||||
|
||||
guardrail_id: str
|
||||
r"""ID of the guardrail"""
|
||||
|
||||
assigned_by: Nullable[str]
|
||||
r"""User ID of who made the assignment"""
|
||||
|
||||
created_at: str
|
||||
r"""ISO 8601 timestamp of when the assignment was created"""
|
||||
|
||||
@model_serializer(mode="wrap")
|
||||
def serialize_model(self, handler):
|
||||
optional_fields = []
|
||||
nullable_fields = ["assigned_by"]
|
||||
null_default_fields = []
|
||||
|
||||
serialized = handler(self)
|
||||
|
||||
m = {}
|
||||
|
||||
for n, f in type(self).model_fields.items():
|
||||
k = f.alias or n
|
||||
val = serialized.get(k)
|
||||
serialized.pop(k, None)
|
||||
|
||||
optional_nullable = k in optional_fields and k in nullable_fields
|
||||
is_set = (
|
||||
self.__pydantic_fields_set__.intersection({n})
|
||||
or k in null_default_fields
|
||||
) # pylint: disable=no-member
|
||||
|
||||
if val is not None and val != UNSET_SENTINEL:
|
||||
m[k] = val
|
||||
elif val != UNSET_SENTINEL and (
|
||||
not k in optional_fields or (optional_nullable and is_set)
|
||||
):
|
||||
m[k] = val
|
||||
|
||||
return m
|
||||
|
||||
|
||||
class ListGuardrailMemberAssignmentsResponseTypedDict(TypedDict):
|
||||
r"""List of member assignments"""
|
||||
|
||||
data: List[ListGuardrailMemberAssignmentsDataTypedDict]
|
||||
r"""List of member assignments"""
|
||||
total_count: float
|
||||
r"""Total number of member assignments"""
|
||||
|
||||
|
||||
class ListGuardrailMemberAssignmentsResponse(BaseModel):
|
||||
r"""List of member assignments"""
|
||||
|
||||
data: List[ListGuardrailMemberAssignmentsData]
|
||||
r"""List of member assignments"""
|
||||
|
||||
total_count: float
|
||||
r"""Total number of member assignments"""
|
||||
@@ -0,0 +1,171 @@
|
||||
"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
|
||||
|
||||
from __future__ import annotations
|
||||
from openrouter.types import (
|
||||
BaseModel,
|
||||
Nullable,
|
||||
OptionalNullable,
|
||||
UNSET,
|
||||
UNSET_SENTINEL,
|
||||
UnrecognizedStr,
|
||||
)
|
||||
from openrouter.utils import FieldMetadata, QueryParamMetadata, validate_open_enum
|
||||
from pydantic import model_serializer
|
||||
from pydantic.functional_validators import PlainValidator
|
||||
from typing import List, Literal, Optional, Union
|
||||
from typing_extensions import Annotated, NotRequired, TypedDict
|
||||
|
||||
|
||||
class ListGuardrailsRequestTypedDict(TypedDict):
|
||||
offset: NotRequired[str]
|
||||
r"""Number of records to skip for pagination"""
|
||||
limit: NotRequired[str]
|
||||
r"""Maximum number of records to return (max 100)"""
|
||||
|
||||
|
||||
class ListGuardrailsRequest(BaseModel):
|
||||
offset: Annotated[
|
||||
Optional[str],
|
||||
FieldMetadata(query=QueryParamMetadata(style="form", explode=True)),
|
||||
] = None
|
||||
r"""Number of records to skip for pagination"""
|
||||
|
||||
limit: Annotated[
|
||||
Optional[str],
|
||||
FieldMetadata(query=QueryParamMetadata(style="form", explode=True)),
|
||||
] = None
|
||||
r"""Maximum number of records to return (max 100)"""
|
||||
|
||||
|
||||
ListGuardrailsResetInterval = Union[
|
||||
Literal[
|
||||
"daily",
|
||||
"weekly",
|
||||
"monthly",
|
||||
],
|
||||
UnrecognizedStr,
|
||||
]
|
||||
r"""Interval at which the limit resets (daily, weekly, monthly)"""
|
||||
|
||||
|
||||
class ListGuardrailsDataTypedDict(TypedDict):
|
||||
id: str
|
||||
r"""Unique identifier for the guardrail"""
|
||||
name: str
|
||||
r"""Name of the guardrail"""
|
||||
created_at: str
|
||||
r"""ISO 8601 timestamp of when the guardrail was created"""
|
||||
description: NotRequired[Nullable[str]]
|
||||
r"""Description of the guardrail"""
|
||||
limit_usd: NotRequired[Nullable[float]]
|
||||
r"""Spending limit in USD"""
|
||||
reset_interval: NotRequired[Nullable[ListGuardrailsResetInterval]]
|
||||
r"""Interval at which the limit resets (daily, weekly, monthly)"""
|
||||
allowed_providers: NotRequired[Nullable[List[str]]]
|
||||
r"""List of allowed provider IDs"""
|
||||
allowed_models: NotRequired[Nullable[List[str]]]
|
||||
r"""Array of model canonical_slugs (immutable identifiers)"""
|
||||
enforce_zdr: NotRequired[Nullable[bool]]
|
||||
r"""Whether to enforce zero data retention"""
|
||||
updated_at: NotRequired[Nullable[str]]
|
||||
r"""ISO 8601 timestamp of when the guardrail was last updated"""
|
||||
|
||||
|
||||
class ListGuardrailsData(BaseModel):
|
||||
id: str
|
||||
r"""Unique identifier for the guardrail"""
|
||||
|
||||
name: str
|
||||
r"""Name of the guardrail"""
|
||||
|
||||
created_at: str
|
||||
r"""ISO 8601 timestamp of when the guardrail was created"""
|
||||
|
||||
description: OptionalNullable[str] = UNSET
|
||||
r"""Description of the guardrail"""
|
||||
|
||||
limit_usd: OptionalNullable[float] = UNSET
|
||||
r"""Spending limit in USD"""
|
||||
|
||||
reset_interval: Annotated[
|
||||
OptionalNullable[ListGuardrailsResetInterval],
|
||||
PlainValidator(validate_open_enum(False)),
|
||||
] = UNSET
|
||||
r"""Interval at which the limit resets (daily, weekly, monthly)"""
|
||||
|
||||
allowed_providers: OptionalNullable[List[str]] = UNSET
|
||||
r"""List of allowed provider IDs"""
|
||||
|
||||
allowed_models: OptionalNullable[List[str]] = UNSET
|
||||
r"""Array of model canonical_slugs (immutable identifiers)"""
|
||||
|
||||
enforce_zdr: OptionalNullable[bool] = UNSET
|
||||
r"""Whether to enforce zero data retention"""
|
||||
|
||||
updated_at: OptionalNullable[str] = UNSET
|
||||
r"""ISO 8601 timestamp of when the guardrail was last updated"""
|
||||
|
||||
@model_serializer(mode="wrap")
|
||||
def serialize_model(self, handler):
|
||||
optional_fields = [
|
||||
"description",
|
||||
"limit_usd",
|
||||
"reset_interval",
|
||||
"allowed_providers",
|
||||
"allowed_models",
|
||||
"enforce_zdr",
|
||||
"updated_at",
|
||||
]
|
||||
nullable_fields = [
|
||||
"description",
|
||||
"limit_usd",
|
||||
"reset_interval",
|
||||
"allowed_providers",
|
||||
"allowed_models",
|
||||
"enforce_zdr",
|
||||
"updated_at",
|
||||
]
|
||||
null_default_fields = []
|
||||
|
||||
serialized = handler(self)
|
||||
|
||||
m = {}
|
||||
|
||||
for n, f in type(self).model_fields.items():
|
||||
k = f.alias or n
|
||||
val = serialized.get(k)
|
||||
serialized.pop(k, None)
|
||||
|
||||
optional_nullable = k in optional_fields and k in nullable_fields
|
||||
is_set = (
|
||||
self.__pydantic_fields_set__.intersection({n})
|
||||
or k in null_default_fields
|
||||
) # pylint: disable=no-member
|
||||
|
||||
if val is not None and val != UNSET_SENTINEL:
|
||||
m[k] = val
|
||||
elif val != UNSET_SENTINEL and (
|
||||
not k in optional_fields or (optional_nullable and is_set)
|
||||
):
|
||||
m[k] = val
|
||||
|
||||
return m
|
||||
|
||||
|
||||
class ListGuardrailsResponseTypedDict(TypedDict):
|
||||
r"""List of guardrails"""
|
||||
|
||||
data: List[ListGuardrailsDataTypedDict]
|
||||
r"""List of guardrails"""
|
||||
total_count: float
|
||||
r"""Total number of guardrails"""
|
||||
|
||||
|
||||
class ListGuardrailsResponse(BaseModel):
|
||||
r"""List of guardrails"""
|
||||
|
||||
data: List[ListGuardrailsData]
|
||||
r"""List of guardrails"""
|
||||
|
||||
total_count: float
|
||||
r"""Total number of guardrails"""
|
||||
@@ -0,0 +1,118 @@
|
||||
"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
|
||||
|
||||
from __future__ import annotations
|
||||
from openrouter.types import BaseModel, Nullable, UNSET_SENTINEL
|
||||
from openrouter.utils import FieldMetadata, QueryParamMetadata
|
||||
from pydantic import model_serializer
|
||||
from typing import List, Optional
|
||||
from typing_extensions import Annotated, NotRequired, TypedDict
|
||||
|
||||
|
||||
class ListKeyAssignmentsRequestTypedDict(TypedDict):
|
||||
offset: NotRequired[str]
|
||||
r"""Number of records to skip for pagination"""
|
||||
limit: NotRequired[str]
|
||||
r"""Maximum number of records to return (max 100)"""
|
||||
|
||||
|
||||
class ListKeyAssignmentsRequest(BaseModel):
|
||||
offset: Annotated[
|
||||
Optional[str],
|
||||
FieldMetadata(query=QueryParamMetadata(style="form", explode=True)),
|
||||
] = None
|
||||
r"""Number of records to skip for pagination"""
|
||||
|
||||
limit: Annotated[
|
||||
Optional[str],
|
||||
FieldMetadata(query=QueryParamMetadata(style="form", explode=True)),
|
||||
] = None
|
||||
r"""Maximum number of records to return (max 100)"""
|
||||
|
||||
|
||||
class ListKeyAssignmentsDataTypedDict(TypedDict):
|
||||
id: str
|
||||
r"""Unique identifier for the assignment"""
|
||||
key_hash: str
|
||||
r"""Hash of the assigned API key"""
|
||||
guardrail_id: str
|
||||
r"""ID of the guardrail"""
|
||||
key_name: str
|
||||
r"""Name of the API key"""
|
||||
key_label: str
|
||||
r"""Label of the API key"""
|
||||
assigned_by: Nullable[str]
|
||||
r"""User ID of who made the assignment"""
|
||||
created_at: str
|
||||
r"""ISO 8601 timestamp of when the assignment was created"""
|
||||
|
||||
|
||||
class ListKeyAssignmentsData(BaseModel):
|
||||
id: str
|
||||
r"""Unique identifier for the assignment"""
|
||||
|
||||
key_hash: str
|
||||
r"""Hash of the assigned API key"""
|
||||
|
||||
guardrail_id: str
|
||||
r"""ID of the guardrail"""
|
||||
|
||||
key_name: str
|
||||
r"""Name of the API key"""
|
||||
|
||||
key_label: str
|
||||
r"""Label of the API key"""
|
||||
|
||||
assigned_by: Nullable[str]
|
||||
r"""User ID of who made the assignment"""
|
||||
|
||||
created_at: str
|
||||
r"""ISO 8601 timestamp of when the assignment was created"""
|
||||
|
||||
@model_serializer(mode="wrap")
|
||||
def serialize_model(self, handler):
|
||||
optional_fields = []
|
||||
nullable_fields = ["assigned_by"]
|
||||
null_default_fields = []
|
||||
|
||||
serialized = handler(self)
|
||||
|
||||
m = {}
|
||||
|
||||
for n, f in type(self).model_fields.items():
|
||||
k = f.alias or n
|
||||
val = serialized.get(k)
|
||||
serialized.pop(k, None)
|
||||
|
||||
optional_nullable = k in optional_fields and k in nullable_fields
|
||||
is_set = (
|
||||
self.__pydantic_fields_set__.intersection({n})
|
||||
or k in null_default_fields
|
||||
) # pylint: disable=no-member
|
||||
|
||||
if val is not None and val != UNSET_SENTINEL:
|
||||
m[k] = val
|
||||
elif val != UNSET_SENTINEL and (
|
||||
not k in optional_fields or (optional_nullable and is_set)
|
||||
):
|
||||
m[k] = val
|
||||
|
||||
return m
|
||||
|
||||
|
||||
class ListKeyAssignmentsResponseTypedDict(TypedDict):
|
||||
r"""List of key assignments"""
|
||||
|
||||
data: List[ListKeyAssignmentsDataTypedDict]
|
||||
r"""List of key assignments"""
|
||||
total_count: float
|
||||
r"""Total number of key assignments for this guardrail"""
|
||||
|
||||
|
||||
class ListKeyAssignmentsResponse(BaseModel):
|
||||
r"""List of key assignments"""
|
||||
|
||||
data: List[ListKeyAssignmentsData]
|
||||
r"""List of key assignments"""
|
||||
|
||||
total_count: float
|
||||
r"""Total number of key assignments for this guardrail"""
|
||||
@@ -0,0 +1,113 @@
|
||||
"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
|
||||
|
||||
from __future__ import annotations
|
||||
from openrouter.types import BaseModel, Nullable, UNSET_SENTINEL
|
||||
from openrouter.utils import FieldMetadata, QueryParamMetadata
|
||||
from pydantic import model_serializer
|
||||
from typing import List, Optional
|
||||
from typing_extensions import Annotated, NotRequired, TypedDict
|
||||
|
||||
|
||||
class ListMemberAssignmentsRequestTypedDict(TypedDict):
|
||||
offset: NotRequired[str]
|
||||
r"""Number of records to skip for pagination"""
|
||||
limit: NotRequired[str]
|
||||
r"""Maximum number of records to return (max 100)"""
|
||||
|
||||
|
||||
class ListMemberAssignmentsRequest(BaseModel):
|
||||
offset: Annotated[
|
||||
Optional[str],
|
||||
FieldMetadata(query=QueryParamMetadata(style="form", explode=True)),
|
||||
] = None
|
||||
r"""Number of records to skip for pagination"""
|
||||
|
||||
limit: Annotated[
|
||||
Optional[str],
|
||||
FieldMetadata(query=QueryParamMetadata(style="form", explode=True)),
|
||||
] = None
|
||||
r"""Maximum number of records to return (max 100)"""
|
||||
|
||||
|
||||
class ListMemberAssignmentsDataTypedDict(TypedDict):
|
||||
id: str
|
||||
r"""Unique identifier for the assignment"""
|
||||
user_id: str
|
||||
r"""Clerk user ID of the assigned member"""
|
||||
organization_id: str
|
||||
r"""Organization ID"""
|
||||
guardrail_id: str
|
||||
r"""ID of the guardrail"""
|
||||
assigned_by: Nullable[str]
|
||||
r"""User ID of who made the assignment"""
|
||||
created_at: str
|
||||
r"""ISO 8601 timestamp of when the assignment was created"""
|
||||
|
||||
|
||||
class ListMemberAssignmentsData(BaseModel):
|
||||
id: str
|
||||
r"""Unique identifier for the assignment"""
|
||||
|
||||
user_id: str
|
||||
r"""Clerk user ID of the assigned member"""
|
||||
|
||||
organization_id: str
|
||||
r"""Organization ID"""
|
||||
|
||||
guardrail_id: str
|
||||
r"""ID of the guardrail"""
|
||||
|
||||
assigned_by: Nullable[str]
|
||||
r"""User ID of who made the assignment"""
|
||||
|
||||
created_at: str
|
||||
r"""ISO 8601 timestamp of when the assignment was created"""
|
||||
|
||||
@model_serializer(mode="wrap")
|
||||
def serialize_model(self, handler):
|
||||
optional_fields = []
|
||||
nullable_fields = ["assigned_by"]
|
||||
null_default_fields = []
|
||||
|
||||
serialized = handler(self)
|
||||
|
||||
m = {}
|
||||
|
||||
for n, f in type(self).model_fields.items():
|
||||
k = f.alias or n
|
||||
val = serialized.get(k)
|
||||
serialized.pop(k, None)
|
||||
|
||||
optional_nullable = k in optional_fields and k in nullable_fields
|
||||
is_set = (
|
||||
self.__pydantic_fields_set__.intersection({n})
|
||||
or k in null_default_fields
|
||||
) # pylint: disable=no-member
|
||||
|
||||
if val is not None and val != UNSET_SENTINEL:
|
||||
m[k] = val
|
||||
elif val != UNSET_SENTINEL and (
|
||||
not k in optional_fields or (optional_nullable and is_set)
|
||||
):
|
||||
m[k] = val
|
||||
|
||||
return m
|
||||
|
||||
|
||||
class ListMemberAssignmentsResponseTypedDict(TypedDict):
|
||||
r"""List of member assignments"""
|
||||
|
||||
data: List[ListMemberAssignmentsDataTypedDict]
|
||||
r"""List of member assignments"""
|
||||
total_count: float
|
||||
r"""Total number of member assignments"""
|
||||
|
||||
|
||||
class ListMemberAssignmentsResponse(BaseModel):
|
||||
r"""List of member assignments"""
|
||||
|
||||
data: List[ListMemberAssignmentsData]
|
||||
r"""List of member assignments"""
|
||||
|
||||
total_count: float
|
||||
r"""Total number of member assignments"""
|
||||
@@ -0,0 +1,271 @@
|
||||
"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
|
||||
|
||||
from __future__ import annotations
|
||||
from openrouter.types import (
|
||||
BaseModel,
|
||||
Nullable,
|
||||
OptionalNullable,
|
||||
UNSET,
|
||||
UNSET_SENTINEL,
|
||||
UnrecognizedStr,
|
||||
)
|
||||
from openrouter.utils import (
|
||||
FieldMetadata,
|
||||
PathParamMetadata,
|
||||
RequestMetadata,
|
||||
validate_open_enum,
|
||||
)
|
||||
from pydantic import model_serializer
|
||||
from pydantic.functional_validators import PlainValidator
|
||||
from typing import List, Literal, Optional, Union
|
||||
from typing_extensions import Annotated, NotRequired, TypedDict
|
||||
|
||||
|
||||
UpdateGuardrailResetIntervalRequest = Union[
|
||||
Literal[
|
||||
"daily",
|
||||
"weekly",
|
||||
"monthly",
|
||||
],
|
||||
UnrecognizedStr,
|
||||
]
|
||||
r"""Interval at which the limit resets (daily, weekly, monthly)"""
|
||||
|
||||
|
||||
class UpdateGuardrailRequestBodyTypedDict(TypedDict):
|
||||
name: NotRequired[str]
|
||||
r"""New name for the guardrail"""
|
||||
description: NotRequired[Nullable[str]]
|
||||
r"""New description for the guardrail"""
|
||||
limit_usd: NotRequired[Nullable[float]]
|
||||
r"""New spending limit in USD"""
|
||||
reset_interval: NotRequired[Nullable[UpdateGuardrailResetIntervalRequest]]
|
||||
r"""Interval at which the limit resets (daily, weekly, monthly)"""
|
||||
allowed_providers: NotRequired[Nullable[List[str]]]
|
||||
r"""New list of allowed provider IDs"""
|
||||
allowed_models: NotRequired[Nullable[List[str]]]
|
||||
r"""Array of model identifiers (slug or canonical_slug accepted)"""
|
||||
enforce_zdr: NotRequired[Nullable[bool]]
|
||||
r"""Whether to enforce zero data retention"""
|
||||
|
||||
|
||||
class UpdateGuardrailRequestBody(BaseModel):
|
||||
name: Optional[str] = None
|
||||
r"""New name for the guardrail"""
|
||||
|
||||
description: OptionalNullable[str] = UNSET
|
||||
r"""New description for the guardrail"""
|
||||
|
||||
limit_usd: OptionalNullable[float] = UNSET
|
||||
r"""New spending limit in USD"""
|
||||
|
||||
reset_interval: Annotated[
|
||||
OptionalNullable[UpdateGuardrailResetIntervalRequest],
|
||||
PlainValidator(validate_open_enum(False)),
|
||||
] = UNSET
|
||||
r"""Interval at which the limit resets (daily, weekly, monthly)"""
|
||||
|
||||
allowed_providers: OptionalNullable[List[str]] = UNSET
|
||||
r"""New list of allowed provider IDs"""
|
||||
|
||||
allowed_models: OptionalNullable[List[str]] = UNSET
|
||||
r"""Array of model identifiers (slug or canonical_slug accepted)"""
|
||||
|
||||
enforce_zdr: OptionalNullable[bool] = UNSET
|
||||
r"""Whether to enforce zero data retention"""
|
||||
|
||||
@model_serializer(mode="wrap")
|
||||
def serialize_model(self, handler):
|
||||
optional_fields = [
|
||||
"name",
|
||||
"description",
|
||||
"limit_usd",
|
||||
"reset_interval",
|
||||
"allowed_providers",
|
||||
"allowed_models",
|
||||
"enforce_zdr",
|
||||
]
|
||||
nullable_fields = [
|
||||
"description",
|
||||
"limit_usd",
|
||||
"reset_interval",
|
||||
"allowed_providers",
|
||||
"allowed_models",
|
||||
"enforce_zdr",
|
||||
]
|
||||
null_default_fields = []
|
||||
|
||||
serialized = handler(self)
|
||||
|
||||
m = {}
|
||||
|
||||
for n, f in type(self).model_fields.items():
|
||||
k = f.alias or n
|
||||
val = serialized.get(k)
|
||||
serialized.pop(k, None)
|
||||
|
||||
optional_nullable = k in optional_fields and k in nullable_fields
|
||||
is_set = (
|
||||
self.__pydantic_fields_set__.intersection({n})
|
||||
or k in null_default_fields
|
||||
) # pylint: disable=no-member
|
||||
|
||||
if val is not None and val != UNSET_SENTINEL:
|
||||
m[k] = val
|
||||
elif val != UNSET_SENTINEL and (
|
||||
not k in optional_fields or (optional_nullable and is_set)
|
||||
):
|
||||
m[k] = val
|
||||
|
||||
return m
|
||||
|
||||
|
||||
class UpdateGuardrailRequestTypedDict(TypedDict):
|
||||
id: str
|
||||
r"""The unique identifier of the guardrail to update"""
|
||||
request_body: UpdateGuardrailRequestBodyTypedDict
|
||||
|
||||
|
||||
class UpdateGuardrailRequest(BaseModel):
|
||||
id: Annotated[
|
||||
str, FieldMetadata(path=PathParamMetadata(style="simple", explode=False))
|
||||
]
|
||||
r"""The unique identifier of the guardrail to update"""
|
||||
|
||||
request_body: Annotated[
|
||||
UpdateGuardrailRequestBody,
|
||||
FieldMetadata(request=RequestMetadata(media_type="application/json")),
|
||||
]
|
||||
|
||||
|
||||
UpdateGuardrailResetIntervalResponse = Union[
|
||||
Literal[
|
||||
"daily",
|
||||
"weekly",
|
||||
"monthly",
|
||||
],
|
||||
UnrecognizedStr,
|
||||
]
|
||||
r"""Interval at which the limit resets (daily, weekly, monthly)"""
|
||||
|
||||
|
||||
class UpdateGuardrailDataTypedDict(TypedDict):
|
||||
r"""The updated guardrail"""
|
||||
|
||||
id: str
|
||||
r"""Unique identifier for the guardrail"""
|
||||
name: str
|
||||
r"""Name of the guardrail"""
|
||||
created_at: str
|
||||
r"""ISO 8601 timestamp of when the guardrail was created"""
|
||||
description: NotRequired[Nullable[str]]
|
||||
r"""Description of the guardrail"""
|
||||
limit_usd: NotRequired[Nullable[float]]
|
||||
r"""Spending limit in USD"""
|
||||
reset_interval: NotRequired[Nullable[UpdateGuardrailResetIntervalResponse]]
|
||||
r"""Interval at which the limit resets (daily, weekly, monthly)"""
|
||||
allowed_providers: NotRequired[Nullable[List[str]]]
|
||||
r"""List of allowed provider IDs"""
|
||||
allowed_models: NotRequired[Nullable[List[str]]]
|
||||
r"""Array of model canonical_slugs (immutable identifiers)"""
|
||||
enforce_zdr: NotRequired[Nullable[bool]]
|
||||
r"""Whether to enforce zero data retention"""
|
||||
updated_at: NotRequired[Nullable[str]]
|
||||
r"""ISO 8601 timestamp of when the guardrail was last updated"""
|
||||
|
||||
|
||||
class UpdateGuardrailData(BaseModel):
|
||||
r"""The updated guardrail"""
|
||||
|
||||
id: str
|
||||
r"""Unique identifier for the guardrail"""
|
||||
|
||||
name: str
|
||||
r"""Name of the guardrail"""
|
||||
|
||||
created_at: str
|
||||
r"""ISO 8601 timestamp of when the guardrail was created"""
|
||||
|
||||
description: OptionalNullable[str] = UNSET
|
||||
r"""Description of the guardrail"""
|
||||
|
||||
limit_usd: OptionalNullable[float] = UNSET
|
||||
r"""Spending limit in USD"""
|
||||
|
||||
reset_interval: Annotated[
|
||||
OptionalNullable[UpdateGuardrailResetIntervalResponse],
|
||||
PlainValidator(validate_open_enum(False)),
|
||||
] = UNSET
|
||||
r"""Interval at which the limit resets (daily, weekly, monthly)"""
|
||||
|
||||
allowed_providers: OptionalNullable[List[str]] = UNSET
|
||||
r"""List of allowed provider IDs"""
|
||||
|
||||
allowed_models: OptionalNullable[List[str]] = UNSET
|
||||
r"""Array of model canonical_slugs (immutable identifiers)"""
|
||||
|
||||
enforce_zdr: OptionalNullable[bool] = UNSET
|
||||
r"""Whether to enforce zero data retention"""
|
||||
|
||||
updated_at: OptionalNullable[str] = UNSET
|
||||
r"""ISO 8601 timestamp of when the guardrail was last updated"""
|
||||
|
||||
@model_serializer(mode="wrap")
|
||||
def serialize_model(self, handler):
|
||||
optional_fields = [
|
||||
"description",
|
||||
"limit_usd",
|
||||
"reset_interval",
|
||||
"allowed_providers",
|
||||
"allowed_models",
|
||||
"enforce_zdr",
|
||||
"updated_at",
|
||||
]
|
||||
nullable_fields = [
|
||||
"description",
|
||||
"limit_usd",
|
||||
"reset_interval",
|
||||
"allowed_providers",
|
||||
"allowed_models",
|
||||
"enforce_zdr",
|
||||
"updated_at",
|
||||
]
|
||||
null_default_fields = []
|
||||
|
||||
serialized = handler(self)
|
||||
|
||||
m = {}
|
||||
|
||||
for n, f in type(self).model_fields.items():
|
||||
k = f.alias or n
|
||||
val = serialized.get(k)
|
||||
serialized.pop(k, None)
|
||||
|
||||
optional_nullable = k in optional_fields and k in nullable_fields
|
||||
is_set = (
|
||||
self.__pydantic_fields_set__.intersection({n})
|
||||
or k in null_default_fields
|
||||
) # pylint: disable=no-member
|
||||
|
||||
if val is not None and val != UNSET_SENTINEL:
|
||||
m[k] = val
|
||||
elif val != UNSET_SENTINEL and (
|
||||
not k in optional_fields or (optional_nullable and is_set)
|
||||
):
|
||||
m[k] = val
|
||||
|
||||
return m
|
||||
|
||||
|
||||
class UpdateGuardrailResponseTypedDict(TypedDict):
|
||||
r"""Guardrail updated successfully"""
|
||||
|
||||
data: UpdateGuardrailDataTypedDict
|
||||
r"""The updated guardrail"""
|
||||
|
||||
|
||||
class UpdateGuardrailResponse(BaseModel):
|
||||
r"""Guardrail updated successfully"""
|
||||
|
||||
data: UpdateGuardrailData
|
||||
r"""The updated guardrail"""
|
||||
@@ -1,237 +0,0 @@
|
||||
"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
|
||||
|
||||
from .basesdk import BaseSDK
|
||||
from openrouter import components, errors, operations, utils
|
||||
from openrouter._hooks import HookContext
|
||||
from openrouter.types import OptionalNullable, UNSET
|
||||
from openrouter.utils import get_security_from_env
|
||||
from openrouter.utils.unmarshal_json_response import unmarshal_json_response
|
||||
from typing import Any, Mapping, Optional, Union
|
||||
|
||||
|
||||
class Parameters(BaseSDK):
|
||||
r"""Parameters endpoints"""
|
||||
|
||||
def get_parameters(
|
||||
self,
|
||||
*,
|
||||
security: Union[
|
||||
operations.GetParametersSecurity, operations.GetParametersSecurityTypedDict
|
||||
],
|
||||
author: str,
|
||||
slug: str,
|
||||
provider: Optional[components.ProviderName] = None,
|
||||
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
||||
server_url: Optional[str] = None,
|
||||
timeout_ms: Optional[int] = None,
|
||||
http_headers: Optional[Mapping[str, str]] = None,
|
||||
) -> operations.GetParametersResponse:
|
||||
r"""Get a model's supported parameters and data about which are most popular
|
||||
|
||||
:param security:
|
||||
:param author:
|
||||
:param slug:
|
||||
:param provider:
|
||||
:param retries: Override the default retry configuration for this method
|
||||
:param server_url: Override the default server URL for this method
|
||||
:param timeout_ms: Override the default request timeout configuration for this method in milliseconds
|
||||
:param http_headers: Additional headers to set or replace on requests.
|
||||
"""
|
||||
base_url = None
|
||||
url_variables = None
|
||||
if timeout_ms is None:
|
||||
timeout_ms = self.sdk_configuration.timeout_ms
|
||||
|
||||
if server_url is not None:
|
||||
base_url = server_url
|
||||
else:
|
||||
base_url = self._get_url(base_url, url_variables)
|
||||
|
||||
request = operations.GetParametersRequest(
|
||||
author=author,
|
||||
slug=slug,
|
||||
provider=provider,
|
||||
)
|
||||
|
||||
req = self._build_request(
|
||||
method="GET",
|
||||
path="/parameters/{author}/{slug}",
|
||||
base_url=base_url,
|
||||
url_variables=url_variables,
|
||||
request=request,
|
||||
request_body_required=False,
|
||||
request_has_path_params=True,
|
||||
request_has_query_params=True,
|
||||
user_agent_header="user-agent",
|
||||
accept_header_value="application/json",
|
||||
http_headers=http_headers,
|
||||
security=utils.get_pydantic_model(
|
||||
security, operations.GetParametersSecurity
|
||||
),
|
||||
allow_empty_value=None,
|
||||
timeout_ms=timeout_ms,
|
||||
)
|
||||
|
||||
if retries == UNSET:
|
||||
if self.sdk_configuration.retry_config is not UNSET:
|
||||
retries = self.sdk_configuration.retry_config
|
||||
|
||||
retry_config = None
|
||||
if isinstance(retries, utils.RetryConfig):
|
||||
retry_config = (retries, ["429", "500", "502", "503", "504"])
|
||||
|
||||
http_res = self.do_request(
|
||||
hook_ctx=HookContext(
|
||||
config=self.sdk_configuration,
|
||||
base_url=base_url or "",
|
||||
operation_id="getParameters",
|
||||
oauth2_scopes=None,
|
||||
security_source=get_security_from_env(security, components.Security),
|
||||
),
|
||||
request=req,
|
||||
error_status_codes=["401", "404", "4XX", "500", "5XX"],
|
||||
retry_config=retry_config,
|
||||
)
|
||||
|
||||
response_data: Any = None
|
||||
if utils.match_response(http_res, "200", "application/json"):
|
||||
return unmarshal_json_response(operations.GetParametersResponse, http_res)
|
||||
if utils.match_response(http_res, "401", "application/json"):
|
||||
response_data = unmarshal_json_response(
|
||||
errors.UnauthorizedResponseErrorData, http_res
|
||||
)
|
||||
raise errors.UnauthorizedResponseError(response_data, http_res)
|
||||
if utils.match_response(http_res, "404", "application/json"):
|
||||
response_data = unmarshal_json_response(
|
||||
errors.NotFoundResponseErrorData, http_res
|
||||
)
|
||||
raise errors.NotFoundResponseError(response_data, http_res)
|
||||
if utils.match_response(http_res, "500", "application/json"):
|
||||
response_data = unmarshal_json_response(
|
||||
errors.InternalServerResponseErrorData, http_res
|
||||
)
|
||||
raise errors.InternalServerResponseError(response_data, http_res)
|
||||
if utils.match_response(http_res, "4XX", "*"):
|
||||
http_res_text = utils.stream_to_text(http_res)
|
||||
raise errors.OpenRouterDefaultError(
|
||||
"API error occurred", http_res, http_res_text
|
||||
)
|
||||
if utils.match_response(http_res, "5XX", "*"):
|
||||
http_res_text = utils.stream_to_text(http_res)
|
||||
raise errors.OpenRouterDefaultError(
|
||||
"API error occurred", http_res, http_res_text
|
||||
)
|
||||
|
||||
raise errors.OpenRouterDefaultError("Unexpected response received", http_res)
|
||||
|
||||
async def get_parameters_async(
|
||||
self,
|
||||
*,
|
||||
security: Union[
|
||||
operations.GetParametersSecurity, operations.GetParametersSecurityTypedDict
|
||||
],
|
||||
author: str,
|
||||
slug: str,
|
||||
provider: Optional[components.ProviderName] = None,
|
||||
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
||||
server_url: Optional[str] = None,
|
||||
timeout_ms: Optional[int] = None,
|
||||
http_headers: Optional[Mapping[str, str]] = None,
|
||||
) -> operations.GetParametersResponse:
|
||||
r"""Get a model's supported parameters and data about which are most popular
|
||||
|
||||
:param security:
|
||||
:param author:
|
||||
:param slug:
|
||||
:param provider:
|
||||
:param retries: Override the default retry configuration for this method
|
||||
:param server_url: Override the default server URL for this method
|
||||
:param timeout_ms: Override the default request timeout configuration for this method in milliseconds
|
||||
:param http_headers: Additional headers to set or replace on requests.
|
||||
"""
|
||||
base_url = None
|
||||
url_variables = None
|
||||
if timeout_ms is None:
|
||||
timeout_ms = self.sdk_configuration.timeout_ms
|
||||
|
||||
if server_url is not None:
|
||||
base_url = server_url
|
||||
else:
|
||||
base_url = self._get_url(base_url, url_variables)
|
||||
|
||||
request = operations.GetParametersRequest(
|
||||
author=author,
|
||||
slug=slug,
|
||||
provider=provider,
|
||||
)
|
||||
|
||||
req = self._build_request_async(
|
||||
method="GET",
|
||||
path="/parameters/{author}/{slug}",
|
||||
base_url=base_url,
|
||||
url_variables=url_variables,
|
||||
request=request,
|
||||
request_body_required=False,
|
||||
request_has_path_params=True,
|
||||
request_has_query_params=True,
|
||||
user_agent_header="user-agent",
|
||||
accept_header_value="application/json",
|
||||
http_headers=http_headers,
|
||||
security=utils.get_pydantic_model(
|
||||
security, operations.GetParametersSecurity
|
||||
),
|
||||
allow_empty_value=None,
|
||||
timeout_ms=timeout_ms,
|
||||
)
|
||||
|
||||
if retries == UNSET:
|
||||
if self.sdk_configuration.retry_config is not UNSET:
|
||||
retries = self.sdk_configuration.retry_config
|
||||
|
||||
retry_config = None
|
||||
if isinstance(retries, utils.RetryConfig):
|
||||
retry_config = (retries, ["429", "500", "502", "503", "504"])
|
||||
|
||||
http_res = await self.do_request_async(
|
||||
hook_ctx=HookContext(
|
||||
config=self.sdk_configuration,
|
||||
base_url=base_url or "",
|
||||
operation_id="getParameters",
|
||||
oauth2_scopes=None,
|
||||
security_source=get_security_from_env(security, components.Security),
|
||||
),
|
||||
request=req,
|
||||
error_status_codes=["401", "404", "4XX", "500", "5XX"],
|
||||
retry_config=retry_config,
|
||||
)
|
||||
|
||||
response_data: Any = None
|
||||
if utils.match_response(http_res, "200", "application/json"):
|
||||
return unmarshal_json_response(operations.GetParametersResponse, http_res)
|
||||
if utils.match_response(http_res, "401", "application/json"):
|
||||
response_data = unmarshal_json_response(
|
||||
errors.UnauthorizedResponseErrorData, http_res
|
||||
)
|
||||
raise errors.UnauthorizedResponseError(response_data, http_res)
|
||||
if utils.match_response(http_res, "404", "application/json"):
|
||||
response_data = unmarshal_json_response(
|
||||
errors.NotFoundResponseErrorData, http_res
|
||||
)
|
||||
raise errors.NotFoundResponseError(response_data, http_res)
|
||||
if utils.match_response(http_res, "500", "application/json"):
|
||||
response_data = unmarshal_json_response(
|
||||
errors.InternalServerResponseErrorData, http_res
|
||||
)
|
||||
raise errors.InternalServerResponseError(response_data, http_res)
|
||||
if utils.match_response(http_res, "4XX", "*"):
|
||||
http_res_text = await utils.stream_to_text_async(http_res)
|
||||
raise errors.OpenRouterDefaultError(
|
||||
"API error occurred", http_res, http_res_text
|
||||
)
|
||||
if utils.match_response(http_res, "5XX", "*"):
|
||||
http_res_text = await utils.stream_to_text_async(http_res)
|
||||
raise errors.OpenRouterDefaultError(
|
||||
"API error occurred", http_res, http_res_text
|
||||
)
|
||||
|
||||
raise errors.OpenRouterDefaultError("Unexpected response received", http_res)
|
||||
@@ -25,9 +25,9 @@ if TYPE_CHECKING:
|
||||
from openrouter.embeddings import Embeddings
|
||||
from openrouter.endpoints import Endpoints
|
||||
from openrouter.generations import Generations
|
||||
from openrouter.guardrails import Guardrails
|
||||
from openrouter.models_ import Models
|
||||
from openrouter.oauth import OAuth
|
||||
from openrouter.parameters import Parameters
|
||||
from openrouter.providers import Providers
|
||||
|
||||
|
||||
@@ -49,12 +49,12 @@ class OpenRouter(BaseSDK):
|
||||
r"""Model information endpoints"""
|
||||
endpoints: "Endpoints"
|
||||
r"""Endpoint information"""
|
||||
parameters: "Parameters"
|
||||
r"""Parameters endpoints"""
|
||||
providers: "Providers"
|
||||
r"""Provider information endpoints"""
|
||||
api_keys: "APIKeys"
|
||||
r"""API key management endpoints"""
|
||||
guardrails: "Guardrails"
|
||||
r"""Guardrails endpoints"""
|
||||
o_auth: "OAuth"
|
||||
r"""OAuth authentication endpoints"""
|
||||
chat: "Chat"
|
||||
@@ -67,9 +67,9 @@ class OpenRouter(BaseSDK):
|
||||
"generations": ("openrouter.generations", "Generations"),
|
||||
"models": ("openrouter.models_", "Models"),
|
||||
"endpoints": ("openrouter.endpoints", "Endpoints"),
|
||||
"parameters": ("openrouter.parameters", "Parameters"),
|
||||
"providers": ("openrouter.providers", "Providers"),
|
||||
"api_keys": ("openrouter.api_keys", "APIKeys"),
|
||||
"guardrails": ("openrouter.guardrails", "Guardrails"),
|
||||
"o_auth": ("openrouter.oauth", "OAuth"),
|
||||
"chat": ("openrouter.chat", "Chat"),
|
||||
"completions": ("openrouter.completions", "Completions"),
|
||||
|
||||
@@ -0,0 +1,378 @@
|
||||
"""Auto-generated by @openrouter/cli types. Do not edit manually."""
|
||||
# Run `npx @openrouter/cli types` to regenerate
|
||||
# Generated: 2025-12-23T14:51:29.122Z
|
||||
# Model count: 351
|
||||
|
||||
from typing import Literal, Union
|
||||
from typing_extensions import TypeAlias
|
||||
|
||||
# Union type of all available model IDs on OpenRouter.
|
||||
# Includes base models and their variants (e.g., ":free", ":nitro").
|
||||
ModelId: TypeAlias = Literal[
|
||||
'ai21/jamba-large-1.7',
|
||||
'ai21/jamba-mini-1.7',
|
||||
'aion-labs/aion-1.0',
|
||||
'aion-labs/aion-1.0-mini',
|
||||
'aion-labs/aion-rp-llama-3.1-8b',
|
||||
'alfredpros/codellama-7b-instruct-solidity',
|
||||
'alibaba/tongyi-deepresearch-30b-a3b',
|
||||
'alibaba/tongyi-deepresearch-30b-a3b:free',
|
||||
'allenai/olmo-2-0325-32b-instruct',
|
||||
'allenai/olmo-3-32b-think:free',
|
||||
'allenai/olmo-3-7b-instruct',
|
||||
'allenai/olmo-3-7b-think',
|
||||
'allenai/olmo-3.1-32b-think:free',
|
||||
'alpindale/goliath-120b',
|
||||
'amazon/nova-2-lite-v1',
|
||||
'amazon/nova-lite-v1',
|
||||
'amazon/nova-micro-v1',
|
||||
'amazon/nova-premier-v1',
|
||||
'amazon/nova-pro-v1',
|
||||
'anthracite-org/magnum-v4-72b',
|
||||
'anthropic/claude-3-haiku',
|
||||
'anthropic/claude-3-opus',
|
||||
'anthropic/claude-3.5-haiku',
|
||||
'anthropic/claude-3.5-haiku-20241022',
|
||||
'anthropic/claude-3.5-sonnet',
|
||||
'anthropic/claude-3.7-sonnet',
|
||||
'anthropic/claude-3.7-sonnet:thinking',
|
||||
'anthropic/claude-haiku-4.5',
|
||||
'anthropic/claude-opus-4',
|
||||
'anthropic/claude-opus-4.1',
|
||||
'anthropic/claude-opus-4.5',
|
||||
'anthropic/claude-sonnet-4',
|
||||
'anthropic/claude-sonnet-4.5',
|
||||
'arcee-ai/coder-large',
|
||||
'arcee-ai/maestro-reasoning',
|
||||
'arcee-ai/spotlight',
|
||||
'arcee-ai/trinity-mini',
|
||||
'arcee-ai/trinity-mini:free',
|
||||
'arcee-ai/virtuoso-large',
|
||||
'arliai/qwq-32b-arliai-rpr-v1',
|
||||
'baidu/ernie-4.5-21b-a3b',
|
||||
'baidu/ernie-4.5-21b-a3b-thinking',
|
||||
'baidu/ernie-4.5-300b-a47b',
|
||||
'baidu/ernie-4.5-vl-28b-a3b',
|
||||
'baidu/ernie-4.5-vl-424b-a47b',
|
||||
'bytedance/ui-tars-1.5-7b',
|
||||
'cognitivecomputations/dolphin-mistral-24b-venice-edition:free',
|
||||
'cohere/command-a',
|
||||
'cohere/command-r-08-2024',
|
||||
'cohere/command-r-plus-08-2024',
|
||||
'cohere/command-r7b-12-2024',
|
||||
'deepcogito/cogito-v2-preview-llama-109b-moe',
|
||||
'deepcogito/cogito-v2-preview-llama-405b',
|
||||
'deepcogito/cogito-v2-preview-llama-70b',
|
||||
'deepcogito/cogito-v2.1-671b',
|
||||
'deepseek/deepseek-chat',
|
||||
'deepseek/deepseek-chat-v3-0324',
|
||||
'deepseek/deepseek-chat-v3.1',
|
||||
'deepseek/deepseek-prover-v2',
|
||||
'deepseek/deepseek-r1',
|
||||
'deepseek/deepseek-r1-0528',
|
||||
'deepseek/deepseek-r1-0528-qwen3-8b',
|
||||
'deepseek/deepseek-r1-0528:free',
|
||||
'deepseek/deepseek-r1-distill-llama-70b',
|
||||
'deepseek/deepseek-r1-distill-qwen-14b',
|
||||
'deepseek/deepseek-r1-distill-qwen-32b',
|
||||
'deepseek/deepseek-v3.1-terminus',
|
||||
'deepseek/deepseek-v3.1-terminus:exacto',
|
||||
'deepseek/deepseek-v3.2',
|
||||
'deepseek/deepseek-v3.2-exp',
|
||||
'deepseek/deepseek-v3.2-speciale',
|
||||
'eleutherai/llemma_7b',
|
||||
'essentialai/rnj-1-instruct',
|
||||
'google/gemini-2.0-flash-001',
|
||||
'google/gemini-2.0-flash-exp:free',
|
||||
'google/gemini-2.0-flash-lite-001',
|
||||
'google/gemini-2.5-flash',
|
||||
'google/gemini-2.5-flash-image',
|
||||
'google/gemini-2.5-flash-image-preview',
|
||||
'google/gemini-2.5-flash-lite',
|
||||
'google/gemini-2.5-flash-lite-preview-09-2025',
|
||||
'google/gemini-2.5-flash-preview-09-2025',
|
||||
'google/gemini-2.5-pro',
|
||||
'google/gemini-2.5-pro-preview',
|
||||
'google/gemini-2.5-pro-preview-05-06',
|
||||
'google/gemini-3-flash-preview',
|
||||
'google/gemini-3-pro-image-preview',
|
||||
'google/gemini-3-pro-preview',
|
||||
'google/gemma-2-27b-it',
|
||||
'google/gemma-2-9b-it',
|
||||
'google/gemma-3-12b-it',
|
||||
'google/gemma-3-12b-it:free',
|
||||
'google/gemma-3-27b-it',
|
||||
'google/gemma-3-27b-it:free',
|
||||
'google/gemma-3-4b-it',
|
||||
'google/gemma-3-4b-it:free',
|
||||
'google/gemma-3n-e2b-it:free',
|
||||
'google/gemma-3n-e4b-it',
|
||||
'google/gemma-3n-e4b-it:free',
|
||||
'gryphe/mythomax-l2-13b',
|
||||
'ibm-granite/granite-4.0-h-micro',
|
||||
'inception/mercury',
|
||||
'inception/mercury-coder',
|
||||
'inflection/inflection-3-pi',
|
||||
'inflection/inflection-3-productivity',
|
||||
'kwaipilot/kat-coder-pro:free',
|
||||
'liquid/lfm-2.2-6b',
|
||||
'liquid/lfm2-8b-a1b',
|
||||
'mancer/weaver',
|
||||
'meituan/longcat-flash-chat',
|
||||
'meta-llama/llama-3-70b-instruct',
|
||||
'meta-llama/llama-3-8b-instruct',
|
||||
'meta-llama/llama-3.1-405b',
|
||||
'meta-llama/llama-3.1-405b-instruct',
|
||||
'meta-llama/llama-3.1-405b-instruct:free',
|
||||
'meta-llama/llama-3.1-70b-instruct',
|
||||
'meta-llama/llama-3.1-8b-instruct',
|
||||
'meta-llama/llama-3.2-11b-vision-instruct',
|
||||
'meta-llama/llama-3.2-1b-instruct',
|
||||
'meta-llama/llama-3.2-3b-instruct',
|
||||
'meta-llama/llama-3.2-3b-instruct:free',
|
||||
'meta-llama/llama-3.2-90b-vision-instruct',
|
||||
'meta-llama/llama-3.3-70b-instruct',
|
||||
'meta-llama/llama-3.3-70b-instruct:free',
|
||||
'meta-llama/llama-4-maverick',
|
||||
'meta-llama/llama-4-scout',
|
||||
'meta-llama/llama-guard-2-8b',
|
||||
'meta-llama/llama-guard-3-8b',
|
||||
'meta-llama/llama-guard-4-12b',
|
||||
'microsoft/phi-3-medium-128k-instruct',
|
||||
'microsoft/phi-3-mini-128k-instruct',
|
||||
'microsoft/phi-3.5-mini-128k-instruct',
|
||||
'microsoft/phi-4',
|
||||
'microsoft/phi-4-multimodal-instruct',
|
||||
'microsoft/phi-4-reasoning-plus',
|
||||
'microsoft/wizardlm-2-8x22b',
|
||||
'minimax/minimax-01',
|
||||
'minimax/minimax-m1',
|
||||
'minimax/minimax-m2',
|
||||
'minimax/minimax-m2.1',
|
||||
'mistralai/codestral-2508',
|
||||
'mistralai/devstral-2512',
|
||||
'mistralai/devstral-2512:free',
|
||||
'mistralai/devstral-medium',
|
||||
'mistralai/devstral-small',
|
||||
'mistralai/devstral-small-2505',
|
||||
'mistralai/ministral-14b-2512',
|
||||
'mistralai/ministral-3b',
|
||||
'mistralai/ministral-3b-2512',
|
||||
'mistralai/ministral-8b',
|
||||
'mistralai/ministral-8b-2512',
|
||||
'mistralai/mistral-7b-instruct',
|
||||
'mistralai/mistral-7b-instruct-v0.1',
|
||||
'mistralai/mistral-7b-instruct-v0.2',
|
||||
'mistralai/mistral-7b-instruct-v0.3',
|
||||
'mistralai/mistral-7b-instruct:free',
|
||||
'mistralai/mistral-large',
|
||||
'mistralai/mistral-large-2407',
|
||||
'mistralai/mistral-large-2411',
|
||||
'mistralai/mistral-large-2512',
|
||||
'mistralai/mistral-medium-3',
|
||||
'mistralai/mistral-medium-3.1',
|
||||
'mistralai/mistral-nemo',
|
||||
'mistralai/mistral-saba',
|
||||
'mistralai/mistral-small-24b-instruct-2501',
|
||||
'mistralai/mistral-small-3.1-24b-instruct',
|
||||
'mistralai/mistral-small-3.1-24b-instruct:free',
|
||||
'mistralai/mistral-small-3.2-24b-instruct',
|
||||
'mistralai/mistral-small-creative',
|
||||
'mistralai/mistral-tiny',
|
||||
'mistralai/mixtral-8x22b-instruct',
|
||||
'mistralai/mixtral-8x7b-instruct',
|
||||
'mistralai/pixtral-12b',
|
||||
'mistralai/pixtral-large-2411',
|
||||
'mistralai/voxtral-small-24b-2507',
|
||||
'moonshotai/kimi-dev-72b',
|
||||
'moonshotai/kimi-k2',
|
||||
'moonshotai/kimi-k2-0905',
|
||||
'moonshotai/kimi-k2-0905:exacto',
|
||||
'moonshotai/kimi-k2-thinking',
|
||||
'moonshotai/kimi-k2:free',
|
||||
'morph/morph-v3-fast',
|
||||
'morph/morph-v3-large',
|
||||
'neversleep/llama-3.1-lumimaid-8b',
|
||||
'neversleep/noromaid-20b',
|
||||
'nex-agi/deepseek-v3.1-nex-n1:free',
|
||||
'nousresearch/deephermes-3-mistral-24b-preview',
|
||||
'nousresearch/hermes-2-pro-llama-3-8b',
|
||||
'nousresearch/hermes-3-llama-3.1-405b',
|
||||
'nousresearch/hermes-3-llama-3.1-405b:free',
|
||||
'nousresearch/hermes-3-llama-3.1-70b',
|
||||
'nousresearch/hermes-4-405b',
|
||||
'nousresearch/hermes-4-70b',
|
||||
'nvidia/llama-3.1-nemotron-70b-instruct',
|
||||
'nvidia/llama-3.1-nemotron-ultra-253b-v1',
|
||||
'nvidia/llama-3.3-nemotron-super-49b-v1.5',
|
||||
'nvidia/nemotron-3-nano-30b-a3b',
|
||||
'nvidia/nemotron-3-nano-30b-a3b:free',
|
||||
'nvidia/nemotron-nano-12b-v2-vl',
|
||||
'nvidia/nemotron-nano-12b-v2-vl:free',
|
||||
'nvidia/nemotron-nano-9b-v2',
|
||||
'nvidia/nemotron-nano-9b-v2:free',
|
||||
'openai/chatgpt-4o-latest',
|
||||
'openai/codex-mini',
|
||||
'openai/gpt-3.5-turbo',
|
||||
'openai/gpt-3.5-turbo-0613',
|
||||
'openai/gpt-3.5-turbo-16k',
|
||||
'openai/gpt-3.5-turbo-instruct',
|
||||
'openai/gpt-4',
|
||||
'openai/gpt-4-0314',
|
||||
'openai/gpt-4-1106-preview',
|
||||
'openai/gpt-4-turbo',
|
||||
'openai/gpt-4-turbo-preview',
|
||||
'openai/gpt-4.1',
|
||||
'openai/gpt-4.1-mini',
|
||||
'openai/gpt-4.1-nano',
|
||||
'openai/gpt-4o',
|
||||
'openai/gpt-4o-2024-05-13',
|
||||
'openai/gpt-4o-2024-08-06',
|
||||
'openai/gpt-4o-2024-11-20',
|
||||
'openai/gpt-4o-audio-preview',
|
||||
'openai/gpt-4o-mini',
|
||||
'openai/gpt-4o-mini-2024-07-18',
|
||||
'openai/gpt-4o-mini-search-preview',
|
||||
'openai/gpt-4o-search-preview',
|
||||
'openai/gpt-4o:extended',
|
||||
'openai/gpt-5',
|
||||
'openai/gpt-5-chat',
|
||||
'openai/gpt-5-codex',
|
||||
'openai/gpt-5-image',
|
||||
'openai/gpt-5-image-mini',
|
||||
'openai/gpt-5-mini',
|
||||
'openai/gpt-5-nano',
|
||||
'openai/gpt-5-pro',
|
||||
'openai/gpt-5.1',
|
||||
'openai/gpt-5.1-chat',
|
||||
'openai/gpt-5.1-codex',
|
||||
'openai/gpt-5.1-codex-max',
|
||||
'openai/gpt-5.1-codex-mini',
|
||||
'openai/gpt-5.2',
|
||||
'openai/gpt-5.2-chat',
|
||||
'openai/gpt-5.2-pro',
|
||||
'openai/gpt-oss-120b',
|
||||
'openai/gpt-oss-120b:exacto',
|
||||
'openai/gpt-oss-120b:free',
|
||||
'openai/gpt-oss-20b',
|
||||
'openai/gpt-oss-20b:free',
|
||||
'openai/gpt-oss-safeguard-20b',
|
||||
'openai/o1',
|
||||
'openai/o1-pro',
|
||||
'openai/o3',
|
||||
'openai/o3-deep-research',
|
||||
'openai/o3-mini',
|
||||
'openai/o3-mini-high',
|
||||
'openai/o3-pro',
|
||||
'openai/o4-mini',
|
||||
'openai/o4-mini-deep-research',
|
||||
'openai/o4-mini-high',
|
||||
'opengvlab/internvl3-78b',
|
||||
'openrouter/auto',
|
||||
'openrouter/bodybuilder',
|
||||
'perplexity/sonar',
|
||||
'perplexity/sonar-deep-research',
|
||||
'perplexity/sonar-pro',
|
||||
'perplexity/sonar-pro-search',
|
||||
'perplexity/sonar-reasoning',
|
||||
'perplexity/sonar-reasoning-pro',
|
||||
'prime-intellect/intellect-3',
|
||||
'qwen/qwen-2.5-72b-instruct',
|
||||
'qwen/qwen-2.5-7b-instruct',
|
||||
'qwen/qwen-2.5-coder-32b-instruct',
|
||||
'qwen/qwen-2.5-vl-7b-instruct',
|
||||
'qwen/qwen-2.5-vl-7b-instruct:free',
|
||||
'qwen/qwen-max',
|
||||
'qwen/qwen-plus',
|
||||
'qwen/qwen-plus-2025-07-28',
|
||||
'qwen/qwen-plus-2025-07-28:thinking',
|
||||
'qwen/qwen-turbo',
|
||||
'qwen/qwen-vl-max',
|
||||
'qwen/qwen-vl-plus',
|
||||
'qwen/qwen2.5-coder-7b-instruct',
|
||||
'qwen/qwen2.5-vl-32b-instruct',
|
||||
'qwen/qwen2.5-vl-72b-instruct',
|
||||
'qwen/qwen3-14b',
|
||||
'qwen/qwen3-235b-a22b',
|
||||
'qwen/qwen3-235b-a22b-2507',
|
||||
'qwen/qwen3-235b-a22b-thinking-2507',
|
||||
'qwen/qwen3-30b-a3b',
|
||||
'qwen/qwen3-30b-a3b-instruct-2507',
|
||||
'qwen/qwen3-30b-a3b-thinking-2507',
|
||||
'qwen/qwen3-32b',
|
||||
'qwen/qwen3-4b:free',
|
||||
'qwen/qwen3-8b',
|
||||
'qwen/qwen3-coder',
|
||||
'qwen/qwen3-coder-30b-a3b-instruct',
|
||||
'qwen/qwen3-coder-flash',
|
||||
'qwen/qwen3-coder-plus',
|
||||
'qwen/qwen3-coder:exacto',
|
||||
'qwen/qwen3-coder:free',
|
||||
'qwen/qwen3-max',
|
||||
'qwen/qwen3-next-80b-a3b-instruct',
|
||||
'qwen/qwen3-next-80b-a3b-thinking',
|
||||
'qwen/qwen3-vl-235b-a22b-instruct',
|
||||
'qwen/qwen3-vl-235b-a22b-thinking',
|
||||
'qwen/qwen3-vl-30b-a3b-instruct',
|
||||
'qwen/qwen3-vl-30b-a3b-thinking',
|
||||
'qwen/qwen3-vl-32b-instruct',
|
||||
'qwen/qwen3-vl-8b-instruct',
|
||||
'qwen/qwen3-vl-8b-thinking',
|
||||
'qwen/qwq-32b',
|
||||
'raifle/sorcererlm-8x22b',
|
||||
'relace/relace-apply-3',
|
||||
'relace/relace-search',
|
||||
'sao10k/l3-euryale-70b',
|
||||
'sao10k/l3-lunaris-8b',
|
||||
'sao10k/l3.1-70b-hanami-x1',
|
||||
'sao10k/l3.1-euryale-70b',
|
||||
'sao10k/l3.3-euryale-70b',
|
||||
'stepfun-ai/step3',
|
||||
'switchpoint/router',
|
||||
'tencent/hunyuan-a13b-instruct',
|
||||
'thedrummer/cydonia-24b-v4.1',
|
||||
'thedrummer/rocinante-12b',
|
||||
'thedrummer/skyfall-36b-v2',
|
||||
'thedrummer/unslopnemo-12b',
|
||||
'thudm/glm-4.1v-9b-thinking',
|
||||
'tngtech/deepseek-r1t-chimera',
|
||||
'tngtech/deepseek-r1t-chimera:free',
|
||||
'tngtech/deepseek-r1t2-chimera',
|
||||
'tngtech/deepseek-r1t2-chimera:free',
|
||||
'tngtech/tng-r1t-chimera',
|
||||
'tngtech/tng-r1t-chimera:free',
|
||||
'undi95/remm-slerp-l2-13b',
|
||||
'x-ai/grok-3',
|
||||
'x-ai/grok-3-beta',
|
||||
'x-ai/grok-3-mini',
|
||||
'x-ai/grok-3-mini-beta',
|
||||
'x-ai/grok-4',
|
||||
'x-ai/grok-4-fast',
|
||||
'x-ai/grok-4.1-fast',
|
||||
'x-ai/grok-code-fast-1',
|
||||
'xiaomi/mimo-v2-flash:free',
|
||||
'z-ai/glm-4-32b',
|
||||
'z-ai/glm-4.5',
|
||||
'z-ai/glm-4.5-air',
|
||||
'z-ai/glm-4.5-air:free',
|
||||
'z-ai/glm-4.5v',
|
||||
'z-ai/glm-4.6',
|
||||
'z-ai/glm-4.6:exacto',
|
||||
'z-ai/glm-4.6v',
|
||||
'z-ai/glm-4.7'
|
||||
]
|
||||
|
||||
# Static variants that create distinct model IDs.
|
||||
# These are already present in the API response (e.g., "openai/gpt-4:free").
|
||||
StaticVariant: TypeAlias = Literal['free', 'extended', 'exacto', 'thinking']
|
||||
|
||||
# Virtual variants used for routing hints.
|
||||
# These do not create distinct model IDs but affect routing behavior.
|
||||
VirtualVariant: TypeAlias = Literal['all', 'online', 'nitro', 'floor']
|
||||
|
||||
# All available variants.
|
||||
Variant: TypeAlias = Union[StaticVariant, VirtualVariant]
|
||||
|
||||
# Hash of model IDs for staleness checking.
|
||||
# Used by postinstall script to detect outdated types.
|
||||
MODEL_HASH: str = '986e77d89072f654'
|
||||
Reference in New Issue
Block a user