"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""

from __future__ import annotations
from openrouter.components import (
    listbyokkeysresponse as components_listbyokkeysresponse,
)
from openrouter.types import BaseModel, UnrecognizedStr
from openrouter.utils import (
    FieldMetadata,
    HeaderMetadata,
    QueryParamMetadata,
    validate_open_enum,
)
import pydantic
from pydantic.functional_validators import PlainValidator
from typing import Awaitable, Callable, Literal, Optional, Union
from typing_extensions import Annotated, NotRequired, TypedDict


class ListBYOKKeysGlobalsTypedDict(TypedDict):
    http_referer: NotRequired[str]
    r"""The app identifier should be your app's URL and is used as the primary identifier for rankings.
    This is used to track API usage per application.

    """
    x_open_router_title: NotRequired[str]
    r"""The app display name allows you to customize how your app appears in OpenRouter's dashboard.

    """
    x_open_router_categories: NotRequired[str]
    r"""Comma-separated list of app categories (e.g. \"cli-agent,cloud-agent\"). Used for marketplace rankings.

    """


class ListBYOKKeysGlobals(BaseModel):
    http_referer: Annotated[
        Optional[str],
        pydantic.Field(alias="HTTP-Referer"),
        FieldMetadata(header=HeaderMetadata(style="simple", explode=False)),
    ] = None
    r"""The app identifier should be your app's URL and is used as the primary identifier for rankings.
    This is used to track API usage per application.

    """

    x_open_router_title: Annotated[
        Optional[str],
        pydantic.Field(alias="X-OpenRouter-Title"),
        FieldMetadata(header=HeaderMetadata(style="simple", explode=False)),
    ] = None
    r"""The app display name allows you to customize how your app appears in OpenRouter's dashboard.

    """

    x_open_router_categories: Annotated[
        Optional[str],
        pydantic.Field(alias="X-OpenRouter-Categories"),
        FieldMetadata(header=HeaderMetadata(style="simple", explode=False)),
    ] = None
    r"""Comma-separated list of app categories (e.g. \"cli-agent,cloud-agent\"). Used for marketplace rankings.

    """


Provider = Union[
    Literal[
        "ai21",
        "aion-labs",
        "akashml",
        "alibaba",
        "amazon-bedrock",
        "amazon-nova",
        "ambient",
        "anthropic",
        "arcee-ai",
        "atlas-cloud",
        "avian",
        "azure",
        "baidu",
        "baseten",
        "black-forest-labs",
        "byteplus",
        "cerebras",
        "chutes",
        "cirrascale",
        "clarifai",
        "cloudflare",
        "cohere",
        "crusoe",
        "darkbloom",
        "decart",
        "deepinfra",
        "deepseek",
        "dekallm",
        "digitalocean",
        "featherless",
        "fireworks",
        "friendli",
        "gmicloud",
        "google-ai-studio",
        "google-vertex",
        "groq",
        "inception",
        "inceptron",
        "inference-net",
        "infermatic",
        "inflection",
        "io-net",
        "ionstream",
        "liquid",
        "mancer",
        "mara",
        "minimax",
        "mistral",
        "modelrun",
        "modular",
        "moonshotai",
        "morph",
        "ncompass",
        "nebius",
        "nex-agi",
        "nextbit",
        "novita",
        "nvidia",
        "open-inference",
        "openai",
        "parasail",
        "perceptron",
        "perplexity",
        "phala",
        "poolside",
        "recraft",
        "reka",
        "relace",
        "sambanova",
        "seed",
        "siliconflow",
        "sourceful",
        "stepfun",
        "streamlake",
        "switchpoint",
        "together",
        "upstage",
        "venice",
        "wafer",
        "wandb",
        "xai",
        "xiaomi",
        "z-ai",
    ],
    UnrecognizedStr,
]
r"""Optional provider slug to filter by (e.g. `openai`, `anthropic`, `amazon-bedrock`)."""


class ListBYOKKeysRequestTypedDict(TypedDict):
    http_referer: NotRequired[str]
    r"""The app identifier should be your app's URL and is used as the primary identifier for rankings.
    This is used to track API usage per application.

    """
    x_open_router_title: NotRequired[str]
    r"""The app display name allows you to customize how your app appears in OpenRouter's dashboard.

    """
    x_open_router_categories: NotRequired[str]
    r"""Comma-separated list of app categories (e.g. \"cli-agent,cloud-agent\"). Used for marketplace rankings.

    """
    offset: NotRequired[int]
    r"""Number of records to skip for pagination"""
    limit: NotRequired[int]
    r"""Maximum number of records to return (max 100)"""
    workspace_id: NotRequired[str]
    r"""Optional workspace ID to filter by. Defaults to the authenticated entity's default workspace."""
    provider: NotRequired[Provider]
    r"""Optional provider slug to filter by (e.g. `openai`, `anthropic`, `amazon-bedrock`)."""


class ListBYOKKeysRequest(BaseModel):
    http_referer: Annotated[
        Optional[str],
        pydantic.Field(alias="HTTP-Referer"),
        FieldMetadata(header=HeaderMetadata(style="simple", explode=False)),
    ] = None
    r"""The app identifier should be your app's URL and is used as the primary identifier for rankings.
    This is used to track API usage per application.

    """

    x_open_router_title: Annotated[
        Optional[str],
        pydantic.Field(alias="X-OpenRouter-Title"),
        FieldMetadata(header=HeaderMetadata(style="simple", explode=False)),
    ] = None
    r"""The app display name allows you to customize how your app appears in OpenRouter's dashboard.

    """

    x_open_router_categories: Annotated[
        Optional[str],
        pydantic.Field(alias="X-OpenRouter-Categories"),
        FieldMetadata(header=HeaderMetadata(style="simple", explode=False)),
    ] = None
    r"""Comma-separated list of app categories (e.g. \"cli-agent,cloud-agent\"). Used for marketplace rankings.

    """

    offset: Annotated[
        Optional[int],
        FieldMetadata(query=QueryParamMetadata(style="form", explode=True)),
    ] = None
    r"""Number of records to skip for pagination"""

    limit: Annotated[
        Optional[int],
        FieldMetadata(query=QueryParamMetadata(style="form", explode=True)),
    ] = None
    r"""Maximum number of records to return (max 100)"""

    workspace_id: Annotated[
        Optional[str],
        FieldMetadata(query=QueryParamMetadata(style="form", explode=True)),
    ] = None
    r"""Optional workspace ID to filter by. Defaults to the authenticated entity's default workspace."""

    provider: Annotated[
        Annotated[Optional[Provider], PlainValidator(validate_open_enum(False))],
        FieldMetadata(query=QueryParamMetadata(style="form", explode=True)),
    ] = None
    r"""Optional provider slug to filter by (e.g. `openai`, `anthropic`, `amazon-bedrock`)."""


class ListBYOKKeysResponseTypedDict(TypedDict):
    result: components_listbyokkeysresponse.ListBYOKKeysResponseTypedDict


class ListBYOKKeysResponse(BaseModel):
    next: Union[
        Callable[[], Optional[ListBYOKKeysResponse]],
        Callable[[], Awaitable[Optional[ListBYOKKeysResponse]]],
    ]

    result: components_listbyokkeysresponse.ListBYOKKeysResponse
