Commits included in this export:

- ac457b8a8dad98fdf5ddcae8dd4711361cea3084
  - ea825199f4c59dd68fec01cf8d18a582963c9f25
  - 4d48e4f6bb936e785787314a965298da6b78fea0
  - 718729a573ee98893a4408d5a52ab4686661fe54
  - b867adcde6b64f3f2a11c4626254b39098e4b0b4
  - 21912c097b4066d109766c6b4492826595cd57c5
  - bc1ed85adc976a4634ca8a41b82e4fc2c39a864f
  - d145c89c941937a312ed1357590d2bfda9a3603d
  - 12f05b5dee397ead47cfcd545a7a2e3c7ff57524
  - dd28f75a19a015809797c7abf3f8758f7c37262e
  - c96e569781e07ab44172d9c69940ec17bafd81f4
  - c9d5a90e3c2b5077a2bdd49773f1a46d1a5a79c7
  - 58b08f87116ceab9076de2fdc0a4c74c919b44c4

GitOrigin-RevId: ac457b8a8dad98fdf5ddcae8dd4711361cea3084
This commit is contained in:
OpenRouter Team
2026-01-27 07:17:27 +00:00
parent 0c791b04d1
commit 4cbb39da19
42 changed files with 181 additions and 2010 deletions
+10 -28
View File
@@ -1,12 +1,12 @@
lockVersion: 2.0.0
id: cfd52247-6a25-4c6d-bbce-fe6fce0cd69d
management:
docChecksum: 7136b263714e485a5a96ee056b6e3f36
docChecksum: 342e7e8ea9cb2b7ff1c1860e18d58822
docVersion: 1.0.0
speakeasyVersion: 1.666.0
generationVersion: 2.768.0
releaseVersion: 0.1.3
configChecksum: d03f8606816d7028a10e566c4ff2ac44
releaseVersion: 0.3.0
configChecksum: 987e66c3a2350c79a554bfc232ca4961
repoURL: https://github.com/OpenRouterTeam/python-sdk.git
installationURL: https://github.com/OpenRouterTeam/python-sdk.git
published: true
@@ -74,11 +74,6 @@ generatedFiles:
- docs/components/chatgenerationparamspreferredminthroughput.md
- docs/components/chatgenerationparamspreferredminthroughputunion.md
- docs/components/chatgenerationparamsprovider.md
- docs/components/chatgenerationparamsresponseformatjsonobject.md
- docs/components/chatgenerationparamsresponseformatpython.md
- docs/components/chatgenerationparamsresponseformattext.md
- docs/components/chatgenerationparamsresponseformatunion.md
- docs/components/chatgenerationparamsstop.md
- docs/components/chatgenerationtokenusage.md
- docs/components/chatmessagecontentitem.md
- docs/components/chatmessagecontentitemaudio.md
@@ -109,18 +104,7 @@ generatedFiles:
- docs/components/chatstreamoptions.md
- docs/components/code.md
- docs/components/codeenum.md
- docs/components/completionchoice.md
- docs/components/completioncreateparams.md
- docs/components/completioncreateparamsresponseformatjsonobject.md
- docs/components/completioncreateparamsresponseformatpython.md
- docs/components/completioncreateparamsresponseformattext.md
- docs/components/completioncreateparamsresponseformatunion.md
- docs/components/completioncreateparamsstop.md
- docs/components/completionfinishreason.md
- docs/components/completionlogprobs.md
- docs/components/completionresponse.md
- docs/components/completiontokensdetails.md
- docs/components/completionusage.md
- docs/components/costdetails.md
- docs/components/createchargerequest.md
- docs/components/datacollection.md
@@ -345,7 +329,6 @@ generatedFiles:
- docs/components/preferredmaxlatency.md
- docs/components/preferredminthroughput.md
- docs/components/pricing.md
- docs/components/prompt.md
- docs/components/prompttokensdetails.md
- docs/components/providername.md
- docs/components/provideroverloadedresponseerrordata.md
@@ -376,7 +359,11 @@ generatedFiles:
- docs/components/reasoningtextcontent.md
- docs/components/reasoningtextcontenttype.md
- docs/components/requesttimeoutresponseerrordata.md
- docs/components/responseformat.md
- docs/components/responseformatjsonobject.md
- docs/components/responseformatjsonschema.md
- docs/components/responseformatpython.md
- docs/components/responseformattext.md
- docs/components/responseformattextconfig.md
- docs/components/responseformattextgrammar.md
- docs/components/responseinputaudio.md
@@ -448,7 +435,7 @@ generatedFiles:
- docs/components/servicetier.md
- docs/components/serviceunavailableresponseerrordata.md
- docs/components/sortenum.md
- docs/components/streamoptions.md
- docs/components/stop.md
- docs/components/systemmessage.md
- docs/components/systemmessagecontent.md
- docs/components/tokenizer.md
@@ -627,7 +614,6 @@ generatedFiles:
- docs/sdks/analytics/README.md
- docs/sdks/apikeys/README.md
- docs/sdks/chat/README.md
- docs/sdks/completions/README.md
- docs/sdks/credits/README.md
- docs/sdks/embeddings/README.md
- docs/sdks/endpoints/README.md
@@ -651,7 +637,6 @@ generatedFiles:
- src/openrouter/basesdk.py
- src/openrouter/beta.py
- src/openrouter/chat.py
- src/openrouter/completions.py
- src/openrouter/components/__init__.py
- src/openrouter/components/_schema0.py
- src/openrouter/components/_schema2.py
@@ -679,11 +664,6 @@ generatedFiles:
- src/openrouter/components/chatstreamingmessagetoolcall.py
- src/openrouter/components/chatstreamingresponsechunk.py
- src/openrouter/components/chatstreamoptions.py
- src/openrouter/components/completionchoice.py
- src/openrouter/components/completioncreateparams.py
- src/openrouter/components/completionlogprobs.py
- src/openrouter/components/completionresponse.py
- src/openrouter/components/completionusage.py
- src/openrouter/components/createchargerequest.py
- src/openrouter/components/datacollection.py
- src/openrouter/components/defaultparameters.py
@@ -1063,6 +1043,8 @@ examples:
application/json: {"error": {"code": 401, "message": "Missing Authentication header"}}
"500":
application/json: {"error": {"code": 500, "message": "Internal Server Error"}}
"404":
application/json: {"error": {"code": 404, "message": "Resource not found"}}
listEndpoints:
speakeasy-default-list-endpoints:
parameters:
+1 -1
View File
@@ -31,7 +31,7 @@ generation:
skipResponseBodyAssertions: false
preApplyUnionDiscriminators: true
python:
version: 0.1.3
version: 0.3.0
additionalDependencies:
dev: {}
main: {}
+17 -313
View File
@@ -2,7 +2,7 @@ openapi: 3.1.0
info:
title: OpenRouter API
version: 1.0.0
description: OpenAI-compatible Chat Completions and Completions API with additional OpenRouter features
description: OpenAI-compatible API with additional OpenRouter features
contact:
name: OpenRouter Support
url: https://openrouter.ai/docs
@@ -9341,263 +9341,6 @@ components:
required:
- data
additionalProperties: false
CompletionFinishReason:
anyOf:
- type: string
enum:
- stop
- length
- content_filter
- type: 'null'
CompletionLogprobs:
type: object
properties:
tokens:
type: array
items:
type: string
token_logprobs:
type: array
items:
type: number
top_logprobs:
anyOf:
- type: array
items:
type: object
propertyNames:
type: string
additionalProperties:
type: number
- type: 'null'
text_offset:
type: array
items:
type: number
required:
- tokens
- token_logprobs
- top_logprobs
- text_offset
CompletionUsage:
type: object
properties:
prompt_tokens:
type: number
completion_tokens:
type: number
total_tokens:
type: number
required:
- prompt_tokens
- completion_tokens
- total_tokens
CompletionCreateParams:
type: object
properties:
model:
$ref: '#/components/schemas/ModelName'
models:
type: array
items:
$ref: '#/components/schemas/ModelName'
prompt:
anyOf:
- type: string
- type: array
items:
type: string
- type: array
items:
type: number
- type: array
items:
type: array
items:
type: number
best_of:
anyOf:
- type: integer
minimum: 1
maximum: 20
- type: 'null'
echo:
anyOf:
- type: boolean
- type: 'null'
frequency_penalty:
anyOf:
- type: number
minimum: -2
maximum: 2
- type: 'null'
logit_bias:
anyOf:
- type: object
propertyNames:
type: string
additionalProperties:
type: number
- type: 'null'
logprobs:
anyOf:
- type: integer
minimum: 0
maximum: 5
- type: 'null'
max_tokens:
anyOf:
- type: integer
minimum: 1
maximum: 9007199254740991
- type: 'null'
'n':
anyOf:
- type: integer
minimum: 1
maximum: 128
- type: 'null'
presence_penalty:
anyOf:
- type: number
minimum: -2
maximum: 2
- type: 'null'
seed:
anyOf:
- type: integer
minimum: -9007199254740991
maximum: 9007199254740991
- type: 'null'
stop:
anyOf:
- anyOf:
- type: string
- type: array
items:
type: string
- type: 'null'
stream:
default: false
type: boolean
stream_options:
anyOf:
- type: object
properties:
include_usage:
anyOf:
- type: boolean
- type: 'null'
- type: 'null'
suffix:
anyOf:
- type: string
- type: 'null'
temperature:
anyOf:
- type: number
minimum: 0
maximum: 2
- type: 'null'
top_p:
anyOf:
- type: number
minimum: 0
maximum: 1
- type: 'null'
user:
type: string
metadata:
anyOf:
- type: object
propertyNames:
type: string
additionalProperties:
type: string
- type: 'null'
response_format:
anyOf:
- oneOf:
- type: object
properties:
type:
type: string
const: text
required:
- type
- type: object
properties:
type:
type: string
const: json_object
required:
- type
- $ref: '#/components/schemas/ResponseFormatJSONSchema'
- $ref: '#/components/schemas/ResponseFormatTextGrammar'
- type: object
properties:
type:
type: string
const: python
required:
- type
type: object
- type: 'null'
required:
- prompt
CompletionChoice:
type: object
properties:
text:
type: string
index:
type: number
logprobs:
anyOf:
- $ref: '#/components/schemas/CompletionLogprobs'
- type: 'null'
finish_reason:
$ref: '#/components/schemas/CompletionFinishReason'
native_finish_reason:
type: string
reasoning:
anyOf:
- type: string
- type: 'null'
required:
- text
- index
- logprobs
- finish_reason
CompletionResponse:
type: object
properties:
id:
type: string
object:
type: string
const: text_completion
created:
type: number
model:
type: string
provider:
type: string
system_fingerprint:
type: string
choices:
type: array
items:
$ref: '#/components/schemas/CompletionChoice'
usage:
$ref: '#/components/schemas/CompletionUsage'
required:
- id
- object
- created
- model
- choices
additionalProperties: false
parameters: {}
securitySchemes:
apiKey:
@@ -9724,7 +9467,7 @@ paths:
x-speakeasy-name-override: create
x-speakeasy-stream-request-field: stream
tags:
- anthropic.messages
- Anthropic Messages
summary: Create a message
description: >-
Creates a message using the Anthropic Messages API format. Supports text, images, PDFs, tools, and extended
@@ -10790,7 +10533,13 @@ paths:
tags:
- Models
x-speakeasy-name-override: listForUser
summary: List models filtered by user provider preferences
description: >-
List models filtered by user provider preferences, [privacy
settings](https://openrouter.ai/docs/guides/privacy/logging), and
[guardrails](https://openrouter.ai/docs/guides/features/guardrails). If requesting through
`eu.openrouter.ai/api/v1/...` the results will be filtered to models that satisfy [EU in-region
routing](https://openrouter.ai/docs/guides/privacy/logging#enterprise-eu-in-region-routing).
summary: List models filtered by user provider preferences, privacy settings, and guardrails
security:
- bearer: []
responses:
@@ -10806,6 +10555,12 @@ paths:
application/json:
schema:
$ref: '#/components/schemas/UnauthorizedResponse'
'404':
description: Not Found - No eligible endpoints found
content:
application/json:
schema:
$ref: '#/components/schemas/NotFoundResponse'
'500':
description: Internal Server Error
content:
@@ -13812,55 +13567,6 @@ paths:
application/json:
schema:
$ref: '#/components/schemas/ChatError'
/completions:
post:
summary: Create a completion
x-speakeasy-group: completions
x-speakeasy-name-override: generate
x-speakeasy-stream-request-field: stream
description: Creates a completion for the provided prompt and parameters. Supports both streaming and non-streaming modes.
tags:
- Completions
requestBody:
required: true
description: Completion request parameters
content:
application/json:
schema:
$ref: '#/components/schemas/CompletionCreateParams'
responses:
'200':
description: Successful completion response
content:
application/json:
schema:
$ref: '#/components/schemas/CompletionResponse'
description: Completion response
'400':
description: Bad request - invalid parameters
content:
application/json:
schema:
$ref: '#/components/schemas/ChatError'
'401':
description: Unauthorized - invalid API key
content:
application/json:
schema:
$ref: '#/components/schemas/ChatError'
'429':
description: Too many requests - rate limit exceeded
content:
application/json:
schema:
$ref: '#/components/schemas/ChatError'
'500':
description: Internal server error
content:
application/json:
schema:
$ref: '#/components/schemas/ChatError'
operationId: createCompletions
servers:
- url: https://openrouter.ai/api/v1
description: Production server
@@ -13875,10 +13581,10 @@ tags:
description: API key management endpoints
- name: Analytics
description: Analytics and usage endpoints
- name: Anthropic Messages
description: Anthropic Messages endpoints
- name: Chat
description: Chat completion endpoints
- name: Completions
description: Text completion endpoints
- name: Credits
description: Credit management endpoints
- name: Embeddings
@@ -13895,8 +13601,6 @@ tags:
description: OAuth authentication endpoints
- name: Providers
description: Provider information endpoints
- name: anthropic.messages
description: anthropic.messages endpoints
- name: beta.responses
description: beta.responses endpoints
x-fern-base-path: /
+13 -314
View File
@@ -2,7 +2,7 @@ openapi: 3.1.0
info:
title: OpenRouter API
version: 1.0.0
description: OpenAI-compatible Chat Completions and Completions API with additional OpenRouter features
description: OpenAI-compatible API with additional OpenRouter features
contact:
name: OpenRouter Support
url: https://openrouter.ai/docs
@@ -9350,264 +9350,6 @@ components:
required:
- data
additionalProperties: false
CompletionFinishReason:
anyOf:
- type: string
enum:
- stop
- length
- content_filter
x-speakeasy-unknown-values: allow
- type: 'null'
CompletionLogprobs:
type: object
properties:
tokens:
type: array
items:
type: string
token_logprobs:
type: array
items:
type: number
top_logprobs:
anyOf:
- type: array
items:
type: object
propertyNames:
type: string
additionalProperties:
type: number
- type: 'null'
text_offset:
type: array
items:
type: number
required:
- tokens
- token_logprobs
- top_logprobs
- text_offset
CompletionUsage:
type: object
properties:
prompt_tokens:
type: number
completion_tokens:
type: number
total_tokens:
type: number
required:
- prompt_tokens
- completion_tokens
- total_tokens
CompletionCreateParams:
type: object
properties:
model:
$ref: '#/components/schemas/ModelName'
models:
type: array
items:
$ref: '#/components/schemas/ModelName'
prompt:
anyOf:
- type: string
- type: array
items:
type: string
- type: array
items:
type: number
- type: array
items:
type: array
items:
type: number
best_of:
anyOf:
- type: integer
minimum: 1
maximum: 20
- type: 'null'
echo:
anyOf:
- type: boolean
- type: 'null'
frequency_penalty:
anyOf:
- type: number
minimum: -2
maximum: 2
- type: 'null'
logit_bias:
anyOf:
- type: object
propertyNames:
type: string
additionalProperties:
type: number
- type: 'null'
logprobs:
anyOf:
- type: integer
minimum: 0
maximum: 5
- type: 'null'
max_tokens:
anyOf:
- type: integer
minimum: 1
maximum: 9007199254740991
- type: 'null'
'n':
anyOf:
- type: integer
minimum: 1
maximum: 128
- type: 'null'
presence_penalty:
anyOf:
- type: number
minimum: -2
maximum: 2
- type: 'null'
seed:
anyOf:
- type: integer
minimum: -9007199254740991
maximum: 9007199254740991
- type: 'null'
stop:
anyOf:
- anyOf:
- type: string
- type: array
items:
type: string
- type: 'null'
stream:
default: false
type: boolean
stream_options:
anyOf:
- type: object
properties:
include_usage:
anyOf:
- type: boolean
- type: 'null'
- type: 'null'
suffix:
anyOf:
- type: string
- type: 'null'
temperature:
anyOf:
- type: number
minimum: 0
maximum: 2
- type: 'null'
top_p:
anyOf:
- type: number
minimum: 0
maximum: 1
- type: 'null'
user:
type: string
metadata:
anyOf:
- type: object
propertyNames:
type: string
additionalProperties:
type: string
- type: 'null'
response_format:
anyOf:
- oneOf:
- type: object
properties:
type:
type: string
const: text
required:
- type
- type: object
properties:
type:
type: string
const: json_object
required:
- type
- $ref: '#/components/schemas/ResponseFormatJSONSchema'
- $ref: '#/components/schemas/ResponseFormatTextGrammar'
- type: object
properties:
type:
type: string
const: python
required:
- type
type: object
- type: 'null'
required:
- prompt
CompletionChoice:
type: object
properties:
text:
type: string
index:
type: number
logprobs:
anyOf:
- $ref: '#/components/schemas/CompletionLogprobs'
- type: 'null'
finish_reason:
$ref: '#/components/schemas/CompletionFinishReason'
native_finish_reason:
type: string
reasoning:
anyOf:
- type: string
- type: 'null'
required:
- text
- index
- logprobs
- finish_reason
CompletionResponse:
type: object
properties:
id:
type: string
object:
type: string
const: text_completion
created:
type: number
model:
type: string
provider:
type: string
system_fingerprint:
type: string
choices:
type: array
items:
$ref: '#/components/schemas/CompletionChoice'
usage:
$ref: '#/components/schemas/CompletionUsage'
required:
- id
- object
- created
- model
- choices
additionalProperties: false
parameters: {AppIdentifier: {name: HTTP-Referer, in: header, schema: {type: string}, description: "The app identifier should be your app's URL and is used as the primary identifier for rankings.\nThis is used to track API usage per application.\n"}, AppDisplayName: {name: X-Title, in: header, schema: {type: string}, description: "The app display name allows you to customize how your app appears in OpenRouter's dashboard.\n"}}
securitySchemes:
apiKey:
@@ -9734,7 +9476,7 @@ paths:
x-speakeasy-name-override: create
x-speakeasy-stream-request-field: stream
tags:
- anthropic.messages
- Anthropic Messages
summary: Create a message
description: >-
Creates a message using the Anthropic Messages API format. Supports text, images, PDFs, tools, and extended thinking.
@@ -10787,7 +10529,9 @@ paths:
tags:
- Models
x-speakeasy-name-override: listForUser
summary: List models filtered by user provider preferences
description: >-
List models filtered by user provider preferences, [privacy settings](https://openrouter.ai/docs/guides/privacy/logging), and [guardrails](https://openrouter.ai/docs/guides/features/guardrails). If requesting through `eu.openrouter.ai/api/v1/...` the results will be filtered to models that satisfy [EU in-region routing](https://openrouter.ai/docs/guides/privacy/logging#enterprise-eu-in-region-routing).
summary: List models filtered by user provider preferences, privacy settings, and guardrails
security:
- bearer: []
responses:
@@ -10803,6 +10547,12 @@ paths:
application/json:
schema:
$ref: '#/components/schemas/UnauthorizedResponse'
'404':
description: Not Found - No eligible endpoints found
content:
application/json:
schema:
$ref: '#/components/schemas/NotFoundResponse'
'500':
description: Internal Server Error
content:
@@ -13802,55 +13552,6 @@ paths:
application/json:
schema:
$ref: '#/components/schemas/ChatError'
/completions:
post:
summary: Create a completion
x-speakeasy-group: completions
x-speakeasy-name-override: generate
x-speakeasy-stream-request-field: stream
description: Creates a completion for the provided prompt and parameters. Supports both streaming and non-streaming modes.
tags:
- Completions
requestBody:
required: true
description: Completion request parameters
content:
application/json:
schema:
$ref: '#/components/schemas/CompletionCreateParams'
responses:
'200':
description: Successful completion response
content:
application/json:
schema:
$ref: '#/components/schemas/CompletionResponse'
description: Completion response
'400':
description: Bad request - invalid parameters
content:
application/json:
schema:
$ref: '#/components/schemas/ChatError'
'401':
description: Unauthorized - invalid API key
content:
application/json:
schema:
$ref: '#/components/schemas/ChatError'
'429':
description: Too many requests - rate limit exceeded
content:
application/json:
schema:
$ref: '#/components/schemas/ChatError'
'500':
description: Internal server error
content:
application/json:
schema:
$ref: '#/components/schemas/ChatError'
operationId: createCompletions
servers:
- url: https://openrouter.ai/api/v1
description: Production server
@@ -13865,10 +13566,10 @@ tags:
description: API key management endpoints
- name: Analytics
description: Analytics and usage endpoints
- name: Anthropic Messages
description: Anthropic Messages endpoints
- name: Chat
description: Chat completion endpoints
- name: Completions
description: Text completion endpoints
- name: Credits
description: Credit management endpoints
- name: Embeddings
@@ -13885,8 +13586,6 @@ tags:
description: OAuth authentication endpoints
- name: Providers
description: Provider information endpoints
- name: anthropic.messages
description: anthropic.messages endpoints
- name: beta.responses
description: beta.responses endpoints
x-fern-base-path: /
+6 -5
View File
@@ -8,19 +8,20 @@ sources:
- latest
OpenRouter API:
sourceNamespace: open-router-chat-completions-api
sourceRevisionDigest: sha256:291e215687f85db05005d79dd87602a75b8086f39a841700fdbaaff7690b4f76
sourceBlobDigest: sha256:166639d08f0ae9687cea532ed8a93db59e63293c6a6f4d17d63f015b60d643d2
sourceRevisionDigest: sha256:5ba48c1ff7f13c2c5d9ab558e9ecd4638b65c12dd9c4e0cff7fb337674e94ceb
sourceBlobDigest: sha256:082db9694677b85116bda99811c8b957f96d1c493a3c606643479a65dad79730
tags:
- latest
- main
- 1.0.0
targets:
open-router:
source: OpenRouter API
sourceNamespace: open-router-chat-completions-api
sourceRevisionDigest: sha256:291e215687f85db05005d79dd87602a75b8086f39a841700fdbaaff7690b4f76
sourceBlobDigest: sha256:166639d08f0ae9687cea532ed8a93db59e63293c6a6f4d17d63f015b60d643d2
sourceRevisionDigest: sha256:5ba48c1ff7f13c2c5d9ab558e9ecd4638b65c12dd9c4e0cff7fb337674e94ceb
sourceBlobDigest: sha256:082db9694677b85116bda99811c8b957f96d1c493a3c606643479a65dad79730
codeSamplesNamespace: open-router-python-code-samples
codeSamplesRevisionDigest: sha256:f19eae09ec90a23147935f07a86f75dbbc998e6bac3b820351a1e5f147fec590
codeSamplesRevisionDigest: sha256:edf48a4b247040d1d03e08ea515577092801ecddf188310752b8fc11ee23a360
workflow:
workflowVersion: 1.0.0
speakeasyVersion: 1.666.0