Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
4 changes: 3 additions & 1 deletion .genignore
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
pylintrc
pylintrc
docs/docs.json
docs/overview.mdx
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ __pycache__/
# Speakeasy generation artifacts (generated in OSS repo, not here)
.speakeasy/*.lock
.speakeasy/*.openapi.yaml
/docs
# Environment
.env
.env.local
Expand Down
14,318 changes: 7,165 additions & 7,153 deletions .speakeasy/gen.lock

Large diffs are not rendered by default.

20 changes: 19 additions & 1 deletion .speakeasy/gen.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ generation:
requestResponseComponentNamesFeb2024: true
securityFeb2025: true
sharedErrorComponentsApr2025: true
sharedNestedComponentsJan2026: false
nameOverrideFeb2026: false
auth:
oAuth2ClientCredentialsEnabled: true
oAuth2PasswordEnabled: true
Expand All @@ -25,14 +27,16 @@ generation:
schemas:
allOfMergeStrategy: shallowMerge
requestBodyFieldName: ""
versioningStrategy: automatic
persistentEdits: {}
tests:
generateTests: false
generateNewTests: true
skipResponseBodyAssertions: false
documentation: mintlify
preApplyUnionDiscriminators: true
python:
version: 0.10.8
version: 0.11.0
additionalDependencies:
dev: {}
main: {}
Expand All @@ -46,19 +50,26 @@ python:
authors:
- OpenRouter
baseErrorName: OpenRouterError
bodyVariantOverloads: false
clientServerStatusCodesAsErrors: true
constFieldCasing: upper
defaultErrorName: OpenRouterDefaultError
description: Official Python Client SDK for OpenRouter.
enableCustomCodeRegions: false
enumFormat: union
envVarPrefix: OPENROUTER
errorSchemaValidation: true
eventStreamClassNames:
async: EventStreamAsync
sync: EventStream
fixFlags:
asyncPaginationSep2025: true
conflictResistantModelImportsFeb2026: false
responseRequiredSep2024: true
flattenGlobalSecurity: true
flattenRequests: true
flatteningOrder: parameters-first
forwardCompatibleEnumsByDefault: false
forwardCompatibleUnionsByDefault: tagged-only
imports:
option: openapi
Expand All @@ -71,18 +82,25 @@ python:
inferSSEOverload: true
inferUnionDiscriminators: true
inputModelSuffix: input
inputTypedDictSuffix: TypedDict
legacyPyright: false
license: Apache-2.0
maxMethodParams: 999
methodArguments: infer-optional-args
methodTimeoutArgument: timeout-ms
methodTimeoutUnits: milliseconds
moduleName: ""
multipartArrayFormat: legacy
optionalDependencies: {}
outputModelSuffix: output
packageManager: uv
packageName: openrouter
preApplyUnionDiscriminators: false
pytestFilterWarnings: []
pytestTimeout: 0
rawResponseHelpers: false
responseFormat: flat
responseSchemaValidation: true
sseFlatResponse: true
templateVersion: v2
useAsyncHooks: false
15 changes: 7 additions & 8 deletions .speakeasy/workflow.lock
Original file line number Diff line number Diff line change
@@ -1,24 +1,23 @@
speakeasyVersion: 1.680.0
speakeasyVersion: 1.787.0
sources:
OpenRouter API:
sourceNamespace: open-router-chat-completions-api
sourceRevisionDigest: sha256:ed6981b24a0f8df827afac0f83d7dae4d8f7df331ae6e72664e03800cb7a0244
sourceBlobDigest: sha256:5961e537bd3160eb3f541232a5e7cb43704fed5e9ce76b342c08f6c52d4fefe9
sourceRevisionDigest: sha256:86c0ff20804c52cf4d1ecd247f6414b4209721628be768bb0e471fa8f2643a36
sourceBlobDigest: sha256:203cdb354ce296155f3b322907ecf7b02345a894ef5eaa042c2c9c86a3f513c8
tags:
- latest
- speakeasy-sdk-regen-1782660460
- 1.0.0
targets:
open-router:
source: OpenRouter API
sourceNamespace: open-router-chat-completions-api
sourceRevisionDigest: sha256:ed6981b24a0f8df827afac0f83d7dae4d8f7df331ae6e72664e03800cb7a0244
sourceBlobDigest: sha256:5961e537bd3160eb3f541232a5e7cb43704fed5e9ce76b342c08f6c52d4fefe9
sourceRevisionDigest: sha256:86c0ff20804c52cf4d1ecd247f6414b4209721628be768bb0e471fa8f2643a36
sourceBlobDigest: sha256:203cdb354ce296155f3b322907ecf7b02345a894ef5eaa042c2c9c86a3f513c8
codeSamplesNamespace: open-router-python-code-samples
codeSamplesRevisionDigest: sha256:d3f20480ea1c0bcb8d872ae696b7a8b2c16d1469ee95b6df12b03b7004ce1c9c
codeSamplesRevisionDigest: sha256:73cd7995d2c186ab5098f0824cad26228baf3c6c9e02400959dde933f8b38439
workflow:
workflowVersion: 1.0.0
speakeasyVersion: 1.680.0
speakeasyVersion: 1.787.0
sources:
OpenRouter API:
inputs:
Expand Down
2 changes: 1 addition & 1 deletion .speakeasy/workflow.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
workflowVersion: 1.0.0
speakeasyVersion: 1.680.0
speakeasyVersion: 1.787.0
sources:
OpenRouter API:
inputs:
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ It's also possible to write a standalone Python script without needing to set up
```python
#!/usr/bin/env -S uv run --script
# /// script
# requires-python = ">=3.9"
# requires-python = ">=3.10"
# dependencies = [
# "openrouter",
# ]
Expand Down
14 changes: 14 additions & 0 deletions docs/components/aabenchmarkentry.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
---
title: "AABenchmarkEntry"
---

Artificial Analysis benchmark index scores.


## Fields

| Field | Type | Required | Description | Example |
| -------------------------------------------- | -------------------------------------------- | -------------------------------------------- | -------------------------------------------- | -------------------------------------------- |
| `agentic_index` | *Nullable[float]* | :heavy_check_mark: | Artificial Analysis Agentic Index score | 55.8 |
| `coding_index` | *Nullable[float]* | :heavy_check_mark: | Artificial Analysis Coding Index score | 63.2 |
| `intelligence_index` | *Nullable[float]* | :heavy_check_mark: | Artificial Analysis Intelligence Index score | 71.4 |
24 changes: 24 additions & 0 deletions docs/components/action.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
---
title: "Action"
---

## Supported Types

### `components.OutputWebSearchCallItemActionSearch`

```python
value: components.OutputWebSearchCallItemActionSearch = /* values here */
```

### `components.ActionOpenPage`

```python
value: components.ActionOpenPage = /* values here */
```

### `components.ActionFindInPage`

```python
value: components.ActionFindInPage = /* values here */
```

21 changes: 21 additions & 0 deletions docs/components/actionenum.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
---
title: "ActionEnum"
---

## Example Usage

```python
from openrouter.components import ActionEnum

