diff --git a/.speakeasy/gen.lock b/.speakeasy/gen.lock
index d68657d..119e224 100644
--- a/.speakeasy/gen.lock
+++ b/.speakeasy/gen.lock
@@ -1,16 +1,17 @@
lockVersion: 2.0.0
id: 232c6d4f-b0fd-4172-8f1b-e2421566e9b4
management:
- docChecksum: 98b4f227e767bb91333b3b3469d93fa5
+ docChecksum: f629b0ca18ec064975608b5eea7aebfd
docVersion: 1.0.0
- speakeasyVersion: 1.611.1
- generationVersion: 2.694.1
- releaseVersion: 0.5.2
- configChecksum: 4619605fbeb6f4488feb5336aa62bab6
+ speakeasyVersion: 1.612.0
+ generationVersion: 2.695.0
+ releaseVersion: 0.6.2
+ configChecksum: f369a2bbdc8e34f44647641a40369e29
repoURL: https://github.com/speakeasy-sdks/openrouter-python-sdk.git
installationURL: https://github.com/speakeasy-sdks/openrouter-python-sdk.git
features:
python:
+ acceptHeaders: 3.0.0
additionalDependencies: 1.0.0
constsAndDefaults: 1.0.5
core: 5.20.3
@@ -24,6 +25,7 @@ features:
globalSecurityCallbacks: 1.0.0
globalSecurityFlattening: 1.0.0
globalServerURLs: 3.1.1
+ groups: 3.0.0
methodArguments: 1.0.2
nameOverrides: 3.0.1
nullables: 1.0.1
@@ -42,6 +44,7 @@ generatedFiles:
- USAGE.md
- docs/errors/chatcompletionerror.md
- docs/models/annotationdetail.md
+ - docs/models/audio.md
- docs/models/chatcompletion.md
- docs/models/chatcompletionassistantmessageparam.md
- docs/models/chatcompletionassistantmessageparamcontent.md
@@ -57,6 +60,7 @@ generatedFiles:
- docs/models/chatcompletionchunkchoicedeltatoolcalltype.md
- docs/models/chatcompletionchunkchoicefinishreason.md
- docs/models/chatcompletionchunkobject.md
+ - docs/models/chatcompletionchunkwrapper.md
- docs/models/chatcompletioncontentpart.md
- docs/models/chatcompletioncontentpartaudio.md
- docs/models/chatcompletioncontentpartaudioformat.md
@@ -67,50 +71,6 @@ generatedFiles:
- docs/models/chatcompletioncontentparttext.md
- docs/models/chatcompletioncontentparttexttype.md
- docs/models/chatcompletioncreateparams.md
- - docs/models/chatcompletioncreateparamsaudio.md
- - docs/models/chatcompletioncreateparamscompletion.md
- - docs/models/chatcompletioncreateparamsdatacollection.md
- - docs/models/chatcompletioncreateparamseffort.md
- - docs/models/chatcompletioncreateparamsengine.md
- - docs/models/chatcompletioncreateparamsidchainofthought.md
- - docs/models/chatcompletioncreateparamsidfileparser.md
- - docs/models/chatcompletioncreateparamsidmoderation.md
- - docs/models/chatcompletioncreateparamsidweb.md
- - docs/models/chatcompletioncreateparamsignoreenum.md
- - docs/models/chatcompletioncreateparamsignoreunion.md
- - docs/models/chatcompletioncreateparamsimage.md
- - docs/models/chatcompletioncreateparamsjsonschema.md
- - docs/models/chatcompletioncreateparamsmaxprice.md
- - docs/models/chatcompletioncreateparamsonlyenum.md
- - docs/models/chatcompletioncreateparamsonlyunion.md
- - docs/models/chatcompletioncreateparamsorderenum.md
- - docs/models/chatcompletioncreateparamsorderunion.md
- - docs/models/chatcompletioncreateparamspdf.md
- - docs/models/chatcompletioncreateparamspdfengine.md
- - docs/models/chatcompletioncreateparamspluginchainofthought.md
- - docs/models/chatcompletioncreateparamspluginfileparser.md
- - docs/models/chatcompletioncreateparamspluginmoderation.md
- - docs/models/chatcompletioncreateparamspluginunion.md
- - docs/models/chatcompletioncreateparamspluginweb.md
- - docs/models/chatcompletioncreateparamsprompt.md
- - docs/models/chatcompletioncreateparamsprovider.md
- - docs/models/chatcompletioncreateparamsquantization.md
- - docs/models/chatcompletioncreateparamsreasoning.md
- - docs/models/chatcompletioncreateparamsreasoningeffort.md
- - docs/models/chatcompletioncreateparamsrequest.md
- - docs/models/chatcompletioncreateparamsresponseformatgrammar.md
- - docs/models/chatcompletioncreateparamsresponseformatjsonobject.md
- - docs/models/chatcompletioncreateparamsresponseformatjsonschema.md
- - docs/models/chatcompletioncreateparamsresponseformatpython.md
- - docs/models/chatcompletioncreateparamsresponseformattext.md
- - docs/models/chatcompletioncreateparamsresponseformatunion.md
- - docs/models/chatcompletioncreateparamssort.md
- - docs/models/chatcompletioncreateparamsstop.md
- - docs/models/chatcompletioncreateparamsstreamoptions.md
- - docs/models/chatcompletioncreateparamstypegrammar.md
- - docs/models/chatcompletioncreateparamstypejsonobject.md
- - docs/models/chatcompletioncreateparamstypejsonschema.md
- - docs/models/chatcompletioncreateparamstypepython.md
- docs/models/chatcompletioncreateparamstypetext.md
- docs/models/chatcompletionmessage.md
- docs/models/chatcompletionmessageparam.md
@@ -140,67 +100,50 @@ generatedFiles:
- docs/models/chatcompletionusermessageparam.md
- docs/models/chatcompletionusermessageparamcontent.md
- docs/models/chatcompletionusermessageparamrole.md
- - docs/models/chatstreamcompletioncreateparams.md
- - docs/models/chatstreamcompletioncreateparamsaudio.md
- - docs/models/chatstreamcompletioncreateparamscompletion.md
- - docs/models/chatstreamcompletioncreateparamsdatacollection.md
- - docs/models/chatstreamcompletioncreateparamseffort.md
- - docs/models/chatstreamcompletioncreateparamsengine.md
- - docs/models/chatstreamcompletioncreateparamsidchainofthought.md
- - docs/models/chatstreamcompletioncreateparamsidfileparser.md
- - docs/models/chatstreamcompletioncreateparamsidmoderation.md
- - docs/models/chatstreamcompletioncreateparamsidweb.md
- - docs/models/chatstreamcompletioncreateparamsignoreenum.md
- - docs/models/chatstreamcompletioncreateparamsignoreunion.md
- - docs/models/chatstreamcompletioncreateparamsimage.md
- - docs/models/chatstreamcompletioncreateparamsjsonschema.md
- - docs/models/chatstreamcompletioncreateparamsmaxprice.md
- - docs/models/chatstreamcompletioncreateparamsonlyenum.md
- - docs/models/chatstreamcompletioncreateparamsonlyunion.md
- - docs/models/chatstreamcompletioncreateparamsorderenum.md
- - docs/models/chatstreamcompletioncreateparamsorderunion.md
- - docs/models/chatstreamcompletioncreateparamspdf.md
- - docs/models/chatstreamcompletioncreateparamspdfengine.md
- - docs/models/chatstreamcompletioncreateparamspluginchainofthought.md
- - docs/models/chatstreamcompletioncreateparamspluginfileparser.md
- - docs/models/chatstreamcompletioncreateparamspluginmoderation.md
- - docs/models/chatstreamcompletioncreateparamspluginunion.md
- - docs/models/chatstreamcompletioncreateparamspluginweb.md
- - docs/models/chatstreamcompletioncreateparamsprompt.md
- - docs/models/chatstreamcompletioncreateparamsprovider.md
- - docs/models/chatstreamcompletioncreateparamsquantization.md
- - docs/models/chatstreamcompletioncreateparamsreasoning.md
- - docs/models/chatstreamcompletioncreateparamsreasoningeffort.md
- - docs/models/chatstreamcompletioncreateparamsrequest.md
- - docs/models/chatstreamcompletioncreateparamsresponseformatgrammar.md
- - docs/models/chatstreamcompletioncreateparamsresponseformatjsonobject.md
- - docs/models/chatstreamcompletioncreateparamsresponseformatjsonschema.md
- - docs/models/chatstreamcompletioncreateparamsresponseformatpython.md
- - docs/models/chatstreamcompletioncreateparamsresponseformattext.md
- - docs/models/chatstreamcompletioncreateparamsresponseformatunion.md
- - docs/models/chatstreamcompletioncreateparamssort.md
- - docs/models/chatstreamcompletioncreateparamsstop.md
- - docs/models/chatstreamcompletioncreateparamsstreamoptions.md
- - docs/models/chatstreamcompletioncreateparamstypegrammar.md
- - docs/models/chatstreamcompletioncreateparamstypejsonobject.md
- - docs/models/chatstreamcompletioncreateparamstypejsonschema.md
- - docs/models/chatstreamcompletioncreateparamstypepython.md
- - docs/models/chatstreamcompletioncreateparamstypetext.md
+ - docs/models/completion.md
- docs/models/completiontokensdetails.md
- docs/models/completionusage.md
- docs/models/contentimageurl.md
- docs/models/contenttext.md
- docs/models/contenttypeimageurl.md
- docs/models/contenttypetext.md
+ - docs/models/createchatcompletionresponse.md
+ - docs/models/datacollection.md
- docs/models/detail.md
+ - docs/models/effort.md
+ - docs/models/engine.md
- docs/models/error.md
- docs/models/file.md
- docs/models/fileannotationdetail.md
- docs/models/fileannotationdetailcontentunion.md
- docs/models/fileannotationdetailimageurl.md
+ - docs/models/idchainofthought.md
+ - docs/models/idfileparser.md
+ - docs/models/idmoderation.md
+ - docs/models/idweb.md
+ - docs/models/ignore.md
+ - docs/models/ignoreenum.md
+ - docs/models/image.md
- docs/models/inputaudio.md
+ - docs/models/jsonschema.md
+ - docs/models/maxprice.md
+ - docs/models/only.md
+ - docs/models/onlyenum.md
+ - docs/models/order.md
+ - docs/models/orderenum.md
- docs/models/parameters.md
+ - docs/models/pdf.md
+ - docs/models/pdfengine.md
+ - docs/models/plugin.md
+ - docs/models/pluginchainofthought.md
+ - docs/models/pluginfileparser.md
+ - docs/models/pluginmoderation.md
+ - docs/models/pluginweb.md
+ - docs/models/prompt.md
- docs/models/prompttokensdetails.md
+ - docs/models/provider.md
+ - docs/models/quantization.md
+ - docs/models/reasoning.md
- docs/models/reasoningdetail.md
- docs/models/reasoningdetailencrypted.md
- docs/models/reasoningdetailencryptedformat.md
@@ -211,11 +154,25 @@ generatedFiles:
- docs/models/reasoningdetailtext.md
- docs/models/reasoningdetailtextformat.md
- docs/models/reasoningdetailtexttype.md
+ - docs/models/reasoningeffort.md
+ - docs/models/request.md
+ - docs/models/responseformat.md
+ - docs/models/responseformatgrammar.md
+ - docs/models/responseformatjsonobject.md
+ - docs/models/responseformatjsonschema.md
- docs/models/responseformatjsonschemaschema.md
+ - docs/models/responseformatpython.md
+ - docs/models/responseformattext.md
- docs/models/security.md
- - docs/models/streamchatcompletionresponsebody.md
+ - docs/models/sort.md
+ - docs/models/stop.md
+ - docs/models/streamoptions.md
- docs/models/toplogprob.md
- docs/models/typefile.md
+ - docs/models/typegrammar.md
+ - docs/models/typejsonobject.md
+ - docs/models/typejsonschema.md
+ - docs/models/typepython.md
- docs/models/urlcitation.md
- docs/models/urlcitationannotationdetail.md
- docs/models/urlcitationannotationdetailtype.md
@@ -250,6 +207,7 @@ generatedFiles:
- src/openrouter/models/chatcompletionchunkchoice.py
- src/openrouter/models/chatcompletionchunkchoicedelta.py
- src/openrouter/models/chatcompletionchunkchoicedeltatoolcall.py
+ - src/openrouter/models/chatcompletionchunkwrapper.py
- src/openrouter/models/chatcompletioncontentpart.py
- src/openrouter/models/chatcompletioncontentpartaudio.py
- src/openrouter/models/chatcompletioncontentpartimage.py
@@ -267,8 +225,8 @@ generatedFiles:
- src/openrouter/models/chatcompletiontoolchoiceoption.py
- src/openrouter/models/chatcompletiontoolmessageparam.py
- src/openrouter/models/chatcompletionusermessageparam.py
- - src/openrouter/models/chatstreamcompletioncreateparams.py
- src/openrouter/models/completionusage.py
+ - src/openrouter/models/createchatcompletionop.py
- src/openrouter/models/fileannotationdetail.py
- src/openrouter/models/reasoningdetail.py
- src/openrouter/models/reasoningdetailencrypted.py
@@ -276,7 +234,6 @@ generatedFiles:
- src/openrouter/models/reasoningdetailtext.py
- src/openrouter/models/responseformatjsonschemaschema.py
- src/openrouter/models/security.py
- - src/openrouter/models/streamchatcompletionop.py
- src/openrouter/models/urlcitationannotationdetail.py
- src/openrouter/py.typed
- src/openrouter/sdk.py
diff --git a/.speakeasy/gen.yaml b/.speakeasy/gen.yaml
index f8e576d..4ab3dff 100644
--- a/.speakeasy/gen.yaml
+++ b/.speakeasy/gen.yaml
@@ -19,13 +19,14 @@ generation:
auth:
oAuth2ClientCredentialsEnabled: true
oAuth2PasswordEnabled: true
+ inferSSEOverload: true
sdkHooksConfigAccess: true
tests:
generateTests: false
generateNewTests: true
skipResponseBodyAssertions: false
python:
- version: 0.5.2
+ version: 0.6.2
additionalDependencies:
dev: {}
main: {}
diff --git a/.speakeasy/in.openapi.yaml b/.speakeasy/in.openapi.yaml
index 6fb845b..72fe017 100644
--- a/.speakeasy/in.openapi.yaml
+++ b/.speakeasy/in.openapi.yaml
@@ -1499,22 +1499,13 @@ components:
required:
- messages
description: Chat completion request parameters
- ChatStreamCompletionCreateParams:
- allOf:
- - $ref: '#/components/schemas/ChatCompletionCreateParams'
- - type: object
- properties:
- stream:
- type: boolean
- enum:
- - true
- default: true
- description: Enable streaming response
parameters: {}
paths:
/chat/completions:
post:
operationId: createChatCompletion
+ x-speakeasy-group: chat
+ x-speakeasy-name-override: complete
summary: Create a chat completion
description: Creates a model response for the given chat conversation. Supports both streaming and non-streaming modes.
tags:
@@ -1534,57 +1525,10 @@ paths:
schema:
$ref: '#/components/schemas/ChatCompletion'
description: Non-streaming response when stream=false
- '400':
- description: Bad request - invalid parameters
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/ChatCompletionError'
- '401':
- description: Unauthorized - invalid API key
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/ChatCompletionError'
- '429':
- description: Too many requests - rate limit exceeded
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/ChatCompletionError'
- '500':
- description: Internal server error
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/ChatCompletionError'
- x-speakeasy-name-override: complete
- /chat/completions#stream:
- post:
- operationId: streamChatCompletion
- summary: Create a chat completion
- description: Creates a model response for the given chat conversation. Supports both streaming and non-streaming modes.
- tags:
- - Chat
- requestBody:
- description: Chat completion request parameters
- required: true
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/ChatStreamCompletionCreateParams'
- responses:
- '200':
- description: Successful chat completion response
- content:
text/event-stream:
x-speakeasy-sse-sentinel: '[DONE]'
schema:
- type: object
- required: [data]
- properties:
- data:
- $ref: '#/components/schemas/ChatCompletionChunk'
+ $ref: '#/components/schemas/ChatCompletionChunkWrapper'
'400':
description: Bad request - invalid parameters
content:
@@ -1609,4 +1553,3 @@ paths:
application/json:
schema:
$ref: '#/components/schemas/ChatCompletionError'
- x-speakeasy-name-override: completeStream
diff --git a/.speakeasy/out.openapi.yaml b/.speakeasy/out.openapi.yaml
index 6fb845b..72fe017 100644
--- a/.speakeasy/out.openapi.yaml
+++ b/.speakeasy/out.openapi.yaml
@@ -1499,22 +1499,13 @@ components:
required:
- messages
description: Chat completion request parameters
- ChatStreamCompletionCreateParams:
- allOf:
- - $ref: '#/components/schemas/ChatCompletionCreateParams'
- - type: object
- properties:
- stream:
- type: boolean
- enum:
- - true
- default: true
- description: Enable streaming response
parameters: {}
paths:
/chat/completions:
post:
operationId: createChatCompletion
+ x-speakeasy-group: chat
+ x-speakeasy-name-override: complete
summary: Create a chat completion
description: Creates a model response for the given chat conversation. Supports both streaming and non-streaming modes.
tags:
@@ -1534,57 +1525,10 @@ paths:
schema:
$ref: '#/components/schemas/ChatCompletion'
description: Non-streaming response when stream=false
- '400':
- description: Bad request - invalid parameters
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/ChatCompletionError'
- '401':
- description: Unauthorized - invalid API key
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/ChatCompletionError'
- '429':
- description: Too many requests - rate limit exceeded
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/ChatCompletionError'
- '500':
- description: Internal server error
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/ChatCompletionError'
- x-speakeasy-name-override: complete
- /chat/completions#stream:
- post:
- operationId: streamChatCompletion
- summary: Create a chat completion
- description: Creates a model response for the given chat conversation. Supports both streaming and non-streaming modes.
- tags:
- - Chat
- requestBody:
- description: Chat completion request parameters
- required: true
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/ChatStreamCompletionCreateParams'
- responses:
- '200':
- description: Successful chat completion response
- content:
text/event-stream:
x-speakeasy-sse-sentinel: '[DONE]'
schema:
- type: object
- required: [data]
- properties:
- data:
- $ref: '#/components/schemas/ChatCompletionChunk'
+ $ref: '#/components/schemas/ChatCompletionChunkWrapper'
'400':
description: Bad request - invalid parameters
content:
@@ -1609,4 +1553,3 @@ paths:
application/json:
schema:
$ref: '#/components/schemas/ChatCompletionError'
- x-speakeasy-name-override: completeStream
diff --git a/.speakeasy/workflow.lock b/.speakeasy/workflow.lock
index 2f80ddc..c876d24 100644
--- a/.speakeasy/workflow.lock
+++ b/.speakeasy/workflow.lock
@@ -1,4 +1,4 @@
-speakeasyVersion: 1.611.1
+speakeasyVersion: 1.612.0
sources:
OpenRouter Chat Completions API:
sourceNamespace: open-router-chat-completions-api
diff --git a/README-PYPI.md b/README-PYPI.md
index cdffb3c..0eaf719 100644
--- a/README-PYPI.md
+++ b/README-PYPI.md
@@ -140,8 +140,10 @@ with OpenRouter(
},
], stream=False, temperature=1, top_p=1)
- # Handle response
- print(res)
+ with res as event_stream:
+ for event in event_stream:
+ # handle event
+ print(event, flush=True)
```
@@ -166,8 +168,10 @@ async def main():
},
], stream=False, temperature=1, top_p=1)
- # Handle response
- print(res)
+ async with res as event_stream:
+ async for event in event_stream:
+ # handle event
+ print(event, flush=True)
asyncio.run(main())
```
@@ -201,8 +205,10 @@ with OpenRouter(
},
], stream=False, temperature=1, top_p=1)
- # Handle response
- print(res)
+ with res as event_stream:
+ for event in event_stream:
+ # handle event
+ print(event, flush=True)
```
@@ -216,7 +222,6 @@ with OpenRouter(
### [chat](https://github.com/speakeasy-sdks/openrouter-python-sdk/blob/master/docs/sdks/chat/README.md)
* [complete](https://github.com/speakeasy-sdks/openrouter-python-sdk/blob/master/docs/sdks/chat/README.md#complete) - Create a chat completion
-* [complete_stream](https://github.com/speakeasy-sdks/openrouter-python-sdk/blob/master/docs/sdks/chat/README.md#complete_stream) - Create a chat completion
@@ -243,12 +248,12 @@ with OpenRouter(
api_key=os.getenv("OPENROUTER_API_KEY", ""),
) as open_router:
- res = open_router.chat.complete_stream(messages=[
+ res = open_router.chat.complete(messages=[
{
"role": "user",
"content": "Hello, how are you?",
},
- ], stream=True, temperature=1, top_p=1)
+ ], stream=False, temperature=1, top_p=1)
with res as event_stream:
for event in event_stream:
@@ -286,8 +291,10 @@ with OpenRouter(
], stream=False, temperature=1, top_p=1,
RetryConfig("backoff", BackoffStrategy(1, 50, 1.1, 100), False))
- # Handle response
- print(res)
+ with res as event_stream:
+ for event in event_stream:
+ # handle event
+ print(event, flush=True)
```
@@ -310,8 +317,10 @@ with OpenRouter(
},
], stream=False, temperature=1, top_p=1)
- # Handle response
- print(res)
+ with res as event_stream:
+ for event in event_stream:
+ # handle event
+ print(event, flush=True)
```
@@ -349,8 +358,10 @@ with OpenRouter(
},
], stream=False, temperature=1, top_p=1)
- # Handle response
- print(res)
+ with res as event_stream:
+ for event in event_stream:
+ # handle event
+ print(event, flush=True)
except errors.OpenRouterError as e:
@@ -417,8 +428,10 @@ with OpenRouter(
},
], stream=False, temperature=1, top_p=1)
- # Handle response
- print(res)
+ with res as event_stream:
+ for event in event_stream:
+ # handle event
+ print(event, flush=True)
```
@@ -442,8 +455,10 @@ with OpenRouter(
},
], stream=False, temperature=1, top_p=1)
- # Handle response
- print(res)
+ with res as event_stream:
+ for event in event_stream:
+ # handle event
+ print(event, flush=True)
```
diff --git a/README.md b/README.md
index c092889..4bdfdbe 100644
--- a/README.md
+++ b/README.md
@@ -140,8 +140,10 @@ with OpenRouter(
},
], stream=False, temperature=1, top_p=1)
- # Handle response
- print(res)
+ with res as event_stream:
+ for event in event_stream:
+ # handle event
+ print(event, flush=True)
```
@@ -166,8 +168,10 @@ async def main():
},
], stream=False, temperature=1, top_p=1)
- # Handle response
- print(res)
+ async with res as event_stream:
+ async for event in event_stream:
+ # handle event
+ print(event, flush=True)
asyncio.run(main())
```
@@ -201,8 +205,10 @@ with OpenRouter(
},
], stream=False, temperature=1, top_p=1)
- # Handle response
- print(res)
+ with res as event_stream:
+ for event in event_stream:
+ # handle event
+ print(event, flush=True)
```
@@ -216,7 +222,6 @@ with OpenRouter(
### [chat](docs/sdks/chat/README.md)
* [complete](docs/sdks/chat/README.md#complete) - Create a chat completion
-* [complete_stream](docs/sdks/chat/README.md#complete_stream) - Create a chat completion
@@ -243,12 +248,12 @@ with OpenRouter(
api_key=os.getenv("OPENROUTER_API_KEY", ""),
) as open_router:
- res = open_router.chat.complete_stream(messages=[
+ res = open_router.chat.complete(messages=[
{
"role": "user",
"content": "Hello, how are you?",
},
- ], stream=True, temperature=1, top_p=1)
+ ], stream=False, temperature=1, top_p=1)
with res as event_stream:
for event in event_stream:
@@ -286,8 +291,10 @@ with OpenRouter(
], stream=False, temperature=1, top_p=1,
RetryConfig("backoff", BackoffStrategy(1, 50, 1.1, 100), False))
- # Handle response
- print(res)
+ with res as event_stream:
+ for event in event_stream:
+ # handle event
+ print(event, flush=True)
```
@@ -310,8 +317,10 @@ with OpenRouter(
},
], stream=False, temperature=1, top_p=1)
- # Handle response
- print(res)
+ with res as event_stream:
+ for event in event_stream:
+ # handle event
+ print(event, flush=True)
```
@@ -349,8 +358,10 @@ with OpenRouter(
},
], stream=False, temperature=1, top_p=1)
- # Handle response
- print(res)
+ with res as event_stream:
+ for event in event_stream:
+ # handle event
+ print(event, flush=True)
except errors.OpenRouterError as e:
@@ -417,8 +428,10 @@ with OpenRouter(
},
], stream=False, temperature=1, top_p=1)
- # Handle response
- print(res)
+ with res as event_stream:
+ for event in event_stream:
+ # handle event
+ print(event, flush=True)
```
@@ -442,8 +455,10 @@ with OpenRouter(
},
], stream=False, temperature=1, top_p=1)
- # Handle response
- print(res)
+ with res as event_stream:
+ for event in event_stream:
+ # handle event
+ print(event, flush=True)
```
diff --git a/USAGE.md b/USAGE.md
index c79eaba..3eba06a 100644
--- a/USAGE.md
+++ b/USAGE.md
@@ -16,8 +16,10 @@ with OpenRouter(
},
], stream=False, temperature=1, top_p=1)
- # Handle response
- print(res)
+ with res as event_stream:
+ for event in event_stream:
+ # handle event
+ print(event, flush=True)
```
@@ -42,8 +44,10 @@ async def main():
},
], stream=False, temperature=1, top_p=1)
- # Handle response
- print(res)
+ async with res as event_stream:
+ async for event in event_stream:
+ # handle event
+ print(event, flush=True)
asyncio.run(main())
```
diff --git a/docs/models/chatcompletioncreateparamsaudio.md b/docs/models/audio.md
similarity index 85%
rename from docs/models/chatcompletioncreateparamsaudio.md
rename to docs/models/audio.md
index e60d0c8..8c0f701 100644
--- a/docs/models/chatcompletioncreateparamsaudio.md
+++ b/docs/models/audio.md
@@ -1,4 +1,4 @@
-# ChatCompletionCreateParamsAudio
+# Audio
## Supported Types
diff --git a/docs/models/streamchatcompletionresponsebody.md b/docs/models/chatcompletionchunkwrapper.md
similarity index 91%
rename from docs/models/streamchatcompletionresponsebody.md
rename to docs/models/chatcompletionchunkwrapper.md
index a0cca72..7d111d0 100644
--- a/docs/models/streamchatcompletionresponsebody.md
+++ b/docs/models/chatcompletionchunkwrapper.md
@@ -1,6 +1,4 @@
-# StreamChatCompletionResponseBody
-
-Successful chat completion response
+# ChatCompletionChunkWrapper
## Fields
diff --git a/docs/models/chatcompletioncreateparams.md b/docs/models/chatcompletioncreateparams.md
index 4ad0570..d0ce250 100644
--- a/docs/models/chatcompletioncreateparams.md
+++ b/docs/models/chatcompletioncreateparams.md
@@ -5,30 +5,30 @@ Chat completion request parameters
## Fields
-| Field | Type | Required | Description | Example |
-| ---------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------- |
-| `messages` | List[[models.ChatCompletionMessageParam](../models/chatcompletionmessageparam.md)] | :heavy_check_mark: | List of messages for the conversation | [
{
"role": "user",
"content": "Hello, how are you?"
}
] |
-| `model` | *Optional[str]* | :heavy_minus_sign: | Model to use for completion | |
-| `frequency_penalty` | *OptionalNullable[float]* | :heavy_minus_sign: | Frequency penalty (-2.0 to 2.0) | |
-| `logit_bias` | Dict[str, *float*] | :heavy_minus_sign: | Token logit bias adjustments | |
-| `logprobs` | *OptionalNullable[bool]* | :heavy_minus_sign: | Return log probabilities | |
-| `top_logprobs` | *OptionalNullable[float]* | :heavy_minus_sign: | Number of top log probabilities to return (0-20) | |
-| `max_completion_tokens` | *OptionalNullable[float]* | :heavy_minus_sign: | Maximum tokens in completion | |
-| `max_tokens` | *OptionalNullable[float]* | :heavy_minus_sign: | Maximum tokens (deprecated, use max_completion_tokens) | |
-| `metadata` | Dict[str, *str*] | :heavy_minus_sign: | Key-value pairs for additional object information (max 16 pairs, 64 char keys, 512 char values) | |
-| `presence_penalty` | *OptionalNullable[float]* | :heavy_minus_sign: | Presence penalty (-2.0 to 2.0) | |
-| `reasoning` | [OptionalNullable[models.ChatCompletionCreateParamsReasoning]](../models/chatcompletioncreateparamsreasoning.md) | :heavy_minus_sign: | Reasoning configuration | |
-| `response_format` | [Optional[models.ChatCompletionCreateParamsResponseFormatUnion]](../models/chatcompletioncreateparamsresponseformatunion.md) | :heavy_minus_sign: | Response format configuration | |
-| `seed` | *OptionalNullable[int]* | :heavy_minus_sign: | Random seed for deterministic outputs | |
-| `stop` | [OptionalNullable[models.ChatCompletionCreateParamsStop]](../models/chatcompletioncreateparamsstop.md) | :heavy_minus_sign: | Stop sequences (up to 4) | |
-| `stream` | *OptionalNullable[bool]* | :heavy_minus_sign: | Enable streaming response | |
-| `stream_options` | [OptionalNullable[models.ChatCompletionCreateParamsStreamOptions]](../models/chatcompletioncreateparamsstreamoptions.md) | :heavy_minus_sign: | N/A | |
-| `temperature` | *OptionalNullable[float]* | :heavy_minus_sign: | Sampling temperature (0-2) | |
-| `tool_choice` | [Optional[models.ChatCompletionToolChoiceOption]](../models/chatcompletiontoolchoiceoption.md) | :heavy_minus_sign: | Tool choice configuration | |
-| `tools` | List[[models.ChatCompletionTool](../models/chatcompletiontool.md)] | :heavy_minus_sign: | Available tools for function calling | |
-| `top_p` | *OptionalNullable[float]* | :heavy_minus_sign: | Nucleus sampling parameter (0-1) | |
-| `user` | *Optional[str]* | :heavy_minus_sign: | Unique user identifier | |
-| `fallback_models` | List[*str*] | :heavy_minus_sign: | Order of models to fallback to for this request | |
-| `reasoning_effort` | [OptionalNullable[models.ChatCompletionCreateParamsReasoningEffort]](../models/chatcompletioncreateparamsreasoningeffort.md) | :heavy_minus_sign: | Reasoning effort | |
-| `provider` | [OptionalNullable[models.ChatCompletionCreateParamsProvider]](../models/chatcompletioncreateparamsprovider.md) | :heavy_minus_sign: | When multiple model providers are available, optionally indicate your routing preference. | |
-| `plugins` | List[[models.ChatCompletionCreateParamsPluginUnion](../models/chatcompletioncreateparamspluginunion.md)] | :heavy_minus_sign: | Plugins you want to enable for this request, including their settings. | |
\ No newline at end of file
+| Field | Type | Required | Description | Example |
+| ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- |
+| `messages` | List[[models.ChatCompletionMessageParam](../models/chatcompletionmessageparam.md)] | :heavy_check_mark: | List of messages for the conversation | [
{
"role": "user",
"content": "Hello, how are you?"
}
] |
+| `model` | *Optional[str]* | :heavy_minus_sign: | Model to use for completion | |
+| `frequency_penalty` | *OptionalNullable[float]* | :heavy_minus_sign: | Frequency penalty (-2.0 to 2.0) | |
+| `logit_bias` | Dict[str, *float*] | :heavy_minus_sign: | Token logit bias adjustments | |
+| `logprobs` | *OptionalNullable[bool]* | :heavy_minus_sign: | Return log probabilities | |
+| `top_logprobs` | *OptionalNullable[float]* | :heavy_minus_sign: | Number of top log probabilities to return (0-20) | |
+| `max_completion_tokens` | *OptionalNullable[float]* | :heavy_minus_sign: | Maximum tokens in completion | |
+| `max_tokens` | *OptionalNullable[float]* | :heavy_minus_sign: | Maximum tokens (deprecated, use max_completion_tokens) | |
+| `metadata` | Dict[str, *str*] | :heavy_minus_sign: | Key-value pairs for additional object information (max 16 pairs, 64 char keys, 512 char values) | |
+| `presence_penalty` | *OptionalNullable[float]* | :heavy_minus_sign: | Presence penalty (-2.0 to 2.0) | |
+| `reasoning` | [OptionalNullable[models.Reasoning]](../models/reasoning.md) | :heavy_minus_sign: | Reasoning configuration | |
+| `response_format` | [Optional[models.ResponseFormat]](../models/responseformat.md) | :heavy_minus_sign: | Response format configuration | |
+| `seed` | *OptionalNullable[int]* | :heavy_minus_sign: | Random seed for deterministic outputs | |
+| `stop` | [OptionalNullable[models.Stop]](../models/stop.md) | :heavy_minus_sign: | Stop sequences (up to 4) | |
+| `stream` | *OptionalNullable[bool]* | :heavy_minus_sign: | Enable streaming response | |
+| `stream_options` | [OptionalNullable[models.StreamOptions]](../models/streamoptions.md) | :heavy_minus_sign: | N/A | |
+| `temperature` | *OptionalNullable[float]* | :heavy_minus_sign: | Sampling temperature (0-2) | |
+| `tool_choice` | [Optional[models.ChatCompletionToolChoiceOption]](../models/chatcompletiontoolchoiceoption.md) | :heavy_minus_sign: | Tool choice configuration | |
+| `tools` | List[[models.ChatCompletionTool](../models/chatcompletiontool.md)] | :heavy_minus_sign: | Available tools for function calling | |
+| `top_p` | *OptionalNullable[float]* | :heavy_minus_sign: | Nucleus sampling parameter (0-1) | |
+| `user` | *Optional[str]* | :heavy_minus_sign: | Unique user identifier | |
+| `fallback_models` | List[*str*] | :heavy_minus_sign: | Order of models to fallback to for this request | |
+| `reasoning_effort` | [OptionalNullable[models.ReasoningEffort]](../models/reasoningeffort.md) | :heavy_minus_sign: | Reasoning effort | |
+| `provider` | [OptionalNullable[models.Provider]](../models/provider.md) | :heavy_minus_sign: | When multiple model providers are available, optionally indicate your routing preference. | |
+| `plugins` | List[[models.Plugin](../models/plugin.md)] | :heavy_minus_sign: | Plugins you want to enable for this request, including their settings. | |
\ No newline at end of file
diff --git a/docs/models/chatcompletioncreateparamscompletion.md b/docs/models/chatcompletioncreateparamscompletion.md
deleted file mode 100644
index 0718ff0..0000000
--- a/docs/models/chatcompletioncreateparamscompletion.md
+++ /dev/null
@@ -1,23 +0,0 @@
-# ChatCompletionCreateParamsCompletion
-
-
-## Supported Types
-
-### `float`
-
-```python
-value: float = /* values here */
-```
-
-### `str`
-
-```python
-value: str = /* values here */
-```
-
-### `Any`
-
-```python
-value: Any = /* values here */
-```
-
diff --git a/docs/models/chatcompletioncreateparamsignoreunion.md b/docs/models/chatcompletioncreateparamsignoreunion.md
deleted file mode 100644
index 96cc708..0000000
--- a/docs/models/chatcompletioncreateparamsignoreunion.md
+++ /dev/null
@@ -1,17 +0,0 @@
-# ChatCompletionCreateParamsIgnoreUnion
-
-
-## Supported Types
-
-### `models.ChatCompletionCreateParamsIgnoreEnum`
-
-```python
-value: models.ChatCompletionCreateParamsIgnoreEnum = /* values here */
-```
-
-### `str`
-
-```python
-value: str = /* values here */
-```
-
diff --git a/docs/models/chatcompletioncreateparamsmaxprice.md b/docs/models/chatcompletioncreateparamsmaxprice.md
deleted file mode 100644
index 21a9f9d..0000000
--- a/docs/models/chatcompletioncreateparamsmaxprice.md
+++ /dev/null
@@ -1,14 +0,0 @@
-# ChatCompletionCreateParamsMaxPrice
-
-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[models.ChatCompletionCreateParamsPrompt]](../models/chatcompletioncreateparamsprompt.md) | :heavy_minus_sign: | N/A |
-| `completion` | [Optional[models.ChatCompletionCreateParamsCompletion]](../models/chatcompletioncreateparamscompletion.md) | :heavy_minus_sign: | N/A |
-| `image` | [Optional[models.ChatCompletionCreateParamsImage]](../models/chatcompletioncreateparamsimage.md) | :heavy_minus_sign: | N/A |
-| `audio` | [Optional[models.ChatCompletionCreateParamsAudio]](../models/chatcompletioncreateparamsaudio.md) | :heavy_minus_sign: | N/A |
-| `request` | [Optional[models.ChatCompletionCreateParamsRequest]](../models/chatcompletioncreateparamsrequest.md) | :heavy_minus_sign: | N/A |
\ No newline at end of file
diff --git a/docs/models/chatcompletioncreateparamsonlyunion.md b/docs/models/chatcompletioncreateparamsonlyunion.md
deleted file mode 100644
index 190e394..0000000
--- a/docs/models/chatcompletioncreateparamsonlyunion.md
+++ /dev/null
@@ -1,17 +0,0 @@
-# ChatCompletionCreateParamsOnlyUnion
-
-
-## Supported Types
-
-### `models.ChatCompletionCreateParamsOnlyEnum`
-
-```python
-value: models.ChatCompletionCreateParamsOnlyEnum = /* values here */
-```
-
-### `str`
-
-```python
-value: str = /* values here */
-```
-
diff --git a/docs/models/chatcompletioncreateparamsorderunion.md b/docs/models/chatcompletioncreateparamsorderunion.md
deleted file mode 100644
index 5b1429e..0000000
--- a/docs/models/chatcompletioncreateparamsorderunion.md
+++ /dev/null
@@ -1,17 +0,0 @@
-# ChatCompletionCreateParamsOrderUnion
-
-
-## Supported Types
-
-### `models.ChatCompletionCreateParamsOrderEnum`
-
-```python
-value: models.ChatCompletionCreateParamsOrderEnum = /* values here */
-```
-
-### `str`
-
-```python
-value: str = /* values here */
-```
-
diff --git a/docs/models/chatcompletioncreateparamspdf.md b/docs/models/chatcompletioncreateparamspdf.md
deleted file mode 100644
index e95b198..0000000
--- a/docs/models/chatcompletioncreateparamspdf.md
+++ /dev/null
@@ -1,8 +0,0 @@
-# ChatCompletionCreateParamsPdf
-
-
-## Fields
-
-| Field | Type | Required | Description |
-| -------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------- |
-| `engine` | [Optional[models.ChatCompletionCreateParamsPdfEngine]](../models/chatcompletioncreateparamspdfengine.md) | :heavy_minus_sign: | N/A |
\ No newline at end of file
diff --git a/docs/models/chatcompletioncreateparamspluginchainofthought.md b/docs/models/chatcompletioncreateparamspluginchainofthought.md
deleted file mode 100644
index 98d012b..0000000
--- a/docs/models/chatcompletioncreateparamspluginchainofthought.md
+++ /dev/null
@@ -1,8 +0,0 @@
-# ChatCompletionCreateParamsPluginChainOfThought
-
-
-## Fields
-
-| Field | Type | Required | Description |
-| ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ |
-| `id` | [models.ChatCompletionCreateParamsIDChainOfThought](../models/chatcompletioncreateparamsidchainofthought.md) | :heavy_check_mark: | N/A |
\ No newline at end of file
diff --git a/docs/models/chatcompletioncreateparamspluginfileparser.md b/docs/models/chatcompletioncreateparamspluginfileparser.md
deleted file mode 100644
index 6d060a6..0000000
--- a/docs/models/chatcompletioncreateparamspluginfileparser.md
+++ /dev/null
@@ -1,10 +0,0 @@
-# ChatCompletionCreateParamsPluginFileParser
-
-
-## Fields
-
-| Field | Type | Required | Description |
-| ---------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------- |
-| `id` | [models.ChatCompletionCreateParamsIDFileParser](../models/chatcompletioncreateparamsidfileparser.md) | :heavy_check_mark: | N/A |
-| `max_files` | *Optional[float]* | :heavy_minus_sign: | N/A |
-| `pdf` | [Optional[models.ChatCompletionCreateParamsPdf]](../models/chatcompletioncreateparamspdf.md) | :heavy_minus_sign: | N/A |
\ No newline at end of file
diff --git a/docs/models/chatcompletioncreateparamspluginmoderation.md b/docs/models/chatcompletioncreateparamspluginmoderation.md
deleted file mode 100644
index a213ea0..0000000
--- a/docs/models/chatcompletioncreateparamspluginmoderation.md
+++ /dev/null
@@ -1,8 +0,0 @@
-# ChatCompletionCreateParamsPluginModeration
-
-
-## Fields
-
-| Field | Type | Required | Description |
-| ---------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------- |
-| `id` | [models.ChatCompletionCreateParamsIDModeration](../models/chatcompletioncreateparamsidmoderation.md) | :heavy_check_mark: | N/A |
\ No newline at end of file
diff --git a/docs/models/chatcompletioncreateparamspluginunion.md b/docs/models/chatcompletioncreateparamspluginunion.md
deleted file mode 100644
index f326c21..0000000
--- a/docs/models/chatcompletioncreateparamspluginunion.md
+++ /dev/null
@@ -1,29 +0,0 @@
-# ChatCompletionCreateParamsPluginUnion
-
-
-## Supported Types
-
-### `models.ChatCompletionCreateParamsPluginModeration`
-
-```python
-value: models.ChatCompletionCreateParamsPluginModeration = /* values here */
-```
-
-### `models.ChatCompletionCreateParamsPluginWeb`
-
-```python
-value: models.ChatCompletionCreateParamsPluginWeb = /* values here */
-```
-
-### `models.ChatCompletionCreateParamsPluginChainOfThought`
-
-```python
-value: models.ChatCompletionCreateParamsPluginChainOfThought = /* values here */
-```
-
-### `models.ChatCompletionCreateParamsPluginFileParser`
-
-```python
-value: models.ChatCompletionCreateParamsPluginFileParser = /* values here */
-```
-
diff --git a/docs/models/chatcompletioncreateparamspluginweb.md b/docs/models/chatcompletioncreateparamspluginweb.md
deleted file mode 100644
index 9796a17..0000000
--- a/docs/models/chatcompletioncreateparamspluginweb.md
+++ /dev/null
@@ -1,11 +0,0 @@
-# ChatCompletionCreateParamsPluginWeb
-
-
-## Fields
-
-| Field | Type | Required | Description |
-| -------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------- |
-| `id` | [models.ChatCompletionCreateParamsIDWeb](../models/chatcompletioncreateparamsidweb.md) | :heavy_check_mark: | N/A |
-| `max_results` | *Optional[float]* | :heavy_minus_sign: | N/A |
-| `search_prompt` | *Optional[str]* | :heavy_minus_sign: | N/A |
-| `engine` | [Optional[models.ChatCompletionCreateParamsEngine]](../models/chatcompletioncreateparamsengine.md) | :heavy_minus_sign: | N/A |
\ No newline at end of file
diff --git a/docs/models/chatcompletioncreateparamsreasoning.md b/docs/models/chatcompletioncreateparamsreasoning.md
deleted file mode 100644
index d2374f7..0000000
--- a/docs/models/chatcompletioncreateparamsreasoning.md
+++ /dev/null
@@ -1,13 +0,0 @@
-# ChatCompletionCreateParamsReasoning
-
-Reasoning configuration
-
-
-## Fields
-
-| Field | Type | Required | Description |
-| ---------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------- |
-| `enabled` | *Optional[bool]* | :heavy_minus_sign: | Enables reasoning with default settings. Only work for some models. |
-| `effort` | [OptionalNullable[models.ChatCompletionCreateParamsEffort]](../models/chatcompletioncreateparamseffort.md) | :heavy_minus_sign: | OpenAI-style reasoning effort setting |
-| `max_tokens` | *OptionalNullable[float]* | :heavy_minus_sign: | non-OpenAI-style reasoning effort setting |
-| `exclude` | *Optional[bool]* | :heavy_minus_sign: | N/A |
\ No newline at end of file
diff --git a/docs/models/chatcompletioncreateparamsresponseformatgrammar.md b/docs/models/chatcompletioncreateparamsresponseformatgrammar.md
deleted file mode 100644
index 4b4275a..0000000
--- a/docs/models/chatcompletioncreateparamsresponseformatgrammar.md
+++ /dev/null
@@ -1,11 +0,0 @@
-# ChatCompletionCreateParamsResponseFormatGrammar
-
-Custom grammar response format
-
-
-## Fields
-
-| Field | Type | Required | Description |
-| -------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------- |
-| `type` | [models.ChatCompletionCreateParamsTypeGrammar](../models/chatcompletioncreateparamstypegrammar.md) | :heavy_check_mark: | N/A |
-| `grammar` | *str* | :heavy_check_mark: | Custom grammar for text generation |
\ No newline at end of file
diff --git a/docs/models/chatcompletioncreateparamsresponseformatjsonobject.md b/docs/models/chatcompletioncreateparamsresponseformatjsonobject.md
deleted file mode 100644
index 0de86bb..0000000
--- a/docs/models/chatcompletioncreateparamsresponseformatjsonobject.md
+++ /dev/null
@@ -1,10 +0,0 @@
-# ChatCompletionCreateParamsResponseFormatJSONObject
-
-JSON object response format
-
-
-## Fields
-
-| Field | Type | Required | Description |
-| -------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------- |
-| `type` | [models.ChatCompletionCreateParamsTypeJSONObject](../models/chatcompletioncreateparamstypejsonobject.md) | :heavy_check_mark: | N/A |
\ No newline at end of file
diff --git a/docs/models/chatcompletioncreateparamsresponseformatjsonschema.md b/docs/models/chatcompletioncreateparamsresponseformatjsonschema.md
deleted file mode 100644
index 9bd34e0..0000000
--- a/docs/models/chatcompletioncreateparamsresponseformatjsonschema.md
+++ /dev/null
@@ -1,11 +0,0 @@
-# ChatCompletionCreateParamsResponseFormatJSONSchema
-
-JSON Schema response format for structured outputs
-
-
-## Fields
-
-| Field | Type | Required | Description |
-| -------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------- |
-| `type` | [models.ChatCompletionCreateParamsTypeJSONSchema](../models/chatcompletioncreateparamstypejsonschema.md) | :heavy_check_mark: | N/A |
-| `json_schema` | [models.ChatCompletionCreateParamsJSONSchema](../models/chatcompletioncreateparamsjsonschema.md) | :heavy_check_mark: | N/A |
\ No newline at end of file
diff --git a/docs/models/chatcompletioncreateparamsresponseformatpython.md b/docs/models/chatcompletioncreateparamsresponseformatpython.md
deleted file mode 100644
index 770b61a..0000000
--- a/docs/models/chatcompletioncreateparamsresponseformatpython.md
+++ /dev/null
@@ -1,10 +0,0 @@
-# ChatCompletionCreateParamsResponseFormatPython
-
-Python code response format
-
-
-## Fields
-
-| Field | Type | Required | Description |
-| ------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------ |
-| `type` | [models.ChatCompletionCreateParamsTypePython](../models/chatcompletioncreateparamstypepython.md) | :heavy_check_mark: | N/A |
\ No newline at end of file
diff --git a/docs/models/chatcompletioncreateparamsresponseformatunion.md b/docs/models/chatcompletioncreateparamsresponseformatunion.md
deleted file mode 100644
index 5b66aef..0000000
--- a/docs/models/chatcompletioncreateparamsresponseformatunion.md
+++ /dev/null
@@ -1,37 +0,0 @@
-# ChatCompletionCreateParamsResponseFormatUnion
-
-Response format configuration
-
-
-## Supported Types
-
-### `models.ChatCompletionCreateParamsResponseFormatText`
-
-```python
-value: models.ChatCompletionCreateParamsResponseFormatText = /* values here */
-```
-
-### `models.ChatCompletionCreateParamsResponseFormatJSONObject`
-
-```python
-value: models.ChatCompletionCreateParamsResponseFormatJSONObject = /* values here */
-```
-
-### `models.ChatCompletionCreateParamsResponseFormatJSONSchema`
-
-```python
-value: models.ChatCompletionCreateParamsResponseFormatJSONSchema = /* values here */
-```
-
-### `models.ChatCompletionCreateParamsResponseFormatGrammar`
-
-```python
-value: models.ChatCompletionCreateParamsResponseFormatGrammar = /* values here */
-```
-
-### `models.ChatCompletionCreateParamsResponseFormatPython`
-
-```python
-value: models.ChatCompletionCreateParamsResponseFormatPython = /* values here */
-```
-
diff --git a/docs/models/chatstreamcompletioncreateparams.md b/docs/models/chatstreamcompletioncreateparams.md
deleted file mode 100644
index a67bebf..0000000
--- a/docs/models/chatstreamcompletioncreateparams.md
+++ /dev/null
@@ -1,34 +0,0 @@
-# ChatStreamCompletionCreateParams
-
-Chat completion request parameters
-
-
-## Fields
-
-| Field | Type | Required | Description | Example |
-| ---------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------- |
-| `messages` | List[[models.ChatCompletionMessageParam](../models/chatcompletionmessageparam.md)] | :heavy_check_mark: | List of messages for the conversation | [
{
"role": "user",
"content": "Hello, how are you?"
}
] |
-| `model` | *Optional[str]* | :heavy_minus_sign: | Model to use for completion | |
-| `frequency_penalty` | *OptionalNullable[float]* | :heavy_minus_sign: | Frequency penalty (-2.0 to 2.0) | |
-| `logit_bias` | Dict[str, *float*] | :heavy_minus_sign: | Token logit bias adjustments | |
-| `logprobs` | *OptionalNullable[bool]* | :heavy_minus_sign: | Return log probabilities | |
-| `top_logprobs` | *OptionalNullable[float]* | :heavy_minus_sign: | Number of top log probabilities to return (0-20) | |
-| `max_completion_tokens` | *OptionalNullable[float]* | :heavy_minus_sign: | Maximum tokens in completion | |
-| `max_tokens` | *OptionalNullable[float]* | :heavy_minus_sign: | Maximum tokens (deprecated, use max_completion_tokens) | |
-| `metadata` | Dict[str, *str*] | :heavy_minus_sign: | Key-value pairs for additional object information (max 16 pairs, 64 char keys, 512 char values) | |
-| `presence_penalty` | *OptionalNullable[float]* | :heavy_minus_sign: | Presence penalty (-2.0 to 2.0) | |
-| `reasoning` | [OptionalNullable[models.ChatStreamCompletionCreateParamsReasoning]](../models/chatstreamcompletioncreateparamsreasoning.md) | :heavy_minus_sign: | Reasoning configuration | |
-| `response_format` | [Optional[models.ChatStreamCompletionCreateParamsResponseFormatUnion]](../models/chatstreamcompletioncreateparamsresponseformatunion.md) | :heavy_minus_sign: | Response format configuration | |
-| `seed` | *OptionalNullable[int]* | :heavy_minus_sign: | Random seed for deterministic outputs | |
-| `stop` | [OptionalNullable[models.ChatStreamCompletionCreateParamsStop]](../models/chatstreamcompletioncreateparamsstop.md) | :heavy_minus_sign: | Stop sequences (up to 4) | |
-| `stream` | *Optional[bool]* | :heavy_minus_sign: | Enable streaming response | |
-| `stream_options` | [OptionalNullable[models.ChatStreamCompletionCreateParamsStreamOptions]](../models/chatstreamcompletioncreateparamsstreamoptions.md) | :heavy_minus_sign: | N/A | |
-| `temperature` | *OptionalNullable[float]* | :heavy_minus_sign: | Sampling temperature (0-2) | |
-| `tool_choice` | [Optional[models.ChatCompletionToolChoiceOption]](../models/chatcompletiontoolchoiceoption.md) | :heavy_minus_sign: | Tool choice configuration | |
-| `tools` | List[[models.ChatCompletionTool](../models/chatcompletiontool.md)] | :heavy_minus_sign: | Available tools for function calling | |
-| `top_p` | *OptionalNullable[float]* | :heavy_minus_sign: | Nucleus sampling parameter (0-1) | |
-| `user` | *Optional[str]* | :heavy_minus_sign: | Unique user identifier | |
-| `fallback_models` | List[*str*] | :heavy_minus_sign: | Order of models to fallback to for this request | |
-| `reasoning_effort` | [OptionalNullable[models.ChatStreamCompletionCreateParamsReasoningEffort]](../models/chatstreamcompletioncreateparamsreasoningeffort.md) | :heavy_minus_sign: | Reasoning effort | |
-| `provider` | [OptionalNullable[models.ChatStreamCompletionCreateParamsProvider]](../models/chatstreamcompletioncreateparamsprovider.md) | :heavy_minus_sign: | When multiple model providers are available, optionally indicate your routing preference. | |
-| `plugins` | List[[models.ChatStreamCompletionCreateParamsPluginUnion](../models/chatstreamcompletioncreateparamspluginunion.md)] | :heavy_minus_sign: | Plugins you want to enable for this request, including their settings. | |
\ No newline at end of file
diff --git a/docs/models/chatstreamcompletioncreateparamsaudio.md b/docs/models/chatstreamcompletioncreateparamsaudio.md
deleted file mode 100644
index af8432b..0000000
--- a/docs/models/chatstreamcompletioncreateparamsaudio.md
+++ /dev/null
@@ -1,23 +0,0 @@
-# ChatStreamCompletionCreateParamsAudio
-
-
-## Supported Types
-
-### `float`
-
-```python
-value: float = /* values here */
-```
-
-### `str`
-
-```python
-value: str = /* values here */
-```
-
-### `Any`
-
-```python
-value: Any = /* values here */
-```
-
diff --git a/docs/models/chatstreamcompletioncreateparamscompletion.md b/docs/models/chatstreamcompletioncreateparamscompletion.md
deleted file mode 100644
index ce56e0b..0000000
--- a/docs/models/chatstreamcompletioncreateparamscompletion.md
+++ /dev/null
@@ -1,23 +0,0 @@
-# ChatStreamCompletionCreateParamsCompletion
-
-
-## Supported Types
-
-### `float`
-
-```python
-value: float = /* values here */
-```
-
-### `str`
-
-```python
-value: str = /* values here */
-```
-
-### `Any`
-
-```python
-value: Any = /* values here */
-```
-
diff --git a/docs/models/chatstreamcompletioncreateparamsdatacollection.md b/docs/models/chatstreamcompletioncreateparamsdatacollection.md
deleted file mode 100644
index 9972e0c..0000000
--- a/docs/models/chatstreamcompletioncreateparamsdatacollection.md
+++ /dev/null
@@ -1,14 +0,0 @@
-# ChatStreamCompletionCreateParamsDataCollection
-
-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.
-
-
-
-## Values
-
-| Name | Value |
-| ------- | ------- |
-| `DENY` | deny |
-| `ALLOW` | allow |
\ No newline at end of file
diff --git a/docs/models/chatstreamcompletioncreateparamseffort.md b/docs/models/chatstreamcompletioncreateparamseffort.md
deleted file mode 100644
index 3a250fe..0000000
--- a/docs/models/chatstreamcompletioncreateparamseffort.md
+++ /dev/null
@@ -1,13 +0,0 @@
-# ChatStreamCompletionCreateParamsEffort
-
-OpenAI-style reasoning effort setting
-
-
-## Values
-
-| Name | Value |
-| --------- | --------- |
-| `HIGH` | high |
-| `MEDIUM` | medium |
-| `LOW` | low |
-| `MINIMAL` | minimal |
\ No newline at end of file
diff --git a/docs/models/chatstreamcompletioncreateparamsengine.md b/docs/models/chatstreamcompletioncreateparamsengine.md
deleted file mode 100644
index eab43e0..0000000
--- a/docs/models/chatstreamcompletioncreateparamsengine.md
+++ /dev/null
@@ -1,9 +0,0 @@
-# ChatStreamCompletionCreateParamsEngine
-
-
-## Values
-
-| Name | Value |
-| -------- | -------- |
-| `NATIVE` | native |
-| `EXA` | exa |
\ No newline at end of file
diff --git a/docs/models/chatstreamcompletioncreateparamsidchainofthought.md b/docs/models/chatstreamcompletioncreateparamsidchainofthought.md
deleted file mode 100644
index b27f206..0000000
--- a/docs/models/chatstreamcompletioncreateparamsidchainofthought.md
+++ /dev/null
@@ -1,8 +0,0 @@
-# ChatStreamCompletionCreateParamsIDChainOfThought
-
-
-## Values
-
-| Name | Value |
-| ------------------ | ------------------ |
-| `CHAIN_OF_THOUGHT` | chain-of-thought |
\ No newline at end of file
diff --git a/docs/models/chatstreamcompletioncreateparamsidfileparser.md b/docs/models/chatstreamcompletioncreateparamsidfileparser.md
deleted file mode 100644
index 1f968ce..0000000
--- a/docs/models/chatstreamcompletioncreateparamsidfileparser.md
+++ /dev/null
@@ -1,8 +0,0 @@
-# ChatStreamCompletionCreateParamsIDFileParser
-
-
-## Values
-
-| Name | Value |
-| ------------- | ------------- |
-| `FILE_PARSER` | file-parser |
\ No newline at end of file
diff --git a/docs/models/chatstreamcompletioncreateparamsidmoderation.md b/docs/models/chatstreamcompletioncreateparamsidmoderation.md
deleted file mode 100644
index 3d87f7f..0000000
--- a/docs/models/chatstreamcompletioncreateparamsidmoderation.md
+++ /dev/null
@@ -1,8 +0,0 @@
-# ChatStreamCompletionCreateParamsIDModeration
-
-
-## Values
-
-| Name | Value |
-| ------------ | ------------ |
-| `MODERATION` | moderation |
\ No newline at end of file
diff --git a/docs/models/chatstreamcompletioncreateparamsidweb.md b/docs/models/chatstreamcompletioncreateparamsidweb.md
deleted file mode 100644
index 19e697e..0000000
--- a/docs/models/chatstreamcompletioncreateparamsidweb.md
+++ /dev/null
@@ -1,8 +0,0 @@
-# ChatStreamCompletionCreateParamsIDWeb
-
-
-## Values
-
-| Name | Value |
-| ----- | ----- |
-| `WEB` | web |
\ No newline at end of file
diff --git a/docs/models/chatstreamcompletioncreateparamsignoreenum.md b/docs/models/chatstreamcompletioncreateparamsignoreenum.md
deleted file mode 100644
index e46f946..0000000
--- a/docs/models/chatstreamcompletioncreateparamsignoreenum.md
+++ /dev/null
@@ -1,85 +0,0 @@
-# ChatStreamCompletionCreateParamsIgnoreEnum
-
-
-## Values
-
-| Name | Value |
-| ------------------ | ------------------ |
-| `ANY_SCALE` | AnyScale |
-| `CENT_ML` | Cent-ML |
-| `HUGGING_FACE` | HuggingFace |
-| `HYPERBOLIC_2` | Hyperbolic 2 |
-| `LEPTON` | Lepton |
-| `LYNN_2` | Lynn 2 |
-| `LYNN` | Lynn |
-| `MANCER` | Mancer |
-| `MODAL` | Modal |
-| `OCTO_AI` | OctoAI |
-| `RECURSAL` | Recursal |
-| `REFLECTION` | Reflection |
-| `REPLICATE` | Replicate |
-| `SAMBA_NOVA_2` | SambaNova 2 |
-| `SF_COMPUTE` | SF Compute |
-| `TOGETHER_2` | Together 2 |
-| `ONE_DOT_AI` | 01.AI |
-| `AI21` | AI21 |
-| `AION_LABS` | AionLabs |
-| `ALIBABA` | Alibaba |
-| `AMAZON_BEDROCK` | Amazon Bedrock |
-| `ANTHROPIC` | Anthropic |
-| `ATLAS_CLOUD` | AtlasCloud |
-| `ATOMA` | Atoma |
-| `AVIAN` | Avian |
-| `AZURE` | Azure |
-| `BASE_TEN` | BaseTen |
-| `CEREBRAS` | Cerebras |
-| `CHUTES` | Chutes |
-| `CLOUDFLARE` | Cloudflare |
-| `COHERE` | Cohere |
-| `CROF_AI` | CrofAI |
-| `CRUSOE` | Crusoe |
-| `DEEP_INFRA` | DeepInfra |
-| `DEEP_SEEK` | DeepSeek |
-| `ENFER` | Enfer |
-| `FEATHERLESS` | Featherless |
-| `FIREWORKS` | Fireworks |
-| `FRIENDLI` | Friendli |
-| `GMI_CLOUD` | GMICloud |
-| `GOOGLE` | Google |
-| `GOOGLE_AI_STUDIO` | Google AI Studio |
-| `GROQ` | Groq |
-| `HYPERBOLIC` | Hyperbolic |
-| `INCEPTION` | Inception |
-| `INFERENCE_NET` | InferenceNet |
-| `INFERMATIC` | Infermatic |
-| `INFLECTION` | Inflection |
-| `INO_CLOUD` | InoCloud |
-| `KLUSTER` | Kluster |
-| `LAMBDA` | Lambda |
-| `LIQUID` | Liquid |
-| `MANCER_2` | Mancer 2 |
-| `META` | Meta |
-| `MINIMAX` | Minimax |
-| `MISTRAL` | Mistral |
-| `MOONSHOT_AI` | Moonshot AI |
-| `MORPH` | Morph |
-| `N_COMPASS` | NCompass |
-| `NEBIUS` | Nebius |
-| `NEXT_BIT` | NextBit |
-| `NINETEEN` | Nineteen |
-| `NOVITA` | Novita |
-| `OPEN_AI` | OpenAI |
-| `OPEN_INFERENCE` | OpenInference |
-| `PARASAIL` | Parasail |
-| `PERPLEXITY` | Perplexity |
-| `PHALA` | Phala |
-| `SAMBA_NOVA` | SambaNova |
-| `STEALTH` | Stealth |
-| `SWITCHPOINT` | Switchpoint |
-| `TARGON` | Targon |
-| `TOGETHER` | Together |
-| `UBICLOUD` | Ubicloud |
-| `VENICE` | Venice |
-| `WAND_B` | WandB |
-| `X_AI` | xAI |
-| `Z_AI` | Z.AI |
\ No newline at end of file
diff --git a/docs/models/chatstreamcompletioncreateparamsignoreunion.md b/docs/models/chatstreamcompletioncreateparamsignoreunion.md
deleted file mode 100644
index 46fc295..0000000
--- a/docs/models/chatstreamcompletioncreateparamsignoreunion.md
+++ /dev/null
@@ -1,17 +0,0 @@
-# ChatStreamCompletionCreateParamsIgnoreUnion
-
-
-## Supported Types
-
-### `models.ChatStreamCompletionCreateParamsIgnoreEnum`
-
-```python
-value: models.ChatStreamCompletionCreateParamsIgnoreEnum = /* values here */
-```
-
-### `str`
-
-```python
-value: str = /* values here */
-```
-
diff --git a/docs/models/chatstreamcompletioncreateparamsimage.md b/docs/models/chatstreamcompletioncreateparamsimage.md
deleted file mode 100644
index 29e9b4b..0000000
--- a/docs/models/chatstreamcompletioncreateparamsimage.md
+++ /dev/null
@@ -1,23 +0,0 @@
-# ChatStreamCompletionCreateParamsImage
-
-
-## Supported Types
-
-### `float`
-
-```python
-value: float = /* values here */
-```
-
-### `str`
-
-```python
-value: str = /* values here */
-```
-
-### `Any`
-
-```python
-value: Any = /* values here */
-```
-
diff --git a/docs/models/chatstreamcompletioncreateparamsjsonschema.md b/docs/models/chatstreamcompletioncreateparamsjsonschema.md
deleted file mode 100644
index 8a7dc08..0000000
--- a/docs/models/chatstreamcompletioncreateparamsjsonschema.md
+++ /dev/null
@@ -1,11 +0,0 @@
-# ChatStreamCompletionCreateParamsJSONSchema
-
-
-## Fields
-
-| Field | Type | Required | Description |
-| ---------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------- |
-| `name` | *str* | :heavy_check_mark: | Schema name (a-z, A-Z, 0-9, underscores, dashes, max 64 chars) |
-| `description` | *Optional[str]* | :heavy_minus_sign: | Schema description for the model |
-| `schema_` | [Optional[models.ResponseFormatJSONSchemaSchema]](../models/responseformatjsonschemaschema.md) | :heavy_minus_sign: | The schema for the response format, described as a JSON Schema object |
-| `strict` | *OptionalNullable[bool]* | :heavy_minus_sign: | Enable strict schema adherence |
\ No newline at end of file
diff --git a/docs/models/chatstreamcompletioncreateparamsmaxprice.md b/docs/models/chatstreamcompletioncreateparamsmaxprice.md
deleted file mode 100644
index a631f50..0000000
--- a/docs/models/chatstreamcompletioncreateparamsmaxprice.md
+++ /dev/null
@@ -1,14 +0,0 @@
-# ChatStreamCompletionCreateParamsMaxPrice
-
-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[models.ChatStreamCompletionCreateParamsPrompt]](../models/chatstreamcompletioncreateparamsprompt.md) | :heavy_minus_sign: | N/A |
-| `completion` | [Optional[models.ChatStreamCompletionCreateParamsCompletion]](../models/chatstreamcompletioncreateparamscompletion.md) | :heavy_minus_sign: | N/A |
-| `image` | [Optional[models.ChatStreamCompletionCreateParamsImage]](../models/chatstreamcompletioncreateparamsimage.md) | :heavy_minus_sign: | N/A |
-| `audio` | [Optional[models.ChatStreamCompletionCreateParamsAudio]](../models/chatstreamcompletioncreateparamsaudio.md) | :heavy_minus_sign: | N/A |
-| `request` | [Optional[models.ChatStreamCompletionCreateParamsRequest]](../models/chatstreamcompletioncreateparamsrequest.md) | :heavy_minus_sign: | N/A |
\ No newline at end of file
diff --git a/docs/models/chatstreamcompletioncreateparamsonlyenum.md b/docs/models/chatstreamcompletioncreateparamsonlyenum.md
deleted file mode 100644
index e038932..0000000
--- a/docs/models/chatstreamcompletioncreateparamsonlyenum.md
+++ /dev/null
@@ -1,85 +0,0 @@
-# ChatStreamCompletionCreateParamsOnlyEnum
-
-
-## Values
-
-| Name | Value |
-| ------------------ | ------------------ |
-| `ANY_SCALE` | AnyScale |
-| `CENT_ML` | Cent-ML |
-| `HUGGING_FACE` | HuggingFace |
-| `HYPERBOLIC_2` | Hyperbolic 2 |
-| `LEPTON` | Lepton |
-| `LYNN_2` | Lynn 2 |
-| `LYNN` | Lynn |
-| `MANCER` | Mancer |
-| `MODAL` | Modal |
-| `OCTO_AI` | OctoAI |
-| `RECURSAL` | Recursal |
-| `REFLECTION` | Reflection |
-| `REPLICATE` | Replicate |
-| `SAMBA_NOVA_2` | SambaNova 2 |
-| `SF_COMPUTE` | SF Compute |
-| `TOGETHER_2` | Together 2 |
-| `ONE_DOT_AI` | 01.AI |
-| `AI21` | AI21 |
-| `AION_LABS` | AionLabs |
-| `ALIBABA` | Alibaba |
-| `AMAZON_BEDROCK` | Amazon Bedrock |
-| `ANTHROPIC` | Anthropic |
-| `ATLAS_CLOUD` | AtlasCloud |
-| `ATOMA` | Atoma |
-| `AVIAN` | Avian |
-| `AZURE` | Azure |
-| `BASE_TEN` | BaseTen |
-| `CEREBRAS` | Cerebras |
-| `CHUTES` | Chutes |
-| `CLOUDFLARE` | Cloudflare |
-| `COHERE` | Cohere |
-| `CROF_AI` | CrofAI |
-| `CRUSOE` | Crusoe |
-| `DEEP_INFRA` | DeepInfra |
-| `DEEP_SEEK` | DeepSeek |
-| `ENFER` | Enfer |
-| `FEATHERLESS` | Featherless |
-| `FIREWORKS` | Fireworks |
-| `FRIENDLI` | Friendli |
-| `GMI_CLOUD` | GMICloud |
-| `GOOGLE` | Google |
-| `GOOGLE_AI_STUDIO` | Google AI Studio |
-| `GROQ` | Groq |
-| `HYPERBOLIC` | Hyperbolic |
-| `INCEPTION` | Inception |
-| `INFERENCE_NET` | InferenceNet |
-| `INFERMATIC` | Infermatic |
-| `INFLECTION` | Inflection |
-| `INO_CLOUD` | InoCloud |
-| `KLUSTER` | Kluster |
-| `LAMBDA` | Lambda |
-| `LIQUID` | Liquid |
-| `MANCER_2` | Mancer 2 |
-| `META` | Meta |
-| `MINIMAX` | Minimax |
-| `MISTRAL` | Mistral |
-| `MOONSHOT_AI` | Moonshot AI |
-| `MORPH` | Morph |
-| `N_COMPASS` | NCompass |
-| `NEBIUS` | Nebius |
-| `NEXT_BIT` | NextBit |
-| `NINETEEN` | Nineteen |
-| `NOVITA` | Novita |
-| `OPEN_AI` | OpenAI |
-| `OPEN_INFERENCE` | OpenInference |
-| `PARASAIL` | Parasail |
-| `PERPLEXITY` | Perplexity |
-| `PHALA` | Phala |
-| `SAMBA_NOVA` | SambaNova |
-| `STEALTH` | Stealth |
-| `SWITCHPOINT` | Switchpoint |
-| `TARGON` | Targon |
-| `TOGETHER` | Together |
-| `UBICLOUD` | Ubicloud |
-| `VENICE` | Venice |
-| `WAND_B` | WandB |
-| `X_AI` | xAI |
-| `Z_AI` | Z.AI |
\ No newline at end of file
diff --git a/docs/models/chatstreamcompletioncreateparamsonlyunion.md b/docs/models/chatstreamcompletioncreateparamsonlyunion.md
deleted file mode 100644
index 18f6d13..0000000
--- a/docs/models/chatstreamcompletioncreateparamsonlyunion.md
+++ /dev/null
@@ -1,17 +0,0 @@
-# ChatStreamCompletionCreateParamsOnlyUnion
-
-
-## Supported Types
-
-### `models.ChatStreamCompletionCreateParamsOnlyEnum`
-
-```python
-value: models.ChatStreamCompletionCreateParamsOnlyEnum = /* values here */
-```
-
-### `str`
-
-```python
-value: str = /* values here */
-```
-
diff --git a/docs/models/chatstreamcompletioncreateparamsorderenum.md b/docs/models/chatstreamcompletioncreateparamsorderenum.md
deleted file mode 100644
index 2b1105c..0000000
--- a/docs/models/chatstreamcompletioncreateparamsorderenum.md
+++ /dev/null
@@ -1,85 +0,0 @@
-# ChatStreamCompletionCreateParamsOrderEnum
-
-
-## Values
-
-| Name | Value |
-| ------------------ | ------------------ |
-| `ANY_SCALE` | AnyScale |
-| `CENT_ML` | Cent-ML |
-| `HUGGING_FACE` | HuggingFace |
-| `HYPERBOLIC_2` | Hyperbolic 2 |
-| `LEPTON` | Lepton |
-| `LYNN_2` | Lynn 2 |
-| `LYNN` | Lynn |
-| `MANCER` | Mancer |
-| `MODAL` | Modal |
-| `OCTO_AI` | OctoAI |
-| `RECURSAL` | Recursal |
-| `REFLECTION` | Reflection |
-| `REPLICATE` | Replicate |
-| `SAMBA_NOVA_2` | SambaNova 2 |
-| `SF_COMPUTE` | SF Compute |
-| `TOGETHER_2` | Together 2 |
-| `ONE_DOT_AI` | 01.AI |
-| `AI21` | AI21 |
-| `AION_LABS` | AionLabs |
-| `ALIBABA` | Alibaba |
-| `AMAZON_BEDROCK` | Amazon Bedrock |
-| `ANTHROPIC` | Anthropic |
-| `ATLAS_CLOUD` | AtlasCloud |
-| `ATOMA` | Atoma |
-| `AVIAN` | Avian |
-| `AZURE` | Azure |
-| `BASE_TEN` | BaseTen |
-| `CEREBRAS` | Cerebras |
-| `CHUTES` | Chutes |
-| `CLOUDFLARE` | Cloudflare |
-| `COHERE` | Cohere |
-| `CROF_AI` | CrofAI |
-| `CRUSOE` | Crusoe |
-| `DEEP_INFRA` | DeepInfra |
-| `DEEP_SEEK` | DeepSeek |
-| `ENFER` | Enfer |
-| `FEATHERLESS` | Featherless |
-| `FIREWORKS` | Fireworks |
-| `FRIENDLI` | Friendli |
-| `GMI_CLOUD` | GMICloud |
-| `GOOGLE` | Google |
-| `GOOGLE_AI_STUDIO` | Google AI Studio |
-| `GROQ` | Groq |
-| `HYPERBOLIC` | Hyperbolic |
-| `INCEPTION` | Inception |
-| `INFERENCE_NET` | InferenceNet |
-| `INFERMATIC` | Infermatic |
-| `INFLECTION` | Inflection |
-| `INO_CLOUD` | InoCloud |
-| `KLUSTER` | Kluster |
-| `LAMBDA` | Lambda |
-| `LIQUID` | Liquid |
-| `MANCER_2` | Mancer 2 |
-| `META` | Meta |
-| `MINIMAX` | Minimax |
-| `MISTRAL` | Mistral |
-| `MOONSHOT_AI` | Moonshot AI |
-| `MORPH` | Morph |
-| `N_COMPASS` | NCompass |
-| `NEBIUS` | Nebius |
-| `NEXT_BIT` | NextBit |
-| `NINETEEN` | Nineteen |
-| `NOVITA` | Novita |
-| `OPEN_AI` | OpenAI |
-| `OPEN_INFERENCE` | OpenInference |
-| `PARASAIL` | Parasail |
-| `PERPLEXITY` | Perplexity |
-| `PHALA` | Phala |
-| `SAMBA_NOVA` | SambaNova |
-| `STEALTH` | Stealth |
-| `SWITCHPOINT` | Switchpoint |
-| `TARGON` | Targon |
-| `TOGETHER` | Together |
-| `UBICLOUD` | Ubicloud |
-| `VENICE` | Venice |
-| `WAND_B` | WandB |
-| `X_AI` | xAI |
-| `Z_AI` | Z.AI |
\ No newline at end of file
diff --git a/docs/models/chatstreamcompletioncreateparamsorderunion.md b/docs/models/chatstreamcompletioncreateparamsorderunion.md
deleted file mode 100644
index ff57c40..0000000
--- a/docs/models/chatstreamcompletioncreateparamsorderunion.md
+++ /dev/null
@@ -1,17 +0,0 @@
-# ChatStreamCompletionCreateParamsOrderUnion
-
-
-## Supported Types
-
-### `models.ChatStreamCompletionCreateParamsOrderEnum`
-
-```python
-value: models.ChatStreamCompletionCreateParamsOrderEnum = /* values here */
-```
-
-### `str`
-
-```python
-value: str = /* values here */
-```
-
diff --git a/docs/models/chatstreamcompletioncreateparamspdf.md b/docs/models/chatstreamcompletioncreateparamspdf.md
deleted file mode 100644
index 60c51a2..0000000
--- a/docs/models/chatstreamcompletioncreateparamspdf.md
+++ /dev/null
@@ -1,8 +0,0 @@
-# ChatStreamCompletionCreateParamsPdf
-
-
-## Fields
-
-| Field | Type | Required | Description |
-| -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- |
-| `engine` | [Optional[models.ChatStreamCompletionCreateParamsPdfEngine]](../models/chatstreamcompletioncreateparamspdfengine.md) | :heavy_minus_sign: | N/A |
\ No newline at end of file
diff --git a/docs/models/chatstreamcompletioncreateparamspdfengine.md b/docs/models/chatstreamcompletioncreateparamspdfengine.md
deleted file mode 100644
index 709c8f0..0000000
--- a/docs/models/chatstreamcompletioncreateparamspdfengine.md
+++ /dev/null
@@ -1,10 +0,0 @@
-# ChatStreamCompletionCreateParamsPdfEngine
-
-
-## Values
-
-| Name | Value |
-| ------------- | ------------- |
-| `MISTRAL_OCR` | mistral-ocr |
-| `PDF_TEXT` | pdf-text |
-| `NATIVE` | native |
\ No newline at end of file
diff --git a/docs/models/chatstreamcompletioncreateparamspluginchainofthought.md b/docs/models/chatstreamcompletioncreateparamspluginchainofthought.md
deleted file mode 100644
index 6f31a2d..0000000
--- a/docs/models/chatstreamcompletioncreateparamspluginchainofthought.md
+++ /dev/null
@@ -1,8 +0,0 @@
-# ChatStreamCompletionCreateParamsPluginChainOfThought
-
-
-## Fields
-
-| Field | Type | Required | Description |
-| ------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------ |
-| `id` | [models.ChatStreamCompletionCreateParamsIDChainOfThought](../models/chatstreamcompletioncreateparamsidchainofthought.md) | :heavy_check_mark: | N/A |
\ No newline at end of file
diff --git a/docs/models/chatstreamcompletioncreateparamspluginfileparser.md b/docs/models/chatstreamcompletioncreateparamspluginfileparser.md
deleted file mode 100644
index 37e3b19..0000000
--- a/docs/models/chatstreamcompletioncreateparamspluginfileparser.md
+++ /dev/null
@@ -1,10 +0,0 @@
-# ChatStreamCompletionCreateParamsPluginFileParser
-
-
-## Fields
-
-| Field | Type | Required | Description |
-| ---------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------- |
-| `id` | [models.ChatStreamCompletionCreateParamsIDFileParser](../models/chatstreamcompletioncreateparamsidfileparser.md) | :heavy_check_mark: | N/A |
-| `max_files` | *Optional[float]* | :heavy_minus_sign: | N/A |
-| `pdf` | [Optional[models.ChatStreamCompletionCreateParamsPdf]](../models/chatstreamcompletioncreateparamspdf.md) | :heavy_minus_sign: | N/A |
\ No newline at end of file
diff --git a/docs/models/chatstreamcompletioncreateparamspluginmoderation.md b/docs/models/chatstreamcompletioncreateparamspluginmoderation.md
deleted file mode 100644
index 16e8729..0000000
--- a/docs/models/chatstreamcompletioncreateparamspluginmoderation.md
+++ /dev/null
@@ -1,8 +0,0 @@
-# ChatStreamCompletionCreateParamsPluginModeration
-
-
-## Fields
-
-| Field | Type | Required | Description |
-| ---------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------- |
-| `id` | [models.ChatStreamCompletionCreateParamsIDModeration](../models/chatstreamcompletioncreateparamsidmoderation.md) | :heavy_check_mark: | N/A |
\ No newline at end of file
diff --git a/docs/models/chatstreamcompletioncreateparamspluginunion.md b/docs/models/chatstreamcompletioncreateparamspluginunion.md
deleted file mode 100644
index 47101cc..0000000
--- a/docs/models/chatstreamcompletioncreateparamspluginunion.md
+++ /dev/null
@@ -1,29 +0,0 @@
-# ChatStreamCompletionCreateParamsPluginUnion
-
-
-## Supported Types
-
-### `models.ChatStreamCompletionCreateParamsPluginModeration`
-
-```python
-value: models.ChatStreamCompletionCreateParamsPluginModeration = /* values here */
-```
-
-### `models.ChatStreamCompletionCreateParamsPluginWeb`
-
-```python
-value: models.ChatStreamCompletionCreateParamsPluginWeb = /* values here */
-```
-
-### `models.ChatStreamCompletionCreateParamsPluginChainOfThought`
-
-```python
-value: models.ChatStreamCompletionCreateParamsPluginChainOfThought = /* values here */
-```
-
-### `models.ChatStreamCompletionCreateParamsPluginFileParser`
-
-```python
-value: models.ChatStreamCompletionCreateParamsPluginFileParser = /* values here */
-```
-
diff --git a/docs/models/chatstreamcompletioncreateparamspluginweb.md b/docs/models/chatstreamcompletioncreateparamspluginweb.md
deleted file mode 100644
index 28d113d..0000000
--- a/docs/models/chatstreamcompletioncreateparamspluginweb.md
+++ /dev/null
@@ -1,11 +0,0 @@
-# ChatStreamCompletionCreateParamsPluginWeb
-
-
-## Fields
-
-| Field | Type | Required | Description |
-| -------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------- |
-| `id` | [models.ChatStreamCompletionCreateParamsIDWeb](../models/chatstreamcompletioncreateparamsidweb.md) | :heavy_check_mark: | N/A |
-| `max_results` | *Optional[float]* | :heavy_minus_sign: | N/A |
-| `search_prompt` | *Optional[str]* | :heavy_minus_sign: | N/A |
-| `engine` | [Optional[models.ChatStreamCompletionCreateParamsEngine]](../models/chatstreamcompletioncreateparamsengine.md) | :heavy_minus_sign: | N/A |
\ No newline at end of file
diff --git a/docs/models/chatstreamcompletioncreateparamsprompt.md b/docs/models/chatstreamcompletioncreateparamsprompt.md
deleted file mode 100644
index dbb7049..0000000
--- a/docs/models/chatstreamcompletioncreateparamsprompt.md
+++ /dev/null
@@ -1,23 +0,0 @@
-# ChatStreamCompletionCreateParamsPrompt
-
-
-## Supported Types
-
-### `float`
-
-```python
-value: float = /* values here */
-```
-
-### `str`
-
-```python
-value: str = /* values here */
-```
-
-### `Any`
-
-```python
-value: Any = /* values here */
-```
-
diff --git a/docs/models/chatstreamcompletioncreateparamsprovider.md b/docs/models/chatstreamcompletioncreateparamsprovider.md
deleted file mode 100644
index 69bc3d2..0000000
--- a/docs/models/chatstreamcompletioncreateparamsprovider.md
+++ /dev/null
@@ -1,18 +0,0 @@
-# ChatStreamCompletionCreateParamsProvider
-
-When multiple model providers are available, optionally indicate your routing preference.
-
-
-## Fields
-
-| Field | Type | Required | Description |
-| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
-| `allow_fallbacks` | *OptionalNullable[bool]* | :heavy_minus_sign: | 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]* | :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[models.ChatStreamCompletionCreateParamsDataCollection]](../models/chatstreamcompletioncreateparamsdatacollection.md) | :heavy_minus_sign: | 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.
|
-| `order` | List[[models.ChatStreamCompletionCreateParamsOrderUnion](../models/chatstreamcompletioncreateparamsorderunion.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[[models.ChatStreamCompletionCreateParamsOnlyUnion](../models/chatstreamcompletioncreateparamsonlyunion.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[[models.ChatStreamCompletionCreateParamsIgnoreUnion](../models/chatstreamcompletioncreateparamsignoreunion.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[[models.ChatStreamCompletionCreateParamsQuantization](../models/chatstreamcompletioncreateparamsquantization.md)] | :heavy_minus_sign: | A list of quantization levels to filter the provider by. |
-| `sort` | [OptionalNullable[models.ChatStreamCompletionCreateParamsSort]](../models/chatstreamcompletioncreateparamssort.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[models.ChatStreamCompletionCreateParamsMaxPrice]](../models/chatstreamcompletioncreateparamsmaxprice.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. |
\ No newline at end of file
diff --git a/docs/models/chatstreamcompletioncreateparamsquantization.md b/docs/models/chatstreamcompletioncreateparamsquantization.md
deleted file mode 100644
index 180a43e..0000000
--- a/docs/models/chatstreamcompletioncreateparamsquantization.md
+++ /dev/null
@@ -1,16 +0,0 @@
-# ChatStreamCompletionCreateParamsQuantization
-
-
-## Values
-
-| Name | Value |
-| --------- | --------- |
-| `INT4` | int4 |
-| `INT8` | int8 |
-| `FP4` | fp4 |
-| `FP6` | fp6 |
-| `FP8` | fp8 |
-| `FP16` | fp16 |
-| `BF16` | bf16 |
-| `FP32` | fp32 |
-| `UNKNOWN` | unknown |
\ No newline at end of file
diff --git a/docs/models/chatstreamcompletioncreateparamsreasoning.md b/docs/models/chatstreamcompletioncreateparamsreasoning.md
deleted file mode 100644
index 1d001f6..0000000
--- a/docs/models/chatstreamcompletioncreateparamsreasoning.md
+++ /dev/null
@@ -1,13 +0,0 @@
-# ChatStreamCompletionCreateParamsReasoning
-
-Reasoning configuration
-
-
-## Fields
-
-| Field | Type | Required | Description |
-| ---------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------- |
-| `enabled` | *Optional[bool]* | :heavy_minus_sign: | Enables reasoning with default settings. Only work for some models. |
-| `effort` | [OptionalNullable[models.ChatStreamCompletionCreateParamsEffort]](../models/chatstreamcompletioncreateparamseffort.md) | :heavy_minus_sign: | OpenAI-style reasoning effort setting |
-| `max_tokens` | *OptionalNullable[float]* | :heavy_minus_sign: | non-OpenAI-style reasoning effort setting |
-| `exclude` | *Optional[bool]* | :heavy_minus_sign: | N/A |
\ No newline at end of file
diff --git a/docs/models/chatstreamcompletioncreateparamsreasoningeffort.md b/docs/models/chatstreamcompletioncreateparamsreasoningeffort.md
deleted file mode 100644
index 8d4800a..0000000
--- a/docs/models/chatstreamcompletioncreateparamsreasoningeffort.md
+++ /dev/null
@@ -1,13 +0,0 @@
-# ChatStreamCompletionCreateParamsReasoningEffort
-
-Reasoning effort
-
-
-## Values
-
-| Name | Value |
-| --------- | --------- |
-| `HIGH` | high |
-| `MEDIUM` | medium |
-| `LOW` | low |
-| `MINIMAL` | minimal |
\ No newline at end of file
diff --git a/docs/models/chatstreamcompletioncreateparamsrequest.md b/docs/models/chatstreamcompletioncreateparamsrequest.md
deleted file mode 100644
index ef75853..0000000
--- a/docs/models/chatstreamcompletioncreateparamsrequest.md
+++ /dev/null
@@ -1,23 +0,0 @@
-# ChatStreamCompletionCreateParamsRequest
-
-
-## Supported Types
-
-### `float`
-
-```python
-value: float = /* values here */
-```
-
-### `str`
-
-```python
-value: str = /* values here */
-```
-
-### `Any`
-
-```python
-value: Any = /* values here */
-```
-
diff --git a/docs/models/chatstreamcompletioncreateparamsresponseformatgrammar.md b/docs/models/chatstreamcompletioncreateparamsresponseformatgrammar.md
deleted file mode 100644
index d6fb376..0000000
--- a/docs/models/chatstreamcompletioncreateparamsresponseformatgrammar.md
+++ /dev/null
@@ -1,11 +0,0 @@
-# ChatStreamCompletionCreateParamsResponseFormatGrammar
-
-Custom grammar response format
-
-
-## Fields
-
-| Field | Type | Required | Description |
-| -------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------- |
-| `type` | [models.ChatStreamCompletionCreateParamsTypeGrammar](../models/chatstreamcompletioncreateparamstypegrammar.md) | :heavy_check_mark: | N/A |
-| `grammar` | *str* | :heavy_check_mark: | Custom grammar for text generation |
\ No newline at end of file
diff --git a/docs/models/chatstreamcompletioncreateparamsresponseformatjsonobject.md b/docs/models/chatstreamcompletioncreateparamsresponseformatjsonobject.md
deleted file mode 100644
index 30c9be5..0000000
--- a/docs/models/chatstreamcompletioncreateparamsresponseformatjsonobject.md
+++ /dev/null
@@ -1,10 +0,0 @@
-# ChatStreamCompletionCreateParamsResponseFormatJSONObject
-
-JSON object response format
-
-
-## Fields
-
-| Field | Type | Required | Description |
-| -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- |
-| `type` | [models.ChatStreamCompletionCreateParamsTypeJSONObject](../models/chatstreamcompletioncreateparamstypejsonobject.md) | :heavy_check_mark: | N/A |
\ No newline at end of file
diff --git a/docs/models/chatstreamcompletioncreateparamsresponseformatjsonschema.md b/docs/models/chatstreamcompletioncreateparamsresponseformatjsonschema.md
deleted file mode 100644
index 63068dd..0000000
--- a/docs/models/chatstreamcompletioncreateparamsresponseformatjsonschema.md
+++ /dev/null
@@ -1,11 +0,0 @@
-# ChatStreamCompletionCreateParamsResponseFormatJSONSchema
-
-JSON Schema response format for structured outputs
-
-
-## Fields
-
-| Field | Type | Required | Description |
-| -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- |
-| `type` | [models.ChatStreamCompletionCreateParamsTypeJSONSchema](../models/chatstreamcompletioncreateparamstypejsonschema.md) | :heavy_check_mark: | N/A |
-| `json_schema` | [models.ChatStreamCompletionCreateParamsJSONSchema](../models/chatstreamcompletioncreateparamsjsonschema.md) | :heavy_check_mark: | N/A |
\ No newline at end of file
diff --git a/docs/models/chatstreamcompletioncreateparamsresponseformatpython.md b/docs/models/chatstreamcompletioncreateparamsresponseformatpython.md
deleted file mode 100644
index 7aa985c..0000000
--- a/docs/models/chatstreamcompletioncreateparamsresponseformatpython.md
+++ /dev/null
@@ -1,10 +0,0 @@
-# ChatStreamCompletionCreateParamsResponseFormatPython
-
-Python code response format
-
-
-## Fields
-
-| Field | Type | Required | Description |
-| ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ |
-| `type` | [models.ChatStreamCompletionCreateParamsTypePython](../models/chatstreamcompletioncreateparamstypepython.md) | :heavy_check_mark: | N/A |
\ No newline at end of file
diff --git a/docs/models/chatstreamcompletioncreateparamsresponseformattext.md b/docs/models/chatstreamcompletioncreateparamsresponseformattext.md
deleted file mode 100644
index ba4bcc4..0000000
--- a/docs/models/chatstreamcompletioncreateparamsresponseformattext.md
+++ /dev/null
@@ -1,10 +0,0 @@
-# ChatStreamCompletionCreateParamsResponseFormatText
-
-Default text response format
-
-
-## Fields
-
-| Field | Type | Required | Description |
-| -------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------- |
-| `type` | [models.ChatStreamCompletionCreateParamsTypeText](../models/chatstreamcompletioncreateparamstypetext.md) | :heavy_check_mark: | N/A |
\ No newline at end of file
diff --git a/docs/models/chatstreamcompletioncreateparamsresponseformatunion.md b/docs/models/chatstreamcompletioncreateparamsresponseformatunion.md
deleted file mode 100644
index f6ba15b..0000000
--- a/docs/models/chatstreamcompletioncreateparamsresponseformatunion.md
+++ /dev/null
@@ -1,37 +0,0 @@
-# ChatStreamCompletionCreateParamsResponseFormatUnion
-
-Response format configuration
-
-
-## Supported Types
-
-### `models.ChatStreamCompletionCreateParamsResponseFormatText`
-
-```python
-value: models.ChatStreamCompletionCreateParamsResponseFormatText = /* values here */
-```
-
-### `models.ChatStreamCompletionCreateParamsResponseFormatJSONObject`
-
-```python
-value: models.ChatStreamCompletionCreateParamsResponseFormatJSONObject = /* values here */
-```
-
-### `models.ChatStreamCompletionCreateParamsResponseFormatJSONSchema`
-
-```python
-value: models.ChatStreamCompletionCreateParamsResponseFormatJSONSchema = /* values here */
-```
-
-### `models.ChatStreamCompletionCreateParamsResponseFormatGrammar`
-
-```python
-value: models.ChatStreamCompletionCreateParamsResponseFormatGrammar = /* values here */
-```
-
-### `models.ChatStreamCompletionCreateParamsResponseFormatPython`
-
-```python
-value: models.ChatStreamCompletionCreateParamsResponseFormatPython = /* values here */
-```
-
diff --git a/docs/models/chatstreamcompletioncreateparamssort.md b/docs/models/chatstreamcompletioncreateparamssort.md
deleted file mode 100644
index e2f845a..0000000
--- a/docs/models/chatstreamcompletioncreateparamssort.md
+++ /dev/null
@@ -1,12 +0,0 @@
-# ChatStreamCompletionCreateParamsSort
-
-The sorting strategy to use for this request, if "order" is not specified. When set, no load balancing is performed.
-
-
-## Values
-
-| Name | Value |
-| ------------ | ------------ |
-| `PRICE` | price |
-| `THROUGHPUT` | throughput |
-| `LATENCY` | latency |
\ No newline at end of file
diff --git a/docs/models/chatstreamcompletioncreateparamsstop.md b/docs/models/chatstreamcompletioncreateparamsstop.md
deleted file mode 100644
index d3cd163..0000000
--- a/docs/models/chatstreamcompletioncreateparamsstop.md
+++ /dev/null
@@ -1,25 +0,0 @@
-# ChatStreamCompletionCreateParamsStop
-
-Stop sequences (up to 4)
-
-
-## Supported Types
-
-### `str`
-
-```python
-value: str = /* values here */
-```
-
-### `List[str]`
-
-```python
-value: List[str] = /* values here */
-```
-
-### `Any`
-
-```python
-value: Any = /* values here */
-```
-
diff --git a/docs/models/chatstreamcompletioncreateparamsstreamoptions.md b/docs/models/chatstreamcompletioncreateparamsstreamoptions.md
deleted file mode 100644
index c70a614..0000000
--- a/docs/models/chatstreamcompletioncreateparamsstreamoptions.md
+++ /dev/null
@@ -1,10 +0,0 @@
-# ChatStreamCompletionCreateParamsStreamOptions
-
-Streaming configuration options
-
-
-## Fields
-
-| Field | Type | Required | Description |
-| ----------------------------------------------- | ----------------------------------------------- | ----------------------------------------------- | ----------------------------------------------- |
-| `include_usage` | *Optional[bool]* | :heavy_minus_sign: | Include usage information in streaming response |
\ No newline at end of file
diff --git a/docs/models/chatstreamcompletioncreateparamstypegrammar.md b/docs/models/chatstreamcompletioncreateparamstypegrammar.md
deleted file mode 100644
index 8e64f10..0000000
--- a/docs/models/chatstreamcompletioncreateparamstypegrammar.md
+++ /dev/null
@@ -1,8 +0,0 @@
-# ChatStreamCompletionCreateParamsTypeGrammar
-
-
-## Values
-
-| Name | Value |
-| --------- | --------- |
-| `GRAMMAR` | grammar |
\ No newline at end of file
diff --git a/docs/models/chatstreamcompletioncreateparamstypejsonobject.md b/docs/models/chatstreamcompletioncreateparamstypejsonobject.md
deleted file mode 100644
index bb9c748..0000000
--- a/docs/models/chatstreamcompletioncreateparamstypejsonobject.md
+++ /dev/null
@@ -1,8 +0,0 @@
-# ChatStreamCompletionCreateParamsTypeJSONObject
-
-
-## Values
-
-| Name | Value |
-| ------------- | ------------- |
-| `JSON_OBJECT` | json_object |
\ No newline at end of file
diff --git a/docs/models/chatstreamcompletioncreateparamstypejsonschema.md b/docs/models/chatstreamcompletioncreateparamstypejsonschema.md
deleted file mode 100644
index 172f379..0000000
--- a/docs/models/chatstreamcompletioncreateparamstypejsonschema.md
+++ /dev/null
@@ -1,8 +0,0 @@
-# ChatStreamCompletionCreateParamsTypeJSONSchema
-
-
-## Values
-
-| Name | Value |
-| ------------- | ------------- |
-| `JSON_SCHEMA` | json_schema |
\ No newline at end of file
diff --git a/docs/models/chatstreamcompletioncreateparamstypepython.md b/docs/models/chatstreamcompletioncreateparamstypepython.md
deleted file mode 100644
index 4c2a41e..0000000
--- a/docs/models/chatstreamcompletioncreateparamstypepython.md
+++ /dev/null
@@ -1,8 +0,0 @@
-# ChatStreamCompletionCreateParamsTypePython
-
-
-## Values
-
-| Name | Value |
-| -------- | -------- |
-| `PYTHON` | python |
\ No newline at end of file
diff --git a/docs/models/chatstreamcompletioncreateparamstypetext.md b/docs/models/chatstreamcompletioncreateparamstypetext.md
deleted file mode 100644
index 2a5cd35..0000000
--- a/docs/models/chatstreamcompletioncreateparamstypetext.md
+++ /dev/null
@@ -1,8 +0,0 @@
-# ChatStreamCompletionCreateParamsTypeText
-
-
-## Values
-
-| Name | Value |
-| ------ | ------ |
-| `TEXT` | text |
\ No newline at end of file
diff --git a/docs/models/chatcompletioncreateparamsimage.md b/docs/models/completion.md
similarity index 85%
rename from docs/models/chatcompletioncreateparamsimage.md
rename to docs/models/completion.md
index c61f30d..ce9609b 100644
--- a/docs/models/chatcompletioncreateparamsimage.md
+++ b/docs/models/completion.md
@@ -1,4 +1,4 @@
-# ChatCompletionCreateParamsImage
+# Completion
## Supported Types
diff --git a/docs/models/createchatcompletionresponse.md b/docs/models/createchatcompletionresponse.md
new file mode 100644
index 0000000..3bd6bc4
--- /dev/null
+++ b/docs/models/createchatcompletionresponse.md
@@ -0,0 +1,17 @@
+# CreateChatCompletionResponse
+
+
+## Supported Types
+
+### `models.ChatCompletion`
+
+```python
+value: models.ChatCompletion = /* values here */
+```
+
+### `Union[eventstreaming.EventStream[models.ChatCompletionChunkWrapper], eventstreaming.EventStreamAsync[models.ChatCompletionChunkWrapper]]`
+
+```python
+value: Union[eventstreaming.EventStream[models.ChatCompletionChunkWrapper], eventstreaming.EventStreamAsync[models.ChatCompletionChunkWrapper]] = /* values here */
+```
+
diff --git a/docs/models/chatcompletioncreateparamsdatacollection.md b/docs/models/datacollection.md
similarity index 89%
rename from docs/models/chatcompletioncreateparamsdatacollection.md
rename to docs/models/datacollection.md
index 0f05804..bb07fc4 100644
--- a/docs/models/chatcompletioncreateparamsdatacollection.md
+++ b/docs/models/datacollection.md
@@ -1,4 +1,4 @@
-# ChatCompletionCreateParamsDataCollection
+# DataCollection
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
diff --git a/docs/models/chatcompletioncreateparamseffort.md b/docs/models/effort.md
similarity index 85%
rename from docs/models/chatcompletioncreateparamseffort.md
rename to docs/models/effort.md
index 15adb4b..eac615b 100644
--- a/docs/models/chatcompletioncreateparamseffort.md
+++ b/docs/models/effort.md
@@ -1,4 +1,4 @@
-# ChatCompletionCreateParamsEffort
+# Effort
OpenAI-style reasoning effort setting
diff --git a/docs/models/chatcompletioncreateparamsengine.md b/docs/models/engine.md
similarity index 75%
rename from docs/models/chatcompletioncreateparamsengine.md
rename to docs/models/engine.md
index 5f1bb21..fcea19c 100644
--- a/docs/models/chatcompletioncreateparamsengine.md
+++ b/docs/models/engine.md
@@ -1,4 +1,4 @@
-# ChatCompletionCreateParamsEngine
+# Engine
## Values
diff --git a/docs/models/chatcompletioncreateparamsidchainofthought.md b/docs/models/idchainofthought.md
similarity index 76%
rename from docs/models/chatcompletioncreateparamsidchainofthought.md
rename to docs/models/idchainofthought.md
index e13847b..a704b14 100644
--- a/docs/models/chatcompletioncreateparamsidchainofthought.md
+++ b/docs/models/idchainofthought.md
@@ -1,4 +1,4 @@
-# ChatCompletionCreateParamsIDChainOfThought
+# IDChainOfThought
## Values
diff --git a/docs/models/chatcompletioncreateparamsidfileparser.md b/docs/models/idfileparser.md
similarity index 73%
rename from docs/models/chatcompletioncreateparamsidfileparser.md
rename to docs/models/idfileparser.md
index 7d664f1..1a27fa0 100644
--- a/docs/models/chatcompletioncreateparamsidfileparser.md
+++ b/docs/models/idfileparser.md
@@ -1,4 +1,4 @@
-# ChatCompletionCreateParamsIDFileParser
+# IDFileParser
## Values
diff --git a/docs/models/chatcompletioncreateparamsidmoderation.md b/docs/models/idmoderation.md
similarity index 72%
rename from docs/models/chatcompletioncreateparamsidmoderation.md
rename to docs/models/idmoderation.md
index a605649..2284d6c 100644
--- a/docs/models/chatcompletioncreateparamsidmoderation.md
+++ b/docs/models/idmoderation.md
@@ -1,4 +1,4 @@
-# ChatCompletionCreateParamsIDModeration
+# IDModeration
## Values
diff --git a/docs/models/chatcompletioncreateparamsidweb.md b/docs/models/idweb.md
similarity index 66%
rename from docs/models/chatcompletioncreateparamsidweb.md
rename to docs/models/idweb.md
index 62d1f02..8c668e6 100644
--- a/docs/models/chatcompletioncreateparamsidweb.md
+++ b/docs/models/idweb.md
@@ -1,4 +1,4 @@
-# ChatCompletionCreateParamsIDWeb
+# IDWeb
## Values
diff --git a/docs/models/ignore.md b/docs/models/ignore.md
new file mode 100644
index 0000000..2115a3b
--- /dev/null
+++ b/docs/models/ignore.md
@@ -0,0 +1,17 @@
+# Ignore
+
+
+## Supported Types
+
+### `models.IgnoreEnum`
+
+```python
+value: models.IgnoreEnum = /* values here */
+```
+
+### `str`
+
+```python
+value: str = /* values here */
+```
+
diff --git a/docs/models/chatcompletioncreateparamsonlyenum.md b/docs/models/ignoreenum.md
similarity index 98%
rename from docs/models/chatcompletioncreateparamsonlyenum.md
rename to docs/models/ignoreenum.md
index ac7e092..ad28f68 100644
--- a/docs/models/chatcompletioncreateparamsonlyenum.md
+++ b/docs/models/ignoreenum.md
@@ -1,4 +1,4 @@
-# ChatCompletionCreateParamsOnlyEnum
+# IgnoreEnum
## Values
diff --git a/docs/models/chatcompletioncreateparamsprompt.md b/docs/models/image.md
similarity index 84%
rename from docs/models/chatcompletioncreateparamsprompt.md
rename to docs/models/image.md
index 12c0a17..cae2edf 100644
--- a/docs/models/chatcompletioncreateparamsprompt.md
+++ b/docs/models/image.md
@@ -1,4 +1,4 @@
-# ChatCompletionCreateParamsPrompt
+# Image
## Supported Types
diff --git a/docs/models/chatcompletioncreateparamsjsonschema.md b/docs/models/jsonschema.md
similarity index 98%
rename from docs/models/chatcompletioncreateparamsjsonschema.md
rename to docs/models/jsonschema.md
index f7b77cc..9787b1d 100644
--- a/docs/models/chatcompletioncreateparamsjsonschema.md
+++ b/docs/models/jsonschema.md
@@ -1,4 +1,4 @@
-# ChatCompletionCreateParamsJSONSchema
+# JSONSchema
## Fields
diff --git a/docs/models/maxprice.md b/docs/models/maxprice.md
new file mode 100644
index 0000000..6a1e11b
--- /dev/null
+++ b/docs/models/maxprice.md
@@ -0,0 +1,14 @@
+# MaxPrice
+
+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[models.Prompt]](../models/prompt.md) | :heavy_minus_sign: | N/A |
+| `completion` | [Optional[models.Completion]](../models/completion.md) | :heavy_minus_sign: | N/A |
+| `image` | [Optional[models.Image]](../models/image.md) | :heavy_minus_sign: | N/A |
+| `audio` | [Optional[models.Audio]](../models/audio.md) | :heavy_minus_sign: | N/A |
+| `request` | [Optional[models.Request]](../models/request.md) | :heavy_minus_sign: | N/A |
\ No newline at end of file
diff --git a/docs/models/only.md b/docs/models/only.md
new file mode 100644
index 0000000..85cd513
--- /dev/null
+++ b/docs/models/only.md
@@ -0,0 +1,17 @@
+# Only
+
+
+## Supported Types
+
+### `models.OnlyEnum`
+
+```python
+value: models.OnlyEnum = /* values here */
+```
+
+### `str`
+
+```python
+value: str = /* values here */
+```
+
diff --git a/docs/models/chatcompletioncreateparamsorderenum.md b/docs/models/onlyenum.md
similarity index 98%
rename from docs/models/chatcompletioncreateparamsorderenum.md
rename to docs/models/onlyenum.md
index a83b3e5..1c55f80 100644
--- a/docs/models/chatcompletioncreateparamsorderenum.md
+++ b/docs/models/onlyenum.md
@@ -1,4 +1,4 @@
-# ChatCompletionCreateParamsOrderEnum
+# OnlyEnum
## Values
diff --git a/docs/models/order.md b/docs/models/order.md
new file mode 100644
index 0000000..cfbc63f
--- /dev/null
+++ b/docs/models/order.md
@@ -0,0 +1,17 @@
+# Order
+
+
+## Supported Types
+
+### `models.OrderEnum`
+
+```python
+value: models.OrderEnum = /* values here */
+```
+
+### `str`
+
+```python
+value: str = /* values here */
+```
+
diff --git a/docs/models/chatcompletioncreateparamsignoreenum.md b/docs/models/orderenum.md
similarity index 98%
rename from docs/models/chatcompletioncreateparamsignoreenum.md
rename to docs/models/orderenum.md
index 39a3791..2e00a0d 100644
--- a/docs/models/chatcompletioncreateparamsignoreenum.md
+++ b/docs/models/orderenum.md
@@ -1,4 +1,4 @@
-# ChatCompletionCreateParamsIgnoreEnum
+# OrderEnum
## Values
diff --git a/docs/models/pdf.md b/docs/models/pdf.md
new file mode 100644
index 0000000..aa1a388
--- /dev/null
+++ b/docs/models/pdf.md
@@ -0,0 +1,8 @@
+# Pdf
+
+
+## Fields
+
+| Field | Type | Required | Description |
+| ---------------------------------------------------- | ---------------------------------------------------- | ---------------------------------------------------- | ---------------------------------------------------- |
+| `engine` | [Optional[models.PdfEngine]](../models/pdfengine.md) | :heavy_minus_sign: | N/A |
\ No newline at end of file
diff --git a/docs/models/chatcompletioncreateparamspdfengine.md b/docs/models/pdfengine.md
similarity index 82%
rename from docs/models/chatcompletioncreateparamspdfengine.md
rename to docs/models/pdfengine.md
index 1330e18..55bca5e 100644
--- a/docs/models/chatcompletioncreateparamspdfengine.md
+++ b/docs/models/pdfengine.md
@@ -1,4 +1,4 @@
-# ChatCompletionCreateParamsPdfEngine
+# PdfEngine
## Values
diff --git a/docs/models/plugin.md b/docs/models/plugin.md
new file mode 100644
index 0000000..ec50fd4
--- /dev/null
+++ b/docs/models/plugin.md
@@ -0,0 +1,29 @@
+# Plugin
+
+
+## Supported Types
+
+### `models.PluginModeration`
+
+```python
+value: models.PluginModeration = /* values here */
+```
+
+### `models.PluginWeb`
+
+```python
+value: models.PluginWeb = /* values here */
+```
+
+### `models.PluginChainOfThought`
+
+```python
+value: models.PluginChainOfThought = /* values here */
+```
+
+### `models.PluginFileParser`
+
+```python
+value: models.PluginFileParser = /* values here */
+```
+
diff --git a/docs/models/pluginchainofthought.md b/docs/models/pluginchainofthought.md
new file mode 100644
index 0000000..e5f069d
--- /dev/null
+++ b/docs/models/pluginchainofthought.md
@@ -0,0 +1,8 @@
+# PluginChainOfThought
+
+
+## Fields
+
+| Field | Type | Required | Description |
+| -------------------------------------------------------- | -------------------------------------------------------- | -------------------------------------------------------- | -------------------------------------------------------- |
+| `id` | [models.IDChainOfThought](../models/idchainofthought.md) | :heavy_check_mark: | N/A |
\ No newline at end of file
diff --git a/docs/models/pluginfileparser.md b/docs/models/pluginfileparser.md
new file mode 100644
index 0000000..c49e7aa
--- /dev/null
+++ b/docs/models/pluginfileparser.md
@@ -0,0 +1,10 @@
+# PluginFileParser
+
+
+## Fields
+
+| Field | Type | Required | Description |
+| ------------------------------------------------ | ------------------------------------------------ | ------------------------------------------------ | ------------------------------------------------ |
+| `id` | [models.IDFileParser](../models/idfileparser.md) | :heavy_check_mark: | N/A |
+| `max_files` | *Optional[float]* | :heavy_minus_sign: | N/A |
+| `pdf` | [Optional[models.Pdf]](../models/pdf.md) | :heavy_minus_sign: | N/A |
\ No newline at end of file
diff --git a/docs/models/pluginmoderation.md b/docs/models/pluginmoderation.md
new file mode 100644
index 0000000..0e58d2f
--- /dev/null
+++ b/docs/models/pluginmoderation.md
@@ -0,0 +1,8 @@
+# PluginModeration
+
+
+## Fields
+
+| Field | Type | Required | Description |
+| ------------------------------------------------ | ------------------------------------------------ | ------------------------------------------------ | ------------------------------------------------ |
+| `id` | [models.IDModeration](../models/idmoderation.md) | :heavy_check_mark: | N/A |
\ No newline at end of file
diff --git a/docs/models/pluginweb.md b/docs/models/pluginweb.md
new file mode 100644
index 0000000..50e2c17
--- /dev/null
+++ b/docs/models/pluginweb.md
@@ -0,0 +1,11 @@
+# PluginWeb
+
+
+## Fields
+
+| Field | Type | Required | Description |
+| ---------------------------------------------- | ---------------------------------------------- | ---------------------------------------------- | ---------------------------------------------- |
+| `id` | [models.IDWeb](../models/idweb.md) | :heavy_check_mark: | N/A |
+| `max_results` | *Optional[float]* | :heavy_minus_sign: | N/A |
+| `search_prompt` | *Optional[str]* | :heavy_minus_sign: | N/A |
+| `engine` | [Optional[models.Engine]](../models/engine.md) | :heavy_minus_sign: | N/A |
\ No newline at end of file
diff --git a/docs/models/chatcompletioncreateparamsrequest.md b/docs/models/prompt.md
similarity index 84%
rename from docs/models/chatcompletioncreateparamsrequest.md
rename to docs/models/prompt.md
index 05c8a09..f242343 100644
--- a/docs/models/chatcompletioncreateparamsrequest.md
+++ b/docs/models/prompt.md
@@ -1,4 +1,4 @@
-# ChatCompletionCreateParamsRequest
+# Prompt
## Supported Types
diff --git a/docs/models/chatcompletioncreateparamsprovider.md b/docs/models/provider.md
similarity index 91%
rename from docs/models/chatcompletioncreateparamsprovider.md
rename to docs/models/provider.md
index e217d53..22de09c 100644
--- a/docs/models/chatcompletioncreateparamsprovider.md
+++ b/docs/models/provider.md
@@ -1,4 +1,4 @@
-# ChatCompletionCreateParamsProvider
+# Provider
When multiple model providers are available, optionally indicate your routing preference.
@@ -9,10 +9,10 @@ When multiple model providers are available, optionally indicate your routing pr
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| `allow_fallbacks` | *OptionalNullable[bool]* | :heavy_minus_sign: | 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]* | :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[models.ChatCompletionCreateParamsDataCollection]](../models/chatcompletioncreateparamsdatacollection.md) | :heavy_minus_sign: | 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.
|
-| `order` | List[[models.ChatCompletionCreateParamsOrderUnion](../models/chatcompletioncreateparamsorderunion.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[[models.ChatCompletionCreateParamsOnlyUnion](../models/chatcompletioncreateparamsonlyunion.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[[models.ChatCompletionCreateParamsIgnoreUnion](../models/chatcompletioncreateparamsignoreunion.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[[models.ChatCompletionCreateParamsQuantization](../models/chatcompletioncreateparamsquantization.md)] | :heavy_minus_sign: | A list of quantization levels to filter the provider by. |
-| `sort` | [OptionalNullable[models.ChatCompletionCreateParamsSort]](../models/chatcompletioncreateparamssort.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[models.ChatCompletionCreateParamsMaxPrice]](../models/chatcompletioncreateparamsmaxprice.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. |
\ No newline at end of file
+| `data_collection` | [OptionalNullable[models.DataCollection]](../models/datacollection.md) | :heavy_minus_sign: | 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.
|
+| `order` | List[[models.Order](../models/order.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[[models.Only](../models/only.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[[models.Ignore](../models/ignore.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[[models.Quantization](../models/quantization.md)] | :heavy_minus_sign: | A list of quantization levels to filter the provider by. |
+| `sort` | [OptionalNullable[models.Sort]](../models/sort.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[models.MaxPrice]](../models/maxprice.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. |
\ No newline at end of file
diff --git a/docs/models/chatcompletioncreateparamsquantization.md b/docs/models/quantization.md
similarity index 87%
rename from docs/models/chatcompletioncreateparamsquantization.md
rename to docs/models/quantization.md
index 2c6c357..7a0574a 100644
--- a/docs/models/chatcompletioncreateparamsquantization.md
+++ b/docs/models/quantization.md
@@ -1,4 +1,4 @@
-# ChatCompletionCreateParamsQuantization
+# Quantization
## Values
diff --git a/docs/models/reasoning.md b/docs/models/reasoning.md
new file mode 100644
index 0000000..b8c6d85
--- /dev/null
+++ b/docs/models/reasoning.md
@@ -0,0 +1,13 @@
+# Reasoning
+
+Reasoning configuration
+
+
+## Fields
+
+| Field | Type | Required | Description |
+| ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- |
+| `enabled` | *Optional[bool]* | :heavy_minus_sign: | Enables reasoning with default settings. Only work for some models. |
+| `effort` | [OptionalNullable[models.Effort]](../models/effort.md) | :heavy_minus_sign: | OpenAI-style reasoning effort setting |
+| `max_tokens` | *OptionalNullable[float]* | :heavy_minus_sign: | non-OpenAI-style reasoning effort setting |
+| `exclude` | *Optional[bool]* | :heavy_minus_sign: | N/A |
\ No newline at end of file
diff --git a/docs/models/chatcompletioncreateparamsreasoningeffort.md b/docs/models/reasoningeffort.md
similarity index 80%
rename from docs/models/chatcompletioncreateparamsreasoningeffort.md
rename to docs/models/reasoningeffort.md
index 771aab3..004197f 100644
--- a/docs/models/chatcompletioncreateparamsreasoningeffort.md
+++ b/docs/models/reasoningeffort.md
@@ -1,4 +1,4 @@
-# ChatCompletionCreateParamsReasoningEffort
+# ReasoningEffort
Reasoning effort
diff --git a/docs/models/request.md b/docs/models/request.md
new file mode 100644
index 0000000..1456e9b
--- /dev/null
+++ b/docs/models/request.md
@@ -0,0 +1,23 @@
+# Request
+
+
+## Supported Types
+
+### `float`
+
+```python
+value: float = /* values here */
+```
+
+### `str`
+
+```python
+value: str = /* values here */
+```
+
+### `Any`
+
+```python
+value: Any = /* values here */
+```
+
diff --git a/docs/models/responseformat.md b/docs/models/responseformat.md
new file mode 100644
index 0000000..1ab9a0b
--- /dev/null
+++ b/docs/models/responseformat.md
@@ -0,0 +1,37 @@
+# ResponseFormat
+
+Response format configuration
+
+
+## Supported Types
+
+### `models.ResponseFormatText`
+
+```python
+value: models.ResponseFormatText = /* values here */
+```
+
+### `models.ResponseFormatJSONObject`
+
+```python
+value: models.ResponseFormatJSONObject = /* values here */
+```
+
+### `models.ResponseFormatJSONSchema`
+
+```python
+value: models.ResponseFormatJSONSchema = /* values here */
+```
+
+### `models.ResponseFormatGrammar`
+
+```python
+value: models.ResponseFormatGrammar = /* values here */
+```
+
+### `models.ResponseFormatPython`
+
+```python
+value: models.ResponseFormatPython = /* values here */
+```
+
diff --git a/docs/models/responseformatgrammar.md b/docs/models/responseformatgrammar.md
new file mode 100644
index 0000000..95ac8aa
--- /dev/null
+++ b/docs/models/responseformatgrammar.md
@@ -0,0 +1,11 @@
+# ResponseFormatGrammar
+
+Custom grammar response format
+
+
+## Fields
+
+| Field | Type | Required | Description |
+| ---------------------------------------------- | ---------------------------------------------- | ---------------------------------------------- | ---------------------------------------------- |
+| `type` | [models.TypeGrammar](../models/typegrammar.md) | :heavy_check_mark: | N/A |
+| `grammar` | *str* | :heavy_check_mark: | Custom grammar for text generation |
\ No newline at end of file
diff --git a/docs/models/responseformatjsonobject.md b/docs/models/responseformatjsonobject.md
new file mode 100644
index 0000000..8c1cbdb
--- /dev/null
+++ b/docs/models/responseformatjsonobject.md
@@ -0,0 +1,10 @@
+# ResponseFormatJSONObject
+
+JSON object response format
+
+
+## Fields
+
+| Field | Type | Required | Description |
+| ---------------------------------------------------- | ---------------------------------------------------- | ---------------------------------------------------- | ---------------------------------------------------- |
+| `type` | [models.TypeJSONObject](../models/typejsonobject.md) | :heavy_check_mark: | N/A |
\ No newline at end of file
diff --git a/docs/models/responseformatjsonschema.md b/docs/models/responseformatjsonschema.md
new file mode 100644
index 0000000..90afdaf
--- /dev/null
+++ b/docs/models/responseformatjsonschema.md
@@ -0,0 +1,11 @@
+# ResponseFormatJSONSchema
+
+JSON Schema response format for structured outputs
+
+
+## Fields
+
+| Field | Type | Required | Description |
+| ---------------------------------------------------- | ---------------------------------------------------- | ---------------------------------------------------- | ---------------------------------------------------- |
+| `type` | [models.TypeJSONSchema](../models/typejsonschema.md) | :heavy_check_mark: | N/A |
+| `json_schema` | [models.JSONSchema](../models/jsonschema.md) | :heavy_check_mark: | N/A |
\ No newline at end of file
diff --git a/docs/models/responseformatpython.md b/docs/models/responseformatpython.md
new file mode 100644
index 0000000..a7285bd
--- /dev/null
+++ b/docs/models/responseformatpython.md
@@ -0,0 +1,10 @@
+# ResponseFormatPython
+
+Python code response format
+
+
+## Fields
+
+| Field | Type | Required | Description |
+| -------------------------------------------- | -------------------------------------------- | -------------------------------------------- | -------------------------------------------- |
+| `type` | [models.TypePython](../models/typepython.md) | :heavy_check_mark: | N/A |
\ No newline at end of file
diff --git a/docs/models/chatcompletioncreateparamsresponseformattext.md b/docs/models/responseformattext.md
similarity index 96%
rename from docs/models/chatcompletioncreateparamsresponseformattext.md
rename to docs/models/responseformattext.md
index 0eadf11..7634448 100644
--- a/docs/models/chatcompletioncreateparamsresponseformattext.md
+++ b/docs/models/responseformattext.md
@@ -1,4 +1,4 @@
-# ChatCompletionCreateParamsResponseFormatText
+# ResponseFormatText
Default text response format
diff --git a/docs/models/chatcompletioncreateparamssort.md b/docs/models/sort.md
similarity index 89%
rename from docs/models/chatcompletioncreateparamssort.md
rename to docs/models/sort.md
index a11c83a..65b6edb 100644
--- a/docs/models/chatcompletioncreateparamssort.md
+++ b/docs/models/sort.md
@@ -1,4 +1,4 @@
-# ChatCompletionCreateParamsSort
+# Sort
The sorting strategy to use for this request, if "order" is not specified. When set, no load balancing is performed.
diff --git a/docs/models/chatcompletioncreateparamsstop.md b/docs/models/stop.md
similarity index 87%
rename from docs/models/chatcompletioncreateparamsstop.md
rename to docs/models/stop.md
index 5b4be00..c36d910 100644
--- a/docs/models/chatcompletioncreateparamsstop.md
+++ b/docs/models/stop.md
@@ -1,4 +1,4 @@
-# ChatCompletionCreateParamsStop
+# Stop
Stop sequences (up to 4)
diff --git a/docs/models/chatcompletioncreateparamsstreamoptions.md b/docs/models/streamoptions.md
similarity index 93%
rename from docs/models/chatcompletioncreateparamsstreamoptions.md
rename to docs/models/streamoptions.md
index 9f75def..f004063 100644
--- a/docs/models/chatcompletioncreateparamsstreamoptions.md
+++ b/docs/models/streamoptions.md
@@ -1,4 +1,4 @@
-# ChatCompletionCreateParamsStreamOptions
+# StreamOptions
Streaming configuration options
diff --git a/docs/models/chatcompletioncreateparamstypegrammar.md b/docs/models/typegrammar.md
similarity index 69%
rename from docs/models/chatcompletioncreateparamstypegrammar.md
rename to docs/models/typegrammar.md
index c3cf87f..ecd24b7 100644
--- a/docs/models/chatcompletioncreateparamstypegrammar.md
+++ b/docs/models/typegrammar.md
@@ -1,4 +1,4 @@
-# ChatCompletionCreateParamsTypeGrammar
+# TypeGrammar
## Values
diff --git a/docs/models/chatcompletioncreateparamstypejsonobject.md b/docs/models/typejsonobject.md
similarity index 72%
rename from docs/models/chatcompletioncreateparamstypejsonobject.md
rename to docs/models/typejsonobject.md
index b3724f9..47eebd5 100644
--- a/docs/models/chatcompletioncreateparamstypejsonobject.md
+++ b/docs/models/typejsonobject.md
@@ -1,4 +1,4 @@
-# ChatCompletionCreateParamsTypeJSONObject
+# TypeJSONObject
## Values
diff --git a/docs/models/chatcompletioncreateparamstypejsonschema.md b/docs/models/typejsonschema.md
similarity index 72%
rename from docs/models/chatcompletioncreateparamstypejsonschema.md
rename to docs/models/typejsonschema.md
index 9f307a4..47333d3 100644
--- a/docs/models/chatcompletioncreateparamstypejsonschema.md
+++ b/docs/models/typejsonschema.md
@@ -1,4 +1,4 @@
-# ChatCompletionCreateParamsTypeJSONSchema
+# TypeJSONSchema
## Values
diff --git a/docs/models/chatcompletioncreateparamstypepython.md b/docs/models/typepython.md
similarity index 68%
rename from docs/models/chatcompletioncreateparamstypepython.md
rename to docs/models/typepython.md
index 991e9ac..4304c4b 100644
--- a/docs/models/chatcompletioncreateparamstypepython.md
+++ b/docs/models/typepython.md
@@ -1,4 +1,4 @@
-# ChatCompletionCreateParamsTypePython
+# TypePython
## Values
diff --git a/docs/sdks/chat/README.md b/docs/sdks/chat/README.md
index bc639cd..6e4870f 100644
--- a/docs/sdks/chat/README.md
+++ b/docs/sdks/chat/README.md
@@ -3,12 +3,9 @@
## Overview
-Chat completion operations
-
### Available Operations
* [complete](#complete) - Create a chat completion
-* [complete_stream](#complete_stream) - Create a chat completion
## complete
@@ -33,77 +30,6 @@ with OpenRouter(
},
], stream=False, temperature=1, top_p=1)
- # Handle response
- print(res)
-
-```
-
-### Parameters
-
-| Parameter | Type | Required | Description | Example |
-| ------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------- |
-| `messages` | List[[models.ChatCompletionMessageParam](../../models/chatcompletionmessageparam.md)] | :heavy_check_mark: | List of messages for the conversation | [
{
"role": "user",
"content": "Hello, how are you?"
}
] |
-| `model` | *Optional[str]* | :heavy_minus_sign: | Model to use for completion | |
-| `frequency_penalty` | *OptionalNullable[float]* | :heavy_minus_sign: | Frequency penalty (-2.0 to 2.0) | |
-| `logit_bias` | Dict[str, *float*] | :heavy_minus_sign: | Token logit bias adjustments | |
-| `logprobs` | *OptionalNullable[bool]* | :heavy_minus_sign: | Return log probabilities | |
-| `top_logprobs` | *OptionalNullable[float]* | :heavy_minus_sign: | Number of top log probabilities to return (0-20) | |
-| `max_completion_tokens` | *OptionalNullable[float]* | :heavy_minus_sign: | Maximum tokens in completion | |
-| `max_tokens` | *OptionalNullable[float]* | :heavy_minus_sign: | Maximum tokens (deprecated, use max_completion_tokens) | |
-| `metadata` | Dict[str, *str*] | :heavy_minus_sign: | Key-value pairs for additional object information (max 16 pairs, 64 char keys, 512 char values) | |
-| `presence_penalty` | *OptionalNullable[float]* | :heavy_minus_sign: | Presence penalty (-2.0 to 2.0) | |
-| `reasoning` | [OptionalNullable[models.ChatCompletionCreateParamsReasoning]](../../models/chatcompletioncreateparamsreasoning.md) | :heavy_minus_sign: | Reasoning configuration | |
-| `response_format` | [Optional[models.ChatCompletionCreateParamsResponseFormatUnion]](../../models/chatcompletioncreateparamsresponseformatunion.md) | :heavy_minus_sign: | Response format configuration | |
-| `seed` | *OptionalNullable[int]* | :heavy_minus_sign: | Random seed for deterministic outputs | |
-| `stop` | [OptionalNullable[models.ChatCompletionCreateParamsStop]](../../models/chatcompletioncreateparamsstop.md) | :heavy_minus_sign: | Stop sequences (up to 4) | |
-| `stream` | *OptionalNullable[bool]* | :heavy_minus_sign: | Enable streaming response | |
-| `stream_options` | [OptionalNullable[models.ChatCompletionCreateParamsStreamOptions]](../../models/chatcompletioncreateparamsstreamoptions.md) | :heavy_minus_sign: | N/A | |
-| `temperature` | *OptionalNullable[float]* | :heavy_minus_sign: | Sampling temperature (0-2) | |
-| `tool_choice` | [Optional[models.ChatCompletionToolChoiceOption]](../../models/chatcompletiontoolchoiceoption.md) | :heavy_minus_sign: | Tool choice configuration | |
-| `tools` | List[[models.ChatCompletionTool](../../models/chatcompletiontool.md)] | :heavy_minus_sign: | Available tools for function calling | |
-| `top_p` | *OptionalNullable[float]* | :heavy_minus_sign: | Nucleus sampling parameter (0-1) | |
-| `user` | *Optional[str]* | :heavy_minus_sign: | Unique user identifier | |
-| `fallback_models` | List[*str*] | :heavy_minus_sign: | Order of models to fallback to for this request | |
-| `reasoning_effort` | [OptionalNullable[models.ChatCompletionCreateParamsReasoningEffort]](../../models/chatcompletioncreateparamsreasoningeffort.md) | :heavy_minus_sign: | Reasoning effort | |
-| `provider` | [OptionalNullable[models.ChatCompletionCreateParamsProvider]](../../models/chatcompletioncreateparamsprovider.md) | :heavy_minus_sign: | When multiple model providers are available, optionally indicate your routing preference. | |
-| `plugins` | List[[models.ChatCompletionCreateParamsPluginUnion](../../models/chatcompletioncreateparamspluginunion.md)] | :heavy_minus_sign: | Plugins you want to enable for this request, including their settings. | |
-| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | |
-
-### Response
-
-**[models.ChatCompletion](../../models/chatcompletion.md)**
-
-### Errors
-
-| Error Type | Status Code | Content Type |
-| ----------------------------- | ----------------------------- | ----------------------------- |
-| errors.ChatCompletionError | 400, 401, 429 | application/json |
-| errors.ChatCompletionError | 500 | application/json |
-| errors.OpenRouterDefaultError | 4XX, 5XX | \*/\* |
-
-## complete_stream
-
-Creates a model response for the given chat conversation. Supports both streaming and non-streaming modes.
-
-### Example Usage
-
-
-```python
-from openrouter import OpenRouter
-import os
-
-
-with OpenRouter(
- api_key=os.getenv("OPENROUTER_API_KEY", ""),
-) as open_router:
-
- res = open_router.chat.complete_stream(messages=[
- {
- "role": "user",
- "content": "Hello, how are you?",
- },
- ], stream=True, temperature=1, top_p=1)
-
with res as event_stream:
for event in event_stream:
# handle event
@@ -113,38 +39,38 @@ with OpenRouter(
### Parameters
-| Parameter | Type | Required | Description | Example |
-| ------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------- |
-| `messages` | List[[models.ChatCompletionMessageParam](../../models/chatcompletionmessageparam.md)] | :heavy_check_mark: | List of messages for the conversation | [
{
"role": "user",
"content": "Hello, how are you?"
}
] |
-| `model` | *Optional[str]* | :heavy_minus_sign: | Model to use for completion | |
-| `frequency_penalty` | *OptionalNullable[float]* | :heavy_minus_sign: | Frequency penalty (-2.0 to 2.0) | |
-| `logit_bias` | Dict[str, *float*] | :heavy_minus_sign: | Token logit bias adjustments | |
-| `logprobs` | *OptionalNullable[bool]* | :heavy_minus_sign: | Return log probabilities | |
-| `top_logprobs` | *OptionalNullable[float]* | :heavy_minus_sign: | Number of top log probabilities to return (0-20) | |
-| `max_completion_tokens` | *OptionalNullable[float]* | :heavy_minus_sign: | Maximum tokens in completion | |
-| `max_tokens` | *OptionalNullable[float]* | :heavy_minus_sign: | Maximum tokens (deprecated, use max_completion_tokens) | |
-| `metadata` | Dict[str, *str*] | :heavy_minus_sign: | Key-value pairs for additional object information (max 16 pairs, 64 char keys, 512 char values) | |
-| `presence_penalty` | *OptionalNullable[float]* | :heavy_minus_sign: | Presence penalty (-2.0 to 2.0) | |
-| `reasoning` | [OptionalNullable[models.ChatStreamCompletionCreateParamsReasoning]](../../models/chatstreamcompletioncreateparamsreasoning.md) | :heavy_minus_sign: | Reasoning configuration | |
-| `response_format` | [Optional[models.ChatStreamCompletionCreateParamsResponseFormatUnion]](../../models/chatstreamcompletioncreateparamsresponseformatunion.md) | :heavy_minus_sign: | Response format configuration | |
-| `seed` | *OptionalNullable[int]* | :heavy_minus_sign: | Random seed for deterministic outputs | |
-| `stop` | [OptionalNullable[models.ChatStreamCompletionCreateParamsStop]](../../models/chatstreamcompletioncreateparamsstop.md) | :heavy_minus_sign: | Stop sequences (up to 4) | |
-| `stream` | *Optional[bool]* | :heavy_minus_sign: | Enable streaming response | |
-| `stream_options` | [OptionalNullable[models.ChatStreamCompletionCreateParamsStreamOptions]](../../models/chatstreamcompletioncreateparamsstreamoptions.md) | :heavy_minus_sign: | N/A | |
-| `temperature` | *OptionalNullable[float]* | :heavy_minus_sign: | Sampling temperature (0-2) | |
-| `tool_choice` | [Optional[models.ChatCompletionToolChoiceOption]](../../models/chatcompletiontoolchoiceoption.md) | :heavy_minus_sign: | Tool choice configuration | |
-| `tools` | List[[models.ChatCompletionTool](../../models/chatcompletiontool.md)] | :heavy_minus_sign: | Available tools for function calling | |
-| `top_p` | *OptionalNullable[float]* | :heavy_minus_sign: | Nucleus sampling parameter (0-1) | |
-| `user` | *Optional[str]* | :heavy_minus_sign: | Unique user identifier | |
-| `fallback_models` | List[*str*] | :heavy_minus_sign: | Order of models to fallback to for this request | |
-| `reasoning_effort` | [OptionalNullable[models.ChatStreamCompletionCreateParamsReasoningEffort]](../../models/chatstreamcompletioncreateparamsreasoningeffort.md) | :heavy_minus_sign: | Reasoning effort | |
-| `provider` | [OptionalNullable[models.ChatStreamCompletionCreateParamsProvider]](../../models/chatstreamcompletioncreateparamsprovider.md) | :heavy_minus_sign: | When multiple model providers are available, optionally indicate your routing preference. | |
-| `plugins` | List[[models.ChatStreamCompletionCreateParamsPluginUnion](../../models/chatstreamcompletioncreateparamspluginunion.md)] | :heavy_minus_sign: | Plugins you want to enable for this request, including their settings. | |
-| `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 | Example |
+| ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- |
+| `messages` | List[[models.ChatCompletionMessageParam](../../models/chatcompletionmessageparam.md)] | :heavy_check_mark: | List of messages for the conversation | [
{
"role": "user",
"content": "Hello, how are you?"
}
] |
+| `model` | *Optional[str]* | :heavy_minus_sign: | Model to use for completion | |
+| `frequency_penalty` | *OptionalNullable[float]* | :heavy_minus_sign: | Frequency penalty (-2.0 to 2.0) | |
+| `logit_bias` | Dict[str, *float*] | :heavy_minus_sign: | Token logit bias adjustments | |
+| `logprobs` | *OptionalNullable[bool]* | :heavy_minus_sign: | Return log probabilities | |
+| `top_logprobs` | *OptionalNullable[float]* | :heavy_minus_sign: | Number of top log probabilities to return (0-20) | |
+| `max_completion_tokens` | *OptionalNullable[float]* | :heavy_minus_sign: | Maximum tokens in completion | |
+| `max_tokens` | *OptionalNullable[float]* | :heavy_minus_sign: | Maximum tokens (deprecated, use max_completion_tokens) | |
+| `metadata` | Dict[str, *str*] | :heavy_minus_sign: | Key-value pairs for additional object information (max 16 pairs, 64 char keys, 512 char values) | |
+| `presence_penalty` | *OptionalNullable[float]* | :heavy_minus_sign: | Presence penalty (-2.0 to 2.0) | |
+| `reasoning` | [OptionalNullable[models.Reasoning]](../../models/reasoning.md) | :heavy_minus_sign: | Reasoning configuration | |
+| `response_format` | [Optional[models.ResponseFormat]](../../models/responseformat.md) | :heavy_minus_sign: | Response format configuration | |
+| `seed` | *OptionalNullable[int]* | :heavy_minus_sign: | Random seed for deterministic outputs | |
+| `stop` | [OptionalNullable[models.Stop]](../../models/stop.md) | :heavy_minus_sign: | Stop sequences (up to 4) | |
+| `stream` | *OptionalNullable[bool]* | :heavy_minus_sign: | Enable streaming response | |
+| `stream_options` | [OptionalNullable[models.StreamOptions]](../../models/streamoptions.md) | :heavy_minus_sign: | N/A | |
+| `temperature` | *OptionalNullable[float]* | :heavy_minus_sign: | Sampling temperature (0-2) | |
+| `tool_choice` | [Optional[models.ChatCompletionToolChoiceOption]](../../models/chatcompletiontoolchoiceoption.md) | :heavy_minus_sign: | Tool choice configuration | |
+| `tools` | List[[models.ChatCompletionTool](../../models/chatcompletiontool.md)] | :heavy_minus_sign: | Available tools for function calling | |
+| `top_p` | *OptionalNullable[float]* | :heavy_minus_sign: | Nucleus sampling parameter (0-1) | |
+| `user` | *Optional[str]* | :heavy_minus_sign: | Unique user identifier | |
+| `fallback_models` | List[*str*] | :heavy_minus_sign: | Order of models to fallback to for this request | |
+| `reasoning_effort` | [OptionalNullable[models.ReasoningEffort]](../../models/reasoningeffort.md) | :heavy_minus_sign: | Reasoning effort | |
+| `provider` | [OptionalNullable[models.Provider]](../../models/provider.md) | :heavy_minus_sign: | When multiple model providers are available, optionally indicate your routing preference. | |
+| `plugins` | List[[models.Plugin](../../models/plugin.md)] | :heavy_minus_sign: | Plugins you want to enable for this request, including their settings. | |
+| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | |
### Response
-**[Union[eventstreaming.EventStream[models.StreamChatCompletionResponseBody], eventstreaming.EventStreamAsync[models.StreamChatCompletionResponseBody]]](../../models/.md)**
+**[models.CreateChatCompletionResponse](../../models/createchatcompletionresponse.md)**
### Errors
diff --git a/pyproject.toml b/pyproject.toml
index 573ac55..8a3d17e 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -1,6 +1,6 @@
[project]
name = "openrouter"
-version = "0.5.2"
+version = "0.6.2"
description = "Python Client SDK Generated by Speakeasy."
authors = [{ name = "Speakeasy" },]
readme = "README-PYPI.md"
diff --git a/src/openrouter/_version.py b/src/openrouter/_version.py
index 2277dde..259ff7a 100644
--- a/src/openrouter/_version.py
+++ b/src/openrouter/_version.py
@@ -3,10 +3,10 @@
import importlib.metadata
__title__: str = "openrouter"
-__version__: str = "0.5.2"
+__version__: str = "0.6.2"
__openapi_doc_version__: str = "1.0.0"
-__gen_version__: str = "2.694.1"
-__user_agent__: str = "speakeasy-sdk/python 0.5.2 2.694.1 1.0.0 openrouter"
+__gen_version__: str = "2.695.0"
+__user_agent__: str = "speakeasy-sdk/python 0.6.2 2.695.0 1.0.0 openrouter"
try:
if __package__ is not None:
diff --git a/src/openrouter/chat.py b/src/openrouter/chat.py
index 56afd7c..58e3eb6 100644
--- a/src/openrouter/chat.py
+++ b/src/openrouter/chat.py
@@ -1,16 +1,138 @@
"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
from .basesdk import BaseSDK
+from enum import Enum
from openrouter import errors, models, utils
from openrouter._hooks import HookContext
from openrouter.types import OptionalNullable, UNSET
from openrouter.utils import eventstreaming, get_security_from_env
from openrouter.utils.unmarshal_json_response import unmarshal_json_response
-from typing import Any, Dict, List, Mapping, Optional, Union
+from typing import Any, Dict, List, Literal, Mapping, Optional, Union, overload
+
+
+class CompleteAcceptEnum(str, Enum):
+ APPLICATION_JSON = "application/json"
+ TEXT_EVENT_STREAM = "text/event-stream"
class Chat(BaseSDK):
- r"""Chat completion operations"""
+ @overload
+ def complete(
+ self,
+ *,
+ messages: Union[
+ List[models.ChatCompletionMessageParam],
+ List[models.ChatCompletionMessageParamTypedDict],
+ ],
+ model: Optional[str] = None,
+ frequency_penalty: OptionalNullable[float] = UNSET,
+ logit_bias: OptionalNullable[Dict[str, float]] = UNSET,
+ logprobs: OptionalNullable[bool] = UNSET,
+ top_logprobs: OptionalNullable[float] = UNSET,
+ max_completion_tokens: OptionalNullable[float] = UNSET,
+ max_tokens: OptionalNullable[float] = UNSET,
+ metadata: Optional[Dict[str, str]] = None,
+ presence_penalty: OptionalNullable[float] = UNSET,
+ reasoning: OptionalNullable[
+ Union[models.Reasoning, models.ReasoningTypedDict]
+ ] = UNSET,
+ response_format: Optional[
+ Union[models.ResponseFormat, models.ResponseFormatTypedDict]
+ ] = None,
+ seed: OptionalNullable[int] = UNSET,
+ stop: OptionalNullable[Union[models.Stop, models.StopTypedDict]] = UNSET,
+ stream: OptionalNullable[Literal[False]] = UNSET,
+ stream_options: OptionalNullable[
+ Union[models.StreamOptions, models.StreamOptionsTypedDict]
+ ] = UNSET,
+ temperature: OptionalNullable[float] = 1,
+ tool_choice: Optional[
+ Union[
+ models.ChatCompletionToolChoiceOption,
+ models.ChatCompletionToolChoiceOptionTypedDict,
+ ]
+ ] = None,
+ tools: Optional[
+ Union[
+ List[models.ChatCompletionTool],
+ List[models.ChatCompletionToolTypedDict],
+ ]
+ ] = None,
+ top_p: OptionalNullable[float] = 1,
+ user: Optional[str] = None,
+ fallback_models: OptionalNullable[List[str]] = UNSET,
+ reasoning_effort: OptionalNullable[models.ReasoningEffort] = UNSET,
+ provider: OptionalNullable[
+ Union[models.Provider, models.ProviderTypedDict]
+ ] = UNSET,
+ plugins: Optional[
+ Union[List[models.Plugin], List[models.PluginTypedDict]]
+ ] = None,
+ retries: OptionalNullable[utils.RetryConfig] = UNSET,
+ server_url: Optional[str] = None,
+ timeout_ms: Optional[int] = None,
+ accept_header_override: Optional[CompleteAcceptEnum] = None,
+ http_headers: Optional[Mapping[str, str]] = None,
+ ) -> models.ChatCompletion: ...
+
+ @overload
+ def complete(
+ self,
+ *,
+ messages: Union[
+ List[models.ChatCompletionMessageParam],
+ List[models.ChatCompletionMessageParamTypedDict],
+ ],
+ model: Optional[str] = None,
+ frequency_penalty: OptionalNullable[float] = UNSET,
+ logit_bias: OptionalNullable[Dict[str, float]] = UNSET,
+ logprobs: OptionalNullable[bool] = UNSET,
+ top_logprobs: OptionalNullable[float] = UNSET,
+ max_completion_tokens: OptionalNullable[float] = UNSET,
+ max_tokens: OptionalNullable[float] = UNSET,
+ metadata: Optional[Dict[str, str]] = None,
+ presence_penalty: OptionalNullable[float] = UNSET,
+ reasoning: OptionalNullable[
+ Union[models.Reasoning, models.ReasoningTypedDict]
+ ] = UNSET,
+ response_format: Optional[
+ Union[models.ResponseFormat, models.ResponseFormatTypedDict]
+ ] = None,
+ seed: OptionalNullable[int] = UNSET,
+ stop: OptionalNullable[Union[models.Stop, models.StopTypedDict]] = UNSET,
+ stream: Literal[True],
+ stream_options: OptionalNullable[
+ Union[models.StreamOptions, models.StreamOptionsTypedDict]
+ ] = UNSET,
+ temperature: OptionalNullable[float] = 1,
+ tool_choice: Optional[
+ Union[
+ models.ChatCompletionToolChoiceOption,
+ models.ChatCompletionToolChoiceOptionTypedDict,
+ ]
+ ] = None,
+ tools: Optional[
+ Union[
+ List[models.ChatCompletionTool],
+ List[models.ChatCompletionToolTypedDict],
+ ]
+ ] = None,
+ top_p: OptionalNullable[float] = 1,
+ user: Optional[str] = None,
+ fallback_models: OptionalNullable[List[str]] = UNSET,
+ reasoning_effort: OptionalNullable[models.ReasoningEffort] = UNSET,
+ provider: OptionalNullable[
+ Union[models.Provider, models.ProviderTypedDict]
+ ] = UNSET,
+ plugins: Optional[
+ Union[List[models.Plugin], List[models.PluginTypedDict]]
+ ] = None,
+ retries: OptionalNullable[utils.RetryConfig] = UNSET,
+ server_url: Optional[str] = None,
+ timeout_ms: Optional[int] = None,
+ accept_header_override: Optional[CompleteAcceptEnum] = None,
+ http_headers: Optional[Mapping[str, str]] = None,
+ ) -> eventstreaming.EventStream[models.ChatCompletionChunkWrapper]: ...
def complete(
self,
@@ -29,30 +151,16 @@ class Chat(BaseSDK):
metadata: Optional[Dict[str, str]] = None,
presence_penalty: OptionalNullable[float] = UNSET,
reasoning: OptionalNullable[
- Union[
- models.ChatCompletionCreateParamsReasoning,
- models.ChatCompletionCreateParamsReasoningTypedDict,
- ]
+ Union[models.Reasoning, models.ReasoningTypedDict]
] = UNSET,
response_format: Optional[
- Union[
- models.ChatCompletionCreateParamsResponseFormatUnion,
- models.ChatCompletionCreateParamsResponseFormatUnionTypedDict,
- ]
+ Union[models.ResponseFormat, models.ResponseFormatTypedDict]
] = None,
seed: OptionalNullable[int] = UNSET,
- stop: OptionalNullable[
- Union[
- models.ChatCompletionCreateParamsStop,
- models.ChatCompletionCreateParamsStopTypedDict,
- ]
- ] = UNSET,
+ stop: OptionalNullable[Union[models.Stop, models.StopTypedDict]] = UNSET,
stream: OptionalNullable[bool] = False,
stream_options: OptionalNullable[
- Union[
- models.ChatCompletionCreateParamsStreamOptions,
- models.ChatCompletionCreateParamsStreamOptionsTypedDict,
- ]
+ Union[models.StreamOptions, models.StreamOptionsTypedDict]
] = UNSET,
temperature: OptionalNullable[float] = 1,
tool_choice: Optional[
@@ -70,26 +178,19 @@ class Chat(BaseSDK):
top_p: OptionalNullable[float] = 1,
user: Optional[str] = None,
fallback_models: OptionalNullable[List[str]] = UNSET,
- reasoning_effort: OptionalNullable[
- models.ChatCompletionCreateParamsReasoningEffort
- ] = UNSET,
+ reasoning_effort: OptionalNullable[models.ReasoningEffort] = UNSET,
provider: OptionalNullable[
- Union[
- models.ChatCompletionCreateParamsProvider,
- models.ChatCompletionCreateParamsProviderTypedDict,
- ]
+ Union[models.Provider, models.ProviderTypedDict]
] = UNSET,
plugins: Optional[
- Union[
- List[models.ChatCompletionCreateParamsPluginUnion],
- List[models.ChatCompletionCreateParamsPluginUnionTypedDict],
- ]
+ Union[List[models.Plugin], List[models.PluginTypedDict]]
] = None,
retries: OptionalNullable[utils.RetryConfig] = UNSET,
server_url: Optional[str] = None,
timeout_ms: Optional[int] = None,
+ accept_header_override: Optional[CompleteAcceptEnum] = None,
http_headers: Optional[Mapping[str, str]] = None,
- ) -> models.ChatCompletion:
+ ) -> models.CreateChatCompletionResponse:
r"""Create a chat completion
Creates a model response for the given chat conversation. Supports both streaming and non-streaming modes.
@@ -122,6 +223,7 @@ class Chat(BaseSDK):
:param retries: Override the default retry configuration for this method
:param server_url: Override the default server URL for this method
:param timeout_ms: Override the default request timeout configuration for this method in milliseconds
+ :param accept_header_override: Override the default accept header for this method
:param http_headers: Additional headers to set or replace on requests.
"""
base_url = None
@@ -148,18 +250,16 @@ class Chat(BaseSDK):
metadata=metadata,
presence_penalty=presence_penalty,
reasoning=utils.get_pydantic_model(
- reasoning, OptionalNullable[models.ChatCompletionCreateParamsReasoning]
+ reasoning, OptionalNullable[models.Reasoning]
),
response_format=utils.get_pydantic_model(
- response_format,
- Optional[models.ChatCompletionCreateParamsResponseFormatUnion],
+ response_format, Optional[models.ResponseFormat]
),
seed=seed,
stop=stop,
stream=stream,
stream_options=utils.get_pydantic_model(
- stream_options,
- OptionalNullable[models.ChatCompletionCreateParamsStreamOptions],
+ stream_options, OptionalNullable[models.StreamOptions]
),
temperature=temperature,
tool_choice=utils.get_pydantic_model(
@@ -173,11 +273,9 @@ class Chat(BaseSDK):
fallback_models=fallback_models,
reasoning_effort=reasoning_effort,
provider=utils.get_pydantic_model(
- provider, OptionalNullable[models.ChatCompletionCreateParamsProvider]
- ),
- plugins=utils.get_pydantic_model(
- plugins, Optional[List[models.ChatCompletionCreateParamsPluginUnion]]
+ provider, OptionalNullable[models.Provider]
),
+ plugins=utils.get_pydantic_model(plugins, Optional[List[models.Plugin]]),
)
req = self._build_request(
@@ -190,7 +288,9 @@ class Chat(BaseSDK):
request_has_path_params=False,
request_has_query_params=True,
user_agent_header="user-agent",
- accept_header_value="application/json",
+ accept_header_value=accept_header_override.value
+ if accept_header_override is not None
+ else "application/json;q=1, text/event-stream;q=0",
http_headers=http_headers,
security=self.sdk_configuration.security,
get_serialized_body=lambda: utils.serialize_request_body(
@@ -219,491 +319,21 @@ class Chat(BaseSDK):
),
request=req,
error_status_codes=["400", "401", "429", "4XX", "500", "5XX"],
- retry_config=retry_config,
- )
-
- response_data: Any = None
- if utils.match_response(http_res, "200", "application/json"):
- return unmarshal_json_response(models.ChatCompletion, http_res)
- if utils.match_response(http_res, ["400", "401", "429"], "application/json"):
- response_data = unmarshal_json_response(
- errors.ChatCompletionErrorData, http_res
- )
- raise errors.ChatCompletionError(response_data, http_res)
- if utils.match_response(http_res, "500", "application/json"):
- response_data = unmarshal_json_response(
- errors.ChatCompletionErrorData, http_res
- )
- raise errors.ChatCompletionError(response_data, http_res)
- if utils.match_response(http_res, "4XX", "*"):
- http_res_text = utils.stream_to_text(http_res)
- raise errors.OpenRouterDefaultError(
- "API error occurred", http_res, http_res_text
- )
- if utils.match_response(http_res, "5XX", "*"):
- http_res_text = utils.stream_to_text(http_res)
- raise errors.OpenRouterDefaultError(
- "API error occurred", http_res, http_res_text
- )
-
- raise errors.OpenRouterDefaultError("Unexpected response received", http_res)
-
- async def complete_async(
- self,
- *,
- messages: Union[
- List[models.ChatCompletionMessageParam],
- List[models.ChatCompletionMessageParamTypedDict],
- ],
- model: Optional[str] = None,
- frequency_penalty: OptionalNullable[float] = UNSET,
- logit_bias: OptionalNullable[Dict[str, float]] = UNSET,
- logprobs: OptionalNullable[bool] = UNSET,
- top_logprobs: OptionalNullable[float] = UNSET,
- max_completion_tokens: OptionalNullable[float] = UNSET,
- max_tokens: OptionalNullable[float] = UNSET,
- metadata: Optional[Dict[str, str]] = None,
- presence_penalty: OptionalNullable[float] = UNSET,
- reasoning: OptionalNullable[
- Union[
- models.ChatCompletionCreateParamsReasoning,
- models.ChatCompletionCreateParamsReasoningTypedDict,
- ]
- ] = UNSET,
- response_format: Optional[
- Union[
- models.ChatCompletionCreateParamsResponseFormatUnion,
- models.ChatCompletionCreateParamsResponseFormatUnionTypedDict,
- ]
- ] = None,
- seed: OptionalNullable[int] = UNSET,
- stop: OptionalNullable[
- Union[
- models.ChatCompletionCreateParamsStop,
- models.ChatCompletionCreateParamsStopTypedDict,
- ]
- ] = UNSET,
- stream: OptionalNullable[bool] = False,
- stream_options: OptionalNullable[
- Union[
- models.ChatCompletionCreateParamsStreamOptions,
- models.ChatCompletionCreateParamsStreamOptionsTypedDict,
- ]
- ] = UNSET,
- temperature: OptionalNullable[float] = 1,
- tool_choice: Optional[
- Union[
- models.ChatCompletionToolChoiceOption,
- models.ChatCompletionToolChoiceOptionTypedDict,
- ]
- ] = None,
- tools: Optional[
- Union[
- List[models.ChatCompletionTool],
- List[models.ChatCompletionToolTypedDict],
- ]
- ] = None,
- top_p: OptionalNullable[float] = 1,
- user: Optional[str] = None,
- fallback_models: OptionalNullable[List[str]] = UNSET,
- reasoning_effort: OptionalNullable[
- models.ChatCompletionCreateParamsReasoningEffort
- ] = UNSET,
- provider: OptionalNullable[
- Union[
- models.ChatCompletionCreateParamsProvider,
- models.ChatCompletionCreateParamsProviderTypedDict,
- ]
- ] = UNSET,
- plugins: Optional[
- Union[
- List[models.ChatCompletionCreateParamsPluginUnion],
- List[models.ChatCompletionCreateParamsPluginUnionTypedDict],
- ]
- ] = None,
- retries: OptionalNullable[utils.RetryConfig] = UNSET,
- server_url: Optional[str] = None,
- timeout_ms: Optional[int] = None,
- http_headers: Optional[Mapping[str, str]] = None,
- ) -> models.ChatCompletion:
- r"""Create a chat completion
-
- Creates a model response for the given chat conversation. Supports both streaming and non-streaming modes.
-
- :param messages: List of messages for the conversation
- :param model: Model to use for completion
- :param frequency_penalty: Frequency penalty (-2.0 to 2.0)
- :param logit_bias: Token logit bias adjustments
- :param logprobs: Return log probabilities
- :param top_logprobs: Number of top log probabilities to return (0-20)
- :param max_completion_tokens: Maximum tokens in completion
- :param max_tokens: Maximum tokens (deprecated, use max_completion_tokens)
- :param metadata: Key-value pairs for additional object information (max 16 pairs, 64 char keys, 512 char values)
- :param presence_penalty: Presence penalty (-2.0 to 2.0)
- :param reasoning: Reasoning configuration
- :param response_format: Response format configuration
- :param seed: Random seed for deterministic outputs
- :param stop: Stop sequences (up to 4)
- :param stream: Enable streaming response
- :param stream_options:
- :param temperature: Sampling temperature (0-2)
- :param tool_choice: Tool choice configuration
- :param tools: Available tools for function calling
- :param top_p: Nucleus sampling parameter (0-1)
- :param user: Unique user identifier
- :param fallback_models: Order of models to fallback to for this request
- :param reasoning_effort: Reasoning effort
- :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 retries: Override the default retry configuration for this method
- :param server_url: Override the default server URL for this method
- :param timeout_ms: Override the default request timeout configuration for this method in milliseconds
- :param http_headers: Additional headers to set or replace on requests.
- """
- base_url = None
- url_variables = None
- if timeout_ms is None:
- timeout_ms = self.sdk_configuration.timeout_ms
-
- if server_url is not None:
- base_url = server_url
- else:
- base_url = self._get_url(base_url, url_variables)
-
- request = models.ChatCompletionCreateParams(
- messages=utils.get_pydantic_model(
- messages, List[models.ChatCompletionMessageParam]
- ),
- model=model,
- frequency_penalty=frequency_penalty,
- logit_bias=logit_bias,
- logprobs=logprobs,
- top_logprobs=top_logprobs,
- max_completion_tokens=max_completion_tokens,
- max_tokens=max_tokens,
- metadata=metadata,
- presence_penalty=presence_penalty,
- reasoning=utils.get_pydantic_model(
- reasoning, OptionalNullable[models.ChatCompletionCreateParamsReasoning]
- ),
- response_format=utils.get_pydantic_model(
- response_format,
- Optional[models.ChatCompletionCreateParamsResponseFormatUnion],
- ),
- seed=seed,
- stop=stop,
- stream=stream,
- stream_options=utils.get_pydantic_model(
- stream_options,
- OptionalNullable[models.ChatCompletionCreateParamsStreamOptions],
- ),
- temperature=temperature,
- tool_choice=utils.get_pydantic_model(
- tool_choice, Optional[models.ChatCompletionToolChoiceOption]
- ),
- tools=utils.get_pydantic_model(
- tools, Optional[List[models.ChatCompletionTool]]
- ),
- top_p=top_p,
- user=user,
- fallback_models=fallback_models,
- reasoning_effort=reasoning_effort,
- provider=utils.get_pydantic_model(
- provider, OptionalNullable[models.ChatCompletionCreateParamsProvider]
- ),
- plugins=utils.get_pydantic_model(
- plugins, Optional[List[models.ChatCompletionCreateParamsPluginUnion]]
- ),
- )
-
- req = self._build_request_async(
- method="POST",
- path="/chat/completions",
- base_url=base_url,
- url_variables=url_variables,
- request=request,
- request_body_required=True,
- request_has_path_params=False,
- request_has_query_params=True,
- user_agent_header="user-agent",
- accept_header_value="application/json",
- http_headers=http_headers,
- security=self.sdk_configuration.security,
- get_serialized_body=lambda: utils.serialize_request_body(
- request, False, False, "json", models.ChatCompletionCreateParams
- ),
- timeout_ms=timeout_ms,
- )
-
- if retries == UNSET:
- if self.sdk_configuration.retry_config is not UNSET:
- retries = self.sdk_configuration.retry_config
-
- retry_config = None
- if isinstance(retries, utils.RetryConfig):
- retry_config = (retries, ["429", "500", "502", "503", "504"])
-
- http_res = await self.do_request_async(
- hook_ctx=HookContext(
- config=self.sdk_configuration,
- base_url=base_url or "",
- operation_id="createChatCompletion",
- oauth2_scopes=[],
- security_source=get_security_from_env(
- self.sdk_configuration.security, models.Security
- ),
- ),
- request=req,
- error_status_codes=["400", "401", "429", "4XX", "500", "5XX"],
- retry_config=retry_config,
- )
-
- response_data: Any = None
- if utils.match_response(http_res, "200", "application/json"):
- return unmarshal_json_response(models.ChatCompletion, http_res)
- if utils.match_response(http_res, ["400", "401", "429"], "application/json"):
- response_data = unmarshal_json_response(
- errors.ChatCompletionErrorData, http_res
- )
- raise errors.ChatCompletionError(response_data, http_res)
- if utils.match_response(http_res, "500", "application/json"):
- response_data = unmarshal_json_response(
- errors.ChatCompletionErrorData, http_res
- )
- raise errors.ChatCompletionError(response_data, http_res)
- if utils.match_response(http_res, "4XX", "*"):
- http_res_text = await utils.stream_to_text_async(http_res)
- raise errors.OpenRouterDefaultError(
- "API error occurred", http_res, http_res_text
- )
- if utils.match_response(http_res, "5XX", "*"):
- http_res_text = await utils.stream_to_text_async(http_res)
- raise errors.OpenRouterDefaultError(
- "API error occurred", http_res, http_res_text
- )
-
- raise errors.OpenRouterDefaultError("Unexpected response received", http_res)
-
- def complete_stream(
- self,
- *,
- messages: Union[
- List[models.ChatCompletionMessageParam],
- List[models.ChatCompletionMessageParamTypedDict],
- ],
- model: Optional[str] = None,
- frequency_penalty: OptionalNullable[float] = UNSET,
- logit_bias: OptionalNullable[Dict[str, float]] = UNSET,
- logprobs: OptionalNullable[bool] = UNSET,
- top_logprobs: OptionalNullable[float] = UNSET,
- max_completion_tokens: OptionalNullable[float] = UNSET,
- max_tokens: OptionalNullable[float] = UNSET,
- metadata: Optional[Dict[str, str]] = None,
- presence_penalty: OptionalNullable[float] = UNSET,
- reasoning: OptionalNullable[
- Union[
- models.ChatStreamCompletionCreateParamsReasoning,
- models.ChatStreamCompletionCreateParamsReasoningTypedDict,
- ]
- ] = UNSET,
- response_format: Optional[
- Union[
- models.ChatStreamCompletionCreateParamsResponseFormatUnion,
- models.ChatStreamCompletionCreateParamsResponseFormatUnionTypedDict,
- ]
- ] = None,
- seed: OptionalNullable[int] = UNSET,
- stop: OptionalNullable[
- Union[
- models.ChatStreamCompletionCreateParamsStop,
- models.ChatStreamCompletionCreateParamsStopTypedDict,
- ]
- ] = UNSET,
- stream: Optional[bool] = True,
- stream_options: OptionalNullable[
- Union[
- models.ChatStreamCompletionCreateParamsStreamOptions,
- models.ChatStreamCompletionCreateParamsStreamOptionsTypedDict,
- ]
- ] = UNSET,
- temperature: OptionalNullable[float] = 1,
- tool_choice: Optional[
- Union[
- models.ChatCompletionToolChoiceOption,
- models.ChatCompletionToolChoiceOptionTypedDict,
- ]
- ] = None,
- tools: Optional[
- Union[
- List[models.ChatCompletionTool],
- List[models.ChatCompletionToolTypedDict],
- ]
- ] = None,
- top_p: OptionalNullable[float] = 1,
- user: Optional[str] = None,
- fallback_models: OptionalNullable[List[str]] = UNSET,
- reasoning_effort: OptionalNullable[
- models.ChatStreamCompletionCreateParamsReasoningEffort
- ] = UNSET,
- provider: OptionalNullable[
- Union[
- models.ChatStreamCompletionCreateParamsProvider,
- models.ChatStreamCompletionCreateParamsProviderTypedDict,
- ]
- ] = UNSET,
- plugins: Optional[
- Union[
- List[models.ChatStreamCompletionCreateParamsPluginUnion],
- List[models.ChatStreamCompletionCreateParamsPluginUnionTypedDict],
- ]
- ] = None,
- retries: OptionalNullable[utils.RetryConfig] = UNSET,
- server_url: Optional[str] = None,
- timeout_ms: Optional[int] = None,
- http_headers: Optional[Mapping[str, str]] = None,
- ) -> eventstreaming.EventStream[models.StreamChatCompletionResponseBody]:
- r"""Create a chat completion
-
- Creates a model response for the given chat conversation. Supports both streaming and non-streaming modes.
-
- :param messages: List of messages for the conversation
- :param model: Model to use for completion
- :param frequency_penalty: Frequency penalty (-2.0 to 2.0)
- :param logit_bias: Token logit bias adjustments
- :param logprobs: Return log probabilities
- :param top_logprobs: Number of top log probabilities to return (0-20)
- :param max_completion_tokens: Maximum tokens in completion
- :param max_tokens: Maximum tokens (deprecated, use max_completion_tokens)
- :param metadata: Key-value pairs for additional object information (max 16 pairs, 64 char keys, 512 char values)
- :param presence_penalty: Presence penalty (-2.0 to 2.0)
- :param reasoning: Reasoning configuration
- :param response_format: Response format configuration
- :param seed: Random seed for deterministic outputs
- :param stop: Stop sequences (up to 4)
- :param stream: Enable streaming response
- :param stream_options:
- :param temperature: Sampling temperature (0-2)
- :param tool_choice: Tool choice configuration
- :param tools: Available tools for function calling
- :param top_p: Nucleus sampling parameter (0-1)
- :param user: Unique user identifier
- :param fallback_models: Order of models to fallback to for this request
- :param reasoning_effort: Reasoning effort
- :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 retries: Override the default retry configuration for this method
- :param server_url: Override the default server URL for this method
- :param timeout_ms: Override the default request timeout configuration for this method in milliseconds
- :param http_headers: Additional headers to set or replace on requests.
- """
- base_url = None
- url_variables = None
- if timeout_ms is None:
- timeout_ms = self.sdk_configuration.timeout_ms
-
- if server_url is not None:
- base_url = server_url
- else:
- base_url = self._get_url(base_url, url_variables)
-
- request = models.ChatStreamCompletionCreateParams(
- messages=utils.get_pydantic_model(
- messages, List[models.ChatCompletionMessageParam]
- ),
- model=model,
- frequency_penalty=frequency_penalty,
- logit_bias=logit_bias,
- logprobs=logprobs,
- top_logprobs=top_logprobs,
- max_completion_tokens=max_completion_tokens,
- max_tokens=max_tokens,
- metadata=metadata,
- presence_penalty=presence_penalty,
- reasoning=utils.get_pydantic_model(
- reasoning,
- OptionalNullable[models.ChatStreamCompletionCreateParamsReasoning],
- ),
- response_format=utils.get_pydantic_model(
- response_format,
- Optional[models.ChatStreamCompletionCreateParamsResponseFormatUnion],
- ),
- seed=seed,
- stop=stop,
- stream=stream,
- stream_options=utils.get_pydantic_model(
- stream_options,
- OptionalNullable[models.ChatStreamCompletionCreateParamsStreamOptions],
- ),
- temperature=temperature,
- tool_choice=utils.get_pydantic_model(
- tool_choice, Optional[models.ChatCompletionToolChoiceOption]
- ),
- tools=utils.get_pydantic_model(
- tools, Optional[List[models.ChatCompletionTool]]
- ),
- top_p=top_p,
- user=user,
- fallback_models=fallback_models,
- reasoning_effort=reasoning_effort,
- provider=utils.get_pydantic_model(
- provider,
- OptionalNullable[models.ChatStreamCompletionCreateParamsProvider],
- ),
- plugins=utils.get_pydantic_model(
- plugins,
- Optional[List[models.ChatStreamCompletionCreateParamsPluginUnion]],
- ),
- )
-
- req = self._build_request(
- method="POST",
- path="/chat/completions#stream",
- base_url=base_url,
- url_variables=url_variables,
- request=request,
- request_body_required=True,
- request_has_path_params=False,
- request_has_query_params=True,
- user_agent_header="user-agent",
- accept_header_value="text/event-stream",
- http_headers=http_headers,
- security=self.sdk_configuration.security,
- get_serialized_body=lambda: utils.serialize_request_body(
- request, False, False, "json", models.ChatStreamCompletionCreateParams
- ),
- timeout_ms=timeout_ms,
- )
-
- if retries == UNSET:
- if self.sdk_configuration.retry_config is not UNSET:
- retries = self.sdk_configuration.retry_config
-
- retry_config = None
- if isinstance(retries, utils.RetryConfig):
- retry_config = (retries, ["429", "500", "502", "503", "504"])
-
- http_res = self.do_request(
- hook_ctx=HookContext(
- config=self.sdk_configuration,
- base_url=base_url or "",
- operation_id="streamChatCompletion",
- oauth2_scopes=[],
- security_source=get_security_from_env(
- self.sdk_configuration.security, models.Security
- ),
- ),
- request=req,
- error_status_codes=["400", "401", "429", "4XX", "500", "5XX"],
stream=True,
retry_config=retry_config,
)
response_data: Any = None
+ if utils.match_response(http_res, "200", "application/json"):
+ http_res_text = utils.stream_to_text(http_res)
+ return unmarshal_json_response(
+ models.ChatCompletion, http_res, http_res_text
+ )
if utils.match_response(http_res, "200", "text/event-stream"):
return eventstreaming.EventStream(
http_res,
lambda raw: utils.unmarshal_json(
- raw, models.StreamChatCompletionResponseBody
+ raw, models.ChatCompletionChunkWrapper
),
sentinel="[DONE]",
client_ref=self,
@@ -736,7 +366,8 @@ class Chat(BaseSDK):
"Unexpected response received", http_res, http_res_text
)
- async def complete_stream_async(
+ @overload
+ async def complete_async(
self,
*,
messages: Union[
@@ -753,30 +384,16 @@ class Chat(BaseSDK):
metadata: Optional[Dict[str, str]] = None,
presence_penalty: OptionalNullable[float] = UNSET,
reasoning: OptionalNullable[
- Union[
- models.ChatStreamCompletionCreateParamsReasoning,
- models.ChatStreamCompletionCreateParamsReasoningTypedDict,
- ]
+ Union[models.Reasoning, models.ReasoningTypedDict]
] = UNSET,
response_format: Optional[
- Union[
- models.ChatStreamCompletionCreateParamsResponseFormatUnion,
- models.ChatStreamCompletionCreateParamsResponseFormatUnionTypedDict,
- ]
+ Union[models.ResponseFormat, models.ResponseFormatTypedDict]
] = None,
seed: OptionalNullable[int] = UNSET,
- stop: OptionalNullable[
- Union[
- models.ChatStreamCompletionCreateParamsStop,
- models.ChatStreamCompletionCreateParamsStopTypedDict,
- ]
- ] = UNSET,
- stream: Optional[bool] = True,
+ stop: OptionalNullable[Union[models.Stop, models.StopTypedDict]] = UNSET,
+ stream: OptionalNullable[Literal[False]] = UNSET,
stream_options: OptionalNullable[
- Union[
- models.ChatStreamCompletionCreateParamsStreamOptions,
- models.ChatStreamCompletionCreateParamsStreamOptionsTypedDict,
- ]
+ Union[models.StreamOptions, models.StreamOptionsTypedDict]
] = UNSET,
temperature: OptionalNullable[float] = 1,
tool_choice: Optional[
@@ -794,26 +411,136 @@ class Chat(BaseSDK):
top_p: OptionalNullable[float] = 1,
user: Optional[str] = None,
fallback_models: OptionalNullable[List[str]] = UNSET,
- reasoning_effort: OptionalNullable[
- models.ChatStreamCompletionCreateParamsReasoningEffort
- ] = UNSET,
+ reasoning_effort: OptionalNullable[models.ReasoningEffort] = UNSET,
provider: OptionalNullable[
- Union[
- models.ChatStreamCompletionCreateParamsProvider,
- models.ChatStreamCompletionCreateParamsProviderTypedDict,
- ]
+ Union[models.Provider, models.ProviderTypedDict]
] = UNSET,
plugins: Optional[
- Union[
- List[models.ChatStreamCompletionCreateParamsPluginUnion],
- List[models.ChatStreamCompletionCreateParamsPluginUnionTypedDict],
- ]
+ Union[List[models.Plugin], List[models.PluginTypedDict]]
] = None,
retries: OptionalNullable[utils.RetryConfig] = UNSET,
server_url: Optional[str] = None,
timeout_ms: Optional[int] = None,
+ accept_header_override: Optional[CompleteAcceptEnum] = None,
http_headers: Optional[Mapping[str, str]] = None,
- ) -> eventstreaming.EventStreamAsync[models.StreamChatCompletionResponseBody]:
+ ) -> models.ChatCompletion: ...
+
+ @overload
+ async def complete_async(
+ self,
+ *,
+ messages: Union[
+ List[models.ChatCompletionMessageParam],
+ List[models.ChatCompletionMessageParamTypedDict],
+ ],
+ model: Optional[str] = None,
+ frequency_penalty: OptionalNullable[float] = UNSET,
+ logit_bias: OptionalNullable[Dict[str, float]] = UNSET,
+ logprobs: OptionalNullable[bool] = UNSET,
+ top_logprobs: OptionalNullable[float] = UNSET,
+ max_completion_tokens: OptionalNullable[float] = UNSET,
+ max_tokens: OptionalNullable[float] = UNSET,
+ metadata: Optional[Dict[str, str]] = None,
+ presence_penalty: OptionalNullable[float] = UNSET,
+ reasoning: OptionalNullable[
+ Union[models.Reasoning, models.ReasoningTypedDict]
+ ] = UNSET,
+ response_format: Optional[
+ Union[models.ResponseFormat, models.ResponseFormatTypedDict]
+ ] = None,
+ seed: OptionalNullable[int] = UNSET,
+ stop: OptionalNullable[Union[models.Stop, models.StopTypedDict]] = UNSET,
+ stream: Literal[True],
+ stream_options: OptionalNullable[
+ Union[models.StreamOptions, models.StreamOptionsTypedDict]
+ ] = UNSET,
+ temperature: OptionalNullable[float] = 1,
+ tool_choice: Optional[
+ Union[
+ models.ChatCompletionToolChoiceOption,
+ models.ChatCompletionToolChoiceOptionTypedDict,
+ ]
+ ] = None,
+ tools: Optional[
+ Union[
+ List[models.ChatCompletionTool],
+ List[models.ChatCompletionToolTypedDict],
+ ]
+ ] = None,
+ top_p: OptionalNullable[float] = 1,
+ user: Optional[str] = None,
+ fallback_models: OptionalNullable[List[str]] = UNSET,
+ reasoning_effort: OptionalNullable[models.ReasoningEffort] = UNSET,
+ provider: OptionalNullable[
+ Union[models.Provider, models.ProviderTypedDict]
+ ] = UNSET,
+ plugins: Optional[
+ Union[List[models.Plugin], List[models.PluginTypedDict]]
+ ] = None,
+ retries: OptionalNullable[utils.RetryConfig] = UNSET,
+ server_url: Optional[str] = None,
+ timeout_ms: Optional[int] = None,
+ accept_header_override: Optional[CompleteAcceptEnum] = None,
+ http_headers: Optional[Mapping[str, str]] = None,
+ ) -> eventstreaming.EventStreamAsync[models.ChatCompletionChunkWrapper]: ...
+
+ async def complete_async(
+ self,
+ *,
+ messages: Union[
+ List[models.ChatCompletionMessageParam],
+ List[models.ChatCompletionMessageParamTypedDict],
+ ],
+ model: Optional[str] = None,
+ frequency_penalty: OptionalNullable[float] = UNSET,
+ logit_bias: OptionalNullable[Dict[str, float]] = UNSET,
+ logprobs: OptionalNullable[bool] = UNSET,
+ top_logprobs: OptionalNullable[float] = UNSET,
+ max_completion_tokens: OptionalNullable[float] = UNSET,
+ max_tokens: OptionalNullable[float] = UNSET,
+ metadata: Optional[Dict[str, str]] = None,
+ presence_penalty: OptionalNullable[float] = UNSET,
+ reasoning: OptionalNullable[
+ Union[models.Reasoning, models.ReasoningTypedDict]
+ ] = UNSET,
+ response_format: Optional[
+ Union[models.ResponseFormat, models.ResponseFormatTypedDict]
+ ] = None,
+ seed: OptionalNullable[int] = UNSET,
+ stop: OptionalNullable[Union[models.Stop, models.StopTypedDict]] = UNSET,
+ stream: OptionalNullable[bool] = False,
+ stream_options: OptionalNullable[
+ Union[models.StreamOptions, models.StreamOptionsTypedDict]
+ ] = UNSET,
+ temperature: OptionalNullable[float] = 1,
+ tool_choice: Optional[
+ Union[
+ models.ChatCompletionToolChoiceOption,
+ models.ChatCompletionToolChoiceOptionTypedDict,
+ ]
+ ] = None,
+ tools: Optional[
+ Union[
+ List[models.ChatCompletionTool],
+ List[models.ChatCompletionToolTypedDict],
+ ]
+ ] = None,
+ top_p: OptionalNullable[float] = 1,
+ user: Optional[str] = None,
+ fallback_models: OptionalNullable[List[str]] = UNSET,
+ reasoning_effort: OptionalNullable[models.ReasoningEffort] = UNSET,
+ provider: OptionalNullable[
+ Union[models.Provider, models.ProviderTypedDict]
+ ] = UNSET,
+ plugins: Optional[
+ Union[List[models.Plugin], List[models.PluginTypedDict]]
+ ] = None,
+ retries: OptionalNullable[utils.RetryConfig] = UNSET,
+ server_url: Optional[str] = None,
+ timeout_ms: Optional[int] = None,
+ accept_header_override: Optional[CompleteAcceptEnum] = None,
+ http_headers: Optional[Mapping[str, str]] = None,
+ ) -> models.CreateChatCompletionResponse:
r"""Create a chat completion
Creates a model response for the given chat conversation. Supports both streaming and non-streaming modes.
@@ -846,6 +573,7 @@ class Chat(BaseSDK):
:param retries: Override the default retry configuration for this method
:param server_url: Override the default server URL for this method
:param timeout_ms: Override the default request timeout configuration for this method in milliseconds
+ :param accept_header_override: Override the default accept header for this method
:param http_headers: Additional headers to set or replace on requests.
"""
base_url = None
@@ -858,7 +586,7 @@ class Chat(BaseSDK):
else:
base_url = self._get_url(base_url, url_variables)
- request = models.ChatStreamCompletionCreateParams(
+ request = models.ChatCompletionCreateParams(
messages=utils.get_pydantic_model(
messages, List[models.ChatCompletionMessageParam]
),
@@ -872,19 +600,16 @@ class Chat(BaseSDK):
metadata=metadata,
presence_penalty=presence_penalty,
reasoning=utils.get_pydantic_model(
- reasoning,
- OptionalNullable[models.ChatStreamCompletionCreateParamsReasoning],
+ reasoning, OptionalNullable[models.Reasoning]
),
response_format=utils.get_pydantic_model(
- response_format,
- Optional[models.ChatStreamCompletionCreateParamsResponseFormatUnion],
+ response_format, Optional[models.ResponseFormat]
),
seed=seed,
stop=stop,
stream=stream,
stream_options=utils.get_pydantic_model(
- stream_options,
- OptionalNullable[models.ChatStreamCompletionCreateParamsStreamOptions],
+ stream_options, OptionalNullable[models.StreamOptions]
),
temperature=temperature,
tool_choice=utils.get_pydantic_model(
@@ -898,18 +623,14 @@ class Chat(BaseSDK):
fallback_models=fallback_models,
reasoning_effort=reasoning_effort,
provider=utils.get_pydantic_model(
- provider,
- OptionalNullable[models.ChatStreamCompletionCreateParamsProvider],
- ),
- plugins=utils.get_pydantic_model(
- plugins,
- Optional[List[models.ChatStreamCompletionCreateParamsPluginUnion]],
+ provider, OptionalNullable[models.Provider]
),
+ plugins=utils.get_pydantic_model(plugins, Optional[List[models.Plugin]]),
)
req = self._build_request_async(
method="POST",
- path="/chat/completions#stream",
+ path="/chat/completions",
base_url=base_url,
url_variables=url_variables,
request=request,
@@ -917,11 +638,13 @@ class Chat(BaseSDK):
request_has_path_params=False,
request_has_query_params=True,
user_agent_header="user-agent",
- accept_header_value="text/event-stream",
+ accept_header_value=accept_header_override.value
+ if accept_header_override is not None
+ else "application/json;q=1, text/event-stream;q=0",
http_headers=http_headers,
security=self.sdk_configuration.security,
get_serialized_body=lambda: utils.serialize_request_body(
- request, False, False, "json", models.ChatStreamCompletionCreateParams
+ request, False, False, "json", models.ChatCompletionCreateParams
),
timeout_ms=timeout_ms,
)
@@ -938,7 +661,7 @@ class Chat(BaseSDK):
hook_ctx=HookContext(
config=self.sdk_configuration,
base_url=base_url or "",
- operation_id="streamChatCompletion",
+ operation_id="createChatCompletion",
oauth2_scopes=[],
security_source=get_security_from_env(
self.sdk_configuration.security, models.Security
@@ -951,11 +674,16 @@ class Chat(BaseSDK):
)
response_data: Any = None
+ if utils.match_response(http_res, "200", "application/json"):
+ http_res_text = await utils.stream_to_text_async(http_res)
+ return unmarshal_json_response(
+ models.ChatCompletion, http_res, http_res_text
+ )
if utils.match_response(http_res, "200", "text/event-stream"):
return eventstreaming.EventStreamAsync(
http_res,
lambda raw: utils.unmarshal_json(
- raw, models.StreamChatCompletionResponseBody
+ raw, models.ChatCompletionChunkWrapper
),
sentinel="[DONE]",
client_ref=self,
diff --git a/src/openrouter/models/__init__.py b/src/openrouter/models/__init__.py
index 2ae4b74..9ec727c 100644
--- a/src/openrouter/models/__init__.py
+++ b/src/openrouter/models/__init__.py
@@ -46,6 +46,10 @@ if TYPE_CHECKING:
ChatCompletionChunkChoiceDeltaToolCallType,
ChatCompletionChunkChoiceDeltaToolCallTypedDict,
)
+ from .chatcompletionchunkwrapper import (
+ ChatCompletionChunkWrapper,
+ ChatCompletionChunkWrapperTypedDict,
+ )
from .chatcompletioncontentpart import (
ChatCompletionContentPart,
ChatCompletionContentPartTypedDict,
@@ -72,79 +76,79 @@ if TYPE_CHECKING:
ChatCompletionContentPartTextTypedDict,
)
from .chatcompletioncreateparams import (
+ Audio,
+ AudioTypedDict,
ChatCompletionCreateParams,
- ChatCompletionCreateParamsAudio,
- ChatCompletionCreateParamsAudioTypedDict,
- ChatCompletionCreateParamsCompletion,
- ChatCompletionCreateParamsCompletionTypedDict,
- ChatCompletionCreateParamsDataCollection,
- ChatCompletionCreateParamsEffort,
- ChatCompletionCreateParamsEngine,
- ChatCompletionCreateParamsIDChainOfThought,
- ChatCompletionCreateParamsIDFileParser,
- ChatCompletionCreateParamsIDModeration,
- ChatCompletionCreateParamsIDWeb,
- ChatCompletionCreateParamsIgnoreEnum,
- ChatCompletionCreateParamsIgnoreUnion,
- ChatCompletionCreateParamsIgnoreUnionTypedDict,
- ChatCompletionCreateParamsImage,
- ChatCompletionCreateParamsImageTypedDict,
- ChatCompletionCreateParamsJSONSchema,
- ChatCompletionCreateParamsJSONSchemaTypedDict,
- ChatCompletionCreateParamsMaxPrice,
- ChatCompletionCreateParamsMaxPriceTypedDict,
- ChatCompletionCreateParamsOnlyEnum,
- ChatCompletionCreateParamsOnlyUnion,
- ChatCompletionCreateParamsOnlyUnionTypedDict,
- ChatCompletionCreateParamsOrderEnum,
- ChatCompletionCreateParamsOrderUnion,
- ChatCompletionCreateParamsOrderUnionTypedDict,
- ChatCompletionCreateParamsPdf,
- ChatCompletionCreateParamsPdfEngine,
- ChatCompletionCreateParamsPdfTypedDict,
- ChatCompletionCreateParamsPluginChainOfThought,
- ChatCompletionCreateParamsPluginChainOfThoughtTypedDict,
- ChatCompletionCreateParamsPluginFileParser,
- ChatCompletionCreateParamsPluginFileParserTypedDict,
- ChatCompletionCreateParamsPluginModeration,
- ChatCompletionCreateParamsPluginModerationTypedDict,
- ChatCompletionCreateParamsPluginUnion,
- ChatCompletionCreateParamsPluginUnionTypedDict,
- ChatCompletionCreateParamsPluginWeb,
- ChatCompletionCreateParamsPluginWebTypedDict,
- ChatCompletionCreateParamsPrompt,
- ChatCompletionCreateParamsPromptTypedDict,
- ChatCompletionCreateParamsProvider,
- ChatCompletionCreateParamsProviderTypedDict,
- ChatCompletionCreateParamsQuantization,
- ChatCompletionCreateParamsReasoning,
- ChatCompletionCreateParamsReasoningEffort,
- ChatCompletionCreateParamsReasoningTypedDict,
- ChatCompletionCreateParamsRequest,
- ChatCompletionCreateParamsRequestTypedDict,
- ChatCompletionCreateParamsResponseFormatGrammar,
- ChatCompletionCreateParamsResponseFormatGrammarTypedDict,
- ChatCompletionCreateParamsResponseFormatJSONObject,
- ChatCompletionCreateParamsResponseFormatJSONObjectTypedDict,
- ChatCompletionCreateParamsResponseFormatJSONSchema,
- ChatCompletionCreateParamsResponseFormatJSONSchemaTypedDict,
- ChatCompletionCreateParamsResponseFormatPython,
- ChatCompletionCreateParamsResponseFormatPythonTypedDict,
- ChatCompletionCreateParamsResponseFormatText,
- ChatCompletionCreateParamsResponseFormatTextTypedDict,
- ChatCompletionCreateParamsResponseFormatUnion,
- ChatCompletionCreateParamsResponseFormatUnionTypedDict,
- ChatCompletionCreateParamsSort,
- ChatCompletionCreateParamsStop,
- ChatCompletionCreateParamsStopTypedDict,
- ChatCompletionCreateParamsStreamOptions,
- ChatCompletionCreateParamsStreamOptionsTypedDict,
- ChatCompletionCreateParamsTypeGrammar,
- ChatCompletionCreateParamsTypeJSONObject,
- ChatCompletionCreateParamsTypeJSONSchema,
- ChatCompletionCreateParamsTypePython,
ChatCompletionCreateParamsTypeText,
ChatCompletionCreateParamsTypedDict,
+ Completion,
+ CompletionTypedDict,
+ DataCollection,
+ Effort,
+ Engine,
+ IDChainOfThought,
+ IDFileParser,
+ IDModeration,
+ IDWeb,
+ Ignore,
+ IgnoreEnum,
+ IgnoreTypedDict,
+ Image,
+ ImageTypedDict,
+ JSONSchema,
+ JSONSchemaTypedDict,
+ MaxPrice,
+ MaxPriceTypedDict,
+ Only,
+ OnlyEnum,
+ OnlyTypedDict,
+ Order,
+ OrderEnum,
+ OrderTypedDict,
+ Pdf,
+ PdfEngine,
+ PdfTypedDict,
+ Plugin,
+ PluginChainOfThought,
+ PluginChainOfThoughtTypedDict,
+ PluginFileParser,
+ PluginFileParserTypedDict,
+ PluginModeration,
+ PluginModerationTypedDict,
+ PluginTypedDict,
+ PluginWeb,
+ PluginWebTypedDict,
+ Prompt,
+ PromptTypedDict,
+ Provider,
+ ProviderTypedDict,
+ Quantization,
+ Reasoning,
+ ReasoningEffort,
+ ReasoningTypedDict,
+ Request,
+ RequestTypedDict,
+ ResponseFormat,
+ ResponseFormatGrammar,
+ ResponseFormatGrammarTypedDict,
+ ResponseFormatJSONObject,
+ ResponseFormatJSONObjectTypedDict,
+ ResponseFormatJSONSchema,
+ ResponseFormatJSONSchemaTypedDict,
+ ResponseFormatPython,
+ ResponseFormatPythonTypedDict,
+ ResponseFormatText,
+ ResponseFormatTextTypedDict,
+ ResponseFormatTypedDict,
+ Sort,
+ Stop,
+ StopTypedDict,
+ StreamOptions,
+ StreamOptionsTypedDict,
+ TypeGrammar,
+ TypeJSONObject,
+ TypeJSONSchema,
+ TypePython,
)
from .chatcompletionerror import Error, ErrorTypedDict
from .chatcompletionmessage import (
@@ -217,81 +221,6 @@ if TYPE_CHECKING:
ChatCompletionUserMessageParamRole,
ChatCompletionUserMessageParamTypedDict,
)
- from .chatstreamcompletioncreateparams import (
- ChatStreamCompletionCreateParams,
- ChatStreamCompletionCreateParamsAudio,
- ChatStreamCompletionCreateParamsAudioTypedDict,
- ChatStreamCompletionCreateParamsCompletion,
- ChatStreamCompletionCreateParamsCompletionTypedDict,
- ChatStreamCompletionCreateParamsDataCollection,
- ChatStreamCompletionCreateParamsEffort,
- ChatStreamCompletionCreateParamsEngine,
- ChatStreamCompletionCreateParamsIDChainOfThought,
- ChatStreamCompletionCreateParamsIDFileParser,
- ChatStreamCompletionCreateParamsIDModeration,
- ChatStreamCompletionCreateParamsIDWeb,
- ChatStreamCompletionCreateParamsIgnoreEnum,
- ChatStreamCompletionCreateParamsIgnoreUnion,
- ChatStreamCompletionCreateParamsIgnoreUnionTypedDict,
- ChatStreamCompletionCreateParamsImage,
- ChatStreamCompletionCreateParamsImageTypedDict,
- ChatStreamCompletionCreateParamsJSONSchema,
- ChatStreamCompletionCreateParamsJSONSchemaTypedDict,
- ChatStreamCompletionCreateParamsMaxPrice,
- ChatStreamCompletionCreateParamsMaxPriceTypedDict,
- ChatStreamCompletionCreateParamsOnlyEnum,
- ChatStreamCompletionCreateParamsOnlyUnion,
- ChatStreamCompletionCreateParamsOnlyUnionTypedDict,
- ChatStreamCompletionCreateParamsOrderEnum,
- ChatStreamCompletionCreateParamsOrderUnion,
- ChatStreamCompletionCreateParamsOrderUnionTypedDict,
- ChatStreamCompletionCreateParamsPdf,
- ChatStreamCompletionCreateParamsPdfEngine,
- ChatStreamCompletionCreateParamsPdfTypedDict,
- ChatStreamCompletionCreateParamsPluginChainOfThought,
- ChatStreamCompletionCreateParamsPluginChainOfThoughtTypedDict,
- ChatStreamCompletionCreateParamsPluginFileParser,
- ChatStreamCompletionCreateParamsPluginFileParserTypedDict,
- ChatStreamCompletionCreateParamsPluginModeration,
- ChatStreamCompletionCreateParamsPluginModerationTypedDict,
- ChatStreamCompletionCreateParamsPluginUnion,
- ChatStreamCompletionCreateParamsPluginUnionTypedDict,
- ChatStreamCompletionCreateParamsPluginWeb,
- ChatStreamCompletionCreateParamsPluginWebTypedDict,
- ChatStreamCompletionCreateParamsPrompt,
- ChatStreamCompletionCreateParamsPromptTypedDict,
- ChatStreamCompletionCreateParamsProvider,
- ChatStreamCompletionCreateParamsProviderTypedDict,
- ChatStreamCompletionCreateParamsQuantization,
- ChatStreamCompletionCreateParamsReasoning,
- ChatStreamCompletionCreateParamsReasoningEffort,
- ChatStreamCompletionCreateParamsReasoningTypedDict,
- ChatStreamCompletionCreateParamsRequest,
- ChatStreamCompletionCreateParamsRequestTypedDict,
- ChatStreamCompletionCreateParamsResponseFormatGrammar,
- ChatStreamCompletionCreateParamsResponseFormatGrammarTypedDict,
- ChatStreamCompletionCreateParamsResponseFormatJSONObject,
- ChatStreamCompletionCreateParamsResponseFormatJSONObjectTypedDict,
- ChatStreamCompletionCreateParamsResponseFormatJSONSchema,
- ChatStreamCompletionCreateParamsResponseFormatJSONSchemaTypedDict,
- ChatStreamCompletionCreateParamsResponseFormatPython,
- ChatStreamCompletionCreateParamsResponseFormatPythonTypedDict,
- ChatStreamCompletionCreateParamsResponseFormatText,
- ChatStreamCompletionCreateParamsResponseFormatTextTypedDict,
- ChatStreamCompletionCreateParamsResponseFormatUnion,
- ChatStreamCompletionCreateParamsResponseFormatUnionTypedDict,
- ChatStreamCompletionCreateParamsSort,
- ChatStreamCompletionCreateParamsStop,
- ChatStreamCompletionCreateParamsStopTypedDict,
- ChatStreamCompletionCreateParamsStreamOptions,
- ChatStreamCompletionCreateParamsStreamOptionsTypedDict,
- ChatStreamCompletionCreateParamsTypeGrammar,
- ChatStreamCompletionCreateParamsTypeJSONObject,
- ChatStreamCompletionCreateParamsTypeJSONSchema,
- ChatStreamCompletionCreateParamsTypePython,
- ChatStreamCompletionCreateParamsTypeText,
- ChatStreamCompletionCreateParamsTypedDict,
- )
from .completionusage import (
CompletionTokensDetails,
CompletionTokensDetailsTypedDict,
@@ -300,6 +229,10 @@ if TYPE_CHECKING:
PromptTokensDetails,
PromptTokensDetailsTypedDict,
)
+ from .createchatcompletionop import (
+ CreateChatCompletionResponse,
+ CreateChatCompletionResponseTypedDict,
+ )
from .fileannotationdetail import (
ContentImageURL,
ContentImageURLTypedDict,
@@ -341,10 +274,6 @@ if TYPE_CHECKING:
ResponseFormatJSONSchemaSchemaTypedDict,
)
from .security import Security, SecurityTypedDict
- from .streamchatcompletionop import (
- StreamChatCompletionResponseBody,
- StreamChatCompletionResponseBodyTypedDict,
- )
from .urlcitationannotationdetail import (
URLCitation,
URLCitationAnnotationDetail,
@@ -356,6 +285,8 @@ if TYPE_CHECKING:
__all__ = [
"AnnotationDetail",
"AnnotationDetailTypedDict",
+ "Audio",
+ "AudioTypedDict",
"ChatCompletion",
"ChatCompletionAssistantMessageParam",
"ChatCompletionAssistantMessageParamContent",
@@ -379,6 +310,8 @@ __all__ = [
"ChatCompletionChunkChoiceTypedDict",
"ChatCompletionChunkObject",
"ChatCompletionChunkTypedDict",
+ "ChatCompletionChunkWrapper",
+ "ChatCompletionChunkWrapperTypedDict",
"ChatCompletionContentPart",
"ChatCompletionContentPartAudio",
"ChatCompletionContentPartAudioFormat",
@@ -394,76 +327,6 @@ __all__ = [
"ChatCompletionContentPartTextTypedDict",
"ChatCompletionContentPartTypedDict",
"ChatCompletionCreateParams",
- "ChatCompletionCreateParamsAudio",
- "ChatCompletionCreateParamsAudioTypedDict",
- "ChatCompletionCreateParamsCompletion",
- "ChatCompletionCreateParamsCompletionTypedDict",
- "ChatCompletionCreateParamsDataCollection",
- "ChatCompletionCreateParamsEffort",
- "ChatCompletionCreateParamsEngine",
- "ChatCompletionCreateParamsIDChainOfThought",
- "ChatCompletionCreateParamsIDFileParser",
- "ChatCompletionCreateParamsIDModeration",
- "ChatCompletionCreateParamsIDWeb",
- "ChatCompletionCreateParamsIgnoreEnum",
- "ChatCompletionCreateParamsIgnoreUnion",
- "ChatCompletionCreateParamsIgnoreUnionTypedDict",
- "ChatCompletionCreateParamsImage",
- "ChatCompletionCreateParamsImageTypedDict",
- "ChatCompletionCreateParamsJSONSchema",
- "ChatCompletionCreateParamsJSONSchemaTypedDict",
- "ChatCompletionCreateParamsMaxPrice",
- "ChatCompletionCreateParamsMaxPriceTypedDict",
- "ChatCompletionCreateParamsOnlyEnum",
- "ChatCompletionCreateParamsOnlyUnion",
- "ChatCompletionCreateParamsOnlyUnionTypedDict",
- "ChatCompletionCreateParamsOrderEnum",
- "ChatCompletionCreateParamsOrderUnion",
- "ChatCompletionCreateParamsOrderUnionTypedDict",
- "ChatCompletionCreateParamsPdf",
- "ChatCompletionCreateParamsPdfEngine",
- "ChatCompletionCreateParamsPdfTypedDict",
- "ChatCompletionCreateParamsPluginChainOfThought",
- "ChatCompletionCreateParamsPluginChainOfThoughtTypedDict",
- "ChatCompletionCreateParamsPluginFileParser",
- "ChatCompletionCreateParamsPluginFileParserTypedDict",
- "ChatCompletionCreateParamsPluginModeration",
- "ChatCompletionCreateParamsPluginModerationTypedDict",
- "ChatCompletionCreateParamsPluginUnion",
- "ChatCompletionCreateParamsPluginUnionTypedDict",
- "ChatCompletionCreateParamsPluginWeb",
- "ChatCompletionCreateParamsPluginWebTypedDict",
- "ChatCompletionCreateParamsPrompt",
- "ChatCompletionCreateParamsPromptTypedDict",
- "ChatCompletionCreateParamsProvider",
- "ChatCompletionCreateParamsProviderTypedDict",
- "ChatCompletionCreateParamsQuantization",
- "ChatCompletionCreateParamsReasoning",
- "ChatCompletionCreateParamsReasoningEffort",
- "ChatCompletionCreateParamsReasoningTypedDict",
- "ChatCompletionCreateParamsRequest",
- "ChatCompletionCreateParamsRequestTypedDict",
- "ChatCompletionCreateParamsResponseFormatGrammar",
- "ChatCompletionCreateParamsResponseFormatGrammarTypedDict",
- "ChatCompletionCreateParamsResponseFormatJSONObject",
- "ChatCompletionCreateParamsResponseFormatJSONObjectTypedDict",
- "ChatCompletionCreateParamsResponseFormatJSONSchema",
- "ChatCompletionCreateParamsResponseFormatJSONSchemaTypedDict",
- "ChatCompletionCreateParamsResponseFormatPython",
- "ChatCompletionCreateParamsResponseFormatPythonTypedDict",
- "ChatCompletionCreateParamsResponseFormatText",
- "ChatCompletionCreateParamsResponseFormatTextTypedDict",
- "ChatCompletionCreateParamsResponseFormatUnion",
- "ChatCompletionCreateParamsResponseFormatUnionTypedDict",
- "ChatCompletionCreateParamsSort",
- "ChatCompletionCreateParamsStop",
- "ChatCompletionCreateParamsStopTypedDict",
- "ChatCompletionCreateParamsStreamOptions",
- "ChatCompletionCreateParamsStreamOptionsTypedDict",
- "ChatCompletionCreateParamsTypeGrammar",
- "ChatCompletionCreateParamsTypeJSONObject",
- "ChatCompletionCreateParamsTypeJSONSchema",
- "ChatCompletionCreateParamsTypePython",
"ChatCompletionCreateParamsTypeText",
"ChatCompletionCreateParamsTypedDict",
"ChatCompletionMessage",
@@ -512,81 +375,10 @@ __all__ = [
"ChatCompletionUserMessageParamContentTypedDict",
"ChatCompletionUserMessageParamRole",
"ChatCompletionUserMessageParamTypedDict",
- "ChatStreamCompletionCreateParams",
- "ChatStreamCompletionCreateParamsAudio",
- "ChatStreamCompletionCreateParamsAudioTypedDict",
- "ChatStreamCompletionCreateParamsCompletion",
- "ChatStreamCompletionCreateParamsCompletionTypedDict",
- "ChatStreamCompletionCreateParamsDataCollection",
- "ChatStreamCompletionCreateParamsEffort",
- "ChatStreamCompletionCreateParamsEngine",
- "ChatStreamCompletionCreateParamsIDChainOfThought",
- "ChatStreamCompletionCreateParamsIDFileParser",
- "ChatStreamCompletionCreateParamsIDModeration",
- "ChatStreamCompletionCreateParamsIDWeb",
- "ChatStreamCompletionCreateParamsIgnoreEnum",
- "ChatStreamCompletionCreateParamsIgnoreUnion",
- "ChatStreamCompletionCreateParamsIgnoreUnionTypedDict",
- "ChatStreamCompletionCreateParamsImage",
- "ChatStreamCompletionCreateParamsImageTypedDict",
- "ChatStreamCompletionCreateParamsJSONSchema",
- "ChatStreamCompletionCreateParamsJSONSchemaTypedDict",
- "ChatStreamCompletionCreateParamsMaxPrice",
- "ChatStreamCompletionCreateParamsMaxPriceTypedDict",
- "ChatStreamCompletionCreateParamsOnlyEnum",
- "ChatStreamCompletionCreateParamsOnlyUnion",
- "ChatStreamCompletionCreateParamsOnlyUnionTypedDict",
- "ChatStreamCompletionCreateParamsOrderEnum",
- "ChatStreamCompletionCreateParamsOrderUnion",
- "ChatStreamCompletionCreateParamsOrderUnionTypedDict",
- "ChatStreamCompletionCreateParamsPdf",
- "ChatStreamCompletionCreateParamsPdfEngine",
- "ChatStreamCompletionCreateParamsPdfTypedDict",
- "ChatStreamCompletionCreateParamsPluginChainOfThought",
- "ChatStreamCompletionCreateParamsPluginChainOfThoughtTypedDict",
- "ChatStreamCompletionCreateParamsPluginFileParser",
- "ChatStreamCompletionCreateParamsPluginFileParserTypedDict",
- "ChatStreamCompletionCreateParamsPluginModeration",
- "ChatStreamCompletionCreateParamsPluginModerationTypedDict",
- "ChatStreamCompletionCreateParamsPluginUnion",
- "ChatStreamCompletionCreateParamsPluginUnionTypedDict",
- "ChatStreamCompletionCreateParamsPluginWeb",
- "ChatStreamCompletionCreateParamsPluginWebTypedDict",
- "ChatStreamCompletionCreateParamsPrompt",
- "ChatStreamCompletionCreateParamsPromptTypedDict",
- "ChatStreamCompletionCreateParamsProvider",
- "ChatStreamCompletionCreateParamsProviderTypedDict",
- "ChatStreamCompletionCreateParamsQuantization",
- "ChatStreamCompletionCreateParamsReasoning",
- "ChatStreamCompletionCreateParamsReasoningEffort",
- "ChatStreamCompletionCreateParamsReasoningTypedDict",
- "ChatStreamCompletionCreateParamsRequest",
- "ChatStreamCompletionCreateParamsRequestTypedDict",
- "ChatStreamCompletionCreateParamsResponseFormatGrammar",
- "ChatStreamCompletionCreateParamsResponseFormatGrammarTypedDict",
- "ChatStreamCompletionCreateParamsResponseFormatJSONObject",
- "ChatStreamCompletionCreateParamsResponseFormatJSONObjectTypedDict",
- "ChatStreamCompletionCreateParamsResponseFormatJSONSchema",
- "ChatStreamCompletionCreateParamsResponseFormatJSONSchemaTypedDict",
- "ChatStreamCompletionCreateParamsResponseFormatPython",
- "ChatStreamCompletionCreateParamsResponseFormatPythonTypedDict",
- "ChatStreamCompletionCreateParamsResponseFormatText",
- "ChatStreamCompletionCreateParamsResponseFormatTextTypedDict",
- "ChatStreamCompletionCreateParamsResponseFormatUnion",
- "ChatStreamCompletionCreateParamsResponseFormatUnionTypedDict",
- "ChatStreamCompletionCreateParamsSort",
- "ChatStreamCompletionCreateParamsStop",
- "ChatStreamCompletionCreateParamsStopTypedDict",
- "ChatStreamCompletionCreateParamsStreamOptions",
- "ChatStreamCompletionCreateParamsStreamOptionsTypedDict",
- "ChatStreamCompletionCreateParamsTypeGrammar",
- "ChatStreamCompletionCreateParamsTypeJSONObject",
- "ChatStreamCompletionCreateParamsTypeJSONSchema",
- "ChatStreamCompletionCreateParamsTypePython",
- "ChatStreamCompletionCreateParamsTypeText",
- "ChatStreamCompletionCreateParamsTypedDict",
+ "Completion",
"CompletionTokensDetails",
"CompletionTokensDetailsTypedDict",
+ "CompletionTypedDict",
"CompletionUsage",
"CompletionUsageTypedDict",
"ContentImageURL",
@@ -595,7 +387,12 @@ __all__ = [
"ContentTextTypedDict",
"ContentTypeImageURL",
"ContentTypeText",
+ "CreateChatCompletionResponse",
+ "CreateChatCompletionResponseTypedDict",
+ "DataCollection",
"Detail",
+ "Effort",
+ "Engine",
"Error",
"ErrorTypedDict",
"File",
@@ -606,12 +403,50 @@ __all__ = [
"FileAnnotationDetailImageURLTypedDict",
"FileAnnotationDetailTypedDict",
"FileTypedDict",
+ "IDChainOfThought",
+ "IDFileParser",
+ "IDModeration",
+ "IDWeb",
+ "Ignore",
+ "IgnoreEnum",
+ "IgnoreTypedDict",
+ "Image",
+ "ImageTypedDict",
"InputAudio",
"InputAudioTypedDict",
+ "JSONSchema",
+ "JSONSchemaTypedDict",
+ "MaxPrice",
+ "MaxPriceTypedDict",
+ "Only",
+ "OnlyEnum",
+ "OnlyTypedDict",
+ "Order",
+ "OrderEnum",
+ "OrderTypedDict",
"Parameters",
"ParametersTypedDict",
+ "Pdf",
+ "PdfEngine",
+ "PdfTypedDict",
+ "Plugin",
+ "PluginChainOfThought",
+ "PluginChainOfThoughtTypedDict",
+ "PluginFileParser",
+ "PluginFileParserTypedDict",
+ "PluginModeration",
+ "PluginModerationTypedDict",
+ "PluginTypedDict",
+ "PluginWeb",
+ "PluginWebTypedDict",
+ "Prompt",
"PromptTokensDetails",
"PromptTokensDetailsTypedDict",
+ "PromptTypedDict",
+ "Provider",
+ "ProviderTypedDict",
+ "Quantization",
+ "Reasoning",
"ReasoningDetail",
"ReasoningDetailEncrypted",
"ReasoningDetailEncryptedFormat",
@@ -626,15 +461,38 @@ __all__ = [
"ReasoningDetailTextType",
"ReasoningDetailTextTypedDict",
"ReasoningDetailTypedDict",
+ "ReasoningEffort",
+ "ReasoningTypedDict",
+ "Request",
+ "RequestTypedDict",
+ "ResponseFormat",
+ "ResponseFormatGrammar",
+ "ResponseFormatGrammarTypedDict",
+ "ResponseFormatJSONObject",
+ "ResponseFormatJSONObjectTypedDict",
+ "ResponseFormatJSONSchema",
"ResponseFormatJSONSchemaSchema",
"ResponseFormatJSONSchemaSchemaTypedDict",
+ "ResponseFormatJSONSchemaTypedDict",
+ "ResponseFormatPython",
+ "ResponseFormatPythonTypedDict",
+ "ResponseFormatText",
+ "ResponseFormatTextTypedDict",
+ "ResponseFormatTypedDict",
"Security",
"SecurityTypedDict",
- "StreamChatCompletionResponseBody",
- "StreamChatCompletionResponseBodyTypedDict",
+ "Sort",
+ "Stop",
+ "StopTypedDict",
+ "StreamOptions",
+ "StreamOptionsTypedDict",
"TopLogprob",
"TopLogprobTypedDict",
"TypeFile",
+ "TypeGrammar",
+ "TypeJSONObject",
+ "TypeJSONSchema",
+ "TypePython",
"URLCitation",
"URLCitationAnnotationDetail",
"URLCitationAnnotationDetailType",
@@ -670,6 +528,8 @@ _dynamic_imports: dict[str, str] = {
"ChatCompletionChunkChoiceDeltaToolCallFunctionTypedDict": ".chatcompletionchunkchoicedeltatoolcall",
"ChatCompletionChunkChoiceDeltaToolCallType": ".chatcompletionchunkchoicedeltatoolcall",
"ChatCompletionChunkChoiceDeltaToolCallTypedDict": ".chatcompletionchunkchoicedeltatoolcall",
+ "ChatCompletionChunkWrapper": ".chatcompletionchunkwrapper",
+ "ChatCompletionChunkWrapperTypedDict": ".chatcompletionchunkwrapper",
"ChatCompletionContentPart": ".chatcompletioncontentpart",
"ChatCompletionContentPartTypedDict": ".chatcompletioncontentpart",
"ChatCompletionContentPartAudio": ".chatcompletioncontentpartaudio",
@@ -687,79 +547,79 @@ _dynamic_imports: dict[str, str] = {
"ChatCompletionContentPartText": ".chatcompletioncontentparttext",
"ChatCompletionContentPartTextType": ".chatcompletioncontentparttext",
"ChatCompletionContentPartTextTypedDict": ".chatcompletioncontentparttext",
+ "Audio": ".chatcompletioncreateparams",
+ "AudioTypedDict": ".chatcompletioncreateparams",
"ChatCompletionCreateParams": ".chatcompletioncreateparams",
- "ChatCompletionCreateParamsAudio": ".chatcompletioncreateparams",
- "ChatCompletionCreateParamsAudioTypedDict": ".chatcompletioncreateparams",
- "ChatCompletionCreateParamsCompletion": ".chatcompletioncreateparams",
- "ChatCompletionCreateParamsCompletionTypedDict": ".chatcompletioncreateparams",
- "ChatCompletionCreateParamsDataCollection": ".chatcompletioncreateparams",
- "ChatCompletionCreateParamsEffort": ".chatcompletioncreateparams",
- "ChatCompletionCreateParamsEngine": ".chatcompletioncreateparams",
- "ChatCompletionCreateParamsIDChainOfThought": ".chatcompletioncreateparams",
- "ChatCompletionCreateParamsIDFileParser": ".chatcompletioncreateparams",
- "ChatCompletionCreateParamsIDModeration": ".chatcompletioncreateparams",
- "ChatCompletionCreateParamsIDWeb": ".chatcompletioncreateparams",
- "ChatCompletionCreateParamsIgnoreEnum": ".chatcompletioncreateparams",
- "ChatCompletionCreateParamsIgnoreUnion": ".chatcompletioncreateparams",
- "ChatCompletionCreateParamsIgnoreUnionTypedDict": ".chatcompletioncreateparams",
- "ChatCompletionCreateParamsImage": ".chatcompletioncreateparams",
- "ChatCompletionCreateParamsImageTypedDict": ".chatcompletioncreateparams",
- "ChatCompletionCreateParamsJSONSchema": ".chatcompletioncreateparams",
- "ChatCompletionCreateParamsJSONSchemaTypedDict": ".chatcompletioncreateparams",
- "ChatCompletionCreateParamsMaxPrice": ".chatcompletioncreateparams",
- "ChatCompletionCreateParamsMaxPriceTypedDict": ".chatcompletioncreateparams",
- "ChatCompletionCreateParamsOnlyEnum": ".chatcompletioncreateparams",
- "ChatCompletionCreateParamsOnlyUnion": ".chatcompletioncreateparams",
- "ChatCompletionCreateParamsOnlyUnionTypedDict": ".chatcompletioncreateparams",
- "ChatCompletionCreateParamsOrderEnum": ".chatcompletioncreateparams",
- "ChatCompletionCreateParamsOrderUnion": ".chatcompletioncreateparams",
- "ChatCompletionCreateParamsOrderUnionTypedDict": ".chatcompletioncreateparams",
- "ChatCompletionCreateParamsPdf": ".chatcompletioncreateparams",
- "ChatCompletionCreateParamsPdfEngine": ".chatcompletioncreateparams",
- "ChatCompletionCreateParamsPdfTypedDict": ".chatcompletioncreateparams",
- "ChatCompletionCreateParamsPluginChainOfThought": ".chatcompletioncreateparams",
- "ChatCompletionCreateParamsPluginChainOfThoughtTypedDict": ".chatcompletioncreateparams",
- "ChatCompletionCreateParamsPluginFileParser": ".chatcompletioncreateparams",
- "ChatCompletionCreateParamsPluginFileParserTypedDict": ".chatcompletioncreateparams",
- "ChatCompletionCreateParamsPluginModeration": ".chatcompletioncreateparams",
- "ChatCompletionCreateParamsPluginModerationTypedDict": ".chatcompletioncreateparams",
- "ChatCompletionCreateParamsPluginUnion": ".chatcompletioncreateparams",
- "ChatCompletionCreateParamsPluginUnionTypedDict": ".chatcompletioncreateparams",
- "ChatCompletionCreateParamsPluginWeb": ".chatcompletioncreateparams",
- "ChatCompletionCreateParamsPluginWebTypedDict": ".chatcompletioncreateparams",
- "ChatCompletionCreateParamsPrompt": ".chatcompletioncreateparams",
- "ChatCompletionCreateParamsPromptTypedDict": ".chatcompletioncreateparams",
- "ChatCompletionCreateParamsProvider": ".chatcompletioncreateparams",
- "ChatCompletionCreateParamsProviderTypedDict": ".chatcompletioncreateparams",
- "ChatCompletionCreateParamsQuantization": ".chatcompletioncreateparams",
- "ChatCompletionCreateParamsReasoning": ".chatcompletioncreateparams",
- "ChatCompletionCreateParamsReasoningEffort": ".chatcompletioncreateparams",
- "ChatCompletionCreateParamsReasoningTypedDict": ".chatcompletioncreateparams",
- "ChatCompletionCreateParamsRequest": ".chatcompletioncreateparams",
- "ChatCompletionCreateParamsRequestTypedDict": ".chatcompletioncreateparams",
- "ChatCompletionCreateParamsResponseFormatGrammar": ".chatcompletioncreateparams",
- "ChatCompletionCreateParamsResponseFormatGrammarTypedDict": ".chatcompletioncreateparams",
- "ChatCompletionCreateParamsResponseFormatJSONObject": ".chatcompletioncreateparams",
- "ChatCompletionCreateParamsResponseFormatJSONObjectTypedDict": ".chatcompletioncreateparams",
- "ChatCompletionCreateParamsResponseFormatJSONSchema": ".chatcompletioncreateparams",
- "ChatCompletionCreateParamsResponseFormatJSONSchemaTypedDict": ".chatcompletioncreateparams",
- "ChatCompletionCreateParamsResponseFormatPython": ".chatcompletioncreateparams",
- "ChatCompletionCreateParamsResponseFormatPythonTypedDict": ".chatcompletioncreateparams",
- "ChatCompletionCreateParamsResponseFormatText": ".chatcompletioncreateparams",
- "ChatCompletionCreateParamsResponseFormatTextTypedDict": ".chatcompletioncreateparams",
- "ChatCompletionCreateParamsResponseFormatUnion": ".chatcompletioncreateparams",
- "ChatCompletionCreateParamsResponseFormatUnionTypedDict": ".chatcompletioncreateparams",
- "ChatCompletionCreateParamsSort": ".chatcompletioncreateparams",
- "ChatCompletionCreateParamsStop": ".chatcompletioncreateparams",
- "ChatCompletionCreateParamsStopTypedDict": ".chatcompletioncreateparams",
- "ChatCompletionCreateParamsStreamOptions": ".chatcompletioncreateparams",
- "ChatCompletionCreateParamsStreamOptionsTypedDict": ".chatcompletioncreateparams",
- "ChatCompletionCreateParamsTypeGrammar": ".chatcompletioncreateparams",
- "ChatCompletionCreateParamsTypeJSONObject": ".chatcompletioncreateparams",
- "ChatCompletionCreateParamsTypeJSONSchema": ".chatcompletioncreateparams",
- "ChatCompletionCreateParamsTypePython": ".chatcompletioncreateparams",
"ChatCompletionCreateParamsTypeText": ".chatcompletioncreateparams",
"ChatCompletionCreateParamsTypedDict": ".chatcompletioncreateparams",
+ "Completion": ".chatcompletioncreateparams",
+ "CompletionTypedDict": ".chatcompletioncreateparams",
+ "DataCollection": ".chatcompletioncreateparams",
+ "Effort": ".chatcompletioncreateparams",
+ "Engine": ".chatcompletioncreateparams",
+ "IDChainOfThought": ".chatcompletioncreateparams",
+ "IDFileParser": ".chatcompletioncreateparams",
+ "IDModeration": ".chatcompletioncreateparams",
+ "IDWeb": ".chatcompletioncreateparams",
+ "Ignore": ".chatcompletioncreateparams",
+ "IgnoreEnum": ".chatcompletioncreateparams",
+ "IgnoreTypedDict": ".chatcompletioncreateparams",
+ "Image": ".chatcompletioncreateparams",
+ "ImageTypedDict": ".chatcompletioncreateparams",
+ "JSONSchema": ".chatcompletioncreateparams",
+ "JSONSchemaTypedDict": ".chatcompletioncreateparams",
+ "MaxPrice": ".chatcompletioncreateparams",
+ "MaxPriceTypedDict": ".chatcompletioncreateparams",
+ "Only": ".chatcompletioncreateparams",
+ "OnlyEnum": ".chatcompletioncreateparams",
+ "OnlyTypedDict": ".chatcompletioncreateparams",
+ "Order": ".chatcompletioncreateparams",
+ "OrderEnum": ".chatcompletioncreateparams",
+ "OrderTypedDict": ".chatcompletioncreateparams",
+ "Pdf": ".chatcompletioncreateparams",
+ "PdfEngine": ".chatcompletioncreateparams",
+ "PdfTypedDict": ".chatcompletioncreateparams",
+ "Plugin": ".chatcompletioncreateparams",
+ "PluginChainOfThought": ".chatcompletioncreateparams",
+ "PluginChainOfThoughtTypedDict": ".chatcompletioncreateparams",
+ "PluginFileParser": ".chatcompletioncreateparams",
+ "PluginFileParserTypedDict": ".chatcompletioncreateparams",
+ "PluginModeration": ".chatcompletioncreateparams",
+ "PluginModerationTypedDict": ".chatcompletioncreateparams",
+ "PluginTypedDict": ".chatcompletioncreateparams",
+ "PluginWeb": ".chatcompletioncreateparams",
+ "PluginWebTypedDict": ".chatcompletioncreateparams",
+ "Prompt": ".chatcompletioncreateparams",
+ "PromptTypedDict": ".chatcompletioncreateparams",
+ "Provider": ".chatcompletioncreateparams",
+ "ProviderTypedDict": ".chatcompletioncreateparams",
+ "Quantization": ".chatcompletioncreateparams",
+ "Reasoning": ".chatcompletioncreateparams",
+ "ReasoningEffort": ".chatcompletioncreateparams",
+ "ReasoningTypedDict": ".chatcompletioncreateparams",
+ "Request": ".chatcompletioncreateparams",
+ "RequestTypedDict": ".chatcompletioncreateparams",
+ "ResponseFormat": ".chatcompletioncreateparams",
+ "ResponseFormatGrammar": ".chatcompletioncreateparams",
+ "ResponseFormatGrammarTypedDict": ".chatcompletioncreateparams",
+ "ResponseFormatJSONObject": ".chatcompletioncreateparams",
+ "ResponseFormatJSONObjectTypedDict": ".chatcompletioncreateparams",
+ "ResponseFormatJSONSchema": ".chatcompletioncreateparams",
+ "ResponseFormatJSONSchemaTypedDict": ".chatcompletioncreateparams",
+ "ResponseFormatPython": ".chatcompletioncreateparams",
+ "ResponseFormatPythonTypedDict": ".chatcompletioncreateparams",
+ "ResponseFormatText": ".chatcompletioncreateparams",
+ "ResponseFormatTextTypedDict": ".chatcompletioncreateparams",
+ "ResponseFormatTypedDict": ".chatcompletioncreateparams",
+ "Sort": ".chatcompletioncreateparams",
+ "Stop": ".chatcompletioncreateparams",
+ "StopTypedDict": ".chatcompletioncreateparams",
+ "StreamOptions": ".chatcompletioncreateparams",
+ "StreamOptionsTypedDict": ".chatcompletioncreateparams",
+ "TypeGrammar": ".chatcompletioncreateparams",
+ "TypeJSONObject": ".chatcompletioncreateparams",
+ "TypeJSONSchema": ".chatcompletioncreateparams",
+ "TypePython": ".chatcompletioncreateparams",
"Error": ".chatcompletionerror",
"ErrorTypedDict": ".chatcompletionerror",
"ChatCompletionMessage": ".chatcompletionmessage",
@@ -810,85 +670,14 @@ _dynamic_imports: dict[str, str] = {
"ChatCompletionUserMessageParamContentTypedDict": ".chatcompletionusermessageparam",
"ChatCompletionUserMessageParamRole": ".chatcompletionusermessageparam",
"ChatCompletionUserMessageParamTypedDict": ".chatcompletionusermessageparam",
- "ChatStreamCompletionCreateParams": ".chatstreamcompletioncreateparams",
- "ChatStreamCompletionCreateParamsAudio": ".chatstreamcompletioncreateparams",
- "ChatStreamCompletionCreateParamsAudioTypedDict": ".chatstreamcompletioncreateparams",
- "ChatStreamCompletionCreateParamsCompletion": ".chatstreamcompletioncreateparams",
- "ChatStreamCompletionCreateParamsCompletionTypedDict": ".chatstreamcompletioncreateparams",
- "ChatStreamCompletionCreateParamsDataCollection": ".chatstreamcompletioncreateparams",
- "ChatStreamCompletionCreateParamsEffort": ".chatstreamcompletioncreateparams",
- "ChatStreamCompletionCreateParamsEngine": ".chatstreamcompletioncreateparams",
- "ChatStreamCompletionCreateParamsIDChainOfThought": ".chatstreamcompletioncreateparams",
- "ChatStreamCompletionCreateParamsIDFileParser": ".chatstreamcompletioncreateparams",
- "ChatStreamCompletionCreateParamsIDModeration": ".chatstreamcompletioncreateparams",
- "ChatStreamCompletionCreateParamsIDWeb": ".chatstreamcompletioncreateparams",
- "ChatStreamCompletionCreateParamsIgnoreEnum": ".chatstreamcompletioncreateparams",
- "ChatStreamCompletionCreateParamsIgnoreUnion": ".chatstreamcompletioncreateparams",
- "ChatStreamCompletionCreateParamsIgnoreUnionTypedDict": ".chatstreamcompletioncreateparams",
- "ChatStreamCompletionCreateParamsImage": ".chatstreamcompletioncreateparams",
- "ChatStreamCompletionCreateParamsImageTypedDict": ".chatstreamcompletioncreateparams",
- "ChatStreamCompletionCreateParamsJSONSchema": ".chatstreamcompletioncreateparams",
- "ChatStreamCompletionCreateParamsJSONSchemaTypedDict": ".chatstreamcompletioncreateparams",
- "ChatStreamCompletionCreateParamsMaxPrice": ".chatstreamcompletioncreateparams",
- "ChatStreamCompletionCreateParamsMaxPriceTypedDict": ".chatstreamcompletioncreateparams",
- "ChatStreamCompletionCreateParamsOnlyEnum": ".chatstreamcompletioncreateparams",
- "ChatStreamCompletionCreateParamsOnlyUnion": ".chatstreamcompletioncreateparams",
- "ChatStreamCompletionCreateParamsOnlyUnionTypedDict": ".chatstreamcompletioncreateparams",
- "ChatStreamCompletionCreateParamsOrderEnum": ".chatstreamcompletioncreateparams",
- "ChatStreamCompletionCreateParamsOrderUnion": ".chatstreamcompletioncreateparams",
- "ChatStreamCompletionCreateParamsOrderUnionTypedDict": ".chatstreamcompletioncreateparams",
- "ChatStreamCompletionCreateParamsPdf": ".chatstreamcompletioncreateparams",
- "ChatStreamCompletionCreateParamsPdfEngine": ".chatstreamcompletioncreateparams",
- "ChatStreamCompletionCreateParamsPdfTypedDict": ".chatstreamcompletioncreateparams",
- "ChatStreamCompletionCreateParamsPluginChainOfThought": ".chatstreamcompletioncreateparams",
- "ChatStreamCompletionCreateParamsPluginChainOfThoughtTypedDict": ".chatstreamcompletioncreateparams",
- "ChatStreamCompletionCreateParamsPluginFileParser": ".chatstreamcompletioncreateparams",
- "ChatStreamCompletionCreateParamsPluginFileParserTypedDict": ".chatstreamcompletioncreateparams",
- "ChatStreamCompletionCreateParamsPluginModeration": ".chatstreamcompletioncreateparams",
- "ChatStreamCompletionCreateParamsPluginModerationTypedDict": ".chatstreamcompletioncreateparams",
- "ChatStreamCompletionCreateParamsPluginUnion": ".chatstreamcompletioncreateparams",
- "ChatStreamCompletionCreateParamsPluginUnionTypedDict": ".chatstreamcompletioncreateparams",
- "ChatStreamCompletionCreateParamsPluginWeb": ".chatstreamcompletioncreateparams",
- "ChatStreamCompletionCreateParamsPluginWebTypedDict": ".chatstreamcompletioncreateparams",
- "ChatStreamCompletionCreateParamsPrompt": ".chatstreamcompletioncreateparams",
- "ChatStreamCompletionCreateParamsPromptTypedDict": ".chatstreamcompletioncreateparams",
- "ChatStreamCompletionCreateParamsProvider": ".chatstreamcompletioncreateparams",
- "ChatStreamCompletionCreateParamsProviderTypedDict": ".chatstreamcompletioncreateparams",
- "ChatStreamCompletionCreateParamsQuantization": ".chatstreamcompletioncreateparams",
- "ChatStreamCompletionCreateParamsReasoning": ".chatstreamcompletioncreateparams",
- "ChatStreamCompletionCreateParamsReasoningEffort": ".chatstreamcompletioncreateparams",
- "ChatStreamCompletionCreateParamsReasoningTypedDict": ".chatstreamcompletioncreateparams",
- "ChatStreamCompletionCreateParamsRequest": ".chatstreamcompletioncreateparams",
- "ChatStreamCompletionCreateParamsRequestTypedDict": ".chatstreamcompletioncreateparams",
- "ChatStreamCompletionCreateParamsResponseFormatGrammar": ".chatstreamcompletioncreateparams",
- "ChatStreamCompletionCreateParamsResponseFormatGrammarTypedDict": ".chatstreamcompletioncreateparams",
- "ChatStreamCompletionCreateParamsResponseFormatJSONObject": ".chatstreamcompletioncreateparams",
- "ChatStreamCompletionCreateParamsResponseFormatJSONObjectTypedDict": ".chatstreamcompletioncreateparams",
- "ChatStreamCompletionCreateParamsResponseFormatJSONSchema": ".chatstreamcompletioncreateparams",
- "ChatStreamCompletionCreateParamsResponseFormatJSONSchemaTypedDict": ".chatstreamcompletioncreateparams",
- "ChatStreamCompletionCreateParamsResponseFormatPython": ".chatstreamcompletioncreateparams",
- "ChatStreamCompletionCreateParamsResponseFormatPythonTypedDict": ".chatstreamcompletioncreateparams",
- "ChatStreamCompletionCreateParamsResponseFormatText": ".chatstreamcompletioncreateparams",
- "ChatStreamCompletionCreateParamsResponseFormatTextTypedDict": ".chatstreamcompletioncreateparams",
- "ChatStreamCompletionCreateParamsResponseFormatUnion": ".chatstreamcompletioncreateparams",
- "ChatStreamCompletionCreateParamsResponseFormatUnionTypedDict": ".chatstreamcompletioncreateparams",
- "ChatStreamCompletionCreateParamsSort": ".chatstreamcompletioncreateparams",
- "ChatStreamCompletionCreateParamsStop": ".chatstreamcompletioncreateparams",
- "ChatStreamCompletionCreateParamsStopTypedDict": ".chatstreamcompletioncreateparams",
- "ChatStreamCompletionCreateParamsStreamOptions": ".chatstreamcompletioncreateparams",
- "ChatStreamCompletionCreateParamsStreamOptionsTypedDict": ".chatstreamcompletioncreateparams",
- "ChatStreamCompletionCreateParamsTypeGrammar": ".chatstreamcompletioncreateparams",
- "ChatStreamCompletionCreateParamsTypeJSONObject": ".chatstreamcompletioncreateparams",
- "ChatStreamCompletionCreateParamsTypeJSONSchema": ".chatstreamcompletioncreateparams",
- "ChatStreamCompletionCreateParamsTypePython": ".chatstreamcompletioncreateparams",
- "ChatStreamCompletionCreateParamsTypeText": ".chatstreamcompletioncreateparams",
- "ChatStreamCompletionCreateParamsTypedDict": ".chatstreamcompletioncreateparams",
"CompletionTokensDetails": ".completionusage",
"CompletionTokensDetailsTypedDict": ".completionusage",
"CompletionUsage": ".completionusage",
"CompletionUsageTypedDict": ".completionusage",
"PromptTokensDetails": ".completionusage",
"PromptTokensDetailsTypedDict": ".completionusage",
+ "CreateChatCompletionResponse": ".createchatcompletionop",
+ "CreateChatCompletionResponseTypedDict": ".createchatcompletionop",
"ContentImageURL": ".fileannotationdetail",
"ContentImageURLTypedDict": ".fileannotationdetail",
"ContentText": ".fileannotationdetail",
@@ -922,8 +711,6 @@ _dynamic_imports: dict[str, str] = {
"ResponseFormatJSONSchemaSchemaTypedDict": ".responseformatjsonschemaschema",
"Security": ".security",
"SecurityTypedDict": ".security",
- "StreamChatCompletionResponseBody": ".streamchatcompletionop",
- "StreamChatCompletionResponseBodyTypedDict": ".streamchatcompletionop",
"URLCitation": ".urlcitationannotationdetail",
"URLCitationAnnotationDetail": ".urlcitationannotationdetail",
"URLCitationAnnotationDetailType": ".urlcitationannotationdetail",
diff --git a/src/openrouter/models/streamchatcompletionop.py b/src/openrouter/models/chatcompletionchunkwrapper.py
similarity index 67%
rename from src/openrouter/models/streamchatcompletionop.py
rename to src/openrouter/models/chatcompletionchunkwrapper.py
index 289f952..129ad9e 100644
--- a/src/openrouter/models/streamchatcompletionop.py
+++ b/src/openrouter/models/chatcompletionchunkwrapper.py
@@ -6,15 +6,11 @@ from openrouter.types import BaseModel
from typing_extensions import TypedDict
-class StreamChatCompletionResponseBodyTypedDict(TypedDict):
- r"""Successful chat completion response"""
-
+class ChatCompletionChunkWrapperTypedDict(TypedDict):
data: ChatCompletionChunkTypedDict
r"""Streaming chat completion chunk"""
-class StreamChatCompletionResponseBody(BaseModel):
- r"""Successful chat completion response"""
-
+class ChatCompletionChunkWrapper(BaseModel):
data: ChatCompletionChunk
r"""Streaming chat completion chunk"""
diff --git a/src/openrouter/models/chatcompletioncreateparams.py b/src/openrouter/models/chatcompletioncreateparams.py
index 75d108c..dd1d79d 100644
--- a/src/openrouter/models/chatcompletioncreateparams.py
+++ b/src/openrouter/models/chatcompletioncreateparams.py
@@ -27,29 +27,29 @@ from typing import Any, Dict, List, Literal, Optional, Union
from typing_extensions import Annotated, NotRequired, TypeAliasType, TypedDict
-ChatCompletionCreateParamsEffort = Literal["high", "medium", "low", "minimal"]
+Effort = Literal["high", "medium", "low", "minimal"]
r"""OpenAI-style reasoning effort setting"""
-class ChatCompletionCreateParamsReasoningTypedDict(TypedDict):
+class ReasoningTypedDict(TypedDict):
r"""Reasoning configuration"""
enabled: NotRequired[bool]
r"""Enables reasoning with default settings. Only work for some models."""
- effort: NotRequired[Nullable[ChatCompletionCreateParamsEffort]]
+ effort: NotRequired[Nullable[Effort]]
r"""OpenAI-style reasoning effort setting"""
max_tokens: NotRequired[Nullable[float]]
r"""non-OpenAI-style reasoning effort setting"""
exclude: NotRequired[bool]
-class ChatCompletionCreateParamsReasoning(BaseModel):
+class Reasoning(BaseModel):
r"""Reasoning configuration"""
enabled: Optional[bool] = None
r"""Enables reasoning with default settings. Only work for some models."""
- effort: OptionalNullable[ChatCompletionCreateParamsEffort] = UNSET
+ effort: OptionalNullable[Effort] = UNSET
r"""OpenAI-style reasoning effort setting"""
max_tokens: OptionalNullable[float] = UNSET
@@ -88,45 +88,45 @@ class ChatCompletionCreateParamsReasoning(BaseModel):
return m
-ChatCompletionCreateParamsTypePython = Literal["python"]
+TypePython = Literal["python"]
-class ChatCompletionCreateParamsResponseFormatPythonTypedDict(TypedDict):
+class ResponseFormatPythonTypedDict(TypedDict):
r"""Python code response format"""
- type: ChatCompletionCreateParamsTypePython
+ type: TypePython
-class ChatCompletionCreateParamsResponseFormatPython(BaseModel):
+class ResponseFormatPython(BaseModel):
r"""Python code response format"""
- type: ChatCompletionCreateParamsTypePython
+ type: TypePython
-ChatCompletionCreateParamsTypeGrammar = Literal["grammar"]
+TypeGrammar = Literal["grammar"]
-class ChatCompletionCreateParamsResponseFormatGrammarTypedDict(TypedDict):
+class ResponseFormatGrammarTypedDict(TypedDict):
r"""Custom grammar response format"""
- type: ChatCompletionCreateParamsTypeGrammar
+ type: TypeGrammar
grammar: str
r"""Custom grammar for text generation"""
-class ChatCompletionCreateParamsResponseFormatGrammar(BaseModel):
+class ResponseFormatGrammar(BaseModel):
r"""Custom grammar response format"""
- type: ChatCompletionCreateParamsTypeGrammar
+ type: TypeGrammar
grammar: str
r"""Custom grammar for text generation"""
-ChatCompletionCreateParamsTypeJSONSchema = Literal["json_schema"]
+TypeJSONSchema = Literal["json_schema"]
-class ChatCompletionCreateParamsJSONSchemaTypedDict(TypedDict):
+class JSONSchemaTypedDict(TypedDict):
name: str
r"""Schema name (a-z, A-Z, 0-9, underscores, dashes, max 64 chars)"""
description: NotRequired[str]
@@ -137,7 +137,7 @@ class ChatCompletionCreateParamsJSONSchemaTypedDict(TypedDict):
r"""Enable strict schema adherence"""
-class ChatCompletionCreateParamsJSONSchema(BaseModel):
+class JSONSchema(BaseModel):
name: str
r"""Schema name (a-z, A-Z, 0-9, underscores, dashes, max 64 chars)"""
@@ -183,114 +183,110 @@ class ChatCompletionCreateParamsJSONSchema(BaseModel):
return m
-class ChatCompletionCreateParamsResponseFormatJSONSchemaTypedDict(TypedDict):
+class ResponseFormatJSONSchemaTypedDict(TypedDict):
r"""JSON Schema response format for structured outputs"""
- type: ChatCompletionCreateParamsTypeJSONSchema
- json_schema: ChatCompletionCreateParamsJSONSchemaTypedDict
+ type: TypeJSONSchema
+ json_schema: JSONSchemaTypedDict
-class ChatCompletionCreateParamsResponseFormatJSONSchema(BaseModel):
+class ResponseFormatJSONSchema(BaseModel):
r"""JSON Schema response format for structured outputs"""
- type: ChatCompletionCreateParamsTypeJSONSchema
+ type: TypeJSONSchema
- json_schema: ChatCompletionCreateParamsJSONSchema
+ json_schema: JSONSchema
-ChatCompletionCreateParamsTypeJSONObject = Literal["json_object"]
+TypeJSONObject = Literal["json_object"]
-class ChatCompletionCreateParamsResponseFormatJSONObjectTypedDict(TypedDict):
+class ResponseFormatJSONObjectTypedDict(TypedDict):
r"""JSON object response format"""
- type: ChatCompletionCreateParamsTypeJSONObject
+ type: TypeJSONObject
-class ChatCompletionCreateParamsResponseFormatJSONObject(BaseModel):
+class ResponseFormatJSONObject(BaseModel):
r"""JSON object response format"""
- type: ChatCompletionCreateParamsTypeJSONObject
+ type: TypeJSONObject
ChatCompletionCreateParamsTypeText = Literal["text"]
-class ChatCompletionCreateParamsResponseFormatTextTypedDict(TypedDict):
+class ResponseFormatTextTypedDict(TypedDict):
r"""Default text response format"""
type: ChatCompletionCreateParamsTypeText
-class ChatCompletionCreateParamsResponseFormatText(BaseModel):
+class ResponseFormatText(BaseModel):
r"""Default text response format"""
type: ChatCompletionCreateParamsTypeText
-ChatCompletionCreateParamsResponseFormatUnionTypedDict = TypeAliasType(
- "ChatCompletionCreateParamsResponseFormatUnionTypedDict",
+ResponseFormatTypedDict = TypeAliasType(
+ "ResponseFormatTypedDict",
Union[
- ChatCompletionCreateParamsResponseFormatTextTypedDict,
- ChatCompletionCreateParamsResponseFormatJSONObjectTypedDict,
- ChatCompletionCreateParamsResponseFormatPythonTypedDict,
- ChatCompletionCreateParamsResponseFormatJSONSchemaTypedDict,
- ChatCompletionCreateParamsResponseFormatGrammarTypedDict,
+ ResponseFormatTextTypedDict,
+ ResponseFormatJSONObjectTypedDict,
+ ResponseFormatPythonTypedDict,
+ ResponseFormatJSONSchemaTypedDict,
+ ResponseFormatGrammarTypedDict,
],
)
r"""Response format configuration"""
-ChatCompletionCreateParamsResponseFormatUnion = TypeAliasType(
- "ChatCompletionCreateParamsResponseFormatUnion",
+ResponseFormat = TypeAliasType(
+ "ResponseFormat",
Union[
- ChatCompletionCreateParamsResponseFormatText,
- ChatCompletionCreateParamsResponseFormatJSONObject,
- ChatCompletionCreateParamsResponseFormatPython,
- ChatCompletionCreateParamsResponseFormatJSONSchema,
- ChatCompletionCreateParamsResponseFormatGrammar,
+ ResponseFormatText,
+ ResponseFormatJSONObject,
+ ResponseFormatPython,
+ ResponseFormatJSONSchema,
+ ResponseFormatGrammar,
],
)
r"""Response format configuration"""
-ChatCompletionCreateParamsStopTypedDict = TypeAliasType(
- "ChatCompletionCreateParamsStopTypedDict", Union[str, List[str], Any]
-)
+StopTypedDict = TypeAliasType("StopTypedDict", Union[str, List[str], Any])
r"""Stop sequences (up to 4)"""
-ChatCompletionCreateParamsStop = TypeAliasType(
- "ChatCompletionCreateParamsStop", Union[str, List[str], Any]
-)
+Stop = TypeAliasType("Stop", Union[str, List[str], Any])
r"""Stop sequences (up to 4)"""
-class ChatCompletionCreateParamsStreamOptionsTypedDict(TypedDict):
+class StreamOptionsTypedDict(TypedDict):
r"""Streaming configuration options"""
include_usage: NotRequired[bool]
r"""Include usage information in streaming response"""
-class ChatCompletionCreateParamsStreamOptions(BaseModel):
+class StreamOptions(BaseModel):
r"""Streaming configuration options"""
include_usage: Optional[bool] = None
r"""Include usage information in streaming response"""
-ChatCompletionCreateParamsReasoningEffort = Literal["high", "medium", "low", "minimal"]
+ReasoningEffort = Literal["high", "medium", "low", "minimal"]
r"""Reasoning effort"""
-ChatCompletionCreateParamsDataCollection = Literal["deny", "allow"]
+DataCollection = Literal["deny", "allow"]
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.
"""
-ChatCompletionCreateParamsOrderEnum = Literal[
+OrderEnum = Literal[
"AnyScale",
"Cent-ML",
"HuggingFace",
@@ -371,19 +367,13 @@ ChatCompletionCreateParamsOrderEnum = Literal[
"Z.AI",
]
-ChatCompletionCreateParamsOrderUnionTypedDict = TypeAliasType(
- "ChatCompletionCreateParamsOrderUnionTypedDict",
- Union[ChatCompletionCreateParamsOrderEnum, str],
-)
+OrderTypedDict = TypeAliasType("OrderTypedDict", Union[OrderEnum, str])
-ChatCompletionCreateParamsOrderUnion = TypeAliasType(
- "ChatCompletionCreateParamsOrderUnion",
- Union[ChatCompletionCreateParamsOrderEnum, str],
-)
+Order = TypeAliasType("Order", Union[OrderEnum, str])
-ChatCompletionCreateParamsOnlyEnum = Literal[
+OnlyEnum = Literal[
"AnyScale",
"Cent-ML",
"HuggingFace",
@@ -464,19 +454,13 @@ ChatCompletionCreateParamsOnlyEnum = Literal[
"Z.AI",
]
-ChatCompletionCreateParamsOnlyUnionTypedDict = TypeAliasType(
- "ChatCompletionCreateParamsOnlyUnionTypedDict",
- Union[ChatCompletionCreateParamsOnlyEnum, str],
-)
+OnlyTypedDict = TypeAliasType("OnlyTypedDict", Union[OnlyEnum, str])
-ChatCompletionCreateParamsOnlyUnion = TypeAliasType(
- "ChatCompletionCreateParamsOnlyUnion",
- Union[ChatCompletionCreateParamsOnlyEnum, str],
-)
+Only = TypeAliasType("Only", Union[OnlyEnum, str])
-ChatCompletionCreateParamsIgnoreEnum = Literal[
+IgnoreEnum = Literal[
"AnyScale",
"Cent-ML",
"HuggingFace",
@@ -557,100 +541,74 @@ ChatCompletionCreateParamsIgnoreEnum = Literal[
"Z.AI",
]
-ChatCompletionCreateParamsIgnoreUnionTypedDict = TypeAliasType(
- "ChatCompletionCreateParamsIgnoreUnionTypedDict",
- Union[ChatCompletionCreateParamsIgnoreEnum, str],
-)
+IgnoreTypedDict = TypeAliasType("IgnoreTypedDict", Union[IgnoreEnum, str])
-ChatCompletionCreateParamsIgnoreUnion = TypeAliasType(
- "ChatCompletionCreateParamsIgnoreUnion",
- Union[ChatCompletionCreateParamsIgnoreEnum, str],
-)
+Ignore = TypeAliasType("Ignore", Union[IgnoreEnum, str])
-ChatCompletionCreateParamsQuantization = Literal[
+Quantization = Literal[
"int4", "int8", "fp4", "fp6", "fp8", "fp16", "bf16", "fp32", "unknown"
]
-ChatCompletionCreateParamsSort = Literal["price", "throughput", "latency"]
+Sort = Literal["price", "throughput", "latency"]
r"""The sorting strategy to use for this request, if \"order\" is not specified. When set, no load balancing is performed."""
-ChatCompletionCreateParamsPromptTypedDict = TypeAliasType(
- "ChatCompletionCreateParamsPromptTypedDict", Union[float, str, Any]
-)
+PromptTypedDict = TypeAliasType("PromptTypedDict", Union[float, str, Any])
-ChatCompletionCreateParamsPrompt = TypeAliasType(
- "ChatCompletionCreateParamsPrompt", Union[float, str, Any]
-)
+Prompt = TypeAliasType("Prompt", Union[float, str, Any])
-ChatCompletionCreateParamsCompletionTypedDict = TypeAliasType(
- "ChatCompletionCreateParamsCompletionTypedDict", Union[float, str, Any]
-)
+CompletionTypedDict = TypeAliasType("CompletionTypedDict", Union[float, str, Any])
-ChatCompletionCreateParamsCompletion = TypeAliasType(
- "ChatCompletionCreateParamsCompletion", Union[float, str, Any]
-)
+Completion = TypeAliasType("Completion", Union[float, str, Any])
-ChatCompletionCreateParamsImageTypedDict = TypeAliasType(
- "ChatCompletionCreateParamsImageTypedDict", Union[float, str, Any]
-)
+ImageTypedDict = TypeAliasType("ImageTypedDict", Union[float, str, Any])
-ChatCompletionCreateParamsImage = TypeAliasType(
- "ChatCompletionCreateParamsImage", Union[float, str, Any]
-)
+Image = TypeAliasType("Image", Union[float, str, Any])
-ChatCompletionCreateParamsAudioTypedDict = TypeAliasType(
- "ChatCompletionCreateParamsAudioTypedDict", Union[float, str, Any]
-)
+AudioTypedDict = TypeAliasType("AudioTypedDict", Union[float, str, Any])
-ChatCompletionCreateParamsAudio = TypeAliasType(
- "ChatCompletionCreateParamsAudio", Union[float, str, Any]
-)
+Audio = TypeAliasType("Audio", Union[float, str, Any])
-ChatCompletionCreateParamsRequestTypedDict = TypeAliasType(
- "ChatCompletionCreateParamsRequestTypedDict", Union[float, str, Any]
-)
+RequestTypedDict = TypeAliasType("RequestTypedDict", Union[float, str, Any])
-ChatCompletionCreateParamsRequest = TypeAliasType(
- "ChatCompletionCreateParamsRequest", Union[float, str, Any]
-)
+Request = TypeAliasType("Request", Union[float, str, Any])
-class ChatCompletionCreateParamsMaxPriceTypedDict(TypedDict):
+class MaxPriceTypedDict(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[ChatCompletionCreateParamsPromptTypedDict]
- completion: NotRequired[ChatCompletionCreateParamsCompletionTypedDict]
- image: NotRequired[ChatCompletionCreateParamsImageTypedDict]
- audio: NotRequired[ChatCompletionCreateParamsAudioTypedDict]
- request: NotRequired[ChatCompletionCreateParamsRequestTypedDict]
+ prompt: NotRequired[PromptTypedDict]
+ completion: NotRequired[CompletionTypedDict]
+ image: NotRequired[ImageTypedDict]
+ audio: NotRequired[AudioTypedDict]
+ request: NotRequired[RequestTypedDict]
-class ChatCompletionCreateParamsMaxPrice(BaseModel):
+class MaxPrice(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[ChatCompletionCreateParamsPrompt] = None
+ prompt: Optional[Prompt] = None
- completion: Optional[ChatCompletionCreateParamsCompletion] = None
+ completion: Optional[Completion] = None
- image: Optional[ChatCompletionCreateParamsImage] = None
+ image: Optional[Image] = None
- audio: Optional[ChatCompletionCreateParamsAudio] = None
+ audio: Optional[Audio] = None
- request: Optional[ChatCompletionCreateParamsRequest] = None
+ request: Optional[Request] = None
-class ChatCompletionCreateParamsProviderTypedDict(TypedDict):
+class ProviderTypedDict(TypedDict):
r"""When multiple model providers are available, optionally indicate your routing preference."""
allow_fallbacks: NotRequired[Nullable[bool]]
@@ -661,27 +619,27 @@ class ChatCompletionCreateParamsProviderTypedDict(TypedDict):
"""
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[ChatCompletionCreateParamsDataCollection]]
+ data_collection: NotRequired[Nullable[DataCollection]]
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.
"""
- order: NotRequired[Nullable[List[ChatCompletionCreateParamsOrderUnionTypedDict]]]
+ order: NotRequired[Nullable[List[OrderTypedDict]]]
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[ChatCompletionCreateParamsOnlyUnionTypedDict]]]
+ only: NotRequired[Nullable[List[OnlyTypedDict]]]
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[ChatCompletionCreateParamsIgnoreUnionTypedDict]]]
+ ignore: NotRequired[Nullable[List[IgnoreTypedDict]]]
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[ChatCompletionCreateParamsQuantization]]]
+ quantizations: NotRequired[Nullable[List[Quantization]]]
r"""A list of quantization levels to filter the provider by."""
- sort: NotRequired[Nullable[ChatCompletionCreateParamsSort]]
+ sort: NotRequired[Nullable[Sort]]
r"""The sorting strategy to use for this request, if \"order\" is not specified. When set, no load balancing is performed."""
- max_price: NotRequired[ChatCompletionCreateParamsMaxPriceTypedDict]
+ max_price: NotRequired[MaxPriceTypedDict]
r"""The object specifying the maximum price you want to pay for this request. USD price per million tokens, for prompt and completion."""
-class ChatCompletionCreateParamsProvider(BaseModel):
+class Provider(BaseModel):
r"""When multiple model providers are available, optionally indicate your routing preference."""
allow_fallbacks: OptionalNullable[bool] = UNSET
@@ -694,31 +652,29 @@ class ChatCompletionCreateParamsProvider(BaseModel):
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: OptionalNullable[ChatCompletionCreateParamsDataCollection] = UNSET
+ data_collection: OptionalNullable[DataCollection] = 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.
"""
- order: OptionalNullable[List[ChatCompletionCreateParamsOrderUnion]] = UNSET
+ order: OptionalNullable[List[Order]] = UNSET
r"""An ordered list of provider slugs. The router will attempt to use the first provider in the subset of this list that supports your requested model, and fall back to the next if it is unavailable. If no providers are available, the request will fail with an error message."""
- only: OptionalNullable[List[ChatCompletionCreateParamsOnlyUnion]] = UNSET
+ only: OptionalNullable[List[Only]] = UNSET
r"""List of provider slugs to allow. If provided, this list is merged with your account-wide allowed provider settings for this request."""
- ignore: OptionalNullable[List[ChatCompletionCreateParamsIgnoreUnion]] = UNSET
+ ignore: OptionalNullable[List[Ignore]] = UNSET
r"""List of provider slugs to ignore. If provided, this list is merged with your account-wide ignored provider settings for this request."""
- quantizations: OptionalNullable[List[ChatCompletionCreateParamsQuantization]] = (
- UNSET
- )
+ quantizations: OptionalNullable[List[Quantization]] = UNSET
r"""A list of quantization levels to filter the provider by."""
- sort: OptionalNullable[ChatCompletionCreateParamsSort] = UNSET
+ sort: OptionalNullable[Sort] = 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[ChatCompletionCreateParamsMaxPrice] = None
+ max_price: Optional[MaxPrice] = None
r"""The object specifying the maximum price you want to pay for this request. USD price per million tokens, for prompt and completion."""
@model_serializer(mode="wrap")
@@ -771,96 +727,90 @@ class ChatCompletionCreateParamsProvider(BaseModel):
return m
-ChatCompletionCreateParamsIDFileParser = Literal["file-parser"]
+IDFileParser = Literal["file-parser"]
-ChatCompletionCreateParamsPdfEngine = Literal["mistral-ocr", "pdf-text", "native"]
+PdfEngine = Literal["mistral-ocr", "pdf-text", "native"]
-class ChatCompletionCreateParamsPdfTypedDict(TypedDict):
- engine: NotRequired[ChatCompletionCreateParamsPdfEngine]
+class PdfTypedDict(TypedDict):
+ engine: NotRequired[PdfEngine]
-class ChatCompletionCreateParamsPdf(BaseModel):
- engine: Optional[ChatCompletionCreateParamsPdfEngine] = None
+class Pdf(BaseModel):
+ engine: Optional[PdfEngine] = None
-class ChatCompletionCreateParamsPluginFileParserTypedDict(TypedDict):
- id: ChatCompletionCreateParamsIDFileParser
+class PluginFileParserTypedDict(TypedDict):
+ id: IDFileParser
max_files: NotRequired[float]
- pdf: NotRequired[ChatCompletionCreateParamsPdfTypedDict]
+ pdf: NotRequired[PdfTypedDict]
-class ChatCompletionCreateParamsPluginFileParser(BaseModel):
- id: ChatCompletionCreateParamsIDFileParser
+class PluginFileParser(BaseModel):
+ id: IDFileParser
max_files: Optional[float] = None
- pdf: Optional[ChatCompletionCreateParamsPdf] = None
+ pdf: Optional[Pdf] = None
-ChatCompletionCreateParamsIDChainOfThought = Literal["chain-of-thought"]
+IDChainOfThought = Literal["chain-of-thought"]
-class ChatCompletionCreateParamsPluginChainOfThoughtTypedDict(TypedDict):
- id: ChatCompletionCreateParamsIDChainOfThought
+class PluginChainOfThoughtTypedDict(TypedDict):
+ id: IDChainOfThought
-class ChatCompletionCreateParamsPluginChainOfThought(BaseModel):
- id: ChatCompletionCreateParamsIDChainOfThought
+class PluginChainOfThought(BaseModel):
+ id: IDChainOfThought
-ChatCompletionCreateParamsIDWeb = Literal["web"]
+IDWeb = Literal["web"]
-ChatCompletionCreateParamsEngine = Literal["native", "exa"]
+Engine = Literal["native", "exa"]
-class ChatCompletionCreateParamsPluginWebTypedDict(TypedDict):
- id: ChatCompletionCreateParamsIDWeb
+class PluginWebTypedDict(TypedDict):
+ id: IDWeb
max_results: NotRequired[float]
search_prompt: NotRequired[str]
- engine: NotRequired[ChatCompletionCreateParamsEngine]
+ engine: NotRequired[Engine]
-class ChatCompletionCreateParamsPluginWeb(BaseModel):
- id: ChatCompletionCreateParamsIDWeb
+class PluginWeb(BaseModel):
+ id: IDWeb
max_results: Optional[float] = None
search_prompt: Optional[str] = None
- engine: Optional[ChatCompletionCreateParamsEngine] = None
+ engine: Optional[Engine] = None
-ChatCompletionCreateParamsIDModeration = Literal["moderation"]
+IDModeration = Literal["moderation"]
-class ChatCompletionCreateParamsPluginModerationTypedDict(TypedDict):
- id: ChatCompletionCreateParamsIDModeration
+class PluginModerationTypedDict(TypedDict):
+ id: IDModeration
-class ChatCompletionCreateParamsPluginModeration(BaseModel):
- id: ChatCompletionCreateParamsIDModeration
+class PluginModeration(BaseModel):
+ id: IDModeration
-ChatCompletionCreateParamsPluginUnionTypedDict = TypeAliasType(
- "ChatCompletionCreateParamsPluginUnionTypedDict",
+PluginTypedDict = TypeAliasType(
+ "PluginTypedDict",
Union[
- ChatCompletionCreateParamsPluginModerationTypedDict,
- ChatCompletionCreateParamsPluginChainOfThoughtTypedDict,
- ChatCompletionCreateParamsPluginFileParserTypedDict,
- ChatCompletionCreateParamsPluginWebTypedDict,
+ PluginModerationTypedDict,
+ PluginChainOfThoughtTypedDict,
+ PluginFileParserTypedDict,
+ PluginWebTypedDict,
],
)
-ChatCompletionCreateParamsPluginUnion = TypeAliasType(
- "ChatCompletionCreateParamsPluginUnion",
- Union[
- ChatCompletionCreateParamsPluginModeration,
- ChatCompletionCreateParamsPluginChainOfThought,
- ChatCompletionCreateParamsPluginFileParser,
- ChatCompletionCreateParamsPluginWeb,
- ],
+Plugin = TypeAliasType(
+ "Plugin", Union[PluginModeration, PluginChainOfThought, PluginFileParser, PluginWeb]
)
@@ -887,19 +837,17 @@ class ChatCompletionCreateParamsTypedDict(TypedDict):
r"""Key-value pairs for additional object information (max 16 pairs, 64 char keys, 512 char values)"""
presence_penalty: NotRequired[Nullable[float]]
r"""Presence penalty (-2.0 to 2.0)"""
- reasoning: NotRequired[Nullable[ChatCompletionCreateParamsReasoningTypedDict]]
+ reasoning: NotRequired[Nullable[ReasoningTypedDict]]
r"""Reasoning configuration"""
- response_format: NotRequired[ChatCompletionCreateParamsResponseFormatUnionTypedDict]
+ response_format: NotRequired[ResponseFormatTypedDict]
r"""Response format configuration"""
seed: NotRequired[Nullable[int]]
r"""Random seed for deterministic outputs"""
- stop: NotRequired[Nullable[ChatCompletionCreateParamsStopTypedDict]]
+ stop: NotRequired[Nullable[StopTypedDict]]
r"""Stop sequences (up to 4)"""
stream: NotRequired[Nullable[bool]]
r"""Enable streaming response"""
- stream_options: NotRequired[
- Nullable[ChatCompletionCreateParamsStreamOptionsTypedDict]
- ]
+ stream_options: NotRequired[Nullable[StreamOptionsTypedDict]]
temperature: NotRequired[Nullable[float]]
r"""Sampling temperature (0-2)"""
tool_choice: NotRequired[ChatCompletionToolChoiceOptionTypedDict]
@@ -912,11 +860,11 @@ class ChatCompletionCreateParamsTypedDict(TypedDict):
r"""Unique user identifier"""
fallback_models: NotRequired[Nullable[List[str]]]
r"""Order of models to fallback to for this request"""
- reasoning_effort: NotRequired[Nullable[ChatCompletionCreateParamsReasoningEffort]]
+ reasoning_effort: NotRequired[Nullable[ReasoningEffort]]
r"""Reasoning effort"""
- provider: NotRequired[Nullable[ChatCompletionCreateParamsProviderTypedDict]]
+ provider: NotRequired[Nullable[ProviderTypedDict]]
r"""When multiple model providers are available, optionally indicate your routing preference."""
- plugins: NotRequired[List[ChatCompletionCreateParamsPluginUnionTypedDict]]
+ plugins: NotRequired[List[PluginTypedDict]]
r"""Plugins you want to enable for this request, including their settings."""
@@ -953,22 +901,22 @@ class ChatCompletionCreateParams(BaseModel):
presence_penalty: OptionalNullable[float] = UNSET
r"""Presence penalty (-2.0 to 2.0)"""
- reasoning: OptionalNullable[ChatCompletionCreateParamsReasoning] = UNSET
+ reasoning: OptionalNullable[Reasoning] = UNSET
r"""Reasoning configuration"""
- response_format: Optional[ChatCompletionCreateParamsResponseFormatUnion] = None
+ response_format: Optional[ResponseFormat] = None
r"""Response format configuration"""
seed: OptionalNullable[int] = UNSET
r"""Random seed for deterministic outputs"""
- stop: OptionalNullable[ChatCompletionCreateParamsStop] = UNSET
+ stop: OptionalNullable[Stop] = UNSET
r"""Stop sequences (up to 4)"""
stream: OptionalNullable[bool] = False
r"""Enable streaming response"""
- stream_options: OptionalNullable[ChatCompletionCreateParamsStreamOptions] = UNSET
+ stream_options: OptionalNullable[StreamOptions] = UNSET
temperature: OptionalNullable[float] = 1
r"""Sampling temperature (0-2)"""
@@ -990,15 +938,13 @@ class ChatCompletionCreateParams(BaseModel):
] = UNSET
r"""Order of models to fallback to for this request"""
- reasoning_effort: OptionalNullable[ChatCompletionCreateParamsReasoningEffort] = (
- UNSET
- )
+ reasoning_effort: OptionalNullable[ReasoningEffort] = UNSET
r"""Reasoning effort"""
- provider: OptionalNullable[ChatCompletionCreateParamsProvider] = UNSET
+ provider: OptionalNullable[Provider] = UNSET
r"""When multiple model providers are available, optionally indicate your routing preference."""
- plugins: Optional[List[ChatCompletionCreateParamsPluginUnion]] = None
+ plugins: Optional[List[Plugin]] = None
r"""Plugins you want to enable for this request, including their settings."""
@model_serializer(mode="wrap")
diff --git a/src/openrouter/models/chatstreamcompletioncreateparams.py b/src/openrouter/models/chatstreamcompletioncreateparams.py
deleted file mode 100644
index aa19b5e..0000000
--- a/src/openrouter/models/chatstreamcompletioncreateparams.py
+++ /dev/null
@@ -1,1096 +0,0 @@
-"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
-
-from __future__ import annotations
-from .chatcompletionmessageparam import (
- ChatCompletionMessageParam,
- ChatCompletionMessageParamTypedDict,
-)
-from .chatcompletiontool import ChatCompletionTool, ChatCompletionToolTypedDict
-from .chatcompletiontoolchoiceoption import (
- ChatCompletionToolChoiceOption,
- ChatCompletionToolChoiceOptionTypedDict,
-)
-from .responseformatjsonschemaschema import (
- ResponseFormatJSONSchemaSchema,
- ResponseFormatJSONSchemaSchemaTypedDict,
-)
-from openrouter.types import (
- BaseModel,
- Nullable,
- OptionalNullable,
- UNSET,
- UNSET_SENTINEL,
-)
-import pydantic
-from pydantic import model_serializer
-from typing import Any, Dict, List, Literal, Optional, Union
-from typing_extensions import Annotated, NotRequired, TypeAliasType, TypedDict
-
-
-ChatStreamCompletionCreateParamsEffort = Literal["high", "medium", "low", "minimal"]
-r"""OpenAI-style reasoning effort setting"""
-
-
-class ChatStreamCompletionCreateParamsReasoningTypedDict(TypedDict):
- r"""Reasoning configuration"""
-
- enabled: NotRequired[bool]
- r"""Enables reasoning with default settings. Only work for some models."""
- effort: NotRequired[Nullable[ChatStreamCompletionCreateParamsEffort]]
- r"""OpenAI-style reasoning effort setting"""
- max_tokens: NotRequired[Nullable[float]]
- r"""non-OpenAI-style reasoning effort setting"""
- exclude: NotRequired[bool]
-
-
-class ChatStreamCompletionCreateParamsReasoning(BaseModel):
- r"""Reasoning configuration"""
-
- enabled: Optional[bool] = None
- r"""Enables reasoning with default settings. Only work for some models."""
-
- effort: OptionalNullable[ChatStreamCompletionCreateParamsEffort] = UNSET
- r"""OpenAI-style reasoning effort setting"""
-
- max_tokens: OptionalNullable[float] = UNSET
- r"""non-OpenAI-style reasoning effort setting"""
-
- exclude: Optional[bool] = False
-
- @model_serializer(mode="wrap")
- def serialize_model(self, handler):
- optional_fields = ["enabled", "effort", "max_tokens", "exclude"]
- nullable_fields = ["effort", "max_tokens"]
- 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
-
-
-ChatStreamCompletionCreateParamsTypePython = Literal["python"]
-
-
-class ChatStreamCompletionCreateParamsResponseFormatPythonTypedDict(TypedDict):
- r"""Python code response format"""
-
- type: ChatStreamCompletionCreateParamsTypePython
-
-
-class ChatStreamCompletionCreateParamsResponseFormatPython(BaseModel):
- r"""Python code response format"""
-
- type: ChatStreamCompletionCreateParamsTypePython
-
-
-ChatStreamCompletionCreateParamsTypeGrammar = Literal["grammar"]
-
-
-class ChatStreamCompletionCreateParamsResponseFormatGrammarTypedDict(TypedDict):
- r"""Custom grammar response format"""
-
- type: ChatStreamCompletionCreateParamsTypeGrammar
- grammar: str
- r"""Custom grammar for text generation"""
-
-
-class ChatStreamCompletionCreateParamsResponseFormatGrammar(BaseModel):
- r"""Custom grammar response format"""
-
- type: ChatStreamCompletionCreateParamsTypeGrammar
-
- grammar: str
- r"""Custom grammar for text generation"""
-
-
-ChatStreamCompletionCreateParamsTypeJSONSchema = Literal["json_schema"]
-
-
-class ChatStreamCompletionCreateParamsJSONSchemaTypedDict(TypedDict):
- name: str
- r"""Schema name (a-z, A-Z, 0-9, underscores, dashes, max 64 chars)"""
- description: NotRequired[str]
- r"""Schema description for the model"""
- schema_: NotRequired[ResponseFormatJSONSchemaSchemaTypedDict]
- r"""The schema for the response format, described as a JSON Schema object"""
- strict: NotRequired[Nullable[bool]]
- r"""Enable strict schema adherence"""
-
-
-class ChatStreamCompletionCreateParamsJSONSchema(BaseModel):
- name: str
- r"""Schema name (a-z, A-Z, 0-9, underscores, dashes, max 64 chars)"""
-
- description: Optional[str] = None
- r"""Schema description for the model"""
-
- schema_: Annotated[
- Optional[ResponseFormatJSONSchemaSchema], pydantic.Field(alias="schema")
- ] = None
- r"""The schema for the response format, described as a JSON Schema object"""
-
- strict: OptionalNullable[bool] = UNSET
- r"""Enable strict schema adherence"""
-
- @model_serializer(mode="wrap")
- def serialize_model(self, handler):
- optional_fields = ["description", "schema", "strict"]
- nullable_fields = ["strict"]
- null_default_fields = []
-
- serialized = handler(self)
-
- m = {}
-
- for n, f in type(self).model_fields.items():
- k = f.alias or n
- val = serialized.get(k)
- serialized.pop(k, None)
-
- optional_nullable = k in optional_fields and k in nullable_fields
- is_set = (
- self.__pydantic_fields_set__.intersection({n})
- or k in null_default_fields
- ) # pylint: disable=no-member
-
- if val is not None and val != UNSET_SENTINEL:
- m[k] = val
- elif val != UNSET_SENTINEL and (
- not k in optional_fields or (optional_nullable and is_set)
- ):
- m[k] = val
-
- return m
-
-
-class ChatStreamCompletionCreateParamsResponseFormatJSONSchemaTypedDict(TypedDict):
- r"""JSON Schema response format for structured outputs"""
-
- type: ChatStreamCompletionCreateParamsTypeJSONSchema
- json_schema: ChatStreamCompletionCreateParamsJSONSchemaTypedDict
-
-
-class ChatStreamCompletionCreateParamsResponseFormatJSONSchema(BaseModel):
- r"""JSON Schema response format for structured outputs"""
-
- type: ChatStreamCompletionCreateParamsTypeJSONSchema
-
- json_schema: ChatStreamCompletionCreateParamsJSONSchema
-
-
-ChatStreamCompletionCreateParamsTypeJSONObject = Literal["json_object"]
-
-
-class ChatStreamCompletionCreateParamsResponseFormatJSONObjectTypedDict(TypedDict):
- r"""JSON object response format"""
-
- type: ChatStreamCompletionCreateParamsTypeJSONObject
-
-
-class ChatStreamCompletionCreateParamsResponseFormatJSONObject(BaseModel):
- r"""JSON object response format"""
-
- type: ChatStreamCompletionCreateParamsTypeJSONObject
-
-
-ChatStreamCompletionCreateParamsTypeText = Literal["text"]
-
-
-class ChatStreamCompletionCreateParamsResponseFormatTextTypedDict(TypedDict):
- r"""Default text response format"""
-
- type: ChatStreamCompletionCreateParamsTypeText
-
-
-class ChatStreamCompletionCreateParamsResponseFormatText(BaseModel):
- r"""Default text response format"""
-
- type: ChatStreamCompletionCreateParamsTypeText
-
-
-ChatStreamCompletionCreateParamsResponseFormatUnionTypedDict = TypeAliasType(
- "ChatStreamCompletionCreateParamsResponseFormatUnionTypedDict",
- Union[
- ChatStreamCompletionCreateParamsResponseFormatTextTypedDict,
- ChatStreamCompletionCreateParamsResponseFormatJSONObjectTypedDict,
- ChatStreamCompletionCreateParamsResponseFormatPythonTypedDict,
- ChatStreamCompletionCreateParamsResponseFormatJSONSchemaTypedDict,
- ChatStreamCompletionCreateParamsResponseFormatGrammarTypedDict,
- ],
-)
-r"""Response format configuration"""
-
-
-ChatStreamCompletionCreateParamsResponseFormatUnion = TypeAliasType(
- "ChatStreamCompletionCreateParamsResponseFormatUnion",
- Union[
- ChatStreamCompletionCreateParamsResponseFormatText,
- ChatStreamCompletionCreateParamsResponseFormatJSONObject,
- ChatStreamCompletionCreateParamsResponseFormatPython,
- ChatStreamCompletionCreateParamsResponseFormatJSONSchema,
- ChatStreamCompletionCreateParamsResponseFormatGrammar,
- ],
-)
-r"""Response format configuration"""
-
-
-ChatStreamCompletionCreateParamsStopTypedDict = TypeAliasType(
- "ChatStreamCompletionCreateParamsStopTypedDict", Union[str, List[str], Any]
-)
-r"""Stop sequences (up to 4)"""
-
-
-ChatStreamCompletionCreateParamsStop = TypeAliasType(
- "ChatStreamCompletionCreateParamsStop", Union[str, List[str], Any]
-)
-r"""Stop sequences (up to 4)"""
-
-
-class ChatStreamCompletionCreateParamsStreamOptionsTypedDict(TypedDict):
- r"""Streaming configuration options"""
-
- include_usage: NotRequired[bool]
- r"""Include usage information in streaming response"""
-
-
-class ChatStreamCompletionCreateParamsStreamOptions(BaseModel):
- r"""Streaming configuration options"""
-
- include_usage: Optional[bool] = None
- r"""Include usage information in streaming response"""
-
-
-ChatStreamCompletionCreateParamsReasoningEffort = Literal[
- "high", "medium", "low", "minimal"
-]
-r"""Reasoning effort"""
-
-ChatStreamCompletionCreateParamsDataCollection = Literal["deny", "allow"]
-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.
-
-"""
-
-ChatStreamCompletionCreateParamsOrderEnum = Literal[
- "AnyScale",
- "Cent-ML",
- "HuggingFace",
- "Hyperbolic 2",
- "Lepton",
- "Lynn 2",
- "Lynn",
- "Mancer",
- "Modal",
- "OctoAI",
- "Recursal",
- "Reflection",
- "Replicate",
- "SambaNova 2",
- "SF Compute",
- "Together 2",
- "01.AI",
- "AI21",
- "AionLabs",
- "Alibaba",
- "Amazon Bedrock",
- "Anthropic",
- "AtlasCloud",
- "Atoma",
- "Avian",
- "Azure",
- "BaseTen",
- "Cerebras",
- "Chutes",
- "Cloudflare",
- "Cohere",
- "CrofAI",
- "Crusoe",
- "DeepInfra",
- "DeepSeek",
- "Enfer",
- "Featherless",
- "Fireworks",
- "Friendli",
- "GMICloud",
- "Google",
- "Google AI Studio",
- "Groq",
- "Hyperbolic",
- "Inception",
- "InferenceNet",
- "Infermatic",
- "Inflection",
- "InoCloud",
- "Kluster",
- "Lambda",
- "Liquid",
- "Mancer 2",
- "Meta",
- "Minimax",
- "Mistral",
- "Moonshot AI",
- "Morph",
- "NCompass",
- "Nebius",
- "NextBit",
- "Nineteen",
- "Novita",
- "OpenAI",
- "OpenInference",
- "Parasail",
- "Perplexity",
- "Phala",
- "SambaNova",
- "Stealth",
- "Switchpoint",
- "Targon",
- "Together",
- "Ubicloud",
- "Venice",
- "WandB",
- "xAI",
- "Z.AI",
-]
-
-ChatStreamCompletionCreateParamsOrderUnionTypedDict = TypeAliasType(
- "ChatStreamCompletionCreateParamsOrderUnionTypedDict",
- Union[ChatStreamCompletionCreateParamsOrderEnum, str],
-)
-
-
-ChatStreamCompletionCreateParamsOrderUnion = TypeAliasType(
- "ChatStreamCompletionCreateParamsOrderUnion",
- Union[ChatStreamCompletionCreateParamsOrderEnum, str],
-)
-
-
-ChatStreamCompletionCreateParamsOnlyEnum = Literal[
- "AnyScale",
- "Cent-ML",
- "HuggingFace",
- "Hyperbolic 2",
- "Lepton",
- "Lynn 2",
- "Lynn",
- "Mancer",
- "Modal",
- "OctoAI",
- "Recursal",
- "Reflection",
- "Replicate",
- "SambaNova 2",
- "SF Compute",
- "Together 2",
- "01.AI",
- "AI21",
- "AionLabs",
- "Alibaba",
- "Amazon Bedrock",
- "Anthropic",
- "AtlasCloud",
- "Atoma",
- "Avian",
- "Azure",
- "BaseTen",
- "Cerebras",
- "Chutes",
- "Cloudflare",
- "Cohere",
- "CrofAI",
- "Crusoe",
- "DeepInfra",
- "DeepSeek",
- "Enfer",
- "Featherless",
- "Fireworks",
- "Friendli",
- "GMICloud",
- "Google",
- "Google AI Studio",
- "Groq",
- "Hyperbolic",
- "Inception",
- "InferenceNet",
- "Infermatic",
- "Inflection",
- "InoCloud",
- "Kluster",
- "Lambda",
- "Liquid",
- "Mancer 2",
- "Meta",
- "Minimax",
- "Mistral",
- "Moonshot AI",
- "Morph",
- "NCompass",
- "Nebius",
- "NextBit",
- "Nineteen",
- "Novita",
- "OpenAI",
- "OpenInference",
- "Parasail",
- "Perplexity",
- "Phala",
- "SambaNova",
- "Stealth",
- "Switchpoint",
- "Targon",
- "Together",
- "Ubicloud",
- "Venice",
- "WandB",
- "xAI",
- "Z.AI",
-]
-
-ChatStreamCompletionCreateParamsOnlyUnionTypedDict = TypeAliasType(
- "ChatStreamCompletionCreateParamsOnlyUnionTypedDict",
- Union[ChatStreamCompletionCreateParamsOnlyEnum, str],
-)
-
-
-ChatStreamCompletionCreateParamsOnlyUnion = TypeAliasType(
- "ChatStreamCompletionCreateParamsOnlyUnion",
- Union[ChatStreamCompletionCreateParamsOnlyEnum, str],
-)
-
-
-ChatStreamCompletionCreateParamsIgnoreEnum = Literal[
- "AnyScale",
- "Cent-ML",
- "HuggingFace",
- "Hyperbolic 2",
- "Lepton",
- "Lynn 2",
- "Lynn",
- "Mancer",
- "Modal",
- "OctoAI",
- "Recursal",
- "Reflection",
- "Replicate",
- "SambaNova 2",
- "SF Compute",
- "Together 2",
- "01.AI",
- "AI21",
- "AionLabs",
- "Alibaba",
- "Amazon Bedrock",
- "Anthropic",
- "AtlasCloud",
- "Atoma",
- "Avian",
- "Azure",
- "BaseTen",
- "Cerebras",
- "Chutes",
- "Cloudflare",
- "Cohere",
- "CrofAI",
- "Crusoe",
- "DeepInfra",
- "DeepSeek",
- "Enfer",
- "Featherless",
- "Fireworks",
- "Friendli",
- "GMICloud",
- "Google",
- "Google AI Studio",
- "Groq",
- "Hyperbolic",
- "Inception",
- "InferenceNet",
- "Infermatic",
- "Inflection",
- "InoCloud",
- "Kluster",
- "Lambda",
- "Liquid",
- "Mancer 2",
- "Meta",
- "Minimax",
- "Mistral",
- "Moonshot AI",
- "Morph",
- "NCompass",
- "Nebius",
- "NextBit",
- "Nineteen",
- "Novita",
- "OpenAI",
- "OpenInference",
- "Parasail",
- "Perplexity",
- "Phala",
- "SambaNova",
- "Stealth",
- "Switchpoint",
- "Targon",
- "Together",
- "Ubicloud",
- "Venice",
- "WandB",
- "xAI",
- "Z.AI",
-]
-
-ChatStreamCompletionCreateParamsIgnoreUnionTypedDict = TypeAliasType(
- "ChatStreamCompletionCreateParamsIgnoreUnionTypedDict",
- Union[ChatStreamCompletionCreateParamsIgnoreEnum, str],
-)
-
-
-ChatStreamCompletionCreateParamsIgnoreUnion = TypeAliasType(
- "ChatStreamCompletionCreateParamsIgnoreUnion",
- Union[ChatStreamCompletionCreateParamsIgnoreEnum, str],
-)
-
-
-ChatStreamCompletionCreateParamsQuantization = Literal[
- "int4", "int8", "fp4", "fp6", "fp8", "fp16", "bf16", "fp32", "unknown"
-]
-
-ChatStreamCompletionCreateParamsSort = Literal["price", "throughput", "latency"]
-r"""The sorting strategy to use for this request, if \"order\" is not specified. When set, no load balancing is performed."""
-
-ChatStreamCompletionCreateParamsPromptTypedDict = TypeAliasType(
- "ChatStreamCompletionCreateParamsPromptTypedDict", Union[float, str, Any]
-)
-
-
-ChatStreamCompletionCreateParamsPrompt = TypeAliasType(
- "ChatStreamCompletionCreateParamsPrompt", Union[float, str, Any]
-)
-
-
-ChatStreamCompletionCreateParamsCompletionTypedDict = TypeAliasType(
- "ChatStreamCompletionCreateParamsCompletionTypedDict", Union[float, str, Any]
-)
-
-
-ChatStreamCompletionCreateParamsCompletion = TypeAliasType(
- "ChatStreamCompletionCreateParamsCompletion", Union[float, str, Any]
-)
-
-
-ChatStreamCompletionCreateParamsImageTypedDict = TypeAliasType(
- "ChatStreamCompletionCreateParamsImageTypedDict", Union[float, str, Any]
-)
-
-
-ChatStreamCompletionCreateParamsImage = TypeAliasType(
- "ChatStreamCompletionCreateParamsImage", Union[float, str, Any]
-)
-
-
-ChatStreamCompletionCreateParamsAudioTypedDict = TypeAliasType(
- "ChatStreamCompletionCreateParamsAudioTypedDict", Union[float, str, Any]
-)
-
-
-ChatStreamCompletionCreateParamsAudio = TypeAliasType(
- "ChatStreamCompletionCreateParamsAudio", Union[float, str, Any]
-)
-
-
-ChatStreamCompletionCreateParamsRequestTypedDict = TypeAliasType(
- "ChatStreamCompletionCreateParamsRequestTypedDict", Union[float, str, Any]
-)
-
-
-ChatStreamCompletionCreateParamsRequest = TypeAliasType(
- "ChatStreamCompletionCreateParamsRequest", Union[float, str, Any]
-)
-
-
-class ChatStreamCompletionCreateParamsMaxPriceTypedDict(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[ChatStreamCompletionCreateParamsPromptTypedDict]
- completion: NotRequired[ChatStreamCompletionCreateParamsCompletionTypedDict]
- image: NotRequired[ChatStreamCompletionCreateParamsImageTypedDict]
- audio: NotRequired[ChatStreamCompletionCreateParamsAudioTypedDict]
- request: NotRequired[ChatStreamCompletionCreateParamsRequestTypedDict]
-
-
-class ChatStreamCompletionCreateParamsMaxPrice(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[ChatStreamCompletionCreateParamsPrompt] = None
-
- completion: Optional[ChatStreamCompletionCreateParamsCompletion] = None
-
- image: Optional[ChatStreamCompletionCreateParamsImage] = None
-
- audio: Optional[ChatStreamCompletionCreateParamsAudio] = None
-
- request: Optional[ChatStreamCompletionCreateParamsRequest] = None
-
-
-class ChatStreamCompletionCreateParamsProviderTypedDict(TypedDict):
- r"""When multiple model providers are available, optionally indicate your routing preference."""
-
- 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[ChatStreamCompletionCreateParamsDataCollection]
- ]
- 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.
-
- """
- order: NotRequired[
- Nullable[List[ChatStreamCompletionCreateParamsOrderUnionTypedDict]]
- ]
- 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[ChatStreamCompletionCreateParamsOnlyUnionTypedDict]]
- ]
- 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[ChatStreamCompletionCreateParamsIgnoreUnionTypedDict]]
- ]
- 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[ChatStreamCompletionCreateParamsQuantization]]
- ]
- r"""A list of quantization levels to filter the provider by."""
- sort: NotRequired[Nullable[ChatStreamCompletionCreateParamsSort]]
- r"""The sorting strategy to use for this request, if \"order\" is not specified. When set, no load balancing is performed."""
- max_price: NotRequired[ChatStreamCompletionCreateParamsMaxPriceTypedDict]
- r"""The object specifying the maximum price you want to pay for this request. USD price per million tokens, for prompt and completion."""
-
-
-class ChatStreamCompletionCreateParamsProvider(BaseModel):
- r"""When multiple model providers are available, optionally indicate your routing preference."""
-
- 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: OptionalNullable[
- ChatStreamCompletionCreateParamsDataCollection
- ] = 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.
-
- """
-
- order: OptionalNullable[List[ChatStreamCompletionCreateParamsOrderUnion]] = UNSET
- r"""An ordered list of provider slugs. The router will attempt to use the first provider in the subset of this list that supports your requested model, and fall back to the next if it is unavailable. If no providers are available, the request will fail with an error message."""
-
- only: OptionalNullable[List[ChatStreamCompletionCreateParamsOnlyUnion]] = UNSET
- r"""List of provider slugs to allow. If provided, this list is merged with your account-wide allowed provider settings for this request."""
-
- ignore: OptionalNullable[List[ChatStreamCompletionCreateParamsIgnoreUnion]] = UNSET
- r"""List of provider slugs to ignore. If provided, this list is merged with your account-wide ignored provider settings for this request."""
-
- quantizations: OptionalNullable[
- List[ChatStreamCompletionCreateParamsQuantization]
- ] = UNSET
- r"""A list of quantization levels to filter the provider by."""
-
- sort: OptionalNullable[ChatStreamCompletionCreateParamsSort] = 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[ChatStreamCompletionCreateParamsMaxPrice] = None
- r"""The object specifying the maximum price you want to pay for this request. USD price per million tokens, for prompt and completion."""
-
- @model_serializer(mode="wrap")
- def serialize_model(self, handler):
- optional_fields = [
- "allow_fallbacks",
- "require_parameters",
- "data_collection",
- "order",
- "only",
- "ignore",
- "quantizations",
- "sort",
- "max_price",
- ]
- nullable_fields = [
- "allow_fallbacks",
- "require_parameters",
- "data_collection",
- "order",
- "only",
- "ignore",
- "quantizations",
- "sort",
- ]
- 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
-
-
-ChatStreamCompletionCreateParamsIDFileParser = Literal["file-parser"]
-
-ChatStreamCompletionCreateParamsPdfEngine = Literal["mistral-ocr", "pdf-text", "native"]
-
-
-class ChatStreamCompletionCreateParamsPdfTypedDict(TypedDict):
- engine: NotRequired[ChatStreamCompletionCreateParamsPdfEngine]
-
-
-class ChatStreamCompletionCreateParamsPdf(BaseModel):
- engine: Optional[ChatStreamCompletionCreateParamsPdfEngine] = None
-
-
-class ChatStreamCompletionCreateParamsPluginFileParserTypedDict(TypedDict):
- id: ChatStreamCompletionCreateParamsIDFileParser
- max_files: NotRequired[float]
- pdf: NotRequired[ChatStreamCompletionCreateParamsPdfTypedDict]
-
-
-class ChatStreamCompletionCreateParamsPluginFileParser(BaseModel):
- id: ChatStreamCompletionCreateParamsIDFileParser
-
- max_files: Optional[float] = None
-
- pdf: Optional[ChatStreamCompletionCreateParamsPdf] = None
-
-
-ChatStreamCompletionCreateParamsIDChainOfThought = Literal["chain-of-thought"]
-
-
-class ChatStreamCompletionCreateParamsPluginChainOfThoughtTypedDict(TypedDict):
- id: ChatStreamCompletionCreateParamsIDChainOfThought
-
-
-class ChatStreamCompletionCreateParamsPluginChainOfThought(BaseModel):
- id: ChatStreamCompletionCreateParamsIDChainOfThought
-
-
-ChatStreamCompletionCreateParamsIDWeb = Literal["web"]
-
-ChatStreamCompletionCreateParamsEngine = Literal["native", "exa"]
-
-
-class ChatStreamCompletionCreateParamsPluginWebTypedDict(TypedDict):
- id: ChatStreamCompletionCreateParamsIDWeb
- max_results: NotRequired[float]
- search_prompt: NotRequired[str]
- engine: NotRequired[ChatStreamCompletionCreateParamsEngine]
-
-
-class ChatStreamCompletionCreateParamsPluginWeb(BaseModel):
- id: ChatStreamCompletionCreateParamsIDWeb
-
- max_results: Optional[float] = None
-
- search_prompt: Optional[str] = None
-
- engine: Optional[ChatStreamCompletionCreateParamsEngine] = None
-
-
-ChatStreamCompletionCreateParamsIDModeration = Literal["moderation"]
-
-
-class ChatStreamCompletionCreateParamsPluginModerationTypedDict(TypedDict):
- id: ChatStreamCompletionCreateParamsIDModeration
-
-
-class ChatStreamCompletionCreateParamsPluginModeration(BaseModel):
- id: ChatStreamCompletionCreateParamsIDModeration
-
-
-ChatStreamCompletionCreateParamsPluginUnionTypedDict = TypeAliasType(
- "ChatStreamCompletionCreateParamsPluginUnionTypedDict",
- Union[
- ChatStreamCompletionCreateParamsPluginModerationTypedDict,
- ChatStreamCompletionCreateParamsPluginChainOfThoughtTypedDict,
- ChatStreamCompletionCreateParamsPluginFileParserTypedDict,
- ChatStreamCompletionCreateParamsPluginWebTypedDict,
- ],
-)
-
-
-ChatStreamCompletionCreateParamsPluginUnion = TypeAliasType(
- "ChatStreamCompletionCreateParamsPluginUnion",
- Union[
- ChatStreamCompletionCreateParamsPluginModeration,
- ChatStreamCompletionCreateParamsPluginChainOfThought,
- ChatStreamCompletionCreateParamsPluginFileParser,
- ChatStreamCompletionCreateParamsPluginWeb,
- ],
-)
-
-
-class ChatStreamCompletionCreateParamsTypedDict(TypedDict):
- r"""Chat completion request parameters"""
-
- messages: List[ChatCompletionMessageParamTypedDict]
- r"""List of messages for the conversation"""
- model: NotRequired[str]
- r"""Model to use for completion"""
- frequency_penalty: NotRequired[Nullable[float]]
- r"""Frequency penalty (-2.0 to 2.0)"""
- logit_bias: NotRequired[Nullable[Dict[str, float]]]
- r"""Token logit bias adjustments"""
- logprobs: NotRequired[Nullable[bool]]
- r"""Return log probabilities"""
- top_logprobs: NotRequired[Nullable[float]]
- r"""Number of top log probabilities to return (0-20)"""
- max_completion_tokens: NotRequired[Nullable[float]]
- r"""Maximum tokens in completion"""
- max_tokens: NotRequired[Nullable[float]]
- r"""Maximum tokens (deprecated, use max_completion_tokens)"""
- metadata: NotRequired[Dict[str, str]]
- r"""Key-value pairs for additional object information (max 16 pairs, 64 char keys, 512 char values)"""
- presence_penalty: NotRequired[Nullable[float]]
- r"""Presence penalty (-2.0 to 2.0)"""
- reasoning: NotRequired[Nullable[ChatStreamCompletionCreateParamsReasoningTypedDict]]
- r"""Reasoning configuration"""
- response_format: NotRequired[
- ChatStreamCompletionCreateParamsResponseFormatUnionTypedDict
- ]
- r"""Response format configuration"""
- seed: NotRequired[Nullable[int]]
- r"""Random seed for deterministic outputs"""
- stop: NotRequired[Nullable[ChatStreamCompletionCreateParamsStopTypedDict]]
- r"""Stop sequences (up to 4)"""
- stream: NotRequired[bool]
- r"""Enable streaming response"""
- stream_options: NotRequired[
- Nullable[ChatStreamCompletionCreateParamsStreamOptionsTypedDict]
- ]
- temperature: NotRequired[Nullable[float]]
- r"""Sampling temperature (0-2)"""
- tool_choice: NotRequired[ChatCompletionToolChoiceOptionTypedDict]
- r"""Tool choice configuration"""
- tools: NotRequired[List[ChatCompletionToolTypedDict]]
- r"""Available tools for function calling"""
- top_p: NotRequired[Nullable[float]]
- r"""Nucleus sampling parameter (0-1)"""
- user: NotRequired[str]
- r"""Unique user identifier"""
- fallback_models: NotRequired[Nullable[List[str]]]
- r"""Order of models to fallback to for this request"""
- reasoning_effort: NotRequired[
- Nullable[ChatStreamCompletionCreateParamsReasoningEffort]
- ]
- r"""Reasoning effort"""
- provider: NotRequired[Nullable[ChatStreamCompletionCreateParamsProviderTypedDict]]
- r"""When multiple model providers are available, optionally indicate your routing preference."""
- plugins: NotRequired[List[ChatStreamCompletionCreateParamsPluginUnionTypedDict]]
- r"""Plugins you want to enable for this request, including their settings."""
-
-
-class ChatStreamCompletionCreateParams(BaseModel):
- r"""Chat completion request parameters"""
-
- messages: List[ChatCompletionMessageParam]
- r"""List of messages for the conversation"""
-
- model: Optional[str] = None
- r"""Model to use for completion"""
-
- frequency_penalty: OptionalNullable[float] = UNSET
- r"""Frequency penalty (-2.0 to 2.0)"""
-
- logit_bias: OptionalNullable[Dict[str, float]] = UNSET
- r"""Token logit bias adjustments"""
-
- logprobs: OptionalNullable[bool] = UNSET
- r"""Return log probabilities"""
-
- top_logprobs: OptionalNullable[float] = UNSET
- r"""Number of top log probabilities to return (0-20)"""
-
- max_completion_tokens: OptionalNullable[float] = UNSET
- r"""Maximum tokens in completion"""
-
- max_tokens: OptionalNullable[float] = UNSET
- r"""Maximum tokens (deprecated, use max_completion_tokens)"""
-
- metadata: Optional[Dict[str, str]] = None
- r"""Key-value pairs for additional object information (max 16 pairs, 64 char keys, 512 char values)"""
-
- presence_penalty: OptionalNullable[float] = UNSET
- r"""Presence penalty (-2.0 to 2.0)"""
-
- reasoning: OptionalNullable[ChatStreamCompletionCreateParamsReasoning] = UNSET
- r"""Reasoning configuration"""
-
- response_format: Optional[ChatStreamCompletionCreateParamsResponseFormatUnion] = (
- None
- )
- r"""Response format configuration"""
-
- seed: OptionalNullable[int] = UNSET
- r"""Random seed for deterministic outputs"""
-
- stop: OptionalNullable[ChatStreamCompletionCreateParamsStop] = UNSET
- r"""Stop sequences (up to 4)"""
-
- stream: Optional[bool] = True
- r"""Enable streaming response"""
-
- stream_options: OptionalNullable[ChatStreamCompletionCreateParamsStreamOptions] = (
- UNSET
- )
-
- temperature: OptionalNullable[float] = 1
- r"""Sampling temperature (0-2)"""
-
- tool_choice: Optional[ChatCompletionToolChoiceOption] = None
- r"""Tool choice configuration"""
-
- tools: Optional[List[ChatCompletionTool]] = None
- r"""Available tools for function calling"""
-
- top_p: OptionalNullable[float] = 1
- r"""Nucleus sampling parameter (0-1)"""
-
- user: Optional[str] = None
- r"""Unique user identifier"""
-
- fallback_models: Annotated[
- OptionalNullable[List[str]], pydantic.Field(alias="models")
- ] = UNSET
- r"""Order of models to fallback to for this request"""
-
- reasoning_effort: OptionalNullable[
- ChatStreamCompletionCreateParamsReasoningEffort
- ] = UNSET
- r"""Reasoning effort"""
-
- provider: OptionalNullable[ChatStreamCompletionCreateParamsProvider] = UNSET
- r"""When multiple model providers are available, optionally indicate your routing preference."""
-
- plugins: Optional[List[ChatStreamCompletionCreateParamsPluginUnion]] = None
- r"""Plugins you want to enable for this request, including their settings."""
-
- @model_serializer(mode="wrap")
- def serialize_model(self, handler):
- optional_fields = [
- "model",
- "frequency_penalty",
- "logit_bias",
- "logprobs",
- "top_logprobs",
- "max_completion_tokens",
- "max_tokens",
- "metadata",
- "presence_penalty",
- "reasoning",
- "response_format",
- "seed",
- "stop",
- "stream",
- "stream_options",
- "temperature",
- "tool_choice",
- "tools",
- "top_p",
- "user",
- "fallback_models",
- "reasoning_effort",
- "provider",
- "plugins",
- ]
- nullable_fields = [
- "frequency_penalty",
- "logit_bias",
- "logprobs",
- "top_logprobs",
- "max_completion_tokens",
- "max_tokens",
- "presence_penalty",
- "reasoning",
- "seed",
- "stop",
- "stream_options",
- "temperature",
- "top_p",
- "fallback_models",
- "reasoning_effort",
- "provider",
- ]
- 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
diff --git a/src/openrouter/models/createchatcompletionop.py b/src/openrouter/models/createchatcompletionop.py
new file mode 100644
index 0000000..4b81b7b
--- /dev/null
+++ b/src/openrouter/models/createchatcompletionop.py
@@ -0,0 +1,35 @@
+"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
+
+from __future__ import annotations
+from .chatcompletion import ChatCompletion, ChatCompletionTypedDict
+from .chatcompletionchunkwrapper import (
+ ChatCompletionChunkWrapper,
+ ChatCompletionChunkWrapperTypedDict,
+)
+from openrouter.utils import eventstreaming
+from typing import Union
+from typing_extensions import TypeAliasType
+
+
+CreateChatCompletionResponseTypedDict = TypeAliasType(
+ "CreateChatCompletionResponseTypedDict",
+ Union[
+ ChatCompletionTypedDict,
+ Union[
+ eventstreaming.EventStream[ChatCompletionChunkWrapperTypedDict],
+ eventstreaming.EventStreamAsync[ChatCompletionChunkWrapperTypedDict],
+ ],
+ ],
+)
+
+
+CreateChatCompletionResponse = TypeAliasType(
+ "CreateChatCompletionResponse",
+ Union[
+ ChatCompletion,
+ Union[
+ eventstreaming.EventStream[ChatCompletionChunkWrapper],
+ eventstreaming.EventStreamAsync[ChatCompletionChunkWrapper],
+ ],
+ ],
+)
diff --git a/src/openrouter/sdk.py b/src/openrouter/sdk.py
index ac72867..ab87f24 100644
--- a/src/openrouter/sdk.py
+++ b/src/openrouter/sdk.py
@@ -24,7 +24,6 @@ class OpenRouter(BaseSDK):
"""
chat: "Chat"
- r"""Chat completion operations"""
_sub_sdk_map = {
"chat": ("openrouter.chat", "Chat"),
}
diff --git a/uv.lock b/uv.lock
index 431c396..184716d 100644
--- a/uv.lock
+++ b/uv.lock
@@ -201,7 +201,7 @@ wheels = [
[[package]]
name = "openrouter"
-version = "0.5.2"
+version = "0.6.2"
source = { editable = "." }
dependencies = [
{ name = "httpcore" },