@tokenlabai/mcp-server 0.6.24 → 0.6.25

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.
@@ -89,7 +89,7 @@
89
89
  "Chat"
90
90
  ],
91
91
  "summary": "Create chat completion",
92
- "description": "Creates a model response from a Chat Completions request. Chat-native upstreams receive the request shape unchanged apart from routing and authentication fields; unknown fields are forwarded on a best-effort basis. Portable Chat requests may be compiled one-way to another protocol when a compatible physical endpoint is selected.",
92
+ "description": "Creates a model response from a Chat Completions request. Supported request formats are listed in each model’s details. Unknown fields are accepted on a best-effort basis; model-specific support is not guaranteed.",
93
93
  "operationId": "createChatCompletion",
94
94
  "requestBody": {
95
95
  "required": true,
@@ -528,6 +528,9 @@
528
528
  "additionalProperties": true
529
529
  }
530
530
  ]
531
+ },
532
+ "error_details": {
533
+ "$ref": "#/components/schemas/AsyncTaskErrorDetails"
531
534
  }
532
535
  }
533
536
  }
@@ -1448,7 +1451,7 @@
1448
1451
  }
1449
1452
  },
1450
1453
  "400": {
1451
- "description": "Task type, provider, or model does not support cancellation",
1454
+ "description": "This task does not support cancellation",
1452
1455
  "content": {
1453
1456
  "application/json": {
1454
1457
  "schema": {
@@ -2000,7 +2003,7 @@
2000
2003
  "Anthropic"
2001
2004
  ],
2002
2005
  "summary": "Delete message batch (Anthropic-compatible)",
2003
- "description": "Deletes a native Anthropic Message Batch when the provider supports deletion.",
2006
+ "description": "Deletes an Anthropic Message Batch when deletion is supported for that batch.",
2004
2007
  "operationId": "deleteAnthropicMessageBatch",
2005
2008
  "parameters": [
2006
2009
  {
@@ -2109,7 +2112,7 @@
2109
2112
  "Anthropic"
2110
2113
  ],
2111
2114
  "summary": "Cancel message batch (Anthropic-compatible)",
2112
- "description": "Cancels a native Anthropic Message Batch when the provider still allows cancellation.",
2115
+ "description": "Cancels an Anthropic Message Batch when cancellation is still available for that batch.",
2113
2116
  "operationId": "cancelAnthropicMessageBatch",
2114
2117
  "parameters": [
2115
2118
  {
@@ -2160,7 +2163,7 @@
2160
2163
  "Gemini"
2161
2164
  ],
2162
2165
  "summary": "Generate content (Gemini-compatible)",
2163
- "description": "Generates content using the native Gemini GenerateContent shape. This route is exposed only when the model details advertise Gemini requests and a same-protocol route is currently available. ProtoJSON lowerCamelCase and original proto snake_case field names are preserved. Unknown fields are forwarded best-effort and support is determined by the selected provider.\n\n**Authentication:** Use `?key=` query parameter, `x-goog-api-key` header, or `Authorization: Bearer` header.",
2166
+ "description": "Generates content using the Gemini GenerateContent request shape. The model details must advertise Gemini requests and the model must be available. ProtoJSON lowerCamelCase and original proto snake_case field names are preserved. Unknown fields are accepted on a best-effort basis; model-specific support is not guaranteed.\n\n**Authentication:** Use `?key=` query parameter, `x-goog-api-key` header, or `Authorization: Bearer` header.",
2164
2167
  "operationId": "geminiGenerateContent",
2165
2168
  "parameters": [
2166
2169
  {
@@ -2642,7 +2645,7 @@
2642
2645
  "Responses"
2643
2646
  ],
2644
2647
  "summary": "Create response (OpenAI Responses API)",
2645
- "description": "Creates a response using the native OpenAI Responses API shape. The model details must advertise the Responses request format and a same-protocol route must be currently available; model names and providers do not imply availability. Unknown request fields are forwarded on a best-effort basis and remain subject to the selected provider's support.",
2648
+ "description": "Creates a response using the OpenAI Responses API request shape. The model details must advertise the Responses request format and the model must be available. Unknown fields are accepted on a best-effort basis; model-specific support is not guaranteed.",
2646
2649
  "operationId": "createResponse",
2647
2650
  "requestBody": {
2648
2651
  "required": true,
@@ -2710,7 +2713,7 @@
2710
2713
  "properties": {
2711
2714
  "include_obfuscation": {
2712
2715
  "type": "boolean",
2713
- "description": "When true, request obfuscated tokens in Responses stream events from compatible upstreams."
2716
+ "description": "When true, request obfuscated tokens in Responses stream events where supported."
2714
2717
  }
2715
2718
  },
2716
2719
  "additionalProperties": true,
@@ -2728,7 +2731,7 @@
2728
2731
  "string",
2729
2732
  "null"
2730
2733
  ],
2731
- "description": "Service tier hint for compatible providers."
2734
+ "description": "Service tier hint where supported by the model."
2732
2735
  },
2733
2736
  "truncation": {
2734
2737
  "type": "string",
@@ -3271,7 +3274,7 @@
3271
3274
  },
3272
3275
  "seed": {
3273
3276
  "type": "integer",
3274
- "description": "Seed for deterministic-compatible providers."
3277
+ "description": "Seed for repeatable generation where supported by the model."
3275
3278
  },
3276
3279
  "user": {
3277
3280
  "type": "string",
@@ -3666,7 +3669,7 @@
3666
3669
  "Management"
3667
3670
  ],
3668
3671
  "summary": "Get API key usage",
3669
- "description": "Returns paginated key-level usage details without exposing provider-specific execution details.",
3672
+ "description": "Returns paginated usage details for this API key.",
3670
3673
  "operationId": "getManagementApiKeyUsage",
3671
3674
  "security": [
3672
3675
  {
@@ -3796,7 +3799,7 @@
3796
3799
  "Management"
3797
3800
  ],
3798
3801
  "summary": "Get API key billing",
3799
- "description": "Returns aggregated key-level billing breakdowns without exposing provider-specific execution details.",
3802
+ "description": "Returns aggregated billing breakdowns for this API key.",
3800
3803
  "operationId": "getManagementApiKeyBilling",
3801
3804
  "security": [
3802
3805
  {
@@ -5665,6 +5668,12 @@
5665
5668
  "cost": {
5666
5669
  "type": "object",
5667
5670
  "additionalProperties": true
5671
+ },
5672
+ "error": {
5673
+ "$ref": "#/components/schemas/AsyncTaskError"
5674
+ },
5675
+ "error_details": {
5676
+ "$ref": "#/components/schemas/AsyncTaskErrorDetails"
5668
5677
  }
5669
5678
  },
5670
5679
  "additionalProperties": true
@@ -5762,7 +5771,10 @@
5762
5771
  "additionalProperties": true
5763
5772
  },
5764
5773
  "error": {
5765
- "type": "string"
5774
+ "$ref": "#/components/schemas/AsyncTaskError"
5775
+ },
5776
+ "error_details": {
5777
+ "$ref": "#/components/schemas/AsyncTaskErrorDetails"
5766
5778
  }
5767
5779
  },
5768
5780
  "additionalProperties": true
@@ -8511,14 +8523,14 @@
8511
8523
  "prediction": {
8512
8524
  "type": "object",
8513
8525
  "additionalProperties": true,
8514
- "description": "Prediction hints for providers that support draft or speculative decoding."
8526
+ "description": "Prediction hints for models that support draft or speculative decoding."
8515
8527
  },
8516
8528
  "service_tier": {
8517
8529
  "type": [
8518
8530
  "string",
8519
8531
  "null"
8520
8532
  ],
8521
- "description": "Service tier hint for compatible providers."
8533
+ "description": "Service tier hint where supported by the model."
8522
8534
  }
8523
8535
  },
8524
8536
  "additionalProperties": true
@@ -9098,7 +9110,7 @@
9098
9110
  },
9099
9111
  "quality": {
9100
9112
  "type": "string",
9101
- "description": "Image quality. Defaults and accepted values are model-specific. For gpt-image-2, omit this field or use auto for automatic quality, or send low, medium, or high. Other image families may use provider-specific values."
9113
+ "description": "Image quality. Defaults and accepted values are model-specific. For gpt-image-2, omit this field or use auto for automatic quality, or send low, medium, or high. Other models may accept different values; check the model details."
9102
9114
  },
9103
9115
  "style": {
9104
9116
  "type": "string",
@@ -9112,6 +9124,10 @@
9112
9124
  "type": "boolean",
9113
9125
  "description": "Ask compatible models to expand or enhance the prompt."
9114
9126
  },
9127
+ "prompt_extend": {
9128
+ "type": "boolean",
9129
+ "description": "For z-image-turbo, enable prompt expansion. Defaults to false. Enabling it uses the model's prompt-expansion price."
9130
+ },
9115
9131
  "negative_prompt": {
9116
9132
  "type": "string",
9117
9133
  "description": "Content to avoid for compatible image models."
@@ -9242,6 +9258,10 @@
9242
9258
  "expand_prompt": {
9243
9259
  "type": "boolean"
9244
9260
  },
9261
+ "prompt_extend": {
9262
+ "type": "boolean",
9263
+ "description": "For z-image-turbo, enable prompt expansion. Defaults to false. Enabling it uses the model's prompt-expansion price."
9264
+ },
9245
9265
  "negative_prompt": {
9246
9266
  "type": "string"
9247
9267
  },
@@ -9338,6 +9358,24 @@
9338
9358
  }
9339
9359
  }
9340
9360
  }
9361
+ },
9362
+ "task_id": {
9363
+ "type": "string",
9364
+ "description": "Task ID when the request runs as a task."
9365
+ },
9366
+ "status": {
9367
+ "type": "string",
9368
+ "description": "Task status when the request runs as a task."
9369
+ },
9370
+ "poll_url": {
9371
+ "type": "string",
9372
+ "description": "URL to poll for the task result."
9373
+ },
9374
+ "error": {
9375
+ "$ref": "#/components/schemas/AsyncTaskError"
9376
+ },
9377
+ "error_details": {
9378
+ "$ref": "#/components/schemas/AsyncTaskErrorDetails"
9341
9379
  }
