Skip to content

Commit a209333

Browse files
openrouter-docs-sync[bot]OpenRouter SDK Bot
andauthored
chore: update OpenAPI spec from monorepo (#1279)
Co-authored-by: OpenRouter SDK Bot <sdk-bot@openrouter.ai>
1 parent 525ae0a commit a209333

1 file changed

Lines changed: 281 additions & 0 deletions

File tree

‎.speakeasy/in.openapi.yaml‎

Lines changed: 281 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10409,6 +10409,15 @@ components:
1040910409
required:
1041010410
- 'data'
1041110411
type: 'object'
10412+
CreateCreditPurchaseRequest:
10413+
properties:
10414+
credit_amount_usd:
10415+
description: 'Credits to buy, in USD with at most two decimals. The platform fee is added on top and shown in the challenge and the receipt.'
10416+
example: '25.00'
10417+
type: 'string'
10418+
required:
10419+
- 'credit_amount_usd'
10420+
type: 'object'
1041210421
CreatedEvent:
1041310422
description: 'Event emitted when a response is created'
1041410423
example:
@@ -11291,6 +11300,52 @@ components:
1129111300
required:
1129211301
- 'data'
1129311302
type: 'object'
11303+
CreditPurchase:
11304+
properties:
11305+
created_at:
11306+
type: 'string'
11307+
credit_amount_usd:
11308+
type: 'string'
11309+
failure_reason:
11310+
type:
11311+
- 'string'
11312+
- 'null'
11313+
id:
11314+
description: 'Purchase id, the Stripe PaymentIntent that owns the deposit address.'
11315+
type: 'string'
11316+
network:
11317+
type: 'string'
11318+
platform_fee_usd:
11319+
type: 'string'
11320+
protocol:
11321+
type: 'string'
11322+
status:
11323+
enum:
11324+
- 'awaiting_payment'
11325+
- 'processing'
11326+
- 'credited'
11327+
- 'failed'
11328+
type: 'string'
11329+
total_charged_usd:
11330+
type: 'string'
11331+
required:
11332+
- 'id'
11333+
- 'status'
11334+
- 'credit_amount_usd'
11335+
- 'platform_fee_usd'
11336+
- 'total_charged_usd'
11337+
- 'protocol'
11338+
- 'network'
11339+
- 'failure_reason'
11340+
- 'created_at'
11341+
type: 'object'
11342+
CreditPurchaseResponse:
11343+
properties:
11344+
data:
11345+
$ref: '#/components/schemas/CreditPurchase'
11346+
required:
11347+
- 'data'
11348+
type: 'object'
1129411349
CustomTool:
1129511350
description: 'Custom tool configuration'
1129611351
example:
@@ -42627,6 +42682,232 @@ paths:
4262742682
x-fern-ignore: true
4262842683
x-speakeasy-ignore: true
4262942684
x-speakeasy-name-override: 'createCoinbaseCharge'
42685+
/credits/purchases:
42686+
post:
42687+
description: 'Starts an agent credit purchase paid with a Machine Payments Protocol (MPP) credential on Tempo. The first call answers `402` with a `WWW-Authenticate: Payment ...` challenge; retry the same request, same `Idempotency-Key`, with the signed credential in `Payment-Authorization: Payment ...` (or in `Authorization: Payment ...` when the management key is sent as `X-Api-Key`). A paid request answers `202`: the transfer was broadcast and Stripe is still screening the payment, so credits arrive asynchronously. Poll the URL in the `Location` header, `GET /api/v1/credits/purchases/{id}`, until `status` is `credited` or `failed`.'
42688+
operationId: 'createCreditsPurchases'
42689+
parameters:
42690+
- description: 'Identifies the purchase. Send the same value on the unpaid request and on the paid retry; use a new value for a new purchase.'
42691+
in: 'header'
42692+
name: 'idempotency-key'
42693+
required: true
42694+
schema:
42695+
description: 'Identifies the purchase. Send the same value on the unpaid request and on the paid retry; use a new value for a new purchase.'
42696+
example: '6f1f7f0e-2b1a-4f57-9a43-3c1f6f3e8b0d'
42697+
maxLength: 255
42698+
minLength: 1
42699+
type: 'string'
42700+
requestBody:
42701+
content:
42702+
application/json:
42703+
schema:
42704+
$ref: '#/components/schemas/CreateCreditPurchaseRequest'
42705+
required: true
42706+
responses:
42707+
'202':
42708+
content:
42709+
application/json:
42710+
schema:
42711+
$ref: '#/components/schemas/CreditPurchaseResponse'
42712+
description: 'Payment accepted; credits are minted when the PaymentIntent succeeds.'
42713+
headers:
42714+
Location:
42715+
description: 'The purchase to poll: `GET /api/v1/credits/purchases/{id}`.'
42716+
required: true
42717+
schema:
42718+
description: 'The purchase to poll: `GET /api/v1/credits/purchases/{id}`.'
42719+
example: '/api/v1/credits/purchases/pi_3PqXyZ2eZvKYlo2C0abc1234'
42720+
type: 'string'
42721+
'400':
42722+
content:
42723+
application/json:
42724+
example:
42725+
error:
42726+
code: 400
42727+
message: 'Invalid request parameters'
42728+
schema:
42729+
$ref: '#/components/schemas/BadRequestResponse'
42730+
description: 'Bad Request - Invalid request parameters or malformed input'
42731+
'401':
42732+
content:
42733+
application/json:
42734+
example:
42735+
error:
42736+
code: 401
42737+
message: 'Missing Authentication header'
42738+
schema:
42739+
$ref: '#/components/schemas/UnauthorizedResponse'
42740+
description: 'Unauthorized - Authentication required or invalid credentials'
42741+
'402':
42742+
content:
42743+
application/json:
42744+
schema:
42745+
$ref: '#/components/schemas/CreditPurchaseResponse'
42746+
description: 'Payment required. An unpaid request carries the MPP challenge in `WWW-Authenticate`.'
42747+
'403':
42748+
content:
42749+
application/json:
42750+
example:
42751+
error:
42752+
code: 403
42753+
message: 'Only management keys can perform this operation'
42754+
schema:
42755+
$ref: '#/components/schemas/ForbiddenResponse'
42756+
description: 'Forbidden - Authentication successful but insufficient permissions'
42757+
'404':
42758+
content:
42759+
application/json:
42760+
example:
42761+
error:
42762+
code: 404
42763+
message: 'Resource not found'
42764+
schema:
42765+
$ref: '#/components/schemas/NotFoundResponse'
42766+
description: 'Not Found - Resource does not exist'
42767+
'409':
42768+
content:
42769+
application/json:
42770+
example:
42771+
error:
42772+
code: 409
42773+
message: 'Resource conflict. Please try again later.'
42774+
schema:
42775+
$ref: '#/components/schemas/ConflictResponse'
42776+
description: 'Conflict - Resource conflict or concurrent modification'
42777+
'429':
42778+
content:
42779+
application/json:
42780+
example:
42781+
error:
42782+
code: 429
42783+
message: 'Rate limit exceeded'
42784+
schema:
42785+
$ref: '#/components/schemas/TooManyRequestsResponse'
42786+
description: 'Too Many Requests - Rate limit exceeded'
42787+
'500':
42788+
content:
42789+
application/json:
42790+
example:
42791+
error:
42792+
code: 500
42793+
message: 'Internal Server Error'
42794+
schema:
42795+
$ref: '#/components/schemas/InternalServerResponse'
42796+
description: 'Internal Server Error - Unexpected server error'
42797+
'503':
42798+
content:
42799+
application/json:
42800+
example:
42801+
error:
42802+
code: 503
42803+
message: 'Service temporarily unavailable'
42804+
schema:
42805+
$ref: '#/components/schemas/ServiceUnavailableResponse'
42806+
description: 'Service Unavailable - Service temporarily unavailable'
42807+
security:
42808+
- bearerAuth: []
42809+
summary: 'Buy credits with a machine payment'
42810+
tags:
42811+
- 'Credits'
42812+
x-fern-ignore: true
42813+
x-hidden: true
42814+
x-speakeasy-ignore: true
42815+
/credits/purchases/{id}:
42816+
get:
42817+
description: 'Returns one agent credit purchase of the calling account, read from its Stripe PaymentIntent. Poll this after a `202` until `status` is `credited` or `failed`.'
42818+
operationId: 'listCreditsPurchases'
42819+
parameters:
42820+
- in: 'path'
42821+
name: 'id'
42822+
required: true
42823+
schema:
42824+
pattern: '^pi_[A-Za-z0-9]{1,64}$'
42825+
type: 'string'
42826+
responses:
42827+
'200':
42828+
content:
42829+
application/json:
42830+
schema:
42831+
$ref: '#/components/schemas/CreditPurchaseResponse'
42832+
description: 'The purchase.'
42833+
'400':
42834+
content:
42835+
application/json:
42836+
example:
42837+
error:
42838+
code: 400
42839+
message: 'Invalid request parameters'
42840+
schema:
42841+
$ref: '#/components/schemas/BadRequestResponse'
42842+
description: 'Bad Request - Invalid request parameters or malformed input'
42843+
'401':
42844+
content:
42845+
application/json:
42846+
example:
42847+
error:
42848+
code: 401
42849+
message: 'Missing Authentication header'
42850+
schema:
42851+
$ref: '#/components/schemas/UnauthorizedResponse'
42852+
description: 'Unauthorized - Authentication required or invalid credentials'
42853+
'403':
42854+
content:
42855+
application/json:
42856+
example:
42857+
error:
42858+
code: 403
42859+
message: 'Only management keys can perform this operation'
42860+
schema:
42861+
$ref: '#/components/schemas/ForbiddenResponse'
42862+
description: 'Forbidden - Authentication successful but insufficient permissions'
42863+
'404':
42864+
content:
42865+
application/json:
42866+
example:
42867+
error:
42868+
code: 404
42869+
message: 'Resource not found'
42870+
schema:
42871+
$ref: '#/components/schemas/NotFoundResponse'
42872+
description: 'Not Found - Resource does not exist'
42873+
'429':
42874+
content:
42875+
application/json:
42876+
example:
42877+
error:
42878+
code: 429
42879+
message: 'Rate limit exceeded'
42880+
schema:
42881+
$ref: '#/components/schemas/TooManyRequestsResponse'
42882+
description: 'Too Many Requests - Rate limit exceeded'
42883+
'500':
42884+
content:
42885+
application/json:
42886+
example:
42887+
error:
42888+
code: 500
42889+
message: 'Internal Server Error'
42890+
schema:
42891+
$ref: '#/components/schemas/InternalServerResponse'
42892+
description: 'Internal Server Error - Unexpected server error'
42893+
'503':
42894+
content:
42895+
application/json:
42896+
example:
42897+
error:
42898+
code: 503
42899+
message: 'Service temporarily unavailable'
42900+
schema:
42901+
$ref: '#/components/schemas/ServiceUnavailableResponse'
42902+
description: 'Service Unavailable - Service temporarily unavailable'
42903+
security:
42904+
- bearerAuth: []
42905+
summary: 'Get a credit purchase'
42906+
tags:
42907+
- 'Credits'
42908+
x-fern-ignore: true
42909+
x-hidden: true
42910+
x-speakeasy-ignore: true
4263042911
/datasets/app-rankings:
4263142912
get:
4263242913
description: "Returns the top public apps on OpenRouter ranked by token usage inside the requested\ndate window, matching the public apps marketplace on openrouter.ai/apps. Token totals\nare `prompt_tokens + completion_tokens`; hidden and private apps are excluded and\ntraffic from related app aliases is merged into the canonical visible app.\n\n`sort=popular` (default) ranks by total token volume inside the window.\n`sort=trending` ranks by absolute excess token growth: window volume minus the average\nvolume of the three equal-length periods immediately preceding the window. Apps with\nno excess growth are omitted, so `trending` may return fewer than `limit` rows.\n\nFilter with `category` (marketplace category group, e.g. `coding`) or `subcategory`\n(e.g. `cli-agent`). Ranks are re-numbered 1..N after filtering. Page with `offset` —\n`rank` stays absolute, so the first row of `offset=50` is `rank: 51`.\n\nAuthenticate with any valid OpenRouter API key (same key used for inference).\nRate-limited to 30 requests/minute per key and 500 requests/day per account.\n\nWhen republishing or quoting this dataset, OpenRouter must be cited as:\n\"Source: OpenRouter (openrouter.ai/apps), as of {as_of}.\"\n\nToken counts come from each upstream provider's own tokenizer, so a token attributed\nto one app is not directly comparable to a token attributed to another app whose\ntraffic flows through a different provider.\n\nLicensed under [CC BY 4.0](https://creativecommons.org/licenses/by/4.0/): reuse and republish with attribution to OpenRouter."

0 commit comments

Comments
 (0)