Compare commits

..
1 Commits
Author SHA1 Message Date
OpenRouter Team bf339d9530 Commits included in this export:
- e1074ff86fccf5e48406b7595298873106d3cc5a
  - 123bbdaf841d299162a82ee2573adfbb70a45b8f
  - ac457b8a8dad98fdf5ddcae8dd4711361cea3084
  - ea825199f4c59dd68fec01cf8d18a582963c9f25
  - 4d48e4f6bb936e785787314a965298da6b78fea0
  - 718729a573ee98893a4408d5a52ab4686661fe54
  - b867adcde6b64f3f2a11c4626254b39098e4b0b4
  - 21912c097b4066d109766c6b4492826595cd57c5
  - bc1ed85adc976a4634ca8a41b82e4fc2c39a864f
  - d145c89c941937a312ed1357590d2bfda9a3603d
  - 12f05b5dee397ead47cfcd545a7a2e3c7ff57524
  - dd28f75a19a015809797c7abf3f8758f7c37262e
  - c96e569781e07ab44172d9c69940ec17bafd81f4
  - c9d5a90e3c2b5077a2bdd49773f1a46d1a5a79c7
  - 58b08f87116ceab9076de2fdc0a4c74c919b44c4

GitOrigin-RevId: e1074ff86fccf5e48406b7595298873106d3cc5a
2026-01-28 18:45:29 +00:00
83 changed files with 1820 additions and 1892 deletions
+34 -39
View File
@@ -1,12 +1,12 @@
lockVersion: 2.0.0
id: cfd52247-6a25-4c6d-bbce-fe6fce0cd69d
management:
docChecksum: 52c044061097671980a3ac37a4839b7f
docChecksum: b46bf86766cf18470329da1fb2271f4e
docVersion: 1.0.0
speakeasyVersion: 1.666.0
generationVersion: 2.768.0
releaseVersion: 0.5.0
configChecksum: 4bcc2dd9900ba2408612f6fa04918561
releaseVersion: 0.3.2
configChecksum: 684039465cd4c6f0105466ef2833908d
repoURL: https://github.com/OpenRouterTeam/python-sdk.git
installationURL: https://github.com/OpenRouterTeam/python-sdk.git
published: true
@@ -60,7 +60,20 @@ generatedFiles:
- docs/components/chatcompletionfinishreason.md
- docs/components/chaterrorerror.md
- docs/components/chatgenerationparams.md
- docs/components/chatgenerationparamsdatacollection.md
- docs/components/chatgenerationparamsimageconfig.md
- docs/components/chatgenerationparamsmaxprice.md
- docs/components/chatgenerationparamspluginautorouter.md
- docs/components/chatgenerationparamspluginfileparser.md
- docs/components/chatgenerationparamspluginmoderation.md
- docs/components/chatgenerationparamspluginresponsehealing.md
- docs/components/chatgenerationparamspluginunion.md
- docs/components/chatgenerationparamspluginweb.md
- docs/components/chatgenerationparamspreferredmaxlatency.md
- docs/components/chatgenerationparamspreferredmaxlatencyunion.md
- docs/components/chatgenerationparamspreferredminthroughput.md
- docs/components/chatgenerationparamspreferredminthroughputunion.md
- docs/components/chatgenerationparamsprovider.md
- docs/components/chatgenerationtokenusage.md
- docs/components/chatmessagecontentitem.md
- docs/components/chatmessagecontentitemaudio.md
@@ -91,15 +104,12 @@ generatedFiles:
- docs/components/chatstreamoptions.md
- docs/components/code.md
- docs/components/codeenum.md
- docs/components/completion.md
- docs/components/completiontokensdetails.md
- docs/components/costdetails.md
- docs/components/createchargerequest.md
- docs/components/datacollection.md
- docs/components/debug.md
- docs/components/defaultparameters.md
- docs/components/developermessage.md
- docs/components/developermessagecontent.md
- docs/components/edgenetworktimeoutresponseerrordata.md
- docs/components/effort.md
- docs/components/endpointstatus.md
@@ -124,6 +134,8 @@ generatedFiles:
- docs/components/listendpointsresponse.md
- docs/components/logprob.md
- docs/components/message.md
- docs/components/messagecontent.md
- docs/components/messagedeveloper.md
- docs/components/modality.md
- docs/components/model.md
- docs/components/modelarchitecture.md
@@ -245,6 +257,13 @@ generatedFiles:
- docs/components/openresponsesrequestmaxprice.md
- docs/components/openresponsesrequestonly.md
- docs/components/openresponsesrequestorder.md
- docs/components/openresponsesrequestpluginautorouter.md
- docs/components/openresponsesrequestpluginfileparser.md
- docs/components/openresponsesrequestpluginmoderation.md
- docs/components/openresponsesrequestpluginresponsehealing.md
- docs/components/openresponsesrequestpluginunion.md
- docs/components/openresponsesrequestpluginweb.md
- docs/components/openresponsesrequestprovider.md
- docs/components/openresponsesrequestsort.md
- docs/components/openresponsesrequesttoolfunction.md
- docs/components/openresponsesrequesttoolunion.md
@@ -307,18 +326,10 @@ generatedFiles:
- docs/components/percentilestats.md
- docs/components/percentilethroughputcutoffs.md
- docs/components/perrequestlimits.md
- docs/components/plugin.md
- docs/components/pluginautorouter.md
- docs/components/pluginfileparser.md
- docs/components/pluginmoderation.md
- docs/components/pluginresponsehealing.md
- docs/components/pluginweb.md
- docs/components/preferredmaxlatency.md
- docs/components/preferredminthroughput.md
- docs/components/pricing.md
- docs/components/prompt.md
- docs/components/prompttokensdetails.md
- docs/components/provider.md
- docs/components/providername.md
- docs/components/provideroverloadedresponseerrordata.md
- docs/components/providerpreferences.md
@@ -339,6 +350,7 @@ generatedFiles:
- docs/components/publicendpointquantization.md
- docs/components/publicpricing.md
- docs/components/quantization.md
- docs/components/quantizations.md
- docs/components/reason.md
- docs/components/reasoning.md
- docs/components/reasoningsummarytext.md
@@ -413,25 +425,12 @@ generatedFiles:
- docs/components/responsetextconfigverbosity.md
- docs/components/route.md
- docs/components/schema0.md
- docs/components/schema10.md
- docs/components/schema14.md
- docs/components/schema15.md
- docs/components/schema15union.md
- docs/components/schema17.md
- docs/components/schema17autorouter.md
- docs/components/schema17fileparser.md
- docs/components/schema17moderation.md
- docs/components/schema17responsehealing.md
- docs/components/schema17web.md
- docs/components/schema19.md
- docs/components/schema19reasoningencrypted.md
- docs/components/schema19reasoningsummary.md
- docs/components/schema19reasoningtext.md
- docs/components/schema21.md
- docs/components/schema3.md
- docs/components/schema5.md
- docs/components/schema5enum.md
- docs/components/schema8.md
- docs/components/schema0enum.md
- docs/components/schema2.md
- docs/components/schema2reasoningencrypted.md
- docs/components/schema2reasoningsummary.md
- docs/components/schema2reasoningtext.md
- docs/components/schema4.md
- docs/components/security.md
- docs/components/servicetier.md
- docs/components/serviceunavailableresponseerrordata.md
@@ -641,11 +640,8 @@ generatedFiles:
- src/openrouter/beta.py
- src/openrouter/chat.py
- src/openrouter/components/__init__.py
- src/openrouter/components/_schema10.py
- src/openrouter/components/_schema14.py
- src/openrouter/components/_schema17.py
- src/openrouter/components/_schema19.py
- src/openrouter/components/_schema5.py
- src/openrouter/components/_schema0.py
- src/openrouter/components/_schema2.py
- src/openrouter/components/activityitem.py
- src/openrouter/components/assistantmessage.py
- src/openrouter/components/badgatewayresponseerrordata.py
@@ -673,7 +669,6 @@ generatedFiles:
- src/openrouter/components/createchargerequest.py
- src/openrouter/components/datacollection.py
- src/openrouter/components/defaultparameters.py
- src/openrouter/components/developermessage.py
- src/openrouter/components/edgenetworktimeoutresponseerrordata.py
- src/openrouter/components/endpointstatus.py
- src/openrouter/components/filecitation.py
+1 -1
View File
@@ -31,7 +31,7 @@ generation:
skipResponseBodyAssertions: false
preApplyUnionDiscriminators: true
python:
version: 0.5.0
version: 0.3.2
additionalDependencies:
dev: {}
main: {}
+317 -423
View File
@@ -3599,7 +3599,6 @@ components:
- Seed
- SiliconFlow
- Sourceful
- StepFun
- Stealth
- StreamLake
- Switchpoint
@@ -3647,7 +3646,7 @@ components:
- type: 'null'
BigNumberUnion:
type: string
description: Price per million prompt tokens
description: A value in string format that is a large number
example: 1000
PercentileThroughputCutoffs:
type: object
@@ -3966,21 +3965,13 @@ components:
prompt:
$ref: '#/components/schemas/BigNumberUnion'
completion:
allOf:
- $ref: '#/components/schemas/BigNumberUnion'
- description: Price per million completion tokens
$ref: '#/components/schemas/BigNumberUnion'
image:
allOf:
- $ref: '#/components/schemas/BigNumberUnion'
- description: Price per image
$ref: '#/components/schemas/BigNumberUnion'
audio:
allOf:
- $ref: '#/components/schemas/BigNumberUnion'
- description: Price per audio unit
$ref: '#/components/schemas/BigNumberUnion'
request:
allOf:
- $ref: '#/components/schemas/BigNumberUnion'
- description: Price per request
$ref: '#/components/schemas/BigNumberUnion'
description: >-
The object specifying the maximum price you want to pay for this request. USD price per million tokens,
for prompt and completion.
@@ -4403,6 +4394,7 @@ components:
- tool_use
- pause_turn
- refusal
- model_context_window_exceeded
stop_sequence:
type: string
nullable: true
@@ -4858,6 +4850,7 @@ components:
- tool_use
- pause_turn
- refusal
- model_context_window_exceeded
stop_sequence:
type: string
nullable: true
@@ -6522,21 +6515,6 @@ components:
- role
- content
description: Anthropic message with OpenRouter extensions
AnthropicOutputConfig:
type: object
properties:
effort:
type: string
nullable: true
enum:
- low
- medium
- high
description: >-
How much effort the model should put into its response. Higher effort levels may result in more thorough
analysis but take longer. Valid values are `low`, `medium`, or `high`.
example: medium
description: Configuration for controlling output behavior. Currently supports the effort parameter for Claude Opus 4.5.
AnthropicMessagesRequest:
type: object
properties:
@@ -7045,21 +7023,13 @@ components:
prompt:
$ref: '#/components/schemas/BigNumberUnion'
completion:
allOf:
- $ref: '#/components/schemas/BigNumberUnion'
- description: Price per million completion tokens
$ref: '#/components/schemas/BigNumberUnion'
image:
allOf:
- $ref: '#/components/schemas/BigNumberUnion'
- description: Price per image
$ref: '#/components/schemas/BigNumberUnion'
audio:
allOf:
- $ref: '#/components/schemas/BigNumberUnion'
- description: Price per audio unit
$ref: '#/components/schemas/BigNumberUnion'
request:
allOf:
- $ref: '#/components/schemas/BigNumberUnion'
- description: Price per request
$ref: '#/components/schemas/BigNumberUnion'
description: >-
The object specifying the maximum price you want to pay for this request. USD price per million tokens,
for prompt and completion.
@@ -7177,8 +7147,6 @@ components:
type: array
items:
type: string
output_config:
$ref: '#/components/schemas/AnthropicOutputConfig'
required:
- model
- max_tokens
@@ -7406,21 +7374,13 @@ components:
prompt:
$ref: '#/components/schemas/BigNumberUnion'
completion:
allOf:
- $ref: '#/components/schemas/BigNumberUnion'
- description: Price per million completion tokens
$ref: '#/components/schemas/BigNumberUnion'
image:
allOf:
- $ref: '#/components/schemas/BigNumberUnion'
- description: Price per image
$ref: '#/components/schemas/BigNumberUnion'
audio:
allOf:
- $ref: '#/components/schemas/BigNumberUnion'
- description: Price per audio unit
$ref: '#/components/schemas/BigNumberUnion'
request:
allOf:
- $ref: '#/components/schemas/BigNumberUnion'
- description: Price per request
$ref: '#/components/schemas/BigNumberUnion'
description: >-
The object specifying the maximum price you want to pay for this request. USD price per million tokens, for
prompt and completion.
@@ -7433,57 +7393,31 @@ components:
type: object
properties:
prompt:
allOf:
- $ref: '#/components/schemas/BigNumberUnion'
- description: A number or string value representing a large number
$ref: '#/components/schemas/BigNumberUnion'
completion:
allOf:
- $ref: '#/components/schemas/BigNumberUnion'
- description: A number or string value representing a large number
$ref: '#/components/schemas/BigNumberUnion'
request:
allOf:
- $ref: '#/components/schemas/BigNumberUnion'
- description: A number or string value representing a large number
$ref: '#/components/schemas/BigNumberUnion'
image:
allOf:
- $ref: '#/components/schemas/BigNumberUnion'
- description: A number or string value representing a large number
$ref: '#/components/schemas/BigNumberUnion'
image_token:
allOf:
- $ref: '#/components/schemas/BigNumberUnion'
- description: A number or string value representing a large number
$ref: '#/components/schemas/BigNumberUnion'
image_output:
allOf:
- $ref: '#/components/schemas/BigNumberUnion'
- description: A number or string value representing a large number
$ref: '#/components/schemas/BigNumberUnion'
audio:
allOf:
- $ref: '#/components/schemas/BigNumberUnion'
- description: A number or string value representing a large number
$ref: '#/components/schemas/BigNumberUnion'
audio_output:
allOf:
- $ref: '#/components/schemas/BigNumberUnion'
- description: A number or string value representing a large number
$ref: '#/components/schemas/BigNumberUnion'
input_audio_cache:
allOf:
- $ref: '#/components/schemas/BigNumberUnion'
- description: A number or string value representing a large number
$ref: '#/components/schemas/BigNumberUnion'
web_search:
allOf:
- $ref: '#/components/schemas/BigNumberUnion'
- description: A number or string value representing a large number
$ref: '#/components/schemas/BigNumberUnion'
internal_reasoning:
allOf:
- $ref: '#/components/schemas/BigNumberUnion'
- description: A number or string value representing a large number
$ref: '#/components/schemas/BigNumberUnion'
input_cache_read:
allOf:
- $ref: '#/components/schemas/BigNumberUnion'
- description: A number or string value representing a large number
$ref: '#/components/schemas/BigNumberUnion'
input_cache_write:
allOf:
- $ref: '#/components/schemas/BigNumberUnion'
- description: A number or string value representing a large number
$ref: '#/components/schemas/BigNumberUnion'
discount:
type: number
required:
@@ -7941,57 +7875,31 @@ components:
type: object
properties:
prompt:
allOf:
- $ref: '#/components/schemas/BigNumberUnion'
- description: A number or string value representing a large number
$ref: '#/components/schemas/BigNumberUnion'
completion:
allOf:
- $ref: '#/components/schemas/BigNumberUnion'
- description: A number or string value representing a large number
$ref: '#/components/schemas/BigNumberUnion'
request:
allOf:
- $ref: '#/components/schemas/BigNumberUnion'
- description: A number or string value representing a large number
$ref: '#/components/schemas/BigNumberUnion'
image:
allOf:
- $ref: '#/components/schemas/BigNumberUnion'
- description: A number or string value representing a large number
$ref: '#/components/schemas/BigNumberUnion'
image_token:
allOf:
- $ref: '#/components/schemas/BigNumberUnion'
- description: A number or string value representing a large number
$ref: '#/components/schemas/BigNumberUnion'
image_output:
allOf:
- $ref: '#/components/schemas/BigNumberUnion'
- description: A number or string value representing a large number
$ref: '#/components/schemas/BigNumberUnion'
audio:
allOf:
- $ref: '#/components/schemas/BigNumberUnion'
- description: A number or string value representing a large number
$ref: '#/components/schemas/BigNumberUnion'
audio_output:
allOf:
- $ref: '#/components/schemas/BigNumberUnion'
- description: A number or string value representing a large number
$ref: '#/components/schemas/BigNumberUnion'
input_audio_cache:
allOf:
- $ref: '#/components/schemas/BigNumberUnion'
- description: A number or string value representing a large number
$ref: '#/components/schemas/BigNumberUnion'
web_search:
allOf:
- $ref: '#/components/schemas/BigNumberUnion'
- description: A number or string value representing a large number
$ref: '#/components/schemas/BigNumberUnion'
internal_reasoning:
allOf:
- $ref: '#/components/schemas/BigNumberUnion'
- description: A number or string value representing a large number
$ref: '#/components/schemas/BigNumberUnion'
input_cache_read:
allOf:
- $ref: '#/components/schemas/BigNumberUnion'
- description: A number or string value representing a large number
$ref: '#/components/schemas/BigNumberUnion'
input_cache_write:
allOf:
- $ref: '#/components/schemas/BigNumberUnion'
- description: A number or string value representing a large number
$ref: '#/components/schemas/BigNumberUnion'
discount:
type: number
required:
@@ -8195,103 +8103,6 @@ components:
p90: 28.3
p99: 15.1
__schema0:
anyOf:
- type: object
properties:
allow_fallbacks:
description: >
Whether to allow backup providers to serve requests
- true: (default) when the primary provider (or your custom providers in "order") is unavailable, use
the next best provider.
- false: use only the primary/custom provider, and return the upstream error if it's unavailable.
$ref: '#/components/schemas/__schema1'
require_parameters:
description: >-
Whether to filter providers to only those that support the parameters you've provided. If this setting
is omitted or set to false, then providers will receive only the parameters they support, and ignore the
rest.
$ref: '#/components/schemas/__schema1'
data_collection:
description: >-
Data collection setting. If no available model provider meets the requirement, your request will return
an error.
- allow: (default) allow providers which store user data non-transiently and may train on it
- deny: use only providers which do not collect user data.
$ref: '#/components/schemas/__schema3'
zdr:
anyOf:
- type: boolean
- type: 'null'
enforce_distillable_text:
anyOf:
- type: boolean
- type: 'null'
order:
description: >-
An ordered list of provider slugs. The router will attempt to use the first provider in the subset of
this list that supports your requested model, and fall back to the next if it is unavailable. If no
providers are available, the request will fail with an error message.
$ref: '#/components/schemas/__schema4'
only:
description: >-
List of provider slugs to allow. If provided, this list is merged with your account-wide allowed
provider settings for this request.
$ref: '#/components/schemas/__schema4'
ignore:
description: >-
List of provider slugs to ignore. If provided, this list is merged with your account-wide ignored
provider settings for this request.
$ref: '#/components/schemas/__schema4'
quantizations:
description: A list of quantization levels to filter the provider by.
$ref: '#/components/schemas/__schema8'
sort:
description: >-
The sorting strategy to use for this request, if "order" is not specified. When set, no load balancing
is performed.
$ref: '#/components/schemas/__schema9'
max_price:
description: >-
The object specifying the maximum price you want to pay for this request. USD price per million tokens,
for prompt and completion.
$ref: '#/components/schemas/__schema10'
preferred_min_throughput:
description: >-
Preferred minimum throughput (in tokens per second). Can be a number (applies to p50) or an object with
percentile-specific cutoffs. Endpoints below the threshold(s) may still be used, but are deprioritized
in routing. When using fallback models, this may cause a fallback model to be used instead of the
primary model if it meets the threshold.
$ref: '#/components/schemas/__schema15'
preferred_max_latency:
description: >-
Preferred maximum latency (in seconds). Can be a number (applies to p50) or an object with
percentile-specific cutoffs. Endpoints above the threshold(s) may still be used, but are deprioritized
in routing. When using fallback models, this may cause a fallback model to be used instead of the
primary model if it meets the threshold.
$ref: '#/components/schemas/__schema15'
additionalProperties: false
- type: 'null'
__schema1:
anyOf:
- type: boolean
- type: 'null'
__schema3:
anyOf:
- type: string
enum:
- deny
- allow
- type: 'null'
__schema4:
anyOf:
- $ref: '#/components/schemas/__schema5'
- type: 'null'
__schema5:
type: array
items:
anyOf:
@@ -8357,7 +8168,6 @@ components:
- Seed
- SiliconFlow
- Sourceful
- StepFun
- Stealth
- StreamLake
- Switchpoint
@@ -8370,150 +8180,12 @@ components:
- Z.AI
- FakeProvider
- type: string
__schema8:
__schema1:
anyOf:
- type: array
items:
type: string
enum:
- int4
- int8
- fp4
- fp6
- fp8
- fp16
- bf16
- fp32
- unknown
- type: 'null'
__schema9:
anyOf:
- $ref: '#/components/schemas/ProviderSortUnion'
- type: 'null'
__schema10:
type: object
properties:
prompt:
anyOf:
- $ref: '#/components/schemas/__schema11'
- $ref: '#/components/schemas/ModelName'
- $ref: '#/components/schemas/__schema13'
completion:
anyOf:
- $ref: '#/components/schemas/__schema11'
- $ref: '#/components/schemas/ModelName'
- $ref: '#/components/schemas/__schema13'
image:
$ref: '#/components/schemas/__schema14'
audio:
$ref: '#/components/schemas/__schema14'
request:
$ref: '#/components/schemas/__schema14'
__schema11:
type: number
__schema13: {}
__schema14:
anyOf:
- $ref: '#/components/schemas/__schema11'
- $ref: '#/components/schemas/ModelName'
- $ref: '#/components/schemas/__schema13'
__schema15:
anyOf:
- anyOf:
- type: number
- type: object
properties:
p50:
anyOf:
- type: number
- type: 'null'
p75:
anyOf:
- type: number
- type: 'null'
p90:
anyOf:
- type: number
- type: 'null'
p99:
anyOf:
- type: number
- type: 'null'
- type: 'null'
__schema17:
type: array
items:
oneOf:
- type: object
properties:
id:
type: string
const: auto-router
enabled:
type: boolean
allowed_models:
type: array
items:
type: string
required:
- id
- type: object
properties:
id:
type: string
const: moderation
required:
- id
- type: object
properties:
id:
type: string
const: web
enabled:
type: boolean
max_results:
type: number
search_prompt:
type: string
engine:
type: string
enum:
- native
- exa
required:
- id
- type: object
properties:
id:
type: string
const: file-parser
enabled:
type: boolean
pdf:
type: object
properties:
engine:
type: string
enum:
- mistral-ocr
- pdf-text
- native
required:
- id
- type: object
properties:
id:
type: string
const: response-healing
enabled:
type: boolean
required:
- id
type: object
__schema18:
type: string
maxLength: 128
__schema19:
- type: number
- type: string
- type: number
__schema2:
oneOf:
- type: object
properties:
@@ -8523,11 +8195,11 @@ components:
summary:
type: string
id:
$ref: '#/components/schemas/__schema20'
$ref: '#/components/schemas/__schema3'
format:
$ref: '#/components/schemas/__schema21'
$ref: '#/components/schemas/__schema4'
index:
$ref: '#/components/schemas/__schema11'
$ref: '#/components/schemas/__schema5'
required:
- type
- summary
@@ -8539,11 +8211,11 @@ components:
data:
type: string
id:
$ref: '#/components/schemas/__schema20'
$ref: '#/components/schemas/__schema3'
format:
$ref: '#/components/schemas/__schema21'
$ref: '#/components/schemas/__schema4'
index:
$ref: '#/components/schemas/__schema11'
$ref: '#/components/schemas/__schema5'
required:
- type
- data
@@ -8561,19 +8233,19 @@ components:
- type: string
- type: 'null'
id:
$ref: '#/components/schemas/__schema20'
$ref: '#/components/schemas/__schema3'
format:
$ref: '#/components/schemas/__schema21'
$ref: '#/components/schemas/__schema4'
index:
$ref: '#/components/schemas/__schema11'
$ref: '#/components/schemas/__schema5'
required:
- type
type: object
__schema20:
__schema3:
anyOf:
- type: string
- type: 'null'
__schema21:
__schema4:
anyOf:
- type: string
enum:
@@ -8584,7 +8256,9 @@ components:
- anthropic-claude-v1
- google-gemini-v1
- type: 'null'
__schema25:
__schema5:
type: number
__schema6:
anyOf:
- $ref: '#/components/schemas/ChatCompletionFinishReason'
- type: 'null'
@@ -8912,23 +8586,6 @@ components:
required:
- role
- content
DeveloperMessage:
type: object
properties:
role:
type: string
const: developer
content:
anyOf:
- type: string
- type: array
items:
$ref: '#/components/schemas/ChatMessageContentItemText'
name:
type: string
required:
- role
- content
AssistantMessage:
type: object
properties:
@@ -8960,7 +8617,7 @@ components:
reasoning_details:
type: array
items:
$ref: '#/components/schemas/__schema19'
$ref: '#/components/schemas/__schema2'
images:
type: array
items:
@@ -8999,18 +8656,25 @@ components:
oneOf:
- $ref: '#/components/schemas/SystemMessage'
- $ref: '#/components/schemas/UserMessage'
- $ref: '#/components/schemas/DeveloperMessage'
- type: object
properties:
role:
type: string
const: developer
content:
anyOf:
- type: string
- type: array
items:
$ref: '#/components/schemas/ChatMessageContentItemText'
name:
type: string
required:
- role
- content
- $ref: '#/components/schemas/AssistantMessage'
- $ref: '#/components/schemas/ToolResponseMessage'
type: object
discriminator:
propertyName: role
mapping:
system: '#/components/schemas/SystemMessage'
user: '#/components/schemas/UserMessage'
developer: '#/components/schemas/DeveloperMessage'
assistant: '#/components/schemas/AssistantMessage'
tool: '#/components/schemas/ToolResponseMessage'
ToolDefinitionJson:
type: object
properties:
@@ -9074,10 +8738,242 @@ components:
properties:
provider:
description: When multiple model providers are available, optionally indicate your routing preference.
$ref: '#/components/schemas/__schema0'
anyOf:
- type: object
properties:
allow_fallbacks:
description: >
Whether to allow backup providers to serve requests
- true: (default) when the primary provider (or your custom providers in "order") is unavailable,
use the next best provider.
- false: use only the primary/custom provider, and return the upstream error if it's unavailable.
anyOf:
- type: boolean
- type: 'null'
require_parameters:
description: >-
Whether to filter providers to only those that support the parameters you've provided. If this
setting is omitted or set to false, then providers will receive only the parameters they support,
and ignore the rest.
anyOf:
- type: boolean
- type: 'null'
data_collection:
description: >-
Data collection setting. If no available model provider meets the requirement, your request will
return an error.
- allow: (default) allow providers which store user data non-transiently and may train on it
- deny: use only providers which do not collect user data.
anyOf:
- type: string
enum:
- deny
- allow
- type: 'null'
zdr:
anyOf:
- type: boolean
- type: 'null'
enforce_distillable_text:
anyOf:
- type: boolean
- type: 'null'
order:
description: >-
An ordered list of provider slugs. The router will attempt to use the first provider in the subset
of this list that supports your requested model, and fall back to the next if it is unavailable. If
no providers are available, the request will fail with an error message.
anyOf:
- $ref: '#/components/schemas/__schema0'
- type: 'null'
only:
description: >-
List of provider slugs to allow. If provided, this list is merged with your account-wide allowed
provider settings for this request.
anyOf:
- $ref: '#/components/schemas/__schema0'
- type: 'null'
ignore:
description: >-
List of provider slugs to ignore. If provided, this list is merged with your account-wide ignored
provider settings for this request.
anyOf:
- $ref: '#/components/schemas/__schema0'
- type: 'null'
quantizations:
description: A list of quantization levels to filter the provider by.
anyOf:
- type: array
items:
type: string
enum:
- int4
- int8
- fp4
- fp6
- fp8
- fp16
- bf16
- fp32
- unknown
- type: 'null'
sort:
description: >-
The sorting strategy to use for this request, if "order" is not specified. When set, no load
balancing is performed.
anyOf:
- $ref: '#/components/schemas/ProviderSortUnion'
- type: 'null'
max_price:
description: >-
The object specifying the maximum price you want to pay for this request. USD price per million
tokens, for prompt and completion.
type: object
properties:
prompt:
$ref: '#/components/schemas/__schema1'
completion:
$ref: '#/components/schemas/__schema1'
image:
$ref: '#/components/schemas/__schema1'
audio:
$ref: '#/components/schemas/__schema1'
request:
$ref: '#/components/schemas/__schema1'
preferred_min_throughput:
description: >-
Preferred minimum throughput (in tokens per second). Can be a number (applies to p50) or an object
with percentile-specific cutoffs. Endpoints below the threshold(s) may still be used, but are
deprioritized in routing. When using fallback models, this may cause a fallback model to be used
instead of the primary model if it meets the threshold.
anyOf:
- anyOf:
- type: number
- type: object
properties:
p50:
anyOf:
- type: number
- type: 'null'
p75:
anyOf:
- type: number
- type: 'null'
p90:
anyOf:
- type: number
- type: 'null'
p99:
anyOf:
- type: number
- type: 'null'
- type: 'null'
preferred_max_latency:
description: >-
Preferred maximum latency (in seconds). Can be a number (applies to p50) or an object with
percentile-specific cutoffs. Endpoints above the threshold(s) may still be used, but are
deprioritized in routing. When using fallback models, this may cause a fallback model to be used
instead of the primary model if it meets the threshold.
anyOf:
- anyOf:
- type: number
- type: object
properties:
p50:
anyOf:
- type: number
- type: 'null'
p75:
anyOf:
- type: number
- type: 'null'
p90:
anyOf:
- type: number
- type: 'null'
p99:
anyOf:
- type: number
- type: 'null'
- type: 'null'
additionalProperties: false
- type: 'null'
plugins:
description: Plugins you want to enable for this request, including their settings.
$ref: '#/components/schemas/__schema17'
type: array
items:
oneOf:
- type: object
properties:
id:
type: string
const: auto-router
enabled:
type: boolean
allowed_models:
type: array
items:
type: string
required:
- id
- type: object
properties:
id:
type: string
const: moderation
required:
- id
- type: object
properties:
id:
type: string
const: web
enabled:
type: boolean
max_results:
type: number
search_prompt:
type: string
engine:
type: string
enum:
- native
- exa
required:
- id
- type: object
properties:
id:
type: string
const: file-parser
enabled:
type: boolean
pdf:
type: object
properties:
engine:
type: string
enum:
- mistral-ocr
- pdf-text
- native
required:
- id
- type: object
properties:
id:
type: string
const: response-healing
enabled:
type: boolean
required:
- id
type: object
route:
anyOf:
- type: string
@@ -9092,7 +8988,8 @@ components:
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.
$ref: '#/components/schemas/__schema18'
type: string
maxLength: 128
messages:
minItems: 1
type: array
@@ -9207,7 +9104,7 @@ components:
- maxItems: 4
type: array
items:
$ref: '#/components/schemas/ModelName'
type: string
- type: 'null'
stream:
default: false
@@ -9249,8 +9146,6 @@ components:
anyOf:
- type: string
- type: number
- type: array
items: {}
modalities:
type: array
items:
@@ -9268,7 +9163,7 @@ components:
type: object
properties:
finish_reason:
$ref: '#/components/schemas/__schema25'
$ref: '#/components/schemas/__schema6'
index:
type: number
message:
@@ -9326,14 +9221,14 @@ components:
reasoning_details:
type: array
items:
$ref: '#/components/schemas/__schema19'
$ref: '#/components/schemas/__schema2'
ChatStreamingChoice:
type: object
properties:
delta:
$ref: '#/components/schemas/ChatStreamingMessageChunk'
finish_reason:
$ref: '#/components/schemas/__schema25'
$ref: '#/components/schemas/__schema6'
index:
type: number
logprobs:
@@ -10565,7 +10460,6 @@ paths:
- Seed
- SiliconFlow
- Sourceful
- StepFun
- Stealth
- StreamLake
- Switchpoint
+306 -412
View File
@@ -3618,7 +3618,6 @@ components:
- Seed
- SiliconFlow
- Sourceful
- StepFun
- Stealth
- StreamLake
- Switchpoint
@@ -3670,7 +3669,7 @@ components:
- type: 'null'
BigNumberUnion:
type: string
description: Price per million prompt tokens
description: A value in string format that is a large number
example: 1000
PercentileThroughputCutoffs:
type: object
@@ -3976,21 +3975,13 @@ components:
prompt:
$ref: '#/components/schemas/BigNumberUnion'
completion:
allOf:
- $ref: '#/components/schemas/BigNumberUnion'
- description: Price per million completion tokens
$ref: '#/components/schemas/BigNumberUnion'
image:
allOf:
- $ref: '#/components/schemas/BigNumberUnion'
- description: Price per image
$ref: '#/components/schemas/BigNumberUnion'
audio:
allOf:
- $ref: '#/components/schemas/BigNumberUnion'
- description: Price per audio unit
$ref: '#/components/schemas/BigNumberUnion'
request:
allOf:
- $ref: '#/components/schemas/BigNumberUnion'
- description: Price per request
$ref: '#/components/schemas/BigNumberUnion'
description: >-
The object specifying the maximum price you want to pay for this request. USD price per million tokens, for prompt and completion.
preferred_min_throughput:
@@ -4407,6 +4398,7 @@ components:
- tool_use
- pause_turn
- refusal
- model_context_window_exceeded
x-speakeasy-unknown-values: allow
stop_sequence:
type: string
@@ -4866,6 +4858,7 @@ components:
- tool_use
- pause_turn
- refusal
- model_context_window_exceeded
x-speakeasy-unknown-values: allow
stop_sequence:
type: string
@@ -6550,21 +6543,6 @@ components:
- role
- content
description: Anthropic message with OpenRouter extensions
AnthropicOutputConfig:
type: object
properties:
effort:
type: string
nullable: true
enum:
- low
- medium
- high
description: >-
How much effort the model should put into its response. Higher effort levels may result in more thorough analysis but take longer. Valid values are `low`, `medium`, or `high`.
example: medium
x-speakeasy-unknown-values: allow
description: Configuration for controlling output behavior. Currently supports the effort parameter for Claude Opus 4.5.
AnthropicMessagesRequest:
type: object
properties:
@@ -7070,21 +7048,13 @@ components:
prompt:
$ref: '#/components/schemas/BigNumberUnion'
completion:
allOf:
- $ref: '#/components/schemas/BigNumberUnion'
- description: Price per million completion tokens
$ref: '#/components/schemas/BigNumberUnion'
image:
allOf:
- $ref: '#/components/schemas/BigNumberUnion'
- description: Price per image
$ref: '#/components/schemas/BigNumberUnion'
audio:
allOf:
- $ref: '#/components/schemas/BigNumberUnion'
- description: Price per audio unit
$ref: '#/components/schemas/BigNumberUnion'
request:
allOf:
- $ref: '#/components/schemas/BigNumberUnion'
- description: Price per request
$ref: '#/components/schemas/BigNumberUnion'
description: >-
The object specifying the maximum price you want to pay for this request. USD price per million tokens, for prompt and completion.
preferred_min_throughput:
@@ -7195,8 +7165,6 @@ components:
type: array
items:
type: string
output_config:
$ref: '#/components/schemas/AnthropicOutputConfig'
required:
- model
- max_tokens
@@ -7417,21 +7385,13 @@ components:
prompt:
$ref: '#/components/schemas/BigNumberUnion'
completion:
allOf:
- $ref: '#/components/schemas/BigNumberUnion'
- description: Price per million completion tokens
$ref: '#/components/schemas/BigNumberUnion'
image:
allOf:
- $ref: '#/components/schemas/BigNumberUnion'
- description: Price per image
$ref: '#/components/schemas/BigNumberUnion'
audio:
allOf:
- $ref: '#/components/schemas/BigNumberUnion'
- description: Price per audio unit
$ref: '#/components/schemas/BigNumberUnion'
request:
allOf:
- $ref: '#/components/schemas/BigNumberUnion'
- description: Price per request
$ref: '#/components/schemas/BigNumberUnion'
description: >-
The object specifying the maximum price you want to pay for this request. USD price per million tokens, for prompt and completion.
preferred_min_throughput:
@@ -7443,57 +7403,31 @@ components:
type: object
properties:
prompt:
allOf:
- $ref: '#/components/schemas/BigNumberUnion'
- description: A number or string value representing a large number
$ref: '#/components/schemas/BigNumberUnion'
completion:
allOf:
- $ref: '#/components/schemas/BigNumberUnion'
- description: A number or string value representing a large number
$ref: '#/components/schemas/BigNumberUnion'
request:
allOf:
- $ref: '#/components/schemas/BigNumberUnion'
- description: A number or string value representing a large number
$ref: '#/components/schemas/BigNumberUnion'
image:
allOf:
- $ref: '#/components/schemas/BigNumberUnion'
- description: A number or string value representing a large number
$ref: '#/components/schemas/BigNumberUnion'
image_token:
allOf:
- $ref: '#/components/schemas/BigNumberUnion'
- description: A number or string value representing a large number
$ref: '#/components/schemas/BigNumberUnion'
image_output:
allOf:
- $ref: '#/components/schemas/BigNumberUnion'
- description: A number or string value representing a large number
$ref: '#/components/schemas/BigNumberUnion'
audio:
allOf:
- $ref: '#/components/schemas/BigNumberUnion'
- description: A number or string value representing a large number
$ref: '#/components/schemas/BigNumberUnion'
audio_output:
allOf:
- $ref: '#/components/schemas/BigNumberUnion'
- description: A number or string value representing a large number
$ref: '#/components/schemas/BigNumberUnion'
input_audio_cache:
allOf:
- $ref: '#/components/schemas/BigNumberUnion'
- description: A number or string value representing a large number
$ref: '#/components/schemas/BigNumberUnion'
web_search:
allOf:
- $ref: '#/components/schemas/BigNumberUnion'
- description: A number or string value representing a large number
$ref: '#/components/schemas/BigNumberUnion'
internal_reasoning:
allOf:
- $ref: '#/components/schemas/BigNumberUnion'
- description: A number or string value representing a large number
$ref: '#/components/schemas/BigNumberUnion'
input_cache_read:
allOf:
- $ref: '#/components/schemas/BigNumberUnion'
- description: A number or string value representing a large number
$ref: '#/components/schemas/BigNumberUnion'
input_cache_write:
allOf:
- $ref: '#/components/schemas/BigNumberUnion'
- description: A number or string value representing a large number
$ref: '#/components/schemas/BigNumberUnion'
discount:
type: number
required:
@@ -7957,57 +7891,31 @@ components:
type: object
properties:
prompt:
allOf:
- $ref: '#/components/schemas/BigNumberUnion'
- description: A number or string value representing a large number
$ref: '#/components/schemas/BigNumberUnion'
completion:
allOf:
- $ref: '#/components/schemas/BigNumberUnion'
- description: A number or string value representing a large number
$ref: '#/components/schemas/BigNumberUnion'
request:
allOf:
- $ref: '#/components/schemas/BigNumberUnion'
- description: A number or string value representing a large number
$ref: '#/components/schemas/BigNumberUnion'
image:
allOf:
- $ref: '#/components/schemas/BigNumberUnion'
- description: A number or string value representing a large number
$ref: '#/components/schemas/BigNumberUnion'
image_token:
allOf:
- $ref: '#/components/schemas/BigNumberUnion'
- description: A number or string value representing a large number
$ref: '#/components/schemas/BigNumberUnion'
image_output:
allOf:
- $ref: '#/components/schemas/BigNumberUnion'
- description: A number or string value representing a large number
$ref: '#/components/schemas/BigNumberUnion'
audio:
allOf:
- $ref: '#/components/schemas/BigNumberUnion'
- description: A number or string value representing a large number
$ref: '#/components/schemas/BigNumberUnion'
audio_output:
allOf:
- $ref: '#/components/schemas/BigNumberUnion'
- description: A number or string value representing a large number
$ref: '#/components/schemas/BigNumberUnion'
input_audio_cache:
allOf:
- $ref: '#/components/schemas/BigNumberUnion'
- description: A number or string value representing a large number
$ref: '#/components/schemas/BigNumberUnion'
web_search:
allOf:
- $ref: '#/components/schemas/BigNumberUnion'
- description: A number or string value representing a large number
$ref: '#/components/schemas/BigNumberUnion'
internal_reasoning:
allOf:
- $ref: '#/components/schemas/BigNumberUnion'
- description: A number or string value representing a large number
$ref: '#/components/schemas/BigNumberUnion'
input_cache_read:
allOf:
- $ref: '#/components/schemas/BigNumberUnion'
- description: A number or string value representing a large number
$ref: '#/components/schemas/BigNumberUnion'
input_cache_write:
allOf:
- $ref: '#/components/schemas/BigNumberUnion'
- description: A number or string value representing a large number
$ref: '#/components/schemas/BigNumberUnion'
discount:
type: number
required:
@@ -8209,89 +8117,6 @@ components:
p90: 28.3
p99: 15.1
__schema0:
anyOf:
- type: object
properties:
allow_fallbacks:
description: >
Whether to allow backup providers to serve requests
- true: (default) when the primary provider (or your custom providers in "order") is unavailable, use the next best provider.
- false: use only the primary/custom provider, and return the upstream error if it's unavailable.
$ref: '#/components/schemas/__schema1'
require_parameters:
description: >-
Whether to filter providers to only those that support the parameters you've provided. If this setting is omitted or set to false, then providers will receive only the parameters they support, and ignore the rest.
$ref: '#/components/schemas/__schema1'
data_collection:
description: >-
Data collection setting. If no available model provider meets the requirement, your request will return an error.
- allow: (default) allow providers which store user data non-transiently and may train on it
- deny: use only providers which do not collect user data.
$ref: '#/components/schemas/__schema3'
zdr:
anyOf:
- type: boolean
- type: 'null'
enforce_distillable_text:
anyOf:
- type: boolean
- type: 'null'
order:
description: >-
An ordered list of provider slugs. The router will attempt to use the first provider in the subset of this list that supports your requested model, and fall back to the next if it is unavailable. If no providers are available, the request will fail with an error message.
$ref: '#/components/schemas/__schema4'
only:
description: >-
List of provider slugs to allow. If provided, this list is merged with your account-wide allowed provider settings for this request.
$ref: '#/components/schemas/__schema4'
ignore:
description: >-
List of provider slugs to ignore. If provided, this list is merged with your account-wide ignored provider settings for this request.
$ref: '#/components/schemas/__schema4'
quantizations:
description: A list of quantization levels to filter the provider by.
$ref: '#/components/schemas/__schema8'
sort:
description: >-
The sorting strategy to use for this request, if "order" is not specified. When set, no load balancing is performed.
$ref: '#/components/schemas/__schema9'
max_price:
description: >-
The object specifying the maximum price you want to pay for this request. USD price per million tokens, for prompt and completion.
$ref: '#/components/schemas/__schema10'
preferred_min_throughput:
description: >-
Preferred minimum throughput (in tokens per second). Can be a number (applies to p50) or an object with percentile-specific cutoffs. Endpoints below the threshold(s) may still be used, but are deprioritized in routing. When using fallback models, this may cause a fallback model to be used instead of the primary model if it meets the threshold.
$ref: '#/components/schemas/__schema15'
preferred_max_latency:
description: >-
Preferred maximum latency (in seconds). Can be a number (applies to p50) or an object with percentile-specific cutoffs. Endpoints above the threshold(s) may still be used, but are deprioritized in routing. When using fallback models, this may cause a fallback model to be used instead of the primary model if it meets the threshold.
$ref: '#/components/schemas/__schema15'
additionalProperties: false
- type: 'null'
__schema1:
anyOf:
- type: boolean
- type: 'null'
__schema3:
anyOf:
- type: string
enum:
- deny
- allow
x-speakeasy-unknown-values: allow
- type: 'null'
__schema4:
anyOf:
- $ref: '#/components/schemas/__schema5'
- type: 'null'
__schema5:
type: array
items:
anyOf:
@@ -8357,7 +8182,6 @@ components:
- Seed
- SiliconFlow
- Sourceful
- StepFun
- Stealth
- StreamLake
- Switchpoint
@@ -8371,153 +8195,12 @@ components:
- FakeProvider
x-speakeasy-unknown-values: allow
- type: string
__schema8:
__schema1:
anyOf:
- type: array
items:
type: string
enum:
- int4
- int8
- fp4
- fp6
- fp8
- fp16
- bf16
- fp32
- unknown
x-speakeasy-unknown-values: allow
- type: 'null'
__schema9:
anyOf:
- $ref: '#/components/schemas/ProviderSortUnion'
- type: 'null'
__schema10:
type: object
properties:
prompt:
anyOf:
- $ref: '#/components/schemas/__schema11'
- $ref: '#/components/schemas/ModelName'
- $ref: '#/components/schemas/__schema13'
completion:
anyOf:
- $ref: '#/components/schemas/__schema11'
- $ref: '#/components/schemas/ModelName'
- $ref: '#/components/schemas/__schema13'
image:
$ref: '#/components/schemas/__schema14'
audio:
$ref: '#/components/schemas/__schema14'
request:
$ref: '#/components/schemas/__schema14'
__schema11:
type: number
__schema13: {}
__schema14:
anyOf:
- $ref: '#/components/schemas/__schema11'
- $ref: '#/components/schemas/ModelName'
- $ref: '#/components/schemas/__schema13'
__schema15:
anyOf:
- anyOf:
- type: number
- type: object
properties:
p50:
anyOf:
- type: number
- type: 'null'
p75:
anyOf:
- type: number
- type: 'null'
p90:
anyOf:
- type: number
- type: 'null'
p99:
anyOf:
- type: number
- type: 'null'
- type: 'null'
__schema17:
type: array
items:
oneOf:
- type: object
properties:
id:
type: string
const: auto-router
enabled:
type: boolean
allowed_models:
type: array
items:
type: string
required:
- id
- type: object
properties:
id:
type: string
const: moderation
required:
- id
- type: object
properties:
id:
type: string
const: web
enabled:
type: boolean
max_results:
type: number
search_prompt:
type: string
engine:
type: string
enum:
- native
- exa
x-speakeasy-unknown-values: allow
required:
- id
- type: object
properties:
id:
type: string
const: file-parser
enabled:
type: boolean
pdf:
type: object
properties:
engine:
type: string
enum:
- mistral-ocr
- pdf-text
- native
x-speakeasy-unknown-values: allow
required:
- id
- type: object
properties:
id:
type: string
const: response-healing
enabled:
type: boolean
required:
- id
type: object
__schema18:
type: string
maxLength: 128
__schema19:
- type: number
- type: string
- type: number
__schema2:
oneOf:
- type: object
properties:
@@ -8527,11 +8210,11 @@ components:
summary:
type: string
id:
$ref: '#/components/schemas/__schema20'
$ref: '#/components/schemas/__schema3'
format:
$ref: '#/components/schemas/__schema21'
$ref: '#/components/schemas/__schema4'
index:
$ref: '#/components/schemas/__schema11'
$ref: '#/components/schemas/__schema5'
required:
- type
- summary
@@ -8543,11 +8226,11 @@ components:
data:
type: string
id:
$ref: '#/components/schemas/__schema20'
$ref: '#/components/schemas/__schema3'
format:
$ref: '#/components/schemas/__schema21'
$ref: '#/components/schemas/__schema4'
index:
$ref: '#/components/schemas/__schema11'
$ref: '#/components/schemas/__schema5'
required:
- type
- data
@@ -8565,19 +8248,19 @@ components:
- type: string
- type: 'null'
id:
$ref: '#/components/schemas/__schema20'
$ref: '#/components/schemas/__schema3'
format:
$ref: '#/components/schemas/__schema21'
$ref: '#/components/schemas/__schema4'
index:
$ref: '#/components/schemas/__schema11'
$ref: '#/components/schemas/__schema5'
required:
- type
type: object
__schema20:
__schema3:
anyOf:
- type: string
- type: 'null'
__schema21:
__schema4:
anyOf:
- type: string
enum:
@@ -8589,7 +8272,9 @@ components:
- google-gemini-v1
x-speakeasy-unknown-values: allow
- type: 'null'
__schema25:
__schema5:
type: number
__schema6:
anyOf:
- $ref: '#/components/schemas/ChatCompletionFinishReason'
- type: 'null'
@@ -8920,23 +8605,6 @@ components:
required:
- role
- content
DeveloperMessage:
type: object
properties:
role:
type: string
const: developer
content:
anyOf:
- type: string
- type: array
items:
$ref: '#/components/schemas/ChatMessageContentItemText'
name:
type: string
required:
- role
- content
AssistantMessage:
type: object
properties:
@@ -8968,7 +8636,7 @@ components:
reasoning_details:
type: array
items:
$ref: '#/components/schemas/__schema19'
$ref: '#/components/schemas/__schema2'
images:
type: array
items:
@@ -9007,18 +8675,25 @@ components:
oneOf:
- $ref: '#/components/schemas/SystemMessage'
- $ref: '#/components/schemas/UserMessage'
- $ref: '#/components/schemas/DeveloperMessage'
- type: object
properties:
role:
type: string
const: developer
content:
anyOf:
- type: string
- type: array
items:
$ref: '#/components/schemas/ChatMessageContentItemText'
name:
type: string
required:
- role
- content
- $ref: '#/components/schemas/AssistantMessage'
- $ref: '#/components/schemas/ToolResponseMessage'
type: object
discriminator:
propertyName: role
mapping:
system: '#/components/schemas/SystemMessage'
user: '#/components/schemas/UserMessage'
developer: '#/components/schemas/DeveloperMessage'
assistant: '#/components/schemas/AssistantMessage'
tool: '#/components/schemas/ToolResponseMessage'
ToolDefinitionJson:
type: object
properties:
@@ -9082,10 +8757,231 @@ components:
properties:
provider:
description: When multiple model providers are available, optionally indicate your routing preference.
$ref: '#/components/schemas/__schema0'
anyOf:
- type: object
properties:
allow_fallbacks:
description: >
Whether to allow backup providers to serve requests
- true: (default) when the primary provider (or your custom providers in "order") is unavailable, use the next best provider.
- false: use only the primary/custom provider, and return the upstream error if it's unavailable.
anyOf:
- type: boolean
- type: 'null'
require_parameters:
description: >-
Whether to filter providers to only those that support the parameters you've provided. If this setting is omitted or set to false, then providers will receive only the parameters they support, and ignore the rest.
anyOf:
- type: boolean
- type: 'null'
data_collection:
description: >-
Data collection setting. If no available model provider meets the requirement, your request will return an error.
- allow: (default) allow providers which store user data non-transiently and may train on it
- deny: use only providers which do not collect user data.
anyOf:
- type: string
enum:
- deny
- allow
x-speakeasy-unknown-values: allow
- type: 'null'
zdr:
anyOf:
- type: boolean
- type: 'null'
enforce_distillable_text:
anyOf:
- type: boolean
- type: 'null'
order:
description: >-
An ordered list of provider slugs. The router will attempt to use the first provider in the subset of this list that supports your requested model, and fall back to the next if it is unavailable. If no providers are available, the request will fail with an error message.
anyOf:
- $ref: '#/components/schemas/__schema0'
- type: 'null'
only:
description: >-
List of provider slugs to allow. If provided, this list is merged with your account-wide allowed provider settings for this request.
anyOf:
- $ref: '#/components/schemas/__schema0'
- type: 'null'
ignore:
description: >-
List of provider slugs to ignore. If provided, this list is merged with your account-wide ignored provider settings for this request.
anyOf:
- $ref: '#/components/schemas/__schema0'
- type: 'null'
quantizations:
description: A list of quantization levels to filter the provider by.
anyOf:
- type: array
items:
type: string
enum:
- int4
- int8
- fp4
- fp6
- fp8
- fp16
- bf16
- fp32
- unknown
x-speakeasy-unknown-values: allow
- type: 'null'
sort:
description: >-
The sorting strategy to use for this request, if "order" is not specified. When set, no load balancing is performed.
anyOf:
- $ref: '#/components/schemas/ProviderSortUnion'
- type: 'null'
max_price:
description: >-
The object specifying the maximum price you want to pay for this request. USD price per million tokens, for prompt and completion.
type: object
properties:
prompt:
$ref: '#/components/schemas/__schema1'
completion:
$ref: '#/components/schemas/__schema1'
image:
$ref: '#/components/schemas/__schema1'
audio:
$ref: '#/components/schemas/__schema1'
request:
$ref: '#/components/schemas/__schema1'
preferred_min_throughput:
description: >-
Preferred minimum throughput (in tokens per second). Can be a number (applies to p50) or an object with percentile-specific cutoffs. Endpoints below the threshold(s) may still be used, but are deprioritized in routing. When using fallback models, this may cause a fallback model to be used instead of the primary model if it meets the threshold.
anyOf:
- anyOf:
- type: number
- type: object
properties:
p50:
anyOf:
- type: number
- type: 'null'
p75:
anyOf:
- type: number
- type: 'null'
p90:
anyOf:
- type: number
- type: 'null'
p99:
anyOf:
- type: number
- type: 'null'
- type: 'null'
preferred_max_latency:
description: >-
Preferred maximum latency (in seconds). Can be a number (applies to p50) or an object with percentile-specific cutoffs. Endpoints above the threshold(s) may still be used, but are deprioritized in routing. When using fallback models, this may cause a fallback model to be used instead of the primary model if it meets the threshold.
anyOf:
- anyOf:
- type: number
- type: object
properties:
p50:
anyOf:
- type: number
- type: 'null'
p75:
anyOf:
- type: number
- type: 'null'
p90:
anyOf:
- type: number
- type: 'null'
p99:
anyOf:
- type: number
- type: 'null'
- type: 'null'
additionalProperties: false
- type: 'null'
plugins:
description: Plugins you want to enable for this request, including their settings.
$ref: '#/components/schemas/__schema17'
type: array
items:
oneOf:
- type: object
properties:
id:
type: string
const: auto-router
enabled:
type: boolean
allowed_models:
type: array
items:
type: string
required:
- id
- type: object
properties:
id:
type: string
const: moderation
required:
- id
- type: object
properties:
id:
type: string
const: web
enabled:
type: boolean
max_results:
type: number
search_prompt:
type: string
engine:
type: string
enum:
- native
- exa
x-speakeasy-unknown-values: allow
required:
- id
- type: object
properties:
id:
type: string
const: file-parser
enabled:
type: boolean
pdf:
type: object
properties:
engine:
type: string
enum:
- mistral-ocr
- pdf-text
- native
x-speakeasy-unknown-values: allow
required:
- id
- type: object
properties:
id:
type: string
const: response-healing
enabled:
type: boolean
required:
- id
type: object
route:
anyOf:
- type: string
@@ -9099,7 +8995,8 @@ components:
session_id:
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.
$ref: '#/components/schemas/__schema18'
type: string
maxLength: 128
messages:
minItems: 1
type: array
@@ -9215,7 +9112,7 @@ components:
- maxItems: 4
type: array
items:
$ref: '#/components/schemas/ModelName'
type: string
- type: 'null'
stream:
default: false
@@ -9257,8 +9154,6 @@ components:
anyOf:
- type: string
- type: number
- type: array
items: {}
modalities:
type: array
items:
@@ -9277,7 +9172,7 @@ components:
type: object
properties:
finish_reason:
$ref: '#/components/schemas/__schema25'
$ref: '#/components/schemas/__schema6'
index:
type: number
message:
@@ -9335,14 +9230,14 @@ components:
reasoning_details:
type: array
items:
$ref: '#/components/schemas/__schema19'
$ref: '#/components/schemas/__schema2'
ChatStreamingChoice:
type: object
properties:
delta:
$ref: '#/components/schemas/ChatStreamingMessageChunk'
finish_reason:
$ref: '#/components/schemas/__schema25'
$ref: '#/components/schemas/__schema6'
index:
type: number
logprobs:
@@ -10573,7 +10468,6 @@ paths:
- Seed
- SiliconFlow
- Sourceful
- StepFun
- Stealth
- StreamLake
- Switchpoint
+5 -5
View File
@@ -8,8 +8,8 @@ sources:
- latest
OpenRouter API:
sourceNamespace: open-router-chat-completions-api
sourceRevisionDigest: sha256:9726bd1a602e2f5f3665445896ccad693820754350ead01d7aef39e0dedeb3dc
sourceBlobDigest: sha256:f8e66605c401e126a5f39b6e0272dd792182257c5162fdfbf7c5a815c516c581
sourceRevisionDigest: sha256:6e8165360ec62cc8b776111afb2e6d8c17e5dd46f2be6e124138a8296e2c7046
sourceBlobDigest: sha256:373dfa5b56ef18b9cdc55a2ad1a5d8b377deabfcc028ab7f940f525b3a3ca9c9
tags:
- latest
- main
@@ -18,10 +18,10 @@ targets:
open-router:
source: OpenRouter API
sourceNamespace: open-router-chat-completions-api
sourceRevisionDigest: sha256:9726bd1a602e2f5f3665445896ccad693820754350ead01d7aef39e0dedeb3dc
sourceBlobDigest: sha256:f8e66605c401e126a5f39b6e0272dd792182257c5162fdfbf7c5a815c516c581
sourceRevisionDigest: sha256:6e8165360ec62cc8b776111afb2e6d8c17e5dd46f2be6e124138a8296e2c7046
sourceBlobDigest: sha256:373dfa5b56ef18b9cdc55a2ad1a5d8b377deabfcc028ab7f940f525b3a3ca9c9
codeSamplesNamespace: open-router-python-code-samples
codeSamplesRevisionDigest: sha256:6719e0045ac51c8ab2461cbd23189a7b289fad9032460c92183e5845f9e43f61
codeSamplesRevisionDigest: sha256:0441c6e25f98818e2b2398041d3a974e3f26897c151a3fabfccbc2206640751a
workflow:
workflowVersion: 1.0.0
speakeasyVersion: 1.666.0
+1 -1
View File
@@ -11,5 +11,5 @@
| `tool_calls` | List[[components.ChatMessageToolCall](../components/chatmessagetoolcall.md)] | :heavy_minus_sign: | N/A |
| `refusal` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A |
| `reasoning` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A |
| `reasoning_details` | List[[components.Schema19](../components/schema19.md)] | :heavy_minus_sign: | N/A |
| `reasoning_details` | List[[components.Schema2](../components/schema2.md)] | :heavy_minus_sign: | N/A |
| `images` | List[[components.Image](../components/image.md)] | :heavy_minus_sign: | N/A |
+31 -31
View File
@@ -3,34 +3,34 @@
## Fields
| Field | Type | Required | Description |
| --------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------- |
| `provider` | [OptionalNullable[components.Schema0]](../components/schema0.md) | :heavy_minus_sign: | N/A |
| `plugins` | List[[components.Schema17](../components/schema17.md)] | :heavy_minus_sign: | N/A |
| `route` | [OptionalNullable[components.Route]](../components/route.md) | :heavy_minus_sign: | N/A |
| `user` | *Optional[str]* | :heavy_minus_sign: | N/A |
| `session_id` | *Optional[str]* | :heavy_minus_sign: | N/A |
| `messages` | List[[components.Message](../components/message.md)] | :heavy_check_mark: | N/A |
| `model` | *Optional[str]* | :heavy_minus_sign: | N/A |
| `models` | List[*str*] | :heavy_minus_sign: | N/A |
| `frequency_penalty` | *OptionalNullable[float]* | :heavy_minus_sign: | N/A |
| `logit_bias` | Dict[str, *float*] | :heavy_minus_sign: | N/A |
| `logprobs` | *OptionalNullable[bool]* | :heavy_minus_sign: | N/A |
| `top_logprobs` | *OptionalNullable[float]* | :heavy_minus_sign: | N/A |
| `max_completion_tokens` | *OptionalNullable[float]* | :heavy_minus_sign: | N/A |
| `max_tokens` | *OptionalNullable[float]* | :heavy_minus_sign: | N/A |
| `metadata` | Dict[str, *str*] | :heavy_minus_sign: | N/A |
| `presence_penalty` | *OptionalNullable[float]* | :heavy_minus_sign: | N/A |
| `reasoning` | [Optional[components.Reasoning]](../components/reasoning.md) | :heavy_minus_sign: | N/A |
| `response_format` | [Optional[components.ResponseFormat]](../components/responseformat.md) | :heavy_minus_sign: | N/A |
| `seed` | *OptionalNullable[int]* | :heavy_minus_sign: | N/A |
| `stop` | [OptionalNullable[components.Stop]](../components/stop.md) | :heavy_minus_sign: | N/A |
| `stream` | *Optional[bool]* | :heavy_minus_sign: | N/A |
| `stream_options` | [OptionalNullable[components.ChatStreamOptions]](../components/chatstreamoptions.md) | :heavy_minus_sign: | N/A |
| `temperature` | *OptionalNullable[float]* | :heavy_minus_sign: | N/A |
| `tool_choice` | *Optional[Any]* | :heavy_minus_sign: | N/A |
| `tools` | List[[components.ToolDefinitionJSON](../components/tooldefinitionjson.md)] | :heavy_minus_sign: | N/A |
| `top_p` | *OptionalNullable[float]* | :heavy_minus_sign: | N/A |
| `debug` | [Optional[components.Debug]](../components/debug.md) | :heavy_minus_sign: | N/A |
| `image_config` | Dict[str, [components.ChatGenerationParamsImageConfig](../components/chatgenerationparamsimageconfig.md)] | :heavy_minus_sign: | N/A |
| `modalities` | List[[components.Modality](../components/modality.md)] | :heavy_minus_sign: | N/A |
| Field | Type | Required | Description |
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `provider` | [OptionalNullable[components.ChatGenerationParamsProvider]](../components/chatgenerationparamsprovider.md) | :heavy_minus_sign: | When multiple model providers are available, optionally indicate your routing preference. |
| `plugins` | List[[components.ChatGenerationParamsPluginUnion](../components/chatgenerationparamspluginunion.md)] | :heavy_minus_sign: | Plugins you want to enable for this request, including their settings. |
| `route` | [OptionalNullable[components.Route]](../components/route.md) | :heavy_minus_sign: | N/A |
| `user` | *Optional[str]* | :heavy_minus_sign: | N/A |
| `session_id` | *Optional[str]* | :heavy_minus_sign: | 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. |
| `messages` | List[[components.Message](../components/message.md)] | :heavy_check_mark: | N/A |
| `model` | *Optional[str]* | :heavy_minus_sign: | N/A |
| `models` | List[*str*] | :heavy_minus_sign: | N/A |
| `frequency_penalty` | *OptionalNullable[float]* | :heavy_minus_sign: | N/A |
| `logit_bias` | Dict[str, *float*] | :heavy_minus_sign: | N/A |
| `logprobs` | *OptionalNullable[bool]* | :heavy_minus_sign: | N/A |
| `top_logprobs` | *OptionalNullable[float]* | :heavy_minus_sign: | N/A |
| `max_completion_tokens` | *OptionalNullable[float]* | :heavy_minus_sign: | N/A |
| `max_tokens` | *OptionalNullable[float]* | :heavy_minus_sign: | N/A |
| `metadata` | Dict[str, *str*] | :heavy_minus_sign: | N/A |
| `presence_penalty` | *OptionalNullable[float]* | :heavy_minus_sign: | N/A |
| `reasoning` | [Optional[components.Reasoning]](../components/reasoning.md) | :heavy_minus_sign: | N/A |
| `response_format` | [Optional[components.ResponseFormat]](../components/responseformat.md) | :heavy_minus_sign: | N/A |
| `seed` | *OptionalNullable[int]* | :heavy_minus_sign: | N/A |
| `stop` | [OptionalNullable[components.Stop]](../components/stop.md) | :heavy_minus_sign: | N/A |
| `stream` | *Optional[bool]* | :heavy_minus_sign: | N/A |
| `stream_options` | [OptionalNullable[components.ChatStreamOptions]](../components/chatstreamoptions.md) | :heavy_minus_sign: | N/A |
| `temperature` | *OptionalNullable[float]* | :heavy_minus_sign: | N/A |
| `tool_choice` | *Optional[Any]* | :heavy_minus_sign: | N/A |
| `tools` | List[[components.ToolDefinitionJSON](../components/tooldefinitionjson.md)] | :heavy_minus_sign: | N/A |
| `top_p` | *OptionalNullable[float]* | :heavy_minus_sign: | N/A |
| `debug` | [Optional[components.Debug]](../components/debug.md) | :heavy_minus_sign: | N/A |
| `image_config` | Dict[str, [components.ChatGenerationParamsImageConfig](../components/chatgenerationparamsimageconfig.md)] | :heavy_minus_sign: | N/A |
| `modalities` | List[[components.Modality](../components/modality.md)] | :heavy_minus_sign: | N/A |
@@ -1,4 +1,4 @@
# Schema3
# ChatGenerationParamsDataCollection
## Values
@@ -15,9 +15,3 @@ value: str = /* values here */
value: float = /* values here */
```
### `List[Any]`
```python
value: List[Any] = /* values here */
```
@@ -0,0 +1,14 @@
# ChatGenerationParamsMaxPrice
The object specifying the maximum price you want to pay for this request. USD price per million tokens, for prompt and completion.
## Fields
| Field | Type | Required | Description |
| ------------------ | ------------------ | ------------------ | ------------------ |
| `prompt` | *Optional[Any]* | :heavy_minus_sign: | N/A |
| `completion` | *Optional[Any]* | :heavy_minus_sign: | N/A |
| `image` | *Optional[Any]* | :heavy_minus_sign: | N/A |
| `audio` | *Optional[Any]* | :heavy_minus_sign: | N/A |
| `request` | *Optional[Any]* | :heavy_minus_sign: | N/A |
@@ -1,4 +1,4 @@
# Schema17AutoRouter
# ChatGenerationParamsPluginAutoRouter
## Fields
@@ -1,4 +1,4 @@
# Schema17FileParser
# ChatGenerationParamsPluginFileParser
## Fields
@@ -1,4 +1,4 @@
# Schema17Moderation
# ChatGenerationParamsPluginModeration
## Fields
@@ -1,4 +1,4 @@
# Schema17ResponseHealing
# ChatGenerationParamsPluginResponseHealing
## Fields
@@ -0,0 +1,35 @@
# ChatGenerationParamsPluginUnion
## Supported Types
### `components.ChatGenerationParamsPluginAutoRouter`
```python
value: components.ChatGenerationParamsPluginAutoRouter = /* values here */
```
### `components.ChatGenerationParamsPluginModeration`
```python
value: components.ChatGenerationParamsPluginModeration = /* values here */
```
### `components.ChatGenerationParamsPluginWeb`
```python
value: components.ChatGenerationParamsPluginWeb = /* values here */
```
### `components.ChatGenerationParamsPluginFileParser`
```python
value: components.ChatGenerationParamsPluginFileParser = /* values here */
```
### `components.ChatGenerationParamsPluginResponseHealing`
```python
value: components.ChatGenerationParamsPluginResponseHealing = /* values here */
```
@@ -1,4 +1,4 @@
# Schema17Web
# ChatGenerationParamsPluginWeb
## Fields
@@ -1,4 +1,4 @@
# Schema15
# ChatGenerationParamsPreferredMaxLatency
## Fields
@@ -0,0 +1,17 @@
# ChatGenerationParamsPreferredMaxLatencyUnion
## Supported Types
### `float`
```python
value: float = /* values here */
```
### `components.ChatGenerationParamsPreferredMaxLatency`
```python
value: components.ChatGenerationParamsPreferredMaxLatency = /* values here */
```
@@ -0,0 +1,11 @@
# ChatGenerationParamsPreferredMinThroughput
## Fields
| Field | Type | Required | Description |
| ------------------------- | ------------------------- | ------------------------- | ------------------------- |
| `p50` | *OptionalNullable[float]* | :heavy_minus_sign: | N/A |
| `p75` | *OptionalNullable[float]* | :heavy_minus_sign: | N/A |
| `p90` | *OptionalNullable[float]* | :heavy_minus_sign: | N/A |
| `p99` | *OptionalNullable[float]* | :heavy_minus_sign: | N/A |
@@ -0,0 +1,17 @@
# ChatGenerationParamsPreferredMinThroughputUnion
## Supported Types
### `float`
```python
value: float = /* values here */
```
### `components.ChatGenerationParamsPreferredMinThroughput`
```python
value: components.ChatGenerationParamsPreferredMinThroughput = /* values here */
```
@@ -0,0 +1,20 @@
# ChatGenerationParamsProvider
## Fields
| Field | Type | Required | Description |
| --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `allow_fallbacks` | *OptionalNullable[bool]* | :heavy_minus_sign: | Whether to allow backup providers to serve requests<br/>- true: (default) when the primary provider (or your custom providers in "order") is unavailable, use the next best provider.<br/>- false: use only the primary/custom provider, and return the upstream error if it's unavailable.<br/> |
| `require_parameters` | *OptionalNullable[bool]* | :heavy_minus_sign: | Whether to filter providers to only those that support the parameters you've provided. If this setting is omitted or set to false, then providers will receive only the parameters they support, and ignore the rest. |
| `data_collection` | [OptionalNullable[components.ChatGenerationParamsDataCollection]](../components/chatgenerationparamsdatacollection.md) | :heavy_minus_sign: | Data collection setting. If no available model provider meets the requirement, your request will return an error.<br/>- allow: (default) allow providers which store user data non-transiently and may train on it<br/><br/>- deny: use only providers which do not collect user data. |
| `zdr` | *OptionalNullable[bool]* | :heavy_minus_sign: | N/A |
| `enforce_distillable_text` | *OptionalNullable[bool]* | :heavy_minus_sign: | N/A |
| `order` | List[[components.Schema0](../components/schema0.md)] | :heavy_minus_sign: | An ordered list of provider slugs. The router will attempt to use the first provider in the subset of this list that supports your requested model, and fall back to the next if it is unavailable. If no providers are available, the request will fail with an error message. |
| `only` | List[[components.Schema0](../components/schema0.md)] | :heavy_minus_sign: | List of provider slugs to allow. If provided, this list is merged with your account-wide allowed provider settings for this request. |
| `ignore` | List[[components.Schema0](../components/schema0.md)] | :heavy_minus_sign: | List of provider slugs to ignore. If provided, this list is merged with your account-wide ignored provider settings for this request. |
| `quantizations` | List[[components.Quantizations](../components/quantizations.md)] | :heavy_minus_sign: | A list of quantization levels to filter the provider by. |
| `sort` | [OptionalNullable[components.ProviderSortUnion]](../components/providersortunion.md) | :heavy_minus_sign: | The sorting strategy to use for this request, if "order" is not specified. When set, no load balancing is performed. |
| `max_price` | [Optional[components.ChatGenerationParamsMaxPrice]](../components/chatgenerationparamsmaxprice.md) | :heavy_minus_sign: | The object specifying the maximum price you want to pay for this request. USD price per million tokens, for prompt and completion. |
| `preferred_min_throughput` | [OptionalNullable[components.ChatGenerationParamsPreferredMinThroughputUnion]](../components/chatgenerationparamspreferredminthroughputunion.md) | :heavy_minus_sign: | Preferred minimum throughput (in tokens per second). Can be a number (applies to p50) or an object with percentile-specific cutoffs. Endpoints below the threshold(s) may still be used, but are deprioritized in routing. When using fallback models, this may cause a fallback model to be used instead of the primary model if it meets the threshold. |
| `preferred_max_latency` | [OptionalNullable[components.ChatGenerationParamsPreferredMaxLatencyUnion]](../components/chatgenerationparamspreferredmaxlatencyunion.md) | :heavy_minus_sign: | Preferred maximum latency (in seconds). Can be a number (applies to p50) or an object with percentile-specific cutoffs. Endpoints above the threshold(s) may still be used, but are deprioritized in routing. When using fallback models, this may cause a fallback model to be used instead of the primary model if it meets the threshold. |
+1 -1
View File
@@ -10,4 +10,4 @@
| `reasoning` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A |
| `refusal` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A |
| `tool_calls` | List[[components.ChatStreamingMessageToolCall](../components/chatstreamingmessagetoolcall.md)] | :heavy_minus_sign: | N/A |
| `reasoning_details` | List[[components.Schema19](../components/schema19.md)] | :heavy_minus_sign: | N/A |
| `reasoning_details` | List[[components.Schema2](../components/schema2.md)] | :heavy_minus_sign: | N/A |
-23
View File
@@ -1,23 +0,0 @@
# Completion
## Supported Types
### `float`
```python
value: float = /* values here */
```
### `str`
```python
value: str = /* values here */
```
### `Any`
```python
value: Any = /* values here */
```
-10
View File
@@ -1,10 +0,0 @@
# DeveloperMessage
## Fields
| Field | Type | Required | Description |
| ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ |
| `role` | *Literal["developer"]* | :heavy_check_mark: | N/A |
| `content` | [components.DeveloperMessageContent](../components/developermessagecontent.md) | :heavy_check_mark: | N/A |
| `name` | *Optional[str]* | :heavy_minus_sign: | N/A |
+2 -2
View File
@@ -15,10 +15,10 @@ value: components.SystemMessage = /* values here */
value: components.UserMessage = /* values here */
```
### `components.DeveloperMessage`
### `components.MessageDeveloper`
```python
value: components.DeveloperMessage = /* values here */
value: components.MessageDeveloper = /* values here */
```
### `components.AssistantMessage`
@@ -1,4 +1,4 @@
# DeveloperMessageContent
# MessageContent
## Supported Types
+10
View File
@@ -0,0 +1,10 @@
# MessageDeveloper
## Fields
| Field | Type | Required | Description |
| ------------------------------------------------------------ | ------------------------------------------------------------ | ------------------------------------------------------------ | ------------------------------------------------------------ |
| `role` | *Literal["developer"]* | :heavy_check_mark: | N/A |
| `content` | [components.MessageContent](../components/messagecontent.md) | :heavy_check_mark: | N/A |
| `name` | *Optional[str]* | :heavy_minus_sign: | N/A |
+2 -2
View File
@@ -37,7 +37,7 @@ Request schema for Responses endpoint
| `service_tier` | [Optional[components.ServiceTier]](../components/servicetier.md) | :heavy_minus_sign: | N/A | |
| `truncation` | [OptionalNullable[components.Truncation]](../components/truncation.md) | :heavy_minus_sign: | N/A | auto |
| `stream` | *Optional[bool]* | :heavy_minus_sign: | N/A | |
| `provider` | [OptionalNullable[components.Provider]](../components/provider.md) | :heavy_minus_sign: | When multiple model providers are available, optionally indicate your routing preference. | |
| `plugins` | List[[components.Plugin](../components/plugin.md)] | :heavy_minus_sign: | Plugins you want to enable for this request, including their settings. | |
| `provider` | [OptionalNullable[components.OpenResponsesRequestProvider]](../components/openresponsesrequestprovider.md) | :heavy_minus_sign: | When multiple model providers are available, optionally indicate your routing preference. | |
| `plugins` | List[[components.OpenResponsesRequestPluginUnion](../components/openresponsesrequestpluginunion.md)] | :heavy_minus_sign: | Plugins you want to enable for this request, including their settings. | |
| `user` | *Optional[str]* | :heavy_minus_sign: | A unique identifier representing your end-user, which helps distinguish between different users of your app. This allows your app to identify specific users in case of abuse reports, preventing your entire app from being affected by the actions of individual users. Maximum of 128 characters. | |
| `session_id` | *Optional[str]* | :heavy_minus_sign: | 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. | |
@@ -5,10 +5,10 @@ The object specifying the maximum price you want to pay for this request. USD pr
## Fields
| Field | Type | Required | Description | Example |
| ------------------------------- | ------------------------------- | ------------------------------- | ------------------------------- | ------------------------------- |
| `prompt` | *Optional[str]* | :heavy_minus_sign: | Price per million prompt tokens | 1000 |
| `completion` | *Optional[str]* | :heavy_minus_sign: | N/A | 1000 |
| `image` | *Optional[str]* | :heavy_minus_sign: | N/A | 1000 |
| `audio` | *Optional[str]* | :heavy_minus_sign: | N/A | 1000 |
| `request` | *Optional[str]* | :heavy_minus_sign: | N/A | 1000 |
| Field | Type | Required | Description | Example |
| ----------------------------------------------- | ----------------------------------------------- | ----------------------------------------------- | ----------------------------------------------- | ----------------------------------------------- |
| `prompt` | *Optional[str]* | :heavy_minus_sign: | A value in string format that is a large number | 1000 |
| `completion` | *Optional[str]* | :heavy_minus_sign: | A value in string format that is a large number | 1000 |
| `image` | *Optional[str]* | :heavy_minus_sign: | A value in string format that is a large number | 1000 |
| `audio` | *Optional[str]* | :heavy_minus_sign: | A value in string format that is a large number | 1000 |
| `request` | *Optional[str]* | :heavy_minus_sign: | A value in string format that is a large number | 1000 |
@@ -1,4 +1,4 @@
# PluginAutoRouter
# OpenResponsesRequestPluginAutoRouter
## Fields
@@ -1,4 +1,4 @@
# PluginFileParser
# OpenResponsesRequestPluginFileParser
## Fields
@@ -1,4 +1,4 @@
# PluginModeration
# OpenResponsesRequestPluginModeration
## Fields
@@ -1,4 +1,4 @@
# PluginResponseHealing
# OpenResponsesRequestPluginResponseHealing
## Fields
@@ -0,0 +1,35 @@
# OpenResponsesRequestPluginUnion
## Supported Types
### `components.OpenResponsesRequestPluginAutoRouter`
```python
value: components.OpenResponsesRequestPluginAutoRouter = /* values here */
```
### `components.OpenResponsesRequestPluginModeration`
```python
value: components.OpenResponsesRequestPluginModeration = /* values here */
```
### `components.OpenResponsesRequestPluginWeb`
```python
value: components.OpenResponsesRequestPluginWeb = /* values here */
```
### `components.OpenResponsesRequestPluginFileParser`
```python
value: components.OpenResponsesRequestPluginFileParser = /* values here */
```
### `components.OpenResponsesRequestPluginResponseHealing`
```python
value: components.OpenResponsesRequestPluginResponseHealing = /* values here */
```
@@ -1,4 +1,4 @@
# PluginWeb
# OpenResponsesRequestPluginWeb
## Fields
@@ -1,4 +1,4 @@
# Provider
# OpenResponsesRequestProvider
When multiple model providers are available, optionally indicate your routing preference.
-35
View File
@@ -1,35 +0,0 @@
# Plugin
## Supported Types
### `components.PluginAutoRouter`
```python
value: components.PluginAutoRouter = /* values here */
```
### `components.PluginModeration`
```python
value: components.PluginModeration = /* values here */
```
### `components.PluginWeb`
```python
value: components.PluginWeb = /* values here */
```
### `components.PluginFileParser`
```python
value: components.PluginFileParser = /* values here */
```
### `components.PluginResponseHealing`
```python
value: components.PluginResponseHealing = /* values here */
```
+16 -16
View File
@@ -3,19 +3,19 @@
## Fields
| Field | Type | Required | Description | Example |
| -------------------- | -------------------- | -------------------- | -------------------- | -------------------- |
| `prompt` | *str* | :heavy_check_mark: | N/A | 1000 |
| `completion` | *str* | :heavy_check_mark: | N/A | 1000 |
| `request` | *Optional[str]* | :heavy_minus_sign: | N/A | 1000 |
| `image` | *Optional[str]* | :heavy_minus_sign: | N/A | 1000 |
| `image_token` | *Optional[str]* | :heavy_minus_sign: | N/A | 1000 |
| `image_output` | *Optional[str]* | :heavy_minus_sign: | N/A | 1000 |
| `audio` | *Optional[str]* | :heavy_minus_sign: | N/A | 1000 |
| `audio_output` | *Optional[str]* | :heavy_minus_sign: | N/A | 1000 |
| `input_audio_cache` | *Optional[str]* | :heavy_minus_sign: | N/A | 1000 |
| `web_search` | *Optional[str]* | :heavy_minus_sign: | N/A | 1000 |
| `internal_reasoning` | *Optional[str]* | :heavy_minus_sign: | N/A | 1000 |
| `input_cache_read` | *Optional[str]* | :heavy_minus_sign: | N/A | 1000 |
| `input_cache_write` | *Optional[str]* | :heavy_minus_sign: | N/A | 1000 |
| `discount` | *Optional[float]* | :heavy_minus_sign: | N/A | |
| Field | Type | Required | Description | Example |
| ----------------------------------------------- | ----------------------------------------------- | ----------------------------------------------- | ----------------------------------------------- | ----------------------------------------------- |
| `prompt` | *str* | :heavy_check_mark: | A value in string format that is a large number | 1000 |
| `completion` | *str* | :heavy_check_mark: | A value in string format that is a large number | 1000 |
| `request` | *Optional[str]* | :heavy_minus_sign: | A value in string format that is a large number | 1000 |
| `image` | *Optional[str]* | :heavy_minus_sign: | A value in string format that is a large number | 1000 |
| `image_token` | *Optional[str]* | :heavy_minus_sign: | A value in string format that is a large number | 1000 |
| `image_output` | *Optional[str]* | :heavy_minus_sign: | A value in string format that is a large number | 1000 |
| `audio` | *Optional[str]* | :heavy_minus_sign: | A value in string format that is a large number | 1000 |
| `audio_output` | *Optional[str]* | :heavy_minus_sign: | A value in string format that is a large number | 1000 |
| `input_audio_cache` | *Optional[str]* | :heavy_minus_sign: | A value in string format that is a large number | 1000 |
| `web_search` | *Optional[str]* | :heavy_minus_sign: | A value in string format that is a large number | 1000 |
| `internal_reasoning` | *Optional[str]* | :heavy_minus_sign: | A value in string format that is a large number | 1000 |
| `input_cache_read` | *Optional[str]* | :heavy_minus_sign: | A value in string format that is a large number | 1000 |
| `input_cache_write` | *Optional[str]* | :heavy_minus_sign: | A value in string format that is a large number | 1000 |
| `discount` | *Optional[float]* | :heavy_minus_sign: | N/A | |
-23
View File
@@ -1,23 +0,0 @@
# Prompt
## Supported Types
### `float`
```python
value: float = /* values here */
```
### `str`
```python
value: str = /* values here */
```
### `Any`
```python
value: Any = /* values here */
```
-1
View File
@@ -65,7 +65,6 @@
| `SEED` | Seed |
| `SILICON_FLOW` | SiliconFlow |
| `SOURCEFUL` | Sourceful |
| `STEP_FUN` | StepFun |
| `STEALTH` | Stealth |
| `STREAM_LAKE` | StreamLake |
| `SWITCHPOINT` | Switchpoint |
@@ -5,10 +5,10 @@ The object specifying the maximum price you want to pay for this request. USD pr
## Fields
| Field | Type | Required | Description | Example |
| ------------------------------- | ------------------------------- | ------------------------------- | ------------------------------- | ------------------------------- |
| `prompt` | *Optional[str]* | :heavy_minus_sign: | Price per million prompt tokens | 1000 |
| `completion` | *Optional[str]* | :heavy_minus_sign: | N/A | 1000 |
| `image` | *Optional[str]* | :heavy_minus_sign: | N/A | 1000 |
| `audio` | *Optional[str]* | :heavy_minus_sign: | N/A | 1000 |
| `request` | *Optional[str]* | :heavy_minus_sign: | N/A | 1000 |
| Field | Type | Required | Description | Example |
| ----------------------------------------------- | ----------------------------------------------- | ----------------------------------------------- | ----------------------------------------------- | ----------------------------------------------- |
| `prompt` | *Optional[str]* | :heavy_minus_sign: | A value in string format that is a large number | 1000 |
| `completion` | *Optional[str]* | :heavy_minus_sign: | A value in string format that is a large number | 1000 |
| `image` | *Optional[str]* | :heavy_minus_sign: | A value in string format that is a large number | 1000 |
| `audio` | *Optional[str]* | :heavy_minus_sign: | A value in string format that is a large number | 1000 |
| `request` | *Optional[str]* | :heavy_minus_sign: | A value in string format that is a large number | 1000 |
+16 -16
View File
@@ -5,19 +5,19 @@ Pricing information for the model
## Fields
| Field | Type | Required | Description | Example |
| -------------------- | -------------------- | -------------------- | -------------------- | -------------------- |
| `prompt` | *str* | :heavy_check_mark: | N/A | 1000 |
| `completion` | *str* | :heavy_check_mark: | N/A | 1000 |
| `request` | *Optional[str]* | :heavy_minus_sign: | N/A | 1000 |
| `image` | *Optional[str]* | :heavy_minus_sign: | N/A | 1000 |
| `image_token` | *Optional[str]* | :heavy_minus_sign: | N/A | 1000 |
| `image_output` | *Optional[str]* | :heavy_minus_sign: | N/A | 1000 |
| `audio` | *Optional[str]* | :heavy_minus_sign: | N/A | 1000 |
| `audio_output` | *Optional[str]* | :heavy_minus_sign: | N/A | 1000 |
| `input_audio_cache` | *Optional[str]* | :heavy_minus_sign: | N/A | 1000 |
| `web_search` | *Optional[str]* | :heavy_minus_sign: | N/A | 1000 |
| `internal_reasoning` | *Optional[str]* | :heavy_minus_sign: | N/A | 1000 |
| `input_cache_read` | *Optional[str]* | :heavy_minus_sign: | N/A | 1000 |
| `input_cache_write` | *Optional[str]* | :heavy_minus_sign: | N/A | 1000 |
| `discount` | *Optional[float]* | :heavy_minus_sign: | N/A | |
| Field | Type | Required | Description | Example |
| ----------------------------------------------- | ----------------------------------------------- | ----------------------------------------------- | ----------------------------------------------- | ----------------------------------------------- |
| `prompt` | *str* | :heavy_check_mark: | A value in string format that is a large number | 1000 |
| `completion` | *str* | :heavy_check_mark: | A value in string format that is a large number | 1000 |
| `request` | *Optional[str]* | :heavy_minus_sign: | A value in string format that is a large number | 1000 |
| `image` | *Optional[str]* | :heavy_minus_sign: | A value in string format that is a large number | 1000 |
| `image_token` | *Optional[str]* | :heavy_minus_sign: | A value in string format that is a large number | 1000 |
| `image_output` | *Optional[str]* | :heavy_minus_sign: | A value in string format that is a large number | 1000 |
| `audio` | *Optional[str]* | :heavy_minus_sign: | A value in string format that is a large number | 1000 |
| `audio_output` | *Optional[str]* | :heavy_minus_sign: | A value in string format that is a large number | 1000 |
| `input_audio_cache` | *Optional[str]* | :heavy_minus_sign: | A value in string format that is a large number | 1000 |
| `web_search` | *Optional[str]* | :heavy_minus_sign: | A value in string format that is a large number | 1000 |
| `internal_reasoning` | *Optional[str]* | :heavy_minus_sign: | A value in string format that is a large number | 1000 |
| `input_cache_read` | *Optional[str]* | :heavy_minus_sign: | A value in string format that is a large number | 1000 |
| `input_cache_write` | *Optional[str]* | :heavy_minus_sign: | A value in string format that is a large number | 1000 |
| `discount` | *Optional[float]* | :heavy_minus_sign: | N/A | |
@@ -1,4 +1,4 @@
# Schema8
# Quantizations
## Values
+13 -16
View File
@@ -1,20 +1,17 @@
# Schema0
## Fields
## Supported Types
### `components.Schema0Enum`
```python
value: components.Schema0Enum = /* values here */
```
### `str`
```python
value: str = /* values here */
```
| Field | Type | Required | Description |
| ------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------ |
| `allow_fallbacks` | *OptionalNullable[bool]* | :heavy_minus_sign: | N/A |
| `require_parameters` | *OptionalNullable[bool]* | :heavy_minus_sign: | N/A |
| `data_collection` | [OptionalNullable[components.Schema3]](../components/schema3.md) | :heavy_minus_sign: | N/A |
| `zdr` | *OptionalNullable[bool]* | :heavy_minus_sign: | N/A |
| `enforce_distillable_text` | *OptionalNullable[bool]* | :heavy_minus_sign: | N/A |
| `order` | List[[components.Schema5](../components/schema5.md)] | :heavy_minus_sign: | N/A |
| `only` | List[[components.Schema5](../components/schema5.md)] | :heavy_minus_sign: | N/A |
| `ignore` | List[[components.Schema5](../components/schema5.md)] | :heavy_minus_sign: | N/A |
| `quantizations` | List[[components.Schema8](../components/schema8.md)] | :heavy_minus_sign: | N/A |
| `sort` | [OptionalNullable[components.ProviderSortUnion]](../components/providersortunion.md) | :heavy_minus_sign: | N/A |
| `max_price` | [Optional[components.Schema10]](../components/schema10.md) | :heavy_minus_sign: | N/A |
| `preferred_min_throughput` | [OptionalNullable[components.Schema15Union]](../components/schema15union.md) | :heavy_minus_sign: | N/A |
| `preferred_max_latency` | [OptionalNullable[components.Schema15Union]](../components/schema15union.md) | :heavy_minus_sign: | N/A |
@@ -1,4 +1,4 @@
# Schema5Enum
# Schema0Enum
## Values
@@ -65,7 +65,6 @@
| `SEED` | Seed |
| `SILICON_FLOW` | SiliconFlow |
| `SOURCEFUL` | Sourceful |
| `STEP_FUN` | StepFun |
| `STEALTH` | Stealth |
| `STREAM_LAKE` | StreamLake |
| `SWITCHPOINT` | Switchpoint |
-12
View File
@@ -1,12 +0,0 @@
# Schema10
## Fields
| Field | Type | Required | Description |
| -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- |
| `prompt` | [Optional[components.Prompt]](../components/prompt.md) | :heavy_minus_sign: | N/A |
| `completion` | [Optional[components.Completion]](../components/completion.md) | :heavy_minus_sign: | N/A |
| `image` | [Optional[components.Schema14]](../components/schema14.md) | :heavy_minus_sign: | N/A |
| `audio` | [Optional[components.Schema14]](../components/schema14.md) | :heavy_minus_sign: | N/A |
| `request` | [Optional[components.Schema14]](../components/schema14.md) | :heavy_minus_sign: | N/A |
-23
View File
@@ -1,23 +0,0 @@
# Schema14
## Supported Types
### `float`
```python
value: float = /* values here */
```
### `str`
```python
value: str = /* values here */
```
### `Any`
```python
value: Any = /* values here */
```
-17
View File
@@ -1,17 +0,0 @@
# Schema15Union
## Supported Types
### `float`
```python
value: float = /* values here */
```
### `components.Schema15`
```python
value: components.Schema15 = /* values here */
```
-35
View File
@@ -1,35 +0,0 @@
# Schema17
## Supported Types
### `components.Schema17AutoRouter`
```python
value: components.Schema17AutoRouter = /* values here */
```
### `components.Schema17Moderation`
```python
value: components.Schema17Moderation = /* values here */
```
### `components.Schema17Web`
```python
value: components.Schema17Web = /* values here */
```
### `components.Schema17FileParser`
```python
value: components.Schema17FileParser = /* values here */
```
### `components.Schema17ResponseHealing`
```python
value: components.Schema17ResponseHealing = /* values here */
```
-23
View File
@@ -1,23 +0,0 @@
# Schema19
## Supported Types
### `components.Schema19ReasoningSummary`
```python
value: components.Schema19ReasoningSummary = /* values here */
```
### `components.Schema19ReasoningEncrypted`
```python
value: components.Schema19ReasoningEncrypted = /* values here */
```
### `components.Schema19ReasoningText`
```python
value: components.Schema19ReasoningText = /* values here */
```
@@ -1,12 +0,0 @@
# Schema19ReasoningEncrypted
## Fields
| Field | Type | Required | Description |
| ------------------------------------------------------------------ | ------------------------------------------------------------------ | ------------------------------------------------------------------ | ------------------------------------------------------------------ |
| `type` | *Literal["reasoning.encrypted"]* | :heavy_check_mark: | N/A |
| `data` | *str* | :heavy_check_mark: | N/A |
| `id` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A |
| `format_` | [OptionalNullable[components.Schema21]](../components/schema21.md) | :heavy_minus_sign: | N/A |
| `index` | *Optional[float]* | :heavy_minus_sign: | N/A |
@@ -1,12 +0,0 @@
# Schema19ReasoningSummary
## Fields
| Field | Type | Required | Description |
| ------------------------------------------------------------------ | ------------------------------------------------------------------ | ------------------------------------------------------------------ | ------------------------------------------------------------------ |
| `type` | *Literal["reasoning.summary"]* | :heavy_check_mark: | N/A |
| `summary` | *str* | :heavy_check_mark: | N/A |
| `id` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A |
| `format_` | [OptionalNullable[components.Schema21]](../components/schema21.md) | :heavy_minus_sign: | N/A |
| `index` | *Optional[float]* | :heavy_minus_sign: | N/A |
-13
View File
@@ -1,13 +0,0 @@
# Schema19ReasoningText
## Fields
| Field | Type | Required | Description |
| ------------------------------------------------------------------ | ------------------------------------------------------------------ | ------------------------------------------------------------------ | ------------------------------------------------------------------ |
| `type` | *Literal["reasoning.text"]* | :heavy_check_mark: | N/A |
| `text` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A |
| `signature` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A |
| `id` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A |
| `format_` | [OptionalNullable[components.Schema21]](../components/schema21.md) | :heavy_minus_sign: | N/A |
| `index` | *Optional[float]* | :heavy_minus_sign: | N/A |
+23
View File
@@ -0,0 +1,23 @@
# Schema2
## Supported Types
### `components.Schema2ReasoningSummary`
```python
value: components.Schema2ReasoningSummary = /* values here */
```
### `components.Schema2ReasoningEncrypted`
```python
value: components.Schema2ReasoningEncrypted = /* values here */
```
### `components.Schema2ReasoningText`
```python
value: components.Schema2ReasoningText = /* values here */
```
@@ -0,0 +1,12 @@
# Schema2ReasoningEncrypted
## Fields
| Field | Type | Required | Description |
| ---------------------------------------------------------------- | ---------------------------------------------------------------- | ---------------------------------------------------------------- | ---------------------------------------------------------------- |
| `type` | *Literal["reasoning.encrypted"]* | :heavy_check_mark: | N/A |
| `data` | *str* | :heavy_check_mark: | N/A |
| `id` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A |
| `format_` | [OptionalNullable[components.Schema4]](../components/schema4.md) | :heavy_minus_sign: | N/A |
| `index` | *Optional[float]* | :heavy_minus_sign: | N/A |
@@ -0,0 +1,12 @@
# Schema2ReasoningSummary
## Fields
| Field | Type | Required | Description |
| ---------------------------------------------------------------- | ---------------------------------------------------------------- | ---------------------------------------------------------------- | ---------------------------------------------------------------- |
| `type` | *Literal["reasoning.summary"]* | :heavy_check_mark: | N/A |
| `summary` | *str* | :heavy_check_mark: | N/A |
| `id` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A |
| `format_` | [OptionalNullable[components.Schema4]](../components/schema4.md) | :heavy_minus_sign: | N/A |
| `index` | *Optional[float]* | :heavy_minus_sign: | N/A |
+13
View File
@@ -0,0 +1,13 @@
# Schema2ReasoningText
## Fields
| Field | Type | Required | Description |
| ---------------------------------------------------------------- | ---------------------------------------------------------------- | ---------------------------------------------------------------- | ---------------------------------------------------------------- |
| `type` | *Literal["reasoning.text"]* | :heavy_check_mark: | N/A |
| `text` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A |
| `signature` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A |
| `id` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A |
| `format_` | [OptionalNullable[components.Schema4]](../components/schema4.md) | :heavy_minus_sign: | N/A |
| `index` | *Optional[float]* | :heavy_minus_sign: | N/A |
@@ -1,4 +1,4 @@
# Schema21
# Schema4
## Values
-17
View File
@@ -1,17 +0,0 @@
# Schema5
## Supported Types
### `components.Schema5Enum`
```python
value: components.Schema5Enum = /* values here */
```
### `str`
```python
value: str = /* values here */
```
-1
View File
@@ -93,7 +93,6 @@
| `SEED` | Seed |
| `SILICON_FLOW` | SiliconFlow |
| `SOURCEFUL` | Sourceful |
| `STEP_FUN` | StepFun |
| `STEALTH` | Stealth |
| `STREAM_LAKE` | StreamLake |
| `SWITCHPOINT` | Switchpoint |
+32 -32
View File
@@ -34,38 +34,38 @@ with OpenRouter(
### Parameters
| Parameter | Type | Required | Description |
| ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ |
| `messages` | List[[components.Message](../../components/message.md)] | :heavy_check_mark: | N/A |
| `provider` | [OptionalNullable[components.Schema0]](../../components/schema0.md) | :heavy_minus_sign: | N/A |
| `plugins` | List[[components.Schema17](../../components/schema17.md)] | :heavy_minus_sign: | N/A |
| `route` | [OptionalNullable[components.Route]](../../components/route.md) | :heavy_minus_sign: | N/A |
| `user` | *Optional[str]* | :heavy_minus_sign: | N/A |
| `session_id` | *Optional[str]* | :heavy_minus_sign: | N/A |
| `model` | *Optional[str]* | :heavy_minus_sign: | N/A |
| `models` | List[*str*] | :heavy_minus_sign: | N/A |
| `frequency_penalty` | *OptionalNullable[float]* | :heavy_minus_sign: | N/A |
| `logit_bias` | Dict[str, *float*] | :heavy_minus_sign: | N/A |
| `logprobs` | *OptionalNullable[bool]* | :heavy_minus_sign: | N/A |
| `top_logprobs` | *OptionalNullable[float]* | :heavy_minus_sign: | N/A |
| `max_completion_tokens` | *OptionalNullable[float]* | :heavy_minus_sign: | N/A |
| `max_tokens` | *OptionalNullable[float]* | :heavy_minus_sign: | N/A |
| `metadata` | Dict[str, *str*] | :heavy_minus_sign: | N/A |
| `presence_penalty` | *OptionalNullable[float]* | :heavy_minus_sign: | N/A |
| `reasoning` | [Optional[components.Reasoning]](../../components/reasoning.md) | :heavy_minus_sign: | N/A |
| `response_format` | [Optional[components.ResponseFormat]](../../components/responseformat.md) | :heavy_minus_sign: | N/A |
| `seed` | *OptionalNullable[int]* | :heavy_minus_sign: | N/A |
| `stop` | [OptionalNullable[components.Stop]](../../components/stop.md) | :heavy_minus_sign: | N/A |
| `stream` | *Optional[bool]* | :heavy_minus_sign: | N/A |
| `stream_options` | [OptionalNullable[components.ChatStreamOptions]](../../components/chatstreamoptions.md) | :heavy_minus_sign: | N/A |
| `temperature` | *OptionalNullable[float]* | :heavy_minus_sign: | N/A |
| `tool_choice` | *Optional[Any]* | :heavy_minus_sign: | N/A |
| `tools` | List[[components.ToolDefinitionJSON](../../components/tooldefinitionjson.md)] | :heavy_minus_sign: | N/A |
| `top_p` | *OptionalNullable[float]* | :heavy_minus_sign: | N/A |
| `debug` | [Optional[components.Debug]](../../components/debug.md) | :heavy_minus_sign: | N/A |
| `image_config` | Dict[str, [components.ChatGenerationParamsImageConfig](../../components/chatgenerationparamsimageconfig.md)] | :heavy_minus_sign: | N/A |
| `modalities` | List[[components.Modality](../../components/modality.md)] | :heavy_minus_sign: | N/A |
| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. |
| Parameter | Type | Required | Description |
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `messages` | List[[components.Message](../../components/message.md)] | :heavy_check_mark: | N/A |
| `provider` | [OptionalNullable[components.ChatGenerationParamsProvider]](../../components/chatgenerationparamsprovider.md) | :heavy_minus_sign: | When multiple model providers are available, optionally indicate your routing preference. |
| `plugins` | List[[components.ChatGenerationParamsPluginUnion](../../components/chatgenerationparamspluginunion.md)] | :heavy_minus_sign: | Plugins you want to enable for this request, including their settings. |
| `route` | [OptionalNullable[components.Route]](../../components/route.md) | :heavy_minus_sign: | N/A |
| `user` | *Optional[str]* | :heavy_minus_sign: | N/A |
| `session_id` | *Optional[str]* | :heavy_minus_sign: | 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. |
| `model` | *Optional[str]* | :heavy_minus_sign: | N/A |
| `models` | List[*str*] | :heavy_minus_sign: | N/A |
| `frequency_penalty` | *OptionalNullable[float]* | :heavy_minus_sign: | N/A |
| `logit_bias` | Dict[str, *float*] | :heavy_minus_sign: | N/A |
| `logprobs` | *OptionalNullable[bool]* | :heavy_minus_sign: | N/A |
| `top_logprobs` | *OptionalNullable[float]* | :heavy_minus_sign: | N/A |
| `max_completion_tokens` | *OptionalNullable[float]* | :heavy_minus_sign: | N/A |
| `max_tokens` | *OptionalNullable[float]* | :heavy_minus_sign: | N/A |
| `metadata` | Dict[str, *str*] | :heavy_minus_sign: | N/A |
| `presence_penalty` | *OptionalNullable[float]* | :heavy_minus_sign: | N/A |
| `reasoning` | [Optional[components.Reasoning]](../../components/reasoning.md) | :heavy_minus_sign: | N/A |
| `response_format` | [Optional[components.ResponseFormat]](../../components/responseformat.md) | :heavy_minus_sign: | N/A |
| `seed` | *OptionalNullable[int]* | :heavy_minus_sign: | N/A |
| `stop` | [OptionalNullable[components.Stop]](../../components/stop.md) | :heavy_minus_sign: | N/A |
| `stream` | *Optional[bool]* | :heavy_minus_sign: | N/A |
| `stream_options` | [OptionalNullable[components.ChatStreamOptions]](../../components/chatstreamoptions.md) | :heavy_minus_sign: | N/A |
| `temperature` | *OptionalNullable[float]* | :heavy_minus_sign: | N/A |
| `tool_choice` | *Optional[Any]* | :heavy_minus_sign: | N/A |
| `tools` | List[[components.ToolDefinitionJSON](../../components/tooldefinitionjson.md)] | :heavy_minus_sign: | N/A |
| `top_p` | *OptionalNullable[float]* | :heavy_minus_sign: | N/A |
| `debug` | [Optional[components.Debug]](../../components/debug.md) | :heavy_minus_sign: | N/A |
| `image_config` | Dict[str, [components.ChatGenerationParamsImageConfig](../../components/chatgenerationparamsimageconfig.md)] | :heavy_minus_sign: | N/A |
| `modalities` | List[[components.Modality](../../components/modality.md)] | :heavy_minus_sign: | N/A |
| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. |
### Response
+2 -2
View File
@@ -67,8 +67,8 @@ with OpenRouter(
| `service_tier` | [Optional[components.ServiceTier]](../../components/servicetier.md) | :heavy_minus_sign: | N/A | |
| `truncation` | [OptionalNullable[components.Truncation]](../../components/truncation.md) | :heavy_minus_sign: | N/A | auto |
| `stream` | *Optional[bool]* | :heavy_minus_sign: | N/A | |
| `provider` | [OptionalNullable[components.Provider]](../../components/provider.md) | :heavy_minus_sign: | When multiple model providers are available, optionally indicate your routing preference. | |
| `plugins` | List[[components.Plugin](../../components/plugin.md)] | :heavy_minus_sign: | Plugins you want to enable for this request, including their settings. | |
| `provider` | [OptionalNullable[components.OpenResponsesRequestProvider]](../../components/openresponsesrequestprovider.md) | :heavy_minus_sign: | When multiple model providers are available, optionally indicate your routing preference. | |
| `plugins` | List[[components.OpenResponsesRequestPluginUnion](../../components/openresponsesrequestpluginunion.md)] | :heavy_minus_sign: | Plugins you want to enable for this request, including their settings. | |
| `user` | *Optional[str]* | :heavy_minus_sign: | A unique identifier representing your end-user, which helps distinguish between different users of your app. This allows your app to identify specific users in case of abuse reports, preventing your entire app from being affected by the actions of individual users. Maximum of 128 characters. | |
| `session_id` | *Optional[str]* | :heavy_minus_sign: | 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. | |
| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | |
+1 -1
View File
@@ -1,6 +1,6 @@
[project]
name = "openrouter"
version = "0.5.0"
version = "0.3.2"
description = "Official Python Client SDK for OpenRouter."
authors = [{ name = "OpenRouter" },]
readme = "README-PYPI.md"
+2 -2
View File
@@ -3,10 +3,10 @@
import importlib.metadata
__title__: str = "openrouter"
__version__: str = "0.5.0"
__version__: str = "0.3.2"
__openapi_doc_version__: str = "1.0.0"
__gen_version__: str = "2.768.0"
__user_agent__: str = "speakeasy-sdk/python 0.5.0 2.768.0 1.0.0 openrouter"
__user_agent__: str = "speakeasy-sdk/python 0.3.2 2.768.0 1.0.0 openrouter"
try:
if __package__ is not None:
+70 -34
View File
@@ -22,10 +22,16 @@ class Chat(BaseSDK):
*,
messages: Union[List[components.Message], List[components.MessageTypedDict]],
provider: OptionalNullable[
Union[components.Schema0, components.Schema0TypedDict]
Union[
components.ChatGenerationParamsProvider,
components.ChatGenerationParamsProviderTypedDict,
]
] = UNSET,
plugins: Optional[
Union[List[components.Schema17], List[components.Schema17TypedDict]]
Union[
List[components.ChatGenerationParamsPluginUnion],
List[components.ChatGenerationParamsPluginUnionTypedDict],
]
] = None,
route: OptionalNullable[components.Route] = UNSET,
user: Optional[str] = None,
@@ -81,11 +87,11 @@ class Chat(BaseSDK):
Sends a request for a model response for the given chat conversation. Supports both streaming and non-streaming modes.
:param messages:
:param provider:
:param plugins:
:param provider: When multiple model providers are available, optionally indicate your routing preference.
:param plugins: Plugins you want to enable for this request, including their settings.
:param route:
:param user:
:param session_id:
:param session_id: 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.
:param model:
:param models:
:param frequency_penalty:
@@ -122,10 +128,16 @@ class Chat(BaseSDK):
*,
messages: Union[List[components.Message], List[components.MessageTypedDict]],
provider: OptionalNullable[
Union[components.Schema0, components.Schema0TypedDict]
Union[
components.ChatGenerationParamsProvider,
components.ChatGenerationParamsProviderTypedDict,
]
] = UNSET,
plugins: Optional[
Union[List[components.Schema17], List[components.Schema17TypedDict]]
Union[
List[components.ChatGenerationParamsPluginUnion],
List[components.ChatGenerationParamsPluginUnionTypedDict],
]
] = None,
route: OptionalNullable[components.Route] = UNSET,
user: Optional[str] = None,
@@ -181,11 +193,11 @@ class Chat(BaseSDK):
Sends a request for a model response for the given chat conversation. Supports both streaming and non-streaming modes.
:param messages:
:param provider:
:param plugins:
:param provider: When multiple model providers are available, optionally indicate your routing preference.
:param plugins: Plugins you want to enable for this request, including their settings.
:param route:
:param user:
:param session_id:
:param session_id: 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.
:param model:
:param models:
:param frequency_penalty:
@@ -221,10 +233,16 @@ class Chat(BaseSDK):
*,
messages: Union[List[components.Message], List[components.MessageTypedDict]],
provider: OptionalNullable[
Union[components.Schema0, components.Schema0TypedDict]
Union[
components.ChatGenerationParamsProvider,
components.ChatGenerationParamsProviderTypedDict,
]
] = UNSET,
plugins: Optional[
Union[List[components.Schema17], List[components.Schema17TypedDict]]
Union[
List[components.ChatGenerationParamsPluginUnion],
List[components.ChatGenerationParamsPluginUnionTypedDict],
]
] = None,
route: OptionalNullable[components.Route] = UNSET,
user: Optional[str] = None,
@@ -280,11 +298,11 @@ class Chat(BaseSDK):
Sends a request for a model response for the given chat conversation. Supports both streaming and non-streaming modes.
:param messages:
:param provider:
:param plugins:
:param provider: When multiple model providers are available, optionally indicate your routing preference.
:param plugins: Plugins you want to enable for this request, including their settings.
:param route:
:param user:
:param session_id:
:param session_id: 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.
:param model:
:param models:
:param frequency_penalty:
@@ -326,10 +344,10 @@ class Chat(BaseSDK):
request = components.ChatGenerationParams(
provider=utils.get_pydantic_model(
provider, OptionalNullable[components.Schema0]
provider, OptionalNullable[components.ChatGenerationParamsProvider]
),
plugins=utils.get_pydantic_model(
plugins, Optional[List[components.Schema17]]
plugins, Optional[List[components.ChatGenerationParamsPluginUnion]]
),
route=route,
user=user,
@@ -461,10 +479,16 @@ class Chat(BaseSDK):
*,
messages: Union[List[components.Message], List[components.MessageTypedDict]],
provider: OptionalNullable[
Union[components.Schema0, components.Schema0TypedDict]
Union[
components.ChatGenerationParamsProvider,
components.ChatGenerationParamsProviderTypedDict,
]
] = UNSET,
plugins: Optional[
Union[List[components.Schema17], List[components.Schema17TypedDict]]
Union[
List[components.ChatGenerationParamsPluginUnion],
List[components.ChatGenerationParamsPluginUnionTypedDict],
]
] = None,
route: OptionalNullable[components.Route] = UNSET,
user: Optional[str] = None,
@@ -520,11 +544,11 @@ class Chat(BaseSDK):
Sends a request for a model response for the given chat conversation. Supports both streaming and non-streaming modes.
:param messages:
:param provider:
:param plugins:
:param provider: When multiple model providers are available, optionally indicate your routing preference.
:param plugins: Plugins you want to enable for this request, including their settings.
:param route:
:param user:
:param session_id:
:param session_id: 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.
:param model:
:param models:
:param frequency_penalty:
@@ -561,10 +585,16 @@ class Chat(BaseSDK):
*,
messages: Union[List[components.Message], List[components.MessageTypedDict]],
provider: OptionalNullable[
Union[components.Schema0, components.Schema0TypedDict]
Union[
components.ChatGenerationParamsProvider,
components.ChatGenerationParamsProviderTypedDict,
]
] = UNSET,
plugins: Optional[
Union[List[components.Schema17], List[components.Schema17TypedDict]]
Union[
List[components.ChatGenerationParamsPluginUnion],
List[components.ChatGenerationParamsPluginUnionTypedDict],
]
] = None,
route: OptionalNullable[components.Route] = UNSET,
user: Optional[str] = None,
@@ -620,11 +650,11 @@ class Chat(BaseSDK):
Sends a request for a model response for the given chat conversation. Supports both streaming and non-streaming modes.
:param messages:
:param provider:
:param plugins:
:param provider: When multiple model providers are available, optionally indicate your routing preference.
:param plugins: Plugins you want to enable for this request, including their settings.
:param route:
:param user:
:param session_id:
:param session_id: 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.
:param model:
:param models:
:param frequency_penalty:
@@ -660,10 +690,16 @@ class Chat(BaseSDK):
*,
messages: Union[List[components.Message], List[components.MessageTypedDict]],
provider: OptionalNullable[
Union[components.Schema0, components.Schema0TypedDict]
Union[
components.ChatGenerationParamsProvider,
components.ChatGenerationParamsProviderTypedDict,
]
] = UNSET,
plugins: Optional[
Union[List[components.Schema17], List[components.Schema17TypedDict]]
Union[
List[components.ChatGenerationParamsPluginUnion],
List[components.ChatGenerationParamsPluginUnionTypedDict],
]
] = None,
route: OptionalNullable[components.Route] = UNSET,
user: Optional[str] = None,
@@ -719,11 +755,11 @@ class Chat(BaseSDK):
Sends a request for a model response for the given chat conversation. Supports both streaming and non-streaming modes.
:param messages:
:param provider:
:param plugins:
:param provider: When multiple model providers are available, optionally indicate your routing preference.
:param plugins: Plugins you want to enable for this request, including their settings.
:param route:
:param user:
:param session_id:
:param session_id: 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.
:param model:
:param models:
:param frequency_penalty:
@@ -765,10 +801,10 @@ class Chat(BaseSDK):
request = components.ChatGenerationParams(
provider=utils.get_pydantic_model(
provider, OptionalNullable[components.Schema0]
provider, OptionalNullable[components.ChatGenerationParamsProvider]
),
plugins=utils.get_pydantic_model(
plugins, Optional[List[components.Schema17]]
plugins, Optional[List[components.ChatGenerationParamsPluginUnion]]
),
route=route,
user=user,
+177 -185
View File
@@ -6,45 +6,18 @@ import builtins
import sys
if TYPE_CHECKING:
from ._schema10 import (
Completion,
CompletionTypedDict,
Prompt,
PromptTypedDict,
Schema10,
Schema10TypedDict,
from ._schema0 import Schema0, Schema0Enum, Schema0TypedDict
from ._schema2 import (
Schema2,
Schema2ReasoningEncrypted,
Schema2ReasoningEncryptedTypedDict,
Schema2ReasoningSummary,
Schema2ReasoningSummaryTypedDict,
Schema2ReasoningText,
Schema2ReasoningTextTypedDict,
Schema2TypedDict,
Schema4,
)
from ._schema14 import Schema14, Schema14TypedDict
from ._schema17 import (
Engine,
Pdf,
PdfEngine,
PdfTypedDict,
Schema17,
Schema17AutoRouter,
Schema17AutoRouterTypedDict,
Schema17FileParser,
Schema17FileParserTypedDict,
Schema17Moderation,
Schema17ModerationTypedDict,
Schema17ResponseHealing,
Schema17ResponseHealingTypedDict,
Schema17TypedDict,
Schema17Web,
Schema17WebTypedDict,
)
from ._schema19 import (
Schema19,
Schema19ReasoningEncrypted,
Schema19ReasoningEncryptedTypedDict,
Schema19ReasoningSummary,
Schema19ReasoningSummaryTypedDict,
Schema19ReasoningText,
Schema19ReasoningTextTypedDict,
Schema19TypedDict,
Schema21,
)
from ._schema5 import Schema5, Schema5Enum, Schema5TypedDict
from .activityitem import ActivityItem, ActivityItemTypedDict
from .assistantmessage import (
AssistantMessage,
@@ -68,13 +41,43 @@ if TYPE_CHECKING:
from .chaterror import ChatErrorError, ChatErrorErrorTypedDict, Code, CodeTypedDict
from .chatgenerationparams import (
ChatGenerationParams,
ChatGenerationParamsDataCollection,
ChatGenerationParamsImageConfig,
ChatGenerationParamsImageConfigTypedDict,
ChatGenerationParamsMaxPrice,
ChatGenerationParamsMaxPriceTypedDict,
ChatGenerationParamsPluginAutoRouter,
ChatGenerationParamsPluginAutoRouterTypedDict,
ChatGenerationParamsPluginFileParser,
ChatGenerationParamsPluginFileParserTypedDict,
ChatGenerationParamsPluginModeration,
ChatGenerationParamsPluginModerationTypedDict,
ChatGenerationParamsPluginResponseHealing,
ChatGenerationParamsPluginResponseHealingTypedDict,
ChatGenerationParamsPluginUnion,
ChatGenerationParamsPluginUnionTypedDict,
ChatGenerationParamsPluginWeb,
ChatGenerationParamsPluginWebTypedDict,
ChatGenerationParamsPreferredMaxLatency,
ChatGenerationParamsPreferredMaxLatencyTypedDict,
ChatGenerationParamsPreferredMaxLatencyUnion,
ChatGenerationParamsPreferredMaxLatencyUnionTypedDict,
ChatGenerationParamsPreferredMinThroughput,
ChatGenerationParamsPreferredMinThroughputTypedDict,
ChatGenerationParamsPreferredMinThroughputUnion,
ChatGenerationParamsPreferredMinThroughputUnionTypedDict,
ChatGenerationParamsProvider,
ChatGenerationParamsProviderTypedDict,
ChatGenerationParamsTypedDict,
Debug,
DebugTypedDict,
Effort,
Engine,
Modality,
Pdf,
PdfEngine,
PdfTypedDict,
Quantizations,
Reasoning,
ReasoningTypedDict,
ResponseFormat,
@@ -86,14 +89,6 @@ if TYPE_CHECKING:
ResponseFormatTextTypedDict,
ResponseFormatTypedDict,
Route,
Schema0,
Schema0TypedDict,
Schema15,
Schema15TypedDict,
Schema15Union,
Schema15UnionTypedDict,
Schema3,
Schema8,
Stop,
StopTypedDict,
)
@@ -189,12 +184,6 @@ if TYPE_CHECKING:
)
from .datacollection import DataCollection
from .defaultparameters import DefaultParameters, DefaultParametersTypedDict
from .developermessage import (
DeveloperMessage,
DeveloperMessageContent,
DeveloperMessageContentTypedDict,
DeveloperMessageTypedDict,
)
from .edgenetworktimeoutresponseerrordata import (
EdgeNetworkTimeoutResponseErrorData,
EdgeNetworkTimeoutResponseErrorDataTypedDict,
@@ -221,7 +210,14 @@ if TYPE_CHECKING:
ListEndpointsResponseTypedDict,
Tokenizer,
)
from .message import Message, MessageTypedDict
from .message import (
Message,
MessageContent,
MessageContentTypedDict,
MessageDeveloper,
MessageDeveloperTypedDict,
MessageTypedDict,
)
from .model import Model, ModelTypedDict
from .modelarchitecture import (
ModelArchitecture,
@@ -473,6 +469,20 @@ if TYPE_CHECKING:
OpenResponsesRequestOnlyTypedDict,
OpenResponsesRequestOrder,
OpenResponsesRequestOrderTypedDict,
OpenResponsesRequestPluginAutoRouter,
OpenResponsesRequestPluginAutoRouterTypedDict,
OpenResponsesRequestPluginFileParser,
OpenResponsesRequestPluginFileParserTypedDict,
OpenResponsesRequestPluginModeration,
OpenResponsesRequestPluginModerationTypedDict,
OpenResponsesRequestPluginResponseHealing,
OpenResponsesRequestPluginResponseHealingTypedDict,
OpenResponsesRequestPluginUnion,
OpenResponsesRequestPluginUnionTypedDict,
OpenResponsesRequestPluginWeb,
OpenResponsesRequestPluginWebTypedDict,
OpenResponsesRequestProvider,
OpenResponsesRequestProviderTypedDict,
OpenResponsesRequestSort,
OpenResponsesRequestSortTypedDict,
OpenResponsesRequestToolFunction,
@@ -481,20 +491,6 @@ if TYPE_CHECKING:
OpenResponsesRequestToolUnionTypedDict,
OpenResponsesRequestType,
OpenResponsesRequestTypedDict,
Plugin,
PluginAutoRouter,
PluginAutoRouterTypedDict,
PluginFileParser,
PluginFileParserTypedDict,
PluginModeration,
PluginModerationTypedDict,
PluginResponseHealing,
PluginResponseHealingTypedDict,
PluginTypedDict,
PluginWeb,
PluginWebTypedDict,
Provider,
ProviderTypedDict,
ServiceTier,
Truncation,
)
@@ -907,8 +903,33 @@ __all__ = [
"ChatErrorError",
"ChatErrorErrorTypedDict",
"ChatGenerationParams",
"ChatGenerationParamsDataCollection",
"ChatGenerationParamsImageConfig",
"ChatGenerationParamsImageConfigTypedDict",
"ChatGenerationParamsMaxPrice",
"ChatGenerationParamsMaxPriceTypedDict",
"ChatGenerationParamsPluginAutoRouter",
"ChatGenerationParamsPluginAutoRouterTypedDict",
"ChatGenerationParamsPluginFileParser",
"ChatGenerationParamsPluginFileParserTypedDict",
"ChatGenerationParamsPluginModeration",
"ChatGenerationParamsPluginModerationTypedDict",
"ChatGenerationParamsPluginResponseHealing",
"ChatGenerationParamsPluginResponseHealingTypedDict",
"ChatGenerationParamsPluginUnion",
"ChatGenerationParamsPluginUnionTypedDict",
"ChatGenerationParamsPluginWeb",
"ChatGenerationParamsPluginWebTypedDict",
"ChatGenerationParamsPreferredMaxLatency",
"ChatGenerationParamsPreferredMaxLatencyTypedDict",
"ChatGenerationParamsPreferredMaxLatencyUnion",
"ChatGenerationParamsPreferredMaxLatencyUnionTypedDict",
"ChatGenerationParamsPreferredMinThroughput",
"ChatGenerationParamsPreferredMinThroughputTypedDict",
"ChatGenerationParamsPreferredMinThroughputUnion",
"ChatGenerationParamsPreferredMinThroughputUnionTypedDict",
"ChatGenerationParamsProvider",
"ChatGenerationParamsProviderTypedDict",
"ChatGenerationParamsTypedDict",
"ChatGenerationTokenUsage",
"ChatGenerationTokenUsageTypedDict",
@@ -967,10 +988,8 @@ __all__ = [
"Code",
"CodeEnum",
"CodeTypedDict",
"Completion",
"CompletionTokensDetails",
"CompletionTokensDetailsTypedDict",
"CompletionTypedDict",
"CostDetails",
"CostDetailsTypedDict",
"CreateChargeRequest",
@@ -980,10 +999,6 @@ __all__ = [
"DebugTypedDict",
"DefaultParameters",
"DefaultParametersTypedDict",
"DeveloperMessage",
"DeveloperMessageContent",
"DeveloperMessageContentTypedDict",
"DeveloperMessageTypedDict",
"EdgeNetworkTimeoutResponseErrorData",
"EdgeNetworkTimeoutResponseErrorDataTypedDict",
"Effort",
@@ -1018,6 +1033,10 @@ __all__ = [
"Logprob",
"LogprobTypedDict",
"Message",
"MessageContent",
"MessageContentTypedDict",
"MessageDeveloper",
"MessageDeveloperTypedDict",
"MessageTypedDict",
"Modality",
"Model",
@@ -1202,6 +1221,20 @@ __all__ = [
"OpenResponsesRequestOnlyTypedDict",
"OpenResponsesRequestOrder",
"OpenResponsesRequestOrderTypedDict",
"OpenResponsesRequestPluginAutoRouter",
"OpenResponsesRequestPluginAutoRouterTypedDict",
"OpenResponsesRequestPluginFileParser",
"OpenResponsesRequestPluginFileParserTypedDict",
"OpenResponsesRequestPluginModeration",
"OpenResponsesRequestPluginModerationTypedDict",
"OpenResponsesRequestPluginResponseHealing",
"OpenResponsesRequestPluginResponseHealingTypedDict",
"OpenResponsesRequestPluginUnion",
"OpenResponsesRequestPluginUnionTypedDict",
"OpenResponsesRequestPluginWeb",
"OpenResponsesRequestPluginWebTypedDict",
"OpenResponsesRequestProvider",
"OpenResponsesRequestProviderTypedDict",
"OpenResponsesRequestSort",
"OpenResponsesRequestSortTypedDict",
"OpenResponsesRequestToolFunction",
@@ -1310,29 +1343,14 @@ __all__ = [
"PercentileStatsTypedDict",
"PercentileThroughputCutoffs",
"PercentileThroughputCutoffsTypedDict",
"Plugin",
"PluginAutoRouter",
"PluginAutoRouterTypedDict",
"PluginFileParser",
"PluginFileParserTypedDict",
"PluginModeration",
"PluginModerationTypedDict",
"PluginResponseHealing",
"PluginResponseHealingTypedDict",
"PluginTypedDict",
"PluginWeb",
"PluginWebTypedDict",
"PreferredMaxLatency",
"PreferredMaxLatencyTypedDict",
"PreferredMinThroughput",
"PreferredMinThroughputTypedDict",
"Pricing",
"PricingTypedDict",
"Prompt",
"PromptTokensDetails",
"PromptTokensDetailsTypedDict",
"PromptTypedDict",
"Provider",
"ProviderName",
"ProviderOverloadedResponseErrorData",
"ProviderOverloadedResponseErrorDataTypedDict",
@@ -1360,13 +1378,13 @@ __all__ = [
"ProviderSortConfigUnionTypedDict",
"ProviderSortUnion",
"ProviderSortUnionTypedDict",
"ProviderTypedDict",
"PublicEndpoint",
"PublicEndpointQuantization",
"PublicEndpointTypedDict",
"PublicPricing",
"PublicPricingTypedDict",
"Quantization",
"Quantizations",
"Reason",
"Reasoning",
"ReasoningSummaryText",
@@ -1477,41 +1495,17 @@ __all__ = [
"ResponsesWebSearchUserLocationTypedDict",
"Route",
"Schema0",
"Schema0Enum",
"Schema0TypedDict",
"Schema10",
"Schema10TypedDict",
"Schema14",
"Schema14TypedDict",
"Schema15",
"Schema15TypedDict",
"Schema15Union",
"Schema15UnionTypedDict",
"Schema17",
"Schema17AutoRouter",
"Schema17AutoRouterTypedDict",
"Schema17FileParser",
"Schema17FileParserTypedDict",
"Schema17Moderation",
"Schema17ModerationTypedDict",
"Schema17ResponseHealing",
"Schema17ResponseHealingTypedDict",
"Schema17TypedDict",
"Schema17Web",
"Schema17WebTypedDict",
"Schema19",
"Schema19ReasoningEncrypted",
"Schema19ReasoningEncryptedTypedDict",
"Schema19ReasoningSummary",
"Schema19ReasoningSummaryTypedDict",
"Schema19ReasoningText",
"Schema19ReasoningTextTypedDict",
"Schema19TypedDict",
"Schema21",
"Schema3",
"Schema5",
"Schema5Enum",
"Schema5TypedDict",
"Schema8",
"Schema2",
"Schema2ReasoningEncrypted",
"Schema2ReasoningEncryptedTypedDict",
"Schema2ReasoningSummary",
"Schema2ReasoningSummaryTypedDict",
"Schema2ReasoningText",
"Schema2ReasoningTextTypedDict",
"Schema2TypedDict",
"Schema4",
"Security",
"SecurityTypedDict",
"ServiceTier",
@@ -1584,42 +1578,18 @@ __all__ = [
]
_dynamic_imports: dict[str, str] = {
"Completion": "._schema10",
"CompletionTypedDict": "._schema10",
"Prompt": "._schema10",
"PromptTypedDict": "._schema10",
"Schema10": "._schema10",
"Schema10TypedDict": "._schema10",
"Schema14": "._schema14",
"Schema14TypedDict": "._schema14",
"Engine": "._schema17",
"Pdf": "._schema17",
"PdfEngine": "._schema17",
"PdfTypedDict": "._schema17",
"Schema17": "._schema17",
"Schema17AutoRouter": "._schema17",
"Schema17AutoRouterTypedDict": "._schema17",
"Schema17FileParser": "._schema17",
"Schema17FileParserTypedDict": "._schema17",
"Schema17Moderation": "._schema17",
"Schema17ModerationTypedDict": "._schema17",
"Schema17ResponseHealing": "._schema17",
"Schema17ResponseHealingTypedDict": "._schema17",
"Schema17TypedDict": "._schema17",
"Schema17Web": "._schema17",
"Schema17WebTypedDict": "._schema17",
"Schema19": "._schema19",
"Schema19ReasoningEncrypted": "._schema19",
"Schema19ReasoningEncryptedTypedDict": "._schema19",
"Schema19ReasoningSummary": "._schema19",
"Schema19ReasoningSummaryTypedDict": "._schema19",
"Schema19ReasoningText": "._schema19",
"Schema19ReasoningTextTypedDict": "._schema19",
"Schema19TypedDict": "._schema19",
"Schema21": "._schema19",
"Schema5": "._schema5",
"Schema5Enum": "._schema5",
"Schema5TypedDict": "._schema5",
"Schema0": "._schema0",
"Schema0Enum": "._schema0",
"Schema0TypedDict": "._schema0",
"Schema2": "._schema2",
"Schema2ReasoningEncrypted": "._schema2",
"Schema2ReasoningEncryptedTypedDict": "._schema2",
"Schema2ReasoningSummary": "._schema2",
"Schema2ReasoningSummaryTypedDict": "._schema2",
"Schema2ReasoningText": "._schema2",
"Schema2ReasoningTextTypedDict": "._schema2",
"Schema2TypedDict": "._schema2",
"Schema4": "._schema2",
"ActivityItem": ".activityitem",
"ActivityItemTypedDict": ".activityitem",
"AssistantMessage": ".assistantmessage",
@@ -1640,13 +1610,43 @@ _dynamic_imports: dict[str, str] = {
"Code": ".chaterror",
"CodeTypedDict": ".chaterror",
"ChatGenerationParams": ".chatgenerationparams",
"ChatGenerationParamsDataCollection": ".chatgenerationparams",
"ChatGenerationParamsImageConfig": ".chatgenerationparams",
"ChatGenerationParamsImageConfigTypedDict": ".chatgenerationparams",
"ChatGenerationParamsMaxPrice": ".chatgenerationparams",
"ChatGenerationParamsMaxPriceTypedDict": ".chatgenerationparams",
"ChatGenerationParamsPluginAutoRouter": ".chatgenerationparams",
"ChatGenerationParamsPluginAutoRouterTypedDict": ".chatgenerationparams",
"ChatGenerationParamsPluginFileParser": ".chatgenerationparams",
"ChatGenerationParamsPluginFileParserTypedDict": ".chatgenerationparams",
"ChatGenerationParamsPluginModeration": ".chatgenerationparams",
"ChatGenerationParamsPluginModerationTypedDict": ".chatgenerationparams",
"ChatGenerationParamsPluginResponseHealing": ".chatgenerationparams",
"ChatGenerationParamsPluginResponseHealingTypedDict": ".chatgenerationparams",
"ChatGenerationParamsPluginUnion": ".chatgenerationparams",
"ChatGenerationParamsPluginUnionTypedDict": ".chatgenerationparams",
"ChatGenerationParamsPluginWeb": ".chatgenerationparams",
"ChatGenerationParamsPluginWebTypedDict": ".chatgenerationparams",
"ChatGenerationParamsPreferredMaxLatency": ".chatgenerationparams",
"ChatGenerationParamsPreferredMaxLatencyTypedDict": ".chatgenerationparams",
"ChatGenerationParamsPreferredMaxLatencyUnion": ".chatgenerationparams",
"ChatGenerationParamsPreferredMaxLatencyUnionTypedDict": ".chatgenerationparams",
"ChatGenerationParamsPreferredMinThroughput": ".chatgenerationparams",
"ChatGenerationParamsPreferredMinThroughputTypedDict": ".chatgenerationparams",
"ChatGenerationParamsPreferredMinThroughputUnion": ".chatgenerationparams",
"ChatGenerationParamsPreferredMinThroughputUnionTypedDict": ".chatgenerationparams",
"ChatGenerationParamsProvider": ".chatgenerationparams",
"ChatGenerationParamsProviderTypedDict": ".chatgenerationparams",
"ChatGenerationParamsTypedDict": ".chatgenerationparams",
"Debug": ".chatgenerationparams",
"DebugTypedDict": ".chatgenerationparams",
"Effort": ".chatgenerationparams",
"Engine": ".chatgenerationparams",
"Modality": ".chatgenerationparams",
"Pdf": ".chatgenerationparams",
"PdfEngine": ".chatgenerationparams",
"PdfTypedDict": ".chatgenerationparams",
"Quantizations": ".chatgenerationparams",
"Reasoning": ".chatgenerationparams",
"ReasoningTypedDict": ".chatgenerationparams",
"ResponseFormat": ".chatgenerationparams",
@@ -1658,14 +1658,6 @@ _dynamic_imports: dict[str, str] = {
"ResponseFormatTextTypedDict": ".chatgenerationparams",
"ResponseFormatTypedDict": ".chatgenerationparams",
"Route": ".chatgenerationparams",
"Schema0": ".chatgenerationparams",
"Schema0TypedDict": ".chatgenerationparams",
"Schema15": ".chatgenerationparams",
"Schema15TypedDict": ".chatgenerationparams",
"Schema15Union": ".chatgenerationparams",
"Schema15UnionTypedDict": ".chatgenerationparams",
"Schema3": ".chatgenerationparams",
"Schema8": ".chatgenerationparams",
"Stop": ".chatgenerationparams",
"StopTypedDict": ".chatgenerationparams",
"ChatGenerationTokenUsage": ".chatgenerationtokenusage",
@@ -1737,10 +1729,6 @@ _dynamic_imports: dict[str, str] = {
"DataCollection": ".datacollection",
"DefaultParameters": ".defaultparameters",
"DefaultParametersTypedDict": ".defaultparameters",
"DeveloperMessage": ".developermessage",
"DeveloperMessageContent": ".developermessage",
"DeveloperMessageContentTypedDict": ".developermessage",
"DeveloperMessageTypedDict": ".developermessage",
"EdgeNetworkTimeoutResponseErrorData": ".edgenetworktimeoutresponseerrordata",
"EdgeNetworkTimeoutResponseErrorDataTypedDict": ".edgenetworktimeoutresponseerrordata",
"EndpointStatus": ".endpointstatus",
@@ -1765,6 +1753,10 @@ _dynamic_imports: dict[str, str] = {
"ListEndpointsResponseTypedDict": ".listendpointsresponse",
"Tokenizer": ".listendpointsresponse",
"Message": ".message",
"MessageContent": ".message",
"MessageContentTypedDict": ".message",
"MessageDeveloper": ".message",
"MessageDeveloperTypedDict": ".message",
"MessageTypedDict": ".message",
"Model": ".model",
"ModelTypedDict": ".model",
@@ -1958,6 +1950,20 @@ _dynamic_imports: dict[str, str] = {
"OpenResponsesRequestOnlyTypedDict": ".openresponsesrequest",
"OpenResponsesRequestOrder": ".openresponsesrequest",
"OpenResponsesRequestOrderTypedDict": ".openresponsesrequest",
"OpenResponsesRequestPluginAutoRouter": ".openresponsesrequest",
"OpenResponsesRequestPluginAutoRouterTypedDict": ".openresponsesrequest",
"OpenResponsesRequestPluginFileParser": ".openresponsesrequest",
"OpenResponsesRequestPluginFileParserTypedDict": ".openresponsesrequest",
"OpenResponsesRequestPluginModeration": ".openresponsesrequest",
"OpenResponsesRequestPluginModerationTypedDict": ".openresponsesrequest",
"OpenResponsesRequestPluginResponseHealing": ".openresponsesrequest",
"OpenResponsesRequestPluginResponseHealingTypedDict": ".openresponsesrequest",
"OpenResponsesRequestPluginUnion": ".openresponsesrequest",
"OpenResponsesRequestPluginUnionTypedDict": ".openresponsesrequest",
"OpenResponsesRequestPluginWeb": ".openresponsesrequest",
"OpenResponsesRequestPluginWebTypedDict": ".openresponsesrequest",
"OpenResponsesRequestProvider": ".openresponsesrequest",
"OpenResponsesRequestProviderTypedDict": ".openresponsesrequest",
"OpenResponsesRequestSort": ".openresponsesrequest",
"OpenResponsesRequestSortTypedDict": ".openresponsesrequest",
"OpenResponsesRequestToolFunction": ".openresponsesrequest",
@@ -1966,20 +1972,6 @@ _dynamic_imports: dict[str, str] = {
"OpenResponsesRequestToolUnionTypedDict": ".openresponsesrequest",
"OpenResponsesRequestType": ".openresponsesrequest",
"OpenResponsesRequestTypedDict": ".openresponsesrequest",
"Plugin": ".openresponsesrequest",
"PluginAutoRouter": ".openresponsesrequest",
"PluginAutoRouterTypedDict": ".openresponsesrequest",
"PluginFileParser": ".openresponsesrequest",
"PluginFileParserTypedDict": ".openresponsesrequest",
"PluginModeration": ".openresponsesrequest",
"PluginModerationTypedDict": ".openresponsesrequest",
"PluginResponseHealing": ".openresponsesrequest",
"PluginResponseHealingTypedDict": ".openresponsesrequest",
"PluginTypedDict": ".openresponsesrequest",
"PluginWeb": ".openresponsesrequest",
"PluginWebTypedDict": ".openresponsesrequest",
"Provider": ".openresponsesrequest",
"ProviderTypedDict": ".openresponsesrequest",
"ServiceTier": ".openresponsesrequest",
"Truncation": ".openresponsesrequest",
"OpenResponsesResponseText": ".openresponsesresponsetext",
@@ -8,7 +8,7 @@ from typing import Literal, Union
from typing_extensions import Annotated, TypeAliasType
Schema5Enum = Union[
Schema0Enum = Union[
Literal[
"AI21",
"AionLabs",
@@ -70,7 +70,6 @@ Schema5Enum = Union[
"Seed",
"SiliconFlow",
"Sourceful",
"StepFun",
"Stealth",
"StreamLake",
"Switchpoint",
@@ -87,10 +86,10 @@ Schema5Enum = Union[
]
Schema5TypedDict = TypeAliasType("Schema5TypedDict", Union[Schema5Enum, str])
Schema0TypedDict = TypeAliasType("Schema0TypedDict", Union[Schema0Enum, str])
Schema5 = TypeAliasType(
"Schema5",
Union[Annotated[Schema5Enum, PlainValidator(validate_open_enum(False))], str],
Schema0 = TypeAliasType(
"Schema0",
Union[Annotated[Schema0Enum, PlainValidator(validate_open_enum(False))], str],
)
-39
View File
@@ -1,39 +0,0 @@
"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
from __future__ import annotations
from ._schema14 import Schema14, Schema14TypedDict
from openrouter.types import BaseModel
from typing import Any, Optional, Union
from typing_extensions import NotRequired, TypeAliasType, TypedDict
PromptTypedDict = TypeAliasType("PromptTypedDict", Union[float, str, Any])
Prompt = TypeAliasType("Prompt", Union[float, str, Any])
CompletionTypedDict = TypeAliasType("CompletionTypedDict", Union[float, str, Any])
Completion = TypeAliasType("Completion", Union[float, str, Any])
class Schema10TypedDict(TypedDict):
prompt: NotRequired[PromptTypedDict]
completion: NotRequired[CompletionTypedDict]
image: NotRequired[Schema14TypedDict]
audio: NotRequired[Schema14TypedDict]
request: NotRequired[Schema14TypedDict]
class Schema10(BaseModel):
prompt: Optional[Prompt] = None
completion: Optional[Completion] = None
image: Optional[Schema14] = None
audio: Optional[Schema14] = None
request: Optional[Schema14] = None
-11
View File
@@ -1,11 +0,0 @@
"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
from __future__ import annotations
from typing import Any, Union
from typing_extensions import TypeAliasType
Schema14TypedDict = TypeAliasType("Schema14TypedDict", Union[float, str, Any])
Schema14 = TypeAliasType("Schema14", Union[float, str, Any])
-154
View File
@@ -1,154 +0,0 @@
"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
from __future__ import annotations
from openrouter.types import BaseModel, UnrecognizedStr
from openrouter.utils import get_discriminator, validate_const, validate_open_enum
import pydantic
from pydantic import Discriminator, Tag
from pydantic.functional_validators import AfterValidator, PlainValidator
from typing import List, Literal, Optional, Union
from typing_extensions import Annotated, NotRequired, TypeAliasType, TypedDict
class Schema17ResponseHealingTypedDict(TypedDict):
id: Literal["response-healing"]
enabled: NotRequired[bool]
class Schema17ResponseHealing(BaseModel):
ID: Annotated[
Annotated[
Literal["response-healing"],
AfterValidator(validate_const("response-healing")),
],
pydantic.Field(alias="id"),
] = "response-healing"
enabled: Optional[bool] = None
PdfEngine = Union[
Literal[
"mistral-ocr",
"pdf-text",
"native",
],
UnrecognizedStr,
]
class PdfTypedDict(TypedDict):
engine: NotRequired[PdfEngine]
class Pdf(BaseModel):
engine: Annotated[
Optional[PdfEngine], PlainValidator(validate_open_enum(False))
] = None
class Schema17FileParserTypedDict(TypedDict):
id: Literal["file-parser"]
enabled: NotRequired[bool]
pdf: NotRequired[PdfTypedDict]
class Schema17FileParser(BaseModel):
ID: Annotated[
Annotated[
Literal["file-parser"], AfterValidator(validate_const("file-parser"))
],
pydantic.Field(alias="id"),
] = "file-parser"
enabled: Optional[bool] = None
pdf: Optional[Pdf] = None
Engine = Union[
Literal[
"native",
"exa",
],
UnrecognizedStr,
]
class Schema17WebTypedDict(TypedDict):
id: Literal["web"]
enabled: NotRequired[bool]
max_results: NotRequired[float]
search_prompt: NotRequired[str]
engine: NotRequired[Engine]
class Schema17Web(BaseModel):
ID: Annotated[
Annotated[Literal["web"], AfterValidator(validate_const("web"))],
pydantic.Field(alias="id"),
] = "web"
enabled: Optional[bool] = None
max_results: Optional[float] = None
search_prompt: Optional[str] = None
engine: Annotated[Optional[Engine], PlainValidator(validate_open_enum(False))] = (
None
)
class Schema17ModerationTypedDict(TypedDict):
id: Literal["moderation"]
class Schema17Moderation(BaseModel):
ID: Annotated[
Annotated[Literal["moderation"], AfterValidator(validate_const("moderation"))],
pydantic.Field(alias="id"),
] = "moderation"
class Schema17AutoRouterTypedDict(TypedDict):
id: Literal["auto-router"]
enabled: NotRequired[bool]
allowed_models: NotRequired[List[str]]
class Schema17AutoRouter(BaseModel):
ID: Annotated[
Annotated[
Literal["auto-router"], AfterValidator(validate_const("auto-router"))
],
pydantic.Field(alias="id"),
] = "auto-router"
enabled: Optional[bool] = None
allowed_models: Optional[List[str]] = None
Schema17TypedDict = TypeAliasType(
"Schema17TypedDict",
Union[
Schema17ModerationTypedDict,
Schema17ResponseHealingTypedDict,
Schema17AutoRouterTypedDict,
Schema17FileParserTypedDict,
Schema17WebTypedDict,
],
)
Schema17 = Annotated[
Union[
Annotated[Schema17AutoRouter, Tag("auto-router")],
Annotated[Schema17Moderation, Tag("moderation")],
Annotated[Schema17Web, Tag("web")],
Annotated[Schema17FileParser, Tag("file-parser")],
Annotated[Schema17ResponseHealing, Tag("response-healing")],
],
Discriminator(lambda m: get_discriminator(m, "id", "id")),
]
@@ -17,7 +17,7 @@ from typing import Literal, Optional, Union
from typing_extensions import Annotated, NotRequired, TypeAliasType, TypedDict
Schema21 = Union[
Schema4 = Union[
Literal[
"unknown",
"openai-responses-v1",
@@ -30,16 +30,16 @@ Schema21 = Union[
]
class Schema19ReasoningTextTypedDict(TypedDict):
class Schema2ReasoningTextTypedDict(TypedDict):
type: Literal["reasoning.text"]
text: NotRequired[Nullable[str]]
signature: NotRequired[Nullable[str]]
id: NotRequired[Nullable[str]]
format_: NotRequired[Nullable[Schema21]]
format_: NotRequired[Nullable[Schema4]]
index: NotRequired[float]
class Schema19ReasoningText(BaseModel):
class Schema2ReasoningText(BaseModel):
TYPE: Annotated[
Annotated[
Literal["reasoning.text"], AfterValidator(validate_const("reasoning.text"))
@@ -54,9 +54,7 @@ class Schema19ReasoningText(BaseModel):
id: OptionalNullable[str] = UNSET
format_: Annotated[
Annotated[
OptionalNullable[Schema21], PlainValidator(validate_open_enum(False))
],
Annotated[OptionalNullable[Schema4], PlainValidator(validate_open_enum(False))],
pydantic.Field(alias="format"),
] = UNSET
@@ -93,15 +91,15 @@ class Schema19ReasoningText(BaseModel):
return m
class Schema19ReasoningEncryptedTypedDict(TypedDict):
class Schema2ReasoningEncryptedTypedDict(TypedDict):
data: str
type: Literal["reasoning.encrypted"]
id: NotRequired[Nullable[str]]
format_: NotRequired[Nullable[Schema21]]
format_: NotRequired[Nullable[Schema4]]
index: NotRequired[float]
class Schema19ReasoningEncrypted(BaseModel):
class Schema2ReasoningEncrypted(BaseModel):
data: str
TYPE: Annotated[
@@ -115,9 +113,7 @@ class Schema19ReasoningEncrypted(BaseModel):
id: OptionalNullable[str] = UNSET
format_: Annotated[
Annotated[
OptionalNullable[Schema21], PlainValidator(validate_open_enum(False))
],
Annotated[OptionalNullable[Schema4], PlainValidator(validate_open_enum(False))],
pydantic.Field(alias="format"),
] = UNSET
@@ -154,15 +150,15 @@ class Schema19ReasoningEncrypted(BaseModel):
return m
class Schema19ReasoningSummaryTypedDict(TypedDict):
class Schema2ReasoningSummaryTypedDict(TypedDict):
summary: str
type: Literal["reasoning.summary"]
id: NotRequired[Nullable[str]]
format_: NotRequired[Nullable[Schema21]]
format_: NotRequired[Nullable[Schema4]]
index: NotRequired[float]
class Schema19ReasoningSummary(BaseModel):
class Schema2ReasoningSummary(BaseModel):
summary: str
TYPE: Annotated[
@@ -176,9 +172,7 @@ class Schema19ReasoningSummary(BaseModel):
id: OptionalNullable[str] = UNSET
format_: Annotated[
Annotated[
OptionalNullable[Schema21], PlainValidator(validate_open_enum(False))
],
Annotated[OptionalNullable[Schema4], PlainValidator(validate_open_enum(False))],
pydantic.Field(alias="format"),
] = UNSET
@@ -215,21 +209,21 @@ class Schema19ReasoningSummary(BaseModel):
return m
Schema19TypedDict = TypeAliasType(
"Schema19TypedDict",
Schema2TypedDict = TypeAliasType(
"Schema2TypedDict",
Union[
Schema19ReasoningSummaryTypedDict,
Schema19ReasoningEncryptedTypedDict,
Schema19ReasoningTextTypedDict,
Schema2ReasoningSummaryTypedDict,
Schema2ReasoningEncryptedTypedDict,
Schema2ReasoningTextTypedDict,
],
)
Schema19 = Annotated[
Schema2 = Annotated[
Union[
Annotated[Schema19ReasoningSummary, Tag("reasoning.summary")],
Annotated[Schema19ReasoningEncrypted, Tag("reasoning.encrypted")],
Annotated[Schema19ReasoningText, 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,7 +1,7 @@
"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
from __future__ import annotations
from ._schema19 import Schema19, Schema19TypedDict
from ._schema2 import Schema2, Schema2TypedDict
from .chatmessagecontentitem import (
ChatMessageContentItem,
ChatMessageContentItemTypedDict,
@@ -56,7 +56,7 @@ class AssistantMessageTypedDict(TypedDict):
tool_calls: NotRequired[List[ChatMessageToolCallTypedDict]]
refusal: NotRequired[Nullable[str]]
reasoning: NotRequired[Nullable[str]]
reasoning_details: NotRequired[List[Schema19TypedDict]]
reasoning_details: NotRequired[List[Schema2TypedDict]]
images: NotRequired[List[ImageTypedDict]]
@@ -76,7 +76,7 @@ class AssistantMessage(BaseModel):
reasoning: OptionalNullable[str] = UNSET
reasoning_details: Optional[List[Schema19]] = None
reasoning_details: Optional[List[Schema2]] = None
images: Optional[List[Image]] = None
+316 -34
View File
@@ -1,9 +1,7 @@
"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
from __future__ import annotations
from ._schema10 import Schema10, Schema10TypedDict
from ._schema17 import Schema17, Schema17TypedDict
from ._schema5 import Schema5, Schema5TypedDict
from ._schema0 import Schema0, Schema0TypedDict
from .chatstreamoptions import ChatStreamOptions, ChatStreamOptionsTypedDict
from .message import Message, MessageTypedDict
from .providersortunion import ProviderSortUnion, ProviderSortUnionTypedDict
@@ -33,7 +31,7 @@ from typing import Any, Dict, List, Literal, Optional, Union
from typing_extensions import Annotated, NotRequired, TypeAliasType, TypedDict
Schema3 = Union[
ChatGenerationParamsDataCollection = Union[
Literal[
"deny",
"allow",
@@ -42,7 +40,7 @@ Schema3 = Union[
]
Schema8 = Union[
Quantizations = Union[
Literal[
"int4",
"int8",
@@ -58,14 +56,38 @@ Schema8 = Union[
]
class Schema15TypedDict(TypedDict):
class ChatGenerationParamsMaxPriceTypedDict(TypedDict):
r"""The object specifying the maximum price you want to pay for this request. USD price per million tokens, for prompt and completion."""
prompt: NotRequired[Any]
completion: NotRequired[Any]
image: NotRequired[Any]
audio: NotRequired[Any]
request: NotRequired[Any]
class ChatGenerationParamsMaxPrice(BaseModel):
r"""The object specifying the maximum price you want to pay for this request. USD price per million tokens, for prompt and completion."""
prompt: Optional[Any] = None
completion: Optional[Any] = None
image: Optional[Any] = None
audio: Optional[Any] = None
request: Optional[Any] = None
class ChatGenerationParamsPreferredMinThroughputTypedDict(TypedDict):
p50: NotRequired[Nullable[float]]
p75: NotRequired[Nullable[float]]
p90: NotRequired[Nullable[float]]
p99: NotRequired[Nullable[float]]
class Schema15(BaseModel):
class ChatGenerationParamsPreferredMinThroughput(BaseModel):
p50: OptionalNullable[float] = UNSET
p75: OptionalNullable[float] = UNSET
@@ -105,60 +127,170 @@ class Schema15(BaseModel):
return m
Schema15UnionTypedDict = TypeAliasType(
"Schema15UnionTypedDict", Union[Schema15TypedDict, float]
ChatGenerationParamsPreferredMinThroughputUnionTypedDict = TypeAliasType(
"ChatGenerationParamsPreferredMinThroughputUnionTypedDict",
Union[ChatGenerationParamsPreferredMinThroughputTypedDict, float],
)
Schema15Union = TypeAliasType("Schema15Union", Union[Schema15, float])
ChatGenerationParamsPreferredMinThroughputUnion = TypeAliasType(
"ChatGenerationParamsPreferredMinThroughputUnion",
Union[ChatGenerationParamsPreferredMinThroughput, float],
)
class Schema0TypedDict(TypedDict):
class ChatGenerationParamsPreferredMaxLatencyTypedDict(TypedDict):
p50: NotRequired[Nullable[float]]
p75: NotRequired[Nullable[float]]
p90: NotRequired[Nullable[float]]
p99: NotRequired[Nullable[float]]
class ChatGenerationParamsPreferredMaxLatency(BaseModel):
p50: OptionalNullable[float] = UNSET
p75: OptionalNullable[float] = UNSET
p90: OptionalNullable[float] = UNSET
p99: OptionalNullable[float] = UNSET
@model_serializer(mode="wrap")
def serialize_model(self, handler):
optional_fields = ["p50", "p75", "p90", "p99"]
nullable_fields = ["p50", "p75", "p90", "p99"]
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
ChatGenerationParamsPreferredMaxLatencyUnionTypedDict = TypeAliasType(
"ChatGenerationParamsPreferredMaxLatencyUnionTypedDict",
Union[ChatGenerationParamsPreferredMaxLatencyTypedDict, float],
)
ChatGenerationParamsPreferredMaxLatencyUnion = TypeAliasType(
"ChatGenerationParamsPreferredMaxLatencyUnion",
Union[ChatGenerationParamsPreferredMaxLatency, float],
)
class ChatGenerationParamsProviderTypedDict(TypedDict):
allow_fallbacks: NotRequired[Nullable[bool]]
r"""Whether to allow backup providers to serve requests
- true: (default) when the primary provider (or your custom providers in \"order\") is unavailable, use the next best provider.
- false: use only the primary/custom provider, and return the upstream error if it's unavailable.
"""
require_parameters: NotRequired[Nullable[bool]]
data_collection: NotRequired[Nullable[Schema3]]
r"""Whether to filter providers to only those that support the parameters you've provided. If this setting is omitted or set to false, then providers will receive only the parameters they support, and ignore the rest."""
data_collection: NotRequired[Nullable[ChatGenerationParamsDataCollection]]
r"""Data collection setting. If no available model provider meets the requirement, your request will return an error.
- allow: (default) allow providers which store user data non-transiently and may train on it
- deny: use only providers which do not collect user data.
"""
zdr: NotRequired[Nullable[bool]]
enforce_distillable_text: NotRequired[Nullable[bool]]
order: NotRequired[Nullable[List[Schema5TypedDict]]]
only: NotRequired[Nullable[List[Schema5TypedDict]]]
ignore: NotRequired[Nullable[List[Schema5TypedDict]]]
quantizations: NotRequired[Nullable[List[Schema8]]]
order: NotRequired[Nullable[List[Schema0TypedDict]]]
r"""An ordered list of provider slugs. The router will attempt to use the first provider in the subset of this list that supports your requested model, and fall back to the next if it is unavailable. If no providers are available, the request will fail with an error message."""
only: NotRequired[Nullable[List[Schema0TypedDict]]]
r"""List of provider slugs to allow. If provided, this list is merged with your account-wide allowed provider settings for this request."""
ignore: NotRequired[Nullable[List[Schema0TypedDict]]]
r"""List of provider slugs to ignore. If provided, this list is merged with your account-wide ignored provider settings for this request."""
quantizations: NotRequired[Nullable[List[Quantizations]]]
r"""A list of quantization levels to filter the provider by."""
sort: NotRequired[Nullable[ProviderSortUnionTypedDict]]
max_price: NotRequired[Schema10TypedDict]
preferred_min_throughput: NotRequired[Nullable[Schema15UnionTypedDict]]
preferred_max_latency: NotRequired[Nullable[Schema15UnionTypedDict]]
r"""The sorting strategy to use for this request, if \"order\" is not specified. When set, no load balancing is performed."""
max_price: NotRequired[ChatGenerationParamsMaxPriceTypedDict]
r"""The object specifying the maximum price you want to pay for this request. USD price per million tokens, for prompt and completion."""
preferred_min_throughput: NotRequired[
Nullable[ChatGenerationParamsPreferredMinThroughputUnionTypedDict]
]
r"""Preferred minimum throughput (in tokens per second). Can be a number (applies to p50) or an object with percentile-specific cutoffs. Endpoints below the threshold(s) may still be used, but are deprioritized in routing. When using fallback models, this may cause a fallback model to be used instead of the primary model if it meets the threshold."""
preferred_max_latency: NotRequired[
Nullable[ChatGenerationParamsPreferredMaxLatencyUnionTypedDict]
]
r"""Preferred maximum latency (in seconds). Can be a number (applies to p50) or an object with percentile-specific cutoffs. Endpoints above the threshold(s) may still be used, but are deprioritized in routing. When using fallback models, this may cause a fallback model to be used instead of the primary model if it meets the threshold."""
class Schema0(BaseModel):
class ChatGenerationParamsProvider(BaseModel):
allow_fallbacks: OptionalNullable[bool] = UNSET
r"""Whether to allow backup providers to serve requests
- true: (default) when the primary provider (or your custom providers in \"order\") is unavailable, use the next best provider.
- false: use only the primary/custom provider, and return the upstream error if it's unavailable.
"""
require_parameters: OptionalNullable[bool] = UNSET
r"""Whether to filter providers to only those that support the parameters you've provided. If this setting is omitted or set to false, then providers will receive only the parameters they support, and ignore the rest."""
data_collection: Annotated[
OptionalNullable[Schema3], PlainValidator(validate_open_enum(False))
OptionalNullable[ChatGenerationParamsDataCollection],
PlainValidator(validate_open_enum(False)),
] = UNSET
r"""Data collection setting. If no available model provider meets the requirement, your request will return an error.
- allow: (default) allow providers which store user data non-transiently and may train on it
- deny: use only providers which do not collect user data.
"""
zdr: OptionalNullable[bool] = UNSET
enforce_distillable_text: OptionalNullable[bool] = UNSET
order: OptionalNullable[List[Schema5]] = UNSET
order: OptionalNullable[List[Schema0]] = UNSET
r"""An ordered list of provider slugs. The router will attempt to use the first provider in the subset of this list that supports your requested model, and fall back to the next if it is unavailable. If no providers are available, the request will fail with an error message."""
only: OptionalNullable[List[Schema5]] = UNSET
only: OptionalNullable[List[Schema0]] = UNSET
r"""List of provider slugs to allow. If provided, this list is merged with your account-wide allowed provider settings for this request."""
ignore: OptionalNullable[List[Schema5]] = UNSET
ignore: OptionalNullable[List[Schema0]] = UNSET
r"""List of provider slugs to ignore. If provided, this list is merged with your account-wide ignored provider settings for this request."""
quantizations: OptionalNullable[
List[Annotated[Schema8, PlainValidator(validate_open_enum(False))]]
List[Annotated[Quantizations, PlainValidator(validate_open_enum(False))]]
] = UNSET
r"""A list of quantization levels to filter the provider by."""
sort: OptionalNullable[ProviderSortUnion] = UNSET
r"""The sorting strategy to use for this request, if \"order\" is not specified. When set, no load balancing is performed."""
max_price: Optional[Schema10] = None
max_price: Optional[ChatGenerationParamsMaxPrice] = None
r"""The object specifying the maximum price you want to pay for this request. USD price per million tokens, for prompt and completion."""
preferred_min_throughput: OptionalNullable[Schema15Union] = UNSET
preferred_min_throughput: OptionalNullable[
ChatGenerationParamsPreferredMinThroughputUnion
] = UNSET
r"""Preferred minimum throughput (in tokens per second). Can be a number (applies to p50) or an object with percentile-specific cutoffs. Endpoints below the threshold(s) may still be used, but are deprioritized in routing. When using fallback models, this may cause a fallback model to be used instead of the primary model if it meets the threshold."""
preferred_max_latency: OptionalNullable[Schema15Union] = UNSET
preferred_max_latency: OptionalNullable[
ChatGenerationParamsPreferredMaxLatencyUnion
] = UNSET
r"""Preferred maximum latency (in seconds). Can be a number (applies to p50) or an object with percentile-specific cutoffs. Endpoints above the threshold(s) may still be used, but are deprioritized in routing. When using fallback models, this may cause a fallback model to be used instead of the primary model if it meets the threshold."""
@model_serializer(mode="wrap")
def serialize_model(self, handler):
@@ -218,6 +350,150 @@ class Schema0(BaseModel):
return m
class ChatGenerationParamsPluginResponseHealingTypedDict(TypedDict):
id: Literal["response-healing"]
enabled: NotRequired[bool]
class ChatGenerationParamsPluginResponseHealing(BaseModel):
ID: Annotated[
Annotated[
Literal["response-healing"],
AfterValidator(validate_const("response-healing")),
],
pydantic.Field(alias="id"),
] = "response-healing"
enabled: Optional[bool] = None
PdfEngine = Union[
Literal[
"mistral-ocr",
"pdf-text",
"native",
],
UnrecognizedStr,
]
class PdfTypedDict(TypedDict):
engine: NotRequired[PdfEngine]
class Pdf(BaseModel):
engine: Annotated[
Optional[PdfEngine], PlainValidator(validate_open_enum(False))
] = None
class ChatGenerationParamsPluginFileParserTypedDict(TypedDict):
id: Literal["file-parser"]
enabled: NotRequired[bool]
pdf: NotRequired[PdfTypedDict]
class ChatGenerationParamsPluginFileParser(BaseModel):
ID: Annotated[
Annotated[
Literal["file-parser"], AfterValidator(validate_const("file-parser"))
],
pydantic.Field(alias="id"),
] = "file-parser"
enabled: Optional[bool] = None
pdf: Optional[Pdf] = None
Engine = Union[
Literal[
"native",
"exa",
],
UnrecognizedStr,
]
class ChatGenerationParamsPluginWebTypedDict(TypedDict):
id: Literal["web"]
enabled: NotRequired[bool]
max_results: NotRequired[float]
search_prompt: NotRequired[str]
engine: NotRequired[Engine]
class ChatGenerationParamsPluginWeb(BaseModel):
ID: Annotated[
Annotated[Literal["web"], AfterValidator(validate_const("web"))],
pydantic.Field(alias="id"),
] = "web"
enabled: Optional[bool] = None
max_results: Optional[float] = None
search_prompt: Optional[str] = None
engine: Annotated[Optional[Engine], PlainValidator(validate_open_enum(False))] = (
None
)
class ChatGenerationParamsPluginModerationTypedDict(TypedDict):
id: Literal["moderation"]
class ChatGenerationParamsPluginModeration(BaseModel):
ID: Annotated[
Annotated[Literal["moderation"], AfterValidator(validate_const("moderation"))],
pydantic.Field(alias="id"),
] = "moderation"
class ChatGenerationParamsPluginAutoRouterTypedDict(TypedDict):
id: Literal["auto-router"]
enabled: NotRequired[bool]
allowed_models: NotRequired[List[str]]
class ChatGenerationParamsPluginAutoRouter(BaseModel):
ID: Annotated[
Annotated[
Literal["auto-router"], AfterValidator(validate_const("auto-router"))
],
pydantic.Field(alias="id"),
] = "auto-router"
enabled: Optional[bool] = None
allowed_models: Optional[List[str]] = None
ChatGenerationParamsPluginUnionTypedDict = TypeAliasType(
"ChatGenerationParamsPluginUnionTypedDict",
Union[
ChatGenerationParamsPluginModerationTypedDict,
ChatGenerationParamsPluginResponseHealingTypedDict,
ChatGenerationParamsPluginAutoRouterTypedDict,
ChatGenerationParamsPluginFileParserTypedDict,
ChatGenerationParamsPluginWebTypedDict,
],
)
ChatGenerationParamsPluginUnion = Annotated[
Union[
Annotated[ChatGenerationParamsPluginAutoRouter, Tag("auto-router")],
Annotated[ChatGenerationParamsPluginModeration, Tag("moderation")],
Annotated[ChatGenerationParamsPluginWeb, Tag("web")],
Annotated[ChatGenerationParamsPluginFileParser, Tag("file-parser")],
Annotated[ChatGenerationParamsPluginResponseHealing, Tag("response-healing")],
],
Discriminator(lambda m: get_discriminator(m, "id", "id")),
]
Route = Union[
Literal[
"fallback",
@@ -360,12 +636,12 @@ class Debug(BaseModel):
ChatGenerationParamsImageConfigTypedDict = TypeAliasType(
"ChatGenerationParamsImageConfigTypedDict", Union[str, float, List[Any]]
"ChatGenerationParamsImageConfigTypedDict", Union[str, float]
)
ChatGenerationParamsImageConfig = TypeAliasType(
"ChatGenerationParamsImageConfig", Union[str, float, List[Any]]
"ChatGenerationParamsImageConfig", Union[str, float]
)
@@ -380,11 +656,14 @@ Modality = Union[
class ChatGenerationParamsTypedDict(TypedDict):
messages: List[MessageTypedDict]
provider: NotRequired[Nullable[Schema0TypedDict]]
plugins: NotRequired[List[Schema17TypedDict]]
provider: NotRequired[Nullable[ChatGenerationParamsProviderTypedDict]]
r"""When multiple model providers are available, optionally indicate your routing preference."""
plugins: NotRequired[List[ChatGenerationParamsPluginUnionTypedDict]]
r"""Plugins you want to enable for this request, including their settings."""
route: NotRequired[Nullable[Route]]
user: NotRequired[str]
session_id: NotRequired[str]
r"""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."""
model: NotRequired[str]
models: NotRequired[List[str]]
frequency_penalty: NotRequired[Nullable[float]]
@@ -413,9 +692,11 @@ class ChatGenerationParamsTypedDict(TypedDict):
class ChatGenerationParams(BaseModel):
messages: List[Message]
provider: OptionalNullable[Schema0] = UNSET
provider: OptionalNullable[ChatGenerationParamsProvider] = UNSET
r"""When multiple model providers are available, optionally indicate your routing preference."""
plugins: Optional[List[Schema17]] = None
plugins: Optional[List[ChatGenerationParamsPluginUnion]] = None
r"""Plugins you want to enable for this request, including their settings."""
route: Annotated[
OptionalNullable[Route], PlainValidator(validate_open_enum(False))
@@ -424,6 +705,7 @@ class ChatGenerationParams(BaseModel):
user: Optional[str] = None
session_id: Optional[str] = None
r"""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."""
model: Optional[str] = None
@@ -1,7 +1,7 @@
"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
from __future__ import annotations
from ._schema19 import Schema19, Schema19TypedDict
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[Schema19TypedDict]]
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[Schema19]] = None
reasoning_details: Optional[List[Schema2]] = None
@model_serializer(mode="wrap")
def serialize_model(self, handler):
@@ -1,41 +0,0 @@
"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
from __future__ import annotations
from .chatmessagecontentitemtext import (
ChatMessageContentItemText,
ChatMessageContentItemTextTypedDict,
)
from openrouter.types import BaseModel
from openrouter.utils import validate_const
import pydantic
from pydantic.functional_validators import AfterValidator
from typing import List, Literal, Optional, Union
from typing_extensions import Annotated, NotRequired, TypeAliasType, TypedDict
DeveloperMessageContentTypedDict = TypeAliasType(
"DeveloperMessageContentTypedDict",
Union[str, List[ChatMessageContentItemTextTypedDict]],
)
DeveloperMessageContent = TypeAliasType(
"DeveloperMessageContent", Union[str, List[ChatMessageContentItemText]]
)
class DeveloperMessageTypedDict(TypedDict):
content: DeveloperMessageContentTypedDict
role: Literal["developer"]
name: NotRequired[str]
class DeveloperMessage(BaseModel):
content: DeveloperMessageContent
ROLE: Annotated[
Annotated[Literal["developer"], AfterValidator(validate_const("developer"))],
pydantic.Field(alias="role"),
] = "developer"
name: Optional[str] = None
+39 -6
View File
@@ -2,14 +2,47 @@
from __future__ import annotations
from .assistantmessage import AssistantMessage, AssistantMessageTypedDict
from .developermessage import DeveloperMessage, DeveloperMessageTypedDict
from .chatmessagecontentitemtext import (
ChatMessageContentItemText,
ChatMessageContentItemTextTypedDict,
)
from .systemmessage import SystemMessage, SystemMessageTypedDict
from .toolresponsemessage import ToolResponseMessage, ToolResponseMessageTypedDict
from .usermessage import UserMessage, UserMessageTypedDict
from openrouter.utils import get_discriminator
from openrouter.types import BaseModel
from openrouter.utils import get_discriminator, validate_const
import pydantic
from pydantic import Discriminator, Tag
from typing import Union
from typing_extensions import Annotated, TypeAliasType
from pydantic.functional_validators import AfterValidator
from typing import List, Literal, Optional, Union
from typing_extensions import Annotated, NotRequired, TypeAliasType, TypedDict
MessageContentTypedDict = TypeAliasType(
"MessageContentTypedDict", Union[str, List[ChatMessageContentItemTextTypedDict]]
)
MessageContent = TypeAliasType(
"MessageContent", Union[str, List[ChatMessageContentItemText]]
)
class MessageDeveloperTypedDict(TypedDict):
content: MessageContentTypedDict
role: Literal["developer"]
name: NotRequired[str]
class MessageDeveloper(BaseModel):
content: MessageContent
ROLE: Annotated[
Annotated[Literal["developer"], AfterValidator(validate_const("developer"))],
pydantic.Field(alias="role"),
] = "developer"
name: Optional[str] = None
MessageTypedDict = TypeAliasType(
@@ -17,7 +50,7 @@ MessageTypedDict = TypeAliasType(
Union[
SystemMessageTypedDict,
UserMessageTypedDict,
DeveloperMessageTypedDict,
MessageDeveloperTypedDict,
ToolResponseMessageTypedDict,
AssistantMessageTypedDict,
],
@@ -28,7 +61,7 @@ Message = Annotated[
Union[
Annotated[SystemMessage, Tag("system")],
Annotated[UserMessage, Tag("user")],
Annotated[DeveloperMessage, Tag("developer")],
Annotated[MessageDeveloper, Tag("developer")],
Annotated[AssistantMessage, Tag("assistant")],
Annotated[ToolResponseMessage, Tag("tool")],
],
@@ -222,29 +222,37 @@ class OpenResponsesRequestMaxPriceTypedDict(TypedDict):
r"""The object specifying the maximum price you want to pay for this request. USD price per million tokens, for prompt and completion."""
prompt: NotRequired[str]
r"""Price per million prompt tokens"""
r"""A value in string format that is a large number"""
completion: NotRequired[str]
r"""A value in string format that is a large number"""
image: NotRequired[str]
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"""
request: NotRequired[str]
r"""A value in string format that is a large number"""
class OpenResponsesRequestMaxPrice(BaseModel):
r"""The object specifying the maximum price you want to pay for this request. USD price per million tokens, for prompt and completion."""
prompt: Optional[str] = None
r"""Price per million prompt tokens"""
r"""A value in string format that is a large number"""
completion: Optional[str] = None
r"""A value in string format that is a large number"""
image: Optional[str] = None
r"""A value in string format that is a large number"""
audio: Optional[str] = None
r"""A value in string format that is a large number"""
request: Optional[str] = None
r"""A value in string format that is a large number"""
class ProviderTypedDict(TypedDict):
class OpenResponsesRequestProviderTypedDict(TypedDict):
r"""When multiple model providers are available, optionally indicate your routing preference."""
allow_fallbacks: NotRequired[Nullable[bool]]
@@ -283,7 +291,7 @@ class ProviderTypedDict(TypedDict):
r"""Preferred maximum latency (in seconds). Can be a number (applies to p50) or an object with percentile-specific cutoffs. Endpoints above the threshold(s) may still be used, but are deprioritized in routing. When using fallback models, this may cause a fallback model to be used instead of the primary model if it meets the threshold."""
class Provider(BaseModel):
class OpenResponsesRequestProvider(BaseModel):
r"""When multiple model providers are available, optionally indicate your routing preference."""
allow_fallbacks: OptionalNullable[bool] = UNSET
@@ -398,13 +406,13 @@ class Provider(BaseModel):
IDResponseHealing = Literal["response-healing",]
class PluginResponseHealingTypedDict(TypedDict):
class OpenResponsesRequestPluginResponseHealingTypedDict(TypedDict):
id: IDResponseHealing
enabled: NotRequired[bool]
r"""Set to false to disable the response-healing plugin for this request. Defaults to true."""
class PluginResponseHealing(BaseModel):
class OpenResponsesRequestPluginResponseHealing(BaseModel):
id: IDResponseHealing
enabled: Optional[bool] = None
@@ -414,7 +422,7 @@ class PluginResponseHealing(BaseModel):
IDFileParser = Literal["file-parser",]
class PluginFileParserTypedDict(TypedDict):
class OpenResponsesRequestPluginFileParserTypedDict(TypedDict):
id: IDFileParser
enabled: NotRequired[bool]
r"""Set to false to disable the file-parser plugin for this request. Defaults to true."""
@@ -422,7 +430,7 @@ class PluginFileParserTypedDict(TypedDict):
r"""Options for PDF parsing."""
class PluginFileParser(BaseModel):
class OpenResponsesRequestPluginFileParser(BaseModel):
id: IDFileParser
enabled: Optional[bool] = None
@@ -435,7 +443,7 @@ class PluginFileParser(BaseModel):
IDWeb = Literal["web",]
class PluginWebTypedDict(TypedDict):
class OpenResponsesRequestPluginWebTypedDict(TypedDict):
id: IDWeb
enabled: NotRequired[bool]
r"""Set to false to disable the web-search plugin for this request. Defaults to true."""
@@ -445,7 +453,7 @@ class PluginWebTypedDict(TypedDict):
r"""The search engine to use for web search."""
class PluginWeb(BaseModel):
class OpenResponsesRequestPluginWeb(BaseModel):
id: IDWeb
enabled: Optional[bool] = None
@@ -464,18 +472,18 @@ class PluginWeb(BaseModel):
IDModeration = Literal["moderation",]
class PluginModerationTypedDict(TypedDict):
class OpenResponsesRequestPluginModerationTypedDict(TypedDict):
id: IDModeration
class PluginModeration(BaseModel):
class OpenResponsesRequestPluginModeration(BaseModel):
id: IDModeration
IDAutoRouter = Literal["auto-router",]
class PluginAutoRouterTypedDict(TypedDict):
class OpenResponsesRequestPluginAutoRouterTypedDict(TypedDict):
id: IDAutoRouter
enabled: NotRequired[bool]
r"""Set to false to disable the auto-router plugin for this request. Defaults to true."""
@@ -483,7 +491,7 @@ class PluginAutoRouterTypedDict(TypedDict):
r"""List of model patterns to filter which models the auto-router can route between. Supports wildcards (e.g., \"anthropic/*\" matches all Anthropic models). When not specified, uses the default supported models list."""
class PluginAutoRouter(BaseModel):
class OpenResponsesRequestPluginAutoRouter(BaseModel):
id: IDAutoRouter
enabled: Optional[bool] = None
@@ -493,25 +501,25 @@ class PluginAutoRouter(BaseModel):
r"""List of model patterns to filter which models the auto-router can route between. Supports wildcards (e.g., \"anthropic/*\" matches all Anthropic models). When not specified, uses the default supported models list."""
PluginTypedDict = TypeAliasType(
"PluginTypedDict",
OpenResponsesRequestPluginUnionTypedDict = TypeAliasType(
"OpenResponsesRequestPluginUnionTypedDict",
Union[
PluginModerationTypedDict,
PluginResponseHealingTypedDict,
PluginAutoRouterTypedDict,
PluginFileParserTypedDict,
PluginWebTypedDict,
OpenResponsesRequestPluginModerationTypedDict,
OpenResponsesRequestPluginResponseHealingTypedDict,
OpenResponsesRequestPluginAutoRouterTypedDict,
OpenResponsesRequestPluginFileParserTypedDict,
OpenResponsesRequestPluginWebTypedDict,
],
)
Plugin = Annotated[
OpenResponsesRequestPluginUnion = Annotated[
Union[
Annotated[PluginAutoRouter, Tag("auto-router")],
Annotated[PluginModeration, Tag("moderation")],
Annotated[PluginWeb, Tag("web")],
Annotated[PluginFileParser, Tag("file-parser")],
Annotated[PluginResponseHealing, Tag("response-healing")],
Annotated[OpenResponsesRequestPluginAutoRouter, Tag("auto-router")],
Annotated[OpenResponsesRequestPluginModeration, Tag("moderation")],
Annotated[OpenResponsesRequestPluginWeb, Tag("web")],
Annotated[OpenResponsesRequestPluginFileParser, Tag("file-parser")],
Annotated[OpenResponsesRequestPluginResponseHealing, Tag("response-healing")],
],
Discriminator(lambda m: get_discriminator(m, "id", "id")),
]
@@ -556,9 +564,9 @@ class OpenResponsesRequestTypedDict(TypedDict):
service_tier: NotRequired[ServiceTier]
truncation: NotRequired[Nullable[Truncation]]
stream: NotRequired[bool]
provider: NotRequired[Nullable[ProviderTypedDict]]
provider: NotRequired[Nullable[OpenResponsesRequestProviderTypedDict]]
r"""When multiple model providers are available, optionally indicate your routing preference."""
plugins: NotRequired[List[PluginTypedDict]]
plugins: NotRequired[List[OpenResponsesRequestPluginUnionTypedDict]]
r"""Plugins you want to enable for this request, including their settings."""
user: NotRequired[str]
r"""A unique identifier representing your end-user, which helps distinguish between different users of your app. This allows your app to identify specific users in case of abuse reports, preventing your entire app from being affected by the actions of individual users. Maximum of 128 characters."""
@@ -652,10 +660,10 @@ class OpenResponsesRequest(BaseModel):
stream: Optional[bool] = False
provider: OptionalNullable[Provider] = UNSET
provider: OptionalNullable[OpenResponsesRequestProvider] = UNSET
r"""When multiple model providers are available, optionally indicate your routing preference."""
plugins: Optional[List[Plugin]] = None
plugins: Optional[List[OpenResponsesRequestPluginUnion]] = None
r"""Plugins you want to enable for this request, including their settings."""
user: Optional[str] = None
@@ -67,7 +67,6 @@ ProviderName = Union[
"Seed",
"SiliconFlow",
"Sourceful",
"StepFun",
"Stealth",
"StreamLake",
"Switchpoint",
@@ -176,26 +176,34 @@ class ProviderPreferencesMaxPriceTypedDict(TypedDict):
r"""The object specifying the maximum price you want to pay for this request. USD price per million tokens, for prompt and completion."""
prompt: NotRequired[str]
r"""Price per million prompt tokens"""
r"""A value in string format that is a large number"""
completion: NotRequired[str]
r"""A value in string format that is a large number"""
image: NotRequired[str]
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"""
request: NotRequired[str]
r"""A value in string format that is a large number"""
class ProviderPreferencesMaxPrice(BaseModel):
r"""The object specifying the maximum price you want to pay for this request. USD price per million tokens, for prompt and completion."""
prompt: Optional[str] = None
r"""Price per million prompt tokens"""
r"""A value in string format that is a large number"""
completion: Optional[str] = None
r"""A value in string format that is a large number"""
image: Optional[str] = None
r"""A value in string format that is a large number"""
audio: Optional[str] = None
r"""A value in string format that is a large number"""
request: Optional[str] = None
r"""A value in string format that is a large number"""
class ProviderPreferencesTypedDict(TypedDict):
@@ -15,47 +15,73 @@ from typing_extensions import Annotated, NotRequired, TypedDict
class PricingTypedDict(TypedDict):
prompt: str
r"""A value in string format that is a large number"""
completion: str
r"""A value in string format that is a large number"""
request: NotRequired[str]
r"""A value in string format that is a large number"""
image: NotRequired[str]
r"""A value in string format that is a large number"""
image_token: NotRequired[str]
r"""A value in string format that is a large number"""
image_output: NotRequired[str]
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]
r"""A value in string format that is a large number"""
internal_reasoning: NotRequired[str]
r"""A value in string format that is a large number"""
input_cache_read: NotRequired[str]
r"""A value in string format that is a large number"""
input_cache_write: NotRequired[str]
r"""A value in string format that is a large number"""
discount: NotRequired[float]
class Pricing(BaseModel):
prompt: str
r"""A value in string format that is a large number"""
completion: str
r"""A value in string format that is a large number"""
request: Optional[str] = None
r"""A value in string format that is a large number"""
image: Optional[str] = None
r"""A value in string format that is a large number"""
image_token: Optional[str] = None
r"""A value in string format that is a large number"""
image_output: Optional[str] = None
r"""A value in string format that is a large number"""
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"""
web_search: Optional[str] = None
r"""A value in string format that is a large number"""
internal_reasoning: Optional[str] = None
r"""A value in string format that is a large number"""
input_cache_read: Optional[str] = None
r"""A value in string format that is a large number"""
input_cache_write: Optional[str] = None
r"""A value in string format that is a large number"""
discount: Optional[float] = None
@@ -10,18 +10,31 @@ class PublicPricingTypedDict(TypedDict):
r"""Pricing information for the model"""
prompt: str
r"""A value in string format that is a large number"""
completion: str
r"""A value in string format that is a large number"""
request: NotRequired[str]
r"""A value in string format that is a large number"""
image: NotRequired[str]
r"""A value in string format that is a large number"""
image_token: NotRequired[str]
r"""A value in string format that is a large number"""
image_output: NotRequired[str]
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]
r"""A value in string format that is a large number"""
internal_reasoning: NotRequired[str]
r"""A value in string format that is a large number"""
input_cache_read: NotRequired[str]
r"""A value in string format that is a large number"""
input_cache_write: NotRequired[str]
r"""A value in string format that is a large number"""
discount: NotRequired[float]
@@ -29,29 +42,42 @@ class PublicPricing(BaseModel):
r"""Pricing information for the model"""
prompt: str
r"""A value in string format that is a large number"""
completion: str
r"""A value in string format that is a large number"""
request: Optional[str] = None
r"""A value in string format that is a large number"""
image: Optional[str] = None
r"""A value in string format that is a large number"""
image_token: Optional[str] = None
r"""A value in string format that is a large number"""
image_output: Optional[str] = None
r"""A value in string format that is a large number"""
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"""
web_search: Optional[str] = None
r"""A value in string format that is a large number"""
internal_reasoning: Optional[str] = None
r"""A value in string format that is a large number"""
input_cache_read: Optional[str] = None
r"""A value in string format that is a large number"""
input_cache_write: Optional[str] = None
r"""A value in string format that is a large number"""
discount: Optional[float] = None
@@ -119,7 +119,6 @@ ProviderName = Union[
"Seed",
"SiliconFlow",
"Sourceful",
"StepFun",
"Stealth",
"StreamLake",
"Switchpoint",
+52 -16
View File
@@ -84,10 +84,16 @@ class Responses(BaseSDK):
truncation: OptionalNullable[components.Truncation] = UNSET,
stream: Union[Literal[False], None] = None,
provider: OptionalNullable[
Union[components.Provider, components.ProviderTypedDict]
Union[
components.OpenResponsesRequestProvider,
components.OpenResponsesRequestProviderTypedDict,
]
] = UNSET,
plugins: Optional[
Union[List[components.Plugin], List[components.PluginTypedDict]]
Union[
List[components.OpenResponsesRequestPluginUnion],
List[components.OpenResponsesRequestPluginUnionTypedDict],
]
] = None,
user: Optional[str] = None,
session_id: Optional[str] = None,
@@ -206,10 +212,16 @@ class Responses(BaseSDK):
truncation: OptionalNullable[components.Truncation] = UNSET,
stream: Literal[True],
provider: OptionalNullable[
Union[components.Provider, components.ProviderTypedDict]
Union[
components.OpenResponsesRequestProvider,
components.OpenResponsesRequestProviderTypedDict,
]
] = UNSET,
plugins: Optional[
Union[List[components.Plugin], List[components.PluginTypedDict]]
Union[
List[components.OpenResponsesRequestPluginUnion],
List[components.OpenResponsesRequestPluginUnionTypedDict],
]
] = None,
user: Optional[str] = None,
session_id: Optional[str] = None,
@@ -327,10 +339,16 @@ class Responses(BaseSDK):
truncation: OptionalNullable[components.Truncation] = UNSET,
stream: Optional[bool] = False,
provider: OptionalNullable[
Union[components.Provider, components.ProviderTypedDict]
Union[
components.OpenResponsesRequestProvider,
components.OpenResponsesRequestProviderTypedDict,
]
] = UNSET,
plugins: Optional[
Union[List[components.Plugin], List[components.PluginTypedDict]]
Union[
List[components.OpenResponsesRequestPluginUnion],
List[components.OpenResponsesRequestPluginUnionTypedDict],
]
] = None,
user: Optional[str] = None,
session_id: Optional[str] = None,
@@ -435,10 +453,10 @@ class Responses(BaseSDK):
truncation=truncation,
stream=stream,
provider=utils.get_pydantic_model(
provider, OptionalNullable[components.Provider]
provider, OptionalNullable[components.OpenResponsesRequestProvider]
),
plugins=utils.get_pydantic_model(
plugins, Optional[List[components.Plugin]]
plugins, Optional[List[components.OpenResponsesRequestPluginUnion]]
),
user=user,
session_id=session_id,
@@ -699,10 +717,16 @@ class Responses(BaseSDK):
truncation: OptionalNullable[components.Truncation] = UNSET,
stream: Union[Literal[False], None] = None,
provider: OptionalNullable[
Union[components.Provider, components.ProviderTypedDict]
Union[
components.OpenResponsesRequestProvider,
components.OpenResponsesRequestProviderTypedDict,
]
] = UNSET,
plugins: Optional[
Union[List[components.Plugin], List[components.PluginTypedDict]]
Union[
List[components.OpenResponsesRequestPluginUnion],
List[components.OpenResponsesRequestPluginUnionTypedDict],
]
] = None,
user: Optional[str] = None,
session_id: Optional[str] = None,
@@ -821,10 +845,16 @@ class Responses(BaseSDK):
truncation: OptionalNullable[components.Truncation] = UNSET,
stream: Literal[True],
provider: OptionalNullable[
Union[components.Provider, components.ProviderTypedDict]
Union[
components.OpenResponsesRequestProvider,
components.OpenResponsesRequestProviderTypedDict,
]
] = UNSET,
plugins: Optional[
Union[List[components.Plugin], List[components.PluginTypedDict]]
Union[
List[components.OpenResponsesRequestPluginUnion],
List[components.OpenResponsesRequestPluginUnionTypedDict],
]
] = None,
user: Optional[str] = None,
session_id: Optional[str] = None,
@@ -942,10 +972,16 @@ class Responses(BaseSDK):
truncation: OptionalNullable[components.Truncation] = UNSET,
stream: Optional[bool] = False,
provider: OptionalNullable[
Union[components.Provider, components.ProviderTypedDict]
Union[
components.OpenResponsesRequestProvider,
components.OpenResponsesRequestProviderTypedDict,
]
] = UNSET,
plugins: Optional[
Union[List[components.Plugin], List[components.PluginTypedDict]]
Union[
List[components.OpenResponsesRequestPluginUnion],
List[components.OpenResponsesRequestPluginUnionTypedDict],
]
] = None,
user: Optional[str] = None,
session_id: Optional[str] = None,
@@ -1050,10 +1086,10 @@ class Responses(BaseSDK):
truncation=truncation,
stream=stream,
provider=utils.get_pydantic_model(
provider, OptionalNullable[components.Provider]
provider, OptionalNullable[components.OpenResponsesRequestProvider]
),
plugins=utils.get_pydantic_model(
plugins, Optional[List[components.Plugin]]
plugins, Optional[List[components.OpenResponsesRequestPluginUnion]]
),
user=user,
session_id=session_id,