9342
9380
  },
9343
9381
  "required": [
@@ -9380,11 +9418,11 @@
9380
9418
  "additionalProperties": false
9381
9419
  }
9382
9420
  ],
9383
- "description": "Voice selector for OpenAI-compatible, Gemini, xAI, and MiniMax-compatible routes. Some MiniMax routes also accept voice_id."
9421
+ "description": "Voice selector for OpenAI-compatible, Gemini, xAI, and MiniMax-compatible speech models. Some MiniMax models also accept voice_id."
9384
9422
  },
9385
9423
  "voice_id": {
9386
9424
  "type": "string",
9387
- "description": "Provider-native voice selector for MiniMax-compatible speech models."
9425
+ "description": "Voice selector for MiniMax-compatible speech models."
9388
9426
  },
9389
9427
  "instructions": {
9390
9428
  "type": "string",
@@ -9398,7 +9436,7 @@
9398
9436
  },
9399
9437
  "language_code": {
9400
9438
  "type": "string",
9401
- "description": "Optional language code for Gemini, xAI, and compatible TTS routes.",
9439
+ "description": "Optional language code for Gemini, xAI, and compatible TTS models.",
9402
9440
  "example": "en-US"
9403
9441
  },
9404
9442
  "response_format": {
@@ -9425,7 +9463,7 @@
9425
9463
  "type": "number",
9426
9464
  "minimum": 0,
9427
9465
  "maximum": 2,
9428
- "description": "Sampling temperature for Gemini-compatible TTS routes."
9466
+ "description": "Sampling temperature for Gemini-compatible TTS models."
9429
9467
  }
