This commit is contained in:
David Alberto Adler
2025-09-07 20:40:53 +01:00
parent 0fc7236673
commit da48e8c4ea
166 changed files with 1689 additions and 4514 deletions
+31 -76
View File
@@ -17,7 +17,7 @@ servers:
default: openrouter.ai
description: Production server
security:
- BearerAuth: []
- ApiKey: []
tags:
- name: Chat
description: Chat completion operations
@@ -26,11 +26,17 @@ externalDocs:
url: https://openrouter.ai/docs
components:
securitySchemes:
BearerAuth:
ApiKey:
type: http
scheme: bearer
description: API key as bearer token in Authorization header
schemas:
ChatCompletionChunkWrapper:
type: object
required: [data]
properties:
data:
$ref: '#/components/schemas/ChatCompletionChunk'
ChatCompletionMessageToolCall:
type: object
properties:
@@ -450,7 +456,7 @@ components:
type: object
properties:
code:
type: string
type: number
nullable: true
message:
type: string
@@ -462,8 +468,6 @@ components:
required:
- code
- message
- param
- type
description: Error object structure
required:
- error
@@ -1057,7 +1061,7 @@ components:
type: string
description: Unique user identifier
models:
x-speakeasy-name-override: models_llm
x-speakeasy-name-override: model_list
type: array
nullable: true
items:
@@ -1082,15 +1086,17 @@ components:
description: >
Whether to allow backup providers to serve requests
- true: (default) when the primary provider (or your custom providers in "order") is unavailable, use the next best provider.
- 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:
type: boolean
nullable: true
description: >-
Whether to filter providers to only those that support the parameters you've provided. If this setting is omitted or set to false, then providers will receive only the parameters they support, and ignore the rest.
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:
type: string
nullable: true
@@ -1098,12 +1104,12 @@ components:
- deny
- allow
description: >
Data collection setting. If no available model provider meets the requirement, your request will return an error.
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:
type: array
nullable: true
@@ -1191,7 +1197,9 @@ components:
- Z.AI
- type: string
description: >-
An ordered list of provider slugs. The router will attempt to use the first provider in the subset of this list that supports your requested model, and fall back to the next if it is unavailable. If no providers are available, the request will fail with an error message.
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:
type: array
nullable: true
@@ -1279,7 +1287,8 @@ components:
- Z.AI
- type: string
description: >-
List of provider slugs to allow. If provided, this list is merged with your account-wide allowed provider settings for this request.
List of provider slugs to allow. If provided, this list is merged with your account-wide allowed
provider settings for this request.
ignore:
type: array
nullable: true
@@ -1367,7 +1376,8 @@ components:
- Z.AI
- type: string
description: >-
List of provider slugs to ignore. If provided, this list is merged with your account-wide ignored provider settings for this request.
List of provider slugs to ignore. If provided, this list is merged with your account-wide ignored
provider settings for this request.
quantizations:
type: array
nullable: true
@@ -1392,7 +1402,8 @@ components:
- throughput
- latency
description: >-
The sorting strategy to use for this request, if "order" is not specified. When set, no load balancing is performed.
The sorting strategy to use for this request, if "order" is not specified. When set, no load balancing
is performed.
max_price:
type: object
properties:
@@ -1423,7 +1434,8 @@ components:
- {}
additionalProperties: false
description: >-
The object specifying the maximum price you want to pay for this request. USD price per million tokens, for prompt and completion.
The object specifying the maximum price you want to pay for this request. USD price per million tokens,
for prompt and completion.
additionalProperties: false
description: When multiple model providers are available, optionally indicate your routing preference.
plugins:
@@ -1486,22 +1498,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:
@@ -1521,57 +1524,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:
@@ -1596,4 +1552,3 @@ paths:
application/json:
schema:
$ref: '#/components/schemas/ChatCompletionError'
x-speakeasy-name-override: completeStream