qwksearch-api-client 1.0.233 → 1.0.234
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/qwksearch-openapi.json +220 -1
package/package.json
CHANGED
package/qwksearch-openapi.json
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"info": {
|
|
4
4
|
"title": "QwkSearch Research Agent API",
|
|
5
5
|
"version": "1.1.0",
|
|
6
|
-
"description": "API for QwkSearch — AI-powered research with search, extraction, chat, document management, and multi-provider LLM support.\n\n## Authentication\n\n- **Public endpoints** work without credentials. When a deployment sets `REQUIRE_API_KEY`, they need an API key, sent as `Authorization: Bearer <key>` or `X-API-Key: <key>`.\n- **Research-agent endpoints** (`/agent/*` chats, messages, history) accept either a signed-in session or the user's API key, so embedding sites can act for a linked user.\n- **Account endpoints** (`/user/*`, `/notebooklm/*`, `/admin/*`) need a signed-in session cookie.\n\nSign-in itself is served by Better Auth under `/auth/*`; partner sites link an account with the \"Sign in with QwkSearch\" flow under `/connect
|
|
6
|
+
"description": "API for QwkSearch — AI-powered research with search, extraction, chat, document management, and multi-provider LLM support.\n\n## Authentication\n\n- **Public endpoints** work without credentials. When a deployment sets `REQUIRE_API_KEY`, they need an API key, sent as `Authorization: Bearer <key>` or `X-API-Key: <key>`.\n- **Research-agent endpoints** (`/agent/*` chats, messages, history) accept either a signed-in session or the user's API key, so embedding sites can act for a linked user.\n- **Account endpoints** (`/user/*`, `/notebooklm/*`, `/admin/*`) need a signed-in session cookie.\n\nSign-in itself is served by Better Auth under `/auth/*`; partner sites link an account with the \"Sign in with QwkSearch\" flow under `/connect/*`.\n\n## Rate limits\n\nEvery `/api` route is rate-limited per client IP (by default 300 requests a minute, with tighter limits on chat, speech and the scraper; admins change them at `/admin/rate-limit`). Responses carry `RateLimit-Limit`, `RateLimit-Remaining` and `RateLimit-Reset`; over the limit is a `429` with `Retry-After`."
|
|
7
7
|
},
|
|
8
8
|
"servers": [
|
|
9
9
|
{
|
|
@@ -7418,6 +7418,122 @@
|
|
|
7418
7418
|
}
|
|
7419
7419
|
}
|
|
7420
7420
|
},
|
|
7421
|
+
"/admin/rate-limit": {
|
|
7422
|
+
"get": {
|
|
7423
|
+
"tags": [
|
|
7424
|
+
"Admin"
|
|
7425
|
+
],
|
|
7426
|
+
"summary": "Get API rate-limit settings and current activity",
|
|
7427
|
+
"operationId": "getAdminRateLimit",
|
|
7428
|
+
"security": [
|
|
7429
|
+
{
|
|
7430
|
+
"sessionCookie": []
|
|
7431
|
+
}
|
|
7432
|
+
],
|
|
7433
|
+
"responses": {
|
|
7434
|
+
"200": {
|
|
7435
|
+
"description": "Settings, the busiest open client windows, and how long servers cache the settings",
|
|
7436
|
+
"content": {
|
|
7437
|
+
"application/json": {
|
|
7438
|
+
"schema": {
|
|
7439
|
+
"type": "object",
|
|
7440
|
+
"properties": {
|
|
7441
|
+
"settings": {
|
|
7442
|
+
"$ref": "#/components/schemas/ApiRateLimitSettings"
|
|
7443
|
+
},
|
|
7444
|
+
"activity": {
|
|
7445
|
+
"type": "object",
|
|
7446
|
+
"additionalProperties": true
|
|
7447
|
+
},
|
|
7448
|
+
"settingsCacheSeconds": {
|
|
7449
|
+
"type": "integer"
|
|
7450
|
+
},
|
|
7451
|
+
"now": {
|
|
7452
|
+
"type": "integer"
|
|
7453
|
+
}
|
|
7454
|
+
}
|
|
7455
|
+
}
|
|
7456
|
+
}
|
|
7457
|
+
}
|
|
7458
|
+
},
|
|
7459
|
+
"401": {
|
|
7460
|
+
"$ref": "#/components/responses/Unauthorized"
|
|
7461
|
+
},
|
|
7462
|
+
"403": {
|
|
7463
|
+
"$ref": "#/components/responses/Forbidden"
|
|
7464
|
+
}
|
|
7465
|
+
}
|
|
7466
|
+
},
|
|
7467
|
+
"post": {
|
|
7468
|
+
"tags": [
|
|
7469
|
+
"Admin"
|
|
7470
|
+
],
|
|
7471
|
+
"summary": "Save API rate-limit settings, or reset counters",
|
|
7472
|
+
"description": "`{ action: \"reset\" }` clears every counter; add `bucket` to clear one client's. Otherwise the named settings fields are saved (partial update) to D1 and reach every server within `settingsCacheSeconds`.",
|
|
7473
|
+
"operationId": "updateAdminRateLimit",
|
|
7474
|
+
"security": [
|
|
7475
|
+
{
|
|
7476
|
+
"sessionCookie": []
|
|
7477
|
+
}
|
|
7478
|
+
],
|
|
7479
|
+
"requestBody": {
|
|
7480
|
+
"required": true,
|
|
7481
|
+
"content": {
|
|
7482
|
+
"application/json": {
|
|
7483
|
+
"schema": {
|
|
7484
|
+
"oneOf": [
|
|
7485
|
+
{
|
|
7486
|
+
"type": "object",
|
|
7487
|
+
"properties": {
|
|
7488
|
+
"action": {
|
|
7489
|
+
"type": "string",
|
|
7490
|
+
"enum": [
|
|
7491
|
+
"reset"
|
|
7492
|
+
]
|
|
7493
|
+
},
|
|
7494
|
+
"bucket": {
|
|
7495
|
+
"type": "string"
|
|
7496
|
+
}
|
|
7497
|
+
},
|
|
7498
|
+
"required": [
|
|
7499
|
+
"action"
|
|
7500
|
+
]
|
|
7501
|
+
},
|
|
7502
|
+
{
|
|
7503
|
+
"$ref": "#/components/schemas/ApiRateLimitSettings"
|
|
7504
|
+
}
|
|
7505
|
+
]
|
|
7506
|
+
}
|
|
7507
|
+
}
|
|
7508
|
+
}
|
|
7509
|
+
},
|
|
7510
|
+
"responses": {
|
|
7511
|
+
"200": {
|
|
7512
|
+
"description": "Saved settings, or the reset count and fresh activity",
|
|
7513
|
+
"content": {
|
|
7514
|
+
"application/json": {
|
|
7515
|
+
"schema": {
|
|
7516
|
+
"type": "object",
|
|
7517
|
+
"additionalProperties": true
|
|
7518
|
+
}
|
|
7519
|
+
}
|
|
7520
|
+
}
|
|
7521
|
+
},
|
|
7522
|
+
"400": {
|
|
7523
|
+
"$ref": "#/components/responses/BadRequest"
|
|
7524
|
+
},
|
|
7525
|
+
"401": {
|
|
7526
|
+
"$ref": "#/components/responses/Unauthorized"
|
|
7527
|
+
},
|
|
7528
|
+
"403": {
|
|
7529
|
+
"$ref": "#/components/responses/Forbidden"
|
|
7530
|
+
},
|
|
7531
|
+
"500": {
|
|
7532
|
+
"$ref": "#/components/responses/ServerError"
|
|
7533
|
+
}
|
|
7534
|
+
}
|
|
7535
|
+
}
|
|
7536
|
+
},
|
|
7421
7537
|
"/admin/overview": {
|
|
7422
7538
|
"get": {
|
|
7423
7539
|
"tags": [
|
|
@@ -7827,6 +7943,58 @@
|
|
|
7827
7943
|
}
|
|
7828
7944
|
}
|
|
7829
7945
|
}
|
|
7946
|
+
},
|
|
7947
|
+
"TooManyRequests": {
|
|
7948
|
+
"description": "Rate limited. Every `/api` route is limited per client IP; wait `Retry-After` seconds.",
|
|
7949
|
+
"headers": {
|
|
7950
|
+
"Retry-After": {
|
|
7951
|
+
"schema": {
|
|
7952
|
+
"type": "integer"
|
|
7953
|
+
}
|
|
7954
|
+
},
|
|
7955
|
+
"RateLimit-Limit": {
|
|
7956
|
+
"schema": {
|
|
7957
|
+
"type": "integer"
|
|
7958
|
+
}
|
|
7959
|
+
},
|
|
7960
|
+
"RateLimit-Remaining": {
|
|
7961
|
+
"schema": {
|
|
7962
|
+
"type": "integer"
|
|
7963
|
+
}
|
|
7964
|
+
},
|
|
7965
|
+
"RateLimit-Reset": {
|
|
7966
|
+
"schema": {
|
|
7967
|
+
"type": "integer"
|
|
7968
|
+
}
|
|
7969
|
+
}
|
|
7970
|
+
},
|
|
7971
|
+
"content": {
|
|
7972
|
+
"application/json": {
|
|
7973
|
+
"schema": {
|
|
7974
|
+
"type": "object",
|
|
7975
|
+
"properties": {
|
|
7976
|
+
"error": {
|
|
7977
|
+
"type": "string",
|
|
7978
|
+
"enum": [
|
|
7979
|
+
"rate_limited"
|
|
7980
|
+
]
|
|
7981
|
+
},
|
|
7982
|
+
"message": {
|
|
7983
|
+
"type": "string"
|
|
7984
|
+
},
|
|
7985
|
+
"retryAfter": {
|
|
7986
|
+
"type": "integer"
|
|
7987
|
+
},
|
|
7988
|
+
"limit": {
|
|
7989
|
+
"type": "integer"
|
|
7990
|
+
},
|
|
7991
|
+
"windowSeconds": {
|
|
7992
|
+
"type": "integer"
|
|
7993
|
+
}
|
|
7994
|
+
}
|
|
7995
|
+
}
|
|
7996
|
+
}
|
|
7997
|
+
}
|
|
7830
7998
|
}
|
|
7831
7999
|
},
|
|
7832
8000
|
"schemas": {
|
|
@@ -8817,6 +8985,57 @@
|
|
|
8817
8985
|
"error"
|
|
8818
8986
|
],
|
|
8819
8987
|
"description": "OpenAI-shaped error body, used by the `/v1/*` routes."
|
|
8988
|
+
},
|
|
8989
|
+
"ApiRateLimitOverride": {
|
|
8990
|
+
"type": "object",
|
|
8991
|
+
"properties": {
|
|
8992
|
+
"pattern": {
|
|
8993
|
+
"type": "string",
|
|
8994
|
+
"description": "Path pattern. `*` matches anything; a trailing `/*` also matches the bare path."
|
|
8995
|
+
},
|
|
8996
|
+
"limit": {
|
|
8997
|
+
"type": "integer",
|
|
8998
|
+
"minimum": 1
|
|
8999
|
+
},
|
|
9000
|
+
"windowSeconds": {
|
|
9001
|
+
"type": "integer",
|
|
9002
|
+
"minimum": 1,
|
|
9003
|
+
"maximum": 86400
|
|
9004
|
+
}
|
|
9005
|
+
},
|
|
9006
|
+
"required": [
|
|
9007
|
+
"pattern",
|
|
9008
|
+
"limit",
|
|
9009
|
+
"windowSeconds"
|
|
9010
|
+
]
|
|
9011
|
+
},
|
|
9012
|
+
"ApiRateLimitSettings": {
|
|
9013
|
+
"type": "object",
|
|
9014
|
+
"properties": {
|
|
9015
|
+
"enabled": {
|
|
9016
|
+
"type": "boolean"
|
|
9017
|
+
},
|
|
9018
|
+
"requestsPerWindow": {
|
|
9019
|
+
"type": "integer",
|
|
9020
|
+
"minimum": 1
|
|
9021
|
+
},
|
|
9022
|
+
"windowSeconds": {
|
|
9023
|
+
"type": "integer",
|
|
9024
|
+
"minimum": 1,
|
|
9025
|
+
"maximum": 86400
|
|
9026
|
+
},
|
|
9027
|
+
"overrides": {
|
|
9028
|
+
"type": "array",
|
|
9029
|
+
"items": {
|
|
9030
|
+
"$ref": "#/components/schemas/ApiRateLimitOverride"
|
|
9031
|
+
},
|
|
9032
|
+
"description": "First match wins; each override counts in its own bucket."
|
|
9033
|
+
},
|
|
9034
|
+
"exemptPaths": {
|
|
9035
|
+
"type": "string",
|
|
9036
|
+
"description": "One path pattern per line; matching requests are never counted."
|
|
9037
|
+
}
|
|
9038
|
+
}
|
|
8820
9039
|
}
|
|
8821
9040
|
}
|
|
8822
9041
|
}
|