Files
openrouter-python-sdk-retry…/.speakeasy/OAS_files/overlay.yaml
T
2025-08-22 10:31:13 -05:00

91 lines
3.4 KiB
YAML

overlay: 1.0.0
x-speakeasy-jsonpath: rfc9535
info:
title: Overlay chat-completions-openapi.yaml => openapi.yaml
version: 0.0.0
actions:
- target: $["components"]["schemas"]["ChatCompletion"]["properties"]["system_fingerprint"]
update:
type: string
nullable: true
description: System fingerprint
- target: $["components"]["schemas"]["ChatCompletionChunk"]["properties"]["system_fingerprint"]
update:
type: string
nullable: true
- target: $["components"]["schemas"]
update:
ChatStreamCompletionCreateParams:
allOf:
- $ref: "#/components/schemas/ChatCompletionCreateParams"
- type: object
properties:
stream:
type: boolean
enum:
- true
default: true
description: Enable streaming response
- target: $["paths"]["/chat/completions"]["post"]["responses"]["200"]["content"]["application/json"]["schema"]
update:
$ref: '#/components/schemas/ChatCompletion'
- target: $["paths"]["/chat/completions"]["post"]["responses"]["200"]["content"]["application/json"]["schema"]
update:
description: Non-streaming response when stream=false
- target: $["paths"]["/chat/completions"]["post"]["responses"]["200"]["content"]["application/json"]["schema"]["oneOf"]
remove: true
- target: $["paths"]["/chat/completions"]["post"]["responses"]["200"]["content"]["text/event-stream"]
remove: true
- target: $["paths"]
update:
/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'
'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'