9430
9468
  },
9431
9469
  "additionalProperties": false
@@ -9619,7 +9657,7 @@
9619
9657
  },
9620
9658
  "output_audio": {
9621
9659
  "type": "boolean",
9622
- "description": "Canonical model-dependent audio output toggle. Veo 3 and Seedance requests default to true when omitted. Kling 3.0 Video accepts this selector for non-element-reference requests and maps it to the compatible sound control; omitted Kling requests default to silent output. Do not combine output_audio=true with kling_elements. The aliases outputAudio and generate_audio are accepted for compatibility and must match when provided together."
9660
+ "description": "Audio-output selector for operations that declare it. Omission follows the model default; `false` requests silent output only when allowed. See the audio behavior above and the selected model detail."
9623
9661
  },
9624
9662
  "fps": {
9625
9663
  "type": "integer",
@@ -9742,7 +9780,7 @@
9742
9780
  "audio_url": {
9743
9781
  "type": "string",
9744
9782
  "format": "uri",
9745
- "description": "Publicly reachable audio URL for model-specific audio-conditioned video flows."
9783
+ "description": "Public audio URL for an audio-driven or reference-audio operation supported by the selected model."
9746
9784
  },
9747
9785
  "task_id": {
9748
9786
  "type": "string",
@@ -9777,7 +9815,7 @@
9777
9815
  },
9778
9816
  "video_urls": {
9779
9817
  "type": "array",
9780
- "description": "Compatibility array for video-conditioned flows when multiple input videos are supported by the routed model family. Seedance 2.5 accepts up to 10 aggregate video inputs; other video models retain the shared limit of 3 references unless the model details specify a lower limit.",
9818
+ "description": "Compatibility array for video-conditioned flows when multiple input videos are supported by the selected model. Seedance 2.5 accepts up to 10 aggregate video inputs; other video models retain the shared limit of 3 references unless the model details specify a lower limit.",
9781
9819
  "minItems": 1,
9782
9820
  "maxItems": 10,
9783
9821
  "items": {
@@ -9787,7 +9825,7 @@
9787
9825
  },
9788
9826
  "audio_urls": {
9789
9827
  "type": "array",
9790
- "description": "Compatibility array for audio-conditioned flows when multiple audio references are supported by the routed model family. Seedance 2.5 accepts up to 10 aggregate audio inputs and permits pure-audio reference requests without a prompt; other video models retain the shared limit of 3 references unless the model details specify a lower limit.",
9828
+ "description": "Compatibility array for audio-conditioned flows when multiple audio references are supported by the selected model. Seedance 2.5 accepts up to 10 aggregate audio inputs and permits pure-audio reference requests without a prompt; other video models retain the shared limit of 3 references unless the model details specify a lower limit.",
9791
9829
  "minItems": 1,
9792
9830
  "maxItems": 10,
9793
9831
  "items": {
@@ -9860,11 +9898,27 @@
9860
9898
  "draft": {
9861
9899
  "type": "boolean",
9862
9900
  "default": false,
9863
- "description": "Seedance 1.5 Pro draft workflow flag. Only supported by draft-capable Seedance routes; draft=true creates a low-cost draft task."
9901
+ "description": "Seedance 1.5 Pro draft workflow flag. Only supported by Seedance models supporting drafts; draft=true creates a low-cost draft task."
9864
9902
  },
9865
9903
  "draft_task_id": {
9866
9904
  "type": "string",
9867
9905
  "description": "Seedance 1.5 Pro draft promotion task ID. Provide this instead of draft=true to create the final video from a previous draft task."
9906
+ },
9907
+ "audio": {
9908
+ "type": "boolean",
9909
+ "description": "Audio-output selector for operations that declare it. Omission follows the model default; `false` requests silent output only when allowed. See the audio behavior above and the selected model detail."
9910
+ },
9911
+ "bgm": {
9912
+ "type": "boolean",
9913
+ "description": "Optional audio control. Accepted only when declared by the selected model and operation; availability may differ by operation."
9914
+ },
9915
+ "audio_type": {
9916
+ "type": "string",
9917
+ "description": "Optional audio control. Accepted only when declared by the selected model and operation; availability may differ by operation."
9918
+ },
9919
+ "voice_id": {
9920
+ "type": "string",
9921
+ "description": "Optional audio control. Accepted only when declared by the selected model and operation; availability may differ by operation."
9868
9922
  }
9869
9923
  }
9870
9924
  },
@@ -9910,15 +9964,10 @@
9910
9964
  }
9911
9965
  },