# Open enum: unrecognized values are captured as UnrecognizedStr
value: ActionEnum = "read"
```


## Values

This is an open enum. Unrecognized values will not fail type checks.

- `"read"`
- `"write"`
- `"delete"`
11 changes: 11 additions & 0 deletions docs/components/actionfindinpage.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
---
title: "ActionFindInPage"
---

## Fields

| Field | Type | Required | Description |
| ------------------------------------------------------------ | ------------------------------------------------------------ | ------------------------------------------------------------ | ------------------------------------------------------------ |
| `pattern` | *str* | :heavy_check_mark: | N/A |
| `type` | [components.TypeFindInPage](../components/typefindinpage.mdx) | :heavy_check_mark: | N/A |
| `url` | *str* | :heavy_check_mark: | N/A |
10 changes: 10 additions & 0 deletions docs/components/actionopenpage.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
---
title: "ActionOpenPage"
---

## Fields

| Field | Type | Required | Description |
| -------------------------------------------------------- | -------------------------------------------------------- | -------------------------------------------------------- | -------------------------------------------------------- |
| `type` | [components.TypeOpenPage](../components/typeopenpage.mdx) | :heavy_check_mark: | N/A |
| `url` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A |
15 changes: 15 additions & 0 deletions docs/components/actiontypesearch.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
---
title: "ActionTypeSearch"
---

## Example Usage

```python
from openrouter.components import ActionTypeSearch
value: ActionTypeSearch = "search"
```


## Values

- `"search"`
18 changes: 0 additions & 18 deletions docs/components/activityitem.md

This file was deleted.

19 changes: 19 additions & 0 deletions docs/components/activityitem.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
---
title: "ActivityItem"
---

## Fields

| Field | Type | Required | Description | Example |
| --------------------------------------------------- | --------------------------------------------------- | --------------------------------------------------- | --------------------------------------------------- | --------------------------------------------------- |
| `byok_usage_inference` | *float* | :heavy_check_mark: | BYOK inference cost in USD (external credits spent) | 0.012 |
| `completion_tokens` | *int* | :heavy_check_mark: | Total completion tokens generated | 125 |
| `date_` | *str* | :heavy_check_mark: | Date of the activity (YYYY-MM-DD format) | 2025-08-24 |
| `endpoint_id` | *str* | :heavy_check_mark: | Unique identifier for the endpoint | 550e8400-e29b-41d4-a716-446655440000 |
| `model` | *str* | :heavy_check_mark: | Model slug (e.g., "openai/gpt-4.1") | openai/gpt-4.1 |
| `model_permaslug` | *str* | :heavy_check_mark: | Model permaslug (e.g., "openai/gpt-4.1-2025-04-14") | openai/gpt-4.1-2025-04-14 |
| `prompt_tokens` | *int* | :heavy_check_mark: | Total prompt tokens used | 50 |
| `provider_name` | *str* | :heavy_check_mark: | Name of the provider serving this endpoint | OpenAI |
| `reasoning_tokens` | *int* | :heavy_check_mark: | Total reasoning tokens used | 25 |
| `requests` | *int* | :heavy_check_mark: | Number of requests made | 5 |
| `usage` | *float* | :heavy_check_mark: | Total cost in USD (OpenRouter credits spent) | 0.015 |
9 changes: 9 additions & 0 deletions docs/components/activityresponse.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
---
title: "ActivityResponse"
---

## Fields

| Field | Type | Required | Description |
| -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- |
| `data` | List[[components.ActivityItem](../components/activityitem.mdx)] | :heavy_check_mark: | List of activity items |
14 changes: 14 additions & 0 deletions docs/components/advisornestedtool.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
---
title: "AdvisorNestedTool"
---

A tool made available to the advisor sub-agent. Only OpenRouter server tools (e.g. openrouter:web_search) are supported; function tools are rejected because the advisor has no way to execute them. The advisor tool may not list itself.


## Fields

| Field | Type | Required | Description | Example |
| ----------------------------------- | ----------------------------------- | ----------------------------------- | ----------------------------------- | ----------------------------------- |
| `parameters` | Dict[str, *Nullable[Any]*] | :heavy_minus_sign: | N/A | |
| `type` | *str* | :heavy_check_mark: | N/A | |
| `__pydantic_extra__` | Dict[str, *Nullable[Any]*] | :heavy_minus_sign: | N/A | \{<br/>"type": "openrouter:web_search"<br/>} |
Loading
Loading