Compare commits

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

GitOrigin-RevId: e6299b4ebfe5c2eed6c598771f0fd99f84555401
2026-02-05 17:57:55 +00:00
83 changed files with 1892 additions and 1820 deletions
+39 -34
View File
@@ -1,12 +1,12 @@
lockVersion: 2.0.0
id: cfd52247-6a25-4c6d-bbce-fe6fce0cd69d
management:
docChecksum: b46bf86766cf18470329da1fb2271f4e
docChecksum: 52c044061097671980a3ac37a4839b7f
docVersion: 1.0.0
speakeasyVersion: 1.666.0
generationVersion: 2.768.0
releaseVersion: 0.3.2
configChecksum: 684039465cd4c6f0105466ef2833908d
releaseVersion: 0.5.0
configChecksum: 4bcc2dd9900ba2408612f6fa04918561
repoURL: https://github.com/OpenRouterTeam/python-sdk.git
installationURL: https://github.com/OpenRouterTeam/python-sdk.git
published: true
@@ -60,20 +60,7 @@ 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
@@ -104,12 +91,15 @@ 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
@@ -134,8 +124,6 @@ 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
@@ -257,13 +245,6 @@ 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
@@ -326,10 +307,18 @@ 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
@@ -350,7 +339,6 @@ 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
@@ -425,12 +413,25 @@ generatedFiles:
- docs/components/responsetextconfigverbosity.md
- docs/components/route.md
- docs/components/schema0.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/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/security.md
- docs/components/servicetier.md
- docs/components/serviceunavailableresponseerrordata.md
@@ -640,8 +641,11 @@ generatedFiles:
- src/openrouter/beta.py
- src/openrouter/chat.py
- src/openrouter/components/__init__.py
- src/openrouter/components/_schema0.py
- src/openrouter/components/_schema2.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/activityitem.py
- src/openrouter/components/assistantmessage.py
- src/openrouter/components/badgatewayresponseerrordata.py
@@ -669,6 +673,7 @@ 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.3.2
version: 0.5.0
additionalDependencies:
dev: {}
main: {}
+423 -317
View File
@@ -3599,6 +3599,7 @@ components:
- Seed
- SiliconFlow
- Sourceful
- StepFun
- Stealth
- StreamLake
- Switchpoint
@@ -3646,7 +3647,7 @@ components:
- type: 'null'
BigNumberUnion:
type: string
description: A value in string format that is a large number
description: Price per million prompt tokens
example: 1000
PercentileThroughputCutoffs:
type: object
@@ -3965,13 +3966,21 @@ components:
prompt:
$ref: '#/components/schemas/BigNumberUnion'
completion:
$ref: '#/components/schemas/BigNumberUnion'
allOf:
- $ref: '#/components/schemas/BigNumberUnion'
- description: Price per million completion tokens
image:
$ref: '#/components/schemas/BigNumberUnion'
allOf:
- $ref: '#/components/schemas/BigNumberUnion'
- description: Price per image
audio:
$ref: '#/components/schemas/BigNumberUnion'
allOf:
- $ref: '#/components/schemas/BigNumberUnion'
- description: Price per audio unit
request:
$ref: '#/components/schemas/BigNumberUnion'
allOf:
- $ref: '#/components/schemas/BigNumberUnion'
- description: Price per request
description: >-
The object specifying the maximum price you want to pay for this request. USD price per million tokens,
for prompt and completion.
@@ -4394,7 +4403,6 @@ components:
- tool_use
- pause_turn
- refusal
- model_context_window_exceeded
stop_sequence:
type: string
nullable: true
@@ -4850,7 +4858,6 @@ components:
- tool_use
- pause_turn
- refusal
- model_context_window_exceeded
stop_sequence:
type: string
nullable: true
@@ -6515,6 +6522,21 @@ 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:
@@ -7023,13 +7045,21 @@ components:
prompt:
$ref: '#/components/schemas/BigNumberUnion'
completion:
$ref: '#/components/schemas/BigNumberUnion'
allOf:
- $ref: '#/components/schemas/BigNumberUnion'
- description: Price per million completion tokens
image:
$ref: '#/components/schemas/BigNumberUnion'
allOf:
- $ref: '#/components/schemas/BigNumberUnion'
- description: Price per image
audio:
$ref: '#/components/schemas/BigNumberUnion'
allOf:
- $ref: '#/components/schemas/BigNumberUnion'
- description: Price per audio unit
request:
$ref: '#/components/schemas/BigNumberUnion'
allOf:
- $ref: '#/components/schemas/BigNumberUnion'
- description: Price per request
description: >-
The object specifying the maximum price you want to pay for this request. USD price per million tokens,
for prompt and completion.
@@ -7147,6 +7177,8 @@ components:
type: array
items:
type: string
output_config:
$ref: '#/components/schemas/AnthropicOutputConfig'
required:
- model
- max_tokens
@@ -7374,13 +7406,21 @@ components:
prompt:
$ref: '#/components/schemas/BigNumberUnion'
completion:
$ref: '#/components/schemas/BigNumberUnion'
allOf:
- $ref: '#/components/schemas/BigNumberUnion'
- description: Price per million completion tokens
image:
$ref: '#/components/schemas/BigNumberUnion'
allOf:
- $ref: '#/components/schemas/BigNumberUnion'
- description: Price per image
audio:
$ref: '#/components/schemas/BigNumberUnion'
allOf:
- $ref: '#/components/schemas/BigNumberUnion'
- description: Price per audio unit
request:
$ref: '#/components/schemas/BigNumberUnion'
allOf:
- $ref: '#/components/schemas/BigNumberUnion'
- description: Price per request
description: >-
The object specifying the maximum price you want to pay for this request. USD price per million tokens, for
prompt and completion.
@@ -7393,31 +7433,57 @@ components:
type: object
properties:
prompt:
$ref: '#/components/schemas/BigNumberUnion'
allOf:
- $ref: '#/components/schemas/BigNumberUnion'
- description: A number or string value representing a large number
completion:
$ref: '#/components/schemas/BigNumberUnion'
allOf:
- $ref: '#/components/schemas/BigNumberUnion'
- description: A number or string value representing a large number
request:
$ref: '#/components/schemas/BigNumberUnion'
allOf:
- $ref: '#/components/schemas/BigNumberUnion'
- description: A number or string value representing a large number
image:
$ref: '#/components/schemas/BigNumberUnion'
allOf:
- $ref: '#/components/schemas/BigNumberUnion'
- description: A number or string value representing a large number
image_token:
$ref: '#/components/schemas/BigNumberUnion'
allOf:
- $ref: '#/components/schemas/BigNumberUnion'
- description: A number or string value representing a large number
image_output:
$ref: '#/components/schemas/BigNumberUnion'
allOf:
- $ref: '#/components/schemas/BigNumberUnion'
- description: A number or string value representing a large number
audio:
$ref: '#/components/schemas/BigNumberUnion'
allOf:
- $ref: '#/components/schemas/BigNumberUnion'
- description: A number or string value representing a large number
audio_output:
$ref: '#/components/schemas/BigNumberUnion'
allOf:
- $ref: '#/components/schemas/BigNumberUnion'
- description: A number or string value representing a large number
input_audio_cache:
$ref: '#/components/schemas/BigNumberUnion'
allOf:
- $ref: '#/components/schemas/BigNumberUnion'
- description: A number or string value representing a large number
web_search:
$ref: '#/components/schemas/BigNumberUnion'
allOf:
- $ref: '#/components/schemas/BigNumberUnion'
- description: A number or string value representing a large number
internal_reasoning:
$ref: '#/components/schemas/BigNumberUnion'
allOf:
- $ref: '#/components/schemas/BigNumberUnion'
- description: A number or string value representing a large number
input_cache_read:
$ref: '#/components/schemas/BigNumberUnion'
allOf:
- $ref: '#/components/schemas/BigNumberUnion'
- description: A number or string value representing a large number
input_cache_write:
$ref: '#/components/schemas/BigNumberUnion'
allOf:
- $ref: '#/components/schemas/BigNumberUnion'
- description: A number or string value representing a large number
discount:
type: number
required:
@@ -7875,31 +7941,57 @@ components:
type: object
properties:
prompt:
$ref: '#/components/schemas/BigNumberUnion'
allOf:
- $ref: '#/components/schemas/BigNumberUnion'
- description: A number or string value representing a large number
completion:
$ref: '#/components/schemas/BigNumberUnion'
allOf:
- $ref: '#/components/schemas/BigNumberUnion'
- description: A number or string value representing a large number
request:
$ref: '#/components/schemas/BigNumberUnion'
allOf:
- $ref: '#/components/schemas/BigNumberUnion'
- description: A number or string value representing a large number
image:
$ref: '#/components/schemas/BigNumberUnion'
allOf:
- $ref: '#/components/schemas/BigNumberUnion'
- description: A number or string value representing a large number
image_token:
$ref: '#/components/schemas/BigNumberUnion'
allOf:
- $ref: '#/components/schemas/BigNumberUnion'
- description: A number or string value representing a large number
image_output:
$ref: '#/components/schemas/BigNumberUnion'
allOf:
- $ref: '#/components/schemas/BigNumberUnion'
- description: A number or string value representing a large number
audio:
$ref: '#/components/schemas/BigNumberUnion'
allOf:
- $ref: '#/components/schemas/BigNumberUnion'
- description: A number or string value representing a large number
audio_output:
$ref: '#/components/schemas/BigNumberUnion'
allOf:
- $ref: '#/components/schemas/BigNumberUnion'
- description: A number or string value representing a large number
input_audio_cache:
$ref: '#/components/schemas/BigNumberUnion'
allOf:
- $ref: '#/components/schemas/BigNumberUnion'
- description: A number or string value representing a large number
web_search:
$ref: '#/components/schemas/BigNumberUnion'
allOf:
- $ref: '#/components/schemas/BigNumberUnion'
- description: A number or string value representing a large number
internal_reasoning:
$ref: '#/components/schemas/BigNumberUnion'
allOf:
- $ref: '#/components/schemas/BigNumberUnion'
- description: A number or string value representing a large number
input_cache_read:
$ref: '#/components/schemas/BigNumberUnion'
allOf:
- $ref: '#/components/schemas/BigNumberUnion'
- description: A number or string value representing a large number
input_cache_write:
$ref: '#/components/schemas/BigNumberUnion'
allOf:
- $ref: '#/components/schemas/BigNumberUnion'
- description: A number or string value representing a large number
discount:
type: number
required:
@@ -8103,6 +8195,103 @@ 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:
@@ -8168,6 +8357,7 @@ components:
- Seed
- SiliconFlow
- Sourceful
- StepFun
- Stealth
- StreamLake
- Switchpoint
@@ -8180,12 +8370,150 @@ components:
- Z.AI
- FakeProvider
- type: string
__schema1:
__schema8:
anyOf:
- type: number
- type: string
- type: number
__schema2:
- 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:
oneOf:
- type: object
properties:
@@ -8195,11 +8523,11 @@ components:
summary:
type: string
id:
$ref: '#/components/schemas/__schema3'
$ref: '#/components/schemas/__schema20'
format:
$ref: '#/components/schemas/__schema4'
$ref: '#/components/schemas/__schema21'
index:
$ref: '#/components/schemas/__schema5'
$ref: '#/components/schemas/__schema11'
required:
- type
- summary
@@ -8211,11 +8539,11 @@ components:
data:
type: string
id:
$ref: '#/components/schemas/__schema3'
$ref: '#/components/schemas/__schema20'
format:
$ref: '#/components/schemas/__schema4'
$ref: '#/components/schemas/__schema21'
index:
$ref: '#/components/schemas/__schema5'
$ref: '#/components/schemas/__schema11'
required:
- type
- data
@@ -8233,19 +8561,19 @@ components:
- type: string
- type: 'null'
id:
$ref: '#/components/schemas/__schema3'
$ref: '#/components/schemas/__schema20'
format:
$ref: '#/components/schemas/__schema4'
$ref: '#/components/schemas/__schema21'
index:
$ref: '#/components/schemas/__schema5'
$ref: '#/components/schemas/__schema11'
required:
- type
type: object
__schema3:
__schema20:
anyOf:
- type: string
- type: 'null'
__schema4:
__schema21:
anyOf:
- type: string
enum:
@@ -8256,9 +8584,7 @@ components:
- anthropic-claude-v1
- google-gemini-v1
- type: 'null'
__schema5:
type: number
__schema6:
__schema25:
anyOf:
- $ref: '#/components/schemas/ChatCompletionFinishReason'
- type: 'null'
@@ -8586,6 +8912,23 @@ 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:
@@ -8617,7 +8960,7 @@ components:
reasoning_details:
type: array
items:
$ref: '#/components/schemas/__schema2'
$ref: '#/components/schemas/__schema19'
images:
type: array
items:
@@ -8656,25 +8999,18 @@ components:
oneOf:
- $ref: '#/components/schemas/SystemMessage'
- $ref: '#/components/schemas/UserMessage'
- 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/DeveloperMessage'
- $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:
@@ -8738,242 +9074,10 @@ components:
properties:
provider:
description: When multiple model providers are available, optionally indicate your routing preference.
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'
$ref: '#/components/schemas/__schema0'
plugins:
description: Plugins you want to enable for this request, including their settings.
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
$ref: '#/components/schemas/__schema17'
route:
anyOf:
- type: string
@@ -8988,8 +9092,7 @@ 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.
type: string
maxLength: 128
$ref: '#/components/schemas/__schema18'
messages:
minItems: 1
type: array
@@ -9104,7 +9207,7 @@ components:
- maxItems: 4
type: array
items:
type: string
$ref: '#/components/schemas/ModelName'
- type: 'null'
stream:
default: false
@@ -9146,6 +9249,8 @@ components:
anyOf:
- type: string
- type: number
- type: array
items: {}
modalities:
type: array
items:
@@ -9163,7 +9268,7 @@ components:
type: object
properties:
finish_reason:
$ref: '#/components/schemas/__schema6'
$ref: '#/components/schemas/__schema25'
index:
type: number
message:
@@ -9221,14 +9326,14 @@ components:
reasoning_details:
type: array
items:
$ref: '#/components/schemas/__schema2'
$ref: '#/components/schemas/__schema19'
ChatStreamingChoice:
type: object
properties:
delta:
$ref: '#/components/schemas/ChatStreamingMessageChunk'
finish_reason:
$ref: '#/components/schemas/__schema6'
$ref: '#/components/schemas/__schema25'
index:
type: number
logprobs:
@@ -10460,6 +10565,7 @@ paths:
- Seed
- SiliconFlow
- Sourceful
- StepFun
- Stealth
- StreamLake
- Switchpoint
+412 -306
View File
@@ -3618,6 +3618,7 @@ components:
- Seed
- SiliconFlow
- Sourceful
- StepFun
- Stealth
- StreamLake
- Switchpoint
@@ -3669,7 +3670,7 @@ components:
- type: 'null'
BigNumberUnion:
type: string
description: A value in string format that is a large number
description: Price per million prompt tokens
example: 1000
PercentileThroughputCutoffs:
type: object
@@ -3975,13 +3976,21 @@ components:
prompt:
$ref: '#/components/schemas/BigNumberUnion'
completion:
$ref: '#/components/schemas/BigNumberUnion'
allOf:
- $ref: '#/components/schemas/BigNumberUnion'
- description: Price per million completion tokens
image:
$ref: '#/components/schemas/BigNumberUnion'
allOf:
- $ref: '#/components/schemas/BigNumberUnion'
- description: Price per image
audio:
$ref: '#/components/schemas/BigNumberUnion'
allOf:
- $ref: '#/components/schemas/BigNumberUnion'
- description: Price per audio unit
request:
$ref: '#/components/schemas/BigNumberUnion'
allOf:
- $ref: '#/components/schemas/BigNumberUnion'
- description: Price per request
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:
@@ -4398,7 +4407,6 @@ components:
- tool_use
- pause_turn
- refusal
- model_context_window_exceeded
x-speakeasy-unknown-values: allow
stop_sequence:
type: string
@@ -4858,7 +4866,6 @@ components:
- tool_use
- pause_turn
- refusal
- model_context_window_exceeded
x-speakeasy-unknown-values: allow
stop_sequence:
type: string
@@ -6543,6 +6550,21 @@ 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:
@@ -7048,13 +7070,21 @@ components:
prompt:
$ref: '#/components/schemas/BigNumberUnion'
completion:
$ref: '#/components/schemas/BigNumberUnion'
allOf:
- $ref: '#/components/schemas/BigNumberUnion'
- description: Price per million completion tokens
image:
$ref: '#/components/schemas/BigNumberUnion'
allOf:
- $ref: '#/components/schemas/BigNumberUnion'
- description: Price per image
audio:
$ref: '#/components/schemas/BigNumberUnion'
allOf:
- $ref: '#/components/schemas/BigNumberUnion'
- description: Price per audio unit
request:
$ref: '#/components/schemas/BigNumberUnion'
allOf:
- $ref: '#/components/schemas/BigNumberUnion'
- description: Price per request
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:
@@ -7165,6 +7195,8 @@ components:
type: array
items:
type: string
output_config:
$ref: '#/components/schemas/AnthropicOutputConfig'
required:
- model
- max_tokens
@@ -7385,13 +7417,21 @@ components:
prompt:
$ref: '#/components/schemas/BigNumberUnion'
completion:
$ref: '#/components/schemas/BigNumberUnion'
allOf:
- $ref: '#/components/schemas/BigNumberUnion'
- description: Price per million completion tokens
image:
$ref: '#/components/schemas/BigNumberUnion'
allOf:
- $ref: '#/components/schemas/BigNumberUnion'
- description: Price per image
audio:
$ref: '#/components/schemas/BigNumberUnion'
allOf:
- $ref: '#/components/schemas/BigNumberUnion'
- description: Price per audio unit
request:
$ref: '#/components/schemas/BigNumberUnion'
allOf:
- $ref: '#/components/schemas/BigNumberUnion'
- description: Price per request
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:
@@ -7403,31 +7443,57 @@ components:
type: object
properties:
prompt:
$ref: '#/components/schemas/BigNumberUnion'
allOf:
- $ref: '#/components/schemas/BigNumberUnion'
- description: A number or string value representing a large number
completion:
$ref: '#/components/schemas/BigNumberUnion'
allOf:
- $ref: '#/components/schemas/BigNumberUnion'
- description: A number or string value representing a large number
request:
$ref: '#/components/schemas/BigNumberUnion'
allOf:
- $ref: '#/components/schemas/BigNumberUnion'
- description: A number or string value representing a large number
image:
$ref: '#/components/schemas/BigNumberUnion'
allOf:
- $ref: '#/components/schemas/BigNumberUnion'
- description: A number or string value representing a large number
image_token:
$ref: '#/components/schemas/BigNumberUnion'
allOf:
- $ref: '#/components/schemas/BigNumberUnion'
- description: A number or string value representing a large number
image_output:
$ref: '#/components/schemas/BigNumberUnion'
allOf:
- $ref: '#/components/schemas/BigNumberUnion'
- description: A number or string value representing a large number
audio:
$ref: '#/components/schemas/BigNumberUnion'
allOf:
- $ref: '#/components/schemas/BigNumberUnion'
- description: A number or string value representing a large number
audio_output:
$ref: '#/components/schemas/BigNumberUnion'
allOf:
- $ref: '#/components/schemas/BigNumberUnion'
- description: A number or string value representing a large number
input_audio_cache:
$ref: '#/components/schemas/BigNumberUnion'
allOf:
- $ref: '#/components/schemas/BigNumberUnion'
- description: A number or string value representing a large number
web_search:
$ref: '#/components/schemas/BigNumberUnion'
allOf:
- $ref: '#/components/schemas/BigNumberUnion'
- description: A number or string value representing a large number
internal_reasoning:
$ref: '#/components/schemas/BigNumberUnion'
allOf:
- $ref: '#/components/schemas/BigNumberUnion'
- description: A number or string value representing a large number
input_cache_read:
$ref: '#/components/schemas/BigNumberUnion'
allOf:
- $ref: '#/components/schemas/BigNumberUnion'
- description: A number or string value representing a large number
input_cache_write:
$ref: '#/components/schemas/BigNumberUnion'
allOf:
- $ref: '#/components/schemas/BigNumberUnion'
- description: A number or string value representing a large number
discount:
type: number
required:
@@ -7891,31 +7957,57 @@ components:
type: object
properties:
prompt:
$ref: '#/components/schemas/BigNumberUnion'
allOf:
- $ref: '#/components/schemas/BigNumberUnion'
- description: A number or string value representing a large number
completion:
$ref: '#/components/schemas/BigNumberUnion'
allOf:
- $ref: '#/components/schemas/BigNumberUnion'
- description: A number or string value representing a large number
request:
$ref: '#/components/schemas/BigNumberUnion'
allOf:
- $ref: '#/components/schemas/BigNumberUnion'
- description: A number or string value representing a large number
image:
$ref: '#/components/schemas/BigNumberUnion'
allOf:
- $ref: '#/components/schemas/BigNumberUnion'
- description: A number or string value representing a large number
image_token:
$ref: '#/components/schemas/BigNumberUnion'
allOf:
- $ref: '#/components/schemas/BigNumberUnion'
- description: A number or string value representing a large number
image_output:
$ref: '#/components/schemas/BigNumberUnion'
allOf:
- $ref: '#/components/schemas/BigNumberUnion'
- description: A number or string value representing a large number
audio:
$ref: '#/components/schemas/BigNumberUnion'
allOf:
- $ref: '#/components/schemas/BigNumberUnion'
- description: A number or string value representing a large number
audio_output:
$ref: '#/components/schemas/BigNumberUnion'
allOf:
- $ref: '#/components/schemas/BigNumberUnion'
- description: A number or string value representing a large number
input_audio_cache:
$ref: '#/components/schemas/BigNumberUnion'
allOf:
- $ref: '#/components/schemas/BigNumberUnion'
- description: A number or string value representing a large number
web_search:
$ref: '#/components/schemas/BigNumberUnion'
allOf:
- $ref: '#/components/schemas/BigNumberUnion'
- description: A number or string value representing a large number
internal_reasoning:
$ref: '#/components/schemas/BigNumberUnion'
allOf:
- $ref: '#/components/schemas/BigNumberUnion'
- description: A number or string value representing a large number
input_cache_read:
$ref: '#/components/schemas/BigNumberUnion'
allOf:
- $ref: '#/components/schemas/BigNumberUnion'
- description: A number or string value representing a large number
input_cache_write:
$ref: '#/components/schemas/BigNumberUnion'
allOf:
- $ref: '#/components/schemas/BigNumberUnion'
- description: A number or string value representing a large number
discount:
type: number
required:
@@ -8117,6 +8209,89 @@ 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:
@@ -8182,6 +8357,7 @@ components:
- Seed
- SiliconFlow
- Sourceful
- StepFun
- Stealth
- StreamLake
- Switchpoint
@@ -8195,12 +8371,153 @@ components:
- FakeProvider
x-speakeasy-unknown-values: allow
- type: string
__schema1:
__schema8:
anyOf:
- type: number
- type: string
- type: number
__schema2:
- 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:
oneOf:
- type: object
properties:
@@ -8210,11 +8527,11 @@ components:
summary:
type: string
id:
$ref: '#/components/schemas/__schema3'
$ref: '#/components/schemas/__schema20'
format:
$ref: '#/components/schemas/__schema4'
$ref: '#/components/schemas/__schema21'
index:
$ref: '#/components/schemas/__schema5'
$ref: '#/components/schemas/__schema11'
required:
- type
- summary
@@ -8226,11 +8543,11 @@ components:
data:
type: string
id:
$ref: '#/components/schemas/__schema3'
$ref: '#/components/schemas/__schema20'
format:
$ref: '#/components/schemas/__schema4'
$ref: '#/components/schemas/__schema21'
index:
$ref: '#/components/schemas/__schema5'
$ref: '#/components/schemas/__schema11'
required:
- type
- data
@@ -8248,19 +8565,19 @@ components:
- type: string
- type: 'null'
id:
$ref: '#/components/schemas/__schema3'
$ref: '#/components/schemas/__schema20'
format:
$ref: '#/components/schemas/__schema4'
$ref: '#/components/schemas/__schema21'
index:
$ref: '#/components/schemas/__schema5'
$ref: '#/components/schemas/__schema11'
required:
- type
type: object
__schema3:
__schema20:
anyOf:
- type: string
- type: 'null'
__schema4:
__schema21:
anyOf:
- type: string
enum:
@@ -8272,9 +8589,7 @@ components:
- google-gemini-v1
x-speakeasy-unknown-values: allow
- type: 'null'
__schema5:
type: number
__schema6:
__schema25:
anyOf:
- $ref: '#/components/schemas/ChatCompletionFinishReason'
- type: 'null'
@@ -8605,6 +8920,23 @@ 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:
@@ -8636,7 +8968,7 @@ components:
reasoning_details:
type: array
items:
$ref: '#/components/schemas/__schema2'
$ref: '#/components/schemas/__schema19'
images:
type: array
items:
@@ -8675,25 +9007,18 @@ components:
oneOf:
- $ref: '#/components/schemas/SystemMessage'
- $ref: '#/components/schemas/UserMessage'
- 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/DeveloperMessage'
- $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:
@@ -8757,231 +9082,10 @@ components:
properties:
provider:
description: When multiple model providers are available, optionally indicate your routing preference.
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'
$ref: '#/components/schemas/__schema0'
plugins:
description: Plugins you want to enable for this request, including their settings.
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
$ref: '#/components/schemas/__schema17'
route:
anyOf:
- type: string
@@ -8995,8 +9099,7 @@ 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.
type: string
maxLength: 128
$ref: '#/components/schemas/__schema18'
messages:
minItems: 1
type: array
@@ -9112,7 +9215,7 @@ components:
- maxItems: 4
type: array
items:
type: string
$ref: '#/components/schemas/ModelName'
- type: 'null'
stream:
default: false
@@ -9154,6 +9257,8 @@ components:
anyOf:
- type: string
- type: number
- type: array
items: {}
modalities:
type: array
items:
@@ -9172,7 +9277,7 @@ components:
type: object
properties:
finish_reason:
$ref: '#/components/schemas/__schema6'
$ref: '#/components/schemas/__schema25'
index:
type: number
message:
@@ -9230,14 +9335,14 @@ components:
reasoning_details:
type: array
items:
$ref: '#/components/schemas/__schema2'
$ref: '#/components/schemas/__schema19'
ChatStreamingChoice:
type: object
properties:
delta:
$ref: '#/components/schemas/ChatStreamingMessageChunk'
finish_reason:
$ref: '#/components/schemas/__schema6'
$ref: '#/components/schemas/__schema25'
index:
type: number
logprobs:
@@ -10468,6 +10573,7 @@ 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:6e8165360ec62cc8b776111afb2e6d8c17e5dd46f2be6e124138a8296e2c7046
sourceBlobDigest: sha256:373dfa5b56ef18b9cdc55a2ad1a5d8b377deabfcc028ab7f940f525b3a3ca9c9
sourceRevisionDigest: sha256:9726bd1a602e2f5f3665445896ccad693820754350ead01d7aef39e0dedeb3dc
sourceBlobDigest: sha256:f8e66605c401e126a5f39b6e0272dd792182257c5162fdfbf7c5a815c516c581
tags:
- latest
- main
@@ -18,10 +18,10 @@ targets:
open-router:
source: OpenRouter API
sourceNamespace: open-router-chat-completions-api
sourceRevisionDigest: sha256:6e8165360ec62cc8b776111afb2e6d8c17e5dd46f2be6e124138a8296e2c7046
sourceBlobDigest: sha256:373dfa5b56ef18b9cdc55a2ad1a5d8b377deabfcc028ab7f940f525b3a3ca9c9
sourceRevisionDigest: sha256:9726bd1a602e2f5f3665445896ccad693820754350ead01d7aef39e0dedeb3dc
sourceBlobDigest: sha256:f8e66605c401e126a5f39b6e0272dd792182257c5162fdfbf7c5a815c516c581
codeSamplesNamespace: open-router-python-code-samples
codeSamplesRevisionDigest: sha256:0441c6e25f98818e2b2398041d3a974e3f26897c151a3fabfccbc2206640751a
codeSamplesRevisionDigest: sha256:6719e0045ac51c8ab2461cbd23189a7b289fad9032460c92183e5845f9e43f61
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.Schema2](../components/schema2.md)] | :heavy_minus_sign: | N/A |
| `reasoning_details` | List[[components.Schema19](../components/schema19.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.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 |
| 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 |
@@ -15,3 +15,9 @@ value: str = /* values here */
value: float = /* values here */
```
### `List[Any]`
```python
value: List[Any] = /* values here */
```
@@ -1,14 +0,0 @@
# 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,35 +0,0 @@
# 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,17 +0,0 @@
# ChatGenerationParamsPreferredMaxLatencyUnion
## Supported Types
### `float`
```python
value: float = /* values here */
```
### `components.ChatGenerationParamsPreferredMaxLatency`
```python
value: components.ChatGenerationParamsPreferredMaxLatency = /* values here */
```
@@ -1,11 +0,0 @@
# 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 |
@@ -1,17 +0,0 @@
# ChatGenerationParamsPreferredMinThroughputUnion
## Supported Types
### `float`
```python
value: float = /* values here */
```
### `components.ChatGenerationParamsPreferredMinThroughput`
```python
value: components.ChatGenerationParamsPreferredMinThroughput = /* values here */
```
@@ -1,20 +0,0 @@
# 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.Schema2](../components/schema2.md)] | :heavy_minus_sign: | N/A |
| `reasoning_details` | List[[components.Schema19](../components/schema19.md)] | :heavy_minus_sign: | N/A |
+23
View File
@@ -0,0 +1,23 @@
# Completion
## Supported Types
### `float`
```python
value: float = /* values here */
```
### `str`
```python
value: str = /* values here */
```
### `Any`
```python
value: Any = /* values here */
```
+10
View File
@@ -0,0 +1,10 @@
# 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 |
@@ -1,4 +1,4 @@
# MessageContent
# DeveloperMessageContent
## Supported Types
+2 -2
View File
@@ -15,10 +15,10 @@ value: components.SystemMessage = /* values here */
value: components.UserMessage = /* values here */
```
### `components.MessageDeveloper`
### `components.DeveloperMessage`
```python
value: components.MessageDeveloper = /* values here */
value: components.DeveloperMessage = /* values here */
```
### `components.AssistantMessage`
-10
View File
@@ -1,10 +0,0 @@
# 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.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. | |
| `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. | |
| `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: | 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 |
| 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 |
@@ -1,35 +0,0 @@
# 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 */
```
+35
View File
@@ -0,0 +1,35 @@
# 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 */
```
@@ -1,4 +1,4 @@
# OpenResponsesRequestPluginAutoRouter
# PluginAutoRouter
## Fields
@@ -1,4 +1,4 @@
# OpenResponsesRequestPluginFileParser
# PluginFileParser
## Fields
@@ -1,4 +1,4 @@
# OpenResponsesRequestPluginModeration
# PluginModeration
## Fields
@@ -1,4 +1,4 @@
# OpenResponsesRequestPluginResponseHealing
# PluginResponseHealing
## Fields
@@ -1,4 +1,4 @@
# OpenResponsesRequestPluginWeb
# PluginWeb
## Fields
+16 -16
View File
@@ -3,19 +3,19 @@
## Fields
| 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 | |
| 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 | |
+23
View File
@@ -0,0 +1,23 @@
# Prompt
## Supported Types
### `float`
```python
value: float = /* values here */
```
### `str`
```python
value: str = /* values here */
```
### `Any`
```python
value: Any = /* values here */
```
@@ -1,4 +1,4 @@
# OpenResponsesRequestProvider
# Provider
When multiple model providers are available, optionally indicate your routing preference.
+1
View File
@@ -65,6 +65,7 @@
| `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: | 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 |
| 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 |
+16 -16
View File
@@ -5,19 +5,19 @@ Pricing information for the model
## Fields
| 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 | |
| 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 | |
+16 -13
View File
@@ -1,17 +1,20 @@
# Schema0
## Supported Types
### `components.Schema0Enum`
```python
value: components.Schema0Enum = /* values here */
```
### `str`
```python
value: str = /* values here */
```
## Fields
| 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 |
+12
View File
@@ -0,0 +1,12 @@
# 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
@@ -0,0 +1,23 @@
# Schema14
## Supported Types
### `float`
```python
value: float = /* values here */
```
### `str`
```python
value: str = /* values here */
```
### `Any`
```python
value: Any = /* values here */
```
@@ -1,4 +1,4 @@
# ChatGenerationParamsPreferredMaxLatency
# Schema15
## Fields
+17
View File
@@ -0,0 +1,17 @@
# Schema15Union
## Supported Types
### `float`
```python
value: float = /* values here */
```
### `components.Schema15`
```python
value: components.Schema15 = /* values here */
```
+35
View File
@@ -0,0 +1,35 @@
# 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 */
```
@@ -1,4 +1,4 @@
# ChatGenerationParamsPluginAutoRouter
# Schema17AutoRouter
## Fields
@@ -1,4 +1,4 @@
# ChatGenerationParamsPluginFileParser
# Schema17FileParser
## Fields
@@ -1,4 +1,4 @@
# ChatGenerationParamsPluginModeration
# Schema17Moderation
## Fields
@@ -1,4 +1,4 @@
# ChatGenerationParamsPluginResponseHealing
# Schema17ResponseHealing
## Fields
@@ -1,4 +1,4 @@
# ChatGenerationParamsPluginWeb
# Schema17Web
## Fields
+23
View File
@@ -0,0 +1,23 @@
# 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 */
```
@@ -0,0 +1,12 @@
# 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 |
@@ -0,0 +1,12 @@
# 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
@@ -0,0 +1,13 @@
# 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
@@ -1,23 +0,0 @@
# 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 */
```
@@ -1,4 +1,4 @@
# Schema4
# Schema21
## Values
@@ -1,12 +0,0 @@
# 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 |
@@ -1,12 +0,0 @@
# 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
@@ -1,13 +0,0 @@
# 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 @@
# ChatGenerationParamsDataCollection
# Schema3
## Values
+17
View File
@@ -0,0 +1,17 @@
# Schema5
## Supported Types
### `components.Schema5Enum`
```python
value: components.Schema5Enum = /* values here */
```
### `str`
```python
value: str = /* values here */
```
@@ -1,4 +1,4 @@
# Schema0Enum
# Schema5Enum
## Values
@@ -65,6 +65,7 @@
| `SEED` | Seed |
| `SILICON_FLOW` | SiliconFlow |
| `SOURCEFUL` | Sourceful |
| `STEP_FUN` | StepFun |
| `STEALTH` | Stealth |
| `STREAM_LAKE` | StreamLake |
| `SWITCHPOINT` | Switchpoint |
@@ -1,4 +1,4 @@
# Quantizations
# Schema8
## Values
+1
View File
@@ -93,6 +93,7 @@
| `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.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. |
| 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. |
### 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.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. | |
| `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. | |
| `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.3.2"
version = "0.5.0"
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.3.2"
__version__: str = "0.5.0"
__openapi_doc_version__: str = "1.0.0"
__gen_version__: str = "2.768.0"
__user_agent__: str = "speakeasy-sdk/python 0.3.2 2.768.0 1.0.0 openrouter"
__user_agent__: str = "speakeasy-sdk/python 0.5.0 2.768.0 1.0.0 openrouter"
try:
if __package__ is not None:
+34 -70
View File
@@ -22,16 +22,10 @@ class Chat(BaseSDK):
*,
messages: Union[List[components.Message], List[components.MessageTypedDict]],
provider: OptionalNullable[
Union[
components.ChatGenerationParamsProvider,
components.ChatGenerationParamsProviderTypedDict,
]
Union[components.Schema0, components.Schema0TypedDict]
] = UNSET,
plugins: Optional[
Union[
List[components.ChatGenerationParamsPluginUnion],
List[components.ChatGenerationParamsPluginUnionTypedDict],
]
Union[List[components.Schema17], List[components.Schema17TypedDict]]
] = None,
route: OptionalNullable[components.Route] = UNSET,
user: Optional[str] = None,
@@ -87,11 +81,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: 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 provider:
:param plugins:
:param route:
:param user:
: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 session_id:
:param model:
:param models:
:param frequency_penalty:
@@ -128,16 +122,10 @@ class Chat(BaseSDK):
*,
messages: Union[List[components.Message], List[components.MessageTypedDict]],
provider: OptionalNullable[
Union[
components.ChatGenerationParamsProvider,
components.ChatGenerationParamsProviderTypedDict,
]
Union[components.Schema0, components.Schema0TypedDict]
] = UNSET,
plugins: Optional[
Union[
List[components.ChatGenerationParamsPluginUnion],
List[components.ChatGenerationParamsPluginUnionTypedDict],
]
Union[List[components.Schema17], List[components.Schema17TypedDict]]
] = None,
route: OptionalNullable[components.Route] = UNSET,
user: Optional[str] = None,
@@ -193,11 +181,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: 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 provider:
:param plugins:
:param route:
:param user:
: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 session_id:
:param model:
:param models:
:param frequency_penalty:
@@ -233,16 +221,10 @@ class Chat(BaseSDK):
*,
messages: Union[List[components.Message], List[components.MessageTypedDict]],
provider: OptionalNullable[
Union[
components.ChatGenerationParamsProvider,
components.ChatGenerationParamsProviderTypedDict,
]
Union[components.Schema0, components.Schema0TypedDict]
] = UNSET,
plugins: Optional[
Union[
List[components.ChatGenerationParamsPluginUnion],
List[components.ChatGenerationParamsPluginUnionTypedDict],
]
Union[List[components.Schema17], List[components.Schema17TypedDict]]
] = None,
route: OptionalNullable[components.Route] = UNSET,
user: Optional[str] = None,
@@ -298,11 +280,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: 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 provider:
:param plugins:
:param route:
:param user:
: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 session_id:
:param model:
:param models:
:param frequency_penalty:
@@ -344,10 +326,10 @@ class Chat(BaseSDK):
request = components.ChatGenerationParams(
provider=utils.get_pydantic_model(
provider, OptionalNullable[components.ChatGenerationParamsProvider]
provider, OptionalNullable[components.Schema0]
),
plugins=utils.get_pydantic_model(
plugins, Optional[List[components.ChatGenerationParamsPluginUnion]]
plugins, Optional[List[components.Schema17]]
),
route=route,
user=user,
@@ -479,16 +461,10 @@ class Chat(BaseSDK):
*,
messages: Union[List[components.Message], List[components.MessageTypedDict]],
provider: OptionalNullable[
Union[
components.ChatGenerationParamsProvider,
components.ChatGenerationParamsProviderTypedDict,
]
Union[components.Schema0, components.Schema0TypedDict]
] = UNSET,
plugins: Optional[
Union[
List[components.ChatGenerationParamsPluginUnion],
List[components.ChatGenerationParamsPluginUnionTypedDict],
]
Union[List[components.Schema17], List[components.Schema17TypedDict]]
] = None,
route: OptionalNullable[components.Route] = UNSET,
user: Optional[str] = None,
@@ -544,11 +520,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: 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 provider:
:param plugins:
:param route:
:param user:
: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 session_id:
:param model:
:param models:
:param frequency_penalty:
@@ -585,16 +561,10 @@ class Chat(BaseSDK):
*,
messages: Union[List[components.Message], List[components.MessageTypedDict]],
provider: OptionalNullable[
Union[
components.ChatGenerationParamsProvider,
components.ChatGenerationParamsProviderTypedDict,
]
Union[components.Schema0, components.Schema0TypedDict]
] = UNSET,
plugins: Optional[
Union[
List[components.ChatGenerationParamsPluginUnion],
List[components.ChatGenerationParamsPluginUnionTypedDict],
]
Union[List[components.Schema17], List[components.Schema17TypedDict]]
] = None,
route: OptionalNullable[components.Route] = UNSET,
user: Optional[str] = None,
@@ -650,11 +620,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: 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 provider:
:param plugins:
:param route:
:param user:
: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 session_id:
:param model:
:param models:
:param frequency_penalty:
@@ -690,16 +660,10 @@ class Chat(BaseSDK):
*,
messages: Union[List[components.Message], List[components.MessageTypedDict]],
provider: OptionalNullable[
Union[
components.ChatGenerationParamsProvider,
components.ChatGenerationParamsProviderTypedDict,
]
Union[components.Schema0, components.Schema0TypedDict]
] = UNSET,
plugins: Optional[
Union[
List[components.ChatGenerationParamsPluginUnion],
List[components.ChatGenerationParamsPluginUnionTypedDict],
]
Union[List[components.Schema17], List[components.Schema17TypedDict]]
] = None,
route: OptionalNullable[components.Route] = UNSET,
user: Optional[str] = None,
@@ -755,11 +719,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: 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 provider:
:param plugins:
:param route:
:param user:
: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 session_id:
:param model:
:param models:
:param frequency_penalty:
@@ -801,10 +765,10 @@ class Chat(BaseSDK):
request = components.ChatGenerationParams(
provider=utils.get_pydantic_model(
provider, OptionalNullable[components.ChatGenerationParamsProvider]
provider, OptionalNullable[components.Schema0]
),
plugins=utils.get_pydantic_model(
plugins, Optional[List[components.ChatGenerationParamsPluginUnion]]
plugins, Optional[List[components.Schema17]]
),
route=route,
user=user,
+185 -177
View File
@@ -6,18 +6,45 @@ import builtins
import sys
if TYPE_CHECKING:
from ._schema0 import Schema0, Schema0Enum, Schema0TypedDict
from ._schema2 import (
Schema2,
Schema2ReasoningEncrypted,
Schema2ReasoningEncryptedTypedDict,
Schema2ReasoningSummary,
Schema2ReasoningSummaryTypedDict,
Schema2ReasoningText,
Schema2ReasoningTextTypedDict,
Schema2TypedDict,
Schema4,
from ._schema10 import (
Completion,
CompletionTypedDict,
Prompt,
PromptTypedDict,
Schema10,
Schema10TypedDict,
)
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,
@@ -41,43 +68,13 @@ 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,
@@ -89,6 +86,14 @@ if TYPE_CHECKING:
ResponseFormatTextTypedDict,
ResponseFormatTypedDict,
Route,
Schema0,
Schema0TypedDict,
Schema15,
Schema15TypedDict,
Schema15Union,
Schema15UnionTypedDict,
Schema3,
Schema8,
Stop,
StopTypedDict,
)
@@ -184,6 +189,12 @@ if TYPE_CHECKING:
)
from .datacollection import DataCollection
from .defaultparameters import DefaultParameters, DefaultParametersTypedDict
from .developermessage import (
DeveloperMessage,
DeveloperMessageContent,
DeveloperMessageContentTypedDict,
DeveloperMessageTypedDict,
)
from .edgenetworktimeoutresponseerrordata import (
EdgeNetworkTimeoutResponseErrorData,
EdgeNetworkTimeoutResponseErrorDataTypedDict,
@@ -210,14 +221,7 @@ if TYPE_CHECKING:
ListEndpointsResponseTypedDict,
Tokenizer,
)
from .message import (
Message,
MessageContent,
MessageContentTypedDict,
MessageDeveloper,
MessageDeveloperTypedDict,
MessageTypedDict,
)
from .message import Message, MessageTypedDict
from .model import Model, ModelTypedDict
from .modelarchitecture import (
ModelArchitecture,
@@ -469,20 +473,6 @@ if TYPE_CHECKING:
OpenResponsesRequestOnlyTypedDict,
OpenResponsesRequestOrder,
OpenResponsesRequestOrderTypedDict,
OpenResponsesRequestPluginAutoRouter,
OpenResponsesRequestPluginAutoRouterTypedDict,
OpenResponsesRequestPluginFileParser,
OpenResponsesRequestPluginFileParserTypedDict,
OpenResponsesRequestPluginModeration,
OpenResponsesRequestPluginModerationTypedDict,
OpenResponsesRequestPluginResponseHealing,
OpenResponsesRequestPluginResponseHealingTypedDict,
OpenResponsesRequestPluginUnion,
OpenResponsesRequestPluginUnionTypedDict,
OpenResponsesRequestPluginWeb,
OpenResponsesRequestPluginWebTypedDict,
OpenResponsesRequestProvider,
OpenResponsesRequestProviderTypedDict,
OpenResponsesRequestSort,
OpenResponsesRequestSortTypedDict,
OpenResponsesRequestToolFunction,
@@ -491,6 +481,20 @@ if TYPE_CHECKING:
OpenResponsesRequestToolUnionTypedDict,
OpenResponsesRequestType,
OpenResponsesRequestTypedDict,
Plugin,
PluginAutoRouter,
PluginAutoRouterTypedDict,
PluginFileParser,
PluginFileParserTypedDict,
PluginModeration,
PluginModerationTypedDict,
PluginResponseHealing,
PluginResponseHealingTypedDict,
PluginTypedDict,
PluginWeb,
PluginWebTypedDict,
Provider,
ProviderTypedDict,
ServiceTier,
Truncation,
)
@@ -903,33 +907,8 @@ __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",
@@ -988,8 +967,10 @@ __all__ = [
"Code",
"CodeEnum",
"CodeTypedDict",
"Completion",
"CompletionTokensDetails",
"CompletionTokensDetailsTypedDict",
"CompletionTypedDict",
"CostDetails",
"CostDetailsTypedDict",
"CreateChargeRequest",
@@ -999,6 +980,10 @@ __all__ = [
"DebugTypedDict",
"DefaultParameters",
"DefaultParametersTypedDict",
"DeveloperMessage",
"DeveloperMessageContent",
"DeveloperMessageContentTypedDict",
"DeveloperMessageTypedDict",
"EdgeNetworkTimeoutResponseErrorData",
"EdgeNetworkTimeoutResponseErrorDataTypedDict",
"Effort",
@@ -1033,10 +1018,6 @@ __all__ = [
"Logprob",
"LogprobTypedDict",
"Message",
"MessageContent",
"MessageContentTypedDict",
"MessageDeveloper",
"MessageDeveloperTypedDict",
"MessageTypedDict",
"Modality",
"Model",
@@ -1221,20 +1202,6 @@ __all__ = [
"OpenResponsesRequestOnlyTypedDict",
"OpenResponsesRequestOrder",
"OpenResponsesRequestOrderTypedDict",
"OpenResponsesRequestPluginAutoRouter",
"OpenResponsesRequestPluginAutoRouterTypedDict",
"OpenResponsesRequestPluginFileParser",
"OpenResponsesRequestPluginFileParserTypedDict",
"OpenResponsesRequestPluginModeration",
"OpenResponsesRequestPluginModerationTypedDict",
"OpenResponsesRequestPluginResponseHealing",
"OpenResponsesRequestPluginResponseHealingTypedDict",
"OpenResponsesRequestPluginUnion",
"OpenResponsesRequestPluginUnionTypedDict",
"OpenResponsesRequestPluginWeb",
"OpenResponsesRequestPluginWebTypedDict",
"OpenResponsesRequestProvider",
"OpenResponsesRequestProviderTypedDict",
"OpenResponsesRequestSort",
"OpenResponsesRequestSortTypedDict",
"OpenResponsesRequestToolFunction",
@@ -1343,14 +1310,29 @@ __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",
@@ -1378,13 +1360,13 @@ __all__ = [
"ProviderSortConfigUnionTypedDict",
"ProviderSortUnion",
"ProviderSortUnionTypedDict",
"ProviderTypedDict",
"PublicEndpoint",
"PublicEndpointQuantization",
"PublicEndpointTypedDict",
"PublicPricing",
"PublicPricingTypedDict",
"Quantization",
"Quantizations",
"Reason",
"Reasoning",
"ReasoningSummaryText",
@@ -1495,17 +1477,41 @@ __all__ = [
"ResponsesWebSearchUserLocationTypedDict",
"Route",
"Schema0",
"Schema0Enum",
"Schema0TypedDict",
"Schema2",
"Schema2ReasoningEncrypted",
"Schema2ReasoningEncryptedTypedDict",
"Schema2ReasoningSummary",
"Schema2ReasoningSummaryTypedDict",
"Schema2ReasoningText",
"Schema2ReasoningTextTypedDict",
"Schema2TypedDict",
"Schema4",
"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",
"Security",
"SecurityTypedDict",
"ServiceTier",
@@ -1578,18 +1584,42 @@ __all__ = [
]
_dynamic_imports: dict[str, str] = {
"Schema0": "._schema0",
"Schema0Enum": "._schema0",
"Schema0TypedDict": "._schema0",
"Schema2": "._schema2",
"Schema2ReasoningEncrypted": "._schema2",
"Schema2ReasoningEncryptedTypedDict": "._schema2",
"Schema2ReasoningSummary": "._schema2",
"Schema2ReasoningSummaryTypedDict": "._schema2",
"Schema2ReasoningText": "._schema2",
"Schema2ReasoningTextTypedDict": "._schema2",
"Schema2TypedDict": "._schema2",
"Schema4": "._schema2",
"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",
"ActivityItem": ".activityitem",
"ActivityItemTypedDict": ".activityitem",
"AssistantMessage": ".assistantmessage",
@@ -1610,43 +1640,13 @@ _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,6 +1658,14 @@ _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",
@@ -1729,6 +1737,10 @@ _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",
@@ -1753,10 +1765,6 @@ _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",
@@ -1950,20 +1958,6 @@ _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",
@@ -1972,6 +1966,20 @@ _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",
+39
View File
@@ -0,0 +1,39 @@
"""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
@@ -0,0 +1,11 @@
"""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
@@ -0,0 +1,154 @@
"""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
Schema4 = Union[
Schema21 = Union[
Literal[
"unknown",
"openai-responses-v1",
@@ -30,16 +30,16 @@ Schema4 = Union[
]
class Schema2ReasoningTextTypedDict(TypedDict):
class Schema19ReasoningTextTypedDict(TypedDict):
type: Literal["reasoning.text"]
text: NotRequired[Nullable[str]]
signature: NotRequired[Nullable[str]]
id: NotRequired[Nullable[str]]
format_: NotRequired[Nullable[Schema4]]
format_: NotRequired[Nullable[Schema21]]
index: NotRequired[float]
class Schema2ReasoningText(BaseModel):
class Schema19ReasoningText(BaseModel):
TYPE: Annotated[
Annotated[
Literal["reasoning.text"], AfterValidator(validate_const("reasoning.text"))
@@ -54,7 +54,9 @@ class Schema2ReasoningText(BaseModel):
id: OptionalNullable[str] = UNSET
format_: Annotated[
Annotated[OptionalNullable[Schema4], PlainValidator(validate_open_enum(False))],
Annotated[
OptionalNullable[Schema21], PlainValidator(validate_open_enum(False))
],
pydantic.Field(alias="format"),
] = UNSET
@@ -91,15 +93,15 @@ class Schema2ReasoningText(BaseModel):
return m
class Schema2ReasoningEncryptedTypedDict(TypedDict):
class Schema19ReasoningEncryptedTypedDict(TypedDict):
data: str
type: Literal["reasoning.encrypted"]
id: NotRequired[Nullable[str]]
format_: NotRequired[Nullable[Schema4]]
format_: NotRequired[Nullable[Schema21]]
index: NotRequired[float]
class Schema2ReasoningEncrypted(BaseModel):
class Schema19ReasoningEncrypted(BaseModel):
data: str
TYPE: Annotated[
@@ -113,7 +115,9 @@ class Schema2ReasoningEncrypted(BaseModel):
id: OptionalNullable[str] = UNSET
format_: Annotated[
Annotated[OptionalNullable[Schema4], PlainValidator(validate_open_enum(False))],
Annotated[
OptionalNullable[Schema21], PlainValidator(validate_open_enum(False))
],
pydantic.Field(alias="format"),
] = UNSET
@@ -150,15 +154,15 @@ class Schema2ReasoningEncrypted(BaseModel):
return m
class Schema2ReasoningSummaryTypedDict(TypedDict):
class Schema19ReasoningSummaryTypedDict(TypedDict):
summary: str
type: Literal["reasoning.summary"]
id: NotRequired[Nullable[str]]
format_: NotRequired[Nullable[Schema4]]
format_: NotRequired[Nullable[Schema21]]
index: NotRequired[float]
class Schema2ReasoningSummary(BaseModel):
class Schema19ReasoningSummary(BaseModel):
summary: str
TYPE: Annotated[
@@ -172,7 +176,9 @@ class Schema2ReasoningSummary(BaseModel):
id: OptionalNullable[str] = UNSET
format_: Annotated[
Annotated[OptionalNullable[Schema4], PlainValidator(validate_open_enum(False))],
Annotated[
OptionalNullable[Schema21], PlainValidator(validate_open_enum(False))
],
pydantic.Field(alias="format"),
] = UNSET
@@ -209,21 +215,21 @@ class Schema2ReasoningSummary(BaseModel):
return m
Schema2TypedDict = TypeAliasType(
"Schema2TypedDict",
Schema19TypedDict = TypeAliasType(
"Schema19TypedDict",
Union[
Schema2ReasoningSummaryTypedDict,
Schema2ReasoningEncryptedTypedDict,
Schema2ReasoningTextTypedDict,
Schema19ReasoningSummaryTypedDict,
Schema19ReasoningEncryptedTypedDict,
Schema19ReasoningTextTypedDict,
],
)
Schema2 = Annotated[
Schema19 = Annotated[
Union[
Annotated[Schema2ReasoningSummary, Tag("reasoning.summary")],
Annotated[Schema2ReasoningEncrypted, Tag("reasoning.encrypted")],
Annotated[Schema2ReasoningText, Tag("reasoning.text")],
Annotated[Schema19ReasoningSummary, Tag("reasoning.summary")],
Annotated[Schema19ReasoningEncrypted, Tag("reasoning.encrypted")],
Annotated[Schema19ReasoningText, Tag("reasoning.text")],
],
Discriminator(lambda m: get_discriminator(m, "type", "type")),
]
@@ -8,7 +8,7 @@ from typing import Literal, Union
from typing_extensions import Annotated, TypeAliasType
Schema0Enum = Union[
Schema5Enum = Union[
Literal[
"AI21",
"AionLabs",
@@ -70,6 +70,7 @@ Schema0Enum = Union[
"Seed",
"SiliconFlow",
"Sourceful",
"StepFun",
"Stealth",
"StreamLake",
"Switchpoint",
@@ -86,10 +87,10 @@ Schema0Enum = Union[
]
Schema0TypedDict = TypeAliasType("Schema0TypedDict", Union[Schema0Enum, str])
Schema5TypedDict = TypeAliasType("Schema5TypedDict", Union[Schema5Enum, str])
Schema0 = TypeAliasType(
"Schema0",
Union[Annotated[Schema0Enum, PlainValidator(validate_open_enum(False))], str],
Schema5 = TypeAliasType(
"Schema5",
Union[Annotated[Schema5Enum, PlainValidator(validate_open_enum(False))], str],
)
@@ -1,7 +1,7 @@
"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
from __future__ import annotations
from ._schema2 import Schema2, Schema2TypedDict
from ._schema19 import Schema19, Schema19TypedDict
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[Schema2TypedDict]]
reasoning_details: NotRequired[List[Schema19TypedDict]]
images: NotRequired[List[ImageTypedDict]]
@@ -76,7 +76,7 @@ class AssistantMessage(BaseModel):
reasoning: OptionalNullable[str] = UNSET
reasoning_details: Optional[List[Schema2]] = None
reasoning_details: Optional[List[Schema19]] = None
images: Optional[List[Image]] = None
+34 -316
View File
@@ -1,7 +1,9 @@
"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
from __future__ import annotations
from ._schema0 import Schema0, Schema0TypedDict
from ._schema10 import Schema10, Schema10TypedDict
from ._schema17 import Schema17, Schema17TypedDict
from ._schema5 import Schema5, Schema5TypedDict
from .chatstreamoptions import ChatStreamOptions, ChatStreamOptionsTypedDict
from .message import Message, MessageTypedDict
from .providersortunion import ProviderSortUnion, ProviderSortUnionTypedDict
@@ -31,7 +33,7 @@ from typing import Any, Dict, List, Literal, Optional, Union
from typing_extensions import Annotated, NotRequired, TypeAliasType, TypedDict
ChatGenerationParamsDataCollection = Union[
Schema3 = Union[
Literal[
"deny",
"allow",
@@ -40,7 +42,7 @@ ChatGenerationParamsDataCollection = Union[
]
Quantizations = Union[
Schema8 = Union[
Literal[
"int4",
"int8",
@@ -56,38 +58,14 @@ Quantizations = Union[
]
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):
class Schema15TypedDict(TypedDict):
p50: NotRequired[Nullable[float]]
p75: NotRequired[Nullable[float]]
p90: NotRequired[Nullable[float]]
p99: NotRequired[Nullable[float]]
class ChatGenerationParamsPreferredMinThroughput(BaseModel):
class Schema15(BaseModel):
p50: OptionalNullable[float] = UNSET
p75: OptionalNullable[float] = UNSET
@@ -127,170 +105,60 @@ class ChatGenerationParamsPreferredMinThroughput(BaseModel):
return m
ChatGenerationParamsPreferredMinThroughputUnionTypedDict = TypeAliasType(
"ChatGenerationParamsPreferredMinThroughputUnionTypedDict",
Union[ChatGenerationParamsPreferredMinThroughputTypedDict, float],
Schema15UnionTypedDict = TypeAliasType(
"Schema15UnionTypedDict", Union[Schema15TypedDict, float]
)
ChatGenerationParamsPreferredMinThroughputUnion = TypeAliasType(
"ChatGenerationParamsPreferredMinThroughputUnion",
Union[ChatGenerationParamsPreferredMinThroughput, float],
)
Schema15Union = TypeAliasType("Schema15Union", Union[Schema15, float])
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):
class Schema0TypedDict(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]]
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.
"""
data_collection: NotRequired[Nullable[Schema3]]
zdr: NotRequired[Nullable[bool]]
enforce_distillable_text: NotRequired[Nullable[bool]]
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."""
order: NotRequired[Nullable[List[Schema5TypedDict]]]
only: NotRequired[Nullable[List[Schema5TypedDict]]]
ignore: NotRequired[Nullable[List[Schema5TypedDict]]]
quantizations: NotRequired[Nullable[List[Schema8]]]
sort: NotRequired[Nullable[ProviderSortUnionTypedDict]]
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."""
max_price: NotRequired[Schema10TypedDict]
preferred_min_throughput: NotRequired[Nullable[Schema15UnionTypedDict]]
preferred_max_latency: NotRequired[Nullable[Schema15UnionTypedDict]]
class ChatGenerationParamsProvider(BaseModel):
class Schema0(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[ChatGenerationParamsDataCollection],
PlainValidator(validate_open_enum(False)),
OptionalNullable[Schema3], 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[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."""
order: 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."""
only: 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."""
ignore: OptionalNullable[List[Schema5]] = UNSET
quantizations: OptionalNullable[
List[Annotated[Quantizations, PlainValidator(validate_open_enum(False))]]
List[Annotated[Schema8, 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[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."""
max_price: Optional[Schema10] = None
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_min_throughput: 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."""
preferred_max_latency: OptionalNullable[Schema15Union] = UNSET
@model_serializer(mode="wrap")
def serialize_model(self, handler):
@@ -350,150 +218,6 @@ class ChatGenerationParamsProvider(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",
@@ -636,12 +360,12 @@ class Debug(BaseModel):
ChatGenerationParamsImageConfigTypedDict = TypeAliasType(
"ChatGenerationParamsImageConfigTypedDict", Union[str, float]
"ChatGenerationParamsImageConfigTypedDict", Union[str, float, List[Any]]
)
ChatGenerationParamsImageConfig = TypeAliasType(
"ChatGenerationParamsImageConfig", Union[str, float]
"ChatGenerationParamsImageConfig", Union[str, float, List[Any]]
)
@@ -656,14 +380,11 @@ Modality = Union[
class ChatGenerationParamsTypedDict(TypedDict):
messages: List[MessageTypedDict]
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."""
provider: NotRequired[Nullable[Schema0TypedDict]]
plugins: NotRequired[List[Schema17TypedDict]]
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]]
@@ -692,11 +413,9 @@ class ChatGenerationParamsTypedDict(TypedDict):
class ChatGenerationParams(BaseModel):
messages: List[Message]
provider: OptionalNullable[ChatGenerationParamsProvider] = UNSET
r"""When multiple model providers are available, optionally indicate your routing preference."""
provider: OptionalNullable[Schema0] = UNSET
plugins: Optional[List[ChatGenerationParamsPluginUnion]] = None
r"""Plugins you want to enable for this request, including their settings."""
plugins: Optional[List[Schema17]] = None
route: Annotated[
OptionalNullable[Route], PlainValidator(validate_open_enum(False))
@@ -705,7 +424,6 @@ 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 ._schema2 import Schema2, Schema2TypedDict
from ._schema19 import Schema19, Schema19TypedDict
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[Schema2TypedDict]]
reasoning_details: NotRequired[List[Schema19TypedDict]]
class ChatStreamingMessageChunk(BaseModel):
@@ -41,7 +41,7 @@ class ChatStreamingMessageChunk(BaseModel):
tool_calls: Optional[List[ChatStreamingMessageToolCall]] = None
reasoning_details: Optional[List[Schema2]] = None
reasoning_details: Optional[List[Schema19]] = None
@model_serializer(mode="wrap")
def serialize_model(self, handler):
@@ -0,0 +1,41 @@
"""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
+6 -39
View File
@@ -2,47 +2,14 @@
from __future__ import annotations
from .assistantmessage import AssistantMessage, AssistantMessageTypedDict
from .chatmessagecontentitemtext import (
ChatMessageContentItemText,
ChatMessageContentItemTextTypedDict,
)
from .developermessage import DeveloperMessage, DeveloperMessageTypedDict
from .systemmessage import SystemMessage, SystemMessageTypedDict
from .toolresponsemessage import ToolResponseMessage, ToolResponseMessageTypedDict
from .usermessage import UserMessage, UserMessageTypedDict
from openrouter.types import BaseModel
from openrouter.utils import get_discriminator, validate_const
import pydantic
from openrouter.utils import get_discriminator
from pydantic import Discriminator, Tag
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
from typing import Union
from typing_extensions import Annotated, TypeAliasType
MessageTypedDict = TypeAliasType(
@@ -50,7 +17,7 @@ MessageTypedDict = TypeAliasType(
Union[
SystemMessageTypedDict,
UserMessageTypedDict,
MessageDeveloperTypedDict,
DeveloperMessageTypedDict,
ToolResponseMessageTypedDict,
AssistantMessageTypedDict,
],
@@ -61,7 +28,7 @@ Message = Annotated[
Union[
Annotated[SystemMessage, Tag("system")],
Annotated[UserMessage, Tag("user")],
Annotated[MessageDeveloper, Tag("developer")],
Annotated[DeveloperMessage, Tag("developer")],
Annotated[AssistantMessage, Tag("assistant")],
Annotated[ToolResponseMessage, Tag("tool")],
],
@@ -222,37 +222,29 @@ 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"""A value in string format that is a large number"""
r"""Price per million prompt tokens"""
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"""A value in string format that is a large number"""
r"""Price per million prompt tokens"""
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 OpenResponsesRequestProviderTypedDict(TypedDict):
class ProviderTypedDict(TypedDict):
r"""When multiple model providers are available, optionally indicate your routing preference."""
allow_fallbacks: NotRequired[Nullable[bool]]
@@ -291,7 +283,7 @@ class OpenResponsesRequestProviderTypedDict(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 OpenResponsesRequestProvider(BaseModel):
class Provider(BaseModel):
r"""When multiple model providers are available, optionally indicate your routing preference."""
allow_fallbacks: OptionalNullable[bool] = UNSET
@@ -406,13 +398,13 @@ class OpenResponsesRequestProvider(BaseModel):
IDResponseHealing = Literal["response-healing",]
class OpenResponsesRequestPluginResponseHealingTypedDict(TypedDict):
class PluginResponseHealingTypedDict(TypedDict):
id: IDResponseHealing
enabled: NotRequired[bool]
r"""Set to false to disable the response-healing plugin for this request. Defaults to true."""
class OpenResponsesRequestPluginResponseHealing(BaseModel):
class PluginResponseHealing(BaseModel):
id: IDResponseHealing
enabled: Optional[bool] = None
@@ -422,7 +414,7 @@ class OpenResponsesRequestPluginResponseHealing(BaseModel):
IDFileParser = Literal["file-parser",]
class OpenResponsesRequestPluginFileParserTypedDict(TypedDict):
class PluginFileParserTypedDict(TypedDict):
id: IDFileParser
enabled: NotRequired[bool]
r"""Set to false to disable the file-parser plugin for this request. Defaults to true."""
@@ -430,7 +422,7 @@ class OpenResponsesRequestPluginFileParserTypedDict(TypedDict):
r"""Options for PDF parsing."""
class OpenResponsesRequestPluginFileParser(BaseModel):
class PluginFileParser(BaseModel):
id: IDFileParser
enabled: Optional[bool] = None
@@ -443,7 +435,7 @@ class OpenResponsesRequestPluginFileParser(BaseModel):
IDWeb = Literal["web",]
class OpenResponsesRequestPluginWebTypedDict(TypedDict):
class PluginWebTypedDict(TypedDict):
id: IDWeb
enabled: NotRequired[bool]
r"""Set to false to disable the web-search plugin for this request. Defaults to true."""
@@ -453,7 +445,7 @@ class OpenResponsesRequestPluginWebTypedDict(TypedDict):
r"""The search engine to use for web search."""
class OpenResponsesRequestPluginWeb(BaseModel):
class PluginWeb(BaseModel):
id: IDWeb
enabled: Optional[bool] = None
@@ -472,18 +464,18 @@ class OpenResponsesRequestPluginWeb(BaseModel):
IDModeration = Literal["moderation",]
class OpenResponsesRequestPluginModerationTypedDict(TypedDict):
class PluginModerationTypedDict(TypedDict):
id: IDModeration
class OpenResponsesRequestPluginModeration(BaseModel):
class PluginModeration(BaseModel):
id: IDModeration
IDAutoRouter = Literal["auto-router",]
class OpenResponsesRequestPluginAutoRouterTypedDict(TypedDict):
class PluginAutoRouterTypedDict(TypedDict):
id: IDAutoRouter
enabled: NotRequired[bool]
r"""Set to false to disable the auto-router plugin for this request. Defaults to true."""
@@ -491,7 +483,7 @@ class OpenResponsesRequestPluginAutoRouterTypedDict(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 OpenResponsesRequestPluginAutoRouter(BaseModel):
class PluginAutoRouter(BaseModel):
id: IDAutoRouter
enabled: Optional[bool] = None
@@ -501,25 +493,25 @@ class OpenResponsesRequestPluginAutoRouter(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."""
OpenResponsesRequestPluginUnionTypedDict = TypeAliasType(
"OpenResponsesRequestPluginUnionTypedDict",
PluginTypedDict = TypeAliasType(
"PluginTypedDict",
Union[
OpenResponsesRequestPluginModerationTypedDict,
OpenResponsesRequestPluginResponseHealingTypedDict,
OpenResponsesRequestPluginAutoRouterTypedDict,
OpenResponsesRequestPluginFileParserTypedDict,
OpenResponsesRequestPluginWebTypedDict,
PluginModerationTypedDict,
PluginResponseHealingTypedDict,
PluginAutoRouterTypedDict,
PluginFileParserTypedDict,
PluginWebTypedDict,
],
)
OpenResponsesRequestPluginUnion = Annotated[
Plugin = Annotated[
Union[
Annotated[OpenResponsesRequestPluginAutoRouter, Tag("auto-router")],
Annotated[OpenResponsesRequestPluginModeration, Tag("moderation")],
Annotated[OpenResponsesRequestPluginWeb, Tag("web")],
Annotated[OpenResponsesRequestPluginFileParser, Tag("file-parser")],
Annotated[OpenResponsesRequestPluginResponseHealing, Tag("response-healing")],
Annotated[PluginAutoRouter, Tag("auto-router")],
Annotated[PluginModeration, Tag("moderation")],
Annotated[PluginWeb, Tag("web")],
Annotated[PluginFileParser, Tag("file-parser")],
Annotated[PluginResponseHealing, Tag("response-healing")],
],
Discriminator(lambda m: get_discriminator(m, "id", "id")),
]
@@ -564,9 +556,9 @@ class OpenResponsesRequestTypedDict(TypedDict):
service_tier: NotRequired[ServiceTier]
truncation: NotRequired[Nullable[Truncation]]
stream: NotRequired[bool]
provider: NotRequired[Nullable[OpenResponsesRequestProviderTypedDict]]
provider: NotRequired[Nullable[ProviderTypedDict]]
r"""When multiple model providers are available, optionally indicate your routing preference."""
plugins: NotRequired[List[OpenResponsesRequestPluginUnionTypedDict]]
plugins: NotRequired[List[PluginTypedDict]]
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."""
@@ -660,10 +652,10 @@ class OpenResponsesRequest(BaseModel):
stream: Optional[bool] = False
provider: OptionalNullable[OpenResponsesRequestProvider] = UNSET
provider: OptionalNullable[Provider] = UNSET
r"""When multiple model providers are available, optionally indicate your routing preference."""
plugins: Optional[List[OpenResponsesRequestPluginUnion]] = None
plugins: Optional[List[Plugin]] = None
r"""Plugins you want to enable for this request, including their settings."""
user: Optional[str] = None
@@ -67,6 +67,7 @@ ProviderName = Union[
"Seed",
"SiliconFlow",
"Sourceful",
"StepFun",
"Stealth",
"StreamLake",
"Switchpoint",
@@ -176,34 +176,26 @@ 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"""A value in string format that is a large number"""
r"""Price per million prompt tokens"""
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"""A value in string format that is a large number"""
r"""Price per million prompt tokens"""
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,73 +15,47 @@ 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,31 +10,18 @@ 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]
@@ -42,42 +29,29 @@ 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,6 +119,7 @@ ProviderName = Union[
"Seed",
"SiliconFlow",
"Sourceful",
"StepFun",
"Stealth",
"StreamLake",
"Switchpoint",
+16 -52
View File
@@ -84,16 +84,10 @@ class Responses(BaseSDK):
truncation: OptionalNullable[components.Truncation] = UNSET,
stream: Union[Literal[False], None] = None,
provider: OptionalNullable[
Union[
components.OpenResponsesRequestProvider,
components.OpenResponsesRequestProviderTypedDict,
]
Union[components.Provider, components.ProviderTypedDict]
] = UNSET,
plugins: Optional[
Union[
List[components.OpenResponsesRequestPluginUnion],
List[components.OpenResponsesRequestPluginUnionTypedDict],
]
Union[List[components.Plugin], List[components.PluginTypedDict]]
] = None,
user: Optional[str] = None,
session_id: Optional[str] = None,
@@ -212,16 +206,10 @@ class Responses(BaseSDK):
truncation: OptionalNullable[components.Truncation] = UNSET,
stream: Literal[True],
provider: OptionalNullable[
Union[
components.OpenResponsesRequestProvider,
components.OpenResponsesRequestProviderTypedDict,
]
Union[components.Provider, components.ProviderTypedDict]
] = UNSET,
plugins: Optional[
Union[
List[components.OpenResponsesRequestPluginUnion],
List[components.OpenResponsesRequestPluginUnionTypedDict],
]
Union[List[components.Plugin], List[components.PluginTypedDict]]
] = None,
user: Optional[str] = None,
session_id: Optional[str] = None,
@@ -339,16 +327,10 @@ class Responses(BaseSDK):
truncation: OptionalNullable[components.Truncation] = UNSET,
stream: Optional[bool] = False,
provider: OptionalNullable[
Union[
components.OpenResponsesRequestProvider,
components.OpenResponsesRequestProviderTypedDict,
]
Union[components.Provider, components.ProviderTypedDict]
] = UNSET,
plugins: Optional[
Union[
List[components.OpenResponsesRequestPluginUnion],
List[components.OpenResponsesRequestPluginUnionTypedDict],
]
Union[List[components.Plugin], List[components.PluginTypedDict]]
] = None,
user: Optional[str] = None,
session_id: Optional[str] = None,
@@ -453,10 +435,10 @@ class Responses(BaseSDK):
truncation=truncation,
stream=stream,
provider=utils.get_pydantic_model(
provider, OptionalNullable[components.OpenResponsesRequestProvider]
provider, OptionalNullable[components.Provider]
),
plugins=utils.get_pydantic_model(
plugins, Optional[List[components.OpenResponsesRequestPluginUnion]]
plugins, Optional[List[components.Plugin]]
),
user=user,
session_id=session_id,
@@ -717,16 +699,10 @@ class Responses(BaseSDK):
truncation: OptionalNullable[components.Truncation] = UNSET,
stream: Union[Literal[False], None] = None,
provider: OptionalNullable[
Union[
components.OpenResponsesRequestProvider,
components.OpenResponsesRequestProviderTypedDict,
]
Union[components.Provider, components.ProviderTypedDict]
] = UNSET,
plugins: Optional[
Union[
List[components.OpenResponsesRequestPluginUnion],
List[components.OpenResponsesRequestPluginUnionTypedDict],
]
Union[List[components.Plugin], List[components.PluginTypedDict]]
] = None,
user: Optional[str] = None,
session_id: Optional[str] = None,
@@ -845,16 +821,10 @@ class Responses(BaseSDK):
truncation: OptionalNullable[components.Truncation] = UNSET,
stream: Literal[True],
provider: OptionalNullable[
Union[
components.OpenResponsesRequestProvider,
components.OpenResponsesRequestProviderTypedDict,
]
Union[components.Provider, components.ProviderTypedDict]
] = UNSET,
plugins: Optional[
Union[
List[components.OpenResponsesRequestPluginUnion],
List[components.OpenResponsesRequestPluginUnionTypedDict],
]
Union[List[components.Plugin], List[components.PluginTypedDict]]
] = None,
user: Optional[str] = None,
session_id: Optional[str] = None,
@@ -972,16 +942,10 @@ class Responses(BaseSDK):
truncation: OptionalNullable[components.Truncation] = UNSET,
stream: Optional[bool] = False,
provider: OptionalNullable[
Union[
components.OpenResponsesRequestProvider,
components.OpenResponsesRequestProviderTypedDict,
]
Union[components.Provider, components.ProviderTypedDict]
] = UNSET,
plugins: Optional[
Union[
List[components.OpenResponsesRequestPluginUnion],
List[components.OpenResponsesRequestPluginUnionTypedDict],
]
Union[List[components.Plugin], List[components.PluginTypedDict]]
] = None,
user: Optional[str] = None,
session_id: Optional[str] = None,
@@ -1086,10 +1050,10 @@ class Responses(BaseSDK):
truncation=truncation,
stream=stream,
provider=utils.get_pydantic_model(
provider, OptionalNullable[components.OpenResponsesRequestProvider]
provider, OptionalNullable[components.Provider]
),
plugins=utils.get_pydantic_model(
plugins, Optional[List[components.OpenResponsesRequestPluginUnion]]
plugins, Optional[List[components.Plugin]]
),
user=user,
session_id=session_id,