Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
60 changes: 46 additions & 14 deletions public/docs/api/index.html

Large diffs are not rendered by default.

238 changes: 233 additions & 5 deletions public/openapi.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"info": {
"title": "TokenWatch Pricing API",
"version": "v1",
"description": "Read-only, public JSON API for TokenWatch text, image, video, provider, organization, pricing catalog data, and workload-aware recommendations. Prices are USD per million tokens unless a response says otherwise, and every unknown value is null rather than zero."
"description": "Read-only, public JSON API for TokenWatch text, image, video, provider, organization, pricing catalog data, and workload-aware recommendations. Prices are USD per million tokens unless a response says otherwise, and every unknown value is null rather than zero. Responses are compact JSON (`pretty=1` to indent) and carry a strong `ETag`: send `If-None-Match` to get a bodyless 304. Successful GETs are cacheable for 300 seconds with a 600-second stale-while-revalidate window; errors are `no-store`. `HEAD` returns the same status and headers as `GET` without a body."
},
"servers": [
{
Expand All @@ -15,7 +15,24 @@
"get": {
"summary": "API metadata and endpoint directory",
"operationId": "getApiV1",
"parameters": [],
"parameters": [
{
"name": "pretty",
"in": "query",
"required": false,
"description": "When `1` or `true`, indent the JSON. Every data route returns compact JSON by default and honours this flag; indenting inflates the payload, so it is meant for reading, not for clients.",
"schema": {
"type": "string",
"enum": [
"1",
"0",
"true",
"false"
],
"default": "0"
}
}
],
"responses": {
"200": {
"description": "Catalog counts and the rendered endpoint directory.",
Expand Down Expand Up @@ -65,7 +82,24 @@
"summary": "List workload recommendation presets and their assumed mixes, weights, requirements, and quality floors",
"description": "Returns the nine use-case presets used by /choose/ and the recommend endpoints. Every mix is flagged assumed: true; weights and floors are documented judgments, not measurements.",
"operationId": "getApiV1UseCases",
"parameters": [],
"parameters": [
{
"name": "pretty",
"in": "query",
"required": false,
"description": "When `1` or `true`, indent the JSON. Every data route returns compact JSON by default and honours this flag; indenting inflates the payload, so it is meant for reading, not for clients.",
"schema": {
"type": "string",
"enum": [
"1",
"0",
"true",
"false"
],
"default": "0"
}
}
],
"responses": {
"200": {
"description": "The nine workload presets with their assumed mixes, benchmark and provider weights, hard requirements, quantization policy and quality floors.",
Expand Down Expand Up @@ -629,6 +663,22 @@
"minimum": 0,
"default": 0
}
},
{
"name": "pretty",
"in": "query",
"required": false,
"description": "When `1` or `true`, indent the JSON. Every data route returns compact JSON by default and honours this flag; indenting inflates the payload, so it is meant for reading, not for clients.",
"schema": {
"type": "string",
"enum": [
"1",
"0",
"true",
"false"
],
"default": "0"
}
}
],
"responses": {
Expand Down Expand Up @@ -707,6 +757,22 @@
"schema": {
"type": "string"
}
},
{
"name": "pretty",
"in": "query",
"required": false,
"description": "When `1` or `true`, indent the JSON. Every data route returns compact JSON by default and honours this flag; indenting inflates the payload, so it is meant for reading, not for clients.",
"schema": {
"type": "string",
"enum": [
"1",
"0",
"true",
"false"
],
"default": "0"
}
}
],
"responses": {
Expand Down Expand Up @@ -788,6 +854,22 @@
"type": "string",
"pattern": "^\\d+(\\.\\d+)?(,\\d+(\\.\\d+)?){2}$"
}
},
{
"name": "pretty",
"in": "query",
"required": false,
"description": "When `1` or `true`, indent the JSON. Every data route returns compact JSON by default and honours this flag; indenting inflates the payload, so it is meant for reading, not for clients.",
"schema": {
"type": "string",
"enum": [
"1",
"0",
"true",
"false"
],
"default": "0"
}
}
],
"responses": {
Expand Down Expand Up @@ -888,6 +970,22 @@
"frontend-ui"
]
}
},
{
"name": "pretty",
"in": "query",
"required": false,
"description": "When `1` or `true`, indent the JSON. Every data route returns compact JSON by default and honours this flag; indenting inflates the payload, so it is meant for reading, not for clients.",
"schema": {
"type": "string",
"enum": [
"1",
"0",
"true",
"false"
],
"default": "0"
}
}
],
"responses": {
Expand Down Expand Up @@ -988,6 +1086,22 @@
"frontend-ui"
]
}
},
{
"name": "pretty",
"in": "query",
"required": false,
"description": "When `1` or `true`, indent the JSON. Every data route returns compact JSON by default and honours this flag; indenting inflates the payload, so it is meant for reading, not for clients.",
"schema": {
"type": "string",
"enum": [
"1",
"0",
"true",
"false"
],
"default": "0"
}
}
],
"responses": {
Expand Down Expand Up @@ -1038,7 +1152,24 @@
"get": {
"summary": "Return catalog, provider, organization, privacy, cache, and quantization counts",
"operationId": "getApiV1Stats",
"parameters": [],
"parameters": [
{
"name": "pretty",
"in": "query",
"required": false,
"description": "When `1` or `true`, indent the JSON. Every data route returns compact JSON by default and honours this flag; indenting inflates the payload, so it is meant for reading, not for clients.",
"schema": {
"type": "string",
"enum": [
"1",
"0",
"true",
"false"
],
"default": "0"
}
}
],
"responses": {
"200": {
"description": "Catalog, provider, organization, privacy, cache and quantization counts. Each bucket map sums to `model_count`.",
Expand Down Expand Up @@ -1087,7 +1218,24 @@
"get": {
"summary": "List model organizations with offering counts",
"operationId": "getApiV1Orgs",
"parameters": [],
"parameters": [
{
"name": "pretty",
"in": "query",
"required": false,
"description": "When `1` or `true`, indent the JSON. Every data route returns compact JSON by default and honours this flag; indenting inflates the payload, so it is meant for reading, not for clients.",
"schema": {
"type": "string",
"enum": [
"1",
"0",
"true",
"false"
],
"default": "0"
}
}
],
"responses": {
"200": {
"description": "Organizations with offering counts, sorted by count descending.",
Expand Down Expand Up @@ -1145,6 +1293,22 @@
"schema": {
"type": "boolean"
}
},
{
"name": "pretty",
"in": "query",
"required": false,
"description": "When `1` or `true`, indent the JSON. Every data route returns compact JSON by default and honours this flag; indenting inflates the payload, so it is meant for reading, not for clients.",
"schema": {
"type": "string",
"enum": [
"1",
"0",
"true",
"false"
],
"default": "0"
}
}
],
"responses": {
Expand Down Expand Up @@ -1274,6 +1438,22 @@
"minimum": 0,
"default": 0
}
},
{
"name": "pretty",
"in": "query",
"required": false,
"description": "When `1` or `true`, indent the JSON. Every data route returns compact JSON by default and honours this flag; indenting inflates the payload, so it is meant for reading, not for clients.",
"schema": {
"type": "string",
"enum": [
"1",
"0",
"true",
"false"
],
"default": "0"
}
}
],
"responses": {
Expand Down Expand Up @@ -1333,6 +1513,22 @@
"schema": {
"type": "string"
}
},
{
"name": "pretty",
"in": "query",
"required": false,
"description": "When `1` or `true`, indent the JSON. Every data route returns compact JSON by default and honours this flag; indenting inflates the payload, so it is meant for reading, not for clients.",
"schema": {
"type": "string",
"enum": [
"1",
"0",
"true",
"false"
],
"default": "0"
}
}
],
"responses": {
Expand Down Expand Up @@ -1462,6 +1658,22 @@
"minimum": 0,
"default": 0
}
},
{
"name": "pretty",
"in": "query",
"required": false,
"description": "When `1` or `true`, indent the JSON. Every data route returns compact JSON by default and honours this flag; indenting inflates the payload, so it is meant for reading, not for clients.",
"schema": {
"type": "string",
"enum": [
"1",
"0",
"true",
"false"
],
"default": "0"
}
}
],
"responses": {
Expand Down Expand Up @@ -1521,6 +1733,22 @@
"schema": {
"type": "string"
}
},
{
"name": "pretty",
"in": "query",
"required": false,
"description": "When `1` or `true`, indent the JSON. Every data route returns compact JSON by default and honours this flag; indenting inflates the payload, so it is meant for reading, not for clients.",
"schema": {
"type": "string",
"enum": [
"1",
"0",
"true",
"false"
],
"default": "0"
}
}
],
"responses": {
Expand Down
2 changes: 1 addition & 1 deletion scripts/seo-pages.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -1419,7 +1419,7 @@ export function buildOpenApiDocument() {
info: {
title: 'TokenWatch Pricing API',
version: 'v1',
description: 'Read-only, public JSON API for TokenWatch text, image, video, provider, organization, pricing catalog data, and workload-aware recommendations. Prices are USD per million tokens unless a response says otherwise, and every unknown value is null rather than zero.',
description: 'Read-only, public JSON API for TokenWatch text, image, video, provider, organization, pricing catalog data, and workload-aware recommendations. Prices are USD per million tokens unless a response says otherwise, and every unknown value is null rather than zero. Responses are compact JSON (`pretty=1` to indent) and carry a strong `ETag`: send `If-None-Match` to get a bodyless 304. Successful GETs are cacheable for 300 seconds with a 600-second stale-while-revalidate window; errors are `no-store`. `HEAD` returns the same status and headers as `GET` without a body.',
},
servers: [{ url: SITE }],
paths,
Expand Down
Loading
Loading