9912
9966
  "error": {
9913
- "type": "object",
9914
- "properties": {
9915
- "code": {
9916
- "type": "string"
9917
- },
9918
- "message": {
9919
- "type": "string"
9920
- }
9921
- }
9967
+ "$ref": "#/components/schemas/AsyncTaskError"
9968
+ },
9969
+ "error_details": {
9970
+ "$ref": "#/components/schemas/AsyncTaskErrorDetails"
9922
9971
  },
9923
9972
  "task_id": {
9924
9973
  "type": "string",
@@ -10037,6 +10086,9 @@
10037
10086
  }
10038
10087
  ]
10039
10088
  },
10089
+ "error_details": {
10090
+ "$ref": "#/components/schemas/AsyncTaskErrorDetails"
10091
+ },
10040
10092
  "task_id": {
10041
10093
  "type": "string"
10042
10094
  },
@@ -10918,7 +10970,7 @@
10918
10970
  },
10919
10971
  "service_tier": {
10920
10972
  "type": "string",
10921
- "description": "Service tier hint for compatible providers."
10973
+ "description": "Service tier hint where supported by the model."
10922
10974
  }
10923
10975
  }
10924
10976
  },
@@ -11244,7 +11296,7 @@
11244
11296
  },
11245
11297
  "responseModalities": {
11246
11298
  "type": "array",
11247
- "description": "Requested output modalities for compatible native Gemini routes.",
11299
+ "description": "Requested output modalities for supported Gemini models.",
11248
11300
  "items": {
11249
11301
  "type": "string"
11250
11302
  }
@@ -12188,7 +12240,7 @@
12188
12240
  "example": 1741425600
12189
12241
  }
