Skip to content

Commit 4610ea4

Browse files
robert-j-yOpenRouter SDK Bot
andauthored
chore: update OpenAPI spec from monorepo (#273)
Co-authored-by: OpenRouter SDK Bot <sdk-bot@openrouter.ai>
1 parent 67bd505 commit 4610ea4

1 file changed

Lines changed: 215 additions & 0 deletions

File tree

‎.speakeasy/in.openapi.yaml‎

Lines changed: 215 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16624,6 +16624,98 @@ components:
1662416624
- unknown
1662516625
example: fp16
1662616626
type: string
16627+
RankingsDailyItem:
16628+
example:
16629+
date: '2026-05-11'
16630+
model_permaslug: openai/gpt-4o-2024-05-13
16631+
total_tokens: '12345678'
16632+
properties:
16633+
date:
16634+
description: UTC calendar date the row is aggregated over (YYYY-MM-DD).
16635+
example: '2026-05-11'
16636+
type: string
16637+
model_permaslug:
16638+
description: >-
16639+
Model variant permaslug (e.g. `openai/gpt-4o-2024-05-13`, `openai/gpt-4o-2024-05-13:free`). Non-default
16640+
variants include a `:variant` suffix and are ranked as their own entry. The reserved value `other` denotes
16641+
the aggregated row covering every model outside the daily top 50 for that date — always sorted last within
16642+
its date.
16643+
example: openai/gpt-4o-2024-05-13
16644+
type: string
16645+
total_tokens:
16646+
description: >-
16647+
Sum of `prompt_tokens + completion_tokens` for the day, returned as a decimal string so 64-bit values are
16648+
not truncated.
16649+
example: '12345678'
16650+
type: string
16651+
required:
16652+
- date
16653+
- model_permaslug
16654+
- total_tokens
16655+
type: object
16656+
RankingsDailyMeta:
16657+
example:
16658+
as_of: '2026-05-12T02:00:00Z'
16659+
end_date: '2026-05-11'
16660+
start_date: '2026-04-12'
16661+
version: v1
16662+
properties:
16663+
as_of:
16664+
description: >-
16665+
ISO-8601 timestamp of when the response was generated. Reflects data-freshness because the underlying
16666+
materialized view continuously ingests upstream events.
16667+
example: '2026-05-12T02:00:00Z'
16668+
type: string
16669+
end_date:
16670+
description: Resolved end of the date window (UTC, inclusive).
16671+
example: '2026-05-11'
16672+
type: string
16673+
start_date:
16674+
description: Resolved start of the date window (UTC, inclusive).
16675+
example: '2026-04-12'
16676+
type: string
16677+
version:
16678+
description: Dataset version. Field names and grain are stable for the life of `v1`.
16679+
enum:
16680+
- v1
16681+
type: string
16682+
required:
16683+
- as_of
16684+
- version
16685+
- start_date
16686+
- end_date
16687+
type: object
16688+
RankingsDailyResponse:
16689+
example:
16690+
data:
16691+
- date: '2026-05-11'
16692+
model_permaslug: openai/gpt-4o-2024-05-13
16693+
total_tokens: '12345678'
16694+
- date: '2026-05-11'
16695+
model_permaslug: anthropic/claude-3.5-sonnet-20241022
16696+
total_tokens: '9876543'
16697+
meta:
16698+
as_of: '2026-05-12T02:00:00Z'
16699+
end_date: '2026-05-11'
16700+
start_date: '2026-04-12'
16701+
version: v1
16702+
properties:
16703+
data:
16704+
description: >-
16705+
Up to 51 rows per day — the top 50 public models by `total_tokens` for each UTC calendar date in the window,
16706+
plus one aggregated `other` row summing every model outside that top 50 (omitted when the long tail is
16707+
empty). Rows are sorted by `date` ascending, then by `total_tokens` descending, with `other` pinned last
16708+
within its date. Ties between real models break alphabetically on `model_permaslug` so the order is stable
16709+
across requests.
16710+
items:
16711+
$ref: '#/components/schemas/RankingsDailyItem'
16712+
type: array
16713+
meta:
16714+
$ref: '#/components/schemas/RankingsDailyMeta'
16715+
required:
16716+
- data
16717+
- meta
16718+
type: object
1662716719
ReasoningConfig:
1662816720
allOf:
1662916721
- $ref: '#/components/schemas/BaseReasoningConfig'
@@ -21253,6 +21345,127 @@ paths:
2125321345
x-fern-ignore: true
2125421346
x-speakeasy-ignore: true
2125521347
x-speakeasy-name-override: createCoinbaseCharge
21348+
/datasets/rankings-daily:
21349+
get:
21350+
description: |-
21351+
Returns the top 50 public models per day by total token usage on OpenRouter, plus a
21352+
single aggregated `other` row per day that sums every model outside that top 50.
21353+
Token totals are `prompt_tokens + completion_tokens`, matching the public rankings
21354+
chart on openrouter.ai/rankings.
21355+
21356+
Each row is a distinct `(date, model_permaslug)` pair. The `other` row uses the
21357+
reserved permaslug `other` and is always returned last within its date, so callers
21358+
can compute `top-50 traffic / total daily traffic` without a second request.
21359+
21360+
Authenticate with any valid OpenRouter API key (same key used for inference).
21361+
Rate-limited to 30 requests/minute per key and 500 requests/day per account.
21362+
21363+
When republishing or quoting this dataset, OpenRouter must be cited as:
21364+
"Source: OpenRouter (openrouter.ai/rankings), as of {as_of}."
21365+
21366+
Token counts come from each upstream provider's own tokenizer (Anthropic counts
21367+
are as reported by Anthropic, OpenAI counts are as reported by OpenAI, etc.), so
21368+
a token in one row is not directly comparable to a token in another row from a
21369+
different provider.
21370+
operationId: getRankingsDaily
21371+
parameters:
21372+
- description: >-
21373+
Start of the date window in YYYY-MM-DD (UTC), inclusive. Defaults to 30 days before `end_date`. The dataset
21374+
begins at 2025-01-01; earlier values are clamped forward to that floor and the resolved value is echoed in
21375+
`meta.start_date`.
21376+
in: query
21377+
name: start_date
21378+
required: false
21379+
schema:
21380+
description: >-
21381+
Start of the date window in YYYY-MM-DD (UTC), inclusive. Defaults to 30 days before `end_date`. The
21382+
dataset begins at 2025-01-01; earlier values are clamped forward to that floor and the resolved value is
21383+
echoed in `meta.start_date`.
21384+
example: '2026-04-12'
21385+
pattern: ^\d{4}-\d{2}-\d{2}$
21386+
type: string
21387+
- description: >-
21388+
End of the date window in YYYY-MM-DD (UTC), inclusive. Defaults to the most recent completed UTC day. Must
21389+
be on or after 2025-01-01; earlier values are rejected with a 400.
21390+
in: query
21391+
name: end_date
21392+
required: false
21393+
schema:
21394+
description: >-
21395+
End of the date window in YYYY-MM-DD (UTC), inclusive. Defaults to the most recent completed UTC day. Must
21396+
be on or after 2025-01-01; earlier values are rejected with a 400.
21397+
example: '2026-05-11'
21398+
pattern: ^\d{4}-\d{2}-\d{2}$
21399+
type: string
21400+
responses:
21401+
'200':
21402+
content:
21403+
application/json:
21404+
example:
21405+
data:
21406+
- date: '2026-05-11'
21407+
model_permaslug: openai/gpt-4o-2024-05-13
21408+
total_tokens: '12345678'
21409+
- date: '2026-05-11'
21410+
model_permaslug: anthropic/claude-3.5-sonnet-20241022
21411+
total_tokens: '9876543'
21412+
- date: '2026-05-11'
21413+
model_permaslug: other
21414+
total_tokens: '4321098'
21415+
meta:
21416+
as_of: '2026-05-12T02:00:00Z'
21417+
end_date: '2026-05-11'
21418+
start_date: '2026-04-12'
21419+
version: v1
21420+
schema:
21421+
$ref: '#/components/schemas/RankingsDailyResponse'
21422+
description: >-
21423+
Up to 51 rows per day — the top 50 public models by `total_tokens` plus a single aggregated `other` row
21424+
covering every model outside that top 50. Sorted by `date` ascending, then by `total_tokens` descending,
21425+
with `other` pinned last within its date.
21426+
'400':
21427+
content:
21428+
application/json:
21429+
example:
21430+
error:
21431+
code: 400
21432+
message: Invalid request parameters
21433+
schema:
21434+
$ref: '#/components/schemas/BadRequestResponse'
21435+
description: Bad Request - Invalid request parameters or malformed input
21436+
'401':
21437+
content:
21438+
application/json:
21439+
example:
21440+
error:
21441+
code: 401
21442+
message: Missing Authentication header
21443+
schema:
21444+
$ref: '#/components/schemas/UnauthorizedResponse'
21445+
description: Unauthorized - Authentication required or invalid credentials
21446+
'429':
21447+
content:
21448+
application/json:
21449+
example:
21450+
error:
21451+
code: 429
21452+
message: Rate limit exceeded
21453+
schema:
21454+
$ref: '#/components/schemas/TooManyRequestsResponse'
21455+
description: Too Many Requests - Rate limit exceeded
21456+
'500':
21457+
content:
21458+
application/json:
21459+
example:
21460+
error:
21461+
code: 500
21462+
message: Internal Server Error
21463+
schema:
21464+
$ref: '#/components/schemas/InternalServerResponse'
21465+
description: Internal Server Error - Unexpected server error
21466+
summary: Daily token totals for top 50 models
21467+
tags:
21468+
- Datasets
2125621469
/embeddings:
2125721470
post:
2125821471
description: Submits an embedding request to the embeddings router
@@ -27919,6 +28132,8 @@ tags:
2791928132
name: Chat
2792028133
- description: Credit management endpoints
2792128134
name: Credits
28135+
- description: Datasets endpoints
28136+
name: Datasets
2792228137
- description: Text embedding endpoints
2792328138
name: Embeddings
2792428139
- description: Endpoint information

0 commit comments

Comments
 (0)