@tokenlabai/mcp-server 0.6.25 → 0.6.27

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": [
@@ -128,34 +132,6 @@
128
132
  "stream": true
129
133
  }
130
134
  },
131
- "live_translation": {
132
- "summary": "Stream audio translation",
133
- "value": {
134
- "model": "qwen3-livetranslate-flash",
135
- "messages": [
136
- {
137
- "role": "user",
138
- "content": [
139
- {
140
- "type": "input_audio",
141
- "input_audio": {
142
- "data": "https://example.com/sample.wav",
143
- "format": "wav"
144
- }
145
- }
146
- ]
147
- }
148
- ],
149
- "translation_options": {
150
- "source_lang": "zh",
151
- "target_lang": "en"
152
- },
153
- "modalities": [
154
- "text"
155
- ],
156
- "stream": true
157
- }
158
- },
159
135
  "function_calling": {
160
136
  "summary": "Function calling",
161
137
  "value": {
@@ -331,7 +307,7 @@
331
307
  "text": {
332
308
  "summary": "Text input",
333
309
  "value": {
334
- "model": "jina-embeddings-v4",
310
+ "model": "qwen3-vl-embedding",
335
311
  "input": {
336
312
  "text": "Describe this product for semantic search."
337
313
  }
@@ -531,6 +507,9 @@
531
507
  },
532
508
  "error_details": {
533
509
  "$ref": "#/components/schemas/AsyncTaskErrorDetails"
510
+ },
511
+ "media_retention": {
512
+ "$ref": "#/components/schemas/MediaRetention"
534
513
  }
535
514
  }
536
515
  }
@@ -588,18 +567,18 @@
588
567
  "basic": {
589
568
  "summary": "Basic TTS",
590
569
  "value": {
591
- "model": "tts-1",
570
+ "model": "grok-tts",
592
571
  "input": "Hello, welcome to TokenLab!",
593
- "voice": "alloy"
572
+ "voice": "eve"
594
573
  }
595
574
  },
596
- "hd": {
597
- "summary": "HD quality TTS",
575
+ "voice_and_speed": {
576
+ "summary": "Voice and speed",
598
577
  "value": {
599
- "model": "tts-1-hd",
600
- "input": "This is high quality speech synthesis.",
601
- "voice": "nova",
602
- "response_format": "mp3",
578
+ "model": "qwen3-tts-flash",
579
+ "input": "This is a speech synthesis example.",
580
+ "voice": "Cherry",
581
+ "response_format": "wav",
603
582
  "speed": 1
604
583
  }
605
584
  }
@@ -757,7 +736,7 @@
757
736
  "image_to_video": {
758
737
  "summary": "Image-to-Video",
759
738
  "value": {
760
- "model": "hailuo-2.3-standard",
739
+ "model": "hailuo-2.3",
761
740
  "prompt": "Make this image come alive with gentle movement",
762
741
  "operation": "image-to-video",
763
742
  "image_url": "https://example.com/image.jpg",
@@ -1776,7 +1755,7 @@
1776
1755
  "Anthropic"
1777
1756
  ],
1778
1757
  "summary": "Count message tokens (Anthropic-compatible)",
1779
- "description": "Counts input tokens for an Anthropic-compatible messages request without creating a model response. Authentication is required; the operation is not billed.",
1758
+ "description": "Counts input tokens for an Anthropic-compatible messages request without creating a model response. Authentication is required; the operation is not billed. Verified upstream counting is preferred. Upstream availability failures return a local estimate marked by X-TokenLab-Count-Tokens-Source: local_estimate. Platform authentication, permission and input errors remain errors. Bound files unreadable locally require upstream counting.",
1780
1759
  "operationId": "countAnthropicMessageTokens",
1781
1760
  "requestBody": {
1782
1761
  "required": true,
@@ -2731,7 +2710,7 @@
2731
2710
  "string",
2732
2711
  "null"
2733
2712
  ],
2734
- "description": "Service tier hint where supported by the model."
2713
+ "description": "TokenLab serves this request at the standard service tier. auto and default are forwarded. Other values, such as flex, priority, fast and ultrafast, are ignored and billed at the standard price."
2735
2714
  },
2736
2715
  "truncation": {
2737
2716
  "type": "string",
@@ -3232,9 +3211,6 @@
3232
3211
  "application/json": {
3233
3212
  "schema": {
3234
3213
  "type": "object",
3235
- "required": [
3236
- "prompt"
3237
- ],
3238
3214
  "properties": {
3239
3215
  "model": {
3240
3216
  "type": "string",
@@ -3242,7 +3218,7 @@
3242
3218
  },
3243
3219
  "prompt": {
3244
3220
  "type": "string",
3245
- "description": "3D model description"
3221
+ "description": "3D model description. Required for every model that takes a prompt; an image-to-3D model whose contract lists no prompt is called without one."
3246
3222
  },
3247
3223
  "image": {
3248
3224
  "type": "string",
@@ -4535,7 +4511,8 @@
4535
4511
  "schema": {
4536
4512
  "type": "object",
4537
4513
  "required": [
4538
- "file"
4514
+ "file",
4515
+ "model"
4539
4516
  ],
4540
4517
  "properties": {
4541
4518
  "file": {
@@ -4543,8 +4520,7 @@
4543
4520
  "format": "binary"
4544
4521
  },
4545
4522
  "model": {
4546
- "type": "string",
4547
- "default": "whisper-1"
4523
+ "type": "string"
4548
4524
  },
4549
4525
  "prompt": {
4550
4526
  "type": "string"
@@ -4613,7 +4589,7 @@
4613
4589
  "schema": {
4614
4590
  "type": "string"
4615
4591
  },
4616
- "example": "gpt-realtime"
4592
+ "example": "grok-voice-latest"
4617
4593
  }
4618
4594
  ],
4619
4595
  "responses": {
@@ -5775,6 +5751,9 @@
5775
5751
  },
5776
5752
  "error_details": {
5777
5753
  "$ref": "#/components/schemas/AsyncTaskErrorDetails"
5754
+ },
5755
+ "media_retention": {
5756
+ "$ref": "#/components/schemas/MediaRetention"
5778
5757
  }
5779
5758
  },
5780
5759
  "additionalProperties": true
@@ -8271,147 +8250,1417 @@
8271
8250
  }
8272
8251
  ]
8273
8252
  }
8274
- }
8275
- },
8276
- "components": {
8277
- "securitySchemes": {
8278
- "BearerAuth": {
8279
- "type": "http",
8280
- "scheme": "bearer",
8281
- "bearerFormat": "API Key",
8282
- "description": "API Key authentication. Create or manage API keys in [Dashboard > API > API Keys](https://tokenlab.sh/dashboard/api?tab=keys)."
8283
- },
8284
- "ManagementTokenAuth": {
8285
- "type": "http",
8286
- "scheme": "bearer",
8287
- "bearerFormat": "Management Token",
8288
- "description": "Management token authentication. Create or manage Management Tokens in [Dashboard > API > Management Tokens](https://tokenlab.sh/dashboard/api?tab=tokens)."
8289
- }
8290
8253
  },
8291
- "schemas": {
8292
- "ChatCompletionRequest": {
8293
- "type": "object",
8294
- "required": [
8295
- "model",
8296
- "messages"
8254
+ "/v1beta/files:register": {
8255
+ "post": {
8256
+ "tags": [
8257
+ "Gemini Resources"
8297
8258
  ],
8298
- "properties": {
8299
- "model": {
8300
- "type": "string",
8301
- "description": "ID of the model to use (e.g., gpt-5.4, claude-sonnet-4-6)",
8302
- "example": "gpt-4o"
8259
+ "operationId": "geminiRegisterFiles",
8260
+ "summary": "Register Gemini files",
8261
+ "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.",
8262
+ "security": [
8263
+ {
8264
+ "BearerAuth": []
8303
8265
  },
8304
- "messages": {
8305
- "type": "array",
8306
- "description": "A list of messages comprising the conversation",
8307
- "items": {
8308
- "$ref": "#/components/schemas/ChatMessage"
8266
+ {
8267
+ "GeminiApiKey": []
8268
+ }
8269
+ ],
8270
+ "parameters": [
8271
+ {
8272
+ "name": "key",
8273
+ "in": "query",
8274
+ "required": false,
8275
+ "schema": {
8276
+ "type": "string"
8309
8277
  },
8310
- "minItems": 1
8311
- },
8312
- "temperature": {
8313
- "type": "number",
8314
- "minimum": 0,
8315
- "maximum": 2,
8316
- "default": 1,
8317
- "description": "Sampling temperature (0-2)"
8278
+ "description": "API key alternative to Bearer or x-goog-api-key."
8318
8279
  },
8319
- "top_p": {
8320
- "type": "number",
8321
- "minimum": 0,
8322
- "maximum": 1,
8323
- "default": 1,
8324
- "description": "Nucleus sampling probability"
8280
+ {
8281
+ "name": "Idempotency-Key",
8282
+ "in": "header",
8283
+ "required": false,
8284
+ "schema": {
8285
+ "type": "string"
8286
+ },
8287
+ "description": "Reuse the same key and request body when recovering a create response. A different body with the same key returns a conflict."
8288
+ }
8289
+ ],
8290
+ "responses": {
8291
+ "200": {
8292
+ "description": "Success",
8293
+ "content": {
8294
+ "application/json": {
8295
+ "schema": {
8296
+ "anyOf": [
8297
+ {
8298
+ "$ref": "#/components/schemas/GeminiFileResource"
8299
+ },
8300
+ {
8301
+ "type": "object",
8302
+ "properties": {
8303
+ "file": {
8304
+ "$ref": "#/components/schemas/GeminiFileResource"
8305
+ },
8306
+ "files": {
8307
+ "type": "array",
8308
+ "items": {
8309
+ "$ref": "#/components/schemas/GeminiFileResource"
8310
+ }
8311
+ }
8312
+ },
8313
+ "additionalProperties": true
8314
+ }
8315
+ ]
8316
+ }
8317
+ }
8318
+ }
8325
8319
  },
8326
- "n": {
8327
- "type": "integer",
8328
- "minimum": 1,
8329
- "maximum": 128,
8330
- "default": 1,
8331
- "description": "Number of completions to generate"
8320
+ "400": {
8321
+ "$ref": "#/components/responses/GeminiResourceError"
8332
8322
  },
8333
- "stream": {
8334
- "type": "boolean",
8335
- "default": false,
8336
- "description": "If true, returns a stream of events"
8323
+ "401": {
8324
+ "$ref": "#/components/responses/GeminiResourceError"
8337
8325
  },
8338
- "stop": {
8339
- "oneOf": [
8340
- {
8341
- "type": "string"
8342
- },
8343
- {
8344
- "type": "array",
8345
- "items": {
8346
- "type": "string"
8347
- },
8348
- "maxItems": 4
8349
- }
8350
- ],
8351
- "description": "Stop sequences"
8326
+ "403": {
8327
+ "$ref": "#/components/responses/GeminiResourceError"
8352
8328
  },
8353
- "max_tokens": {
8354
- "type": "integer",
8355
- "minimum": 1,
8356
- "description": "Maximum number of tokens to generate"
8329
+ "404": {
8330
+ "$ref": "#/components/responses/GeminiResourceError"
8357
8331
  },
8358
- "max_completion_tokens": {
8359
- "type": "integer",
8360
- "minimum": 1,
8361
- "description": "Maximum completion tokens for newer reasoning-enabled model families"
8332
+ "409": {
8333
+ "$ref": "#/components/responses/GeminiResourceError"
8362
8334
  },
8363
- "presence_penalty": {
8364
- "type": "number",
8365
- "minimum": -2,
8366
- "maximum": 2,
8367
- "default": 0,
8368
- "description": "Presence penalty (-2 to 2)"
8335
+ "429": {
8336
+ "$ref": "#/components/responses/GeminiResourceError"
8369
8337
  },
8370
- "frequency_penalty": {
8371
- "type": "number",
8372
- "minimum": -2,
8373
- "maximum": 2,
8374
- "default": 0,
8375
- "description": "Frequency penalty (-2 to 2)"
8338
+ "502": {
8339
+ "$ref": "#/components/responses/GeminiResourceError"
8376
8340
  },
8377
- "tools": {
8378
- "type": "array",
8379
- "description": "List of tools the model may call",
8380
- "items": {
8381
- "$ref": "#/components/schemas/Tool"
8341
+ "503": {
8342
+ "$ref": "#/components/responses/GeminiResourceError"
8343
+ }
8344
+ },
8345
+ "requestBody": {
8346
+ "required": true,
8347
+ "content": {
8348
+ "application/json": {
8349
+ "schema": {
8350
+ "$ref": "#/components/schemas/GeminiFileRegisterRequest"
8351
+ }
8382
8352
  }
8353
+ }
8354
+ }
8355
+ }
8356
+ },
8357
+ "/v1beta/files": {
8358
+ "post": {
8359
+ "tags": [
8360
+ "Gemini Resources"
8361
+ ],
8362
+ "operationId": "geminiCreateFile",
8363
+ "summary": "Create Gemini file metadata",
8364
+ "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.",
8365
+ "security": [
8366
+ {
8367
+ "BearerAuth": []
8383
8368
  },
8384
- "functions": {
8385
- "type": "array",
8386
- "description": "Deprecated function definitions retained by the official Chat Completions contract.",
8387
- "items": {
8388
- "type": "object",
8389
- "additionalProperties": true
8390
- }
8369
+ {
8370
+ "GeminiApiKey": []
8371
+ }
8372
+ ],
8373
+ "parameters": [
8374
+ {
8375
+ "name": "key",
8376
+ "in": "query",
8377
+ "required": false,
8378
+ "schema": {
8379
+ "type": "string"
8380
+ },
8381
+ "description": "API key alternative to Bearer or x-goog-api-key."
8391
8382
  },
8392
- "function_call": {
8393
- "oneOf": [
8394
- {
8395
- "type": "string"
8396
- },
8397
- {
8398
- "type": "object",
8399
- "additionalProperties": true
8383
+ {
8384
+ "name": "Idempotency-Key",
8385
+ "in": "header",
8386
+ "required": false,
8387
+ "schema": {
8388
+ "type": "string"
8389
+ },
8390
+ "description": "Reuse the same key and request body when recovering a create response. A different body with the same key returns a conflict."
8391
+ }
8392
+ ],
8393
+ "responses": {
8394
+ "200": {
8395
+ "description": "Success",
8396
+ "content": {
8397
+ "application/json": {
8398
+ "schema": {
8399
+ "anyOf": [
8400
+ {
8401
+ "$ref": "#/components/schemas/GeminiFileResource"
8402
+ },
8403
+ {
8404
+ "type": "object",
8405
+ "properties": {
8406
+ "file": {
8407
+ "$ref": "#/components/schemas/GeminiFileResource"
8408
+ },
8409
+ "files": {
8410
+ "type": "array",
8411
+ "items": {
8412
+ "$ref": "#/components/schemas/GeminiFileResource"
8413
+ }
8414
+ }
8415
+ },
8416
+ "additionalProperties": true
8417
+ }
8418
+ ]
8419
+ }
8400
8420
  }
8401
- ],
8402
- "description": "Deprecated function-call selection retained by the official Chat Completions contract."
8421
+ }
8403
8422
  },
8404
- "tool_choice": {
8405
- "oneOf": [
8406
- {
8407
- "type": "string",
8408
- "enum": [
8409
- "none",
8410
- "auto",
8411
- "required"
8412
- ]
8413
- },
8414
- {
8423
+ "400": {
8424
+ "$ref": "#/components/responses/GeminiResourceError"
8425
+ },
8426
+ "401": {
8427
+ "$ref": "#/components/responses/GeminiResourceError"
8428
+ },
8429
+ "403": {
8430
+ "$ref": "#/components/responses/GeminiResourceError"
8431
+ },
8432
+ "404": {
8433
+ "$ref": "#/components/responses/GeminiResourceError"
8434
+ },
8435
+ "409": {
8436
+ "$ref": "#/components/responses/GeminiResourceError"
8437
+ },
8438
+ "429": {
8439
+ "$ref": "#/components/responses/GeminiResourceError"
8440
+ },
8441
+ "502": {
8442
+ "$ref": "#/components/responses/GeminiResourceError"
8443
+ },
8444
+ "503": {
8445
+ "$ref": "#/components/responses/GeminiResourceError"
8446
+ }
8447
+ },
8448
+ "requestBody": {
8449
+ "required": true,
8450
+ "content": {
8451
+ "application/json": {
8452
+ "schema": {
8453
+ "$ref": "#/components/schemas/GeminiFileCreateRequest"
8454
+ }
8455
+ }
8456
+ }
8457
+ }
8458
+ },
8459
+ "get": {
8460
+ "tags": [
8461
+ "Gemini Resources"
8462
+ ],
8463
+ "operationId": "geminiListFiles",
8464
+ "summary": "List Gemini files",
8465
+ "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.",
8466
+ "security": [
8467
+ {
8468
+ "BearerAuth": []
8469
+ },
8470
+ {
8471
+ "GeminiApiKey": []
8472
+ }
8473
+ ],
8474
+ "parameters": [
8475
+ {
8476
+ "name": "key",
8477
+ "in": "query",
8478
+ "required": false,
8479
+ "schema": {
8480
+ "type": "string"
8481
+ },
8482
+ "description": "API key alternative to Bearer or x-goog-api-key."
8483
+ },
8484
+ {
8485
+ "name": "pageSize",
8486
+ "in": "query",
8487
+ "schema": {
8488
+ "type": "integer"
8489
+ },
8490
+ "description": "Requested page size; page_size is also accepted."
8491
+ },
8492
+ {
8493
+ "name": "pageToken",
8494
+ "in": "query",
8495
+ "required": false,
8496
+ "schema": {
8497
+ "type": "string"
8498
+ },
8499
+ "description": "Opaque nextPageToken from the previous response. page_token is also accepted."
8500
+ }
8501
+ ],
8502
+ "responses": {
8503
+ "200": {
8504
+ "description": "Success",
8505
+ "content": {
8506
+ "application/json": {
8507
+ "schema": {
8508
+ "type": "object",
8509
+ "properties": {
8510
+ "files": {
8511
+ "type": "array",
8512
+ "items": {
8513
+ "$ref": "#/components/schemas/GeminiFileResource"
8514
+ }
8515
+ },
8516
+ "nextPageToken": {
8517
+ "type": "string"
8518
+ }
8519
+ },
8520
+ "required": [
8521
+ "files"
8522
+ ]
8523
+ }
8524
+ }
8525
+ }
8526
+ },
8527
+ "400": {
8528
+ "$ref": "#/components/responses/GeminiResourceError"
8529
+ },
8530
+ "401": {
8531
+ "$ref": "#/components/responses/GeminiResourceError"
8532
+ },
8533
+ "403": {
8534
+ "$ref": "#/components/responses/GeminiResourceError"
8535
+ },
8536
+ "404": {
8537
+ "$ref": "#/components/responses/GeminiResourceError"
8538
+ },
8539
+ "409": {
8540
+ "$ref": "#/components/responses/GeminiResourceError"
8541
+ },
8542
+ "429": {
8543
+ "$ref": "#/components/responses/GeminiResourceError"
8544
+ },
8545
+ "502": {
8546
+ "$ref": "#/components/responses/GeminiResourceError"
8547
+ },
8548
+ "503": {
8549
+ "$ref": "#/components/responses/GeminiResourceError"
8550
+ }
8551
+ }
8552
+ }
8553
+ },
8554
+ "/v1beta/files/{fileId}": {
8555
+ "get": {
8556
+ "tags": [
8557
+ "Gemini Resources"
8558
+ ],
8559
+ "operationId": "geminiGetFile",
8560
+ "summary": "Get Gemini file",
8561
+ "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.",
8562
+ "security": [
8563
+ {
8564
+ "BearerAuth": []
8565
+ },
8566
+ {
8567
+ "GeminiApiKey": []
8568
+ }
8569
+ ],
8570
+ "parameters": [
8571
+ {
8572
+ "name": "fileId",
8573
+ "in": "path",
8574
+ "required": true,
8575
+ "schema": {
8576
+ "type": "string"
8577
+ },
8578
+ "description": "Suffix of the returned files/{fileId} name."
8579
+ },
8580
+ {
8581
+ "name": "key",
8582
+ "in": "query",
8583
+ "required": false,
8584
+ "schema": {
8585
+ "type": "string"
8586
+ },
8587
+ "description": "API key alternative to Bearer or x-goog-api-key."
8588
+ }
8589
+ ],
8590
+ "responses": {
8591
+ "200": {
8592
+ "description": "Success",
8593
+ "content": {
8594
+ "application/json": {
8595
+ "schema": {
8596
+ "$ref": "#/components/schemas/GeminiFileResource"
8597
+ }
8598
+ }
8599
+ }
8600
+ },
8601
+ "400": {
8602
+ "$ref": "#/components/responses/GeminiResourceError"
8603
+ },
8604
+ "401": {
8605
+ "$ref": "#/components/responses/GeminiResourceError"
8606
+ },
8607
+ "403": {
8608
+ "$ref": "#/components/responses/GeminiResourceError"
8609
+ },
8610
+ "404": {
8611
+ "$ref": "#/components/responses/GeminiResourceError"
8612
+ },
8613
+ "409": {
8614
+ "$ref": "#/components/responses/GeminiResourceError"
8615
+ },
8616
+ "429": {
8617
+ "$ref": "#/components/responses/GeminiResourceError"
8618
+ },
8619
+ "502": {
8620
+ "$ref": "#/components/responses/GeminiResourceError"
8621
+ },
8622
+ "503": {
8623
+ "$ref": "#/components/responses/GeminiResourceError"
8624
+ }
8625
+ }
8626
+ },
8627
+ "delete": {
8628
+ "tags": [
8629
+ "Gemini Resources"
8630
+ ],
8631
+ "operationId": "geminiDeleteFile",
8632
+ "summary": "Delete Gemini file",
8633
+ "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.",
8634
+ "security": [
8635
+ {
8636
+ "BearerAuth": []
8637
+ },
8638
+ {
8639
+ "GeminiApiKey": []
8640
+ }
8641
+ ],
8642
+ "parameters": [
8643
+ {
8644
+ "name": "fileId",
8645
+ "in": "path",
8646
+ "required": true,
8647
+ "schema": {
8648
+ "type": "string"
8649
+ }
8650
+ },
8651
+ {
8652
+ "name": "key",
8653
+ "in": "query",
8654
+ "required": false,
8655
+ "schema": {
8656
+ "type": "string"
8657
+ },
8658
+ "description": "API key alternative to Bearer or x-goog-api-key."
8659
+ }
8660
+ ],
8661
+ "responses": {
8662
+ "200": {
8663
+ "description": "Success",
8664
+ "content": {
8665
+ "application/json": {
8666
+ "schema": {
8667
+ "type": "object",
8668
+ "additionalProperties": true
8669
+ }
8670
+ }
8671
+ }
8672
+ },
8673
+ "400": {
8674
+ "$ref": "#/components/responses/GeminiResourceError"
8675
+ },
8676
+ "401": {
8677
+ "$ref": "#/components/responses/GeminiResourceError"
8678
+ },
8679
+ "403": {
8680
+ "$ref": "#/components/responses/GeminiResourceError"
8681
+ },
8682
+ "404": {
8683
+ "$ref": "#/components/responses/GeminiResourceError"
8684
+ },
8685
+ "409": {
8686
+ "$ref": "#/components/responses/GeminiResourceError"
8687
+ },
8688
+ "429": {
8689
+ "$ref": "#/components/responses/GeminiResourceError"
8690
+ },
8691
+ "502": {
8692
+ "$ref": "#/components/responses/GeminiResourceError"
8693
+ },
8694
+ "503": {
8695
+ "$ref": "#/components/responses/GeminiResourceError"
8696
+ }
8697
+ }
8698
+ }
8699
+ },
8700
+ "/v1beta/cachedContents": {
8701
+ "post": {
8702
+ "tags": [
8703
+ "Gemini Resources"
8704
+ ],
8705
+ "operationId": "geminiCreateCachedContent",
8706
+ "summary": "Create Gemini cached content",
8707
+ "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.",
8708
+ "security": [
8709
+ {
8710
+ "BearerAuth": []
8711
+ },
8712
+ {
8713
+ "GeminiApiKey": []
8714
+ }
8715
+ ],
8716
+ "parameters": [
8717
+ {
8718
+ "name": "key",
8719
+ "in": "query",
8720
+ "required": false,
8721
+ "schema": {
8722
+ "type": "string"
8723
+ },
8724
+ "description": "API key alternative to Bearer or x-goog-api-key."
8725
+ },
8726
+ {
8727
+ "name": "Idempotency-Key",
8728
+ "in": "header",
8729
+ "required": false,
8730
+ "schema": {
8731
+ "type": "string"
8732
+ },
8733
+ "description": "Reuse the same key and request body when recovering a create response. A different body with the same key returns a conflict."
8734
+ }
8735
+ ],
8736
+ "responses": {
8737
+ "200": {
8738
+ "description": "Success",
8739
+ "content": {
8740
+ "application/json": {
8741
+ "schema": {
8742
+ "$ref": "#/components/schemas/GeminiCachedContentResource"
8743
+ }
8744
+ }
8745
+ }
8746
+ },
8747
+ "400": {
8748
+ "$ref": "#/components/responses/GeminiResourceError"
8749
+ },
8750
+ "401": {
8751
+ "$ref": "#/components/responses/GeminiResourceError"
8752
+ },
8753
+ "403": {
8754
+ "$ref": "#/components/responses/GeminiResourceError"
8755
+ },
8756
+ "404": {
8757
+ "$ref": "#/components/responses/GeminiResourceError"
8758
+ },
8759
+ "409": {
8760
+ "$ref": "#/components/responses/GeminiResourceError"
8761
+ },
8762
+ "429": {
8763
+ "$ref": "#/components/responses/GeminiResourceError"
8764
+ },
8765
+ "502": {
8766
+ "$ref": "#/components/responses/GeminiResourceError"
8767
+ },
8768
+ "503": {
8769
+ "$ref": "#/components/responses/GeminiResourceError"
8770
+ }
8771
+ },
8772
+ "requestBody": {
8773
+ "required": true,
8774
+ "content": {
8775
+ "application/json": {
8776
+ "schema": {
8777
+ "$ref": "#/components/schemas/GeminiCachedContentRequest"
8778
+ }
8779
+ }
8780
+ }
8781
+ }
8782
+ },
8783
+ "get": {
8784
+ "tags": [
8785
+ "Gemini Resources"
8786
+ ],
8787
+ "operationId": "geminiListCachedContents",
8788
+ "summary": "List Gemini cached content",
8789
+ "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.",
8790
+ "security": [
8791
+ {
8792
+ "BearerAuth": []
8793
+ },
8794
+ {
8795
+ "GeminiApiKey": []
8796
+ }
8797
+ ],
8798
+ "parameters": [
8799
+ {
8800
+ "name": "key",
8801
+ "in": "query",
8802
+ "required": false,
8803
+ "schema": {
8804
+ "type": "string"
8805
+ },
8806
+ "description": "API key alternative to Bearer or x-goog-api-key."
8807
+ },
8808
+ {
8809
+ "name": "pageSize",
8810
+ "in": "query",
8811
+ "schema": {
8812
+ "type": "integer"
8813
+ },
8814
+ "description": "Requested page size; page_size is also accepted."
8815
+ },
8816
+ {
8817
+ "name": "pageToken",
8818
+ "in": "query",
8819
+ "required": false,
8820
+ "schema": {
8821
+ "type": "string"
8822
+ },
8823
+ "description": "Opaque nextPageToken from the previous response. page_token is also accepted."
8824
+ }
8825
+ ],
8826
+ "responses": {
8827
+ "200": {
8828
+ "description": "Success",
8829
+ "content": {
8830
+ "application/json": {
8831
+ "schema": {
8832
+ "type": "object",
8833
+ "required": [
8834
+ "cachedContents"
8835
+ ],
8836
+ "properties": {
8837
+ "cachedContents": {
8838
+ "type": "array",
8839
+ "items": {
8840
+ "$ref": "#/components/schemas/GeminiCachedContentResource"
8841
+ }
8842
+ },
8843
+ "nextPageToken": {
8844
+ "type": "string"
8845
+ }
8846
+ }
8847
+ }
8848
+ }
8849
+ }
8850
+ },
8851
+ "400": {
8852
+ "$ref": "#/components/responses/GeminiResourceError"
8853
+ },
8854
+ "401": {
8855
+ "$ref": "#/components/responses/GeminiResourceError"
8856
+ },
8857
+ "403": {
8858
+ "$ref": "#/components/responses/GeminiResourceError"
8859
+ },
8860
+ "404": {
8861
+ "$ref": "#/components/responses/GeminiResourceError"
8862
+ },
8863
+ "409": {
8864
+ "$ref": "#/components/responses/GeminiResourceError"
8865
+ },
8866
+ "429": {
8867
+ "$ref": "#/components/responses/GeminiResourceError"
8868
+ },
8869
+ "502": {
8870
+ "$ref": "#/components/responses/GeminiResourceError"
8871
+ },
8872
+ "503": {
8873
+ "$ref": "#/components/responses/GeminiResourceError"
8874
+ }
8875
+ }
8876
+ }
8877
+ },
8878
+ "/v1beta/cachedContents/{cacheId}": {
8879
+ "get": {
8880
+ "tags": [
8881
+ "Gemini Resources"
8882
+ ],
8883
+ "operationId": "geminiGetCachedContent",
8884
+ "summary": "Get Gemini cached content",
8885
+ "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.",
8886
+ "security": [
8887
+ {
8888
+ "BearerAuth": []
8889
+ },
8890
+ {
8891
+ "GeminiApiKey": []
8892
+ }
8893
+ ],
8894
+ "parameters": [
8895
+ {
8896
+ "name": "cacheId",
8897
+ "in": "path",
8898
+ "required": true,
8899
+ "schema": {
8900
+ "type": "string"
8901
+ },
8902
+ "description": "Suffix of the returned cachedContents/{cacheId} name."
8903
+ },
8904
+ {
8905
+ "name": "key",
8906
+ "in": "query",
8907
+ "required": false,
8908
+ "schema": {
8909
+ "type": "string"
8910
+ },
8911
+ "description": "API key alternative to Bearer or x-goog-api-key."
8912
+ }
8913
+ ],
8914
+ "responses": {
8915
+ "200": {
8916
+ "description": "Success",
8917
+ "content": {
8918
+ "application/json": {
8919
+ "schema": {
8920
+ "$ref": "#/components/schemas/GeminiCachedContentResource"
8921
+ }
8922
+ }
8923
+ }
8924
+ },
8925
+ "400": {
8926
+ "$ref": "#/components/responses/GeminiResourceError"
8927
+ },
8928
+ "401": {
8929
+ "$ref": "#/components/responses/GeminiResourceError"
8930
+ },
8931
+ "403": {
8932
+ "$ref": "#/components/responses/GeminiResourceError"
8933
+ },
8934
+ "404": {
8935
+ "$ref": "#/components/responses/GeminiResourceError"
8936
+ },
8937
+ "409": {
8938
+ "$ref": "#/components/responses/GeminiResourceError"
8939
+ },
8940
+ "429": {
8941
+ "$ref": "#/components/responses/GeminiResourceError"
8942
+ },
8943
+ "502": {
8944
+ "$ref": "#/components/responses/GeminiResourceError"
8945
+ },
8946
+ "503": {
8947
+ "$ref": "#/components/responses/GeminiResourceError"
8948
+ }
8949
+ }
8950
+ },
8951
+ "patch": {
8952
+ "tags": [
8953
+ "Gemini Resources"
8954
+ ],
8955
+ "operationId": "geminiUpdateCachedContent",
8956
+ "summary": "Update Gemini cached content",
8957
+ "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.",
8958
+ "security": [
8959
+ {
8960
+ "BearerAuth": []
8961
+ },
8962
+ {
8963
+ "GeminiApiKey": []
8964
+ }
8965
+ ],
8966
+ "parameters": [
8967
+ {
8968
+ "name": "cacheId",
8969
+ "in": "path",
8970
+ "required": true,
8971
+ "schema": {
8972
+ "type": "string"
8973
+ }
8974
+ },
8975
+ {
8976
+ "name": "key",
8977
+ "in": "query",
8978
+ "required": false,
8979
+ "schema": {
8980
+ "type": "string"
8981
+ },
8982
+ "description": "API key alternative to Bearer or x-goog-api-key."
8983
+ },
8984
+ {
8985
+ "name": "updateMask",
8986
+ "in": "query",
8987
+ "required": false,
8988
+ "schema": {
8989
+ "type": "string"
8990
+ },
8991
+ "description": "Gemini field mask when required by the service."
8992
+ }
8993
+ ],
8994
+ "responses": {
8995
+ "200": {
8996
+ "description": "Success",
8997
+ "content": {
8998
+ "application/json": {
8999
+ "schema": {
9000
+ "$ref": "#/components/schemas/GeminiCachedContentResource"
9001
+ }
9002
+ }
9003
+ }
9004
+ },
9005
+ "400": {
9006
+ "$ref": "#/components/responses/GeminiResourceError"
9007
+ },
9008
+ "401": {
9009
+ "$ref": "#/components/responses/GeminiResourceError"
9010
+ },
9011
+ "403": {
9012
+ "$ref": "#/components/responses/GeminiResourceError"
9013
+ },
9014
+ "404": {
9015
+ "$ref": "#/components/responses/GeminiResourceError"
9016
+ },
9017
+ "409": {
9018
+ "$ref": "#/components/responses/GeminiResourceError"
9019
+ },
9020
+ "429": {
9021
+ "$ref": "#/components/responses/GeminiResourceError"
9022
+ },
9023
+ "502": {
9024
+ "$ref": "#/components/responses/GeminiResourceError"
9025
+ },
9026
+ "503": {
9027
+ "$ref": "#/components/responses/GeminiResourceError"
9028
+ }
9029
+ },
9030
+ "requestBody": {
9031
+ "required": true,
9032
+ "content": {
9033
+ "application/json": {
9034
+ "schema": {
9035
+ "$ref": "#/components/schemas/GeminiCachedContentUpdateRequest"
9036
+ }
9037
+ }
9038
+ }
9039
+ }
9040
+ },
9041
+ "delete": {
9042
+ "tags": [
9043
+ "Gemini Resources"
9044
+ ],
9045
+ "operationId": "geminiDeleteCachedContent",
9046
+ "summary": "Delete Gemini cached content",
9047
+ "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.",
9048
+ "security": [
9049
+ {
9050
+ "BearerAuth": []
9051
+ },
9052
+ {
9053
+ "GeminiApiKey": []
9054
+ }
9055
+ ],
9056
+ "parameters": [
9057
+ {
9058
+ "name": "cacheId",
9059
+ "in": "path",
9060
+ "required": true,
9061
+ "schema": {
9062
+ "type": "string"
9063
+ }
9064
+ },
9065
+ {
9066
+ "name": "key",
9067
+ "in": "query",
9068
+ "required": false,
9069
+ "schema": {
9070
+ "type": "string"
9071
+ },
9072
+ "description": "API key alternative to Bearer or x-goog-api-key."
9073
+ }
9074
+ ],
9075
+ "responses": {
9076
+ "200": {
9077
+ "description": "Success",
9078
+ "content": {
9079
+ "application/json": {
9080
+ "schema": {
9081
+ "type": "object",
9082
+ "additionalProperties": true
9083
+ }
9084
+ }
9085
+ }
9086
+ },
9087
+ "400": {
9088
+ "$ref": "#/components/responses/GeminiResourceError"
9089
+ },
9090
+ "401": {
9091
+ "$ref": "#/components/responses/GeminiResourceError"
9092
+ },
9093
+ "403": {
9094
+ "$ref": "#/components/responses/GeminiResourceError"
9095
+ },
9096
+ "404": {
9097
+ "$ref": "#/components/responses/GeminiResourceError"
9098
+ },
9099
+ "409": {
9100
+ "$ref": "#/components/responses/GeminiResourceError"
9101
+ },
9102
+ "429": {
9103
+ "$ref": "#/components/responses/GeminiResourceError"
9104
+ },
9105
+ "502": {
9106
+ "$ref": "#/components/responses/GeminiResourceError"
9107
+ },
9108
+ "503": {
9109
+ "$ref": "#/components/responses/GeminiResourceError"
9110
+ }
9111
+ }
9112
+ }
9113
+ },
9114
+ "/upload/v1beta/files": {
9115
+ "post": {
9116
+ "tags": [
9117
+ "Gemini Resources"
9118
+ ],
9119
+ "operationId": "geminiUploadFile",
9120
+ "summary": "Upload Gemini file",
9121
+ "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.",
9122
+ "security": [
9123
+ {
9124
+ "BearerAuth": []
9125
+ },
9126
+ {
9127
+ "GeminiApiKey": []
9128
+ }
9129
+ ],
9130
+ "parameters": [
9131
+ {
9132
+ "name": "key",
9133
+ "in": "query",
9134
+ "required": false,
9135
+ "schema": {
9136
+ "type": "string"
9137
+ },
9138
+ "description": "API key alternative to Bearer or x-goog-api-key."
9139
+ },
9140
+ {
9141
+ "name": "Idempotency-Key",
9142
+ "in": "header",
9143
+ "required": false,
9144
+ "schema": {
9145
+ "type": "string"
9146
+ },
9147
+ "description": "Reuse the same key and request body when recovering a create response. A different body with the same key returns a conflict."
9148
+ },
9149
+ {
9150
+ "name": "X-Goog-Upload-Protocol",
9151
+ "in": "header",
9152
+ "required": false,
9153
+ "schema": {
9154
+ "type": "string"
9155
+ },
9156
+ "description": "Upload protocol such as resumable."
9157
+ },
9158
+ {
9159
+ "name": "X-Goog-Upload-Command",
9160
+ "in": "header",
9161
+ "required": false,
9162
+ "schema": {
9163
+ "type": "string"
9164
+ },
9165
+ "description": "Upload command such as start or upload, finalize."
9166
+ },
9167
+ {
9168
+ "name": "X-Goog-Upload-Header-Content-Length",
9169
+ "in": "header",
9170
+ "required": false,
9171
+ "schema": {
9172
+ "type": "string"
9173
+ },
9174
+ "description": "Expected file byte length when starting a resumable upload."
9175
+ },
9176
+ {
9177
+ "name": "X-Goog-Upload-Header-Content-Type",
9178
+ "in": "header",
9179
+ "required": false,
9180
+ "schema": {
9181
+ "type": "string"
9182
+ },
9183
+ "description": "File MIME type when starting a resumable upload."
9184
+ }
9185
+ ],
9186
+ "responses": {
9187
+ "200": {
9188
+ "description": "Success",
9189
+ "content": {
9190
+ "application/json": {
9191
+ "schema": {
9192
+ "type": "object",
9193
+ "properties": {
9194
+ "file": {
9195
+ "$ref": "#/components/schemas/GeminiFileResource"
9196
+ }
9197
+ },
9198
+ "additionalProperties": true
9199
+ }
9200
+ }
9201
+ },
9202
+ "headers": {
9203
+ "X-Goog-Upload-URL": {
9204
+ "description": "Private resumable upload URL; returned for resumable start. Use it as supplied.",
9205
+ "schema": {
9206
+ "type": "string",
9207
+ "format": "uri"
9208
+ }
9209
+ }
9210
+ }
9211
+ },
9212
+ "400": {
9213
+ "$ref": "#/components/responses/GeminiResourceError"
9214
+ },
9215
+ "401": {
9216
+ "$ref": "#/components/responses/GeminiResourceError"
9217
+ },
9218
+ "403": {
9219
+ "$ref": "#/components/responses/GeminiResourceError"
9220
+ },
9221
+ "404": {
9222
+ "$ref": "#/components/responses/GeminiResourceError"
9223
+ },
9224
+ "409": {
9225
+ "$ref": "#/components/responses/GeminiResourceError"
9226
+ },
9227
+ "429": {
9228
+ "$ref": "#/components/responses/GeminiResourceError"
9229
+ },
9230
+ "502": {
9231
+ "$ref": "#/components/responses/GeminiResourceError"
9232
+ },
9233
+ "503": {
9234
+ "$ref": "#/components/responses/GeminiResourceError"
9235
+ }
9236
+ },
9237
+ "requestBody": {
9238
+ "required": false,
9239
+ "content": {
9240
+ "application/json": {
9241
+ "schema": {
9242
+ "$ref": "#/components/schemas/GeminiFileCreateRequest"
9243
+ }
9244
+ },
9245
+ "application/octet-stream": {
9246
+ "schema": {
9247
+ "type": "string",
9248
+ "format": "binary"
9249
+ }
9250
+ },
9251
+ "*/*": {
9252
+ "schema": {
9253
+ "type": "string",
9254
+ "format": "binary"
9255
+ }
9256
+ }
9257
+ }
9258
+ },
9259
+ "x-mint": {
9260
+ "metadata": {
9261
+ "playground": "none"
9262
+ }
9263
+ }
9264
+ }
9265
+ },
9266
+ "/upload/v1beta/files/session/{sessionId}": {
9267
+ "post": {
9268
+ "tags": [
9269
+ "Gemini Resources"
9270
+ ],
9271
+ "operationId": "geminiContinueFileUpload",
9272
+ "summary": "Continue Gemini file upload",
9273
+ "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.",
9274
+ "security": [],
9275
+ "parameters": [
9276
+ {
9277
+ "name": "sessionId",
9278
+ "in": "path",
9279
+ "required": true,
9280
+ "schema": {
9281
+ "type": "string"
9282
+ }
9283
+ },
9284
+ {
9285
+ "name": "X-Goog-Upload-Command",
9286
+ "in": "header",
9287
+ "required": false,
9288
+ "schema": {
9289
+ "type": "string"
9290
+ },
9291
+ "description": "Upload command such as upload, finalize."
9292
+ },
9293
+ {
9294
+ "name": "X-Goog-Upload-Offset",
9295
+ "in": "header",
9296
+ "required": false,
9297
+ "schema": {
9298
+ "type": "string"
9299
+ },
9300
+ "description": "Zero-based byte offset of the chunk."
9301
+ }
9302
+ ],
9303
+ "responses": {
9304
+ "200": {
9305
+ "description": "Success",
9306
+ "content": {
9307
+ "application/json": {
9308
+ "schema": {
9309
+ "type": "object",
9310
+ "properties": {
9311
+ "file": {
9312
+ "$ref": "#/components/schemas/GeminiFileResource"
9313
+ }
9314
+ },
9315
+ "additionalProperties": true
9316
+ }
9317
+ }
9318
+ }
9319
+ },
9320
+ "308": {
9321
+ "description": "Upload chunk accepted; more data or finalization is needed."
9322
+ },
9323
+ "400": {
9324
+ "$ref": "#/components/responses/GeminiResourceError"
9325
+ },
9326
+ "401": {
9327
+ "$ref": "#/components/responses/GeminiResourceError"
9328
+ },
9329
+ "403": {
9330
+ "$ref": "#/components/responses/GeminiResourceError"
9331
+ },
9332
+ "404": {
9333
+ "$ref": "#/components/responses/GeminiResourceError"
9334
+ },
9335
+ "409": {
9336
+ "$ref": "#/components/responses/GeminiResourceError"
9337
+ },
9338
+ "410": {
9339
+ "$ref": "#/components/responses/GeminiResourceError"
9340
+ },
9341
+ "429": {
9342
+ "$ref": "#/components/responses/GeminiResourceError"
9343
+ },
9344
+ "502": {
9345
+ "$ref": "#/components/responses/GeminiResourceError"
9346
+ },
9347
+ "503": {
9348
+ "$ref": "#/components/responses/GeminiResourceError"
9349
+ }
9350
+ },
9351
+ "requestBody": {
9352
+ "required": false,
9353
+ "content": {
9354
+ "application/octet-stream": {
9355
+ "schema": {
9356
+ "type": "string",
9357
+ "format": "binary"
9358
+ }
9359
+ },
9360
+ "*/*": {
9361
+ "schema": {
9362
+ "type": "string",
9363
+ "format": "binary"
9364
+ }
9365
+ }
9366
+ }
9367
+ },
9368
+ "x-mint": {
9369
+ "metadata": {
9370
+ "playground": "none"
9371
+ }
9372
+ }
9373
+ }
9374
+ },
9375
+ "/v1/media-results/{id}": {
9376
+ "get": {
9377
+ "tags": [
9378
+ "Media Results"
9379
+ ],
9380
+ "summary": "Get a media result",
9381
+ "description": "Returns a generated image, video, audio or downloadable 3D result. Result URLs have this form and stay valid for 30 days from when the result is first recorded. Use the URL exactly as you received it: its token grants access, and no API key is needed.",
9382
+ "operationId": "getMediaResult",
9383
+ "security": [],
9384
+ "parameters": [
9385
+ {
9386
+ "name": "id",
9387
+ "in": "path",
9388
+ "required": true,
9389
+ "description": "Result ID, followed by the file extension, for example `.png`, `.mp4`, `.mp3` or `.glb`.",
9390
+ "schema": {
9391
+ "type": "string"
9392
+ }
9393
+ },
9394
+ {
9395
+ "name": "token",
9396
+ "in": "query",
9397
+ "required": true,
9398
+ "description": "Access token from the URL you received.",
9399
+ "schema": {
9400
+ "type": "string",
9401
+ "pattern": "^[a-f0-9]{64}$"
9402
+ }
9403
+ },
9404
+ {
9405
+ "name": "metadata",
9406
+ "in": "query",
9407
+ "required": false,
9408
+ "description": "Return the saving status as JSON instead of the file.",
9409
+ "schema": {
9410
+ "type": "boolean"
9411
+ }
9412
+ }
9413
+ ],
9414
+ "responses": {
9415
+ "200": {
9416
+ "description": "The file, or the saving status when `metadata=true`.",
9417
+ "content": {
9418
+ "application/octet-stream": {
9419
+ "schema": {
9420
+ "type": "string",
9421
+ "format": "binary"
9422
+ }
9423
+ },
9424
+ "application/json": {
9425
+ "schema": {
9426
+ "type": "object",
9427
+ "required": [
9428
+ "status",
9429
+ "expires_at",
9430
+ "kind"
9431
+ ],
9432
+ "properties": {
9433
+ "status": {
9434
+ "type": "string",
9435
+ "enum": [
9436
+ "saving",
9437
+ "saved",
9438
+ "failed",
9439
+ "expired"
9440
+ ]
9441
+ },
9442
+ "expires_at": {
9443
+ "type": "string",
9444
+ "format": "date-time"
9445
+ },
9446
+ "content_type": {
9447
+ "type": [
9448
+ "string",
9449
+ "null"
9450
+ ]
9451
+ },
9452
+ "kind": {
9453
+ "type": "string",
9454
+ "enum": [
9455
+ "image",
9456
+ "video",
9457
+ "audio",
9458
+ "3d"
9459
+ ]
9460
+ }
9461
+ }
9462
+ },
9463
+ "example": {
9464
+ "status": "saved",
9465
+ "expires_at": "2026-11-06T08:00:00.000Z",
9466
+ "content_type": "video/mp4",
9467
+ "kind": "video"
9468
+ }
9469
+ }
9470
+ }
9471
+ },
9472
+ "302": {
9473
+ "description": "Redirect to a short-lived download URL for a saved image, video or audio file. The download URL lasts at most five minutes."
9474
+ },
9475
+ "404": {
9476
+ "description": "`media_not_found`: the token or file extension does not match the result.",
9477
+ "content": {
9478
+ "application/json": {
9479
+ "schema": {
9480
+ "$ref": "#/components/schemas/ApiError"
9481
+ }
9482
+ }
9483
+ }
9484
+ },
9485
+ "410": {
9486
+ "description": "`media_expired`: the 30-day period has ended, or saving failed more than 24 hours ago.",
9487
+ "content": {
9488
+ "application/json": {
9489
+ "schema": {
9490
+ "$ref": "#/components/schemas/ApiError"
9491
+ }
9492
+ }
9493
+ }
9494
+ },
9495
+ "502": {
9496
+ "description": "`media_unavailable`: the result is not available now. Retry after the `Retry-After` delay.",
9497
+ "content": {
9498
+ "application/json": {
9499
+ "schema": {
9500
+ "$ref": "#/components/schemas/ApiError"
9501
+ }
9502
+ }
9503
+ }
9504
+ },
9505
+ "503": {
9506
+ "description": "`media_unavailable`: the result is not available now. Retry after the `Retry-After` delay.",
9507
+ "content": {
9508
+ "application/json": {
9509
+ "schema": {
9510
+ "$ref": "#/components/schemas/ApiError"
9511
+ }
9512
+ }
9513
+ }
9514
+ }
9515
+ }
9516
+ }
9517
+ }
9518
+ },
9519
+ "components": {
9520
+ "securitySchemes": {
9521
+ "BearerAuth": {
9522
+ "type": "http",
9523
+ "scheme": "bearer",
9524
+ "bearerFormat": "API Key",
9525
+ "description": "API Key authentication. Create or manage API keys in [Dashboard > API > API Keys](https://tokenlab.sh/dashboard/api?tab=keys)."
9526
+ },
9527
+ "ManagementTokenAuth": {
9528
+ "type": "http",
9529
+ "scheme": "bearer",
9530
+ "bearerFormat": "Management Token",
9531
+ "description": "Management token authentication. Create or manage Management Tokens in [Dashboard > API > Management Tokens](https://tokenlab.sh/dashboard/api?tab=tokens)."
9532
+ },
9533
+ "GeminiApiKey": {
9534
+ "type": "apiKey",
9535
+ "in": "header",
9536
+ "name": "x-goog-api-key",
9537
+ "description": "TokenLab API key for Gemini requests."
9538
+ }
9539
+ },
9540
+ "schemas": {
9541
+ "ChatCompletionRequest": {
9542
+ "type": "object",
9543
+ "required": [
9544
+ "model",
9545
+ "messages"
9546
+ ],
9547
+ "properties": {
9548
+ "model": {
9549
+ "type": "string",
9550
+ "description": "ID of the model to use (e.g., gpt-5.4, claude-sonnet-4-6)",
9551
+ "example": "gpt-4o"
9552
+ },
9553
+ "messages": {
9554
+ "type": "array",
9555
+ "description": "A list of messages comprising the conversation",
9556
+ "items": {
9557
+ "$ref": "#/components/schemas/ChatMessage"
9558
+ },
9559
+ "minItems": 1
9560
+ },
9561
+ "temperature": {
9562
+ "type": "number",
9563
+ "minimum": 0,
9564
+ "maximum": 2,
9565
+ "default": 1,
9566
+ "description": "Sampling temperature (0-2)"
9567
+ },
9568
+ "top_p": {
9569
+ "type": "number",
9570
+ "minimum": 0,
9571
+ "maximum": 1,
9572
+ "default": 1,
9573
+ "description": "Nucleus sampling probability"
9574
+ },
9575
+ "n": {
9576
+ "type": "integer",
9577
+ "minimum": 1,
9578
+ "maximum": 128,
9579
+ "default": 1,
9580
+ "description": "Number of completions to generate"
9581
+ },
9582
+ "stream": {
9583
+ "type": "boolean",
9584
+ "default": false,
9585
+ "description": "If true, returns a stream of events"
9586
+ },
9587
+ "stop": {
9588
+ "oneOf": [
9589
+ {
9590
+ "type": "string"
9591
+ },
9592
+ {
9593
+ "type": "array",
9594
+ "items": {
9595
+ "type": "string"
9596
+ },
9597
+ "maxItems": 4
9598
+ }
9599
+ ],
9600
+ "description": "Stop sequences"
9601
+ },
9602
+ "max_tokens": {
9603
+ "type": "integer",
9604
+ "minimum": 1,
9605
+ "description": "Maximum number of tokens to generate"
9606
+ },
9607
+ "max_completion_tokens": {
9608
+ "type": "integer",
9609
+ "minimum": 1,
9610
+ "description": "Maximum completion tokens for newer reasoning-enabled model families"
9611
+ },
9612
+ "presence_penalty": {
9613
+ "type": "number",
9614
+ "minimum": -2,
9615
+ "maximum": 2,
9616
+ "default": 0,
9617
+ "description": "Presence penalty (-2 to 2)"
9618
+ },
9619
+ "frequency_penalty": {
9620
+ "type": "number",
9621
+ "minimum": -2,
9622
+ "maximum": 2,
9623
+ "default": 0,
9624
+ "description": "Frequency penalty (-2 to 2)"
9625
+ },
9626
+ "tools": {
9627
+ "type": "array",
9628
+ "description": "List of tools the model may call",
9629
+ "items": {
9630
+ "$ref": "#/components/schemas/Tool"
9631
+ }
9632
+ },
9633
+ "functions": {
9634
+ "type": "array",
9635
+ "description": "Deprecated function definitions retained by the official Chat Completions contract.",
9636
+ "items": {
9637
+ "type": "object",
9638
+ "additionalProperties": true
9639
+ }
9640
+ },
9641
+ "function_call": {
9642
+ "oneOf": [
9643
+ {
9644
+ "type": "string"
9645
+ },
9646
+ {
9647
+ "type": "object",
9648
+ "additionalProperties": true
9649
+ }
9650
+ ],
9651
+ "description": "Deprecated function-call selection retained by the official Chat Completions contract."
9652
+ },
9653
+ "tool_choice": {
9654
+ "oneOf": [
9655
+ {
9656
+ "type": "string",
9657
+ "enum": [
9658
+ "none",
9659
+ "auto",
9660
+ "required"
9661
+ ]
9662
+ },
9663
+ {
8415
9664
  "type": "object",
8416
9665
  "properties": {
8417
9666
  "type": {
@@ -8530,7 +9779,45 @@
8530
9779
  "string",
8531
9780
  "null"
8532
9781
  ],
8533
- "description": "Service tier hint where supported by the model."
9782
+ "description": "TokenLab serves this request at the standard service tier. auto and default are forwarded. Other values, such as flex, priority, fast and ultrafast, are ignored and billed at the standard price."
9783
+ },
9784
+ "anthropic_options": {
9785
+ "type": "object",
9786
+ "description": "Options for Claude models.",
9787
+ "properties": {
9788
+ "prompt_caching": {
9789
+ "type": "boolean",
9790
+ "description": "Set true to cache the start of the prompt on Claude models. TokenLab marks the end of the system prompt and the latest user message as cache points, unless a message already has cache_control."
9791
+ },
9792
+ "prompt_caching_ttl": {
9793
+ "type": "string",
9794
+ "enum": [
9795
+ "5m",
9796
+ "1h"
9797
+ ],
9798
+ "description": "Cache lifetime. Defaults to 5m. If the serving route does not support 1h, the 5-minute cache is used and the request is not rejected."
9799
+ }
9800
+ },
9801
+ "additionalProperties": true
9802
+ },
9803
+ "extra": {
9804
+ "type": "object",
9805
+ "description": "Extension options. extra.prompt_caching and extra.prompt_caching_ttl are the same as the anthropic_options fields.",
9806
+ "properties": {
9807
+ "prompt_caching": {
9808
+ "type": "boolean",
9809
+ "description": "Set true to cache the start of the prompt on Claude models. TokenLab marks the end of the system prompt and the latest user message as cache points, unless a message already has cache_control."
9810
+ },
9811
+ "prompt_caching_ttl": {
9812
+ "type": "string",
9813
+ "enum": [
9814
+ "5m",
9815
+ "1h"
9816
+ ],
9817
+ "description": "Cache lifetime. Defaults to 5m. If the serving route does not support 1h, the 5-minute cache is used and the request is not rejected."
9818
+ }
9819
+ },
9820
+ "additionalProperties": true
8534
9821
  }
8535
9822
  },
8536
9823
  "additionalProperties": true
@@ -8693,6 +9980,14 @@
8693
9980
  "tool_call_id": {
8694
9981
  "type": "string",
8695
9982
  "description": "ID of the tool call being responded to"
9983
+ },
9984
+ "reasoning_details": {
9985
+ "type": "array",
9986
+ "items": {
9987
+ "type": "object",
9988
+ "additionalProperties": true
9989
+ },
9990
+ "description": "Assistant messages only: the reasoning_details returned in an earlier response, sent back unchanged."
8696
9991
  }
8697
9992
  }
8698
9993
  },
@@ -8849,6 +10144,18 @@
8849
10144
  "string",
8850
10145
  "null"
8851
10146
  ]
10147
+ },
10148
+ "reasoning_content": {
10149
+ "type": "string",
10150
+ "description": "Thinking text, when the model thinks. Some models return only a summary, or no text."
10151
+ },
10152
+ "reasoning_details": {
10153
+ "type": "array",
10154
+ "items": {
10155
+ "type": "object",
10156
+ "additionalProperties": true
10157
+ },
10158
+ "description": "Thinking blocks with their signatures. To continue a conversation with thinking, send them back unchanged in the assistant message."
8852
10159
  }
8853
10160
  }
8854
10161
  },
@@ -9045,14 +10352,13 @@
9045
10352
  "ImageGenerationRequest": {
9046
10353
  "type": "object",
9047
10354
  "required": [
9048
- "model",
9049
- "prompt"
10355
+ "model"
9050
10356
  ],
9051
10357
  "properties": {
9052
10358
  "prompt": {
9053
10359
  "type": "string",
9054
10360
  "maxLength": 4000,
9055
- "description": "Image description"
10361
+ "description": "Image description. Required for every model that takes a prompt; a tool whose contract lists no prompt (background removal, upscaling, vectorizing) is called without one."
9056
10362
  },
9057
10363
  "model": {
9058
10364
  "type": "string",
@@ -9106,7 +10412,7 @@
9106
10412
  },
9107
10413
  "size": {
9108
10414
  "type": "string",
9109
- "description": "Image size. Defaults are model-specific. For gpt-image-2, omit this field or use auto for automatic sizing, or send WIDTHxHEIGHT; custom dimensions must both be multiples of 16, longest edge <= 3840px, long/short ratio <= 3:1, and total pixels between 655,360 and 8,294,400."
10415
+ "description": "Image size. Defaults are model-specific. For gpt-image-2, omit this field or use auto for automatic sizing, or send WIDTHxHEIGHT; custom dimensions must both be multiples of 16, longest edge <= 3840px, long/short ratio <= 3:1, and total pixels between 655,360 and 8,294,400. For Google image models with resolution tiers (gemini-3.1-flash-image, gemini-3-pro-image, gemini-3.1-flash-lite-image, gemini-nano-banana-2.1, nano-banana-2, nano-banana-2.1, nano-banana-pro), send an output size from the model's size table or a resolution tier: 1K, 2K, or 4K. TokenLab sends a tier as resolution. A tier that the model does not support, or a tier that is different from resolution, returns 400 invalid_image_size_contract. The recommended form for these models is aspect_ratio with resolution."
9110
10416
  },
9111
10417
  "quality": {
9112
10418
  "type": "string",
@@ -9142,8 +10448,7 @@
9142
10448
  "url",
9143
10449
  "b64_json"
9144
10450
  ],
9145
- "default": "url",
9146
- "description": "Response format"
10451
+ "description": "How the images are returned. Omitted: when the model returns image bytes, each image is in data[].b64_json, and also in data[].url when TokenLab stored it; when the model returns a link, each image is in data[].url. url: only data[].url. b64_json: only data[].b64_json. Links are TokenLab media-result URLs that stay valid for 30 days."
9147
10452
  },
9148
10453
  "async": {
9149
10454
  "type": "boolean",
@@ -9208,8 +10513,7 @@
9208
10513
  "ImageGenerationMultipartRequest": {
9209
10514
  "type": "object",
9210
10515
  "required": [
9211
- "model",
9212
- "prompt"
10516
+ "model"
9213
10517
  ],
9214
10518
  "properties": {
9215
10519
  "model": {
@@ -9219,7 +10523,7 @@
9219
10523
  "prompt": {
9220
10524
  "type": "string",
9221
10525
  "maxLength": 4000,
9222
- "description": "Image description"
10526
+ "description": "Image description. Required for every model that takes a prompt; a tool whose contract lists no prompt (background removal, upscaling, vectorizing) is called without one."
9223
10527
  },
9224
10528
  "operation": {
9225
10529
  "type": "string",
@@ -9376,6 +10680,9 @@
9376
10680
  },
9377
10681
  "error_details": {
9378
10682
  "$ref": "#/components/schemas/AsyncTaskErrorDetails"
10683
+ },
10684
+ "media_retention": {
10685
+ "$ref": "#/components/schemas/MediaRetention"
9379
10686
  }
9380
10687
  },
9381
10688
  "required": [
@@ -9386,14 +10693,14 @@
9386
10693
  "AudioSpeechRequest": {
9387
10694
  "type": "object",
9388
10695
  "required": [
10696
+ "model",
9389
10697
  "input"
9390
10698
  ],
9391
10699
  "properties": {
9392
10700
  "model": {
9393
10701
  "type": "string",
9394
- "default": "tts-1",
9395
- "description": "TTS model. Query GET /v1/models?recommended_for=tts for the current shortlist.",
9396
- "example": "tts-1"
10702
+ "description": "TTS model. There is no default model. Query GET /v1/models?recommended_for=tts for the current shortlist.",
10703
+ "example": "grok-tts"
9397
10704
  },
9398
10705
  "input": {
9399
10706
  "type": "string",
@@ -9451,7 +10758,7 @@
9451
10758
  "sse"
9452
10759
  ],
9453
10760
  "default": "audio",
9454
- "description": "TokenLab delivery format. stream_format=sse is not supported for tts-1 or tts-1-hd."
10761
+ "description": "TokenLab delivery format."
9455
10762
  },
9456
10763
  "speed": {
9457
10764
  "type": "number",
@@ -9482,8 +10789,8 @@
9482
10789
  },
9483
10790
  "model": {
9484
10791
  "type": "string",
9485
- "description": "Model to use (whisper-1)",
9486
- "example": "whisper-1"
10792
+ "description": "Transcription model ID. There is no default model.",
10793
+ "example": "whisper-large-v3"
9487
10794
  },
9488
10795
  "language": {
9489
10796
  "type": "string",
@@ -10014,6 +11321,9 @@
10014
11321
  "draft_task_id": {
10015
11322
  "type": "string",
10016
11323
  "description": "Seedance draft task identifier when returned by the adapter."
11324
+ },
11325
+ "media_retention": {
11326
+ "$ref": "#/components/schemas/MediaRetention"
10017
11327
  }
10018
11328
  },
10019
11329
  "required": [
@@ -10143,6 +11453,9 @@
10143
11453
  },
10144
11454
  "fbx_url": {
10145
11455
  "type": "string"
11456
+ },
11457
+ "media_retention": {
11458
+ "$ref": "#/components/schemas/MediaRetention"
10146
11459
  }
10147
11460
  }
10148
11461
  },
@@ -10472,21 +11785,44 @@
10472
11785
  ]
10473
11786
  },
10474
11787
  "input_per_1m": {
10475
- "type": "string"
11788
+ "type": "string",
11789
+ "description": "TokenLab Verified price per 1M input tokens. Omitted when the model has no Verified supply (`deliveryAvailability.verified` is false)."
10476
11790
  },
10477
11791
  "output_per_1m": {
10478
- "type": "string"
11792
+ "type": "string",
11793
+ "description": "TokenLab Verified price per 1M output tokens. Omitted when the model has no Verified supply (`deliveryAvailability.verified` is false)."
10479
11794
  },
10480
11795
  "per_request": {
10481
- "type": "string"
11796
+ "type": "string",
11797
+ "description": "TokenLab Verified price per request. Omitted when the model has no Verified supply (`deliveryAvailability.verified` is false)."
10482
11798
  },
10483
11799
  "min_price": {
10484
11800
  "type": "string",
10485
- "description": "Minimum TokenLab price for a structured pricing model."
11801
+ "description": "Lowest TokenLab Verified price for a model with structured pricing. Omitted when the model has no Verified supply (`deliveryAvailability.verified` is false)."
10486
11802
  },
10487
11803
  "max_price": {
10488
11804
  "type": "string",
10489
- "description": "Maximum TokenLab price for a structured pricing model."
11805
+ "description": "Highest TokenLab Verified price for a model with structured pricing. Omitted when the model has no Verified supply (`deliveryAvailability.verified` is false)."
11806
+ },
11807
+ "official_input_per_1m": {
11808
+ "type": "string",
11809
+ "description": "Official price per 1M input tokens. Requests that Official delivers are billed at this price."
11810
+ },
11811
+ "official_output_per_1m": {
11812
+ "type": "string",
11813
+ "description": "Official price per 1M output tokens. Requests that Official delivers are billed at this price."
11814
+ },
11815
+ "official_per_request": {
11816
+ "type": "string",
11817
+ "description": "Official price per request. Requests that Official delivers are billed at this price."
11818
+ },
11819
+ "official_min_price": {
11820
+ "type": "string",
11821
+ "description": "Lowest Official price for a model with structured pricing."
11822
+ },
11823
+ "official_max_price": {
11824
+ "type": "string",
11825
+ "description": "Highest Official price for a model with structured pricing."
10490
11826
  },
10491
11827
  "has_complex_pricing": {
10492
11828
  "type": "boolean"
@@ -10643,7 +11979,7 @@
10643
11979
  },
10644
11980
  "code": {
10645
11981
  "type": "string",
10646
- "description": "Error code"
11982
+ "description": "Error code. Branch on this value, not on `message`. 400 codes include `invalid_request_error`, `missing_required_parameter`, `invalid_value`, `invalid_image_url`, `unsupported_model_capability` and `unpriceable_selection`."
10647
11983
  },
10648
11984
  "param": {
10649
11985
  "type": "string",
@@ -12144,6 +13480,44 @@
12144
13480
  "model": {
12145
13481
  "type": "string"
12146
13482
  },
13483
+ "deliveryAvailability": {
13484
+ "type": "object",
13485
+ "description": "Current model availability by delivery tier; omitted when the source projection is unavailable.",
13486
+ "properties": {
13487
+ "verified": {
13488
+ "type": "boolean",
13489
+ "description": "Whether this model has eligible TokenLab Verified delivery supply."
13490
+ },
13491
+ "official": {
13492
+ "type": "boolean",
13493
+ "description": "Whether this model has eligible Official delivery supply."
13494
+ },
13495
+ "operations": {
13496
+ "type": "object",
13497
+ "additionalProperties": {
13498
+ "type": "object",
13499
+ "properties": {
13500
+ "verified": {
13501
+ "type": "boolean"
13502
+ },
13503
+ "official": {
13504
+ "type": "boolean"
13505
+ }
13506
+ },
13507
+ "required": [
13508
+ "verified",
13509
+ "official"
13510
+ ],
13511
+ "additionalProperties": false
13512
+ }
13513
+ }
13514
+ },
13515
+ "required": [
13516
+ "verified",
13517
+ "official"
13518
+ ],
13519
+ "additionalProperties": false
13520
+ },
12147
13521
  "pricing_unit": {
12148
13522
  "type": "string"
12149
13523
  },
@@ -12178,8 +13552,12 @@
12178
13552
  "additionalProperties": true
12179
13553
  },
12180
13554
  "scalar_pricing": {
12181
- "type": "object",
12182
- "additionalProperties": true
13555
+ "$ref": "#/components/schemas/ScalarPricing",
13556
+ "description": "TokenLab Verified price. The price fields are null when the model has no Verified supply (`deliveryAvailability.verified` is false)."
13557
+ },
13558
+ "official_scalar_pricing": {
13559
+ "$ref": "#/components/schemas/ScalarPricing",
13560
+ "description": "Official price. Requests that Official delivers are billed at this price."
12183
13561
  }
12184
13562
  },
12185
13563
  "additionalProperties": true
@@ -12654,6 +14032,44 @@
12654
14032
  "provider": {
12655
14033
  "type": "string"
12656
14034
  },
14035
+ "deliveryAvailability": {
14036
+ "type": "object",
14037
+ "description": "Current model availability by delivery tier; omitted when the source projection is unavailable.",
14038
+ "properties": {
14039
+ "verified": {
14040
+ "type": "boolean",
14041
+ "description": "Whether this model has eligible TokenLab Verified delivery supply."
14042
+ },
14043
+ "official": {
14044
+ "type": "boolean",
14045
+ "description": "Whether this model has eligible Official delivery supply."
14046
+ },
14047
+ "operations": {
14048
+ "type": "object",
14049
+ "additionalProperties": {
14050
+ "type": "object",
14051
+ "properties": {
14052
+ "verified": {
14053
+ "type": "boolean"
14054
+ },
14055
+ "official": {
14056
+ "type": "boolean"
14057
+ }
14058
+ },
14059
+ "required": [
14060
+ "verified",
14061
+ "official"
14062
+ ],
14063
+ "additionalProperties": false
14064
+ }
14065
+ }
14066
+ },
14067
+ "required": [
14068
+ "verified",
14069
+ "official"
14070
+ ],
14071
+ "additionalProperties": false
14072
+ },
12657
14073
  "is_lock_price": {
12658
14074
  "type": "boolean"
12659
14075
  },
@@ -12673,19 +14089,43 @@
12673
14089
  "type": [
12674
14090
  "string",
12675
14091
  "null"
12676
- ]
14092
+ ],
14093
+ "description": "TokenLab Verified price per 1M input tokens. Omitted when the model has no Verified supply (`deliveryAvailability.verified` is false)."
12677
14094
  },
12678
14095
  "output_per_1m_tokens": {
12679
14096
  "type": [
12680
14097
  "string",
12681
14098
  "null"
12682
- ]
14099
+ ],
14100
+ "description": "TokenLab Verified price per 1M output tokens. Omitted when the model has no Verified supply (`deliveryAvailability.verified` is false)."
12683
14101
  },
12684
14102
  "lock_price_per_request": {
12685
14103
  "type": [
12686
14104
  "string",
12687
14105
  "null"
12688
- ]
14106
+ ],
14107
+ "description": "TokenLab Verified price per request. Omitted when the model has no Verified supply (`deliveryAvailability.verified` is false)."
14108
+ },
14109
+ "official_input_per_1m_tokens": {
14110
+ "type": [
14111
+ "string",
14112
+ "null"
14113
+ ],
14114
+ "description": "Official price per 1M input tokens. Requests that Official delivers are billed at this price."
14115
+ },
14116
+ "official_output_per_1m_tokens": {
14117
+ "type": [
14118
+ "string",
14119
+ "null"
14120
+ ],
14121
+ "description": "Official price per 1M output tokens. Requests that Official delivers are billed at this price."
14122
+ },
14123
+ "official_lock_price_per_request": {
14124
+ "type": [
14125
+ "string",
14126
+ "null"
14127
+ ],
14128
+ "description": "Official price per request. Requests that Official delivers are billed at this price."
12689
14129
  },
12690
14130
  "has_complex_pricing": {
12691
14131
  "type": "boolean"
@@ -13195,7 +14635,7 @@
13195
14635
  "model": {
13196
14636
  "type": "string",
13197
14637
  "description": "Model to use for multimodal embeddings",
13198
- "example": "jina-embeddings-v4"
14638
+ "example": "qwen3-vl-embedding"
13199
14639
  },
13200
14640
  "input": {
13201
14641
  "oneOf": [
@@ -13371,8 +14811,12 @@
13371
14811
  "additionalProperties": false
13372
14812
  },
13373
14813
  "pricing": {
13374
- "type": "object",
13375
- "additionalProperties": true
14814
+ "$ref": "#/components/schemas/ScalarPricing",
14815
+ "description": "TokenLab Verified price. The price fields are null when the model has no Verified supply (`deliveryAvailability.verified` is false)."
14816
+ },
14817
+ "official_pricing": {
14818
+ "$ref": "#/components/schemas/ScalarPricing",
14819
+ "description": "Official price. Requests that Official delivers are billed at this price."
13376
14820
  },
13377
14821
  "capabilities": {
13378
14822
  "type": "array",
@@ -13404,12 +14848,21 @@
13404
14848
  "pricing_unit": {
13405
14849
  "type": "string"
13406
14850
  },
13407
- "cache_pricing": {
14851
+ "cache_pricing": {
14852
+ "type": [
14853
+ "object",
14854
+ "null"
14855
+ ],
14856
+ "additionalProperties": true,
14857
+ "description": "TokenLab Verified prompt-cache prices. Null or omitted when the model has no Verified supply (`deliveryAvailability.verified` is false)."
14858
+ },
14859
+ "official_cache_pricing": {
13408
14860
  "type": [
13409
14861
  "object",
13410
14862
  "null"
13411
14863
  ],
13412
- "additionalProperties": true
14864
+ "additionalProperties": true,
14865
+ "description": "Official prompt-cache prices. Null or omitted when none are published."
13413
14866
  },
13414
14867
  "has_complex_pricing": {
13415
14868
  "type": "boolean"
@@ -13623,6 +15076,7 @@
13623
15076
  "required": [
13624
15077
  "aliases",
13625
15078
  "pricing",
15079
+ "official_pricing",
13626
15080
  "capabilities",
13627
15081
  "max_input_tokens",
13628
15082
  "max_output_tokens",
@@ -13684,8 +15138,12 @@
13684
15138
  "additionalProperties": false
13685
15139
  },
13686
15140
  "pricing": {
13687
- "type": "object",
13688
- "additionalProperties": true
15141
+ "$ref": "#/components/schemas/ScalarPricing",
15142
+ "description": "TokenLab Verified price. The price fields are null when the model has no Verified supply (`deliveryAvailability.verified` is false)."
15143
+ },
15144
+ "official_pricing": {
15145
+ "$ref": "#/components/schemas/ScalarPricing",
15146
+ "description": "Official price. Requests that Official delivers are billed at this price."
13689
15147
  },
13690
15148
  "capabilities": {
13691
15149
  "type": "array",
@@ -13722,7 +15180,16 @@
13722
15180
  "object",
13723
15181
  "null"
13724
15182
  ],
13725
- "additionalProperties": true
15183
+ "additionalProperties": true,
15184
+ "description": "TokenLab Verified prompt-cache prices. Null or omitted when the model has no Verified supply (`deliveryAvailability.verified` is false)."
15185
+ },
15186
+ "official_cache_pricing": {
15187
+ "type": [
15188
+ "object",
15189
+ "null"
15190
+ ],
15191
+ "additionalProperties": true,
15192
+ "description": "Official prompt-cache prices. Null or omitted when none are published."
13726
15193
  },
13727
15194
  "has_complex_pricing": {
13728
15195
  "type": "boolean"
@@ -15553,6 +17020,18 @@
15553
17020
  "null"
15554
17021
  ]
15555
17022
  },
17023
+ "webSearch": {
17024
+ "type": [
17025
+ "string",
17026
+ "null"
17027
+ ]
17028
+ },
17029
+ "groundedPrompt": {
17030
+ "type": [
17031
+ "string",
17032
+ "null"
17033
+ ]
17034
+ },
15556
17035
  "structured": {
15557
17036
  "anyOf": [
15558
17037
  {
@@ -16269,6 +17748,262 @@
16269
17748
  "additionalProperties": false
16270
17749
  }
16271
17750
  ]
17751
+ },
17752
+ "GeminiFileResource": {
17753
+ "type": "object",
17754
+ "description": "A Gemini file in the current Workspace. Fields are returned when available.",
17755
+ "properties": {
17756
+ "name": {
17757
+ "type": "string",
17758
+ "description": "File resource name such as files/{fileId}."
17759
+ },
17760
+ "displayName": {
17761
+ "type": "string",
17762
+ "description": "Human-readable file name."
17763
+ },
17764
+ "mimeType": {
17765
+ "type": "string",
17766
+ "description": "Media MIME type."
17767
+ },
17768
+ "sizeBytes": {
17769
+ "type": "string",
17770
+ "description": "File byte size as a decimal string."
17771
+ },
17772
+ "uri": {
17773
+ "type": "string",
17774
+ "description": "File URI to use in Gemini content parts."
17775
+ },
17776
+ "state": {
17777
+ "type": "string",
17778
+ "description": "Processing state reported by the service. Wait until the file is ready before generation."
17779
+ },
17780
+ "createTime": {
17781
+ "type": "string",
17782
+ "format": "date-time"
17783
+ },
17784
+ "updateTime": {
17785
+ "type": "string",
17786
+ "format": "date-time"
17787
+ },
17788
+ "expirationTime": {
17789
+ "type": "string",
17790
+ "format": "date-time"
17791
+ },
17792
+ "error": {
17793
+ "type": "object",
17794
+ "additionalProperties": true
17795
+ }
17796
+ },
17797
+ "additionalProperties": true
17798
+ },
17799
+ "GeminiFileCreateRequest": {
17800
+ "type": "object",
17801
+ "description": "Gemini file metadata request. Supported fields and values are validated by the service. File bytes are uploaded through /upload/v1beta/files.",
17802
+ "properties": {
17803
+ "file": {
17804
+ "$ref": "#/components/schemas/GeminiFileResource"
17805
+ }
17806
+ },
17807
+ "additionalProperties": true
17808
+ },
17809
+ "GeminiFileRegisterRequest": {
17810
+ "type": "object",
17811
+ "description": "Gemini file registration request. Use only sources and fields accepted by the service; registration does not upload local bytes.",
17812
+ "additionalProperties": true
17813
+ },
17814
+ "GeminiCachedContentRequest": {
17815
+ "type": "object",
17816
+ "required": [
17817
+ "model"
17818
+ ],
17819
+ "properties": {
17820
+ "model": {
17821
+ "type": "string",
17822
+ "minLength": 1,
17823
+ "description": "Current TokenLab model ID that supports Gemini cached content."
17824
+ },
17825
+ "displayName": {
17826
+ "type": "string",
17827
+ "description": "Human-readable cache name."
17828
+ },
17829
+ "ttl": {
17830
+ "type": "string",
17831
+ "description": "Positive duration such as 3600s. Supported lifetime is validated by the service."
17832
+ },
17833
+ "expireTime": {
17834
+ "type": "string",
17835
+ "format": "date-time",
17836
+ "description": "Requested expiration time; use ttl or expireTime as supported by the service."
17837
+ },
17838
+ "contents": {
17839
+ "$ref": "#/components/schemas/GeminiRequest/properties/contents"
17840
+ },
17841
+ "systemInstruction": {
17842
+ "$ref": "#/components/schemas/GeminiRequest/properties/systemInstruction"
17843
+ },
17844
+ "tools": {
17845
+ "$ref": "#/components/schemas/GeminiRequest/properties/tools"
17846
+ },
17847
+ "toolConfig": {
17848
+ "$ref": "#/components/schemas/GeminiRequest/properties/toolConfig"
17849
+ }
17850
+ },
17851
+ "additionalProperties": true
17852
+ },
17853
+ "GeminiCachedContentResource": {
17854
+ "type": "object",
17855
+ "description": "Cached content belonging to the current Workspace. Use the returned name as cachedContent in Gemini generation.",
17856
+ "properties": {
17857
+ "name": {
17858
+ "type": "string",
17859
+ "description": "Resource name such as cachedContents/{cacheId}."
17860
+ },
17861
+ "model": {
17862
+ "type": "string",
17863
+ "description": "TokenLab model ID associated with the cached content."
17864
+ },
17865
+ "displayName": {
17866
+ "type": "string",
17867
+ "description": "Human-readable cache name."
17868
+ },
17869
+ "createTime": {
17870
+ "type": "string",
17871
+ "format": "date-time"
17872
+ },
17873
+ "updateTime": {
17874
+ "type": "string",
17875
+ "format": "date-time"
17876
+ },
17877
+ "expireTime": {
17878
+ "type": "string",
17879
+ "format": "date-time"
17880
+ },
17881
+ "usageMetadata": {
17882
+ "type": "object",
17883
+ "additionalProperties": true
17884
+ }
17885
+ },
17886
+ "additionalProperties": true
17887
+ },
17888
+ "GeminiCachedContentUpdateRequest": {
17889
+ "type": "object",
17890
+ "description": "Update cached content lifetime using the fields accepted by the service.",
17891
+ "properties": {
17892
+ "ttl": {
17893
+ "type": "string",
17894
+ "description": "Positive duration such as 3600s."
17895
+ },
17896
+ "expireTime": {
17897
+ "type": "string",
17898
+ "format": "date-time"
17899
+ }
17900
+ },
17901
+ "additionalProperties": true
17902
+ },
17903
+ "MediaRetention": {
17904
+ "type": "object",
17905
+ "description": "Saving status of the media results in this response. Present when the status is known within the response time limit; when it is absent, the media URLs still work.",
17906
+ "required": [
17907
+ "days",
17908
+ "items"
17909
+ ],
17910
+ "properties": {
17911
+ "days": {
17912
+ "type": "integer",
17913
+ "description": "Days a media-result URL stays valid after the result is first recorded.",
17914
+ "example": 30
17915
+ },
17916
+ "items": {
17917
+ "type": "array",
17918
+ "items": {
17919
+ "type": "object",
17920
+ "required": [
17921
+ "url",
17922
+ "kind",
17923
+ "status",
17924
+ "expires_at"
17925
+ ],
17926
+ "properties": {
17927
+ "url": {
17928
+ "type": "string",
17929
+ "format": "uri"
17930
+ },
17931
+ "kind": {
17932
+ "type": "string",
17933
+ "enum": [
17934
+ "image",
17935
+ "video",
17936
+ "audio",
17937
+ "3d"
17938
+ ]
17939
+ },
17940
+ "content_type": {
17941
+ "type": "string"
17942
+ },
17943
+ "status": {
17944
+ "type": "string",
17945
+ "enum": [
17946
+ "saving",
17947
+ "saved",
17948
+ "failed",
17949
+ "expired"
17950
+ ]
17951
+ },
17952
+ "expires_at": {
17953
+ "type": "string",
17954
+ "format": "date-time"
17955
+ }
17956
+ },
17957
+ "additionalProperties": false
17958
+ }
17959
+ }
17960
+ },
17961
+ "additionalProperties": false
17962
+ },
17963
+ "ScalarPricing": {
17964
+ "type": "object",
17965
+ "description": "One scalar price layer in USD. Token prices are per 1M tokens.",
17966
+ "properties": {
17967
+ "input_per_1m": {
17968
+ "type": [
17969
+ "string",
17970
+ "null"
17971
+ ],
17972
+ "description": "Price per 1M input tokens. Null for per-request pricing."
17973
+ },
17974
+ "output_per_1m": {
17975
+ "type": [
17976
+ "string",
17977
+ "null"
17978
+ ],
17979
+ "description": "Price per 1M output tokens. Null for per-request pricing."
17980
+ },
17981
+ "per_request": {
17982
+ "type": [
17983
+ "string",
17984
+ "null"
17985
+ ],
17986
+ "description": "Price per request. Null for per-token pricing."
17987
+ },
17988
+ "is_lock_price": {
17989
+ "type": "boolean",
17990
+ "description": "Whether the model is priced per request."
17991
+ },
17992
+ "currency": {
17993
+ "type": "string",
17994
+ "enum": [
17995
+ "USD"
17996
+ ]
17997
+ }
17998
+ },
17999
+ "required": [
18000
+ "input_per_1m",
18001
+ "output_per_1m",
18002
+ "per_request",
18003
+ "is_lock_price",
18004
+ "currency"
18005
+ ],
18006
+ "additionalProperties": true
16272
18007
  }
16273
18008
  },
16274
18009
  "responses": {
@@ -16279,18 +18014,77 @@
16279
18014
  "schema": {
16280
18015
  "$ref": "#/components/schemas/ValidationError"
16281
18016
  },
16282
- "example": {
16283
- "error": {
16284
- "message": "model: Model is required",
16285
- "type": "invalid_request_error",
16286
- "param": "model"
18017
+ "examples": {
18018
+ "validation": {
18019
+ "summary": "Invalid field",
18020
+ "value": {
18021
+ "error": {
18022
+ "message": "model: Model is required",
18023
+ "type": "invalid_request_error",
18024
+ "param": "model"
18025
+ },
18026
+ "validation_errors": [
18027
+ {
18028
+ "field": "model",
18029
+ "message": "Model is required"
18030
+ }
18031
+ ]
18032
+ }
18033
+ },
18034
+ "missingRequiredParameter": {
18035
+ "summary": "Required field is missing",
18036
+ "value": {
18037
+ "error": {
18038
+ "message": "model is required",
18039
+ "type": "invalid_request_error",
18040
+ "code": "missing_required_parameter",
18041
+ "param": "model"
18042
+ }
18043
+ }
16287
18044
  },
16288
- "validation_errors": [
16289
- {
16290
- "field": "model",
16291
- "message": "Model is required"
18045
+ "invalidValue": {
18046
+ "summary": "Value the model does not accept",
18047
+ "value": {
18048
+ "error": {
18049
+ "message": "reasoning_effort \"max\" is not supported for this model. Supported values: low, medium, high.",
18050
+ "type": "invalid_request_error",
18051
+ "code": "invalid_value",
18052
+ "param": "reasoning_effort"
18053
+ }
16292
18054
  }
16293
- ]
18055
+ },
18056
+ "invalidImageUrl": {
18057
+ "summary": "Image URL cannot be used",
18058
+ "value": {
18059
+ "error": {
18060
+ "message": "image_url could not be downloaded from the image URL: the connection to the image host timed out. The URL must be publicly reachable from the internet (hosts that serve only mainland China networks can be unreachable). Use a different image URL or send the image as a base64 data URL.",
18061
+ "type": "invalid_request_error",
18062
+ "code": "invalid_image_url",
18063
+ "param": "image_url"
18064
+ }
18065
+ }
18066
+ },
18067
+ "unsupportedModelCapability": {
18068
+ "summary": "No route of the Delivery tier supports a parameter",
18069
+ "value": {
18070
+ "error": {
18071
+ "message": "Model gpt-4.1-mini cannot serve this request for operation 'chat' on the routes this request can use: web_search_options is not supported. Change these parameters, or choose another model or Delivery tier.",
18072
+ "type": "invalid_request_error",
18073
+ "code": "unsupported_model_capability"
18074
+ }
18075
+ }
18076
+ },
18077
+ "unpriceableSelection": {
18078
+ "summary": "Video request cannot be priced",
18079
+ "value": {
18080
+ "error": {
18081
+ "message": "This image-to-video request cannot be priced without resolution. Set resolution explicitly if the operation accepts it.",
18082
+ "type": "invalid_request_error",
18083
+ "code": "unpriceable_selection",
18084
+ "param": "resolution"
18085
+ }
18086
+ }
18087
+ }
16294
18088
  }
16295
18089
  }
16296
18090
  }
@@ -16490,10 +18284,32 @@
16490
18284
  "request_id": "req_01JEXAMPLE"
16491
18285
  }
16492
18286
  }
18287
+ },
18288
+ "pricingUnavailable": {
18289
+ "summary": "TokenLab cannot price this request",
18290
+ "value": {
18291
+ "error": {
18292
+ "message": "TokenLab cannot serve model gpt-image-2 with operation 'image-edit' right now because it cannot price this request on the routes this request can use. The request was not charged.",
18293
+ "type": "all_channels_failed",
18294
+ "code": "model_pricing_unavailable",
18295
+ "retryable": false,
18296
+ "request_id": "req_01JEXAMPLE"
18297
+ }
18298
+ }
16493
18299
  }
16494
18300
  }
16495
18301
  }
16496
18302
  }
18303
+ },
18304
+ "GeminiResourceError": {
18305
+ "description": "Gemini-format resource error",
18306
+ "content": {
18307
+ "application/json": {
18308
+ "schema": {
18309
+ "$ref": "#/components/schemas/GeminiErrorResponse"
18310
+ }
18311
+ }
18312
+ }
16497
18313
  }
16498
18314
  },
16499
18315
  "parameters": {