mirror of
https://github.com/wassname/openrouter-python-sdk-retry-errors.git
synced 2026-07-31 12:30:30 +08:00
Compare commits
188
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
6c83145dee | ||
|
|
d8b76e8bd4 | ||
|
|
7e29e408af | ||
|
|
30bc131b97 | ||
|
|
1b0118c365 | ||
|
|
cda73e5ebf | ||
|
|
b0eda78d3f | ||
|
|
bf682bdb62 | ||
|
|
b322622117 | ||
|
|
415450e785 | ||
|
|
1d488f0117 | ||
|
|
4e789208b4 | ||
|
|
cdd4dc7302 | ||
|
|
60708e1e8b | ||
|
|
5a324f99ae | ||
|
|
d5778dfafb | ||
|
|
68c251830c | ||
|
|
2aa2d73d2d | ||
|
|
58bd390fbd | ||
|
|
2707901239 | ||
|
|
a5ed2de8a8 | ||
|
|
21893dda58 | ||
|
|
758a2f3d49 | ||
|
|
0331f14f19 | ||
|
|
138b131a35 | ||
|
|
55c0d5c7fd | ||
|
|
e98a7a8260 | ||
|
|
7e7787cb23 | ||
|
|
c4b508f045 | ||
|
|
52e7853d21 | ||
|
|
d43061f722 | ||
|
|
7b10fd47d8 | ||
|
|
95f2c87bfa | ||
|
|
c756fc51e0 | ||
|
|
386db75669 | ||
|
|
e3dc2e6f4c | ||
|
|
70c8757fc0 | ||
|
|
b794150ed9 | ||
|
|
0f116c9792 | ||
|
|
0c735989c1 | ||
|
|
3b2f5b2316 | ||
|
|
3883438f02 | ||
|
|
1cd1e66e2d | ||
|
|
f29a61de7e | ||
|
|
1725abad89 | ||
|
|
8df520997d | ||
|
|
c4843278fd | ||
|
|
ccbd6d16f8 | ||
|
|
80646bd8a6 | ||
|
|
68fc6f0ee9 | ||
|
|
23ee599564 | ||
|
|
2203de96b4 | ||
|
|
b7d5098042 | ||
|
|
b9f588d84b | ||
|
|
5caa85a52c | ||
|
|
fc328cd45d | ||
|
|
234901509f | ||
|
|
771a5b1a52 | ||
|
|
93dd1b59fd | ||
|
|
698e7d6d7e | ||
|
|
fe4080dfda | ||
|
|
1090ab30b2 | ||
|
|
51a8873f33 | ||
|
|
a95178f8b3 | ||
|
|
63b73f57d4 | ||
|
|
6ceb25ca84 | ||
|
|
b5aca7806b | ||
|
|
4610ea4719 | ||
|
|
67bd50597a | ||
|
|
859e89d545 | ||
|
|
f94fcc1eb1 | ||
|
|
c361f61f5b | ||
|
|
f119275b26 | ||
|
|
460658428f | ||
|
|
5d441447a9 | ||
|
|
d549103228 | ||
|
|
3e77e61a5c | ||
|
|
e0dddac466 | ||
|
|
32c6c506cf | ||
|
|
59a8775ed7 | ||
|
|
e7a06917b2 | ||
|
|
d8c617dfd2 | ||
|
|
752156a9ad | ||
|
|
688c063276 | ||
|
|
da19555f7f | ||
|
|
0ecf2ef253 | ||
|
|
a7fd661299 | ||
|
|
c5e2532cc4 | ||
|
|
0aa6eabffd | ||
|
|
205749ae6b | ||
|
|
bf8a2c6adc | ||
|
|
9312cabf22 | ||
|
|
ec85ab283b | ||
|
|
4c5911ffee | ||
|
|
882f4a0811 | ||
|
|
90f661ff73 | ||
|
|
bb74b7fabc | ||
|
|
a7bb403311 | ||
|
|
522b03abf3 | ||
|
|
be479e24fd | ||
|
|
a4197ac1db | ||
|
|
f587c3ce45 | ||
|
|
a4ae8297ce | ||
|
|
4664c73492 | ||
|
|
e150991aa7 | ||
|
|
5f18dd0131 | ||
|
|
5441e86fee | ||
|
|
bb505b71e5 | ||
|
|
45c3ace681 | ||
|
|
d208cc6cf8 | ||
|
|
fb31150e8f | ||
|
|
e0e80c538a | ||
|
|
7db74e51d1 | ||
|
|
27c12d4d59 | ||
|
|
cd24443470 | ||
|
|
2fc0ea8084 | ||
|
|
330cff1158 | ||
|
|
8ac9dede84 | ||
|
|
c10bbfe084 | ||
|
|
3d1fdef97a | ||
|
|
067cdc027a | ||
|
|
5bad276c29 | ||
|
|
f3699017d5 | ||
|
|
b202e599ae | ||
|
|
be9056bcbe | ||
|
|
cb23cec150 | ||
|
|
312ffce1c5 | ||
|
|
c5e87b6ab2 | ||
|
|
a23c20f60b | ||
|
|
e6703a5038 | ||
|
|
9ce403745a | ||
|
|
175b135377 | ||
|
|
0503928934 | ||
|
|
6006c3a84f | ||
|
|
c2a933ff6b | ||
|
|
a34a1456a1 | ||
|
|
a40c0019c1 | ||
|
|
5881e47375 | ||
|
|
6989ad4f40 | ||
|
|
b2386114cd | ||
|
|
2bba049182 | ||
|
|
e8953c70bd | ||
|
|
29fdfcedc3 | ||
|
|
c0959955c1 | ||
|
|
a0a7edecfa | ||
|
|
4e84bb736b | ||
|
|
947e92e68d | ||
|
|
bdbd8becc2 | ||
|
|
6ef088e7c7 | ||
|
|
e4e5cc259a | ||
|
|
06bea2ae0f | ||
|
|
6b1b7e6a9d | ||
|
|
dd8e6bdac2 | ||
|
|
e6b0242969 | ||
|
|
5ab44f08f0 | ||
|
|
e72a84e82d | ||
|
|
c734c52d9c | ||
|
|
b2098ff28e | ||
|
|
1cad51abb6 | ||
|
|
0c791b04d1 | ||
|
|
5f2c0ee2ea | ||
|
|
5832c0495b | ||
|
|
f5dfc30997 | ||
|
|
a56ffbf5f3 | ||
|
|
cc2b002c5c | ||
|
|
9774c726fd | ||
|
|
3a40848aab | ||
|
|
f190e3f950 | ||
|
|
d433ce35e8 | ||
|
|
61e5216764 | ||
|
|
67ef52b03e | ||
|
|
d4474da1b8 | ||
|
|
aed8199b2b | ||
|
|
06b2ccc54a | ||
|
|
6cd0d2a76d | ||
|
|
a1dae775cb | ||
|
|
10a76ba502 | ||
|
|
f4ffd51f40 | ||
|
|
20c63f6f13 | ||
|
|
0f9cb9787a | ||
|
|
6c5dfcfb2b | ||
|
|
afbf99e8bf | ||
|
|
6895d9d45b | ||
|
|
e824ca8a57 | ||
|
|
e70f43e916 | ||
|
|
94ba44c933 | ||
|
|
d13e797ad1 | ||
|
|
3629471122 |
@@ -1,7 +1,9 @@
|
||||
{
|
||||
"permissions": {
|
||||
"allow": [
|
||||
"Bash(python3:*)"
|
||||
"Bash(python3:*)",
|
||||
"Bash(git push:*)",
|
||||
"Bash(gh pr create:*)"
|
||||
],
|
||||
"deny": [],
|
||||
"ask": []
|
||||
|
||||
@@ -1,4 +1,9 @@
|
||||
|
||||
<div align="center">
|
||||
<a href="https://codespaces.new/OpenRouterTeam/python-sdk.git/tree/main"><img src="https://github.com/codespaces/badge.svg" /></a>
|
||||
</div>
|
||||
<br>
|
||||
|
||||
> **Remember to shutdown a GitHub Codespace when it is not in use!**
|
||||
|
||||
# Dev Containers Quick Start
|
||||
|
||||
@@ -0,0 +1,86 @@
|
||||
name: Auto-merge Speakeasy PR
|
||||
|
||||
# Speakeasy mode:pr opens PRs (speakeasy-sdk-regen-*) and labels them
|
||||
# patch/minor/major. Merge automatically so sdk_publish.yaml can run.
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
types: [labeled]
|
||||
|
||||
permissions:
|
||||
contents: write
|
||||
pull-requests: write
|
||||
|
||||
concurrency:
|
||||
group: auto-merge-speakeasy
|
||||
cancel-in-progress: false
|
||||
|
||||
jobs:
|
||||
auto-merge:
|
||||
if: |
|
||||
github.event.sender.login == 'github-actions[bot]' &&
|
||||
github.event.pull_request.user.login == 'github-actions[bot]' &&
|
||||
startsWith(github.event.pull_request.head.ref, 'speakeasy-sdk-regen-') &&
|
||||
contains(github.event.pull_request.title, '🐝 Update SDK') &&
|
||||
contains(fromJSON('["patch", "minor", "major"]'), github.event.label.name)
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Close superseded Speakeasy PRs
|
||||
env:
|
||||
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
run: |
|
||||
set -euo pipefail
|
||||
CURRENT_PR="${{ github.event.pull_request.number }}"
|
||||
|
||||
PRIOR_JSON=$(gh pr list \
|
||||
--repo "${{ github.repository }}" \
|
||||
--state open \
|
||||
--search "head:speakeasy-sdk-regen-" \
|
||||
--limit 500 \
|
||||
--json number \
|
||||
| jq -r --arg cur "$CURRENT_PR" \
|
||||
'[.[].number | select(tostring != $cur)] | .[]')
|
||||
|
||||
if [ -z "$PRIOR_JSON" ]; then
|
||||
echo "No superseded Speakeasy PRs to close"
|
||||
exit 0
|
||||
fi
|
||||
|
||||
mapfile -t PRIOR <<< "$PRIOR_JSON"
|
||||
|
||||
echo "Closing ${#PRIOR[@]} superseded Speakeasy PR(s)"
|
||||
for N in "${PRIOR[@]}"; do
|
||||
gh pr close "$N" --repo "${{ github.repository }}" --delete-branch \
|
||||
--comment "Superseded by newer Speakeasy SDK generation PR #${CURRENT_PR}" \
|
||||
|| echo "::warning::Failed to close PR #$N (continuing)"
|
||||
sleep 1
|
||||
done
|
||||
|
||||
- name: Auto-merge Speakeasy PR
|
||||
env:
|
||||
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
run: |
|
||||
set -euo pipefail
|
||||
PR_NUM="${{ github.event.pull_request.number }}"
|
||||
REPO="${{ github.repository }}"
|
||||
|
||||
STATE=$(gh pr view "$PR_NUM" --repo "$REPO" --json state --jq .state)
|
||||
if [ "$STATE" != "OPEN" ]; then
|
||||
echo "PR #$PR_NUM is $STATE — skipping merge"
|
||||
exit 0
|
||||
fi
|
||||
|
||||
# Prefer GitHub auto-merge when required checks exist; otherwise
|
||||
# squash-merge directly (same pattern as sdk-release-prs.yaml).
|
||||
AUTO_MERGE_NOOP_PATTERN='is in clean status|protected branch rules|Branch does not have required protected branch rules'
|
||||
if gh pr merge "$PR_NUM" --repo "$REPO" --squash --auto --delete-branch 2> /tmp/gh-merge.err; then
|
||||
echo "Auto-merge enabled for Speakeasy PR #$PR_NUM"
|
||||
elif grep -qiE "$AUTO_MERGE_NOOP_PATTERN" /tmp/gh-merge.err; then
|
||||
echo "Auto-merge not applicable — merging PR #$PR_NUM directly"
|
||||
cat /tmp/gh-merge.err >&2
|
||||
gh pr merge "$PR_NUM" --repo "$REPO" --squash --delete-branch
|
||||
else
|
||||
echo "::error::Failed to enable auto-merge on Speakeasy PR #$PR_NUM"
|
||||
cat /tmp/gh-merge.err >&2
|
||||
exit 1
|
||||
fi
|
||||
@@ -0,0 +1,46 @@
|
||||
name: Notify Monorepo of Changes
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
|
||||
jobs:
|
||||
notify-monorepo:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Send repository dispatch to monorepo
|
||||
run: |
|
||||
# Determine which event type to send based on repository name
|
||||
REPO_NAME="${GITHUB_REPOSITORY#*/}" # Gets 'python-sdk' from 'OpenRouterTeam/python-sdk'
|
||||
|
||||
case "$REPO_NAME" in
|
||||
"typescript-sdk")
|
||||
EVENT_TYPE="sync-typescript-sdk"
|
||||
;;
|
||||
"python-sdk")
|
||||
EVENT_TYPE="sync-python-sdk"
|
||||
;;
|
||||
"ai-sdk-provider")
|
||||
EVENT_TYPE="sync-ai-sdk-provider"
|
||||
;;
|
||||
"cli")
|
||||
EVENT_TYPE="sync-cli"
|
||||
;;
|
||||
*)
|
||||
echo "Unknown repository: $REPO_NAME"
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
|
||||
echo "Sending repository_dispatch event: $EVENT_TYPE"
|
||||
|
||||
curl -L \
|
||||
-X POST \
|
||||
-H "Accept: application/vnd.github+json" \
|
||||
-H "Authorization: Bearer ${{ secrets.MONOREPO_SYNC_TOKEN }}" \
|
||||
-H "X-GitHub-Api-Version: 2022-11-28" \
|
||||
https://api.github.com/repos/OpenRouterTeam/openrouter-web/dispatches \
|
||||
-d "{\"event_type\":\"$EVENT_TYPE\",\"client_payload\":{\"repository\":\"$GITHUB_REPOSITORY\",\"ref\":\"$GITHUB_REF\",\"sha\":\"$GITHUB_SHA\"}}"
|
||||
|
||||
echo "✅ Notification sent to monorepo"
|
||||
@@ -0,0 +1,36 @@
|
||||
name: Generate (spec change merged)
|
||||
permissions:
|
||||
checks: write
|
||||
contents: write
|
||||
pull-requests: write
|
||||
statuses: write
|
||||
id-token: write
|
||||
"on":
|
||||
workflow_dispatch:
|
||||
inputs:
|
||||
force:
|
||||
description: Force generation of SDKs
|
||||
type: boolean
|
||||
default: false
|
||||
set_version:
|
||||
description: optionally set a specific SDK version
|
||||
type: string
|
||||
pull_request:
|
||||
types: [closed]
|
||||
branches:
|
||||
- main
|
||||
paths:
|
||||
- .speakeasy/in.openapi.yaml
|
||||
|
||||
jobs:
|
||||
generate:
|
||||
if: github.event.pull_request.merged == true || github.event_name == 'workflow_dispatch'
|
||||
uses: speakeasy-api/sdk-generation-action/.github/workflows/workflow-executor.yaml@v15
|
||||
with:
|
||||
force: ${{ github.event.inputs.force }}
|
||||
mode: pr
|
||||
set_version: ${{ github.event.inputs.set_version }}
|
||||
secrets:
|
||||
github_access_token: ${{ secrets.GITHUB_TOKEN }}
|
||||
pypi_token: ${{ secrets.PYPI_TOKEN }}
|
||||
speakeasy_api_key: ${{ secrets.SPEAKEASY_API_KEY }}
|
||||
+14
-2
@@ -1,13 +1,25 @@
|
||||
.venv/
|
||||
venv/
|
||||
src/*.egg-info/
|
||||
**/__pycache__/
|
||||
.pytest_cache/
|
||||
.python-version
|
||||
.DS_Store
|
||||
pyrightconfig.json
|
||||
**/.speakeasy/temp/
|
||||
**/.speakeasy/logs/
|
||||
.speakeasy/reports
|
||||
# Build artifacts
|
||||
/dist
|
||||
__pycache__/
|
||||
*.py[cod]
|
||||
*.egg-info/
|
||||
*.egg
|
||||
# Speakeasy generation artifacts (generated in OSS repo, not here)
|
||||
.speakeasy/*.lock
|
||||
.speakeasy/*.openapi.yaml
|
||||
/docs
|
||||
# Environment
|
||||
.env
|
||||
.env.local
|
||||
.env.*.local
|
||||
.DS_Store
|
||||
.venv/
|
||||
|
||||
+9769
-802
File diff suppressed because it is too large
Load Diff
+18
-7
@@ -6,7 +6,7 @@ generation:
|
||||
sdkClassName: OpenRouter
|
||||
maintainOpenAPIOrder: true
|
||||
usageSnippets:
|
||||
optionalPropertyRendering: withExample
|
||||
optionalPropertyRendering: never
|
||||
sdkInitStyle: constructor
|
||||
useClassNamesForArrayFields: true
|
||||
fixes:
|
||||
@@ -24,13 +24,15 @@ generation:
|
||||
sdkHooksConfigAccess: true
|
||||
schemas:
|
||||
allOfMergeStrategy: shallowMerge
|
||||
requestBodyFieldName: body
|
||||
requestBodyFieldName: ""
|
||||
persistentEdits: {}
|
||||
tests:
|
||||
generateTests: false
|
||||
generateNewTests: true
|
||||
skipResponseBodyAssertions: false
|
||||
preApplyUnionDiscriminators: true
|
||||
python:
|
||||
version: 0.0.8
|
||||
version: 0.10.1
|
||||
additionalDependencies:
|
||||
dev: {}
|
||||
main: {}
|
||||
@@ -38,11 +40,14 @@ python:
|
||||
- id
|
||||
- object
|
||||
- input
|
||||
- models
|
||||
- hash
|
||||
asyncMode: both
|
||||
authors:
|
||||
- OpenRouter
|
||||
baseErrorName: OpenRouterError
|
||||
clientServerStatusCodesAsErrors: true
|
||||
constFieldCasing: upper
|
||||
defaultErrorName: OpenRouterDefaultError
|
||||
description: Official Python Client SDK for OpenRouter.
|
||||
enableCustomCodeRegions: false
|
||||
@@ -54,22 +59,28 @@ python:
|
||||
flattenGlobalSecurity: true
|
||||
flattenRequests: true
|
||||
flatteningOrder: parameters-first
|
||||
forwardCompatibleUnionsByDefault: tagged-only
|
||||
imports:
|
||||
option: openapi
|
||||
paths:
|
||||
callbacks: ""
|
||||
callbacks: callbacks
|
||||
errors: errors
|
||||
operations: ""
|
||||
shared: ""
|
||||
webhooks: ""
|
||||
operations: operations
|
||||
shared: components
|
||||
webhooks: webhooks
|
||||
inferSSEOverload: true
|
||||
inferUnionDiscriminators: true
|
||||
inputModelSuffix: input
|
||||
legacyPyright: false
|
||||
license: Apache-2.0
|
||||
maxMethodParams: 999
|
||||
methodArguments: infer-optional-args
|
||||
moduleName: ""
|
||||
multipartArrayFormat: legacy
|
||||
outputModelSuffix: output
|
||||
packageManager: uv
|
||||
packageName: openrouter
|
||||
preApplyUnionDiscriminators: false
|
||||
pytestFilterWarnings: []
|
||||
pytestTimeout: 0
|
||||
responseFormat: flat
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,10 @@
|
||||
lintVersion: 1.0.0
|
||||
defaultRuleset: openrouter
|
||||
rulesets:
|
||||
openrouter:
|
||||
rulesets:
|
||||
- speakeasy-recommended
|
||||
- speakeasy-generation
|
||||
rules:
|
||||
oas3-missing-example:
|
||||
severity: "off"
|
||||
+32488
-8220
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,52 @@
|
||||
overlay: 1.0.0
|
||||
x-speakeasy-jsonpath: rfc9535
|
||||
info:
|
||||
title: Add HTTP-Referer and X-OpenRouter-Title as global parameters
|
||||
version: 0.0.0
|
||||
actions:
|
||||
# Add global parameters for app identification
|
||||
- target: $
|
||||
description: Add x-speakeasy-globals for HTTP-Referer, X-OpenRouter-Title, and X-OpenRouter-Categories headers
|
||||
update:
|
||||
x-speakeasy-globals:
|
||||
parameters:
|
||||
- $ref: "#/components/parameters/AppIdentifier"
|
||||
- $ref: "#/components/parameters/AppDisplayName"
|
||||
- $ref: "#/components/parameters/AppCategories"
|
||||
|
||||
# Add component parameters
|
||||
- target: $.components
|
||||
description: Add parameters for app identification headers
|
||||
update:
|
||||
parameters:
|
||||
AppIdentifier:
|
||||
name: HTTP-Referer
|
||||
in: header
|
||||
schema:
|
||||
type: string
|
||||
description: |
|
||||
The app identifier should be your app's URL and is used as the primary identifier for rankings.
|
||||
This is used to track API usage per application.
|
||||
AppDisplayName:
|
||||
name: X-OpenRouter-Title
|
||||
in: header
|
||||
schema:
|
||||
type: string
|
||||
description: |
|
||||
The app display name allows you to customize how your app appears in OpenRouter's dashboard.
|
||||
AppCategories:
|
||||
name: X-OpenRouter-Categories
|
||||
in: header
|
||||
schema:
|
||||
type: string
|
||||
description: |
|
||||
Comma-separated list of app categories (e.g. "cli-agent,cloud-agent"). Used for marketplace rankings.
|
||||
|
||||
# Add header parameters to all paths so Speakeasy matches them with globals
|
||||
- target: $.paths[*]
|
||||
description: Reference app identification headers on all paths so Speakeasy injects them via globals
|
||||
update:
|
||||
parameters:
|
||||
- $ref: "#/components/parameters/AppIdentifier"
|
||||
- $ref: "#/components/parameters/AppDisplayName"
|
||||
- $ref: "#/components/parameters/AppCategories"
|
||||
@@ -0,0 +1,11 @@
|
||||
overlay: 1.0.0
|
||||
x-speakeasy-jsonpath: rfc9535
|
||||
info:
|
||||
title: Simplify redundant allOf inline schemas
|
||||
version: 0.0.0
|
||||
actions:
|
||||
- target: "$..allOf[?@.enum && !@['$ref']]"
|
||||
description: >
|
||||
Remove inline enum definitions that duplicate a $ref enum in the same
|
||||
allOf. These are artifacts from zod-openapi .extend() serialization.
|
||||
remove: true
|
||||
@@ -0,0 +1,10 @@
|
||||
overlay: 1.0.0
|
||||
x-speakeasy-jsonpath: rfc9535
|
||||
info:
|
||||
title: Convert boolean query params from string to boolean
|
||||
version: 0.0.0
|
||||
actions:
|
||||
- target: $..parameters[?@.schema["x-openrouter-type"] == "boolean"].schema
|
||||
description: Convert x-openrouter-type boolean params from string to boolean
|
||||
update:
|
||||
type: boolean
|
||||
@@ -0,0 +1,10 @@
|
||||
overlay: 1.0.0
|
||||
x-speakeasy-jsonpath: rfc9535
|
||||
info:
|
||||
title: Fix nullable pagination params
|
||||
version: 0.0.0
|
||||
actions:
|
||||
- target: $..parameters[?@.name == "offset" && @.in == "query"].schema
|
||||
description: Remove nullable from offset query params to fix mypy errors in pagination helpers
|
||||
update:
|
||||
nullable: false
|
||||
@@ -0,0 +1,10 @@
|
||||
overlay: 1.0.0
|
||||
x-speakeasy-jsonpath: rfc9535
|
||||
info:
|
||||
title: Add open enums
|
||||
version: 0.0.0
|
||||
actions:
|
||||
- target: $..[?length(@.enum) > 1]
|
||||
description: Automatically open all enums that have length > 1
|
||||
update:
|
||||
x-speakeasy-unknown-values: allow
|
||||
@@ -0,0 +1,15 @@
|
||||
overlay: 1.0.0
|
||||
x-speakeasy-jsonpath: rfc9535
|
||||
info:
|
||||
title: Remove RSS+XML response schemas and related parameters
|
||||
version: 0.0.0
|
||||
actions:
|
||||
- target: $..responses.*.content["application/rss+xml"]
|
||||
description: Remove application/rss+xml response schemas
|
||||
remove: true
|
||||
- target: $..parameters[?@.name == "use_rss"]
|
||||
description: Remove use_rss parameter
|
||||
remove: true
|
||||
- target: $..parameters[?@.name == "use_rss_chat_links"]
|
||||
description: Remove use_rss_chat_links parameter
|
||||
remove: true
|
||||
+24
-13
@@ -1,37 +1,48 @@
|
||||
speakeasyVersion: 1.656.2
|
||||
speakeasyVersion: 1.680.0
|
||||
sources:
|
||||
-OAS:
|
||||
OpenRouter API:
|
||||
sourceNamespace: open-router-chat-completions-api
|
||||
sourceRevisionDigest: sha256:08647b466c00989914e3a2436175152270f771f0a57d055f5bab14cc2d4be89e
|
||||
sourceBlobDigest: sha256:53027ec57392d9617cc001ece83c2fe1aa6e5dbfd52d170381c34c33c6042c23
|
||||
sourceRevisionDigest: sha256:6ca77315c3cd31ab7e308e010b26b7c9eb366b11b78ea9c71179facc4daaf97b
|
||||
sourceBlobDigest: sha256:8bada810c7c5ddb302c51dbbbb36dd0c9a45c4ba1c5e44af1646f69fc2a38751
|
||||
tags:
|
||||
- latest
|
||||
- speakeasy-sdk-regen-1781819857
|
||||
- 1.0.0
|
||||
targets:
|
||||
open-router:
|
||||
source: -OAS
|
||||
source: OpenRouter API
|
||||
sourceNamespace: open-router-chat-completions-api
|
||||
sourceRevisionDigest: sha256:08647b466c00989914e3a2436175152270f771f0a57d055f5bab14cc2d4be89e
|
||||
sourceBlobDigest: sha256:53027ec57392d9617cc001ece83c2fe1aa6e5dbfd52d170381c34c33c6042c23
|
||||
sourceRevisionDigest: sha256:6ca77315c3cd31ab7e308e010b26b7c9eb366b11b78ea9c71179facc4daaf97b
|
||||
sourceBlobDigest: sha256:8bada810c7c5ddb302c51dbbbb36dd0c9a45c4ba1c5e44af1646f69fc2a38751
|
||||
codeSamplesNamespace: open-router-python-code-samples
|
||||
codeSamplesRevisionDigest: sha256:80ceff338c097e19bf3951fd00e8010fc7c102b916a684eeec33d507b7a3844f
|
||||
workflow:
|
||||
workflowVersion: 1.0.0
|
||||
speakeasyVersion: latest
|
||||
speakeasyVersion: 1.680.0
|
||||
sources:
|
||||
-OAS:
|
||||
OpenRouter API:
|
||||
inputs:
|
||||
- location: registry.speakeasyapi.dev/openrouter/sdk/open-router-chat-completions-api:main
|
||||
- location: .speakeasy/in.openapi.yaml
|
||||
overlays:
|
||||
- location: .speakeasy/overlays/open-enums.overlay.yaml
|
||||
- location: .speakeasy/overlays/remove-rss-responses.overlay.yaml
|
||||
- location: .speakeasy/overlays/add-headers.overlay.yaml
|
||||
- location: .speakeasy/overlays/allof-simplify.overlay.yaml
|
||||
- location: .speakeasy/overlays/boolean-query-params.overlay.yaml
|
||||
- location: .speakeasy/overlays/fix-nullable-pagination.overlay.yaml
|
||||
output: .speakeasy/out.openapi.yaml
|
||||
registry:
|
||||
location: registry.speakeasyapi.dev/openrouter/sdk/-oas
|
||||
location: registry.speakeasyapi.dev/openrouter/sdk/open-router-chat-completions-api
|
||||
targets:
|
||||
open-router:
|
||||
target: python
|
||||
source: -OAS
|
||||
source: OpenRouter API
|
||||
publish:
|
||||
pypi:
|
||||
token: $pypi_token
|
||||
codeSamples:
|
||||
registry:
|
||||
location: registry.speakeasyapi.dev/openrouter/sdk/-oas-python-code-samples
|
||||
location: registry.speakeasyapi.dev/openrouter/sdk/open-router-python-code-samples
|
||||
labelOverride:
|
||||
fixedValue: Python (SDK)
|
||||
blocking: false
|
||||
|
||||
@@ -1,22 +1,29 @@
|
||||
workflowVersion: 1.0.0
|
||||
speakeasyVersion: latest
|
||||
speakeasyVersion: 1.680.0
|
||||
sources:
|
||||
-OAS:
|
||||
OpenRouter API:
|
||||
inputs:
|
||||
- location: registry.speakeasyapi.dev/openrouter/sdk/open-router-chat-completions-api:main
|
||||
- location: .speakeasy/in.openapi.yaml
|
||||
overlays:
|
||||
- location: .speakeasy/overlays/open-enums.overlay.yaml
|
||||
- location: .speakeasy/overlays/remove-rss-responses.overlay.yaml
|
||||
- location: .speakeasy/overlays/add-headers.overlay.yaml
|
||||
- location: .speakeasy/overlays/allof-simplify.overlay.yaml
|
||||
- location: .speakeasy/overlays/boolean-query-params.overlay.yaml
|
||||
- location: .speakeasy/overlays/fix-nullable-pagination.overlay.yaml
|
||||
output: .speakeasy/out.openapi.yaml
|
||||
registry:
|
||||
location: registry.speakeasyapi.dev/openrouter/sdk/-oas
|
||||
location: registry.speakeasyapi.dev/openrouter/sdk/open-router-chat-completions-api
|
||||
targets:
|
||||
open-router:
|
||||
target: python
|
||||
source: -OAS
|
||||
source: OpenRouter API
|
||||
publish:
|
||||
pypi:
|
||||
token: $pypi_token
|
||||
codeSamples:
|
||||
registry:
|
||||
location: registry.speakeasyapi.dev/openrouter/sdk/-oas-python-code-samples
|
||||
location: registry.speakeasyapi.dev/openrouter/sdk/open-router-python-code-samples
|
||||
labelOverride:
|
||||
fixedValue: Python (SDK)
|
||||
blocking: false
|
||||
|
||||
@@ -0,0 +1,201 @@
|
||||
Apache License
|
||||
Version 2.0, January 2004
|
||||
http://www.apache.org/licenses/
|
||||
|
||||
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
||||
|
||||
1. Definitions.
|
||||
|
||||
"License" shall mean the terms and conditions for use, reproduction,
|
||||
and distribution as defined by Sections 1 through 9 of this document.
|
||||
|
||||
"Licensor" shall mean the copyright owner or entity authorized by
|
||||
the copyright owner that is granting the License.
|
||||
|
||||
"Legal Entity" shall mean the union of the acting entity and all
|
||||
other entities that control, are controlled by, or are under common
|
||||
control with that entity. For the purposes of this definition,
|
||||
"control" means (i) the power, direct or indirect, to cause the
|
||||
direction or management of such entity, whether by contract or
|
||||
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
||||
outstanding shares, or (iii) beneficial ownership of such entity.
|
||||
|
||||
"You" (or "Your") shall mean an individual or Legal Entity
|
||||
exercising permissions granted by this License.
|
||||
|
||||
"Source" form shall mean the preferred form for making modifications,
|
||||
including but not limited to software source code, documentation
|
||||
source, and configuration files.
|
||||
|
||||
"Object" form shall mean any form resulting from mechanical
|
||||
transformation or translation of a Source form, including but
|
||||
not limited to compiled object code, generated documentation,
|
||||
and conversions to other media types.
|
||||
|
||||
"Work" shall mean the work of authorship, whether in Source or
|
||||
Object form, made available under the License, as indicated by a
|
||||
copyright notice that is included in or attached to the work
|
||||
(an example is provided in the Appendix below).
|
||||
|
||||
"Derivative Works" shall mean any work, whether in Source or Object
|
||||
form, that is based on (or derived from) the Work and for which the
|
||||
editorial revisions, annotations, elaborations, or other modifications
|
||||
represent, as a whole, an original work of authorship. For the purposes
|
||||
of this License, Derivative Works shall not include works that remain
|
||||
separable from, or merely link (or bind by name) to the interfaces of,
|
||||
the Work and Derivative Works thereof.
|
||||
|
||||
"Contribution" shall mean any work of authorship, including
|
||||
the original version of the Work and any modifications or additions
|
||||
to that Work or Derivative Works thereof, that is intentionally
|
||||
submitted to Licensor for inclusion in the Work by the copyright owner
|
||||
or by an individual or Legal Entity authorized to submit on behalf of
|
||||
the copyright owner. For the purposes of this definition, "submitted"
|
||||
means any form of electronic, verbal, or written communication sent
|
||||
to the Licensor or its representatives, including but not limited to
|
||||
communication on electronic mailing lists, source code control systems,
|
||||
and issue tracking systems that are managed by, or on behalf of, the
|
||||
Licensor for the purpose of discussing and improving the Work, but
|
||||
excluding communication that is conspicuously marked or otherwise
|
||||
designated in writing by the copyright owner as "Not a Contribution."
|
||||
|
||||
"Contributor" shall mean Licensor and any individual or Legal Entity
|
||||
on behalf of whom a Contribution has been received by Licensor and
|
||||
subsequently incorporated within the Work.
|
||||
|
||||
2. Grant of Copyright License. Subject to the terms and conditions of
|
||||
this License, each Contributor hereby grants to You a perpetual,
|
||||
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
||||
copyright license to reproduce, prepare Derivative Works of,
|
||||
publicly display, publicly perform, sublicense, and distribute the
|
||||
Work and such Derivative Works in Source or Object form.
|
||||
|
||||
3. Grant of Patent License. Subject to the terms and conditions of
|
||||
this License, each Contributor hereby grants to You a perpetual,
|
||||
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
||||
(except as stated in this section) patent license to make, have made,
|
||||
use, offer to sell, sell, import, and otherwise transfer the Work,
|
||||
where such license applies only to those patent claims licensable
|
||||
by such Contributor that are necessarily infringed by their
|
||||
Contribution(s) alone or by combination of their Contribution(s)
|
||||
with the Work to which such Contribution(s) was submitted. If You
|
||||
institute patent litigation against any entity (including a
|
||||
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
||||
or a Contribution incorporated within the Work constitutes direct
|
||||
or contributory patent infringement, then any patent licenses
|
||||
granted to You under this License for that Work shall terminate
|
||||
as of the date such litigation is filed.
|
||||
|
||||
4. Redistribution. You may reproduce and distribute copies of the
|
||||
Work or Derivative Works thereof in any medium, with or without
|
||||
modifications, and in Source or Object form, provided that You
|
||||
meet the following conditions:
|
||||
|
||||
(a) You must give any other recipients of the Work or
|
||||
Derivative Works a copy of this License; and
|
||||
|
||||
(b) You must cause any modified files to carry prominent notices
|
||||
stating that You changed the files; and
|
||||
|
||||
(c) You must retain, in the Source form of any Derivative Works
|
||||
that You distribute, all copyright, patent, trademark, and
|
||||
attribution notices from the Source form of the Work,
|
||||
excluding those notices that do not pertain to any part of
|
||||
the Derivative Works; and
|
||||
|
||||
(d) If the Work includes a "NOTICE" text file as part of its
|
||||
distribution, then any Derivative Works that You distribute must
|
||||
include a readable copy of the attribution notices contained
|
||||
within such NOTICE file, excluding those notices that do not
|
||||
pertain to any part of the Derivative Works, in at least one
|
||||
of the following places: within a NOTICE text file distributed
|
||||
as part of the Derivative Works; within the Source form or
|
||||
documentation, if provided along with the Derivative Works; or,
|
||||
within a display generated by the Derivative Works, if and
|
||||
wherever such third-party notices normally appear. The contents
|
||||
of the NOTICE file are for informational purposes only and
|
||||
do not modify the License. You may add Your own attribution
|
||||
notices within Derivative Works that You distribute, alongside
|
||||
or as an addendum to the NOTICE text from the Work, provided
|
||||
that such additional attribution notices cannot be construed
|
||||
as modifying the License.
|
||||
|
||||
You may add Your own copyright statement to Your modifications and
|
||||
may provide additional or different license terms and conditions
|
||||
for use, reproduction, or distribution of Your modifications, or
|
||||
for any such Derivative Works as a whole, provided Your use,
|
||||
reproduction, and distribution of the Work otherwise complies with
|
||||
the conditions stated in this License.
|
||||
|
||||
5. Submission of Contributions. Unless You explicitly state otherwise,
|
||||
any Contribution intentionally submitted for inclusion in the Work
|
||||
by You to the Licensor shall be under the terms and conditions of
|
||||
this License, without any additional terms or conditions.
|
||||
Notwithstanding the above, nothing herein shall supersede or modify
|
||||
the terms of any separate license agreement you may have executed
|
||||
with Licensor regarding such Contributions.
|
||||
|
||||
6. Trademarks. This License does not grant permission to use the trade
|
||||
names, trademarks, service marks, or product names of the Licensor,
|
||||
except as required for reasonable and customary use in describing the
|
||||
origin of the Work and reproducing the content of the NOTICE file.
|
||||
|
||||
7. Disclaimer of Warranty. Unless required by applicable law or
|
||||
agreed to in writing, Licensor provides the Work (and each
|
||||
Contributor provides its Contributions) on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
||||
implied, including, without limitation, any warranties or conditions
|
||||
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
||||
PARTICULAR PURPOSE. You are solely responsible for determining the
|
||||
appropriateness of using or redistributing the Work and assume any
|
||||
risks associated with Your exercise of permissions under this License.
|
||||
|
||||
8. Limitation of Liability. In no event and under no legal theory,
|
||||
whether in tort (including negligence), contract, or otherwise,
|
||||
unless required by applicable law (such as deliberate and grossly
|
||||
negligent acts) or agreed to in writing, shall any Contributor be
|
||||
liable to You for damages, including any direct, indirect, special,
|
||||
incidental, or consequential damages of any character arising as a
|
||||
result of this License or out of the use or inability to use the
|
||||
Work (including but not limited to damages for loss of goodwill,
|
||||
work stoppage, computer failure or malfunction, or any and all
|
||||
other commercial damages or losses), even if such Contributor
|
||||
has been advised of the possibility of such damages.
|
||||
|
||||
9. Accepting Warranty or Additional Liability. While redistributing
|
||||
the Work or Derivative Works thereof, You may choose to offer,
|
||||
and charge a fee for, acceptance of support, warranty, indemnity,
|
||||
or other liability obligations and/or rights consistent with this
|
||||
License. However, in accepting such obligations, You may act only
|
||||
on Your own behalf and on Your sole responsibility, not on behalf
|
||||
of any other Contributor, and only if You agree to indemnify,
|
||||
defend, and hold each Contributor harmless for any liability
|
||||
incurred by, or claims asserted against, such Contributor by reason
|
||||
of your accepting any such warranty or additional liability.
|
||||
|
||||
END OF TERMS AND CONDITIONS
|
||||
|
||||
APPENDIX: How to apply the Apache License to your work.
|
||||
|
||||
To apply the Apache License to your work, attach the following
|
||||
boilerplate notice, with the fields enclosed by brackets "[]"
|
||||
replaced with your own identifying information. (Don't include
|
||||
the brackets!) The text should be enclosed in the appropriate
|
||||
comment syntax for the file format. We also recommend that a
|
||||
file or class name and description of purpose be included on the
|
||||
same "printed page" as the copyright notice for easier
|
||||
identification within third-party archives.
|
||||
|
||||
Copyright [yyyy] [name of copyright owner]
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
# OpenRouter Python SDK
|
||||
|
||||
The OpenRouter Python SDK is a type-safe toolkit for building AI applications with access to 300+ language models through a unified API.
|
||||
The OpenRouter Python SDK is a type-safe toolkit for building AI applications with access to 400+ language models through a unified API.
|
||||
|
||||
## Why use the OpenRouter SDK?
|
||||
|
||||
|
||||
+312
@@ -0,0 +1,312 @@
|
||||
# OpenRouter SDK
|
||||
|
||||
The [OpenRouter SDK](https://openrouter.ai/docs/sdks/python) is a Python toolkit designed to help you build AI-powered features and solutions. Giving you easy access to 400+ models across providers in an easy and type-safe way.
|
||||
|
||||
To learn more about how to use the OpenRouter SDK, check out our [API Reference](https://openrouter.ai/docs/sdks/python/reference) and [Documentation](https://openrouter.ai/docs/sdks/python).
|
||||
|
||||
<!-- No Summary [summary] -->
|
||||
|
||||
<!-- No Table of Contents [toc] -->
|
||||
|
||||
<!-- Start SDK Installation [installation] -->
|
||||
## SDK Installation
|
||||
|
||||
> [!NOTE]
|
||||
> **Python version upgrade policy**
|
||||
>
|
||||
> Once a Python version reaches its [official end of life date](https://devguide.python.org/versions/), a 3-month grace period is provided for users to upgrade. Following this grace period, the minimum python version supported in the SDK will be updated.
|
||||
|
||||
The SDK can be installed with *uv*, *pip*, or *poetry* package managers.
|
||||
|
||||
### uv
|
||||
|
||||
*uv* is a fast Python package installer and resolver, designed as a drop-in replacement for pip and pip-tools. It's recommended for its speed and modern Python tooling capabilities.
|
||||
|
||||
```bash
|
||||
uv add openrouter
|
||||
```
|
||||
|
||||
### PIP
|
||||
|
||||
*PIP* is the default package installer for Python, enabling easy installation and management of packages from PyPI via the command line.
|
||||
|
||||
```bash
|
||||
pip install openrouter
|
||||
```
|
||||
|
||||
### Poetry
|
||||
|
||||
*Poetry* is a modern tool that simplifies dependency management and package publishing by using a single `pyproject.toml` file to handle project metadata and dependencies.
|
||||
|
||||
```bash
|
||||
poetry add openrouter
|
||||
```
|
||||
|
||||
### Shell and script usage with `uv`
|
||||
|
||||
You can use this SDK in a Python shell with [uv](https://docs.astral.sh/uv/) and the `uvx` command that comes with it like so:
|
||||
|
||||
```shell
|
||||
uvx --from openrouter python
|
||||
```
|
||||
|
||||
It's also possible to write a standalone Python script without needing to set up a whole project like so:
|
||||
|
||||
```python
|
||||
#!/usr/bin/env -S uv run --script
|
||||
# /// script
|
||||
# requires-python = ">=3.9"
|
||||
# dependencies = [
|
||||
# "openrouter",
|
||||
# ]
|
||||
# ///
|
||||
|
||||
from openrouter import OpenRouter
|
||||
|
||||
sdk = OpenRouter(
|
||||
# SDK arguments
|
||||
)
|
||||
|
||||
# Rest of script here...
|
||||
```
|
||||
|
||||
Once that is saved to a file, you can run it with `uv run script.py` where
|
||||
`script.py` can be replaced with the actual file name.
|
||||
<!-- End SDK Installation [installation] -->
|
||||
|
||||
<!-- Start Requirements [requirements] -->
|
||||
## Requirements
|
||||
|
||||
This SDK requires Python 3.9 or higher. For Python version support policy, see the SDK Installation section above.
|
||||
<!-- End Requirements [requirements] -->
|
||||
|
||||
<!-- Start IDE Support [idesupport] -->
|
||||
## IDE Support
|
||||
|
||||
### PyCharm
|
||||
|
||||
Generally, the SDK will work well with most IDEs out of the box. However, when using PyCharm, you can enjoy much better integration with Pydantic by installing an additional plugin.
|
||||
|
||||
- [PyCharm Pydantic Plugin](https://docs.pydantic.dev/latest/integrations/pycharm/)
|
||||
<!-- End IDE Support [idesupport] -->
|
||||
|
||||
<!-- No SDK Example Usage [usage] -->
|
||||
## SDK Usage
|
||||
|
||||
```python
|
||||
# Synchronous Example
|
||||
from openrouter import OpenRouter
|
||||
import os
|
||||
|
||||
|
||||
with OpenRouter(
|
||||
api_key=os.getenv("OPENROUTER_API_KEY", ""),
|
||||
) as open_router:
|
||||
|
||||
res = open_router.chat.send(messages=[
|
||||
{
|
||||
"role": "user",
|
||||
"content": "Hello, how are you?",
|
||||
},
|
||||
], model="anthropic/claude-4.5-sonnet", provider={
|
||||
"zdr": True,
|
||||
"sort": "price",
|
||||
}, stream=True)
|
||||
|
||||
for event in event_stream:
|
||||
# handle event
|
||||
print(event, flush=True)
|
||||
```
|
||||
|
||||
</br>
|
||||
|
||||
The same SDK client can also be used to make asynchronous requests by importing asyncio.
|
||||
|
||||
```python
|
||||
# Asynchronous Example
|
||||
import asyncio
|
||||
from openrouter import OpenRouter
|
||||
import os
|
||||
|
||||
async def main():
|
||||
|
||||
async with OpenRouter(
|
||||
api_key=os.getenv("OPENROUTER_API_KEY", ""),
|
||||
) as open_router:
|
||||
|
||||
res = await open_router.chat.send_async(messages=[
|
||||
{
|
||||
"role": "user",
|
||||
"content": "Hello, how are you?",
|
||||
},
|
||||
], model="anthropic/claude-4.5-sonnet", provider={
|
||||
"zdr": True,
|
||||
"sort": "price",
|
||||
}, stream=True)
|
||||
|
||||
async for event in event_stream:
|
||||
# handle event
|
||||
print(event, flush=True)
|
||||
|
||||
asyncio.run(main())
|
||||
```
|
||||
|
||||
<!-- No Authentication [security] -->
|
||||
|
||||
<!-- No Available Resources and Operations [operations] -->
|
||||
|
||||
<!-- No Standalone functions [standalone-funcs] -->
|
||||
|
||||
<!-- No React hooks with TanStack Query [react-query] -->
|
||||
|
||||
<!-- No Server-sent event streaming [eventstream] -->
|
||||
|
||||
<!-- No Retries [retries] -->
|
||||
|
||||
<!-- No Error Handling [errors] -->
|
||||
|
||||
<!-- No Server Selection [server] -->
|
||||
|
||||
<!-- No Custom HTTP Client [http-client] -->
|
||||
|
||||
<!-- Start Pagination [pagination] -->
|
||||
## Pagination
|
||||
|
||||
Some of the endpoints in this SDK support pagination. To use pagination, you make your SDK calls as usual, but the
|
||||
returned response object will have a `Next` method that can be called to pull down the next group of results. If the
|
||||
return value of `Next` is `None`, then there are no more pages to be fetched.
|
||||
|
||||
Here's an example of one such pagination call:
|
||||
```python
|
||||
from openrouter import OpenRouter
|
||||
import os
|
||||
|
||||
|
||||
with OpenRouter(
|
||||
http_referer="<value>",
|
||||
x_open_router_title="<value>",
|
||||
x_open_router_categories="<value>",
|
||||
api_key=os.getenv("OPENROUTER_API_KEY", ""),
|
||||
) as open_router:
|
||||
|
||||
res = open_router.byok.list()
|
||||
|
||||
while res is not None:
|
||||
# Handle items
|
||||
|
||||
res = res.next()
|
||||
|
||||
```
|
||||
<!-- End Pagination [pagination] -->
|
||||
|
||||
<!-- Start File uploads [file-upload] -->
|
||||
## File uploads
|
||||
|
||||
Certain SDK methods accept file objects as part of a request body or multi-part request. It is possible and typically recommended to upload files as a stream rather than reading the entire contents into memory. This avoids excessive memory consumption and potentially crashing with out-of-memory errors when working with very large files. The following example demonstrates how to attach a file stream to a request.
|
||||
|
||||
> [!TIP]
|
||||
>
|
||||
> For endpoints that handle file uploads bytes arrays can also be used. However, using streams is recommended for large files.
|
||||
>
|
||||
|
||||
```python
|
||||
from openrouter import OpenRouter
|
||||
import os
|
||||
|
||||
|
||||
with OpenRouter(
|
||||
http_referer="<value>",
|
||||
x_open_router_title="<value>",
|
||||
x_open_router_categories="<value>",
|
||||
api_key=os.getenv("OPENROUTER_API_KEY", ""),
|
||||
) as open_router:
|
||||
|
||||
res = open_router.files.upload(file={
|
||||
"file_name": "example.file",
|
||||
"content": open("example.file", "rb"),
|
||||
})
|
||||
|
||||
# Handle response
|
||||
print(res)
|
||||
|
||||
```
|
||||
<!-- End File uploads [file-upload] -->
|
||||
|
||||
<!-- Start Resource Management [resource-management] -->
|
||||
## Resource Management
|
||||
|
||||
The `OpenRouter` class implements the context manager protocol and registers a finalizer function to close the underlying sync and async HTTPX clients it uses under the hood. This will close HTTP connections, release memory and free up other resources held by the SDK. In short-lived Python programs and notebooks that make a few SDK method calls, resource management may not be a concern. However, in longer-lived programs, it is beneficial to create a single SDK instance via a [context manager][context-manager] and reuse it across the application.
|
||||
|
||||
[context-manager]: https://docs.python.org/3/reference/datamodel.html#context-managers
|
||||
|
||||
```python
|
||||
from openrouter import OpenRouter
|
||||
import os
|
||||
def main():
|
||||
|
||||
with OpenRouter(
|
||||
http_referer="<value>",
|
||||
x_open_router_title="<value>",
|
||||
x_open_router_categories="<value>",
|
||||
api_key=os.getenv("OPENROUTER_API_KEY", ""),
|
||||
) as open_router:
|
||||
# Rest of application here...
|
||||
|
||||
|
||||
# Or when using async:
|
||||
async def amain():
|
||||
|
||||
async with OpenRouter(
|
||||
http_referer="<value>",
|
||||
x_open_router_title="<value>",
|
||||
x_open_router_categories="<value>",
|
||||
api_key=os.getenv("OPENROUTER_API_KEY", ""),
|
||||
) as open_router:
|
||||
# Rest of application here...
|
||||
```
|
||||
<!-- End Resource Management [resource-management] -->
|
||||
|
||||
<!-- Start Debugging [debug] -->
|
||||
## Debugging
|
||||
|
||||
You can setup your SDK to emit debug logs for SDK requests and responses.
|
||||
|
||||
You can pass your own logger class directly into your SDK.
|
||||
```python
|
||||
from openrouter import OpenRouter
|
||||
import logging
|
||||
|
||||
logging.basicConfig(level=logging.DEBUG)
|
||||
s = OpenRouter(debug_logger=logging.getLogger("openrouter"))
|
||||
```
|
||||
|
||||
You can also enable a default debug logger by setting an environment variable `OPENROUTER_DEBUG` to true.
|
||||
<!-- End Debugging [debug] -->
|
||||
|
||||
<!-- Placeholder for Future Speakeasy SDK Sections -->
|
||||
|
||||
# Development
|
||||
|
||||
## Running Tests
|
||||
|
||||
To run the test suite, you'll need to set up your environment with an OpenRouter API key.
|
||||
|
||||
### Local Development
|
||||
|
||||
1. Copy the example environment file:
|
||||
|
||||
```bash
|
||||
cp .env.example .env
|
||||
```
|
||||
|
||||
2. Edit `.env` and add your OpenRouter API key:
|
||||
|
||||
```bash
|
||||
OPENROUTER_API_KEY=your_api_key_here
|
||||
```
|
||||
|
||||
3. Run the tests:
|
||||
|
||||
```bash
|
||||
pytest
|
||||
```
|
||||
@@ -1,8 +1,6 @@
|
||||

|
||||
# OpenRouter SDK
|
||||
|
||||
# OpenRouter SDK (Beta)
|
||||
|
||||
The [OpenRouter SDK](https://openrouter.ai/docs/sdks/python) is a Python toolkit designed to help you build AI-powered features and solutions. Giving you easy access to over 300 models across providers in an easy and type-safe way.
|
||||
The [OpenRouter SDK](https://openrouter.ai/docs/sdks/python) is a Python toolkit designed to help you build AI-powered features and solutions. Giving you easy access to 400+ models across providers in an easy and type-safe way.
|
||||
|
||||
To learn more about how to use the OpenRouter SDK, check out our [API Reference](https://openrouter.ai/docs/sdks/python/reference) and [Documentation](https://openrouter.ai/docs/sdks/python).
|
||||
|
||||
@@ -171,6 +169,69 @@ asyncio.run(main())
|
||||
|
||||
<!-- No Custom HTTP Client [http-client] -->
|
||||
|
||||
<!-- Start Pagination [pagination] -->
|
||||
## Pagination
|
||||
|
||||
Some of the endpoints in this SDK support pagination. To use pagination, you make your SDK calls as usual, but the
|
||||
returned response object will have a `Next` method that can be called to pull down the next group of results. If the
|
||||
return value of `Next` is `None`, then there are no more pages to be fetched.
|
||||
|
||||
Here's an example of one such pagination call:
|
||||
```python
|
||||
from openrouter import OpenRouter
|
||||
import os
|
||||
|
||||
|
||||
with OpenRouter(
|
||||
http_referer="<value>",
|
||||
x_open_router_title="<value>",
|
||||
x_open_router_categories="<value>",
|
||||
api_key=os.getenv("OPENROUTER_API_KEY", ""),
|
||||
) as open_router:
|
||||
|
||||
res = open_router.byok.list()
|
||||
|
||||
while res is not None:
|
||||
# Handle items
|
||||
|
||||
res = res.next()
|
||||
|
||||
```
|
||||
<!-- End Pagination [pagination] -->
|
||||
|
||||
<!-- Start File uploads [file-upload] -->
|
||||
## File uploads
|
||||
|
||||
Certain SDK methods accept file objects as part of a request body or multi-part request. It is possible and typically recommended to upload files as a stream rather than reading the entire contents into memory. This avoids excessive memory consumption and potentially crashing with out-of-memory errors when working with very large files. The following example demonstrates how to attach a file stream to a request.
|
||||
|
||||
> [!TIP]
|
||||
>
|
||||
> For endpoints that handle file uploads bytes arrays can also be used. However, using streams is recommended for large files.
|
||||
>
|
||||
|
||||
```python
|
||||
from openrouter import OpenRouter
|
||||
import os
|
||||
|
||||
|
||||
with OpenRouter(
|
||||
http_referer="<value>",
|
||||
x_open_router_title="<value>",
|
||||
x_open_router_categories="<value>",
|
||||
api_key=os.getenv("OPENROUTER_API_KEY", ""),
|
||||
) as open_router:
|
||||
|
||||
res = open_router.files.upload(file={
|
||||
"file_name": "example.file",
|
||||
"content": open("example.file", "rb"),
|
||||
})
|
||||
|
||||
# Handle response
|
||||
print(res)
|
||||
|
||||
```
|
||||
<!-- End File uploads [file-upload] -->
|
||||
|
||||
<!-- Start Resource Management [resource-management] -->
|
||||
## Resource Management
|
||||
|
||||
@@ -184,6 +245,9 @@ import os
|
||||
def main():
|
||||
|
||||
with OpenRouter(
|
||||
http_referer="<value>",
|
||||
x_open_router_title="<value>",
|
||||
x_open_router_categories="<value>",
|
||||
api_key=os.getenv("OPENROUTER_API_KEY", ""),
|
||||
) as open_router:
|
||||
# Rest of application here...
|
||||
@@ -193,6 +257,9 @@ def main():
|
||||
async def amain():
|
||||
|
||||
async with OpenRouter(
|
||||
http_referer="<value>",
|
||||
x_open_router_title="<value>",
|
||||
x_open_router_categories="<value>",
|
||||
api_key=os.getenv("OPENROUTER_API_KEY", ""),
|
||||
) as open_router:
|
||||
# Rest of application here...
|
||||
@@ -242,10 +309,4 @@ To run the test suite, you'll need to set up your environment with an OpenRouter
|
||||
|
||||
```bash
|
||||
pytest
|
||||
```
|
||||
|
||||
## Maturity
|
||||
|
||||
This SDK is in beta, and there may be breaking changes between versions without a major version update. Therefore, we recommend pinning usage
|
||||
to a specific package version. This way, you can install the same version each time without breaking changes unless you are intentionally
|
||||
looking for the latest version.
|
||||
```
|
||||
+41
@@ -0,0 +1,41 @@
|
||||
|
||||
|
||||
## 2025-11-15 18:16:18
|
||||
### Changes
|
||||
Based on:
|
||||
- OpenAPI Doc
|
||||
- Speakeasy CLI 1.658.1 (2.755.6) https://github.com/speakeasy-api/speakeasy
|
||||
### Generated
|
||||
- [python v0.0.16] .
|
||||
### Releases
|
||||
- [PyPI v0.0.16] https://pypi.org/project/openrouter/0.0.16 - .
|
||||
|
||||
## 2026-06-11 00:55:55
|
||||
### Changes
|
||||
Based on:
|
||||
- OpenAPI Doc
|
||||
- Speakeasy CLI 1.680.0 (2.788.4) https://github.com/speakeasy-api/speakeasy
|
||||
### Generated
|
||||
- [python v0.9.2] .
|
||||
### Releases
|
||||
- [PyPI v0.9.2] https://pypi.org/project/openrouter/0.9.2 - .
|
||||
|
||||
## 2026-06-17 00:59:07
|
||||
### Changes
|
||||
Based on:
|
||||
- OpenAPI Doc
|
||||
- Speakeasy CLI 1.680.0 (2.788.4) https://github.com/speakeasy-api/speakeasy
|
||||
### Generated
|
||||
- [python v0.10.0] .
|
||||
### Releases
|
||||
- [PyPI v0.10.0] https://pypi.org/project/openrouter/0.10.0 - .
|
||||
|
||||
## 2026-06-18 21:57:15
|
||||
### Changes
|
||||
Based on:
|
||||
- OpenAPI Doc
|
||||
- Speakeasy CLI 1.680.0 (2.788.4) https://github.com/speakeasy-api/speakeasy
|
||||
### Generated
|
||||
- [python v0.10.1] .
|
||||
### Releases
|
||||
- [PyPI v0.10.1] https://pypi.org/project/openrouter/0.10.1 - .
|
||||
@@ -6,69 +6,16 @@ import os
|
||||
|
||||
|
||||
with OpenRouter(
|
||||
http_referer="<value>",
|
||||
x_open_router_title="<value>",
|
||||
x_open_router_categories="<value>",
|
||||
api_key=os.getenv("OPENROUTER_API_KEY", ""),
|
||||
) as open_router:
|
||||
|
||||
res = open_router.beta.responses.send(input=[
|
||||
{
|
||||
"type": "message",
|
||||
"role": "user",
|
||||
"content": "Hello, how are you?",
|
||||
},
|
||||
], metadata={
|
||||
"user_id": "123",
|
||||
"session_id": "abc-def-ghi",
|
||||
}, tools=[
|
||||
{
|
||||
"type": "function",
|
||||
"name": "get_current_weather",
|
||||
"description": "Get the current weather in a given location",
|
||||
"parameters": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"location": {
|
||||
"type": "string",
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
], model="anthropic/claude-4.5-sonnet-20250929", text={
|
||||
"format_": {
|
||||
"type": "text",
|
||||
},
|
||||
"verbosity": "medium",
|
||||
}, reasoning={
|
||||
"summary": "auto",
|
||||
"enabled": True,
|
||||
}, temperature=0.7, top_p=0.9, prompt={
|
||||
"id": "<id>",
|
||||
"variables": {
|
||||
"key": {
|
||||
"type": "input_text",
|
||||
"text": "Hello, how can I help you?",
|
||||
},
|
||||
},
|
||||
}, service_tier="auto", truncation="auto", stream=False, provider={
|
||||
"data_collection": "deny",
|
||||
"zdr": True,
|
||||
"enforce_distillable_text": True,
|
||||
"order": [
|
||||
"OpenAI",
|
||||
],
|
||||
"only": [
|
||||
"OpenAI",
|
||||
],
|
||||
"ignore": [
|
||||
"OpenAI",
|
||||
],
|
||||
"quantizations": None,
|
||||
"sort": "price",
|
||||
})
|
||||
res = open_router.analytics.get_user_activity()
|
||||
|
||||
with res as event_stream:
|
||||
for event in event_stream:
|
||||
# handle event
|
||||
print(event, flush=True)
|
||||
# Handle response
|
||||
print(res)
|
||||
```
|
||||
|
||||
</br>
|
||||
@@ -84,69 +31,16 @@ import os
|
||||
async def main():
|
||||
|
||||
async with OpenRouter(
|
||||
http_referer="<value>",
|
||||
x_open_router_title="<value>",
|
||||
x_open_router_categories="<value>",
|
||||
api_key=os.getenv("OPENROUTER_API_KEY", ""),
|
||||
) as open_router:
|
||||
|
||||
res = await open_router.beta.responses.send_async(input=[
|
||||
{
|
||||
"type": "message",
|
||||
"role": "user",
|
||||
"content": "Hello, how are you?",
|
||||
},
|
||||
], metadata={
|
||||
"user_id": "123",
|
||||
"session_id": "abc-def-ghi",
|
||||
}, tools=[
|
||||
{
|
||||
"type": "function",
|
||||
"name": "get_current_weather",
|
||||
"description": "Get the current weather in a given location",
|
||||
"parameters": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"location": {
|
||||
"type": "string",
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
], model="anthropic/claude-4.5-sonnet-20250929", text={
|
||||
"format_": {
|
||||
"type": "text",
|
||||
},
|
||||
"verbosity": "medium",
|
||||
}, reasoning={
|
||||
"summary": "auto",
|
||||
"enabled": True,
|
||||
}, temperature=0.7, top_p=0.9, prompt={
|
||||
"id": "<id>",
|
||||
"variables": {
|
||||
"key": {
|
||||
"type": "input_text",
|
||||
"text": "Hello, how can I help you?",
|
||||
},
|
||||
},
|
||||
}, service_tier="auto", truncation="auto", stream=False, provider={
|
||||
"data_collection": "deny",
|
||||
"zdr": True,
|
||||
"enforce_distillable_text": True,
|
||||
"order": [
|
||||
"OpenAI",
|
||||
],
|
||||
"only": [
|
||||
"OpenAI",
|
||||
],
|
||||
"ignore": [
|
||||
"OpenAI",
|
||||
],
|
||||
"quantizations": None,
|
||||
"sort": "price",
|
||||
})
|
||||
res = await open_router.analytics.get_user_activity_async()
|
||||
|
||||
async with res as event_stream:
|
||||
async for event in event_stream:
|
||||
# handle event
|
||||
print(event, flush=True)
|
||||
# Handle response
|
||||
print(res)
|
||||
|
||||
asyncio.run(main())
|
||||
```
|
||||
|
||||
@@ -5,14 +5,14 @@
|
||||
|
||||
| Field | Type | Required | Description | Example |
|
||||
| --------------------------------------------------- | --------------------------------------------------- | --------------------------------------------------- | --------------------------------------------------- | --------------------------------------------------- |
|
||||
| `byok_usage_inference` | *float* | :heavy_check_mark: | BYOK inference cost in USD (external credits spent) | 0.012 |
|
||||
| `completion_tokens` | *int* | :heavy_check_mark: | Total completion tokens generated | 125 |
|
||||
| `date_` | *str* | :heavy_check_mark: | Date of the activity (YYYY-MM-DD format) | 2025-08-24 |
|
||||
| `endpoint_id` | *str* | :heavy_check_mark: | Unique identifier for the endpoint | 550e8400-e29b-41d4-a716-446655440000 |
|
||||
| `model` | *str* | :heavy_check_mark: | Model slug (e.g., "openai/gpt-4.1") | openai/gpt-4.1 |
|
||||
| `model_permaslug` | *str* | :heavy_check_mark: | Model permaslug (e.g., "openai/gpt-4.1-2025-04-14") | openai/gpt-4.1-2025-04-14 |
|
||||
| `endpoint_id` | *str* | :heavy_check_mark: | Unique identifier for the endpoint | 550e8400-e29b-41d4-a716-446655440000 |
|
||||
| `prompt_tokens` | *int* | :heavy_check_mark: | Total prompt tokens used | 50 |
|
||||
| `provider_name` | *str* | :heavy_check_mark: | Name of the provider serving this endpoint | OpenAI |
|
||||
| `usage` | *float* | :heavy_check_mark: | Total cost in USD (OpenRouter credits spent) | 0.015 |
|
||||
| `byok_usage_inference` | *float* | :heavy_check_mark: | BYOK inference cost in USD (external credits spent) | 0.012 |
|
||||
| `requests` | *float* | :heavy_check_mark: | Number of requests made | 5 |
|
||||
| `prompt_tokens` | *float* | :heavy_check_mark: | Total prompt tokens used | 50 |
|
||||
| `completion_tokens` | *float* | :heavy_check_mark: | Total completion tokens generated | 125 |
|
||||
| `reasoning_tokens` | *float* | :heavy_check_mark: | Total reasoning tokens used | 25 |
|
||||
| `reasoning_tokens` | *int* | :heavy_check_mark: | Total reasoning tokens used | 25 |
|
||||
| `requests` | *int* | :heavy_check_mark: | Number of requests made | 5 |
|
||||
| `usage` | *float* | :heavy_check_mark: | Total cost in USD (OpenRouter credits spent) | 0.015 |
|
||||
@@ -0,0 +1,14 @@
|
||||
# Architecture
|
||||
|
||||
Model architecture information
|
||||
|
||||
|
||||
## Fields
|
||||
|
||||
| Field | Type | Required | Description | Example |
|
||||
| ------------------------------------------------------------------ | ------------------------------------------------------------------ | ------------------------------------------------------------------ | ------------------------------------------------------------------ | ------------------------------------------------------------------ |
|
||||
| `input_modalities` | List[[components.InputModality](../components/inputmodality.md)] | :heavy_check_mark: | Supported input modalities | |
|
||||
| `instruct_type` | [Nullable[components.InstructType]](../components/instructtype.md) | :heavy_check_mark: | Instruction format type | chatml |
|
||||
| `modality` | *Nullable[str]* | :heavy_check_mark: | Primary modality of the model | text |
|
||||
| `output_modalities` | List[[components.OutputModality](../components/outputmodality.md)] | :heavy_check_mark: | Supported output modalities | |
|
||||
| `tokenizer` | [Nullable[components.Tokenizer]](../components/tokenizer.md) | :heavy_check_mark: | N/A | GPT |
|
||||
@@ -0,0 +1,13 @@
|
||||
# By
|
||||
|
||||
The provider sorting strategy (price, throughput, latency)
|
||||
|
||||
|
||||
## Values
|
||||
|
||||
| Name | Value |
|
||||
| ------------ | ------------ |
|
||||
| `PRICE` | price |
|
||||
| `THROUGHPUT` | throughput |
|
||||
| `LATENCY` | latency |
|
||||
| `EXACTO` | exacto |
|
||||
@@ -0,0 +1,10 @@
|
||||
# ChatStreamOptions
|
||||
|
||||
Streaming configuration options
|
||||
|
||||
|
||||
## Fields
|
||||
|
||||
| Field | Type | Required | Description | Example |
|
||||
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
||||
| ~~`include_usage`~~ | *Optional[bool]* | :heavy_minus_sign: | : warning: ** DEPRECATED **: This will be removed in a future release, please migrate away from it as soon as possible.<br/><br/>Deprecated: This field has no effect. Full usage details are always included. | true |
|
||||
@@ -1,4 +1,4 @@
|
||||
# CodeEnum
|
||||
# Code
|
||||
|
||||
|
||||
## Values
|
||||
@@ -0,0 +1,13 @@
|
||||
# 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 |
|
||||
@@ -0,0 +1,12 @@
|
||||
# CostDetails
|
||||
|
||||
Breakdown of upstream inference costs
|
||||
|
||||
|
||||
## Fields
|
||||
|
||||
| Field | Type | Required | Description |
|
||||
| ------------------------------------- | ------------------------------------- | ------------------------------------- | ------------------------------------- |
|
||||
| `upstream_inference_completions_cost` | *float* | :heavy_check_mark: | N/A |
|
||||
| `upstream_inference_cost` | *OptionalNullable[float]* | :heavy_minus_sign: | N/A |
|
||||
| `upstream_inference_prompt_cost` | *float* | :heavy_check_mark: | N/A |
|
||||
@@ -2,8 +2,8 @@
|
||||
|
||||
Data collection setting. If no available model provider meets the requirement, your request will return an error.
|
||||
- allow: (default) allow providers which store user data non-transiently and may train on it
|
||||
- deny: use only providers which do not collect user data.
|
||||
|
||||
- deny: use only providers which do not collect user data.
|
||||
|
||||
|
||||
## Values
|
||||
@@ -7,6 +7,9 @@ Default parameters for this model
|
||||
|
||||
| Field | Type | Required | Description |
|
||||
| ------------------------- | ------------------------- | ------------------------- | ------------------------- |
|
||||
| `frequency_penalty` | *OptionalNullable[float]* | :heavy_minus_sign: | N/A |
|
||||
| `presence_penalty` | *OptionalNullable[float]* | :heavy_minus_sign: | N/A |
|
||||
| `repetition_penalty` | *OptionalNullable[float]* | :heavy_minus_sign: | N/A |
|
||||
| `temperature` | *OptionalNullable[float]* | :heavy_minus_sign: | N/A |
|
||||
| `top_p` | *OptionalNullable[float]* | :heavy_minus_sign: | N/A |
|
||||
| `frequency_penalty` | *OptionalNullable[float]* | :heavy_minus_sign: | N/A |
|
||||
| `top_k` | *OptionalNullable[int]* | :heavy_minus_sign: | N/A |
|
||||
| `top_p` | *OptionalNullable[float]* | :heavy_minus_sign: | N/A |
|
||||
@@ -0,0 +1,11 @@
|
||||
# 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 |
|
||||
@@ -1,10 +1,11 @@
|
||||
# SystemMessage
|
||||
# FileCitation
|
||||
|
||||
|
||||
## Fields
|
||||
|
||||
| Field | Type | Required | Description |
|
||||
| ---------------------------------------------------------------- | ---------------------------------------------------------------- | ---------------------------------------------------------------- | ---------------------------------------------------------------- |
|
||||
| `role` | *Literal["system"]* | :heavy_check_mark: | N/A |
|
||||
| `content` | [models.SystemMessageContent](../models/systemmessagecontent.md) | :heavy_check_mark: | N/A |
|
||||
| `name` | *Optional[str]* | :heavy_minus_sign: | N/A |
|
||||
| `file_id` | *str* | :heavy_check_mark: | N/A |
|
||||
| `filename` | *str* | :heavy_check_mark: | N/A |
|
||||
| `index` | *int* | :heavy_check_mark: | N/A |
|
||||
| `type` | [components.FileCitationType](../components/filecitationtype.md) | :heavy_check_mark: | N/A |
|
||||
@@ -1,11 +1,10 @@
|
||||
# FileCitation
|
||||
# FilePath
|
||||
|
||||
|
||||
## Fields
|
||||
|
||||
| Field | Type | Required | Description |
|
||||
| -------------------------------------------------------- | -------------------------------------------------------- | -------------------------------------------------------- | -------------------------------------------------------- |
|
||||
| `type` | [models.FileCitationType](../models/filecitationtype.md) | :heavy_check_mark: | N/A |
|
||||
| `file_id` | *str* | :heavy_check_mark: | N/A |
|
||||
| `filename` | *str* | :heavy_check_mark: | N/A |
|
||||
| `index` | *float* | :heavy_check_mark: | N/A |
|
||||
| `index` | *int* | :heavy_check_mark: | N/A |
|
||||
| `type` | [components.FilePathType](../components/filepathtype.md) | :heavy_check_mark: | N/A |
|
||||
@@ -5,4 +5,4 @@
|
||||
|
||||
| Field | Type | Required | Description |
|
||||
| ------------------ | ------------------ | ------------------ | ------------------ |
|
||||
| `cached_tokens` | *float* | :heavy_check_mark: | N/A |
|
||||
| `cached_tokens` | *int* | :heavy_check_mark: | N/A |
|
||||
@@ -7,9 +7,9 @@ List of available endpoints for a model
|
||||
|
||||
| Field | Type | Required | Description | Example |
|
||||
| ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| `id` | *str* | :heavy_check_mark: | Unique identifier for the model | openai/gpt-4 |
|
||||
| `name` | *str* | :heavy_check_mark: | Display name of the model | GPT-4 |
|
||||
| `created` | *float* | :heavy_check_mark: | Unix timestamp of when the model was created | 1692901234 |
|
||||
| `architecture` | [components.Architecture](../components/architecture.md) | :heavy_check_mark: | N/A | {<br/>"input_modalities": [<br/>"text"<br/>],<br/>"instruct_type": "chatml",<br/>"modality": "text-\u003etext",<br/>"output_modalities": [<br/>"text"<br/>],<br/>"tokenizer": "GPT"<br/>} |
|
||||
| `created` | *int* | :heavy_check_mark: | Unix timestamp of when the model was created | 1692901234 |
|
||||
| `description` | *str* | :heavy_check_mark: | Description of the model | GPT-4 is a large multimodal model that can solve difficult problems with greater accuracy. |
|
||||
| `architecture` | [models.Architecture](../models/architecture.md) | :heavy_check_mark: | N/A | {<br/>"tokenizer": "GPT",<br/>"instruct_type": "chatml",<br/>"modality": "text-\u003etext",<br/>"input_modalities": [<br/>"text"<br/>],<br/>"output_modalities": [<br/>"text"<br/>]<br/>} |
|
||||
| `endpoints` | List[[models.PublicEndpoint](../models/publicendpoint.md)] | :heavy_check_mark: | List of available endpoints for this model | |
|
||||
| `endpoints` | List[[components.PublicEndpoint](../components/publicendpoint.md)] | :heavy_check_mark: | List of available endpoints for this model | |
|
||||
| `id` | *str* | :heavy_check_mark: | Unique identifier for the model | openai/gpt-4 |
|
||||
| `name` | *str* | :heavy_check_mark: | Display name of the model | GPT-4 |
|
||||
@@ -0,0 +1,10 @@
|
||||
# Modality
|
||||
|
||||
|
||||
## Values
|
||||
|
||||
| Name | Value |
|
||||
| ------- | ------- |
|
||||
| `TEXT` | text |
|
||||
| `IMAGE` | image |
|
||||
| `AUDIO` | audio |
|
||||
@@ -1,20 +1,28 @@
|
||||
# Provider
|
||||
# Model
|
||||
|
||||
When multiple model providers are available, optionally indicate your routing preference.
|
||||
Information about an AI model available on OpenRouter
|
||||
|
||||
|
||||
## Fields
|
||||
|
||||
| Field | Type | Required | Description | Example |
|
||||
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
||||
| `allow_fallbacks` | *OptionalNullable[bool]* | :heavy_minus_sign: | Whether to allow backup providers to serve requests<br/>- true: (default) when the primary provider (or your custom providers in "order") is unavailable, use the next best provider.<br/>- false: use only the primary/custom provider, and return the upstream error if it's unavailable.<br/> | |
|
||||
| `require_parameters` | *OptionalNullable[bool]* | :heavy_minus_sign: | Whether to filter providers to only those that support the parameters you've provided. If this setting is omitted or set to false, then providers will receive only the parameters they support, and ignore the rest. | |
|
||||
| `data_collection` | [OptionalNullable[models.DataCollection]](../models/datacollection.md) | :heavy_minus_sign: | Data collection setting. If no available model provider meets the requirement, your request will return an error.<br/>- allow: (default) allow providers which store user data non-transiently and may train on it<br/>- deny: use only providers which do not collect user data.<br/> | deny |
|
||||
| `zdr` | *OptionalNullable[bool]* | :heavy_minus_sign: | Whether to restrict routing to only ZDR (Zero Data Retention) endpoints. When true, only endpoints that do not retain prompts will be used. | true |
|
||||
| `enforce_distillable_text` | *OptionalNullable[bool]* | :heavy_minus_sign: | Whether to restrict routing to only models that allow text distillation. When true, only models where the author has allowed distillation will be used. | true |
|
||||
| `order` | List[[models.Order](../models/order.md)] | :heavy_minus_sign: | An ordered list of provider slugs. The router will attempt to use the first provider in the subset of this list that supports your requested model, and fall back to the next if it is unavailable. If no providers are available, the request will fail with an error message. | |
|
||||
| `only` | List[[models.Only](../models/only.md)] | :heavy_minus_sign: | List of provider slugs to allow. If provided, this list is merged with your account-wide allowed provider settings for this request. | |
|
||||
| `ignore` | List[[models.Ignore](../models/ignore.md)] | :heavy_minus_sign: | List of provider slugs to ignore. If provided, this list is merged with your account-wide ignored provider settings for this request. | |
|
||||
| `quantizations` | List[[models.Quantization](../models/quantization.md)] | :heavy_minus_sign: | A list of quantization levels to filter the provider by. | |
|
||||
| `sort` | [OptionalNullable[models.Sort]](../models/sort.md) | :heavy_minus_sign: | The sorting strategy to use for this request, if "order" is not specified. When set, no load balancing is performed. | price |
|
||||
| `max_price` | [Optional[models.MaxPrice]](../models/maxprice.md) | :heavy_minus_sign: | The object specifying the maximum price you want to pay for this request. USD price per million tokens, for prompt and completion. | |
|
||||
| Field | Type | Required | Description | Example |
|
||||
| -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| `architecture` | [components.ModelArchitecture](../components/modelarchitecture.md) | :heavy_check_mark: | Model architecture information | {<br/>"input_modalities": [<br/>"text"<br/>],<br/>"instruct_type": "chatml",<br/>"modality": "text-\u003etext",<br/>"output_modalities": [<br/>"text"<br/>],<br/>"tokenizer": "GPT"<br/>} |
|
||||
| `benchmarks` | [Optional[components.ModelBenchmarks]](../components/modelbenchmarks.md) | :heavy_minus_sign: | Third-party benchmark rankings for this model. Omitted when no benchmark data is available. | {<br/>"artificial_analysis": {<br/>"agentic_index": 55.8,<br/>"coding_index": 63.2,<br/>"intelligence_index": 71.4<br/>},<br/>"design_arena": [<br/>{<br/>"arena": "models",<br/>"category": "website",<br/>"elo": 1385.2,<br/>"rank": 5,<br/>"win_rate": 62.5<br/>}<br/>]<br/>} |
|
||||
| `canonical_slug` | *str* | :heavy_check_mark: | Canonical slug for the model | openai/gpt-4 |
|
||||
| `context_length` | *Nullable[int]* | :heavy_check_mark: | Maximum context length in tokens | 8192 |
|
||||
| `created` | *int* | :heavy_check_mark: | Unix timestamp of when the model was created | 1692901234 |
|
||||
| `default_parameters` | [Nullable[components.DefaultParameters]](../components/defaultparameters.md) | :heavy_check_mark: | Default parameters for this model | {<br/>"frequency_penalty": 0,<br/>"presence_penalty": 0,<br/>"repetition_penalty": 1,<br/>"temperature": 0.7,<br/>"top_k": 0,<br/>"top_p": 0.9<br/>} |
|
||||
| `description` | *Optional[str]* | :heavy_minus_sign: | Description of the model | GPT-4 is a large multimodal model that can solve difficult problems with greater accuracy. |
|
||||
| `expiration_date` | *OptionalNullable[str]* | :heavy_minus_sign: | The date after which the model may be removed. ISO 8601 date string (YYYY-MM-DD) or null if no expiration. | 2025-06-01 |
|
||||
| `hugging_face_id` | *OptionalNullable[str]* | :heavy_minus_sign: | Hugging Face model identifier, if applicable | microsoft/DialoGPT-medium |
|
||||
| `id` | *str* | :heavy_check_mark: | Unique identifier for the model | openai/gpt-4 |
|
||||
| `knowledge_cutoff` | *OptionalNullable[str]* | :heavy_minus_sign: | The date up to which the model was trained on data. ISO 8601 date string (YYYY-MM-DD) or null if unknown. | 2024-10-01 |
|
||||
| `links` | [components.ModelLinks](../components/modellinks.md) | :heavy_check_mark: | Related API endpoints and resources for this model. | {<br/>"details": "/api/v1/models/openai/gpt-5.4/endpoints"<br/>} |
|
||||
| `name` | *str* | :heavy_check_mark: | Display name of the model | GPT-4 |
|
||||
| `per_request_limits` | [Nullable[components.PerRequestLimits]](../components/perrequestlimits.md) | :heavy_check_mark: | Per-request token limits | {<br/>"completion_tokens": 1000,<br/>"prompt_tokens": 1000<br/>} |
|
||||
| `pricing` | [components.PublicPricing](../components/publicpricing.md) | :heavy_check_mark: | Pricing information for the model | {<br/>"completion": "0.00006",<br/>"image": "0",<br/>"prompt": "0.00003",<br/>"request": "0"<br/>} |
|
||||
| `reasoning` | [Optional[components.ModelReasoning]](../components/modelreasoning.md) | :heavy_minus_sign: | Reasoning effort configuration. Omitted for non-reasoning models and dynamic router models. | {<br/>"default_effort": "medium",<br/>"default_enabled": true,<br/>"mandatory": false,<br/>"supported_efforts": [<br/>"high",<br/>"medium",<br/>"low",<br/>"minimal"<br/>]<br/>} |
|
||||
| `supported_parameters` | List[[components.Parameter](../components/parameter.md)] | :heavy_check_mark: | List of supported parameters for this model | |
|
||||
| `supported_voices` | List[*str*] | :heavy_check_mark: | List of supported voice identifiers for TTS models. Null for non-TTS models. | <nil> |
|
||||
| `top_provider` | [components.TopProviderInfo](../components/topproviderinfo.md) | :heavy_check_mark: | Information about the top provider for this model | {<br/>"context_length": 8192,<br/>"is_moderated": true,<br/>"max_completion_tokens": 4096<br/>} |
|
||||
+8
-6
@@ -1,12 +1,14 @@
|
||||
# OpenAIResponsesInputFunctionCallOutput
|
||||
# ModelArchitecture
|
||||
|
||||
Model architecture information
|
||||
|
||||
|
||||
## Fields
|
||||
|
||||
| Field | Type | Required | Description | Example |
|
||||
| ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ |
|
||||
| `type` | [models.OpenAIResponsesInputTypeFunctionCallOutput](../models/openairesponsesinputtypefunctioncalloutput.md) | :heavy_check_mark: | N/A | |
|
||||
| `id` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | |
|
||||
| `call_id` | *str* | :heavy_check_mark: | N/A | |
|
||||
| `output` | *str* | :heavy_check_mark: | N/A | |
|
||||
| `status` | [OptionalNullable[models.ToolCallStatus]](../models/toolcallstatus.md) | :heavy_minus_sign: | N/A | completed |
|
||||
| `input_modalities` | List[[components.InputModality](../components/inputmodality.md)] | :heavy_check_mark: | Supported input modalities | |
|
||||
| `instruct_type` | [OptionalNullable[components.ModelArchitectureInstructType]](../components/modelarchitectureinstructtype.md) | :heavy_minus_sign: | Instruction format type | chatml |
|
||||
| `modality` | *Nullable[str]* | :heavy_check_mark: | Primary modality of the model | text->text |
|
||||
| `output_modalities` | List[[components.OutputModality](../components/outputmodality.md)] | :heavy_check_mark: | Supported output modalities | |
|
||||
| `tokenizer` | [Optional[components.ModelGroup]](../components/modelgroup.md) | :heavy_minus_sign: | Tokenizer type used by the model | GPT |
|
||||
@@ -13,6 +13,7 @@ Tokenizer type used by the model
|
||||
| `GPT` | GPT |
|
||||
| `CLAUDE` | Claude |
|
||||
| `GEMINI` | Gemini |
|
||||
| `GEMMA` | Gemma |
|
||||
| `GROK` | Grok |
|
||||
| `COHERE` | Cohere |
|
||||
| `NOVA` | Nova |
|
||||
@@ -0,0 +1,10 @@
|
||||
# ModelsCountResponse
|
||||
|
||||
Model count data
|
||||
|
||||
|
||||
## Fields
|
||||
|
||||
| Field | Type | Required | Description | Example |
|
||||
| ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ |
|
||||
| `data` | [components.ModelsCountResponseData](../components/modelscountresponsedata.md) | :heavy_check_mark: | Model count data | {<br/>"count": 150<br/>} |
|
||||
+5
-5
@@ -1,10 +1,10 @@
|
||||
# EndpointsListEndpointsResponse
|
||||
# ModelsListResponse
|
||||
|
||||
Returns a list of endpoints
|
||||
List of available models
|
||||
|
||||
|
||||
## Fields
|
||||
|
||||
| Field | Type | Required | Description | Example |
|
||||
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
||||
| `data` | [models.ListEndpointsResponse](../models/listendpointsresponse.md) | :heavy_check_mark: | List of available endpoints for a model | {<br/>"id": "openai/gpt-4",<br/>"name": "GPT-4",<br/>"created": 1692901234,<br/>"description": "GPT-4 is a large multimodal model that can solve difficult problems with greater accuracy.",<br/>"architecture": {<br/>"tokenizer": "GPT",<br/>"instruct_type": "chatml",<br/>"modality": "text-\u003etext",<br/>"input_modalities": [<br/>"text"<br/>],<br/>"output_modalities": [<br/>"text"<br/>]<br/>},<br/>"endpoints": [<br/>{<br/>"name": "OpenAI: GPT-4",<br/>"model_name": "GPT-4",<br/>"context_length": 8192,<br/>"pricing": {<br/>"prompt": "0.00003",<br/>"completion": "0.00006",<br/>"request": "0",<br/>"image": "0"<br/>},<br/>"provider_name": "OpenAI",<br/>"tag": "openai",<br/>"quantization": "fp16",<br/>"max_completion_tokens": 4096,<br/>"max_prompt_tokens": 8192,<br/>"supported_parameters": [<br/>"temperature",<br/>"top_p",<br/>"max_tokens",<br/>"frequency_penalty",<br/>"presence_penalty"<br/>],<br/>"status": "default",<br/>"uptime_last_30m": 99.5,<br/>"supports_implicit_caching": true<br/>}<br/>]<br/>} |
|
||||
| Field | Type | Required | Description | Example |
|
||||
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
||||
| `data` | List[[components.Model](../components/model.md)] | :heavy_check_mark: | List of available models | [<br/>{<br/>"architecture": {<br/>"input_modalities": [<br/>"text"<br/>],<br/>"instruct_type": "chatml",<br/>"modality": "text-\u003etext",<br/>"output_modalities": [<br/>"text"<br/>],<br/>"tokenizer": "GPT"<br/>},<br/>"canonical_slug": "openai/gpt-4",<br/>"context_length": 8192,<br/>"created": 1692901234,<br/>"default_parameters": null,<br/>"description": "GPT-4 is a large multimodal model that can solve difficult problems with greater accuracy.",<br/>"expiration_date": null,<br/>"id": "openai/gpt-4",<br/>"knowledge_cutoff": null,<br/>"links": {<br/>"details": "/api/v1/models/openai/gpt-5.4/endpoints"<br/>},<br/>"name": "GPT-4",<br/>"per_request_limits": null,<br/>"pricing": {<br/>"completion": "0.00006",<br/>"image": "0",<br/>"prompt": "0.00003",<br/>"request": "0"<br/>},<br/>"supported_parameters": [<br/>"temperature",<br/>"top_p",<br/>"max_tokens"<br/>],<br/>"supported_voices": null,<br/>"top_provider": {<br/>"context_length": 8192,<br/>"is_moderated": true,<br/>"max_completion_tokens": 4096<br/>}<br/>}<br/>] |
|
||||
@@ -0,0 +1,23 @@
|
||||
# OpenAIResponsesAnnotation
|
||||
|
||||
|
||||
## Supported Types
|
||||
|
||||
### `components.FileCitation`
|
||||
|
||||
```python
|
||||
value: components.FileCitation = /* values here */
|
||||
```
|
||||
|
||||
### `components.URLCitation`
|
||||
|
||||
```python
|
||||
value: components.URLCitation = /* values here */
|
||||
```
|
||||
|
||||
### `components.FilePath`
|
||||
|
||||
```python
|
||||
value: components.FilePath = /* values here */
|
||||
```
|
||||
|
||||
+3
-3
@@ -1,9 +1,9 @@
|
||||
# OpenAIResponsesToolChoiceFunction
|
||||
# OpenAIResponsesRefusalContent
|
||||
|
||||
|
||||
## Fields
|
||||
|
||||
| Field | Type | Required | Description |
|
||||
| -------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------- |
|
||||
| `type` | [models.OpenAIResponsesToolChoiceTypeFunction](../models/openairesponsestoolchoicetypefunction.md) | :heavy_check_mark: | N/A |
|
||||
| `name` | *str* | :heavy_check_mark: | N/A |
|
||||
| `refusal` | *str* | :heavy_check_mark: | N/A |
|
||||
| `type` | [components.OpenAIResponsesRefusalContentType](../components/openairesponsesrefusalcontenttype.md) | :heavy_check_mark: | N/A |
|
||||
@@ -1,10 +1,8 @@
|
||||
# ModelsListResponse
|
||||
|
||||
List of available models
|
||||
# OpenAIResponsesToolChoice
|
||||
|
||||
|
||||
## Fields
|
||||
|
||||
| Field | Type | Required | Description |
|
||||
| ---------------------------------------- | ---------------------------------------- | ---------------------------------------- | ---------------------------------------- |
|
||||
| `data` | List[[models.Model](../models/model.md)] | :heavy_check_mark: | List of available models |
|
||||
| `type` | [components.Type](../components/type.md) | :heavy_check_mark: | N/A |
|
||||
+3
-5
@@ -1,11 +1,9 @@
|
||||
# ChatStreamingMessageToolCall
|
||||
# OpenAIResponsesToolChoiceFunction
|
||||
|
||||
|
||||
## Fields
|
||||
|
||||
| Field | Type | Required | Description |
|
||||
| ---------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------- |
|
||||
| `index` | *float* | :heavy_check_mark: | N/A |
|
||||
| `id` | *Optional[str]* | :heavy_minus_sign: | N/A |
|
||||
| `type` | *Optional[Literal["function"]]* | :heavy_minus_sign: | N/A |
|
||||
| `function` | [Optional[models.ChatStreamingMessageToolCallFunction]](../models/chatstreamingmessagetoolcallfunction.md) | :heavy_minus_sign: | N/A |
|
||||
| `name` | *str* | :heavy_check_mark: | N/A |
|
||||
| `type` | [components.OpenAIResponsesToolChoiceTypeFunction](../components/openairesponsestoolchoicetypefunction.md) | :heavy_check_mark: | N/A |
|
||||
@@ -0,0 +1,53 @@
|
||||
# OpenAIResponsesToolChoiceUnion
|
||||
|
||||
|
||||
## Supported Types
|
||||
|
||||
### `components.OpenAIResponsesToolChoiceAuto`
|
||||
|
||||
```python
|
||||
value: components.OpenAIResponsesToolChoiceAuto = /* values here */
|
||||
```
|
||||
|
||||
### `components.OpenAIResponsesToolChoiceNone`
|
||||
|
||||
```python
|
||||
value: components.OpenAIResponsesToolChoiceNone = /* values here */
|
||||
```
|
||||
|
||||
### `components.OpenAIResponsesToolChoiceRequired`
|
||||
|
||||
```python
|
||||
value: components.OpenAIResponsesToolChoiceRequired = /* values here */
|
||||
```
|
||||
|
||||
### `components.OpenAIResponsesToolChoiceFunction`
|
||||
|
||||
```python
|
||||
value: components.OpenAIResponsesToolChoiceFunction = /* values here */
|
||||
```
|
||||
|
||||
### `components.OpenAIResponsesToolChoice`
|
||||
|
||||
```python
|
||||
value: components.OpenAIResponsesToolChoice = /* values here */
|
||||
```
|
||||
|
||||
### `components.ToolChoiceAllowed`
|
||||
|
||||
```python
|
||||
value: components.ToolChoiceAllowed = /* values here */
|
||||
```
|
||||
|
||||
### `components.OpenAIResponsesToolChoiceApplyPatch`
|
||||
|
||||
```python
|
||||
value: components.OpenAIResponsesToolChoiceApplyPatch = /* values here */
|
||||
```
|
||||
|
||||
### `components.OpenAIResponsesToolChoiceShell`
|
||||
|
||||
```python
|
||||
value: components.OpenAIResponsesToolChoiceShell = /* values here */
|
||||
```
|
||||
|
||||
+4
-4
@@ -1,11 +1,11 @@
|
||||
# ResponsesOutputItemFileSearchCall
|
||||
# OutputItemImageGenerationCall
|
||||
|
||||
|
||||
## Fields
|
||||
|
||||
| Field | Type | Required | Description | Example |
|
||||
| -------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------- |
|
||||
| `type` | [models.ResponsesOutputItemFileSearchCallType](../models/responsesoutputitemfilesearchcalltype.md) | :heavy_check_mark: | N/A | |
|
||||
| `id` | *str* | :heavy_check_mark: | N/A | |
|
||||
| `queries` | List[*str*] | :heavy_check_mark: | N/A | |
|
||||
| `status` | [models.WebSearchStatus](../models/websearchstatus.md) | :heavy_check_mark: | N/A | completed |
|
||||
| `result` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | |
|
||||
| `status` | [components.ImageGenerationStatus](../components/imagegenerationstatus.md) | :heavy_check_mark: | N/A | completed |
|
||||
| `type` | [components.OutputItemImageGenerationCallType](../components/outputitemimagegenerationcalltype.md) | :heavy_check_mark: | N/A | |
|
||||
@@ -1,10 +1,13 @@
|
||||
# GetCurrentKeyResponse
|
||||
|
||||
API key details
|
||||
# OutputMessage
|
||||
|
||||
|
||||
## Fields
|
||||
|
||||
| Field | Type | Required | Description | Example |
|
||||
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| `data` | [models.GetCurrentKeyData](../models/getcurrentkeydata.md) | :heavy_check_mark: | Current API key information | {<br/>"label": "sk-or-v1-au78b3456789012345678901234567890",<br/>"limit": 100,<br/>"usage": 25.5,<br/>"usage_daily": 25.5,<br/>"usage_weekly": 25.5,<br/>"usage_monthly": 25.5,<br/>"byok_usage": 17.38,<br/>"byok_usage_daily": 17.38,<br/>"byok_usage_weekly": 17.38,<br/>"byok_usage_monthly": 17.38,<br/>"is_free_tier": false,<br/>"is_provisioning_key": false,<br/>"limit_remaining": 74.5,<br/>"limit_reset": "monthly",<br/>"include_byok_in_limit": false,<br/>"expires_at": "2027-12-31T23:59:59Z",<br/>"rate_limit": {<br/>"requests": 1000,<br/>"interval": "1h",<br/>"note": "This field is deprecated and safe to ignore."<br/>}<br/>} |
|
||||
| Field | Type | Required | Description |
|
||||
| -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| `content` | List[[components.OutputMessageContent](../components/outputmessagecontent.md)] | :heavy_check_mark: | N/A |
|
||||
| `id` | *str* | :heavy_check_mark: | N/A |
|
||||
| `phase` | [OptionalNullable[components.OutputMessagePhaseUnion]](../components/outputmessagephaseunion.md) | :heavy_minus_sign: | The phase of an assistant message. Use `commentary` for an intermediate assistant message and `final_answer` for the final assistant message. For follow-up requests with models like `gpt-5.3-codex` and later, preserve and resend phase on all assistant messages. Omitting it can degrade performance. Not used for user messages. |
|
||||
| `role` | [components.OutputMessageRole](../components/outputmessagerole.md) | :heavy_check_mark: | N/A |
|
||||
| `status` | [Optional[components.OutputMessageStatusUnion]](../components/outputmessagestatusunion.md) | :heavy_minus_sign: | N/A |
|
||||
| `type` | [components.OutputMessageType](../components/outputmessagetype.md) | :heavy_check_mark: | N/A |
|
||||
@@ -0,0 +1,17 @@
|
||||
# OutputMessageContent
|
||||
|
||||
|
||||
## Supported Types
|
||||
|
||||
### `components.ResponseOutputText`
|
||||
|
||||
```python
|
||||
value: components.ResponseOutputText = /* values here */
|
||||
```
|
||||
|
||||
### `components.OpenAIResponsesRefusalContent`
|
||||
|
||||
```python
|
||||
value: components.OpenAIResponsesRefusalContent = /* values here */
|
||||
```
|
||||
|
||||
@@ -0,0 +1,23 @@
|
||||
# OutputMessageStatusUnion
|
||||
|
||||
|
||||
## Supported Types
|
||||
|
||||
### `components.OutputMessageStatusCompleted`
|
||||
|
||||
```python
|
||||
value: components.OutputMessageStatusCompleted = /* values here */
|
||||
```
|
||||
|
||||
### `components.OutputMessageStatusIncomplete`
|
||||
|
||||
```python
|
||||
value: components.OutputMessageStatusIncomplete = /* values here */
|
||||
```
|
||||
|
||||
### `components.OutputMessageStatusInProgress`
|
||||
|
||||
```python
|
||||
value: components.OutputMessageStatusInProgress = /* values here */
|
||||
```
|
||||
|
||||
@@ -0,0 +1,15 @@
|
||||
# OutputModality
|
||||
|
||||
|
||||
## Values
|
||||
|
||||
| Name | Value |
|
||||
| --------------- | --------------- |
|
||||
| `TEXT` | text |
|
||||
| `IMAGE` | image |
|
||||
| `EMBEDDINGS` | embeddings |
|
||||
| `AUDIO` | audio |
|
||||
| `VIDEO` | video |
|
||||
| `RERANK` | rerank |
|
||||
| `SPEECH` | speech |
|
||||
| `TRANSCRIPTION` | transcription |
|
||||
@@ -5,4 +5,4 @@
|
||||
|
||||
| Field | Type | Required | Description |
|
||||
| ------------------ | ------------------ | ------------------ | ------------------ |
|
||||
| `reasoning_tokens` | *float* | :heavy_check_mark: | N/A |
|
||||
| `reasoning_tokens` | *int* | :heavy_check_mark: | N/A |
|
||||
@@ -0,0 +1,32 @@
|
||||
# Parameter
|
||||
|
||||
|
||||
## Values
|
||||
|
||||
| Name | Value |
|
||||
| ----------------------- | ----------------------- |
|
||||
| `TEMPERATURE` | temperature |
|
||||
| `TOP_P` | top_p |
|
||||
| `TOP_K` | top_k |
|
||||
| `MIN_P` | min_p |
|
||||
| `TOP_A` | top_a |
|
||||
| `FREQUENCY_PENALTY` | frequency_penalty |
|
||||
| `PRESENCE_PENALTY` | presence_penalty |
|
||||
| `REPETITION_PENALTY` | repetition_penalty |
|
||||
| `MAX_TOKENS` | max_tokens |
|
||||
| `MAX_COMPLETION_TOKENS` | max_completion_tokens |
|
||||
| `LOGIT_BIAS` | logit_bias |
|
||||
| `LOGPROBS` | logprobs |
|
||||
| `TOP_LOGPROBS` | top_logprobs |
|
||||
| `SEED` | seed |
|
||||
| `RESPONSE_FORMAT` | response_format |
|
||||
| `STRUCTURED_OUTPUTS` | structured_outputs |
|
||||
| `STOP` | stop |
|
||||
| `TOOLS` | tools |
|
||||
| `TOOL_CHOICE` | tool_choice |
|
||||
| `PARALLEL_TOOL_CALLS` | parallel_tool_calls |
|
||||
| `INCLUDE_REASONING` | include_reasoning |
|
||||
| `REASONING` | reasoning |
|
||||
| `REASONING_EFFORT` | reasoning_effort |
|
||||
| `WEB_SEARCH_OPTIONS` | web_search_options |
|
||||
| `VERBOSITY` | verbosity |
|
||||
@@ -0,0 +1,11 @@
|
||||
# Partition
|
||||
|
||||
Partitioning strategy for sorting: "model" (default) groups endpoints by model before sorting (fallback models remain fallbacks), "none" sorts all endpoints together regardless of model.
|
||||
|
||||
|
||||
## Values
|
||||
|
||||
| Name | Value |
|
||||
| ------- | ------- |
|
||||
| `MODEL` | model |
|
||||
| `NONE` | none |
|
||||
@@ -0,0 +1,19 @@
|
||||
# PDFParserEngine
|
||||
|
||||
The engine to use for parsing PDF files. "pdf-text" is deprecated and automatically redirected to "cloudflare-ai".
|
||||
|
||||
|
||||
## Supported Types
|
||||
|
||||
### `components.PDFParserEngineEnum`
|
||||
|
||||
```python
|
||||
value: components.PDFParserEngineEnum = /* values here */
|
||||
```
|
||||
|
||||
### `components.PDFParserEnginePDFText`
|
||||
|
||||
```python
|
||||
value: components.PDFParserEnginePDFText = /* values here */
|
||||
```
|
||||
|
||||
@@ -0,0 +1,10 @@
|
||||
# PDFParserOptions
|
||||
|
||||
Options for PDF parsing.
|
||||
|
||||
|
||||
## Fields
|
||||
|
||||
| Field | Type | Required | Description | Example |
|
||||
| ------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------ |
|
||||
| `engine` | [Optional[components.PDFParserEngine]](../components/pdfparserengine.md) | :heavy_minus_sign: | The engine to use for parsing PDF files. "pdf-text" is deprecated and automatically redirected to "cloudflare-ai". | cloudflare-ai |
|
||||
@@ -0,0 +1,13 @@
|
||||
# PercentileLatencyCutoffs
|
||||
|
||||
Percentile-based latency cutoffs. All specified cutoffs must be met for an endpoint to be preferred.
|
||||
|
||||
|
||||
## Fields
|
||||
|
||||
| Field | Type | Required | Description |
|
||||
| ----------------------------- | ----------------------------- | ----------------------------- | ----------------------------- |
|
||||
| `p50` | *OptionalNullable[float]* | :heavy_minus_sign: | Maximum p50 latency (seconds) |
|
||||
| `p75` | *OptionalNullable[float]* | :heavy_minus_sign: | Maximum p75 latency (seconds) |
|
||||
| `p90` | *OptionalNullable[float]* | :heavy_minus_sign: | Maximum p90 latency (seconds) |
|
||||
| `p99` | *OptionalNullable[float]* | :heavy_minus_sign: | Maximum p99 latency (seconds) |
|
||||
@@ -0,0 +1,13 @@
|
||||
# PercentileStats
|
||||
|
||||
Latency percentiles in milliseconds over the last 30 minutes. Latency measures time to first token. Only visible when authenticated with an API key or cookie; returns null for unauthenticated requests.
|
||||
|
||||
|
||||
## Fields
|
||||
|
||||
| Field | Type | Required | Description | Example |
|
||||
| ------------------------ | ------------------------ | ------------------------ | ------------------------ | ------------------------ |
|
||||
| `p50` | *float* | :heavy_check_mark: | Median (50th percentile) | 25.5 |
|
||||
| `p75` | *float* | :heavy_check_mark: | 75th percentile | 35.2 |
|
||||
| `p90` | *float* | :heavy_check_mark: | 90th percentile | 48.7 |
|
||||
| `p99` | *float* | :heavy_check_mark: | 99th percentile | 85.3 |
|
||||
@@ -0,0 +1,13 @@
|
||||
# PercentileThroughputCutoffs
|
||||
|
||||
Percentile-based throughput cutoffs. All specified cutoffs must be met for an endpoint to be preferred.
|
||||
|
||||
|
||||
## Fields
|
||||
|
||||
| Field | Type | Required | Description |
|
||||
| ----------------------------------- | ----------------------------------- | ----------------------------------- | ----------------------------------- |
|
||||
| `p50` | *OptionalNullable[float]* | :heavy_minus_sign: | Minimum p50 throughput (tokens/sec) |
|
||||
| `p75` | *OptionalNullable[float]* | :heavy_minus_sign: | Minimum p75 throughput (tokens/sec) |
|
||||
| `p90` | *OptionalNullable[float]* | :heavy_minus_sign: | Minimum p90 throughput (tokens/sec) |
|
||||
| `p99` | *OptionalNullable[float]* | :heavy_minus_sign: | Minimum p99 throughput (tokens/sec) |
|
||||
@@ -7,5 +7,5 @@ Per-request token limits
|
||||
|
||||
| Field | Type | Required | Description | Example |
|
||||
| ------------------------------------- | ------------------------------------- | ------------------------------------- | ------------------------------------- | ------------------------------------- |
|
||||
| `prompt_tokens` | *float* | :heavy_check_mark: | Maximum prompt tokens per request | 1000 |
|
||||
| `completion_tokens` | *float* | :heavy_check_mark: | Maximum completion tokens per request | 1000 |
|
||||
| `completion_tokens` | *float* | :heavy_check_mark: | Maximum completion tokens per request | 1000 |
|
||||
| `prompt_tokens` | *float* | :heavy_check_mark: | Maximum prompt tokens per request | 1000 |
|
||||
@@ -0,0 +1,25 @@
|
||||
# PreferredMaxLatency
|
||||
|
||||
Preferred maximum latency (in seconds). Can be a number (applies to p50) or an object with percentile-specific cutoffs. Endpoints above the threshold(s) may still be used, but are deprioritized in routing. When using fallback models, this may cause a fallback model to be used instead of the primary model if it meets the threshold.
|
||||
|
||||
|
||||
## Supported Types
|
||||
|
||||
### `float`
|
||||
|
||||
```python
|
||||
value: float = /* values here */
|
||||
```
|
||||
|
||||
### `components.PercentileLatencyCutoffs`
|
||||
|
||||
```python
|
||||
value: components.PercentileLatencyCutoffs = /* values here */
|
||||
```
|
||||
|
||||
### `Any`
|
||||
|
||||
```python
|
||||
value: Any = /* values here */
|
||||
```
|
||||
|
||||
@@ -0,0 +1,25 @@
|
||||
# PreferredMinThroughput
|
||||
|
||||
Preferred minimum throughput (in tokens per second). Can be a number (applies to p50) or an object with percentile-specific cutoffs. Endpoints below the threshold(s) may still be used, but are deprioritized in routing. When using fallback models, this may cause a fallback model to be used instead of the primary model if it meets the threshold.
|
||||
|
||||
|
||||
## Supported Types
|
||||
|
||||
### `float`
|
||||
|
||||
```python
|
||||
value: float = /* values here */
|
||||
```
|
||||
|
||||
### `components.PercentileThroughputCutoffs`
|
||||
|
||||
```python
|
||||
value: components.PercentileThroughputCutoffs = /* values here */
|
||||
```
|
||||
|
||||
### `Any`
|
||||
|
||||
```python
|
||||
value: Any = /* values here */
|
||||
```
|
||||
|
||||
@@ -0,0 +1,21 @@
|
||||
# Pricing
|
||||
|
||||
|
||||
## Fields
|
||||
|
||||
| Field | Type | Required | Description | Example |
|
||||
| -------------------- | -------------------- | -------------------- | -------------------- | -------------------- |
|
||||
| `audio` | *Optional[str]* | :heavy_minus_sign: | N/A | 1000 |
|
||||
| `audio_output` | *Optional[str]* | :heavy_minus_sign: | N/A | 1000 |
|
||||
| `completion` | *str* | :heavy_check_mark: | N/A | 1000 |
|
||||
| `discount` | *Optional[float]* | :heavy_minus_sign: | N/A | |
|
||||
| `image` | *Optional[str]* | :heavy_minus_sign: | N/A | 1000 |
|
||||
| `image_output` | *Optional[str]* | :heavy_minus_sign: | N/A | 1000 |
|
||||
| `image_token` | *Optional[str]* | :heavy_minus_sign: | N/A | 1000 |
|
||||
| `input_audio_cache` | *Optional[str]* | :heavy_minus_sign: | N/A | 1000 |
|
||||
| `input_cache_read` | *Optional[str]* | :heavy_minus_sign: | N/A | 1000 |
|
||||
| `input_cache_write` | *Optional[str]* | :heavy_minus_sign: | N/A | 1000 |
|
||||
| `internal_reasoning` | *Optional[str]* | :heavy_minus_sign: | N/A | 1000 |
|
||||
| `prompt` | *str* | :heavy_check_mark: | N/A | 1000 |
|
||||
| `request` | *Optional[str]* | :heavy_minus_sign: | N/A | 1000 |
|
||||
| `web_search` | *Optional[str]* | :heavy_minus_sign: | N/A | 1000 |
|
||||
+7
-6
@@ -1,12 +1,13 @@
|
||||
# WebSearchPreviewToolUserLocation
|
||||
# PromptTokensDetails
|
||||
|
||||
Detailed prompt token usage
|
||||
|
||||
|
||||
## Fields
|
||||
|
||||
| Field | Type | Required | Description |
|
||||
| ------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------ |
|
||||
| `type` | [models.WebSearchPreviewToolUserLocationType](../models/websearchpreviewtooluserlocationtype.md) | :heavy_check_mark: | N/A |
|
||||
| `city` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A |
|
||||
| `country` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A |
|
||||
| `region` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A |
|
||||
| `timezone` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A |
|
||||
| `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 |
|
||||
@@ -0,0 +1,93 @@
|
||||
# ProviderName
|
||||
|
||||
|
||||
## Values
|
||||
|
||||
| Name | Value |
|
||||
| ------------------- | ------------------- |
|
||||
| `AKASH_ML` | AkashML |
|
||||
| `AI21` | AI21 |
|
||||
| `AION_LABS` | AionLabs |
|
||||
| `ALIBABA` | Alibaba |
|
||||
| `AMBIENT` | Ambient |
|
||||
| `BAIDU` | Baidu |
|
||||
| `AMAZON_BEDROCK` | Amazon Bedrock |
|
||||
| `AMAZON_NOVA` | Amazon Nova |
|
||||
| `ANTHROPIC` | Anthropic |
|
||||
| `ARCEE_AI` | Arcee AI |
|
||||
| `ATLAS_CLOUD` | AtlasCloud |
|
||||
| `AVIAN` | Avian |
|
||||
| `AZURE` | Azure |
|
||||
| `BASE_TEN` | BaseTen |
|
||||
| `BYTE_PLUS` | BytePlus |
|
||||
| `BLACK_FOREST_LABS` | Black Forest Labs |
|
||||
| `CEREBRAS` | Cerebras |
|
||||
| `CHUTES` | Chutes |
|
||||
| `CIRRASCALE` | Cirrascale |
|
||||
| `CLARIFAI` | Clarifai |
|
||||
| `CLOUDFLARE` | Cloudflare |
|
||||
| `COHERE` | Cohere |
|
||||
| `CRUCIBLE` | Crucible |
|
||||
| `CRUSOE` | Crusoe |
|
||||
| `DARKBLOOM` | Darkbloom |
|
||||
| `DECART` | Decart |
|
||||
| `DEEP_INFRA` | DeepInfra |
|
||||
| `DEEP_SEEK` | DeepSeek |
|
||||
| `DEKA_LLM` | DekaLLM |
|
||||
| `DIGITAL_OCEAN` | DigitalOcean |
|
||||
| `FEATHERLESS` | Featherless |
|
||||
| `FIREWORKS` | Fireworks |
|
||||
| `FRIENDLI` | Friendli |
|
||||
| `GMI_CLOUD` | GMICloud |
|
||||
| `GOOGLE` | Google |
|
||||
| `GOOGLE_AI_STUDIO` | Google AI Studio |
|
||||
| `GROQ` | Groq |
|
||||
| `INCEPTION` | Inception |
|
||||
| `INCEPTRON` | Inceptron |
|
||||
| `INFERENCE_NET` | InferenceNet |
|
||||
| `IONSTREAM` | Ionstream |
|
||||
| `INFERMATIC` | Infermatic |
|
||||
| `IO_NET` | Io Net |
|
||||
| `INFLECTION` | Inflection |
|
||||
| `LIQUID` | Liquid |
|
||||
| `MARA` | Mara |
|
||||
| `MANCER_2` | Mancer 2 |
|
||||
| `MINIMAX` | Minimax |
|
||||
| `MODEL_RUN` | ModelRun |
|
||||
| `MISTRAL` | Mistral |
|
||||
| `MODULAR` | Modular |
|
||||
| `MOONSHOT_AI` | Moonshot AI |
|
||||
| `MORPH` | Morph |
|
||||
| `N_COMPASS` | NCompass |
|
||||
| `NEBIUS` | Nebius |
|
||||
| `NEX_AGI` | Nex AGI |
|
||||
| `NEXT_BIT` | NextBit |
|
||||
| `NOVITA` | Novita |
|
||||
| `NVIDIA` | Nvidia |
|
||||
| `OPEN_AI` | OpenAI |
|
||||
| `OPEN_INFERENCE` | OpenInference |
|
||||
| `PARASAIL` | Parasail |
|
||||
| `POOLSIDE` | Poolside |
|
||||
| `PERCEPTRON` | Perceptron |
|
||||
| `PERPLEXITY` | Perplexity |
|
||||
| `PHALA` | Phala |
|
||||
| `RECRAFT` | Recraft |
|
||||
| `REKA` | Reka |
|
||||
| `RELACE` | Relace |
|
||||
| `SAMBA_NOVA` | SambaNova |
|
||||
| `SEED` | Seed |
|
||||
| `SILICON_FLOW` | SiliconFlow |
|
||||
| `SOURCEFUL` | Sourceful |
|
||||
| `STEP_FUN` | StepFun |
|
||||
| `STEALTH` | Stealth |
|
||||
| `STREAM_LAKE` | StreamLake |
|
||||
| `SWITCHPOINT` | Switchpoint |
|
||||
| `TOGETHER` | Together |
|
||||
| `UPSTAGE` | Upstage |
|
||||
| `VENICE` | Venice |
|
||||
| `WAFER` | Wafer |
|
||||
| `WAND_B` | WandB |
|
||||
| `XIAOMI` | Xiaomi |
|
||||
| `X_AI` | xAI |
|
||||
| `Z_AI` | Z.AI |
|
||||
| `FAKE_PROVIDER` | FakeProvider |
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user