### Get All Tokens Response Example Source: https://context7.com/xiaomo-123/flow2api/llms.txt Example JSON response detailing a token's properties, including its ID, session and access tokens, expiration, user information, and usage counts. ```json [ { "id": 1, "st": "session_token_value", "at": "access_token_value", "at_expires": "2025-01-15T04:46:04.000Z", "email": "user@example.com", "name": "User Name", "remark": "主账号", "is_active": true, "credits": 920, "current_project_id": "uuid-project-id", "current_project_name": "My Project", "image_enabled": true, "video_enabled": true, "image_concurrency": -1, "video_concurrency": -1, "image_count": 150, "video_count": 30, "error_count": 2 } ] ``` -------------------------------- ### Admin Login Response Example Source: https://context7.com/xiaomo-123/flow2api/llms.txt Example JSON response after a successful administrator login, containing a session token. ```json { "success": true, "token": "admin-aBcDeFgHiJkLmNoPqRsTuVwXyZ123456", "username": "admin" } ``` -------------------------------- ### Add New Token Response Example Source: https://context7.com/xiaomo-123/flow2api/llms.txt Example JSON response upon successfully adding a new token, confirming success and providing basic details of the added token. ```json { "success": true, "message": "Token添加成功", "token": { "id": 2, "email": "newuser@example.com", "credits": 1000, "project_id": "new-project-uuid", "project_name": "我的项目" } } ``` -------------------------------- ### Refresh Token Balance Response Example Source: https://context7.com/xiaomo-123/flow2api/llms.txt Example JSON response after successfully refreshing a token's balance, showing the new credit amount. ```json { "success": true, "message": "余额刷新成功", "credits": 850 } ``` -------------------------------- ### ST to AT Conversion Tool Response Example Source: https://context7.com/xiaomo-123/flow2api/llms.txt Example JSON response from the ST to AT conversion tool, showing success, the converted access token, and its expiration. ```json { "success": true, "message": "ST converted to AT successfully", "access_token": "ya29.a0ARrdaM...", "email": "user@example.com", "expires": "2025-01-15T04:46:04.000Z" } ``` -------------------------------- ### Deploy Locally Source: https://github.com/xiaomo-123/flow2api/blob/main/README.md Steps to set up a local Python environment and start the service manually. ```bash # 克隆项目 git clone https://github.com/TheSmallHanCat/flow2api.git cd sora2api # 创建虚拟环境 python -m venv venv # 激活虚拟环境 # Windows venv\Scripts\activate # Linux/Mac source venv/bin/activate # 安装依赖 pip install -r requirements.txt # 启动服务 python main.py ``` -------------------------------- ### Batch Import Tokens Response Example Source: https://context7.com/xiaomo-123/flow2api/llms.txt Example JSON response after a batch token import, indicating success and summarizing the number of tokens added and updated. ```json { "success": true, "message": "导入完成", "added": 2, "updated": 0, "errors": [] } ``` -------------------------------- ### Refresh Access Token Response Example Source: https://context7.com/xiaomo-123/flow2api/llms.txt Example JSON response after successfully refreshing an Access Token, confirming the action and providing the new expiration time. ```json { "success": true, "message": "AT刷新成功", "token": { "id": 1, "email": "user@example.com", "at_expires": "2025-01-16T04:46:04.000Z" } } ``` -------------------------------- ### Deploy with Docker Source: https://github.com/xiaomo-123/flow2api/blob/main/README.md Commands to start the service using Docker Compose, either in standard mode or with a WARP proxy. ```bash # 克隆项目 git clone https://github.com/TheSmallHanCat/flow2api.git cd flow2api # 启动服务 docker-compose up -d # 查看日志 docker-compose logs -f ``` ```bash # 使用 WARP 代理启动 docker-compose -f docker-compose.warp.yml up -d # 查看日志 docker-compose -f docker-compose.warp.yml logs -f ``` -------------------------------- ### Docker Compose File Example Source: https://context7.com/xiaomo-123/flow2api/llms.txt Example docker-compose.yml configuration for Flow2API. This defines the service, build context, port mappings, volume mounts, environment variables, and restart policy. ```yaml version: '3.8' services: flow2api: build: . ports: - "8000:8000" volumes: - ./config:/app/config - ./data:/app/data environment: - TZ=Asia/Shanghai restart: unless-stopped ``` -------------------------------- ### GET /v1/models Source: https://context7.com/xiaomo-123/flow2api/llms.txt Retrieve a list of all supported image and video generation models. ```APIDOC ## GET /v1/models ### Description Retrieves all supported image and video generation models in OpenAI format. ### Method GET ### Endpoint /v1/models ### Response #### Success Response (200) - **object** (string) - The type of the object, which is 'list'. - **data** (array) - List of model objects. #### Response Example { "object": "list", "data": [ { "id": "gemini-2.5-flash-image-landscape", "object": "model", "owned_by": "flow2api", "description": "Image generation - GEM_PIX" } ] } ``` -------------------------------- ### Setting.toml Configuration File Source: https://context7.com/xiaomo-123/flow2api/llms.txt Example configuration for the setting.toml file. This file contains global settings, API keys, server configurations, proxy settings, generation timeouts, cache settings, and token refresh intervals. ```toml [global] api_key = "your_api_key" # 外部调用API使用的密钥 admin_username = "admin" # 管理后台用户名 admin_password = "your_password" # 管理后台密码 [flow] labs_base_url = "https://labs.google/fx/api" api_base_url = "https://aisandbox-pa.googleapis.com/v1" timeout = 120 # 请求超时时间(秒) poll_interval = 3.0 # 视频状态轮询间隔(秒) max_poll_attempts = 200 # 最大轮询次数 [server] host = "0.0.0.0" port = 8000 [proxy] proxy_enabled = false # 是否启用代理 proxy_url = "socks5://127.0.0.1:1080" # 代理地址 [generation] image_timeout = 300 # 图片生成超时(秒) video_timeout = 1500 # 视频生成超时(秒) [admin] error_ban_threshold = 3 # 连续错误N次后自动禁用Token [cache] enabled = false # 是否启用缓存 timeout = 7200 # 缓存超时(秒) base_url = "" # 缓存文件访问URL [token_refresh] interval = 3600 # Token自动刷新间隔(秒) ``` -------------------------------- ### Get Available Models List Source: https://context7.com/xiaomo-123/flow2api/llms.txt Retrieve a list of all supported image and video generation models in OpenAI format. Requires authentication. ```bash curl -X GET "http://localhost:8000/v1/models" \ -H "Authorization: Bearer han1234" ``` -------------------------------- ### Get Generation Timeout Configuration Source: https://context7.com/xiaomo-123/flow2api/llms.txt Retrieve the configured timeouts for image and video generation. ```bash curl -X GET "http://localhost:8000/api/config/generation" \ -H "Authorization: Bearer admin-aBcDeFgHiJkLmNoPqRsTuVwXyZ123456" ``` -------------------------------- ### Generate Video from Start and End Frames Source: https://github.com/xiaomo-123/flow2api/blob/main/README.md API request to generate a video transition between two provided images. ```bash curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Authorization: Bearer han1234" \ -H "Content-Type: application/json" \ -d '{ "model": "veo_3_1_i2v_s_fast_fl_landscape", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "从第一张图过渡到第二张图" }, { "type": "image_url", "image_url": { "url": "data:image/jpeg;base64,<首帧base64>" } }, { "type": "image_url", "image_url": { "url": "data:image/jpeg;base64,<尾帧base64>" } } ] } ], "stream": true }' ``` -------------------------------- ### Get Proxy Configuration Source: https://context7.com/xiaomo-123/flow2api/llms.txt Use this endpoint to retrieve the current proxy configuration settings. ```bash curl -X GET "http://localhost:8000/api/proxy/config" \ -H "Authorization: Bearer admin-aBcDeFgHiJkLmNoPqRsTuVwXyZ123456" ``` -------------------------------- ### Docker Compose Standard Deployment Source: https://context7.com/xiaomo-123/flow2api/llms.txt Instructions for deploying Flow2API using Docker Compose in standard mode without a proxy. Includes cloning the repository, starting the service, viewing logs, and stopping the service. ```bash # 克隆项目 git clone https://github.com/TheSmallHanCat/flow2api.git cd flow2api # 启动服务 docker-compose up -d # 查看日志 docker-compose logs -f # 停止服务 docker-compose down ``` -------------------------------- ### Get All Tokens API Source: https://context7.com/xiaomo-123/flow2api/llms.txt Retrieve detailed information for all tokens in the system, including balance and usage statistics. Requires an Authorization header with the admin token. ```bash curl -X GET "http://localhost:8000/api/tokens" \ -H "Authorization: Bearer admin-aBcDeFgHiJkLmNoPqRsTuVwXyZ123456" ``` -------------------------------- ### GET /api/tokens Source: https://context7.com/xiaomo-123/flow2api/llms.txt Retrieves a list of all tokens in the system along with their usage statistics and configuration. ```APIDOC ## GET /api/tokens ### Description Fetches detailed information for all tokens, including credits and concurrency limits. ### Method GET ### Endpoint http://localhost:8000/api/tokens ``` -------------------------------- ### Get System Statistics Source: https://context7.com/xiaomo-123/flow2api/llms.txt Retrieve overall system statistics, including token counts, generation statistics, and error counts. ```bash curl -X GET "http://localhost:8000/api/stats" \ -H "Authorization: Bearer admin-aBcDeFgHiJkLmNoPqRsTuVwXyZ123456" ``` -------------------------------- ### Proxy Configuration API Source: https://context7.com/xiaomo-123/flow2api/llms.txt APIs to get and update the proxy configuration for the service. ```APIDOC ## GET /api/proxy/config ### Description Retrieves the current proxy configuration. ### Method GET ### Endpoint /api/proxy/config ### Request Example ```bash curl -X GET "http://localhost:8000/api/proxy/config" \ -H "Authorization: Bearer admin-aBcDeFgHiJkLmNoPqRsTuVwXyZ123456" ``` ### Response #### Success Response (200) - **proxy_enabled** (boolean) - Indicates if the proxy is enabled. - **proxy_url** (string) - The URL of the proxy server. #### Response Example ```json { "proxy_enabled": true, "proxy_url": "socks5://127.0.0.1:1080" } ``` ## POST /api/proxy/config ### Description Updates the proxy configuration. ### Method POST ### Endpoint /api/proxy/config ### Request Body - **proxy_enabled** (boolean) - Required - Whether to enable the proxy. - **proxy_url** (string) - Required - The URL of the proxy server. ### Request Example ```json { "proxy_enabled": true, "proxy_url": "socks5://127.0.0.1:1080" } ``` ### Response #### Success Response (200) - **message** (string) - Confirmation message. #### Response Example ```json { "message": "Proxy configuration updated successfully." } ``` ``` -------------------------------- ### Get Token Refresh Configuration Source: https://context7.com/xiaomo-123/flow2api/llms.txt Retrieve the configuration for the automatic Access Token refresh feature. ```bash curl -X GET "http://localhost:8000/api/token-refresh/config" \ -H "Authorization: Bearer admin-aBcDeFgHiJkLmNoPqRsTuVwXyZ123456" ``` -------------------------------- ### Get Cache Configuration Source: https://context7.com/xiaomo-123/flow2api/llms.txt Retrieve the current configuration for the local cache, including its enabled status, timeout, and base URL. ```bash curl -X GET "http://localhost:8000/api/cache/config" \ -H "Authorization: Bearer admin-aBcDeFgHiJkLmNoPqRsTuVwXyZ123456" ``` -------------------------------- ### Cache Configuration API Source: https://context7.com/xiaomo-123/flow2api/llms.txt APIs to get and update the cache configuration for generation results. ```APIDOC ## GET /api/cache/config ### Description Retrieves the current cache configuration. ### Method GET ### Endpoint /api/cache/config ### Request Example ```bash curl -X GET "http://localhost:8000/api/cache/config" \ -H "Authorization: Bearer admin-aBcDeFgHiJkLmNoPqRsTuVwXyZ123456" ``` ### Response #### Success Response (200) - **enabled** (boolean) - Whether cache is enabled. - **timeout** (integer) - Cache timeout in seconds. - **base_url** (string) - The base URL for accessing cached files. #### Response Example ```json { "enabled": true, "timeout": 7200, "base_url": "https://your-domain.com" } ``` ## POST /api/cache/config ### Description Updates the cache configuration. ### Method POST ### Endpoint /api/cache/config ### Request Body - **enabled** (boolean) - Required - Whether to enable cache. - **timeout** (integer) - Required - Cache timeout in seconds. - **base_url** (string) - Required - The base URL for accessing cached files. ### Request Example ```json { "enabled": true, "timeout": 7200, "base_url": "https://your-domain.com" } ``` ### Response #### Success Response (200) - **message** (string) - Confirmation message. #### Response Example ```json { "message": "Cache configuration updated successfully." } ``` ``` -------------------------------- ### Generation Timeout Configuration API Source: https://context7.com/xiaomo-123/flow2api/llms.txt APIs to get and update the image and video generation timeout settings. ```APIDOC ## GET /api/config/generation ### Description Retrieves the current generation timeout configuration for images and videos. ### Method GET ### Endpoint /api/config/generation ### Request Example ```bash curl -X GET "http://localhost:8000/api/config/generation" \ -H "Authorization: Bearer admin-aBcDeFgHiJkLmNoPqRsTuVwXyZ123456" ``` ### Response #### Success Response (200) - **image_timeout** (integer) - Timeout for image generation in seconds. - **video_timeout** (integer) - Timeout for video generation in seconds. #### Response Example ```json { "image_timeout": 300, "video_timeout": 1500 } ``` ## POST /api/config/generation ### Description Updates the image and video generation timeout settings. ### Method POST ### Endpoint /api/config/generation ### Request Body - **image_timeout** (integer) - Required - Timeout for image generation in seconds. - **video_timeout** (integer) - Required - Timeout for video generation in seconds. ### Request Example ```json { "image_timeout": 300, "video_timeout": 1500 } ``` ### Response #### Success Response (200) - **message** (string) - Confirmation message. #### Response Example ```json { "message": "Generation timeout configuration updated successfully." } ``` ``` -------------------------------- ### Token Refresh Configuration API Source: https://context7.com/xiaomo-123/flow2api/llms.txt APIs to get and update the Access Token auto-refresh configuration. ```APIDOC ## GET /api/token-refresh/config ### Description Retrieves the current Access Token auto-refresh configuration. ### Method GET ### Endpoint /api/token-refresh/config ### Request Example ```bash curl -X GET "http://localhost:8000/api/token-refresh/config" \ -H "Authorization: Bearer admin-aBcDeFgHiJkLmNoPqRsTuVwXyZ123456" ``` ### Response #### Success Response (200) - **interval** (integer) - The interval in seconds for token refresh. #### Response Example ```json { "interval": 3600 } ``` ## POST /api/token-refresh/enabled ### Description Enables or disables the Access Token auto-refresh feature. ### Method POST ### Endpoint /api/token-refresh/enabled ### Request Body - **enabled** (boolean) - Required - Whether to enable or disable auto-refresh. ### Request Example ```json { "enabled": true } ``` ### Response #### Success Response (200) - **message** (string) - Confirmation message. #### Response Example ```json { "message": "Token refresh enabled successfully." } ``` ``` -------------------------------- ### Configuration File Explanation Source: https://context7.com/xiaomo-123/flow2api/llms.txt Explanation of the `setting.toml` configuration file. ```APIDOC ## Configuration File Explanation ### `setting.toml` Configuration This is the main configuration file, containing API keys, server settings, and proxy configurations. ```toml [global] api_key = "your_api_key" # API key for external calls admin_username = "admin" # Admin backend username admin_password = "your_password" # Admin backend password [flow] labs_base_url = "https://labs.google/fx/api" api_base_url = "https://aisandbox-pa.googleapis.com/v1" timeout = 120 # Request timeout in seconds poll_interval = 3.0 # Video status polling interval in seconds max_poll_attempts = 200 # Maximum polling attempts [server] host = "0.0.0.0" port = 8000 [proxy] proxy_enabled = false # Whether to enable proxy proxy_url = "socks5://127.0.0.1:1080" # Proxy address [generation] image_timeout = 300 # Image generation timeout in seconds video_timeout = 1500 # Video generation timeout in seconds [admin] error_ban_threshold = 3 # Auto-ban token after N consecutive errors [cache] enabled = false # Whether to enable cache timeout = 7200 # Cache timeout in seconds base_url = "" # URL for accessing cached files [token_refresh] interval = 3600 # Token auto-refresh interval in seconds ``` ``` -------------------------------- ### Generate Video from Reference Images Source: https://context7.com/xiaomo-123/flow2api/llms.txt Use this endpoint to create a video from multiple reference images. Supports an unlimited number of images. Ensure images are base64 encoded. ```bash curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Authorization: Bearer han1234" \ -H "Content-Type: application/json" \ -d '{ "model": "veo_3_0_r2v_fast_landscape", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "将这些产品图片制作成一个展示视频" }, { "type": "image_url", "image_url": {"url": "data:image/jpeg;base64,<图片1>"} }, { "type": "image_url", "image_url": {"url": "data:image/jpeg;base64,<图片2>"} }, { "type": "image_url", "image_url": {"url": "data:image/jpeg;base64,<图片3>"} } ] } ], "stream": true }' ``` -------------------------------- ### Image-to-Video Generation (First/Last Frame) Source: https://context7.com/xiaomo-123/flow2api/llms.txt Generate a transitional video using 1-2 images as the first and last frames. Supports streaming output. Ensure the correct model ID is used for landscape or portrait orientation. ```bash curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Authorization: Bearer han1234" \ -H "Content-Type: application/json" \ -d '{ "model": "veo_3_1_i2v_s_fast_fl_landscape", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "从第一张图平滑过渡到第二张图,展现日出到日落的变化" }, { "type": "image_url", "image_url": { "url": "data:image/jpeg;base64,<首帧图片base64>" } }, { "type": "image_url", "image_url": { "url": "data:image/jpeg;base64,<尾帧图片base64>" } } ] } ], "stream": true }' ``` -------------------------------- ### Docker Deployment Source: https://context7.com/xiaomo-123/flow2api/llms.txt Instructions for deploying Flow2API using Docker. ```APIDOC ## Docker Deployment ### Standard Mode Deployment This describes the standard Docker deployment without a proxy. ```bash # Clone the project git clone https://github.com/TheSmallHanCat/flow2api.git cd flow2api # Start the service docker-compose up -d # View logs docker-compose logs -f # Stop the service docker-compose down ``` **docker-compose.yml Configuration:** ```yaml version: '3.8' services: flow2api: build: . ports: - "8000:8000" volumes: - ./config:/app/config - ./data:/app/data environment: - TZ=Asia/Shanghai restart: unless-stopped ``` ### WARP Proxy Mode Deployment This describes deployment using Cloudflare WARP proxy. ```bash # Start with WARP proxy docker-compose -f docker-compose.warp.yml up -d # View logs docker-compose -f docker-compose.warp.yml logs -f ``` ``` -------------------------------- ### POST /api/tokens/import Source: https://context7.com/xiaomo-123/flow2api/llms.txt Bulk imports multiple tokens into the system. ```APIDOC ## POST /api/tokens/import ### Description Imports a list of tokens, automatically handling creation or updates. ### Method POST ### Endpoint http://localhost:8000/api/tokens/import ### Request Body - **tokens** (array) - Required - List of token objects to import ``` -------------------------------- ### POST /v1/chat/completions Source: https://context7.com/xiaomo-123/flow2api/llms.txt Generates a video from multiple reference images by sending a request to the chat completions endpoint. ```APIDOC ## POST /v1/chat/completions ### Description Uploads multiple reference images to generate a video based on the provided prompt. ### Method POST ### Endpoint http://localhost:8000/v1/chat/completions ### Request Body - **model** (string) - Required - The model identifier (e.g., "veo_3_0_r2v_fast_landscape") - **messages** (array) - Required - List of message objects containing text and image_url content - **stream** (boolean) - Optional - Whether to stream the response ``` -------------------------------- ### Open Token Import Modal Source: https://github.com/xiaomo-123/flow2api/blob/main/static/manage.html Opens the modal for importing tokens, clearing the file input. ```javascript openImportModal=()=>{$('importModal').classList.remove('hidden');$('importFile').value=''} ``` -------------------------------- ### POST /v1/chat/completions Source: https://context7.com/xiaomo-123/flow2api/llms.txt Unified endpoint for text-to-image, image-to-image, text-to-video, and image-to-video generation tasks. ```APIDOC ## POST /v1/chat/completions ### Description Generates content based on the specified model and input messages. Supports text-to-image, image-to-image, text-to-video, and image-to-video generation. ### Method POST ### Endpoint /v1/chat/completions ### Request Body - **model** (string) - Required - The ID of the model to use. - **messages** (array) - Required - The input messages containing text or image_url content. - **stream** (boolean) - Optional - Whether to stream the response. ### Request Example { "model": "gemini-2.5-flash-image-landscape", "messages": [ { "role": "user", "content": "一只可爱的猫咪在花园里玩耍" } ], "stream": true } ``` -------------------------------- ### Get Request Logs Source: https://context7.com/xiaomo-123/flow2api/llms.txt Retrieve recent API request logs for debugging and monitoring purposes. You can specify a limit for the number of logs returned. ```bash curl -X GET "http://localhost:8000/api/logs?limit=50" \ -H "Authorization: Bearer admin-aBcDeFgHiJkLmNoPqRsTuVwXyZ123456" ``` -------------------------------- ### Generate Video from Text Source: https://github.com/xiaomo-123/flow2api/blob/main/README.md API request to generate a video from a text prompt. ```bash curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Authorization: Bearer han1234" \ -H "Content-Type: application/json" \ -d '{ "model": "veo_3_1_t2v_fast_landscape", "messages": [ { "role": "user", "content": "一只小猫在草地上追逐蝴蝶" } ], "stream": true }' ``` -------------------------------- ### POST /api/tokens Source: https://context7.com/xiaomo-123/flow2api/llms.txt Adds a new session token to the system and initializes its associated account information. ```APIDOC ## POST /api/tokens ### Description Registers a new session token and converts it to an access token. ### Method POST ### Endpoint http://localhost:8000/api/tokens ### Request Body - **st** (string) - Required - Session token string - **project_name** (string) - Required - Name of the project - **remark** (string) - Optional - Description of the token - **image_enabled** (boolean) - Optional - Enable image generation - **video_enabled** (boolean) - Optional - Enable video generation - **image_concurrency** (integer) - Optional - Image concurrency limit - **video_concurrency** (integer) - Optional - Video concurrency limit ``` -------------------------------- ### Batch Import Tokens API Source: https://context7.com/xiaomo-123/flow2api/llms.txt Import multiple tokens in bulk. The system will automatically handle new additions and updates. Requires admin authorization. ```bash curl -X POST "http://localhost:8000/api/tokens/import" \ -H "Authorization: Bearer admin-aBcDeFgHiJkLmNoPqRsTuVwXyZ123456" \ -H "Content-Type: application/json" \ -d '{ "tokens": [ { "session_token": "st_token_1", "project_name": "项目1", "remark": "账号1", "image_enabled": true, "video_enabled": true }, { "session_token": "st_token_2", "project_name": "项目2", "remark": "账号2", "image_enabled": true, "video_enabled": false } ] }' ``` -------------------------------- ### Token Data Formatting Utilities Source: https://github.com/xiaomo-123/flow2api/blob/main/static/manage.html Helper functions to format token expiry, plan types, and account status for display in the UI. ```javascript formatExpiry=exp=>{if(!exp)return'-';const d=new Date(exp),now=new Date(),diff=d-now;const dateStr=d.toLocaleDateString('zh-CN',{year:'numeric',month:'2-digit',day:'2-digit'}).replace(/\//g,'-');const timeStr=d.toLocaleTimeString('zh-CN',{hour:'2-digit',minute:'2-digit',hour12:false});const hours=Math.floor(diff/36e5);if(diff<0)return`已过期`;if(hours<1)return`${Math.floor(diff/6e4)}分钟`;if(hours<24)return`${hours}小时`;const days=Math.floor(diff/864e5);if(days<7)return`${days}天`;return`${days}天`}, formatPlanType=type=>{if(!type)return'-';const typeMap={'chatgpt_team':'Team','chatgpt_plus':'Plus','chatgpt_pro':'Pro','chatgpt_free':'Free'};return typeMap[type]||type}, formatSora2=(t)=>{if(t.sora2_supported===true){const remaining=t.sora2_total_count-t.sora2_redeemed_count;const tooltipText=`邀请码: ${t.sora2_invite_code||'无'}\n可用次数: ${remaining}/${t.sora2_total_count}\n已用次数: ${t.sora2_redeemed_count}`;return`