### Start DB-GPT Web Server Source: https://docs.anyfast.ai/guides/usecases/use-anyfast-in-db-gpt Launch the DB-GPT web server on the specified port. ```bash dbgpt start webserver --port 5670 ``` -------------------------------- ### Install DB-GPT and OpenAI Python Packages Source: https://docs.anyfast.ai/guides/usecases/use-anyfast-in-db-gpt Install the necessary Python packages for DB-GPT and OpenAI integration. ```bash pip install "dbgpt>=0.6.3rc2" openai ``` -------------------------------- ### Python SDK Example Source: https://docs.anyfast.ai/guides/model-api/anthropic/claude-sonnet-4 Example of how to use the OpenAI Python SDK to interact with the Claude Sonnet 4 API. ```APIDOC ## Python SDK Request Example This example shows how to use the OpenAI Python SDK with Anyfast to access Claude Sonnet 4. ### Method client.chat.completions.create ### Parameters - `model` (string): `claude-sonnet-4-20250514` - `messages` (array): List of message objects. ### Request Body Example ```python from openai import OpenAI client = OpenAI( api_key="YOUR_API_KEY", base_url="https://www.anyfast.ai/v1" ) response = client.chat.completions.create( model="claude-sonnet-4-20250514", messages=[ {"role": "user", "content": "Write a Python function to merge two sorted arrays."} ] ) print(response.choices[0].message.content) ``` ``` -------------------------------- ### Set Up DB-GPT Virtual Environment and Dependencies Source: https://docs.anyfast.ai/guides/usecases/use-anyfast-in-db-gpt Create a dedicated Conda environment for DB-GPT and install its dependencies, including proxy support. ```bash conda create -n dbgpt_env python=3.10 conda activate dbgpt_env pip install -e ".[proxy]" ``` -------------------------------- ### Start MindSearch Frontend with Gradio Source: https://docs.anyfast.ai/guides/usecases/use-anyfast-in-mindsearch This command starts the Gradio-based frontend for MindSearch. ```bash python frontend/mindsearch_gradio.py ``` -------------------------------- ### Set Anyfast API Key and Start MindSearch Backend Source: https://docs.anyfast.ai/guides/usecases/use-anyfast-in-mindsearch Before starting the MindSearch backend, set your Anyfast API key as an environment variable. This command starts the MindSearch application with English language support, Anyfast model configuration, and DuckDuckGo search engine. ```bash # Set your Anyfast API Key export ANYFAST_API_KEY= # Start MindSearch python -m mindsearch.app --lang en --model_format anyfast_config --search_engine DuckDuckGoSearch ``` -------------------------------- ### Doubao Seedance 1.0 Lite I2V Example Source: https://docs.anyfast.ai/api-reference/model-api/bytedance/doubao-seedance-1-0-lite-i2v-250428 An example of a request to the Doubao Seedance 1.0 Lite Image-to-Video API. ```yaml openapi: 3.0.0 info: title: Doubao Seedance 1.0 Lite I2V API version: 1.0.0 paths: /v1/seedance/i2v: post: summary: Generate video from image operationId: generateVideoFromImage requestBody: required: true content: application/json: schema: type: object properties: prompt: type: string description: Text prompt for video generation example: A majestic dragon flying over a castle negative_prompt: type: string description: Text prompt for elements to exclude from the video example: ugly, deformed, blurry image_url: type: string description: URL of the input image example: https://example.com/image.jpg seed: type: integer description: Seed for random number generation example: 12345 style_preset: type: string description: Style preset for video generation example: cinematic resolution: type: string description: Resolution of the output video example: 1024x1024 num_frames: type: integer description: Number of frames in the output video example: 25 fps: type: integer description: Frames per second of the output video example: 15 responses: '200': description: Video generation successful content: application/json: schema: type: object properties: id: type: string description: Unique identifier for the video generation task example: task-12345 status: type: string description: Current status of the video generation task example: processing created_at: type: integer description: Timestamp when the task was created example: 1773130665 '401': description: Unauthorized '429': description: Rate limit exceeded components: securitySchemes: bearerAuth: type: http scheme: bearer ``` -------------------------------- ### OpenAPI Processing Example Source: https://docs.anyfast.ai/api-reference/model-api/bytedance/doubao-seedance-1-5-pro-251215-i2v An example demonstrating the processing endpoint within the OpenAPI specification. ```yaml components: schemas: processing: type: object properties: created_at: type: integer example: 1773130665 responses: '401': description: Unauthorized '429': description: Rate limit exceeded securitySchemes: bearerAuth: type: http scheme: bearer ``` -------------------------------- ### Processing Example Source: https://docs.anyfast.ai/api-reference/model-api/bytedance/doubao-seedance-1-0-pro-fast-251015-i2v This snippet shows an example of processing a request with the Doubao Seedance 1.0 Pro Fast model. ```APIDOC ## POST /v1/doubao-seedance-1.0-pro-fast ### Description Processes a request using the Doubao Seedance 1.0 Pro Fast model. ### Method POST ### Endpoint /v1/doubao-seedance-1.0-pro-fast ### Request Body - **prompt** (string) - Required - The input prompt for the model. - **negative_prompt** (string) - Optional - A prompt to guide the model away from certain concepts. - **style_raw** (string) - Optional - Specifies a raw style for the output. - **aspect_ratio** (string) - Optional - The desired aspect ratio for the generated image. - **num_inference_steps** (integer) - Optional - The number of inference steps to perform. - **seed** (integer) - Optional - The seed for reproducibility. - **guidance_scale** (number) - Optional - Controls how much the prompt influences the output. - **controlnet_conditioning_scale** (number) - Optional - Scale for ControlNet conditioning. - **controlnet_model** (string) - Optional - The ControlNet model to use. - **controlnet_image** (string) - Optional - The ControlNet conditioning image. ### Response #### Success Response (200) - **code** (integer) - The status code of the operation. - **msg** (string) - A message describing the result of the operation. - **data** (object) - The data payload of the response. - **image** (string) - The generated image in base64 format. - **seed** (integer) - The seed used for generation. #### Error Response - **401** - Unauthorized - **429** - Rate limit exceeded ``` -------------------------------- ### Clone DB-GPT Repository Source: https://docs.anyfast.ai/guides/usecases/use-anyfast-in-db-gpt Clone the DB-GPT repository to your local machine to begin the setup process. ```bash git clone https://github.com/eosphoros-ai/DB-GPT.git cd DB-GPT ``` -------------------------------- ### Example API Request Source: https://docs.anyfast.ai/api-reference/introduction This cURL command demonstrates how to make a chat completion request to the Anyfast API, including authentication and content type headers. ```bash curl https://www.anyfast.ai/v1/chat/completions \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "model": "claude-3-5-sonnet-20241022", "messages": [ {"role": "user", "content": "Hello!"} ] }' ``` -------------------------------- ### GPT-5.2 Chat Latest - Streaming Example Source: https://docs.anyfast.ai/guides/model-api/openai/gpt-5-2-chat-latest Demonstrates how to enable and receive real-time token streaming from the GPT-5.2 Chat Latest model using SSE. ```APIDOC ## POST /v1/responses (Streaming) ### Description Sends a request to the GPT-5.2 Chat Latest model with streaming enabled to receive real-time token output. ### Method POST ### Endpoint /v1/responses ### Parameters #### Request Body - **model** (string) - Required - Must be `gpt-5.2-chat-latest` - **input** (array) - Required - List of `{ role, content }` objects - **stream** (boolean) - Required - Set to `true` to enable SSE streaming. - **reasoning** (object) - Optional - `{ effort, summary }` — controls reasoning depth - **text** (object) - Optional - `{ format, verbosity }` — controls output format and verbosity ### Request Example ```json { "model": "gpt-5.2-chat-latest", "input": [ { "role": "user", "content": "Write a short poem about the sea." } ], "stream": true } ``` ### Response #### Success Response (200) - **delta** (object) - Contains the streamed output tokens. #### Response Example ``` [Streaming Server-Sent Events] ``` ``` -------------------------------- ### Chat Completions (Python SDK) Source: https://docs.anyfast.ai/guides/model-api/alibaba/qwen2-vl-7b-instruct Example of how to send a chat completion request to the Qwen2-VL-7B-Instruct model using the OpenAI Python SDK. ```APIDOC ## Chat Completions with OpenAI SDK ### Description Utilizes the OpenAI-compatible API to interact with the Qwen2-VL-7B-Instruct model using the Python SDK. ### Method Client.chat.completions.create ### Parameters - **model**: `qwen2-vl-7b-instruct` (string, required) - **messages**: List of message objects (list of dict, required) - **stream**: Boolean, optional (defaults to `false`) ### Request Example ```python from openai import OpenAI client = OpenAI( api_key="YOUR_API_KEY", base_url="https://www.anyfast.ai/v1" ) response = client.chat.completions.create( model="qwen2-vl-7b-instruct", messages=[ {"role": "user", "content": "Explain quantum entanglement in simple terms."} ] ) print(response.choices[0].message.content) ``` ``` -------------------------------- ### Image to Video (Python) Source: https://docs.anyfast.ai/guides/model-api/kuaishou/kling-v3-omni Generate a video using a reference image as a guide. This Python example shows how to include an image URL in the request to influence the video generation, such as making a person wave. ```python import requests response = requests.post( "https://www.anyfast.ai/kling/v1/videos/omni-video", headers={ "Authorization": "Bearer YOUR_API_KEY", "Content-Type": "application/json" }, json={ "model_name": "kling-v3-omni", "prompt": "Make the person in <<>> wave to the camera", "image_list": [ {"image_url": "https://example.com/photo.jpg"} ], "duration": "5", "mode": "pro", "aspect_ratio": "16:9" } ) task = response.json() print(f"Task ID: {task['task_id']}") ``` -------------------------------- ### Python Chat Completion with Qwen3-Coder-Next Source: https://docs.anyfast.ai/guides/model-api/alibaba/qwen3-coder-next This Python snippet demonstrates how to use the OpenAI SDK with Anyfast's API to get a chat completion from Qwen3-Coder-Next. Ensure you have the 'openai' library installed and replace YOUR_API_KEY. ```python from openai import OpenAI client = OpenAI( api_key="YOUR_API_KEY", base_url="https://www.anyfast.ai/v1" ) response = client.chat.completions.create( model="qwen3-coder-next", messages=[ {"role": "user", "content": "Explain quantum entanglement in simple terms."} ] ) print(response.choices[0].message.content) ``` -------------------------------- ### Quick Example: Python Request for GPT-5.2 Source: https://docs.anyfast.ai/guides/model-api/openai/gpt-5-2 This Python script demonstrates how to interact with the GPT-5.2 model using the OpenAI client library. Configure your API key and base URL accordingly. ```python from openai import OpenAI client = OpenAI( api_key="YOUR_API_KEY", base_url="https://www.anyfast.ai/v1" ) response = client.responses.create( model="gpt-5.2", input=[ {"role": "user", "content": "Explain quantum entanglement in simple terms."} ], reasoning={"effort": "high", "summary": "auto"}, text={"format": {"type": "text"}, "verbosity": "medium"}, store=True ) print(response.output[0].content[0].text) ``` -------------------------------- ### HappyHorse Task Query OpenAPI Specification Source: https://docs.anyfast.ai/api-reference/model-api/alibaba/happyhorse-task-query This OpenAPI specification defines the GET /v1/video/generations/{task_id} endpoint for querying the status and result of a HappyHorse video generation task. It includes request parameters, response schemas, and example values. ```yaml openapi: 3.1.0 info: title: HappyHorse Task Query description: >- Query the status and result of a HappyHorse 1.0 video generation task via Anyfast API version: 1.0.0 servers: - url: https://www.anyfast.ai security: - bearerAuth: [] paths: /v1/video/generations/{task_id}: get: summary: Query Video Generation Task description: >- Retrieve the status and result of a HappyHorse video generation task by its ID. operationId: getHappyhorseTaskStatus parameters: - name: task_id in: path required: true schema: type: string description: >- Task ID returned from the video generation request (format: `asyntask_xxx`). example: asyntask_jwgfhsG0m2aDjLmiiELRf74eoWmss6ya responses: '200': description: Task status retrieved content: application/json: schema: type: object properties: code: type: string example: success message: type: string example: '' data: type: object properties: task_id: type: string example: asyntask_jwgfhsG0m2aDjLmiiELRf74eoWmss6ya action: type: string description: >- Sub-type: `generate`, `firstTailGenerate`, `referenceGenerate`, `omniGenerate`. example: generate status: type: string enum: - NOT_START - QUEUED - IN_PROGRESS - SUCCESS - FAILURE description: Task status. example: SUCCESS result_url: type: string description: >- Pre-signed video download URL (valid 24 hours). Omitted on failure. example: >- https://dashscope-a717.oss-accelerate.aliyuncs.com/.../xxx_refiner.mp4?Expires=... fail_reason: type: string description: >- On `status = SUCCESS`, copies `result_url` (backward compat for legacy clients). On `status = FAILURE`, contains the error message. example: >- https://dashscope-a717.oss-accelerate.aliyuncs.com/.../xxx_refiner.mp4?Expires=... submit_time: type: integer example: 1777343862 start_time: type: integer description: Upstream start timestamp; `0` if not started yet. example: 1777343866 finish_time: type: integer example: 1777343961 progress: type: string example: 100% request_id: type: string example: 20260428023742441081000FMrSbjcs data: type: object description: Upstream DashScope raw output and usage. properties: output: type: object properties: task_id: type: string description: Upstream DashScope task ID. example: e45a6a1b-6f05-43e5-ab06-ddfdc97587a7 task_status: type: string enum: - PENDING - RUNNING - SUCCEEDED - FAILED - CANCELED - UNKNOWN ``` -------------------------------- ### Configure OpenAI SDK with Anyfast Base URL (Python) Source: https://docs.anyfast.ai/api-reference/introduction Initialize the OpenAI client with a custom base URL to direct requests to the Anyfast API. ```python from openai import OpenAI client = OpenAI( api_key="YOUR_API_KEY", base_url="https://www.anyfast.ai/v1" ) ``` -------------------------------- ### Poll HappyHorse Task Status and Get Result (Python) Source: https://docs.anyfast.ai/guides/model-api/alibaba/happyhorse-task-query This Python script polls the status of a HappyHorse video generation task every 15 seconds. It prints the video URL if the task is successful or the failure reason if it fails. Ensure you have the 'requests' and 'time' libraries installed. ```python import requests, time task_id = "asyntask_jwgfhsG0m2aDjLmiiELRf74eoWmss6ya" while True: r = requests.get( f"https://www.anyfast.ai/v1/video/generations/{task_id}", headers={"Authorization": "Bearer YOUR_API_KEY"} ).json() status = r["data"]["status"] if status == "SUCCESS": print("Video URL:", r["data"]["result_url"]) break if status == "FAILURE": print("Failed:", r["data"]["fail_reason"]) break time.sleep(15) ``` -------------------------------- ### Streaming Chat Completions with Qwen2-VL-7B-Instruct in Python Source: https://docs.anyfast.ai/guides/model-api/alibaba/qwen2-vl-7b-instruct This Python example demonstrates how to receive streaming responses from the Qwen2-VL-7B-Instruct model using the OpenAI SDK. It iterates over the stream and prints each chunk of content as it arrives. ```python from openai import OpenAI client = OpenAI( api_key="YOUR_API_KEY", base_url="https://www.anyfast.ai/v1" ) stream = client.chat.completions.create( model="qwen2-vl-7b-instruct", messages=[ {"role": "user", "content": "Write a short poem about the sea."} ], stream=True ) for chunk in stream: print(chunk.choices[0].delta.content or "", end="") ``` -------------------------------- ### Python OpenAI SDK for Qwen2.5-VL-7B-Instruct Source: https://docs.anyfast.ai/guides/model-api/alibaba/qwen2.5-vl-7b-instruct Integrate Qwen2.5-VL-7B-Instruct into your Python application using the OpenAI SDK. Set your API key and the base URL for Anyfast. This example shows a standard chat completion. ```python from openai import OpenAI client = OpenAI( api_key="YOUR_API_KEY", base_url="https://www.anyfast.ai/v1" ) response = client.chat.completions.create( model="qwen2.5-vl-7b-instruct", messages=[ {"role": "user", "content": "Explain quantum entanglement in simple terms."} ] ) print(response.choices[0].message.content) ``` -------------------------------- ### Python Chat Completions with OpenAI SDK Source: https://docs.anyfast.ai/guides/model-api/alibaba/qwen3-32b This Python snippet demonstrates how to use the OpenAI SDK to interact with the Qwen3-32B model through Anyfast. Configure the client with your API key and base URL, then create a chat completion. ```python from openai import OpenAI client = OpenAI( api_key="YOUR_API_KEY", base_url="https://www.anyfast.ai/v1" ) response = client.chat.completions.create( model="qwen3-32b", messages=[ {"role": "user", "content": "Explain quantum entanglement in simple terms."} ] ) print(response.choices[0].message.content) ``` -------------------------------- ### cURL Example Source: https://docs.anyfast.ai/guides/model-api/anthropic/claude-sonnet-4 Example of how to send a request to the Claude Sonnet 4 API using cURL. ```APIDOC ## cURL Request Example This example demonstrates how to call the Claude Sonnet 4 API using cURL. ### Method POST ### Endpoint https://www.anyfast.ai/v1/messages ### Request Body ```json { "model": "claude-sonnet-4-20250514", "messages": [ { "role": "user", "content": "Write a Python function to merge two sorted arrays." } ] } ``` ``` -------------------------------- ### OpenAPI Specification Example Source: https://docs.anyfast.ai/api-reference/model-api/bytedance/doubao-seedance-1-0-pro-250528-i2v An example snippet from an OpenAPI specification, illustrating processing details and error codes. ```yaml components: securitySchemes: bearerAuth: type: http scheme: bearer openapi: 3.0.0 info: title: Doubao Seedance 1.0 Pro 250528 i2v API version: 1.0.0 paths: /v1/seedance/i2v: post: summary: Generate video from image operationId: generateVideoFromImage requestBody: required: true content: application/json: schema: type: object properties: prompt: type: string description: Text prompt to guide video generation. example: "A cat playing with a ball of yarn." negative_prompt: type: string description: Text prompt for elements to exclude from the video. example: "blurry, low quality, text" image_url: type: string description: URL of the input image. example: "https://example.com/image.jpg" num_frames: type: integer description: Number of frames in the generated video. example: 16 seed: type: integer description: Seed for reproducible generation. example: 12345 responses: '200': description: Video generation successful content: application/json: schema: type: object properties: video_url: type: string description: URL of the generated video. example: "https://example.com/video.mp4" seed: type: integer description: Seed used for this generation. example: 12345 '400': description: Bad Request '401': description: Unauthorized '429': description: Rate limit exceeded ``` -------------------------------- ### Quick Example: cURL Request for GPT-5.2 Source: https://docs.anyfast.ai/guides/model-api/openai/gpt-5-2 Use this cURL command to make a request to the GPT-5.2 model via the Anyfast Responses API. Ensure you replace 'YOUR_API_KEY' with your actual API key. ```bash curl https://www.anyfast.ai/v1/responses \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "model": "gpt-5.2", "input": [ { "role": "user", "content": "Explain quantum entanglement in simple terms." } ], "reasoning": { "effort": "high", "summary": "auto" }, "text": { "format": { "type": "text" }, "verbosity": "medium" }, "store": true }' ``` -------------------------------- ### Seedance Asset — Get Asset Source: https://docs.anyfast.ai/llms.txt Get a single asset detail by Id. This is a read-only operation and is not billed. ```APIDOC ## Seedance Asset — Get Asset ### Description Get a single asset detail by Id. This is a read-only operation and is not billed. ### Method GET ### Endpoint /v1/bytedance/volc-asset/{asset_id} ### Parameters #### Path Parameters - **asset_id** (string) - Required - The ID of the asset to retrieve. ### Response #### Success Response (200) - **asset_id** (string) - The ID of the asset. - **asset_type** (string) - The type of the asset (e.g., 'image', 'audio', 'video'). - **group_id** (string) - The ID of the asset group. - **created_at** (string) - The timestamp when the asset was created. - **asset_name** (string) - Optional - The custom name of the asset. ``` -------------------------------- ### Configure OpenAI SDK with Anyfast Base URL (Node.js) Source: https://docs.anyfast.ai/api-reference/introduction Instantiate the OpenAI client with a custom baseURL to route requests to the Anyfast API. ```javascript import OpenAI from "openai"; const client = new OpenAI({ apiKey: "YOUR_API_KEY", baseURL: "https://www.anyfast.ai/v1", }); ``` -------------------------------- ### API Response Example Source: https://docs.anyfast.ai/guides/system-api/models-list This is an example of the JSON response structure returned by the /v1/models endpoint, showing available models with their details. ```json { "data": [ { "id": "gpt-4o", "object": "model", "created": 1626777600, "owned_by": "openai", "supported_endpoint_types": ["openai"] }, { "id": "claude-sonnet-4-5-20250929", "object": "model", "created": 1626777600, "owned_by": "vertex-ai", "supported_endpoint_types": ["openai", "anthropic"] } ] } ``` -------------------------------- ### Make First Chat API Call with Node.js Source: https://docs.anyfast.ai/quickstart This Node.js example shows how to use the OpenAI library to interact with a chat model through Anyfast. Remember to replace YOUR_API_KEY and configure your channels. ```javascript import OpenAI from "openai"; const client = new OpenAI({ apiKey: "YOUR_API_KEY", baseURL: "https://www.anyfast.ai/v1", }); const response = await client.chat.completions.create({ model: "claude-3-5-sonnet-20241022", messages: [{ role: "user", content: "Hello!" }], }); console.log(response.choices[0].message.content); ``` -------------------------------- ### Python SDK Streaming Example Source: https://docs.anyfast.ai/guides/model-api/anthropic/claude-sonnet-4 Example of how to use the OpenAI Python SDK for streaming responses from the Claude Sonnet 4 API. ```APIDOC ## Python SDK Streaming Example This example demonstrates how to enable and receive streaming responses from Claude Sonnet 4 using the OpenAI Python SDK. ### Method client.chat.completions.create (with `stream=True`) ### Parameters - `model` (string): `claude-sonnet-4-20250514` - `messages` (array): List of message objects. - `stream` (boolean): Set to `True` to enable streaming. ### Request Body Example ```python from openai import OpenAI client = OpenAI( api_key="YOUR_API_KEY", base_url="https://www.anyfast.ai/v1" ) stream = client.chat.completions.create( model="claude-sonnet-4-20250514", messages=[ {"role": "user", "content": "Explain the difference between async and sync programming."} ], stream=True ) for chunk in stream: print(chunk.choices[0].delta.content or "", end="") ``` ``` -------------------------------- ### Python Chat Completion with OpenAI SDK Source: https://docs.anyfast.ai/guides/model-api/openai/gpt-5-pro This Python snippet demonstrates how to use the OpenAI SDK to interact with GPT-5 Pro. Configure the client with your API key and the Anyfast base URL. Replace 'YOUR_API_KEY' with your actual API key. ```python from openai import OpenAI client = OpenAI( api_key="YOUR_API_KEY", base_url="https://www.anyfast.ai/v1" ) response = client.chat.completions.create( model="gpt-5-pro", messages=[ {"role": "user", "content": "Explain quantum entanglement in simple terms."} ] ) print(response.choices[0].message.content) ``` -------------------------------- ### OpenAPI Specification - Processing Example Source: https://docs.anyfast.ai/api-reference/model-api/bytedance/doubao-seedance-1-0-pro-fast-251015-i2v This snippet shows an example of the 'processing' status within the OpenAPI specification, including an integer timestamp. ```yaml components: schemas: ProcessingResponse: type: object properties: processing_code: type: integer example: 200 msg: type: string example: processing created_at: type: integer example: 1773130665 ErrorResponse: type: object properties: error_code: type: integer msg: type: string responses: '401': description: Unauthorized '429': description: Rate limit exceeded securitySchemes: bearerAuth: type: http scheme: bearer ``` -------------------------------- ### SSE Response Format Example Source: https://docs.anyfast.ai/guides/model-api/google/gemini-2-5-flash-image-stream Illustrates the structure of Server-Sent Events (SSE) responses for Gemini 2.5 Flash Image (Stream). It shows examples of thinking chunks, image data chunks, and final usage metadata chunks. ```json data: {"candidates":[{"content":{"role":"model","parts":[{"text":"...","thought":true}]}}],"usageMetadata":{"trafficType":"ON_DEMAND"},"modelVersion":"gemini-2.5-flash-image","createTime":"...","responseId":"..."} data: {"candidates":[{"content":{"role":"model","parts":[{"inlineData":{"mimeType":"image/png","data":""}}]}}],...} data: {"usageMetadata":{"promptTokenCount":8,"candidatesTokenCount":1120,"totalTokenCount":1392,"trafficType":"ON_DEMAND","promptTokensDetails":[{"modality":"TEXT","tokenCount":8}],"candidatesTokensDetails":[{"modality":"IMAGE","tokenCount":1120}],"thoughtsTokenCount":264}} ``` -------------------------------- ### Python OpenAI SDK for GPT-5 Mini Chat Completions Source: https://docs.anyfast.ai/guides/model-api/openai/gpt-5-mini This Python script demonstrates how to use the OpenAI SDK to interact with GPT-5 Mini. Configure the client with your API key and the Anyfast base URL. ```python from openai import OpenAI client = OpenAI( api_key="YOUR_API_KEY", base_url="https://www.anyfast.ai/v1" ) response = client.chat.completions.create( model="gpt-5-mini", messages=[ {"role": "user", "content": "Explain quantum entanglement in simple terms."} ] ) print(response.choices[0].message.content) ``` -------------------------------- ### Get Asset Source: https://docs.anyfast.ai/api-reference/model-api/bytedance/volc-asset-get-asset Retrieves the details of a specific asset using its unique identifier. This is a read-only operation. ```APIDOC ## POST /volc/asset/GetAsset ### Description Get a single asset detail by Id. This is a read-only operation and is not billed. ### Method POST ### Endpoint /volc/asset/GetAsset ### Parameters #### Request Body - **Id** (string) - Required - Asset ID to query. ### Request Example { "Id": "asset-20260528140922-d9646" } ### Response #### Success Response (200) - **Id** (string) - **Name** (string) - **URL** (string) - Asset file URL. - **AssetType** (string) - Enum: Image, Video, Audio - **GroupId** (string) - **Status** (string) - Enum: Active, Inactive - **ProjectName** (string) - **CreateTime** (string) - **UpdateTime** (string) #### Response Example { "Id": "asset-20260528140922-d9646", "Name": "character-reference", "URL": "https://ark-media-asset.tos-cn-beijing.volces.com/...", "AssetType": "Video", "GroupId": "group-20260528140601-tp9hw", "Status": "Active", "ProjectName": "default", "CreateTime": "2026-05-28T06:09:22Z", "UpdateTime": "2026-05-28T06:09:31Z" } ```