mirror of
https://github.com/wassname/openrouter-python-sdk-retry-errors.git
synced 2026-08-01 12:40:23 +08:00
Compare commits
39
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
778e2e36fb | ||
|
|
14f262fa66 | ||
|
|
10f2890d75 | ||
|
|
ad1cfda1f4 | ||
|
|
21020fb334 | ||
|
|
a243d78d32 | ||
|
|
66512fa808 | ||
|
|
7efd03fb3b | ||
|
|
e1b89f5aaf | ||
|
|
32dd522d5a | ||
|
|
eeb0373033 | ||
|
|
facade7d00 | ||
|
|
08e796401a | ||
|
|
f8e8ab669d | ||
|
|
5e0b1a2b69 | ||
|
|
667941aaa8 | ||
|
|
011fb81cc3 | ||
|
|
5c06b57cea | ||
|
|
0680f01bf7 | ||
|
|
186c1075ce | ||
|
|
b161a5c288 | ||
|
|
4f018c91d7 | ||
|
|
63949d45e2 | ||
|
|
399c1d0e02 | ||
|
|
89717dca56 | ||
|
|
c8bf74a516 | ||
|
|
4e551e432f | ||
|
|
60add6da49 | ||
|
|
ddcadce542 | ||
|
|
5cefd3a108 | ||
|
|
713dd5c71a | ||
|
|
678d5aacc5 | ||
|
|
b3f4ab7452 | ||
|
|
7b4b9feaa5 | ||
|
|
add423f762 | ||
|
|
c34ce15fa2 | ||
|
|
8e637041c4 | ||
|
|
146cec3c08 | ||
|
|
14a62e3451 |
@@ -1,11 +1,27 @@
|
|||||||
name: Auto-merge Speakeasy PR
|
name: Auto-merge Speakeasy PR
|
||||||
|
|
||||||
# Speakeasy mode:pr opens PRs (speakeasy-sdk-regen-*) and labels them
|
# Called as a follow-up job after Speakeasy Generate (mode: pr). Merges the
|
||||||
# patch/minor/major. Merge automatically so sdk_publish.yaml can run.
|
# 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.
|
||||||
|
|
||||||
on:
|
on:
|
||||||
pull_request:
|
workflow_call:
|
||||||
types: [labeled]
|
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
|
||||||
|
|
||||||
permissions:
|
permissions:
|
||||||
contents: write
|
contents: write
|
||||||
@@ -17,29 +33,90 @@ concurrency:
|
|||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
auto-merge:
|
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') &&
|
|
||||||
contains(fromJSON('["patch", "minor", "major"]'), github.event.label.name)
|
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- name: Close superseded Speakeasy PRs
|
- 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
|
||||||
env:
|
env:
|
||||||
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
GH_TOKEN: ${{ steps.app-token.outputs.token }}
|
||||||
run: |
|
run: |
|
||||||
set -euo pipefail
|
set -euo pipefail
|
||||||
CURRENT_PR="${{ github.event.pull_request.number }}"
|
|
||||||
|
|
||||||
PRIOR_JSON=$(gh pr list \
|
REPO="${{ github.repository }}"
|
||||||
--repo "${{ github.repository }}" \
|
RUN_STARTED="${{ inputs.run_started_at }}"
|
||||||
|
BRANCH="${{ inputs.branch_name }}"
|
||||||
|
|
||||||
|
PR_JSON=$(gh pr list \
|
||||||
|
--repo "$REPO" \
|
||||||
--state open \
|
--state open \
|
||||||
--search "head:speakeasy-sdk-regen-" \
|
--search "head:speakeasy-sdk-regen-" \
|
||||||
--limit 500 \
|
--limit 500 \
|
||||||
--json number \
|
--json number,updatedAt,title,labels,author,headRefName)
|
||||||
| jq -r --arg cur "$CURRENT_PR" \
|
|
||||||
'[.[].number | select(tostring != $cur)] | .[]')
|
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)] | .[]')
|
||||||
|
|
||||||
if [ -z "$PRIOR_JSON" ]; then
|
if [ -z "$PRIOR_JSON" ]; then
|
||||||
echo "No superseded Speakeasy PRs to close"
|
echo "No superseded Speakeasy PRs to close"
|
||||||
@@ -57,30 +134,92 @@ jobs:
|
|||||||
done
|
done
|
||||||
|
|
||||||
- name: Auto-merge Speakeasy PR
|
- name: Auto-merge Speakeasy PR
|
||||||
|
if: steps.pr.outputs.pr_num != ''
|
||||||
env:
|
env:
|
||||||
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
GH_TOKEN: ${{ steps.app-token.outputs.token }}
|
||||||
run: |
|
run: |
|
||||||
set -euo pipefail
|
set -euo pipefail
|
||||||
PR_NUM="${{ github.event.pull_request.number }}"
|
|
||||||
|
PR_NUM="${{ steps.pr.outputs.pr_num }}"
|
||||||
REPO="${{ github.repository }}"
|
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)
|
STATE=$(gh pr view "$PR_NUM" --repo "$REPO" --json state --jq .state)
|
||||||
if [ "$STATE" != "OPEN" ]; then
|
if [ "$STATE" != "OPEN" ]; then
|
||||||
echo "PR #$PR_NUM is $STATE — skipping merge"
|
echo "PR #$PR_NUM is $STATE — skipping merge"
|
||||||
exit 0
|
exit 0
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
MERGE_METHOD=""
|
||||||
# Prefer GitHub auto-merge when required checks exist; otherwise
|
# Prefer GitHub auto-merge when required checks exist; otherwise
|
||||||
# squash-merge directly (same pattern as sdk-release-prs.yaml).
|
# squash-merge directly after checks pass (sdk-release-prs.yaml pattern).
|
||||||
AUTO_MERGE_NOOP_PATTERN='is in clean status|protected branch rules|Branch does not have required protected branch rules'
|
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
|
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"
|
echo "Auto-merge enabled for Speakeasy PR #$PR_NUM"
|
||||||
elif grep -qiE "$AUTO_MERGE_NOOP_PATTERN" /tmp/gh-merge.err; then
|
elif grep -qiE "$AUTO_MERGE_NOOP_PATTERN" /tmp/gh-merge.err; then
|
||||||
echo "Auto-merge not applicable — merging PR #$PR_NUM directly"
|
echo "Auto-merge not applicable — waiting for checks, then merging PR #$PR_NUM directly"
|
||||||
cat /tmp/gh-merge.err >&2
|
cat /tmp/gh-merge.err >&2
|
||||||
|
wait_for_checks "$PR_NUM"
|
||||||
gh pr merge "$PR_NUM" --repo "$REPO" --squash --delete-branch
|
gh pr merge "$PR_NUM" --repo "$REPO" --squash --delete-branch
|
||||||
|
MERGE_METHOD="direct squash (checks passed)"
|
||||||
else
|
else
|
||||||
echo "::error::Failed to enable auto-merge on Speakeasy PR #$PR_NUM"
|
echo "::error::Failed to enable auto-merge on Speakeasy PR #$PR_NUM"
|
||||||
cat /tmp/gh-merge.err >&2
|
cat /tmp/gh-merge.err >&2
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
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"
|
||||||
|
|||||||
@@ -0,0 +1,37 @@
|
|||||||
|
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
|
||||||
@@ -21,6 +21,11 @@ permissions:
|
|||||||
types:
|
types:
|
||||||
- labeled
|
- labeled
|
||||||
- unlabeled
|
- unlabeled
|
||||||
|
|
||||||
|
concurrency:
|
||||||
|
group: speakeasy-generate
|
||||||
|
cancel-in-progress: false
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
generate:
|
generate:
|
||||||
uses: speakeasy-api/sdk-generation-action/.github/workflows/workflow-executor.yaml@v15
|
uses: speakeasy-api/sdk-generation-action/.github/workflows/workflow-executor.yaml@v15
|
||||||
@@ -32,3 +37,67 @@ jobs:
|
|||||||
github_access_token: ${{ secrets.GITHUB_TOKEN }}
|
github_access_token: ${{ secrets.GITHUB_TOKEN }}
|
||||||
pypi_token: ${{ secrets.PYPI_TOKEN }}
|
pypi_token: ${{ secrets.PYPI_TOKEN }}
|
||||||
speakeasy_api_key: ${{ secrets.SPEAKEASY_API_KEY }}
|
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,6 +22,10 @@ permissions:
|
|||||||
paths:
|
paths:
|
||||||
- .speakeasy/in.openapi.yaml
|
- .speakeasy/in.openapi.yaml
|
||||||
|
|
||||||
|
concurrency:
|
||||||
|
group: speakeasy-generate-spec-change
|
||||||
|
cancel-in-progress: false
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
generate:
|
generate:
|
||||||
if: github.event.pull_request.merged == true || github.event_name == 'workflow_dispatch'
|
if: github.event.pull_request.merged == true || github.event_name == 'workflow_dispatch'
|
||||||
@@ -34,3 +38,67 @@ jobs:
|
|||||||
github_access_token: ${{ secrets.GITHUB_TOKEN }}
|
github_access_token: ${{ secrets.GITHUB_TOKEN }}
|
||||||
pypi_token: ${{ secrets.PYPI_TOKEN }}
|
pypi_token: ${{ secrets.PYPI_TOKEN }}
|
||||||
speakeasy_api_key: ${{ secrets.SPEAKEASY_API_KEY }}
|
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 }}
|
||||||
|
|||||||
+759
-252
File diff suppressed because it is too large
Load Diff
+1
-1
@@ -32,7 +32,7 @@ generation:
|
|||||||
skipResponseBodyAssertions: false
|
skipResponseBodyAssertions: false
|
||||||
preApplyUnionDiscriminators: true
|
preApplyUnionDiscriminators: true
|
||||||
python:
|
python:
|
||||||
version: 0.10.1
|
version: 0.10.8
|
||||||
additionalDependencies:
|
additionalDependencies:
|
||||||
dev: {}
|
dev: {}
|
||||||
main: {}
|
main: {}
|
||||||
|
|||||||
+1671
-127
File diff suppressed because it is too large
Load Diff
+1645
-123
File diff suppressed because it is too large
Load Diff
@@ -2,20 +2,20 @@ speakeasyVersion: 1.680.0
|
|||||||
sources:
|
sources:
|
||||||
OpenRouter API:
|
OpenRouter API:
|
||||||
sourceNamespace: open-router-chat-completions-api
|
sourceNamespace: open-router-chat-completions-api
|
||||||
sourceRevisionDigest: sha256:6ca77315c3cd31ab7e308e010b26b7c9eb366b11b78ea9c71179facc4daaf97b
|
sourceRevisionDigest: sha256:ed6981b24a0f8df827afac0f83d7dae4d8f7df331ae6e72664e03800cb7a0244
|
||||||
sourceBlobDigest: sha256:8bada810c7c5ddb302c51dbbbb36dd0c9a45c4ba1c5e44af1646f69fc2a38751
|
sourceBlobDigest: sha256:5961e537bd3160eb3f541232a5e7cb43704fed5e9ce76b342c08f6c52d4fefe9
|
||||||
tags:
|
tags:
|
||||||
- latest
|
- latest
|
||||||
- speakeasy-sdk-regen-1781819160
|
- speakeasy-sdk-regen-1782660460
|
||||||
- 1.0.0
|
- 1.0.0
|
||||||
targets:
|
targets:
|
||||||
open-router:
|
open-router:
|
||||||
source: OpenRouter API
|
source: OpenRouter API
|
||||||
sourceNamespace: open-router-chat-completions-api
|
sourceNamespace: open-router-chat-completions-api
|
||||||
sourceRevisionDigest: sha256:6ca77315c3cd31ab7e308e010b26b7c9eb366b11b78ea9c71179facc4daaf97b
|
sourceRevisionDigest: sha256:ed6981b24a0f8df827afac0f83d7dae4d8f7df331ae6e72664e03800cb7a0244
|
||||||
sourceBlobDigest: sha256:8bada810c7c5ddb302c51dbbbb36dd0c9a45c4ba1c5e44af1646f69fc2a38751
|
sourceBlobDigest: sha256:5961e537bd3160eb3f541232a5e7cb43704fed5e9ce76b342c08f6c52d4fefe9
|
||||||
codeSamplesNamespace: open-router-python-code-samples
|
codeSamplesNamespace: open-router-python-code-samples
|
||||||
codeSamplesRevisionDigest: sha256:80ceff338c097e19bf3951fd00e8010fc7c102b916a684eeec33d507b7a3844f
|
codeSamplesRevisionDigest: sha256:d3f20480ea1c0bcb8d872ae696b7a8b2c16d1469ee95b6df12b03b7004ce1c9c
|
||||||
workflow:
|
workflow:
|
||||||
workflowVersion: 1.0.0
|
workflowVersion: 1.0.0
|
||||||
speakeasyVersion: 1.680.0
|
speakeasyVersion: 1.680.0
|
||||||
|
|||||||
+71
-1
@@ -30,7 +30,7 @@ Based on:
|
|||||||
### Releases
|
### Releases
|
||||||
- [PyPI v0.10.0] https://pypi.org/project/openrouter/0.10.0 - .
|
- [PyPI v0.10.0] https://pypi.org/project/openrouter/0.10.0 - .
|
||||||
|
|
||||||
## 2026-06-18 21:51:38
|
## 2026-06-25 21:56:51
|
||||||
### Changes
|
### Changes
|
||||||
Based on:
|
Based on:
|
||||||
- OpenAPI Doc
|
- OpenAPI Doc
|
||||||
@@ -39,3 +39,73 @@ Based on:
|
|||||||
- [python v0.10.1] .
|
- [python v0.10.1] .
|
||||||
### Releases
|
### Releases
|
||||||
- [PyPI v0.10.1] https://pypi.org/project/openrouter/0.10.1 - .
|
- [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 - .
|
||||||
@@ -1,13 +0,0 @@
|
|||||||
# CompletionTokensDetails
|
|
||||||
|
|
||||||
Detailed completion token usage
|
|
||||||
|
|
||||||
|
|
||||||
## Fields
|
|
||||||
|
|
||||||
| Field | Type | Required | Description |
|
|
||||||
| ---------------------------- | ---------------------------- | ---------------------------- | ---------------------------- |
|
|
||||||
| `accepted_prediction_tokens` | *OptionalNullable[int]* | :heavy_minus_sign: | Accepted prediction tokens |
|
|
||||||
| `audio_tokens` | *OptionalNullable[int]* | :heavy_minus_sign: | Tokens used for audio output |
|
|
||||||
| `reasoning_tokens` | *OptionalNullable[int]* | :heavy_minus_sign: | Tokens used for reasoning |
|
|
||||||
| `rejected_prediction_tokens` | *OptionalNullable[int]* | :heavy_minus_sign: | Rejected prediction tokens |
|
|
||||||
@@ -1,11 +0,0 @@
|
|||||||
# Error
|
|
||||||
|
|
||||||
Error information
|
|
||||||
|
|
||||||
|
|
||||||
## Fields
|
|
||||||
|
|
||||||
| Field | Type | Required | Description | Example |
|
|
||||||
| ------------------- | ------------------- | ------------------- | ------------------- | ------------------- |
|
|
||||||
| `code` | *int* | :heavy_check_mark: | Error code | 429 |
|
|
||||||
| `message` | *str* | :heavy_check_mark: | Error message | Rate limit exceeded |
|
|
||||||
+17
-16
@@ -3,19 +3,20 @@
|
|||||||
|
|
||||||
## Fields
|
## Fields
|
||||||
|
|
||||||
| Field | Type | Required | Description | Example |
|
| Field | Type | Required | Description |
|
||||||
| -------------------- | -------------------- | -------------------- | -------------------- | -------------------- |
|
| --------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||||
| `audio` | *Optional[str]* | :heavy_minus_sign: | N/A | 1000 |
|
| `audio` | *Optional[str]* | :heavy_minus_sign: | Price in USD per audio input token |
|
||||||
| `audio_output` | *Optional[str]* | :heavy_minus_sign: | N/A | 1000 |
|
| `audio_output` | *Optional[str]* | :heavy_minus_sign: | Price in USD per audio output token |
|
||||||
| `completion` | *str* | :heavy_check_mark: | N/A | 1000 |
|
| `completion` | *str* | :heavy_check_mark: | Price in USD per token for completion (output) generation |
|
||||||
| `discount` | *Optional[float]* | :heavy_minus_sign: | N/A | |
|
| `discount` | *Optional[float]* | :heavy_minus_sign: | Fractional discount applied to this endpoint's pricing; the price is multiplied by (1 - discount) (0 = no discount, 1 = free) |
|
||||||
| `image` | *Optional[str]* | :heavy_minus_sign: | N/A | 1000 |
|
| `image` | *Optional[str]* | :heavy_minus_sign: | Price in USD per input image |
|
||||||
| `image_output` | *Optional[str]* | :heavy_minus_sign: | N/A | 1000 |
|
| `image_output` | *Optional[str]* | :heavy_minus_sign: | Price in USD per output image |
|
||||||
| `image_token` | *Optional[str]* | :heavy_minus_sign: | N/A | 1000 |
|
| `image_token` | *Optional[str]* | :heavy_minus_sign: | Price in USD per image token |
|
||||||
| `input_audio_cache` | *Optional[str]* | :heavy_minus_sign: | N/A | 1000 |
|
| `input_audio_cache` | *Optional[str]* | :heavy_minus_sign: | Price in USD per cached audio input token |
|
||||||
| `input_cache_read` | *Optional[str]* | :heavy_minus_sign: | N/A | 1000 |
|
| `input_cache_read` | *Optional[str]* | :heavy_minus_sign: | Price in USD per cached input token (read) |
|
||||||
| `input_cache_write` | *Optional[str]* | :heavy_minus_sign: | N/A | 1000 |
|
| `input_cache_write` | *Optional[str]* | :heavy_minus_sign: | Price per cache-write token, in USD per token. For providers with multiple cache TTLs (e.g. Anthropic), this is the default (5-minute) cache-write rate. |
|
||||||
| `internal_reasoning` | *Optional[str]* | :heavy_minus_sign: | N/A | 1000 |
|
| `input_cache_write_1h` | *Optional[str]* | :heavy_minus_sign: | Price per 1-hour cache-write token, in USD per token. Only present for providers that price an extended (1-hour) cache TTL separately, such as Anthropic. |
|
||||||
| `prompt` | *str* | :heavy_check_mark: | N/A | 1000 |
|
| `internal_reasoning` | *Optional[str]* | :heavy_minus_sign: | Price in USD per internal reasoning token |
|
||||||
| `request` | *Optional[str]* | :heavy_minus_sign: | N/A | 1000 |
|
| `prompt` | *str* | :heavy_check_mark: | Price in USD per token for prompt (input) processing |
|
||||||
| `web_search` | *Optional[str]* | :heavy_minus_sign: | N/A | 1000 |
|
| `request` | *Optional[str]* | :heavy_minus_sign: | Price in USD per request |
|
||||||
|
| `web_search` | *Optional[str]* | :heavy_minus_sign: | Price in USD per web search |
|
||||||
@@ -1,13 +0,0 @@
|
|||||||
# PromptTokensDetails
|
|
||||||
|
|
||||||
Detailed prompt token usage
|
|
||||||
|
|
||||||
|
|
||||||
## Fields
|
|
||||||
|
|
||||||
| Field | Type | Required | Description |
|
|
||||||
| ------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------ |
|
|
||||||
| `audio_tokens` | *Optional[int]* | :heavy_minus_sign: | Audio input tokens |
|
|
||||||
| `cache_write_tokens` | *Optional[int]* | :heavy_minus_sign: | Tokens written to cache. Only returned for models with explicit caching and cache write pricing. |
|
|
||||||
| `cached_tokens` | *Optional[int]* | :heavy_minus_sign: | Cached prompt tokens |
|
|
||||||
| `video_tokens` | *Optional[int]* | :heavy_minus_sign: | Video input tokens |
|
|
||||||
@@ -42,12 +42,14 @@
|
|||||||
| `GOOGLE` | Google |
|
| `GOOGLE` | Google |
|
||||||
| `GOOGLE_AI_STUDIO` | Google AI Studio |
|
| `GOOGLE_AI_STUDIO` | Google AI Studio |
|
||||||
| `GROQ` | Groq |
|
| `GROQ` | Groq |
|
||||||
|
| `HEY_GEN` | HeyGen |
|
||||||
| `INCEPTION` | Inception |
|
| `INCEPTION` | Inception |
|
||||||
| `INCEPTRON` | Inceptron |
|
| `INCEPTRON` | Inceptron |
|
||||||
| `INFERENCE_NET` | InferenceNet |
|
| `INFERENCE_NET` | InferenceNet |
|
||||||
| `IONSTREAM` | Ionstream |
|
| `IONSTREAM` | Ionstream |
|
||||||
| `INFERMATIC` | Infermatic |
|
| `INFERMATIC` | Infermatic |
|
||||||
| `IO_NET` | Io Net |
|
| `IO_NET` | Io Net |
|
||||||
|
| `INFERACT_V_LLM` | Inferact vLLM |
|
||||||
| `INFLECTION` | Inflection |
|
| `INFLECTION` | Inflection |
|
||||||
| `LIQUID` | Liquid |
|
| `LIQUID` | Liquid |
|
||||||
| `MARA` | Mara |
|
| `MARA` | Mara |
|
||||||
@@ -74,6 +76,7 @@
|
|||||||
| `RECRAFT` | Recraft |
|
| `RECRAFT` | Recraft |
|
||||||
| `REKA` | Reka |
|
| `REKA` | Reka |
|
||||||
| `RELACE` | Relace |
|
| `RELACE` | Relace |
|
||||||
|
| `SAKANA_AI` | Sakana AI |
|
||||||
| `SAMBA_NOVA` | SambaNova |
|
| `SAMBA_NOVA` | SambaNova |
|
||||||
| `SEED` | Seed |
|
| `SEED` | Seed |
|
||||||
| `SILICON_FLOW` | SiliconFlow |
|
| `SILICON_FLOW` | SiliconFlow |
|
||||||
@@ -82,11 +85,13 @@
|
|||||||
| `STEALTH` | Stealth |
|
| `STEALTH` | Stealth |
|
||||||
| `STREAM_LAKE` | StreamLake |
|
| `STREAM_LAKE` | StreamLake |
|
||||||
| `SWITCHPOINT` | Switchpoint |
|
| `SWITCHPOINT` | Switchpoint |
|
||||||
|
| `TENSTORRENT` | Tenstorrent |
|
||||||
| `TOGETHER` | Together |
|
| `TOGETHER` | Together |
|
||||||
| `UPSTAGE` | Upstage |
|
| `UPSTAGE` | Upstage |
|
||||||
| `VENICE` | Venice |
|
| `VENICE` | Venice |
|
||||||
| `WAFER` | Wafer |
|
| `WAFER` | Wafer |
|
||||||
| `WAND_B` | WandB |
|
| `WAND_B` | WandB |
|
||||||
|
| `QUIVER` | Quiver |
|
||||||
| `XIAOMI` | Xiaomi |
|
| `XIAOMI` | Xiaomi |
|
||||||
| `X_AI` | xAI |
|
| `X_AI` | xAI |
|
||||||
| `Z_AI` | Z.AI |
|
| `Z_AI` | Z.AI |
|
||||||
|
|||||||
@@ -5,19 +5,20 @@ Pricing information for the model
|
|||||||
|
|
||||||
## Fields
|
## Fields
|
||||||
|
|
||||||
| Field | Type | Required | Description | Example |
|
| Field | Type | Required | Description |
|
||||||
| -------------------- | -------------------- | -------------------- | -------------------- | -------------------- |
|
| --------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||||
| `audio` | *Optional[str]* | :heavy_minus_sign: | N/A | 1000 |
|
| `audio` | *Optional[str]* | :heavy_minus_sign: | Price in USD per audio input token |
|
||||||
| `audio_output` | *Optional[str]* | :heavy_minus_sign: | N/A | 1000 |
|
| `audio_output` | *Optional[str]* | :heavy_minus_sign: | Price in USD per audio output token |
|
||||||
| `completion` | *str* | :heavy_check_mark: | N/A | 1000 |
|
| `completion` | *str* | :heavy_check_mark: | Price in USD per token for completion (output) generation |
|
||||||
| `discount` | *Optional[float]* | :heavy_minus_sign: | N/A | |
|
| `discount` | *Optional[float]* | :heavy_minus_sign: | Fractional discount applied to this endpoint's pricing; the price is multiplied by (1 - discount) (0 = no discount, 1 = free) |
|
||||||
| `image` | *Optional[str]* | :heavy_minus_sign: | N/A | 1000 |
|
| `image` | *Optional[str]* | :heavy_minus_sign: | Price in USD per input image |
|
||||||
| `image_output` | *Optional[str]* | :heavy_minus_sign: | N/A | 1000 |
|
| `image_output` | *Optional[str]* | :heavy_minus_sign: | Price in USD per output image |
|
||||||
| `image_token` | *Optional[str]* | :heavy_minus_sign: | N/A | 1000 |
|
| `image_token` | *Optional[str]* | :heavy_minus_sign: | Price in USD per image token |
|
||||||
| `input_audio_cache` | *Optional[str]* | :heavy_minus_sign: | N/A | 1000 |
|
| `input_audio_cache` | *Optional[str]* | :heavy_minus_sign: | Price in USD per cached audio input token |
|
||||||
| `input_cache_read` | *Optional[str]* | :heavy_minus_sign: | N/A | 1000 |
|
| `input_cache_read` | *Optional[str]* | :heavy_minus_sign: | Price in USD per cached input token (read) |
|
||||||
| `input_cache_write` | *Optional[str]* | :heavy_minus_sign: | N/A | 1000 |
|
| `input_cache_write` | *Optional[str]* | :heavy_minus_sign: | Price per cache-write token, in USD per token. For providers with multiple cache TTLs (e.g. Anthropic), this is the default (5-minute) cache-write rate. |
|
||||||
| `internal_reasoning` | *Optional[str]* | :heavy_minus_sign: | N/A | 1000 |
|
| `input_cache_write_1h` | *Optional[str]* | :heavy_minus_sign: | Price per 1-hour cache-write token, in USD per token. Only present for providers that price an extended (1-hour) cache TTL separately, such as Anthropic. |
|
||||||
| `prompt` | *str* | :heavy_check_mark: | N/A | 1000 |
|
| `internal_reasoning` | *Optional[str]* | :heavy_minus_sign: | Price in USD per internal reasoning token |
|
||||||
| `request` | *Optional[str]* | :heavy_minus_sign: | N/A | 1000 |
|
| `prompt` | *str* | :heavy_check_mark: | Price in USD per token for prompt (input) processing |
|
||||||
| `web_search` | *Optional[str]* | :heavy_minus_sign: | N/A | 1000 |
|
| `request` | *Optional[str]* | :heavy_minus_sign: | Price in USD per request |
|
||||||
|
| `web_search` | *Optional[str]* | :heavy_minus_sign: | Price in USD per web search |
|
||||||
@@ -3,23 +3,23 @@
|
|||||||
|
|
||||||
## Fields
|
## Fields
|
||||||
|
|
||||||
| Field | Type | Required | Description | Example |
|
| Field | Type | Required | Description | Example |
|
||||||
| ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
||||||
| `http_referer` | *Optional[str]* | :heavy_minus_sign: | The app identifier should be your app's URL and is used as the primary identifier for rankings.<br/>This is used to track API usage per application.<br/> | |
|
| `http_referer` | *Optional[str]* | :heavy_minus_sign: | The app identifier should be your app's URL and is used as the primary identifier for rankings.<br/>This is used to track API usage per application.<br/> | |
|
||||||
| `x_open_router_title` | *Optional[str]* | :heavy_minus_sign: | The app display name allows you to customize how your app appears in OpenRouter's dashboard.<br/> | |
|
| `x_open_router_title` | *Optional[str]* | :heavy_minus_sign: | The app display name allows you to customize how your app appears in OpenRouter's dashboard.<br/> | |
|
||||||
| `x_open_router_categories` | *Optional[str]* | :heavy_minus_sign: | Comma-separated list of app categories (e.g. "cli-agent,cloud-agent"). Used for marketplace rankings.<br/> | |
|
| `x_open_router_categories` | *Optional[str]* | :heavy_minus_sign: | Comma-separated list of app categories (e.g. "cli-agent,cloud-agent"). Used for marketplace rankings.<br/> | |
|
||||||
| `category` | [Optional[operations.GetModelsCategory]](../operations/getmodelscategory.md) | :heavy_minus_sign: | Filter models by use case category | programming |
|
| `category` | [Optional[operations.GetModelsCategory]](../operations/getmodelscategory.md) | :heavy_minus_sign: | Filter models by use case category | programming |
|
||||||
| `supported_parameters` | *Optional[str]* | :heavy_minus_sign: | Filter models by supported parameter (comma-separated) | temperature |
|
| `supported_parameters` | *Optional[str]* | :heavy_minus_sign: | Filter models by supported parameter (comma-separated) | temperature |
|
||||||
| `output_modalities` | *Optional[str]* | :heavy_minus_sign: | Filter models by output modality. Accepts a comma-separated list of modalities (text, image, audio, embeddings) or "all" to include all models. Defaults to "text". | text |
|
| `output_modalities` | *Optional[str]* | :heavy_minus_sign: | Filter models by output modality. Accepts a comma-separated list of modalities (text, image, audio, embeddings) or "all" to include all models. Defaults to "text". | text |
|
||||||
| `sort` | [Optional[operations.GetModelsSort]](../operations/getmodelssort.md) | :heavy_minus_sign: | Sort the returned models server-side. Prefer this over fetching the full list and sorting client-side. Options: pricing-low-to-high, pricing-high-to-low (average prompt/completion price), context-high-to-low (context length), throughput-high-to-low, latency-low-to-high (recent median performance), most-popular, top-weekly (tokens processed in the last week), newest (creation date). When omitted, the existing default ordering is preserved. | newest |
|
| `sort` | [Optional[operations.GetModelsSort]](../operations/getmodelssort.md) | :heavy_minus_sign: | Sort the returned models server-side. Prefer this over fetching the full list and sorting client-side. Options: pricing-low-to-high, pricing-high-to-low (average prompt/completion price), context-high-to-low (context length), throughput-high-to-low, latency-low-to-high (recent median performance), most-popular, top-weekly (tokens processed in the last week), newest (creation date), intelligence-high-to-low (Artificial Analysis intelligence index), design-arena-elo-high-to-low (best Design Arena ELO across arenas). Models without a score for the chosen benchmark are placed last. When omitted, the existing default ordering is preserved. | newest |
|
||||||
| `q` | *Optional[str]* | :heavy_minus_sign: | Free-text search by model name or slug. | gpt-4 |
|
| `q` | *Optional[str]* | :heavy_minus_sign: | Free-text search by model name or slug. | gpt-4 |
|
||||||
| `input_modalities` | *Optional[str]* | :heavy_minus_sign: | Filter models by input modality. Comma-separated list of: text, image, audio, file. | text,image |
|
| `input_modalities` | *Optional[str]* | :heavy_minus_sign: | Filter models by input modality. Comma-separated list of: text, image, audio, file. | text,image |
|
||||||
| `context` | *Optional[int]* | :heavy_minus_sign: | Minimum context length (tokens). Models with smaller context are excluded. | 128000 |
|
| `context` | *Optional[int]* | :heavy_minus_sign: | Minimum context length (tokens). Models with smaller context are excluded. | 128000 |
|
||||||
| `min_price` | *OptionalNullable[float]* | :heavy_minus_sign: | Minimum prompt price in $/M tokens. | 0 |
|
| `min_price` | *OptionalNullable[float]* | :heavy_minus_sign: | Minimum prompt price in $/M tokens. | 0 |
|
||||||
| `max_price` | *OptionalNullable[float]* | :heavy_minus_sign: | Maximum prompt price in $/M tokens. | 10 |
|
| `max_price` | *OptionalNullable[float]* | :heavy_minus_sign: | Maximum prompt price in $/M tokens. | 10 |
|
||||||
| `arch` | *Optional[str]* | :heavy_minus_sign: | Filter models by architecture/model family (e.g. GPT, Claude, Gemini, Llama). | GPT |
|
| `arch` | *Optional[str]* | :heavy_minus_sign: | Filter models by architecture/model family (e.g. GPT, Claude, Gemini, Llama). | GPT |
|
||||||
| `model_authors` | *Optional[str]* | :heavy_minus_sign: | Filter models by the organization that created the model. Comma-separated list of author slugs. | openai,anthropic |
|
| `model_authors` | *Optional[str]* | :heavy_minus_sign: | Filter models by the organization that created the model. Comma-separated list of author slugs. | openai,anthropic |
|
||||||
| `providers` | *Optional[str]* | :heavy_minus_sign: | Filter models by hosting provider. Comma-separated list of provider names. | OpenAI,Anthropic |
|
| `providers` | *Optional[str]* | :heavy_minus_sign: | Filter models by hosting provider. Comma-separated list of provider names. | OpenAI,Anthropic |
|
||||||
| `distillable` | [Optional[operations.Distillable]](../operations/distillable.md) | :heavy_minus_sign: | Filter by distillation capability. "true" returns only distillable models, "false" excludes them. | true |
|
| `distillable` | [Optional[operations.Distillable]](../operations/distillable.md) | :heavy_minus_sign: | Filter by distillation capability. "true" returns only distillable models, "false" excludes them. | true |
|
||||||
| `zdr` | [Optional[operations.Zdr]](../operations/zdr.md) | :heavy_minus_sign: | When set to "true", return only models with zero data retention endpoints. | true |
|
| `zdr` | [Optional[operations.Zdr]](../operations/zdr.md) | :heavy_minus_sign: | When set to "true", return only models with zero data retention endpoints. | true |
|
||||||
| `region` | [Optional[operations.Region]](../operations/region.md) | :heavy_minus_sign: | Filter to models with endpoints in the given data region. Currently only "eu" is supported. | eu |
|
| `region` | [Optional[operations.Region]](../operations/region.md) | :heavy_minus_sign: | Filter to models with endpoints in the given data region. Currently only "eu" is supported. | eu |
|
||||||
@@ -113,7 +113,7 @@ with OpenRouter(
|
|||||||
|
|
||||||
## create
|
## create
|
||||||
|
|
||||||
Create a new API key for the authenticated user. [Management key](/docs/guides/overview/auth/management-api-keys) required.
|
Create a new API key for the authenticated user. The plaintext `key` is returned only in this response. Treat it as a write-only, sensitive value; it cannot be retrieved later. [Management key](/docs/guides/overview/auth/management-api-keys) required.
|
||||||
|
|
||||||
### Example Usage
|
### Example Usage
|
||||||
|
|
||||||
|
|||||||
@@ -241,7 +241,7 @@ with OpenRouter(
|
|||||||
|
|
||||||
## update
|
## update
|
||||||
|
|
||||||
Update an existing guardrail. [Management key](/docs/guides/overview/auth/management-api-keys) required.
|
Update an existing guardrail. Collection fields use replace semantics: send the full desired set on every update. [Management key](/docs/guides/overview/auth/management-api-keys) required.
|
||||||
|
|
||||||
### Example Usage
|
### Example Usage
|
||||||
|
|
||||||
@@ -359,7 +359,7 @@ with OpenRouter(
|
|||||||
|
|
||||||
## bulk_assign_keys
|
## bulk_assign_keys
|
||||||
|
|
||||||
Assign multiple API keys to a specific guardrail. [Management key](/docs/guides/overview/auth/management-api-keys) required.
|
Assign multiple API keys to a specific guardrail. A key may hold at most one guardrail; assigning replaces any existing assignment. [Management key](/docs/guides/overview/auth/management-api-keys) required.
|
||||||
|
|
||||||
### Example Usage
|
### Example Usage
|
||||||
|
|
||||||
|
|||||||
+21
-21
@@ -88,27 +88,27 @@ with OpenRouter(
|
|||||||
|
|
||||||
### Parameters
|
### Parameters
|
||||||
|
|
||||||
| Parameter | Type | Required | Description | Example |
|
| Parameter | Type | Required | Description | Example |
|
||||||
| ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
||||||
| `http_referer` | *Optional[str]* | :heavy_minus_sign: | The app identifier should be your app's URL and is used as the primary identifier for rankings.<br/>This is used to track API usage per application.<br/> | |
|
| `http_referer` | *Optional[str]* | :heavy_minus_sign: | The app identifier should be your app's URL and is used as the primary identifier for rankings.<br/>This is used to track API usage per application.<br/> | |
|
||||||
| `x_open_router_title` | *Optional[str]* | :heavy_minus_sign: | The app display name allows you to customize how your app appears in OpenRouter's dashboard.<br/> | |
|
| `x_open_router_title` | *Optional[str]* | :heavy_minus_sign: | The app display name allows you to customize how your app appears in OpenRouter's dashboard.<br/> | |
|
||||||
| `x_open_router_categories` | *Optional[str]* | :heavy_minus_sign: | Comma-separated list of app categories (e.g. "cli-agent,cloud-agent"). Used for marketplace rankings.<br/> | |
|
| `x_open_router_categories` | *Optional[str]* | :heavy_minus_sign: | Comma-separated list of app categories (e.g. "cli-agent,cloud-agent"). Used for marketplace rankings.<br/> | |
|
||||||
| `category` | [Optional[operations.GetModelsCategory]](../../operations/getmodelscategory.md) | :heavy_minus_sign: | Filter models by use case category | programming |
|
| `category` | [Optional[operations.GetModelsCategory]](../../operations/getmodelscategory.md) | :heavy_minus_sign: | Filter models by use case category | programming |
|
||||||
| `supported_parameters` | *Optional[str]* | :heavy_minus_sign: | Filter models by supported parameter (comma-separated) | temperature |
|
| `supported_parameters` | *Optional[str]* | :heavy_minus_sign: | Filter models by supported parameter (comma-separated) | temperature |
|
||||||
| `output_modalities` | *Optional[str]* | :heavy_minus_sign: | Filter models by output modality. Accepts a comma-separated list of modalities (text, image, audio, embeddings) or "all" to include all models. Defaults to "text". | text |
|
| `output_modalities` | *Optional[str]* | :heavy_minus_sign: | Filter models by output modality. Accepts a comma-separated list of modalities (text, image, audio, embeddings) or "all" to include all models. Defaults to "text". | text |
|
||||||
| `sort` | [Optional[operations.GetModelsSort]](../../operations/getmodelssort.md) | :heavy_minus_sign: | Sort the returned models server-side. Prefer this over fetching the full list and sorting client-side. Options: pricing-low-to-high, pricing-high-to-low (average prompt/completion price), context-high-to-low (context length), throughput-high-to-low, latency-low-to-high (recent median performance), most-popular, top-weekly (tokens processed in the last week), newest (creation date). When omitted, the existing default ordering is preserved. | newest |
|
| `sort` | [Optional[operations.GetModelsSort]](../../operations/getmodelssort.md) | :heavy_minus_sign: | Sort the returned models server-side. Prefer this over fetching the full list and sorting client-side. Options: pricing-low-to-high, pricing-high-to-low (average prompt/completion price), context-high-to-low (context length), throughput-high-to-low, latency-low-to-high (recent median performance), most-popular, top-weekly (tokens processed in the last week), newest (creation date), intelligence-high-to-low (Artificial Analysis intelligence index), design-arena-elo-high-to-low (best Design Arena ELO across arenas). Models without a score for the chosen benchmark are placed last. When omitted, the existing default ordering is preserved. | newest |
|
||||||
| `q` | *Optional[str]* | :heavy_minus_sign: | Free-text search by model name or slug. | gpt-4 |
|
| `q` | *Optional[str]* | :heavy_minus_sign: | Free-text search by model name or slug. | gpt-4 |
|
||||||
| `input_modalities` | *Optional[str]* | :heavy_minus_sign: | Filter models by input modality. Comma-separated list of: text, image, audio, file. | text,image |
|
| `input_modalities` | *Optional[str]* | :heavy_minus_sign: | Filter models by input modality. Comma-separated list of: text, image, audio, file. | text,image |
|
||||||
| `context` | *Optional[int]* | :heavy_minus_sign: | Minimum context length (tokens). Models with smaller context are excluded. | 128000 |
|
| `context` | *Optional[int]* | :heavy_minus_sign: | Minimum context length (tokens). Models with smaller context are excluded. | 128000 |
|
||||||
| `min_price` | *OptionalNullable[float]* | :heavy_minus_sign: | Minimum prompt price in $/M tokens. | 0 |
|
| `min_price` | *OptionalNullable[float]* | :heavy_minus_sign: | Minimum prompt price in $/M tokens. | 0 |
|
||||||
| `max_price` | *OptionalNullable[float]* | :heavy_minus_sign: | Maximum prompt price in $/M tokens. | 10 |
|
| `max_price` | *OptionalNullable[float]* | :heavy_minus_sign: | Maximum prompt price in $/M tokens. | 10 |
|
||||||
| `arch` | *Optional[str]* | :heavy_minus_sign: | Filter models by architecture/model family (e.g. GPT, Claude, Gemini, Llama). | GPT |
|
| `arch` | *Optional[str]* | :heavy_minus_sign: | Filter models by architecture/model family (e.g. GPT, Claude, Gemini, Llama). | GPT |
|
||||||
| `model_authors` | *Optional[str]* | :heavy_minus_sign: | Filter models by the organization that created the model. Comma-separated list of author slugs. | openai,anthropic |
|
| `model_authors` | *Optional[str]* | :heavy_minus_sign: | Filter models by the organization that created the model. Comma-separated list of author slugs. | openai,anthropic |
|
||||||
| `providers` | *Optional[str]* | :heavy_minus_sign: | Filter models by hosting provider. Comma-separated list of provider names. | OpenAI,Anthropic |
|
| `providers` | *Optional[str]* | :heavy_minus_sign: | Filter models by hosting provider. Comma-separated list of provider names. | OpenAI,Anthropic |
|
||||||
| `distillable` | [Optional[operations.Distillable]](../../operations/distillable.md) | :heavy_minus_sign: | Filter by distillation capability. "true" returns only distillable models, "false" excludes them. | true |
|
| `distillable` | [Optional[operations.Distillable]](../../operations/distillable.md) | :heavy_minus_sign: | Filter by distillation capability. "true" returns only distillable models, "false" excludes them. | true |
|
||||||
| `zdr` | [Optional[operations.Zdr]](../../operations/zdr.md) | :heavy_minus_sign: | When set to "true", return only models with zero data retention endpoints. | true |
|
| `zdr` | [Optional[operations.Zdr]](../../operations/zdr.md) | :heavy_minus_sign: | When set to "true", return only models with zero data retention endpoints. | true |
|
||||||
| `region` | [Optional[operations.Region]](../../operations/region.md) | :heavy_minus_sign: | Filter to models with endpoints in the given data region. Currently only "eu" is supported. | eu |
|
| `region` | [Optional[operations.Region]](../../operations/region.md) | :heavy_minus_sign: | Filter to models with endpoints in the given data region. Currently only "eu" is supported. | eu |
|
||||||
| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | |
|
| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | |
|
||||||
|
|
||||||
### Response
|
### Response
|
||||||
|
|
||||||
|
|||||||
@@ -46,6 +46,7 @@ with OpenRouter(
|
|||||||
| `x_open_router_metadata` | [Optional[components.MetadataLevel]](../../components/metadatalevel.md) | :heavy_minus_sign: | Opt-in to surface routing metadata on the response under `openrouter_metadata`. Defaults to `disabled`. The legacy header `X-OpenRouter-Experimental-Metadata` is also accepted for backward compatibility. | enabled |
|
| `x_open_router_metadata` | [Optional[components.MetadataLevel]](../../components/metadatalevel.md) | :heavy_minus_sign: | Opt-in to surface routing metadata on the response under `openrouter_metadata`. Defaults to `disabled`. The legacy header `X-OpenRouter-Experimental-Metadata` is also accepted for backward compatibility. | enabled |
|
||||||
| `background` | *OptionalNullable[bool]* | :heavy_minus_sign: | N/A | |
|
| `background` | *OptionalNullable[bool]* | :heavy_minus_sign: | N/A | |
|
||||||
| `cache_control` | [Optional[components.AnthropicCacheControlDirective]](../../components/anthropiccachecontroldirective.md) | :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/>} |
|
| `cache_control` | [Optional[components.AnthropicCacheControlDirective]](../../components/anthropiccachecontroldirective.md) | :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/>} |
|
||||||
|
| `debug` | [Optional[components.ChatDebugOptions]](../../components/chatdebugoptions.md) | :heavy_minus_sign: | Debug options for inspecting request transformations (streaming only) | {<br/>"echo_upstream_body": true<br/>} |
|
||||||
| `frequency_penalty` | *OptionalNullable[float]* | :heavy_minus_sign: | N/A | |
|
| `frequency_penalty` | *OptionalNullable[float]* | :heavy_minus_sign: | N/A | |
|
||||||
| `image_config` | Dict[str, [components.ImageConfig](../../components/imageconfig.md)] | :heavy_minus_sign: | Provider-specific image configuration options. Keys and values vary by model/provider. See https://openrouter.ai/docs/guides/overview/multimodal/image-generation for more details. | {<br/>"aspect_ratio": "16:9",<br/>"quality": "high"<br/>} |
|
| `image_config` | Dict[str, [components.ImageConfig](../../components/imageconfig.md)] | :heavy_minus_sign: | Provider-specific image configuration options. Keys and values vary by model/provider. See https://openrouter.ai/docs/guides/overview/multimodal/image-generation for more details. | {<br/>"aspect_ratio": "16:9",<br/>"quality": "high"<br/>} |
|
||||||
| `include` | List[[components.ResponseIncludesEnum](../../components/responseincludesenum.md)] | :heavy_minus_sign: | N/A | |
|
| `include` | List[[components.ResponseIncludesEnum](../../components/responseincludesenum.md)] | :heavy_minus_sign: | N/A | |
|
||||||
|
|||||||
+1
-1
@@ -1,6 +1,6 @@
|
|||||||
[project]
|
[project]
|
||||||
name = "openrouter"
|
name = "openrouter"
|
||||||
version = "0.10.1"
|
version = "0.10.8"
|
||||||
description = "Official Python Client SDK for OpenRouter."
|
description = "Official Python Client SDK for OpenRouter."
|
||||||
authors = [{ name = "OpenRouter" },]
|
authors = [{ name = "OpenRouter" },]
|
||||||
readme = "README-PYPI.md"
|
readme = "README-PYPI.md"
|
||||||
|
|||||||
@@ -3,10 +3,10 @@
|
|||||||
import importlib.metadata
|
import importlib.metadata
|
||||||
|
|
||||||
__title__: str = "openrouter"
|
__title__: str = "openrouter"
|
||||||
__version__: str = "0.10.1"
|
__version__: str = "0.10.8"
|
||||||
__openapi_doc_version__: str = "1.0.0"
|
__openapi_doc_version__: str = "1.0.0"
|
||||||
__gen_version__: str = "2.788.4"
|
__gen_version__: str = "2.788.4"
|
||||||
__user_agent__: str = "speakeasy-sdk/python 0.10.1 2.788.4 1.0.0 openrouter"
|
__user_agent__: str = "speakeasy-sdk/python 0.10.8 2.788.4 1.0.0 openrouter"
|
||||||
|
|
||||||
try:
|
try:
|
||||||
if __package__ is not None:
|
if __package__ is not None:
|
||||||
|
|||||||
@@ -533,7 +533,7 @@ class APIKeys(BaseSDK):
|
|||||||
) -> operations.CreateKeysResponse:
|
) -> operations.CreateKeysResponse:
|
||||||
r"""Create a new API key
|
r"""Create a new API key
|
||||||
|
|
||||||
Create a new API key for the authenticated user. [Management key](/docs/guides/overview/auth/management-api-keys) required.
|
Create a new API key for the authenticated user. The plaintext `key` is returned only in this response. Treat it as a write-only, sensitive value; it cannot be retrieved later. [Management key](/docs/guides/overview/auth/management-api-keys) required.
|
||||||
|
|
||||||
:param name: Name for the new API key
|
:param name: Name for the new API key
|
||||||
:param http_referer: The app identifier should be your app's URL and is used as the primary identifier for rankings.
|
:param http_referer: The app identifier should be your app's URL and is used as the primary identifier for rankings.
|
||||||
@@ -696,7 +696,7 @@ class APIKeys(BaseSDK):
|
|||||||
) -> operations.CreateKeysResponse:
|
) -> operations.CreateKeysResponse:
|
||||||
r"""Create a new API key
|
r"""Create a new API key
|
||||||
|
|
||||||
Create a new API key for the authenticated user. [Management key](/docs/guides/overview/auth/management-api-keys) required.
|
Create a new API key for the authenticated user. The plaintext `key` is returned only in this response. Treat it as a write-only, sensitive value; it cannot be retrieved later. [Management key](/docs/guides/overview/auth/management-api-keys) required.
|
||||||
|
|
||||||
:param name: Name for the new API key
|
:param name: Name for the new API key
|
||||||
:param http_referer: The app identifier should be your app's URL and is used as the primary identifier for rankings.
|
:param http_referer: The app identifier should be your app's URL and is used as the primary identifier for rankings.
|
||||||
|
|||||||
@@ -15,14 +15,14 @@ class Benchmarks(BaseSDK):
|
|||||||
def get_benchmarks(
|
def get_benchmarks(
|
||||||
self,
|
self,
|
||||||
*,
|
*,
|
||||||
source: operations.Source,
|
|
||||||
http_referer: Optional[str] = None,
|
http_referer: Optional[str] = None,
|
||||||
x_open_router_title: Optional[str] = None,
|
x_open_router_title: Optional[str] = None,
|
||||||
x_open_router_categories: Optional[str] = None,
|
x_open_router_categories: Optional[str] = None,
|
||||||
|
source: Optional[operations.Source] = None,
|
||||||
task_type: Optional[operations.TaskType] = None,
|
task_type: Optional[operations.TaskType] = None,
|
||||||
arena: Optional[operations.Arena] = None,
|
arena: Optional[operations.Arena] = None,
|
||||||
category: Optional[str] = None,
|
category: Optional[str] = None,
|
||||||
max_results: Optional[int] = 50,
|
max_results: Optional[int] = None,
|
||||||
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
||||||
server_url: Optional[str] = None,
|
server_url: Optional[str] = None,
|
||||||
timeout_ms: Optional[int] = None,
|
timeout_ms: Optional[int] = None,
|
||||||
@@ -32,7 +32,6 @@ class Benchmarks(BaseSDK):
|
|||||||
|
|
||||||
Unified benchmark endpoint that aggregates scores from multiple benchmark sources (Artificial Analysis, Design Arena). Filter by source to reproduce the exact shapes from the legacy per-source endpoints, or use task_type to find models suited for specific workloads. Authenticate with any valid OpenRouter API key. Rate-limited to 30 requests/minute per key and 500 requests/day per account.
|
Unified benchmark endpoint that aggregates scores from multiple benchmark sources (Artificial Analysis, Design Arena). Filter by source to reproduce the exact shapes from the legacy per-source endpoints, or use task_type to find models suited for specific workloads. Authenticate with any valid OpenRouter API key. Rate-limited to 30 requests/minute per key and 500 requests/day per account.
|
||||||
|
|
||||||
:param source: Benchmark source to query. Determines the shape of the returned items.
|
|
||||||
:param http_referer: The app identifier should be your app's URL and is used as the primary identifier for rankings.
|
:param http_referer: The app identifier should be your app's URL and is used as the primary identifier for rankings.
|
||||||
This is used to track API usage per application.
|
This is used to track API usage per application.
|
||||||
|
|
||||||
@@ -40,10 +39,11 @@ class Benchmarks(BaseSDK):
|
|||||||
|
|
||||||
:param x_open_router_categories: Comma-separated list of app categories (e.g. \"cli-agent,cloud-agent\"). Used for marketplace rankings.
|
:param x_open_router_categories: Comma-separated list of app categories (e.g. \"cli-agent,cloud-agent\"). Used for marketplace rankings.
|
||||||
|
|
||||||
|
:param source: Benchmark source to query. Determines the shape of the returned items. When omitted, returns results from all sources.
|
||||||
:param task_type: Filter results by task type. For Artificial Analysis, maps to the corresponding index. For Design Arena, maps to the matching category.
|
:param task_type: Filter results by task type. For Artificial Analysis, maps to the corresponding index. For Design Arena, maps to the matching category.
|
||||||
:param arena: Design Arena only: arena to query. Defaults to `models` when source is `design-arena`.
|
:param arena: Design Arena only: arena to query. Defaults to `models` when source is `design-arena`.
|
||||||
:param category: Design Arena only: category within the arena (e.g. `codecategories`, `uicomponent`, `gamedev`, `3d`, `dataviz`, `image`, `video`, `svg`). When omitted, returns all categories.
|
:param category: Design Arena only: category within the arena (e.g. `codecategories`, `uicomponent`, `gamedev`, `3d`, `dataviz`, `image`, `video`, `svg`). When omitted, returns all categories.
|
||||||
:param max_results: Max results to return (1–100, default 50).
|
:param max_results: Maximum number of items to return. When omitted, all matching results are returned.
|
||||||
:param retries: Override the default retry configuration for this method
|
:param retries: Override the default retry configuration for this method
|
||||||
:param server_url: Override the default server URL for this method
|
:param server_url: Override the default server URL for this method
|
||||||
:param timeout_ms: Override the default request timeout configuration for this method in milliseconds
|
:param timeout_ms: Override the default request timeout configuration for this method in milliseconds
|
||||||
@@ -160,14 +160,14 @@ class Benchmarks(BaseSDK):
|
|||||||
async def get_benchmarks_async(
|
async def get_benchmarks_async(
|
||||||
self,
|
self,
|
||||||
*,
|
*,
|
||||||
source: operations.Source,
|
|
||||||
http_referer: Optional[str] = None,
|
http_referer: Optional[str] = None,
|
||||||
x_open_router_title: Optional[str] = None,
|
x_open_router_title: Optional[str] = None,
|
||||||
x_open_router_categories: Optional[str] = None,
|
x_open_router_categories: Optional[str] = None,
|
||||||
|
source: Optional[operations.Source] = None,
|
||||||
task_type: Optional[operations.TaskType] = None,
|
task_type: Optional[operations.TaskType] = None,
|
||||||
arena: Optional[operations.Arena] = None,
|
arena: Optional[operations.Arena] = None,
|
||||||
category: Optional[str] = None,
|
category: Optional[str] = None,
|
||||||
max_results: Optional[int] = 50,
|
max_results: Optional[int] = None,
|
||||||
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
||||||
server_url: Optional[str] = None,
|
server_url: Optional[str] = None,
|
||||||
timeout_ms: Optional[int] = None,
|
timeout_ms: Optional[int] = None,
|
||||||
@@ -177,7 +177,6 @@ class Benchmarks(BaseSDK):
|
|||||||
|
|
||||||
Unified benchmark endpoint that aggregates scores from multiple benchmark sources (Artificial Analysis, Design Arena). Filter by source to reproduce the exact shapes from the legacy per-source endpoints, or use task_type to find models suited for specific workloads. Authenticate with any valid OpenRouter API key. Rate-limited to 30 requests/minute per key and 500 requests/day per account.
|
Unified benchmark endpoint that aggregates scores from multiple benchmark sources (Artificial Analysis, Design Arena). Filter by source to reproduce the exact shapes from the legacy per-source endpoints, or use task_type to find models suited for specific workloads. Authenticate with any valid OpenRouter API key. Rate-limited to 30 requests/minute per key and 500 requests/day per account.
|
||||||
|
|
||||||
:param source: Benchmark source to query. Determines the shape of the returned items.
|
|
||||||
:param http_referer: The app identifier should be your app's URL and is used as the primary identifier for rankings.
|
:param http_referer: The app identifier should be your app's URL and is used as the primary identifier for rankings.
|
||||||
This is used to track API usage per application.
|
This is used to track API usage per application.
|
||||||
|
|
||||||
@@ -185,10 +184,11 @@ class Benchmarks(BaseSDK):
|
|||||||
|
|
||||||
:param x_open_router_categories: Comma-separated list of app categories (e.g. \"cli-agent,cloud-agent\"). Used for marketplace rankings.
|
:param x_open_router_categories: Comma-separated list of app categories (e.g. \"cli-agent,cloud-agent\"). Used for marketplace rankings.
|
||||||
|
|
||||||
|
:param source: Benchmark source to query. Determines the shape of the returned items. When omitted, returns results from all sources.
|
||||||
:param task_type: Filter results by task type. For Artificial Analysis, maps to the corresponding index. For Design Arena, maps to the matching category.
|
:param task_type: Filter results by task type. For Artificial Analysis, maps to the corresponding index. For Design Arena, maps to the matching category.
|
||||||
:param arena: Design Arena only: arena to query. Defaults to `models` when source is `design-arena`.
|
:param arena: Design Arena only: arena to query. Defaults to `models` when source is `design-arena`.
|
||||||
:param category: Design Arena only: category within the arena (e.g. `codecategories`, `uicomponent`, `gamedev`, `3d`, `dataviz`, `image`, `video`, `svg`). When omitted, returns all categories.
|
:param category: Design Arena only: category within the arena (e.g. `codecategories`, `uicomponent`, `gamedev`, `3d`, `dataviz`, `image`, `video`, `svg`). When omitted, returns all categories.
|
||||||
:param max_results: Max results to return (1–100, default 50).
|
:param max_results: Maximum number of items to return. When omitted, all matching results are returned.
|
||||||
:param retries: Override the default retry configuration for this method
|
:param retries: Override the default retry configuration for this method
|
||||||
:param server_url: Override the default server URL for this method
|
:param server_url: Override the default server URL for this method
|
||||||
:param timeout_ms: Override the default request timeout configuration for this method in milliseconds
|
:param timeout_ms: Override the default request timeout configuration for this method in milliseconds
|
||||||
|
|||||||
@@ -359,7 +359,7 @@ class Byok(BaseSDK):
|
|||||||
) -> components.CreateBYOKKeyResponse:
|
) -> components.CreateBYOKKeyResponse:
|
||||||
r"""Create a BYOK provider credential
|
r"""Create a BYOK provider credential
|
||||||
|
|
||||||
Create a new bring-your-own-key (BYOK) provider credential. The raw key is encrypted at rest and never returned in API responses. Defaults to the authenticated entity's default workspace; use the `workspace_id` body field to scope to a different workspace. [Management key](/docs/guides/overview/auth/management-api-keys) required.
|
Create a new bring-your-own-key (BYOK) provider credential. The raw key is encrypted at rest and never returned in API responses. Defaults to the authenticated entity's default workspace; use the `workspace_id` body field to scope to a different workspace. Treat the raw key as write-only; it is never returned after creation. [Management key](/docs/guides/overview/auth/management-api-keys) required.
|
||||||
|
|
||||||
:param key: The raw provider API key or credential. This value is encrypted at rest and never returned in API responses.
|
:param key: The raw provider API key or credential. This value is encrypted at rest and never returned in API responses.
|
||||||
:param provider: The upstream provider this credential authenticates against, as a lowercase slug (e.g. `openai`, `anthropic`, `amazon-bedrock`).
|
:param provider: The upstream provider this credential authenticates against, as a lowercase slug (e.g. `openai`, `anthropic`, `amazon-bedrock`).
|
||||||
@@ -520,7 +520,7 @@ class Byok(BaseSDK):
|
|||||||
) -> components.CreateBYOKKeyResponse:
|
) -> components.CreateBYOKKeyResponse:
|
||||||
r"""Create a BYOK provider credential
|
r"""Create a BYOK provider credential
|
||||||
|
|
||||||
Create a new bring-your-own-key (BYOK) provider credential. The raw key is encrypted at rest and never returned in API responses. Defaults to the authenticated entity's default workspace; use the `workspace_id` body field to scope to a different workspace. [Management key](/docs/guides/overview/auth/management-api-keys) required.
|
Create a new bring-your-own-key (BYOK) provider credential. The raw key is encrypted at rest and never returned in API responses. Defaults to the authenticated entity's default workspace; use the `workspace_id` body field to scope to a different workspace. Treat the raw key as write-only; it is never returned after creation. [Management key](/docs/guides/overview/auth/management-api-keys) required.
|
||||||
|
|
||||||
:param key: The raw provider API key or credential. This value is encrypted at rest and never returned in API responses.
|
:param key: The raw provider API key or credential. This value is encrypted at rest and never returned in API responses.
|
||||||
:param provider: The upstream provider this credential authenticates against, as a lowercase slug (e.g. `openai`, `anthropic`, `amazon-bedrock`).
|
:param provider: The upstream provider this credential authenticates against, as a lowercase slug (e.g. `openai`, `anthropic`, `amazon-bedrock`).
|
||||||
|
|||||||
@@ -0,0 +1,315 @@
|
|||||||
|
"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
|
||||||
|
|
||||||
|
from .basesdk import BaseSDK
|
||||||
|
from openrouter import components, errors, operations, utils
|
||||||
|
from openrouter._hooks import HookContext
|
||||||
|
from openrouter.types import OptionalNullable, UNSET
|
||||||
|
from openrouter.utils import get_security_from_env
|
||||||
|
from openrouter.utils.unmarshal_json_response import unmarshal_json_response
|
||||||
|
from typing import Any, Mapping, Optional
|
||||||
|
|
||||||
|
|
||||||
|
class Classifications(BaseSDK):
|
||||||
|
r"""Task classification market-share endpoints"""
|
||||||
|
|
||||||
|
def get_task_classifications(
|
||||||
|
self,
|
||||||
|
*,
|
||||||
|
http_referer: Optional[str] = None,
|
||||||
|
x_open_router_title: Optional[str] = None,
|
||||||
|
x_open_router_categories: Optional[str] = None,
|
||||||
|
window: Optional[operations.Window] = "7d",
|
||||||
|
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
||||||
|
server_url: Optional[str] = None,
|
||||||
|
timeout_ms: Optional[int] = None,
|
||||||
|
http_headers: Optional[Mapping[str, str]] = None,
|
||||||
|
) -> components.TaskClassificationResponse:
|
||||||
|
r"""Task classification market share
|
||||||
|
|
||||||
|
Returns the market-share breakdown of OpenRouter traffic by task classification
|
||||||
|
(e.g. code generation, web search, summarization) over a trailing time window.
|
||||||
|
|
||||||
|
Each classification reports its share of classified sampled requests (`usage_share`)
|
||||||
|
and classified sampled token volume (`token_share`) as fractions between 0 and 1.
|
||||||
|
The unclassified `other` bucket is excluded. Absolute volumes are not exposed
|
||||||
|
because the underlying data is sampled.
|
||||||
|
|
||||||
|
Each classification also includes a `models` array listing the top models by
|
||||||
|
request volume within that classification, with their within-tag usage and token shares.
|
||||||
|
|
||||||
|
Classifications are grouped into macro-categories (Code, Data, Agent, General)
|
||||||
|
with aggregate shares provided for each.
|
||||||
|
|
||||||
|
Authenticate with any valid OpenRouter API key (same key used for inference).
|
||||||
|
Rate-limited to 30 requests/minute per key and 500 requests/day per account.
|
||||||
|
|
||||||
|
When republishing or quoting this data, cite as:
|
||||||
|
\"Source: OpenRouter (openrouter.ai/rankings), as of {as_of}.\"
|
||||||
|
|
||||||
|
:param http_referer: The app identifier should be your app's URL and is used as the primary identifier for rankings.
|
||||||
|
This is used to track API usage per application.
|
||||||
|
|
||||||
|
:param x_open_router_title: The app display name allows you to customize how your app appears in OpenRouter's dashboard.
|
||||||
|
|
||||||
|
:param x_open_router_categories: Comma-separated list of app categories (e.g. \"cli-agent,cloud-agent\"). Used for marketplace rankings.
|
||||||
|
|
||||||
|
:param window: Trailing time window for the classification data. Currently only `7d` (trailing 7 days) is supported.
|
||||||
|
:param retries: Override the default retry configuration for this method
|
||||||
|
:param server_url: Override the default server URL for this method
|
||||||
|
:param timeout_ms: Override the default request timeout configuration for this method in milliseconds
|
||||||
|
:param http_headers: Additional headers to set or replace on requests.
|
||||||
|
"""
|
||||||
|
base_url = None
|
||||||
|
url_variables = None
|
||||||
|
if timeout_ms is None:
|
||||||
|
timeout_ms = self.sdk_configuration.timeout_ms
|
||||||
|
|
||||||
|
if server_url is not None:
|
||||||
|
base_url = server_url
|
||||||
|
else:
|
||||||
|
base_url = self._get_url(base_url, url_variables)
|
||||||
|
|
||||||
|
request = operations.GetTaskClassificationsRequest(
|
||||||
|
http_referer=http_referer,
|
||||||
|
x_open_router_title=x_open_router_title,
|
||||||
|
x_open_router_categories=x_open_router_categories,
|
||||||
|
window=window,
|
||||||
|
)
|
||||||
|
|
||||||
|
req = self._build_request(
|
||||||
|
method="GET",
|
||||||
|
path="/classifications/task",
|
||||||
|
base_url=base_url,
|
||||||
|
url_variables=url_variables,
|
||||||
|
request=request,
|
||||||
|
request_body_required=False,
|
||||||
|
request_has_path_params=False,
|
||||||
|
request_has_query_params=True,
|
||||||
|
user_agent_header="user-agent",
|
||||||
|
accept_header_value="application/json",
|
||||||
|
http_headers=http_headers,
|
||||||
|
_globals=operations.GetTaskClassificationsGlobals(
|
||||||
|
http_referer=self.sdk_configuration.globals.http_referer,
|
||||||
|
x_open_router_title=self.sdk_configuration.globals.x_open_router_title,
|
||||||
|
x_open_router_categories=self.sdk_configuration.globals.x_open_router_categories,
|
||||||
|
),
|
||||||
|
security=self.sdk_configuration.security,
|
||||||
|
allow_empty_value=None,
|
||||||
|
timeout_ms=timeout_ms,
|
||||||
|
)
|
||||||
|
|
||||||
|
if retries == UNSET:
|
||||||
|
if self.sdk_configuration.retry_config is not UNSET:
|
||||||
|
retries = self.sdk_configuration.retry_config
|
||||||
|
else:
|
||||||
|
retries = utils.RetryConfig(
|
||||||
|
"backoff", utils.BackoffStrategy(500, 60000, 1.5, 3600000), True
|
||||||
|
)
|
||||||
|
|
||||||
|
retry_config = None
|
||||||
|
if isinstance(retries, utils.RetryConfig):
|
||||||
|
retry_config = (retries, ["5XX"])
|
||||||
|
|
||||||
|
http_res = self.do_request(
|
||||||
|
hook_ctx=HookContext(
|
||||||
|
config=self.sdk_configuration,
|
||||||
|
base_url=base_url or "",
|
||||||
|
operation_id="getTaskClassifications",
|
||||||
|
oauth2_scopes=None,
|
||||||
|
security_source=get_security_from_env(
|
||||||
|
self.sdk_configuration.security, components.Security
|
||||||
|
),
|
||||||
|
),
|
||||||
|
request=req,
|
||||||
|
error_status_codes=["400", "401", "429", "4XX", "500", "5XX"],
|
||||||
|
retry_config=retry_config,
|
||||||
|
)
|
||||||
|
|
||||||
|
response_data: Any = None
|
||||||
|
if utils.match_response(http_res, "200", "application/json"):
|
||||||
|
return unmarshal_json_response(
|
||||||
|
components.TaskClassificationResponse, http_res
|
||||||
|
)
|
||||||
|
if utils.match_response(http_res, "400", "application/json"):
|
||||||
|
response_data = unmarshal_json_response(
|
||||||
|
errors.BadRequestResponseErrorData, http_res
|
||||||
|
)
|
||||||
|
raise errors.BadRequestResponseError(response_data, http_res)
|
||||||
|
if utils.match_response(http_res, "401", "application/json"):
|
||||||
|
response_data = unmarshal_json_response(
|
||||||
|
errors.UnauthorizedResponseErrorData, http_res
|
||||||
|
)
|
||||||
|
raise errors.UnauthorizedResponseError(response_data, http_res)
|
||||||
|
if utils.match_response(http_res, "429", "application/json"):
|
||||||
|
response_data = unmarshal_json_response(
|
||||||
|
errors.TooManyRequestsResponseErrorData, http_res
|
||||||
|
)
|
||||||
|
raise errors.TooManyRequestsResponseError(response_data, http_res)
|
||||||
|
if utils.match_response(http_res, "500", "application/json"):
|
||||||
|
response_data = unmarshal_json_response(
|
||||||
|
errors.InternalServerResponseErrorData, http_res
|
||||||
|
)
|
||||||
|
raise errors.InternalServerResponseError(response_data, http_res)
|
||||||
|
if utils.match_response(http_res, "4XX", "*"):
|
||||||
|
http_res_text = utils.stream_to_text(http_res)
|
||||||
|
raise errors.OpenRouterDefaultError(
|
||||||
|
"API error occurred", http_res, http_res_text
|
||||||
|
)
|
||||||
|
if utils.match_response(http_res, "5XX", "*"):
|
||||||
|
http_res_text = utils.stream_to_text(http_res)
|
||||||
|
raise errors.OpenRouterDefaultError(
|
||||||
|
"API error occurred", http_res, http_res_text
|
||||||
|
)
|
||||||
|
|
||||||
|
raise errors.OpenRouterDefaultError("Unexpected response received", http_res)
|
||||||
|
|
||||||
|
async def get_task_classifications_async(
|
||||||
|
self,
|
||||||
|
*,
|
||||||
|
http_referer: Optional[str] = None,
|
||||||
|
x_open_router_title: Optional[str] = None,
|
||||||
|
x_open_router_categories: Optional[str] = None,
|
||||||
|
window: Optional[operations.Window] = "7d",
|
||||||
|
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
||||||
|
server_url: Optional[str] = None,
|
||||||
|
timeout_ms: Optional[int] = None,
|
||||||
|
http_headers: Optional[Mapping[str, str]] = None,
|
||||||
|
) -> components.TaskClassificationResponse:
|
||||||
|
r"""Task classification market share
|
||||||
|
|
||||||
|
Returns the market-share breakdown of OpenRouter traffic by task classification
|
||||||
|
(e.g. code generation, web search, summarization) over a trailing time window.
|
||||||
|
|
||||||
|
Each classification reports its share of classified sampled requests (`usage_share`)
|
||||||
|
and classified sampled token volume (`token_share`) as fractions between 0 and 1.
|
||||||
|
The unclassified `other` bucket is excluded. Absolute volumes are not exposed
|
||||||
|
because the underlying data is sampled.
|
||||||
|
|
||||||
|
Each classification also includes a `models` array listing the top models by
|
||||||
|
request volume within that classification, with their within-tag usage and token shares.
|
||||||
|
|
||||||
|
Classifications are grouped into macro-categories (Code, Data, Agent, General)
|
||||||
|
with aggregate shares provided for each.
|
||||||
|
|
||||||
|
Authenticate with any valid OpenRouter API key (same key used for inference).
|
||||||
|
Rate-limited to 30 requests/minute per key and 500 requests/day per account.
|
||||||
|
|
||||||
|
When republishing or quoting this data, cite as:
|
||||||
|
\"Source: OpenRouter (openrouter.ai/rankings), as of {as_of}.\"
|
||||||
|
|
||||||
|
:param http_referer: The app identifier should be your app's URL and is used as the primary identifier for rankings.
|
||||||
|
This is used to track API usage per application.
|
||||||
|
|
||||||
|
:param x_open_router_title: The app display name allows you to customize how your app appears in OpenRouter's dashboard.
|
||||||
|
|
||||||
|
:param x_open_router_categories: Comma-separated list of app categories (e.g. \"cli-agent,cloud-agent\"). Used for marketplace rankings.
|
||||||
|
|
||||||
|
:param window: Trailing time window for the classification data. Currently only `7d` (trailing 7 days) is supported.
|
||||||
|
:param retries: Override the default retry configuration for this method
|
||||||
|
:param server_url: Override the default server URL for this method
|
||||||
|
:param timeout_ms: Override the default request timeout configuration for this method in milliseconds
|
||||||
|
:param http_headers: Additional headers to set or replace on requests.
|
||||||
|
"""
|
||||||
|
base_url = None
|
||||||
|
url_variables = None
|
||||||
|
if timeout_ms is None:
|
||||||
|
timeout_ms = self.sdk_configuration.timeout_ms
|
||||||
|
|
||||||
|
if server_url is not None:
|
||||||
|
base_url = server_url
|
||||||
|
else:
|
||||||
|
base_url = self._get_url(base_url, url_variables)
|
||||||
|
|
||||||
|
request = operations.GetTaskClassificationsRequest(
|
||||||
|
http_referer=http_referer,
|
||||||
|
x_open_router_title=x_open_router_title,
|
||||||
|
x_open_router_categories=x_open_router_categories,
|
||||||
|
window=window,
|
||||||
|
)
|
||||||
|
|
||||||
|
req = self._build_request_async(
|
||||||
|
method="GET",
|
||||||
|
path="/classifications/task",
|
||||||
|
base_url=base_url,
|
||||||
|
url_variables=url_variables,
|
||||||
|
request=request,
|
||||||
|
request_body_required=False,
|
||||||
|
request_has_path_params=False,
|
||||||
|
request_has_query_params=True,
|
||||||
|
user_agent_header="user-agent",
|
||||||
|
accept_header_value="application/json",
|
||||||
|
http_headers=http_headers,
|
||||||
|
_globals=operations.GetTaskClassificationsGlobals(
|
||||||
|
http_referer=self.sdk_configuration.globals.http_referer,
|
||||||
|
x_open_router_title=self.sdk_configuration.globals.x_open_router_title,
|
||||||
|
x_open_router_categories=self.sdk_configuration.globals.x_open_router_categories,
|
||||||
|
),
|
||||||
|
security=self.sdk_configuration.security,
|
||||||
|
allow_empty_value=None,
|
||||||
|
timeout_ms=timeout_ms,
|
||||||
|
)
|
||||||
|
|
||||||
|
if retries == UNSET:
|
||||||
|
if self.sdk_configuration.retry_config is not UNSET:
|
||||||
|
retries = self.sdk_configuration.retry_config
|
||||||
|
else:
|
||||||
|
retries = utils.RetryConfig(
|
||||||
|
"backoff", utils.BackoffStrategy(500, 60000, 1.5, 3600000), True
|
||||||
|
)
|
||||||
|
|
||||||
|
retry_config = None
|
||||||
|
if isinstance(retries, utils.RetryConfig):
|
||||||
|
retry_config = (retries, ["5XX"])
|
||||||
|
|
||||||
|
http_res = await self.do_request_async(
|
||||||
|
hook_ctx=HookContext(
|
||||||
|
config=self.sdk_configuration,
|
||||||
|
base_url=base_url or "",
|
||||||
|
operation_id="getTaskClassifications",
|
||||||
|
oauth2_scopes=None,
|
||||||
|
security_source=get_security_from_env(
|
||||||
|
self.sdk_configuration.security, components.Security
|
||||||
|
),
|
||||||
|
),
|
||||||
|
request=req,
|
||||||
|
error_status_codes=["400", "401", "429", "4XX", "500", "5XX"],
|
||||||
|
retry_config=retry_config,
|
||||||
|
)
|
||||||
|
|
||||||
|
response_data: Any = None
|
||||||
|
if utils.match_response(http_res, "200", "application/json"):
|
||||||
|
return unmarshal_json_response(
|
||||||
|
components.TaskClassificationResponse, http_res
|
||||||
|
)
|
||||||
|
if utils.match_response(http_res, "400", "application/json"):
|
||||||
|
response_data = unmarshal_json_response(
|
||||||
|
errors.BadRequestResponseErrorData, http_res
|
||||||
|
)
|
||||||
|
raise errors.BadRequestResponseError(response_data, http_res)
|
||||||
|
if utils.match_response(http_res, "401", "application/json"):
|
||||||
|
response_data = unmarshal_json_response(
|
||||||
|
errors.UnauthorizedResponseErrorData, http_res
|
||||||
|
)
|
||||||
|
raise errors.UnauthorizedResponseError(response_data, http_res)
|
||||||
|
if utils.match_response(http_res, "429", "application/json"):
|
||||||
|
response_data = unmarshal_json_response(
|
||||||
|
errors.TooManyRequestsResponseErrorData, http_res
|
||||||
|
)
|
||||||
|
raise errors.TooManyRequestsResponseError(response_data, http_res)
|
||||||
|
if utils.match_response(http_res, "500", "application/json"):
|
||||||
|
response_data = unmarshal_json_response(
|
||||||
|
errors.InternalServerResponseErrorData, http_res
|
||||||
|
)
|
||||||
|
raise errors.InternalServerResponseError(response_data, http_res)
|
||||||
|
if utils.match_response(http_res, "4XX", "*"):
|
||||||
|
http_res_text = await utils.stream_to_text_async(http_res)
|
||||||
|
raise errors.OpenRouterDefaultError(
|
||||||
|
"API error occurred", http_res, http_res_text
|
||||||
|
)
|
||||||
|
if utils.match_response(http_res, "5XX", "*"):
|
||||||
|
http_res_text = await utils.stream_to_text_async(http_res)
|
||||||
|
raise errors.OpenRouterDefaultError(
|
||||||
|
"API error occurred", http_res, http_res_text
|
||||||
|
)
|
||||||
|
|
||||||
|
raise errors.OpenRouterDefaultError("Unexpected response received", http_res)
|
||||||
@@ -29,6 +29,11 @@ if TYPE_CHECKING:
|
|||||||
AnnotationAddedEventType,
|
AnnotationAddedEventType,
|
||||||
AnnotationAddedEventTypedDict,
|
AnnotationAddedEventTypedDict,
|
||||||
)
|
)
|
||||||
|
from .anthropicadvisormessageusageiteration import (
|
||||||
|
AnthropicAdvisorMessageUsageIteration,
|
||||||
|
AnthropicAdvisorMessageUsageIterationType,
|
||||||
|
AnthropicAdvisorMessageUsageIterationTypedDict,
|
||||||
|
)
|
||||||
from .anthropicallowedcallers import AnthropicAllowedCallers
|
from .anthropicallowedcallers import AnthropicAllowedCallers
|
||||||
from .anthropicbase64imagesource import (
|
from .anthropicbase64imagesource import (
|
||||||
AnthropicBase64ImageSource,
|
AnthropicBase64ImageSource,
|
||||||
@@ -72,6 +77,11 @@ if TYPE_CHECKING:
|
|||||||
AnthropicCitationWebSearchResultLocationType,
|
AnthropicCitationWebSearchResultLocationType,
|
||||||
AnthropicCitationWebSearchResultLocationTypedDict,
|
AnthropicCitationWebSearchResultLocationTypedDict,
|
||||||
)
|
)
|
||||||
|
from .anthropiccompactionusageiteration import (
|
||||||
|
AnthropicCompactionUsageIteration,
|
||||||
|
AnthropicCompactionUsageIterationType,
|
||||||
|
AnthropicCompactionUsageIterationTypedDict,
|
||||||
|
)
|
||||||
from .anthropicdocumentblockparam import (
|
from .anthropicdocumentblockparam import (
|
||||||
AnthropicDocumentBlockParam,
|
AnthropicDocumentBlockParam,
|
||||||
AnthropicDocumentBlockParamCitations,
|
AnthropicDocumentBlockParamCitations,
|
||||||
@@ -111,6 +121,15 @@ if TYPE_CHECKING:
|
|||||||
AnthropicInputTokensTriggerType,
|
AnthropicInputTokensTriggerType,
|
||||||
AnthropicInputTokensTriggerTypedDict,
|
AnthropicInputTokensTriggerTypedDict,
|
||||||
)
|
)
|
||||||
|
from .anthropiciterationcachecreation import (
|
||||||
|
AnthropicIterationCacheCreation,
|
||||||
|
AnthropicIterationCacheCreationTypedDict,
|
||||||
|
)
|
||||||
|
from .anthropicmessageusageiteration import (
|
||||||
|
AnthropicMessageUsageIteration,
|
||||||
|
AnthropicMessageUsageIterationType,
|
||||||
|
AnthropicMessageUsageIterationTypedDict,
|
||||||
|
)
|
||||||
from .anthropicplaintextsource import (
|
from .anthropicplaintextsource import (
|
||||||
AnthropicPlainTextSource,
|
AnthropicPlainTextSource,
|
||||||
AnthropicPlainTextSourceMediaType,
|
AnthropicPlainTextSourceMediaType,
|
||||||
@@ -124,6 +143,7 @@ if TYPE_CHECKING:
|
|||||||
AnthropicSearchResultBlockParamType,
|
AnthropicSearchResultBlockParamType,
|
||||||
AnthropicSearchResultBlockParamTypedDict,
|
AnthropicSearchResultBlockParamTypedDict,
|
||||||
)
|
)
|
||||||
|
from .anthropicspeed import AnthropicSpeed
|
||||||
from .anthropictextblockparam import (
|
from .anthropictextblockparam import (
|
||||||
AnthropicTextBlockParam,
|
AnthropicTextBlockParam,
|
||||||
AnthropicTextBlockParamType,
|
AnthropicTextBlockParamType,
|
||||||
@@ -147,6 +167,10 @@ if TYPE_CHECKING:
|
|||||||
AnthropicToolUsesTriggerType,
|
AnthropicToolUsesTriggerType,
|
||||||
AnthropicToolUsesTriggerTypedDict,
|
AnthropicToolUsesTriggerTypedDict,
|
||||||
)
|
)
|
||||||
|
from .anthropicunknownusageiteration import (
|
||||||
|
AnthropicUnknownUsageIteration,
|
||||||
|
AnthropicUnknownUsageIterationTypedDict,
|
||||||
|
)
|
||||||
from .anthropicurlimagesource import (
|
from .anthropicurlimagesource import (
|
||||||
AnthropicURLImageSource,
|
AnthropicURLImageSource,
|
||||||
AnthropicURLImageSourceType,
|
AnthropicURLImageSourceType,
|
||||||
@@ -157,6 +181,10 @@ if TYPE_CHECKING:
|
|||||||
AnthropicURLPdfSourceType,
|
AnthropicURLPdfSourceType,
|
||||||
AnthropicURLPdfSourceTypedDict,
|
AnthropicURLPdfSourceTypedDict,
|
||||||
)
|
)
|
||||||
|
from .anthropicusageiteration import (
|
||||||
|
AnthropicUsageIteration,
|
||||||
|
AnthropicUsageIterationTypedDict,
|
||||||
|
)
|
||||||
from .anthropicwebsearchresultblockparam import (
|
from .anthropicwebsearchresultblockparam import (
|
||||||
AnthropicWebSearchResultBlockParam,
|
AnthropicWebSearchResultBlockParam,
|
||||||
AnthropicWebSearchResultBlockParamType,
|
AnthropicWebSearchResultBlockParamType,
|
||||||
@@ -167,6 +195,7 @@ if TYPE_CHECKING:
|
|||||||
AnthropicWebSearchToolUserLocationType,
|
AnthropicWebSearchToolUserLocationType,
|
||||||
AnthropicWebSearchToolUserLocationTypedDict,
|
AnthropicWebSearchToolUserLocationTypedDict,
|
||||||
)
|
)
|
||||||
|
from .apierrortype import APIErrorType
|
||||||
from .applypatchcallitem import (
|
from .applypatchcallitem import (
|
||||||
ApplyPatchCallItem,
|
ApplyPatchCallItem,
|
||||||
ApplyPatchCallItemType,
|
ApplyPatchCallItemType,
|
||||||
@@ -276,6 +305,11 @@ if TYPE_CHECKING:
|
|||||||
BashServerToolEnvironment,
|
BashServerToolEnvironment,
|
||||||
BashServerToolEnvironmentTypedDict,
|
BashServerToolEnvironmentTypedDict,
|
||||||
)
|
)
|
||||||
|
from .booleancapability import (
|
||||||
|
BooleanCapability,
|
||||||
|
BooleanCapabilityType,
|
||||||
|
BooleanCapabilityTypedDict,
|
||||||
|
)
|
||||||
from .bulkaddworkspacemembersrequest import (
|
from .bulkaddworkspacemembersrequest import (
|
||||||
BulkAddWorkspaceMembersRequest,
|
BulkAddWorkspaceMembersRequest,
|
||||||
BulkAddWorkspaceMembersRequestTypedDict,
|
BulkAddWorkspaceMembersRequestTypedDict,
|
||||||
@@ -326,6 +360,10 @@ if TYPE_CHECKING:
|
|||||||
)
|
)
|
||||||
from .byokkey import BYOKKey, BYOKKeyTypedDict
|
from .byokkey import BYOKKey, BYOKKeyTypedDict
|
||||||
from .byokproviderslug import BYOKProviderSlug
|
from .byokproviderslug import BYOKProviderSlug
|
||||||
|
from .capabilitydescriptor import (
|
||||||
|
CapabilityDescriptor,
|
||||||
|
CapabilityDescriptorTypedDict,
|
||||||
|
)
|
||||||
from .chatassistantimages import (
|
from .chatassistantimages import (
|
||||||
ChatAssistantImages,
|
ChatAssistantImages,
|
||||||
ChatAssistantImagesImageURL,
|
ChatAssistantImagesImageURL,
|
||||||
@@ -463,10 +501,12 @@ if TYPE_CHECKING:
|
|||||||
from .chatstreamchoice import ChatStreamChoice, ChatStreamChoiceTypedDict
|
from .chatstreamchoice import ChatStreamChoice, ChatStreamChoiceTypedDict
|
||||||
from .chatstreamchunk import (
|
from .chatstreamchunk import (
|
||||||
ChatStreamChunk,
|
ChatStreamChunk,
|
||||||
|
ChatStreamChunkError,
|
||||||
|
ChatStreamChunkErrorTypedDict,
|
||||||
|
ChatStreamChunkMetadata,
|
||||||
|
ChatStreamChunkMetadataTypedDict,
|
||||||
ChatStreamChunkObject,
|
ChatStreamChunkObject,
|
||||||
ChatStreamChunkTypedDict,
|
ChatStreamChunkTypedDict,
|
||||||
Error,
|
|
||||||
ErrorTypedDict,
|
|
||||||
)
|
)
|
||||||
from .chatstreamdelta import (
|
from .chatstreamdelta import (
|
||||||
ChatStreamDelta,
|
ChatStreamDelta,
|
||||||
@@ -522,11 +562,13 @@ if TYPE_CHECKING:
|
|||||||
)
|
)
|
||||||
from .chatusage import (
|
from .chatusage import (
|
||||||
ChatUsage,
|
ChatUsage,
|
||||||
|
ChatUsageCompletionTokensDetails,
|
||||||
|
ChatUsageCompletionTokensDetailsTypedDict,
|
||||||
|
ChatUsagePromptTokensDetails,
|
||||||
|
ChatUsagePromptTokensDetailsTypedDict,
|
||||||
ChatUsageTypedDict,
|
ChatUsageTypedDict,
|
||||||
CompletionTokensDetails,
|
ServerToolUseDetails,
|
||||||
CompletionTokensDetailsTypedDict,
|
ServerToolUseDetailsTypedDict,
|
||||||
PromptTokensDetails,
|
|
||||||
PromptTokensDetailsTypedDict,
|
|
||||||
)
|
)
|
||||||
from .chatusermessage import (
|
from .chatusermessage import (
|
||||||
ChatUserMessage,
|
ChatUserMessage,
|
||||||
@@ -744,6 +786,16 @@ if TYPE_CHECKING:
|
|||||||
DatetimeServerToolConfig,
|
DatetimeServerToolConfig,
|
||||||
DatetimeServerToolConfigTypedDict,
|
DatetimeServerToolConfigTypedDict,
|
||||||
)
|
)
|
||||||
|
from .debugevent import (
|
||||||
|
Debug,
|
||||||
|
DebugEvent,
|
||||||
|
DebugEventType,
|
||||||
|
DebugEventTypedDict,
|
||||||
|
DebugTypedDict,
|
||||||
|
Event,
|
||||||
|
Timings,
|
||||||
|
TimingsTypedDict,
|
||||||
|
)
|
||||||
from .defaultparameters import DefaultParameters, DefaultParametersTypedDict
|
from .defaultparameters import DefaultParameters, DefaultParametersTypedDict
|
||||||
from .deletebyokkeyresponse import (
|
from .deletebyokkeyresponse import (
|
||||||
DeleteBYOKKeyResponse,
|
DeleteBYOKKeyResponse,
|
||||||
@@ -795,6 +847,11 @@ if TYPE_CHECKING:
|
|||||||
from .endpointinfo import EndpointInfo, EndpointInfoTypedDict
|
from .endpointinfo import EndpointInfo, EndpointInfoTypedDict
|
||||||
from .endpointsmetadata import EndpointsMetadata, EndpointsMetadataTypedDict
|
from .endpointsmetadata import EndpointsMetadata, EndpointsMetadataTypedDict
|
||||||
from .endpointstatus import EndpointStatus
|
from .endpointstatus import EndpointStatus
|
||||||
|
from .enumcapability import (
|
||||||
|
EnumCapability,
|
||||||
|
EnumCapabilityType,
|
||||||
|
EnumCapabilityTypedDict,
|
||||||
|
)
|
||||||
from .errorevent import ErrorEvent, ErrorEventType, ErrorEventTypedDict
|
from .errorevent import ErrorEvent, ErrorEventType, ErrorEventTypedDict
|
||||||
from .filecitation import FileCitation, FileCitationType, FileCitationTypedDict
|
from .filecitation import FileCitation, FileCitationType, FileCitationTypedDict
|
||||||
from .filedeleteresponse import (
|
from .filedeleteresponse import (
|
||||||
@@ -963,6 +1020,7 @@ if TYPE_CHECKING:
|
|||||||
FusionServerToolConfigToolTypedDict,
|
FusionServerToolConfigToolTypedDict,
|
||||||
FusionServerToolConfigTypedDict,
|
FusionServerToolConfigTypedDict,
|
||||||
)
|
)
|
||||||
|
from .fusionsource import FusionSource, FusionSourceTypedDict
|
||||||
from .generationcontentdata import (
|
from .generationcontentdata import (
|
||||||
GenerationContentData,
|
GenerationContentData,
|
||||||
GenerationContentDataOutput,
|
GenerationContentDataOutput,
|
||||||
@@ -1008,6 +1066,7 @@ if TYPE_CHECKING:
|
|||||||
from .guardrail import Guardrail, GuardrailTypedDict
|
from .guardrail import Guardrail, GuardrailTypedDict
|
||||||
from .guardrailinterval import GuardrailInterval
|
from .guardrailinterval import GuardrailInterval
|
||||||
from .imageconfig import ImageConfig, ImageConfigTypedDict
|
from .imageconfig import ImageConfig, ImageConfigTypedDict
|
||||||
|
from .imageendpoint import ImageEndpoint, ImageEndpointTypedDict
|
||||||
from .imagegencallcompletedevent import (
|
from .imagegencallcompletedevent import (
|
||||||
ImageGenCallCompletedEvent,
|
ImageGenCallCompletedEvent,
|
||||||
ImageGenCallCompletedEventType,
|
ImageGenCallCompletedEventType,
|
||||||
@@ -1028,9 +1087,35 @@ if TYPE_CHECKING:
|
|||||||
ImageGenCallPartialImageEventType,
|
ImageGenCallPartialImageEventType,
|
||||||
ImageGenCallPartialImageEventTypedDict,
|
ImageGenCallPartialImageEventTypedDict,
|
||||||
)
|
)
|
||||||
|
from .imagegencompletedevent import (
|
||||||
|
ImageGenCompletedEvent,
|
||||||
|
ImageGenCompletedEventType,
|
||||||
|
ImageGenCompletedEventTypedDict,
|
||||||
|
)
|
||||||
|
from .imagegenerationrequest import (
|
||||||
|
ImageGenerationRequest,
|
||||||
|
ImageGenerationRequestAspectRatio,
|
||||||
|
ImageGenerationRequestBackground,
|
||||||
|
ImageGenerationRequestOptions,
|
||||||
|
ImageGenerationRequestOptionsTypedDict,
|
||||||
|
ImageGenerationRequestOutputFormat,
|
||||||
|
ImageGenerationRequestProvider,
|
||||||
|
ImageGenerationRequestProviderTypedDict,
|
||||||
|
ImageGenerationRequestQuality,
|
||||||
|
ImageGenerationRequestResolution,
|
||||||
|
ImageGenerationRequestTypedDict,
|
||||||
|
)
|
||||||
|
from .imagegenerationresponse import (
|
||||||
|
ImageGenerationResponse,
|
||||||
|
ImageGenerationResponseData,
|
||||||
|
ImageGenerationResponseDataTypedDict,
|
||||||
|
ImageGenerationResponseTypedDict,
|
||||||
|
)
|
||||||
from .imagegenerationservertool import (
|
from .imagegenerationservertool import (
|
||||||
Background,
|
|
||||||
ImageGenerationServerTool,
|
ImageGenerationServerTool,
|
||||||
|
ImageGenerationServerToolBackground,
|
||||||
|
ImageGenerationServerToolOutputFormat,
|
||||||
|
ImageGenerationServerToolQuality,
|
||||||
ImageGenerationServerToolType,
|
ImageGenerationServerToolType,
|
||||||
ImageGenerationServerToolTypedDict,
|
ImageGenerationServerToolTypedDict,
|
||||||
InputFidelity,
|
InputFidelity,
|
||||||
@@ -1038,8 +1123,6 @@ if TYPE_CHECKING:
|
|||||||
InputImageMaskTypedDict,
|
InputImageMaskTypedDict,
|
||||||
ModelEnum,
|
ModelEnum,
|
||||||
Moderation,
|
Moderation,
|
||||||
OutputFormat,
|
|
||||||
Quality,
|
|
||||||
Size,
|
Size,
|
||||||
)
|
)
|
||||||
from .imagegenerationservertool_openrouter import (
|
from .imagegenerationservertool_openrouter import (
|
||||||
@@ -1056,6 +1139,54 @@ if TYPE_CHECKING:
|
|||||||
ImageGenerationServerToolConfigUnionTypedDict,
|
ImageGenerationServerToolConfigUnionTypedDict,
|
||||||
)
|
)
|
||||||
from .imagegenerationstatus import ImageGenerationStatus
|
from .imagegenerationstatus import ImageGenerationStatus
|
||||||
|
from .imagegenerationusage import (
|
||||||
|
ImageGenerationUsage,
|
||||||
|
ImageGenerationUsageCompletionTokensDetails,
|
||||||
|
ImageGenerationUsageCompletionTokensDetailsTypedDict,
|
||||||
|
ImageGenerationUsagePromptTokensDetails,
|
||||||
|
ImageGenerationUsagePromptTokensDetailsTypedDict,
|
||||||
|
ImageGenerationUsageTypedDict,
|
||||||
|
ServerToolUse,
|
||||||
|
ServerToolUseTypedDict,
|
||||||
|
)
|
||||||
|
from .imagegenpartialimageevent import (
|
||||||
|
ImageGenPartialImageEvent,
|
||||||
|
ImageGenPartialImageEventType,
|
||||||
|
ImageGenPartialImageEventTypedDict,
|
||||||
|
)
|
||||||
|
from .imagegenstreamerrorevent import (
|
||||||
|
ImageGenStreamErrorEvent,
|
||||||
|
ImageGenStreamErrorEventError,
|
||||||
|
ImageGenStreamErrorEventErrorTypedDict,
|
||||||
|
ImageGenStreamErrorEventType,
|
||||||
|
ImageGenStreamErrorEventTypedDict,
|
||||||
|
)
|
||||||
|
from .imagemodelarchitecture import (
|
||||||
|
ImageModelArchitecture,
|
||||||
|
ImageModelArchitectureTypedDict,
|
||||||
|
)
|
||||||
|
from .imagemodelendpointsresponse import (
|
||||||
|
ImageModelEndpointsResponse,
|
||||||
|
ImageModelEndpointsResponseTypedDict,
|
||||||
|
)
|
||||||
|
from .imagemodellistitem import ImageModelListItem, ImageModelListItemTypedDict
|
||||||
|
from .imagemodelslistresponse import (
|
||||||
|
ImageModelsListResponse,
|
||||||
|
ImageModelsListResponseTypedDict,
|
||||||
|
)
|
||||||
|
from .imageoutputmodality import ImageOutputModality
|
||||||
|
from .imagepricingentry import (
|
||||||
|
Billable,
|
||||||
|
ImagePricingEntry,
|
||||||
|
ImagePricingEntryTypedDict,
|
||||||
|
Unit,
|
||||||
|
)
|
||||||
|
from .imagestreamingresponse import (
|
||||||
|
ImageStreamingResponse,
|
||||||
|
ImageStreamingResponseData,
|
||||||
|
ImageStreamingResponseDataTypedDict,
|
||||||
|
ImageStreamingResponseTypedDict,
|
||||||
|
)
|
||||||
from .incompletedetails import IncompleteDetails, IncompleteDetailsTypedDict, Reason
|
from .incompletedetails import IncompleteDetails, IncompleteDetailsTypedDict, Reason
|
||||||
from .inputaudio import (
|
from .inputaudio import (
|
||||||
FormatEnum,
|
FormatEnum,
|
||||||
@@ -1325,6 +1456,8 @@ if TYPE_CHECKING:
|
|||||||
KeepType,
|
KeepType,
|
||||||
KeepTypedDict,
|
KeepTypedDict,
|
||||||
MessagesRequest,
|
MessagesRequest,
|
||||||
|
MessagesRequestMetadata,
|
||||||
|
MessagesRequestMetadataTypedDict,
|
||||||
MessagesRequestPlugin,
|
MessagesRequestPlugin,
|
||||||
MessagesRequestPluginTypedDict,
|
MessagesRequestPluginTypedDict,
|
||||||
MessagesRequestTool,
|
MessagesRequestTool,
|
||||||
@@ -1332,8 +1465,6 @@ if TYPE_CHECKING:
|
|||||||
MessagesRequestToolUnion,
|
MessagesRequestToolUnion,
|
||||||
MessagesRequestToolUnionTypedDict,
|
MessagesRequestToolUnionTypedDict,
|
||||||
MessagesRequestTypedDict,
|
MessagesRequestTypedDict,
|
||||||
Metadata,
|
|
||||||
MetadataTypedDict,
|
|
||||||
NameAdvisor,
|
NameAdvisor,
|
||||||
NameBash,
|
NameBash,
|
||||||
NameStrReplaceEditor,
|
NameStrReplaceEditor,
|
||||||
@@ -2005,6 +2136,11 @@ if TYPE_CHECKING:
|
|||||||
)
|
)
|
||||||
from .publicpricing import PublicPricing, PublicPricingTypedDict
|
from .publicpricing import PublicPricing, PublicPricingTypedDict
|
||||||
from .quantization import Quantization
|
from .quantization import Quantization
|
||||||
|
from .rangecapability import (
|
||||||
|
RangeCapability,
|
||||||
|
RangeCapabilityType,
|
||||||
|
RangeCapabilityTypedDict,
|
||||||
|
)
|
||||||
from .rankingsdailyitem import RankingsDailyItem, RankingsDailyItemTypedDict
|
from .rankingsdailyitem import RankingsDailyItem, RankingsDailyItemTypedDict
|
||||||
from .rankingsdailymeta import (
|
from .rankingsdailymeta import (
|
||||||
RankingsDailyMeta,
|
RankingsDailyMeta,
|
||||||
@@ -2285,6 +2421,24 @@ if TYPE_CHECKING:
|
|||||||
SubagentServerToolConfig,
|
SubagentServerToolConfig,
|
||||||
SubagentServerToolConfigTypedDict,
|
SubagentServerToolConfigTypedDict,
|
||||||
)
|
)
|
||||||
|
from .taskclassificationitem import (
|
||||||
|
TaskClassificationItem,
|
||||||
|
TaskClassificationItemTypedDict,
|
||||||
|
)
|
||||||
|
from .taskclassificationmacrocategory import (
|
||||||
|
TaskClassificationMacroCategory,
|
||||||
|
TaskClassificationMacroCategoryTypedDict,
|
||||||
|
)
|
||||||
|
from .taskclassificationmodel import (
|
||||||
|
TaskClassificationModel,
|
||||||
|
TaskClassificationModelTypedDict,
|
||||||
|
)
|
||||||
|
from .taskclassificationresponse import (
|
||||||
|
TaskClassificationResponse,
|
||||||
|
TaskClassificationResponseData,
|
||||||
|
TaskClassificationResponseDataTypedDict,
|
||||||
|
TaskClassificationResponseTypedDict,
|
||||||
|
)
|
||||||
from .textdeltaevent import (
|
from .textdeltaevent import (
|
||||||
TextDeltaEvent,
|
TextDeltaEvent,
|
||||||
TextDeltaEventType,
|
TextDeltaEventType,
|
||||||
@@ -2340,9 +2494,9 @@ if TYPE_CHECKING:
|
|||||||
UnifiedBenchmarksMetaVersion,
|
UnifiedBenchmarksMetaVersion,
|
||||||
)
|
)
|
||||||
from .unifiedbenchmarksresponse import (
|
from .unifiedbenchmarksresponse import (
|
||||||
Data,
|
|
||||||
DataTypedDict,
|
|
||||||
UnifiedBenchmarksResponse,
|
UnifiedBenchmarksResponse,
|
||||||
|
UnifiedBenchmarksResponseData,
|
||||||
|
UnifiedBenchmarksResponseDataTypedDict,
|
||||||
UnifiedBenchmarksResponseTypedDict,
|
UnifiedBenchmarksResponseTypedDict,
|
||||||
)
|
)
|
||||||
from .unprocessableentityresponseerrordata import (
|
from .unprocessableentityresponseerrordata import (
|
||||||
@@ -2401,13 +2555,13 @@ if TYPE_CHECKING:
|
|||||||
UsageTypedDict,
|
UsageTypedDict,
|
||||||
)
|
)
|
||||||
from .videogenerationrequest import (
|
from .videogenerationrequest import (
|
||||||
AspectRatio,
|
|
||||||
Options,
|
|
||||||
OptionsTypedDict,
|
|
||||||
Resolution,
|
|
||||||
VideoGenerationRequest,
|
VideoGenerationRequest,
|
||||||
|
VideoGenerationRequestAspectRatio,
|
||||||
|
VideoGenerationRequestOptions,
|
||||||
|
VideoGenerationRequestOptionsTypedDict,
|
||||||
VideoGenerationRequestProvider,
|
VideoGenerationRequestProvider,
|
||||||
VideoGenerationRequestProviderTypedDict,
|
VideoGenerationRequestProviderTypedDict,
|
||||||
|
VideoGenerationRequestResolution,
|
||||||
VideoGenerationRequestTypedDict,
|
VideoGenerationRequestTypedDict,
|
||||||
)
|
)
|
||||||
from .videogenerationresponse import (
|
from .videogenerationresponse import (
|
||||||
@@ -2522,6 +2676,7 @@ if TYPE_CHECKING:
|
|||||||
__all__ = [
|
__all__ = [
|
||||||
"AABenchmarkEntry",
|
"AABenchmarkEntry",
|
||||||
"AABenchmarkEntryTypedDict",
|
"AABenchmarkEntryTypedDict",
|
||||||
|
"APIErrorType",
|
||||||
"APIType",
|
"APIType",
|
||||||
"Action",
|
"Action",
|
||||||
"ActionEnum",
|
"ActionEnum",
|
||||||
@@ -2554,6 +2709,9 @@ __all__ = [
|
|||||||
"AnnotationAddedEvent",
|
"AnnotationAddedEvent",
|
||||||
"AnnotationAddedEventType",
|
"AnnotationAddedEventType",
|
||||||
"AnnotationAddedEventTypedDict",
|
"AnnotationAddedEventTypedDict",
|
||||||
|
"AnthropicAdvisorMessageUsageIteration",
|
||||||
|
"AnthropicAdvisorMessageUsageIterationType",
|
||||||
|
"AnthropicAdvisorMessageUsageIterationTypedDict",
|
||||||
"AnthropicAllowedCallers",
|
"AnthropicAllowedCallers",
|
||||||
"AnthropicBase64ImageSource",
|
"AnthropicBase64ImageSource",
|
||||||
"AnthropicBase64ImageSourceType",
|
"AnthropicBase64ImageSourceType",
|
||||||
@@ -2581,6 +2739,9 @@ __all__ = [
|
|||||||
"AnthropicCitationWebSearchResultLocation",
|
"AnthropicCitationWebSearchResultLocation",
|
||||||
"AnthropicCitationWebSearchResultLocationType",
|
"AnthropicCitationWebSearchResultLocationType",
|
||||||
"AnthropicCitationWebSearchResultLocationTypedDict",
|
"AnthropicCitationWebSearchResultLocationTypedDict",
|
||||||
|
"AnthropicCompactionUsageIteration",
|
||||||
|
"AnthropicCompactionUsageIterationType",
|
||||||
|
"AnthropicCompactionUsageIterationTypedDict",
|
||||||
"AnthropicDocumentBlockParam",
|
"AnthropicDocumentBlockParam",
|
||||||
"AnthropicDocumentBlockParamCitations",
|
"AnthropicDocumentBlockParamCitations",
|
||||||
"AnthropicDocumentBlockParamCitationsTypedDict",
|
"AnthropicDocumentBlockParamCitationsTypedDict",
|
||||||
@@ -2606,6 +2767,11 @@ __all__ = [
|
|||||||
"AnthropicInputTokensTrigger",
|
"AnthropicInputTokensTrigger",
|
||||||
"AnthropicInputTokensTriggerType",
|
"AnthropicInputTokensTriggerType",
|
||||||
"AnthropicInputTokensTriggerTypedDict",
|
"AnthropicInputTokensTriggerTypedDict",
|
||||||
|
"AnthropicIterationCacheCreation",
|
||||||
|
"AnthropicIterationCacheCreationTypedDict",
|
||||||
|
"AnthropicMessageUsageIteration",
|
||||||
|
"AnthropicMessageUsageIterationType",
|
||||||
|
"AnthropicMessageUsageIterationTypedDict",
|
||||||
"AnthropicPlainTextSource",
|
"AnthropicPlainTextSource",
|
||||||
"AnthropicPlainTextSourceMediaType",
|
"AnthropicPlainTextSourceMediaType",
|
||||||
"AnthropicPlainTextSourceType",
|
"AnthropicPlainTextSourceType",
|
||||||
@@ -2615,6 +2781,7 @@ __all__ = [
|
|||||||
"AnthropicSearchResultBlockParamCitationsTypedDict",
|
"AnthropicSearchResultBlockParamCitationsTypedDict",
|
||||||
"AnthropicSearchResultBlockParamType",
|
"AnthropicSearchResultBlockParamType",
|
||||||
"AnthropicSearchResultBlockParamTypedDict",
|
"AnthropicSearchResultBlockParamTypedDict",
|
||||||
|
"AnthropicSpeed",
|
||||||
"AnthropicTextBlockParam",
|
"AnthropicTextBlockParam",
|
||||||
"AnthropicTextBlockParamType",
|
"AnthropicTextBlockParamType",
|
||||||
"AnthropicTextBlockParamTypedDict",
|
"AnthropicTextBlockParamTypedDict",
|
||||||
@@ -2634,6 +2801,10 @@ __all__ = [
|
|||||||
"AnthropicURLPdfSource",
|
"AnthropicURLPdfSource",
|
||||||
"AnthropicURLPdfSourceType",
|
"AnthropicURLPdfSourceType",
|
||||||
"AnthropicURLPdfSourceTypedDict",
|
"AnthropicURLPdfSourceTypedDict",
|
||||||
|
"AnthropicUnknownUsageIteration",
|
||||||
|
"AnthropicUnknownUsageIterationTypedDict",
|
||||||
|
"AnthropicUsageIteration",
|
||||||
|
"AnthropicUsageIterationTypedDict",
|
||||||
"AnthropicWebSearchResultBlockParam",
|
"AnthropicWebSearchResultBlockParam",
|
||||||
"AnthropicWebSearchResultBlockParamType",
|
"AnthropicWebSearchResultBlockParamType",
|
||||||
"AnthropicWebSearchResultBlockParamTypedDict",
|
"AnthropicWebSearchResultBlockParamTypedDict",
|
||||||
@@ -2680,7 +2851,6 @@ __all__ = [
|
|||||||
"ApplyPatchUpdateFileOperationTypedDict",
|
"ApplyPatchUpdateFileOperationTypedDict",
|
||||||
"Architecture",
|
"Architecture",
|
||||||
"ArchitectureTypedDict",
|
"ArchitectureTypedDict",
|
||||||
"AspectRatio",
|
|
||||||
"AudioURL",
|
"AudioURL",
|
||||||
"AudioURLTypedDict",
|
"AudioURLTypedDict",
|
||||||
"AutoRouterPlugin",
|
"AutoRouterPlugin",
|
||||||
@@ -2689,7 +2859,6 @@ __all__ = [
|
|||||||
"BYOKKey",
|
"BYOKKey",
|
||||||
"BYOKKeyTypedDict",
|
"BYOKKeyTypedDict",
|
||||||
"BYOKProviderSlug",
|
"BYOKProviderSlug",
|
||||||
"Background",
|
|
||||||
"BadGatewayResponseErrorData",
|
"BadGatewayResponseErrorData",
|
||||||
"BadGatewayResponseErrorDataTypedDict",
|
"BadGatewayResponseErrorDataTypedDict",
|
||||||
"BadRequestResponseErrorData",
|
"BadRequestResponseErrorData",
|
||||||
@@ -2725,6 +2894,10 @@ __all__ = [
|
|||||||
"BashServerToolEnvironmentTypedDict",
|
"BashServerToolEnvironmentTypedDict",
|
||||||
"BashServerToolType",
|
"BashServerToolType",
|
||||||
"BashServerToolTypedDict",
|
"BashServerToolTypedDict",
|
||||||
|
"Billable",
|
||||||
|
"BooleanCapability",
|
||||||
|
"BooleanCapabilityType",
|
||||||
|
"BooleanCapabilityTypedDict",
|
||||||
"BulkAddWorkspaceMembersRequest",
|
"BulkAddWorkspaceMembersRequest",
|
||||||
"BulkAddWorkspaceMembersRequestTypedDict",
|
"BulkAddWorkspaceMembersRequestTypedDict",
|
||||||
"BulkAddWorkspaceMembersResponse",
|
"BulkAddWorkspaceMembersResponse",
|
||||||
@@ -2752,6 +2925,8 @@ __all__ = [
|
|||||||
"By",
|
"By",
|
||||||
"Caching",
|
"Caching",
|
||||||
"CachingTypedDict",
|
"CachingTypedDict",
|
||||||
|
"CapabilityDescriptor",
|
||||||
|
"CapabilityDescriptorTypedDict",
|
||||||
"ChatAssistantImages",
|
"ChatAssistantImages",
|
||||||
"ChatAssistantImagesImageURL",
|
"ChatAssistantImagesImageURL",
|
||||||
"ChatAssistantImagesImageURLTypedDict",
|
"ChatAssistantImagesImageURLTypedDict",
|
||||||
@@ -2849,6 +3024,10 @@ __all__ = [
|
|||||||
"ChatStreamChoice",
|
"ChatStreamChoice",
|
||||||
"ChatStreamChoiceTypedDict",
|
"ChatStreamChoiceTypedDict",
|
||||||
"ChatStreamChunk",
|
"ChatStreamChunk",
|
||||||
|
"ChatStreamChunkError",
|
||||||
|
"ChatStreamChunkErrorTypedDict",
|
||||||
|
"ChatStreamChunkMetadata",
|
||||||
|
"ChatStreamChunkMetadataTypedDict",
|
||||||
"ChatStreamChunkObject",
|
"ChatStreamChunkObject",
|
||||||
"ChatStreamChunkTypedDict",
|
"ChatStreamChunkTypedDict",
|
||||||
"ChatStreamDelta",
|
"ChatStreamDelta",
|
||||||
@@ -2890,6 +3069,10 @@ __all__ = [
|
|||||||
"ChatToolMessageRole",
|
"ChatToolMessageRole",
|
||||||
"ChatToolMessageTypedDict",
|
"ChatToolMessageTypedDict",
|
||||||
"ChatUsage",
|
"ChatUsage",
|
||||||
|
"ChatUsageCompletionTokensDetails",
|
||||||
|
"ChatUsageCompletionTokensDetailsTypedDict",
|
||||||
|
"ChatUsagePromptTokensDetails",
|
||||||
|
"ChatUsagePromptTokensDetailsTypedDict",
|
||||||
"ChatUsageTypedDict",
|
"ChatUsageTypedDict",
|
||||||
"ChatUserMessage",
|
"ChatUserMessage",
|
||||||
"ChatUserMessageContent",
|
"ChatUserMessageContent",
|
||||||
@@ -2913,8 +3096,6 @@ __all__ = [
|
|||||||
"CompactionItem",
|
"CompactionItem",
|
||||||
"CompactionItemType",
|
"CompactionItemType",
|
||||||
"CompactionItemTypedDict",
|
"CompactionItemTypedDict",
|
||||||
"CompletionTokensDetails",
|
|
||||||
"CompletionTokensDetailsTypedDict",
|
|
||||||
"CompoundFilter",
|
"CompoundFilter",
|
||||||
"CompoundFilterType",
|
"CompoundFilterType",
|
||||||
"CompoundFilterTypedDict",
|
"CompoundFilterTypedDict",
|
||||||
@@ -3046,15 +3227,18 @@ __all__ = [
|
|||||||
"CustomToolTypedDict",
|
"CustomToolTypedDict",
|
||||||
"DABenchmarkEntry",
|
"DABenchmarkEntry",
|
||||||
"DABenchmarkEntryTypedDict",
|
"DABenchmarkEntryTypedDict",
|
||||||
"Data",
|
|
||||||
"DataCollection",
|
"DataCollection",
|
||||||
"DataRegion",
|
"DataRegion",
|
||||||
"DataTypedDict",
|
|
||||||
"DatetimeServerTool",
|
"DatetimeServerTool",
|
||||||
"DatetimeServerToolConfig",
|
"DatetimeServerToolConfig",
|
||||||
"DatetimeServerToolConfigTypedDict",
|
"DatetimeServerToolConfigTypedDict",
|
||||||
"DatetimeServerToolType",
|
"DatetimeServerToolType",
|
||||||
"DatetimeServerToolTypedDict",
|
"DatetimeServerToolTypedDict",
|
||||||
|
"Debug",
|
||||||
|
"DebugEvent",
|
||||||
|
"DebugEventType",
|
||||||
|
"DebugEventTypedDict",
|
||||||
|
"DebugTypedDict",
|
||||||
"DefaultEffort",
|
"DefaultEffort",
|
||||||
"DefaultParameters",
|
"DefaultParameters",
|
||||||
"DefaultParametersTypedDict",
|
"DefaultParametersTypedDict",
|
||||||
@@ -3105,13 +3289,15 @@ __all__ = [
|
|||||||
"EndpointStatus",
|
"EndpointStatus",
|
||||||
"EndpointsMetadata",
|
"EndpointsMetadata",
|
||||||
"EndpointsMetadataTypedDict",
|
"EndpointsMetadataTypedDict",
|
||||||
|
"EnumCapability",
|
||||||
|
"EnumCapabilityType",
|
||||||
|
"EnumCapabilityTypedDict",
|
||||||
"Environment",
|
"Environment",
|
||||||
"Error",
|
|
||||||
"ErrorCode",
|
"ErrorCode",
|
||||||
"ErrorEvent",
|
"ErrorEvent",
|
||||||
"ErrorEventType",
|
"ErrorEventType",
|
||||||
"ErrorEventTypedDict",
|
"ErrorEventTypedDict",
|
||||||
"ErrorTypedDict",
|
"Event",
|
||||||
"FailedModel",
|
"FailedModel",
|
||||||
"FailedModelTypedDict",
|
"FailedModelTypedDict",
|
||||||
"FieldT",
|
"FieldT",
|
||||||
@@ -3238,6 +3424,8 @@ __all__ = [
|
|||||||
"FusionServerToolOpenRouter",
|
"FusionServerToolOpenRouter",
|
||||||
"FusionServerToolOpenRouterType",
|
"FusionServerToolOpenRouterType",
|
||||||
"FusionServerToolOpenRouterTypedDict",
|
"FusionServerToolOpenRouterTypedDict",
|
||||||
|
"FusionSource",
|
||||||
|
"FusionSourceTypedDict",
|
||||||
"GenerationContentData",
|
"GenerationContentData",
|
||||||
"GenerationContentDataOutput",
|
"GenerationContentDataOutput",
|
||||||
"GenerationContentDataOutputTypedDict",
|
"GenerationContentDataOutputTypedDict",
|
||||||
@@ -3269,6 +3457,8 @@ __all__ = [
|
|||||||
"IgnoreTypedDict",
|
"IgnoreTypedDict",
|
||||||
"ImageConfig",
|
"ImageConfig",
|
||||||
"ImageConfigTypedDict",
|
"ImageConfigTypedDict",
|
||||||
|
"ImageEndpoint",
|
||||||
|
"ImageEndpointTypedDict",
|
||||||
"ImageGenCallCompletedEvent",
|
"ImageGenCallCompletedEvent",
|
||||||
"ImageGenCallCompletedEventType",
|
"ImageGenCallCompletedEventType",
|
||||||
"ImageGenCallCompletedEventTypedDict",
|
"ImageGenCallCompletedEventTypedDict",
|
||||||
@@ -3281,7 +3471,34 @@ __all__ = [
|
|||||||
"ImageGenCallPartialImageEvent",
|
"ImageGenCallPartialImageEvent",
|
||||||
"ImageGenCallPartialImageEventType",
|
"ImageGenCallPartialImageEventType",
|
||||||
"ImageGenCallPartialImageEventTypedDict",
|
"ImageGenCallPartialImageEventTypedDict",
|
||||||
|
"ImageGenCompletedEvent",
|
||||||
|
"ImageGenCompletedEventType",
|
||||||
|
"ImageGenCompletedEventTypedDict",
|
||||||
|
"ImageGenPartialImageEvent",
|
||||||
|
"ImageGenPartialImageEventType",
|
||||||
|
"ImageGenPartialImageEventTypedDict",
|
||||||
|
"ImageGenStreamErrorEvent",
|
||||||
|
"ImageGenStreamErrorEventError",
|
||||||
|
"ImageGenStreamErrorEventErrorTypedDict",
|
||||||
|
"ImageGenStreamErrorEventType",
|
||||||
|
"ImageGenStreamErrorEventTypedDict",
|
||||||
|
"ImageGenerationRequest",
|
||||||
|
"ImageGenerationRequestAspectRatio",
|
||||||
|
"ImageGenerationRequestBackground",
|
||||||
|
"ImageGenerationRequestOptions",
|
||||||
|
"ImageGenerationRequestOptionsTypedDict",
|
||||||
|
"ImageGenerationRequestOutputFormat",
|
||||||
|
"ImageGenerationRequestProvider",
|
||||||
|
"ImageGenerationRequestProviderTypedDict",
|
||||||
|
"ImageGenerationRequestQuality",
|
||||||
|
"ImageGenerationRequestResolution",
|
||||||
|
"ImageGenerationRequestTypedDict",
|
||||||
|
"ImageGenerationResponse",
|
||||||
|
"ImageGenerationResponseData",
|
||||||
|
"ImageGenerationResponseDataTypedDict",
|
||||||
|
"ImageGenerationResponseTypedDict",
|
||||||
"ImageGenerationServerTool",
|
"ImageGenerationServerTool",
|
||||||
|
"ImageGenerationServerToolBackground",
|
||||||
"ImageGenerationServerToolConfig",
|
"ImageGenerationServerToolConfig",
|
||||||
"ImageGenerationServerToolConfigTypedDict",
|
"ImageGenerationServerToolConfigTypedDict",
|
||||||
"ImageGenerationServerToolConfigUnion",
|
"ImageGenerationServerToolConfigUnion",
|
||||||
@@ -3289,9 +3506,32 @@ __all__ = [
|
|||||||
"ImageGenerationServerToolOpenRouter",
|
"ImageGenerationServerToolOpenRouter",
|
||||||
"ImageGenerationServerToolOpenRouterType",
|
"ImageGenerationServerToolOpenRouterType",
|
||||||
"ImageGenerationServerToolOpenRouterTypedDict",
|
"ImageGenerationServerToolOpenRouterTypedDict",
|
||||||
|
"ImageGenerationServerToolOutputFormat",
|
||||||
|
"ImageGenerationServerToolQuality",
|
||||||
"ImageGenerationServerToolType",
|
"ImageGenerationServerToolType",
|
||||||
"ImageGenerationServerToolTypedDict",
|
"ImageGenerationServerToolTypedDict",
|
||||||
"ImageGenerationStatus",
|
"ImageGenerationStatus",
|
||||||
|
"ImageGenerationUsage",
|
||||||
|
"ImageGenerationUsageCompletionTokensDetails",
|
||||||
|
"ImageGenerationUsageCompletionTokensDetailsTypedDict",
|
||||||
|
"ImageGenerationUsagePromptTokensDetails",
|
||||||
|
"ImageGenerationUsagePromptTokensDetailsTypedDict",
|
||||||
|
"ImageGenerationUsageTypedDict",
|
||||||
|
"ImageModelArchitecture",
|
||||||
|
"ImageModelArchitectureTypedDict",
|
||||||
|
"ImageModelEndpointsResponse",
|
||||||
|
"ImageModelEndpointsResponseTypedDict",
|
||||||
|
"ImageModelListItem",
|
||||||
|
"ImageModelListItemTypedDict",
|
||||||
|
"ImageModelsListResponse",
|
||||||
|
"ImageModelsListResponseTypedDict",
|
||||||
|
"ImageOutputModality",
|
||||||
|
"ImagePricingEntry",
|
||||||
|
"ImagePricingEntryTypedDict",
|
||||||
|
"ImageStreamingResponse",
|
||||||
|
"ImageStreamingResponseData",
|
||||||
|
"ImageStreamingResponseDataTypedDict",
|
||||||
|
"ImageStreamingResponseTypedDict",
|
||||||
"IncompleteDetails",
|
"IncompleteDetails",
|
||||||
"IncompleteDetailsTypedDict",
|
"IncompleteDetailsTypedDict",
|
||||||
"Input1",
|
"Input1",
|
||||||
@@ -3470,6 +3710,8 @@ __all__ = [
|
|||||||
"MessagesOutputConfigTypeJSONSchema",
|
"MessagesOutputConfigTypeJSONSchema",
|
||||||
"MessagesOutputConfigTypedDict",
|
"MessagesOutputConfigTypedDict",
|
||||||
"MessagesRequest",
|
"MessagesRequest",
|
||||||
|
"MessagesRequestMetadata",
|
||||||
|
"MessagesRequestMetadataTypedDict",
|
||||||
"MessagesRequestPlugin",
|
"MessagesRequestPlugin",
|
||||||
"MessagesRequestPluginTypedDict",
|
"MessagesRequestPluginTypedDict",
|
||||||
"MessagesRequestTool",
|
"MessagesRequestTool",
|
||||||
@@ -3477,9 +3719,7 @@ __all__ = [
|
|||||||
"MessagesRequestToolUnion",
|
"MessagesRequestToolUnion",
|
||||||
"MessagesRequestToolUnionTypedDict",
|
"MessagesRequestToolUnionTypedDict",
|
||||||
"MessagesRequestTypedDict",
|
"MessagesRequestTypedDict",
|
||||||
"Metadata",
|
|
||||||
"MetadataLevel",
|
"MetadataLevel",
|
||||||
"MetadataTypedDict",
|
|
||||||
"Method",
|
"Method",
|
||||||
"Modality",
|
"Modality",
|
||||||
"Mode",
|
"Mode",
|
||||||
@@ -3691,8 +3931,6 @@ __all__ = [
|
|||||||
"OpenRouterWebSearchServerToolType",
|
"OpenRouterWebSearchServerToolType",
|
||||||
"OpenRouterWebSearchServerToolTypedDict",
|
"OpenRouterWebSearchServerToolTypedDict",
|
||||||
"Operator",
|
"Operator",
|
||||||
"Options",
|
|
||||||
"OptionsTypedDict",
|
|
||||||
"Order",
|
"Order",
|
||||||
"OrderTypedDict",
|
"OrderTypedDict",
|
||||||
"Outcome",
|
"Outcome",
|
||||||
@@ -3740,7 +3978,6 @@ __all__ = [
|
|||||||
"OutputFileSearchServerToolItem",
|
"OutputFileSearchServerToolItem",
|
||||||
"OutputFileSearchServerToolItemType",
|
"OutputFileSearchServerToolItemType",
|
||||||
"OutputFileSearchServerToolItemTypedDict",
|
"OutputFileSearchServerToolItemTypedDict",
|
||||||
"OutputFormat",
|
|
||||||
"OutputFunctionCallItem",
|
"OutputFunctionCallItem",
|
||||||
"OutputFunctionCallItemStatusCompleted",
|
"OutputFunctionCallItemStatusCompleted",
|
||||||
"OutputFunctionCallItemStatusInProgress",
|
"OutputFunctionCallItemStatusInProgress",
|
||||||
@@ -3907,8 +4144,6 @@ __all__ = [
|
|||||||
"Pricing",
|
"Pricing",
|
||||||
"PricingTypedDict",
|
"PricingTypedDict",
|
||||||
"PromptInjectionScanScope",
|
"PromptInjectionScanScope",
|
||||||
"PromptTokensDetails",
|
|
||||||
"PromptTokensDetailsTypedDict",
|
|
||||||
"ProviderName",
|
"ProviderName",
|
||||||
"ProviderOptions",
|
"ProviderOptions",
|
||||||
"ProviderOptionsTypedDict",
|
"ProviderOptionsTypedDict",
|
||||||
@@ -3927,8 +4162,10 @@ __all__ = [
|
|||||||
"PublicEndpointTypedDict",
|
"PublicEndpointTypedDict",
|
||||||
"PublicPricing",
|
"PublicPricing",
|
||||||
"PublicPricingTypedDict",
|
"PublicPricingTypedDict",
|
||||||
"Quality",
|
|
||||||
"Quantization",
|
"Quantization",
|
||||||
|
"RangeCapability",
|
||||||
|
"RangeCapabilityType",
|
||||||
|
"RangeCapabilityTypedDict",
|
||||||
"Ranker",
|
"Ranker",
|
||||||
"RankingOptions",
|
"RankingOptions",
|
||||||
"RankingOptionsTypedDict",
|
"RankingOptionsTypedDict",
|
||||||
@@ -4004,7 +4241,6 @@ __all__ = [
|
|||||||
"RequireApprovalUnion",
|
"RequireApprovalUnion",
|
||||||
"RequireApprovalUnionTypedDict",
|
"RequireApprovalUnionTypedDict",
|
||||||
"ResetInterval",
|
"ResetInterval",
|
||||||
"Resolution",
|
|
||||||
"Response",
|
"Response",
|
||||||
"ResponseFormat",
|
"ResponseFormat",
|
||||||
"ResponseFormatEnum",
|
"ResponseFormatEnum",
|
||||||
@@ -4056,6 +4292,10 @@ __all__ = [
|
|||||||
"SearchQualityLevel",
|
"SearchQualityLevel",
|
||||||
"Security",
|
"Security",
|
||||||
"SecurityTypedDict",
|
"SecurityTypedDict",
|
||||||
|
"ServerToolUse",
|
||||||
|
"ServerToolUseDetails",
|
||||||
|
"ServerToolUseDetailsTypedDict",
|
||||||
|
"ServerToolUseTypedDict",
|
||||||
"ServiceUnavailableResponseErrorData",
|
"ServiceUnavailableResponseErrorData",
|
||||||
"ServiceUnavailableResponseErrorDataTypedDict",
|
"ServiceUnavailableResponseErrorDataTypedDict",
|
||||||
"ShellCallItem",
|
"ShellCallItem",
|
||||||
@@ -4156,6 +4396,16 @@ __all__ = [
|
|||||||
"SystemTypedDict",
|
"SystemTypedDict",
|
||||||
"TaskBudget",
|
"TaskBudget",
|
||||||
"TaskBudgetTypedDict",
|
"TaskBudgetTypedDict",
|
||||||
|
"TaskClassificationItem",
|
||||||
|
"TaskClassificationItemTypedDict",
|
||||||
|
"TaskClassificationMacroCategory",
|
||||||
|
"TaskClassificationMacroCategoryTypedDict",
|
||||||
|
"TaskClassificationModel",
|
||||||
|
"TaskClassificationModelTypedDict",
|
||||||
|
"TaskClassificationResponse",
|
||||||
|
"TaskClassificationResponseData",
|
||||||
|
"TaskClassificationResponseDataTypedDict",
|
||||||
|
"TaskClassificationResponseTypedDict",
|
||||||
"TextDeltaEvent",
|
"TextDeltaEvent",
|
||||||
"TextDeltaEventType",
|
"TextDeltaEventType",
|
||||||
"TextDeltaEventTypedDict",
|
"TextDeltaEventTypedDict",
|
||||||
@@ -4172,6 +4422,8 @@ __all__ = [
|
|||||||
"ThinkingEnabled",
|
"ThinkingEnabled",
|
||||||
"ThinkingEnabledTypedDict",
|
"ThinkingEnabledTypedDict",
|
||||||
"ThinkingTypedDict",
|
"ThinkingTypedDict",
|
||||||
|
"Timings",
|
||||||
|
"TimingsTypedDict",
|
||||||
"Tokenizer",
|
"Tokenizer",
|
||||||
"TooManyRequestsResponseErrorData",
|
"TooManyRequestsResponseErrorData",
|
||||||
"TooManyRequestsResponseErrorDataTypedDict",
|
"TooManyRequestsResponseErrorDataTypedDict",
|
||||||
@@ -4270,9 +4522,12 @@ __all__ = [
|
|||||||
"UnifiedBenchmarksMetaTypedDict",
|
"UnifiedBenchmarksMetaTypedDict",
|
||||||
"UnifiedBenchmarksMetaVersion",
|
"UnifiedBenchmarksMetaVersion",
|
||||||
"UnifiedBenchmarksResponse",
|
"UnifiedBenchmarksResponse",
|
||||||
|
"UnifiedBenchmarksResponseData",
|
||||||
|
"UnifiedBenchmarksResponseDataTypedDict",
|
||||||
"UnifiedBenchmarksResponseTypedDict",
|
"UnifiedBenchmarksResponseTypedDict",
|
||||||
"UniqueInsight",
|
"UniqueInsight",
|
||||||
"UniqueInsightTypedDict",
|
"UniqueInsightTypedDict",
|
||||||
|
"Unit",
|
||||||
"UnprocessableEntityResponseErrorData",
|
"UnprocessableEntityResponseErrorData",
|
||||||
"UnprocessableEntityResponseErrorDataTypedDict",
|
"UnprocessableEntityResponseErrorDataTypedDict",
|
||||||
"UpdateBYOKKeyRequest",
|
"UpdateBYOKKeyRequest",
|
||||||
@@ -4305,8 +4560,12 @@ __all__ = [
|
|||||||
"VariablesTypedDict",
|
"VariablesTypedDict",
|
||||||
"Verbosity",
|
"Verbosity",
|
||||||
"VideoGenerationRequest",
|
"VideoGenerationRequest",
|
||||||
|
"VideoGenerationRequestAspectRatio",
|
||||||
|
"VideoGenerationRequestOptions",
|
||||||
|
"VideoGenerationRequestOptionsTypedDict",
|
||||||
"VideoGenerationRequestProvider",
|
"VideoGenerationRequestProvider",
|
||||||
"VideoGenerationRequestProviderTypedDict",
|
"VideoGenerationRequestProviderTypedDict",
|
||||||
|
"VideoGenerationRequestResolution",
|
||||||
"VideoGenerationRequestTypedDict",
|
"VideoGenerationRequestTypedDict",
|
||||||
"VideoGenerationResponse",
|
"VideoGenerationResponse",
|
||||||
"VideoGenerationResponseStatus",
|
"VideoGenerationResponseStatus",
|
||||||
@@ -4395,6 +4654,9 @@ _dynamic_imports: dict[str, str] = {
|
|||||||
"AnnotationAddedEvent": ".annotationaddedevent",
|
"AnnotationAddedEvent": ".annotationaddedevent",
|
||||||
"AnnotationAddedEventType": ".annotationaddedevent",
|
"AnnotationAddedEventType": ".annotationaddedevent",
|
||||||
"AnnotationAddedEventTypedDict": ".annotationaddedevent",
|
"AnnotationAddedEventTypedDict": ".annotationaddedevent",
|
||||||
|
"AnthropicAdvisorMessageUsageIteration": ".anthropicadvisormessageusageiteration",
|
||||||
|
"AnthropicAdvisorMessageUsageIterationType": ".anthropicadvisormessageusageiteration",
|
||||||
|
"AnthropicAdvisorMessageUsageIterationTypedDict": ".anthropicadvisormessageusageiteration",
|
||||||
"AnthropicAllowedCallers": ".anthropicallowedcallers",
|
"AnthropicAllowedCallers": ".anthropicallowedcallers",
|
||||||
"AnthropicBase64ImageSource": ".anthropicbase64imagesource",
|
"AnthropicBase64ImageSource": ".anthropicbase64imagesource",
|
||||||
"AnthropicBase64ImageSourceType": ".anthropicbase64imagesource",
|
"AnthropicBase64ImageSourceType": ".anthropicbase64imagesource",
|
||||||
@@ -4422,6 +4684,9 @@ _dynamic_imports: dict[str, str] = {
|
|||||||
"AnthropicCitationWebSearchResultLocation": ".anthropiccitationwebsearchresultlocation",
|
"AnthropicCitationWebSearchResultLocation": ".anthropiccitationwebsearchresultlocation",
|
||||||
"AnthropicCitationWebSearchResultLocationType": ".anthropiccitationwebsearchresultlocation",
|
"AnthropicCitationWebSearchResultLocationType": ".anthropiccitationwebsearchresultlocation",
|
||||||
"AnthropicCitationWebSearchResultLocationTypedDict": ".anthropiccitationwebsearchresultlocation",
|
"AnthropicCitationWebSearchResultLocationTypedDict": ".anthropiccitationwebsearchresultlocation",
|
||||||
|
"AnthropicCompactionUsageIteration": ".anthropiccompactionusageiteration",
|
||||||
|
"AnthropicCompactionUsageIterationType": ".anthropiccompactionusageiteration",
|
||||||
|
"AnthropicCompactionUsageIterationTypedDict": ".anthropiccompactionusageiteration",
|
||||||
"AnthropicDocumentBlockParam": ".anthropicdocumentblockparam",
|
"AnthropicDocumentBlockParam": ".anthropicdocumentblockparam",
|
||||||
"AnthropicDocumentBlockParamCitations": ".anthropicdocumentblockparam",
|
"AnthropicDocumentBlockParamCitations": ".anthropicdocumentblockparam",
|
||||||
"AnthropicDocumentBlockParamCitationsTypedDict": ".anthropicdocumentblockparam",
|
"AnthropicDocumentBlockParamCitationsTypedDict": ".anthropicdocumentblockparam",
|
||||||
@@ -4451,6 +4716,11 @@ _dynamic_imports: dict[str, str] = {
|
|||||||
"AnthropicInputTokensTrigger": ".anthropicinputtokenstrigger",
|
"AnthropicInputTokensTrigger": ".anthropicinputtokenstrigger",
|
||||||
"AnthropicInputTokensTriggerType": ".anthropicinputtokenstrigger",
|
"AnthropicInputTokensTriggerType": ".anthropicinputtokenstrigger",
|
||||||
"AnthropicInputTokensTriggerTypedDict": ".anthropicinputtokenstrigger",
|
"AnthropicInputTokensTriggerTypedDict": ".anthropicinputtokenstrigger",
|
||||||
|
"AnthropicIterationCacheCreation": ".anthropiciterationcachecreation",
|
||||||
|
"AnthropicIterationCacheCreationTypedDict": ".anthropiciterationcachecreation",
|
||||||
|
"AnthropicMessageUsageIteration": ".anthropicmessageusageiteration",
|
||||||
|
"AnthropicMessageUsageIterationType": ".anthropicmessageusageiteration",
|
||||||
|
"AnthropicMessageUsageIterationTypedDict": ".anthropicmessageusageiteration",
|
||||||
"AnthropicPlainTextSource": ".anthropicplaintextsource",
|
"AnthropicPlainTextSource": ".anthropicplaintextsource",
|
||||||
"AnthropicPlainTextSourceMediaType": ".anthropicplaintextsource",
|
"AnthropicPlainTextSourceMediaType": ".anthropicplaintextsource",
|
||||||
"AnthropicPlainTextSourceType": ".anthropicplaintextsource",
|
"AnthropicPlainTextSourceType": ".anthropicplaintextsource",
|
||||||
@@ -4460,6 +4730,7 @@ _dynamic_imports: dict[str, str] = {
|
|||||||
"AnthropicSearchResultBlockParamCitationsTypedDict": ".anthropicsearchresultblockparam",
|
"AnthropicSearchResultBlockParamCitationsTypedDict": ".anthropicsearchresultblockparam",
|
||||||
"AnthropicSearchResultBlockParamType": ".anthropicsearchresultblockparam",
|
"AnthropicSearchResultBlockParamType": ".anthropicsearchresultblockparam",
|
||||||
"AnthropicSearchResultBlockParamTypedDict": ".anthropicsearchresultblockparam",
|
"AnthropicSearchResultBlockParamTypedDict": ".anthropicsearchresultblockparam",
|
||||||
|
"AnthropicSpeed": ".anthropicspeed",
|
||||||
"AnthropicTextBlockParam": ".anthropictextblockparam",
|
"AnthropicTextBlockParam": ".anthropictextblockparam",
|
||||||
"AnthropicTextBlockParamType": ".anthropictextblockparam",
|
"AnthropicTextBlockParamType": ".anthropictextblockparam",
|
||||||
"AnthropicTextBlockParamTypedDict": ".anthropictextblockparam",
|
"AnthropicTextBlockParamTypedDict": ".anthropictextblockparam",
|
||||||
@@ -4475,18 +4746,23 @@ _dynamic_imports: dict[str, str] = {
|
|||||||
"AnthropicToolUsesTrigger": ".anthropictoolusestrigger",
|
"AnthropicToolUsesTrigger": ".anthropictoolusestrigger",
|
||||||
"AnthropicToolUsesTriggerType": ".anthropictoolusestrigger",
|
"AnthropicToolUsesTriggerType": ".anthropictoolusestrigger",
|
||||||
"AnthropicToolUsesTriggerTypedDict": ".anthropictoolusestrigger",
|
"AnthropicToolUsesTriggerTypedDict": ".anthropictoolusestrigger",
|
||||||
|
"AnthropicUnknownUsageIteration": ".anthropicunknownusageiteration",
|
||||||
|
"AnthropicUnknownUsageIterationTypedDict": ".anthropicunknownusageiteration",
|
||||||
"AnthropicURLImageSource": ".anthropicurlimagesource",
|
"AnthropicURLImageSource": ".anthropicurlimagesource",
|
||||||
"AnthropicURLImageSourceType": ".anthropicurlimagesource",
|
"AnthropicURLImageSourceType": ".anthropicurlimagesource",
|
||||||
"AnthropicURLImageSourceTypedDict": ".anthropicurlimagesource",
|
"AnthropicURLImageSourceTypedDict": ".anthropicurlimagesource",
|
||||||
"AnthropicURLPdfSource": ".anthropicurlpdfsource",
|
"AnthropicURLPdfSource": ".anthropicurlpdfsource",
|
||||||
"AnthropicURLPdfSourceType": ".anthropicurlpdfsource",
|
"AnthropicURLPdfSourceType": ".anthropicurlpdfsource",
|
||||||
"AnthropicURLPdfSourceTypedDict": ".anthropicurlpdfsource",
|
"AnthropicURLPdfSourceTypedDict": ".anthropicurlpdfsource",
|
||||||
|
"AnthropicUsageIteration": ".anthropicusageiteration",
|
||||||
|
"AnthropicUsageIterationTypedDict": ".anthropicusageiteration",
|
||||||
"AnthropicWebSearchResultBlockParam": ".anthropicwebsearchresultblockparam",
|
"AnthropicWebSearchResultBlockParam": ".anthropicwebsearchresultblockparam",
|
||||||
"AnthropicWebSearchResultBlockParamType": ".anthropicwebsearchresultblockparam",
|
"AnthropicWebSearchResultBlockParamType": ".anthropicwebsearchresultblockparam",
|
||||||
"AnthropicWebSearchResultBlockParamTypedDict": ".anthropicwebsearchresultblockparam",
|
"AnthropicWebSearchResultBlockParamTypedDict": ".anthropicwebsearchresultblockparam",
|
||||||
"AnthropicWebSearchToolUserLocation": ".anthropicwebsearchtooluserlocation",
|
"AnthropicWebSearchToolUserLocation": ".anthropicwebsearchtooluserlocation",
|
||||||
"AnthropicWebSearchToolUserLocationType": ".anthropicwebsearchtooluserlocation",
|
"AnthropicWebSearchToolUserLocationType": ".anthropicwebsearchtooluserlocation",
|
||||||
"AnthropicWebSearchToolUserLocationTypedDict": ".anthropicwebsearchtooluserlocation",
|
"AnthropicWebSearchToolUserLocationTypedDict": ".anthropicwebsearchtooluserlocation",
|
||||||
|
"APIErrorType": ".apierrortype",
|
||||||
"ApplyPatchCallItem": ".applypatchcallitem",
|
"ApplyPatchCallItem": ".applypatchcallitem",
|
||||||
"ApplyPatchCallItemType": ".applypatchcallitem",
|
"ApplyPatchCallItemType": ".applypatchcallitem",
|
||||||
"ApplyPatchCallItemTypedDict": ".applypatchcallitem",
|
"ApplyPatchCallItemTypedDict": ".applypatchcallitem",
|
||||||
@@ -4563,6 +4839,9 @@ _dynamic_imports: dict[str, str] = {
|
|||||||
"BashServerToolEngine": ".bashservertoolengine",
|
"BashServerToolEngine": ".bashservertoolengine",
|
||||||
"BashServerToolEnvironment": ".bashservertoolenvironment",
|
"BashServerToolEnvironment": ".bashservertoolenvironment",
|
||||||
"BashServerToolEnvironmentTypedDict": ".bashservertoolenvironment",
|
"BashServerToolEnvironmentTypedDict": ".bashservertoolenvironment",
|
||||||
|
"BooleanCapability": ".booleancapability",
|
||||||
|
"BooleanCapabilityType": ".booleancapability",
|
||||||
|
"BooleanCapabilityTypedDict": ".booleancapability",
|
||||||
"BulkAddWorkspaceMembersRequest": ".bulkaddworkspacemembersrequest",
|
"BulkAddWorkspaceMembersRequest": ".bulkaddworkspacemembersrequest",
|
||||||
"BulkAddWorkspaceMembersRequestTypedDict": ".bulkaddworkspacemembersrequest",
|
"BulkAddWorkspaceMembersRequestTypedDict": ".bulkaddworkspacemembersrequest",
|
||||||
"BulkAddWorkspaceMembersResponse": ".bulkaddworkspacemembersresponse",
|
"BulkAddWorkspaceMembersResponse": ".bulkaddworkspacemembersresponse",
|
||||||
@@ -4590,6 +4869,8 @@ _dynamic_imports: dict[str, str] = {
|
|||||||
"BYOKKey": ".byokkey",
|
"BYOKKey": ".byokkey",
|
||||||
"BYOKKeyTypedDict": ".byokkey",
|
"BYOKKeyTypedDict": ".byokkey",
|
||||||
"BYOKProviderSlug": ".byokproviderslug",
|
"BYOKProviderSlug": ".byokproviderslug",
|
||||||
|
"CapabilityDescriptor": ".capabilitydescriptor",
|
||||||
|
"CapabilityDescriptorTypedDict": ".capabilitydescriptor",
|
||||||
"ChatAssistantImages": ".chatassistantimages",
|
"ChatAssistantImages": ".chatassistantimages",
|
||||||
"ChatAssistantImagesImageURL": ".chatassistantimages",
|
"ChatAssistantImagesImageURL": ".chatassistantimages",
|
||||||
"ChatAssistantImagesImageURLTypedDict": ".chatassistantimages",
|
"ChatAssistantImagesImageURLTypedDict": ".chatassistantimages",
|
||||||
@@ -4694,10 +4975,12 @@ _dynamic_imports: dict[str, str] = {
|
|||||||
"ChatStreamChoice": ".chatstreamchoice",
|
"ChatStreamChoice": ".chatstreamchoice",
|
||||||
"ChatStreamChoiceTypedDict": ".chatstreamchoice",
|
"ChatStreamChoiceTypedDict": ".chatstreamchoice",
|
||||||
"ChatStreamChunk": ".chatstreamchunk",
|
"ChatStreamChunk": ".chatstreamchunk",
|
||||||
|
"ChatStreamChunkError": ".chatstreamchunk",
|
||||||
|
"ChatStreamChunkErrorTypedDict": ".chatstreamchunk",
|
||||||
|
"ChatStreamChunkMetadata": ".chatstreamchunk",
|
||||||
|
"ChatStreamChunkMetadataTypedDict": ".chatstreamchunk",
|
||||||
"ChatStreamChunkObject": ".chatstreamchunk",
|
"ChatStreamChunkObject": ".chatstreamchunk",
|
||||||
"ChatStreamChunkTypedDict": ".chatstreamchunk",
|
"ChatStreamChunkTypedDict": ".chatstreamchunk",
|
||||||
"Error": ".chatstreamchunk",
|
|
||||||
"ErrorTypedDict": ".chatstreamchunk",
|
|
||||||
"ChatStreamDelta": ".chatstreamdelta",
|
"ChatStreamDelta": ".chatstreamdelta",
|
||||||
"ChatStreamDeltaRole": ".chatstreamdelta",
|
"ChatStreamDeltaRole": ".chatstreamdelta",
|
||||||
"ChatStreamDeltaTypedDict": ".chatstreamdelta",
|
"ChatStreamDeltaTypedDict": ".chatstreamdelta",
|
||||||
@@ -4737,11 +5020,13 @@ _dynamic_imports: dict[str, str] = {
|
|||||||
"ChatToolMessageRole": ".chattoolmessage",
|
"ChatToolMessageRole": ".chattoolmessage",
|
||||||
"ChatToolMessageTypedDict": ".chattoolmessage",
|
"ChatToolMessageTypedDict": ".chattoolmessage",
|
||||||
"ChatUsage": ".chatusage",
|
"ChatUsage": ".chatusage",
|
||||||
|
"ChatUsageCompletionTokensDetails": ".chatusage",
|
||||||
|
"ChatUsageCompletionTokensDetailsTypedDict": ".chatusage",
|
||||||
|
"ChatUsagePromptTokensDetails": ".chatusage",
|
||||||
|
"ChatUsagePromptTokensDetailsTypedDict": ".chatusage",
|
||||||
"ChatUsageTypedDict": ".chatusage",
|
"ChatUsageTypedDict": ".chatusage",
|
||||||
"CompletionTokensDetails": ".chatusage",
|
"ServerToolUseDetails": ".chatusage",
|
||||||
"CompletionTokensDetailsTypedDict": ".chatusage",
|
"ServerToolUseDetailsTypedDict": ".chatusage",
|
||||||
"PromptTokensDetails": ".chatusage",
|
|
||||||
"PromptTokensDetailsTypedDict": ".chatusage",
|
|
||||||
"ChatUserMessage": ".chatusermessage",
|
"ChatUserMessage": ".chatusermessage",
|
||||||
"ChatUserMessageContent": ".chatusermessage",
|
"ChatUserMessageContent": ".chatusermessage",
|
||||||
"ChatUserMessageContentTypedDict": ".chatusermessage",
|
"ChatUserMessageContentTypedDict": ".chatusermessage",
|
||||||
@@ -4887,6 +5172,14 @@ _dynamic_imports: dict[str, str] = {
|
|||||||
"DatetimeServerToolTypedDict": ".datetimeservertool",
|
"DatetimeServerToolTypedDict": ".datetimeservertool",
|
||||||
"DatetimeServerToolConfig": ".datetimeservertoolconfig",
|
"DatetimeServerToolConfig": ".datetimeservertoolconfig",
|
||||||
"DatetimeServerToolConfigTypedDict": ".datetimeservertoolconfig",
|
"DatetimeServerToolConfigTypedDict": ".datetimeservertoolconfig",
|
||||||
|
"Debug": ".debugevent",
|
||||||
|
"DebugEvent": ".debugevent",
|
||||||
|
"DebugEventType": ".debugevent",
|
||||||
|
"DebugEventTypedDict": ".debugevent",
|
||||||
|
"DebugTypedDict": ".debugevent",
|
||||||
|
"Event": ".debugevent",
|
||||||
|
"Timings": ".debugevent",
|
||||||
|
"TimingsTypedDict": ".debugevent",
|
||||||
"DefaultParameters": ".defaultparameters",
|
"DefaultParameters": ".defaultparameters",
|
||||||
"DefaultParametersTypedDict": ".defaultparameters",
|
"DefaultParametersTypedDict": ".defaultparameters",
|
||||||
"DeleteBYOKKeyResponse": ".deletebyokkeyresponse",
|
"DeleteBYOKKeyResponse": ".deletebyokkeyresponse",
|
||||||
@@ -4927,6 +5220,9 @@ _dynamic_imports: dict[str, str] = {
|
|||||||
"EndpointsMetadata": ".endpointsmetadata",
|
"EndpointsMetadata": ".endpointsmetadata",
|
||||||
"EndpointsMetadataTypedDict": ".endpointsmetadata",
|
"EndpointsMetadataTypedDict": ".endpointsmetadata",
|
||||||
"EndpointStatus": ".endpointstatus",
|
"EndpointStatus": ".endpointstatus",
|
||||||
|
"EnumCapability": ".enumcapability",
|
||||||
|
"EnumCapabilityType": ".enumcapability",
|
||||||
|
"EnumCapabilityTypedDict": ".enumcapability",
|
||||||
"ErrorEvent": ".errorevent",
|
"ErrorEvent": ".errorevent",
|
||||||
"ErrorEventType": ".errorevent",
|
"ErrorEventType": ".errorevent",
|
||||||
"ErrorEventTypedDict": ".errorevent",
|
"ErrorEventTypedDict": ".errorevent",
|
||||||
@@ -5055,6 +5351,8 @@ _dynamic_imports: dict[str, str] = {
|
|||||||
"FusionServerToolConfigTool": ".fusionservertoolconfig",
|
"FusionServerToolConfigTool": ".fusionservertoolconfig",
|
||||||
"FusionServerToolConfigToolTypedDict": ".fusionservertoolconfig",
|
"FusionServerToolConfigToolTypedDict": ".fusionservertoolconfig",
|
||||||
"FusionServerToolConfigTypedDict": ".fusionservertoolconfig",
|
"FusionServerToolConfigTypedDict": ".fusionservertoolconfig",
|
||||||
|
"FusionSource": ".fusionsource",
|
||||||
|
"FusionSourceTypedDict": ".fusionsource",
|
||||||
"GenerationContentData": ".generationcontentdata",
|
"GenerationContentData": ".generationcontentdata",
|
||||||
"GenerationContentDataOutput": ".generationcontentdata",
|
"GenerationContentDataOutput": ".generationcontentdata",
|
||||||
"GenerationContentDataOutputTypedDict": ".generationcontentdata",
|
"GenerationContentDataOutputTypedDict": ".generationcontentdata",
|
||||||
@@ -5090,6 +5388,8 @@ _dynamic_imports: dict[str, str] = {
|
|||||||
"GuardrailInterval": ".guardrailinterval",
|
"GuardrailInterval": ".guardrailinterval",
|
||||||
"ImageConfig": ".imageconfig",
|
"ImageConfig": ".imageconfig",
|
||||||
"ImageConfigTypedDict": ".imageconfig",
|
"ImageConfigTypedDict": ".imageconfig",
|
||||||
|
"ImageEndpoint": ".imageendpoint",
|
||||||
|
"ImageEndpointTypedDict": ".imageendpoint",
|
||||||
"ImageGenCallCompletedEvent": ".imagegencallcompletedevent",
|
"ImageGenCallCompletedEvent": ".imagegencallcompletedevent",
|
||||||
"ImageGenCallCompletedEventType": ".imagegencallcompletedevent",
|
"ImageGenCallCompletedEventType": ".imagegencallcompletedevent",
|
||||||
"ImageGenCallCompletedEventTypedDict": ".imagegencallcompletedevent",
|
"ImageGenCallCompletedEventTypedDict": ".imagegencallcompletedevent",
|
||||||
@@ -5102,8 +5402,28 @@ _dynamic_imports: dict[str, str] = {
|
|||||||
"ImageGenCallPartialImageEvent": ".imagegencallpartialimageevent",
|
"ImageGenCallPartialImageEvent": ".imagegencallpartialimageevent",
|
||||||
"ImageGenCallPartialImageEventType": ".imagegencallpartialimageevent",
|
"ImageGenCallPartialImageEventType": ".imagegencallpartialimageevent",
|
||||||
"ImageGenCallPartialImageEventTypedDict": ".imagegencallpartialimageevent",
|
"ImageGenCallPartialImageEventTypedDict": ".imagegencallpartialimageevent",
|
||||||
"Background": ".imagegenerationservertool",
|
"ImageGenCompletedEvent": ".imagegencompletedevent",
|
||||||
|
"ImageGenCompletedEventType": ".imagegencompletedevent",
|
||||||
|
"ImageGenCompletedEventTypedDict": ".imagegencompletedevent",
|
||||||
|
"ImageGenerationRequest": ".imagegenerationrequest",
|
||||||
|
"ImageGenerationRequestAspectRatio": ".imagegenerationrequest",
|
||||||
|
"ImageGenerationRequestBackground": ".imagegenerationrequest",
|
||||||
|
"ImageGenerationRequestOptions": ".imagegenerationrequest",
|
||||||
|
"ImageGenerationRequestOptionsTypedDict": ".imagegenerationrequest",
|
||||||
|
"ImageGenerationRequestOutputFormat": ".imagegenerationrequest",
|
||||||
|
"ImageGenerationRequestProvider": ".imagegenerationrequest",
|
||||||
|
"ImageGenerationRequestProviderTypedDict": ".imagegenerationrequest",
|
||||||
|
"ImageGenerationRequestQuality": ".imagegenerationrequest",
|
||||||
|
"ImageGenerationRequestResolution": ".imagegenerationrequest",
|
||||||
|
"ImageGenerationRequestTypedDict": ".imagegenerationrequest",
|
||||||
|
"ImageGenerationResponse": ".imagegenerationresponse",
|
||||||
|
"ImageGenerationResponseData": ".imagegenerationresponse",
|
||||||
|
"ImageGenerationResponseDataTypedDict": ".imagegenerationresponse",
|
||||||
|
"ImageGenerationResponseTypedDict": ".imagegenerationresponse",
|
||||||
"ImageGenerationServerTool": ".imagegenerationservertool",
|
"ImageGenerationServerTool": ".imagegenerationservertool",
|
||||||
|
"ImageGenerationServerToolBackground": ".imagegenerationservertool",
|
||||||
|
"ImageGenerationServerToolOutputFormat": ".imagegenerationservertool",
|
||||||
|
"ImageGenerationServerToolQuality": ".imagegenerationservertool",
|
||||||
"ImageGenerationServerToolType": ".imagegenerationservertool",
|
"ImageGenerationServerToolType": ".imagegenerationservertool",
|
||||||
"ImageGenerationServerToolTypedDict": ".imagegenerationservertool",
|
"ImageGenerationServerToolTypedDict": ".imagegenerationservertool",
|
||||||
"InputFidelity": ".imagegenerationservertool",
|
"InputFidelity": ".imagegenerationservertool",
|
||||||
@@ -5111,8 +5431,6 @@ _dynamic_imports: dict[str, str] = {
|
|||||||
"InputImageMaskTypedDict": ".imagegenerationservertool",
|
"InputImageMaskTypedDict": ".imagegenerationservertool",
|
||||||
"ModelEnum": ".imagegenerationservertool",
|
"ModelEnum": ".imagegenerationservertool",
|
||||||
"Moderation": ".imagegenerationservertool",
|
"Moderation": ".imagegenerationservertool",
|
||||||
"OutputFormat": ".imagegenerationservertool",
|
|
||||||
"Quality": ".imagegenerationservertool",
|
|
||||||
"Size": ".imagegenerationservertool",
|
"Size": ".imagegenerationservertool",
|
||||||
"ImageGenerationServerToolOpenRouter": ".imagegenerationservertool_openrouter",
|
"ImageGenerationServerToolOpenRouter": ".imagegenerationservertool_openrouter",
|
||||||
"ImageGenerationServerToolOpenRouterType": ".imagegenerationservertool_openrouter",
|
"ImageGenerationServerToolOpenRouterType": ".imagegenerationservertool_openrouter",
|
||||||
@@ -5122,6 +5440,39 @@ _dynamic_imports: dict[str, str] = {
|
|||||||
"ImageGenerationServerToolConfigUnion": ".imagegenerationservertoolconfig_union",
|
"ImageGenerationServerToolConfigUnion": ".imagegenerationservertoolconfig_union",
|
||||||
"ImageGenerationServerToolConfigUnionTypedDict": ".imagegenerationservertoolconfig_union",
|
"ImageGenerationServerToolConfigUnionTypedDict": ".imagegenerationservertoolconfig_union",
|
||||||
"ImageGenerationStatus": ".imagegenerationstatus",
|
"ImageGenerationStatus": ".imagegenerationstatus",
|
||||||
|
"ImageGenerationUsage": ".imagegenerationusage",
|
||||||
|
"ImageGenerationUsageCompletionTokensDetails": ".imagegenerationusage",
|
||||||
|
"ImageGenerationUsageCompletionTokensDetailsTypedDict": ".imagegenerationusage",
|
||||||
|
"ImageGenerationUsagePromptTokensDetails": ".imagegenerationusage",
|
||||||
|
"ImageGenerationUsagePromptTokensDetailsTypedDict": ".imagegenerationusage",
|
||||||
|
"ImageGenerationUsageTypedDict": ".imagegenerationusage",
|
||||||
|
"ServerToolUse": ".imagegenerationusage",
|
||||||
|
"ServerToolUseTypedDict": ".imagegenerationusage",
|
||||||
|
"ImageGenPartialImageEvent": ".imagegenpartialimageevent",
|
||||||
|
"ImageGenPartialImageEventType": ".imagegenpartialimageevent",
|
||||||
|
"ImageGenPartialImageEventTypedDict": ".imagegenpartialimageevent",
|
||||||
|
"ImageGenStreamErrorEvent": ".imagegenstreamerrorevent",
|
||||||
|
"ImageGenStreamErrorEventError": ".imagegenstreamerrorevent",
|
||||||
|
"ImageGenStreamErrorEventErrorTypedDict": ".imagegenstreamerrorevent",
|
||||||
|
"ImageGenStreamErrorEventType": ".imagegenstreamerrorevent",
|
||||||
|
"ImageGenStreamErrorEventTypedDict": ".imagegenstreamerrorevent",
|
||||||
|
"ImageModelArchitecture": ".imagemodelarchitecture",
|
||||||
|
"ImageModelArchitectureTypedDict": ".imagemodelarchitecture",
|
||||||
|
"ImageModelEndpointsResponse": ".imagemodelendpointsresponse",
|
||||||
|
"ImageModelEndpointsResponseTypedDict": ".imagemodelendpointsresponse",
|
||||||
|
"ImageModelListItem": ".imagemodellistitem",
|
||||||
|
"ImageModelListItemTypedDict": ".imagemodellistitem",
|
||||||
|
"ImageModelsListResponse": ".imagemodelslistresponse",
|
||||||
|
"ImageModelsListResponseTypedDict": ".imagemodelslistresponse",
|
||||||
|
"ImageOutputModality": ".imageoutputmodality",
|
||||||
|
"Billable": ".imagepricingentry",
|
||||||
|
"ImagePricingEntry": ".imagepricingentry",
|
||||||
|
"ImagePricingEntryTypedDict": ".imagepricingentry",
|
||||||
|
"Unit": ".imagepricingentry",
|
||||||
|
"ImageStreamingResponse": ".imagestreamingresponse",
|
||||||
|
"ImageStreamingResponseData": ".imagestreamingresponse",
|
||||||
|
"ImageStreamingResponseDataTypedDict": ".imagestreamingresponse",
|
||||||
|
"ImageStreamingResponseTypedDict": ".imagestreamingresponse",
|
||||||
"IncompleteDetails": ".incompletedetails",
|
"IncompleteDetails": ".incompletedetails",
|
||||||
"IncompleteDetailsTypedDict": ".incompletedetails",
|
"IncompleteDetailsTypedDict": ".incompletedetails",
|
||||||
"Reason": ".incompletedetails",
|
"Reason": ".incompletedetails",
|
||||||
@@ -5350,6 +5701,8 @@ _dynamic_imports: dict[str, str] = {
|
|||||||
"KeepType": ".messagesrequest",
|
"KeepType": ".messagesrequest",
|
||||||
"KeepTypedDict": ".messagesrequest",
|
"KeepTypedDict": ".messagesrequest",
|
||||||
"MessagesRequest": ".messagesrequest",
|
"MessagesRequest": ".messagesrequest",
|
||||||
|
"MessagesRequestMetadata": ".messagesrequest",
|
||||||
|
"MessagesRequestMetadataTypedDict": ".messagesrequest",
|
||||||
"MessagesRequestPlugin": ".messagesrequest",
|
"MessagesRequestPlugin": ".messagesrequest",
|
||||||
"MessagesRequestPluginTypedDict": ".messagesrequest",
|
"MessagesRequestPluginTypedDict": ".messagesrequest",
|
||||||
"MessagesRequestTool": ".messagesrequest",
|
"MessagesRequestTool": ".messagesrequest",
|
||||||
@@ -5357,8 +5710,6 @@ _dynamic_imports: dict[str, str] = {
|
|||||||
"MessagesRequestToolUnion": ".messagesrequest",
|
"MessagesRequestToolUnion": ".messagesrequest",
|
||||||
"MessagesRequestToolUnionTypedDict": ".messagesrequest",
|
"MessagesRequestToolUnionTypedDict": ".messagesrequest",
|
||||||
"MessagesRequestTypedDict": ".messagesrequest",
|
"MessagesRequestTypedDict": ".messagesrequest",
|
||||||
"Metadata": ".messagesrequest",
|
|
||||||
"MetadataTypedDict": ".messagesrequest",
|
|
||||||
"NameAdvisor": ".messagesrequest",
|
"NameAdvisor": ".messagesrequest",
|
||||||
"NameBash": ".messagesrequest",
|
"NameBash": ".messagesrequest",
|
||||||
"NameStrReplaceEditor": ".messagesrequest",
|
"NameStrReplaceEditor": ".messagesrequest",
|
||||||
@@ -5881,6 +6232,9 @@ _dynamic_imports: dict[str, str] = {
|
|||||||
"PublicPricing": ".publicpricing",
|
"PublicPricing": ".publicpricing",
|
||||||
"PublicPricingTypedDict": ".publicpricing",
|
"PublicPricingTypedDict": ".publicpricing",
|
||||||
"Quantization": ".quantization",
|
"Quantization": ".quantization",
|
||||||
|
"RangeCapability": ".rangecapability",
|
||||||
|
"RangeCapabilityType": ".rangecapability",
|
||||||
|
"RangeCapabilityTypedDict": ".rangecapability",
|
||||||
"RankingsDailyItem": ".rankingsdailyitem",
|
"RankingsDailyItem": ".rankingsdailyitem",
|
||||||
"RankingsDailyItemTypedDict": ".rankingsdailyitem",
|
"RankingsDailyItemTypedDict": ".rankingsdailyitem",
|
||||||
"RankingsDailyMeta": ".rankingsdailymeta",
|
"RankingsDailyMeta": ".rankingsdailymeta",
|
||||||
@@ -6074,6 +6428,16 @@ _dynamic_imports: dict[str, str] = {
|
|||||||
"SubagentServerToolOpenRouterTypedDict": ".subagentservertool_openrouter",
|
"SubagentServerToolOpenRouterTypedDict": ".subagentservertool_openrouter",
|
||||||
"SubagentServerToolConfig": ".subagentservertoolconfig",
|
"SubagentServerToolConfig": ".subagentservertoolconfig",
|
||||||
"SubagentServerToolConfigTypedDict": ".subagentservertoolconfig",
|
"SubagentServerToolConfigTypedDict": ".subagentservertoolconfig",
|
||||||
|
"TaskClassificationItem": ".taskclassificationitem",
|
||||||
|
"TaskClassificationItemTypedDict": ".taskclassificationitem",
|
||||||
|
"TaskClassificationMacroCategory": ".taskclassificationmacrocategory",
|
||||||
|
"TaskClassificationMacroCategoryTypedDict": ".taskclassificationmacrocategory",
|
||||||
|
"TaskClassificationModel": ".taskclassificationmodel",
|
||||||
|
"TaskClassificationModelTypedDict": ".taskclassificationmodel",
|
||||||
|
"TaskClassificationResponse": ".taskclassificationresponse",
|
||||||
|
"TaskClassificationResponseData": ".taskclassificationresponse",
|
||||||
|
"TaskClassificationResponseDataTypedDict": ".taskclassificationresponse",
|
||||||
|
"TaskClassificationResponseTypedDict": ".taskclassificationresponse",
|
||||||
"TextDeltaEvent": ".textdeltaevent",
|
"TextDeltaEvent": ".textdeltaevent",
|
||||||
"TextDeltaEventType": ".textdeltaevent",
|
"TextDeltaEventType": ".textdeltaevent",
|
||||||
"TextDeltaEventTypedDict": ".textdeltaevent",
|
"TextDeltaEventTypedDict": ".textdeltaevent",
|
||||||
@@ -6114,9 +6478,9 @@ _dynamic_imports: dict[str, str] = {
|
|||||||
"UnifiedBenchmarksMetaSource": ".unifiedbenchmarksmeta",
|
"UnifiedBenchmarksMetaSource": ".unifiedbenchmarksmeta",
|
||||||
"UnifiedBenchmarksMetaTypedDict": ".unifiedbenchmarksmeta",
|
"UnifiedBenchmarksMetaTypedDict": ".unifiedbenchmarksmeta",
|
||||||
"UnifiedBenchmarksMetaVersion": ".unifiedbenchmarksmeta",
|
"UnifiedBenchmarksMetaVersion": ".unifiedbenchmarksmeta",
|
||||||
"Data": ".unifiedbenchmarksresponse",
|
|
||||||
"DataTypedDict": ".unifiedbenchmarksresponse",
|
|
||||||
"UnifiedBenchmarksResponse": ".unifiedbenchmarksresponse",
|
"UnifiedBenchmarksResponse": ".unifiedbenchmarksresponse",
|
||||||
|
"UnifiedBenchmarksResponseData": ".unifiedbenchmarksresponse",
|
||||||
|
"UnifiedBenchmarksResponseDataTypedDict": ".unifiedbenchmarksresponse",
|
||||||
"UnifiedBenchmarksResponseTypedDict": ".unifiedbenchmarksresponse",
|
"UnifiedBenchmarksResponseTypedDict": ".unifiedbenchmarksresponse",
|
||||||
"UnprocessableEntityResponseErrorData": ".unprocessableentityresponseerrordata",
|
"UnprocessableEntityResponseErrorData": ".unprocessableentityresponseerrordata",
|
||||||
"UnprocessableEntityResponseErrorDataTypedDict": ".unprocessableentityresponseerrordata",
|
"UnprocessableEntityResponseErrorDataTypedDict": ".unprocessableentityresponseerrordata",
|
||||||
@@ -6151,13 +6515,13 @@ _dynamic_imports: dict[str, str] = {
|
|||||||
"UsageCostDetails": ".usage",
|
"UsageCostDetails": ".usage",
|
||||||
"UsageCostDetailsTypedDict": ".usage",
|
"UsageCostDetailsTypedDict": ".usage",
|
||||||
"UsageTypedDict": ".usage",
|
"UsageTypedDict": ".usage",
|
||||||
"AspectRatio": ".videogenerationrequest",
|
|
||||||
"Options": ".videogenerationrequest",
|
|
||||||
"OptionsTypedDict": ".videogenerationrequest",
|
|
||||||
"Resolution": ".videogenerationrequest",
|
|
||||||
"VideoGenerationRequest": ".videogenerationrequest",
|
"VideoGenerationRequest": ".videogenerationrequest",
|
||||||
|
"VideoGenerationRequestAspectRatio": ".videogenerationrequest",
|
||||||
|
"VideoGenerationRequestOptions": ".videogenerationrequest",
|
||||||
|
"VideoGenerationRequestOptionsTypedDict": ".videogenerationrequest",
|
||||||
"VideoGenerationRequestProvider": ".videogenerationrequest",
|
"VideoGenerationRequestProvider": ".videogenerationrequest",
|
||||||
"VideoGenerationRequestProviderTypedDict": ".videogenerationrequest",
|
"VideoGenerationRequestProviderTypedDict": ".videogenerationrequest",
|
||||||
|
"VideoGenerationRequestResolution": ".videogenerationrequest",
|
||||||
"VideoGenerationRequestTypedDict": ".videogenerationrequest",
|
"VideoGenerationRequestTypedDict": ".videogenerationrequest",
|
||||||
"VideoGenerationResponse": ".videogenerationresponse",
|
"VideoGenerationResponse": ".videogenerationresponse",
|
||||||
"VideoGenerationResponseStatus": ".videogenerationresponse",
|
"VideoGenerationResponseStatus": ".videogenerationresponse",
|
||||||
|
|||||||
@@ -10,6 +10,7 @@ from typing_extensions import Annotated, NotRequired, TypedDict
|
|||||||
|
|
||||||
AdvisorReasoningEffort = Union[
|
AdvisorReasoningEffort = Union[
|
||||||
Literal[
|
Literal[
|
||||||
|
"max",
|
||||||
"xhigh",
|
"xhigh",
|
||||||
"high",
|
"high",
|
||||||
"medium",
|
"medium",
|
||||||
|
|||||||
@@ -0,0 +1,82 @@
|
|||||||
|
"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
|
||||||
|
|
||||||
|
from __future__ import annotations
|
||||||
|
from .anthropiciterationcachecreation import (
|
||||||
|
AnthropicIterationCacheCreation,
|
||||||
|
AnthropicIterationCacheCreationTypedDict,
|
||||||
|
)
|
||||||
|
from openrouter.types import (
|
||||||
|
BaseModel,
|
||||||
|
Nullable,
|
||||||
|
OptionalNullable,
|
||||||
|
UNSET,
|
||||||
|
UNSET_SENTINEL,
|
||||||
|
)
|
||||||
|
from pydantic import model_serializer
|
||||||
|
from typing import Literal, Optional
|
||||||
|
from typing_extensions import NotRequired, TypedDict
|
||||||
|
|
||||||
|
|
||||||
|
AnthropicAdvisorMessageUsageIterationType = Literal["advisor_message",]
|
||||||
|
|
||||||
|
|
||||||
|
class AnthropicAdvisorMessageUsageIterationTypedDict(TypedDict):
|
||||||
|
model: str
|
||||||
|
type: AnthropicAdvisorMessageUsageIterationType
|
||||||
|
cache_creation: NotRequired[Nullable[AnthropicIterationCacheCreationTypedDict]]
|
||||||
|
cache_creation_input_tokens: NotRequired[int]
|
||||||
|
cache_read_input_tokens: NotRequired[int]
|
||||||
|
input_tokens: NotRequired[int]
|
||||||
|
output_tokens: NotRequired[int]
|
||||||
|
|
||||||
|
|
||||||
|
class AnthropicAdvisorMessageUsageIteration(BaseModel):
|
||||||
|
model: str
|
||||||
|
|
||||||
|
type: AnthropicAdvisorMessageUsageIterationType
|
||||||
|
|
||||||
|
cache_creation: OptionalNullable[AnthropicIterationCacheCreation] = UNSET
|
||||||
|
|
||||||
|
cache_creation_input_tokens: Optional[int] = None
|
||||||
|
|
||||||
|
cache_read_input_tokens: Optional[int] = None
|
||||||
|
|
||||||
|
input_tokens: Optional[int] = None
|
||||||
|
|
||||||
|
output_tokens: Optional[int] = None
|
||||||
|
|
||||||
|
@model_serializer(mode="wrap")
|
||||||
|
def serialize_model(self, handler):
|
||||||
|
optional_fields = [
|
||||||
|
"cache_creation",
|
||||||
|
"cache_creation_input_tokens",
|
||||||
|
"cache_read_input_tokens",
|
||||||
|
"input_tokens",
|
||||||
|
"output_tokens",
|
||||||
|
]
|
||||||
|
nullable_fields = ["cache_creation"]
|
||||||
|
null_default_fields = []
|
||||||
|
|
||||||
|
serialized = handler(self)
|
||||||
|
|
||||||
|
m = {}
|
||||||
|
|
||||||
|
for n, f in type(self).model_fields.items():
|
||||||
|
k = f.alias or n
|
||||||
|
val = serialized.get(k)
|
||||||
|
serialized.pop(k, None)
|
||||||
|
|
||||||
|
optional_nullable = k in optional_fields and k in nullable_fields
|
||||||
|
is_set = (
|
||||||
|
self.__pydantic_fields_set__.intersection({n})
|
||||||
|
or k in null_default_fields
|
||||||
|
) # pylint: disable=no-member
|
||||||
|
|
||||||
|
if val is not None and val != UNSET_SENTINEL:
|
||||||
|
m[k] = val
|
||||||
|
elif val != UNSET_SENTINEL and (
|
||||||
|
not k in optional_fields or (optional_nullable and is_set)
|
||||||
|
):
|
||||||
|
m[k] = val
|
||||||
|
|
||||||
|
return m
|
||||||
@@ -0,0 +1,79 @@
|
|||||||
|
"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
|
||||||
|
|
||||||
|
from __future__ import annotations
|
||||||
|
from .anthropiciterationcachecreation import (
|
||||||
|
AnthropicIterationCacheCreation,
|
||||||
|
AnthropicIterationCacheCreationTypedDict,
|
||||||
|
)
|
||||||
|
from openrouter.types import (
|
||||||
|
BaseModel,
|
||||||
|
Nullable,
|
||||||
|
OptionalNullable,
|
||||||
|
UNSET,
|
||||||
|
UNSET_SENTINEL,
|
||||||
|
)
|
||||||
|
from pydantic import model_serializer
|
||||||
|
from typing import Literal, Optional
|
||||||
|
from typing_extensions import NotRequired, TypedDict
|
||||||
|
|
||||||
|
|
||||||
|
AnthropicCompactionUsageIterationType = Literal["compaction",]
|
||||||
|
|
||||||
|
|
||||||
|
class AnthropicCompactionUsageIterationTypedDict(TypedDict):
|
||||||
|
type: AnthropicCompactionUsageIterationType
|
||||||
|
cache_creation: NotRequired[Nullable[AnthropicIterationCacheCreationTypedDict]]
|
||||||
|
cache_creation_input_tokens: NotRequired[int]
|
||||||
|
cache_read_input_tokens: NotRequired[int]
|
||||||
|
input_tokens: NotRequired[int]
|
||||||
|
output_tokens: NotRequired[int]
|
||||||
|
|
||||||
|
|
||||||
|
class AnthropicCompactionUsageIteration(BaseModel):
|
||||||
|
type: AnthropicCompactionUsageIterationType
|
||||||
|
|
||||||
|
cache_creation: OptionalNullable[AnthropicIterationCacheCreation] = UNSET
|
||||||
|
|
||||||
|
cache_creation_input_tokens: Optional[int] = None
|
||||||
|
|
||||||
|
cache_read_input_tokens: Optional[int] = None
|
||||||
|
|
||||||
|
input_tokens: Optional[int] = None
|
||||||
|
|
||||||
|
output_tokens: Optional[int] = None
|
||||||
|
|
||||||
|
@model_serializer(mode="wrap")
|
||||||
|
def serialize_model(self, handler):
|
||||||
|
optional_fields = [
|
||||||
|
"cache_creation",
|
||||||
|
"cache_creation_input_tokens",
|
||||||
|
"cache_read_input_tokens",
|
||||||
|
"input_tokens",
|
||||||
|
"output_tokens",
|
||||||
|
]
|
||||||
|
nullable_fields = ["cache_creation"]
|
||||||
|
null_default_fields = []
|
||||||
|
|
||||||
|
serialized = handler(self)
|
||||||
|
|
||||||
|
m = {}
|
||||||
|
|
||||||
|
for n, f in type(self).model_fields.items():
|
||||||
|
k = f.alias or n
|
||||||
|
val = serialized.get(k)
|
||||||
|
serialized.pop(k, None)
|
||||||
|
|
||||||
|
optional_nullable = k in optional_fields and k in nullable_fields
|
||||||
|
is_set = (
|
||||||
|
self.__pydantic_fields_set__.intersection({n})
|
||||||
|
or k in null_default_fields
|
||||||
|
) # pylint: disable=no-member
|
||||||
|
|
||||||
|
if val is not None and val != UNSET_SENTINEL:
|
||||||
|
m[k] = val
|
||||||
|
elif val != UNSET_SENTINEL and (
|
||||||
|
not k in optional_fields or (optional_nullable and is_set)
|
||||||
|
):
|
||||||
|
m[k] = val
|
||||||
|
|
||||||
|
return m
|
||||||
@@ -0,0 +1,17 @@
|
|||||||
|
"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
|
||||||
|
|
||||||
|
from __future__ import annotations
|
||||||
|
from openrouter.types import BaseModel
|
||||||
|
from typing import Optional
|
||||||
|
from typing_extensions import NotRequired, TypedDict
|
||||||
|
|
||||||
|
|
||||||
|
class AnthropicIterationCacheCreationTypedDict(TypedDict):
|
||||||
|
ephemeral_1h_input_tokens: NotRequired[int]
|
||||||
|
ephemeral_5m_input_tokens: NotRequired[int]
|
||||||
|
|
||||||
|
|
||||||
|
class AnthropicIterationCacheCreation(BaseModel):
|
||||||
|
ephemeral_1h_input_tokens: Optional[int] = None
|
||||||
|
|
||||||
|
ephemeral_5m_input_tokens: Optional[int] = None
|
||||||
@@ -0,0 +1,83 @@
|
|||||||
|
"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
|
||||||
|
|
||||||
|
from __future__ import annotations
|
||||||
|
from .anthropiciterationcachecreation import (
|
||||||
|
AnthropicIterationCacheCreation,
|
||||||
|
AnthropicIterationCacheCreationTypedDict,
|
||||||
|
)
|
||||||
|
from openrouter.types import (
|
||||||
|
BaseModel,
|
||||||
|
Nullable,
|
||||||
|
OptionalNullable,
|
||||||
|
UNSET,
|
||||||
|
UNSET_SENTINEL,
|
||||||
|
)
|
||||||
|
from pydantic import model_serializer
|
||||||
|
from typing import Literal, Optional
|
||||||
|
from typing_extensions import NotRequired, TypedDict
|
||||||
|
|
||||||
|
|
||||||
|
AnthropicMessageUsageIterationType = Literal["message",]
|
||||||
|
|
||||||
|
|
||||||
|
class AnthropicMessageUsageIterationTypedDict(TypedDict):
|
||||||
|
type: AnthropicMessageUsageIterationType
|
||||||
|
cache_creation: NotRequired[Nullable[AnthropicIterationCacheCreationTypedDict]]
|
||||||
|
cache_creation_input_tokens: NotRequired[int]
|
||||||
|
cache_read_input_tokens: NotRequired[int]
|
||||||
|
input_tokens: NotRequired[int]
|
||||||
|
output_tokens: NotRequired[int]
|
||||||
|
model: NotRequired[str]
|
||||||
|
|
||||||
|
|
||||||
|
class AnthropicMessageUsageIteration(BaseModel):
|
||||||
|
type: AnthropicMessageUsageIterationType
|
||||||
|
|
||||||
|
cache_creation: OptionalNullable[AnthropicIterationCacheCreation] = UNSET
|
||||||
|
|
||||||
|
cache_creation_input_tokens: Optional[int] = None
|
||||||
|
|
||||||
|
cache_read_input_tokens: Optional[int] = None
|
||||||
|
|
||||||
|
input_tokens: Optional[int] = None
|
||||||
|
|
||||||
|
output_tokens: Optional[int] = None
|
||||||
|
|
||||||
|
model: Optional[str] = None
|
||||||
|
|
||||||
|
@model_serializer(mode="wrap")
|
||||||
|
def serialize_model(self, handler):
|
||||||
|
optional_fields = [
|
||||||
|
"cache_creation",
|
||||||
|
"cache_creation_input_tokens",
|
||||||
|
"cache_read_input_tokens",
|
||||||
|
"input_tokens",
|
||||||
|
"output_tokens",
|
||||||
|
"model",
|
||||||
|
]
|
||||||
|
nullable_fields = ["cache_creation"]
|
||||||
|
null_default_fields = []
|
||||||
|
|
||||||
|
serialized = handler(self)
|
||||||
|
|
||||||
|
m = {}
|
||||||
|
|
||||||
|
for n, f in type(self).model_fields.items():
|
||||||
|
k = f.alias or n
|
||||||
|
val = serialized.get(k)
|
||||||
|
serialized.pop(k, None)
|
||||||
|
|
||||||
|
optional_nullable = k in optional_fields and k in nullable_fields
|
||||||
|
is_set = (
|
||||||
|
self.__pydantic_fields_set__.intersection({n})
|
||||||
|
or k in null_default_fields
|
||||||
|
) # pylint: disable=no-member
|
||||||
|
|
||||||
|
if val is not None and val != UNSET_SENTINEL:
|
||||||
|
m[k] = val
|
||||||
|
elif val != UNSET_SENTINEL and (
|
||||||
|
not k in optional_fields or (optional_nullable and is_set)
|
||||||
|
):
|
||||||
|
m[k] = val
|
||||||
|
|
||||||
|
return m
|
||||||
@@ -0,0 +1,14 @@
|
|||||||
|
"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
|
||||||
|
|
||||||
|
from __future__ import annotations
|
||||||
|
from openrouter.types import UnrecognizedStr
|
||||||
|
from typing import Literal, Union
|
||||||
|
|
||||||
|
|
||||||
|
AnthropicSpeed = Union[
|
||||||
|
Literal[
|
||||||
|
"fast",
|
||||||
|
"standard",
|
||||||
|
],
|
||||||
|
UnrecognizedStr,
|
||||||
|
]
|
||||||
@@ -0,0 +1,76 @@
|
|||||||
|
"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
|
||||||
|
|
||||||
|
from __future__ import annotations
|
||||||
|
from .anthropiciterationcachecreation import (
|
||||||
|
AnthropicIterationCacheCreation,
|
||||||
|
AnthropicIterationCacheCreationTypedDict,
|
||||||
|
)
|
||||||
|
from openrouter.types import (
|
||||||
|
BaseModel,
|
||||||
|
Nullable,
|
||||||
|
OptionalNullable,
|
||||||
|
UNSET,
|
||||||
|
UNSET_SENTINEL,
|
||||||
|
)
|
||||||
|
from pydantic import model_serializer
|
||||||
|
from typing import Optional
|
||||||
|
from typing_extensions import NotRequired, TypedDict
|
||||||
|
|
||||||
|
|
||||||
|
class AnthropicUnknownUsageIterationTypedDict(TypedDict):
|
||||||
|
type: str
|
||||||
|
cache_creation: NotRequired[Nullable[AnthropicIterationCacheCreationTypedDict]]
|
||||||
|
cache_creation_input_tokens: NotRequired[int]
|
||||||
|
cache_read_input_tokens: NotRequired[int]
|
||||||
|
input_tokens: NotRequired[int]
|
||||||
|
output_tokens: NotRequired[int]
|
||||||
|
|
||||||
|
|
||||||
|
class AnthropicUnknownUsageIteration(BaseModel):
|
||||||
|
type: str
|
||||||
|
|
||||||
|
cache_creation: OptionalNullable[AnthropicIterationCacheCreation] = UNSET
|
||||||
|
|
||||||
|
cache_creation_input_tokens: Optional[int] = None
|
||||||
|
|
||||||
|
cache_read_input_tokens: Optional[int] = None
|
||||||
|
|
||||||
|
input_tokens: Optional[int] = None
|
||||||
|
|
||||||
|
output_tokens: Optional[int] = None
|
||||||
|
|
||||||
|
@model_serializer(mode="wrap")
|
||||||
|
def serialize_model(self, handler):
|
||||||
|
optional_fields = [
|
||||||
|
"cache_creation",
|
||||||
|
"cache_creation_input_tokens",
|
||||||
|
"cache_read_input_tokens",
|
||||||
|
"input_tokens",
|
||||||
|
"output_tokens",
|
||||||
|
]
|
||||||
|
nullable_fields = ["cache_creation"]
|
||||||
|
null_default_fields = []
|
||||||
|
|
||||||
|
serialized = handler(self)
|
||||||
|
|
||||||
|
m = {}
|
||||||
|
|
||||||
|
for n, f in type(self).model_fields.items():
|
||||||
|
k = f.alias or n
|
||||||
|
val = serialized.get(k)
|
||||||
|
serialized.pop(k, None)
|
||||||
|
|
||||||
|
optional_nullable = k in optional_fields and k in nullable_fields
|
||||||
|
is_set = (
|
||||||
|
self.__pydantic_fields_set__.intersection({n})
|
||||||
|
or k in null_default_fields
|
||||||
|
) # pylint: disable=no-member
|
||||||
|
|
||||||
|
if val is not None and val != UNSET_SENTINEL:
|
||||||
|
m[k] = val
|
||||||
|
elif val != UNSET_SENTINEL and (
|
||||||
|
not k in optional_fields or (optional_nullable and is_set)
|
||||||
|
):
|
||||||
|
m[k] = val
|
||||||
|
|
||||||
|
return m
|
||||||
@@ -0,0 +1,43 @@
|
|||||||
|
"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
|
||||||
|
|
||||||
|
from __future__ import annotations
|
||||||
|
from .anthropicadvisormessageusageiteration import (
|
||||||
|
AnthropicAdvisorMessageUsageIteration,
|
||||||
|
AnthropicAdvisorMessageUsageIterationTypedDict,
|
||||||
|
)
|
||||||
|
from .anthropiccompactionusageiteration import (
|
||||||
|
AnthropicCompactionUsageIteration,
|
||||||
|
AnthropicCompactionUsageIterationTypedDict,
|
||||||
|
)
|
||||||
|
from .anthropicmessageusageiteration import (
|
||||||
|
AnthropicMessageUsageIteration,
|
||||||
|
AnthropicMessageUsageIterationTypedDict,
|
||||||
|
)
|
||||||
|
from .anthropicunknownusageiteration import (
|
||||||
|
AnthropicUnknownUsageIteration,
|
||||||
|
AnthropicUnknownUsageIterationTypedDict,
|
||||||
|
)
|
||||||
|
from typing import Union
|
||||||
|
from typing_extensions import TypeAliasType
|
||||||
|
|
||||||
|
|
||||||
|
AnthropicUsageIterationTypedDict = TypeAliasType(
|
||||||
|
"AnthropicUsageIterationTypedDict",
|
||||||
|
Union[
|
||||||
|
AnthropicCompactionUsageIterationTypedDict,
|
||||||
|
AnthropicUnknownUsageIterationTypedDict,
|
||||||
|
AnthropicMessageUsageIterationTypedDict,
|
||||||
|
AnthropicAdvisorMessageUsageIterationTypedDict,
|
||||||
|
],
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
|
AnthropicUsageIteration = TypeAliasType(
|
||||||
|
"AnthropicUsageIteration",
|
||||||
|
Union[
|
||||||
|
AnthropicCompactionUsageIteration,
|
||||||
|
AnthropicUnknownUsageIteration,
|
||||||
|
AnthropicMessageUsageIteration,
|
||||||
|
AnthropicAdvisorMessageUsageIteration,
|
||||||
|
],
|
||||||
|
)
|
||||||
@@ -0,0 +1,40 @@
|
|||||||
|
"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
|
||||||
|
|
||||||
|
from __future__ import annotations
|
||||||
|
from openrouter.types import UnrecognizedStr
|
||||||
|
from typing import Literal, Union
|
||||||
|
|
||||||
|
|
||||||
|
APIErrorType = Union[
|
||||||
|
Literal[
|
||||||
|
"context_length_exceeded",
|
||||||
|
"max_tokens_exceeded",
|
||||||
|
"token_limit_exceeded",
|
||||||
|
"string_too_long",
|
||||||
|
"authentication",
|
||||||
|
"permission_denied",
|
||||||
|
"payment_required",
|
||||||
|
"rate_limit_exceeded",
|
||||||
|
"provider_overloaded",
|
||||||
|
"provider_unavailable",
|
||||||
|
"invalid_request",
|
||||||
|
"invalid_prompt",
|
||||||
|
"not_found",
|
||||||
|
"precondition_failed",
|
||||||
|
"payload_too_large",
|
||||||
|
"unprocessable",
|
||||||
|
"content_policy_violation",
|
||||||
|
"refusal",
|
||||||
|
"invalid_image",
|
||||||
|
"image_too_large",
|
||||||
|
"image_too_small",
|
||||||
|
"unsupported_image_format",
|
||||||
|
"image_not_found",
|
||||||
|
"image_download_failed",
|
||||||
|
"server",
|
||||||
|
"timeout",
|
||||||
|
"unmapped",
|
||||||
|
],
|
||||||
|
UnrecognizedStr,
|
||||||
|
]
|
||||||
|
r"""Canonical OpenRouter error type, stable across all API formats"""
|
||||||
@@ -0,0 +1,21 @@
|
|||||||
|
"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
|
||||||
|
|
||||||
|
from __future__ import annotations
|
||||||
|
from openrouter.types import BaseModel
|
||||||
|
from typing import Literal
|
||||||
|
from typing_extensions import TypedDict
|
||||||
|
|
||||||
|
|
||||||
|
BooleanCapabilityType = Literal["boolean",]
|
||||||
|
|
||||||
|
|
||||||
|
class BooleanCapabilityTypedDict(TypedDict):
|
||||||
|
r"""A supported-or-not flag. Present means the parameter is accepted."""
|
||||||
|
|
||||||
|
type: BooleanCapabilityType
|
||||||
|
|
||||||
|
|
||||||
|
class BooleanCapability(BaseModel):
|
||||||
|
r"""A supported-or-not flag. Present means the parameter is accepted."""
|
||||||
|
|
||||||
|
type: BooleanCapabilityType
|
||||||
@@ -43,8 +43,10 @@ BYOKProviderSlug = Union[
|
|||||||
"google-ai-studio",
|
"google-ai-studio",
|
||||||
"google-vertex",
|
"google-vertex",
|
||||||
"groq",
|
"groq",
|
||||||
|
"heygen",
|
||||||
"inception",
|
"inception",
|
||||||
"inceptron",
|
"inceptron",
|
||||||
|
"inferact-vllm",
|
||||||
"inference-net",
|
"inference-net",
|
||||||
"infermatic",
|
"infermatic",
|
||||||
"inflection",
|
"inflection",
|
||||||
@@ -72,9 +74,11 @@ BYOKProviderSlug = Union[
|
|||||||
"perplexity",
|
"perplexity",
|
||||||
"phala",
|
"phala",
|
||||||
"poolside",
|
"poolside",
|
||||||
|
"quiver",
|
||||||
"recraft",
|
"recraft",
|
||||||
"reka",
|
"reka",
|
||||||
"relace",
|
"relace",
|
||||||
|
"sakana-ai",
|
||||||
"sambanova",
|
"sambanova",
|
||||||
"seed",
|
"seed",
|
||||||
"siliconflow",
|
"siliconflow",
|
||||||
@@ -82,6 +86,7 @@ BYOKProviderSlug = Union[
|
|||||||
"stepfun",
|
"stepfun",
|
||||||
"streamlake",
|
"streamlake",
|
||||||
"switchpoint",
|
"switchpoint",
|
||||||
|
"tenstorrent",
|
||||||
"together",
|
"together",
|
||||||
"upstage",
|
"upstage",
|
||||||
"venice",
|
"venice",
|
||||||
|
|||||||
@@ -0,0 +1,30 @@
|
|||||||
|
"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
|
||||||
|
|
||||||
|
from __future__ import annotations
|
||||||
|
from .booleancapability import BooleanCapability, BooleanCapabilityTypedDict
|
||||||
|
from .enumcapability import EnumCapability, EnumCapabilityTypedDict
|
||||||
|
from .rangecapability import RangeCapability, RangeCapabilityTypedDict
|
||||||
|
from openrouter.utils import get_discriminator
|
||||||
|
from pydantic import Discriminator, Tag
|
||||||
|
from typing import Union
|
||||||
|
from typing_extensions import Annotated, TypeAliasType
|
||||||
|
|
||||||
|
|
||||||
|
CapabilityDescriptorTypedDict = TypeAliasType(
|
||||||
|
"CapabilityDescriptorTypedDict",
|
||||||
|
Union[
|
||||||
|
BooleanCapabilityTypedDict, EnumCapabilityTypedDict, RangeCapabilityTypedDict
|
||||||
|
],
|
||||||
|
)
|
||||||
|
r"""A typed descriptor for one supported request parameter."""
|
||||||
|
|
||||||
|
|
||||||
|
CapabilityDescriptor = Annotated[
|
||||||
|
Union[
|
||||||
|
Annotated[EnumCapability, Tag("enum")],
|
||||||
|
Annotated[RangeCapability, Tag("range")],
|
||||||
|
Annotated[BooleanCapability, Tag("boolean")],
|
||||||
|
],
|
||||||
|
Discriminator(lambda m: get_discriminator(m, "type", "type")),
|
||||||
|
]
|
||||||
|
r"""A typed descriptor for one supported request parameter."""
|
||||||
@@ -13,17 +13,18 @@ ChatContentImageDetail = Union[
|
|||||||
"auto",
|
"auto",
|
||||||
"low",
|
"low",
|
||||||
"high",
|
"high",
|
||||||
|
"original",
|
||||||
],
|
],
|
||||||
UnrecognizedStr,
|
UnrecognizedStr,
|
||||||
]
|
]
|
||||||
r"""Image detail level for vision models"""
|
r"""Image detail level for vision models. `original` is an OpenRouter extension (not in the OpenAI Chat Completions spec) requesting true original-resolution media; it is downgraded to `high` for providers that lack an original-resolution tier."""
|
||||||
|
|
||||||
|
|
||||||
class ChatContentImageImageURLTypedDict(TypedDict):
|
class ChatContentImageImageURLTypedDict(TypedDict):
|
||||||
url: str
|
url: str
|
||||||
r"""URL of the image (data: URLs supported)"""
|
r"""URL of the image (data: URLs supported)"""
|
||||||
detail: NotRequired[ChatContentImageDetail]
|
detail: NotRequired[ChatContentImageDetail]
|
||||||
r"""Image detail level for vision models"""
|
r"""Image detail level for vision models. `original` is an OpenRouter extension (not in the OpenAI Chat Completions spec) requesting true original-resolution media; it is downgraded to `high` for providers that lack an original-resolution tier."""
|
||||||
|
|
||||||
|
|
||||||
class ChatContentImageImageURL(BaseModel):
|
class ChatContentImageImageURL(BaseModel):
|
||||||
@@ -33,7 +34,7 @@ class ChatContentImageImageURL(BaseModel):
|
|||||||
detail: Annotated[
|
detail: Annotated[
|
||||||
Optional[ChatContentImageDetail], PlainValidator(validate_open_enum(False))
|
Optional[ChatContentImageDetail], PlainValidator(validate_open_enum(False))
|
||||||
] = None
|
] = None
|
||||||
r"""Image detail level for vision models"""
|
r"""Image detail level for vision models. `original` is an OpenRouter extension (not in the OpenAI Chat Completions spec) requesting true original-resolution media; it is downgraded to `high` for providers that lack an original-resolution tier."""
|
||||||
|
|
||||||
|
|
||||||
ChatContentImageType = Literal["image_url",]
|
ChatContentImageType = Literal["image_url",]
|
||||||
|
|||||||
@@ -106,6 +106,7 @@ ChatRequestPlugin = Annotated[
|
|||||||
|
|
||||||
ChatRequestEffort = Union[
|
ChatRequestEffort = Union[
|
||||||
Literal[
|
Literal[
|
||||||
|
"max",
|
||||||
"xhigh",
|
"xhigh",
|
||||||
"high",
|
"high",
|
||||||
"medium",
|
"medium",
|
||||||
@@ -172,6 +173,7 @@ class ChatRequestReasoning(BaseModel):
|
|||||||
|
|
||||||
ChatRequestReasoningEffort = Union[
|
ChatRequestReasoningEffort = Union[
|
||||||
Literal[
|
Literal[
|
||||||
|
"max",
|
||||||
"xhigh",
|
"xhigh",
|
||||||
"high",
|
"high",
|
||||||
"medium",
|
"medium",
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
|
"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
|
||||||
|
|
||||||
from __future__ import annotations
|
from __future__ import annotations
|
||||||
|
from .apierrortype import APIErrorType
|
||||||
from .chatstreamchoice import ChatStreamChoice, ChatStreamChoiceTypedDict
|
from .chatstreamchoice import ChatStreamChoice, ChatStreamChoiceTypedDict
|
||||||
from .chatusage import ChatUsage, ChatUsageTypedDict
|
from .chatusage import ChatUsage, ChatUsageTypedDict
|
||||||
from .openroutermetadata import OpenRouterMetadata, OpenRouterMetadataTypedDict
|
from .openroutermetadata import OpenRouterMetadata, OpenRouterMetadataTypedDict
|
||||||
@@ -11,21 +12,44 @@ from openrouter.types import (
|
|||||||
UNSET,
|
UNSET,
|
||||||
UNSET_SENTINEL,
|
UNSET_SENTINEL,
|
||||||
)
|
)
|
||||||
|
from openrouter.utils import validate_open_enum
|
||||||
from pydantic import model_serializer
|
from pydantic import model_serializer
|
||||||
|
from pydantic.functional_validators import PlainValidator
|
||||||
from typing import List, Literal, Optional
|
from typing import List, Literal, Optional
|
||||||
from typing_extensions import NotRequired, TypedDict
|
from typing_extensions import Annotated, NotRequired, TypedDict
|
||||||
|
|
||||||
|
|
||||||
class ErrorTypedDict(TypedDict):
|
class ChatStreamChunkMetadataTypedDict(TypedDict):
|
||||||
|
r"""Structured error metadata"""
|
||||||
|
|
||||||
|
error_type: APIErrorType
|
||||||
|
r"""Canonical OpenRouter error type, stable across all API formats"""
|
||||||
|
provider_code: NotRequired[str]
|
||||||
|
r"""Upstream provider-specific error code, when available"""
|
||||||
|
|
||||||
|
|
||||||
|
class ChatStreamChunkMetadata(BaseModel):
|
||||||
|
r"""Structured error metadata"""
|
||||||
|
|
||||||
|
error_type: Annotated[APIErrorType, PlainValidator(validate_open_enum(False))]
|
||||||
|
r"""Canonical OpenRouter error type, stable across all API formats"""
|
||||||
|
|
||||||
|
provider_code: Optional[str] = None
|
||||||
|
r"""Upstream provider-specific error code, when available"""
|
||||||
|
|
||||||
|
|
||||||
|
class ChatStreamChunkErrorTypedDict(TypedDict):
|
||||||
r"""Error information"""
|
r"""Error information"""
|
||||||
|
|
||||||
code: int
|
code: int
|
||||||
r"""Error code"""
|
r"""Error code"""
|
||||||
message: str
|
message: str
|
||||||
r"""Error message"""
|
r"""Error message"""
|
||||||
|
metadata: NotRequired[ChatStreamChunkMetadataTypedDict]
|
||||||
|
r"""Structured error metadata"""
|
||||||
|
|
||||||
|
|
||||||
class Error(BaseModel):
|
class ChatStreamChunkError(BaseModel):
|
||||||
r"""Error information"""
|
r"""Error information"""
|
||||||
|
|
||||||
code: int
|
code: int
|
||||||
@@ -34,6 +58,9 @@ class Error(BaseModel):
|
|||||||
message: str
|
message: str
|
||||||
r"""Error message"""
|
r"""Error message"""
|
||||||
|
|
||||||
|
metadata: Optional[ChatStreamChunkMetadata] = None
|
||||||
|
r"""Structured error metadata"""
|
||||||
|
|
||||||
|
|
||||||
ChatStreamChunkObject = Literal["chat.completion.chunk",]
|
ChatStreamChunkObject = Literal["chat.completion.chunk",]
|
||||||
|
|
||||||
@@ -50,7 +77,7 @@ class ChatStreamChunkTypedDict(TypedDict):
|
|||||||
model: str
|
model: str
|
||||||
r"""Model used for completion"""
|
r"""Model used for completion"""
|
||||||
object: ChatStreamChunkObject
|
object: ChatStreamChunkObject
|
||||||
error: NotRequired[ErrorTypedDict]
|
error: NotRequired[ChatStreamChunkErrorTypedDict]
|
||||||
r"""Error information"""
|
r"""Error information"""
|
||||||
openrouter_metadata: NotRequired[OpenRouterMetadataTypedDict]
|
openrouter_metadata: NotRequired[OpenRouterMetadataTypedDict]
|
||||||
service_tier: NotRequired[Nullable[str]]
|
service_tier: NotRequired[Nullable[str]]
|
||||||
@@ -78,7 +105,7 @@ class ChatStreamChunk(BaseModel):
|
|||||||
|
|
||||||
object: ChatStreamChunkObject
|
object: ChatStreamChunkObject
|
||||||
|
|
||||||
error: Optional[Error] = None
|
error: Optional[ChatStreamChunkError] = None
|
||||||
r"""Error information"""
|
r"""Error information"""
|
||||||
|
|
||||||
openrouter_metadata: Optional[OpenRouterMetadata] = None
|
openrouter_metadata: Optional[OpenRouterMetadata] = None
|
||||||
|
|||||||
@@ -14,7 +14,7 @@ from typing import Optional
|
|||||||
from typing_extensions import NotRequired, TypedDict
|
from typing_extensions import NotRequired, TypedDict
|
||||||
|
|
||||||
|
|
||||||
class CompletionTokensDetailsTypedDict(TypedDict):
|
class ChatUsageCompletionTokensDetailsTypedDict(TypedDict):
|
||||||
r"""Detailed completion token usage"""
|
r"""Detailed completion token usage"""
|
||||||
|
|
||||||
accepted_prediction_tokens: NotRequired[Nullable[int]]
|
accepted_prediction_tokens: NotRequired[Nullable[int]]
|
||||||
@@ -27,7 +27,7 @@ class CompletionTokensDetailsTypedDict(TypedDict):
|
|||||||
r"""Rejected prediction tokens"""
|
r"""Rejected prediction tokens"""
|
||||||
|
|
||||||
|
|
||||||
class CompletionTokensDetails(BaseModel):
|
class ChatUsageCompletionTokensDetails(BaseModel):
|
||||||
r"""Detailed completion token usage"""
|
r"""Detailed completion token usage"""
|
||||||
|
|
||||||
accepted_prediction_tokens: OptionalNullable[int] = UNSET
|
accepted_prediction_tokens: OptionalNullable[int] = UNSET
|
||||||
@@ -83,7 +83,7 @@ class CompletionTokensDetails(BaseModel):
|
|||||||
return m
|
return m
|
||||||
|
|
||||||
|
|
||||||
class PromptTokensDetailsTypedDict(TypedDict):
|
class ChatUsagePromptTokensDetailsTypedDict(TypedDict):
|
||||||
r"""Detailed prompt token usage"""
|
r"""Detailed prompt token usage"""
|
||||||
|
|
||||||
audio_tokens: NotRequired[int]
|
audio_tokens: NotRequired[int]
|
||||||
@@ -96,7 +96,7 @@ class PromptTokensDetailsTypedDict(TypedDict):
|
|||||||
r"""Video input tokens"""
|
r"""Video input tokens"""
|
||||||
|
|
||||||
|
|
||||||
class PromptTokensDetails(BaseModel):
|
class ChatUsagePromptTokensDetails(BaseModel):
|
||||||
r"""Detailed prompt token usage"""
|
r"""Detailed prompt token usage"""
|
||||||
|
|
||||||
audio_tokens: Optional[int] = None
|
audio_tokens: Optional[int] = None
|
||||||
@@ -112,68 +112,141 @@ class PromptTokensDetails(BaseModel):
|
|||||||
r"""Video input tokens"""
|
r"""Video input tokens"""
|
||||||
|
|
||||||
|
|
||||||
class ChatUsageTypedDict(TypedDict):
|
class ServerToolUseDetailsTypedDict(TypedDict):
|
||||||
r"""Token usage statistics"""
|
r"""Usage for server-side tool execution (e.g., web search)"""
|
||||||
|
|
||||||
completion_tokens: int
|
tool_calls_executed: NotRequired[Nullable[int]]
|
||||||
r"""Number of tokens in the completion"""
|
r"""Number of OpenRouter server tool calls that executed and produced a result"""
|
||||||
prompt_tokens: int
|
tool_calls_requested: NotRequired[Nullable[int]]
|
||||||
r"""Number of tokens in the prompt"""
|
r"""Total number of OpenRouter server-orchestrated tool calls the model requested, across all tool types. Provider-native tools (e.g. native web search) are not counted here."""
|
||||||
total_tokens: int
|
web_search_requests: NotRequired[Nullable[int]]
|
||||||
r"""Total number of tokens"""
|
r"""Number of web searches performed by server-side tools. For server-orchestrated tool calls a web search is also counted in tool_calls_requested; provider-native web search may report web_search_requests only. Do not sum the two."""
|
||||||
completion_tokens_details: NotRequired[Nullable[CompletionTokensDetailsTypedDict]]
|
|
||||||
r"""Detailed completion token usage"""
|
|
||||||
cost: NotRequired[Nullable[float]]
|
|
||||||
r"""Cost of the completion"""
|
|
||||||
cost_details: NotRequired[Nullable[CostDetailsTypedDict]]
|
|
||||||
r"""Breakdown of upstream inference costs"""
|
|
||||||
is_byok: NotRequired[bool]
|
|
||||||
r"""Whether a request was made using a Bring Your Own Key configuration"""
|
|
||||||
prompt_tokens_details: NotRequired[Nullable[PromptTokensDetailsTypedDict]]
|
|
||||||
r"""Detailed prompt token usage"""
|
|
||||||
|
|
||||||
|
|
||||||
class ChatUsage(BaseModel):
|
class ServerToolUseDetails(BaseModel):
|
||||||
r"""Token usage statistics"""
|
r"""Usage for server-side tool execution (e.g., web search)"""
|
||||||
|
|
||||||
completion_tokens: int
|
tool_calls_executed: OptionalNullable[int] = UNSET
|
||||||
r"""Number of tokens in the completion"""
|
r"""Number of OpenRouter server tool calls that executed and produced a result"""
|
||||||
|
|
||||||
prompt_tokens: int
|
tool_calls_requested: OptionalNullable[int] = UNSET
|
||||||
r"""Number of tokens in the prompt"""
|
r"""Total number of OpenRouter server-orchestrated tool calls the model requested, across all tool types. Provider-native tools (e.g. native web search) are not counted here."""
|
||||||
|
|
||||||
total_tokens: int
|
web_search_requests: OptionalNullable[int] = UNSET
|
||||||
r"""Total number of tokens"""
|
r"""Number of web searches performed by server-side tools. For server-orchestrated tool calls a web search is also counted in tool_calls_requested; provider-native web search may report web_search_requests only. Do not sum the two."""
|
||||||
|
|
||||||
completion_tokens_details: OptionalNullable[CompletionTokensDetails] = UNSET
|
|
||||||
r"""Detailed completion token usage"""
|
|
||||||
|
|
||||||
cost: OptionalNullable[float] = UNSET
|
|
||||||
r"""Cost of the completion"""
|
|
||||||
|
|
||||||
cost_details: OptionalNullable[CostDetails] = UNSET
|
|
||||||
r"""Breakdown of upstream inference costs"""
|
|
||||||
|
|
||||||
is_byok: Optional[bool] = None
|
|
||||||
r"""Whether a request was made using a Bring Your Own Key configuration"""
|
|
||||||
|
|
||||||
prompt_tokens_details: OptionalNullable[PromptTokensDetails] = UNSET
|
|
||||||
r"""Detailed prompt token usage"""
|
|
||||||
|
|
||||||
@model_serializer(mode="wrap")
|
@model_serializer(mode="wrap")
|
||||||
def serialize_model(self, handler):
|
def serialize_model(self, handler):
|
||||||
optional_fields = [
|
optional_fields = [
|
||||||
"completion_tokens_details",
|
"tool_calls_executed",
|
||||||
"cost",
|
"tool_calls_requested",
|
||||||
"cost_details",
|
"web_search_requests",
|
||||||
"is_byok",
|
|
||||||
"prompt_tokens_details",
|
|
||||||
]
|
]
|
||||||
nullable_fields = [
|
nullable_fields = [
|
||||||
|
"tool_calls_executed",
|
||||||
|
"tool_calls_requested",
|
||||||
|
"web_search_requests",
|
||||||
|
]
|
||||||
|
null_default_fields = []
|
||||||
|
|
||||||
|
serialized = handler(self)
|
||||||
|
|
||||||
|
m = {}
|
||||||
|
|
||||||
|
for n, f in type(self).model_fields.items():
|
||||||
|
k = f.alias or n
|
||||||
|
val = serialized.get(k)
|
||||||
|
serialized.pop(k, None)
|
||||||
|
|
||||||
|
optional_nullable = k in optional_fields and k in nullable_fields
|
||||||
|
is_set = (
|
||||||
|
self.__pydantic_fields_set__.intersection({n})
|
||||||
|
or k in null_default_fields
|
||||||
|
) # pylint: disable=no-member
|
||||||
|
|
||||||
|
if val is not None and val != UNSET_SENTINEL:
|
||||||
|
m[k] = val
|
||||||
|
elif val != UNSET_SENTINEL and (
|
||||||
|
not k in optional_fields or (optional_nullable and is_set)
|
||||||
|
):
|
||||||
|
m[k] = val
|
||||||
|
|
||||||
|
return m
|
||||||
|
|
||||||
|
|
||||||
|
class ChatUsageTypedDict(TypedDict):
|
||||||
|
r"""Token usage statistics"""
|
||||||
|
|
||||||
|
completion_tokens: int
|
||||||
|
r"""Number of tokens in the completion"""
|
||||||
|
prompt_tokens: int
|
||||||
|
r"""Number of tokens in the prompt"""
|
||||||
|
total_tokens: int
|
||||||
|
r"""Total number of tokens"""
|
||||||
|
completion_tokens_details: NotRequired[
|
||||||
|
Nullable[ChatUsageCompletionTokensDetailsTypedDict]
|
||||||
|
]
|
||||||
|
r"""Detailed completion token usage"""
|
||||||
|
cost: NotRequired[Nullable[float]]
|
||||||
|
r"""Cost of the completion"""
|
||||||
|
cost_details: NotRequired[Nullable[CostDetailsTypedDict]]
|
||||||
|
r"""Breakdown of upstream inference costs"""
|
||||||
|
is_byok: NotRequired[bool]
|
||||||
|
r"""Whether a request was made using a Bring Your Own Key configuration"""
|
||||||
|
prompt_tokens_details: NotRequired[Nullable[ChatUsagePromptTokensDetailsTypedDict]]
|
||||||
|
r"""Detailed prompt token usage"""
|
||||||
|
server_tool_use_details: NotRequired[Nullable[ServerToolUseDetailsTypedDict]]
|
||||||
|
r"""Usage for server-side tool execution (e.g., web search)"""
|
||||||
|
|
||||||
|
|
||||||
|
class ChatUsage(BaseModel):
|
||||||
|
r"""Token usage statistics"""
|
||||||
|
|
||||||
|
completion_tokens: int
|
||||||
|
r"""Number of tokens in the completion"""
|
||||||
|
|
||||||
|
prompt_tokens: int
|
||||||
|
r"""Number of tokens in the prompt"""
|
||||||
|
|
||||||
|
total_tokens: int
|
||||||
|
r"""Total number of tokens"""
|
||||||
|
|
||||||
|
completion_tokens_details: OptionalNullable[ChatUsageCompletionTokensDetails] = (
|
||||||
|
UNSET
|
||||||
|
)
|
||||||
|
r"""Detailed completion token usage"""
|
||||||
|
|
||||||
|
cost: OptionalNullable[float] = UNSET
|
||||||
|
r"""Cost of the completion"""
|
||||||
|
|
||||||
|
cost_details: OptionalNullable[CostDetails] = UNSET
|
||||||
|
r"""Breakdown of upstream inference costs"""
|
||||||
|
|
||||||
|
is_byok: Optional[bool] = None
|
||||||
|
r"""Whether a request was made using a Bring Your Own Key configuration"""
|
||||||
|
|
||||||
|
prompt_tokens_details: OptionalNullable[ChatUsagePromptTokensDetails] = UNSET
|
||||||
|
r"""Detailed prompt token usage"""
|
||||||
|
|
||||||
|
server_tool_use_details: OptionalNullable[ServerToolUseDetails] = UNSET
|
||||||
|
r"""Usage for server-side tool execution (e.g., web search)"""
|
||||||
|
|
||||||
|
@model_serializer(mode="wrap")
|
||||||
|
def serialize_model(self, handler):
|
||||||
|
optional_fields = [
|
||||||
"completion_tokens_details",
|
"completion_tokens_details",
|
||||||
"cost",
|
"cost",
|
||||||
"cost_details",
|
"cost_details",
|
||||||
|
"is_byok",
|
||||||
"prompt_tokens_details",
|
"prompt_tokens_details",
|
||||||
|
"server_tool_use_details",
|
||||||
|
]
|
||||||
|
nullable_fields = [
|
||||||
|
"completion_tokens_details",
|
||||||
|
"cost",
|
||||||
|
"cost_details",
|
||||||
|
"prompt_tokens_details",
|
||||||
|
"server_tool_use_details",
|
||||||
]
|
]
|
||||||
null_default_fields = []
|
null_default_fields = []
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,65 @@
|
|||||||
|
"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
|
||||||
|
|
||||||
|
from __future__ import annotations
|
||||||
|
from openrouter.types import BaseModel, Nullable, UnrecognizedStr
|
||||||
|
from openrouter.utils import validate_open_enum
|
||||||
|
from pydantic.functional_validators import PlainValidator
|
||||||
|
from typing import Any, Dict, Literal, Optional, Union
|
||||||
|
from typing_extensions import Annotated, NotRequired, TypedDict
|
||||||
|
|
||||||
|
|
||||||
|
Event = Union[
|
||||||
|
Literal[
|
||||||
|
"adapter_request",
|
||||||
|
"upstream_headers_received",
|
||||||
|
"first_token_received",
|
||||||
|
"upstream_body_ended",
|
||||||
|
],
|
||||||
|
UnrecognizedStr,
|
||||||
|
]
|
||||||
|
|
||||||
|
|
||||||
|
class TimingsTypedDict(TypedDict):
|
||||||
|
epoch_ms: int
|
||||||
|
event: Event
|
||||||
|
start_ms: int
|
||||||
|
|
||||||
|
|
||||||
|
class Timings(BaseModel):
|
||||||
|
epoch_ms: int
|
||||||
|
|
||||||
|
event: Annotated[Event, PlainValidator(validate_open_enum(False))]
|
||||||
|
|
||||||
|
start_ms: int
|
||||||
|
|
||||||
|
|
||||||
|
class DebugTypedDict(TypedDict):
|
||||||
|
echo_upstream_body: NotRequired[Dict[str, Nullable[Any]]]
|
||||||
|
timings: NotRequired[TimingsTypedDict]
|
||||||
|
|
||||||
|
|
||||||
|
class Debug(BaseModel):
|
||||||
|
echo_upstream_body: Optional[Dict[str, Nullable[Any]]] = None
|
||||||
|
|
||||||
|
timings: Optional[Timings] = None
|
||||||
|
|
||||||
|
|
||||||
|
DebugEventType = Literal["response.debug",]
|
||||||
|
|
||||||
|
|
||||||
|
class DebugEventTypedDict(TypedDict):
|
||||||
|
r"""Debug event emitted when debug.echo_upstream_body is true. Contains the transformed upstream request body or timing milestones."""
|
||||||
|
|
||||||
|
debug: DebugTypedDict
|
||||||
|
sequence_number: int
|
||||||
|
type: DebugEventType
|
||||||
|
|
||||||
|
|
||||||
|
class DebugEvent(BaseModel):
|
||||||
|
r"""Debug event emitted when debug.echo_upstream_body is true. Contains the transformed upstream request body or timing milestones."""
|
||||||
|
|
||||||
|
debug: Debug
|
||||||
|
|
||||||
|
sequence_number: int
|
||||||
|
|
||||||
|
type: DebugEventType
|
||||||
@@ -0,0 +1,24 @@
|
|||||||
|
"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
|
||||||
|
|
||||||
|
from __future__ import annotations
|
||||||
|
from openrouter.types import BaseModel
|
||||||
|
from typing import List, Literal
|
||||||
|
from typing_extensions import TypedDict
|
||||||
|
|
||||||
|
|
||||||
|
EnumCapabilityType = Literal["enum",]
|
||||||
|
|
||||||
|
|
||||||
|
class EnumCapabilityTypedDict(TypedDict):
|
||||||
|
r"""A parameter that accepts one of a discrete set of string values."""
|
||||||
|
|
||||||
|
type: EnumCapabilityType
|
||||||
|
values: List[str]
|
||||||
|
|
||||||
|
|
||||||
|
class EnumCapability(BaseModel):
|
||||||
|
r"""A parameter that accepts one of a discrete set of string values."""
|
||||||
|
|
||||||
|
type: EnumCapabilityType
|
||||||
|
|
||||||
|
values: List[str]
|
||||||
@@ -15,6 +15,7 @@ PresetEnum = Union[
|
|||||||
Literal[
|
Literal[
|
||||||
"general-high",
|
"general-high",
|
||||||
"general-budget",
|
"general-budget",
|
||||||
|
"general-fast",
|
||||||
],
|
],
|
||||||
UnrecognizedStr,
|
UnrecognizedStr,
|
||||||
]
|
]
|
||||||
|
|||||||
@@ -1,6 +1,10 @@
|
|||||||
"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
|
"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
|
||||||
|
|
||||||
from __future__ import annotations
|
from __future__ import annotations
|
||||||
|
from .anthropiccachecontroldirective import (
|
||||||
|
AnthropicCacheControlDirective,
|
||||||
|
AnthropicCacheControlDirectiveTypedDict,
|
||||||
|
)
|
||||||
from openrouter.types import BaseModel, Nullable, UnrecognizedStr
|
from openrouter.types import BaseModel, Nullable, UnrecognizedStr
|
||||||
from openrouter.utils import validate_open_enum
|
from openrouter.utils import validate_open_enum
|
||||||
from pydantic.functional_validators import PlainValidator
|
from pydantic.functional_validators import PlainValidator
|
||||||
@@ -10,6 +14,7 @@ from typing_extensions import Annotated, NotRequired, TypedDict
|
|||||||
|
|
||||||
FusionServerToolConfigEffort = Union[
|
FusionServerToolConfigEffort = Union[
|
||||||
Literal[
|
Literal[
|
||||||
|
"max",
|
||||||
"xhigh",
|
"xhigh",
|
||||||
"high",
|
"high",
|
||||||
"medium",
|
"medium",
|
||||||
@@ -64,6 +69,8 @@ class FusionServerToolConfigTypedDict(TypedDict):
|
|||||||
|
|
||||||
analysis_models: NotRequired[List[str]]
|
analysis_models: NotRequired[List[str]]
|
||||||
r"""Slugs of models to run in parallel as the analysis panel. Each model receives the user prompt with openrouter:web_search and openrouter:web_fetch enabled, then a judge model summarizes the collective output into structured analysis JSON. Capped at 8 models to bound cost amplification. Defaults to the Quality preset from /labs/fusion."""
|
r"""Slugs of models to run in parallel as the analysis panel. Each model receives the user prompt with openrouter:web_search and openrouter:web_fetch enabled, then a judge model summarizes the collective output into structured analysis JSON. Capped at 8 models to bound cost amplification. Defaults to the Quality preset from /labs/fusion."""
|
||||||
|
cache_control: NotRequired[AnthropicCacheControlDirectiveTypedDict]
|
||||||
|
r"""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."""
|
||||||
max_completion_tokens: NotRequired[int]
|
max_completion_tokens: NotRequired[int]
|
||||||
r"""Maximum number of output tokens (including reasoning tokens) each panelist and the judge model may produce per inner call. Controls the total output budget so reasoning-heavy models like GPT-5.5 do not exhaust their token allowance before producing visible text. When omitted, the provider's default applies."""
|
r"""Maximum number of output tokens (including reasoning tokens) each panelist and the judge model may produce per inner call. Controls the total output budget so reasoning-heavy models like GPT-5.5 do not exhaust their token allowance before producing visible text. When omitted, the provider's default applies."""
|
||||||
max_tool_calls: NotRequired[int]
|
max_tool_calls: NotRequired[int]
|
||||||
@@ -73,7 +80,7 @@ class FusionServerToolConfigTypedDict(TypedDict):
|
|||||||
reasoning: NotRequired[FusionServerToolConfigReasoningTypedDict]
|
reasoning: NotRequired[FusionServerToolConfigReasoningTypedDict]
|
||||||
r"""Reasoning configuration forwarded to panelist and judge inner calls. Use this to control reasoning effort and token budget for models that support extended thinking."""
|
r"""Reasoning configuration forwarded to panelist and judge inner calls. Use this to control reasoning effort and token budget for models that support extended thinking."""
|
||||||
temperature: NotRequired[float]
|
temperature: NotRequired[float]
|
||||||
r"""Sampling temperature forwarded to panelist and judge inner calls. When omitted, the provider's default applies."""
|
r"""Temperature forwarded to panelist inner calls. The judge always runs at temperature 0 regardless of this value. When omitted, the provider's default applies."""
|
||||||
tools: NotRequired[List[FusionServerToolConfigToolTypedDict]]
|
tools: NotRequired[List[FusionServerToolConfigToolTypedDict]]
|
||||||
r"""Server tools available to panelist and judge inner calls. Each entry uses the same `{ type, parameters? }` shorthand as the outer Chat Completions request. When omitted, defaults to `[{ type: \"openrouter:web_search\" }, { type: \"openrouter:web_fetch\" }]`. Pass an empty array to disable tools entirely (panelists answer from parametric knowledge only)."""
|
r"""Server tools available to panelist and judge inner calls. Each entry uses the same `{ type, parameters? }` shorthand as the outer Chat Completions request. When omitted, defaults to `[{ type: \"openrouter:web_search\" }, { type: \"openrouter:web_fetch\" }]`. Pass an empty array to disable tools entirely (panelists answer from parametric knowledge only)."""
|
||||||
|
|
||||||
@@ -84,6 +91,9 @@ class FusionServerToolConfig(BaseModel):
|
|||||||
analysis_models: Optional[List[str]] = None
|
analysis_models: Optional[List[str]] = None
|
||||||
r"""Slugs of models to run in parallel as the analysis panel. Each model receives the user prompt with openrouter:web_search and openrouter:web_fetch enabled, then a judge model summarizes the collective output into structured analysis JSON. Capped at 8 models to bound cost amplification. Defaults to the Quality preset from /labs/fusion."""
|
r"""Slugs of models to run in parallel as the analysis panel. Each model receives the user prompt with openrouter:web_search and openrouter:web_fetch enabled, then a judge model summarizes the collective output into structured analysis JSON. Capped at 8 models to bound cost amplification. Defaults to the Quality preset from /labs/fusion."""
|
||||||
|
|
||||||
|
cache_control: Optional[AnthropicCacheControlDirective] = None
|
||||||
|
r"""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."""
|
||||||
|
|
||||||
max_completion_tokens: Optional[int] = None
|
max_completion_tokens: Optional[int] = None
|
||||||
r"""Maximum number of output tokens (including reasoning tokens) each panelist and the judge model may produce per inner call. Controls the total output budget so reasoning-heavy models like GPT-5.5 do not exhaust their token allowance before producing visible text. When omitted, the provider's default applies."""
|
r"""Maximum number of output tokens (including reasoning tokens) each panelist and the judge model may produce per inner call. Controls the total output budget so reasoning-heavy models like GPT-5.5 do not exhaust their token allowance before producing visible text. When omitted, the provider's default applies."""
|
||||||
|
|
||||||
@@ -97,7 +107,7 @@ class FusionServerToolConfig(BaseModel):
|
|||||||
r"""Reasoning configuration forwarded to panelist and judge inner calls. Use this to control reasoning effort and token budget for models that support extended thinking."""
|
r"""Reasoning configuration forwarded to panelist and judge inner calls. Use this to control reasoning effort and token budget for models that support extended thinking."""
|
||||||
|
|
||||||
temperature: Optional[float] = None
|
temperature: Optional[float] = None
|
||||||
r"""Sampling temperature forwarded to panelist and judge inner calls. When omitted, the provider's default applies."""
|
r"""Temperature forwarded to panelist inner calls. The judge always runs at temperature 0 regardless of this value. When omitted, the provider's default applies."""
|
||||||
|
|
||||||
tools: Optional[List[FusionServerToolConfigTool]] = None
|
tools: Optional[List[FusionServerToolConfigTool]] = None
|
||||||
r"""Server tools available to panelist and judge inner calls. Each entry uses the same `{ type, parameters? }` shorthand as the outer Chat Completions request. When omitted, defaults to `[{ type: \"openrouter:web_search\" }, { type: \"openrouter:web_fetch\" }]`. Pass an empty array to disable tools entirely (panelists answer from parametric knowledge only)."""
|
r"""Server tools available to panelist and judge inner calls. Each entry uses the same `{ type, parameters? }` shorthand as the outer Chat Completions request. When omitted, defaults to `[{ type: \"openrouter:web_search\" }, { type: \"openrouter:web_fetch\" }]`. Pass an empty array to disable tools entirely (panelists answer from parametric knowledge only)."""
|
||||||
|
|||||||
@@ -0,0 +1,24 @@
|
|||||||
|
"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
|
||||||
|
|
||||||
|
from __future__ import annotations
|
||||||
|
from openrouter.types import BaseModel
|
||||||
|
from typing_extensions import TypedDict
|
||||||
|
|
||||||
|
|
||||||
|
class FusionSourceTypedDict(TypedDict):
|
||||||
|
r"""A web page retrieved via web search during a fusion run."""
|
||||||
|
|
||||||
|
title: str
|
||||||
|
r"""Title of the retrieved web page."""
|
||||||
|
url: str
|
||||||
|
r"""URL of the web page a panel or the judge retrieved during the run."""
|
||||||
|
|
||||||
|
|
||||||
|
class FusionSource(BaseModel):
|
||||||
|
r"""A web page retrieved via web search during a fusion run."""
|
||||||
|
|
||||||
|
title: str
|
||||||
|
r"""Title of the retrieved web page."""
|
||||||
|
|
||||||
|
url: str
|
||||||
|
r"""URL of the web page a panel or the judge retrieved during the run."""
|
||||||
@@ -0,0 +1,81 @@
|
|||||||
|
"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
|
||||||
|
|
||||||
|
from __future__ import annotations
|
||||||
|
from .capabilitydescriptor import CapabilityDescriptor, CapabilityDescriptorTypedDict
|
||||||
|
from .imagepricingentry import ImagePricingEntry, ImagePricingEntryTypedDict
|
||||||
|
from openrouter.types import BaseModel, Nullable, UNSET_SENTINEL
|
||||||
|
from pydantic import model_serializer
|
||||||
|
from typing import Dict, List
|
||||||
|
from typing_extensions import TypedDict
|
||||||
|
|
||||||
|
|
||||||
|
class ImageEndpointTypedDict(TypedDict):
|
||||||
|
r"""An endpoint that serves a given image model."""
|
||||||
|
|
||||||
|
allowed_passthrough_parameters: List[str]
|
||||||
|
r"""Provider-specific options accepted under provider.options[provider_slug]."""
|
||||||
|
pricing: List[ImagePricingEntryTypedDict]
|
||||||
|
r"""Billable pricing lines for this endpoint."""
|
||||||
|
provider_name: str
|
||||||
|
r"""Provider display name"""
|
||||||
|
provider_slug: str
|
||||||
|
r"""Provider slug"""
|
||||||
|
provider_tag: Nullable[str]
|
||||||
|
r"""Provider tag for request-side selection"""
|
||||||
|
supported_parameters: Dict[str, CapabilityDescriptorTypedDict]
|
||||||
|
supports_streaming: bool
|
||||||
|
r"""Whether this endpoint supports native SSE streaming (`stream: true` in the request)."""
|
||||||
|
|
||||||
|
|
||||||
|
class ImageEndpoint(BaseModel):
|
||||||
|
r"""An endpoint that serves a given image model."""
|
||||||
|
|
||||||
|
allowed_passthrough_parameters: List[str]
|
||||||
|
r"""Provider-specific options accepted under provider.options[provider_slug]."""
|
||||||
|
|
||||||
|
pricing: List[ImagePricingEntry]
|
||||||
|
r"""Billable pricing lines for this endpoint."""
|
||||||
|
|
||||||
|
provider_name: str
|
||||||
|
r"""Provider display name"""
|
||||||
|
|
||||||
|
provider_slug: str
|
||||||
|
r"""Provider slug"""
|
||||||
|
|
||||||
|
provider_tag: Nullable[str]
|
||||||
|
r"""Provider tag for request-side selection"""
|
||||||
|
|
||||||
|
supported_parameters: Dict[str, CapabilityDescriptor]
|
||||||
|
|
||||||
|
supports_streaming: bool
|
||||||
|
r"""Whether this endpoint supports native SSE streaming (`stream: true` in the request)."""
|
||||||
|
|
||||||
|
@model_serializer(mode="wrap")
|
||||||
|
def serialize_model(self, handler):
|
||||||
|
optional_fields = []
|
||||||
|
nullable_fields = ["provider_tag"]
|
||||||
|
null_default_fields = []
|
||||||
|
|
||||||
|
serialized = handler(self)
|
||||||
|
|
||||||
|
m = {}
|
||||||
|
|
||||||
|
for n, f in type(self).model_fields.items():
|
||||||
|
k = f.alias or n
|
||||||
|
val = serialized.get(k)
|
||||||
|
serialized.pop(k, None)
|
||||||
|
|
||||||
|
optional_nullable = k in optional_fields and k in nullable_fields
|
||||||
|
is_set = (
|
||||||
|
self.__pydantic_fields_set__.intersection({n})
|
||||||
|
or k in null_default_fields
|
||||||
|
) # pylint: disable=no-member
|
||||||
|
|
||||||
|
if val is not None and val != UNSET_SENTINEL:
|
||||||
|
m[k] = val
|
||||||
|
elif val != UNSET_SENTINEL and (
|
||||||
|
not k in optional_fields or (optional_nullable and is_set)
|
||||||
|
):
|
||||||
|
m[k] = val
|
||||||
|
|
||||||
|
return m
|
||||||
@@ -0,0 +1,45 @@
|
|||||||
|
"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
|
||||||
|
|
||||||
|
from __future__ import annotations
|
||||||
|
from .imagegenerationusage import ImageGenerationUsage, ImageGenerationUsageTypedDict
|
||||||
|
from openrouter.types import BaseModel
|
||||||
|
from typing import Literal, Optional
|
||||||
|
from typing_extensions import NotRequired, TypedDict
|
||||||
|
|
||||||
|
|
||||||
|
ImageGenCompletedEventType = Literal["image_generation.completed",]
|
||||||
|
r"""The event type"""
|
||||||
|
|
||||||
|
|
||||||
|
class ImageGenCompletedEventTypedDict(TypedDict):
|
||||||
|
r"""Emitted when generation completes and the final image is available"""
|
||||||
|
|
||||||
|
b64_json: str
|
||||||
|
r"""Base64-encoded final image data"""
|
||||||
|
created: int
|
||||||
|
r"""Unix timestamp (seconds) when the image was generated"""
|
||||||
|
type: ImageGenCompletedEventType
|
||||||
|
r"""The event type"""
|
||||||
|
media_type: NotRequired[str]
|
||||||
|
r"""Media type (MIME type) of the image. Omitted when the output is a standard raster format (PNG). Present for non-raster outputs such as SVG (`image/svg+xml`)."""
|
||||||
|
usage: NotRequired[ImageGenerationUsageTypedDict]
|
||||||
|
r"""Token and cost usage for the image generation request, when available"""
|
||||||
|
|
||||||
|
|
||||||
|
class ImageGenCompletedEvent(BaseModel):
|
||||||
|
r"""Emitted when generation completes and the final image is available"""
|
||||||
|
|
||||||
|
b64_json: str
|
||||||
|
r"""Base64-encoded final image data"""
|
||||||
|
|
||||||
|
created: int
|
||||||
|
r"""Unix timestamp (seconds) when the image was generated"""
|
||||||
|
|
||||||
|
type: ImageGenCompletedEventType
|
||||||
|
r"""The event type"""
|
||||||
|
|
||||||
|
media_type: Optional[str] = None
|
||||||
|
r"""Media type (MIME type) of the image. Omitted when the output is a standard raster format (PNG). Present for non-raster outputs such as SVG (`image/svg+xml`)."""
|
||||||
|
|
||||||
|
usage: Optional[ImageGenerationUsage] = None
|
||||||
|
r"""Token and cost usage for the image generation request, when available"""
|
||||||
@@ -0,0 +1,610 @@
|
|||||||
|
"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
|
||||||
|
|
||||||
|
from __future__ import annotations
|
||||||
|
from .contentpartimage import ContentPartImage, ContentPartImageTypedDict
|
||||||
|
from openrouter.types import BaseModel, Nullable, UnrecognizedStr
|
||||||
|
from openrouter.utils import validate_open_enum
|
||||||
|
import pydantic
|
||||||
|
from pydantic.functional_validators import PlainValidator
|
||||||
|
from typing import Any, Dict, List, Literal, Optional, Union
|
||||||
|
from typing_extensions import Annotated, NotRequired, TypedDict
|
||||||
|
|
||||||
|
|
||||||
|
ImageGenerationRequestAspectRatio = Union[
|
||||||
|
Literal[
|
||||||
|
"1:1",
|
||||||
|
"1:2",
|
||||||
|
"1:4",
|
||||||
|
"1:8",
|
||||||
|
"2:1",
|
||||||
|
"2:3",
|
||||||
|
"3:2",
|
||||||
|
"3:4",
|
||||||
|
"4:1",
|
||||||
|
"4:3",
|
||||||
|
"4:5",
|
||||||
|
"5:4",
|
||||||
|
"8:1",
|
||||||
|
"9:16",
|
||||||
|
"16:9",
|
||||||
|
"9:19.5",
|
||||||
|
"19.5:9",
|
||||||
|
"9:20",
|
||||||
|
"20:9",
|
||||||
|
"9:21",
|
||||||
|
"21:9",
|
||||||
|
"auto",
|
||||||
|
],
|
||||||
|
UnrecognizedStr,
|
||||||
|
]
|
||||||
|
r"""Normalized aspect ratio of the generated image. Providers clamp to their supported subset."""
|
||||||
|
|
||||||
|
|
||||||
|
ImageGenerationRequestBackground = Union[
|
||||||
|
Literal[
|
||||||
|
"auto",
|
||||||
|
"transparent",
|
||||||
|
"opaque",
|
||||||
|
],
|
||||||
|
UnrecognizedStr,
|
||||||
|
]
|
||||||
|
r"""Background treatment. `transparent` requires an output_format that supports alpha (png or webp)."""
|
||||||
|
|
||||||
|
|
||||||
|
ImageGenerationRequestOutputFormat = Union[
|
||||||
|
Literal[
|
||||||
|
"png",
|
||||||
|
"jpeg",
|
||||||
|
"webp",
|
||||||
|
"svg",
|
||||||
|
],
|
||||||
|
UnrecognizedStr,
|
||||||
|
]
|
||||||
|
r"""Encoding of the returned image bytes. Most models produce raster formats (png, jpeg, webp). SVG is supported by vectorization models (e.g. Quiver) — the SVG markup is UTF-8 base64-encoded in `b64_json`."""
|
||||||
|
|
||||||
|
|
||||||
|
class ImageGenerationRequestOptionsTypedDict(TypedDict):
|
||||||
|
r"""Provider-specific options keyed by provider slug. Only options for the matched provider are forwarded; the rest are ignored. Unrecognized keys are silently dropped."""
|
||||||
|
|
||||||
|
oneai: NotRequired[Dict[str, Nullable[Any]]]
|
||||||
|
ai21: NotRequired[Dict[str, Nullable[Any]]]
|
||||||
|
aion_labs: NotRequired[Dict[str, Nullable[Any]]]
|
||||||
|
akashml: NotRequired[Dict[str, Nullable[Any]]]
|
||||||
|
alibaba: NotRequired[Dict[str, Nullable[Any]]]
|
||||||
|
amazon_bedrock: NotRequired[Dict[str, Nullable[Any]]]
|
||||||
|
amazon_nova: NotRequired[Dict[str, Nullable[Any]]]
|
||||||
|
ambient: NotRequired[Dict[str, Nullable[Any]]]
|
||||||
|
anthropic: NotRequired[Dict[str, Nullable[Any]]]
|
||||||
|
anyscale: NotRequired[Dict[str, Nullable[Any]]]
|
||||||
|
arcee_ai: NotRequired[Dict[str, Nullable[Any]]]
|
||||||
|
atlas_cloud: NotRequired[Dict[str, Nullable[Any]]]
|
||||||
|
atoma: NotRequired[Dict[str, Nullable[Any]]]
|
||||||
|
avian: NotRequired[Dict[str, Nullable[Any]]]
|
||||||
|
azure: NotRequired[Dict[str, Nullable[Any]]]
|
||||||
|
baidu: NotRequired[Dict[str, Nullable[Any]]]
|
||||||
|
baseten: NotRequired[Dict[str, Nullable[Any]]]
|
||||||
|
black_forest_labs: NotRequired[Dict[str, Nullable[Any]]]
|
||||||
|
byteplus: NotRequired[Dict[str, Nullable[Any]]]
|
||||||
|
centml: NotRequired[Dict[str, Nullable[Any]]]
|
||||||
|
cerebras: NotRequired[Dict[str, Nullable[Any]]]
|
||||||
|
chutes: NotRequired[Dict[str, Nullable[Any]]]
|
||||||
|
cirrascale: NotRequired[Dict[str, Nullable[Any]]]
|
||||||
|
clarifai: NotRequired[Dict[str, Nullable[Any]]]
|
||||||
|
cloudflare: NotRequired[Dict[str, Nullable[Any]]]
|
||||||
|
cohere: NotRequired[Dict[str, Nullable[Any]]]
|
||||||
|
crofai: NotRequired[Dict[str, Nullable[Any]]]
|
||||||
|
crucible: NotRequired[Dict[str, Nullable[Any]]]
|
||||||
|
crusoe: NotRequired[Dict[str, Nullable[Any]]]
|
||||||
|
darkbloom: NotRequired[Dict[str, Nullable[Any]]]
|
||||||
|
decart: NotRequired[Dict[str, Nullable[Any]]]
|
||||||
|
deepinfra: NotRequired[Dict[str, Nullable[Any]]]
|
||||||
|
deepseek: NotRequired[Dict[str, Nullable[Any]]]
|
||||||
|
dekallm: NotRequired[Dict[str, Nullable[Any]]]
|
||||||
|
digitalocean: NotRequired[Dict[str, Nullable[Any]]]
|
||||||
|
enfer: NotRequired[Dict[str, Nullable[Any]]]
|
||||||
|
fake_provider: NotRequired[Dict[str, Nullable[Any]]]
|
||||||
|
featherless: NotRequired[Dict[str, Nullable[Any]]]
|
||||||
|
fireworks: NotRequired[Dict[str, Nullable[Any]]]
|
||||||
|
friendli: NotRequired[Dict[str, Nullable[Any]]]
|
||||||
|
gmicloud: NotRequired[Dict[str, Nullable[Any]]]
|
||||||
|
google_ai_studio: NotRequired[Dict[str, Nullable[Any]]]
|
||||||
|
google_vertex: NotRequired[Dict[str, Nullable[Any]]]
|
||||||
|
gopomelo: NotRequired[Dict[str, Nullable[Any]]]
|
||||||
|
groq: NotRequired[Dict[str, Nullable[Any]]]
|
||||||
|
heygen: NotRequired[Dict[str, Nullable[Any]]]
|
||||||
|
huggingface: NotRequired[Dict[str, Nullable[Any]]]
|
||||||
|
hyperbolic: NotRequired[Dict[str, Nullable[Any]]]
|
||||||
|
hyperbolic_quantized: NotRequired[Dict[str, Nullable[Any]]]
|
||||||
|
inception: NotRequired[Dict[str, Nullable[Any]]]
|
||||||
|
inceptron: NotRequired[Dict[str, Nullable[Any]]]
|
||||||
|
inferact_vllm: NotRequired[Dict[str, Nullable[Any]]]
|
||||||
|
inference_net: NotRequired[Dict[str, Nullable[Any]]]
|
||||||
|
infermatic: NotRequired[Dict[str, Nullable[Any]]]
|
||||||
|
inflection: NotRequired[Dict[str, Nullable[Any]]]
|
||||||
|
inocloud: NotRequired[Dict[str, Nullable[Any]]]
|
||||||
|
io_net: NotRequired[Dict[str, Nullable[Any]]]
|
||||||
|
ionstream: NotRequired[Dict[str, Nullable[Any]]]
|
||||||
|
klusterai: NotRequired[Dict[str, Nullable[Any]]]
|
||||||
|
lambda_: NotRequired[Dict[str, Nullable[Any]]]
|
||||||
|
lepton: NotRequired[Dict[str, Nullable[Any]]]
|
||||||
|
liquid: NotRequired[Dict[str, Nullable[Any]]]
|
||||||
|
lynn: NotRequired[Dict[str, Nullable[Any]]]
|
||||||
|
lynn_private: NotRequired[Dict[str, Nullable[Any]]]
|
||||||
|
mancer: NotRequired[Dict[str, Nullable[Any]]]
|
||||||
|
mancer_old: NotRequired[Dict[str, Nullable[Any]]]
|
||||||
|
mara: NotRequired[Dict[str, Nullable[Any]]]
|
||||||
|
meta: NotRequired[Dict[str, Nullable[Any]]]
|
||||||
|
minimax: NotRequired[Dict[str, Nullable[Any]]]
|
||||||
|
mistral: NotRequired[Dict[str, Nullable[Any]]]
|
||||||
|
modal: NotRequired[Dict[str, Nullable[Any]]]
|
||||||
|
modelrun: NotRequired[Dict[str, Nullable[Any]]]
|
||||||
|
modular: NotRequired[Dict[str, Nullable[Any]]]
|
||||||
|
moonshotai: NotRequired[Dict[str, Nullable[Any]]]
|
||||||
|
morph: NotRequired[Dict[str, Nullable[Any]]]
|
||||||
|
ncompass: NotRequired[Dict[str, Nullable[Any]]]
|
||||||
|
nebius: NotRequired[Dict[str, Nullable[Any]]]
|
||||||
|
nex_agi: NotRequired[Dict[str, Nullable[Any]]]
|
||||||
|
nextbit: NotRequired[Dict[str, Nullable[Any]]]
|
||||||
|
nineteen: NotRequired[Dict[str, Nullable[Any]]]
|
||||||
|
novita: NotRequired[Dict[str, Nullable[Any]]]
|
||||||
|
nvidia: NotRequired[Dict[str, Nullable[Any]]]
|
||||||
|
octoai: NotRequired[Dict[str, Nullable[Any]]]
|
||||||
|
open_inference: NotRequired[Dict[str, Nullable[Any]]]
|
||||||
|
openai: NotRequired[Dict[str, Nullable[Any]]]
|
||||||
|
parasail: NotRequired[Dict[str, Nullable[Any]]]
|
||||||
|
perceptron: NotRequired[Dict[str, Nullable[Any]]]
|
||||||
|
perplexity: NotRequired[Dict[str, Nullable[Any]]]
|
||||||
|
phala: NotRequired[Dict[str, Nullable[Any]]]
|
||||||
|
poolside: NotRequired[Dict[str, Nullable[Any]]]
|
||||||
|
quiver: NotRequired[Dict[str, Nullable[Any]]]
|
||||||
|
recraft: NotRequired[Dict[str, Nullable[Any]]]
|
||||||
|
recursal: NotRequired[Dict[str, Nullable[Any]]]
|
||||||
|
reflection: NotRequired[Dict[str, Nullable[Any]]]
|
||||||
|
reka: NotRequired[Dict[str, Nullable[Any]]]
|
||||||
|
relace: NotRequired[Dict[str, Nullable[Any]]]
|
||||||
|
replicate: NotRequired[Dict[str, Nullable[Any]]]
|
||||||
|
sakana_ai: NotRequired[Dict[str, Nullable[Any]]]
|
||||||
|
sambanova: NotRequired[Dict[str, Nullable[Any]]]
|
||||||
|
sambanova_cloaked: NotRequired[Dict[str, Nullable[Any]]]
|
||||||
|
seed: NotRequired[Dict[str, Nullable[Any]]]
|
||||||
|
sf_compute: NotRequired[Dict[str, Nullable[Any]]]
|
||||||
|
siliconflow: NotRequired[Dict[str, Nullable[Any]]]
|
||||||
|
sourceful: NotRequired[Dict[str, Nullable[Any]]]
|
||||||
|
stealth: NotRequired[Dict[str, Nullable[Any]]]
|
||||||
|
stepfun: NotRequired[Dict[str, Nullable[Any]]]
|
||||||
|
streamlake: NotRequired[Dict[str, Nullable[Any]]]
|
||||||
|
switchpoint: NotRequired[Dict[str, Nullable[Any]]]
|
||||||
|
targon: NotRequired[Dict[str, Nullable[Any]]]
|
||||||
|
tenstorrent: NotRequired[Dict[str, Nullable[Any]]]
|
||||||
|
together: NotRequired[Dict[str, Nullable[Any]]]
|
||||||
|
together_lite: NotRequired[Dict[str, Nullable[Any]]]
|
||||||
|
ubicloud: NotRequired[Dict[str, Nullable[Any]]]
|
||||||
|
upstage: NotRequired[Dict[str, Nullable[Any]]]
|
||||||
|
venice: NotRequired[Dict[str, Nullable[Any]]]
|
||||||
|
wafer: NotRequired[Dict[str, Nullable[Any]]]
|
||||||
|
wandb: NotRequired[Dict[str, Nullable[Any]]]
|
||||||
|
xai: NotRequired[Dict[str, Nullable[Any]]]
|
||||||
|
xiaomi: NotRequired[Dict[str, Nullable[Any]]]
|
||||||
|
z_ai: NotRequired[Dict[str, Nullable[Any]]]
|
||||||
|
|
||||||
|
|
||||||
|
class ImageGenerationRequestOptions(BaseModel):
|
||||||
|
r"""Provider-specific options keyed by provider slug. Only options for the matched provider are forwarded; the rest are ignored. Unrecognized keys are silently dropped."""
|
||||||
|
|
||||||
|
oneai: Annotated[
|
||||||
|
Optional[Dict[str, Nullable[Any]]], pydantic.Field(alias="01ai")
|
||||||
|
] = None
|
||||||
|
|
||||||
|
ai21: Optional[Dict[str, Nullable[Any]]] = None
|
||||||
|
|
||||||
|
aion_labs: Annotated[
|
||||||
|
Optional[Dict[str, Nullable[Any]]], pydantic.Field(alias="aion-labs")
|
||||||
|
] = None
|
||||||
|
|
||||||
|
akashml: Optional[Dict[str, Nullable[Any]]] = None
|
||||||
|
|
||||||
|
alibaba: Optional[Dict[str, Nullable[Any]]] = None
|
||||||
|
|
||||||
|
amazon_bedrock: Annotated[
|
||||||
|
Optional[Dict[str, Nullable[Any]]], pydantic.Field(alias="amazon-bedrock")
|
||||||
|
] = None
|
||||||
|
|
||||||
|
amazon_nova: Annotated[
|
||||||
|
Optional[Dict[str, Nullable[Any]]], pydantic.Field(alias="amazon-nova")
|
||||||
|
] = None
|
||||||
|
|
||||||
|
ambient: Optional[Dict[str, Nullable[Any]]] = None
|
||||||
|
|
||||||
|
anthropic: Optional[Dict[str, Nullable[Any]]] = None
|
||||||
|
|
||||||
|
anyscale: Optional[Dict[str, Nullable[Any]]] = None
|
||||||
|
|
||||||
|
arcee_ai: Annotated[
|
||||||
|
Optional[Dict[str, Nullable[Any]]], pydantic.Field(alias="arcee-ai")
|
||||||
|
] = None
|
||||||
|
|
||||||
|
atlas_cloud: Annotated[
|
||||||
|
Optional[Dict[str, Nullable[Any]]], pydantic.Field(alias="atlas-cloud")
|
||||||
|
] = None
|
||||||
|
|
||||||
|
atoma: Optional[Dict[str, Nullable[Any]]] = None
|
||||||
|
|
||||||
|
avian: Optional[Dict[str, Nullable[Any]]] = None
|
||||||
|
|
||||||
|
azure: Optional[Dict[str, Nullable[Any]]] = None
|
||||||
|
|
||||||
|
baidu: Optional[Dict[str, Nullable[Any]]] = None
|
||||||
|
|
||||||
|
baseten: Optional[Dict[str, Nullable[Any]]] = None
|
||||||
|
|
||||||
|
black_forest_labs: Annotated[
|
||||||
|
Optional[Dict[str, Nullable[Any]]], pydantic.Field(alias="black-forest-labs")
|
||||||
|
] = None
|
||||||
|
|
||||||
|
byteplus: Optional[Dict[str, Nullable[Any]]] = None
|
||||||
|
|
||||||
|
centml: Optional[Dict[str, Nullable[Any]]] = None
|
||||||
|
|
||||||
|
cerebras: Optional[Dict[str, Nullable[Any]]] = None
|
||||||
|
|
||||||
|
chutes: Optional[Dict[str, Nullable[Any]]] = None
|
||||||
|
|
||||||
|
cirrascale: Optional[Dict[str, Nullable[Any]]] = None
|
||||||
|
|
||||||
|
clarifai: Optional[Dict[str, Nullable[Any]]] = None
|
||||||
|
|
||||||
|
cloudflare: Optional[Dict[str, Nullable[Any]]] = None
|
||||||
|
|
||||||
|
cohere: Optional[Dict[str, Nullable[Any]]] = None
|
||||||
|
|
||||||
|
crofai: Optional[Dict[str, Nullable[Any]]] = None
|
||||||
|
|
||||||
|
crucible: Optional[Dict[str, Nullable[Any]]] = None
|
||||||
|
|
||||||
|
crusoe: Optional[Dict[str, Nullable[Any]]] = None
|
||||||
|
|
||||||
|
darkbloom: Optional[Dict[str, Nullable[Any]]] = None
|
||||||
|
|
||||||
|
decart: Optional[Dict[str, Nullable[Any]]] = None
|
||||||
|
|
||||||
|
deepinfra: Optional[Dict[str, Nullable[Any]]] = None
|
||||||
|
|
||||||
|
deepseek: Optional[Dict[str, Nullable[Any]]] = None
|
||||||
|
|
||||||
|
dekallm: Optional[Dict[str, Nullable[Any]]] = None
|
||||||
|
|
||||||
|
digitalocean: Optional[Dict[str, Nullable[Any]]] = None
|
||||||
|
|
||||||
|
enfer: Optional[Dict[str, Nullable[Any]]] = None
|
||||||
|
|
||||||
|
fake_provider: Annotated[
|
||||||
|
Optional[Dict[str, Nullable[Any]]], pydantic.Field(alias="fake-provider")
|
||||||
|
] = None
|
||||||
|
|
||||||
|
featherless: Optional[Dict[str, Nullable[Any]]] = None
|
||||||
|
|
||||||
|
fireworks: Optional[Dict[str, Nullable[Any]]] = None
|
||||||
|
|
||||||
|
friendli: Optional[Dict[str, Nullable[Any]]] = None
|
||||||
|
|
||||||
|
gmicloud: Optional[Dict[str, Nullable[Any]]] = None
|
||||||
|
|
||||||
|
google_ai_studio: Annotated[
|
||||||
|
Optional[Dict[str, Nullable[Any]]], pydantic.Field(alias="google-ai-studio")
|
||||||
|
] = None
|
||||||
|
|
||||||
|
google_vertex: Annotated[
|
||||||
|
Optional[Dict[str, Nullable[Any]]], pydantic.Field(alias="google-vertex")
|
||||||
|
] = None
|
||||||
|
|
||||||
|
gopomelo: Optional[Dict[str, Nullable[Any]]] = None
|
||||||
|
|
||||||
|
groq: Optional[Dict[str, Nullable[Any]]] = None
|
||||||
|
|
||||||
|
heygen: Optional[Dict[str, Nullable[Any]]] = None
|
||||||
|
|
||||||
|
huggingface: Optional[Dict[str, Nullable[Any]]] = None
|
||||||
|
|
||||||
|
hyperbolic: Optional[Dict[str, Nullable[Any]]] = None
|
||||||
|
|
||||||
|
hyperbolic_quantized: Annotated[
|
||||||
|
Optional[Dict[str, Nullable[Any]]], pydantic.Field(alias="hyperbolic-quantized")
|
||||||
|
] = None
|
||||||
|
|
||||||
|
inception: Optional[Dict[str, Nullable[Any]]] = None
|
||||||
|
|
||||||
|
inceptron: Optional[Dict[str, Nullable[Any]]] = None
|
||||||
|
|
||||||
|
inferact_vllm: Annotated[
|
||||||
|
Optional[Dict[str, Nullable[Any]]], pydantic.Field(alias="inferact-vllm")
|
||||||
|
] = None
|
||||||
|
|
||||||
|
inference_net: Annotated[
|
||||||
|
Optional[Dict[str, Nullable[Any]]], pydantic.Field(alias="inference-net")
|
||||||
|
] = None
|
||||||
|
|
||||||
|
infermatic: Optional[Dict[str, Nullable[Any]]] = None
|
||||||
|
|
||||||
|
inflection: Optional[Dict[str, Nullable[Any]]] = None
|
||||||
|
|
||||||
|
inocloud: Optional[Dict[str, Nullable[Any]]] = None
|
||||||
|
|
||||||
|
io_net: Annotated[
|
||||||
|
Optional[Dict[str, Nullable[Any]]], pydantic.Field(alias="io-net")
|
||||||
|
] = None
|
||||||
|
|
||||||
|
ionstream: Optional[Dict[str, Nullable[Any]]] = None
|
||||||
|
|
||||||
|
klusterai: Optional[Dict[str, Nullable[Any]]] = None
|
||||||
|
|
||||||
|
lambda_: Annotated[
|
||||||
|
Optional[Dict[str, Nullable[Any]]], pydantic.Field(alias="lambda")
|
||||||
|
] = None
|
||||||
|
|
||||||
|
lepton: Optional[Dict[str, Nullable[Any]]] = None
|
||||||
|
|
||||||
|
liquid: Optional[Dict[str, Nullable[Any]]] = None
|
||||||
|
|
||||||
|
lynn: Optional[Dict[str, Nullable[Any]]] = None
|
||||||
|
|
||||||
|
lynn_private: Annotated[
|
||||||
|
Optional[Dict[str, Nullable[Any]]], pydantic.Field(alias="lynn-private")
|
||||||
|
] = None
|
||||||
|
|
||||||
|
mancer: Optional[Dict[str, Nullable[Any]]] = None
|
||||||
|
|
||||||
|
mancer_old: Annotated[
|
||||||
|
Optional[Dict[str, Nullable[Any]]], pydantic.Field(alias="mancer-old")
|
||||||
|
] = None
|
||||||
|
|
||||||
|
mara: Optional[Dict[str, Nullable[Any]]] = None
|
||||||
|
|
||||||
|
meta: Optional[Dict[str, Nullable[Any]]] = None
|
||||||
|
|
||||||
|
minimax: Optional[Dict[str, Nullable[Any]]] = None
|
||||||
|
|
||||||
|
mistral: Optional[Dict[str, Nullable[Any]]] = None
|
||||||
|
|
||||||
|
modal: Optional[Dict[str, Nullable[Any]]] = None
|
||||||
|
|
||||||
|
modelrun: Optional[Dict[str, Nullable[Any]]] = None
|
||||||
|
|
||||||
|
modular: Optional[Dict[str, Nullable[Any]]] = None
|
||||||
|
|
||||||
|
moonshotai: Optional[Dict[str, Nullable[Any]]] = None
|
||||||
|
|
||||||
|
morph: Optional[Dict[str, Nullable[Any]]] = None
|
||||||
|
|
||||||
|
ncompass: Optional[Dict[str, Nullable[Any]]] = None
|
||||||
|
|
||||||
|
nebius: Optional[Dict[str, Nullable[Any]]] = None
|
||||||
|
|
||||||
|
nex_agi: Annotated[
|
||||||
|
Optional[Dict[str, Nullable[Any]]], pydantic.Field(alias="nex-agi")
|
||||||
|
] = None
|
||||||
|
|
||||||
|
nextbit: Optional[Dict[str, Nullable[Any]]] = None
|
||||||
|
|
||||||
|
nineteen: Optional[Dict[str, Nullable[Any]]] = None
|
||||||
|
|
||||||
|
novita: Optional[Dict[str, Nullable[Any]]] = None
|
||||||
|
|
||||||
|
nvidia: Optional[Dict[str, Nullable[Any]]] = None
|
||||||
|
|
||||||
|
octoai: Optional[Dict[str, Nullable[Any]]] = None
|
||||||
|
|
||||||
|
open_inference: Annotated[
|
||||||
|
Optional[Dict[str, Nullable[Any]]], pydantic.Field(alias="open-inference")
|
||||||
|
] = None
|
||||||
|
|
||||||
|
openai: Optional[Dict[str, Nullable[Any]]] = None
|
||||||
|
|
||||||
|
parasail: Optional[Dict[str, Nullable[Any]]] = None
|
||||||
|
|
||||||
|
perceptron: Optional[Dict[str, Nullable[Any]]] = None
|
||||||
|
|
||||||
|
perplexity: Optional[Dict[str, Nullable[Any]]] = None
|
||||||
|
|
||||||
|
phala: Optional[Dict[str, Nullable[Any]]] = None
|
||||||
|
|
||||||
|
poolside: Optional[Dict[str, Nullable[Any]]] = None
|
||||||
|
|
||||||
|
quiver: Optional[Dict[str, Nullable[Any]]] = None
|
||||||
|
|
||||||
|
recraft: Optional[Dict[str, Nullable[Any]]] = None
|
||||||
|
|
||||||
|
recursal: Optional[Dict[str, Nullable[Any]]] = None
|
||||||
|
|
||||||
|
reflection: Optional[Dict[str, Nullable[Any]]] = None
|
||||||
|
|
||||||
|
reka: Optional[Dict[str, Nullable[Any]]] = None
|
||||||
|
|
||||||
|
relace: Optional[Dict[str, Nullable[Any]]] = None
|
||||||
|
|
||||||
|
replicate: Optional[Dict[str, Nullable[Any]]] = None
|
||||||
|
|
||||||
|
sakana_ai: Annotated[
|
||||||
|
Optional[Dict[str, Nullable[Any]]], pydantic.Field(alias="sakana-ai")
|
||||||
|
] = None
|
||||||
|
|
||||||
|
sambanova: Optional[Dict[str, Nullable[Any]]] = None
|
||||||
|
|
||||||
|
sambanova_cloaked: Annotated[
|
||||||
|
Optional[Dict[str, Nullable[Any]]], pydantic.Field(alias="sambanova-cloaked")
|
||||||
|
] = None
|
||||||
|
|
||||||
|
seed: Optional[Dict[str, Nullable[Any]]] = None
|
||||||
|
|
||||||
|
sf_compute: Annotated[
|
||||||
|
Optional[Dict[str, Nullable[Any]]], pydantic.Field(alias="sf-compute")
|
||||||
|
] = None
|
||||||
|
|
||||||
|
siliconflow: Optional[Dict[str, Nullable[Any]]] = None
|
||||||
|
|
||||||
|
sourceful: Optional[Dict[str, Nullable[Any]]] = None
|
||||||
|
|
||||||
|
stealth: Optional[Dict[str, Nullable[Any]]] = None
|
||||||
|
|
||||||
|
stepfun: Optional[Dict[str, Nullable[Any]]] = None
|
||||||
|
|
||||||
|
streamlake: Optional[Dict[str, Nullable[Any]]] = None
|
||||||
|
|
||||||
|
switchpoint: Optional[Dict[str, Nullable[Any]]] = None
|
||||||
|
|
||||||
|
targon: Optional[Dict[str, Nullable[Any]]] = None
|
||||||
|
|
||||||
|
tenstorrent: Optional[Dict[str, Nullable[Any]]] = None
|
||||||
|
|
||||||
|
together: Optional[Dict[str, Nullable[Any]]] = None
|
||||||
|
|
||||||
|
together_lite: Annotated[
|
||||||
|
Optional[Dict[str, Nullable[Any]]], pydantic.Field(alias="together-lite")
|
||||||
|
] = None
|
||||||
|
|
||||||
|
ubicloud: Optional[Dict[str, Nullable[Any]]] = None
|
||||||
|
|
||||||
|
upstage: Optional[Dict[str, Nullable[Any]]] = None
|
||||||
|
|
||||||
|
venice: Optional[Dict[str, Nullable[Any]]] = None
|
||||||
|
|
||||||
|
wafer: Optional[Dict[str, Nullable[Any]]] = None
|
||||||
|
|
||||||
|
wandb: Optional[Dict[str, Nullable[Any]]] = None
|
||||||
|
|
||||||
|
xai: Optional[Dict[str, Nullable[Any]]] = None
|
||||||
|
|
||||||
|
xiaomi: Optional[Dict[str, Nullable[Any]]] = None
|
||||||
|
|
||||||
|
z_ai: Annotated[
|
||||||
|
Optional[Dict[str, Nullable[Any]]], pydantic.Field(alias="z-ai")
|
||||||
|
] = None
|
||||||
|
|
||||||
|
|
||||||
|
class ImageGenerationRequestProviderTypedDict(TypedDict):
|
||||||
|
r"""Provider-specific passthrough configuration"""
|
||||||
|
|
||||||
|
options: NotRequired[ImageGenerationRequestOptionsTypedDict]
|
||||||
|
|
||||||
|
|
||||||
|
class ImageGenerationRequestProvider(BaseModel):
|
||||||
|
r"""Provider-specific passthrough configuration"""
|
||||||
|
|
||||||
|
options: Optional[ImageGenerationRequestOptions] = None
|
||||||
|
|
||||||
|
|
||||||
|
ImageGenerationRequestQuality = Union[
|
||||||
|
Literal[
|
||||||
|
"auto",
|
||||||
|
"low",
|
||||||
|
"medium",
|
||||||
|
"high",
|
||||||
|
],
|
||||||
|
UnrecognizedStr,
|
||||||
|
]
|
||||||
|
r"""Rendering quality. Providers without a quality knob ignore this."""
|
||||||
|
|
||||||
|
|
||||||
|
ImageGenerationRequestResolution = Union[
|
||||||
|
Literal[
|
||||||
|
"512",
|
||||||
|
"1K",
|
||||||
|
"2K",
|
||||||
|
"4K",
|
||||||
|
],
|
||||||
|
UnrecognizedStr,
|
||||||
|
]
|
||||||
|
r"""Normalized resolution tier of the generated image. Concrete pixel dimensions are derived per-provider."""
|
||||||
|
|
||||||
|
|
||||||
|
class ImageGenerationRequestTypedDict(TypedDict):
|
||||||
|
r"""Image generation request input"""
|
||||||
|
|
||||||
|
model: str
|
||||||
|
r"""The image generation model to use"""
|
||||||
|
prompt: str
|
||||||
|
r"""Text description of the desired image"""
|
||||||
|
aspect_ratio: NotRequired[ImageGenerationRequestAspectRatio]
|
||||||
|
r"""Normalized aspect ratio of the generated image. Providers clamp to their supported subset."""
|
||||||
|
background: NotRequired[ImageGenerationRequestBackground]
|
||||||
|
r"""Background treatment. `transparent` requires an output_format that supports alpha (png or webp)."""
|
||||||
|
input_references: NotRequired[List[ContentPartImageTypedDict]]
|
||||||
|
r"""Reference images to guide image-to-image generation, as base64 data URLs or HTTP(S) URLs."""
|
||||||
|
n: NotRequired[int]
|
||||||
|
r"""Number of images to generate (1-10). Providers that only support single-image generation reject n > 1."""
|
||||||
|
output_compression: NotRequired[int]
|
||||||
|
r"""Compression level (0-100) for webp/jpeg output. Ignored for png and by providers without a compression knob."""
|
||||||
|
output_format: NotRequired[ImageGenerationRequestOutputFormat]
|
||||||
|
r"""Encoding of the returned image bytes. Most models produce raster formats (png, jpeg, webp). SVG is supported by vectorization models (e.g. Quiver) — the SVG markup is UTF-8 base64-encoded in `b64_json`."""
|
||||||
|
provider: NotRequired[ImageGenerationRequestProviderTypedDict]
|
||||||
|
r"""Provider-specific passthrough configuration"""
|
||||||
|
quality: NotRequired[ImageGenerationRequestQuality]
|
||||||
|
r"""Rendering quality. Providers without a quality knob ignore this."""
|
||||||
|
resolution: NotRequired[ImageGenerationRequestResolution]
|
||||||
|
r"""Normalized resolution tier of the generated image. Concrete pixel dimensions are derived per-provider."""
|
||||||
|
seed: NotRequired[int]
|
||||||
|
r"""If specified, the generation will sample deterministically, such that repeated requests with the same seed and parameters should return the same result. Determinism is not guaranteed for all providers."""
|
||||||
|
size: NotRequired[str]
|
||||||
|
r"""Optional. A convenience shorthand for output dimensions — pass a tier (\"2K\", \"4K\") or explicit pixels (\"2048x2048\") and we normalize it to the right dimensions for the chosen provider. Interchangeable with resolution + aspect_ratio; use those directly for enumerated, per-model discoverable values. Conflicting size + resolution/aspect_ratio is rejected."""
|
||||||
|
stream: NotRequired[bool]
|
||||||
|
r"""If true, partial images are streamed as SSE events as they become available. Only supported by providers with native streaming (currently OpenAI). Non-streaming providers ignore this flag and return a buffered response."""
|
||||||
|
|
||||||
|
|
||||||
|
class ImageGenerationRequest(BaseModel):
|
||||||
|
r"""Image generation request input"""
|
||||||
|
|
||||||
|
model: str
|
||||||
|
r"""The image generation model to use"""
|
||||||
|
|
||||||
|
prompt: str
|
||||||
|
r"""Text description of the desired image"""
|
||||||
|
|
||||||
|
aspect_ratio: Annotated[
|
||||||
|
Optional[ImageGenerationRequestAspectRatio],
|
||||||
|
PlainValidator(validate_open_enum(False)),
|
||||||
|
] = None
|
||||||
|
r"""Normalized aspect ratio of the generated image. Providers clamp to their supported subset."""
|
||||||
|
|
||||||
|
background: Annotated[
|
||||||
|
Optional[ImageGenerationRequestBackground],
|
||||||
|
PlainValidator(validate_open_enum(False)),
|
||||||
|
] = None
|
||||||
|
r"""Background treatment. `transparent` requires an output_format that supports alpha (png or webp)."""
|
||||||
|
|
||||||
|
input_references: Optional[List[ContentPartImage]] = None
|
||||||
|
r"""Reference images to guide image-to-image generation, as base64 data URLs or HTTP(S) URLs."""
|
||||||
|
|
||||||
|
n: Optional[int] = None
|
||||||
|
r"""Number of images to generate (1-10). Providers that only support single-image generation reject n > 1."""
|
||||||
|
|
||||||
|
output_compression: Optional[int] = None
|
||||||
|
r"""Compression level (0-100) for webp/jpeg output. Ignored for png and by providers without a compression knob."""
|
||||||
|
|
||||||
|
output_format: Annotated[
|
||||||
|
Optional[ImageGenerationRequestOutputFormat],
|
||||||
|
PlainValidator(validate_open_enum(False)),
|
||||||
|
] = None
|
||||||
|
r"""Encoding of the returned image bytes. Most models produce raster formats (png, jpeg, webp). SVG is supported by vectorization models (e.g. Quiver) — the SVG markup is UTF-8 base64-encoded in `b64_json`."""
|
||||||
|
|
||||||
|
provider: Optional[ImageGenerationRequestProvider] = None
|
||||||
|
r"""Provider-specific passthrough configuration"""
|
||||||
|
|
||||||
|
quality: Annotated[
|
||||||
|
Optional[ImageGenerationRequestQuality],
|
||||||
|
PlainValidator(validate_open_enum(False)),
|
||||||
|
] = None
|
||||||
|
r"""Rendering quality. Providers without a quality knob ignore this."""
|
||||||
|
|
||||||
|
resolution: Annotated[
|
||||||
|
Optional[ImageGenerationRequestResolution],
|
||||||
|
PlainValidator(validate_open_enum(False)),
|
||||||
|
] = None
|
||||||
|
r"""Normalized resolution tier of the generated image. Concrete pixel dimensions are derived per-provider."""
|
||||||
|
|
||||||
|
seed: Optional[int] = None
|
||||||
|
r"""If specified, the generation will sample deterministically, such that repeated requests with the same seed and parameters should return the same result. Determinism is not guaranteed for all providers."""
|
||||||
|
|
||||||
|
size: Optional[str] = None
|
||||||
|
r"""Optional. A convenience shorthand for output dimensions — pass a tier (\"2K\", \"4K\") or explicit pixels (\"2048x2048\") and we normalize it to the right dimensions for the chosen provider. Interchangeable with resolution + aspect_ratio; use those directly for enumerated, per-model discoverable values. Conflicting size + resolution/aspect_ratio is rejected."""
|
||||||
|
|
||||||
|
stream: Optional[bool] = None
|
||||||
|
r"""If true, partial images are streamed as SSE events as they become available. Only supported by providers with native streaming (currently OpenAI). Non-streaming providers ignore this flag and return a buffered response."""
|
||||||
@@ -0,0 +1,46 @@
|
|||||||
|
"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
|
||||||
|
|
||||||
|
from __future__ import annotations
|
||||||
|
from .imagegenerationusage import ImageGenerationUsage, ImageGenerationUsageTypedDict
|
||||||
|
from openrouter.types import BaseModel
|
||||||
|
from typing import List, Optional
|
||||||
|
from typing_extensions import NotRequired, TypedDict
|
||||||
|
|
||||||
|
|
||||||
|
class ImageGenerationResponseDataTypedDict(TypedDict):
|
||||||
|
b64_json: str
|
||||||
|
r"""Base64-encoded image bytes"""
|
||||||
|
media_type: NotRequired[str]
|
||||||
|
r"""Media type (MIME type) of the image. Omitted when the output is a standard raster format (PNG). Present for non-raster outputs such as SVG (`image/svg+xml`)."""
|
||||||
|
|
||||||
|
|
||||||
|
class ImageGenerationResponseData(BaseModel):
|
||||||
|
b64_json: str
|
||||||
|
r"""Base64-encoded image bytes"""
|
||||||
|
|
||||||
|
media_type: Optional[str] = None
|
||||||
|
r"""Media type (MIME type) of the image. Omitted when the output is a standard raster format (PNG). Present for non-raster outputs such as SVG (`image/svg+xml`)."""
|
||||||
|
|
||||||
|
|
||||||
|
class ImageGenerationResponseTypedDict(TypedDict):
|
||||||
|
r"""Image generation response"""
|
||||||
|
|
||||||
|
created: int
|
||||||
|
r"""Unix timestamp (seconds) when the image was generated"""
|
||||||
|
data: List[ImageGenerationResponseDataTypedDict]
|
||||||
|
r"""Generated images"""
|
||||||
|
usage: NotRequired[ImageGenerationUsageTypedDict]
|
||||||
|
r"""Token and cost usage for the image generation request, when available"""
|
||||||
|
|
||||||
|
|
||||||
|
class ImageGenerationResponse(BaseModel):
|
||||||
|
r"""Image generation response"""
|
||||||
|
|
||||||
|
created: int
|
||||||
|
r"""Unix timestamp (seconds) when the image was generated"""
|
||||||
|
|
||||||
|
data: List[ImageGenerationResponseData]
|
||||||
|
r"""Generated images"""
|
||||||
|
|
||||||
|
usage: Optional[ImageGenerationUsage] = None
|
||||||
|
r"""Token and cost usage for the image generation request, when available"""
|
||||||
@@ -16,7 +16,7 @@ from typing import Literal, Optional, Union
|
|||||||
from typing_extensions import Annotated, NotRequired, TypedDict
|
from typing_extensions import Annotated, NotRequired, TypedDict
|
||||||
|
|
||||||
|
|
||||||
Background = Union[
|
ImageGenerationServerToolBackground = Union[
|
||||||
Literal[
|
Literal[
|
||||||
"transparent",
|
"transparent",
|
||||||
"opaque",
|
"opaque",
|
||||||
@@ -64,7 +64,7 @@ Moderation = Union[
|
|||||||
]
|
]
|
||||||
|
|
||||||
|
|
||||||
OutputFormat = Union[
|
ImageGenerationServerToolOutputFormat = Union[
|
||||||
Literal[
|
Literal[
|
||||||
"png",
|
"png",
|
||||||
"webp",
|
"webp",
|
||||||
@@ -74,7 +74,7 @@ OutputFormat = Union[
|
|||||||
]
|
]
|
||||||
|
|
||||||
|
|
||||||
Quality = Union[
|
ImageGenerationServerToolQuality = Union[
|
||||||
Literal[
|
Literal[
|
||||||
"low",
|
"low",
|
||||||
"medium",
|
"medium",
|
||||||
@@ -103,15 +103,15 @@ class ImageGenerationServerToolTypedDict(TypedDict):
|
|||||||
r"""Image generation tool configuration"""
|
r"""Image generation tool configuration"""
|
||||||
|
|
||||||
type: ImageGenerationServerToolType
|
type: ImageGenerationServerToolType
|
||||||
background: NotRequired[Background]
|
background: NotRequired[ImageGenerationServerToolBackground]
|
||||||
input_fidelity: NotRequired[Nullable[InputFidelity]]
|
input_fidelity: NotRequired[Nullable[InputFidelity]]
|
||||||
input_image_mask: NotRequired[InputImageMaskTypedDict]
|
input_image_mask: NotRequired[InputImageMaskTypedDict]
|
||||||
model: NotRequired[ModelEnum]
|
model: NotRequired[ModelEnum]
|
||||||
moderation: NotRequired[Moderation]
|
moderation: NotRequired[Moderation]
|
||||||
output_compression: NotRequired[int]
|
output_compression: NotRequired[int]
|
||||||
output_format: NotRequired[OutputFormat]
|
output_format: NotRequired[ImageGenerationServerToolOutputFormat]
|
||||||
partial_images: NotRequired[int]
|
partial_images: NotRequired[int]
|
||||||
quality: NotRequired[Quality]
|
quality: NotRequired[ImageGenerationServerToolQuality]
|
||||||
size: NotRequired[Size]
|
size: NotRequired[Size]
|
||||||
|
|
||||||
|
|
||||||
@@ -121,7 +121,8 @@ class ImageGenerationServerTool(BaseModel):
|
|||||||
type: ImageGenerationServerToolType
|
type: ImageGenerationServerToolType
|
||||||
|
|
||||||
background: Annotated[
|
background: Annotated[
|
||||||
Optional[Background], PlainValidator(validate_open_enum(False))
|
Optional[ImageGenerationServerToolBackground],
|
||||||
|
PlainValidator(validate_open_enum(False)),
|
||||||
] = None
|
] = None
|
||||||
|
|
||||||
input_fidelity: Annotated[
|
input_fidelity: Annotated[
|
||||||
@@ -141,14 +142,16 @@ class ImageGenerationServerTool(BaseModel):
|
|||||||
output_compression: Optional[int] = None
|
output_compression: Optional[int] = None
|
||||||
|
|
||||||
output_format: Annotated[
|
output_format: Annotated[
|
||||||
Optional[OutputFormat], PlainValidator(validate_open_enum(False))
|
Optional[ImageGenerationServerToolOutputFormat],
|
||||||
|
PlainValidator(validate_open_enum(False)),
|
||||||
] = None
|
] = None
|
||||||
|
|
||||||
partial_images: Optional[int] = None
|
partial_images: Optional[int] = None
|
||||||
|
|
||||||
quality: Annotated[Optional[Quality], PlainValidator(validate_open_enum(False))] = (
|
quality: Annotated[
|
||||||
None
|
Optional[ImageGenerationServerToolQuality],
|
||||||
)
|
PlainValidator(validate_open_enum(False)),
|
||||||
|
] = None
|
||||||
|
|
||||||
size: Annotated[Optional[Size], PlainValidator(validate_open_enum(False))] = None
|
size: Annotated[Optional[Size], PlainValidator(validate_open_enum(False))] = None
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,331 @@
|
|||||||
|
"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
|
||||||
|
|
||||||
|
from __future__ import annotations
|
||||||
|
from .anthropicspeed import AnthropicSpeed
|
||||||
|
from .anthropicusageiteration import (
|
||||||
|
AnthropicUsageIteration,
|
||||||
|
AnthropicUsageIterationTypedDict,
|
||||||
|
)
|
||||||
|
from .costdetails import CostDetails, CostDetailsTypedDict
|
||||||
|
from openrouter.types import (
|
||||||
|
BaseModel,
|
||||||
|
Nullable,
|
||||||
|
OptionalNullable,
|
||||||
|
UNSET,
|
||||||
|
UNSET_SENTINEL,
|
||||||
|
)
|
||||||
|
from openrouter.utils import validate_open_enum
|
||||||
|
from pydantic import model_serializer
|
||||||
|
from pydantic.functional_validators import PlainValidator
|
||||||
|
from typing import List, Optional
|
||||||
|
from typing_extensions import Annotated, NotRequired, TypedDict
|
||||||
|
|
||||||
|
|
||||||
|
class ImageGenerationUsageCompletionTokensDetailsTypedDict(TypedDict):
|
||||||
|
audio_tokens: NotRequired[Nullable[int]]
|
||||||
|
r"""Tokens generated by the model for audio output."""
|
||||||
|
image_tokens: NotRequired[Nullable[int]]
|
||||||
|
r"""Tokens generated by the model for image output."""
|
||||||
|
reasoning_tokens: NotRequired[Nullable[int]]
|
||||||
|
r"""Tokens generated by the model for reasoning."""
|
||||||
|
|
||||||
|
|
||||||
|
class ImageGenerationUsageCompletionTokensDetails(BaseModel):
|
||||||
|
audio_tokens: OptionalNullable[int] = UNSET
|
||||||
|
r"""Tokens generated by the model for audio output."""
|
||||||
|
|
||||||
|
image_tokens: OptionalNullable[int] = UNSET
|
||||||
|
r"""Tokens generated by the model for image output."""
|
||||||
|
|
||||||
|
reasoning_tokens: OptionalNullable[int] = UNSET
|
||||||
|
r"""Tokens generated by the model for reasoning."""
|
||||||
|
|
||||||
|
@model_serializer(mode="wrap")
|
||||||
|
def serialize_model(self, handler):
|
||||||
|
optional_fields = ["audio_tokens", "image_tokens", "reasoning_tokens"]
|
||||||
|
nullable_fields = ["audio_tokens", "image_tokens", "reasoning_tokens"]
|
||||||
|
null_default_fields = []
|
||||||
|
|
||||||
|
serialized = handler(self)
|
||||||
|
|
||||||
|
m = {}
|
||||||
|
|
||||||
|
for n, f in type(self).model_fields.items():
|
||||||
|
k = f.alias or n
|
||||||
|
val = serialized.get(k)
|
||||||
|
serialized.pop(k, None)
|
||||||
|
|
||||||
|
optional_nullable = k in optional_fields and k in nullable_fields
|
||||||
|
is_set = (
|
||||||
|
self.__pydantic_fields_set__.intersection({n})
|
||||||
|
or k in null_default_fields
|
||||||
|
) # pylint: disable=no-member
|
||||||
|
|
||||||
|
if val is not None and val != UNSET_SENTINEL:
|
||||||
|
m[k] = val
|
||||||
|
elif val != UNSET_SENTINEL and (
|
||||||
|
not k in optional_fields or (optional_nullable and is_set)
|
||||||
|
):
|
||||||
|
m[k] = val
|
||||||
|
|
||||||
|
return m
|
||||||
|
|
||||||
|
|
||||||
|
class ImageGenerationUsagePromptTokensDetailsTypedDict(TypedDict):
|
||||||
|
r"""Breakdown of tokens used in the prompt."""
|
||||||
|
|
||||||
|
audio_tokens: NotRequired[Nullable[int]]
|
||||||
|
r"""Tokens used for input audio."""
|
||||||
|
cache_write_tokens: NotRequired[Nullable[int]]
|
||||||
|
r"""Tokens written to cache. Only returned for models with explicit caching and cache write pricing."""
|
||||||
|
cached_tokens: NotRequired[Nullable[int]]
|
||||||
|
r"""Tokens cached by the endpoint."""
|
||||||
|
file_tokens: NotRequired[Nullable[int]]
|
||||||
|
r"""Tokens used for input files/documents."""
|
||||||
|
video_tokens: NotRequired[Nullable[int]]
|
||||||
|
r"""Tokens used for input video."""
|
||||||
|
|
||||||
|
|
||||||
|
class ImageGenerationUsagePromptTokensDetails(BaseModel):
|
||||||
|
r"""Breakdown of tokens used in the prompt."""
|
||||||
|
|
||||||
|
audio_tokens: OptionalNullable[int] = UNSET
|
||||||
|
r"""Tokens used for input audio."""
|
||||||
|
|
||||||
|
cache_write_tokens: OptionalNullable[int] = UNSET
|
||||||
|
r"""Tokens written to cache. Only returned for models with explicit caching and cache write pricing."""
|
||||||
|
|
||||||
|
cached_tokens: OptionalNullable[int] = UNSET
|
||||||
|
r"""Tokens cached by the endpoint."""
|
||||||
|
|
||||||
|
file_tokens: OptionalNullable[int] = UNSET
|
||||||
|
r"""Tokens used for input files/documents."""
|
||||||
|
|
||||||
|
video_tokens: OptionalNullable[int] = UNSET
|
||||||
|
r"""Tokens used for input video."""
|
||||||
|
|
||||||
|
@model_serializer(mode="wrap")
|
||||||
|
def serialize_model(self, handler):
|
||||||
|
optional_fields = [
|
||||||
|
"audio_tokens",
|
||||||
|
"cache_write_tokens",
|
||||||
|
"cached_tokens",
|
||||||
|
"file_tokens",
|
||||||
|
"video_tokens",
|
||||||
|
]
|
||||||
|
nullable_fields = [
|
||||||
|
"audio_tokens",
|
||||||
|
"cache_write_tokens",
|
||||||
|
"cached_tokens",
|
||||||
|
"file_tokens",
|
||||||
|
"video_tokens",
|
||||||
|
]
|
||||||
|
null_default_fields = []
|
||||||
|
|
||||||
|
serialized = handler(self)
|
||||||
|
|
||||||
|
m = {}
|
||||||
|
|
||||||
|
for n, f in type(self).model_fields.items():
|
||||||
|
k = f.alias or n
|
||||||
|
val = serialized.get(k)
|
||||||
|
serialized.pop(k, None)
|
||||||
|
|
||||||
|
optional_nullable = k in optional_fields and k in nullable_fields
|
||||||
|
is_set = (
|
||||||
|
self.__pydantic_fields_set__.intersection({n})
|
||||||
|
or k in null_default_fields
|
||||||
|
) # pylint: disable=no-member
|
||||||
|
|
||||||
|
if val is not None and val != UNSET_SENTINEL:
|
||||||
|
m[k] = val
|
||||||
|
elif val != UNSET_SENTINEL and (
|
||||||
|
not k in optional_fields or (optional_nullable and is_set)
|
||||||
|
):
|
||||||
|
m[k] = val
|
||||||
|
|
||||||
|
return m
|
||||||
|
|
||||||
|
|
||||||
|
class ServerToolUseTypedDict(TypedDict):
|
||||||
|
r"""Usage for server-side tool execution (e.g., web search)"""
|
||||||
|
|
||||||
|
tool_calls_executed: NotRequired[Nullable[int]]
|
||||||
|
r"""Number of OpenRouter server tool calls that executed and produced a result."""
|
||||||
|
tool_calls_requested: NotRequired[Nullable[int]]
|
||||||
|
r"""Total number of OpenRouter server-orchestrated tool calls the model requested, across all tool types. Provider-native tools (e.g. native web search) are not counted here."""
|
||||||
|
web_search_requests: NotRequired[Nullable[int]]
|
||||||
|
r"""Number of web searches performed by server-side tools. For server-orchestrated tool calls a web search is also counted in tool_calls_requested; provider-native web search may report web_search_requests only. Do not sum the two."""
|
||||||
|
|
||||||
|
|
||||||
|
class ServerToolUse(BaseModel):
|
||||||
|
r"""Usage for server-side tool execution (e.g., web search)"""
|
||||||
|
|
||||||
|
tool_calls_executed: OptionalNullable[int] = UNSET
|
||||||
|
r"""Number of OpenRouter server tool calls that executed and produced a result."""
|
||||||
|
|
||||||
|
tool_calls_requested: OptionalNullable[int] = UNSET
|
||||||
|
r"""Total number of OpenRouter server-orchestrated tool calls the model requested, across all tool types. Provider-native tools (e.g. native web search) are not counted here."""
|
||||||
|
|
||||||
|
web_search_requests: OptionalNullable[int] = UNSET
|
||||||
|
r"""Number of web searches performed by server-side tools. For server-orchestrated tool calls a web search is also counted in tool_calls_requested; provider-native web search may report web_search_requests only. Do not sum the two."""
|
||||||
|
|
||||||
|
@model_serializer(mode="wrap")
|
||||||
|
def serialize_model(self, handler):
|
||||||
|
optional_fields = [
|
||||||
|
"tool_calls_executed",
|
||||||
|
"tool_calls_requested",
|
||||||
|
"web_search_requests",
|
||||||
|
]
|
||||||
|
nullable_fields = [
|
||||||
|
"tool_calls_executed",
|
||||||
|
"tool_calls_requested",
|
||||||
|
"web_search_requests",
|
||||||
|
]
|
||||||
|
null_default_fields = []
|
||||||
|
|
||||||
|
serialized = handler(self)
|
||||||
|
|
||||||
|
m = {}
|
||||||
|
|
||||||
|
for n, f in type(self).model_fields.items():
|
||||||
|
k = f.alias or n
|
||||||
|
val = serialized.get(k)
|
||||||
|
serialized.pop(k, None)
|
||||||
|
|
||||||
|
optional_nullable = k in optional_fields and k in nullable_fields
|
||||||
|
is_set = (
|
||||||
|
self.__pydantic_fields_set__.intersection({n})
|
||||||
|
or k in null_default_fields
|
||||||
|
) # pylint: disable=no-member
|
||||||
|
|
||||||
|
if val is not None and val != UNSET_SENTINEL:
|
||||||
|
m[k] = val
|
||||||
|
elif val != UNSET_SENTINEL and (
|
||||||
|
not k in optional_fields or (optional_nullable and is_set)
|
||||||
|
):
|
||||||
|
m[k] = val
|
||||||
|
|
||||||
|
return m
|
||||||
|
|
||||||
|
|
||||||
|
class ImageGenerationUsageTypedDict(TypedDict):
|
||||||
|
r"""Token and cost usage for the image generation request, when available"""
|
||||||
|
|
||||||
|
completion_tokens: int
|
||||||
|
r"""The tokens generated"""
|
||||||
|
prompt_tokens: int
|
||||||
|
r"""Including images, input audio, and tools if any"""
|
||||||
|
total_tokens: int
|
||||||
|
r"""Sum of the above two fields"""
|
||||||
|
completion_tokens_details: NotRequired[
|
||||||
|
Nullable[ImageGenerationUsageCompletionTokensDetailsTypedDict]
|
||||||
|
]
|
||||||
|
cost: NotRequired[Nullable[float]]
|
||||||
|
r"""Cost of the completion"""
|
||||||
|
cost_details: NotRequired[Nullable[CostDetailsTypedDict]]
|
||||||
|
r"""Breakdown of upstream inference costs"""
|
||||||
|
is_byok: NotRequired[bool]
|
||||||
|
r"""Whether a request was made using a Bring Your Own Key configuration"""
|
||||||
|
iterations: NotRequired[Nullable[List[AnthropicUsageIterationTypedDict]]]
|
||||||
|
prompt_tokens_details: NotRequired[
|
||||||
|
Nullable[ImageGenerationUsagePromptTokensDetailsTypedDict]
|
||||||
|
]
|
||||||
|
r"""Breakdown of tokens used in the prompt."""
|
||||||
|
server_tool_use: NotRequired[Nullable[ServerToolUseTypedDict]]
|
||||||
|
r"""Usage for server-side tool execution (e.g., web search)"""
|
||||||
|
service_tier: NotRequired[Nullable[str]]
|
||||||
|
r"""The service tier used by the upstream provider for this request"""
|
||||||
|
speed: NotRequired[Nullable[AnthropicSpeed]]
|
||||||
|
|
||||||
|
|
||||||
|
class ImageGenerationUsage(BaseModel):
|
||||||
|
r"""Token and cost usage for the image generation request, when available"""
|
||||||
|
|
||||||
|
completion_tokens: int
|
||||||
|
r"""The tokens generated"""
|
||||||
|
|
||||||
|
prompt_tokens: int
|
||||||
|
r"""Including images, input audio, and tools if any"""
|
||||||
|
|
||||||
|
total_tokens: int
|
||||||
|
r"""Sum of the above two fields"""
|
||||||
|
|
||||||
|
completion_tokens_details: OptionalNullable[
|
||||||
|
ImageGenerationUsageCompletionTokensDetails
|
||||||
|
] = UNSET
|
||||||
|
|
||||||
|
cost: OptionalNullable[float] = UNSET
|
||||||
|
r"""Cost of the completion"""
|
||||||
|
|
||||||
|
cost_details: OptionalNullable[CostDetails] = UNSET
|
||||||
|
r"""Breakdown of upstream inference costs"""
|
||||||
|
|
||||||
|
is_byok: Optional[bool] = None
|
||||||
|
r"""Whether a request was made using a Bring Your Own Key configuration"""
|
||||||
|
|
||||||
|
iterations: OptionalNullable[List[AnthropicUsageIteration]] = UNSET
|
||||||
|
|
||||||
|
prompt_tokens_details: OptionalNullable[ImageGenerationUsagePromptTokensDetails] = (
|
||||||
|
UNSET
|
||||||
|
)
|
||||||
|
r"""Breakdown of tokens used in the prompt."""
|
||||||
|
|
||||||
|
server_tool_use: OptionalNullable[ServerToolUse] = UNSET
|
||||||
|
r"""Usage for server-side tool execution (e.g., web search)"""
|
||||||
|
|
||||||
|
service_tier: OptionalNullable[str] = UNSET
|
||||||
|
r"""The service tier used by the upstream provider for this request"""
|
||||||
|
|
||||||
|
speed: Annotated[
|
||||||
|
OptionalNullable[AnthropicSpeed], PlainValidator(validate_open_enum(False))
|
||||||
|
] = UNSET
|
||||||
|
|
||||||
|
@model_serializer(mode="wrap")
|
||||||
|
def serialize_model(self, handler):
|
||||||
|
optional_fields = [
|
||||||
|
"completion_tokens_details",
|
||||||
|
"cost",
|
||||||
|
"cost_details",
|
||||||
|
"is_byok",
|
||||||
|
"iterations",
|
||||||
|
"prompt_tokens_details",
|
||||||
|
"server_tool_use",
|
||||||
|
"service_tier",
|
||||||
|
"speed",
|
||||||
|
]
|
||||||
|
nullable_fields = [
|
||||||
|
"completion_tokens_details",
|
||||||
|
"cost",
|
||||||
|
"cost_details",
|
||||||
|
"iterations",
|
||||||
|
"prompt_tokens_details",
|
||||||
|
"server_tool_use",
|
||||||
|
"service_tier",
|
||||||
|
"speed",
|
||||||
|
]
|
||||||
|
null_default_fields = []
|
||||||
|
|
||||||
|
serialized = handler(self)
|
||||||
|
|
||||||
|
m = {}
|
||||||
|
|
||||||
|
for n, f in type(self).model_fields.items():
|
||||||
|
k = f.alias or n
|
||||||
|
val = serialized.get(k)
|
||||||
|
serialized.pop(k, None)
|
||||||
|
|
||||||
|
optional_nullable = k in optional_fields and k in nullable_fields
|
||||||
|
is_set = (
|
||||||
|
self.__pydantic_fields_set__.intersection({n})
|
||||||
|
or k in null_default_fields
|
||||||
|
) # pylint: disable=no-member
|
||||||
|
|
||||||
|
if val is not None and val != UNSET_SENTINEL:
|
||||||
|
m[k] = val
|
||||||
|
elif val != UNSET_SENTINEL and (
|
||||||
|
not k in optional_fields or (optional_nullable and is_set)
|
||||||
|
):
|
||||||
|
m[k] = val
|
||||||
|
|
||||||
|
return m
|
||||||
@@ -0,0 +1,34 @@
|
|||||||
|
"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
|
||||||
|
|
||||||
|
from __future__ import annotations
|
||||||
|
from openrouter.types import BaseModel
|
||||||
|
from typing import Literal
|
||||||
|
from typing_extensions import TypedDict
|
||||||
|
|
||||||
|
|
||||||
|
ImageGenPartialImageEventType = Literal["image_generation.partial_image",]
|
||||||
|
r"""The event type"""
|
||||||
|
|
||||||
|
|
||||||
|
class ImageGenPartialImageEventTypedDict(TypedDict):
|
||||||
|
r"""Emitted when a partial image becomes available during streaming generation"""
|
||||||
|
|
||||||
|
b64_json: str
|
||||||
|
r"""Base64-encoded partial image data"""
|
||||||
|
partial_image_index: int
|
||||||
|
r"""0-based index indicating which partial image this is in the sequence"""
|
||||||
|
type: ImageGenPartialImageEventType
|
||||||
|
r"""The event type"""
|
||||||
|
|
||||||
|
|
||||||
|
class ImageGenPartialImageEvent(BaseModel):
|
||||||
|
r"""Emitted when a partial image becomes available during streaming generation"""
|
||||||
|
|
||||||
|
b64_json: str
|
||||||
|
r"""Base64-encoded partial image data"""
|
||||||
|
|
||||||
|
partial_image_index: int
|
||||||
|
r"""0-based index indicating which partial image this is in the sequence"""
|
||||||
|
|
||||||
|
type: ImageGenPartialImageEventType
|
||||||
|
r"""The event type"""
|
||||||
@@ -0,0 +1,95 @@
|
|||||||
|
"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
|
||||||
|
|
||||||
|
from __future__ import annotations
|
||||||
|
from openrouter.types import (
|
||||||
|
BaseModel,
|
||||||
|
Nullable,
|
||||||
|
OptionalNullable,
|
||||||
|
UNSET,
|
||||||
|
UNSET_SENTINEL,
|
||||||
|
)
|
||||||
|
from pydantic import model_serializer
|
||||||
|
from typing import Literal
|
||||||
|
from typing_extensions import NotRequired, TypedDict
|
||||||
|
|
||||||
|
|
||||||
|
class ImageGenStreamErrorEventErrorTypedDict(TypedDict):
|
||||||
|
r"""Provider error details"""
|
||||||
|
|
||||||
|
message: str
|
||||||
|
r"""Provider error message"""
|
||||||
|
code: NotRequired[Nullable[str]]
|
||||||
|
r"""Provider error code, when supplied"""
|
||||||
|
param: NotRequired[Nullable[str]]
|
||||||
|
r"""Request parameter associated with the error, when supplied"""
|
||||||
|
type: NotRequired[Nullable[str]]
|
||||||
|
r"""Provider error type, when supplied"""
|
||||||
|
|
||||||
|
|
||||||
|
class ImageGenStreamErrorEventError(BaseModel):
|
||||||
|
r"""Provider error details"""
|
||||||
|
|
||||||
|
message: str
|
||||||
|
r"""Provider error message"""
|
||||||
|
|
||||||
|
code: OptionalNullable[str] = UNSET
|
||||||
|
r"""Provider error code, when supplied"""
|
||||||
|
|
||||||
|
param: OptionalNullable[str] = UNSET
|
||||||
|
r"""Request parameter associated with the error, when supplied"""
|
||||||
|
|
||||||
|
type: OptionalNullable[str] = UNSET
|
||||||
|
r"""Provider error type, when supplied"""
|
||||||
|
|
||||||
|
@model_serializer(mode="wrap")
|
||||||
|
def serialize_model(self, handler):
|
||||||
|
optional_fields = ["code", "param", "type"]
|
||||||
|
nullable_fields = ["code", "param", "type"]
|
||||||
|
null_default_fields = []
|
||||||
|
|
||||||
|
serialized = handler(self)
|
||||||
|
|
||||||
|
m = {}
|
||||||
|
|
||||||
|
for n, f in type(self).model_fields.items():
|
||||||
|
k = f.alias or n
|
||||||
|
val = serialized.get(k)
|
||||||
|
serialized.pop(k, None)
|
||||||
|
|
||||||
|
optional_nullable = k in optional_fields and k in nullable_fields
|
||||||
|
is_set = (
|
||||||
|
self.__pydantic_fields_set__.intersection({n})
|
||||||
|
or k in null_default_fields
|
||||||
|
) # pylint: disable=no-member
|
||||||
|
|
||||||
|
if val is not None and val != UNSET_SENTINEL:
|
||||||
|
m[k] = val
|
||||||
|
elif val != UNSET_SENTINEL and (
|
||||||
|
not k in optional_fields or (optional_nullable and is_set)
|
||||||
|
):
|
||||||
|
m[k] = val
|
||||||
|
|
||||||
|
return m
|
||||||
|
|
||||||
|
|
||||||
|
ImageGenStreamErrorEventType = Literal["error",]
|
||||||
|
r"""The event type"""
|
||||||
|
|
||||||
|
|
||||||
|
class ImageGenStreamErrorEventTypedDict(TypedDict):
|
||||||
|
r"""Emitted when streaming generation fails after the SSE response starts"""
|
||||||
|
|
||||||
|
error: ImageGenStreamErrorEventErrorTypedDict
|
||||||
|
r"""Provider error details"""
|
||||||
|
type: ImageGenStreamErrorEventType
|
||||||
|
r"""The event type"""
|
||||||
|
|
||||||
|
|
||||||
|
class ImageGenStreamErrorEvent(BaseModel):
|
||||||
|
r"""Emitted when streaming generation fails after the SSE response starts"""
|
||||||
|
|
||||||
|
error: ImageGenStreamErrorEventError
|
||||||
|
r"""Provider error details"""
|
||||||
|
|
||||||
|
type: ImageGenStreamErrorEventType
|
||||||
|
r"""The event type"""
|
||||||
@@ -0,0 +1,29 @@
|
|||||||
|
"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
|
||||||
|
|
||||||
|
from __future__ import annotations
|
||||||
|
from .imageoutputmodality import ImageOutputModality
|
||||||
|
from .inputmodality import InputModality
|
||||||
|
from openrouter.types import BaseModel
|
||||||
|
from openrouter.utils import validate_open_enum
|
||||||
|
from pydantic.functional_validators import PlainValidator
|
||||||
|
from typing import List
|
||||||
|
from typing_extensions import Annotated, TypedDict
|
||||||
|
|
||||||
|
|
||||||
|
class ImageModelArchitectureTypedDict(TypedDict):
|
||||||
|
input_modalities: List[InputModality]
|
||||||
|
r"""Supported input modalities"""
|
||||||
|
output_modalities: List[ImageOutputModality]
|
||||||
|
r"""Supported output modalities"""
|
||||||
|
|
||||||
|
|
||||||
|
class ImageModelArchitecture(BaseModel):
|
||||||
|
input_modalities: List[
|
||||||
|
Annotated[InputModality, PlainValidator(validate_open_enum(False))]
|
||||||
|
]
|
||||||
|
r"""Supported input modalities"""
|
||||||
|
|
||||||
|
output_modalities: List[
|
||||||
|
Annotated[ImageOutputModality, PlainValidator(validate_open_enum(False))]
|
||||||
|
]
|
||||||
|
r"""Supported output modalities"""
|
||||||
@@ -0,0 +1,24 @@
|
|||||||
|
"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
|
||||||
|
|
||||||
|
from __future__ import annotations
|
||||||
|
from .imageendpoint import ImageEndpoint, ImageEndpointTypedDict
|
||||||
|
from openrouter.types import BaseModel
|
||||||
|
from typing import List
|
||||||
|
from typing_extensions import TypedDict
|
||||||
|
|
||||||
|
|
||||||
|
class ImageModelEndpointsResponseTypedDict(TypedDict):
|
||||||
|
r"""The full per-endpoint records for an image model."""
|
||||||
|
|
||||||
|
endpoints: List[ImageEndpointTypedDict]
|
||||||
|
id: str
|
||||||
|
r"""Model slug"""
|
||||||
|
|
||||||
|
|
||||||
|
class ImageModelEndpointsResponse(BaseModel):
|
||||||
|
r"""The full per-endpoint records for an image model."""
|
||||||
|
|
||||||
|
endpoints: List[ImageEndpoint]
|
||||||
|
|
||||||
|
id: str
|
||||||
|
r"""Model slug"""
|
||||||
@@ -0,0 +1,56 @@
|
|||||||
|
"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
|
||||||
|
|
||||||
|
from __future__ import annotations
|
||||||
|
from .capabilitydescriptor import CapabilityDescriptor, CapabilityDescriptorTypedDict
|
||||||
|
from .imagemodelarchitecture import (
|
||||||
|
ImageModelArchitecture,
|
||||||
|
ImageModelArchitectureTypedDict,
|
||||||
|
)
|
||||||
|
from openrouter.types import BaseModel
|
||||||
|
from typing import Dict
|
||||||
|
from typing_extensions import TypedDict
|
||||||
|
|
||||||
|
|
||||||
|
class ImageModelListItemTypedDict(TypedDict):
|
||||||
|
r"""A single image model in the discovery listing."""
|
||||||
|
|
||||||
|
architecture: ImageModelArchitectureTypedDict
|
||||||
|
created: int
|
||||||
|
r"""Unix timestamp (seconds) of when the model was created"""
|
||||||
|
description: str
|
||||||
|
endpoints: str
|
||||||
|
r"""Relative URL to the full per-endpoint records for this model"""
|
||||||
|
id: str
|
||||||
|
r"""Model slug"""
|
||||||
|
name: str
|
||||||
|
r"""Display name"""
|
||||||
|
supported_parameters: Dict[str, CapabilityDescriptorTypedDict]
|
||||||
|
r"""Union of supported parameters across every endpoint of this model. Coarse discovery aid; the definitive per-endpoint set is behind the endpoints URL."""
|
||||||
|
supports_streaming: bool
|
||||||
|
r"""Whether any endpoint of this model supports native SSE streaming on the dedicated Image API (i.e. `stream: true` in the request). OR across endpoints."""
|
||||||
|
|
||||||
|
|
||||||
|
class ImageModelListItem(BaseModel):
|
||||||
|
r"""A single image model in the discovery listing."""
|
||||||
|
|
||||||
|
architecture: ImageModelArchitecture
|
||||||
|
|
||||||
|
created: int
|
||||||
|
r"""Unix timestamp (seconds) of when the model was created"""
|
||||||
|
|
||||||
|
description: str
|
||||||
|
|
||||||
|
endpoints: str
|
||||||
|
r"""Relative URL to the full per-endpoint records for this model"""
|
||||||
|
|
||||||
|
id: str
|
||||||
|
r"""Model slug"""
|
||||||
|
|
||||||
|
name: str
|
||||||
|
r"""Display name"""
|
||||||
|
|
||||||
|
supported_parameters: Dict[str, CapabilityDescriptor]
|
||||||
|
r"""Union of supported parameters across every endpoint of this model. Coarse discovery aid; the definitive per-endpoint set is behind the endpoints URL."""
|
||||||
|
|
||||||
|
supports_streaming: bool
|
||||||
|
r"""Whether any endpoint of this model supports native SSE streaming on the dedicated Image API (i.e. `stream: true` in the request). OR across endpoints."""
|
||||||
@@ -0,0 +1,19 @@
|
|||||||
|
"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
|
||||||
|
|
||||||
|
from __future__ import annotations
|
||||||
|
from .imagemodellistitem import ImageModelListItem, ImageModelListItemTypedDict
|
||||||
|
from openrouter.types import BaseModel
|
||||||
|
from typing import List
|
||||||
|
from typing_extensions import TypedDict
|
||||||
|
|
||||||
|
|
||||||
|
class ImageModelsListResponseTypedDict(TypedDict):
|
||||||
|
r"""List of image generation models."""
|
||||||
|
|
||||||
|
data: List[ImageModelListItemTypedDict]
|
||||||
|
|
||||||
|
|
||||||
|
class ImageModelsListResponse(BaseModel):
|
||||||
|
r"""List of image generation models."""
|
||||||
|
|
||||||
|
data: List[ImageModelListItem]
|
||||||
@@ -0,0 +1,20 @@
|
|||||||
|
"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
|
||||||
|
|
||||||
|
from __future__ import annotations
|
||||||
|
from openrouter.types import UnrecognizedStr
|
||||||
|
from typing import Literal, Union
|
||||||
|
|
||||||
|
|
||||||
|
ImageOutputModality = Union[
|
||||||
|
Literal[
|
||||||
|
"text",
|
||||||
|
"image",
|
||||||
|
"embeddings",
|
||||||
|
"audio",
|
||||||
|
"video",
|
||||||
|
"rerank",
|
||||||
|
"speech",
|
||||||
|
"transcription",
|
||||||
|
],
|
||||||
|
UnrecognizedStr,
|
||||||
|
]
|
||||||
@@ -0,0 +1,51 @@
|
|||||||
|
"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
|
||||||
|
|
||||||
|
from __future__ import annotations
|
||||||
|
from openrouter.types import BaseModel, UnrecognizedStr
|
||||||
|
from openrouter.utils import validate_open_enum
|
||||||
|
from pydantic.functional_validators import PlainValidator
|
||||||
|
from typing import Literal, Optional, Union
|
||||||
|
from typing_extensions import Annotated, NotRequired, TypedDict
|
||||||
|
|
||||||
|
|
||||||
|
Billable = Union[
|
||||||
|
Literal[
|
||||||
|
"output_image",
|
||||||
|
"input_image",
|
||||||
|
"input_font",
|
||||||
|
"input_reference",
|
||||||
|
"input_text",
|
||||||
|
],
|
||||||
|
UnrecognizedStr,
|
||||||
|
]
|
||||||
|
|
||||||
|
|
||||||
|
Unit = Union[
|
||||||
|
Literal[
|
||||||
|
"image",
|
||||||
|
"megapixel",
|
||||||
|
"token",
|
||||||
|
],
|
||||||
|
UnrecognizedStr,
|
||||||
|
]
|
||||||
|
|
||||||
|
|
||||||
|
class ImagePricingEntryTypedDict(TypedDict):
|
||||||
|
r"""One billable pricing line for an image provider."""
|
||||||
|
|
||||||
|
billable: Billable
|
||||||
|
cost_usd: float
|
||||||
|
unit: Unit
|
||||||
|
variant: NotRequired[str]
|
||||||
|
|
||||||
|
|
||||||
|
class ImagePricingEntry(BaseModel):
|
||||||
|
r"""One billable pricing line for an image provider."""
|
||||||
|
|
||||||
|
billable: Annotated[Billable, PlainValidator(validate_open_enum(False))]
|
||||||
|
|
||||||
|
cost_usd: float
|
||||||
|
|
||||||
|
unit: Annotated[Unit, PlainValidator(validate_open_enum(False))]
|
||||||
|
|
||||||
|
variant: Optional[str] = None
|
||||||
@@ -0,0 +1,48 @@
|
|||||||
|
"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
|
||||||
|
|
||||||
|
from __future__ import annotations
|
||||||
|
from .imagegencompletedevent import (
|
||||||
|
ImageGenCompletedEvent,
|
||||||
|
ImageGenCompletedEventTypedDict,
|
||||||
|
)
|
||||||
|
from .imagegenpartialimageevent import (
|
||||||
|
ImageGenPartialImageEvent,
|
||||||
|
ImageGenPartialImageEventTypedDict,
|
||||||
|
)
|
||||||
|
from .imagegenstreamerrorevent import (
|
||||||
|
ImageGenStreamErrorEvent,
|
||||||
|
ImageGenStreamErrorEventTypedDict,
|
||||||
|
)
|
||||||
|
from openrouter.types import BaseModel
|
||||||
|
from openrouter.utils import get_discriminator
|
||||||
|
from pydantic import Discriminator, Tag
|
||||||
|
from typing import Union
|
||||||
|
from typing_extensions import Annotated, TypeAliasType, TypedDict
|
||||||
|
|
||||||
|
|
||||||
|
ImageStreamingResponseDataTypedDict = TypeAliasType(
|
||||||
|
"ImageStreamingResponseDataTypedDict",
|
||||||
|
Union[
|
||||||
|
ImageGenStreamErrorEventTypedDict,
|
||||||
|
ImageGenPartialImageEventTypedDict,
|
||||||
|
ImageGenCompletedEventTypedDict,
|
||||||
|
],
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
|
ImageStreamingResponseData = Annotated[
|
||||||
|
Union[
|
||||||
|
Annotated[ImageGenPartialImageEvent, Tag("image_generation.partial_image")],
|
||||||
|
Annotated[ImageGenCompletedEvent, Tag("image_generation.completed")],
|
||||||
|
Annotated[ImageGenStreamErrorEvent, Tag("error")],
|
||||||
|
],
|
||||||
|
Discriminator(lambda m: get_discriminator(m, "type", "type")),
|
||||||
|
]
|
||||||
|
|
||||||
|
|
||||||
|
class ImageStreamingResponseTypedDict(TypedDict):
|
||||||
|
data: ImageStreamingResponseDataTypedDict
|
||||||
|
|
||||||
|
|
||||||
|
class ImageStreamingResponse(BaseModel):
|
||||||
|
data: ImageStreamingResponseData
|
||||||
@@ -298,11 +298,11 @@ class ContextManagement(BaseModel):
|
|||||||
edits: Optional[List[Edit]] = None
|
edits: Optional[List[Edit]] = None
|
||||||
|
|
||||||
|
|
||||||
class MetadataTypedDict(TypedDict):
|
class MessagesRequestMetadataTypedDict(TypedDict):
|
||||||
user_id: NotRequired[Nullable[str]]
|
user_id: NotRequired[Nullable[str]]
|
||||||
|
|
||||||
|
|
||||||
class Metadata(BaseModel):
|
class MessagesRequestMetadata(BaseModel):
|
||||||
user_id: OptionalNullable[str] = UNSET
|
user_id: OptionalNullable[str] = UNSET
|
||||||
|
|
||||||
@model_serializer(mode="wrap")
|
@model_serializer(mode="wrap")
|
||||||
@@ -1050,7 +1050,7 @@ class MessagesRequestTypedDict(TypedDict):
|
|||||||
fallbacks: NotRequired[Nullable[List[MessagesFallbackParamTypedDict]]]
|
fallbacks: NotRequired[Nullable[List[MessagesFallbackParamTypedDict]]]
|
||||||
r"""Fallback models to try if the primary model fails or refuses, in order. Handled by OpenRouter multi-model routing rather than Anthropic server-side fallbacks; cannot be combined with `models`. Each entry accepts only `model`. Maximum of 3 entries."""
|
r"""Fallback models to try if the primary model fails or refuses, in order. Handled by OpenRouter multi-model routing rather than Anthropic server-side fallbacks; cannot be combined with `models`. Each entry accepts only `model`. Maximum of 3 entries."""
|
||||||
max_tokens: NotRequired[int]
|
max_tokens: NotRequired[int]
|
||||||
metadata: NotRequired[MetadataTypedDict]
|
metadata: NotRequired[MessagesRequestMetadataTypedDict]
|
||||||
models: NotRequired[List[str]]
|
models: NotRequired[List[str]]
|
||||||
output_config: NotRequired[MessagesOutputConfigTypedDict]
|
output_config: NotRequired[MessagesOutputConfigTypedDict]
|
||||||
r"""Configuration for controlling output behavior. Supports the effort parameter and structured output format."""
|
r"""Configuration for controlling output behavior. Supports the effort parameter and structured output format."""
|
||||||
@@ -1096,7 +1096,7 @@ class MessagesRequest(BaseModel):
|
|||||||
|
|
||||||
max_tokens: Optional[int] = None
|
max_tokens: Optional[int] = None
|
||||||
|
|
||||||
metadata: Optional[Metadata] = None
|
metadata: Optional[MessagesRequestMetadata] = None
|
||||||
|
|
||||||
models: Optional[List[str]] = None
|
models: Optional[List[str]] = None
|
||||||
|
|
||||||
|
|||||||
@@ -19,6 +19,7 @@ from typing_extensions import Annotated, NotRequired, TypedDict
|
|||||||
|
|
||||||
DefaultEffort = Union[
|
DefaultEffort = Union[
|
||||||
Literal[
|
Literal[
|
||||||
|
"max",
|
||||||
"xhigh",
|
"xhigh",
|
||||||
"high",
|
"high",
|
||||||
"medium",
|
"medium",
|
||||||
|
|||||||
@@ -15,6 +15,7 @@ from typing_extensions import Annotated, NotRequired, TypedDict
|
|||||||
class ObservabilityArizeDestinationConfigTypedDict(TypedDict):
|
class ObservabilityArizeDestinationConfigTypedDict(TypedDict):
|
||||||
api_key: str
|
api_key: str
|
||||||
model_id: str
|
model_id: str
|
||||||
|
r"""The name of the tracing project in Arize AX"""
|
||||||
space_key: str
|
space_key: str
|
||||||
base_url: NotRequired[str]
|
base_url: NotRequired[str]
|
||||||
headers: NotRequired[Dict[str, str]]
|
headers: NotRequired[Dict[str, str]]
|
||||||
@@ -25,6 +26,7 @@ class ObservabilityArizeDestinationConfig(BaseModel):
|
|||||||
api_key: Annotated[str, pydantic.Field(alias="apiKey")]
|
api_key: Annotated[str, pydantic.Field(alias="apiKey")]
|
||||||
|
|
||||||
model_id: Annotated[str, pydantic.Field(alias="modelId")]
|
model_id: Annotated[str, pydantic.Field(alias="modelId")]
|
||||||
|
r"""The name of the tracing project in Arize AX"""
|
||||||
|
|
||||||
space_key: Annotated[str, pydantic.Field(alias="spaceKey")]
|
space_key: Annotated[str, pydantic.Field(alias="spaceKey")]
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
|
"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
|
||||||
|
|
||||||
from __future__ import annotations
|
from __future__ import annotations
|
||||||
|
from .apierrortype import APIErrorType
|
||||||
from .applypatchservertool import ApplyPatchServerTool, ApplyPatchServerToolTypedDict
|
from .applypatchservertool import ApplyPatchServerTool, ApplyPatchServerToolTypedDict
|
||||||
from .baseinputs_union import BaseInputsUnion, BaseInputsUnionTypedDict
|
from .baseinputs_union import BaseInputsUnion, BaseInputsUnionTypedDict
|
||||||
from .basereasoningconfig import BaseReasoningConfig, BaseReasoningConfigTypedDict
|
from .basereasoningconfig import BaseReasoningConfig, BaseReasoningConfigTypedDict
|
||||||
@@ -203,6 +204,8 @@ class OpenResponsesResultTypedDict(TypedDict):
|
|||||||
usage: NotRequired[Nullable[UsageTypedDict]]
|
usage: NotRequired[Nullable[UsageTypedDict]]
|
||||||
r"""Token usage information for the response"""
|
r"""Token usage information for the response"""
|
||||||
user: NotRequired[Nullable[str]]
|
user: NotRequired[Nullable[str]]
|
||||||
|
error_type: NotRequired[APIErrorType]
|
||||||
|
r"""Canonical OpenRouter error type, stable across all API formats"""
|
||||||
openrouter_metadata: NotRequired[OpenRouterMetadataTypedDict]
|
openrouter_metadata: NotRequired[OpenRouterMetadataTypedDict]
|
||||||
|
|
||||||
|
|
||||||
@@ -285,6 +288,11 @@ class OpenResponsesResult(BaseModel):
|
|||||||
|
|
||||||
user: OptionalNullable[str] = UNSET
|
user: OptionalNullable[str] = UNSET
|
||||||
|
|
||||||
|
error_type: Annotated[
|
||||||
|
Optional[APIErrorType], PlainValidator(validate_open_enum(False))
|
||||||
|
] = None
|
||||||
|
r"""Canonical OpenRouter error type, stable across all API formats"""
|
||||||
|
|
||||||
openrouter_metadata: Optional[OpenRouterMetadata] = None
|
openrouter_metadata: Optional[OpenRouterMetadata] = None
|
||||||
|
|
||||||
@model_serializer(mode="wrap")
|
@model_serializer(mode="wrap")
|
||||||
@@ -306,6 +314,7 @@ class OpenResponsesResult(BaseModel):
|
|||||||
"truncation",
|
"truncation",
|
||||||
"usage",
|
"usage",
|
||||||
"user",
|
"user",
|
||||||
|
"error_type",
|
||||||
"openrouter_metadata",
|
"openrouter_metadata",
|
||||||
]
|
]
|
||||||
nullable_fields = [
|
nullable_fields = [
|
||||||
|
|||||||
@@ -2,6 +2,7 @@
|
|||||||
|
|
||||||
from __future__ import annotations
|
from __future__ import annotations
|
||||||
from .fusionanalysisresult import FusionAnalysisResult, FusionAnalysisResultTypedDict
|
from .fusionanalysisresult import FusionAnalysisResult, FusionAnalysisResultTypedDict
|
||||||
|
from .fusionsource import FusionSource, FusionSourceTypedDict
|
||||||
from .toolcallstatus import ToolCallStatus
|
from .toolcallstatus import ToolCallStatus
|
||||||
from openrouter.types import BaseModel
|
from openrouter.types import BaseModel
|
||||||
from openrouter.utils import validate_open_enum
|
from openrouter.utils import validate_open_enum
|
||||||
@@ -60,6 +61,8 @@ class OutputFusionServerToolItemTypedDict(TypedDict):
|
|||||||
id: NotRequired[str]
|
id: NotRequired[str]
|
||||||
responses: NotRequired[List[ResponseTypedDict]]
|
responses: NotRequired[List[ResponseTypedDict]]
|
||||||
r"""Analysis models that produced a response in this fusion run, with each model's full panel content."""
|
r"""Analysis models that produced a response in this fusion run, with each model's full panel content."""
|
||||||
|
sources: NotRequired[List[FusionSourceTypedDict]]
|
||||||
|
r"""Web pages the analysis panels and judge retrieved via web search during this fusion run, deduplicated by URL across the whole run. Present when at least one model cited a source."""
|
||||||
|
|
||||||
|
|
||||||
class OutputFusionServerToolItem(BaseModel):
|
class OutputFusionServerToolItem(BaseModel):
|
||||||
@@ -85,3 +88,6 @@ class OutputFusionServerToolItem(BaseModel):
|
|||||||
|
|
||||||
responses: Optional[List[Response]] = None
|
responses: Optional[List[Response]] = None
|
||||||
r"""Analysis models that produced a response in this fusion run, with each model's full panel content."""
|
r"""Analysis models that produced a response in this fusion run, with each model's full panel content."""
|
||||||
|
|
||||||
|
sources: Optional[List[FusionSource]] = None
|
||||||
|
r"""Web pages the analysis panels and judge retrieved via web search during this fusion run, deduplicated by URL across the whole run. Present when at least one model cited a source."""
|
||||||
|
|||||||
@@ -140,9 +140,9 @@ OutputItemsTypedDict = TypeAliasType(
|
|||||||
OutputWebFetchServerToolItemTypedDict,
|
OutputWebFetchServerToolItemTypedDict,
|
||||||
OutputCodeInterpreterServerToolItemTypedDict,
|
OutputCodeInterpreterServerToolItemTypedDict,
|
||||||
OutputReasoningItemTypedDict,
|
OutputReasoningItemTypedDict,
|
||||||
OutputFusionServerToolItemTypedDict,
|
|
||||||
OutputAdvisorServerToolItemTypedDict,
|
OutputAdvisorServerToolItemTypedDict,
|
||||||
OutputSubagentServerToolItemTypedDict,
|
OutputSubagentServerToolItemTypedDict,
|
||||||
|
OutputFusionServerToolItemTypedDict,
|
||||||
],
|
],
|
||||||
)
|
)
|
||||||
r"""An output item from the response"""
|
r"""An output item from the response"""
|
||||||
|
|||||||
@@ -44,12 +44,14 @@ ProviderName = Union[
|
|||||||
"Google",
|
"Google",
|
||||||
"Google AI Studio",
|
"Google AI Studio",
|
||||||
"Groq",
|
"Groq",
|
||||||
|
"HeyGen",
|
||||||
"Inception",
|
"Inception",
|
||||||
"Inceptron",
|
"Inceptron",
|
||||||
"InferenceNet",
|
"InferenceNet",
|
||||||
"Ionstream",
|
"Ionstream",
|
||||||
"Infermatic",
|
"Infermatic",
|
||||||
"Io Net",
|
"Io Net",
|
||||||
|
"Inferact vLLM",
|
||||||
"Inflection",
|
"Inflection",
|
||||||
"Liquid",
|
"Liquid",
|
||||||
"Mara",
|
"Mara",
|
||||||
@@ -76,6 +78,7 @@ ProviderName = Union[
|
|||||||
"Recraft",
|
"Recraft",
|
||||||
"Reka",
|
"Reka",
|
||||||
"Relace",
|
"Relace",
|
||||||
|
"Sakana AI",
|
||||||
"SambaNova",
|
"SambaNova",
|
||||||
"Seed",
|
"Seed",
|
||||||
"SiliconFlow",
|
"SiliconFlow",
|
||||||
@@ -84,11 +87,13 @@ ProviderName = Union[
|
|||||||
"Stealth",
|
"Stealth",
|
||||||
"StreamLake",
|
"StreamLake",
|
||||||
"Switchpoint",
|
"Switchpoint",
|
||||||
|
"Tenstorrent",
|
||||||
"Together",
|
"Together",
|
||||||
"Upstage",
|
"Upstage",
|
||||||
"Venice",
|
"Venice",
|
||||||
"Wafer",
|
"Wafer",
|
||||||
"WandB",
|
"WandB",
|
||||||
|
"Quiver",
|
||||||
"Xiaomi",
|
"Xiaomi",
|
||||||
"xAI",
|
"xAI",
|
||||||
"Z.AI",
|
"Z.AI",
|
||||||
|
|||||||
@@ -55,11 +55,13 @@ class ProviderOptionsTypedDict(TypedDict):
|
|||||||
google_vertex: NotRequired[Dict[str, Nullable[Any]]]
|
google_vertex: NotRequired[Dict[str, Nullable[Any]]]
|
||||||
gopomelo: NotRequired[Dict[str, Nullable[Any]]]
|
gopomelo: NotRequired[Dict[str, Nullable[Any]]]
|
||||||
groq: NotRequired[Dict[str, Nullable[Any]]]
|
groq: NotRequired[Dict[str, Nullable[Any]]]
|
||||||
|
heygen: NotRequired[Dict[str, Nullable[Any]]]
|
||||||
huggingface: NotRequired[Dict[str, Nullable[Any]]]
|
huggingface: NotRequired[Dict[str, Nullable[Any]]]
|
||||||
hyperbolic: NotRequired[Dict[str, Nullable[Any]]]
|
hyperbolic: NotRequired[Dict[str, Nullable[Any]]]
|
||||||
hyperbolic_quantized: NotRequired[Dict[str, Nullable[Any]]]
|
hyperbolic_quantized: NotRequired[Dict[str, Nullable[Any]]]
|
||||||
inception: NotRequired[Dict[str, Nullable[Any]]]
|
inception: NotRequired[Dict[str, Nullable[Any]]]
|
||||||
inceptron: NotRequired[Dict[str, Nullable[Any]]]
|
inceptron: NotRequired[Dict[str, Nullable[Any]]]
|
||||||
|
inferact_vllm: NotRequired[Dict[str, Nullable[Any]]]
|
||||||
inference_net: NotRequired[Dict[str, Nullable[Any]]]
|
inference_net: NotRequired[Dict[str, Nullable[Any]]]
|
||||||
infermatic: NotRequired[Dict[str, Nullable[Any]]]
|
infermatic: NotRequired[Dict[str, Nullable[Any]]]
|
||||||
inflection: NotRequired[Dict[str, Nullable[Any]]]
|
inflection: NotRequired[Dict[str, Nullable[Any]]]
|
||||||
@@ -98,12 +100,14 @@ class ProviderOptionsTypedDict(TypedDict):
|
|||||||
perplexity: NotRequired[Dict[str, Nullable[Any]]]
|
perplexity: NotRequired[Dict[str, Nullable[Any]]]
|
||||||
phala: NotRequired[Dict[str, Nullable[Any]]]
|
phala: NotRequired[Dict[str, Nullable[Any]]]
|
||||||
poolside: NotRequired[Dict[str, Nullable[Any]]]
|
poolside: NotRequired[Dict[str, Nullable[Any]]]
|
||||||
|
quiver: NotRequired[Dict[str, Nullable[Any]]]
|
||||||
recraft: NotRequired[Dict[str, Nullable[Any]]]
|
recraft: NotRequired[Dict[str, Nullable[Any]]]
|
||||||
recursal: NotRequired[Dict[str, Nullable[Any]]]
|
recursal: NotRequired[Dict[str, Nullable[Any]]]
|
||||||
reflection: NotRequired[Dict[str, Nullable[Any]]]
|
reflection: NotRequired[Dict[str, Nullable[Any]]]
|
||||||
reka: NotRequired[Dict[str, Nullable[Any]]]
|
reka: NotRequired[Dict[str, Nullable[Any]]]
|
||||||
relace: NotRequired[Dict[str, Nullable[Any]]]
|
relace: NotRequired[Dict[str, Nullable[Any]]]
|
||||||
replicate: NotRequired[Dict[str, Nullable[Any]]]
|
replicate: NotRequired[Dict[str, Nullable[Any]]]
|
||||||
|
sakana_ai: NotRequired[Dict[str, Nullable[Any]]]
|
||||||
sambanova: NotRequired[Dict[str, Nullable[Any]]]
|
sambanova: NotRequired[Dict[str, Nullable[Any]]]
|
||||||
sambanova_cloaked: NotRequired[Dict[str, Nullable[Any]]]
|
sambanova_cloaked: NotRequired[Dict[str, Nullable[Any]]]
|
||||||
seed: NotRequired[Dict[str, Nullable[Any]]]
|
seed: NotRequired[Dict[str, Nullable[Any]]]
|
||||||
@@ -115,6 +119,7 @@ class ProviderOptionsTypedDict(TypedDict):
|
|||||||
streamlake: NotRequired[Dict[str, Nullable[Any]]]
|
streamlake: NotRequired[Dict[str, Nullable[Any]]]
|
||||||
switchpoint: NotRequired[Dict[str, Nullable[Any]]]
|
switchpoint: NotRequired[Dict[str, Nullable[Any]]]
|
||||||
targon: NotRequired[Dict[str, Nullable[Any]]]
|
targon: NotRequired[Dict[str, Nullable[Any]]]
|
||||||
|
tenstorrent: NotRequired[Dict[str, Nullable[Any]]]
|
||||||
together: NotRequired[Dict[str, Nullable[Any]]]
|
together: NotRequired[Dict[str, Nullable[Any]]]
|
||||||
together_lite: NotRequired[Dict[str, Nullable[Any]]]
|
together_lite: NotRequired[Dict[str, Nullable[Any]]]
|
||||||
ubicloud: NotRequired[Dict[str, Nullable[Any]]]
|
ubicloud: NotRequired[Dict[str, Nullable[Any]]]
|
||||||
@@ -240,6 +245,8 @@ class ProviderOptions(BaseModel):
|
|||||||
|
|
||||||
groq: Optional[Dict[str, Nullable[Any]]] = None
|
groq: Optional[Dict[str, Nullable[Any]]] = None
|
||||||
|
|
||||||
|
heygen: Optional[Dict[str, Nullable[Any]]] = None
|
||||||
|
|
||||||
huggingface: Optional[Dict[str, Nullable[Any]]] = None
|
huggingface: Optional[Dict[str, Nullable[Any]]] = None
|
||||||
|
|
||||||
hyperbolic: Optional[Dict[str, Nullable[Any]]] = None
|
hyperbolic: Optional[Dict[str, Nullable[Any]]] = None
|
||||||
@@ -252,6 +259,10 @@ class ProviderOptions(BaseModel):
|
|||||||
|
|
||||||
inceptron: Optional[Dict[str, Nullable[Any]]] = None
|
inceptron: Optional[Dict[str, Nullable[Any]]] = None
|
||||||
|
|
||||||
|
inferact_vllm: Annotated[
|
||||||
|
Optional[Dict[str, Nullable[Any]]], pydantic.Field(alias="inferact-vllm")
|
||||||
|
] = None
|
||||||
|
|
||||||
inference_net: Annotated[
|
inference_net: Annotated[
|
||||||
Optional[Dict[str, Nullable[Any]]], pydantic.Field(alias="inference-net")
|
Optional[Dict[str, Nullable[Any]]], pydantic.Field(alias="inference-net")
|
||||||
] = None
|
] = None
|
||||||
@@ -342,6 +353,8 @@ class ProviderOptions(BaseModel):
|
|||||||
|
|
||||||
poolside: Optional[Dict[str, Nullable[Any]]] = None
|
poolside: Optional[Dict[str, Nullable[Any]]] = None
|
||||||
|
|
||||||
|
quiver: Optional[Dict[str, Nullable[Any]]] = None
|
||||||
|
|
||||||
recraft: Optional[Dict[str, Nullable[Any]]] = None
|
recraft: Optional[Dict[str, Nullable[Any]]] = None
|
||||||
|
|
||||||
recursal: Optional[Dict[str, Nullable[Any]]] = None
|
recursal: Optional[Dict[str, Nullable[Any]]] = None
|
||||||
@@ -354,6 +367,10 @@ class ProviderOptions(BaseModel):
|
|||||||
|
|
||||||
replicate: Optional[Dict[str, Nullable[Any]]] = None
|
replicate: Optional[Dict[str, Nullable[Any]]] = None
|
||||||
|
|
||||||
|
sakana_ai: Annotated[
|
||||||
|
Optional[Dict[str, Nullable[Any]]], pydantic.Field(alias="sakana-ai")
|
||||||
|
] = None
|
||||||
|
|
||||||
sambanova: Optional[Dict[str, Nullable[Any]]] = None
|
sambanova: Optional[Dict[str, Nullable[Any]]] = None
|
||||||
|
|
||||||
sambanova_cloaked: Annotated[
|
sambanova_cloaked: Annotated[
|
||||||
@@ -380,6 +397,8 @@ class ProviderOptions(BaseModel):
|
|||||||
|
|
||||||
targon: Optional[Dict[str, Nullable[Any]]] = None
|
targon: Optional[Dict[str, Nullable[Any]]] = None
|
||||||
|
|
||||||
|
tenstorrent: Optional[Dict[str, Nullable[Any]]] = None
|
||||||
|
|
||||||
together: Optional[Dict[str, Nullable[Any]]] = None
|
together: Optional[Dict[str, Nullable[Any]]] = None
|
||||||
|
|
||||||
together_lite: Annotated[
|
together_lite: Annotated[
|
||||||
|
|||||||
@@ -52,26 +52,34 @@ class MaxPriceTypedDict(TypedDict):
|
|||||||
r"""The object specifying the maximum price you want to pay for this request. USD price per million tokens, for prompt and completion."""
|
r"""The object specifying the maximum price you want to pay for this request. USD price per million tokens, for prompt and completion."""
|
||||||
|
|
||||||
audio: NotRequired[str]
|
audio: NotRequired[str]
|
||||||
|
r"""Maximum price in USD per audio unit"""
|
||||||
completion: NotRequired[str]
|
completion: NotRequired[str]
|
||||||
|
r"""Maximum price in USD per million completion tokens"""
|
||||||
image: NotRequired[str]
|
image: NotRequired[str]
|
||||||
|
r"""Maximum price in USD per image"""
|
||||||
prompt: NotRequired[str]
|
prompt: NotRequired[str]
|
||||||
r"""Price per million prompt tokens"""
|
r"""Maximum price in USD per million prompt tokens"""
|
||||||
request: NotRequired[str]
|
request: NotRequired[str]
|
||||||
|
r"""Maximum price in USD per request"""
|
||||||
|
|
||||||
|
|
||||||
class MaxPrice(BaseModel):
|
class MaxPrice(BaseModel):
|
||||||
r"""The object specifying the maximum price you want to pay for this request. USD price per million tokens, for prompt and completion."""
|
r"""The object specifying the maximum price you want to pay for this request. USD price per million tokens, for prompt and completion."""
|
||||||
|
|
||||||
audio: Optional[str] = None
|
audio: Optional[str] = None
|
||||||
|
r"""Maximum price in USD per audio unit"""
|
||||||
|
|
||||||
completion: Optional[str] = None
|
completion: Optional[str] = None
|
||||||
|
r"""Maximum price in USD per million completion tokens"""
|
||||||
|
|
||||||
image: Optional[str] = None
|
image: Optional[str] = None
|
||||||
|
r"""Maximum price in USD per image"""
|
||||||
|
|
||||||
prompt: Optional[str] = None
|
prompt: Optional[str] = None
|
||||||
r"""Price per million prompt tokens"""
|
r"""Maximum price in USD per million prompt tokens"""
|
||||||
|
|
||||||
request: Optional[str] = None
|
request: Optional[str] = None
|
||||||
|
r"""Maximum price in USD per request"""
|
||||||
|
|
||||||
|
|
||||||
OnlyTypedDict = TypeAliasType("OnlyTypedDict", Union[ProviderName, str])
|
OnlyTypedDict = TypeAliasType("OnlyTypedDict", Union[ProviderName, str])
|
||||||
|
|||||||
@@ -77,12 +77,14 @@ ProviderResponseProviderName = Union[
|
|||||||
"Google",
|
"Google",
|
||||||
"Google AI Studio",
|
"Google AI Studio",
|
||||||
"Groq",
|
"Groq",
|
||||||
|
"HeyGen",
|
||||||
"Inception",
|
"Inception",
|
||||||
"Inceptron",
|
"Inceptron",
|
||||||
"InferenceNet",
|
"InferenceNet",
|
||||||
"Ionstream",
|
"Ionstream",
|
||||||
"Infermatic",
|
"Infermatic",
|
||||||
"Io Net",
|
"Io Net",
|
||||||
|
"Inferact vLLM",
|
||||||
"Inflection",
|
"Inflection",
|
||||||
"Liquid",
|
"Liquid",
|
||||||
"Mara",
|
"Mara",
|
||||||
@@ -109,6 +111,7 @@ ProviderResponseProviderName = Union[
|
|||||||
"Recraft",
|
"Recraft",
|
||||||
"Reka",
|
"Reka",
|
||||||
"Relace",
|
"Relace",
|
||||||
|
"Sakana AI",
|
||||||
"SambaNova",
|
"SambaNova",
|
||||||
"Seed",
|
"Seed",
|
||||||
"SiliconFlow",
|
"SiliconFlow",
|
||||||
@@ -117,11 +120,13 @@ ProviderResponseProviderName = Union[
|
|||||||
"Stealth",
|
"Stealth",
|
||||||
"StreamLake",
|
"StreamLake",
|
||||||
"Switchpoint",
|
"Switchpoint",
|
||||||
|
"Tenstorrent",
|
||||||
"Together",
|
"Together",
|
||||||
"Upstage",
|
"Upstage",
|
||||||
"Venice",
|
"Venice",
|
||||||
"Wafer",
|
"Wafer",
|
||||||
"WandB",
|
"WandB",
|
||||||
|
"Quiver",
|
||||||
"Xiaomi",
|
"Xiaomi",
|
||||||
"xAI",
|
"xAI",
|
||||||
"Z.AI",
|
"Z.AI",
|
||||||
|
|||||||
@@ -15,49 +15,82 @@ from typing_extensions import Annotated, NotRequired, TypedDict
|
|||||||
|
|
||||||
class PricingTypedDict(TypedDict):
|
class PricingTypedDict(TypedDict):
|
||||||
completion: str
|
completion: str
|
||||||
|
r"""Price in USD per token for completion (output) generation"""
|
||||||
prompt: str
|
prompt: str
|
||||||
|
r"""Price in USD per token for prompt (input) processing"""
|
||||||
audio: NotRequired[str]
|
audio: NotRequired[str]
|
||||||
|
r"""Price in USD per audio input token"""
|
||||||
audio_output: NotRequired[str]
|
audio_output: NotRequired[str]
|
||||||
|
r"""Price in USD per audio output token"""
|
||||||
discount: NotRequired[float]
|
discount: NotRequired[float]
|
||||||
|
r"""Fractional discount applied to this endpoint's pricing; the price is multiplied by (1 - discount) (0 = no discount, 1 = free)"""
|
||||||
image: NotRequired[str]
|
image: NotRequired[str]
|
||||||
|
r"""Price in USD per input image"""
|
||||||
image_output: NotRequired[str]
|
image_output: NotRequired[str]
|
||||||
|
r"""Price in USD per output image"""
|
||||||
image_token: NotRequired[str]
|
image_token: NotRequired[str]
|
||||||
|
r"""Price in USD per image token"""
|
||||||
input_audio_cache: NotRequired[str]
|
input_audio_cache: NotRequired[str]
|
||||||
|
r"""Price in USD per cached audio input token"""
|
||||||
input_cache_read: NotRequired[str]
|
input_cache_read: NotRequired[str]
|
||||||
|
r"""Price in USD per cached input token (read)"""
|
||||||
input_cache_write: NotRequired[str]
|
input_cache_write: NotRequired[str]
|
||||||
|
r"""Price per cache-write token, in USD per token. For providers with multiple cache TTLs (e.g. Anthropic), this is the default (5-minute) cache-write rate."""
|
||||||
|
input_cache_write_1h: NotRequired[str]
|
||||||
|
r"""Price per 1-hour cache-write token, in USD per token. Only present for providers that price an extended (1-hour) cache TTL separately, such as Anthropic."""
|
||||||
internal_reasoning: NotRequired[str]
|
internal_reasoning: NotRequired[str]
|
||||||
|
r"""Price in USD per internal reasoning token"""
|
||||||
request: NotRequired[str]
|
request: NotRequired[str]
|
||||||
|
r"""Price in USD per request"""
|
||||||
web_search: NotRequired[str]
|
web_search: NotRequired[str]
|
||||||
|
r"""Price in USD per web search"""
|
||||||
|
|
||||||
|
|
||||||
class Pricing(BaseModel):
|
class Pricing(BaseModel):
|
||||||
completion: str
|
completion: str
|
||||||
|
r"""Price in USD per token for completion (output) generation"""
|
||||||
|
|
||||||
prompt: str
|
prompt: str
|
||||||
|
r"""Price in USD per token for prompt (input) processing"""
|
||||||
|
|
||||||
audio: Optional[str] = None
|
audio: Optional[str] = None
|
||||||
|
r"""Price in USD per audio input token"""
|
||||||
|
|
||||||
audio_output: Optional[str] = None
|
audio_output: Optional[str] = None
|
||||||
|
r"""Price in USD per audio output token"""
|
||||||
|
|
||||||
discount: Optional[float] = None
|
discount: Optional[float] = None
|
||||||
|
r"""Fractional discount applied to this endpoint's pricing; the price is multiplied by (1 - discount) (0 = no discount, 1 = free)"""
|
||||||
|
|
||||||
image: Optional[str] = None
|
image: Optional[str] = None
|
||||||
|
r"""Price in USD per input image"""
|
||||||
|
|
||||||
image_output: Optional[str] = None
|
image_output: Optional[str] = None
|
||||||
|
r"""Price in USD per output image"""
|
||||||
|
|
||||||
image_token: Optional[str] = None
|
image_token: Optional[str] = None
|
||||||
|
r"""Price in USD per image token"""
|
||||||
|
|
||||||
input_audio_cache: Optional[str] = None
|
input_audio_cache: Optional[str] = None
|
||||||
|
r"""Price in USD per cached audio input token"""
|
||||||
|
|
||||||
input_cache_read: Optional[str] = None
|
input_cache_read: Optional[str] = None
|
||||||
|
r"""Price in USD per cached input token (read)"""
|
||||||
|
|
||||||
input_cache_write: Optional[str] = None
|
input_cache_write: Optional[str] = None
|
||||||
|
r"""Price per cache-write token, in USD per token. For providers with multiple cache TTLs (e.g. Anthropic), this is the default (5-minute) cache-write rate."""
|
||||||
|
|
||||||
|
input_cache_write_1h: Optional[str] = None
|
||||||
|
r"""Price per 1-hour cache-write token, in USD per token. Only present for providers that price an extended (1-hour) cache TTL separately, such as Anthropic."""
|
||||||
|
|
||||||
internal_reasoning: Optional[str] = None
|
internal_reasoning: Optional[str] = None
|
||||||
|
r"""Price in USD per internal reasoning token"""
|
||||||
|
|
||||||
request: Optional[str] = None
|
request: Optional[str] = None
|
||||||
|
r"""Price in USD per request"""
|
||||||
|
|
||||||
web_search: Optional[str] = None
|
web_search: Optional[str] = None
|
||||||
|
r"""Price in USD per web search"""
|
||||||
|
|
||||||
|
|
||||||
PublicEndpointQuantization = Union[
|
PublicEndpointQuantization = Union[
|
||||||
|
|||||||
@@ -10,48 +10,81 @@ class PublicPricingTypedDict(TypedDict):
|
|||||||
r"""Pricing information for the model"""
|
r"""Pricing information for the model"""
|
||||||
|
|
||||||
completion: str
|
completion: str
|
||||||
|
r"""Price in USD per token for completion (output) generation"""
|
||||||
prompt: str
|
prompt: str
|
||||||
|
r"""Price in USD per token for prompt (input) processing"""
|
||||||
audio: NotRequired[str]
|
audio: NotRequired[str]
|
||||||
|
r"""Price in USD per audio input token"""
|
||||||
audio_output: NotRequired[str]
|
audio_output: NotRequired[str]
|
||||||
|
r"""Price in USD per audio output token"""
|
||||||
discount: NotRequired[float]
|
discount: NotRequired[float]
|
||||||
|
r"""Fractional discount applied to this endpoint's pricing; the price is multiplied by (1 - discount) (0 = no discount, 1 = free)"""
|
||||||
image: NotRequired[str]
|
image: NotRequired[str]
|
||||||
|
r"""Price in USD per input image"""
|
||||||
image_output: NotRequired[str]
|
image_output: NotRequired[str]
|
||||||
|
r"""Price in USD per output image"""
|
||||||
image_token: NotRequired[str]
|
image_token: NotRequired[str]
|
||||||
|
r"""Price in USD per image token"""
|
||||||
input_audio_cache: NotRequired[str]
|
input_audio_cache: NotRequired[str]
|
||||||
|
r"""Price in USD per cached audio input token"""
|
||||||
input_cache_read: NotRequired[str]
|
input_cache_read: NotRequired[str]
|
||||||
|
r"""Price in USD per cached input token (read)"""
|
||||||
input_cache_write: NotRequired[str]
|
input_cache_write: NotRequired[str]
|
||||||
|
r"""Price per cache-write token, in USD per token. For providers with multiple cache TTLs (e.g. Anthropic), this is the default (5-minute) cache-write rate."""
|
||||||
|
input_cache_write_1h: NotRequired[str]
|
||||||
|
r"""Price per 1-hour cache-write token, in USD per token. Only present for providers that price an extended (1-hour) cache TTL separately, such as Anthropic."""
|
||||||
internal_reasoning: NotRequired[str]
|
internal_reasoning: NotRequired[str]
|
||||||
|
r"""Price in USD per internal reasoning token"""
|
||||||
request: NotRequired[str]
|
request: NotRequired[str]
|
||||||
|
r"""Price in USD per request"""
|
||||||
web_search: NotRequired[str]
|
web_search: NotRequired[str]
|
||||||
|
r"""Price in USD per web search"""
|
||||||
|
|
||||||
|
|
||||||
class PublicPricing(BaseModel):
|
class PublicPricing(BaseModel):
|
||||||
r"""Pricing information for the model"""
|
r"""Pricing information for the model"""
|
||||||
|
|
||||||
completion: str
|
completion: str
|
||||||
|
r"""Price in USD per token for completion (output) generation"""
|
||||||
|
|
||||||
prompt: str
|
prompt: str
|
||||||
|
r"""Price in USD per token for prompt (input) processing"""
|
||||||
|
|
||||||
audio: Optional[str] = None
|
audio: Optional[str] = None
|
||||||
|
r"""Price in USD per audio input token"""
|
||||||
|
|
||||||
audio_output: Optional[str] = None
|
audio_output: Optional[str] = None
|
||||||
|
r"""Price in USD per audio output token"""
|
||||||
|
|
||||||
discount: Optional[float] = None
|
discount: Optional[float] = None
|
||||||
|
r"""Fractional discount applied to this endpoint's pricing; the price is multiplied by (1 - discount) (0 = no discount, 1 = free)"""
|
||||||
|
|
||||||
image: Optional[str] = None
|
image: Optional[str] = None
|
||||||
|
r"""Price in USD per input image"""
|
||||||
|
|
||||||
image_output: Optional[str] = None
|
image_output: Optional[str] = None
|
||||||
|
r"""Price in USD per output image"""
|
||||||
|
|
||||||
image_token: Optional[str] = None
|
image_token: Optional[str] = None
|
||||||
|
r"""Price in USD per image token"""
|
||||||
|
|
||||||
input_audio_cache: Optional[str] = None
|
input_audio_cache: Optional[str] = None
|
||||||
|
r"""Price in USD per cached audio input token"""
|
||||||
|
|
||||||
input_cache_read: Optional[str] = None
|
input_cache_read: Optional[str] = None
|
||||||
|
r"""Price in USD per cached input token (read)"""
|
||||||
|
|
||||||
input_cache_write: Optional[str] = None
|
input_cache_write: Optional[str] = None
|
||||||
|
r"""Price per cache-write token, in USD per token. For providers with multiple cache TTLs (e.g. Anthropic), this is the default (5-minute) cache-write rate."""
|
||||||
|
|
||||||
|
input_cache_write_1h: Optional[str] = None
|
||||||
|
r"""Price per 1-hour cache-write token, in USD per token. Only present for providers that price an extended (1-hour) cache TTL separately, such as Anthropic."""
|
||||||
|
|
||||||
internal_reasoning: Optional[str] = None
|
internal_reasoning: Optional[str] = None
|
||||||
|
r"""Price in USD per internal reasoning token"""
|
||||||
|
|
||||||
request: Optional[str] = None
|
request: Optional[str] = None
|
||||||
|
r"""Price in USD per request"""
|
||||||
|
|
||||||
web_search: Optional[str] = None
|
web_search: Optional[str] = None
|
||||||
|
r"""Price in USD per web search"""
|
||||||
|
|||||||
@@ -0,0 +1,27 @@
|
|||||||
|
"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
|
||||||
|
|
||||||
|
from __future__ import annotations
|
||||||
|
from openrouter.types import BaseModel
|
||||||
|
from typing import Literal
|
||||||
|
from typing_extensions import TypedDict
|
||||||
|
|
||||||
|
|
||||||
|
RangeCapabilityType = Literal["range",]
|
||||||
|
|
||||||
|
|
||||||
|
class RangeCapabilityTypedDict(TypedDict):
|
||||||
|
r"""A parameter that accepts any value within an inclusive numeric range."""
|
||||||
|
|
||||||
|
max: float
|
||||||
|
min: float
|
||||||
|
type: RangeCapabilityType
|
||||||
|
|
||||||
|
|
||||||
|
class RangeCapability(BaseModel):
|
||||||
|
r"""A parameter that accepts any value within an inclusive numeric range."""
|
||||||
|
|
||||||
|
max: float
|
||||||
|
|
||||||
|
min: float
|
||||||
|
|
||||||
|
type: RangeCapabilityType
|
||||||
@@ -7,6 +7,7 @@ from typing import Literal, Union
|
|||||||
|
|
||||||
ReasoningEffort = Union[
|
ReasoningEffort = Union[
|
||||||
Literal[
|
Literal[
|
||||||
|
"max",
|
||||||
"xhigh",
|
"xhigh",
|
||||||
"high",
|
"high",
|
||||||
"medium",
|
"medium",
|
||||||
|
|||||||
@@ -16,6 +16,7 @@ from .applypatchservertool_openrouter import (
|
|||||||
)
|
)
|
||||||
from .autorouterplugin import AutoRouterPlugin, AutoRouterPluginTypedDict
|
from .autorouterplugin import AutoRouterPlugin, AutoRouterPluginTypedDict
|
||||||
from .bashservertool import BashServerTool, BashServerToolTypedDict
|
from .bashservertool import BashServerTool, BashServerToolTypedDict
|
||||||
|
from .chatdebugoptions import ChatDebugOptions, ChatDebugOptionsTypedDict
|
||||||
from .chatsearchmodelsservertool import (
|
from .chatsearchmodelsservertool import (
|
||||||
ChatSearchModelsServerTool,
|
ChatSearchModelsServerTool,
|
||||||
ChatSearchModelsServerToolTypedDict,
|
ChatSearchModelsServerToolTypedDict,
|
||||||
@@ -291,6 +292,8 @@ class ResponsesRequestTypedDict(TypedDict):
|
|||||||
background: NotRequired[Nullable[bool]]
|
background: NotRequired[Nullable[bool]]
|
||||||
cache_control: NotRequired[AnthropicCacheControlDirectiveTypedDict]
|
cache_control: NotRequired[AnthropicCacheControlDirectiveTypedDict]
|
||||||
r"""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."""
|
r"""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."""
|
||||||
|
debug: NotRequired[ChatDebugOptionsTypedDict]
|
||||||
|
r"""Debug options for inspecting request transformations (streaming only)"""
|
||||||
frequency_penalty: NotRequired[Nullable[float]]
|
frequency_penalty: NotRequired[Nullable[float]]
|
||||||
image_config: NotRequired[Dict[str, ImageConfigTypedDict]]
|
image_config: NotRequired[Dict[str, ImageConfigTypedDict]]
|
||||||
r"""Provider-specific image configuration options. Keys and values vary by model/provider. See https://openrouter.ai/docs/guides/overview/multimodal/image-generation for more details."""
|
r"""Provider-specific image configuration options. Keys and values vary by model/provider. See https://openrouter.ai/docs/guides/overview/multimodal/image-generation for more details."""
|
||||||
@@ -348,6 +351,9 @@ class ResponsesRequest(BaseModel):
|
|||||||
cache_control: Optional[AnthropicCacheControlDirective] = None
|
cache_control: Optional[AnthropicCacheControlDirective] = None
|
||||||
r"""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."""
|
r"""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."""
|
||||||
|
|
||||||
|
debug: Optional[ChatDebugOptions] = None
|
||||||
|
r"""Debug options for inspecting request transformations (streaming only)"""
|
||||||
|
|
||||||
frequency_penalty: OptionalNullable[float] = UNSET
|
frequency_penalty: OptionalNullable[float] = UNSET
|
||||||
|
|
||||||
image_config: Optional[Dict[str, ImageConfig]] = None
|
image_config: Optional[Dict[str, ImageConfig]] = None
|
||||||
@@ -448,6 +454,7 @@ class ResponsesRequest(BaseModel):
|
|||||||
optional_fields = [
|
optional_fields = [
|
||||||
"background",
|
"background",
|
||||||
"cache_control",
|
"cache_control",
|
||||||
|
"debug",
|
||||||
"frequency_penalty",
|
"frequency_penalty",
|
||||||
"image_config",
|
"image_config",
|
||||||
"include",
|
"include",
|
||||||
|
|||||||
@@ -20,6 +20,7 @@ from .customtoolcallinputdoneevent import (
|
|||||||
CustomToolCallInputDoneEvent,
|
CustomToolCallInputDoneEvent,
|
||||||
CustomToolCallInputDoneEventTypedDict,
|
CustomToolCallInputDoneEventTypedDict,
|
||||||
)
|
)
|
||||||
|
from .debugevent import DebugEvent, DebugEventTypedDict
|
||||||
from .errorevent import ErrorEvent, ErrorEventTypedDict
|
from .errorevent import ErrorEvent, ErrorEventTypedDict
|
||||||
from .functioncallargsdeltaevent import (
|
from .functioncallargsdeltaevent import (
|
||||||
FunctionCallArgsDeltaEvent,
|
FunctionCallArgsDeltaEvent,
|
||||||
@@ -152,34 +153,35 @@ from typing_extensions import Annotated, TypeAliasType
|
|||||||
StreamEventsTypedDict = TypeAliasType(
|
StreamEventsTypedDict = TypeAliasType(
|
||||||
"StreamEventsTypedDict",
|
"StreamEventsTypedDict",
|
||||||
Union[
|
Union[
|
||||||
OpenResponsesCreatedEventTypedDict,
|
DebugEventTypedDict,
|
||||||
OpenResponsesInProgressEventTypedDict,
|
OpenResponsesInProgressEventTypedDict,
|
||||||
StreamEventsResponseCompletedTypedDict,
|
StreamEventsResponseCompletedTypedDict,
|
||||||
StreamEventsResponseIncompleteTypedDict,
|
StreamEventsResponseIncompleteTypedDict,
|
||||||
StreamEventsResponseFailedTypedDict,
|
StreamEventsResponseFailedTypedDict,
|
||||||
FusionCallInProgressEventTypedDict,
|
OpenResponsesCreatedEventTypedDict,
|
||||||
|
FusionCallCompletedEventTypedDict,
|
||||||
|
StreamEventsResponseOutputItemAddedTypedDict,
|
||||||
WebSearchCallCompletedEventTypedDict,
|
WebSearchCallCompletedEventTypedDict,
|
||||||
StreamEventsResponseOutputItemDoneTypedDict,
|
StreamEventsResponseOutputItemDoneTypedDict,
|
||||||
FusionCallCompletedEventTypedDict,
|
|
||||||
ImageGenCallInProgressEventTypedDict,
|
ImageGenCallInProgressEventTypedDict,
|
||||||
StreamEventsResponseOutputItemAddedTypedDict,
|
|
||||||
ImageGenCallCompletedEventTypedDict,
|
|
||||||
ImageGenCallGeneratingEventTypedDict,
|
ImageGenCallGeneratingEventTypedDict,
|
||||||
|
ImageGenCallCompletedEventTypedDict,
|
||||||
|
FusionCallInProgressEventTypedDict,
|
||||||
WebSearchCallInProgressEventTypedDict,
|
WebSearchCallInProgressEventTypedDict,
|
||||||
WebSearchCallSearchingEventTypedDict,
|
WebSearchCallSearchingEventTypedDict,
|
||||||
FusionCallAnalysisInProgressEventTypedDict,
|
FusionCallPanelAddedEventTypedDict,
|
||||||
CustomToolCallInputDoneEventTypedDict,
|
CustomToolCallInputDoneEventTypedDict,
|
||||||
CustomToolCallInputDeltaEventTypedDict,
|
CustomToolCallInputDeltaEventTypedDict,
|
||||||
FunctionCallArgsDeltaEventTypedDict,
|
|
||||||
ApplyPatchCallOperationDiffDeltaEventTypedDict,
|
ApplyPatchCallOperationDiffDeltaEventTypedDict,
|
||||||
ErrorEventTypedDict,
|
FunctionCallArgsDeltaEventTypedDict,
|
||||||
ApplyPatchCallOperationDiffDoneEventTypedDict,
|
ApplyPatchCallOperationDiffDoneEventTypedDict,
|
||||||
FusionCallPanelAddedEventTypedDict,
|
FusionCallAnalysisInProgressEventTypedDict,
|
||||||
FusionCallAnalysisCompletedEventTypedDict,
|
FusionCallAnalysisCompletedEventTypedDict,
|
||||||
ReasoningSummaryPartDoneEventTypedDict,
|
ErrorEventTypedDict,
|
||||||
RefusalDoneEventTypedDict,
|
|
||||||
ReasoningSummaryTextDoneEventTypedDict,
|
ReasoningSummaryTextDoneEventTypedDict,
|
||||||
|
RefusalDoneEventTypedDict,
|
||||||
ReasoningSummaryTextDeltaEventTypedDict,
|
ReasoningSummaryTextDeltaEventTypedDict,
|
||||||
|
ReasoningSummaryPartDoneEventTypedDict,
|
||||||
ReasoningSummaryPartAddedEventTypedDict,
|
ReasoningSummaryPartAddedEventTypedDict,
|
||||||
ReasoningDoneEventTypedDict,
|
ReasoningDoneEventTypedDict,
|
||||||
ReasoningDeltaEventTypedDict,
|
ReasoningDeltaEventTypedDict,
|
||||||
@@ -187,13 +189,13 @@ StreamEventsTypedDict = TypeAliasType(
|
|||||||
ContentPartAddedEventTypedDict,
|
ContentPartAddedEventTypedDict,
|
||||||
ImageGenCallPartialImageEventTypedDict,
|
ImageGenCallPartialImageEventTypedDict,
|
||||||
RefusalDeltaEventTypedDict,
|
RefusalDeltaEventTypedDict,
|
||||||
ContentPartDoneEventTypedDict,
|
|
||||||
FusionCallPanelDeltaEventTypedDict,
|
FusionCallPanelDeltaEventTypedDict,
|
||||||
FusionCallPanelReasoningDeltaEventTypedDict,
|
FusionCallPanelReasoningDeltaEventTypedDict,
|
||||||
FusionCallPanelCompletedEventTypedDict,
|
FusionCallPanelCompletedEventTypedDict,
|
||||||
FusionCallPanelFailedEventTypedDict,
|
ContentPartDoneEventTypedDict,
|
||||||
TextDeltaEventTypedDict,
|
|
||||||
TextDoneEventTypedDict,
|
TextDoneEventTypedDict,
|
||||||
|
TextDeltaEventTypedDict,
|
||||||
|
FusionCallPanelFailedEventTypedDict,
|
||||||
AnnotationAddedEventTypedDict,
|
AnnotationAddedEventTypedDict,
|
||||||
],
|
],
|
||||||
)
|
)
|
||||||
@@ -221,6 +223,7 @@ StreamEvents = Annotated[
|
|||||||
Annotated[
|
Annotated[
|
||||||
CustomToolCallInputDoneEvent, Tag("response.custom_tool_call_input.done")
|
CustomToolCallInputDoneEvent, Tag("response.custom_tool_call_input.done")
|
||||||
],
|
],
|
||||||
|
Annotated[DebugEvent, Tag("response.debug")],
|
||||||
Annotated[StreamEventsResponseFailed, Tag("response.failed")],
|
Annotated[StreamEventsResponseFailed, Tag("response.failed")],
|
||||||
Annotated[
|
Annotated[
|
||||||
FunctionCallArgsDeltaEvent, Tag("response.function_call_arguments.delta")
|
FunctionCallArgsDeltaEvent, Tag("response.function_call_arguments.delta")
|
||||||
|
|||||||
@@ -10,6 +10,7 @@ from typing_extensions import Annotated, NotRequired, TypedDict
|
|||||||
|
|
||||||
SubagentReasoningEffort = Union[
|
SubagentReasoningEffort = Union[
|
||||||
Literal[
|
Literal[
|
||||||
|
"max",
|
||||||
"xhigh",
|
"xhigh",
|
||||||
"high",
|
"high",
|
||||||
"medium",
|
"medium",
|
||||||
|
|||||||
@@ -0,0 +1,55 @@
|
|||||||
|
"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
|
||||||
|
|
||||||
|
from __future__ import annotations
|
||||||
|
from .taskclassificationmodel import (
|
||||||
|
TaskClassificationModel,
|
||||||
|
TaskClassificationModelTypedDict,
|
||||||
|
)
|
||||||
|
from openrouter.types import BaseModel
|
||||||
|
from typing import List
|
||||||
|
from typing_extensions import TypedDict
|
||||||
|
|
||||||
|
|
||||||
|
class TaskClassificationItemTypedDict(TypedDict):
|
||||||
|
category_token_share: float
|
||||||
|
r"""Fraction of this classification's token volume within its macro-category (0–1). Sums to 1 across all classifications sharing the same `macro_category`."""
|
||||||
|
category_usage_share: float
|
||||||
|
r"""Fraction of this classification's usage within its macro-category (0–1). Sums to 1 across all classifications sharing the same `macro_category`."""
|
||||||
|
display_name: str
|
||||||
|
r"""Human-readable label for the classification."""
|
||||||
|
macro_category: str
|
||||||
|
r"""Coarse grouping derived from the tag prefix: `code`, `data`, `agent`, or `general`."""
|
||||||
|
models: List[TaskClassificationModelTypedDict]
|
||||||
|
r"""Top models for this classification by request volume, sorted descending. Each entry reports the model's share of this classification's requests and tokens."""
|
||||||
|
tag: str
|
||||||
|
r"""Classification tag identifier (e.g. `code:general_impl`, `agent:web_search`)."""
|
||||||
|
token_share: float
|
||||||
|
r"""Fraction of classified sampled token volume (prompt + completion) attributed to this classification (0–1). The unclassified `other` bucket is excluded from the denominator."""
|
||||||
|
usage_share: float
|
||||||
|
r"""Fraction of classified sampled requests attributed to this classification (0–1). The unclassified `other` bucket is excluded from the denominator."""
|
||||||
|
|
||||||
|
|
||||||
|
class TaskClassificationItem(BaseModel):
|
||||||
|
category_token_share: float
|
||||||
|
r"""Fraction of this classification's token volume within its macro-category (0–1). Sums to 1 across all classifications sharing the same `macro_category`."""
|
||||||
|
|
||||||
|
category_usage_share: float
|
||||||
|
r"""Fraction of this classification's usage within its macro-category (0–1). Sums to 1 across all classifications sharing the same `macro_category`."""
|
||||||
|
|
||||||
|
display_name: str
|
||||||
|
r"""Human-readable label for the classification."""
|
||||||
|
|
||||||
|
macro_category: str
|
||||||
|
r"""Coarse grouping derived from the tag prefix: `code`, `data`, `agent`, or `general`."""
|
||||||
|
|
||||||
|
models: List[TaskClassificationModel]
|
||||||
|
r"""Top models for this classification by request volume, sorted descending. Each entry reports the model's share of this classification's requests and tokens."""
|
||||||
|
|
||||||
|
tag: str
|
||||||
|
r"""Classification tag identifier (e.g. `code:general_impl`, `agent:web_search`)."""
|
||||||
|
|
||||||
|
token_share: float
|
||||||
|
r"""Fraction of classified sampled token volume (prompt + completion) attributed to this classification (0–1). The unclassified `other` bucket is excluded from the denominator."""
|
||||||
|
|
||||||
|
usage_share: float
|
||||||
|
r"""Fraction of classified sampled requests attributed to this classification (0–1). The unclassified `other` bucket is excluded from the denominator."""
|
||||||
@@ -0,0 +1,30 @@
|
|||||||
|
"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
|
||||||
|
|
||||||
|
from __future__ import annotations
|
||||||
|
from openrouter.types import BaseModel
|
||||||
|
from typing_extensions import TypedDict
|
||||||
|
|
||||||
|
|
||||||
|
class TaskClassificationMacroCategoryTypedDict(TypedDict):
|
||||||
|
key: str
|
||||||
|
r"""Macro-category identifier."""
|
||||||
|
label: str
|
||||||
|
r"""Human-readable label for the macro-category."""
|
||||||
|
token_share: float
|
||||||
|
r"""Combined token share of all classifications in this macro-category (0–1)."""
|
||||||
|
usage_share: float
|
||||||
|
r"""Combined usage share of all classifications in this macro-category (0–1)."""
|
||||||
|
|
||||||
|
|
||||||
|
class TaskClassificationMacroCategory(BaseModel):
|
||||||
|
key: str
|
||||||
|
r"""Macro-category identifier."""
|
||||||
|
|
||||||
|
label: str
|
||||||
|
r"""Human-readable label for the macro-category."""
|
||||||
|
|
||||||
|
token_share: float
|
||||||
|
r"""Combined token share of all classifications in this macro-category (0–1)."""
|
||||||
|
|
||||||
|
usage_share: float
|
||||||
|
r"""Combined usage share of all classifications in this macro-category (0–1)."""
|
||||||
@@ -0,0 +1,25 @@
|
|||||||
|
"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
|
||||||
|
|
||||||
|
from __future__ import annotations
|
||||||
|
from openrouter.types import BaseModel
|
||||||
|
from typing_extensions import TypedDict
|
||||||
|
|
||||||
|
|
||||||
|
class TaskClassificationModelTypedDict(TypedDict):
|
||||||
|
id: str
|
||||||
|
r"""Model identifier (permaslug)."""
|
||||||
|
tag_token_share: float
|
||||||
|
r"""Fraction of this classification's sampled token volume attributed to this model (0–1). Sums to ≤1 across the returned models (only top-N are included and unattributed requests are excluded)."""
|
||||||
|
tag_usage_share: float
|
||||||
|
r"""Fraction of this classification's sampled requests attributed to this model (0–1). Sums to ≤1 across the returned models (only top-N are included and unattributed requests are excluded)."""
|
||||||
|
|
||||||
|
|
||||||
|
class TaskClassificationModel(BaseModel):
|
||||||
|
id: str
|
||||||
|
r"""Model identifier (permaslug)."""
|
||||||
|
|
||||||
|
tag_token_share: float
|
||||||
|
r"""Fraction of this classification's sampled token volume attributed to this model (0–1). Sums to ≤1 across the returned models (only top-N are included and unattributed requests are excluded)."""
|
||||||
|
|
||||||
|
tag_usage_share: float
|
||||||
|
r"""Fraction of this classification's sampled requests attributed to this model (0–1). Sums to ≤1 across the returned models (only top-N are included and unattributed requests are excluded)."""
|
||||||
@@ -0,0 +1,47 @@
|
|||||||
|
"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
|
||||||
|
|
||||||
|
from __future__ import annotations
|
||||||
|
from .taskclassificationitem import (
|
||||||
|
TaskClassificationItem,
|
||||||
|
TaskClassificationItemTypedDict,
|
||||||
|
)
|
||||||
|
from .taskclassificationmacrocategory import (
|
||||||
|
TaskClassificationMacroCategory,
|
||||||
|
TaskClassificationMacroCategoryTypedDict,
|
||||||
|
)
|
||||||
|
from openrouter.types import BaseModel
|
||||||
|
from typing import List
|
||||||
|
from typing_extensions import TypedDict
|
||||||
|
|
||||||
|
|
||||||
|
class TaskClassificationResponseDataTypedDict(TypedDict):
|
||||||
|
as_of: str
|
||||||
|
r"""UTC date (YYYY-MM-DD) of the window upper bound (yesterday). Data is exclusive of the current incomplete UTC day. This is the expected latest date in the snapshot; it does not confirm data presence for that date."""
|
||||||
|
classifications: List[TaskClassificationItemTypedDict]
|
||||||
|
r"""Per-task classification market-share data, sorted by usage_share descending."""
|
||||||
|
macro_categories: List[TaskClassificationMacroCategoryTypedDict]
|
||||||
|
r"""Aggregate market-share data per macro-category (code, data, agent, general)."""
|
||||||
|
window_days: int
|
||||||
|
r"""Number of trailing days covered by this snapshot."""
|
||||||
|
|
||||||
|
|
||||||
|
class TaskClassificationResponseData(BaseModel):
|
||||||
|
as_of: str
|
||||||
|
r"""UTC date (YYYY-MM-DD) of the window upper bound (yesterday). Data is exclusive of the current incomplete UTC day. This is the expected latest date in the snapshot; it does not confirm data presence for that date."""
|
||||||
|
|
||||||
|
classifications: List[TaskClassificationItem]
|
||||||
|
r"""Per-task classification market-share data, sorted by usage_share descending."""
|
||||||
|
|
||||||
|
macro_categories: List[TaskClassificationMacroCategory]
|
||||||
|
r"""Aggregate market-share data per macro-category (code, data, agent, general)."""
|
||||||
|
|
||||||
|
window_days: int
|
||||||
|
r"""Number of trailing days covered by this snapshot."""
|
||||||
|
|
||||||
|
|
||||||
|
class TaskClassificationResponseTypedDict(TypedDict):
|
||||||
|
data: TaskClassificationResponseDataTypedDict
|
||||||
|
|
||||||
|
|
||||||
|
class TaskClassificationResponse(BaseModel):
|
||||||
|
data: TaskClassificationResponseData
|
||||||
@@ -16,7 +16,7 @@ UnifiedBenchmarksMetaSource = Union[
|
|||||||
],
|
],
|
||||||
UnrecognizedStr,
|
UnrecognizedStr,
|
||||||
]
|
]
|
||||||
r"""The source filter applied."""
|
r"""The source filter applied, or null when all sources are returned."""
|
||||||
|
|
||||||
|
|
||||||
UnifiedBenchmarksMetaVersion = Literal["v1",]
|
UnifiedBenchmarksMetaVersion = Literal["v1",]
|
||||||
@@ -26,14 +26,14 @@ r"""Dataset version."""
|
|||||||
class UnifiedBenchmarksMetaTypedDict(TypedDict):
|
class UnifiedBenchmarksMetaTypedDict(TypedDict):
|
||||||
as_of: str
|
as_of: str
|
||||||
r"""ISO-8601 timestamp of when this data was last updated."""
|
r"""ISO-8601 timestamp of when this data was last updated."""
|
||||||
citation: str
|
citation: Nullable[str]
|
||||||
r"""Required attribution when republishing this data."""
|
r"""Required attribution when republishing this data, or null when results span multiple sources (attribute each item individually by its `source` discriminator)."""
|
||||||
model_count: int
|
model_count: int
|
||||||
r"""Number of unique models in the response."""
|
r"""Number of unique models in the response."""
|
||||||
source: UnifiedBenchmarksMetaSource
|
source: Nullable[UnifiedBenchmarksMetaSource]
|
||||||
r"""The source filter applied."""
|
r"""The source filter applied, or null when all sources are returned."""
|
||||||
source_url: str
|
source_url: Nullable[str]
|
||||||
r"""URL of the upstream data source."""
|
r"""URL of the upstream data source, or null when results span multiple sources."""
|
||||||
task_type: Nullable[str]
|
task_type: Nullable[str]
|
||||||
r"""The task_type filter applied, or null if showing all."""
|
r"""The task_type filter applied, or null if showing all."""
|
||||||
version: UnifiedBenchmarksMetaVersion
|
version: UnifiedBenchmarksMetaVersion
|
||||||
@@ -44,19 +44,19 @@ class UnifiedBenchmarksMeta(BaseModel):
|
|||||||
as_of: str
|
as_of: str
|
||||||
r"""ISO-8601 timestamp of when this data was last updated."""
|
r"""ISO-8601 timestamp of when this data was last updated."""
|
||||||
|
|
||||||
citation: str
|
citation: Nullable[str]
|
||||||
r"""Required attribution when republishing this data."""
|
r"""Required attribution when republishing this data, or null when results span multiple sources (attribute each item individually by its `source` discriminator)."""
|
||||||
|
|
||||||
model_count: int
|
model_count: int
|
||||||
r"""Number of unique models in the response."""
|
r"""Number of unique models in the response."""
|
||||||
|
|
||||||
source: Annotated[
|
source: Annotated[
|
||||||
UnifiedBenchmarksMetaSource, PlainValidator(validate_open_enum(False))
|
Nullable[UnifiedBenchmarksMetaSource], PlainValidator(validate_open_enum(False))
|
||||||
]
|
]
|
||||||
r"""The source filter applied."""
|
r"""The source filter applied, or null when all sources are returned."""
|
||||||
|
|
||||||
source_url: str
|
source_url: Nullable[str]
|
||||||
r"""URL of the upstream data source."""
|
r"""URL of the upstream data source, or null when results span multiple sources."""
|
||||||
|
|
||||||
task_type: Nullable[str]
|
task_type: Nullable[str]
|
||||||
r"""The task_type filter applied, or null if showing all."""
|
r"""The task_type filter applied, or null if showing all."""
|
||||||
@@ -67,7 +67,7 @@ class UnifiedBenchmarksMeta(BaseModel):
|
|||||||
@model_serializer(mode="wrap")
|
@model_serializer(mode="wrap")
|
||||||
def serialize_model(self, handler):
|
def serialize_model(self, handler):
|
||||||
optional_fields = []
|
optional_fields = []
|
||||||
nullable_fields = ["task_type"]
|
nullable_fields = ["citation", "source", "source_url", "task_type"]
|
||||||
null_default_fields = []
|
null_default_fields = []
|
||||||
|
|
||||||
serialized = handler(self)
|
serialized = handler(self)
|
||||||
|
|||||||
@@ -17,13 +17,13 @@ from typing import List, Union
|
|||||||
from typing_extensions import Annotated, TypeAliasType, TypedDict
|
from typing_extensions import Annotated, TypeAliasType, TypedDict
|
||||||
|
|
||||||
|
|
||||||
DataTypedDict = TypeAliasType(
|
UnifiedBenchmarksResponseDataTypedDict = TypeAliasType(
|
||||||
"DataTypedDict",
|
"UnifiedBenchmarksResponseDataTypedDict",
|
||||||
Union[UnifiedBenchmarksAAItemTypedDict, UnifiedBenchmarksDAItemTypedDict],
|
Union[UnifiedBenchmarksAAItemTypedDict, UnifiedBenchmarksDAItemTypedDict],
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
Data = Annotated[
|
UnifiedBenchmarksResponseData = Annotated[
|
||||||
Union[
|
Union[
|
||||||
Annotated[UnifiedBenchmarksAAItem, Tag("artificial-analysis")],
|
Annotated[UnifiedBenchmarksAAItem, Tag("artificial-analysis")],
|
||||||
Annotated[UnifiedBenchmarksDAItem, Tag("design-arena")],
|
Annotated[UnifiedBenchmarksDAItem, Tag("design-arena")],
|
||||||
@@ -33,11 +33,11 @@ Data = Annotated[
|
|||||||
|
|
||||||
|
|
||||||
class UnifiedBenchmarksResponseTypedDict(TypedDict):
|
class UnifiedBenchmarksResponseTypedDict(TypedDict):
|
||||||
data: List[DataTypedDict]
|
data: List[UnifiedBenchmarksResponseDataTypedDict]
|
||||||
meta: UnifiedBenchmarksMetaTypedDict
|
meta: UnifiedBenchmarksMetaTypedDict
|
||||||
|
|
||||||
|
|
||||||
class UnifiedBenchmarksResponse(BaseModel):
|
class UnifiedBenchmarksResponse(BaseModel):
|
||||||
data: List[Data]
|
data: List[UnifiedBenchmarksResponseData]
|
||||||
|
|
||||||
meta: UnifiedBenchmarksMeta
|
meta: UnifiedBenchmarksMeta
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ from typing import Any, Dict, List, Literal, Optional, Union
|
|||||||
from typing_extensions import Annotated, NotRequired, TypedDict
|
from typing_extensions import Annotated, NotRequired, TypedDict
|
||||||
|
|
||||||
|
|
||||||
AspectRatio = Union[
|
VideoGenerationRequestAspectRatio = Union[
|
||||||
Literal[
|
Literal[
|
||||||
"16:9",
|
"16:9",
|
||||||
"9:16",
|
"9:16",
|
||||||
@@ -28,7 +28,7 @@ AspectRatio = Union[
|
|||||||
r"""Aspect ratio of the generated video"""
|
r"""Aspect ratio of the generated video"""
|
||||||
|
|
||||||
|
|
||||||
class OptionsTypedDict(TypedDict):
|
class VideoGenerationRequestOptionsTypedDict(TypedDict):
|
||||||
r"""Provider-specific options keyed by provider slug. Only options for the matched provider are forwarded; the rest are ignored. Unrecognized keys are silently dropped."""
|
r"""Provider-specific options keyed by provider slug. Only options for the matched provider are forwarded; the rest are ignored. Unrecognized keys are silently dropped."""
|
||||||
|
|
||||||
oneai: NotRequired[Dict[str, Nullable[Any]]]
|
oneai: NotRequired[Dict[str, Nullable[Any]]]
|
||||||
@@ -76,11 +76,13 @@ class OptionsTypedDict(TypedDict):
|
|||||||
google_vertex: NotRequired[Dict[str, Nullable[Any]]]
|
google_vertex: NotRequired[Dict[str, Nullable[Any]]]
|
||||||
gopomelo: NotRequired[Dict[str, Nullable[Any]]]
|
gopomelo: NotRequired[Dict[str, Nullable[Any]]]
|
||||||
groq: NotRequired[Dict[str, Nullable[Any]]]
|
groq: NotRequired[Dict[str, Nullable[Any]]]
|
||||||
|
heygen: NotRequired[Dict[str, Nullable[Any]]]
|
||||||
huggingface: NotRequired[Dict[str, Nullable[Any]]]
|
huggingface: NotRequired[Dict[str, Nullable[Any]]]
|
||||||
hyperbolic: NotRequired[Dict[str, Nullable[Any]]]
|
hyperbolic: NotRequired[Dict[str, Nullable[Any]]]
|
||||||
hyperbolic_quantized: NotRequired[Dict[str, Nullable[Any]]]
|
hyperbolic_quantized: NotRequired[Dict[str, Nullable[Any]]]
|
||||||
inception: NotRequired[Dict[str, Nullable[Any]]]
|
inception: NotRequired[Dict[str, Nullable[Any]]]
|
||||||
inceptron: NotRequired[Dict[str, Nullable[Any]]]
|
inceptron: NotRequired[Dict[str, Nullable[Any]]]
|
||||||
|
inferact_vllm: NotRequired[Dict[str, Nullable[Any]]]
|
||||||
inference_net: NotRequired[Dict[str, Nullable[Any]]]
|
inference_net: NotRequired[Dict[str, Nullable[Any]]]
|
||||||
infermatic: NotRequired[Dict[str, Nullable[Any]]]
|
infermatic: NotRequired[Dict[str, Nullable[Any]]]
|
||||||
inflection: NotRequired[Dict[str, Nullable[Any]]]
|
inflection: NotRequired[Dict[str, Nullable[Any]]]
|
||||||
@@ -119,12 +121,14 @@ class OptionsTypedDict(TypedDict):
|
|||||||
perplexity: NotRequired[Dict[str, Nullable[Any]]]
|
perplexity: NotRequired[Dict[str, Nullable[Any]]]
|
||||||
phala: NotRequired[Dict[str, Nullable[Any]]]
|
phala: NotRequired[Dict[str, Nullable[Any]]]
|
||||||
poolside: NotRequired[Dict[str, Nullable[Any]]]
|
poolside: NotRequired[Dict[str, Nullable[Any]]]
|
||||||
|
quiver: NotRequired[Dict[str, Nullable[Any]]]
|
||||||
recraft: NotRequired[Dict[str, Nullable[Any]]]
|
recraft: NotRequired[Dict[str, Nullable[Any]]]
|
||||||
recursal: NotRequired[Dict[str, Nullable[Any]]]
|
recursal: NotRequired[Dict[str, Nullable[Any]]]
|
||||||
reflection: NotRequired[Dict[str, Nullable[Any]]]
|
reflection: NotRequired[Dict[str, Nullable[Any]]]
|
||||||
reka: NotRequired[Dict[str, Nullable[Any]]]
|
reka: NotRequired[Dict[str, Nullable[Any]]]
|
||||||
relace: NotRequired[Dict[str, Nullable[Any]]]
|
relace: NotRequired[Dict[str, Nullable[Any]]]
|
||||||
replicate: NotRequired[Dict[str, Nullable[Any]]]
|
replicate: NotRequired[Dict[str, Nullable[Any]]]
|
||||||
|
sakana_ai: NotRequired[Dict[str, Nullable[Any]]]
|
||||||
sambanova: NotRequired[Dict[str, Nullable[Any]]]
|
sambanova: NotRequired[Dict[str, Nullable[Any]]]
|
||||||
sambanova_cloaked: NotRequired[Dict[str, Nullable[Any]]]
|
sambanova_cloaked: NotRequired[Dict[str, Nullable[Any]]]
|
||||||
seed: NotRequired[Dict[str, Nullable[Any]]]
|
seed: NotRequired[Dict[str, Nullable[Any]]]
|
||||||
@@ -136,6 +140,7 @@ class OptionsTypedDict(TypedDict):
|
|||||||
streamlake: NotRequired[Dict[str, Nullable[Any]]]
|
streamlake: NotRequired[Dict[str, Nullable[Any]]]
|
||||||
switchpoint: NotRequired[Dict[str, Nullable[Any]]]
|
switchpoint: NotRequired[Dict[str, Nullable[Any]]]
|
||||||
targon: NotRequired[Dict[str, Nullable[Any]]]
|
targon: NotRequired[Dict[str, Nullable[Any]]]
|
||||||
|
tenstorrent: NotRequired[Dict[str, Nullable[Any]]]
|
||||||
together: NotRequired[Dict[str, Nullable[Any]]]
|
together: NotRequired[Dict[str, Nullable[Any]]]
|
||||||
together_lite: NotRequired[Dict[str, Nullable[Any]]]
|
together_lite: NotRequired[Dict[str, Nullable[Any]]]
|
||||||
ubicloud: NotRequired[Dict[str, Nullable[Any]]]
|
ubicloud: NotRequired[Dict[str, Nullable[Any]]]
|
||||||
@@ -148,7 +153,7 @@ class OptionsTypedDict(TypedDict):
|
|||||||
z_ai: NotRequired[Dict[str, Nullable[Any]]]
|
z_ai: NotRequired[Dict[str, Nullable[Any]]]
|
||||||
|
|
||||||
|
|
||||||
class Options(BaseModel):
|
class VideoGenerationRequestOptions(BaseModel):
|
||||||
r"""Provider-specific options keyed by provider slug. Only options for the matched provider are forwarded; the rest are ignored. Unrecognized keys are silently dropped."""
|
r"""Provider-specific options keyed by provider slug. Only options for the matched provider are forwarded; the rest are ignored. Unrecognized keys are silently dropped."""
|
||||||
|
|
||||||
oneai: Annotated[
|
oneai: Annotated[
|
||||||
@@ -261,6 +266,8 @@ class Options(BaseModel):
|
|||||||
|
|
||||||
groq: Optional[Dict[str, Nullable[Any]]] = None
|
groq: Optional[Dict[str, Nullable[Any]]] = None
|
||||||
|
|
||||||
|
heygen: Optional[Dict[str, Nullable[Any]]] = None
|
||||||
|
|
||||||
huggingface: Optional[Dict[str, Nullable[Any]]] = None
|
huggingface: Optional[Dict[str, Nullable[Any]]] = None
|
||||||
|
|
||||||
hyperbolic: Optional[Dict[str, Nullable[Any]]] = None
|
hyperbolic: Optional[Dict[str, Nullable[Any]]] = None
|
||||||
@@ -273,6 +280,10 @@ class Options(BaseModel):
|
|||||||
|
|
||||||
inceptron: Optional[Dict[str, Nullable[Any]]] = None
|
inceptron: Optional[Dict[str, Nullable[Any]]] = None
|
||||||
|
|
||||||
|
inferact_vllm: Annotated[
|
||||||
|
Optional[Dict[str, Nullable[Any]]], pydantic.Field(alias="inferact-vllm")
|
||||||
|
] = None
|
||||||
|
|
||||||
inference_net: Annotated[
|
inference_net: Annotated[
|
||||||
Optional[Dict[str, Nullable[Any]]], pydantic.Field(alias="inference-net")
|
Optional[Dict[str, Nullable[Any]]], pydantic.Field(alias="inference-net")
|
||||||
] = None
|
] = None
|
||||||
@@ -363,6 +374,8 @@ class Options(BaseModel):
|
|||||||
|
|
||||||
poolside: Optional[Dict[str, Nullable[Any]]] = None
|
poolside: Optional[Dict[str, Nullable[Any]]] = None
|
||||||
|
|
||||||
|
quiver: Optional[Dict[str, Nullable[Any]]] = None
|
||||||
|
|
||||||
recraft: Optional[Dict[str, Nullable[Any]]] = None
|
recraft: Optional[Dict[str, Nullable[Any]]] = None
|
||||||
|
|
||||||
recursal: Optional[Dict[str, Nullable[Any]]] = None
|
recursal: Optional[Dict[str, Nullable[Any]]] = None
|
||||||
@@ -375,6 +388,10 @@ class Options(BaseModel):
|
|||||||
|
|
||||||
replicate: Optional[Dict[str, Nullable[Any]]] = None
|
replicate: Optional[Dict[str, Nullable[Any]]] = None
|
||||||
|
|
||||||
|
sakana_ai: Annotated[
|
||||||
|
Optional[Dict[str, Nullable[Any]]], pydantic.Field(alias="sakana-ai")
|
||||||
|
] = None
|
||||||
|
|
||||||
sambanova: Optional[Dict[str, Nullable[Any]]] = None
|
sambanova: Optional[Dict[str, Nullable[Any]]] = None
|
||||||
|
|
||||||
sambanova_cloaked: Annotated[
|
sambanova_cloaked: Annotated[
|
||||||
@@ -401,6 +418,8 @@ class Options(BaseModel):
|
|||||||
|
|
||||||
targon: Optional[Dict[str, Nullable[Any]]] = None
|
targon: Optional[Dict[str, Nullable[Any]]] = None
|
||||||
|
|
||||||
|
tenstorrent: Optional[Dict[str, Nullable[Any]]] = None
|
||||||
|
|
||||||
together: Optional[Dict[str, Nullable[Any]]] = None
|
together: Optional[Dict[str, Nullable[Any]]] = None
|
||||||
|
|
||||||
together_lite: Annotated[
|
together_lite: Annotated[
|
||||||
@@ -429,16 +448,16 @@ class Options(BaseModel):
|
|||||||
class VideoGenerationRequestProviderTypedDict(TypedDict):
|
class VideoGenerationRequestProviderTypedDict(TypedDict):
|
||||||
r"""Provider-specific passthrough configuration"""
|
r"""Provider-specific passthrough configuration"""
|
||||||
|
|
||||||
options: NotRequired[OptionsTypedDict]
|
options: NotRequired[VideoGenerationRequestOptionsTypedDict]
|
||||||
|
|
||||||
|
|
||||||
class VideoGenerationRequestProvider(BaseModel):
|
class VideoGenerationRequestProvider(BaseModel):
|
||||||
r"""Provider-specific passthrough configuration"""
|
r"""Provider-specific passthrough configuration"""
|
||||||
|
|
||||||
options: Optional[Options] = None
|
options: Optional[VideoGenerationRequestOptions] = None
|
||||||
|
|
||||||
|
|
||||||
Resolution = Union[
|
VideoGenerationRequestResolution = Union[
|
||||||
Literal[
|
Literal[
|
||||||
"480p",
|
"480p",
|
||||||
"720p",
|
"720p",
|
||||||
@@ -455,7 +474,7 @@ r"""Resolution of the generated video"""
|
|||||||
class VideoGenerationRequestTypedDict(TypedDict):
|
class VideoGenerationRequestTypedDict(TypedDict):
|
||||||
model: str
|
model: str
|
||||||
prompt: str
|
prompt: str
|
||||||
aspect_ratio: NotRequired[AspectRatio]
|
aspect_ratio: NotRequired[VideoGenerationRequestAspectRatio]
|
||||||
r"""Aspect ratio of the generated video"""
|
r"""Aspect ratio of the generated video"""
|
||||||
callback_url: NotRequired[str]
|
callback_url: NotRequired[str]
|
||||||
r"""URL to receive a webhook notification when the video generation job completes. Overrides the workspace-level default callback URL if set. Must be HTTPS."""
|
r"""URL to receive a webhook notification when the video generation job completes. Overrides the workspace-level default callback URL if set. Must be HTTPS."""
|
||||||
@@ -469,7 +488,7 @@ class VideoGenerationRequestTypedDict(TypedDict):
|
|||||||
r"""Reference assets to guide video generation. Accepts image, audio, and video references. Audio and video references are only honored by providers that support them (currently BytePlus Seedance 2.0); other providers use image references and ignore the rest."""
|
r"""Reference assets to guide video generation. Accepts image, audio, and video references. Audio and video references are only honored by providers that support them (currently BytePlus Seedance 2.0); other providers use image references and ignore the rest."""
|
||||||
provider: NotRequired[VideoGenerationRequestProviderTypedDict]
|
provider: NotRequired[VideoGenerationRequestProviderTypedDict]
|
||||||
r"""Provider-specific passthrough configuration"""
|
r"""Provider-specific passthrough configuration"""
|
||||||
resolution: NotRequired[Resolution]
|
resolution: NotRequired[VideoGenerationRequestResolution]
|
||||||
r"""Resolution of the generated video"""
|
r"""Resolution of the generated video"""
|
||||||
seed: NotRequired[int]
|
seed: NotRequired[int]
|
||||||
r"""If specified, the generation will sample deterministically, such that repeated requests with the same seed and parameters should return the same result. Determinism is not guaranteed for all providers."""
|
r"""If specified, the generation will sample deterministically, such that repeated requests with the same seed and parameters should return the same result. Determinism is not guaranteed for all providers."""
|
||||||
@@ -483,7 +502,8 @@ class VideoGenerationRequest(BaseModel):
|
|||||||
prompt: str
|
prompt: str
|
||||||
|
|
||||||
aspect_ratio: Annotated[
|
aspect_ratio: Annotated[
|
||||||
Optional[AspectRatio], PlainValidator(validate_open_enum(False))
|
Optional[VideoGenerationRequestAspectRatio],
|
||||||
|
PlainValidator(validate_open_enum(False)),
|
||||||
] = None
|
] = None
|
||||||
r"""Aspect ratio of the generated video"""
|
r"""Aspect ratio of the generated video"""
|
||||||
|
|
||||||
@@ -506,7 +526,8 @@ class VideoGenerationRequest(BaseModel):
|
|||||||
r"""Provider-specific passthrough configuration"""
|
r"""Provider-specific passthrough configuration"""
|
||||||
|
|
||||||
resolution: Annotated[
|
resolution: Annotated[
|
||||||
Optional[Resolution], PlainValidator(validate_open_enum(False))
|
Optional[VideoGenerationRequestResolution],
|
||||||
|
PlainValidator(validate_open_enum(False)),
|
||||||
] = None
|
] = None
|
||||||
r"""Resolution of the generated video"""
|
r"""Resolution of the generated video"""
|
||||||
|
|
||||||
|
|||||||
@@ -1275,7 +1275,7 @@ class Guardrails(BaseSDK):
|
|||||||
) -> components.UpdateGuardrailResponse:
|
) -> components.UpdateGuardrailResponse:
|
||||||
r"""Update a guardrail
|
r"""Update a guardrail
|
||||||
|
|
||||||
Update an existing guardrail. [Management key](/docs/guides/overview/auth/management-api-keys) required.
|
Update an existing guardrail. Collection fields use replace semantics: send the full desired set on every update. [Management key](/docs/guides/overview/auth/management-api-keys) required.
|
||||||
|
|
||||||
:param id: The unique identifier of the guardrail to update
|
:param id: The unique identifier of the guardrail to update
|
||||||
:param http_referer: The app identifier should be your app's URL and is used as the primary identifier for rankings.
|
:param http_referer: The app identifier should be your app's URL and is used as the primary identifier for rankings.
|
||||||
@@ -1476,7 +1476,7 @@ class Guardrails(BaseSDK):
|
|||||||
) -> components.UpdateGuardrailResponse:
|
) -> components.UpdateGuardrailResponse:
|
||||||
r"""Update a guardrail
|
r"""Update a guardrail
|
||||||
|
|
||||||
Update an existing guardrail. [Management key](/docs/guides/overview/auth/management-api-keys) required.
|
Update an existing guardrail. Collection fields use replace semantics: send the full desired set on every update. [Management key](/docs/guides/overview/auth/management-api-keys) required.
|
||||||
|
|
||||||
:param id: The unique identifier of the guardrail to update
|
:param id: The unique identifier of the guardrail to update
|
||||||
:param http_referer: The app identifier should be your app's URL and is used as the primary identifier for rankings.
|
:param http_referer: The app identifier should be your app's URL and is used as the primary identifier for rankings.
|
||||||
@@ -1982,7 +1982,7 @@ class Guardrails(BaseSDK):
|
|||||||
) -> components.BulkAssignKeysResponse:
|
) -> components.BulkAssignKeysResponse:
|
||||||
r"""Bulk assign keys to a guardrail
|
r"""Bulk assign keys to a guardrail
|
||||||
|
|
||||||
Assign multiple API keys to a specific guardrail. [Management key](/docs/guides/overview/auth/management-api-keys) required.
|
Assign multiple API keys to a specific guardrail. A key may hold at most one guardrail; assigning replaces any existing assignment. [Management key](/docs/guides/overview/auth/management-api-keys) required.
|
||||||
|
|
||||||
:param id: The unique identifier of the guardrail
|
:param id: The unique identifier of the guardrail
|
||||||
:param key_hashes: Array of API key hashes to assign to the guardrail
|
:param key_hashes: Array of API key hashes to assign to the guardrail
|
||||||
@@ -2125,7 +2125,7 @@ class Guardrails(BaseSDK):
|
|||||||
) -> components.BulkAssignKeysResponse:
|
) -> components.BulkAssignKeysResponse:
|
||||||
r"""Bulk assign keys to a guardrail
|
r"""Bulk assign keys to a guardrail
|
||||||
|
|
||||||
Assign multiple API keys to a specific guardrail. [Management key](/docs/guides/overview/auth/management-api-keys) required.
|
Assign multiple API keys to a specific guardrail. A key may hold at most one guardrail; assigning replaces any existing assignment. [Management key](/docs/guides/overview/auth/management-api-keys) required.
|
||||||
|
|
||||||
:param id: The unique identifier of the guardrail
|
:param id: The unique identifier of the guardrail
|
||||||
:param key_hashes: Array of API key hashes to assign to the guardrail
|
:param key_hashes: Array of API key hashes to assign to the guardrail
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
@@ -298,7 +298,7 @@ class Models(BaseSDK):
|
|||||||
:param category: Filter models by use case category
|
:param category: Filter models by use case category
|
||||||
:param supported_parameters: Filter models by supported parameter (comma-separated)
|
:param supported_parameters: Filter models by supported parameter (comma-separated)
|
||||||
:param output_modalities: Filter models by output modality. Accepts a comma-separated list of modalities (text, image, audio, embeddings) or \"all\" to include all models. Defaults to \"text\".
|
:param output_modalities: Filter models by output modality. Accepts a comma-separated list of modalities (text, image, audio, embeddings) or \"all\" to include all models. Defaults to \"text\".
|
||||||
:param sort: Sort the returned models server-side. Prefer this over fetching the full list and sorting client-side. Options: pricing-low-to-high, pricing-high-to-low (average prompt/completion price), context-high-to-low (context length), throughput-high-to-low, latency-low-to-high (recent median performance), most-popular, top-weekly (tokens processed in the last week), newest (creation date). When omitted, the existing default ordering is preserved.
|
:param sort: Sort the returned models server-side. Prefer this over fetching the full list and sorting client-side. Options: pricing-low-to-high, pricing-high-to-low (average prompt/completion price), context-high-to-low (context length), throughput-high-to-low, latency-low-to-high (recent median performance), most-popular, top-weekly (tokens processed in the last week), newest (creation date), intelligence-high-to-low (Artificial Analysis intelligence index), design-arena-elo-high-to-low (best Design Arena ELO across arenas). Models without a score for the chosen benchmark are placed last. When omitted, the existing default ordering is preserved.
|
||||||
:param q: Free-text search by model name or slug.
|
:param q: Free-text search by model name or slug.
|
||||||
:param input_modalities: Filter models by input modality. Comma-separated list of: text, image, audio, file.
|
:param input_modalities: Filter models by input modality. Comma-separated list of: text, image, audio, file.
|
||||||
:param context: Minimum context length (tokens). Models with smaller context are excluded.
|
:param context: Minimum context length (tokens). Models with smaller context are excluded.
|
||||||
@@ -459,7 +459,7 @@ class Models(BaseSDK):
|
|||||||
:param category: Filter models by use case category
|
:param category: Filter models by use case category
|
||||||
:param supported_parameters: Filter models by supported parameter (comma-separated)
|
:param supported_parameters: Filter models by supported parameter (comma-separated)
|
||||||
:param output_modalities: Filter models by output modality. Accepts a comma-separated list of modalities (text, image, audio, embeddings) or \"all\" to include all models. Defaults to \"text\".
|
:param output_modalities: Filter models by output modality. Accepts a comma-separated list of modalities (text, image, audio, embeddings) or \"all\" to include all models. Defaults to \"text\".
|
||||||
:param sort: Sort the returned models server-side. Prefer this over fetching the full list and sorting client-side. Options: pricing-low-to-high, pricing-high-to-low (average prompt/completion price), context-high-to-low (context length), throughput-high-to-low, latency-low-to-high (recent median performance), most-popular, top-weekly (tokens processed in the last week), newest (creation date). When omitted, the existing default ordering is preserved.
|
:param sort: Sort the returned models server-side. Prefer this over fetching the full list and sorting client-side. Options: pricing-low-to-high, pricing-high-to-low (average prompt/completion price), context-high-to-low (context length), throughput-high-to-low, latency-low-to-high (recent median performance), most-popular, top-weekly (tokens processed in the last week), newest (creation date), intelligence-high-to-low (Artificial Analysis intelligence index), design-arena-elo-high-to-low (best Design Arena ELO across arenas). Models without a score for the chosen benchmark are placed last. When omitted, the existing default ordering is preserved.
|
||||||
:param q: Free-text search by model name or slug.
|
:param q: Free-text search by model name or slug.
|
||||||
:param input_modalities: Filter models by input modality. Comma-separated list of: text, image, audio, file.
|
:param input_modalities: Filter models by input modality. Comma-separated list of: text, image, audio, file.
|
||||||
:param context: Minimum context length (tokens). Models with smaller context are excluded.
|
:param context: Minimum context length (tokens). Models with smaller context are excluded.
|
||||||
|
|||||||
@@ -81,6 +81,8 @@ if TYPE_CHECKING:
|
|||||||
ContentText,
|
ContentText,
|
||||||
ContentTextTypedDict,
|
ContentTextTypedDict,
|
||||||
ContentTypedDict,
|
ContentTypedDict,
|
||||||
|
CostDetails,
|
||||||
|
CostDetailsTypedDict,
|
||||||
CreateEmbeddingsData,
|
CreateEmbeddingsData,
|
||||||
CreateEmbeddingsDataTypedDict,
|
CreateEmbeddingsDataTypedDict,
|
||||||
CreateEmbeddingsGlobals,
|
CreateEmbeddingsGlobals,
|
||||||
@@ -117,6 +119,14 @@ if TYPE_CHECKING:
|
|||||||
CreateGuardrailRequest,
|
CreateGuardrailRequest,
|
||||||
CreateGuardrailRequestTypedDict,
|
CreateGuardrailRequestTypedDict,
|
||||||
)
|
)
|
||||||
|
from .createimages import (
|
||||||
|
CreateImagesGlobals,
|
||||||
|
CreateImagesGlobalsTypedDict,
|
||||||
|
CreateImagesRequest,
|
||||||
|
CreateImagesRequestTypedDict,
|
||||||
|
CreateImagesResponse,
|
||||||
|
CreateImagesResponseTypedDict,
|
||||||
|
)
|
||||||
from .createkeys import (
|
from .createkeys import (
|
||||||
CreateKeysData,
|
CreateKeysData,
|
||||||
CreateKeysDataTypedDict,
|
CreateKeysDataTypedDict,
|
||||||
@@ -396,6 +406,13 @@ if TYPE_CHECKING:
|
|||||||
GetRankingsDailyRequest,
|
GetRankingsDailyRequest,
|
||||||
GetRankingsDailyRequestTypedDict,
|
GetRankingsDailyRequestTypedDict,
|
||||||
)
|
)
|
||||||
|
from .gettaskclassifications import (
|
||||||
|
GetTaskClassificationsGlobals,
|
||||||
|
GetTaskClassificationsGlobalsTypedDict,
|
||||||
|
GetTaskClassificationsRequest,
|
||||||
|
GetTaskClassificationsRequestTypedDict,
|
||||||
|
Window,
|
||||||
|
)
|
||||||
from .getuseractivity import (
|
from .getuseractivity import (
|
||||||
GetUserActivityGlobals,
|
GetUserActivityGlobals,
|
||||||
GetUserActivityGlobalsTypedDict,
|
GetUserActivityGlobalsTypedDict,
|
||||||
@@ -493,6 +510,18 @@ if TYPE_CHECKING:
|
|||||||
ListGuardrailsResponse,
|
ListGuardrailsResponse,
|
||||||
ListGuardrailsResponseTypedDict,
|
ListGuardrailsResponseTypedDict,
|
||||||
)
|
)
|
||||||
|
from .listimagemodelendpoints import (
|
||||||
|
ListImageModelEndpointsGlobals,
|
||||||
|
ListImageModelEndpointsGlobalsTypedDict,
|
||||||
|
ListImageModelEndpointsRequest,
|
||||||
|
ListImageModelEndpointsRequestTypedDict,
|
||||||
|
)
|
||||||
|
from .listimagemodels import (
|
||||||
|
ListImageModelsGlobals,
|
||||||
|
ListImageModelsGlobalsTypedDict,
|
||||||
|
ListImageModelsRequest,
|
||||||
|
ListImageModelsRequestTypedDict,
|
||||||
|
)
|
||||||
from .listkeyassignments import (
|
from .listkeyassignments import (
|
||||||
ListKeyAssignmentsGlobals,
|
ListKeyAssignmentsGlobals,
|
||||||
ListKeyAssignmentsGlobalsTypedDict,
|
ListKeyAssignmentsGlobalsTypedDict,
|
||||||
@@ -719,6 +748,8 @@ __all__ = [
|
|||||||
"ContentText",
|
"ContentText",
|
||||||
"ContentTextTypedDict",
|
"ContentTextTypedDict",
|
||||||
"ContentTypedDict",
|
"ContentTypedDict",
|
||||||
|
"CostDetails",
|
||||||
|
"CostDetailsTypedDict",
|
||||||
"CreateAudioSpeechGlobals",
|
"CreateAudioSpeechGlobals",
|
||||||
"CreateAudioSpeechGlobalsTypedDict",
|
"CreateAudioSpeechGlobalsTypedDict",
|
||||||
"CreateAudioSpeechRequest",
|
"CreateAudioSpeechRequest",
|
||||||
@@ -760,6 +791,12 @@ __all__ = [
|
|||||||
"CreateGuardrailGlobalsTypedDict",
|
"CreateGuardrailGlobalsTypedDict",
|
||||||
"CreateGuardrailRequest",
|
"CreateGuardrailRequest",
|
||||||
"CreateGuardrailRequestTypedDict",
|
"CreateGuardrailRequestTypedDict",
|
||||||
|
"CreateImagesGlobals",
|
||||||
|
"CreateImagesGlobalsTypedDict",
|
||||||
|
"CreateImagesRequest",
|
||||||
|
"CreateImagesRequestTypedDict",
|
||||||
|
"CreateImagesResponse",
|
||||||
|
"CreateImagesResponseTypedDict",
|
||||||
"CreateKeysData",
|
"CreateKeysData",
|
||||||
"CreateKeysDataTypedDict",
|
"CreateKeysDataTypedDict",
|
||||||
"CreateKeysGlobals",
|
"CreateKeysGlobals",
|
||||||
@@ -961,6 +998,10 @@ __all__ = [
|
|||||||
"GetRankingsDailyGlobalsTypedDict",
|
"GetRankingsDailyGlobalsTypedDict",
|
||||||
"GetRankingsDailyRequest",
|
"GetRankingsDailyRequest",
|
||||||
"GetRankingsDailyRequestTypedDict",
|
"GetRankingsDailyRequestTypedDict",
|
||||||
|
"GetTaskClassificationsGlobals",
|
||||||
|
"GetTaskClassificationsGlobalsTypedDict",
|
||||||
|
"GetTaskClassificationsRequest",
|
||||||
|
"GetTaskClassificationsRequestTypedDict",
|
||||||
"GetUserActivityGlobals",
|
"GetUserActivityGlobals",
|
||||||
"GetUserActivityGlobalsTypedDict",
|
"GetUserActivityGlobalsTypedDict",
|
||||||
"GetUserActivityRequest",
|
"GetUserActivityRequest",
|
||||||
@@ -1037,6 +1078,14 @@ __all__ = [
|
|||||||
"ListGuardrailsRequestTypedDict",
|
"ListGuardrailsRequestTypedDict",
|
||||||
"ListGuardrailsResponse",
|
"ListGuardrailsResponse",
|
||||||
"ListGuardrailsResponseTypedDict",
|
"ListGuardrailsResponseTypedDict",
|
||||||
|
"ListImageModelEndpointsGlobals",
|
||||||
|
"ListImageModelEndpointsGlobalsTypedDict",
|
||||||
|
"ListImageModelEndpointsRequest",
|
||||||
|
"ListImageModelEndpointsRequestTypedDict",
|
||||||
|
"ListImageModelsGlobals",
|
||||||
|
"ListImageModelsGlobalsTypedDict",
|
||||||
|
"ListImageModelsRequest",
|
||||||
|
"ListImageModelsRequestTypedDict",
|
||||||
"ListKeyAssignmentsGlobals",
|
"ListKeyAssignmentsGlobals",
|
||||||
"ListKeyAssignmentsGlobalsTypedDict",
|
"ListKeyAssignmentsGlobalsTypedDict",
|
||||||
"ListKeyAssignmentsRequest",
|
"ListKeyAssignmentsRequest",
|
||||||
@@ -1205,6 +1254,7 @@ __all__ = [
|
|||||||
"Value2",
|
"Value2",
|
||||||
"Value2TypedDict",
|
"Value2TypedDict",
|
||||||
"ValueType",
|
"ValueType",
|
||||||
|
"Window",
|
||||||
"Zdr",
|
"Zdr",
|
||||||
]
|
]
|
||||||
|
|
||||||
@@ -1263,6 +1313,8 @@ _dynamic_imports: dict[str, str] = {
|
|||||||
"ContentText": ".createembeddings",
|
"ContentText": ".createembeddings",
|
||||||
"ContentTextTypedDict": ".createembeddings",
|
"ContentTextTypedDict": ".createembeddings",
|
||||||
"ContentTypedDict": ".createembeddings",
|
"ContentTypedDict": ".createembeddings",
|
||||||
|
"CostDetails": ".createembeddings",
|
||||||
|
"CostDetailsTypedDict": ".createembeddings",
|
||||||
"CreateEmbeddingsData": ".createembeddings",
|
"CreateEmbeddingsData": ".createembeddings",
|
||||||
"CreateEmbeddingsDataTypedDict": ".createembeddings",
|
"CreateEmbeddingsDataTypedDict": ".createembeddings",
|
||||||
"CreateEmbeddingsGlobals": ".createembeddings",
|
"CreateEmbeddingsGlobals": ".createembeddings",
|
||||||
@@ -1296,6 +1348,12 @@ _dynamic_imports: dict[str, str] = {
|
|||||||
"CreateGuardrailGlobalsTypedDict": ".createguardrail",
|
"CreateGuardrailGlobalsTypedDict": ".createguardrail",
|
||||||
"CreateGuardrailRequest": ".createguardrail",
|
"CreateGuardrailRequest": ".createguardrail",
|
||||||
"CreateGuardrailRequestTypedDict": ".createguardrail",
|
"CreateGuardrailRequestTypedDict": ".createguardrail",
|
||||||
|
"CreateImagesGlobals": ".createimages",
|
||||||
|
"CreateImagesGlobalsTypedDict": ".createimages",
|
||||||
|
"CreateImagesRequest": ".createimages",
|
||||||
|
"CreateImagesRequestTypedDict": ".createimages",
|
||||||
|
"CreateImagesResponse": ".createimages",
|
||||||
|
"CreateImagesResponseTypedDict": ".createimages",
|
||||||
"CreateKeysData": ".createkeys",
|
"CreateKeysData": ".createkeys",
|
||||||
"CreateKeysDataTypedDict": ".createkeys",
|
"CreateKeysDataTypedDict": ".createkeys",
|
||||||
"CreateKeysGlobals": ".createkeys",
|
"CreateKeysGlobals": ".createkeys",
|
||||||
@@ -1507,6 +1565,11 @@ _dynamic_imports: dict[str, str] = {
|
|||||||
"GetRankingsDailyGlobalsTypedDict": ".getrankingsdaily",
|
"GetRankingsDailyGlobalsTypedDict": ".getrankingsdaily",
|
||||||
"GetRankingsDailyRequest": ".getrankingsdaily",
|
"GetRankingsDailyRequest": ".getrankingsdaily",
|
||||||
"GetRankingsDailyRequestTypedDict": ".getrankingsdaily",
|
"GetRankingsDailyRequestTypedDict": ".getrankingsdaily",
|
||||||
|
"GetTaskClassificationsGlobals": ".gettaskclassifications",
|
||||||
|
"GetTaskClassificationsGlobalsTypedDict": ".gettaskclassifications",
|
||||||
|
"GetTaskClassificationsRequest": ".gettaskclassifications",
|
||||||
|
"GetTaskClassificationsRequestTypedDict": ".gettaskclassifications",
|
||||||
|
"Window": ".gettaskclassifications",
|
||||||
"GetUserActivityGlobals": ".getuseractivity",
|
"GetUserActivityGlobals": ".getuseractivity",
|
||||||
"GetUserActivityGlobalsTypedDict": ".getuseractivity",
|
"GetUserActivityGlobalsTypedDict": ".getuseractivity",
|
||||||
"GetUserActivityRequest": ".getuseractivity",
|
"GetUserActivityRequest": ".getuseractivity",
|
||||||
@@ -1578,6 +1641,14 @@ _dynamic_imports: dict[str, str] = {
|
|||||||
"ListGuardrailsRequestTypedDict": ".listguardrails",
|
"ListGuardrailsRequestTypedDict": ".listguardrails",
|
||||||
"ListGuardrailsResponse": ".listguardrails",
|
"ListGuardrailsResponse": ".listguardrails",
|
||||||
"ListGuardrailsResponseTypedDict": ".listguardrails",
|
"ListGuardrailsResponseTypedDict": ".listguardrails",
|
||||||
|
"ListImageModelEndpointsGlobals": ".listimagemodelendpoints",
|
||||||
|
"ListImageModelEndpointsGlobalsTypedDict": ".listimagemodelendpoints",
|
||||||
|
"ListImageModelEndpointsRequest": ".listimagemodelendpoints",
|
||||||
|
"ListImageModelEndpointsRequestTypedDict": ".listimagemodelendpoints",
|
||||||
|
"ListImageModelsGlobals": ".listimagemodels",
|
||||||
|
"ListImageModelsGlobalsTypedDict": ".listimagemodels",
|
||||||
|
"ListImageModelsRequest": ".listimagemodels",
|
||||||
|
"ListImageModelsRequestTypedDict": ".listimagemodels",
|
||||||
"ListKeyAssignmentsGlobals": ".listkeyassignments",
|
"ListKeyAssignmentsGlobals": ".listkeyassignments",
|
||||||
"ListKeyAssignmentsGlobalsTypedDict": ".listkeyassignments",
|
"ListKeyAssignmentsGlobalsTypedDict": ".listkeyassignments",
|
||||||
"ListKeyAssignmentsRequest": ".listkeyassignments",
|
"ListKeyAssignmentsRequest": ".listkeyassignments",
|
||||||
|
|||||||
@@ -344,6 +344,54 @@ class CreateEmbeddingsData(BaseModel):
|
|||||||
Object = Literal["list",]
|
Object = Literal["list",]
|
||||||
|
|
||||||
|
|
||||||
|
class CostDetailsTypedDict(TypedDict):
|
||||||
|
r"""Breakdown of upstream inference costs"""
|
||||||
|
|
||||||
|
upstream_inference_completions_cost: float
|
||||||
|
upstream_inference_prompt_cost: float
|
||||||
|
upstream_inference_cost: NotRequired[Nullable[float]]
|
||||||
|
|
||||||
|
|
||||||
|
class CostDetails(BaseModel):
|
||||||
|
r"""Breakdown of upstream inference costs"""
|
||||||
|
|
||||||
|
upstream_inference_completions_cost: float
|
||||||
|
|
||||||
|
upstream_inference_prompt_cost: float
|
||||||
|
|
||||||
|
upstream_inference_cost: OptionalNullable[float] = UNSET
|
||||||
|
|
||||||
|
@model_serializer(mode="wrap")
|
||||||
|
def serialize_model(self, handler):
|
||||||
|
optional_fields = ["upstream_inference_cost"]
|
||||||
|
nullable_fields = ["upstream_inference_cost"]
|
||||||
|
null_default_fields = []
|
||||||
|
|
||||||
|
serialized = handler(self)
|
||||||
|
|
||||||
|
m = {}
|
||||||
|
|
||||||
|
for n, f in type(self).model_fields.items():
|
||||||
|
k = f.alias or n
|
||||||
|
val = serialized.get(k)
|
||||||
|
serialized.pop(k, None)
|
||||||
|
|
||||||
|
optional_nullable = k in optional_fields and k in nullable_fields
|
||||||
|
is_set = (
|
||||||
|
self.__pydantic_fields_set__.intersection({n})
|
||||||
|
or k in null_default_fields
|
||||||
|
) # pylint: disable=no-member
|
||||||
|
|
||||||
|
if val is not None and val != UNSET_SENTINEL:
|
||||||
|
m[k] = val
|
||||||
|
elif val != UNSET_SENTINEL and (
|
||||||
|
not k in optional_fields or (optional_nullable and is_set)
|
||||||
|
):
|
||||||
|
m[k] = val
|
||||||
|
|
||||||
|
return m
|
||||||
|
|
||||||
|
|
||||||
class PromptTokensDetailsTypedDict(TypedDict):
|
class PromptTokensDetailsTypedDict(TypedDict):
|
||||||
r"""Per-modality token breakdown. Only present when the input contains 2+ modalities (e.g. text + image) and the upstream provider returns modality-level usage data. Only non-zero modality counts are included."""
|
r"""Per-modality token breakdown. Only present when the input contains 2+ modalities (e.g. text + image) and the upstream provider returns modality-level usage data. Only non-zero modality counts are included."""
|
||||||
|
|
||||||
@@ -387,6 +435,10 @@ class CreateEmbeddingsUsageTypedDict(TypedDict):
|
|||||||
r"""Total number of tokens used"""
|
r"""Total number of tokens used"""
|
||||||
cost: NotRequired[float]
|
cost: NotRequired[float]
|
||||||
r"""Cost of the request in credits"""
|
r"""Cost of the request in credits"""
|
||||||
|
cost_details: NotRequired[Nullable[CostDetailsTypedDict]]
|
||||||
|
r"""Breakdown of upstream inference costs"""
|
||||||
|
is_byok: NotRequired[bool]
|
||||||
|
r"""Whether a request was made using a Bring Your Own Key configuration"""
|
||||||
prompt_tokens_details: NotRequired[PromptTokensDetailsTypedDict]
|
prompt_tokens_details: NotRequired[PromptTokensDetailsTypedDict]
|
||||||
r"""Per-modality token breakdown. Only present when the input contains 2+ modalities (e.g. text + image) and the upstream provider returns modality-level usage data. Only non-zero modality counts are included."""
|
r"""Per-modality token breakdown. Only present when the input contains 2+ modalities (e.g. text + image) and the upstream provider returns modality-level usage data. Only non-zero modality counts are included."""
|
||||||
|
|
||||||
@@ -403,9 +455,45 @@ class CreateEmbeddingsUsage(BaseModel):
|
|||||||
cost: Optional[float] = None
|
cost: Optional[float] = None
|
||||||
r"""Cost of the request in credits"""
|
r"""Cost of the request in credits"""
|
||||||
|
|
||||||
|
cost_details: OptionalNullable[CostDetails] = UNSET
|
||||||
|
r"""Breakdown of upstream inference costs"""
|
||||||
|
|
||||||
|
is_byok: Optional[bool] = None
|
||||||
|
r"""Whether a request was made using a Bring Your Own Key configuration"""
|
||||||
|
|
||||||
prompt_tokens_details: Optional[PromptTokensDetails] = None
|
prompt_tokens_details: Optional[PromptTokensDetails] = None
|
||||||
r"""Per-modality token breakdown. Only present when the input contains 2+ modalities (e.g. text + image) and the upstream provider returns modality-level usage data. Only non-zero modality counts are included."""
|
r"""Per-modality token breakdown. Only present when the input contains 2+ modalities (e.g. text + image) and the upstream provider returns modality-level usage data. Only non-zero modality counts are included."""
|
||||||
|
|
||||||
|
@model_serializer(mode="wrap")
|
||||||
|
def serialize_model(self, handler):
|
||||||
|
optional_fields = ["cost", "cost_details", "is_byok", "prompt_tokens_details"]
|
||||||
|
nullable_fields = ["cost_details"]
|
||||||
|
null_default_fields = []
|
||||||
|
|
||||||
|
serialized = handler(self)
|
||||||
|
|
||||||
|
m = {}
|
||||||
|
|
||||||
|
for n, f in type(self).model_fields.items():
|
||||||
|
k = f.alias or n
|
||||||
|
val = serialized.get(k)
|
||||||
|
serialized.pop(k, None)
|
||||||
|
|
||||||
|
optional_nullable = k in optional_fields and k in nullable_fields
|
||||||
|
is_set = (
|
||||||
|
self.__pydantic_fields_set__.intersection({n})
|
||||||
|
or k in null_default_fields
|
||||||
|
) # pylint: disable=no-member
|
||||||
|
|
||||||
|
if val is not None and val != UNSET_SENTINEL:
|
||||||
|
m[k] = val
|
||||||
|
elif val != UNSET_SENTINEL and (
|
||||||
|
not k in optional_fields or (optional_nullable and is_set)
|
||||||
|
):
|
||||||
|
m[k] = val
|
||||||
|
|
||||||
|
return m
|
||||||
|
|
||||||
|
|
||||||
class CreateEmbeddingsResponseBodyTypedDict(TypedDict):
|
class CreateEmbeddingsResponseBodyTypedDict(TypedDict):
|
||||||
r"""Embeddings response containing embedding vectors"""
|
r"""Embeddings response containing embedding vectors"""
|
||||||
|
|||||||
@@ -0,0 +1,150 @@
|
|||||||
|
"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
|
||||||
|
|
||||||
|
from __future__ import annotations
|
||||||
|
from openrouter.components import (
|
||||||
|
imagegenerationrequest as components_imagegenerationrequest,
|
||||||
|
imagegenerationresponse as components_imagegenerationresponse,
|
||||||
|
imagestreamingresponse as components_imagestreamingresponse,
|
||||||
|
)
|
||||||
|
from openrouter.types import BaseModel
|
||||||
|
from openrouter.utils import (
|
||||||
|
FieldMetadata,
|
||||||
|
HeaderMetadata,
|
||||||
|
RequestMetadata,
|
||||||
|
eventstreaming,
|
||||||
|
)
|
||||||
|
import pydantic
|
||||||
|
from typing import Optional, Union
|
||||||
|
from typing_extensions import Annotated, NotRequired, TypeAliasType, TypedDict
|
||||||
|
|
||||||
|
|
||||||
|
class CreateImagesGlobalsTypedDict(TypedDict):
|
||||||
|
http_referer: NotRequired[str]
|
||||||
|
r"""The app identifier should be your app's URL and is used as the primary identifier for rankings.
|
||||||
|
This is used to track API usage per application.
|
||||||
|
|
||||||
|
"""
|
||||||
|
x_open_router_title: NotRequired[str]
|
||||||
|
r"""The app display name allows you to customize how your app appears in OpenRouter's dashboard.
|
||||||
|
|
||||||
|
"""
|
||||||
|
x_open_router_categories: NotRequired[str]
|
||||||
|
r"""Comma-separated list of app categories (e.g. \"cli-agent,cloud-agent\"). Used for marketplace rankings.
|
||||||
|
|
||||||
|
"""
|
||||||
|
|
||||||
|
|
||||||
|
class CreateImagesGlobals(BaseModel):
|
||||||
|
http_referer: Annotated[
|
||||||
|
Optional[str],
|
||||||
|
pydantic.Field(alias="HTTP-Referer"),
|
||||||
|
FieldMetadata(header=HeaderMetadata(style="simple", explode=False)),
|
||||||
|
] = None
|
||||||
|
r"""The app identifier should be your app's URL and is used as the primary identifier for rankings.
|
||||||
|
This is used to track API usage per application.
|
||||||
|
|
||||||
|
"""
|
||||||
|
|
||||||
|
x_open_router_title: Annotated[
|
||||||
|
Optional[str],
|
||||||
|
pydantic.Field(alias="X-OpenRouter-Title"),
|
||||||
|
FieldMetadata(header=HeaderMetadata(style="simple", explode=False)),
|
||||||
|
] = None
|
||||||
|
r"""The app display name allows you to customize how your app appears in OpenRouter's dashboard.
|
||||||
|
|
||||||
|
"""
|
||||||
|
|
||||||
|
x_open_router_categories: Annotated[
|
||||||
|
Optional[str],
|
||||||
|
pydantic.Field(alias="X-OpenRouter-Categories"),
|
||||||
|
FieldMetadata(header=HeaderMetadata(style="simple", explode=False)),
|
||||||
|
] = None
|
||||||
|
r"""Comma-separated list of app categories (e.g. \"cli-agent,cloud-agent\"). Used for marketplace rankings.
|
||||||
|
|
||||||
|
"""
|
||||||
|
|
||||||
|
|
||||||
|
class CreateImagesRequestTypedDict(TypedDict):
|
||||||
|
image_generation_request: (
|
||||||
|
components_imagegenerationrequest.ImageGenerationRequestTypedDict
|
||||||
|
)
|
||||||
|
http_referer: NotRequired[str]
|
||||||
|
r"""The app identifier should be your app's URL and is used as the primary identifier for rankings.
|
||||||
|
This is used to track API usage per application.
|
||||||
|
|
||||||
|
"""
|
||||||
|
x_open_router_title: NotRequired[str]
|
||||||
|
r"""The app display name allows you to customize how your app appears in OpenRouter's dashboard.
|
||||||
|
|
||||||
|
"""
|
||||||
|
x_open_router_categories: NotRequired[str]
|
||||||
|
r"""Comma-separated list of app categories (e.g. \"cli-agent,cloud-agent\"). Used for marketplace rankings.
|
||||||
|
|
||||||
|
"""
|
||||||
|
|
||||||
|
|
||||||
|
class CreateImagesRequest(BaseModel):
|
||||||
|
image_generation_request: Annotated[
|
||||||
|
components_imagegenerationrequest.ImageGenerationRequest,
|
||||||
|
FieldMetadata(request=RequestMetadata(media_type="application/json")),
|
||||||
|
]
|
||||||
|
|
||||||
|
http_referer: Annotated[
|
||||||
|
Optional[str],
|
||||||
|
pydantic.Field(alias="HTTP-Referer"),
|
||||||
|
FieldMetadata(header=HeaderMetadata(style="simple", explode=False)),
|
||||||
|
] = None
|
||||||
|
r"""The app identifier should be your app's URL and is used as the primary identifier for rankings.
|
||||||
|
This is used to track API usage per application.
|
||||||
|
|
||||||
|
"""
|
||||||
|
|
||||||
|
x_open_router_title: Annotated[
|
||||||
|
Optional[str],
|
||||||
|
pydantic.Field(alias="X-OpenRouter-Title"),
|
||||||
|
FieldMetadata(header=HeaderMetadata(style="simple", explode=False)),
|
||||||
|
] = None
|
||||||
|
r"""The app display name allows you to customize how your app appears in OpenRouter's dashboard.
|
||||||
|
|
||||||
|
"""
|
||||||
|
|
||||||
|
x_open_router_categories: Annotated[
|
||||||
|
Optional[str],
|
||||||
|
pydantic.Field(alias="X-OpenRouter-Categories"),
|
||||||
|
FieldMetadata(header=HeaderMetadata(style="simple", explode=False)),
|
||||||
|
] = None
|
||||||
|
r"""Comma-separated list of app categories (e.g. \"cli-agent,cloud-agent\"). Used for marketplace rankings.
|
||||||
|
|
||||||
|
"""
|
||||||
|
|
||||||
|
|
||||||
|
CreateImagesResponseTypedDict = TypeAliasType(
|
||||||
|
"CreateImagesResponseTypedDict",
|
||||||
|
Union[
|
||||||
|
components_imagegenerationresponse.ImageGenerationResponseTypedDict,
|
||||||
|
Union[
|
||||||
|
eventstreaming.EventStream[
|
||||||
|
components_imagestreamingresponse.ImageStreamingResponseDataTypedDict
|
||||||
|
],
|
||||||
|
eventstreaming.EventStreamAsync[
|
||||||
|
components_imagestreamingresponse.ImageStreamingResponseDataTypedDict
|
||||||
|
],
|
||||||
|
],
|
||||||
|
],
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
|
CreateImagesResponse = TypeAliasType(
|
||||||
|
"CreateImagesResponse",
|
||||||
|
Union[
|
||||||
|
components_imagegenerationresponse.ImageGenerationResponse,
|
||||||
|
Union[
|
||||||
|
eventstreaming.EventStream[
|
||||||
|
components_imagestreamingresponse.ImageStreamingResponseData
|
||||||
|
],
|
||||||
|
eventstreaming.EventStreamAsync[
|
||||||
|
components_imagestreamingresponse.ImageStreamingResponseData
|
||||||
|
],
|
||||||
|
],
|
||||||
|
],
|
||||||
|
)
|
||||||
@@ -67,7 +67,7 @@ Source = Union[
|
|||||||
],
|
],
|
||||||
UnrecognizedStr,
|
UnrecognizedStr,
|
||||||
]
|
]
|
||||||
r"""Benchmark source to query. Determines the shape of the returned items."""
|
r"""Benchmark source to query. Determines the shape of the returned items. When omitted, returns results from all sources."""
|
||||||
|
|
||||||
|
|
||||||
TaskType = Union[
|
TaskType = Union[
|
||||||
@@ -93,8 +93,6 @@ r"""Design Arena only: arena to query. Defaults to `models` when source is `desi
|
|||||||
|
|
||||||
|
|
||||||
class GetBenchmarksRequestTypedDict(TypedDict):
|
class GetBenchmarksRequestTypedDict(TypedDict):
|
||||||
source: Source
|
|
||||||
r"""Benchmark source to query. Determines the shape of the returned items."""
|
|
||||||
http_referer: NotRequired[str]
|
http_referer: NotRequired[str]
|
||||||
r"""The app identifier should be your app's URL and is used as the primary identifier for rankings.
|
r"""The app identifier should be your app's URL and is used as the primary identifier for rankings.
|
||||||
This is used to track API usage per application.
|
This is used to track API usage per application.
|
||||||
@@ -108,6 +106,8 @@ class GetBenchmarksRequestTypedDict(TypedDict):
|
|||||||
r"""Comma-separated list of app categories (e.g. \"cli-agent,cloud-agent\"). Used for marketplace rankings.
|
r"""Comma-separated list of app categories (e.g. \"cli-agent,cloud-agent\"). Used for marketplace rankings.
|
||||||
|
|
||||||
"""
|
"""
|
||||||
|
source: NotRequired[Source]
|
||||||
|
r"""Benchmark source to query. Determines the shape of the returned items. When omitted, returns results from all sources."""
|
||||||
task_type: NotRequired[TaskType]
|
task_type: NotRequired[TaskType]
|
||||||
r"""Filter results by task type. For Artificial Analysis, maps to the corresponding index. For Design Arena, maps to the matching category."""
|
r"""Filter results by task type. For Artificial Analysis, maps to the corresponding index. For Design Arena, maps to the matching category."""
|
||||||
arena: NotRequired[Arena]
|
arena: NotRequired[Arena]
|
||||||
@@ -115,16 +115,10 @@ class GetBenchmarksRequestTypedDict(TypedDict):
|
|||||||
category: NotRequired[str]
|
category: NotRequired[str]
|
||||||
r"""Design Arena only: category within the arena (e.g. `codecategories`, `uicomponent`, `gamedev`, `3d`, `dataviz`, `image`, `video`, `svg`). When omitted, returns all categories."""
|
r"""Design Arena only: category within the arena (e.g. `codecategories`, `uicomponent`, `gamedev`, `3d`, `dataviz`, `image`, `video`, `svg`). When omitted, returns all categories."""
|
||||||
max_results: NotRequired[int]
|
max_results: NotRequired[int]
|
||||||
r"""Max results to return (1–100, default 50)."""
|
r"""Maximum number of items to return. When omitted, all matching results are returned."""
|
||||||
|
|
||||||
|
|
||||||
class GetBenchmarksRequest(BaseModel):
|
class GetBenchmarksRequest(BaseModel):
|
||||||
source: Annotated[
|
|
||||||
Annotated[Source, PlainValidator(validate_open_enum(False))],
|
|
||||||
FieldMetadata(query=QueryParamMetadata(style="form", explode=True)),
|
|
||||||
]
|
|
||||||
r"""Benchmark source to query. Determines the shape of the returned items."""
|
|
||||||
|
|
||||||
http_referer: Annotated[
|
http_referer: Annotated[
|
||||||
Optional[str],
|
Optional[str],
|
||||||
pydantic.Field(alias="HTTP-Referer"),
|
pydantic.Field(alias="HTTP-Referer"),
|
||||||
@@ -153,6 +147,12 @@ class GetBenchmarksRequest(BaseModel):
|
|||||||
|
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
source: Annotated[
|
||||||
|
Annotated[Optional[Source], PlainValidator(validate_open_enum(False))],
|
||||||
|
FieldMetadata(query=QueryParamMetadata(style="form", explode=True)),
|
||||||
|
] = None
|
||||||
|
r"""Benchmark source to query. Determines the shape of the returned items. When omitted, returns results from all sources."""
|
||||||
|
|
||||||
task_type: Annotated[
|
task_type: Annotated[
|
||||||
Annotated[Optional[TaskType], PlainValidator(validate_open_enum(False))],
|
Annotated[Optional[TaskType], PlainValidator(validate_open_enum(False))],
|
||||||
FieldMetadata(query=QueryParamMetadata(style="form", explode=True)),
|
FieldMetadata(query=QueryParamMetadata(style="form", explode=True)),
|
||||||
@@ -174,5 +174,5 @@ class GetBenchmarksRequest(BaseModel):
|
|||||||
max_results: Annotated[
|
max_results: Annotated[
|
||||||
Optional[int],
|
Optional[int],
|
||||||
FieldMetadata(query=QueryParamMetadata(style="form", explode=True)),
|
FieldMetadata(query=QueryParamMetadata(style="form", explode=True)),
|
||||||
] = 50
|
] = None
|
||||||
r"""Max results to return (1–100, default 50)."""
|
r"""Maximum number of items to return. When omitted, all matching results are returned."""
|
||||||
|
|||||||
@@ -98,10 +98,12 @@ GetModelsSort = Union[
|
|||||||
"context-high-to-low",
|
"context-high-to-low",
|
||||||
"throughput-high-to-low",
|
"throughput-high-to-low",
|
||||||
"latency-low-to-high",
|
"latency-low-to-high",
|
||||||
|
"intelligence-high-to-low",
|
||||||
|
"design-arena-elo-high-to-low",
|
||||||
],
|
],
|
||||||
UnrecognizedStr,
|
UnrecognizedStr,
|
||||||
]
|
]
|
||||||
r"""Sort the returned models server-side. Prefer this over fetching the full list and sorting client-side. Options: pricing-low-to-high, pricing-high-to-low (average prompt/completion price), context-high-to-low (context length), throughput-high-to-low, latency-low-to-high (recent median performance), most-popular, top-weekly (tokens processed in the last week), newest (creation date). When omitted, the existing default ordering is preserved."""
|
r"""Sort the returned models server-side. Prefer this over fetching the full list and sorting client-side. Options: pricing-low-to-high, pricing-high-to-low (average prompt/completion price), context-high-to-low (context length), throughput-high-to-low, latency-low-to-high (recent median performance), most-popular, top-weekly (tokens processed in the last week), newest (creation date), intelligence-high-to-low (Artificial Analysis intelligence index), design-arena-elo-high-to-low (best Design Arena ELO across arenas). Models without a score for the chosen benchmark are placed last. When omitted, the existing default ordering is preserved."""
|
||||||
|
|
||||||
|
|
||||||
Distillable = Union[
|
Distillable = Union[
|
||||||
@@ -143,7 +145,7 @@ class GetModelsRequestTypedDict(TypedDict):
|
|||||||
output_modalities: NotRequired[str]
|
output_modalities: NotRequired[str]
|
||||||
r"""Filter models by output modality. Accepts a comma-separated list of modalities (text, image, audio, embeddings) or \"all\" to include all models. Defaults to \"text\"."""
|
r"""Filter models by output modality. Accepts a comma-separated list of modalities (text, image, audio, embeddings) or \"all\" to include all models. Defaults to \"text\"."""
|
||||||
sort: NotRequired[GetModelsSort]
|
sort: NotRequired[GetModelsSort]
|
||||||
r"""Sort the returned models server-side. Prefer this over fetching the full list and sorting client-side. Options: pricing-low-to-high, pricing-high-to-low (average prompt/completion price), context-high-to-low (context length), throughput-high-to-low, latency-low-to-high (recent median performance), most-popular, top-weekly (tokens processed in the last week), newest (creation date). When omitted, the existing default ordering is preserved."""
|
r"""Sort the returned models server-side. Prefer this over fetching the full list and sorting client-side. Options: pricing-low-to-high, pricing-high-to-low (average prompt/completion price), context-high-to-low (context length), throughput-high-to-low, latency-low-to-high (recent median performance), most-popular, top-weekly (tokens processed in the last week), newest (creation date), intelligence-high-to-low (Artificial Analysis intelligence index), design-arena-elo-high-to-low (best Design Arena ELO across arenas). Models without a score for the chosen benchmark are placed last. When omitted, the existing default ordering is preserved."""
|
||||||
q: NotRequired[str]
|
q: NotRequired[str]
|
||||||
r"""Free-text search by model name or slug."""
|
r"""Free-text search by model name or slug."""
|
||||||
input_modalities: NotRequired[str]
|
input_modalities: NotRequired[str]
|
||||||
@@ -221,7 +223,7 @@ class GetModelsRequest(BaseModel):
|
|||||||
Annotated[Optional[GetModelsSort], PlainValidator(validate_open_enum(False))],
|
Annotated[Optional[GetModelsSort], PlainValidator(validate_open_enum(False))],
|
||||||
FieldMetadata(query=QueryParamMetadata(style="form", explode=True)),
|
FieldMetadata(query=QueryParamMetadata(style="form", explode=True)),
|
||||||
] = None
|
] = None
|
||||||
r"""Sort the returned models server-side. Prefer this over fetching the full list and sorting client-side. Options: pricing-low-to-high, pricing-high-to-low (average prompt/completion price), context-high-to-low (context length), throughput-high-to-low, latency-low-to-high (recent median performance), most-popular, top-weekly (tokens processed in the last week), newest (creation date). When omitted, the existing default ordering is preserved."""
|
r"""Sort the returned models server-side. Prefer this over fetching the full list and sorting client-side. Options: pricing-low-to-high, pricing-high-to-low (average prompt/completion price), context-high-to-low (context length), throughput-high-to-low, latency-low-to-high (recent median performance), most-popular, top-weekly (tokens processed in the last week), newest (creation date), intelligence-high-to-low (Artificial Analysis intelligence index), design-arena-elo-high-to-low (best Design Arena ELO across arenas). Models without a score for the chosen benchmark are placed last. When omitted, the existing default ordering is preserved."""
|
||||||
|
|
||||||
q: Annotated[
|
q: Annotated[
|
||||||
Optional[str],
|
Optional[str],
|
||||||
|
|||||||
@@ -0,0 +1,112 @@
|
|||||||
|
"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
|
||||||
|
|
||||||
|
from __future__ import annotations
|
||||||
|
from openrouter.types import BaseModel
|
||||||
|
from openrouter.utils import FieldMetadata, HeaderMetadata, QueryParamMetadata
|
||||||
|
import pydantic
|
||||||
|
from typing import Literal, Optional
|
||||||
|
from typing_extensions import Annotated, NotRequired, TypedDict
|
||||||
|
|
||||||
|
|
||||||
|
class GetTaskClassificationsGlobalsTypedDict(TypedDict):
|
||||||
|
http_referer: NotRequired[str]
|
||||||
|
r"""The app identifier should be your app's URL and is used as the primary identifier for rankings.
|
||||||
|
This is used to track API usage per application.
|
||||||
|
|
||||||
|
"""
|
||||||
|
x_open_router_title: NotRequired[str]
|
||||||
|
r"""The app display name allows you to customize how your app appears in OpenRouter's dashboard.
|
||||||
|
|
||||||
|
"""
|
||||||
|
x_open_router_categories: NotRequired[str]
|
||||||
|
r"""Comma-separated list of app categories (e.g. \"cli-agent,cloud-agent\"). Used for marketplace rankings.
|
||||||
|
|
||||||
|
"""
|
||||||
|
|
||||||
|
|
||||||
|
class GetTaskClassificationsGlobals(BaseModel):
|
||||||
|
http_referer: Annotated[
|
||||||
|
Optional[str],
|
||||||
|
pydantic.Field(alias="HTTP-Referer"),
|
||||||
|
FieldMetadata(header=HeaderMetadata(style="simple", explode=False)),
|
||||||
|
] = None
|
||||||
|
r"""The app identifier should be your app's URL and is used as the primary identifier for rankings.
|
||||||
|
This is used to track API usage per application.
|
||||||
|
|
||||||
|
"""
|
||||||
|
|
||||||
|
x_open_router_title: Annotated[
|
||||||
|
Optional[str],
|
||||||
|
pydantic.Field(alias="X-OpenRouter-Title"),
|
||||||
|
FieldMetadata(header=HeaderMetadata(style="simple", explode=False)),
|
||||||
|
] = None
|
||||||
|
r"""The app display name allows you to customize how your app appears in OpenRouter's dashboard.
|
||||||
|
|
||||||
|
"""
|
||||||
|
|
||||||
|
x_open_router_categories: Annotated[
|
||||||
|
Optional[str],
|
||||||
|
pydantic.Field(alias="X-OpenRouter-Categories"),
|
||||||
|
FieldMetadata(header=HeaderMetadata(style="simple", explode=False)),
|
||||||
|
] = None
|
||||||
|
r"""Comma-separated list of app categories (e.g. \"cli-agent,cloud-agent\"). Used for marketplace rankings.
|
||||||
|
|
||||||
|
"""
|
||||||
|
|
||||||
|
|
||||||
|
Window = Literal["7d",]
|
||||||
|
r"""Trailing time window for the classification data. Currently only `7d` (trailing 7 days) is supported."""
|
||||||
|
|
||||||
|
|
||||||
|
class GetTaskClassificationsRequestTypedDict(TypedDict):
|
||||||
|
http_referer: NotRequired[str]
|
||||||
|
r"""The app identifier should be your app's URL and is used as the primary identifier for rankings.
|
||||||
|
This is used to track API usage per application.
|
||||||
|
|
||||||
|
"""
|
||||||
|
x_open_router_title: NotRequired[str]
|
||||||
|
r"""The app display name allows you to customize how your app appears in OpenRouter's dashboard.
|
||||||
|
|
||||||
|
"""
|
||||||
|
x_open_router_categories: NotRequired[str]
|
||||||
|
r"""Comma-separated list of app categories (e.g. \"cli-agent,cloud-agent\"). Used for marketplace rankings.
|
||||||
|
|
||||||
|
"""
|
||||||
|
window: NotRequired[Window]
|
||||||
|
r"""Trailing time window for the classification data. Currently only `7d` (trailing 7 days) is supported."""
|
||||||
|
|
||||||
|
|
||||||
|
class GetTaskClassificationsRequest(BaseModel):
|
||||||
|
http_referer: Annotated[
|
||||||
|
Optional[str],
|
||||||
|
pydantic.Field(alias="HTTP-Referer"),
|
||||||
|
FieldMetadata(header=HeaderMetadata(style="simple", explode=False)),
|
||||||
|
] = None
|
||||||
|
r"""The app identifier should be your app's URL and is used as the primary identifier for rankings.
|
||||||
|
This is used to track API usage per application.
|
||||||
|
|
||||||
|
"""
|
||||||
|
|
||||||
|
x_open_router_title: Annotated[
|
||||||
|
Optional[str],
|
||||||
|
pydantic.Field(alias="X-OpenRouter-Title"),
|
||||||
|
FieldMetadata(header=HeaderMetadata(style="simple", explode=False)),
|
||||||
|
] = None
|
||||||
|
r"""The app display name allows you to customize how your app appears in OpenRouter's dashboard.
|
||||||
|
|
||||||
|
"""
|
||||||
|
|
||||||
|
x_open_router_categories: Annotated[
|
||||||
|
Optional[str],
|
||||||
|
pydantic.Field(alias="X-OpenRouter-Categories"),
|
||||||
|
FieldMetadata(header=HeaderMetadata(style="simple", explode=False)),
|
||||||
|
] = None
|
||||||
|
r"""Comma-separated list of app categories (e.g. \"cli-agent,cloud-agent\"). Used for marketplace rankings.
|
||||||
|
|
||||||
|
"""
|
||||||
|
|
||||||
|
window: Annotated[
|
||||||
|
Optional[Window],
|
||||||
|
FieldMetadata(query=QueryParamMetadata(style="form", explode=True)),
|
||||||
|
] = "7d"
|
||||||
|
r"""Trailing time window for the classification data. Currently only `7d` (trailing 7 days) is supported."""
|
||||||
@@ -101,8 +101,10 @@ Provider = Union[
|
|||||||
"google-ai-studio",
|
"google-ai-studio",
|
||||||
"google-vertex",
|
"google-vertex",
|
||||||
"groq",
|
"groq",
|
||||||
|
"heygen",
|
||||||
"inception",
|
"inception",
|
||||||
"inceptron",
|
"inceptron",
|
||||||
|
"inferact-vllm",
|
||||||
"inference-net",
|
"inference-net",
|
||||||
"infermatic",
|
"infermatic",
|
||||||
"inflection",
|
"inflection",
|
||||||
@@ -130,9 +132,11 @@ Provider = Union[
|
|||||||
"perplexity",
|
"perplexity",
|
||||||
"phala",
|
"phala",
|
||||||
"poolside",
|
"poolside",
|
||||||
|
"quiver",
|
||||||
"recraft",
|
"recraft",
|
||||||
"reka",
|
"reka",
|
||||||
"relace",
|
"relace",
|
||||||
|
"sakana-ai",
|
||||||
"sambanova",
|
"sambanova",
|
||||||
"seed",
|
"seed",
|
||||||
"siliconflow",
|
"siliconflow",
|
||||||
@@ -140,6 +144,7 @@ Provider = Union[
|
|||||||
"stepfun",
|
"stepfun",
|
||||||
"streamlake",
|
"streamlake",
|
||||||
"switchpoint",
|
"switchpoint",
|
||||||
|
"tenstorrent",
|
||||||
"together",
|
"together",
|
||||||
"upstage",
|
"upstage",
|
||||||
"venice",
|
"venice",
|
||||||
|
|||||||
@@ -0,0 +1,114 @@
|
|||||||
|
"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
|
||||||
|
|
||||||
|
from __future__ import annotations
|
||||||
|
from openrouter.types import BaseModel
|
||||||
|
from openrouter.utils import FieldMetadata, HeaderMetadata, PathParamMetadata
|
||||||
|
import pydantic
|
||||||
|
from typing import Optional
|
||||||
|
from typing_extensions import Annotated, NotRequired, TypedDict
|
||||||
|
|
||||||
|
|
||||||
|
class ListImageModelEndpointsGlobalsTypedDict(TypedDict):
|
||||||
|
http_referer: NotRequired[str]
|
||||||
|
r"""The app identifier should be your app's URL and is used as the primary identifier for rankings.
|
||||||
|
This is used to track API usage per application.
|
||||||
|
|
||||||
|
"""
|
||||||
|
x_open_router_title: NotRequired[str]
|
||||||
|
r"""The app display name allows you to customize how your app appears in OpenRouter's dashboard.
|
||||||
|
|
||||||
|
"""
|
||||||
|
x_open_router_categories: NotRequired[str]
|
||||||
|
r"""Comma-separated list of app categories (e.g. \"cli-agent,cloud-agent\"). Used for marketplace rankings.
|
||||||
|
|
||||||
|
"""
|
||||||
|
|
||||||
|
|
||||||
|
class ListImageModelEndpointsGlobals(BaseModel):
|
||||||
|
http_referer: Annotated[
|
||||||
|
Optional[str],
|
||||||
|
pydantic.Field(alias="HTTP-Referer"),
|
||||||
|
FieldMetadata(header=HeaderMetadata(style="simple", explode=False)),
|
||||||
|
] = None
|
||||||
|
r"""The app identifier should be your app's URL and is used as the primary identifier for rankings.
|
||||||
|
This is used to track API usage per application.
|
||||||
|
|
||||||
|
"""
|
||||||
|
|
||||||
|
x_open_router_title: Annotated[
|
||||||
|
Optional[str],
|
||||||
|
pydantic.Field(alias="X-OpenRouter-Title"),
|
||||||
|
FieldMetadata(header=HeaderMetadata(style="simple", explode=False)),
|
||||||
|
] = None
|
||||||
|
r"""The app display name allows you to customize how your app appears in OpenRouter's dashboard.
|
||||||
|
|
||||||
|
"""
|
||||||
|
|
||||||
|
x_open_router_categories: Annotated[
|
||||||
|
Optional[str],
|
||||||
|
pydantic.Field(alias="X-OpenRouter-Categories"),
|
||||||
|
FieldMetadata(header=HeaderMetadata(style="simple", explode=False)),
|
||||||
|
] = None
|
||||||
|
r"""Comma-separated list of app categories (e.g. \"cli-agent,cloud-agent\"). Used for marketplace rankings.
|
||||||
|
|
||||||
|
"""
|
||||||
|
|
||||||
|
|
||||||
|
class ListImageModelEndpointsRequestTypedDict(TypedDict):
|
||||||
|
author: str
|
||||||
|
r"""Model author/organization"""
|
||||||
|
slug: str
|
||||||
|
r"""Model slug"""
|
||||||
|
http_referer: NotRequired[str]
|
||||||
|
r"""The app identifier should be your app's URL and is used as the primary identifier for rankings.
|
||||||
|
This is used to track API usage per application.
|
||||||
|
|
||||||
|
"""
|
||||||
|
x_open_router_title: NotRequired[str]
|
||||||
|
r"""The app display name allows you to customize how your app appears in OpenRouter's dashboard.
|
||||||
|
|
||||||
|
"""
|
||||||
|
x_open_router_categories: NotRequired[str]
|
||||||
|
r"""Comma-separated list of app categories (e.g. \"cli-agent,cloud-agent\"). Used for marketplace rankings.
|
||||||
|
|
||||||
|
"""
|
||||||
|
|
||||||
|
|
||||||
|
class ListImageModelEndpointsRequest(BaseModel):
|
||||||
|
author: Annotated[
|
||||||
|
str, FieldMetadata(path=PathParamMetadata(style="simple", explode=False))
|
||||||
|
]
|
||||||
|
r"""Model author/organization"""
|
||||||
|
|
||||||
|
slug: Annotated[
|
||||||
|
str, FieldMetadata(path=PathParamMetadata(style="simple", explode=False))
|
||||||
|
]
|
||||||
|
r"""Model slug"""
|
||||||
|
|
||||||
|
http_referer: Annotated[
|
||||||
|
Optional[str],
|
||||||
|
pydantic.Field(alias="HTTP-Referer"),
|
||||||
|
FieldMetadata(header=HeaderMetadata(style="simple", explode=False)),
|
||||||
|
] = None
|
||||||
|
r"""The app identifier should be your app's URL and is used as the primary identifier for rankings.
|
||||||
|
This is used to track API usage per application.
|
||||||
|
|
||||||
|
"""
|
||||||
|
|
||||||
|
x_open_router_title: Annotated[
|
||||||
|
Optional[str],
|
||||||
|
pydantic.Field(alias="X-OpenRouter-Title"),
|
||||||
|
FieldMetadata(header=HeaderMetadata(style="simple", explode=False)),
|
||||||
|
] = None
|
||||||
|
r"""The app display name allows you to customize how your app appears in OpenRouter's dashboard.
|
||||||
|
|
||||||
|
"""
|
||||||
|
|
||||||
|
x_open_router_categories: Annotated[
|
||||||
|
Optional[str],
|
||||||
|
pydantic.Field(alias="X-OpenRouter-Categories"),
|
||||||
|
FieldMetadata(header=HeaderMetadata(style="simple", explode=False)),
|
||||||
|
] = None
|
||||||
|
r"""Comma-separated list of app categories (e.g. \"cli-agent,cloud-agent\"). Used for marketplace rankings.
|
||||||
|
|
||||||
|
"""
|
||||||
@@ -0,0 +1,100 @@
|
|||||||
|
"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
|
||||||
|
|
||||||
|
from __future__ import annotations
|
||||||
|
from openrouter.types import BaseModel
|
||||||
|
from openrouter.utils import FieldMetadata, HeaderMetadata
|
||||||
|
import pydantic
|
||||||
|
from typing import Optional
|
||||||
|
from typing_extensions import Annotated, NotRequired, TypedDict
|
||||||
|
|
||||||
|
|
||||||
|
class ListImageModelsGlobalsTypedDict(TypedDict):
|
||||||
|
http_referer: NotRequired[str]
|
||||||
|
r"""The app identifier should be your app's URL and is used as the primary identifier for rankings.
|
||||||
|
This is used to track API usage per application.
|
||||||
|
|
||||||
|
"""
|
||||||
|
x_open_router_title: NotRequired[str]
|
||||||
|
r"""The app display name allows you to customize how your app appears in OpenRouter's dashboard.
|
||||||
|
|
||||||
|
"""
|
||||||
|
x_open_router_categories: NotRequired[str]
|
||||||
|
r"""Comma-separated list of app categories (e.g. \"cli-agent,cloud-agent\"). Used for marketplace rankings.
|
||||||
|
|
||||||
|
"""
|
||||||
|
|
||||||
|
|
||||||
|
class ListImageModelsGlobals(BaseModel):
|
||||||
|
http_referer: Annotated[
|
||||||
|
Optional[str],
|
||||||
|
pydantic.Field(alias="HTTP-Referer"),
|
||||||
|
FieldMetadata(header=HeaderMetadata(style="simple", explode=False)),
|
||||||
|
] = None
|
||||||
|
r"""The app identifier should be your app's URL and is used as the primary identifier for rankings.
|
||||||
|
This is used to track API usage per application.
|
||||||
|
|
||||||
|
"""
|
||||||
|
|
||||||
|
x_open_router_title: Annotated[
|
||||||
|
Optional[str],
|
||||||
|
pydantic.Field(alias="X-OpenRouter-Title"),
|
||||||
|
FieldMetadata(header=HeaderMetadata(style="simple", explode=False)),
|
||||||
|
] = None
|
||||||
|
r"""The app display name allows you to customize how your app appears in OpenRouter's dashboard.
|
||||||
|
|
||||||
|
"""
|
||||||
|
|
||||||
|
x_open_router_categories: Annotated[
|
||||||
|
Optional[str],
|
||||||
|
pydantic.Field(alias="X-OpenRouter-Categories"),
|
||||||
|
FieldMetadata(header=HeaderMetadata(style="simple", explode=False)),
|
||||||
|
] = None
|
||||||
|
r"""Comma-separated list of app categories (e.g. \"cli-agent,cloud-agent\"). Used for marketplace rankings.
|
||||||
|
|
||||||
|
"""
|
||||||
|
|
||||||
|
|
||||||
|
class ListImageModelsRequestTypedDict(TypedDict):
|
||||||
|
http_referer: NotRequired[str]
|
||||||
|
r"""The app identifier should be your app's URL and is used as the primary identifier for rankings.
|
||||||
|
This is used to track API usage per application.
|
||||||
|
|
||||||
|
"""
|
||||||
|
x_open_router_title: NotRequired[str]
|
||||||
|
r"""The app display name allows you to customize how your app appears in OpenRouter's dashboard.
|
||||||
|
|
||||||
|
"""
|
||||||
|
x_open_router_categories: NotRequired[str]
|
||||||
|
r"""Comma-separated list of app categories (e.g. \"cli-agent,cloud-agent\"). Used for marketplace rankings.
|
||||||
|
|
||||||
|
"""
|
||||||
|
|
||||||
|
|
||||||
|
class ListImageModelsRequest(BaseModel):
|
||||||
|
http_referer: Annotated[
|
||||||
|
Optional[str],
|
||||||
|
pydantic.Field(alias="HTTP-Referer"),
|
||||||
|
FieldMetadata(header=HeaderMetadata(style="simple", explode=False)),
|
||||||
|
] = None
|
||||||
|
r"""The app identifier should be your app's URL and is used as the primary identifier for rankings.
|
||||||
|
This is used to track API usage per application.
|
||||||
|
|
||||||
|
"""
|
||||||
|
|
||||||
|
x_open_router_title: Annotated[
|
||||||
|
Optional[str],
|
||||||
|
pydantic.Field(alias="X-OpenRouter-Title"),
|
||||||
|
FieldMetadata(header=HeaderMetadata(style="simple", explode=False)),
|
||||||
|
] = None
|
||||||
|
r"""The app display name allows you to customize how your app appears in OpenRouter's dashboard.
|
||||||
|
|
||||||
|
"""
|
||||||
|
|
||||||
|
x_open_router_categories: Annotated[
|
||||||
|
Optional[str],
|
||||||
|
pydantic.Field(alias="X-OpenRouter-Categories"),
|
||||||
|
FieldMetadata(header=HeaderMetadata(style="simple", explode=False)),
|
||||||
|
] = None
|
||||||
|
r"""Comma-separated list of app categories (e.g. \"cli-agent,cloud-agent\"). Used for marketplace rankings.
|
||||||
|
|
||||||
|
"""
|
||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user