@tokenlabai/mcp-server 0.6.24 → 0.6.26

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.
@@ -2,7 +2,7 @@
2
2
  "openapi": "3.1.0",
3
3
  "info": {
4
4
  "title": "TokenLab AI Gateway",
5
- "description": "Organization balance, API key management, and key-level usage/billing via management token",
5
+ "description": "TokenLab public AI API: model discovery, generation, files, cached content, asynchronous tasks, and management-token account reporting.",
6
6
  "version": "1.0.0",
7
7
  "termsOfService": "https://tokenlab.sh/tos",
8
8
  "contact": {
@@ -75,6 +75,10 @@
75
75
  {
76
76
  "name": "Webhooks",
77
77
  "description": "Workspace webhook management with Management Tokens (mt-...). Inference API keys do not grant management access."
78
+ },
79
+ {
80
+ "name": "Gemini Resources",
81
+ "description": "Workspace-owned Gemini files, uploads, and cached content"
78
82
  }
79
83
  ],
80
84
  "security": [
@@ -89,7 +93,7 @@
89
93
  "Chat"
90
94
  ],
91
95
  "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.",
96
+ "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
97
  "operationId": "createChatCompletion",
94
98
  "requestBody": {
95
99
  "required": true,
@@ -528,6 +532,9 @@
528
532
  "additionalProperties": true
529
533
  }
530
534
  ]
535
+ },
536
+ "error_details": {
537
+ "$ref": "#/components/schemas/AsyncTaskErrorDetails"
531
538
  }
532
539
  }
533
540
  }
@@ -1448,7 +1455,7 @@
1448
1455
  }
1449
1456
  },
