This commit is contained in:
David Alberto Adler
2025-09-07 21:28:38 +01:00
parent 03054b21e4
commit 7a11b80884
4 changed files with 1549 additions and 91 deletions
-90
View File
@@ -1,90 +0,0 @@
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'
File diff suppressed because it is too large Load Diff
+1 -1
View File
@@ -3,7 +3,7 @@ speakeasyVersion: latest
sources:
OpenRouter Chat Completions API:
inputs:
- location: .speakeasy/OAS_files/chat-completions-openapi.yaml
- location: .speakeasy/input.openapi.yaml
output: .speakeasy/out.openapi.yaml
registry:
location: registry.speakeasyapi.dev/sheldon-vaughn-test/sandbox/open-router-chat-completions-api