Commits included in this export:

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

GitOrigin-RevId: e1074ff86fccf5e48406b7595298873106d3cc5a
This commit is contained in:
OpenRouter Team
2026-01-28 18:45:29 +00:00
parent 0c791b04d1
commit bf339d9530
51 changed files with 787 additions and 2048 deletions
+13 -29
View File
@@ -1,12 +1,12 @@
lockVersion: 2.0.0
id: cfd52247-6a25-4c6d-bbce-fe6fce0cd69d
management:
docChecksum: 7136b263714e485a5a96ee056b6e3f36
docChecksum: b46bf86766cf18470329da1fb2271f4e
docVersion: 1.0.0
speakeasyVersion: 1.666.0
generationVersion: 2.768.0
releaseVersion: 0.1.3
configChecksum: d03f8606816d7028a10e566c4ff2ac44
releaseVersion: 0.3.2
configChecksum: 684039465cd4c6f0105466ef2833908d
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
@@ -606,6 +593,8 @@ generatedFiles:
- docs/operations/metadata.md
- docs/operations/object.md
- docs/operations/objectembedding.md
- docs/operations/providername.md
- docs/operations/providerresponse.md
- docs/operations/ratelimit.md
- docs/operations/sendchatcompletionrequestresponse.md
- docs/operations/transferintent.md
@@ -627,7 +616,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 +639,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 +666,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
@@ -1021,7 +1003,7 @@ examples:
id: "<id>"
responses:
"200":
application/json: {"data": {"id": "gen-3bhGkxlo4XFrqiabUM7NDtwDzWwG", "upstream_id": "chatcmpl-791bcf62-080e-4568-87d0-94c72e3b4946", "total_cost": 0.0015, "cache_discount": 0.0002, "upstream_inference_cost": 0.0012, "created_at": "2024-07-15T23:33:19.433273+00:00", "model": "sao10k/l3-stheno-8b", "app_id": 12345, "streamed": true, "cancelled": false, "provider_name": "Infermatic", "latency": 1250, "moderation_latency": 50, "generation_time": 1200, "finish_reason": "stop", "tokens_prompt": 10, "tokens_completion": 25, "native_tokens_prompt": 10, "native_tokens_completion": 25, "native_tokens_completion_images": 0, "native_tokens_reasoning": 5, "native_tokens_cached": 3, "num_media_prompt": 1, "num_input_audio_prompt": 0, "num_media_completion": 0, "num_search_results": 5, "origin": "https://openrouter.ai/", "usage": 0.0015, "is_byok": false, "native_finish_reason": "stop", "external_user": "user-123", "api_type": "completions", "router": "openrouter/auto"}}
application/json: {"data": {"id": "gen-3bhGkxlo4XFrqiabUM7NDtwDzWwG", "upstream_id": "chatcmpl-791bcf62-080e-4568-87d0-94c72e3b4946", "total_cost": 0.0015, "cache_discount": 0.0002, "upstream_inference_cost": 0.0012, "created_at": "2024-07-15T23:33:19.433273+00:00", "model": "sao10k/l3-stheno-8b", "app_id": 12345, "streamed": true, "cancelled": false, "provider_name": "Infermatic", "latency": 1250, "moderation_latency": 50, "generation_time": 1200, "finish_reason": "stop", "tokens_prompt": 10, "tokens_completion": 25, "native_tokens_prompt": 10, "native_tokens_completion": 25, "native_tokens_completion_images": 0, "native_tokens_reasoning": 5, "native_tokens_cached": 3, "num_media_prompt": 1, "num_input_audio_prompt": 0, "num_media_completion": 0, "num_search_results": 5, "origin": "https://openrouter.ai/", "usage": 0.0015, "is_byok": false, "native_finish_reason": "stop", "external_user": "user-123", "api_type": "completions", "router": "openrouter/auto", "provider_responses": []}}
"401":
application/json: {"error": {"code": 401, "message": "Missing Authentication header"}}
"402":
@@ -1063,6 +1045,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.2
additionalDependencies:
dev: {}
main: {}
+144 -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
@@ -3542,6 +3542,7 @@ components:
- AI21
- AionLabs
- Alibaba
- Ambient
- Amazon Bedrock
- Amazon Nova
- Anthropic
@@ -8110,6 +8111,7 @@ components:
- AI21
- AionLabs
- Alibaba
- Ambient
- Amazon Bedrock
- Amazon Nova
- Anthropic
@@ -9341,263 +9343,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 +9469,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
@@ -10612,6 +10357,130 @@ paths:
nullable: true
description: Router used for the request (e.g., openrouter/auto)
example: openrouter/auto
provider_responses:
type: array
nullable: true
items:
type: object
properties:
id:
type: string
endpoint_id:
type: string
model_permaslug:
type: string
provider_name:
type: string
enum:
- AnyScale
- Atoma
- Cent-ML
- CrofAI
- Enfer
- GoPomelo
- HuggingFace
- Hyperbolic 2
- InoCloud
- Kluster
- Lambda
- Lepton
- Lynn 2
- Lynn
- Mancer
- Meta
- Modal
- Nineteen
- OctoAI
- Recursal
- Reflection
- Replicate
- SambaNova 2
- SF Compute
- Targon
- Together 2
- Ubicloud
- 01.AI
- AI21
- AionLabs
- Alibaba
- Ambient
- Amazon Bedrock
- Amazon Nova
- Anthropic
- Arcee AI
- AtlasCloud
- Avian
- Azure
- BaseTen
- BytePlus
- Black Forest Labs
- Cerebras
- Chutes
- Cirrascale
- Clarifai
- Cloudflare
- Cohere
- Crusoe
- DeepInfra
- DeepSeek
- Featherless
- Fireworks
- Friendli
- GMICloud
- Google
- Google AI Studio
- Groq
- Hyperbolic
- Inception
- Inceptron
- InferenceNet
- Infermatic
- Inflection
- Liquid
- Mara
- Mancer 2
- Minimax
- ModelRun
- Mistral
- Modular
- Moonshot AI
- Morph
- NCompass
- Nebius
- NextBit
- Novita
- Nvidia
- OpenAI
- OpenInference
- Parasail
- Perplexity
- Phala
- Relace
- SambaNova
- Seed
- SiliconFlow
- Sourceful
- Stealth
- StreamLake
- Switchpoint
- Together
- Upstage
- Venice
- WandB
- Xiaomi
- xAI
- Z.AI
- FakeProvider
status:
type: number
nullable: true
latency:
type: number
is_byok:
type: boolean
required:
- status
description: List of provider responses for this generation, including fallback attempts
required:
- id
- upstream_id
@@ -10646,6 +10515,7 @@ paths:
- external_user
- api_type
- router
- provider_responses
description: Generation data
required:
- data
@@ -10790,7 +10660,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 +10682,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 +13694,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 +13708,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 +13728,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: /
+141 -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
@@ -3561,6 +3561,7 @@ components:
- AI21
- AionLabs
- Alibaba
- Ambient
- Amazon Bedrock
- Amazon Nova
- Anthropic
@@ -8124,6 +8125,7 @@ components:
- AI21
- AionLabs
- Alibaba
- Ambient
- Amazon Bedrock
- Amazon Nova
- Anthropic
@@ -9350,264 +9352,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 +9478,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.
@@ -10621,6 +10365,131 @@ paths:
nullable: true
description: Router used for the request (e.g., openrouter/auto)
example: openrouter/auto
provider_responses:
type: array
nullable: true
items:
type: object
properties:
id:
type: string
endpoint_id:
type: string
model_permaslug:
type: string
provider_name:
type: string
enum:
- AnyScale
- Atoma
- Cent-ML
- CrofAI
- Enfer
- GoPomelo
- HuggingFace
- Hyperbolic 2
- InoCloud
- Kluster
- Lambda
- Lepton
- Lynn 2
- Lynn
- Mancer
- Meta
- Modal
- Nineteen
- OctoAI
- Recursal
- Reflection
- Replicate
- SambaNova 2
- SF Compute
- Targon
- Together 2
- Ubicloud
- 01.AI
- AI21
- AionLabs
- Alibaba
- Ambient
- Amazon Bedrock
- Amazon Nova
- Anthropic
- Arcee AI
- AtlasCloud
- Avian
- Azure
- BaseTen
- BytePlus
- Black Forest Labs
- Cerebras
- Chutes
- Cirrascale
- Clarifai
- Cloudflare
- Cohere
- Crusoe
- DeepInfra
- DeepSeek
- Featherless
- Fireworks
- Friendli
- GMICloud
- Google
- Google AI Studio
- Groq
- Hyperbolic
- Inception
- Inceptron
- InferenceNet
- Infermatic
- Inflection
- Liquid
- Mara
- Mancer 2
- Minimax
- ModelRun
- Mistral
- Modular
- Moonshot AI
- Morph
- NCompass
- Nebius
- NextBit
- Novita
- Nvidia
- OpenAI
- OpenInference
- Parasail
- Perplexity
- Phala
- Relace
- SambaNova
- Seed
- SiliconFlow
- Sourceful
- Stealth
- StreamLake
- Switchpoint
- Together
- Upstage
- Venice
- WandB
- Xiaomi
- xAI
- Z.AI
- FakeProvider
x-speakeasy-unknown-values: allow
status:
type: number
nullable: true
latency:
type: number
is_byok:
type: boolean
required:
- status
description: List of provider responses for this generation, including fallback attempts
required:
- id
- upstream_id
@@ -10655,6 +10524,7 @@ paths:
- external_user
- api_type
- router
- provider_responses
description: Generation data
required:
- data
@@ -10787,7 +10657,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 +10675,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 +13680,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 +13694,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 +13714,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:6e8165360ec62cc8b776111afb2e6d8c17e5dd46f2be6e124138a8296e2c7046
sourceBlobDigest: sha256:373dfa5b56ef18b9cdc55a2ad1a5d8b377deabfcc028ab7f940f525b3a3ca9c9
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:6e8165360ec62cc8b776111afb2e6d8c17e5dd46f2be6e124138a8296e2c7046
sourceBlobDigest: sha256:373dfa5b56ef18b9cdc55a2ad1a5d8b377deabfcc028ab7f940f525b3a3ca9c9
codeSamplesNamespace: open-router-python-code-samples
codeSamplesRevisionDigest: sha256:f19eae09ec90a23147935f07a86f75dbbc998e6bac3b820351a1e5f147fec590
codeSamplesRevisionDigest: sha256:0441c6e25f98818e2b2398041d3a974e3f26897c151a3fabfccbc2206640751a
workflow:
workflowVersion: 1.0.0
speakeasyVersion: 1.666.0