1450
1457
  "400": {
1451
- "description": "Task type, provider, or model does not support cancellation",
1458
+ "description": "This task does not support cancellation",
1452
1459
  "content": {
1453
1460
  "application/json": {
1454
1461
  "schema": {
@@ -2000,7 +2007,7 @@
2000
2007
  "Anthropic"
2001
2008
  ],
2002
2009
  "summary": "Delete message batch (Anthropic-compatible)",
2003
- "description": "Deletes a native Anthropic Message Batch when the provider supports deletion.",
2010
+ "description": "Deletes an Anthropic Message Batch when deletion is supported for that batch.",
2004
2011
  "operationId": "deleteAnthropicMessageBatch",
2005
2012
  "parameters": [
2006
2013
  {
@@ -2109,7 +2116,7 @@
2109
2116
  "Anthropic"
2110
2117
  ],
2111
2118
  "summary": "Cancel message batch (Anthropic-compatible)",
2112
- "description": "Cancels a native Anthropic Message Batch when the provider still allows cancellation.",
2119
+ "description": "Cancels an Anthropic Message Batch when cancellation is still available for that batch.",
2113
2120
  "operationId": "cancelAnthropicMessageBatch",
2114
2121
  "parameters": [
2115
2122
  {
@@ -2160,7 +2167,7 @@
2160
2167
  "Gemini"
2161
2168
  ],
2162
2169
  "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.",
2170
+ "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
2171
  "operationId": "geminiGenerateContent",
2165
2172
  "parameters": [
2166
2173
  {
@@ -2642,7 +2649,7 @@
2642
2649
  "Responses"
2643
2650
  ],
2644
2651
  "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.",
2652
+ "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
2653
  "operationId": "createResponse",
2647
2654
  "requestBody": {
2648
2655
  "required": true,
@@ -2710,7 +2717,7 @@
2710
2717
  "properties": {
2711
2718
  "include_obfuscation": {
2712
2719
  "type": "boolean",
2713
- "description": "When true, request obfuscated tokens in Responses stream events from compatible upstreams."
2720
+ "description": "When true, request obfuscated tokens in Responses stream events where supported."
2714
2721
  }
2715
2722
  },
2716
2723
  "additionalProperties": true,
@@ -2728,7 +2735,7 @@
2728
2735
  "string",
2729
2736
  "null"
2730
2737
  ],
2731
- "description": "Service tier hint for compatible providers."
2738
+ "description": "Service tier hint where supported by the model."
2732
2739
  },
2733
2740
  "truncation": {
2734
2741
  "type": "string",
@@ -3271,7 +3278,7 @@
3271
3278
  },
3272
3279
  "seed": {
3273
3280
  "type": "integer",
3274
- "description": "Seed for deterministic-compatible providers."
3281
+ "description": "Seed for repeatable generation where supported by the model."
3275
3282
  },
3276
3283
  "user": {
3277
3284
  "type": "string",
@@ -3666,7 +3673,7 @@
3666
3673
  "Management"
3667
3674
  ],
3668
3675
  "summary": "Get API key usage",
3669
- "description": "Returns paginated key-level usage details without exposing provider-specific execution details.",
3676
+ "description": "Returns paginated usage details for this API key.",
3670
3677
  "operationId": "getManagementApiKeyUsage",
3671
3678
  "security": [
3672
3679
  {
@@ -3796,7 +3803,7 @@
3796
3803
  "Management"
3797
3804
  ],
3798
3805
  "summary": "Get API key billing",
3799
- "description": "Returns aggregated key-level billing breakdowns without exposing provider-specific execution details.",
3806
+ "description": "Returns aggregated billing breakdowns for this API key.",
3800
3807
  "operationId": "getManagementApiKeyBilling",
3801
3808
  "security": [
3802
3809
  {
@@ -5665,6 +5672,12 @@
5665
5672
  "cost": {
5666
5673
  "type": "object",
5667
5674
  "additionalProperties": true
5675
+ },
5676
+ "error": {
5677
+ "$ref": "#/components/schemas/AsyncTaskError"
5678
+ },
5679
+ "error_details": {
5680
+ "$ref": "#/components/schemas/AsyncTaskErrorDetails"
5668
5681
  }
5669
5682
  },
5670
5683
  "additionalProperties": true
@@ -5762,7 +5775,10 @@
5762
5775
  "additionalProperties": true
5763
5776
  },
5764
5777
  "error": {
5765
- "type": "string"
5778
+ "$ref": "#/components/schemas/AsyncTaskError"
5779
+ },
5780
+ "error_details": {
5781
+ "$ref": "#/components/schemas/AsyncTaskErrorDetails"
5766
5782
  }
5767
5783
  },
5768
5784
  "additionalProperties": true
@@ -8259,195 +8275,1322 @@
8259
8275
  }
8260
8276
  ]
8261
8277
  }
8262
- }
8263
- },
8264
- "components": {
8265
- "securitySchemes": {
8266
- "BearerAuth": {
8267
- "type": "http",
8268
- "scheme": "bearer",
8269
- "bearerFormat": "API Key",
8270
- "description": "API Key authentication. Create or manage API keys in [Dashboard > API > API Keys](https://tokenlab.sh/dashboard/api?tab=keys)."
8271
- },
8272
- "ManagementTokenAuth": {
8273
- "type": "http",
8274
- "scheme": "bearer",
8275
- "bearerFormat": "Management Token",
8276
- "description": "Management token authentication. Create or manage Management Tokens in [Dashboard > API > Management Tokens](https://tokenlab.sh/dashboard/api?tab=tokens)."
8277
- }
8278
8278
  },
8279
- "schemas": {
8280
- "ChatCompletionRequest": {
8281
- "type": "object",
8282
- "required": [
8283
- "model",
8284
- "messages"
8279
+ "/v1beta/files:register": {
8280
+ "post": {
8281
+ "tags": [
8282
+ "Gemini Resources"
8285
8283
  ],
8286
- "properties": {
8287
- "model": {
8288
- "type": "string",
8289
- "description": "ID of the model to use (e.g., gpt-5.4, claude-sonnet-4-6)",
8290
- "example": "gpt-4o"
8284
+ "operationId": "geminiRegisterFiles",
8285
+ "summary": "Register Gemini files",
8286
+ "description": "Registers files from a supported source using Gemini JSON. The service validates the source and request fields. Resources can only be read, referenced, changed, or deleted in their owning Workspace. Missing, expired, or inaccessible resources return a Gemini-format error.",
8287
+ "security": [
8288
+ {
8289
+ "BearerAuth": []
8291
8290
  },
8292
- "messages": {
8293
- "type": "array",
8294
- "description": "A list of messages comprising the conversation",
8295
- "items": {
8296
- "$ref": "#/components/schemas/ChatMessage"
8291
+ {
8292
+ "GeminiApiKey": []
8293
+ }
8294
+ ],
8295
+ "parameters": [
8296
+ {
8297
+ "name": "key",
8298
+ "in": "query",
8299
+ "required": false,
8300
+ "schema": {
8301
+ "type": "string"
8297
8302
  },
8298
- "minItems": 1
8299
- },
8300
- "temperature": {
8301
- "type": "number",
8302
- "minimum": 0,
8303
- "maximum": 2,
8304
- "default": 1,
8305
- "description": "Sampling temperature (0-2)"
8306
- },
8307
- "top_p": {
8308
- "type": "number",
8309
- "minimum": 0,
8310
- "maximum": 1,
8311
- "default": 1,
8312
- "description": "Nucleus sampling probability"
8313
- },
8314
- "n": {
8315
- "type": "integer",
8316
- "minimum": 1,
8317
- "maximum": 128,
8318
- "default": 1,
8319
- "description": "Number of completions to generate"
8320
- },
8321
- "stream": {
8322
- "type": "boolean",
8323
- "default": false,
8324
- "description": "If true, returns a stream of events"
8303
+ "description": "API key alternative to Bearer or x-goog-api-key."
8325
8304
  },
8326
- "stop": {
8327
- "oneOf": [
8328
- {
8329
- "type": "string"
8330
- },
8331
- {
8332
- "type": "array",
8333
- "items": {
8334
- "type": "string"
8335
- },
8336
- "maxItems": 4
8305
+ {
8306
+ "name": "Idempotency-Key",
8307
+ "in": "header",
8308
+ "required": false,
8309
+ "schema": {
8310
+ "type": "string"
8311
+ },
8312
+ "description": "Reuse the same key and request body when recovering a create response. A different body with the same key returns a conflict."
8313
+ }
8314
+ ],
8315
+ "responses": {
8316
+ "200": {
8317
+ "description": "Success",
8318
+ "content": {
8319
+ "application/json": {
8320
+ "schema": {
8321
+ "anyOf": [
8322
+ {
8323
+ "$ref": "#/components/schemas/GeminiFileResource"
8324
+ },
8325
+ {
8326
+ "type": "object",
8327
+ "properties": {
8328
+ "file": {
8329
+ "$ref": "#/components/schemas/GeminiFileResource"
8330
+ },
8331
+ "files": {
8332
+ "type": "array",
8333
+ "items": {
8334
+ "$ref": "#/components/schemas/GeminiFileResource"
8335
+ }
8336
+ }
8337
+ },
8338
+ "additionalProperties": true
8339
+ }
8340
+ ]
8341
+ }
8337
8342
  }
8338
- ],
8339
- "description": "Stop sequences"
8343
+ }
8340
8344
  },
8341
- "max_tokens": {
8342
- "type": "integer",
8343
- "minimum": 1,
8344
- "description": "Maximum number of tokens to generate"
8345
+ "400": {
8346
+ "$ref": "#/components/responses/GeminiResourceError"
8345
8347
  },
8346
- "max_completion_tokens": {
8347
- "type": "integer",
8348
- "minimum": 1,
8349
- "description": "Maximum completion tokens for newer reasoning-enabled model families"
8348
+ "401": {
8349
+ "$ref": "#/components/responses/GeminiResourceError"
8350
8350
  },
8351
- "presence_penalty": {
8352
- "type": "number",
8353
- "minimum": -2,
8354
- "maximum": 2,
8355
- "default": 0,
8356
- "description": "Presence penalty (-2 to 2)"
8351
+ "403": {
8352
+ "$ref": "#/components/responses/GeminiResourceError"
8357
8353
  },
8358
- "frequency_penalty": {
8359
- "type": "number",
8360
- "minimum": -2,
8361
- "maximum": 2,
8362
- "default": 0,
8363
- "description": "Frequency penalty (-2 to 2)"
8354
+ "404": {
8355
+ "$ref": "#/components/responses/GeminiResourceError"
8364
8356
  },
8365
- "tools": {
8366
- "type": "array",
8367
- "description": "List of tools the model may call",
8368
- "items": {
8369
- "$ref": "#/components/schemas/Tool"
8370
- }
8357
+ "409": {
8358
+ "$ref": "#/components/responses/GeminiResourceError"
8371
8359
  },
8372
- "functions": {
8373
- "type": "array",
8374
- "description": "Deprecated function definitions retained by the official Chat Completions contract.",
8375
- "items": {
8376
- "type": "object",
8377
- "additionalProperties": true
8378
- }
8360
+ "429": {
8361
+ "$ref": "#/components/responses/GeminiResourceError"
8379
8362
  },
8380
- "function_call": {
8381
- "oneOf": [
8382
- {
8383
- "type": "string"
8384
- },
8385
- {
8386
- "type": "object",
8387
- "additionalProperties": true
8388
- }
8389
- ],
8390
- "description": "Deprecated function-call selection retained by the official Chat Completions contract."
8363
+ "502": {
8364
+ "$ref": "#/components/responses/GeminiResourceError"
8391
8365
  },
8392
- "tool_choice": {
8393
- "oneOf": [
8394
- {
8395
- "type": "string",
8396
- "enum": [
8397
- "none",
8398
- "auto",
8399
- "required"
8400
- ]
8401
- },
8402
- {
8403
- "type": "object",
8404
- "properties": {
8405
- "type": {
8406
- "type": "string",
8407
- "enum": [
8408
- "function"
8409
- ]
8410
- },
8411
- "function": {
8412
- "type": "object",
8413
- "properties": {
8414
- "name": {
8415
- "type": "string"
8416
- }
8417
- },
8418
- "required": [
8419
- "name"
8420
- ]
8421
- }
8422
- },
8423
- "required": [
8424
- "type",
8425
- "function"
8426
- ]
8366
+ "503": {
8367
+ "$ref": "#/components/responses/GeminiResourceError"
8368
+ }
8369
+ },
8370
+ "requestBody": {
8371
+ "required": true,
8372
+ "content": {
8373
+ "application/json": {
8374
+ "schema": {
8375
+ "$ref": "#/components/schemas/GeminiFileRegisterRequest"
8427
8376
  }
8428
- ],
8429
- "description": "Controls which function is called"
8377
+ }
8378
+ }
8379
+ }
8380
+ }
8381
+ },
8382
+ "/v1beta/files": {
8383
+ "post": {
8384
+ "tags": [
8385
+ "Gemini Resources"
8386
+ ],
8387
+ "operationId": "geminiCreateFile",
8388
+ "summary": "Create Gemini file metadata",
8389
+ "description": "Creates a Gemini file resource from JSON metadata. Upload file bytes through /upload/v1beta/files. Resources can only be read, referenced, changed, or deleted in their owning Workspace. Missing, expired, or inaccessible resources return a Gemini-format error.",
8390
+ "security": [
8391
+ {
8392
+ "BearerAuth": []
8430
8393
  },
8431
- "response_format": {
8432
- "type": "object",
8433
- "properties": {
8434
- "type": {
8435
- "type": "string",
8436
- "enum": [
8437
- "text",
8438
- "json_object"
8439
- ]
8440
- }
8394
+ {
8395
+ "GeminiApiKey": []
8396
+ }
8397
+ ],
8398
+ "parameters": [
8399
+ {
8400
+ "name": "key",
8401
+ "in": "query",
8402
+ "required": false,
8403
+ "schema": {
8404
+ "type": "string"
8441
8405
  },
8442
- "description": "Response format specification"
8443
- },
8444
- "seed": {
8445
- "type": "integer",
8446
- "description": "Seed for deterministic generation"
8406
+ "description": "API key alternative to Bearer or x-goog-api-key."
8447
8407
  },
8448
- "user": {
8449
- "type": "string",
8450
- "description": "End-user identifier for abuse detection"
8408
+ {
8409
+ "name": "Idempotency-Key",
8410
+ "in": "header",
8411
+ "required": false,
8412
+ "schema": {
8413
+ "type": "string"
8414
+ },
8415
+ "description": "Reuse the same key and request body when recovering a create response. A different body with the same key returns a conflict."
8416
+ }
8417
+ ],
8418
+ "responses": {
8419
+ "200": {
8420
+ "description": "Success",
8421
+ "content": {
8422
+ "application/json": {
8423
+ "schema": {
8424
+ "anyOf": [
8425
+ {
8426
+ "$ref": "#/components/schemas/GeminiFileResource"
8427
+ },
8428
+ {
8429
+ "type": "object",
8430
+ "properties": {
8431
+ "file": {
8432
+ "$ref": "#/components/schemas/GeminiFileResource"
8433
+ },
8434
+ "files": {
8435
+ "type": "array",
8436
+ "items": {
8437
+ "$ref": "#/components/schemas/GeminiFileResource"
8438
+ }
8439
+ }
8440
+ },
8441
+ "additionalProperties": true
8442
+ }
8443
+ ]
8444
+ }
8445
+ }
8446
+ }
8447
+ },
8448
+ "400": {
8449
+ "$ref": "#/components/responses/GeminiResourceError"
8450
+ },
8451
+ "401": {
8452
+ "$ref": "#/components/responses/GeminiResourceError"
8453
+ },
8454
+ "403": {
8455
+ "$ref": "#/components/responses/GeminiResourceError"
8456
+ },
8457
+ "404": {
8458
+ "$ref": "#/components/responses/GeminiResourceError"
8459
+ },
8460
+ "409": {
8461
+ "$ref": "#/components/responses/GeminiResourceError"
8462
+ },
8463
+ "429": {
8464
+ "$ref": "#/components/responses/GeminiResourceError"
8465
+ },
8466
+ "502": {
8467
+ "$ref": "#/components/responses/GeminiResourceError"
8468
+ },
8469
+ "503": {
8470
+ "$ref": "#/components/responses/GeminiResourceError"
8471
+ }
8472
+ },
8473
+ "requestBody": {
8474
+ "required": true,
8475
+ "content": {
8476
+ "application/json": {
8477
+ "schema": {
8478
+ "$ref": "#/components/schemas/GeminiFileCreateRequest"
8479
+ }
8480
+ }
8481
+ }
8482
+ }
8483
+ },
8484
+ "get": {
8485
+ "tags": [
8486
+ "Gemini Resources"
8487
+ ],
8488
+ "operationId": "geminiListFiles",
8489
+ "summary": "List Gemini files",
8490
+ "description": "Lists files belonging to the current Workspace. Use nextPageToken to continue. Resources can only be read, referenced, changed, or deleted in their owning Workspace. Missing, expired, or inaccessible resources return a Gemini-format error.",
8491
+ "security": [
8492
+ {
8493
+ "BearerAuth": []
8494
+ },
8495
+ {
8496
+ "GeminiApiKey": []
8497
+ }
8498
+ ],
8499
+ "parameters": [
8500
+ {
8501
+ "name": "key",
8502
+ "in": "query",
8503
+ "required": false,
8504
+ "schema": {
8505
+ "type": "string"
8506
+ },
8507
+ "description": "API key alternative to Bearer or x-goog-api-key."
8508
+ },
8509
+ {
8510
+ "name": "pageSize",
8511
+ "in": "query",
8512
+ "schema": {
8513
+ "type": "integer"
8514
+ },
8515
+ "description": "Requested page size; page_size is also accepted."
8516
+ },
8517
+ {
8518
+ "name": "pageToken",
8519
+ "in": "query",
8520
+ "required": false,
8521
+ "schema": {
8522
+ "type": "string"
8523
+ },
8524
+ "description": "Opaque nextPageToken from the previous response. page_token is also accepted."
8525
+ }
8526
+ ],
8527
+ "responses": {
8528
+ "200": {
8529
+ "description": "Success",
8530
+ "content": {
8531
+ "application/json": {
8532
+ "schema": {
8533
+ "type": "object",
8534
+ "properties": {
8535
+ "files": {
8536
+ "type": "array",
8537
+ "items": {
8538
+ "$ref": "#/components/schemas/GeminiFileResource"
8539
+ }
8540
+ },
8541
+ "nextPageToken": {
8542
+ "type": "string"
8543
+ }
8544
+ },
8545
+ "required": [
8546
+ "files"
8547
+ ]
8548
+ }
8549
+ }
8550
+ }
8551
+ },
8552
+ "400": {
8553
+ "$ref": "#/components/responses/GeminiResourceError"
8554
+ },
8555
+ "401": {
8556
+ "$ref": "#/components/responses/GeminiResourceError"
8557
+ },
8558
+ "403": {
8559
+ "$ref": "#/components/responses/GeminiResourceError"
8560
+ },
8561
+ "404": {
8562
+ "$ref": "#/components/responses/GeminiResourceError"
8563
+ },
8564
+ "409": {
8565
+ "$ref": "#/components/responses/GeminiResourceError"
8566
+ },
8567
+ "429": {
8568
+ "$ref": "#/components/responses/GeminiResourceError"
8569
+ },
8570
+ "502": {
8571
+ "$ref": "#/components/responses/GeminiResourceError"
8572
+ },
8573
+ "503": {
8574
+ "$ref": "#/components/responses/GeminiResourceError"
8575
+ }
8576
+ }
8577
+ }
8578
+ },
8579
+ "/v1beta/files/{fileId}": {
8580
+ "get": {
8581
+ "tags": [
8582
+ "Gemini Resources"
8583
+ ],
8584
+ "operationId": "geminiGetFile",
8585
+ "summary": "Get Gemini file",
8586
+ "description": "Reads metadata for a Gemini file. Resources can only be read, referenced, changed, or deleted in their owning Workspace. Missing, expired, or inaccessible resources return a Gemini-format error.",
8587
+ "security": [
8588
+ {
8589
+ "BearerAuth": []
8590
+ },
8591
+ {
8592
+ "GeminiApiKey": []
8593
+ }
8594
+ ],
8595
+ "parameters": [
8596
+ {
8597
+ "name": "fileId",
8598
+ "in": "path",
8599
+ "required": true,
8600
+ "schema": {
8601
+ "type": "string"
8602
+ },
8603
+ "description": "Suffix of the returned files/{fileId} name."
8604
+ },
8605
+ {
8606
+ "name": "key",
8607
+ "in": "query",
8608
+ "required": false,
8609
+ "schema": {
8610
+ "type": "string"
8611
+ },
8612
+ "description": "API key alternative to Bearer or x-goog-api-key."
8613
+ }
8614
+ ],
8615
+ "responses": {
8616
+ "200": {
8617
+ "description": "Success",
8618
+ "content": {
8619
+ "application/json": {
8620
+ "schema": {
8621
+ "$ref": "#/components/schemas/GeminiFileResource"
8622
+ }
8623
+ }
8624
+ }
8625
+ },
8626
+ "400": {
8627
+ "$ref": "#/components/responses/GeminiResourceError"
8628
+ },
8629
+ "401": {
8630
+ "$ref": "#/components/responses/GeminiResourceError"
8631
+ },
8632
+ "403": {
8633
+ "$ref": "#/components/responses/GeminiResourceError"
8634
+ },
8635
+ "404": {
8636
+ "$ref": "#/components/responses/GeminiResourceError"
8637
+ },
8638
+ "409": {
8639
+ "$ref": "#/components/responses/GeminiResourceError"
8640
+ },
8641
+ "429": {
8642
+ "$ref": "#/components/responses/GeminiResourceError"
8643
+ },
8644
+ "502": {
8645
+ "$ref": "#/components/responses/GeminiResourceError"
8646
+ },
8647
+ "503": {
8648
+ "$ref": "#/components/responses/GeminiResourceError"
8649
+ }
8650
+ }
8651
+ },
8652
+ "delete": {
8653
+ "tags": [
8654
+ "Gemini Resources"
8655
+ ],
8656
+ "operationId": "geminiDeleteFile",
8657
+ "summary": "Delete Gemini file",
8658
+ "description": "Deletes a Gemini file. Save anything needed before deletion. Resources can only be read, referenced, changed, or deleted in their owning Workspace. Missing, expired, or inaccessible resources return a Gemini-format error.",
8659
+ "security": [
8660
+ {
8661
+ "BearerAuth": []
8662
+ },
8663
+ {
8664
+ "GeminiApiKey": []
8665
+ }
8666
+ ],
8667
+ "parameters": [
8668
+ {
8669
+ "name": "fileId",
8670
+ "in": "path",
8671
+ "required": true,
8672
+ "schema": {
8673
+ "type": "string"
8674
+ }
8675
+ },
8676
+ {
8677
+ "name": "key",
8678
+ "in": "query",
8679
+ "required": false,
8680
+ "schema": {
8681
+ "type": "string"
8682
+ },
8683
+ "description": "API key alternative to Bearer or x-goog-api-key."
8684
+ }
8685
+ ],
8686
+ "responses": {
8687
+ "200": {
8688
+ "description": "Success",
8689
+ "content": {
8690
+ "application/json": {
8691
+ "schema": {
8692
+ "type": "object",
8693
+ "additionalProperties": true
8694
+ }
8695
+ }
8696
+ }
8697
+ },
8698
+ "400": {
8699
+ "$ref": "#/components/responses/GeminiResourceError"
8700
+ },
8701
+ "401": {
8702
+ "$ref": "#/components/responses/GeminiResourceError"
8703
+ },
8704
+ "403": {
8705
+ "$ref": "#/components/responses/GeminiResourceError"
8706
+ },
8707
+ "404": {
8708
+ "$ref": "#/components/responses/GeminiResourceError"
8709
+ },
8710
+ "409": {
8711
+ "$ref": "#/components/responses/GeminiResourceError"
8712
+ },
8713
+ "429": {
8714
+ "$ref": "#/components/responses/GeminiResourceError"
8715
+ },
8716
+ "502": {
8717
+ "$ref": "#/components/responses/GeminiResourceError"
8718
+ },
8719
+ "503": {
8720
+ "$ref": "#/components/responses/GeminiResourceError"
8721
+ }
8722
+ }
8723
+ }
8724
+ },
8725
+ "/v1beta/cachedContents": {
8726
+ "post": {
8727
+ "tags": [
8728
+ "Gemini Resources"
8729
+ ],
8730
+ "operationId": "geminiCreateCachedContent",
8731
+ "summary": "Create Gemini cached content",
8732
+ "description": "Creates cached content for a current TokenLab Gemini model. Supported fields, resource references, and lifetime depend on the service and model; lowerCamelCase and the corresponding proto snake_case names are accepted. Resources can only be read, referenced, changed, or deleted in their owning Workspace. Missing, expired, or inaccessible resources return a Gemini-format error.",
8733
+ "security": [
8734
+ {
8735
+ "BearerAuth": []
8736
+ },
8737
+ {
8738
+ "GeminiApiKey": []
8739
+ }
8740
+ ],
8741
+ "parameters": [
8742
+ {
8743
+ "name": "key",
8744
+ "in": "query",
8745
+ "required": false,
8746
+ "schema": {
8747
+ "type": "string"
8748
+ },
8749
+ "description": "API key alternative to Bearer or x-goog-api-key."
8750
+ },
8751
+ {
8752
+ "name": "Idempotency-Key",
8753
+ "in": "header",
8754
+ "required": false,
8755
+ "schema": {
8756
+ "type": "string"
8757
+ },
8758
+ "description": "Reuse the same key and request body when recovering a create response. A different body with the same key returns a conflict."
8759
+ }
8760
+ ],
8761
+ "responses": {
8762
+ "200": {
8763
+ "description": "Success",
8764
+ "content": {
8765
+ "application/json": {
8766
+ "schema": {
8767
+ "$ref": "#/components/schemas/GeminiCachedContentResource"
8768
+ }
8769
+ }
8770
+ }
8771
+ },
8772
+ "400": {
8773
+ "$ref": "#/components/responses/GeminiResourceError"
8774
+ },
8775
+ "401": {
8776
+ "$ref": "#/components/responses/GeminiResourceError"
8777
+ },
8778
+ "403": {
8779
+ "$ref": "#/components/responses/GeminiResourceError"
8780
+ },
8781
+ "404": {
8782
+ "$ref": "#/components/responses/GeminiResourceError"
8783
+ },
8784
+ "409": {
8785
+ "$ref": "#/components/responses/GeminiResourceError"
8786
+ },
8787
+ "429": {
8788
+ "$ref": "#/components/responses/GeminiResourceError"
8789
+ },
8790
+ "502": {
8791
+ "$ref": "#/components/responses/GeminiResourceError"
8792
+ },
8793
+ "503": {
8794
+ "$ref": "#/components/responses/GeminiResourceError"
8795
+ }
8796
+ },
8797
+ "requestBody": {
8798
+ "required": true,
8799
+ "content": {
8800
+ "application/json": {
8801
+ "schema": {
8802
+ "$ref": "#/components/schemas/GeminiCachedContentRequest"
8803
+ }
8804
+ }
8805
+ }
8806
+ }
8807
+ },
8808
+ "get": {
8809
+ "tags": [
8810
+ "Gemini Resources"
8811
+ ],
8812
+ "operationId": "geminiListCachedContents",
8813
+ "summary": "List Gemini cached content",
8814
+ "description": "Lists cached content belonging to the current Workspace. Use nextPageToken to continue. Resources can only be read, referenced, changed, or deleted in their owning Workspace. Missing, expired, or inaccessible resources return a Gemini-format error.",
8815
+ "security": [
8816
+ {
8817
+ "BearerAuth": []
8818
+ },
8819
+ {
8820
+ "GeminiApiKey": []
8821
+ }
8822
+ ],
8823
+ "parameters": [
8824
+ {
8825
+ "name": "key",
8826
+ "in": "query",
8827
+ "required": false,
8828
+ "schema": {
8829
+ "type": "string"
8830
+ },
8831
+ "description": "API key alternative to Bearer or x-goog-api-key."
8832
+ },
8833
+ {
8834
+ "name": "pageSize",
8835
+ "in": "query",
8836
+ "schema": {
8837
+ "type": "integer"
8838
+ },
8839
+ "description": "Requested page size; page_size is also accepted."
8840
+ },
8841
+ {
8842
+ "name": "pageToken",
8843
+ "in": "query",
8844
+ "required": false,
8845
+ "schema": {
8846
+ "type": "string"
8847
+ },
8848
+ "description": "Opaque nextPageToken from the previous response. page_token is also accepted."
8849
+ }
8850
+ ],
8851
+ "responses": {
8852
+ "200": {
8853
+ "description": "Success",
8854
+ "content": {
8855
+ "application/json": {
8856
+ "schema": {
8857
+ "type": "object",
8858
+ "required": [
8859
+ "cachedContents"
8860
+ ],
8861
+ "properties": {
8862
+ "cachedContents": {
8863
+ "type": "array",
8864
+ "items": {
8865
+ "$ref": "#/components/schemas/GeminiCachedContentResource"
8866
+ }
8867
+ },
8868
+ "nextPageToken": {
8869
+ "type": "string"
8870
+ }
8871
+ }
8872
+ }
8873
+ }
8874
+ }
8875
+ },
8876
+ "400": {
8877
+ "$ref": "#/components/responses/GeminiResourceError"
8878
+ },
8879
+ "401": {
8880
+ "$ref": "#/components/responses/GeminiResourceError"
8881
+ },
8882
+ "403": {
8883
+ "$ref": "#/components/responses/GeminiResourceError"
8884
+ },
8885
+ "404": {
8886
+ "$ref": "#/components/responses/GeminiResourceError"
8887
+ },
8888
+ "409": {
8889
+ "$ref": "#/components/responses/GeminiResourceError"
8890
+ },
8891
+ "429": {
8892
+ "$ref": "#/components/responses/GeminiResourceError"
8893
+ },
8894
+ "502": {
8895
+ "$ref": "#/components/responses/GeminiResourceError"
8896
+ },
8897
+ "503": {
8898
+ "$ref": "#/components/responses/GeminiResourceError"
8899
+ }
8900
+ }
8901
+ }
8902
+ },
8903
+ "/v1beta/cachedContents/{cacheId}": {
8904
+ "get": {
8905
+ "tags": [
8906
+ "Gemini Resources"
8907
+ ],
8908
+ "operationId": "geminiGetCachedContent",
8909
+ "summary": "Get Gemini cached content",
8910
+ "description": "Reads cached content metadata. Resources can only be read, referenced, changed, or deleted in their owning Workspace. Missing, expired, or inaccessible resources return a Gemini-format error.",
8911
+ "security": [
8912
+ {
8913
+ "BearerAuth": []
8914
+ },
8915
+ {
8916
+ "GeminiApiKey": []
8917
+ }
8918
+ ],
8919
+ "parameters": [
8920
+ {
8921
+ "name": "cacheId",
8922
+ "in": "path",
8923
+ "required": true,
8924
+ "schema": {
8925
+ "type": "string"
8926
+ },
8927
+ "description": "Suffix of the returned cachedContents/{cacheId} name."
8928
+ },
8929
+ {
8930
+ "name": "key",
8931
+ "in": "query",
8932
+ "required": false,
8933
+ "schema": {
8934
+ "type": "string"
8935
+ },
8936
+ "description": "API key alternative to Bearer or x-goog-api-key."
8937
+ }
8938
+ ],
8939
+ "responses": {
8940
+ "200": {
8941
+ "description": "Success",
8942
+ "content": {
8943
+ "application/json": {
8944
+ "schema": {
8945
+ "$ref": "#/components/schemas/GeminiCachedContentResource"
8946
+ }
8947
+ }
8948
+ }
8949
+ },
8950
+ "400": {
8951
+ "$ref": "#/components/responses/GeminiResourceError"
8952
+ },
8953
+ "401": {
8954
+ "$ref": "#/components/responses/GeminiResourceError"
8955
+ },
8956
+ "403": {
8957
+ "$ref": "#/components/responses/GeminiResourceError"
8958
+ },
8959
+ "404": {
8960
+ "$ref": "#/components/responses/GeminiResourceError"
8961
+ },
8962
+ "409": {
8963
+ "$ref": "#/components/responses/GeminiResourceError"
8964
+ },
8965
+ "429": {
8966
+ "$ref": "#/components/responses/GeminiResourceError"
8967
+ },
8968
+ "502": {
8969
+ "$ref": "#/components/responses/GeminiResourceError"
8970
+ },
8971
+ "503": {
8972
+ "$ref": "#/components/responses/GeminiResourceError"
8973
+ }
8974
+ }
8975
+ },
8976
+ "patch": {
8977
+ "tags": [
8978
+ "Gemini Resources"
8979
+ ],
8980
+ "operationId": "geminiUpdateCachedContent",
8981
+ "summary": "Update Gemini cached content",
8982
+ "description": "Updates the cache lifetime. Invalid lifetime or unsupported fields return a Gemini-format error. Resources can only be read, referenced, changed, or deleted in their owning Workspace. Missing, expired, or inaccessible resources return a Gemini-format error.",
8983
+ "security": [
8984
+ {
8985
+ "BearerAuth": []
8986
+ },
8987
+ {
8988
+ "GeminiApiKey": []
8989
+ }
8990
+ ],
8991
+ "parameters": [
8992
+ {
8993
+ "name": "cacheId",
8994
+ "in": "path",
8995
+ "required": true,
8996
+ "schema": {
8997
+ "type": "string"
8998
+ }
8999
+ },
9000
+ {
9001
+ "name": "key",
9002
+ "in": "query",
9003
+ "required": false,
9004
+ "schema": {
9005
+ "type": "string"
9006
+ },
9007
+ "description": "API key alternative to Bearer or x-goog-api-key."
9008
+ },
9009
+ {
9010
+ "name": "updateMask",
9011
+ "in": "query",
9012
+ "required": false,
9013
+ "schema": {
9014
+ "type": "string"
9015
+ },
9016
+ "description": "Gemini field mask when required by the service."
9017
+ }
9018
+ ],
9019
+ "responses": {
9020
+ "200": {
9021
+ "description": "Success",
9022
+ "content": {
9023
+ "application/json": {
9024
+ "schema": {
9025
+ "$ref": "#/components/schemas/GeminiCachedContentResource"
9026
+ }
9027
+ }
9028
+ }
9029
+ },
9030
+ "400": {
9031
+ "$ref": "#/components/responses/GeminiResourceError"
9032
+ },
9033
+ "401": {
9034
+ "$ref": "#/components/responses/GeminiResourceError"
9035
+ },
9036
+ "403": {
9037
+ "$ref": "#/components/responses/GeminiResourceError"
9038
+ },
9039
+ "404": {
9040
+ "$ref": "#/components/responses/GeminiResourceError"
9041
+ },
9042
+ "409": {
9043
+ "$ref": "#/components/responses/GeminiResourceError"
9044
+ },
9045
+ "429": {
9046
+ "$ref": "#/components/responses/GeminiResourceError"
9047
+ },
9048
+ "502": {
9049
+ "$ref": "#/components/responses/GeminiResourceError"
9050
+ },
9051
+ "503": {
9052
+ "$ref": "#/components/responses/GeminiResourceError"
9053
+ }
9054
+ },
9055
+ "requestBody": {
9056
+ "required": true,
9057
+ "content": {
9058
+ "application/json": {
9059
+ "schema": {
9060
+ "$ref": "#/components/schemas/GeminiCachedContentUpdateRequest"
9061
+ }
9062
+ }
9063
+ }
9064
+ }
9065
+ },
9066
+ "delete": {
9067
+ "tags": [
9068
+ "Gemini Resources"
9069
+ ],
9070
+ "operationId": "geminiDeleteCachedContent",
9071
+ "summary": "Delete Gemini cached content",
9072
+ "description": "Deletes cached content. It cannot be used by subsequent generation after deletion. Resources can only be read, referenced, changed, or deleted in their owning Workspace. Missing, expired, or inaccessible resources return a Gemini-format error.",
9073
+ "security": [
9074
+ {
9075
+ "BearerAuth": []
9076
+ },
9077
+ {
9078
+ "GeminiApiKey": []
9079
+ }
9080
+ ],
9081
+ "parameters": [
9082
+ {
9083
+ "name": "cacheId",
9084
+ "in": "path",
9085
+ "required": true,
9086
+ "schema": {
9087
+ "type": "string"
9088
+ }
9089
+ },
9090
+ {
9091
+ "name": "key",
9092
+ "in": "query",
9093
+ "required": false,
9094
+ "schema": {
9095
+ "type": "string"
9096
+ },
9097
+ "description": "API key alternative to Bearer or x-goog-api-key."
9098
+ }
9099
+ ],
9100
+ "responses": {
9101
+ "200": {
9102
+ "description": "Success",
9103
+ "content": {
9104
+ "application/json": {
9105
+ "schema": {
9106
+ "type": "object",
9107
+ "additionalProperties": true
9108
+ }
9109
+ }
9110
+ }
9111
+ },
9112
+ "400": {
9113
+ "$ref": "#/components/responses/GeminiResourceError"
9114
+ },
9115
+ "401": {
9116
+ "$ref": "#/components/responses/GeminiResourceError"
9117
+ },
9118
+ "403": {
9119
+ "$ref": "#/components/responses/GeminiResourceError"
9120
+ },
9121
+ "404": {
9122
+ "$ref": "#/components/responses/GeminiResourceError"
9123
+ },
9124
+ "409": {
9125
+ "$ref": "#/components/responses/GeminiResourceError"
9126
+ },
9127
+ "429": {
9128
+ "$ref": "#/components/responses/GeminiResourceError"
9129
+ },
9130
+ "502": {
9131
+ "$ref": "#/components/responses/GeminiResourceError"
9132
+ },
9133
+ "503": {
9134
+ "$ref": "#/components/responses/GeminiResourceError"
9135
+ }
9136
+ }
9137
+ }
9138
+ },
9139
+ "/upload/v1beta/files": {
9140
+ "post": {
9141
+ "tags": [
9142
+ "Gemini Resources"
9143
+ ],
9144
+ "operationId": "geminiUploadFile",
9145
+ "summary": "Upload Gemini file",
9146
+ "description": "Uploads bytes or starts a resumable upload. For resumable start, send metadata and read X-Goog-Upload-URL. Continue only at that returned URL. The upload URL grants access to that upload, expires after one hour, and must be kept private. Resources can only be read, referenced, changed, or deleted in their owning Workspace. Missing, expired, or inaccessible resources return a Gemini-format error.",
9147
+ "security": [
9148
+ {
9149
+ "BearerAuth": []
9150
+ },
9151
+ {
9152
+ "GeminiApiKey": []
9153
+ }
9154
+ ],
9155
+ "parameters": [
9156
+ {
9157
+ "name": "key",
9158
+ "in": "query",
9159
+ "required": false,
9160
+ "schema": {
9161
+ "type": "string"
9162
+ },
9163
+ "description": "API key alternative to Bearer or x-goog-api-key."
9164
+ },
9165
+ {
9166
+ "name": "Idempotency-Key",
9167
+ "in": "header",
9168
+ "required": false,
9169
+ "schema": {
9170
+ "type": "string"
9171
+ },
9172
+ "description": "Reuse the same key and request body when recovering a create response. A different body with the same key returns a conflict."
9173
+ },
9174
+ {
9175
+ "name": "X-Goog-Upload-Protocol",
9176
+ "in": "header",
9177
+ "required": false,
9178
+ "schema": {
9179
+ "type": "string"
9180
+ },
9181
+ "description": "Upload protocol such as resumable."
9182
+ },
9183
+ {
9184
+ "name": "X-Goog-Upload-Command",
9185
+ "in": "header",
9186
+ "required": false,
9187
+ "schema": {
9188
+ "type": "string"
9189
+ },
9190
+ "description": "Upload command such as start or upload, finalize."
9191
+ },
9192
+ {
9193
+ "name": "X-Goog-Upload-Header-Content-Length",
9194
+ "in": "header",
9195
+ "required": false,
9196
+ "schema": {
9197
+ "type": "string"
9198
+ },
9199
+ "description": "Expected file byte length when starting a resumable upload."
9200
+ },
9201
+ {
9202
+ "name": "X-Goog-Upload-Header-Content-Type",
9203
+ "in": "header",
9204
+ "required": false,
9205
+ "schema": {
9206
+ "type": "string"
9207
+ },
9208
+ "description": "File MIME type when starting a resumable upload."
9209
+ }
9210
+ ],
9211
+ "responses": {
9212
+ "200": {
9213
+ "description": "Success",
9214
+ "content": {
9215
+ "application/json": {
9216
+ "schema": {
9217
+ "type": "object",
9218
+ "properties": {
9219
+ "file": {
9220
+ "$ref": "#/components/schemas/GeminiFileResource"
9221
+ }
9222
+ },
9223
+ "additionalProperties": true
9224
+ }
9225
+ }
9226
+ },
9227
+ "headers": {
9228
+ "X-Goog-Upload-URL": {
9229
+ "description": "Private resumable upload URL; returned for resumable start. Use it as supplied.",
9230
+ "schema": {
9231
+ "type": "string",
9232
+ "format": "uri"
9233
+ }
9234
+ }
9235
+ }
9236
+ },
9237
+ "400": {
9238
+ "$ref": "#/components/responses/GeminiResourceError"
9239
+ },
9240
+ "401": {
9241
+ "$ref": "#/components/responses/GeminiResourceError"
9242
+ },
9243
+ "403": {
9244
+ "$ref": "#/components/responses/GeminiResourceError"
9245
+ },
9246
+ "404": {
9247
+ "$ref": "#/components/responses/GeminiResourceError"
9248
+ },
9249
+ "409": {
9250
+ "$ref": "#/components/responses/GeminiResourceError"
9251
+ },
9252
+ "429": {
9253
+ "$ref": "#/components/responses/GeminiResourceError"
9254
+ },
9255
+ "502": {
9256
+ "$ref": "#/components/responses/GeminiResourceError"
9257
+ },
9258
+ "503": {
9259
+ "$ref": "#/components/responses/GeminiResourceError"
9260
+ }
9261
+ },
9262
+ "requestBody": {
9263
+ "required": false,
9264
+ "content": {
9265
+ "application/json": {
9266
+ "schema": {
9267
+ "$ref": "#/components/schemas/GeminiFileCreateRequest"
9268
+ }
9269
+ },
9270
+ "application/octet-stream": {
9271
+ "schema": {
9272
+ "type": "string",
9273
+ "format": "binary"
9274
+ }
9275
+ },
9276
+ "*/*": {
9277
+ "schema": {
9278
+ "type": "string",
9279
+ "format": "binary"
9280
+ }
9281
+ }
9282
+ }
9283
+ },
9284
+ "x-mint": {
9285
+ "metadata": {
9286
+ "playground": "none"
9287
+ }
9288
+ }
9289
+ }
9290
+ },
9291
+ "/upload/v1beta/files/session/{sessionId}": {
9292
+ "post": {
9293
+ "tags": [
9294
+ "Gemini Resources"
9295
+ ],
9296
+ "operationId": "geminiContinueFileUpload",
9297
+ "summary": "Continue Gemini file upload",
9298
+ "description": "Sends bytes or commands to the exact URL returned by resumable start. The session in the URL authorizes this upload; an API key is not required. Keep the URL private. A missing or expired session returns 404; a session that can no longer be continued returns 410. A nonterminal chunk can return 308, so do not treat that response as a page redirect.",
9299
+ "security": [],
9300
+ "parameters": [
9301
+ {
9302
+ "name": "sessionId",
9303
+ "in": "path",
9304
+ "required": true,
9305
+ "schema": {
9306
+ "type": "string"
9307
+ }
9308
+ },
9309
+ {
9310
+ "name": "X-Goog-Upload-Command",
9311
+ "in": "header",
9312
+ "required": false,
9313
+ "schema": {
9314
+ "type": "string"
9315
+ },
9316
+ "description": "Upload command such as upload, finalize."
9317
+ },
9318
+ {
9319
+ "name": "X-Goog-Upload-Offset",
9320
+ "in": "header",
9321
+ "required": false,
9322
+ "schema": {
9323
+ "type": "string"
9324
+ },
9325
+ "description": "Zero-based byte offset of the chunk."
9326
+ }
9327
+ ],
9328
+ "responses": {
9329
+ "200": {
9330
+ "description": "Success",
9331
+ "content": {
9332
+ "application/json": {
9333
+ "schema": {
9334
+ "type": "object",
9335
+ "properties": {
9336
+ "file": {
9337
+ "$ref": "#/components/schemas/GeminiFileResource"
9338
+ }
9339
+ },
9340
+ "additionalProperties": true
9341
+ }
9342
+ }
9343
+ }
9344
+ },
9345
+ "308": {
9346
+ "description": "Upload chunk accepted; more data or finalization is needed."
9347
+ },
9348
+ "400": {
9349
+ "$ref": "#/components/responses/GeminiResourceError"
9350
+ },
9351
+ "401": {
9352
+ "$ref": "#/components/responses/GeminiResourceError"
9353
+ },
9354
+ "403": {
9355
+ "$ref": "#/components/responses/GeminiResourceError"
9356
+ },
9357
+ "404": {
9358
+ "$ref": "#/components/responses/GeminiResourceError"
9359
+ },
9360
+ "409": {
9361
+ "$ref": "#/components/responses/GeminiResourceError"
9362
+ },
9363
+ "410": {
9364
+ "$ref": "#/components/responses/GeminiResourceError"
9365
+ },
9366
+ "429": {
9367
+ "$ref": "#/components/responses/GeminiResourceError"
9368
+ },
9369
+ "502": {
9370
+ "$ref": "#/components/responses/GeminiResourceError"
9371
+ },
9372
+ "503": {
9373
+ "$ref": "#/components/responses/GeminiResourceError"
9374
+ }
9375
+ },
9376
+ "requestBody": {
9377
+ "required": false,
9378
+ "content": {
9379
+ "application/octet-stream": {
9380
+ "schema": {
9381
+ "type": "string",
9382
+ "format": "binary"
9383
+ }
9384
+ },
9385
+ "*/*": {
9386
+ "schema": {
9387
+ "type": "string",
9388
+ "format": "binary"
9389
+ }
9390
+ }
9391
+ }
9392
+ },
9393
+ "x-mint": {
9394
+ "metadata": {
9395
+ "playground": "none"
9396
+ }
9397
+ }
9398
+ }
9399
+ }
9400
+ },
9401
+ "components": {
9402
+ "securitySchemes": {
9403
+ "BearerAuth": {
9404
+ "type": "http",
9405
+ "scheme": "bearer",
9406
+ "bearerFormat": "API Key",
9407
+ "description": "API Key authentication. Create or manage API keys in [Dashboard > API > API Keys](https://tokenlab.sh/dashboard/api?tab=keys)."
9408
+ },
9409
+ "ManagementTokenAuth": {
9410
+ "type": "http",
9411
+ "scheme": "bearer",
9412
+ "bearerFormat": "Management Token",
9413
+ "description": "Management token authentication. Create or manage Management Tokens in [Dashboard > API > Management Tokens](https://tokenlab.sh/dashboard/api?tab=tokens)."
9414
+ },
9415
+ "GeminiApiKey": {
9416
+ "type": "apiKey",
9417
+ "in": "header",
9418
+ "name": "x-goog-api-key",
9419
+ "description": "TokenLab API key for Gemini requests."
9420
+ }
9421
+ },
9422
+ "schemas": {
9423
+ "ChatCompletionRequest": {
9424
+ "type": "object",
9425
+ "required": [
9426
+ "model",
9427
+ "messages"
9428
+ ],
9429
+ "properties": {
9430
+ "model": {
9431
+ "type": "string",
9432
+ "description": "ID of the model to use (e.g., gpt-5.4, claude-sonnet-4-6)",
9433
+ "example": "gpt-4o"
9434
+ },
9435
+ "messages": {
9436
+ "type": "array",
9437
+ "description": "A list of messages comprising the conversation",
9438
+ "items": {
9439
+ "$ref": "#/components/schemas/ChatMessage"
9440
+ },
9441
+ "minItems": 1
9442
+ },
9443
+ "temperature": {
9444
+ "type": "number",
9445
+ "minimum": 0,
9446
+ "maximum": 2,
9447
+ "default": 1,
9448
+ "description": "Sampling temperature (0-2)"
9449
+ },
9450
+ "top_p": {
9451
+ "type": "number",
9452
+ "minimum": 0,
9453
+ "maximum": 1,
9454
+ "default": 1,
9455
+ "description": "Nucleus sampling probability"
9456
+ },
9457
+ "n": {
9458
+ "type": "integer",
9459
+ "minimum": 1,
9460
+ "maximum": 128,
9461
+ "default": 1,
9462
+ "description": "Number of completions to generate"
9463
+ },
9464
+ "stream": {
9465
+ "type": "boolean",
9466
+ "default": false,
9467
+ "description": "If true, returns a stream of events"
9468
+ },
9469
+ "stop": {
9470
+ "oneOf": [
9471
+ {
9472
+ "type": "string"
9473
+ },
9474
+ {
9475
+ "type": "array",
9476
+ "items": {
9477
+ "type": "string"
9478
+ },
9479
+ "maxItems": 4
9480
+ }
9481
+ ],
9482
+ "description": "Stop sequences"
9483
+ },
9484
+ "max_tokens": {
9485
+ "type": "integer",
9486
+ "minimum": 1,
9487
+ "description": "Maximum number of tokens to generate"
9488
+ },
9489
+ "max_completion_tokens": {
9490
+ "type": "integer",
9491
+ "minimum": 1,
9492
+ "description": "Maximum completion tokens for newer reasoning-enabled model families"
9493
+ },
9494
+ "presence_penalty": {
9495
+ "type": "number",
9496
+ "minimum": -2,
9497
+ "maximum": 2,
9498
+ "default": 0,
9499
+ "description": "Presence penalty (-2 to 2)"
9500
+ },
9501
+ "frequency_penalty": {
9502
+ "type": "number",
9503
+ "minimum": -2,
9504
+ "maximum": 2,
9505
+ "default": 0,
9506
+ "description": "Frequency penalty (-2 to 2)"
9507
+ },
9508
+ "tools": {
9509
+ "type": "array",
9510
+ "description": "List of tools the model may call",
9511
+ "items": {
9512
+ "$ref": "#/components/schemas/Tool"
9513
+ }
9514
+ },
9515
+ "functions": {
9516
+ "type": "array",
9517
+ "description": "Deprecated function definitions retained by the official Chat Completions contract.",
9518
+ "items": {
9519
+ "type": "object",
9520
+ "additionalProperties": true
9521
+ }
9522
+ },
9523
+ "function_call": {
9524
+ "oneOf": [
9525
+ {
9526
+ "type": "string"
9527
+ },
9528
+ {
9529
+ "type": "object",
9530
+ "additionalProperties": true
9531
+ }
9532
+ ],
9533
+ "description": "Deprecated function-call selection retained by the official Chat Completions contract."
9534
+ },
9535
+ "tool_choice": {
9536
+ "oneOf": [
9537
+ {
9538
+ "type": "string",
9539
+ "enum": [
9540
+ "none",
9541
+ "auto",
9542
+ "required"
9543
+ ]
9544
+ },
9545
+ {
9546
+ "type": "object",
9547
+ "properties": {
9548
+ "type": {
9549
+ "type": "string",
9550
+ "enum": [
9551
+ "function"
9552
+ ]
9553
+ },
9554
+ "function": {
9555
+ "type": "object",
9556
+ "properties": {
9557
+ "name": {
9558
+ "type": "string"
9559
+ }
9560
+ },
9561
+ "required": [
9562
+ "name"
9563
+ ]
9564
+ }
9565
+ },
9566
+ "required": [
9567
+ "type",
9568
+ "function"
9569
+ ]
9570
+ }
9571
+ ],
9572
+ "description": "Controls which function is called"
9573
+ },
9574
+ "response_format": {
9575
+ "type": "object",
9576
+ "properties": {
9577
+ "type": {
9578
+ "type": "string",
9579
+ "enum": [
9580
+ "text",
9581
+ "json_object"
9582
+ ]
9583
+ }
9584
+ },
9585
+ "description": "Response format specification"
9586
+ },
9587
+ "seed": {
9588
+ "type": "integer",
9589
+ "description": "Seed for deterministic generation"
9590
+ },
9591
+ "user": {
9592
+ "type": "string",
9593
+ "description": "End-user identifier for abuse detection"
8451
9594
  },
8452
9595
  "stream_options": {
8453
9596
  "type": "object",
@@ -8511,14 +9654,14 @@
8511
9654
  "prediction": {
8512
9655
  "type": "object",
8513
9656
  "additionalProperties": true,
8514
- "description": "Prediction hints for providers that support draft or speculative decoding."
9657
+ "description": "Prediction hints for models that support draft or speculative decoding."
8515
9658
  },
8516
9659
  "service_tier": {
8517
9660
  "type": [
8518
9661
  "string",
8519
9662
  "null"
8520
9663
  ],
8521
- "description": "Service tier hint for compatible providers."
9664
+ "description": "Service tier hint where supported by the model."
8522
9665
  }
8523
9666
  },
8524
9667
  "additionalProperties": true
@@ -9098,7 +10241,7 @@
9098
10241
  },
9099
10242
  "quality": {
9100
10243
  "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."
10244
+ "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
10245
  },
9103
10246
  "style": {
9104
10247
  "type": "string",
@@ -9112,6 +10255,10 @@
9112
10255
  "type": "boolean",
9113
10256
  "description": "Ask compatible models to expand or enhance the prompt."
9114
10257
  },
10258
+ "prompt_extend": {
10259
+ "type": "boolean",
10260
+ "description": "For z-image-turbo, enable prompt expansion. Defaults to false. Enabling it uses the model's prompt-expansion price."
10261
+ },
9115
10262
  "negative_prompt": {
9116
10263
  "type": "string",
9117
10264
  "description": "Content to avoid for compatible image models."
@@ -9242,6 +10389,10 @@
9242
10389
  "expand_prompt": {
9243
10390
  "type": "boolean"
9244
10391
  },
10392
+ "prompt_extend": {
10393
+ "type": "boolean",
10394
+ "description": "For z-image-turbo, enable prompt expansion. Defaults to false. Enabling it uses the model's prompt-expansion price."
10395
+ },
9245
10396
  "negative_prompt": {
9246
10397
  "type": "string"
9247
10398
  },
@@ -9338,6 +10489,24 @@
9338
10489
  }
9339
10490
  }
9340
10491
  }
10492
+ },
10493
+ "task_id": {
10494
+ "type": "string",
10495
+ "description": "Task ID when the request runs as a task."
10496
+ },
10497
+ "status": {
10498
+ "type": "string",
10499
+ "description": "Task status when the request runs as a task."
10500
+ },
10501
+ "poll_url": {
10502
+ "type": "string",
10503
+ "description": "URL to poll for the task result."
10504
+ },
10505
+ "error": {
10506
+ "$ref": "#/components/schemas/AsyncTaskError"
10507
+ },
10508
+ "error_details": {
10509
+ "$ref": "#/components/schemas/AsyncTaskErrorDetails"
9341
10510
  }
9342
10511
  },
9343
10512
  "required": [
@@ -9380,11 +10549,11 @@
9380
10549
  "additionalProperties": false
9381
10550
  }
9382
10551
  ],
9383
- "description": "Voice selector for OpenAI-compatible, Gemini, xAI, and MiniMax-compatible routes. Some MiniMax routes also accept voice_id."
10552
+ "description": "Voice selector for OpenAI-compatible, Gemini, xAI, and MiniMax-compatible speech models. Some MiniMax models also accept voice_id."
9384
10553
  },
9385
10554
  "voice_id": {
9386
10555
  "type": "string",
9387
- "description": "Provider-native voice selector for MiniMax-compatible speech models."
10556
+ "description": "Voice selector for MiniMax-compatible speech models."
9388
10557
  },
9389
10558
  "instructions": {
9390
10559
  "type": "string",
@@ -9398,7 +10567,7 @@
9398
10567
  },
9399
10568
  "language_code": {
9400
10569
  "type": "string",
9401
- "description": "Optional language code for Gemini, xAI, and compatible TTS routes.",
10570
+ "description": "Optional language code for Gemini, xAI, and compatible TTS models.",
9402
10571
  "example": "en-US"
9403
10572
  },
9404
10573
  "response_format": {
@@ -9425,7 +10594,7 @@
9425
10594
  "type": "number",
9426
10595
  "minimum": 0,
9427
10596
  "maximum": 2,
9428
- "description": "Sampling temperature for Gemini-compatible TTS routes."
10597
+ "description": "Sampling temperature for Gemini-compatible TTS models."
9429
10598
  }
9430
10599
  },
9431
10600
  "additionalProperties": false
@@ -9619,7 +10788,7 @@
9619
10788
  },
9620
10789
  "output_audio": {
9621
10790
  "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."
10791
+ "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
10792
  },
9624
10793
  "fps": {
9625
10794
  "type": "integer",
@@ -9742,7 +10911,7 @@
9742
10911
  "audio_url": {
9743
10912
  "type": "string",
9744
10913
  "format": "uri",
9745
- "description": "Publicly reachable audio URL for model-specific audio-conditioned video flows."
10914
+ "description": "Public audio URL for an audio-driven or reference-audio operation supported by the selected model."
9746
10915
  },
9747
10916
  "task_id": {
9748
10917
  "type": "string",
@@ -9777,7 +10946,7 @@
9777
10946
  },
9778
10947
  "video_urls": {
9779
10948
  "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.",
10949
+ "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
10950
  "minItems": 1,
9782
10951
  "maxItems": 10,
9783
10952
  "items": {
@@ -9787,7 +10956,7 @@
9787
10956
  },
9788
10957
  "audio_urls": {
9789
10958
  "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.",
10959
+ "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
10960
  "minItems": 1,
9792
10961
  "maxItems": 10,
9793
10962
  "items": {
@@ -9860,11 +11029,27 @@
9860
11029
  "draft": {
9861
11030
  "type": "boolean",
9862
11031
  "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."
11032
+ "description": "Seedance 1.5 Pro draft workflow flag. Only supported by Seedance models supporting drafts; draft=true creates a low-cost draft task."
9864
11033
  },
9865
11034
  "draft_task_id": {
9866
11035
  "type": "string",
9867
11036
  "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."
11037
+ },
11038
+ "audio": {
11039
+ "type": "boolean",
11040
+ "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."
11041
+ },
11042
+ "bgm": {
11043
+ "type": "boolean",
11044
+ "description": "Optional audio control. Accepted only when declared by the selected model and operation; availability may differ by operation."
11045
+ },
11046
+ "audio_type": {
11047
+ "type": "string",
11048
+ "description": "Optional audio control. Accepted only when declared by the selected model and operation; availability may differ by operation."
11049
+ },
11050
+ "voice_id": {
11051
+ "type": "string",
11052
+ "description": "Optional audio control. Accepted only when declared by the selected model and operation; availability may differ by operation."
9868
11053
  }
9869
11054
  }
9870
11055
  },
@@ -9910,15 +11095,10 @@
9910
11095
  }
9911
11096
  },
9912
11097
  "error": {
9913
- "type": "object",
9914
- "properties": {
9915
- "code": {
9916
- "type": "string"
9917
- },
9918
- "message": {
9919
- "type": "string"
9920
- }
9921
- }
11098
+ "$ref": "#/components/schemas/AsyncTaskError"
11099
+ },
11100
+ "error_details": {
11101
+ "$ref": "#/components/schemas/AsyncTaskErrorDetails"
9922
11102
  },
9923
11103
  "task_id": {
9924
11104
  "type": "string",
@@ -10037,6 +11217,9 @@
10037
11217
  }
10038
11218
  ]
10039
11219
  },
11220
+ "error_details": {
11221
+ "$ref": "#/components/schemas/AsyncTaskErrorDetails"
11222
+ },
10040
11223
  "task_id": {
10041
11224
  "type": "string"
10042
11225
  },
@@ -10918,7 +12101,7 @@
10918
12101
  },
10919
12102
  "service_tier": {
10920
12103
  "type": "string",
10921
- "description": "Service tier hint for compatible providers."
12104
+ "description": "Service tier hint where supported by the model."
10922
12105
  }
10923
12106
  }
10924
12107
  },
@@ -11244,7 +12427,7 @@
11244
12427
  },
11245
12428
  "responseModalities": {
11246
12429
  "type": "array",
11247
- "description": "Requested output modalities for compatible native Gemini routes.",
12430
+ "description": "Requested output modalities for supported Gemini models.",
11248
12431
  "items": {
11249
12432
  "type": "string"
11250
12433
  }
@@ -12188,7 +13371,7 @@
12188
13371
  "example": 1741425600
12189
13372
  }
12190
13373
  },
12191
- "description": "File metadata. Batch files include status; image/reference files may omit status depending on the upstream file provider."
13374
+ "description": "File metadata. Batch files include status; image/reference files may omit status depending on the file purpose."
12192
13375
  },
12193
13376
  "FileListResponse": {
12194
13377
  "type": "object",
@@ -13006,7 +14189,7 @@
13006
14189
  },
13007
14190
  "AnthropicMessageBatch": {
13008
14191
  "type": "object",
13009
- "description": "Anthropic-compatible message batch object relayed from the provider.",
14192
+ "description": "Anthropic-compatible message batch object.",
13010
14193
  "required": [
13011
14194
  "id",
13012
14195
  "type",
@@ -13039,7 +14222,7 @@
13039
14222
  "request_counts": {
13040
14223
  "type": "object",
13041
14224
  "additionalProperties": true,
13042
- "description": "Upstream request count summary for the batch"
14225
+ "description": "Request count summary for the batch"
13043
14226
  },
13044
14227
  "ended_at": {
13045
14228
  "type": [
@@ -13075,7 +14258,7 @@
13075
14258
  "string",
13076
14259
  "null"
13077
14260
  ],
13078
- "description": "Upstream results URL, when available"
14261
+ "description": "Results URL, when available"
13079
14262
  }
13080
14263
  },
13081
14264
  "additionalProperties": true
@@ -13272,7 +14455,7 @@
13272
14455
  },
13273
14456
  "ModelListTokenLabExtension": {
13274
14457
  "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.",
14458
+ "description": "TokenLab model discovery fields. Use the model details endpoint for the full supported request and pricing contract.",
13276
14459
  "properties": {
13277
14460
  "aliases": {
13278
14461
  "type": "array",
@@ -13396,14 +14579,14 @@
13396
14579
  "deprecated",
13397
14580
  "retired"
13398
14581
  ],
13399
- "description": "Provider lifecycle stage for public discovery and display."
14582
+ "description": "Model lifecycle stage for public discovery and display."
13400
14583
  },
13401
14584
  "reason": {
13402
14585
  "type": [
13403
14586
  "string",
13404
14587
  "null"
13405
14588
  ],
13406
- "description": "Short lifecycle reason or provider note."
14589
+ "description": "Short model lifecycle explanation."
13407
14590
  },
13408
14591
  "replacement_model": {
13409
14592
  "type": [
@@ -13718,14 +14901,14 @@
13718
14901
  "deprecated",
13719
14902
  "retired"
13720
14903
  ],
13721
- "description": "Provider lifecycle stage for public discovery and display."
14904
+ "description": "Model lifecycle stage for public discovery and display."
13722
14905
  },
13723
14906
  "reason": {
13724
14907
  "type": [
13725
14908
  "string",
13726
14909
  "null"
13727
14910
  ],
13728
- "description": "Short lifecycle reason or provider note."
14911
+ "description": "Short model lifecycle explanation."
13729
14912
  },
13730
14913
  "replacement_model": {
13731
14914
  "type": [
@@ -14253,6 +15436,61 @@
14253
15436
  "items": {
14254
15437
  "type": "string"
14255
15438
  }
15439
+ },
15440
+ "parameter_options": {
15441
+ "type": "object",
15442
+ "additionalProperties": {
15443
+ "type": "array",
15444
+ "items": {
15445
+ "type": [
15446
+ "string",
15447
+ "number",
15448
+ "boolean"
15449
+ ]
15450
+ }
15451
+ }
15452
+ },
15453
+ "parameter_value_constraints": {
15454
+ "type": "object",
15455
+ "additionalProperties": {
15456
+ "type": "object",
15457
+ "properties": {
15458
+ "enum": {
15459
+ "type": "array",
15460
+ "items": {
15461
+ "type": [
15462
+ "string",
15463
+ "boolean"
15464
+ ]
15465
+ }
15466
+ },
15467
+ "enumCaseInsensitive": {
15468
+ "type": "boolean"
15469
+ },
15470
+ "maxItems": {
15471
+ "type": "integer"
15472
+ },
15473
+ "maxInteger": {
15474
+ "type": "integer"
15475
+ },
15476
+ "when": {
15477
+ "type": "object",
15478
+ "properties": {
15479
+ "parameter": {
15480
+ "type": "string"
15481
+ },
15482
+ "equals": {
15483
+ "type": [
15484
+ "string",
15485
+ "boolean"
15486
+ ]
15487
+ }
15488
+ },
15489
+ "additionalProperties": false
15490
+ }
15491
+ },
15492
+ "additionalProperties": false
15493
+ }
14256
15494
  }
14257
15495
  },
14258
15496
  "additionalProperties": false
@@ -14675,7 +15913,7 @@
14675
15913
  "minimum": -1,
14676
15914
  "maximum": 4294967295,
14677
15915
  "default": -1,
14678
- "description": "Random seed. -1 lets the model choose a seed. Forwarded on a best-effort basis for routes that accept it."
15916
+ "description": "Random seed. -1 lets the model choose a seed. Accepted on a best-effort basis where supported by the model."
14679
15917
  },
14680
15918
  "execution_expires_after": {
14681
15919
  "type": "integer",
@@ -15859,126 +17097,460 @@
15859
17097
  "additionalProperties": false
15860
17098
  }
15861
17099
  },
15862
- "pagination": {
17100
+ "pagination": {
17101
+ "type": "object",
17102
+ "required": [
17103
+ "page",
17104
+ "limit",
17105
+ "total",
17106
+ "total_pages"
17107
+ ],
17108
+ "properties": {
17109
+ "page": {
17110
+ "type": "integer"
17111
+ },
17112
+ "limit": {
17113
+ "type": "integer"
17114
+ },
17115
+ "total": {
17116
+ "type": "integer"
17117
+ },
17118
+ "total_pages": {
17119
+ "type": "integer"
17120
+ }
17121
+ },
17122
+ "additionalProperties": false
17123
+ }
17124
+ },
17125
+ "additionalProperties": false
17126
+ },
17127
+ "DeletedWebhookEndpoint": {
17128
+ "type": "object",
17129
+ "required": [
17130
+ "id",
17131
+ "object",
17132
+ "deleted"
17133
+ ],
17134
+ "properties": {
17135
+ "id": {
17136
+ "type": "string"
17137
+ },
17138
+ "object": {
17139
+ "type": "string",
17140
+ "enum": [
17141
+ "webhook_endpoint"
17142
+ ]
17143
+ },
17144
+ "deleted": {
17145
+ "type": "boolean",
17146
+ "const": true
17147
+ }
17148
+ },
17149
+ "additionalProperties": false
17150
+ },
17151
+ "CreateWebhookEndpointRequest": {
17152
+ "type": "object",
17153
+ "additionalProperties": false,
17154
+ "required": [
17155
+ "url",
17156
+ "events"
17157
+ ],
17158
+ "properties": {
17159
+ "url": {
17160
+ "type": "string",
17161
+ "format": "uri",
17162
+ "description": "Public HTTPS receiver URL. Credentials, query strings, fragments, private or reserved network targets and redirects are rejected."
17163
+ },
17164
+ "events": {
17165
+ "type": "array",
17166
+ "minItems": 1,
17167
+ "maxItems": 10,
17168
+ "items": {
17169
+ "type": "string",
17170
+ "enum": [
17171
+ "task.completed",
17172
+ "task.failed",
17173
+ "task.timeout"
17174
+ ]
17175
+ },
17176
+ "description": "Supported event subscriptions; duplicates are removed."
17177
+ },
17178
+ "description": {
17179
+ "type": "string",
17180
+ "maxLength": 200
17181
+ }
17182
+ }
17183
+ },
17184
+ "UpdateWebhookEndpointRequest": {
17185
+ "type": "object",
17186
+ "additionalProperties": false,
17187
+ "minProperties": 1,
17188
+ "properties": {
17189
+ "url": {
17190
+ "type": "string",
17191
+ "format": "uri",
17192
+ "description": "Public HTTPS receiver URL. Credentials, query strings, fragments, private or reserved network targets and redirects are rejected."
17193
+ },
17194
+ "events": {
17195
+ "type": "array",
17196
+ "minItems": 1,
17197
+ "maxItems": 10,
17198
+ "items": {
17199
+ "type": "string",
17200
+ "enum": [
17201
+ "task.completed",
17202
+ "task.failed",
17203
+ "task.timeout"
17204
+ ]
17205
+ },
17206
+ "description": "Supported event subscriptions; duplicates are removed."
17207
+ },
17208
+ "description": {
17209
+ "type": [
17210
+ "string",
17211
+ "null"
17212
+ ],
17213
+ "maxLength": 200
17214
+ },
17215
+ "is_active": {
17216
+ "type": "boolean",
17217
+ "description": "Resume or pause delivery. Resuming resets the consecutive failure count."
17218
+ }
17219
+ }
17220
+ },
17221
+ "TaskTimeoutWebhook": {
17222
+ "type": "object",
17223
+ "required": [
17224
+ "id",
17225
+ "type",
17226
+ "created",
17227
+ "data"
17228
+ ],
17229
+ "properties": {
17230
+ "id": {
17231
+ "type": "string",
17232
+ "description": "Stable event ID for deduplication at the receiving endpoint."
17233
+ },
17234
+ "type": {
17235
+ "type": "string",
17236
+ "enum": [
17237
+ "task.timeout"
17238
+ ]
17239
+ },
17240
+ "created": {
17241
+ "type": "integer",
17242
+ "description": "Event creation time in Unix seconds."
17243
+ },
17244
+ "data": {
17245
+ "type": "object",
17246
+ "required": [
17247
+ "taskType",
17248
+ "taskId",
17249
+ "expectedTimeoutMs",
17250
+ "actualWaitMs"
17251
+ ],
17252
+ "properties": {
17253
+ "taskType": {
17254
+ "type": "string",
17255
+ "enum": [
17256
+ "video",
17257
+ "music",
17258
+ "3d",
17259
+ "world",
17260
+ "image",
17261
+ "audio"
17262
+ ]
17263
+ },
17264
+ "taskId": {
17265
+ "type": "string"
17266
+ },
17267
+ "expectedTimeoutMs": {
17268
+ "type": "integer",
17269
+ "minimum": 0,
17270
+ "description": "Expected timeout threshold in milliseconds."
17271
+ },
17272
+ "actualWaitMs": {
17273
+ "type": "integer",
17274
+ "minimum": 0,
17275
+ "description": "Actual elapsed wait in milliseconds."
17276
+ },
17277
+ "refundIssued": {
17278
+ "type": "boolean",
17279
+ "description": "True if the refund succeeded or had already been issued. False does not rule out a later refund."
17280
+ },
17281
+ "resolutionSource": {
17282
+ "type": "string",
17283
+ "enum": [
17284
+ "callback",
17285
+ "status_query",
17286
+ "background_poller",
17287
+ "timeout_detector",
17288
+ "create_response"
17289
+ ]
17290
+ },
17291
+ "refundOutcome": {
17292
+ "type": "string",
17293
+ "enum": [
17294
+ "success",
17295
+ "already_refunded",
17296
+ "not_applicable",
17297
+ "failed_persisted",
17298
+ "failed_unrecoverable"
17299
+ ],
17300
+ "description": "Refund processing result at event creation."
17301
+ }
17302
+ },
17303
+ "description": "Timeout event data. This event does not contain durationMs."
17304
+ }
17305
+ }
17306
+ },
17307
+ "AsyncTaskUpstreamError": {
17308
+ "type": "object",
17309
+ "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`.",
17310
+ "required": [
17311
+ "message"
17312
+ ],
17313
+ "properties": {
17314
+ "source": {
17315
+ "type": "string",
17316
+ "description": "Upstream service name, when known."
17317
+ },
17318
+ "code": {
17319
+ "type": "string"
17320
+ },
17321
+ "message": {
17322
+ "type": "string"
17323
+ },
17324
+ "param": {
17325
+ "type": "string"
17326
+ }
17327
+ },
17328
+ "additionalProperties": false
17329
+ },
17330
+ "AsyncTaskErrorDetails": {
17331
+ "type": "object",
17332
+ "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.",
17333
+ "required": [
17334
+ "status",
17335
+ "message",
17336
+ "type",
17337
+ "code",
17338
+ "retryable"
17339
+ ],
17340
+ "properties": {
17341
+ "projection_version": {
17342
+ "type": "integer",
17343
+ "description": "`2` means `message` is the final reason for the failure."
17344
+ },
17345
+ "status": {
17346
+ "type": "integer",
17347
+ "minimum": 400,
17348
+ "maximum": 599
17349
+ },
17350
+ "message": {
17351
+ "type": "string"
17352
+ },
17353
+ "type": {
17354
+ "type": "string"
17355
+ },
17356
+ "code": {
17357
+ "type": "string"
17358
+ },
17359
+ "param": {
17360
+ "type": "string",
17361
+ "description": "The request field at fault, omitted when no specific field is known."
17362
+ },
17363
+ "retryable": {
17364
+ "type": "boolean"
17365
+ },
17366
+ "upstream": {
17367
+ "$ref": "#/components/schemas/AsyncTaskUpstreamError"
17368
+ }
17369
+ },
17370
+ "additionalProperties": false
17371
+ },
17372
+ "AsyncTaskError": {
17373
+ "description": "Why the task failed: a string, or an object with `message` and, when known, `type`, `code`, `param` and `retryable`.",
17374
+ "oneOf": [
17375
+ {
17376
+ "type": "string"
17377
+ },
17378
+ {
15863
17379
  "type": "object",
15864
17380
  "required": [
15865
- "page",
15866
- "limit",
15867
- "total",
15868
- "total_pages"
17381
+ "message"
15869
17382
  ],
15870
17383
  "properties": {
15871
- "page": {
15872
- "type": "integer"
17384
+ "message": {
17385
+ "type": "string"
15873
17386
  },
15874
- "limit": {
15875
- "type": "integer"
17387
+ "type": {
17388
+ "type": "string"
15876
17389
  },
15877
- "total": {
15878
- "type": "integer"
17390
+ "code": {
17391
+ "type": "string"
15879
17392
  },
15880
- "total_pages": {
15881
- "type": "integer"
17393
+ "param": {
17394
+ "type": "string"
17395
+ },
17396
+ "retryable": {
17397
+ "type": "boolean"
15882
17398
  }
15883
17399
  },
15884
17400
  "additionalProperties": false
15885
17401
  }
15886
- },
15887
- "additionalProperties": false
17402
+ ]
15888
17403
  },
15889
- "DeletedWebhookEndpoint": {
17404
+ "GeminiFileResource": {
15890
17405
  "type": "object",
15891
- "required": [
15892
- "id",
15893
- "object",
15894
- "deleted"
15895
- ],
17406
+ "description": "A Gemini file in the current Workspace. Fields are returned when available.",
15896
17407
  "properties": {
15897
- "id": {
15898
- "type": "string"
17408
+ "name": {
17409
+ "type": "string",
17410
+ "description": "File resource name such as files/{fileId}."
15899
17411
  },
15900
- "object": {
17412
+ "displayName": {
15901
17413
  "type": "string",
15902
- "enum": [
15903
- "webhook_endpoint"
15904
- ]
17414
+ "description": "Human-readable file name."
15905
17415
  },
15906
- "deleted": {
15907
- "type": "boolean",
15908
- "const": true
17416
+ "mimeType": {
17417
+ "type": "string",
17418
+ "description": "Media MIME type."
17419
+ },
17420
+ "sizeBytes": {
17421
+ "type": "string",
17422
+ "description": "File byte size as a decimal string."
17423
+ },
17424
+ "uri": {
17425
+ "type": "string",
17426
+ "description": "File URI to use in Gemini content parts."
17427
+ },
17428
+ "state": {
17429
+ "type": "string",
17430
+ "description": "Processing state reported by the service. Wait until the file is ready before generation."
17431
+ },
17432
+ "createTime": {
17433
+ "type": "string",
17434
+ "format": "date-time"
17435
+ },
17436
+ "updateTime": {
17437
+ "type": "string",
17438
+ "format": "date-time"
17439
+ },
17440
+ "expirationTime": {
17441
+ "type": "string",
17442
+ "format": "date-time"
17443
+ },
17444
+ "error": {
17445
+ "type": "object",
17446
+ "additionalProperties": true
15909
17447
  }
15910
17448
  },
15911
- "additionalProperties": false
17449
+ "additionalProperties": true
15912
17450
  },
15913
- "CreateWebhookEndpointRequest": {
17451
+ "GeminiFileCreateRequest": {
17452
+ "type": "object",
17453
+ "description": "Gemini file metadata request. Supported fields and values are validated by the service. File bytes are uploaded through /upload/v1beta/files.",
17454
+ "properties": {
17455
+ "file": {
17456
+ "$ref": "#/components/schemas/GeminiFileResource"
17457
+ }
17458
+ },
17459
+ "additionalProperties": true
17460
+ },
17461
+ "GeminiFileRegisterRequest": {
17462
+ "type": "object",
17463
+ "description": "Gemini file registration request. Use only sources and fields accepted by the service; registration does not upload local bytes.",
17464
+ "additionalProperties": true
17465
+ },
17466
+ "GeminiCachedContentRequest": {
15914
17467
  "type": "object",
15915
- "additionalProperties": false,
15916
17468
  "required": [
15917
- "url",
15918
- "events"
17469
+ "model"
15919
17470
  ],
15920
17471
  "properties": {
15921
- "url": {
17472
+ "model": {
15922
17473
  "type": "string",
15923
- "format": "uri",
15924
- "description": "Public HTTPS receiver URL. Credentials, query strings, fragments, private or reserved network targets and redirects are rejected."
17474
+ "minLength": 1,
17475
+ "description": "Current TokenLab model ID that supports Gemini cached content."
15925
17476
  },
15926
- "events": {
15927
- "type": "array",
15928
- "minItems": 1,
15929
- "maxItems": 10,
15930
- "items": {
15931
- "type": "string",
15932
- "enum": [
15933
- "task.completed",
15934
- "task.failed",
15935
- "task.timeout"
15936
- ]
15937
- },
15938
- "description": "Supported event subscriptions; duplicates are removed."
17477
+ "displayName": {
17478
+ "type": "string",
17479
+ "description": "Human-readable cache name."
15939
17480
  },
15940
- "description": {
17481
+ "ttl": {
15941
17482
  "type": "string",
15942
- "maxLength": 200
17483
+ "description": "Positive duration such as 3600s. Supported lifetime is validated by the service."
17484
+ },
17485
+ "expireTime": {
17486
+ "type": "string",
17487
+ "format": "date-time",
17488
+ "description": "Requested expiration time; use ttl or expireTime as supported by the service."
17489
+ },
17490
+ "contents": {
17491
+ "$ref": "#/components/schemas/GeminiRequest/properties/contents"
17492
+ },
17493
+ "systemInstruction": {
17494
+ "$ref": "#/components/schemas/GeminiRequest/properties/systemInstruction"
17495
+ },
17496
+ "tools": {
17497
+ "$ref": "#/components/schemas/GeminiRequest/properties/tools"
17498
+ },
17499
+ "toolConfig": {
17500
+ "$ref": "#/components/schemas/GeminiRequest/properties/toolConfig"
15943
17501
  }
15944
- }
17502
+ },
17503
+ "additionalProperties": true
15945
17504
  },
15946
- "UpdateWebhookEndpointRequest": {
17505
+ "GeminiCachedContentResource": {
15947
17506
  "type": "object",
15948
- "additionalProperties": false,
15949
- "minProperties": 1,
17507
+ "description": "Cached content belonging to the current Workspace. Use the returned name as cachedContent in Gemini generation.",
15950
17508
  "properties": {
15951
- "url": {
17509
+ "name": {
15952
17510
  "type": "string",
15953
- "format": "uri",
15954
- "description": "Public HTTPS receiver URL. Credentials, query strings, fragments, private or reserved network targets and redirects are rejected."
17511
+ "description": "Resource name such as cachedContents/{cacheId}."
15955
17512
  },
15956
- "events": {
15957
- "type": "array",
15958
- "minItems": 1,
15959
- "maxItems": 10,
15960
- "items": {
15961
- "type": "string",
15962
- "enum": [
15963
- "task.completed",
15964
- "task.failed",
15965
- "task.timeout"
15966
- ]
15967
- },
15968
- "description": "Supported event subscriptions; duplicates are removed."
17513
+ "model": {
17514
+ "type": "string",
17515
+ "description": "TokenLab model ID associated with the cached content."
15969
17516
  },
15970
- "description": {
15971
- "type": [
15972
- "string",
15973
- "null"
15974
- ],
15975
- "maxLength": 200
17517
+ "displayName": {
17518
+ "type": "string",
17519
+ "description": "Human-readable cache name."
15976
17520
  },
15977
- "is_active": {
15978
- "type": "boolean",
15979
- "description": "Resume or pause delivery. Resuming resets the consecutive failure count."
17521
+ "createTime": {
17522
+ "type": "string",
17523
+ "format": "date-time"
17524
+ },
17525
+ "updateTime": {
17526
+ "type": "string",
17527
+ "format": "date-time"
17528
+ },
17529
+ "expireTime": {
17530
+ "type": "string",
17531
+ "format": "date-time"
17532
+ },
17533
+ "usageMetadata": {
17534
+ "type": "object",
17535
+ "additionalProperties": true
15980
17536
  }
15981
- }
17537
+ },
17538
+ "additionalProperties": true
17539
+ },
17540
+ "GeminiCachedContentUpdateRequest": {
17541
+ "type": "object",
17542
+ "description": "Update cached content lifetime using the fields accepted by the service.",
17543
+ "properties": {
17544
+ "ttl": {
17545
+ "type": "string",
17546
+ "description": "Positive duration such as 3600s."
17547
+ },
17548
+ "expireTime": {
17549
+ "type": "string",
17550
+ "format": "date-time"
17551
+ }
17552
+ },
17553
+ "additionalProperties": true
15982
17554
  }
15983
17555
  },
15984
17556
  "responses": {
@@ -16090,7 +17662,7 @@
16090
17662
  }
16091
17663
  },
16092
17664
  "UpstreamError": {
16093
- "description": "Upstream Provider Error",
17665
+ "description": "Service Error",
16094
17666
  "content": {
16095
17667
  "application/json": {
16096
17668
  "schema": {
@@ -16098,7 +17670,7 @@
16098
17670
  },
16099
17671
  "example": {
16100
17672
  "error": {
16101
- "message": "Upstream provider returned an error",
17673
+ "message": "The service could not complete the request",
16102
17674
  "type": "upstream_error"
16103
17675
  }
16104
17676
  }
@@ -16106,7 +17678,7 @@
16106
17678
  }
16107
17679
  },
16108
17680
  "AllChannelsFailed": {
16109
- "description": "All Channels Failed",
17681
+ "description": "Service Unavailable",
16110
17682
  "content": {
16111
17683
  "application/json": {
16112
17684
  "schema": {
@@ -16114,7 +17686,7 @@
16114
17686
  },
16115
17687
  "example": {
16116
17688
  "error": {
16117
- "message": "All available channels failed to process the request",
17689
+ "message": "The service is temporarily unable to process this request",
16118
17690
  "type": "all_channels_failed"
16119
17691
  }
16120
17692
  }
@@ -16171,7 +17743,7 @@
16171
17743
  }
16172
17744
  },
16173
17745
  "DeliveryUnavailable": {
16174
- "description": "No eligible Delivery route is currently available, or all eligible routes failed.",
17746
+ "description": "The requested Delivery tier is temporarily unavailable.",
16175
17747
  "content": {
16176
17748
  "application/json": {
16177
17749
  "schema": {
@@ -16179,7 +17751,7 @@
16179
17751
  },
16180
17752
  "examples": {
16181
17753
  "requestedTierUnavailable": {
16182
- "summary": "The requested Delivery tier has no eligible route",
17754
+ "summary": "The requested Delivery tier is unavailable",
16183
17755
  "value": {
16184
17756
  "error": {
16185
17757
  "message": "The requested Delivery tier is temporarily unavailable for model gpt-5.4.",
@@ -16191,7 +17763,7 @@
16191
17763
  }
16192
17764
  },
16193
17765
  "eligibleRoutesFailed": {
16194
- "summary": "All eligible Delivery routes failed",
17766
+ "summary": "The requested Delivery tier could not complete this request",
16195
17767
  "value": {
16196
17768
  "error": {
16197
17769
  "message": "All available routes failed to process the request.",
@@ -16204,6 +17776,16 @@
16204
17776
  }
16205
17777
  }
16206
17778
  }
17779
+ },
17780
+ "GeminiResourceError": {
17781
+ "description": "Gemini-format resource error",
17782
+ "content": {
17783
+ "application/json": {
17784
+ "schema": {
17785
+ "$ref": "#/components/schemas/GeminiErrorResponse"
17786
+ }
17787
+ }
17788
+ }
16207
17789
  }
16208
17790
  },
16209
17791
  "parameters": {
@@ -16211,7 +17793,7 @@
16211
17793
  "name": "X-TokenLab-Delivery-Policy",
16212
17794
  "in": "header",
16213
17795
  "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.",
17796
+ "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
17797
  "schema": {
16216
17798
  "type": "string",
16217
17799
  "enum": [
@@ -16222,5 +17804,78 @@
16222
17804
  }
16223
17805
  }
16224
17806
  }
17807
+ },
17808
+ "webhooks": {
17809
+ "taskTimeout": {
17810
+ "post": {
17811
+ "tags": [
17812
+ "Webhooks"
17813
+ ],
17814
+ "summary": "Task timeout notification",
17815
+ "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.",
17816
+ "operationId": "receiveTaskTimeoutWebhook",
17817
+ "security": [],
17818
+ "parameters": [
17819
+ {
17820
+ "in": "header",
17821
+ "name": "X-Webhook-ID",
17822
+ "required": true,
17823
+ "schema": {
17824
+ "type": "string"
17825
+ },
17826
+ "description": "Matches the event id in the request body."
17827
+ },
17828
+ {
17829
+ "in": "header",
17830
+ "name": "X-Webhook-Timestamp",
17831
+ "required": true,
17832
+ "schema": {
17833
+ "type": "string",
17834
+ "pattern": "^[0-9]+$"
17835
+ },
17836
+ "description": "Delivery attempt timestamp in Unix seconds."
17837
+ },
17838
+ {
17839
+ "in": "header",
17840
+ "name": "X-Webhook-Signature",
17841
+ "required": true,
17842
+ "schema": {
17843
+ "type": "string",
17844
+ "pattern": "^sha256=[a-f0-9]{64}$"
17845
+ },
17846
+ "description": "HMAC-SHA256 signature using the complete whsec_ signing secret."
17847
+ }
17848
+ ],
17849
+ "requestBody": {
17850
+ "required": true,
17851
+ "content": {
17852
+ "application/json": {
17853
+ "schema": {
17854
+ "$ref": "#/components/schemas/TaskTimeoutWebhook"
17855
+ },
17856
+ "example": {
17857
+ "id": "event-unique-id",
17858
+ "type": "task.timeout",
17859
+ "created": 1790000000,
17860
+ "data": {
17861
+ "taskType": "image",
17862
+ "taskId": "ldtask_0123456789abcdef0123456789abcdef",
17863
+ "expectedTimeoutMs": 1800000,
17864
+ "actualWaitMs": 1801000,
17865
+ "refundIssued": true,
17866
+ "resolutionSource": "timeout_detector",
17867
+ "refundOutcome": "success"
17868
+ }
17869
+ }
17870
+ }
17871
+ }
17872
+ },
17873
+ "responses": {
17874
+ "2XX": {
17875
+ "description": "Notification accepted by the receiving endpoint."
17876
+ }
17877
+ }
17878
+ }
17879
+ }
16225
17880
  }
16226
17881
  }