mirror of
https://github.com/wassname/openrouter-python-sdk-retry-errors.git
synced 2026-07-31 12:30:30 +08:00
18 KiB
18 KiB
ChatStreamCompletionCreateParams
Chat completion request parameters
Fields
| Field | Type | Required | Description | Example |
|---|---|---|---|---|
stream |
OptionalNullable[bool] | ➖ | Enable streaming response | |
messages |
List[models.ChatCompletionMessageParam] | ✔️ | List of messages for the conversation | [ { "role": "user", "content": "Hello, how are you?" } ] |
model |
Optional[str] | ➖ | Model to use for completion | |
frequency_penalty |
OptionalNullable[float] | ➖ | Frequency penalty (-2.0 to 2.0) | |
logit_bias |
Dict[str, float] | ➖ | Token logit bias adjustments | |
logprobs |
OptionalNullable[bool] | ➖ | Return log probabilities | |
top_logprobs |
OptionalNullable[float] | ➖ | Number of top log probabilities to return (0-20) | |
max_completion_tokens |
OptionalNullable[float] | ➖ | Maximum tokens in completion | |
max_tokens |
OptionalNullable[float] | ➖ | Maximum tokens (deprecated, use max_completion_tokens) | |
metadata |
Dict[str, str] | ➖ | Key-value pairs for additional object information (max 16 pairs, 64 char keys, 512 char values) | |
presence_penalty |
OptionalNullable[float] | ➖ | Presence penalty (-2.0 to 2.0) | |
reasoning |
OptionalNullable[models.ChatStreamCompletionCreateParamsReasoning] | ➖ | Reasoning configuration | |
response_format |
Optional[models.ChatStreamCompletionCreateParamsResponseFormatUnion] | ➖ | Response format configuration | |
seed |
OptionalNullable[int] | ➖ | Random seed for deterministic outputs | |
stop |
OptionalNullable[models.ChatStreamCompletionCreateParamsStop] | ➖ | Stop sequences (up to 4) | |
stream_options |
OptionalNullable[models.ChatStreamCompletionCreateParamsStreamOptions] | ➖ | N/A | |
temperature |
OptionalNullable[float] | ➖ | Sampling temperature (0-2) | |
tool_choice |
Optional[models.ChatCompletionToolChoiceOption] | ➖ | Tool choice configuration | |
tools |
List[models.ChatCompletionTool] | ➖ | Available tools for function calling | |
top_p |
OptionalNullable[float] | ➖ | Nucleus sampling parameter (0-1) | |
user |
Optional[str] | ➖ | Unique user identifier | |
fallback_models |
List[str] | ➖ | Order of models to fallback to for this request | |
reasoning_effort |
OptionalNullable[models.ChatStreamCompletionCreateParamsReasoningEffort] | ➖ | Reasoning effort | |
provider |
OptionalNullable[models.ChatStreamCompletionCreateParamsProvider] | ➖ | When multiple model providers are available, optionally indicate your routing preference. | |
plugins |
List[models.ChatStreamCompletionCreateParamsPluginUnion] | ➖ | Plugins you want to enable for this request, including their settings. |