12190
12242
  },
12191
- "description": "File metadata. Batch files include status; image/reference files may omit status depending on the upstream file provider."
12243
+ "description": "File metadata. Batch files include status; image/reference files may omit status depending on the file purpose."
12192
12244
  },
12193
12245
  "FileListResponse": {
12194
12246
  "type": "object",
@@ -13006,7 +13058,7 @@
13006
13058
  },
13007
13059
  "AnthropicMessageBatch": {
13008
13060
  "type": "object",
13009
- "description": "Anthropic-compatible message batch object relayed from the provider.",
13061
+ "description": "Anthropic-compatible message batch object.",
13010
13062
  "required": [
13011
13063
  "id",
13012
13064
  "type",
@@ -13039,7 +13091,7 @@
13039
13091
  "request_counts": {
13040
13092
  "type": "object",
13041
13093
  "additionalProperties": true,
13042
- "description": "Upstream request count summary for the batch"
13094
+ "description": "Request count summary for the batch"
13043
13095
  },
13044
13096
  "ended_at": {
13045
13097
  "type": [
@@ -13075,7 +13127,7 @@
13075
13127
  "string",
13076
13128
  "null"
13077
13129
  ],
13078
- "description": "Upstream results URL, when available"
13130
+ "description": "Results URL, when available"
13079
13131
  }
13080
13132
  },
13081
13133
  "additionalProperties": true
@@ -13272,7 +13324,7 @@
13272
13324
  },
13273
13325
  "ModelListTokenLabExtension": {
13274
13326
  "type": "object",
13275
- "description": "TokenLab discovery fields for the list route. Detail-only metadata such as capability flags, pricing provenance, full model details, and empty recommendation snapshots are omitted.",
13327
+ "description": "TokenLab model discovery fields. Use the model details endpoint for the full supported request and pricing contract.",
13276
13328
  "properties": {
13277
13329
  "aliases": {
13278
13330
  "type": "array",
@@ -13396,14 +13448,14 @@
13396
13448
  "deprecated",
13397
13449
  "retired"
13398
13450
  ],
13399
- "description": "Provider lifecycle stage for public discovery and display."
13451
+ "description": "Model lifecycle stage for public discovery and display."
13400
13452
  },
13401
13453
  "reason": {
13402
13454
  "type": [
13403
13455
  "string",
13404
13456
  "null"
13405
13457
  ],
13406
- "description": "Short lifecycle reason or provider note."
13458
+ "description": "Short model lifecycle explanation."
13407
13459
  },
13408
13460
  "replacement_model": {
13409
13461
  "type": [
@@ -13718,14 +13770,14 @@
13718
13770
  "deprecated",
13719
13771
  "retired"
13720
13772
  ],
13721
- "description": "Provider lifecycle stage for public discovery and display."
13773
+ "description": "Model lifecycle stage for public discovery and display."
13722
13774
  },
13723
13775
  "reason": {
13724
13776
  "type": [
13725
13777
  "string",
13726
13778
  "null"
13727
13779
  ],
13728
- "description": "Short lifecycle reason or provider note."
13780
+ "description": "Short model lifecycle explanation."
13729
13781
  },
13730
13782
  "replacement_model": {
13731
13783
  "type": [
@@ -14253,6 +14305,61 @@
14253
14305
  "items": {
14254
14306
  "type": "string"
14255
14307
  }
14308
+ },
14309
+ "parameter_options": {
14310
+ "type": "object",
14311
+ "additionalProperties": {
14312
+ "type": "array",
14313
+ "items": {
14314
+ "type": [
14315
+ "string",
14316
+ "number",
14317
+ "boolean"
14318
+ ]
14319
+ }
14320
+ }
14321
+ },
14322
+ "parameter_value_constraints": {
14323
+ "type": "object",
14324
+ "additionalProperties": {
14325
+ "type": "object",
14326
+ "properties": {
14327
+ "enum": {
14328
+ "type": "array",
14329
+ "items": {
14330
+ "type": [
14331
+ "string",
14332
+ "boolean"
14333
+ ]
14334
+ }
14335
+ },
14336
+ "enumCaseInsensitive": {
14337
+ "type": "boolean"
14338
+ },
14339
+ "maxItems": {
14340
+ "type": "integer"
14341
+ },
14342
+ "maxInteger": {
14343
+ "type": "integer"
14344
+ },
14345
+ "when": {
14346
+ "type": "object",
14347
+ "properties": {
14348
+ "parameter": {
14349
+ "type": "string"
14350
+ },
14351
+ "equals": {
14352
+ "type": [
14353
+ "string",
14354
+ "boolean"
14355
+ ]
14356
+ }
14357
+ },
14358
+ "additionalProperties": false
14359
+ }
14360
+ },
14361
+ "additionalProperties": false
14362
+ }
14256
14363
  }
14257
14364
  },
14258
14365
  "additionalProperties": false
@@ -14675,7 +14782,7 @@
14675
14782
  "minimum": -1,
14676
14783
  "maximum": 4294967295,
14677
14784
  "default": -1,
14678
- "description": "Random seed. -1 lets the model choose a seed. Forwarded on a best-effort basis for routes that accept it."
14785
+ "description": "Random seed. -1 lets the model choose a seed. Accepted on a best-effort basis where supported by the model."
14679
14786
  },
