Compare commits

..
Author SHA1 Message Date
speakeasy-github[bot]andspeakeasy-bot fbc76c779e empty commit to trigger [run-tests] workflow 2026-06-22 16:49:21 +00:00
speakeasybot 9454ae7365 ## Python SDK Changes:
* `open_router.benchmarks.get_benchmarks()`: **Added**
* `open_router.datasets.get_benchmarks_artificial_analysis()`: **Deleted** **Breaking** ⚠️
* `open_router.datasets.get_benchmarks_design_arena()`: **Deleted** **Breaking** ⚠️
* `open_router.chat.send()`:  `response` **Changed**
* `open_router.embeddings.generate()`:  `response.usage` **Changed**
* `open_router.embeddings.list_models()`:  `response.data.[].reasoning` **Added**
* `open_router.models.get()`:  `response.data.reasoning` **Added**
* `open_router.models.list()`:  `response.data.[].reasoning` **Added**
* `open_router.models.list_for_user()`:  `response.data.[].reasoning` **Added**
2026-06-22 16:49:03 +00:00
2141 changed files with 16404 additions and 60722 deletions
+1 -3
View File
@@ -1,3 +1 @@
pylintrc
docs/docs.json
docs/overview.mdx
pylintrc
+28 -161
View File
@@ -1,27 +1,11 @@
name: Auto-merge Speakeasy PR
# Called as a follow-up job after Speakeasy Generate (mode: pr). Merges the
# regen PR opened/updated in the same workflow run so sdk_publish.yaml can run.
# Prefer branch_name from Generate logs; fall back to run_started_at heuristics.
# Uses GH_DOCS_SYNC GitHub App token (not a PAT) so merges trigger downstream push.
# Speakeasy mode:pr opens PRs (speakeasy-sdk-regen-*) and labels them
# patch/minor/major. Merge automatically so sdk_publish.yaml can run.
on:
workflow_call:
inputs:
run_started_at:
description: ISO timestamp when the parent Generate workflow run started
required: true
type: string
branch_name:
description: Speakeasy regen branch from the parent Generate run (optional)
required: false
type: string
default: ""
secrets:
GH_DOCS_SYNC_APP_ID:
required: true
GH_DOCS_SYNC_APP_PRIVATE_KEY:
required: true
pull_request:
types: [labeled, opened]
permissions:
contents: write
@@ -33,90 +17,35 @@ concurrency:
jobs:
auto-merge:
if: |
github.event.sender.login == 'github-actions[bot]' &&
github.event.pull_request.user.login == 'github-actions[bot]' &&
startsWith(github.event.pull_request.head.ref, 'speakeasy-sdk-regen-') &&
contains(github.event.pull_request.title, '🐝 Update SDK') &&
(
(github.event.action == 'labeled' && contains(fromJSON('["patch", "minor", "major"]'), github.event.label.name)) ||
(github.event.action == 'opened' &&
(contains(github.event.pull_request.labels.*.name, 'patch') ||
contains(github.event.pull_request.labels.*.name, 'minor') ||
contains(github.event.pull_request.labels.*.name, 'major')))
)
runs-on: ubuntu-latest
steps:
- name: Generate GitHub App token
id: app-token
# actions/create-github-app-token@v3.2.0 (immutable SHA)
uses: actions/create-github-app-token@bcd2ba49218906704ab6c1aa796996da409d3eb1
with:
app-id: ${{ secrets.GH_DOCS_SYNC_APP_ID }}
private-key: ${{ secrets.GH_DOCS_SYNC_APP_PRIVATE_KEY }}
- name: Resolve Speakeasy regen PR
id: pr
- name: Close superseded Speakeasy PRs
env:
GH_TOKEN: ${{ steps.app-token.outputs.token }}
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
set -euo pipefail
CURRENT_PR="${{ github.event.pull_request.number }}"
REPO="${{ github.repository }}"
RUN_STARTED="${{ inputs.run_started_at }}"
BRANCH="${{ inputs.branch_name }}"
PR_JSON=$(gh pr list \
--repo "$REPO" \
PRIOR_JSON=$(gh pr list \
--repo "${{ github.repository }}" \
--state open \
--search "head:speakeasy-sdk-regen-" \
--limit 500 \
--json number,updatedAt,title,labels,author,headRefName)
PR_NUM=""
if [ -n "$BRANCH" ]; then
CANDIDATE=$(echo "$PR_JSON" | jq -r --arg branch "$BRANCH" \
'[.[] | select(.headRefName == $branch)] | .[0] // empty')
if [ -n "$CANDIDATE" ] && echo "$CANDIDATE" | jq -e '
(.headRefName | startswith("speakeasy-sdk-regen-"))
and (.title | contains("🐝 Update SDK"))
and ([.labels[].name] | any(. == "patch" or . == "minor" or . == "major"))
and (.author.is_bot == true)
' > /dev/null; then
PR_NUM=$(echo "$CANDIDATE" | jq -r '.number')
echo "Resolved Speakeasy regen PR #$PR_NUM from branch $BRANCH"
else
echo "::warning::branch_name=$BRANCH did not match a valid open regen PR — falling back to run_started_at"
fi
fi
if [ -z "$PR_NUM" ]; then
PR_NUM=$(echo "$PR_JSON" | jq -r --arg started "$RUN_STARTED" '
[.[]
| select(.headRefName | startswith("speakeasy-sdk-regen-"))
| select(.title | contains("🐝 Update SDK"))
| select([.labels[].name] | any(. == "patch" or . == "minor" or . == "major"))
| select(.author.is_bot == true)
| select(.updatedAt >= $started)
] | sort_by(.updatedAt) | last | .number // empty')
fi
if [ -z "$PR_NUM" ]; then
echo "No Speakeasy regen PR for this Generate run — skipping auto-merge"
echo "::notice title=auto-merge-skipped::No qualifying Speakeasy regen PR to merge"
{
echo "## Auto-merge skipped"
echo "No qualifying \`speakeasy-sdk-regen-*\` PR was found."
echo "- branch_name input: \`${BRANCH:-<empty>}\`"
echo "- run_started_at: \`$RUN_STARTED\`"
} >> "$GITHUB_STEP_SUMMARY"
echo "pr_num=" >> "$GITHUB_OUTPUT"
exit 0
fi
echo "pr_num=$PR_NUM" >> "$GITHUB_OUTPUT"
echo "$PR_JSON" > /tmp/speakeasy_pr_json.json
- name: Close superseded Speakeasy PRs
if: steps.pr.outputs.pr_num != ''
env:
GH_TOKEN: ${{ steps.app-token.outputs.token }}
run: |
set -euo pipefail
CURRENT_PR="${{ steps.pr.outputs.pr_num }}"
PR_JSON=$(cat /tmp/speakeasy_pr_json.json)
PRIOR_JSON=$(echo "$PR_JSON" | jq -r --arg current_pr "$CURRENT_PR" \
'[.[].number | select(tostring != $current_pr)] | .[]')
--json number \
| jq -r --arg cur "$CURRENT_PR" \
'[.[].number | select(tostring != $cur)] | .[]')
if [ -z "$PRIOR_JSON" ]; then
echo "No superseded Speakeasy PRs to close"
@@ -134,92 +63,30 @@ jobs:
done
- name: Auto-merge Speakeasy PR
if: steps.pr.outputs.pr_num != ''
env:
GH_TOKEN: ${{ steps.app-token.outputs.token }}
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
set -euo pipefail
PR_NUM="${{ steps.pr.outputs.pr_num }}"
PR_NUM="${{ github.event.pull_request.number }}"
REPO="${{ github.repository }}"
wait_for_checks() {
local pr=$1
local timeout=600
local interval=15
local elapsed=0
echo "Waiting for PR #$pr checks (timeout ${timeout}s)..."
while [ "$elapsed" -lt "$timeout" ]; do
TOTAL=$(gh pr view "$pr" --repo "$REPO" --json statusCheckRollup --jq \
'.statusCheckRollup | length')
PENDING=$(gh pr view "$pr" --repo "$REPO" --json statusCheckRollup --jq \
'[.statusCheckRollup[]? | select(.status != "COMPLETED")] | length')
FAILED=$(gh pr view "$pr" --repo "$REPO" --json statusCheckRollup --jq \
'[.statusCheckRollup[]? | select(.status == "COMPLETED") | select(.conclusion != "SUCCESS" and .conclusion != "SKIPPED" and .conclusion != "NEUTRAL")] | length')
if [ "$TOTAL" -eq 0 ]; then
# GITHUB_TOKEN-authored regen PRs get no pull_request checks at all,
# so TOTAL stays 0 forever. Wait a short grace window in case checks
# are merely slow to register, then proceed rather than time out.
if [ "$elapsed" -ge 60 ]; then
echo "No checks registered after ${elapsed}s — proceeding (checkless PR)"
return 0
fi
echo "Checks not yet registered — waiting ${interval}s..."
sleep "$interval"
elapsed=$((elapsed + interval))
continue
fi
if [ "$PENDING" -eq 0 ]; then
if [ "$FAILED" -gt 0 ]; then
echo "::error::PR #$pr has failing checks — refusing direct merge"
gh pr checks "$pr" --repo "$REPO" || true
exit 1
fi
echo "All checks completed"
return 0
fi
echo "Checks pending ($PENDING) — waiting ${interval}s..."
sleep "$interval"
elapsed=$((elapsed + interval))
done
echo "::error::Timed out waiting for PR #$pr checks"
exit 1
}
STATE=$(gh pr view "$PR_NUM" --repo "$REPO" --json state --jq .state)
if [ "$STATE" != "OPEN" ]; then
echo "PR #$PR_NUM is $STATE — skipping merge"
exit 0
fi
MERGE_METHOD=""
# Prefer GitHub auto-merge when required checks exist; otherwise
# squash-merge directly after checks pass (sdk-release-prs.yaml pattern).
# squash-merge directly (same pattern as sdk-release-prs.yaml).
AUTO_MERGE_NOOP_PATTERN='is in clean status|protected branch rules|Branch does not have required protected branch rules'
if gh pr merge "$PR_NUM" --repo "$REPO" --squash --auto --delete-branch 2> /tmp/gh-merge.err; then
MERGE_METHOD="auto-merge queued"
echo "Auto-merge enabled for Speakeasy PR #$PR_NUM"
elif grep -qiE "$AUTO_MERGE_NOOP_PATTERN" /tmp/gh-merge.err; then
echo "Auto-merge not applicable — waiting for checks, then merging PR #$PR_NUM directly"
echo "Auto-merge not applicable — merging PR #$PR_NUM directly"
cat /tmp/gh-merge.err >&2
wait_for_checks "$PR_NUM"
gh pr merge "$PR_NUM" --repo "$REPO" --squash --delete-branch
MERGE_METHOD="direct squash (checks passed)"
else
echo "::error::Failed to enable auto-merge on Speakeasy PR #$PR_NUM"
cat /tmp/gh-merge.err >&2
exit 1
fi
echo "::notice title=auto-merge-pr::Merged Speakeasy PR #$PR_NUM ($MERGE_METHOD)"
{
echo "## Auto-merge complete"
echo "- PR: #$PR_NUM"
echo "- Method: $MERGE_METHOD"
echo "- Token: GH_DOCS_SYNC GitHub App"
} >> "$GITHUB_STEP_SUMMARY"
-32
View File
@@ -1,32 +0,0 @@
name: Docs navigation
permissions:
contents: write
pull-requests: write
on:
workflow_dispatch:
pull_request:
paths:
- "docs/sdks/**"
- "scripts/gen-docs-nav.sh"
- ".github/workflows/docs-nav.yaml"
jobs:
gen-docs-nav:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v5
with:
ref: ${{ github.event.pull_request.head.ref }}
token: ${{ secrets.GITHUB_TOKEN }}
# jq is preinstalled on GitHub-hosted ubuntu runners.
- name: Regenerate docs navigation
run: scripts/gen-docs-nav.sh
- name: Auto-commit docs.json navigation
uses: int128/update-generated-files-action@v2
with:
commit-message: "Chore: regenerate docs navigation"
-37
View File
@@ -1,37 +0,0 @@
name: PR Validation
on:
pull_request:
paths-ignore:
- .speakeasy/in.openapi.yaml
concurrency:
group: pr-validation-${{ github.event.pull_request.number }}
cancel-in-progress: true
permissions:
contents: read
jobs:
validate:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v5
- name: Install uv
uses: astral-sh/setup-uv@v5
with:
enable-cache: true
- name: Build SDK
run: uv build
- name: Type check (mypy)
run: uv run --group dev mypy src
- name: Type check (pyright)
run: uv run --group dev pyright src
- name: Lint (pylint)
run: uv run --group dev pylint src --rcfile pylintrc
-69
View File
@@ -21,11 +21,6 @@ permissions:
types:
- labeled
- unlabeled
concurrency:
group: speakeasy-generate
cancel-in-progress: false
jobs:
generate:
uses: speakeasy-api/sdk-generation-action/.github/workflows/workflow-executor.yaml@v15
@@ -37,67 +32,3 @@ jobs:
github_access_token: ${{ secrets.GITHUB_TOKEN }}
pypi_token: ${{ secrets.PYPI_TOKEN }}
speakeasy_api_key: ${{ secrets.SPEAKEASY_API_KEY }}
resolve-branch:
needs: generate
if: ${{ !cancelled() && needs.generate.result == 'success' }}
runs-on: ubuntu-latest
outputs:
branch_name: ${{ steps.branch.outputs.branch_name }}
run_started_at: ${{ steps.branch.outputs.run_started_at }}
steps:
- name: Extract branch from Generate logs
id: branch
env:
GH_TOKEN: ${{ github.token }}
run: |
set -euo pipefail
REPO="${{ github.repository }}"
RUN_ID="${{ github.run_id }}"
RUN_STARTED="${{ github.run_started_at }}"
if [ -z "$RUN_STARTED" ]; then
RUN_STARTED=$(gh run view "$RUN_ID" --repo "$REPO" --json startedAt --jq '.startedAt')
echo "Resolved run_started_at from API: $RUN_STARTED"
fi
echo "run_started_at=$RUN_STARTED" >> "$GITHUB_OUTPUT"
# Full-run logs are unavailable while the workflow is in progress;
# fetch logs from the completed generate job instead.
JOB_ID=$(gh run view "$RUN_ID" --repo "$REPO" --json jobs --jq \
'[.jobs[] | select(.name == "generate / Generate Target")] | .[0].databaseId // empty')
BRANCH=""
if [ -z "$JOB_ID" ]; then
echo "::warning::Could not find generate job id — auto-merge will use run_started_at fallback"
else
MAX_ATTEMPTS=12
INTERVAL=10
for attempt in $(seq 1 "$MAX_ATTEMPTS"); do
BRANCH=$(gh run view "$RUN_ID" --repo "$REPO" --job "$JOB_ID" --log 2>/dev/null \
| grep -oE 'branch_name=speakeasy-sdk-regen-[0-9]+' | tail -1 | cut -d= -f2 || true)
if [ -n "$BRANCH" ]; then
echo "Extracted branch_name=$BRANCH (attempt $attempt)"
break
fi
if [ "$attempt" -lt "$MAX_ATTEMPTS" ]; then
echo "Job logs not ready — waiting ${INTERVAL}s (attempt $attempt/$MAX_ATTEMPTS)..."
sleep "$INTERVAL"
fi
done
if [ -z "$BRANCH" ]; then
echo "::warning::Could not extract branch_name from Generate logs after ${MAX_ATTEMPTS} attempts — auto-merge will use run_started_at fallback"
fi
fi
echo "branch_name=$BRANCH" >> "$GITHUB_OUTPUT"
auto-merge:
needs: [generate, resolve-branch]
if: ${{ !cancelled() && needs.generate.result == 'success' }}
uses: ./.github/workflows/auto-merge-speakeasy-pr.yaml
with:
run_started_at: ${{ needs.resolve-branch.outputs.run_started_at }}
branch_name: ${{ needs.resolve-branch.outputs.branch_name }}
secrets:
GH_DOCS_SYNC_APP_ID: ${{ secrets.GH_DOCS_SYNC_APP_ID }}
GH_DOCS_SYNC_APP_PRIVATE_KEY: ${{ secrets.GH_DOCS_SYNC_APP_PRIVATE_KEY }}
@@ -22,10 +22,6 @@ permissions:
paths:
- .speakeasy/in.openapi.yaml
concurrency:
group: speakeasy-generate-spec-change
cancel-in-progress: false
jobs:
generate:
if: github.event.pull_request.merged == true || github.event_name == 'workflow_dispatch'
@@ -38,67 +34,3 @@ jobs:
github_access_token: ${{ secrets.GITHUB_TOKEN }}
pypi_token: ${{ secrets.PYPI_TOKEN }}
speakeasy_api_key: ${{ secrets.SPEAKEASY_API_KEY }}
resolve-branch:
needs: generate
if: ${{ !cancelled() && needs.generate.result == 'success' }}
runs-on: ubuntu-latest
outputs:
branch_name: ${{ steps.branch.outputs.branch_name }}
run_started_at: ${{ steps.branch.outputs.run_started_at }}
steps:
- name: Extract branch from Generate logs
id: branch
env:
GH_TOKEN: ${{ github.token }}
run: |
set -euo pipefail
REPO="${{ github.repository }}"
RUN_ID="${{ github.run_id }}"
RUN_STARTED="${{ github.run_started_at }}"
if [ -z "$RUN_STARTED" ]; then
RUN_STARTED=$(gh run view "$RUN_ID" --repo "$REPO" --json startedAt --jq '.startedAt')
echo "Resolved run_started_at from API: $RUN_STARTED"
fi
echo "run_started_at=$RUN_STARTED" >> "$GITHUB_OUTPUT"
# Full-run logs are unavailable while the workflow is in progress;
# fetch logs from the completed generate job instead.
JOB_ID=$(gh run view "$RUN_ID" --repo "$REPO" --json jobs --jq \
'[.jobs[] | select(.name == "generate / Generate Target")] | .[0].databaseId // empty')
BRANCH=""
if [ -z "$JOB_ID" ]; then
echo "::warning::Could not find generate job id — auto-merge will use run_started_at fallback"
else
MAX_ATTEMPTS=12
INTERVAL=10
for attempt in $(seq 1 "$MAX_ATTEMPTS"); do
BRANCH=$(gh run view "$RUN_ID" --repo "$REPO" --job "$JOB_ID" --log 2>/dev/null \
| grep -oE 'branch_name=speakeasy-sdk-regen-[0-9]+' | tail -1 | cut -d= -f2 || true)
if [ -n "$BRANCH" ]; then
echo "Extracted branch_name=$BRANCH (attempt $attempt)"
break
fi
if [ "$attempt" -lt "$MAX_ATTEMPTS" ]; then
echo "Job logs not ready — waiting ${INTERVAL}s (attempt $attempt/$MAX_ATTEMPTS)..."
sleep "$INTERVAL"
fi
done
if [ -z "$BRANCH" ]; then
echo "::warning::Could not extract branch_name from Generate logs after ${MAX_ATTEMPTS} attempts — auto-merge will use run_started_at fallback"
fi
fi
echo "branch_name=$BRANCH" >> "$GITHUB_OUTPUT"
auto-merge:
needs: [generate, resolve-branch]
if: ${{ !cancelled() && needs.generate.result == 'success' }}
uses: ./.github/workflows/auto-merge-speakeasy-pr.yaml
with:
run_started_at: ${{ needs.resolve-branch.outputs.run_started_at }}
branch_name: ${{ needs.resolve-branch.outputs.branch_name }}
secrets:
GH_DOCS_SYNC_APP_ID: ${{ secrets.GH_DOCS_SYNC_APP_ID }}
GH_DOCS_SYNC_APP_PRIVATE_KEY: ${{ secrets.GH_DOCS_SYNC_APP_PRIVATE_KEY }}
+1
View File
@@ -16,6 +16,7 @@ __pycache__/
# Speakeasy generation artifacts (generated in OSS repo, not here)
.speakeasy/*.lock
.speakeasy/*.openapi.yaml
/docs
# Environment
.env
.env.local
+6832 -7414
View File
File diff suppressed because it is too large Load Diff
+1 -19
View File
@@ -16,8 +16,6 @@ generation:
requestResponseComponentNamesFeb2024: true
securityFeb2025: true
sharedErrorComponentsApr2025: true
sharedNestedComponentsJan2026: false
nameOverrideFeb2026: false
auth:
oAuth2ClientCredentialsEnabled: true
oAuth2PasswordEnabled: true
@@ -27,16 +25,14 @@ generation:
schemas:
allOfMergeStrategy: shallowMerge
requestBodyFieldName: ""
versioningStrategy: automatic
persistentEdits: {}
tests:
generateTests: false
generateNewTests: true
skipResponseBodyAssertions: false
documentation: mintlify
preApplyUnionDiscriminators: true
python:
version: 0.11.3
version: 0.10.1
additionalDependencies:
dev: {}
main: {}
@@ -50,7 +46,6 @@ python:
authors:
- OpenRouter
baseErrorName: OpenRouterError
bodyVariantOverloads: false
clientServerStatusCodesAsErrors: true
constFieldCasing: upper
defaultErrorName: OpenRouterDefaultError
@@ -58,18 +53,12 @@ python:
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
@@ -82,25 +71,18 @@ 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
+127 -1808
View File
File diff suppressed because it is too large Load Diff
+123 -1787
View File
File diff suppressed because it is too large Load Diff
+8 -7
View File
@@ -1,23 +1,24 @@
speakeasyVersion: 1.787.0
speakeasyVersion: 1.680.0
sources:
OpenRouter API:
sourceNamespace: open-router-chat-completions-api
sourceRevisionDigest: sha256:5381277309ba2f3a4a3e0719b00425be3f93c3103717316e6625bd5caf15b277
sourceBlobDigest: sha256:def8d29511aca594e11c3367b7013a64c8733cc8050e23deae98d9cc5df55c93
sourceRevisionDigest: sha256:e723fd6d93d1675f10180ae0294e31a5f58f3492260b2afb840c9d21afe73fa5
sourceBlobDigest: sha256:e0cae9ca4d8bd6326bf2af1bc0b1444b9819a634698e848acf6831bcd7391c36
tags:
- latest
- speakeasy-sdk-regen-1782146304
- 1.0.0
targets:
open-router:
source: OpenRouter API
sourceNamespace: open-router-chat-completions-api
sourceRevisionDigest: sha256:5381277309ba2f3a4a3e0719b00425be3f93c3103717316e6625bd5caf15b277
sourceBlobDigest: sha256:def8d29511aca594e11c3367b7013a64c8733cc8050e23deae98d9cc5df55c93
sourceRevisionDigest: sha256:e723fd6d93d1675f10180ae0294e31a5f58f3492260b2afb840c9d21afe73fa5
sourceBlobDigest: sha256:e0cae9ca4d8bd6326bf2af1bc0b1444b9819a634698e848acf6831bcd7391c36
codeSamplesNamespace: open-router-python-code-samples
codeSamplesRevisionDigest: sha256:18d6fc594c9338480cbc65842c3f276ad0a58f2ceda311aff3d70ea33dbd6e6d
codeSamplesRevisionDigest: sha256:18d9a2a331754321fc8bb0067e344794777799ec325b28bdd67548c0d0f3bbe1
workflow:
workflowVersion: 1.0.0
speakeasyVersion: 1.787.0
speakeasyVersion: 1.680.0
sources:
OpenRouter API:
inputs:
+1 -1
View File
@@ -1,5 +1,5 @@
workflowVersion: 1.0.0
speakeasyVersion: 1.787.0
speakeasyVersion: 1.680.0
sources:
OpenRouter API:
inputs:
+1 -1
View File
@@ -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.10"
# requires-python = ">=3.9"
# dependencies = [
# "openrouter",
# ]
+1 -1
View File
@@ -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.10"
# requires-python = ">=3.9"
# dependencies = [
# "openrouter",
# ]
+2 -102
View File
@@ -30,7 +30,7 @@ Based on:
### Releases
- [PyPI v0.10.0] https://pypi.org/project/openrouter/0.10.0 - .
## 2026-06-25 21:56:51
## 2026-06-22 16:46:58
### Changes
Based on:
- OpenAPI Doc
@@ -38,104 +38,4 @@ Based on:
### Generated
- [python v0.10.1] .
### Releases
- [PyPI v0.10.1] https://pypi.org/project/openrouter/0.10.1 - .
## 2026-06-25 22:28:38
### Changes
Based on:
- OpenAPI Doc
- Speakeasy CLI 1.680.0 (2.788.4) https://github.com/speakeasy-api/speakeasy
### Generated
- [python v0.10.2] .
### Releases
- [PyPI v0.10.2] https://pypi.org/project/openrouter/0.10.2 - .
## 2026-06-26 00:15:50
### Changes
Based on:
- OpenAPI Doc
- Speakeasy CLI 1.680.0 (2.788.4) https://github.com/speakeasy-api/speakeasy
### Generated
- [python v0.10.3] .
### Releases
- [PyPI v0.10.3] https://pypi.org/project/openrouter/0.10.3 - .
## 2026-06-26 12:06:01
### Changes
Based on:
- OpenAPI Doc
- Speakeasy CLI 1.680.0 (2.788.4) https://github.com/speakeasy-api/speakeasy
### Generated
- [python v0.10.4] .
### Releases
- [PyPI v0.10.4] https://pypi.org/project/openrouter/0.10.4 - .
## 2026-06-26 14:36:56
### Changes
Based on:
- OpenAPI Doc
- Speakeasy CLI 1.680.0 (2.788.4) https://github.com/speakeasy-api/speakeasy
### Generated
- [python v0.10.5] .
### Releases
- [PyPI v0.10.5] https://pypi.org/project/openrouter/0.10.5 - .
## 2026-06-26 18:19:11
### Changes
Based on:
- OpenAPI Doc
- Speakeasy CLI 1.680.0 (2.788.4) https://github.com/speakeasy-api/speakeasy
### Generated
- [python v0.10.6] .
### Releases
- [PyPI v0.10.6] https://pypi.org/project/openrouter/0.10.6 - .
## 2026-06-26 23:43:40
### Changes
Based on:
- OpenAPI Doc
- Speakeasy CLI 1.680.0 (2.788.4) https://github.com/speakeasy-api/speakeasy
### Generated
- [python v0.10.7] .
### Releases
- [PyPI v0.10.7] https://pypi.org/project/openrouter/0.10.7 - .
## 2026-06-28 15:27:21
### Changes
Based on:
- OpenAPI Doc
- Speakeasy CLI 1.680.0 (2.788.4) https://github.com/speakeasy-api/speakeasy
### Generated
- [python v0.10.8] .
### Releases
- [PyPI v0.10.8] https://pypi.org/project/openrouter/0.10.8 - .
## 2026-07-01 16:13:11
### Changes
Based on:
- OpenAPI Doc
- Speakeasy CLI 1.787.0 (2.914.0) https://github.com/speakeasy-api/speakeasy
### Generated
- [python v0.11.1] .
### Releases
- [PyPI v0.11.1] https://pypi.org/project/openrouter/0.11.1 - .
## 2026-07-03 15:05:16
### Changes
Based on:
- OpenAPI Doc
- Speakeasy CLI 1.787.0 (2.914.0) https://github.com/speakeasy-api/speakeasy
### Generated
- [python v0.11.2] .
### Releases
- [PyPI v0.11.2] https://pypi.org/project/openrouter/0.11.2 - .
## 2026-07-03 19:54:08
### Changes
Based on:
- OpenAPI Doc
- Speakeasy CLI 1.787.0 (2.914.0) https://github.com/speakeasy-api/speakeasy
### Generated
- [python v0.11.3] .
### Releases
- [PyPI v0.11.3] https://pypi.org/project/openrouter/0.11.3 - .
- [PyPI v0.10.1] https://pypi.org/project/openrouter/0.10.1 - .
-14
View File
@@ -1,14 +0,0 @@
---
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
View File
@@ -1,24 +0,0 @@
---
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
View File
@@ -1,21 +0,0 @@
---
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
View File
@@ -1,11 +0,0 @@
---
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
View File
@@ -1,10 +0,0 @@
---
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
View File
@@ -1,15 +0,0 @@
---
title: "ActionTypeSearch"
---
## Example Usage
```python
from openrouter.components import ActionTypeSearch
value: ActionTypeSearch = "search"
```
## Values
- `"search"`
@@ -1,6 +1,5 @@
---
title: "ActivityItem"
---
# ActivityItem
## Fields
-9
View File
@@ -1,9 +0,0 @@
---
title: "ActivityResponse"
---
## Fields
| Field | Type | Required | Description |
| -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- |
| `data` | List[[components.ActivityItem](../components/activityitem.mdx)] | :heavy_check_mark: | List of activity items |
-14
View File
@@ -1,14 +0,0 @@
---
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/>} |
-13
View File
@@ -1,13 +0,0 @@
---
title: "AdvisorReasoning"
---
Reasoning configuration forwarded to the advisor call. Use this to control reasoning effort and token budget for models that support extended thinking.
## Fields
| Field | Type | Required | Description |
| -------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------- |
| `effort` | [Optional[components.AdvisorReasoningEffort]](../components/advisorreasoningeffort.mdx) | :heavy_minus_sign: | Reasoning effort level for the advisor call. |
| `max_tokens` | *Optional[int]* | :heavy_minus_sign: | Maximum number of reasoning tokens the advisor may use. |
@@ -1,27 +0,0 @@
---
title: "AdvisorReasoningEffort"
---
Reasoning effort level for the advisor call.
## Example Usage
```python
from openrouter.components import AdvisorReasoningEffort
# Open enum: unrecognized values are captured as UnrecognizedStr
value: AdvisorReasoningEffort = "max"
```
## Values
This is an open enum. Unrecognized values will not fail type checks.
- `"max"`
- `"xhigh"`
- `"high"`
- `"medium"`
- `"low"`
- `"minimal"`
- `"none"`
@@ -1,21 +0,0 @@
---
title: "AdvisorServerToolConfig"
---
Configuration for one openrouter:advisor server tool entry.
## Fields
| Field | Type | Required | Description | Example |
| -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `forward_transcript` | *Optional[bool]* | :heavy_minus_sign: | When true, the full parent conversation is forwarded to the advisor so it sees the same context the executor does (and the tool-call `prompt`, if given, is appended as a final user turn). When false or omitted, the advisor receives only the `prompt` the executor passes in the tool call. | false |
| `instructions` | *Optional[str]* | :heavy_minus_sign: | System instructions for the advisor sub-agent. When omitted, the advisor responds with no system prompt of its own. | You are a senior staff engineer. Give a focused, decisive plan. |
| `max_completion_tokens` | *Optional[int]* | :heavy_minus_sign: | Maximum number of output tokens (including reasoning) the advisor may produce. When omitted, the provider's default applies. | 2048 |
| `max_tool_calls` | *Optional[int]* | :heavy_minus_sign: | Maximum number of tool-calling steps the advisor sub-agent may take during its agentic loop. Capped at 25. Only relevant when the advisor is given tools. | 5 |
| `model` | *Optional[str]* | :heavy_minus_sign: | Slug of the advisor model to consult (any OpenRouter model). When omitted, the executor can choose it via the tool call's `model` argument; if neither is set, the model from the outer API request is used. The advisor tool itself cannot be the advisor model. | ~anthropic/claude-opus-latest |
| `name` | *Optional[str]* | :heavy_minus_sign: | Optional name for this advisor. The model sees one tool per named advisor (and one default for an unnamed entry). Names must be unique across advisor entries. Letters, digits, spaces, underscores, and dashes; trimmed; 164 chars. | reviewer |
| `reasoning` | [Optional[components.AdvisorReasoning]](../components/advisorreasoning.mdx) | :heavy_minus_sign: | Reasoning configuration forwarded to the advisor call. Use this to control reasoning effort and token budget for models that support extended thinking. | \{<br/>"effort": "high"<br/>} |
| `stream` | *Optional[bool]* | :heavy_minus_sign: | When true, the advisor's advice streams incrementally as it is produced. In the Responses API this emits `response.output_text.delta` events targeting the advisor output item; the final `advice` field is still set on the completed item. Has no effect on the Chat Completions API (where the advice arrives only as the final tool result). When false or omitted, the advice arrives only as the final result. | false |
| `temperature` | *Optional[float]* | :heavy_minus_sign: | Sampling temperature forwarded to the advisor call. When omitted, the provider's default applies. | 0.7 |
| `tools` | List[[components.AdvisorNestedTool](../components/advisornestedtool.mdx)] | :heavy_minus_sign: | Tools the advisor sub-agent may use while forming its advice. The advisor runs as an agentic sub-agent over these tools, then returns its text. Only OpenRouter server tools are supported — function tools are rejected — and the list must not include the advisor tool itself. | |
@@ -1,13 +0,0 @@
---
title: "AdvisorServerToolOpenRouter"
---
OpenRouter built-in server tool: consults a higher-intelligence advisor model (any OpenRouter model) for guidance mid-generation and returns its response. The advisor may run as a sub-agent with its own tools. Include multiple entries to offer several named advisors; at most one entry may omit `name` to act as the default advisor.
## Fields
| Field | Type | Required | Description | Example |
| ---------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------- |
| `parameters` | [Optional[components.AdvisorServerToolConfig]](../components/advisorservertoolconfig.mdx) | :heavy_minus_sign: | Configuration for one openrouter:advisor server tool entry. | \{<br/>"model": "~anthropic/claude-opus-latest",<br/>"name": "reviewer"<br/>} |
| `type` | [components.AdvisorServerToolOpenRouterType](../components/advisorservertoolopenroutertype.mdx) | :heavy_check_mark: | N/A | |
@@ -1,15 +0,0 @@
---
title: "AdvisorServerToolOpenRouterType"
---
## Example Usage
```python
from openrouter.components import AdvisorServerToolOpenRouterType
value: AdvisorServerToolOpenRouterType = "openrouter:advisor"
```
## Values
- `"openrouter:advisor"`
-10
View File
@@ -1,10 +0,0 @@
---
title: "AllowedTools"
---
## Fields
| Field | Type | Required | Description |
| ------------------ | ------------------ | ------------------ | ------------------ |
| `read_only` | *Optional[bool]* | :heavy_minus_sign: | N/A |
| `tool_names` | List[*str*] | :heavy_minus_sign: | N/A |
-24
View File
@@ -1,24 +0,0 @@
---
title: "AllowedToolsUnion"
---
## Supported Types
### `List[str]`
```python
value: List[str] = /* values here */
```
### `components.AllowedTools`
```python
value: components.AllowedTools = /* values here */
```
### `Any`
```python
value: Any = /* values here */
```
-9
View File
@@ -1,9 +0,0 @@
---
title: "Always"
---
## Fields
| Field | Type | Required | Description |
| ------------------ | ------------------ | ------------------ | ------------------ |
| `tool_names` | List[*str*] | :heavy_minus_sign: | N/A |
-18
View File
@@ -1,18 +0,0 @@
---
title: "AnnotationAddedEvent"
---
Event emitted when a text annotation is added to output
## Fields
| Field | Type | Required | Description | Example |
| --------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------- |
| `annotation` | [components.OpenAIResponsesAnnotation](../components/openairesponsesannotation.mdx) | :heavy_check_mark: | N/A | \{<br/>"file_id": "file-abc123",<br/>"filename": "research_paper.pdf",<br/>"index": 0,<br/>"type": "file_citation"<br/>} |
| `annotation_index` | *int* | :heavy_check_mark: | N/A | |
| `content_index` | *int* | :heavy_check_mark: | N/A | |
| `item_id` | *str* | :heavy_check_mark: | N/A | |
| `output_index` | *int* | :heavy_check_mark: | N/A | |
| `sequence_number` | *int* | :heavy_check_mark: | N/A | |
| `type` | [components.AnnotationAddedEventType](../components/annotationaddedeventtype.mdx) | :heavy_check_mark: | N/A | |
@@ -1,15 +0,0 @@
---
title: "AnnotationAddedEventType"
---
## Example Usage
```python
from openrouter.components import AnnotationAddedEventType
value: AnnotationAddedEventType = "response.output_text.annotation.added"
```
## Values
- `"response.output_text.annotation.added"`
@@ -1,15 +0,0 @@
---
title: "AnthropicAdvisorMessageUsageIteration"
---
## Fields
| Field | Type | Required | Description | Example |
| ------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------ |
| `cache_creation` | [OptionalNullable[components.AnthropicIterationCacheCreation]](../components/anthropiciterationcachecreation.mdx) | :heavy_minus_sign: | N/A | \{<br/>"ephemeral_1h_input_tokens": 0,<br/>"ephemeral_5m_input_tokens": 0<br/>} |
| `cache_creation_input_tokens` | *Optional[int]* | :heavy_minus_sign: | N/A | |
| `cache_read_input_tokens` | *Optional[int]* | :heavy_minus_sign: | N/A | |
| `input_tokens` | *Optional[int]* | :heavy_minus_sign: | N/A | |
| `output_tokens` | *Optional[int]* | :heavy_minus_sign: | N/A | |
| `model` | *str* | :heavy_check_mark: | N/A | |
| `type` | [components.AnthropicAdvisorMessageUsageIterationType](../components/anthropicadvisormessageusageiterationtype.mdx) | :heavy_check_mark: | N/A | |
@@ -1,15 +0,0 @@
---
title: "AnthropicAdvisorMessageUsageIterationType"
---
## Example Usage
```python
from openrouter.components import AnthropicAdvisorMessageUsageIterationType
value: AnthropicAdvisorMessageUsageIterationType = "advisor_message"
```
## Values
- `"advisor_message"`
@@ -1,21 +0,0 @@
---
title: "AnthropicAllowedCallers"
---
## Example Usage
```python
from openrouter.components import AnthropicAllowedCallers
# Open enum: unrecognized values are captured as UnrecognizedStr
value: AnthropicAllowedCallers = "direct"
```
## Values
This is an open enum. Unrecognized values will not fail type checks.
- `"direct"`
- `"code_execution_20250825"`
- `"code_execution_20260120"`
@@ -1,11 +0,0 @@
---
title: "AnthropicBase64ImageSource"
---
## Fields
| Field | Type | Required | Description | Example |
| -------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------- |
| `data` | *str* | :heavy_check_mark: | N/A | |
| `media_type` | [components.AnthropicImageMimeType](../components/anthropicimagemimetype.mdx) | :heavy_check_mark: | N/A | image/jpeg |
| `type` | [components.AnthropicBase64ImageSourceType](../components/anthropicbase64imagesourcetype.mdx) | :heavy_check_mark: | N/A | |
@@ -1,15 +0,0 @@
---
title: "AnthropicBase64ImageSourceType"
---
## Example Usage
```python
from openrouter.components import AnthropicBase64ImageSourceType
value: AnthropicBase64ImageSourceType = "base64"
```
## Values
- `"base64"`
@@ -1,11 +0,0 @@
---
title: "AnthropicBase64PdfSource"
---
## Fields
| Field | Type | Required | Description |
| -------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------- |
| `data` | *str* | :heavy_check_mark: | N/A |
| `media_type` | [components.AnthropicBase64PdfSourceMediaType](../components/anthropicbase64pdfsourcemediatype.mdx) | :heavy_check_mark: | N/A |
| `type` | [components.AnthropicBase64PdfSourceType](../components/anthropicbase64pdfsourcetype.mdx) | :heavy_check_mark: | N/A |
@@ -1,15 +0,0 @@
---
title: "AnthropicBase64PdfSourceMediaType"
---
## Example Usage
```python
from openrouter.components import AnthropicBase64PdfSourceMediaType
value: AnthropicBase64PdfSourceMediaType = "application/pdf"
```
## Values
- `"application/pdf"`
@@ -1,15 +0,0 @@
---
title: "AnthropicBase64PdfSourceType"
---
## Example Usage
```python
from openrouter.components import AnthropicBase64PdfSourceType
value: AnthropicBase64PdfSourceType = "base64"
```
## Values
- `"base64"`
@@ -1,13 +0,0 @@
---
title: "AnthropicCacheControlDirective"
---
Enable automatic prompt caching. When set at the top level, the system automatically applies cache breakpoints to the last cacheable block in the request. Currently supported for Anthropic Claude models.
## Fields
| Field | Type | Required | Description | Example |
| ---------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------- |
| `ttl` | [Optional[components.AnthropicCacheControlTTL]](../components/anthropiccachecontrolttl.mdx) | :heavy_minus_sign: | N/A | 5m |
| `type` | [components.AnthropicCacheControlDirectiveType](../components/anthropiccachecontroldirectivetype.mdx) | :heavy_check_mark: | N/A | |
@@ -1,15 +0,0 @@
---
title: "AnthropicCacheControlDirectiveType"
---
## Example Usage
```python
from openrouter.components import AnthropicCacheControlDirectiveType
value: AnthropicCacheControlDirectiveType = "ephemeral"
```
## Values
- `"ephemeral"`
@@ -1,20 +0,0 @@
---
title: "AnthropicCacheControlTTL"
---
## Example Usage
```python
from openrouter.components import AnthropicCacheControlTTL
# Open enum: unrecognized values are captured as UnrecognizedStr
value: AnthropicCacheControlTTL = "5m"
```
## Values
This is an open enum. Unrecognized values will not fail type checks.
- `"5m"`
- `"1h"`
@@ -1,14 +0,0 @@
---
title: "AnthropicCitationCharLocationParam"
---
## Fields
| Field | Type | Required | Description |
| ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ |
| `cited_text` | *str* | :heavy_check_mark: | N/A |
| `document_index` | *int* | :heavy_check_mark: | N/A |
| `document_title` | *Nullable[str]* | :heavy_check_mark: | N/A |
| `end_char_index` | *int* | :heavy_check_mark: | N/A |
| `start_char_index` | *int* | :heavy_check_mark: | N/A |
| `type` | [components.AnthropicCitationCharLocationParamType](../components/anthropiccitationcharlocationparamtype.mdx) | :heavy_check_mark: | N/A |
@@ -1,15 +0,0 @@
---
title: "AnthropicCitationCharLocationParamType"
---
## Example Usage
```python
from openrouter.components import AnthropicCitationCharLocationParamType
value: AnthropicCitationCharLocationParamType = "char_location"
```
## Values
- `"char_location"`
@@ -1,14 +0,0 @@
---
title: "AnthropicCitationContentBlockLocationParam"
---
## Fields
| Field | Type | Required | Description |
| ---------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------- |
| `cited_text` | *str* | :heavy_check_mark: | N/A |
| `document_index` | *int* | :heavy_check_mark: | N/A |
| `document_title` | *Nullable[str]* | :heavy_check_mark: | N/A |
| `end_block_index` | *int* | :heavy_check_mark: | N/A |
| `start_block_index` | *int* | :heavy_check_mark: | N/A |
| `type` | [components.AnthropicCitationContentBlockLocationParamType](../components/anthropiccitationcontentblocklocationparamtype.mdx) | :heavy_check_mark: | N/A |
@@ -1,15 +0,0 @@
---
title: "AnthropicCitationContentBlockLocationParamType"
---
## Example Usage
```python
from openrouter.components import AnthropicCitationContentBlockLocationParamType
value: AnthropicCitationContentBlockLocationParamType = "content_block_location"
```
## Values
- `"content_block_location"`
@@ -1,14 +0,0 @@
---
title: "AnthropicCitationPageLocationParam"
---
## Fields
| Field | Type | Required | Description |
| ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ |
| `cited_text` | *str* | :heavy_check_mark: | N/A |
| `document_index` | *int* | :heavy_check_mark: | N/A |
| `document_title` | *Nullable[str]* | :heavy_check_mark: | N/A |
| `end_page_number` | *int* | :heavy_check_mark: | N/A |
| `start_page_number` | *int* | :heavy_check_mark: | N/A |
| `type` | [components.AnthropicCitationPageLocationParamType](../components/anthropiccitationpagelocationparamtype.mdx) | :heavy_check_mark: | N/A |
@@ -1,15 +0,0 @@
---
title: "AnthropicCitationPageLocationParamType"
---
## Example Usage
```python
from openrouter.components import AnthropicCitationPageLocationParamType
value: AnthropicCitationPageLocationParamType = "page_location"
```
## Values
- `"page_location"`
@@ -1,15 +0,0 @@
---
title: "AnthropicCitationSearchResultLocation"
---
## Fields
| Field | Type | Required | Description |
| ------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------ |
| `cited_text` | *str* | :heavy_check_mark: | N/A |
| `end_block_index` | *int* | :heavy_check_mark: | N/A |
| `search_result_index` | *int* | :heavy_check_mark: | N/A |
| `source` | *str* | :heavy_check_mark: | N/A |
| `start_block_index` | *int* | :heavy_check_mark: | N/A |
| `title` | *Nullable[str]* | :heavy_check_mark: | N/A |
| `type` | [components.AnthropicCitationSearchResultLocationType](../components/anthropiccitationsearchresultlocationtype.mdx) | :heavy_check_mark: | N/A |
@@ -1,15 +0,0 @@
---
title: "AnthropicCitationSearchResultLocationType"
---
## Example Usage
```python
from openrouter.components import AnthropicCitationSearchResultLocationType
value: AnthropicCitationSearchResultLocationType = "search_result_location"
```
## Values
- `"search_result_location"`
@@ -1,13 +0,0 @@
---
title: "AnthropicCitationWebSearchResultLocation"
---
## Fields
| Field | Type | Required | Description |
| ------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------ |
| `cited_text` | *str* | :heavy_check_mark: | N/A |
| `encrypted_index` | *str* | :heavy_check_mark: | N/A |
| `title` | *Nullable[str]* | :heavy_check_mark: | N/A |
| `type` | [components.AnthropicCitationWebSearchResultLocationType](../components/anthropiccitationwebsearchresultlocationtype.mdx) | :heavy_check_mark: | N/A |
| `url` | *str* | :heavy_check_mark: | N/A |
@@ -1,15 +0,0 @@
---
title: "AnthropicCitationWebSearchResultLocationType"
---
## Example Usage
```python
from openrouter.components import AnthropicCitationWebSearchResultLocationType
value: AnthropicCitationWebSearchResultLocationType = "web_search_result_location"
```
## Values
- `"web_search_result_location"`
@@ -1,14 +0,0 @@
---
title: "AnthropicCompactionUsageIteration"
---
## Fields
| Field | Type | Required | Description | Example |
| ---------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------- |
| `cache_creation` | [OptionalNullable[components.AnthropicIterationCacheCreation]](../components/anthropiciterationcachecreation.mdx) | :heavy_minus_sign: | N/A | \{<br/>"ephemeral_1h_input_tokens": 0,<br/>"ephemeral_5m_input_tokens": 0<br/>} |
| `cache_creation_input_tokens` | *Optional[int]* | :heavy_minus_sign: | N/A | |
| `cache_read_input_tokens` | *Optional[int]* | :heavy_minus_sign: | N/A | |
| `input_tokens` | *Optional[int]* | :heavy_minus_sign: | N/A | |
| `output_tokens` | *Optional[int]* | :heavy_minus_sign: | N/A | |
| `type` | [components.AnthropicCompactionUsageIterationType](../components/anthropiccompactionusageiterationtype.mdx) | :heavy_check_mark: | N/A | |
@@ -1,15 +0,0 @@
---
title: "AnthropicCompactionUsageIterationType"
---
## Example Usage
```python
from openrouter.components import AnthropicCompactionUsageIterationType
value: AnthropicCompactionUsageIterationType = "compaction"
```
## Values
- `"compaction"`
@@ -1,14 +0,0 @@
---
title: "AnthropicDocumentBlockParam"
---
## Fields
| Field | Type | Required | Description | Example |
| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `cache_control` | [Optional[components.AnthropicCacheControlDirective]](../components/anthropiccachecontroldirective.mdx) | :heavy_minus_sign: | Enable automatic prompt caching. When set at the top level, the system automatically applies cache breakpoints to the last cacheable block in the request. Currently supported for Anthropic Claude models. | \{<br/>"type": "ephemeral"<br/>} |
| `citations` | [OptionalNullable[components.AnthropicDocumentBlockParamCitations]](../components/anthropicdocumentblockparamcitations.mdx) | :heavy_minus_sign: | N/A | |
| `context` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | |
| `source` | [components.AnthropicDocumentBlockParamSourceUnion](../components/anthropicdocumentblockparamsourceunion.mdx) | :heavy_check_mark: | N/A | |
| `title` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | |
| `type` | [components.TypeDocument](../components/typedocument.mdx) | :heavy_check_mark: | N/A | |
@@ -1,9 +0,0 @@
---
title: "AnthropicDocumentBlockParamCitations"
---
## Fields
| Field | Type | Required | Description |
| ------------------ | ------------------ | ------------------ | ------------------ |
| `enabled` | *Optional[bool]* | :heavy_minus_sign: | N/A |
@@ -1,18 +0,0 @@
---
title: "AnthropicDocumentBlockParamContent1"
---
## Supported Types
### `components.AnthropicImageBlockParam`
```python
value: components.AnthropicImageBlockParam = /* values here */
```
### `components.AnthropicTextBlockParam`
```python
value: components.AnthropicTextBlockParam = /* values here */
```
@@ -1,18 +0,0 @@
---
title: "AnthropicDocumentBlockParamContent2"
---
## Supported Types
### `str`
```python
value: str = /* values here */
```
### `List[components.AnthropicDocumentBlockParamContent1]`
```python
value: List[components.AnthropicDocumentBlockParamContent1] = /* values here */
```
@@ -1,36 +0,0 @@
---
title: "AnthropicDocumentBlockParamSourceUnion"
---
## Supported Types
### `components.AnthropicBase64PdfSource`
```python
value: components.AnthropicBase64PdfSource = /* values here */
```
### `components.AnthropicPlainTextSource`
```python
value: components.AnthropicPlainTextSource = /* values here */
```
### `components.SourceContent`
```python
value: components.SourceContent = /* values here */
```
### `components.AnthropicURLPdfSource`
```python
value: components.AnthropicURLPdfSource = /* values here */
```
### `components.AnthropicFileDocumentSource`
```python
value: components.AnthropicFileDocumentSource = /* values here */
```
@@ -1,10 +0,0 @@
---
title: "AnthropicFileDocumentSource"
---
## Fields
| Field | Type | Required | Description |
| ---------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------- |
| `file_id` | *str* | :heavy_check_mark: | N/A |
| `type` | [components.AnthropicFileDocumentSourceType](../components/anthropicfiledocumentsourcetype.mdx) | :heavy_check_mark: | N/A |
@@ -1,15 +0,0 @@
---
title: "AnthropicFileDocumentSourceType"
---
## Example Usage
```python
from openrouter.components import AnthropicFileDocumentSourceType
value: AnthropicFileDocumentSourceType = "file"
```
## Values
- `"file"`
@@ -1,11 +0,0 @@
---
title: "AnthropicImageBlockParam"
---
## Fields
| Field | Type | Required | Description | Example |
| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `cache_control` | [Optional[components.AnthropicCacheControlDirective]](../components/anthropiccachecontroldirective.mdx) | :heavy_minus_sign: | Enable automatic prompt caching. When set at the top level, the system automatically applies cache breakpoints to the last cacheable block in the request. Currently supported for Anthropic Claude models. | \{<br/>"type": "ephemeral"<br/>} |
| `source` | [components.AnthropicImageBlockParamSource](../components/anthropicimageblockparamsource.mdx) | :heavy_check_mark: | N/A | |
| `type` | [components.AnthropicImageBlockParamType](../components/anthropicimageblockparamtype.mdx) | :heavy_check_mark: | N/A | |
@@ -1,18 +0,0 @@
---
title: "AnthropicImageBlockParamSource"
---
## Supported Types
### `components.AnthropicBase64ImageSource`
```python
value: components.AnthropicBase64ImageSource = /* values here */
```
### `components.AnthropicURLImageSource`
```python
value: components.AnthropicURLImageSource = /* values here */
```
@@ -1,15 +0,0 @@
---
title: "AnthropicImageBlockParamType"
---
## Example Usage
```python
from openrouter.components import AnthropicImageBlockParamType
value: AnthropicImageBlockParamType = "image"
```
## Values
- `"image"`
@@ -1,22 +0,0 @@
---
title: "AnthropicImageMimeType"
---
## Example Usage
```python
from openrouter.components import AnthropicImageMimeType
# Open enum: unrecognized values are captured as UnrecognizedStr
value: AnthropicImageMimeType = "image/jpeg"
```
## Values
This is an open enum. Unrecognized values will not fail type checks.
- `"image/jpeg"`
- `"image/png"`
- `"image/gif"`
- `"image/webp"`
@@ -1,10 +0,0 @@
---
title: "AnthropicInputTokensClearAtLeast"
---
## Fields
| Field | Type | Required | Description |
| -------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------- |
| `type` | [components.AnthropicInputTokensClearAtLeastType](../components/anthropicinputtokensclearatleasttype.mdx) | :heavy_check_mark: | N/A |
| `value` | *int* | :heavy_check_mark: | N/A |
@@ -1,15 +0,0 @@
---
title: "AnthropicInputTokensClearAtLeastType"
---
## Example Usage
```python
from openrouter.components import AnthropicInputTokensClearAtLeastType
value: AnthropicInputTokensClearAtLeastType = "input_tokens"
```
## Values
- `"input_tokens"`
@@ -1,10 +0,0 @@
---
title: "AnthropicInputTokensTrigger"
---
## Fields
| Field | Type | Required | Description |
| ---------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------- |
| `type` | [components.AnthropicInputTokensTriggerType](../components/anthropicinputtokenstriggertype.mdx) | :heavy_check_mark: | N/A |
| `value` | *int* | :heavy_check_mark: | N/A |
@@ -1,15 +0,0 @@
---
title: "AnthropicInputTokensTriggerType"
---
## Example Usage
```python
from openrouter.components import AnthropicInputTokensTriggerType
value: AnthropicInputTokensTriggerType = "input_tokens"
```
## Values
- `"input_tokens"`
@@ -1,10 +0,0 @@
---
title: "AnthropicIterationCacheCreation"
---
## Fields
| Field | Type | Required | Description |
| --------------------------- | --------------------------- | --------------------------- | --------------------------- |
| `ephemeral_1h_input_tokens` | *Optional[int]* | :heavy_minus_sign: | N/A |
| `ephemeral_5m_input_tokens` | *Optional[int]* | :heavy_minus_sign: | N/A |
@@ -1,15 +0,0 @@
---
title: "AnthropicMessageUsageIteration"
---
## Fields
| Field | Type | Required | Description | Example |
| ---------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------- |
| `cache_creation` | [OptionalNullable[components.AnthropicIterationCacheCreation]](../components/anthropiciterationcachecreation.mdx) | :heavy_minus_sign: | N/A | \{<br/>"ephemeral_1h_input_tokens": 0,<br/>"ephemeral_5m_input_tokens": 0<br/>} |
| `cache_creation_input_tokens` | *Optional[int]* | :heavy_minus_sign: | N/A | |
| `cache_read_input_tokens` | *Optional[int]* | :heavy_minus_sign: | N/A | |
| `input_tokens` | *Optional[int]* | :heavy_minus_sign: | N/A | |
| `output_tokens` | *Optional[int]* | :heavy_minus_sign: | N/A | |
| `model` | *Optional[str]* | :heavy_minus_sign: | N/A | |
| `type` | [components.AnthropicMessageUsageIterationType](../components/anthropicmessageusageiterationtype.mdx) | :heavy_check_mark: | N/A | |
@@ -1,15 +0,0 @@
---
title: "AnthropicMessageUsageIterationType"
---
## Example Usage
```python
from openrouter.components import AnthropicMessageUsageIterationType
value: AnthropicMessageUsageIterationType = "message"
```
## Values
- `"message"`
@@ -1,11 +0,0 @@
---
title: "AnthropicPlainTextSource"
---
## Fields
| Field | Type | Required | Description |
| -------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------- |
| `data` | *str* | :heavy_check_mark: | N/A |
| `media_type` | [components.AnthropicPlainTextSourceMediaType](../components/anthropicplaintextsourcemediatype.mdx) | :heavy_check_mark: | N/A |
| `type` | [components.AnthropicPlainTextSourceType](../components/anthropicplaintextsourcetype.mdx) | :heavy_check_mark: | N/A |
@@ -1,15 +0,0 @@
---
title: "AnthropicPlainTextSourceMediaType"
---
## Example Usage
```python
from openrouter.components import AnthropicPlainTextSourceMediaType
value: AnthropicPlainTextSourceMediaType = "text/plain"
```
## Values
- `"text/plain"`
@@ -1,15 +0,0 @@
---
title: "AnthropicPlainTextSourceType"
---
## Example Usage
```python
from openrouter.components import AnthropicPlainTextSourceType
value: AnthropicPlainTextSourceType = "text"
```
## Values
- `"text"`
@@ -1,14 +0,0 @@
---
title: "AnthropicSearchResultBlockParam"
---
## Fields
| Field | Type | Required | Description | Example |
| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `cache_control` | [Optional[components.AnthropicCacheControlDirective]](../components/anthropiccachecontroldirective.mdx) | :heavy_minus_sign: | Enable automatic prompt caching. When set at the top level, the system automatically applies cache breakpoints to the last cacheable block in the request. Currently supported for Anthropic Claude models. | \{<br/>"type": "ephemeral"<br/>} |
| `citations` | [Optional[components.AnthropicSearchResultBlockParamCitations]](../components/anthropicsearchresultblockparamcitations.mdx) | :heavy_minus_sign: | N/A | |
| `content` | List[[components.AnthropicTextBlockParam](../components/anthropictextblockparam.mdx)] | :heavy_check_mark: | N/A | |
| `source` | *str* | :heavy_check_mark: | N/A | |
| `title` | *str* | :heavy_check_mark: | N/A | |
| `type` | [components.AnthropicSearchResultBlockParamType](../components/anthropicsearchresultblockparamtype.mdx) | :heavy_check_mark: | N/A | |
@@ -1,9 +0,0 @@
---
title: "AnthropicSearchResultBlockParamCitations"
---
## Fields
| Field | Type | Required | Description |
| ------------------ | ------------------ | ------------------ | ------------------ |
| `enabled` | *Optional[bool]* | :heavy_minus_sign: | N/A |
@@ -1,15 +0,0 @@
---
title: "AnthropicSearchResultBlockParamType"
---
## Example Usage
```python
from openrouter.components import AnthropicSearchResultBlockParamType
value: AnthropicSearchResultBlockParamType = "search_result"
```
## Values
- `"search_result"`
-20
View File
@@ -1,20 +0,0 @@
---
title: "AnthropicSpeed"
---
## Example Usage
```python
from openrouter.components import AnthropicSpeed
# Open enum: unrecognized values are captured as UnrecognizedStr
value: AnthropicSpeed = "fast"
```
## Values
This is an open enum. Unrecognized values will not fail type checks.
- `"fast"`
- `"standard"`
@@ -1,12 +0,0 @@
---
title: "AnthropicTextBlockParam"
---
## Fields
| Field | Type | Required | Description | Example |
| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `cache_control` | [Optional[components.AnthropicCacheControlDirective]](../components/anthropiccachecontroldirective.mdx) | :heavy_minus_sign: | Enable automatic prompt caching. When set at the top level, the system automatically applies cache breakpoints to the last cacheable block in the request. Currently supported for Anthropic Claude models. | \{<br/>"type": "ephemeral"<br/>} |
| `citations` | List[[components.Citation](../components/citation.mdx)] | :heavy_minus_sign: | N/A | |
| `text` | *str* | :heavy_check_mark: | N/A | |
| `type` | [components.AnthropicTextBlockParamType](../components/anthropictextblockparamtype.mdx) | :heavy_check_mark: | N/A | |
@@ -1,15 +0,0 @@
---
title: "AnthropicTextBlockParamType"
---
## Example Usage
```python
from openrouter.components import AnthropicTextBlockParamType
value: AnthropicTextBlockParamType = "text"
```
## Values
- `"text"`
@@ -1,20 +0,0 @@
---
title: "AnthropicThinkingDisplay"
---
## Example Usage
```python
from openrouter.components import AnthropicThinkingDisplay
# Open enum: unrecognized values are captured as UnrecognizedStr
value: AnthropicThinkingDisplay = "summarized"
```
## Values
This is an open enum. Unrecognized values will not fail type checks.
- `"summarized"`
- `"omitted"`
@@ -1,10 +0,0 @@
---
title: "AnthropicThinkingTurns"
---
## Fields
| Field | Type | Required | Description |
| ------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------ |
| `type` | [components.AnthropicThinkingTurnsType](../components/anthropicthinkingturnstype.mdx) | :heavy_check_mark: | N/A |
| `value` | *int* | :heavy_check_mark: | N/A |
@@ -1,15 +0,0 @@
---
title: "AnthropicThinkingTurnsType"
---
## Example Usage
```python
from openrouter.components import AnthropicThinkingTurnsType
value: AnthropicThinkingTurnsType = "thinking_turns"
```
## Values
- `"thinking_turns"`
-10
View File
@@ -1,10 +0,0 @@
---
title: "AnthropicToolUsesKeep"
---
## Fields
| Field | Type | Required | Description |
| ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- |
| `type` | [components.AnthropicToolUsesKeepType](../components/anthropictooluseskeeptype.mdx) | :heavy_check_mark: | N/A |
| `value` | *int* | :heavy_check_mark: | N/A |
@@ -1,15 +0,0 @@
---
title: "AnthropicToolUsesKeepType"
---
## Example Usage
```python
from openrouter.components import AnthropicToolUsesKeepType
value: AnthropicToolUsesKeepType = "tool_uses"
```
## Values
- `"tool_uses"`
@@ -1,10 +0,0 @@
---
title: "AnthropicToolUsesTrigger"
---
## Fields
| Field | Type | Required | Description |
| ---------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- |
| `type` | [components.AnthropicToolUsesTriggerType](../components/anthropictoolusestriggertype.mdx) | :heavy_check_mark: | N/A |
| `value` | *int* | :heavy_check_mark: | N/A |
@@ -1,15 +0,0 @@
---
title: "AnthropicToolUsesTriggerType"
---
## Example Usage
```python
from openrouter.components import AnthropicToolUsesTriggerType
value: AnthropicToolUsesTriggerType = "tool_uses"
```
## Values
- `"tool_uses"`
@@ -1,14 +0,0 @@
---
title: "AnthropicUnknownUsageIteration"
---
## Fields
| Field | Type | Required | Description | Example |
| ---------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------- |
| `cache_creation` | [OptionalNullable[components.AnthropicIterationCacheCreation]](../components/anthropiciterationcachecreation.mdx) | :heavy_minus_sign: | N/A | \{<br/>"ephemeral_1h_input_tokens": 0,<br/>"ephemeral_5m_input_tokens": 0<br/>} |
| `cache_creation_input_tokens` | *Optional[int]* | :heavy_minus_sign: | N/A | |
| `cache_read_input_tokens` | *Optional[int]* | :heavy_minus_sign: | N/A | |
| `input_tokens` | *Optional[int]* | :heavy_minus_sign: | N/A | |
| `output_tokens` | *Optional[int]* | :heavy_minus_sign: | N/A | |
| `type` | *str* | :heavy_check_mark: | N/A | |
@@ -1,10 +0,0 @@
---
title: "AnthropicURLImageSource"
---
## Fields
| Field | Type | Required | Description |
| -------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------- |
| `type` | [components.AnthropicURLImageSourceType](../components/anthropicurlimagesourcetype.mdx) | :heavy_check_mark: | N/A |
| `url` | *str* | :heavy_check_mark: | N/A |
@@ -1,15 +0,0 @@
---
title: "AnthropicURLImageSourceType"
---
## Example Usage
```python
from openrouter.components import AnthropicURLImageSourceType
value: AnthropicURLImageSourceType = "url"
```
## Values
- `"url"`
-10
View File
@@ -1,10 +0,0 @@
---
title: "AnthropicURLPdfSource"
---
## Fields
| Field | Type | Required | Description |
| ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- |
| `type` | [components.AnthropicURLPdfSourceType](../components/anthropicurlpdfsourcetype.mdx) | :heavy_check_mark: | N/A |
| `url` | *str* | :heavy_check_mark: | N/A |
@@ -1,15 +0,0 @@
---
title: "AnthropicURLPdfSourceType"
---
## Example Usage
```python
from openrouter.components import AnthropicURLPdfSourceType
value: AnthropicURLPdfSourceType = "url"
```
## Values
- `"url"`
@@ -1,30 +0,0 @@
---
title: "AnthropicUsageIteration"
---
## Supported Types
### `components.AnthropicCompactionUsageIteration`
```python
value: components.AnthropicCompactionUsageIteration = /* values here */
```
### `components.AnthropicMessageUsageIteration`
```python
value: components.AnthropicMessageUsageIteration = /* values here */
```
### `components.AnthropicAdvisorMessageUsageIteration`
```python
value: components.AnthropicAdvisorMessageUsageIteration = /* values here */
```
### `components.AnthropicUnknownUsageIteration`
```python
value: components.AnthropicUnknownUsageIteration = /* values here */
```
@@ -1,13 +0,0 @@
---
title: "AnthropicWebSearchResultBlockParam"
---
## Fields
| Field | Type | Required | Description |
| ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ |
| `encrypted_content` | *str* | :heavy_check_mark: | N/A |
| `page_age` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A |
| `title` | *str* | :heavy_check_mark: | N/A |
| `type` | [components.AnthropicWebSearchResultBlockParamType](../components/anthropicwebsearchresultblockparamtype.mdx) | :heavy_check_mark: | N/A |
| `url` | *str* | :heavy_check_mark: | N/A |
@@ -1,15 +0,0 @@
---
title: "AnthropicWebSearchResultBlockParamType"
---
## Example Usage
```python
from openrouter.components import AnthropicWebSearchResultBlockParamType
value: AnthropicWebSearchResultBlockParamType = "web_search_result"
```
## Values
- `"web_search_result"`

Some files were not shown because too many files have changed in this diff Show More