Skip to content

Commit 0d22f63

Browse files
author
OpenRouter SDK Bot
committed
chore: update OpenAPI spec [sdk-bot]
1 parent 678d5aa commit 0d22f63

1 file changed

Lines changed: 297 additions & 0 deletions

File tree

‎.speakeasy/in.openapi.yaml‎

Lines changed: 297 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20782,6 +20782,195 @@ components:
2078220782
seed:
2078320783
type: boolean
2078420784
type: object
20785+
TaskClassificationItem:
20786+
example:
20787+
category_token_share: 0.48
20788+
category_usage_share: 0.51
20789+
display_name: Code Generation
20790+
macro_category: code
20791+
models:
20792+
- id: openai/gpt-4.1-mini
20793+
tag_token_share: 0.75
20794+
tag_usage_share: 0.55
20795+
- id: anthropic/claude-sonnet-4
20796+
tag_token_share: 0.12
20797+
tag_usage_share: 0.2
20798+
tag: code:general_impl
20799+
token_share: 0.31
20800+
usage_share: 0.23
20801+
properties:
20802+
category_token_share:
20803+
description: >-
20804+
Fraction of this classification's token volume within its macro-category (0–1). Sums to 1 across all
20805+
classifications sharing the same `macro_category`.
20806+
example: 0.48
20807+
format: double
20808+
type: number
20809+
category_usage_share:
20810+
description: >-
20811+
Fraction of this classification's usage within its macro-category (0–1). Sums to 1 across all
20812+
classifications sharing the same `macro_category`.
20813+
example: 0.51
20814+
format: double
20815+
type: number
20816+
display_name:
20817+
description: Human-readable label for the classification.
20818+
example: Code Generation
20819+
type: string
20820+
macro_category:
20821+
description: 'Coarse grouping derived from the tag prefix: `code`, `data`, `agent`, or `general`.'
20822+
example: code
20823+
type: string
20824+
models:
20825+
description: >-
20826+
Top models for this classification by request volume, sorted descending. Each entry reports the model's
20827+
share of this classification's requests and tokens.
20828+
items:
20829+
$ref: '#/components/schemas/TaskClassificationModel'
20830+
type: array
20831+
tag:
20832+
description: Classification tag identifier (e.g. `code:general_impl`, `agent:web_search`).
20833+
example: code:general_impl
20834+
type: string
20835+
token_share:
20836+
description: >-
20837+
Fraction of classified sampled token volume (prompt + completion) attributed to this classification (0–1).
20838+
The unclassified `other` bucket is excluded from the denominator.
20839+
example: 0.31
20840+
format: double
20841+
type: number
20842+
usage_share:
20843+
description: >-
20844+
Fraction of classified sampled requests attributed to this classification (0–1). The unclassified `other`
20845+
bucket is excluded from the denominator.
20846+
example: 0.23
20847+
format: double
20848+
type: number
20849+
required:
20850+
- tag
20851+
- display_name
20852+
- macro_category
20853+
- usage_share
20854+
- token_share
20855+
- category_usage_share
20856+
- category_token_share
20857+
- models
20858+
type: object
20859+
TaskClassificationMacroCategory:
20860+
example:
20861+
key: code
20862+
label: Code
20863+
token_share: 0.52
20864+
usage_share: 0.45
20865+
properties:
20866+
key:
20867+
description: Macro-category identifier.
20868+
example: code
20869+
type: string
20870+
label:
20871+
description: Human-readable label for the macro-category.
20872+
example: Code
20873+
type: string
20874+
token_share:
20875+
description: Combined token share of all classifications in this macro-category (0–1).
20876+
example: 0.52
20877+
format: double
20878+
type: number
20879+
usage_share:
20880+
description: Combined usage share of all classifications in this macro-category (0–1).
20881+
example: 0.45
20882+
format: double
20883+
type: number
20884+
required:
20885+
- key
20886+
- label
20887+
- usage_share
20888+
- token_share
20889+
type: object
20890+
TaskClassificationModel:
20891+
example:
20892+
id: openai/gpt-4.1-mini
20893+
tag_token_share: 0.75
20894+
tag_usage_share: 0.55
20895+
properties:
20896+
id:
20897+
description: Model identifier (permaslug).
20898+
example: openai/gpt-4.1-mini
20899+
type: string
20900+
tag_token_share:
20901+
description: >-
20902+
Fraction of this classification's sampled token volume attributed to this model (0–1). Sums to ≤1 across the
20903+
returned models (only top-N are included and unattributed requests are excluded).
20904+
example: 0.75
20905+
format: double
20906+
type: number
20907+
tag_usage_share:
20908+
description: >-
20909+
Fraction of this classification's sampled requests attributed to this model (0–1). Sums to ≤1 across the
20910+
returned models (only top-N are included and unattributed requests are excluded).
20911+
example: 0.55
20912+
format: double
20913+
type: number
20914+
required:
20915+
- id
20916+
- tag_usage_share
20917+
- tag_token_share
20918+
type: object
20919+
TaskClassificationResponse:
20920+
example:
20921+
data:
20922+
as_of: '2026-06-17'
20923+
classifications:
20924+
- category_token_share: 0.48
20925+
category_usage_share: 0.51
20926+
display_name: Code Generation
20927+
macro_category: code
20928+
models:
20929+
- id: openai/gpt-4.1-mini
20930+
tag_token_share: 0.75
20931+
tag_usage_share: 0.55
20932+
tag: code:general_impl
20933+
token_share: 0.31
20934+
usage_share: 0.23
20935+
macro_categories:
20936+
- key: code
20937+
label: Code
20938+
token_share: 0.52
20939+
usage_share: 0.45
20940+
window_days: 7
20941+
properties:
20942+
data:
20943+
properties:
20944+
as_of:
20945+
description: >-
20946+
UTC date (YYYY-MM-DD) of the window upper bound (yesterday). Data is exclusive of the current incomplete
20947+
UTC day. This is the expected latest date in the snapshot; it does not confirm data presence for that
20948+
date.
20949+
example: '2026-06-17'
20950+
type: string
20951+
classifications:
20952+
description: Per-task classification market-share data, sorted by usage_share descending.
20953+
items:
20954+
$ref: '#/components/schemas/TaskClassificationItem'
20955+
type: array
20956+
macro_categories:
20957+
description: Aggregate market-share data per macro-category (code, data, agent, general).
20958+
items:
20959+
$ref: '#/components/schemas/TaskClassificationMacroCategory'
20960+
type: array
20961+
window_days:
20962+
description: Number of trailing days covered by this snapshot.
20963+
example: 7
20964+
type: integer
20965+
required:
20966+
- window_days
20967+
- as_of
20968+
- classifications
20969+
- macro_categories
20970+
type: object
20971+
required:
20972+
- data
20973+
type: object
2078520974
TextConfig:
2078620975
description: Text output configuration including format and verbosity
2078720976
example:
@@ -24781,6 +24970,112 @@ paths:
2478124970
x-speakeasy-group: chat
2478224971
x-speakeasy-name-override: send
2478324972
x-speakeasy-stream-request-field: stream
24973+
/classifications/task:
24974+
get:
24975+
description: |-
24976+
Returns the market-share breakdown of OpenRouter traffic by task classification
24977+
(e.g. code generation, web search, summarization) over a trailing time window.
24978+
24979+
Each classification reports its share of classified sampled requests (`usage_share`)
24980+
and classified sampled token volume (`token_share`) as fractions between 0 and 1.
24981+
The unclassified `other` bucket is excluded. Absolute volumes are not exposed
24982+
because the underlying data is sampled.
24983+
24984+
Each classification also includes a `models` array listing the top models by
24985+
request volume within that classification, with their within-tag usage and token shares.
24986+
24987+
Classifications are grouped into macro-categories (Code, Data, Agent, General)
24988+
with aggregate shares provided for each.
24989+
24990+
Authenticate with any valid OpenRouter API key (same key used for inference).
24991+
Rate-limited to 30 requests/minute per key and 500 requests/day per account.
24992+
24993+
When republishing or quoting this data, cite as:
24994+
"Source: OpenRouter (openrouter.ai/rankings), as of {as_of}."
24995+
operationId: getTaskClassifications
24996+
parameters:
24997+
- description: Trailing time window for the classification data. Currently only `7d` (trailing 7 days) is supported.
24998+
in: query
24999+
name: window
25000+
required: false
25001+
schema:
25002+
default: 7d
25003+
description: Trailing time window for the classification data. Currently only `7d` (trailing 7 days) is supported.
25004+
enum:
25005+
- 7d
25006+
example: 7d
25007+
type: string
25008+
responses:
25009+
'200':
25010+
content:
25011+
application/json:
25012+
example:
25013+
data:
25014+
as_of: '2026-06-17'
25015+
classifications:
25016+
- category_token_share: 0.48
25017+
category_usage_share: 0.51
25018+
display_name: Code Generation
25019+
macro_category: code
25020+
models:
25021+
- id: openai/gpt-4.1-mini
25022+
tag_token_share: 0.75
25023+
tag_usage_share: 0.55
25024+
tag: code:general_impl
25025+
token_share: 0.31
25026+
usage_share: 0.23
25027+
macro_categories:
25028+
- key: code
25029+
label: Code
25030+
token_share: 0.52
25031+
usage_share: 0.45
25032+
window_days: 7
25033+
schema:
25034+
$ref: '#/components/schemas/TaskClassificationResponse'
25035+
description: Task classification market-share data for the requested trailing window.
25036+
'400':
25037+
content:
25038+
application/json:
25039+
example:
25040+
error:
25041+
code: 400
25042+
message: Invalid request parameters
25043+
schema:
25044+
$ref: '#/components/schemas/BadRequestResponse'
25045+
description: Bad Request - Invalid request parameters or malformed input
25046+
'401':
25047+
content:
25048+
application/json:
25049+
example:
25050+
error:
25051+
code: 401
25052+
message: Missing Authentication header
25053+
schema:
25054+
$ref: '#/components/schemas/UnauthorizedResponse'
25055+
description: Unauthorized - Authentication required or invalid credentials
25056+
'429':
25057+
content:
25058+
application/json:
25059+
example:
25060+
error:
25061+
code: 429
25062+
message: Rate limit exceeded
25063+
schema:
25064+
$ref: '#/components/schemas/TooManyRequestsResponse'
25065+
description: Too Many Requests - Rate limit exceeded
25066+
'500':
25067+
content:
25068+
application/json:
25069+
example:
25070+
error:
25071+
code: 500
25072+
message: Internal Server Error
25073+
schema:
25074+
$ref: '#/components/schemas/InternalServerResponse'
25075+
description: Internal Server Error - Unexpected server error
25076+
summary: Task classification market share
25077+
tags:
25078+
- Classifications
2478425079
/credits:
2478525080
get:
2478625081
description: >-
@@ -33725,6 +34020,8 @@ tags:
3372534020
name: Benchmarks
3372634021
- description: Chat completion endpoints
3372734022
name: Chat
34023+
- description: Task classification market-share endpoints
34024+
name: Classifications
3372834025
- description: Credit management endpoints
3372934026
name: Credits
3373034027
- description: Datasets endpoints

0 commit comments

Comments
 (0)