Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
139 changes: 109 additions & 30 deletions packages/ai/openrouter/src/Generated.ts
Original file line number Diff line number Diff line change
Expand Up @@ -678,6 +678,7 @@ export type ProviderName =
| "Inceptron"
| "InferenceNet"
| "Infermatic"
| "Io Net"
| "Inflection"
| "Liquid"
| "Mara"
Expand Down Expand Up @@ -751,6 +752,7 @@ export const ProviderName = Schema.Literals([
"Inceptron",
"InferenceNet",
"Infermatic",
"Io Net",
"Inflection",
"Liquid",
"Mara",
Expand Down Expand Up @@ -2583,6 +2585,7 @@ export type __schema5 = ReadonlyArray<
| "Inceptron"
| "InferenceNet"
| "Infermatic"
| "Io Net"
| "Inflection"
| "Liquid"
| "Mara"
Expand Down Expand Up @@ -2660,6 +2663,7 @@ export const __schema5 = Schema.Array(
"Inceptron",
"InferenceNet",
"Infermatic",
"Io Net",
"Inflection",
"Liquid",
"Mara",
Expand Down Expand Up @@ -2705,17 +2709,17 @@ export type __schema11 = number
export const __schema11 = Schema.Number.check(Schema.isFinite())
export type __schema13 = unknown
export const __schema13 = Schema.Unknown
export type __schema20 = string | null
export const __schema20 = Schema.Union([Schema.String, Schema.Null])
export type __schema21 =
export type __schema21 = string | null
export const __schema21 = Schema.Union([Schema.String, Schema.Null])
export type __schema22 =
| "unknown"
| "openai-responses-v1"
| "azure-openai-responses-v1"
| "xai-responses-v1"
| "anthropic-claude-v1"
| "google-gemini-v1"
| null
export const __schema21 = Schema.Union([
export const __schema22 = Schema.Union([
Schema.Literals([
"unknown",
"openai-responses-v1",
Expand Down Expand Up @@ -3551,47 +3555,47 @@ export const PublicEndpoint = Schema.Struct({
"Throughput percentiles in tokens per second over the last 30 minutes. Throughput measures output token generation speed. Only visible when authenticated with an API key or cookie; returns null for unauthenticated requests."
})
}).annotate({ "description": "Information about a specific model endpoint" })
export type __schema19 = {
export type __schema20 = {
readonly "type": "reasoning.summary"
readonly "summary": string
readonly "id"?: __schema20
readonly "format"?: __schema21
readonly "id"?: __schema21
readonly "format"?: __schema22
readonly "index"?: __schema11
} | {
readonly "type": "reasoning.encrypted"
readonly "data": string
readonly "id"?: __schema20
readonly "format"?: __schema21
readonly "id"?: __schema21
readonly "format"?: __schema22
readonly "index"?: __schema11
} | {
readonly "type": "reasoning.text"
readonly "text"?: string | null
readonly "signature"?: string | null
readonly "id"?: __schema20
readonly "format"?: __schema21
readonly "id"?: __schema21
readonly "format"?: __schema22
readonly "index"?: __schema11
}
export const __schema19 = Schema.Union([
export const __schema20 = Schema.Union([
Schema.Struct({
"type": Schema.Literal("reasoning.summary"),
"summary": Schema.String,
"id": Schema.optionalKey(__schema20),
"format": Schema.optionalKey(__schema21),
"id": Schema.optionalKey(__schema21),
"format": Schema.optionalKey(__schema22),
"index": Schema.optionalKey(__schema11)
}),
Schema.Struct({
"type": Schema.Literal("reasoning.encrypted"),
"data": Schema.String,
"id": Schema.optionalKey(__schema20),
"format": Schema.optionalKey(__schema21),
"id": Schema.optionalKey(__schema21),
"format": Schema.optionalKey(__schema22),
"index": Schema.optionalKey(__schema11)
}),
Schema.Struct({
"type": Schema.Literal("reasoning.text"),
"text": Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])),
"signature": Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])),
"id": Schema.optionalKey(__schema20),
"format": Schema.optionalKey(__schema21),
"id": Schema.optionalKey(__schema21),
"format": Schema.optionalKey(__schema22),
"index": Schema.optionalKey(__schema11)
})
], { mode: "oneOf" })
Expand All @@ -3605,8 +3609,8 @@ export const ChatMessageTokenLogprobs = Schema.Struct({
"content": Schema.Union([Schema.Array(ChatMessageTokenLogprob), Schema.Null]),
"refusal": Schema.Union([Schema.Array(ChatMessageTokenLogprob), Schema.Null])
})
export type __schema25 = ChatCompletionFinishReason | null
export const __schema25 = Schema.Union([ChatCompletionFinishReason, Schema.Null])
export type __schema26 = ChatCompletionFinishReason | null
export const __schema26 = Schema.Union([ChatCompletionFinishReason, Schema.Null])
export type ResponseFormatJSONSchema = { readonly "type": "json_schema"; readonly "json_schema": JSONSchemaConfig }
export const ResponseFormatJSONSchema = Schema.Struct({
"type": Schema.Literal("json_schema"),
Expand Down Expand Up @@ -3970,6 +3974,13 @@ export type AnthropicMessagesRequest = {
readonly "route"?: "fallback" | "sort"
readonly "user"?: string
readonly "session_id"?: string
readonly "trace"?: {
readonly "trace_id"?: string
readonly "trace_name"?: string
readonly "span_name"?: string
readonly "generation_name"?: string
readonly "parent_span_id"?: string
}
readonly "models"?: ReadonlyArray<string>
readonly "output_config"?: AnthropicOutputConfig
}
Expand Down Expand Up @@ -4257,6 +4268,18 @@ export const AnthropicMessagesRequest = Schema.Struct({
"A unique identifier for grouping related requests (e.g., a conversation or agent workflow) for observability. If provided in both the request body and the x-session-id header, the body value takes precedence. Maximum of 128 characters."
}).check(Schema.isMaxLength(128))
),
"trace": Schema.optionalKey(
Schema.Struct({
"trace_id": Schema.optionalKey(Schema.String),
"trace_name": Schema.optionalKey(Schema.String),
"span_name": Schema.optionalKey(Schema.String),
"generation_name": Schema.optionalKey(Schema.String),
"parent_span_id": Schema.optionalKey(Schema.String)
}).annotate({
"description":
"Metadata for observability and tracing. Known keys (trace_id, trace_name, span_name, generation_name, parent_span_id) have special handling. Additional keys are passed through as custom metadata to configured broadcast destinations."
})
),
"models": Schema.optionalKey(Schema.Array(Schema.String)),
"output_config": Schema.optionalKey(AnthropicOutputConfig)
}).annotate({ "description": "Request schema for Anthropic Messages API endpoint" })
Expand Down Expand Up @@ -4440,7 +4463,7 @@ export type ChatStreamingMessageChunk = {
readonly "reasoning"?: string | null
readonly "refusal"?: string | null
readonly "tool_calls"?: ReadonlyArray<ChatStreamingMessageToolCall>
readonly "reasoning_details"?: ReadonlyArray<__schema19>
readonly "reasoning_details"?: ReadonlyArray<__schema20>
readonly "images"?:
| ReadonlyArray<{ readonly "type": "image_url"; readonly "image_url": { readonly "url": string } }>
| null
Expand Down Expand Up @@ -4475,7 +4498,7 @@ export const ChatStreamingMessageChunk = Schema.Struct({
"reasoning": Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])),
"refusal": Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])),
"tool_calls": Schema.optionalKey(Schema.Array(ChatStreamingMessageToolCall)),
"reasoning_details": Schema.optionalKey(Schema.Array(__schema19)),
"reasoning_details": Schema.optionalKey(Schema.Array(__schema20)),
"images": Schema.optionalKey(
Schema.Union([
Schema.Array(
Expand Down Expand Up @@ -4609,13 +4632,13 @@ export type ModelsListResponseData = ReadonlyArray<Model>
export const ModelsListResponseData = Schema.Array(Model).annotate({ "description": "List of available models" })
export type ChatStreamingChoice = {
readonly "delta": ChatStreamingMessageChunk
readonly "finish_reason": __schema25
readonly "finish_reason": __schema26
readonly "index": number
readonly "logprobs"?: ChatMessageTokenLogprobs | null
}
export const ChatStreamingChoice = Schema.Struct({
"delta": ChatStreamingMessageChunk,
"finish_reason": __schema25,
"finish_reason": __schema26,
"index": Schema.Number.check(Schema.isFinite()),
"logprobs": Schema.optionalKey(Schema.Union([ChatMessageTokenLogprobs, Schema.Null]))
})
Expand All @@ -4636,7 +4659,7 @@ export type AssistantMessage = {
readonly "tool_calls"?: ReadonlyArray<ChatMessageToolCall>
readonly "refusal"?: string | null
readonly "reasoning"?: string | null
readonly "reasoning_details"?: ReadonlyArray<__schema19>
readonly "reasoning_details"?: ReadonlyArray<__schema20>
readonly "images"?:
| ReadonlyArray<{ readonly "type": "image_url"; readonly "image_url": { readonly "url": string } }>
| null
Expand Down Expand Up @@ -4674,7 +4697,7 @@ export const AssistantMessage = Schema.Struct({
"tool_calls": Schema.optionalKey(Schema.Array(ChatMessageToolCall)),
"refusal": Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])),
"reasoning": Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])),
"reasoning_details": Schema.optionalKey(Schema.Array(__schema19)),
"reasoning_details": Schema.optionalKey(Schema.Array(__schema20)),
"images": Schema.optionalKey(
Schema.Union([
Schema.Array(
Expand Down Expand Up @@ -4915,13 +4938,13 @@ export const ChatStreamingResponseChunk = Schema.Struct({
})
})
export type ChatResponseChoice = {
readonly "finish_reason": __schema25
readonly "finish_reason": __schema26
readonly "index": number
readonly "message": AssistantMessage
readonly "logprobs"?: ChatMessageTokenLogprobs | null
}
export const ChatResponseChoice = Schema.Struct({
"finish_reason": __schema25,
"finish_reason": __schema26,
"index": Schema.Number.check(Schema.isFinite()),
"message": AssistantMessage,
"logprobs": Schema.optionalKey(Schema.Union([ChatMessageTokenLogprobs, Schema.Null]))
Expand Down Expand Up @@ -6299,6 +6322,13 @@ export type OpenResponsesRequest = {
readonly "route"?: "fallback" | "sort"
readonly "user"?: string
readonly "session_id"?: string
readonly "trace"?: {
readonly "trace_id"?: string
readonly "trace_name"?: string
readonly "span_name"?: string
readonly "generation_name"?: string
readonly "parent_span_id"?: string
}
}
export const OpenResponsesRequest = Schema.Struct({
"input": Schema.optionalKey(OpenResponsesInput),
Expand Down Expand Up @@ -6504,6 +6534,18 @@ export const OpenResponsesRequest = Schema.Struct({
"description":
"A unique identifier for grouping related requests (e.g., a conversation or agent workflow) for observability. If provided in both the request body and the x-session-id header, the body value takes precedence. Maximum of 128 characters."
}).check(Schema.isMaxLength(128))
),
"trace": Schema.optionalKey(
Schema.Struct({
"trace_id": Schema.optionalKey(Schema.String),
"trace_name": Schema.optionalKey(Schema.String),
"span_name": Schema.optionalKey(Schema.String),
"generation_name": Schema.optionalKey(Schema.String),
"parent_span_id": Schema.optionalKey(Schema.String)
}).annotate({
"description":
"Metadata for observability and tracing. Known keys (trace_id, trace_name, span_name, generation_name, parent_span_id) have special handling. Additional keys are passed through as custom metadata to configured broadcast destinations."
})
)
}).annotate({ "description": "Request schema for Responses endpoint" })
export type ChatGenerationParams = {
Expand Down Expand Up @@ -6560,6 +6602,13 @@ export type ChatGenerationParams = {
readonly "route"?: "fallback" | "sort" | null
readonly "user"?: string
readonly "session_id"?: string
readonly "trace"?: {
readonly "trace_id"?: string
readonly "trace_name"?: string
readonly "span_name"?: string
readonly "generation_name"?: string
readonly "parent_span_id"?: string
}
readonly "messages": ReadonlyArray<Message>
readonly "model"?: ModelName
readonly "models"?: ReadonlyArray<ModelName>
Expand Down Expand Up @@ -6734,6 +6783,18 @@ export const ChatGenerationParams = Schema.Struct({
"A unique identifier for grouping related requests (e.g., a conversation or agent workflow) for observability. If provided in both the request body and the x-session-id header, the body value takes precedence. Maximum of 128 characters."
}).check(Schema.isMaxLength(128))
),
"trace": Schema.optionalKey(
Schema.Struct({
"trace_id": Schema.optionalKey(Schema.String),
"trace_name": Schema.optionalKey(Schema.String),
"span_name": Schema.optionalKey(Schema.String),
"generation_name": Schema.optionalKey(Schema.String),
"parent_span_id": Schema.optionalKey(Schema.String)
}).annotate({
"description":
"Metadata for observability and tracing. Known keys (trace_id, trace_name, span_name, generation_name, parent_span_id) have special handling. Additional keys are passed through as custom metadata to configured broadcast destinations."
})
),
"messages": Schema.Array(Message).check(Schema.isMinLength(1)),
"model": Schema.optionalKey(ModelName),
"models": Schema.optionalKey(Schema.Array(ModelName)),
Expand Down Expand Up @@ -7342,6 +7403,7 @@ export type GetGeneration200 = {
| "Inceptron"
| "InferenceNet"
| "Infermatic"
| "Io Net"
| "Inflection"
| "Liquid"
| "Mara"
Expand Down Expand Up @@ -7522,6 +7584,7 @@ export const GetGeneration200 = Schema.Struct({
"Inceptron",
"InferenceNet",
"Infermatic",
"Io Net",
"Inflection",
"Liquid",
"Mara",
Expand Down Expand Up @@ -7602,6 +7665,7 @@ export type GetModelsParams = {
| "trivia"
| "academia"
readonly "supported_parameters"?: string
readonly "mode"?: "available"
}
export const GetModelsParams = Schema.Struct({
"category": Schema.optionalKey(
Expand All @@ -7620,12 +7684,22 @@ export const GetModelsParams = Schema.Struct({
"academia"
]).annotate({ "description": "Filter models by use case category" })
),
"supported_parameters": Schema.optionalKey(Schema.String)
"supported_parameters": Schema.optionalKey(Schema.String),
"mode": Schema.optionalKey(
Schema.Literal("available").annotate({
"description":
"When set to \"available\", filters models by the authenticated user's provider preferences, privacy settings, and guardrails. Requires a valid API key in the Authorization header."
})
)
})
export type GetModels200 = ModelsListResponse
export const GetModels200 = ModelsListResponse
export type GetModels400 = BadRequestResponse
export const GetModels400 = BadRequestResponse
export type GetModels401 = UnauthorizedResponse
export const GetModels401 = UnauthorizedResponse
export type GetModels404 = NotFoundResponse
export const GetModels404 = NotFoundResponse
export type GetModels500 = InternalServerResponse
export const GetModels500 = InternalServerResponse
export type ListModelsUser200 = ModelsListResponse
Expand Down Expand Up @@ -9021,11 +9095,14 @@ export const make = (
HttpClientRequest.get(`/models`).pipe(
HttpClientRequest.setUrlParams({
"category": options?.params?.["category"] as any,
"supported_parameters": options?.params?.["supported_parameters"] as any
"supported_parameters": options?.params?.["supported_parameters"] as any,
"mode": options?.params?.["mode"] as any
}),
withResponse(options?.config)(HttpClientResponse.matchStatus({
"2xx": decodeSuccess(GetModels200),
"400": decodeError("GetModels400", GetModels400),
"401": decodeError("GetModels401", GetModels401),
"404": decodeError("GetModels404", GetModels404),
"500": decodeError("GetModels500", GetModels500),
orElse: unexpectedStatus
}))
Expand Down Expand Up @@ -9525,6 +9602,8 @@ export interface OpenRouterClient {
| HttpClientError.HttpClientError
| SchemaError
| OpenRouterClientError<"GetModels400", typeof GetModels400.Type>
| OpenRouterClientError<"GetModels401", typeof GetModels401.Type>
| OpenRouterClientError<"GetModels404", typeof GetModels404.Type>
| OpenRouterClientError<"GetModels500", typeof GetModels500.Type>
>
/**
Expand Down