14680
14787
  "execution_expires_after": {
14681
14788
  "type": "integer",
@@ -15979,6 +16086,189 @@
15979
16086
  "description": "Resume or pause delivery. Resuming resets the consecutive failure count."
15980
16087
  }
15981
16088
  }
16089
+ },
16090
+ "TaskTimeoutWebhook": {
16091
+ "type": "object",
16092
+ "required": [
16093
+ "id",
16094
+ "type",
16095
+ "created",
16096
+ "data"
16097
+ ],
16098
+ "properties": {
16099
+ "id": {
16100
+ "type": "string",
16101
+ "description": "Stable event ID for deduplication at the receiving endpoint."
16102
+ },
16103
+ "type": {
16104
+ "type": "string",
16105
+ "enum": [
16106
+ "task.timeout"
16107
+ ]
16108
+ },
16109
+ "created": {
16110
+ "type": "integer",
16111
+ "description": "Event creation time in Unix seconds."
16112
+ },
16113
+ "data": {
16114
+ "type": "object",
16115
+ "required": [
16116
+ "taskType",
16117
+ "taskId",
16118
+ "expectedTimeoutMs",
16119
+ "actualWaitMs"
16120
+ ],
16121
+ "properties": {
16122
+ "taskType": {
16123
+ "type": "string",
16124
+ "enum": [
16125
+ "video",
16126
+ "music",
16127
+ "3d",
16128
+ "world",
16129
+ "image",
16130
+ "audio"
16131
+ ]
16132
+ },
16133
+ "taskId": {
16134
+ "type": "string"
16135
+ },
16136
+ "expectedTimeoutMs": {
16137
+ "type": "integer",
16138
+ "minimum": 0,
16139
+ "description": "Expected timeout threshold in milliseconds."
16140
+ },
16141
+ "actualWaitMs": {
16142
+ "type": "integer",
16143
+ "minimum": 0,
16144
+ "description": "Actual elapsed wait in milliseconds."
16145
+ },
16146
+ "refundIssued": {
16147
+ "type": "boolean",
16148
+ "description": "True if the refund succeeded or had already been issued. False does not rule out a later refund."
16149
+ },
16150
+ "resolutionSource": {
16151
+ "type": "string",
16152
+ "enum": [
16153
+ "callback",
16154
+ "status_query",
16155
+ "background_poller",
16156
+ "timeout_detector",
16157
+ "create_response"
16158
+ ]
16159
+ },
16160
+ "refundOutcome": {
16161
+ "type": "string",
16162
+ "enum": [
16163
+ "success",
16164
+ "already_refunded",
16165
+ "not_applicable",
16166
+ "failed_persisted",
16167
+ "failed_unrecoverable"
16168
+ ],
16169
+ "description": "Refund processing result at event creation."
16170
+ }
16171
+ },
16172
+ "description": "Timeout event data. This event does not contain durationMs."
16173
+ }
16174
+ }
16175
+ },
16176
+ "AsyncTaskUpstreamError": {
16177
+ "type": "object",
16178
+ "description": "The upstream service's own error, present only for a task that ran on an Official route. Its `code` values are defined by the upstream service and may change; branch on `error_details.code` and `error_details.type`.",
16179
+ "required": [
16180
+ "message"
16181
+ ],
16182
+ "properties": {
16183
+ "source": {
16184
+ "type": "string",
16185
+ "description": "Upstream service name, when known."
16186
+ },
16187
+ "code": {
16188
+ "type": "string"
16189
+ },
16190
+ "message": {
16191
+ "type": "string"
16192
+ },
16193
+ "param": {
16194
+ "type": "string"
16195
+ }
16196
+ },
16197
+ "additionalProperties": false
16198
+ },
16199
+ "AsyncTaskErrorDetails": {
16200
+ "type": "object",
16201
+ "description": "Why a task failed. A status read returns HTTP 200 even for a failed task; `status` here is the status of the failure itself.",
16202
+ "required": [
16203
+ "status",
16204
+ "message",
16205
+ "type",
16206
+ "code",
16207
+ "retryable"
16208
+ ],
16209
+ "properties": {
16210
+ "projection_version": {
16211
+ "type": "integer",
16212
+ "description": "`2` means `message` is the final reason for the failure."
16213
+ },
16214
+ "status": {
16215
+ "type": "integer",
16216
+ "minimum": 400,
16217
+ "maximum": 599
16218
+ },
16219
+ "message": {
16220
+ "type": "string"
16221
+ },
16222
+ "type": {
16223
+ "type": "string"
16224
+ },
16225
+ "code": {
16226
+ "type": "string"
16227
+ },
16228
+ "param": {
16229
+ "type": "string",
16230
+ "description": "The request field at fault, omitted when no specific field is known."
16231
+ },
16232
+ "retryable": {
16233
+ "type": "boolean"
16234
+ },
16235
+ "upstream": {
16236
+ "$ref": "#/components/schemas/AsyncTaskUpstreamError"
16237
+ }
16238
+ },
16239
+ "additionalProperties": false
16240
+ },
16241
+ "AsyncTaskError": {
16242
+ "description": "Why the task failed: a string, or an object with `message` and, when known, `type`, `code`, `param` and `retryable`.",
16243
+ "oneOf": [
16244
+ {
16245
+ "type": "string"
16246
+ },
16247
+ {
16248
+ "type": "object",
16249
+ "required": [
16250
+ "message"
16251
+ ],
16252
+ "properties": {
16253
+ "message": {
16254
+ "type": "string"
16255
+ },
16256
+ "type": {
16257
+ "type": "string"
16258
+ },
16259
+ "code": {
16260
+ "type": "string"
16261
+ },
16262
+ "param": {
16263
+ "type": "string"
16264
+ },
16265
+ "retryable": {
16266
+ "type": "boolean"
16267
+ }
16268
+ },
16269
+ "additionalProperties": false
16270
+ }
16271
+ ]
15982
16272
  }
15983
16273
  },
15984
16274
  "responses": {
@@ -16090,7 +16380,7 @@
16090
16380
  }
16091
16381
  },
16092
16382
  "UpstreamError": {
16093
- "description": "Upstream Provider Error",
16383
+ "description": "Service Error",
16094
16384
  "content": {
16095
16385
  "application/json": {
16096
16386
  "schema": {
@@ -16098,7 +16388,7 @@
16098
16388
  },
16099
16389
  "example": {
16100
16390
  "error": {
16101
- "message": "Upstream provider returned an error",
16391
+ "message": "The service could not complete the request",
16102
16392
  "type": "upstream_error"
16103
16393
  }
16104
16394
  }
@@ -16106,7 +16396,7 @@
16106
16396
  }
16107
16397
  },
16108
16398
  "AllChannelsFailed": {
16109
- "description": "All Channels Failed",
16399
+ "description": "Service Unavailable",
16110
16400
  "content": {
16111
16401
  "application/json": {
16112
16402
  "schema": {
@@ -16114,7 +16404,7 @@
16114
16404
  },
16115
16405
  "example": {
16116
16406
  "error": {
16117
- "message": "All available channels failed to process the request",
16407
+ "message": "The service is temporarily unable to process this request",
16118
16408
  "type": "all_channels_failed"
16119
16409
  }
16120
16410
  }
@@ -16171,7 +16461,7 @@
16171
16461
  }
16172
16462
  },
16173
16463
  "DeliveryUnavailable": {
16174
- "description": "No eligible Delivery route is currently available, or all eligible routes failed.",
16464
+ "description": "The requested Delivery tier is temporarily unavailable.",
16175
16465
  "content": {
16176
16466
  "application/json": {
16177
16467
  "schema": {
@@ -16179,7 +16469,7 @@
16179
16469
  },
16180
16470
  "examples": {
16181
16471
  "requestedTierUnavailable": {
16182
- "summary": "The requested Delivery tier has no eligible route",
16472
+ "summary": "The requested Delivery tier is unavailable",
16183
16473
  "value": {
16184
16474
  "error": {
16185
16475
  "message": "The requested Delivery tier is temporarily unavailable for model gpt-5.4.",
@@ -16191,7 +16481,7 @@
16191
16481
  }
16192
16482
  },
16193
16483
  "eligibleRoutesFailed": {
16194
- "summary": "All eligible Delivery routes failed",
16484
+ "summary": "The requested Delivery tier could not complete this request",
16195
16485
  "value": {
16196
16486
  "error": {
16197
16487
  "message": "All available routes failed to process the request.",
@@ -16211,7 +16501,7 @@
16211
16501
  "name": "X-TokenLab-Delivery-Policy",
16212
16502
  "in": "header",
16213
16503
  "required": false,
16214
- "description": "Per-request Delivery policy. Overrides the API key and Workspace defaults. Auto tries TokenLab Verified first and may switch once to Official only before output, upstream acceptance, or persistent resource creation.",
16504
+ "description": "Per-request Delivery policy. Overrides the API key and Workspace defaults. Auto tries TokenLab Verified first and may switch once to Official only before output, request acceptance, or persistent resource creation.",
16215
16505
  "schema": {
16216
16506
  "type": "string",
16217
16507
  "enum": [
@@ -16222,5 +16512,78 @@
16222
16512
  }
16223
16513
  }
16224
16514
  }
16515
+ },
16516
+ "webhooks": {
16517
+ "taskTimeout": {
16518
+ "post": {
16519
+ "tags": [
16520
+ "Webhooks"
16521
+ ],
16522
+ "summary": "Task timeout notification",
16523
+ "description": "Sent to a configured webhook endpoint subscribed to task.timeout. Verify the HMAC-SHA256 signature over the timestamp, a period, and the raw request body using the signing secret. Return 2xx promptly and deduplicate by event ID. See https://tokenlab.sh/docs/en/guides/webhooks for signature verification and delivery recovery.",
16524
+ "operationId": "receiveTaskTimeoutWebhook",
16525
+ "security": [],
16526
+ "parameters": [
16527
+ {
16528
+ "in": "header",
16529
+ "name": "X-Webhook-ID",
16530
+ "required": true,
16531
+ "schema": {
16532
+ "type": "string"
16533
+ },
16534
+ "description": "Matches the event id in the request body."
16535
+ },
16536
+ {
16537
+ "in": "header",
16538
+ "name": "X-Webhook-Timestamp",
16539
+ "required": true,
16540
+ "schema": {
16541
+ "type": "string",
16542
+ "pattern": "^[0-9]+$"
16543
+ },
16544
+ "description": "Delivery attempt timestamp in Unix seconds."
16545
+ },
16546
+ {
16547
+ "in": "header",
16548
+ "name": "X-Webhook-Signature",
16549
+ "required": true,
16550
+ "schema": {
16551
+ "type": "string",
16552
+ "pattern": "^sha256=[a-f0-9]{64}$"
16553
+ },
16554
+ "description": "HMAC-SHA256 signature using the complete whsec_ signing secret."
16555
+ }
16556
+ ],
16557
+ "requestBody": {
16558
+ "required": true,
16559
+ "content": {
16560
+ "application/json": {
16561
+ "schema": {
16562
+ "$ref": "#/components/schemas/TaskTimeoutWebhook"
16563
+ },
16564
+ "example": {
16565
+ "id": "event-unique-id",
16566
+ "type": "task.timeout",
16567
+ "created": 1790000000,
16568
+ "data": {
16569
+ "taskType": "image",
16570
+ "taskId": "ldtask_0123456789abcdef0123456789abcdef",
16571
+ "expectedTimeoutMs": 1800000,
16572
+ "actualWaitMs": 1801000,
16573
+ "refundIssued": true,
16574
+ "resolutionSource": "timeout_detector",
16575
+ "refundOutcome": "success"
16576
+ }
16577
+ }
16578
+ }
16579
+ }
16580
+ },
16581
+ "responses": {
16582
+ "2XX": {
16583
+ "description": "Notification accepted by the receiving endpoint."
16584
+ }
16585
+ }
16586
+ }
16587
+ }
16225
16588
  }
16226
16589
  }