# Create speech-to-text request
Source: https://docs.siliconflow.com/en/api-reference/audio/create-audio-transcriptions
post /audio/transcriptions
Creates an audio transcription.
# Create text-to-speech request
Source: https://docs.siliconflow.com/en/api-reference/audio/create-speech
post /audio/speech
Generate audio from input text. The data generated by the interface is the binary data of the audio, which requires the user to handle it themselves. Reference:https://docs.siliconflow.com/capabilities/text-to-speech#5
# Delete reference audio
Source: https://docs.siliconflow.com/en/api-reference/audio/delete-voice
post /audio/voice/deletions
Delete user-defined voice style
# Upload reference audio
Source: https://docs.siliconflow.com/en/api-reference/audio/upload-voice
post /uploads/audio/voice
Upload user-provided voice style, which can be in base64 encoding or file format. Refer to (https://docs.siliconflow.com/capabilities/text-to-speech#2-2)
# Retrieve reference audio list
Source: https://docs.siliconflow.com/en/api-reference/audio/voice-list
get /audio/voice/list
Get list of user-defined voice styles
# Create text generation request
Source: https://docs.siliconflow.com/en/api-reference/chat-completions/chat-completions
post /chat/completions
Creates a model response for the given chat conversation.
# Create image generation request
Source: https://docs.siliconflow.com/en/api-reference/images/images-generations
post /images/generations
Creates an image response for the given prompt. The URL for the generated image is valid for one hour. Please make sure to download and store it promptly to avoid any issues due to URL expiration.
# Retrieve user model list
Source: https://docs.siliconflow.com/en/api-reference/models/get-model-list
get /models
Retrieve models information.
# Retrieve user account information
Source: https://docs.siliconflow.com/en/api-reference/userinfo/get-user-info
get /user/info
Get user information including balance and status
# Retrieve video generation link request
Source: https://docs.siliconflow.com/en/api-reference/videos/get_videos_status
post /video/status
Get the user-generated video. The URL for the generated video is valid for one hour. Please make sure to download and store it promptly to avoid any issues due to URL expiration.
# Create video generation request
Source: https://docs.siliconflow.com/en/api-reference/videos/videos_submit
post /video/submit
Generate a video through the input prompt. This API returns the user's current request ID. The user needs to poll the status interface to get the specific video link. The generated result is valid for 10 minutes, so please retrieve the video link promptly.
# Error Handling
Source: https://docs.siliconflow.com/en/faqs/error-code
**1. Try obtaining the HTTP error code to initially locate the issue**
a. In your code, try to print the error code and error message (message). Using this information, most issues can be located.
```shell
HTTP/1.1 400 Bad Request
Date: Thu, 19 Dec 2024 08:39:19 GMT
Content-Type: application/json; charset=utf-8
Content-Length: 87
Connection: keep-alive
{"code":20012,"message":"Model does not exist. Please check it carefully.","data":null}
```
* Common error codes and their causes:
* **400**: Incorrect parameters. Refer to the error message (message) to correct invalid request parameters.
* **401**: API Key is not properly set.
* **403**: Insufficient permissions. The most common reason is that the model requires real-name authentication. For other cases, refer to the error message (message).
* **429**: Rate limits triggered. Refer to the error message (message) to determine whether the issue is related to `RPM / RPD / TPM / TPD / IPM / IPD`. You can consult [Rate Limits](https://docs.siliconflow.com/rate-limits/rate-limit-and-upgradation) to understand the specific rate-limiting policies.
* **504 / 503**:
* Generally caused by high system load. You can try again later.
* For chat and text-to-speech requests, you can try using streaming output (`"stream": true`). Refer to [Streaming Output](https://docs.siliconflow.com/faqs/stream-mode) for more details.
* **500**: An unknown server error occurred. You can send an email to [help@siliconflow.com](mailto:help@siliconflow.com) for troubleshooting.
b. If the client does not output corresponding information, you can try running the curl command in the command line (taking an LLM model as an example):
```shell
curl --request POST \
--url https://api.ap.siliconflow.com/v1/chat/completions \
--header 'accept: application/json' \
--header 'authorization: Bearer Replace_with_your_apikey' \
--header 'content-type: application/json' \
--data '
{
"model": "Remember_to_replace_with_model",
"messages": [
{
"role": "user",
"content": "Hello"
}
],
"max_tokens": 128
}' -i
```
**2. Try switching to another model to see if the issue persists**
**3. If you are using a proxy, consider disabling the proxy and trying again**
For any other issues, please send an email to [help@siliconflow.com](mailto:help@siliconflow.com).
# Other Issues
Source: https://docs.siliconflow.com/en/faqs/misc
## 1. Garbled Output from the Model
Currently, some models may produce garbled output when parameters are not set. In such cases, you can try setting parameters like `temperature`, `top_k`, `top_p`, and `frequency_penalty`.
Modify the corresponding payload as follows, adjusting for different languages as needed:
```python
payload = {
"model": "Qwen/Qwen2.5-Math-72B-Instruct",
"messages": [
{
"role": "user",
"content": "1+1=?",
}
],
"max_tokens": 200, # Add as needed
"temperature": 0.7, # Add as needed
"top_k": 50, # Add as needed
"top_p": 0.7, # Add as needed
"frequency_penalty": 0 # Add as needed
}
```
## 2. Explanation of `max_tokens`
For the LLM models provided by the platform:
* Models with a `max_tokens` limit of `16384`:
* deepseek-ai/DeepSeek-R1
* deepseek-ai/DeepSeek-R1-Distill-Qwen-32B
* deepseek-ai/DeepSeek-R1-Distill-Qwen-14B
* deepseek-ai/DeepSeek-R1-Distill-Qwen-7B
* deepseek-ai/DeepSeek-R1-Distill-Qwen-1.5B
* Models with a `max_tokens` limit of `8192`:
* Qwen/QwQ-32B-Preview
* Models with a `max_tokens` limit of `4096`:
* All other LLM models not mentioned above
If you have special requirements, it is recommended to send feedback via email to [contact@siliconflow.com](mailto:contact@siliconflow.com).
## 3. Explanation of `context_length`
The `context_length` varies across different LLM models. You can search for the specific model on the [Models](https://cloud.siliconflow.com/models) page to view detailed information about the model.
## 4. Explanation of `429` Error for `DeepSeek-R1` and `DeepSeek-V3` Models
1. **Unverified Users**: Limited to `100 requests` per day. If the daily request limit exceeds `100`, a `429` error will be returned with the message: "Details: RPD limit reached. Could only send 100 requests per day without real name verification." You can unlock higher rate limits through real-name verification.
2. **Verified Users**: Have higher rate limits. Refer to the [Models](https://cloud.siliconflow.com/models) page for specific values.
If the request limit is exceeded, a `429` error will also be returned.
## 5. Differences Between Pro and Non-Pro Models
1. For some models, the platform provides both free and paid versions. The free version retains its original name, while the paid version is prefixed with "Pro/" to distinguish them. The rate limits for the free version are fixed, while those for the paid version are variable. Refer to [Rate Limits](https://docs.siliconflow.com/cn/userguide/rate-limits/rate-limit-and-upgradation) for specific rules.
2. For `DeepSeek R1` and `DeepSeek V3` models, the naming differs based on the payment method. The `Pro version` only supports payment through "recharge balance," while the `non-Pro version` supports payment through both "gifted balance" and "recharge balance."
## 6. Are There Any Time or Quality Requirements for Custom Voice Uploads in Speech Models?
* **cosyvoice2**: The uploaded voice must be less than 30 seconds.
* **GPT-SoVITS**: The uploaded voice should be between 3–10 seconds.
* **fishaudio**: No specific restrictions.
To ensure optimal voice generation results, it is recommended to upload a voice sample of around 8–10 seconds, with clear pronunciation and no noise or background sounds.
## 7. Troubleshooting Truncated Model Output
You can troubleshoot truncated output from the following perspectives:
* **For API requests**:
* **max\_tokens setting**: Set `max_tokens` to an appropriate value. If the output exceeds the `max_tokens` value, it will be truncated. The maximum `max_tokens` value for the DeepSeek R1 series is 16384.
* **Enable streaming output requests**: For non-streaming requests, long outputs may result in a `504 timeout`.
* **Set client timeout**: Increase the client timeout to prevent truncation due to the timeout being reached before output completion.
* **For third-party client requests**:
* **CherryStdio**: The default `max_tokens` is 4096. Users can adjust this by enabling the "Message Length Limit" switch and setting `max_tokens` to an appropriate value.
For any other issues, please send an email to [help@siliconflow.com](mailto:help@siliconflow.com).
# Stream
Source: https://docs.siliconflow.com/en/faqs/stream-mode
## 1. Using Stream Mode in Python
### 1.1 Stream Mode with the OpenAI Library
In general scenarios, it is recommended to use the OpenAI library for Stream Mode.
```python
from openai import OpenAI
client = OpenAI(
base_url='https://api.ap.siliconflow.com/v1',
api_key='your-api-key'
)
# Send a request with Stream Mode
response = client.chat.completions.create(
model="deepseek-ai/DeepSeek-V2.5",
messages=[
{"role": "user", "content": "What does the release of DeepSeek mean for the field of large AI models?"}
],
stream=True # Enable Stream Mode
)
# Receive and process the response incrementally
for chunk in response:
chunk_message = chunk.choices[0].delta.content
print(chunk_message, end='', flush=True)
```
### 1.2 Stream Mode with the Requests Library
If you have non-OpenAI scenarios, such as using the SiliconCloud API with the Requests library, please note:
In addition to setting `stream` in the payload, you also need to set `stream=True` in the request parameters to properly handle responses in streaming mode.
```python
import requests
url = "https://api.ap.siliconflow.com/v1/chat/completions"
payload = {
"model": "deepseek-ai/DeepSeek-V2.5", # Replace with your model
"messages": [
{
"role": "user",
"content": "What does the release of DeepSeek mean for the field of large AI models?"
}
],
"stream": True # This must be set to streaming mode
}
headers = {
"accept": "application/json",
"content-type": "application/json",
"authorization": "Bearer your-api-key"
}
response = requests.post(url, json=payload, headers=headers, stream=True) # Specify stream mode in the request
# Print the streaming response
if response.status_code == 200:
for chunk in response.iter_content(chunk_size=8192):
if chunk:
decoded_chunk = chunk.decode('utf-8')
print(decoded_chunk, end='')
else:
print('Request failed with status code:', response.status_code)
```
# Privacy Policy
Source: https://docs.siliconflow.com/en/legals/privacy-policy
Update Date: Mar. 31st, 2025
Welcome to use the high-value GenAI platform of SILICONFLOW TECHNOLOGY PTE. LTD. ("**SiliconFlow**" or "**we**","**us**”, or "**our**"). We attach great importance to the protection of Personal Data from users (“**you**”). When you register, log in, and use the services (“**Services**”) provided through the [https://siliconflow.com](https://siliconflow.com) (the "**Platform**"), we will collect and store the relevant information in accordance with this policy.
We hope to introduce to you through this Privacy Policy how we Process your Personal Data. Before you start using our Services, **please be sure to carefully read and understand this policy to ensure that you fully understand and agree before proceeding. If you do not agree with this Privacy Policy, you should stop using the Services. When you choose to use the Services, it will be deemed that you accept and acknowledge that we handle your relevant information in accordance with this Privacy Policy.**
### Revision
To provide you with better services, our Platform and Services will be periodically updated and adjusted. We will also revise this Privacy Policy in a timely manner. We may revise this Privacy Policy in a timely manner, and these revisions constitute part of the Privacy Policy and carry the same legal effect.
After updates to the Privacy Policy, we will publish the updated version on this platform and use reasonable best efforts to notify you of the updated terms before they become effective via website announcements or other commercially reasonable means, so that you are aware of the latest version of this Privacy Policy in a timely manner. For significant changes, we will provide more prominent notifications (including, but not limited to, emails, SMS, system messages, or special reminders on the browsing page) to explain the specific changes in the Privacy Policy. Your continued access to or use of our Services after such notice had been given and such revised Privacy Policy had come into effect shall constitute your acceptance of the revised Privacy Policy.
### Contact Us
If you want to contact us with specific queries or concerns in relation to this Privacy Policy, or if you have any questions or complaints as to how your personal data is collected, used, disclosed and/or processed by us, please contact us at [contact@siliconflow.com](mailto:contact@siliconflow.com).
### Overview
This Privacy Policy will help you understand:
1. Definitions
2. How We Collect and Use your Personal Data
3. Interaction Data
4. Use of Cookies and Similar Technologies
5. How We Share Your Personal Data
6. Third Party Links and Collection of Personal Data by Third Parties
7. How We Retain Your Personal Data
8. Your Rights and Options Regarding Your Personal Data
9. Protection of Personal Data
10. Accuracy of Personal Data
11. No Right of Enforcement by Third Parties
## 1. Definitions
1.1 In this Privacy Policy, the following words and expressions shall have the meanings respectively assigned to them hereunder:
“**Data Protection Laws**” means all applicable laws and regulations in any jurisdiction which relate to the collection, disclosure, use and/or Processing of Personal Data, including without limitation to the PDPA, including all amendments thereto and subsidiary legislation enacted thereunder, whether now or in the future.
“**PDPA**” means the Personal Data Protection Act 2012 of Singapore, including all amendments thereto and subsidiary legislation enacted thereunder, whether now or in the future.
"**Personal Data**" means data, whether true or not, about an individual who can be identified (a) from that data; or (b) from that data and other information to which a party has or is likely to have access.
“**Process**”, in relation to Personal Data, means the carrying out of any operation or set of operations in relation to the Personal Data, including without limitation to recording, holding, organising, adapting, altering, modifying, retrieving, combining, transmitting, erasing, or destroying, and “Processing” shall be construed accordingly.
1.2 Any capitalised term not defined herein shall have the meaning ascribed to them in the Privacy Policy.
## 2. How We Collect and Use Your Personal Data
We may collect and use the following Personal Data about you when you access our Services for the purposes described below:
2.1 **Information Provided by You**
a. **Register and Log in to Platform Account.** You need to register and login to the Platform by using a third-party platform account.If you log in to the Platform using an account from another platform, you authorize us to obtain relevant information from your other platform account, such as account/account information from third-party platforms like \[Google and GitHub] (including but not limited to your name, profile picture, and any other information you authorize).
b. **Subscribe and Purchase the Services.** When you make purchases on our platform or subscribe paid Services, we will collect data and information relating to your purchase (which may be directly from you, or from our partnering third-party payment service providers (e.g., Stripe) for the purposes of verifying your transaction and processing your transaction. This may include your \[credit card details, bank account details, bank statements, billing address, payments and orders to and from you, and other details of services that you have purchased through the platform].
c. **Surveys and Online Events.** When you participate in surveys or lottery activities on our Platform, we may retain information such as your account ID, name, address, mobile phone number, job title, and usage of Services. This information will be used to contact you, verify your identity, and provide rewards (if applicable) according to the rules of the specific activity.
d. **Contract-related Information.** If you need to apply for offline delivery or conduct product testing, please contact \[[contact@siliconflow.com](mailto:contact@siliconflow.com)]. We will collect the necessary contract-related information according to your requirements.
2.2 **Information We Automatically Collect**
a. **Security and Operation of the Services.** To maintain the secure and stable operation of our Services, protect the legitimate interests of you, other users, or the public from losses, ensure the normal operation and operational security of our Services, and prevent network attacks and intrusion risks, we will collect the information necessary for ensuring the normal operation of our services and network security. This information includes, but is not limited to, device information (such as resolution, time zone, and language), network access method and type information, and web browsing records.
b. **Service Improvement.** To enhance our user experience and ensure usage security, we may record network log information, as well as information on the frequency of using our platform and related services, crash data, usage scenarios, and related performance data. This information will be used to optimize the service experience and improve product quality.
c. **Troubleshooting.** We may collect user consultation records, trouble-reporting records, and troubleshooting process information (such as communication or call records) generated during your use of our platform and related services. This information will be used to respond to your help requests in a timely manner and improve service quality.
d. **Notification and Marketing Information.** We may send you commercial information about services, features, or activities that you may be interested in via text messages or phone calls. If you do not wish to receive such information, you can unsubscribe via text message or email, or you can directly contact us to unsubscribe.
2.3 **Information We Collect from Third-Parties**
To provide you with better, more optimized, and more personalized services, or to jointly offer services to you, or to detect fraud information, our affiliated companies and partners may share your information with us in accordance with legal requirements, agreements with you, or with your consent. We will, in accordance with relevant laws and regulations and as necessary for the identity verification function, adopt industry-standard methods and make our best commercial efforts to protect the security of your Personal Data.
## 3. Interaction Data
**The data generated or processed through the Services provided by this Platform (excluding third-party services), including but not limited to through means of input, feedback, modification, processing, storage, uploading, downloading, distribution, and other methods, in relation to open-source models, third-party websites, software, applications or services, shall all be your business and customer data (“Interaction Data”).**
You understand and agree that you are responsible for storing your Interaction Data according to your own requirements. We only provide data storage services as required by relevant laws and regulations or as stipulated in specific service rules. You understand and further agree that, unless otherwise provided by laws and regulations or as agreed in the service rules, we have no obligation to store your Interaction Data, and we will not assume any responsibility for your data storage efforts or outcomes.
In case the Interaction Data contains Personal Data, as a neutral technology service provider, we will only process your Interaction Data strictly in accordance with your instructions. You are required to fulfill the obligations associated with the Processing of Personal Data contained in Interaction Data in accordance with the laws.
## 4 Use of Cookies and Similar Technologies
Cookies and similar technologies are common and widely used in the Internet. When you use our Platform, we may use relevant technologies to send one or more cookies or anonymous identifiers to your device to collect and store your account information, search history information, and login status information. Cookies and similar technologies can help you skip the steps and processes of repeatedly filling in account information and entering search content. They can also help us improve service efficiency and enhance login and response speeds.
You have the ability to accept or decline cookies by modifying the setting in your browser. However, please note that if you disable cookies, you may not be able to enjoy the best service experience, and the availability of certain functions may be affected.
## 5. How We Share Your Personal Data
5.1 You acknowledge and agree that Personal Data provided to us by you may be disclosed and/or transferred to the following third parties, and used or Processed by such third parties, whether within or outside Singapore, for the purposes set out above or otherwise permitted/ required by law:
a. **Our Affiliates.** We may share your Personal Data with our affiliates to enable us to provide you with the Services.
b. **Service Providers.** We engage third-party service providers to operate and maintain our Services, store data, and offer related services. We may share your Personal Data with these service providers to ensure that you can access and use our application and services. For example:
* i. **Third-party Payment Service Providers:** We use third party payment service providers such as \[Stripe] to process payments from you.
* ii. **Customer Service Providers:** We use third-party customer service providers to promptly handle your complaints and suggestions.
* iii. **Data Analytics Service Providers:** We use data analytics service providers to analyse how our Services are used and enhance user experiences.
c. **Governmental and regulatory authorities**. We may share your Personal Data with third parties, including law enforcement agencies and governmental or regulatory authorities, whether in Singapore or abroad, where required by applicable laws (including to respond to valid legal process such as a search warrant or a court order), where it is necessary in connection with our Services or where we have another legitimate interest in doing so.
d. **Buyer or successor of our business**. We may share your Personal Data with any buyer or successor in the event of a merger, reorganisation, dissolution, or other sale or transfer of title.
e. **Our advisors, including auditors and lawyers**. We may share your Personal Data with or disclose your Personal Data to our advisors in the course of seeking professional advice.
## 6. Third Party Links and Collection of Personal Data by Third Parties
6.1 The Platform may from time to time, contain links to and from the websites of our affiliates, advertisers, or other third parties (“**Third Party Websites**”). Certain functions and features within our Services (such as the payment function) may be provided by third parties (such as payment service providers) (such functions and features being “**Third Party Services**”). Third Party Websites and Third Party Services are operated by third parties (**“Third Party Service Providers**”). When you access or use such Third Party Services, or when you click on the link to Third Party Websites, your Personal Data may be collected directly by such Third Party Service Providers.
6.2 As these Third Party Websites and Third Party Services are not owned or operated by us, we do not accept any responsibility or liability for such Third Party Websites and Third Party Service, or the collection of your Personal Data by such Third Party Service Providers. Your access to such Third Party Websites and Third Party Services, and provision of Personal Data to these Third Party Service Providers are entirely at your own risk. Please check the privacy policies that apply to such Third Party Websites and Third Party Services carefully before you provide any Personal Data to such Third Party Service Providers.
6.3 By accessing or using Third Party Websites and/or Third Party Services, or providing your Personal Data to Third Party Service Providers, you acknowledge and agree that:
a. you have read and understood such Third Party Service Providers’ privacy policies, and consent to the collection, use, disclosure and/or Processing of your Personal Data by such Third Party Service Providers pursuant to their privacy policies;
b. we do not control such Third Party Service Providers, and the manner in which and purposes for which your Personal Data may be collected, used, disclosed and/or Processed is determined solely by such Third Party Service Providers as data controllers (as defined under applicable Data Protection Laws); and
c. to the maximum extent permissible by law, we shall not be liable for any liabilities, losses or damages that may be incurred by you as a result of your use of any Third Party Websites and/or Third Party Services, or the collection, use, disclosure and/or Processing of your Personal Data by any Third Party Service Providers.
## 7. How We Retain Your Personal Data
We may retain your Personal Data for as long as it is necessary to fulfil the purpose for which it was collected, or as required or permitted by applicable laws.
We will cease to retain your Personal Data or remove the means by which the data can be associated with you, as soon as it is reasonable to assume that such retention no longer serves the purpose for which the Personal Data was collected, and is no longer necessary for legal or business purposes.
## 8. Your Rights and Options Regarding Your Personal Data
8.1. **Withdrawing consent**
a. You may withdraw your consent and request us to stop collecting, using, disclosing and/or Processing your Personal Data for any or all of the purposes listed above by submitting your request via email to our Data Protection Officer at the contact details provided above.
b. Upon receipt of your written request to withdraw your consent, we may require a reasonable period of time to process and respond to your request.
c. Whilst we respect your decision to withdraw your consent, please note that depending on the nature and scope of your request, we may not be in a position to continue providing access to our Services to you. We will, in such circumstances, notify you before completing the processing of your request.
d. Please note that withdrawing consent does not affect our right to continue to collect, use, disclose or Process your Personal Data where such collection, use, disclosure, and Processing without consent is permitted or required under applicable laws.
8.2 **Accessing and Correcting your Personal Data**
a. If you wish to make
* i. an access request for access to a copy of the Personal Data which we hold about you or information about the ways in which we had used or disclosed your Personal Data in the one (1) year prior to the date of your request, or
* ii. a correction request to correct or update any of your Personal Data which we hold about you.
> You may submit your request by emailing us at [contact@siliconflow.com](mailto:contact@siliconflow.com) as per the details provided above.
b. Please note that a reasonable fee may be charged for an access request. If so, we will inform you of the fee before processing your request.
c. We will respond to your request as soon as reasonably possible. Should we not be able to respond to your request within thirty (30) days after receiving your request, we will inform you in writing within thirty (30) days of the time by which we will be able to respond to your request. If we are unable to provide you with any Personal Data or to make a correction requested by you, we shall generally inform you of the reasons why we are unable to do so (except where we are not required to do so under the applicable laws).
## 9. Protection of Personal Data
9.1 We will take appropriate administrative, physical, and technical measures to safeguard your Personal Data from unauthorised access, collection, use, disclosure, copying, modification, disposal or similar risks, and the loss of any storage medium or device on which Personal Data is stored.
9.2 You should be aware, however, that no method of transmission over the Internet or method of electronic storage is completely secure. While security cannot be guaranteed, we strive to protect the security of your Personal Data, and are constantly reviewing and enhancing our security measures.
## 10. Accuracy of Personal Data
10.1 When providing your Personal Data to us, you should ensure such Personal Data is accurate. You should also review your Personal Data from time to time and let us know if there are changes or updates to your Personal Data so that we do not hold any inaccurate Personal Data about you.
10.2 You can review and update your Personal Data at any time by logging in to your account.
## 11. No Right of Enforcement by Third Parties
11.1 A person who is not a party to this Privacy Policy has no right to enforce any of the provisions under this Privacy Policy.
# Terms of Use
Source: https://docs.siliconflow.com/en/legals/terms-of-service
Update Date: Mar. 31st, 2025
These Terms of Use (this “**Agreement**”) form a binding agreement between SILICONFLOW TECHNOLOGY PTE. LTD.(“**SiliconFlow**”, “**we**”, “**us**” or “**our**”) and you (“**User**”, “**you**” or “**yours**”) and governs your access to and use of the Platform (as defined below) and Services (as defined below). The Services are not available for users located in the territory of mainland China and users in China may access our services through [https://siliconflow.cn](https://siliconflow.cn). Please note that this Agreement includes and incorporates by reference our Privacy Policy accessible at [https://docs.siliconflow.com/en/legals/privacy-policy](https://docs.siliconflow.com/en/legals/privacy-policy) (“**Privacy Policy**”) and the User Agreements (as defined below).
You acknowledge that this Agreement has the same force and effect as if it were executed in writing between you and SiliconFlow. By accessing or using any part of the Platform and/or Services, you acknowledge and agree that (i) you have read, understood, and agree to be bound by the terms of this Agreement, Privacy Policy and the User Agreements, and (ii) you have reached the legal age and have the capacity in accordance with the laws and regulations where you are located to form a binding contract with SiliconFlow. **If you do not agree to be bound by the terms of this Agreement, the Privacy Policy, and the User Agreements, are not of legal age, or do not have such capacity to enter into this Agreement, you may not access or use the Platform and Services**.
We reserve the right to revise this Agreement, or to amend or issue new Documentation and other terms and conditions governing your access to and use of the Platform and Services (including new features or functionalities in the Platform and Services) (collectively, “**User Agreements**”) at any time. We may use commercially reasonable methods to notify you of such revisions, such as by providing a push notification to you via the Platform. Your continued access to or use of Platform and/or Services after such notice had been given and such revised Agreement, revised User Agreement or new User Agreement had come into effect shall constitute your acceptance of the revised Agreement, revised User Agreement or new User Agreement (as the case may be).
## 1. DEFINITIONS
1.1 In this Agreement, the following words and expressions shall have the meanings respectively assigned to them hereunder:
“**Account**” has the meaning given to it in **Clause 5.1.**
"**Affiliates**", in relation to a party, means any entity which controls, is controlled by, or is under common control with such party (where "**control**", including its correlative meanings such as "**controlled** **by**", "**controls**" and "**under** **common** **control** **with**", means, the direct or indirect power to direct or cause the direction of the management and policies of a corporation, whether through the ownership of voting securities, by contract, or otherwise).
“**Platform**” means the Platform provided in various versions (including for instance web, API and mobile applications) and made available by SiliconFlow which the User may use to access the Services.
“**Documentation**” means any and all user guides, guidelines, notices, operating rules, policies and instructions or other documentation describing the features, functionality or operation of the Platform and Services supplied or made available by SiliconFlow for use with or in support of the Services, including without limitation any and all revisions, modifications, and updates to such Documentation made by SiliconFlow from time to time.
“**Errors**” has the meaning given to it in **Clause 4.2(c)**.
“**Fees**” has the meaning given to it in **Clause 6.1**.
“**Feedback**” has the meaning given to it in **Clause 12(a)**.
"**Force Majeure Event**" means any circumstance not within a party's reasonable control, including, without limitation (a) fire, storm, lightning, flood, drought, earthquake or other natural disaster or other similar acts of God; (b) epidemic or pandemic; (c) terrorist attack, civil war, civil commotion or riots, war, threat of or preparation for war, armed conflict, imposition of sanctions, embargo, or breaking off of diplomatic relations; (d) any Law or any action taken by a Governmental Authority, including without limitation to changes to Law, imposing an export or import restriction, quota or prohibition, or failing to grant a necessary licence or consent; (e) fire, explosion or accident; (f) any labour or trade dispute, strikes, industrial action or lockouts; (g) non-performance by suppliers or subcontractors; and (h) the unavailability, interruption or failure of utility services such as electricity, gas, water, telecommunications including the internet.
"**Governmental Authority**" means any governmental, administrative, statutory, regulatory or self-regulatory, judicial or arbitral authority or body (including any division thereof), anywhere in the world with jurisdiction over the relevant affairs of SiliconFlow or the User.
“**Harmful Code**” means any computer code, files, scripts and programs, including any malware and/or software, that is intended or known to be harmful, destructive, disabling or which assists in or enables theft, alteration, denial of service, unauthorised disclosure or destruction or corruption of data, including viruses, worms, spyware, adware, keyloggers, trojans, ransomware and any new type of threats.
“**Intellectual Property Rights**” means patents, trademarks, service marks, copyright, know-how, design rights, database rights, rights in software, rights in designs and inventions, trade secrets, confidential information, trade and business names and brands, internet domain names, any application (whether pending, in process or issued) for any of the foregoing and any other industrial, intellectual property or protected right similar to the foregoing (whether registered, registrable or unregistered) in any country and in any form, media, or technology now known or later developed.
**“Interaction Data”** means data generated or processed through the Services provided by this Platform (excluding third-party services), including but not limited to through means of input, feedback, modification, processing, storage, uploading, downloading, distribution, and other methods, in relation to open-source models, third-party websites, software, applications or services.
"**Laws**" means any applicable statute, regulation, by-law, ordinance or subordinate legislation in force from time to time, including the common law as may be applicable from time to time and any applicable industry codes or standards which are of a mandatory and binding nature.
“**Maintenance**” means any scheduled or urgent suspension or restriction of the Platform or Services to allow for Updates, upgrades, repairs, and maintenance of the Platform or Services.
“**Payment Method**” has the meaning given to it in **Clause 6.5**.
“**Payment Service Provider**” has the meaning given to it in **Clause 6.6(a)**.
"**Personal Data**" means data, whether true or not, about an individual who can be identified (a) from that data; or (b) from that data and other information to which a party has or is likely to have access.
“**Personnel**” has the meaning given to it in **Clause 10.6**.
“**Registered User**” has the meaning given to it in **Clause 5.1**.
“**Registration Data**” has the meaning given to it in **Clause 5.4**.
“**Rewards**” has the meaning given to it in **Clause 6.3**.
“**Services**” means the services, functions, features, information and content provided by SiliconFlow and/or its business partners to the User through the Platform. For the avoidance of doubt, Services exclude Third-Party Materials.
“**Technical Data**” means system specific data or information and other technical data relating to the Platform or Services.
“**Term**” has the meaning given to it in **Clause 13.1**.
“**Third-Party Account**” has the meaning given to it in **Clause 5.3**.
“**Third-Party Materials**” has the meaning given to it in **Clause 9.1**.
“**Third Party Software**” has the meaning given to it in **Clause 8.1**.
“**Trademarks**” has the meaning given to it in **Clause 2.3**.
“**Unavailability**” has the meaning given to it in **Clause 4.2(c)**.
“**Updates**” means updates, bug fixes, patches, corrections, modifications, enhancements, new releases, the introduction of new functionalities or features to, or removal or modification of existing functionalities or features from, the software components of the Platform or Services.
“**User Agreements**” means the Documentation and Policies that SiliconFlow may introduce from time to time.
“**User Device**” has the meaning given to it in **Clause 8.1**.
“**User Failure**” means any failure or inability to access or use the Platform or Services that is attributable to the User, including without limitation (i) your access or use of, or attempt to access or use, the Platform and/or Services in breach of this Agreement (including the User Agreements), (ii) the User’s non-compliance with the User Obligations and Restrictions as set out in **Clause 3** of this Agreement; (iii) the User’s delay in performing, or failure to perform any of its obligations under this Agreement (including making payments), (iv) connectivity issues with the Users’ internet connection, or (v) failure or incompatibility of the User Devices, and other hardware or software components required by the User to access or use the Platform or Services which are not provided by SiliconFlow.
“**SiliconFlow Intellectual Property**” has the meaning given to it in **Clause 11.1**.
“**SiliconFlow Proprietary Marking**” has the meaning given to it in **Clause 11.1(a)**.
## 2. LICENSE
2.1 The Platform (including the Documentation and Services) is owned by us. Subject to the terms and conditions of this Agreement, during the Term, SiliconFlow grants you a limited, revocable, non-exclusive, non-transferable, non-sublicensable, and non-assignable license to access and use the Platform and Services for in Singapore.
2.2 All Intellectual Property Rights available on and/or through the Platform and the Services (excluding the Interaction Data and the Registration Data) are owned by SiliconFlow or licensed to SiliconFlow by our licensors. You do not acquire any rights, title or interest in or to the Platform or Services, other than a right to use the Platform or Services in accordance with the limited license granted hereunder and subject to all terms, conditions, and restrictions, under this Agreement. SiliconFlow reserves and shall retain its entire right, title, and interest in and to the Platform and Services, including all Intellectual Property Rights therein or relating thereto.
2.3 The trademarks, service marks, trade names and logos used and displayed on the Platform (the "**Trademarks**") are registered and unregistered trademarks of SiliconFlow (except those Trademarks contained in Registration Data provided by you) and others. Nothing on the Platform should be construed as granting, by implication, estoppel or otherwise, any licence or right to use any Trademarks displayed on and the Platform, without the prior written permission of SiliconFlow or any other applicable trademark owner.
## 3. USER OBLIGATIONS AND RESTRICTIONS
3.1 You shall access and use the Platform and Services in compliance with this Agreement, the User Agreements, Documentation, and all applicable Laws.
3.2 You confirm, declare and warrant that you will comply with the obligations specified under Article 7 of the Agreement.
3.3 You shall not use the Platform or Services:
a. for any unlawful purposes or criminal activity; or
b. to post, upload, publish, submit, disseminate, promote or transmit or otherwise make available any:
* i. unlawful, harassing, libellous, abusive, threatening, harmful, vulgar, obscene, pornographic, indecent, counterfeited, fraudulent, stolen, harmful or otherwise objectionable content or material;
* ii. material that encourages conduct that constitutes a criminal offence, or otherwise breaches any applicable laws, regulations or codes of practice;
* iii. unauthorised material for advertising purposes or otherwise;
* iv. materials that infringe or violate any other person’s Intellectual Property Rights (including without limitation making, transmitting or storing electronic copies of materials protected by Intellectual Property Rights without the permission of the owner), rights of publicity or privacy, or other personal rights; or
* v. materials that, in the sole judgment of SiliconFlow, is objectionable or which restricts or inhibits any other person from using or enjoying the Platform or Services, or which may expose SiliconFlow or its users to any harm or liability of any type.
3.4 In using the Platform and Services, you shall not:
a. impersonate any person or party or falsely declare, distort or misrepresent your affiliation with any person or party;
b. use any content provided on or through this service (including any title information, keywords, or other metadata) for any machine learning and artificial intelligence training or development purposes, or for any technology intended to identify the identity of natural persons;
c. collect or obtain any personal information from this service, including but not limited to the names of other users;
d. attempt to gain unauthorised access to or otherwise interfere with the performance, operation or functionality of any part of the Platform or Services, or any computer facilities of and/or accessed through the Platform;
e. make the Platform, Services or the Documentation (or any part thereof) available to, or use the Platform, Services or the Documentation (or any part thereof) for the benefit of anyone other than yourself;
f. rent, lease, lend, sell, resell, sublicense, assign, distribute, publish, or lease the Platform or Services (or any part thereof) or otherwise make available to any third party for any reason, including the Documentation, or include the Platform or Services in a service bureau, time-sharing, or outsourcing offering;
g. interfere with or disrupt the integrity, performance, operation or functionality of the Platform or Services, or any information and content contained thereon;
h. copy, adapt, modify, prepare derivative works based upon, transfer, publicly display, transmit, or otherwise exploit the Platform or Services, including any function or feature thereof;
i. use any manual or automated software, devices or other processes (including but not limited to spiders, robots, scrapers, crawlers, avatars, data mining tools or similar tools) to “scrape”, collect or download any information and data from the Platform or Services;
j. access the Platform or Services in order to build a competitive product or service or otherwise to compete with SiliconFlow;
k. reverse engineer, disassemble, or otherwise attempt to derive or gain access to the source code or infrastructure of the Platform or Services or any part thereof;
l. attempt to probe, scan, or test the vulnerability of the Platform or Services, any SiliconFlow system or network or breach any security or authentication measures, or otherwise attempt to benchmark the Platform or Services or SiliconFlow’s performance of any services;
m. upload, store on, or transmit or make available through the Platform or Services any Harmful Code;
n. remove, delete, alter or obscure any trademarks or any copyright, trademark, patent or other Intellectual Property Rights notices from the Platform or Services, including any copy thereof;
o. provide any competitor of SiliconFlow (including any employee or contractor of such competitor) with access to or use of the Platform or Services (or any part thereof), including by read-only access, direct access through your identification and password information, or otherwise; or
p. use the Platform or Services for any commercial purposes, including but not limited to advertising, selling or offering to sell any goods or services, or conducting any trainings, events or courses.
3.5 You acknowledge and agree that SiliconFlow reserves the right, but shall have no obligation, to:
1. monitor your access to or use of the Platform or Services, check, vet and/or control any activity, content or information occurring on or through the Platform or Services, to ensure your compliance with this Agreement, or to comply with SiliconFlow’s obligations under applicable Laws or the order or requirement of a court or other Governmental Authority;
2. investigate and prosecute violations of this Agreement to the fullest extent of the Law, report any suspicious or unlawful activities occurring on or through the Platform and Services, and involve and cooperate with law enforcement authorities in prosecuting users who violate this Agreement; and
3. terminate the license granted to you under this Agreement and remove or disable your access to and use of the Platform or Services (or any part thereof) at any time and without prior notice for any reason or no reason (including without limitation to circumstances where SiliconFlow, at its sole discretion, consider any of your actions or operations to be in violation of this Agreement or applicable Law, is harmful to the Platform or Services or any users of the Platform or Services, or to comply with the order or requirement of a court or other Governmental Authority).
## 4. AVAILABILITY
4.1 SiliconFlow will use commercially reasonable efforts to make the Platform and Services available to you, and ensure that the Platform and Services will comply with Singapore Laws.
4.2 Notwithstanding the foregoing, you acknowledge and agree that:
a. As the applicable Singapore Laws and relevant technical reference guides may be subject to changes from time to time, SiliconFlow cannot guarantee that your access to or use of the Platform and/or Services will always remain compliant with the applicable Singapore Laws;
b. The availability and performance of the Platform and/or Services may vary depending on a variety of factors which may be outside of SiliconFlow’s control, including without limitation to stability of the internet and disruption of telecommunication network. SiliconFlow makes no representations or warranties, whether express, implied, statutory or otherwise, to the performance (including without limitation to quality, speed, service level or efficiency), uptime, or availability of the Platform and/or Services, or that your access to or use of the Platform and/or Services will be uninterrupted, error-free or will meet your needs or requirements; and
c. SiliconFlow shall not be held responsible or liable for any errors or disruptions in the Platform and/or Services (“**Errors**”), or your inability to access or use the Platform and/or Services (or any part thereof) (“**Unavailability**”) for any reasons, and any losses or damages you may suffer as a result of such Error or Unavailability, including where such Error or Unavailability is due in part or in whole to any of the following:
* i. User Failure;
* ii. Maintenance;
* iii. Force Majeure Event;
* iv. changes in Laws or orders or requirements of a court or other Governmental Authority;
* v. any suspension or termination of your Account, access and/or use of the Platform and/or Services in accordance with this Agreement; and
* vi. failure of the internet, telecommunication network, power grid failure, or any other reasons not caused by or attributable to SiliconFlow, or beyond SiliconFlow’s control.
4.3 You acknowledge and agree that your access to and/or use of the Platform and/or Services may be occasionally suspended or restricted to allow for Updates. SiliconFlow may at any time, and without giving any reason or notice, Update the Platform and/or Services without any liability towards you. You further agree that all Updates will be deemed part of the Platform or Services and be subject to all terms and conditions of this Agreement.
## 5. USER ACCOUNT
5.1 In order to access the Platform or Services, you are required to become a Registered User and access such features through your Account. For the purposes of the Agreement, a “**Registered User**” is a User who has registered an account on the Platform for the use of such features (“**Account**”).
5.2 In order to become a Registered User, you will be required to register and log in to your Account through a third-party account. .
5.3 SiliconFlow may allow you to link your Account with, or otherwise access the Platform or Services using, your accounts on third party services (for example, \[Google, Github, and other third party services as SiliconFlow may permit from time to time]) (“**Third-Party Account**”). For the purposes of this Agreement, all references to “Account” shall include “Third-Party Account”.
5.4 In creating an Account, you agree to:
a. provide true, accurate, current and complete information about yourself (the “**Registration Data**”);
b. maintain and promptly update the Registration Data to keep it true, accurate, current and complete; and
c. not create an Account using a false identity or information, or on behalf of someone other than yourself.
5.5 You acknowledge and agree that you shall be solely responsible for maintaining the confidentiality and security of your Account and shall not allow another person to use your Account to access the Platform and Services. You shall immediately notify SiliconFlow via [contact@siliconflow.com](mailto:contact@siliconflow.com) if you have reason to suspect that the confidentiality of your Account has been compromised, or if you suspect or become aware of any unauthorised use of your Account or any other breach of security.
5.6 Notwithstanding the foregoing, you acknowledge and agree that any access to and/or use of the Platform or the Services, any actions taken on, and all operations of, the Platform and Services, and any information, data or communications that occur under or through the use of your Account or are referable or traceable to your Account (including without limitation to any Services accessed or activated, and any payments or purchases made under your Account) shall be attributable to you, and you shall be deemed to have taken such actions and shall be solely responsible for all such actions, even if you did not authorise such actions. SiliconFlow shall be entitled (but not obliged) to act upon and hold you responsible and liable for such action, as if such actions were carried out by you. You also agree to indemnify SiliconFlow entirely against any and all losses attributable to any access to and/or use of the Platform and/or the Services referable or traceable to your Account.
5.7 SiliconFlow shall not be liable to you for any harm or loss arising from or relating to the theft of your Account, your disclosure of your Account, or the use of your Account by another person or entity.
5.8 SiliconFlow reserves the right to require you to provide additional Registration Data, change your password, temporarily or permanently suspend or terminate your Account, or impose limits on or restrict your access to and use of the Platform or Services with or without notice at any time for any or no reason including:
a. if you provide any Registration Data that is untrue, inaccurate, not current or incomplete, or SiliconFlow has reasonable grounds to suspect that any Registration Data you provide is untrue, inaccurate, not current or incomplete;
b. if SiliconFlow has reasonable grounds to believe you have violated, or are about to violate, the Agreement, including any incorporated agreements, policies or guidelines, or any applicable Laws, or that your Account may have been compromised;
c. if activities occur under your Account which, in SiliconFlow’s sole discretion, would or might cause damage or losses to SiliconFlow or any users (whether yourself or other users), impair SiliconFlow’s ability to provide the Platform or Services, or infringe or violate any third party rights (including Intellectual Property Rights);
d. if you decline to disclose such information required for the continued usage of the Platform or Services;
e. in response to requests by law enforcement agencies or other Governmental Authority; or
f. to address or respond to technical or security issues or problems, or to allow for repairs, maintenance or the introduction of new functionalities or services.
5.9 SiliconFlow shall not be held liable for any losses suffered by you arising out of or in connection with such suspension or termination of your Account.
5.10 You agree not to create an Account and/or use the Platform or Services if you have previously been banned from the Platform and Services by SiliconFlow.
5.11 You hereby acknowledge and agree that any or all data (including without limitation to user access data, user account data and transaction data) and communications with the Platform may be monitored, captured, recorded and transmitted to the authorities in compliance with the local legal requirements and without further notice.
5.12 It is your responsibility to keep your User Devices and access to this Platform secure. Any removal of software restrictions and limitations imposed by the official operating system of your User Devices may make your User Devices vulnerable to Harmful Code and/or compromise your User Devices’ security features, and may also affect the proper functionality of the Platform and/or Services. We shall not be liable or responsible for any damage, expense or loss of any kind suffered directly or indirectly by you as a result of any loss, disclosure, theft and/or unauthorised use of your Account, security credentials and/or User Devices.
## 6. FEES AND PAYMENT
6.1 You are required to pay fees to us to access or use the Services. In order to access and use such Services, you must make full payment of the applicable fees for the Services which you have received and used (“**Fees**”). The Fees iwill be displayed to you through the Platform prior to you receiving our Services. You’re responsible for all applicable taxes, and we’ll charge tax when required. Should you choose to accept the Fees and receive our Services, such Fees will be due and payable by you immediately upon you having received the Services. The Fees may be recurring or based on usage. If these Fees are specified to be recurring or based on usage, you agree that we may charge the fees on a periodic basis to the payment method you specify at the time of your initial purchase. SiliconFlow may suspend or restrict your further use of our Platform and/or Services if you do not make full payment of the Fees.
6.2 SiliconFlow reserves the right to recover any Fees due from you that arose from Errors as described in **Clause 4.2(c)**.
6.3 You acknowledge and agree that:
a. Except where we specifically agree otherwise in a separate contract with you, we may adjust or increase any Fees for access to or use of the Services at any time. Additional Fees may apply for additional Services or features of the Services that SiliconFlow may make available. In such cases, we will provide you with notice before charging the additional Fees. If we charge additional Fees in connection with our Services, you will have an opportunity to review and accept the additional Fees that you will be charged before being charged. If you do not accept any such additional Fees, we may discontinue your access to the Services or features.
b. While SiliconFlow may make available one or more Payment Methods in the Platform, SiliconFlow does not operate or provide any payment services. The payment services behind each of the respective Payment Methods are provided to you by the relevant service providers (“**Payment Service Providers**”), and your use of such payment services may be subject to you entering into separate agreements or arrangements with such Payment Service Providers, which SiliconFlow is not a party to. SiliconFlow shall not be liable for, and you shall release SiliconFlow from, any obligations or liabilities that may be owed by you to your bank, debit or credit card company, or Payment Service Provider under any agreement or arrangement between you and such third parties;
c. SiliconFlow does not provide you with the service of accepting money for the purpose of executing or arranging for the execution of a payment transaction;
d. SiliconFlow does not provide any online payment gateway or related services; and
e. SiliconFlow does not, and does not purport to, operate a payment service regulated under the Payment Services Act 2019 of Singapore. Consequently, we owe no duties and does not purport to owe any such duties (whether contractual or otherwise) to you in relation to the receipt of such money. You acknowledge that we are not licensed, approved or registered under the Payment Services Act 2019 of Singapore and you may not be afforded the relevant protections set out in the Payment Services Act 2019 of Singapore and related subsidiary legislation, regulations, circulars, notices, directions and guidelines.
6.4 All payments shall be made in the currency as indicated within the Platform for the relevant paid Services.
6.5 You shall be responsible for all taxes and transaction charges associated with your payments.
6.6 Without our written consent or in accordance with other relevant policies of this platform, once the payment obligation arises, it cannot be cancelled, and the fees already paid will not be refunded.
6.7 You shall be responsible for verifying the accuracy of any Fees charged to you. If you dispute or disagree with any Fees charged, you must notify SiliconFlow in writing within seven (7) days from the date such Fees are charged to you. If you do not provide us with such notice within seven (7) days, you shall be deemed to have accepted the accuracy of the Fees and waived your right to dispute the same. SiliconFlow shall not be liable for all losses arising from or in connection with discrepancies or inaccuracies.
6.8 If you have any questions when purchasing services, you can contact us at [contact@siliconflow.com](mailto:contact@siliconflow.com).
## 7. INTERACTION DATA
7.1 **This service may allow Registered Users, in accordance with the purpose of Platform usage, to input, provide feedback, make corrections, process, store, upload, download, or distribute personal data, videos, images, audio, comments, questions, and other content, files, data, and information (collectively referred to as "Interaction Data") between open-source models, third-party websites, software, applications, or services during their use of the models.**
7.2 If any Interaction Data violates applicable laws, regulations, or this Agreement, we reserve the right to delete or suspend Services.
7.3 With respect to your Interaction Data, you hereby confirm, represent, and warrant that:
a. upon our request, you will provide written explanations or authorization regarding the source and legality of any personal information or other data requiring authorization contained in the Interaction Data. If you exceed the scope or duration of authorized use, you shall be solely responsible for obtaining expanded or extended authorization;
b. your Interaction Data, as well as our use of such data under this Agreement, will not violate any applicable laws or infringe any rights of any third party, including but not limited to intellectual property rights and privacy rights;
c. your Interaction Data does not include any information or materials deemed sensitive or confidential by government authorities, nor does it infringe any third party’s confidentiality rights;
d. you will not upload or provide, directly or indirectly through this service, any personal information of children under the age of 14;
e. your Interaction Data does not include nudity or other sexually suggestive content; hate speech, threats, or direct attacks against individuals or groups; abusive, harassing, infringing, defamatory, vulgar, obscene, or privacy-violating content; sexist, racist, ethnic, or other discriminatory content; content promoting self-harm or excessive violence; fake or impersonated profiles; illegal content or material encouraging harmful or unlawful activities; malicious programs or code; personal information of any individual without their consent; or spam, machine-generated content, unsolicited messages, or other objectionable material; and
f. all Interaction Data provided to us are legal and do not infringe upon the legitimate rights and interests of any third party.
7.4. **Disclaimer**. We will not be responsible or liable for any Interaction Data. You are solely responsible for all Interaction Data that you input, modify, process, store, upload, download, distribute, or otherwise handle through this Platform or model services. **Unless otherwise required by law, agreed under specific product rules, or necessary to provide technical assistance for troubleshooting or resolving technical issues at your request, our technical services will strictly execute your instructions for processing Interaction Data. We will not access your Interaction Data. You acknowledge and agree that we and this platform act solely as passive technical supporters or channels for Interaction Data. We are under no obligation to store Interaction Data and will not use or disclose it without authorization. Additionally, we will only use your Interaction Data in compliance with applicable laws and solely for the purpose of providing Services to you.**
## 8. INTERNET / USER DEVICE / THIRD PARTY SOFTWARE
8.1 You acknowledge and agree that to access and use the Platform and Services, you will need access to the Internet and a computing device capable of accessing the Internet and compliant with the specifications set forth in the Documentation (“User Device”). In addition, certain third party software which is not incorporated into the Platform and Services (including the operating system of the User Device and web browsers) (“Third Party Software”) may be required to be properly installed onto such User Device for you to access and use the Platform and Services. You acknowledge that SiliconFlow has no control over the terms and conditions of the end user license agreement provided with such Third Party Software and shall under no circumstance be deemed a party to any agreement or arrangement between you and any third parties. You shall be fully responsible for obtaining Internet access, User Devices and entering into and maintaining the end user license agreement for Third Party Software at your own cost, expense and risk. Your use of such separately acquired Third Party Software and/or the User Device shall be in accordance with any applicable terms and conditions. SiliconFlow shall not be liable for, and you shall release SiliconFlow from, any obligations or liabilities that may be owed by you to any third parties under any agreement or arrangement between you and such third parties. SiliconFlow shall not be liable to you for your inability to access the Platform and/or Services for any reasons not attributable to SiliconFlow, including your lack of access to the Internet, or any issues with the User Device or Third Party Software.
## 9. THIRD PARTY MATERIALS
9.1 SiliconFlow may display, include or make available third-party content or provide links to third-party websites or services (collectively, “**Third-Party Materials**”) on the Platform or Services. You acknowledge and agree that any Third-Party Materials you access through the Platform or Services are entirely at your own risk.
9.2 Without prejudice to the foregoing, you acknowledge and agree that:
a. SiliconFlow may but shall have no obligation to monitor and review such Third-Party Materials, and shall not be responsible for such Third-Party Materials, including their accuracy, completeness, timeliness, currency, validity, copyright compliance, legality, decency, quality or any other aspect thereof;
b. SiliconFlow does not assume and will not have any liability or responsibility to you or any other person or entity for any Third-Party Materials;
c. Third-Party Materials and links thereto are provided solely as a convenience to you and you access and use them entirely at your own risk and subject to such third parties’ terms and conditions;
d. SiliconFlow does not guarantee the continued availability of such Third-Party Materials, and may cease displaying, including or making available such Third-Party Materials at any time at its sole discretion without any liability to you; and
e. SiliconFlow makes no representations or warranties whatsoever, and shall not be liable for any damage, liabilities, losses (including any loss of data or profits), or any other consequences that you may incur arising out of or in relation to your use of Third-Party Materials, any transactions completed in or through the same, nor for any contract entered into by you with any third party.
9.3 You shall indemnify SiliconFlow against all costs, losses, liabilities and damages which arise from any action or claim against SiliconFlow from third parties in respect of your use of, integration and/or interface with Third-Party Materials and related data.
## 10. DISCLAIMERS, LIMITATIONS OF LIABILITY AND INDEMNITY
10.1 You acknowledge and agree that to the fullest extent permitted by applicable Laws, the Platform and Services are provided by SiliconFlow on an “as is,” and “as available” basis, with all faults. Without limiting **Clause 10** in any way, but for the sake of clarity, to the fullest extent permitted by applicable Laws, SiliconFlow does not make any representations, warranties or undertakings, whether express, implied, statutory or otherwise imposed by Laws, regarding or in relation to the Platform and Services, and expressly disclaims all other warranties, representations, and conditions of any kind, whether express, implied, statutory or otherwise, with respect to the Platform and Services and/or the results that may (or may not) be achieved by the use of the Platform and Services, including without limitation to all warranties of merchantability, third-party rights, title, satisfactory quality, fitness for a particular purpose, completeness, non-infringement, accuracy, correctness, reliability, timeliness or effectiveness, compliance with Laws, and any warranties arising from a course of dealing or usage or trade. SiliconFlow also does not warrant that Errors will be corrected or that the Platform or Services will be free from hallucinations, Errors and/or that the Platform or Services is up to date, accurate or complete.
10.2 Without prejudice to the generality of **Clause 10**, SiliconFlow does not represent and warrant:
a. that the Platform or the Services will meet your requirements;
b. the use of the Platform or Services will be or will remain to be permitted by Laws;
c. the accuracy, timeliness, adequacy, commercial value or completeness of all data and/or information contained in the Platform or the Services;
d. that the Platform or the Services, or any material or information obtained through the Platform or Services, will be provided uninterrupted, secure, or free from errors or omissions;
e. that the Platform or the Services or any material obtained through or from the Platform or Services are free from any Harmful Code; or
f. the security of any data or information (including Interaction Data) transmitted by you or to you through the Platform or the Services. In this regard, you acknowledge and agree that you understand that any material or information transmitted or received through the Platform or Services may be accessed by unauthorised third parties, and accept the risk of such occurrences and shall not hold SiliconFlow liable for the same.
10.3 In no event shall SiliconFlow be liable to you for:
a. any loss of earnings, revenue, profits, sales, contracts, business opportunity, business or anticipated savings;
b. any loss of goodwill or loss of reputation;
c. any loss or corruption of data; or
d. any incidental, consequential, exemplary, special, punitive, multiple, pure economic loss, emotional distress or psychological trauma, other indirect losses,
> whether based upon warranty, contract, tort, statute, strict liability or otherwise, even if SiliconFlow has been advised of the possibility of such damages or losses, arising out of, resulting from or relating in any way to:
a. your use or inability to use the Platform or Services for any reasons;
b. your reliance on any material or information made available through the Platform or Services;
c. the cost of procurement of substitute goods or services resulting from any goods, data, information or Services purchased or obtained or messages received for transactions entered into through the Platform and Services;
d. any unauthorized access to or alteration of your data or information (including Interaction Data);
e. statements or conduct of any third party on the Platform; or
f. any other matter relating to the Platform and Services.
10.4 Save with respect to death or personal injury caused by the negligence of SiliconFlow, to the maximum extent permitted by Law, SiliconFlow shall not be liable to you for any death or personal injury, however caused and under any theory of liability, arising out of this Agreement or your use of the Platform and/or Services, or resulting from or relating in any way to your use or inability to use the Platform or Services.
10.5 In no event shall SiliconFlow’s aggregate liability arising out of or related to this Agreement exceed \[the amount of monies paid by you to SiliconFlow for the paid Services in the \[one (1) year] period prior to the date your claim arose].
10.6 You shall indemnify, defend and hold harmless SiliconFlow, our related corporations, our and our related corporations’ directors, officers, employees and agents (collectively, our "**Personnel**") from and against any and all claims, demands, actions, suits proceedings, damages, obligations, losses, liabilities, costs, penalties or expenses (including, but not limited to, legal fees incurred by us on a full indemnity basis) of whatsoever nature which may be suffered or incurred by us as a result of or in connection with:
a. your use of the Platform or Services or the results obtained therefrom;
b. any breach of this Agreement by you;
c. any damage or injury caused by you to any property belonging to any Personnel;
d. any damage or injury caused by you to any person and/or their property; and
e. your infringement of any third party right (including any intellectual property, property, or privacy right).
10.7 You further acknowledge and agree that any Personnel shall be entitled to rely on and enforce the indemnity in **Clause 10.6** as if such Personnel were a party to this Agreement.
10.8 You hereby acknowledge and agree that the disclaimer of warranties, limitations of liability and indemnity in this clause and in the other provisions of this Agreement and the allocation of risk therein are essential elements of the bargain in SiliconFlow’s provision of the Platform and/or Services, without which SiliconFlow would not have provided the Platform and/or Services or entered into this Agreement.
## 11. INTELLECTUAL PROPERTY
11.1 **Ownership.**
a. You acknowledge and agree that SiliconFlow and its third-party licensors own all rights, titles and interests (including without limitation to Intellectual Property Rights) in and to:
* i. the Platform, Services, and Documentation;
* ii. any trade marks, service marks, trade names, domain names, website names, other significant brand features or specific descriptions which will allow a third party to identify SiliconFlow and/or its Affiliates (collectively, “**SiliconFlow Proprietary Markings**”);
* iii. all updates, derivatives and modifications developed or derived therefrom, including without limitation to any software, source and object codes, algorithms, data models, technology, web pages, text, pictures, images, audio, video, charts, layout design, and electronic documents, or customisation to the Platform and Services;
* iv. any intangible ideas, residual knowledge, concepts, know-how and techniques related to or learned from SiliconFlow’s provision of the Platform or Services, including, without limitation, any intangible ideas, residual knowledge, concepts, know-how, and techniques related to any new features for the Platform or Services, whether or not created for you; and
* v. any operation and technical data relating to the Platform and Services (including without limitation to user Account information, Registration Data, operation records, and service orders)
> (collectively, the “**SiliconFlow Intellectual Property**”).
b. As between you and us, you retain your ownership over the rights (including Intellectual Property Rights, if any) in the Interaction Data. You may use the results generated by the large model on the basis of your compliance with the following and in accordance with laws and regulations:(i) your use of the service and the output will not transfer or infringe any intellectual property rights (including infringing the intellectual property rights of Silicone - based Flow and those of other third parties);(ii) If, at our discretion, we consider that your use of the output violates laws and regulations or may infringe the rights of any third party, we may restrict your use of the output at any time and require you to cease using the output (and delete any copies thereof);(iii) you shall not represent that the output of the large - language model is human - generated;(iv) you shall not violate any licensing or usage restrictions of the model provider.
11.2 Other than the limited license and use rights expressly set forth in this Agreement to SiliconFlow Intellectual Property, SiliconFlow does not grant you any rights to SiliconFlow Intellectual Property and reserves all rights therein.
11.3 You shall not, and shall not permit any other person to:
a. access or use SiliconFlow Intellectual Property except in accordance with the terms of and otherwise permitted under this Agreement;
b. display, use, apply for registration any SiliconFlow Proprietary Markings;
c. represent to any other persons, that you have the right to display, use or to otherwise dispose of SiliconFlow Proprietary Markings;
d. modify, alter, remove, delete or destroy any SiliconFlow Proprietary Markings placed upon or contained within the Platform, Services or any Documentation; or
e. take any action which would cause the Platform and/or Services or any part thereof to be placed in the public domain or to become open-source software.
11.4 You further acknowledge that you, and not SiliconFlow, are entirely responsible for all Interaction Data, input, output and all content or other materials that you make available through the Platform and/or Services.
## 12. FEEDBACK.
a. If you propose or provide any ideas, suggestions, recommendations, enhancements, improvements, or other feedback (collectively “**Feedback**”) to SiliconFlow, then you hereby assign all rights, title, and interests, including all copyright, patent, trade dress rights and other Intellectual Property Rights, in and to such Feedback to SiliconFlow.
b. SiliconFlow shall have the right to use and disclose any ideas, know-how, concepts, techniques, or other Intellectual Property Rights contained in such Feedback in any manner and for any purpose in SiliconFlow’s discretion without remuneration, compensation or attribution to you, provided that the foregoing shall not create or imply any obligation on the part of SiliconFlow to use such Feedback.
c. Further, by posting comments or reviews to the Platform, you agree to grant SiliconFlow the right to use the submitted name, referable to said review, comment or other content. You shall not use a false email address, act as a person who is not yourself or otherwise deceive or misinform SiliconFlow or third parties about the source of any submissions.
d. You acknowledge that SiliconFlow is under no obligation to publish any material submitted by you and may edit or remove any previously submitted materials from the Platform at any time.
## 13. TERM AND TERMINATION
13.1 This Agreement shall commence on the date when you accepted this Agreement (as described in the preamble above) and remain in full force and effect while you access or use the Platform and Services, unless terminated earlier in accordance with this Agreement (the “**Term**”). For the avoidance of doubt, you hereby acknowledge and agree that the Agreement commenced on the earlier of (a) the date you first accessed the Platform or Services, or (b) the date you accepted the Agreement.
13.2 Upon any termination of this Agreement:
a. all rights and licenses granted to you shall cease, and you shall immediately discontinue use of the Platform and Services;
b. your access to the Platform and Services may be barred;
c. your Account and related information, files and content associated with or inside your Account (or any part thereof), including your Interaction Data, may be deleted from SiliconFlow’s database at SiliconFlow’s discretion. You acknowledge and agree that SiliconFlow will not have any liability whatsoever to you for deletion of your Account or your Interaction Data; and
d. where applicable, you shall promptly pay all amounts due to SiliconFlow as of the effective date of termination.
13.3 Any provision of this Agreement that expressly or by implication is intended to come into or continue in force on or after the termination of this Agreement shall remain in full force and effect, including without limitation to **Clause 1** (Definitions), **3** (User Obligations and Restrictions), **10** (Disclaimers, Limitation of Liability and Indemnity), **11** (Intellectual Property), **13** (Term and Termination), **14** (Governing Law and Dispute Resolution) and **15** (General Provisions).
## 14. GOVERNING LAW AND DISPUTE RESOLUTION
14.1 This Agreement shall be governed by and construed under the Laws of the Republic of Singapore.
14.2 Any dispute arising out of or in connection with or in relation to this Agreement, including any question regarding the existence, validity or termination of this Agreement shall be referred to and finally resolved by arbitration in Singapore administered by the Singapore International Arbitration Centre (“**SIAC**”) in accordance with the Arbitration Rules of the Singapore International Arbitration Centre (“**SIAC** **Rules**”) for the time being in force, which rules are deemed to be incorporated by reference in this clause. The seat of arbitration shall be Singapore. The Tribunal shall consist of one (1) arbitrator. The language of the arbitration shall be English.
## 15. GENERAL PROVISIONS
15.1 **No Third-Party Beneficiaries.** No third party who is not a party to this Agreement (whether or not such person shall be named, referred to, or otherwise identified, or shall form part of a class of persons so named, referred to, or identified, in this Agreement) shall have any rights to enforce or rely upon any of the provisions of this Agreement.
15.2 **Partnership.** Neither you nor we shall, by virtue of this Agreement, be deemed to be a partner or agent of each other, nor shall anything contained herein be construed as creating a partnership, joint association or trust, it is agreed that each party will be responsible only for its obligations under this Agreement, and neither party shall be authorised to represent or bind the other to any other person.
15.3 **Notices**. Where SiliconFlow requires that you provide an e-mail address, you are responsible for providing SiliconFlow with your most current e-mail address. In the event that the last e-mail address you provided to SiliconFlow is not valid, or for any reason is not capable of delivering to you any notices required/ permitted by the Agreement, SiliconFlow’s dispatch of the e-mail containing such notice will nonetheless constitute effective notice. All notices or other communications given to you will be deemed received by you on (a) if sent via any print or electronic media that we select, the date of publication or broadcast, (b) if sent by post, or left at your last known address, the day after such posting or on the day it was left at your last known address, or (c) if sent by email, the time at which the email was sent by us. You may only send us notices in writing to our designated address or email address. We shall be considered as having received such notice only upon receipt. Though we endeavour to respond to customer notices as swiftly as we are able, we cannot promise to always answer with consistent speed. You consent to receive communications from us electronically. You agree that all agreements, notices, disclosures and other communications which we provide to you electronically satisfy any legal requirement that such communications be in writing. You further waive any rights under any legal requirement in any jurisdiction which requires an original (non-electronic) signature or delivery or retention of non-electronic records.
15.4 **No Contra Proferentum Rule**. You acknowledge and agree that prior to accessing or using the Platform and Services, you have had the opportunity to seek, or have sought the advice of independent legal counsel, and have read and understood all of the terms and conditions of this Agreement and its legal effect. This Agreement shall not be construed against SiliconFlow because SiliconFlow drafted its provisions, and any rule of construction that a document shall be construed against the drafting party shall not apply to this Agreement.
15.5 **No Waiver.** No failure on our part to exercise, and no delay on our part in exercising, any right or remedy under this Agreement, will operate as a waiver thereof, nor will any single or partial exercise of any right or remedy preclude any other or further exercise thereof, or the exercise of any other right or remedy.
15.6 **Cumulative rights and remedies**. Unless otherwise provided under this Agreement, the provisions of this Agreement and our rights and remedies under this Agreement are cumulative and are without prejudice and in addition to any rights or remedies we may have at law or in equity, and no exercise by us of any one right or remedy under this Agreement, or at law or in equity, shall (save to the extent, if any, expressly provided for in this Agreement or at law or in equity) operate so as to hinder or prevent our exercise of any other such right or remedy as at law or in equity.
15.7 **Assignment.**
e. This Agreement shall be binding upon and inure to our and your benefit, and any of our and your successors and permitted assigns. You may not assign or transfer any of your rights, benefits or obligations under this Agreement without our prior written consent. No assignment shall relieve or discharge you of any of your obligations or liabilities hereunder, notwithstanding any voluntary assumption by the assignee of such obligations and liabilities.
f. We shall be entitled, in our discretion, to delegate or subcontract the performance of any of our functions in connection with the Platform, Services and our performance of our obligations under this Agreement, and reserve the right to use any service provider, subcontractor and/or agent on such terms as we deem appropriate.
15.8 **Severability.** If a court of competent jurisdiction finds any provision of this Agreement invalid or unenforceable, that provision of this Agreement will be amended to achieve as nearly as possible the intent of the parties, and the remainder of this Agreement will remain in full force and effect.
15.9 **Language**. This Agreement is made in the English language only, and any translation of these terms and conditions in another language shall not be binding upon the parties.
# Using in DB-GPT
Source: https://docs.siliconflow.com/en/usercases/use-siliconcloud-in-DB-GPT
## 1. About DB-GPT
[DB-GPT](https://github.com/eosphoros-ai/DB-GPT) **is an open-source AI native data application development framework (AI Native Data App Development framework with AWEL (Agentic Workflow Expression Language) and Agents).**
Its purpose is to build infrastructure in the field of large models by developing capabilities like multi-model management (SMMF), Text2SQL optimization, RAG framework and enhancements, multi-agent framework collaboration, AWEL (agentic workflow orchestration), and more. This makes building large model applications centered around databases simpler and more convenient.
## 2. Obtain API Key
2.1 Open the [SiliconCloud official website](https://cloud.siliconflow.com/) and register an account (if already registered, simply log in).
2.2 After registration, navigate to [API Key](https://cloud.siliconflow.com/account/ak), create a new API Key, and copy it for later use.
## 3. Deploy DB-GPT
### 3.1 Clone the DB-GPT Source Code
```bash
git clone https://github.com/eosphoros-ai/DB-GPT.git
```
### 3.2 Create a Virtual Environment and Install Dependencies
```bash
# Navigate to the root directory of the DB-GPT source code
cd DB-GPT
# DB-GPT requires Python >= 3.10
conda create -n dbgpt_env python=3.10
conda activate dbgpt_env
# Install dependencies for proxy model support
pip install -e ".[proxy]"
```
### 3.3 Configure Basic Environment Variables
```bash
# Copy the template env file as .env
cp .env.template .env
```
### 3.4 Modify the `.env` Environment Variable File to Configure the SiliconCloud Model
```bash
# Use the proxy model from SiliconCloud
LLM_MODEL=siliconflow_proxyllm
# Specify the model name to use
SILICONFLOW_MODEL_VERSION=Qwen/Qwen2.5-Coder-32B-Instruct
SILICONFLOW_API_BASE=https://api.ap.siliconflow.com/v1
# Enter the API Key obtained in Step 2
SILICONFLOW_API_KEY={your-siliconflow-api-key}
# Configure the Embedding model from SiliconCloud
EMBEDDING_MODEL=proxy_http_openapi
PROXY_HTTP_OPENAPI_PROXY_SERVER_URL=https://api.ap.siliconflow.com/v1/embeddings
# Enter the API Key obtained in Step 2
PROXY_HTTP_OPENAPI_PROXY_API_KEY={your-siliconflow-api-key}
# Specify the Embedding model name
PROXY_HTTP_OPENAPI_PROXY_BACKEND=BAAI/bge-large-zh-v1.5
# Configure the rerank model from SiliconCloud
RERANK_MODEL=rerank_proxy_siliconflow
RERANK_PROXY_SILICONFLOW_PROXY_SERVER_URL=https://api.ap.siliconflow.com/v1/rerank
# Enter the API Key obtained in Step 2
RERANK_PROXY_SILICONFLOW_PROXY_API_KEY={your-siliconflow-api-key}
# Specify the rerank model name
RERANK_PROXY_SILICONFLOW_PROXY_BACKEND=BAAI/bge-reranker-v2-m3
```
Note that the `SILICONFLOW_API_KEY`, `PROXY_HTTP_OPENAPI_PROXY_SERVER_URL`, and `RERANK_PROXY_SILICONFLOW_PROXY_API_KEY` environment variables are the SiliconCloud API Keys obtained in Step 2. The language model (`SILICONFLOW_MODEL_VERSION`), embedding model (`PROXY_HTTP_OPENAPI_PROXY_BACKEND`), and rerank model (`RERANK_PROXY_SILICONFLOW_PROXY_BACKEND`) can be found in the [Model List - SiliconFlow](https://docs.siliconflow.com/api-reference/models/get-model-list).
### 3.5 Start the DB-GPT Service
```bash
dbgpt start webserver --port 5670
```
Open the browser and navigate to [http://127.0.0.1:5670/](http://127.0.0.1:5670/) to access the deployed DB-GPT.
## 4. Use SiliconCloud Models through the DB-GPT Python SDK
### 4.1 Install the DB-GPT Python Package
```bash
pip install "dbgpt>=0.6.3rc2" openai requests numpy
```
Install additional dependencies for testing.
### 4.2 Use SiliconCloud's Large Language Model
```python
import asyncio
import os
from dbgpt.core import ModelRequest
from dbgpt.model.proxy import SiliconFlowLLMClient
model = "Qwen/Qwen2.5-Coder-32B-Instruct"
client = SiliconFlowLLMClient(
api_key=os.getenv("SILICONFLOW_API_KEY"),
model_alias=model
)
res = asyncio.run(
client.generate(
ModelRequest(
model=model,
messages=[
{"role": "system", "content": "You are a helpful AI assistant."},
{"role": "human", "content": "Hello"},
]
)
)
)
print(res)
```
### 4.3 Use SiliconCloud's Embedding Model
```python
import os
from dbgpt.rag.embedding import OpenAPIEmbeddings
openai_embeddings = OpenAPIEmbeddings(
api_url="https://api.ap.siliconflow.com/v1/embeddings",
api_key=os.getenv("SILICONFLOW_API_KEY"),
model_name="BAAI/bge-large-zh-v1.5",
)
texts = ["Hello, world!", "How are you?"]
res = openai_embeddings.embed_documents(texts)
print(res)
```
### 4.4 Use SiliconCloud's Rerank Model
```python
import os
from dbgpt.rag.embedding import SiliconFlowRerankEmbeddings
embedding = SiliconFlowRerankEmbeddings(
api_key=os.getenv("SILICONFLOW_API_KEY"),
model_name="BAAI/bge-reranker-v2-m3",
)
res = embedding.predict("Apple", candidates=["苹果", "香蕉", "水果", "蔬菜"])
print(res)
```
## 5. Getting Started Guide
Take the data dialogue feature as an example. The data dialogue capability allows natural language conversations with data, primarily supporting structured and semi-structured data, assisting in data analysis and insights. Below is the specific operation process:
### 1. Add a Data Source
First, select "Data Source" on the left to add a database. DB-GPT currently supports multiple database types. Choose the appropriate database type to add. Here, MySQL is used for demonstration. The test data for this demo can be found in the [test examples](https://github.com/eosphoros-ai/DB-GPT/tree/main/docker/examples/sqls).
### 2. Select Dialogue Type
Choose the ChatData dialogue type.
### 3. Start Data Dialogue
Note: During the conversation, select the corresponding model and database. DB-GPT also provides both preview and edit modes.
# Using in Chatbox
Source: https://docs.siliconflow.com/en/usercases/use-siliconcloud-in-chatbox
## 1 About Chatbox
Chatbox is a popular cross-platform chat client for large language models, known for its powerful features and simple installation process. You can use it to connect to various large language models and chat with AI on any device (computer, mobile, or web).
Chatbox not only provides easy-to-use AI chat functionality but also offers a range of powerful features:
* **Artifact Preview**: In Chatbox, you can preview the actual effects of AI-generated code, such as creating a webpage or a snake game, and run it directly within Chatbox.
* **Chart Creation**: Let AI generate mind maps, flowcharts, and statistical charts.
* **Document Understanding and Visual Recognition**: Send documents or images to AI for analysis.
* **Webpage Parsing and Recognition**: Send links to AI and discuss webpage content.
## 2 Installing and Using Chatbox
Visit the [Chatbox official website](https://chatboxai.app/) to download the installation package.
Chatbox supports all major operating systems, including Windows, macOS, and Linux, as well as mobile systems like iOS and Android. After downloading the installation package, simply install it on your system. Alternatively, you can also access and use the web version of Chatbox.
## 3 Using SiliconCloud Models in Chatbox
### 3.1 Configure SiliconCloud API Key
Visit [API Key](https://cloud.siliconflow.com/account/ak) to create or copy an existing key.
### 3.2 Configuration in Chatbox
#### 3.2.1 Open Chatbox and go to settings
#### 3.2.2 Create a custom model provider
Click the "Model Provider" toggle button, then click "Add Custom Provider" at the bottom of the pop-up menu.
#### 3.2.3 Configure SiliconCloud integration details
Fill out the form with the SiliconCloud integration settings:
* **Name**: (e.g., SiliconCloud, for easier identification later)
* **API Domain**: [https://api.ap.siliconflow.com/](https://api.ap.siliconflow.com/)
* **API Path**: /v1/chat/completions
* **API Key**: Enter the API key created in the SiliconCloud dashboard.
* **Model**: Add the model you want to use (e.g., Qwen/Qwen2.5-7B-Instruct). You can find all SiliconCloud model options on the [Model Plaza](https://cloud.siliconflow.com/models).
* Click "Save" to start chatting.
#### 3.2.4 Start chatting
After completing the steps above, the configuration should be successful. Perform a simple chat test.
### 3.3 Usage Tips
Here are some tips for using Chatbox effectively.
#### 3.3.1 Use Chatbox's charting capabilities to generate visual charts during chats
Chatbox's "Chart Assistant" can generate various charts, making it easier to understand data during conversations.
**Note**: For better results, choose smarter and more powerful models. The model's capabilities directly affect the quality of the charts.
#### 3.3.2 Use Chatbox's Artifact Preview feature to view the execution results of AI-generated code
Chatbox's Artifact Preview feature allows you to directly preview the actual running effects of AI-generated frontend code.
**Note**: For better results, choose smarter and more powerful models. The model's capabilities directly affect the quality of the generated code.
In addition to these tips, Chatbox has many hidden powerful features beneath its simple and user-friendly interface, offering plenty of areas to explore.
# Using in ChatHub
Source: https://docs.siliconflow.com/en/usercases/use-siliconcloud-in-chathub
## About ChatHub
[ChatHub](https://chathub.gg/zh) is a popular large language model aggregation plugin that allows users to chat with multiple models simultaneously, making it convenient to compare responses. ChatHub has hundreds of thousands of active users worldwide.
## Installing ChatHub
Open the [ChatHub official website](https://chathub.gg/zh) in your browser and click the "Add to Chrome" button to install the ChatHub browser plugin:
After installation, the ChatHub settings page will open automatically.
## Using SiliconCloud Models in ChatHub
1. In the ChatHub settings, locate the "Custom Bot" section and click the "Add" button.
2. In the pop-up window, follow these steps:
1. Enter the bot name.
2. Select SiliconFlow as the provider.
3. Enter the SiliconFlow key.
4. Specify any model supported by SiliconFlow.
3. After clicking "Confirm," the model will be successfully configured.
4. Start chatting.
## Comparing Multiple Models in ChatHub
You can repeat the above steps to add other models to ChatHub. Then, you can use ChatHub's All-in-One feature to chat with multiple models simultaneously (up to 6 models at the same time):
In addition to the core comparison feature, ChatHub also offers powerful functionalities such as a prompt library and code preview. You can learn more in the [ChatHub Official Documentation](https://doc.chathub.gg/introduction).
# Using in Cline
Source: https://docs.siliconflow.com/en/usercases/use-siliconcloud-in-cline
## 1. Install Cline
[Installation link](https://marketplace.visualstudio.com/items?itemName=saoudrizwan.claude-dev)
## 2. Open Cline
In VSCode, use Ctrl/Command+Shift+P to open the command palette and open Cline in a new tab for configuration.
## 3. Configure in the new window
1. API Provider: Select "OpenAI Compatible"
2. Base URL: [https://api.ap.siliconflow.com/v1](https://api.ap.siliconflow.com/v1)
3. API Key: Obtain it from [https://cloud.siliconflow.com/account/ak](https://cloud.siliconflow.com/account/ak)
4. Model ID: Obtain it from [https://cloud.siliconflow.com/models](https://cloud.siliconflow.com/models)
After completing the above steps, you can start using SiliconCloud in Cline.
# Using in Deep Research
Source: https://docs.siliconflow.com/en/usercases/use-siliconcloud-in-deep-research
## 1. Introduction
Deep Research Web UI is an AI-powered research assistant that combines search engines, web scraping, and large language models to enable AI to independently search for information on a given question, dig deeper, and finally generate a research report.
Features of this project:
* 💰 **Low Cost**: Achieve "in-depth research" effects similar to ChatGPT, Perplexity, and Metaphor at a very low cost.
* 🚀 **Privacy and Security**: All configurations and API requests are completed on the browser side, and self-deployment is supported.
* 🕙 **Real-Time Feedback**: Stream AI responses and display them in real time on the interface.
* 🌳 **Search Visualization**: Display the research process using a tree structure, supporting English search terms.
* 📄 **Export to PDF**: Export the final research report in Markdown and PDF formats.
* 🤖 **Multi-Model Support**: Uses pure prompt engineering instead of structured outputs, compatible with more large model providers.
Project open-source repository: [GitHub](https://github.com/AnotiaWang/deep-research-web-ui)
## 2. How to Use
Open the [Deep Research Web UI homepage](https://deep-research.ataw.top) and click the "⚙️" button in the top right corner to open the settings panel.
### 2.1 Configure AI Large Model Service
1. Register or log in to an account on SiliconCloud.
2. Generate a new API key in [API Keys](https://cloud.siliconflow.com/account/ak) and copy it.
3. Return to the Deep Research webpage, and in the AI Service section of the settings, select "SiliconFlow." Paste the API key you just generated into the "API Key" field.
4. In the "Model Name" field, click the dropdown button on the right (or type the model name in the input box to filter) and select the model you want to use.
5. (Optional) Configure context length: If you plan to conduct large-scale research, it is recommended to configure the "Context Length" option. Ensure it does not exceed the maximum context length of the selected model to avoid request failures.
### 2.2 Configure Networked Search Model
Currently, Tavily and Firecrawl are supported, with more search services to be added in the future. Here, we choose Tavily as it provides 1,000 free searches per month, sufficient for most scenarios.
1. Register an account on the [Tavily homepage](https://app.tavily.com/home). Then create a new API key in the console and copy it.
* Key Name can be set to Deep Research.
* Key Type depends on your usage. For light usage, select "Development"; for heavy usage, select "Production," which supports higher request frequencies.
* Keep the API key secure and do not disclose it.
2. Return to the Deep Research webpage, and in the "Networked Search Service" section of the settings, select "Tavily." Enter the API key you just generated into the "API Key" field.
3. (Optional) Set the language used for searches. By default, the AI model will use the current language of your webpage for searches and responses. However, if you want to use English search terms to find higher-quality information, you can set the "Language" option to English.
With these configurations complete, you can start using the platform!
# Using in Dify
Source: https://docs.siliconflow.com/en/usercases/use-siliconcloud-in-dify
Leverage the advantages of multiple SiliconCloud models and fast speed to quickly implement workflows/Agents in Dify.
## 1. Obtain API Key
1. Open the SiliconCloud [official website](https://cloud.siliconflow.com/) and register an account (if you already have one, simply log in).
2. After registration, go to [API Key](https://cloud.siliconflow.com/account/ak), create a new API Key, and copy the key for later use.
## 2. Using SiliconCloud Language Models in Dify
### 2.1 Using the Built-in SiliconCloud Model API in Dify
1. Open the SiliconCloud official website and register an account (if you already have one, simply log in). After registration, go to API Key, create a new API Key, and copy the key for later use.
2. On the Dify homepage, click "Settings" in the top-right corner and select "Model Provider" from the top-left menu.
3. Find "SiliconCloud," paste the previously copied API Key from the SiliconCloud platform, and click the "Save" button.
4. Once successfully validated, you will see the models provided by SiliconCloud in the top section of the model provider list and can use SiliconCloud models in your applications.
### 2.2 Using SiliconCloud Models Not Currently Available in Dify's Source Code
1. Open Dify's "Settings" for configuration.
2. Select "Model Provider" from the navigation bar and add a model service platform compatible with the OpenAI API.
3. Configure the corresponding SiliconCloud settings, including Model Name, API Key, and API Endpoint:
* **Model Name:** Select from the [model-list](/api-reference/models/get-model-list) documentation.
* **API Key:** Obtain it from [https://cloud.siliconflow.com/account/ak](https://cloud.siliconflow.com/account/ak). Note: If you need to use overseas models, complete identity verification first.
* **API Endpoint URL:** [https://api.ap.siliconflow.com/v1](https://api.ap.siliconflow.com/v1)
4. After completing the setup, you will see the newly added models in the model list.
## 3. Using SiliconCloud Image Generation Models in Dify
Refer to [Using SiliconCloud Image Generation Models in Dify](https://docs.dify.ai/guides/tools/tool-configuration/siliconflow).
# Using in MindSearch
Source: https://docs.siliconflow.com/en/usercases/use-siliconcloud-in-mindsearch
## 1. Obtain API Key
1. Open the SiliconCloud [official website](https://cloud.siliconflow.com/) and register an account (if you already have one, simply log in).
2. After completing the registration, go to [API Key](https://cloud.siliconflow.com/account/ak), create a new API Key, and copy the key for later use.
## 2. Deploy MindSearch
1. Clone MindSearch to your local environment and install the necessary dependencies (refer to [https://github.com/InternLM/MindSearch/blob/main/README.md](https://github.com/InternLM/MindSearch/blob/main/README.md)).
2. Modify the following file:
`/path/to/MindSearch/mindsearch/models.py`
3. Add the configuration for calling the SiliconFlow API. The configuration is as follows:
```
internlm_silicon = dict(type=GPTAPI,
model_type='internlm/internlm2_5-7b-chat',
key=os.environ.get('SILICON_API_KEY', 'YOUR SILICON API KEY'),
openai_api_base='https://api.ap.siliconflow.com/v1/chat/completions',
meta_template=[
dict(role='system', api_role='system'),
dict(role='user', api_role='user'),
dict(role='assistant', api_role='assistant'),
dict(role='environment', api_role='system')
],
top_p=0.8,
top_k=1,
temperature=0,
max_new_tokens=8192,
repetition_penalty=1.02,
stop_words=['<|im_end|>'])
```
After adding this configuration, you can execute the relevant commands to start MindSearch.
4. Start the backend:
```
# Specify the SiliconFlow API Key
export SILICON_API_KEY=The key copied in the previous steps
# Start
python -m mindsearch.app --lang en --model_format internlm_silicon --search_engine DuckDuckGoSearch
```
5. Start the frontend. Here, the Gradio frontend is used as an example. For other frontend setups, refer to the MindSearch README:
`python frontend/mindsearch_gradio.py`
## 3. Upload to HuggingFace Space
We can also choose to deploy it to HuggingFace Space.
1. Go to [https://huggingface.co/new-space](https://huggingface.co/new-space) and create a new Space. Configure it as follows:
* Gradio
* Template: Blank
* Hardware: CPU basic · 2 vCPU · 16GB · FREE
2. After successfully creating the Space, go to "Settings" and set the API Key.
3. Upload the MindSearch directory from step 2, `requirements.txt`, and an `app.py` file.
For the detailed content of `app.py`, refer to: [https://huggingface.co/spaces/SmartFlowAI/MindSearch\_X\_SiliconFlow/blob/main/app.py](https://huggingface.co/spaces/SmartFlowAI/MindSearch_X_SiliconFlow/blob/main/app.py)
# Using in Obsidian Copilot
Source: https://docs.siliconflow.com/en/usercases/use-siliconcloud-in-obsidian
Obsidian Copilot is an open-source AI assistant plugin that is simple in design and easy to use. Users can interact with various models through built-in API keys or local models. It supports custom prompts, quick conversations with the entire note library, and provides answers and insights. It is designed to be the ultimate privacy-focused AI assistant with a deep understanding of your personal knowledge base.\
How can you use SiliconCloud models in Obsidian?
## 1. Obtain API Key
1. Open the SiliconCloud [official website](https://cloud.siliconflow.com/) and register an account (if you already have one, simply log in).
2. After completing the registration, go to [API Key](https://cloud.siliconflow.com/account/ak), create a new API Key, and copy the key for later use.
## 2. Use the SiliconCloud Language Model Series in Obsidian Copilot
### 2.1 Install Obsidian Copilot
1. Install the Obsidian application. For details, visit the [Obsidian official website](https://obsidian.md/).
2. Install the Copilot plugin in Obsidian.
### 2.2 Configure the SiliconCloud Model in Obsidian Copilot
#### 2.2.1 Set up the LLM Model
1. Select Copilot.
2. Enter the model name from SiliconCloud [SiliconCloud Platform LLM List](https://cloud.siliconflow.com/models?types=chat).
3. Choose a third-party model compatible with Open API: 3rd party (openai-format).
4. Enter the corresponding Base URL for SiliconCloud: [https://api.ap.siliconflow.com/v1](https://api.ap.siliconflow.com/v1).
5. Enter the corresponding API Key for SiliconCloud: ([https://cloud.siliconflow.com/account/ak](https://cloud.siliconflow.com/account/ak)).
6. Click “Add Model” to complete the setup.
#### 2.2.2 Set up the Embedding Model
1. Enter the corresponding Embedding model name. Refer to the [SiliconCloud Platform Embedding List](https://cloud.siliconflow.com/models?types=embedding).
2. Choose a third-party model compatible with Open API: 3rd party (openai-format).
3. Enter the corresponding Base URL for SiliconCloud: [https://api.ap.siliconflow.com/v1](https://api.ap.siliconflow.com/v1).
4. Enter the corresponding API Key for SiliconCloud: ([https://cloud.siliconflow.com/account/ak](https://cloud.siliconflow.com/account/ak)).
5. Click “Add Model” to complete the setup.
#### 2.2.3 Load the Configuration
Select the model you just added, then click “Save and Reload” to save and reload the configuration.\
You can now perform retrieval and Q\&A based on the SiliconCloud model and your local knowledge base.
# Using in Sider
Source: https://docs.siliconflow.com/en/usercases/use-siliconcloud-in-sider
As the "Chrome Editor's Choice Extension of the Year" for 2023, Sider has received over 50K "5-star reviews" and has more than 6 million active users. The Sider browser extension primarily addresses:
* Sider (ChatGPT Sidebar) is your helpful AI assistant, allowing you to use it while browsing any website.
1. Developers can visit the [Sider official website](https://sider.ai/en/) to use the Sider application.
2. Sider provides a registration method compatible with OpenAI API models to meet the needs of software developers, making it more convenient to use the desired models.
3. As a one-stop cloud service platform integrating top AI models, SiliconCloud is dedicated to providing developers with faster, cheaper, more comprehensive, and smoother model APIs.
So how can you use SiliconCloud in Sider?
## 1. Obtain API Key
1. Open the SiliconCloud [official website](https://cloud.siliconflow.com/) and register an account (if you already have one, simply log in).
2. After registration, go to [API Key](https://cloud.siliconflow.com/account/ak), create a new API Key, and copy the key for later use.
## 2. Using SiliconCloud Language Models in Sider
1. Open Sider settings.
2. Use the OpenAI API Key mode.
3. Enter the API Key from SiliconCloud.
4. Enter the corresponding SiliconCloud API endpoint address.
5. Enter the model name from SiliconCloud.
6. Verify in the dialog box to ensure it is working.
# Image Generation
Source: https://docs.siliconflow.com/en/userguide/capabilities/images
## 1. Introduction to Image Generation Models
The platform provides two main usage methods for image generation models: one is generating images directly based on prompt input, and the other is generating image variants based on existing images combined with prompt input.
* **Creating Images Based on Text Prompts**
When using text-to-image models, carefully designing the input prompt is crucial for generating high-quality images. Below are some tips for crafting prompts to improve the quality of generated images:
* **Specific Descriptions**: Provide as much detail as possible about the image you want to generate. For example, instead of simply inputting "beach sunset," you could try "A tranquil beach at sunset, with the sky glowing orange and red, gentle waves lapping at the shore, and a small boat in the distance."
* **Emotion and Atmosphere**: In addition to describing the content of the image, include descriptions of the emotion or atmosphere, such as "warm," "mysterious," or "vibrant," to help the model better understand the desired style.
* **Style Specification**: If you have a preference for a particular artistic style, such as "Impressionism" or "Surrealism," explicitly mention it in the prompt to increase the likelihood of the generated image meeting your expectations.
* **Avoid Vague Terms**: Try to avoid using overly abstract or vague terms, such as "beautiful" or "nice," as these are difficult for the model to concretize and may lead to results that deviate from your expectations.
* **Use Negative Prompts**: If you want to exclude certain elements from the image, use negative prompts. For example, "Generate an image of a beach sunset, but without any boats."
* **Step-by-Step Inputs**: For complex scenes, try breaking the prompt into steps—first generate a base image, then adjust or add details as needed.
* **Experiment with Different Descriptions**: Sometimes, even when describing the same scene, different wording can yield different results. Experiment with various angles or phrasing to find the most satisfactory outcome.
* **Leverage Model-Specific Features**: Some models may offer specific features or parameter adjustment options, such as controlling image resolution or style intensity. Utilizing these features can also help improve the quality of generated images.
By following these methods, you can effectively enhance the quality of images generated using text-to-image models. However, since different models may have unique characteristics and preferences, practical usage may require adjustments based on the specific model's features and feedback.
Here are some example prompts:
> A futuristic eco-friendly skyscraper in central Tokyo. The building incorporates lush vertical gardens on every floor, with cascading plants and trees lining glass terraces. Solar panels and wind turbines are integrated into the structure's design, reflecting a sustainable future. The Tokyo Tower is visible in the background, contrasting the modern eco-architecture with traditional city landmarks.
> An elegant snow leopard perched on a cliff in the Himalayan mountains, surrounded by swirling snow. The animal’s fur is intricately detailed with distinctive patterns and a thick winter coat. The scene captures the majesty and isolation of the leopard's habitat, with mist and mountain peaks fading into the background.
* **Generating Image Variants Based on Existing Images**
Some image generation models support creating image variants based on existing images. In this case, it is still necessary to input an appropriate prompt to achieve the desired effect. Refer to the prompt crafting tips above for guidance.
## 2. Experience the Feature
You can explore the image generation feature via [Image Generation](https://cloud.siliconflow.com/playground/image) or use the [API Documentation](https://docs.siliconflow.com/api-reference/images/images-generations) to make API calls.
* **Key Parameter Descriptions**
* **image\_size**: Controls the resolution of the generated image. When making API requests, you can customize various resolutions.
* **num\_inference\_steps**: Controls the number of steps for image generation.
* **batch\_size**: Specifies the number of images to generate at once. The default value is 1, and the maximum value is 4.
* **negative\_prompt**: Allows you to specify elements you do not want to appear in the image, removing potential unwanted factors.
* **seed**: To generate consistent images across multiple runs, set the seed to a fixed value.
***
## 3. Supported Models
Currently supported image generation models:
* **Text-to-Image Series**:
* black-forest-labs Series:
* black-forest-labs/FLUX.1-dev
* black-forest-labs/FLUX.1-schnell
Note: The list of supported image generation models may change. Please filter by the "Image" tag in the **Models** section to view the supported model list.
# Reasoning
Source: https://docs.siliconflow.com/en/userguide/capabilities/reasoning
## Overview
DeepSeek-R1 is a series of advanced language models developed by deepseek-ai, designed to enhance the accuracy of final answers by outputting reasoning chain content (`reasoning_content`). This interface is compatible with the deepseek interface, and it is recommended to upgrade the OpenAI SDK to support new parameters when using this model.
### Supported Models:
* deepseek-ai/DeepSeek-R1
* deepseek-ai/DeepSeek-R1-Distill-Qwen-32B
* deepseek-ai/DeepSeek-R1-Distill-Qwen-14B
* deepseek-ai/DeepSeek-R1-Distill-Qwen-7B
* deepseek-ai/DeepSeek-R1-Distill-Qwen-1.5B
## Installation and Upgrade
Before using DeepSeek-R1, ensure that the latest version of the OpenAI SDK is installed. You can upgrade it using the following command:
```bash
pip3 install -U openai
```
## API Parameters
* Input Parameters:
* `max_tokens`: The maximum length of the answer (including reasoning chain output). The maximum value for `max_tokens` is 16k.
* Return Parameters:
* `reasoning_content`: The reasoning chain content, at the same level as `content`.
* `content`: The final answer content.
* Usage Recommendations:
* Set `temperature` between 0.5 and 0.7 (recommended value is 0.6) to prevent infinite loops or incoherent outputs.
* Set `top_p` to 0.95.
* Avoid adding system prompts; all instructions should be included in the user prompt.
* For mathematical problems, include an instruction in the prompt, such as: "Please reason step by step and write the final answer in \boxed{}."
* When evaluating model performance, it is recommended to conduct multiple tests and average the results.
* The DeepSeek-R1 series tends to bypass reasoning mode (outputting "\n\n") for certain queries, which may affect model performance. To ensure adequate reasoning, it is recommended to force the model to start each output with "\n".
{/*
- Use specific prompts for file uploads and web searches to provide a better user experience.
* For file uploads, create prompts using the template where `{file_name}`, `{file_content}`, and `{question}` are parameters:
```bash
file_template = \
"""[file name]: {file_name}
[file content begin]
{file_content}
[file content end]
{question}"""
```
* For web searches, `{search_results}`, `{cur_data}`, and `{question}` are parameters.
* For Chinese queries, use the following prompt:
```bash
search_answer_zh_template = \
```# The following content is based on the search results related to the user's message:
{search_results}
Each result in the search results is formatted as [webpage X begin]...[webpage X end], where X represents the numerical index of each article. Please cite the context at the end of the relevant sentence when appropriate. Use the citation format [citation:X] in the corresponding part of your answer. If a sentence is derived from multiple contexts, list all relevant citation numbers, such as [citation:3][citation:5]. Be sure not to cluster all citations at the end; instead, include them in the corresponding parts of the answer.
When responding, please keep the following points in mind:
- Today is {cur_date}.
- Not all content in the search results is closely related to the user's question. You need to evaluate and filter the search results based on the question.
- For listing-type questions (e.g., listing all flight information), try to limit the answer to 10 key points and inform the user that they can refer to the search sources for complete information. Prioritize providing the most complete and relevant items in the list. Avoid mentioning content not provided in the search results unless necessary.
- For creative tasks (e.g., writing an essay), ensure that references are cited within the body of the text, such as [citation:3][citation:5], rather than only at the end of the text. You need to interpret and summarize the user's requirements, choose an appropriate format, fully utilize the search results, extract key information, and generate an answer that is insightful, creative, and professional. Extend the length of your response as much as possible, addressing each point in detail and from multiple perspectives, ensuring the content is rich and thorough.
- If the response is lengthy, structure it well and summarize it in paragraphs. If a point-by-point format is needed, try to limit it to 5 points and merge related content.
- For objective Q&A, if the answer is very brief, you may add one or two related sentences to enrich the content.
- Choose an appropriate and visually appealing format for your response based on the user's requirements and the content of the answer, ensuring strong readability.
- Your answer should synthesize information from multiple relevant webpages and avoid repeatedly citing the same webpage.
- Unless the user requests otherwise, your response should be in the same language as the user's question.
# The user's message is:
{question}```
```
* For English queries, use the following prompt:
```bash
search_answer_en_template = \
```# The following contents are the search results related to the user's message:
{search_results}
In the search results I provide to you, each result is formatted as [webpage X begin]...[webpage X end], where X represents the numerical index of each article. Please cite the context at the end of the relevant sentence when appropriate. Use the citation format [citation:X] in the corresponding part of your answer. If a sentence is derived from multiple contexts, list all relevant citation numbers, such as [citation:3][citation:5]. Be sure not to cluster all citations at the end; instead, include them in the corresponding parts of the answer.
When responding, please keep the following points in mind:
- Today is {cur_date}.
- Not all content in the search results is closely related to the user's question. You need to evaluate and filter the search results based on the question.
- For listing-type questions (e.g., listing all flight information), try to limit the answer to 10 key points and inform the user that they can refer to the search sources for complete information. Prioritize providing the most complete and relevant items in the list. Avoid mentioning content not provided in the search results unless necessary.
- For creative tasks (e.g., writing an essay), ensure that references are cited within the body of the text, such as [citation:3][citation:5], rather than only at the end of the text. You need to interpret and summarize the user's requirements, choose an appropriate format, fully utilize the search results, extract key information, and generate an answer that is insightful, creative, and professional. Extend the length of your response as much as possible, addressing each point in detail and from multiple perspectives, ensuring the content is rich and thorough.
- If the response is lengthy, structure it well and summarize it in paragraphs. If a point-by-point format is needed, try to limit it to 5 points and merge related content.
- For objective Q&A, if the answer is very brief, you may add one or two related sentences to enrich the content.
- Choose an appropriate and visually appealing format for your response based on the user's requirements and the content of the answer, ensuring strong readability.
- Your answer should synthesize information from multiple relevant webpages and avoid repeatedly citing the same webpage.
- Unless the user requests otherwise, your response should be in the same language as the user's question.
# The user's message is:
{question}```
```*/}
## Context Concatenation
During each round of conversation, the model outputs reasoning chain content (`reasoning_content`) and the final answer (`content`). In the next round of conversation, the reasoning chain content from the previous round will not be concatenated into the context.
## OpenAI Request Example
### Streaming Output Request
```python
from openai import OpenAI
url = 'https://api.ap.siliconflow.com/v1/'
api_key = 'your api_key'
client = OpenAI(
base_url=url,
api_key=api_key
)
# Send a request with streaming output
content = ""
reasoning_content=""
messages = [
{"role": "user", "content": "Who are the legendary athletes in the Olympics?"}
]
response = client.chat.completions.create(
model="deepseek-ai/DeepSeek-R1",
messages=messages,
stream=True, # Enable streaming output
max_tokens=4096
)
# Receive and process response incrementally
for chunk in response:
if chunk.choices[0].delta.content:
content += chunk.choices[0].delta.content
if chunk.choices[0].delta.reasoning_content:
reasoning_content += chunk.choices[0].delta.reasoning_content
# Round 2
messages.append({"role": "assistant", "content": content})
messages.append({'role': 'user', 'content': "Continue"})
response = client.chat.completions.create(
model="deepseek-ai/DeepSeek-R1",
messages=messages,
stream=True
)
```
### Non-Streaming Output Request
```python
from openai import OpenAI
url = 'https://api.ap.siliconflow.com/v1/'
api_key = 'your api_key'
client = OpenAI(
base_url=url,
api_key=api_key
)
# Send a request with non-streaming output
messages = [
{"role": "user", "content": "Who are the legendary athletes in the Olympics?"}
]
response = client.chat.completions.create(
model="deepseek-ai/DeepSeek-R1",
messages=messages,
stream=False,
max_tokens=4096
)
content = response.choices[0].message.content
reasoning_content = response.choices[0].message.reasoning_content
# Round 2
messages.append({"role": "assistant", "content": content})
messages.append({'role': 'user', 'content': "Continue"})
response = client.chat.completions.create(
model="deepseek-ai/DeepSeek-R1",
messages=messages,
stream=False
)
```
## Notes
* API Key: Ensure you are using the correct API key for authentication.
* Streaming Output: Streaming output is suitable for scenarios where incremental responses are needed, while non-streaming output is better for retrieving the complete response at once.
{/* - Context Management: During each round of conversation, the reasoning chain content output by the model will not be concatenated into the context of the next round, so manual context management is required.*/}
## FAQs
* How to obtain an API key?
Visit [SiliconFlow](https://cloud.siliconflow.com/) to register and obtain an API key.
* How to handle long texts?
You can control the output length by adjusting the `max_tokens` parameter, but note that the maximum length is 16K.
# Text Generation
Source: https://docs.siliconflow.com/en/userguide/capabilities/text-generation
## 1. Core Capabilities of the Model
### 1.1 Basic Functions
* **Text Generation**: Generate coherent natural language text based on context, supporting various writing styles and tones.
* **Semantic Understanding**: Deeply analyze user intent, support multi-turn conversation management, ensuring coherence and accuracy in dialogues.
* **Knowledge Q\&A**: Cover a wide range of knowledge domains, including science, technology, culture, history, etc., providing accurate answers.
* **Code Assistance**: Support code generation, explanation, and debugging for various mainstream programming languages (e.g., Python, Java, C++, etc.).
### 1.2 Advanced Capabilities
* **Long-text Processing**: Support context windows ranging from 4k to 64k tokens, suitable for generating long documents and handling complex conversational scenarios.
* **Instruction Following**: Accurately understand complex task instructions, such as "Compare Plan A and Plan B using a Markdown table."
* **Style Control**: Adjust output style through system prompts, supporting academic, conversational, poetic, and other styles.
* **Multi-modal Support**: In addition to text generation, support tasks like image description and speech-to-text.
## 2. API Call Specifications
### 2.1 Basic Request Structure
You can perform end-to-end API requests using the OpenAI SDK.
```python
from openai import OpenAI
client = OpenAI(api_key="YOUR_KEY", base_url="https://api.ap.siliconflow.com/v1")
response = client.chat.completions.create(
model="deepseek-ai/DeepSeek-V3",
messages=[
{"role": "system", "content": "You are a helpful assistant."},
{"role": "user", "content": "Write a haiku about recursion in programming."}
],
temperature=0.7,
max_tokens=1024,
stream=True
)
# Process the response incrementally
for chunk in response:
print(chunk.choices[0].delta.content)
```
```python
from openai import OpenAI
client = OpenAI(api_key="YOUR_KEY", base_url="https://api.ap.siliconflow.com/v1")
response = client.chat.completions.create(
model="deepseek-ai/deepseek-vl2",
messages=[
{
"role": "user",
"content": [
{
"type": "image_url",
"image_url": {
"url": "https://sf-maas.s3.us-east-1.amazonaws.com/images/recDq23epr.png",
},
},
{
"type": "text",
"text": "What's in this image?"
}
],
}
],
temperature=0.7,
max_tokens=1024,
stream=True
)
# Process the response incrementally
for chunk in response:
print(chunk.choices[0].delta.content)
```
```python
import json
from openai import OpenAI
client = OpenAI(
api_key="YOUR_API_KEY", # Obtain from https://cloud.siliconflow.com/account/ak
base_url="https://api.ap.siliconflow.com/v1"
)
response = client.chat.completions.create(
model="deepseek-ai/DeepSeek-V2.5",
messages=[
{"role": "system", "content": "You are a helpful assistant designed to output JSON."},
{"role": "user", "content": "? Who were the men's and women's singles champions of the 2020 Olympic table tennis event? "
"Please respond in the format {\"Men's Champion\": ..., \"Women's Champion\": ...}"}
],
response_format={"type": "json_object"}
)
print(response.choices[0].message.content)
```
### 2.2 Message Structure Explanation
| Message Type | Function Description | Example Content |
| ------------ | -------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------- |
| system | Model instructions, defining the AI's role and general behavior | e.g., "You are a pediatrician with 10 years of experience." |
| user | User input, passing the end user's message to the model | e.g., "How should a persistent fever in a toddler be treated?" |
| assistant | Model-generated historical responses, providing examples of how it should respond to the current request | e.g., "I suggest measuring the temperature first..." |
When you want the model to follow hierarchical instructions, message roles can help you achieve better outputs. However, they are not deterministic, so the best approach is to try different methods to see which yields optimal results.
## 3. Model Selection Guide
Visit the [Models](https://cloud.siliconflow.com/models) to filter language models supporting different functionalities using the filter options on the left. Learn about specific model details such as pricing, model size, maximum context length, and cost.
You can also experience the models in the [Playground](https://cloud.siliconflow.com/playground/chat). Note that the Playground is only for model testing and does not retain historical conversation records. If you wish to save the conversation history, please do so manually. For more usage details, refer to the [API Documentation](https://docs.siliconflow.com/cn/api-reference/chat-completions/chat-completions).
## 4. Detailed Explanation of Core Parameters
### 4.1 Creativity Control
```bash
# Temperature parameter (0.0~2.0)
temperature=0.5 # Balances creativity and reliability
# Nucleus sampling (top_p)
top_p=0.9 # Considers only the top 90% probability cumulative word set
```
### 4.2 Output Limits
```json
max_tokens=1000 # Maximum generation length per request
stop=["\n##", "<|end|>"] # Stop sequences; output halts when encountering these strings
frequency_penalty=0.5 # Suppresses repetitive word usage (-2.0~2.0)
stream=true # Controls whether the output is streamed; recommended for models with lengthy outputs to prevent timeouts
```
### 4.3 Common Issues with Language Model Scenarios
**1. Model Output Garbled**
Some models may produce garbled output if parameters are not set. To address this, try setting parameters like `temperature`, `top_k`, `top_p`, and `frequency_penalty`.
Corresponding payload adjustments for different languages:
```python
payload = {
"model": "Qwen/Qwen2.5-Math-72B-Instruct",
"messages": [
{
"role": "user",
"content": "1+1=?",
}
],
"max_tokens": 200, # Adjust as needed
"temperature": 0.7, # Adjust as needed
"top_k": 50, # Adjust as needed
"top_p": 0.7, # Adjust as needed
"frequency_penalty": 0 # Adjust as needed
}
```
**2. Explanation of `max_tokens`**
For LLM models provided by the platform:
* Models with a `max_tokens` limit of `16384` include:
* deepseek-ai/DeepSeek-R1
* deepseek-ai/DeepSeek-R1-Distill-Qwen-32B
* deepseek-ai/DeepSeek-R1-Distill-Qwen-14B
* deepseek-ai/DeepSeek-R1-Distill-Qwen-7B
* deepseek-ai/DeepSeek-R1-Distill-Qwen-1.5B
* Models with a `max_tokens` limit of `8192` include:
* Qwen/QwQ-32B-Preview
* deepseek-ai/DeepSeek-R1
* Models with a `max_tokens` limit of `4096` include:
* All other LLM models not mentioned above.
**3. Explanation of `context_length`**
The `context_length` varies across different LLM models. You can search for specific models on the [Models](https://cloud.siliconflow.com/models) to view detailed information.
**4. Model Output Truncation Issues**
To troubleshoot truncation issues:
* For API requests:
* Adjust `max_tokens` to an appropriate value. Outputs exceeding `max_tokens` will be truncated. The DeepSeek R1 series supports up to 16384 tokens.
* Enable streaming output for lengthy responses to prevent 504 timeouts.
* Increase the client timeout duration to prevent truncation due to incomplete output.
* For third-party clients:
* CherryStdio defaults to `max_tokens=4096`. Users can enable the "Message Length Limit" switch in settings to adjust the value.
**5. Error Code Handling**
| Error Code | Common Cause | Solution |
| ---------- | --------------------------- | ----------------------------------------------------------------------------------- |
| 400 | Parameter format error | Check the range of parameters like temperature |
| 401 | API Key not correctly set | Verify the API Key |
| 403 | Insufficient permissions | Commonly requires real-name authentication; refer to error messages for other cases |
| 429 | Request rate limit exceeded | Implement exponential backoff retry mechanism |
| 503/504 | Model overload | Switch to backup model nodes |
## 5. Billing and Quota Management
### 5.1 Billing Formula
`Total Cost = (Input Tokens × Input Unit Price) + (Output Tokens × Output Unit Price)`
### 5.2 Example Pricing for Different Series
Specific model prices can be found on the [Models](https://cloud.siliconflow.com/models) under the model details page.
## 6. Application Scenarios
### 6.1 Technical Documentation Generation
```python
from openai import OpenAI
client = OpenAI(api_key="YOUR_KEY", base_url="https://api.ap.siliconflow.com/v1")
response = client.chat.completions.create(
model="Qwen/Qwen2.5-Coder-32B-Instruct",
messages=[{
"role": "user",
"content": "Write a Python tutorial on asynchronous web scraping, including code examples and precautions."
}],
temperature=0.7,
max_tokens=4096
)
```
### 6.2 Data Analysis Reports
```python
from openai import OpenAI
client = OpenAI(api_key="YOUR_KEY", base_url="https://api.ap.siliconflow.com/v1")
response = client.chat.completions.create(
model="Qwen/QVQ-72B-Preview",
messages=[
{"role": "system", "content": "You are a data analysis expert. Output results in Markdown."},
{"role": "user", "content": "Analyze the sales trends of new energy vehicles in 2023."}
],
temperature=0.7,
max_tokens=4096
)
```
Model capabilities are continuously updated. It is recommended to visit the [Models](https://cloud.siliconflow.com/models) regularly for the latest information.
# Text-to-speech
Source: https://docs.siliconflow.com/en/userguide/capabilities/text-to-speech
## 1. Use Cases
The Text-to-Speech (TTS) model is an AI model that converts text information into speech output. This model generates natural, fluent, and expressive speech from input text, suitable for various application scenarios:
* Providing audio narration for blog articles
* Generating multilingual speech content
* Supporting real-time streaming audio output
## 2. API Usage Guide
* Endpoint: /audio/speech. For details, refer to the [API documentation](https://docs.siliconflow.com/api-reference/audio/create-speech).
* Key request parameters:
* `model`: The model used for speech synthesis. Supported [model list](/capabilities/text-to-speech#3).
* `input`: The text content to be converted into audio.
* `voice`: Reference voice, supporting [system preset voices](/capabilities/text-to-speech#2-1), [user preset voices](/capabilities/text-to-speech#2-2), and [user dynamic voices](/capabilities/text-to-speech#2-3). For detailed parameters, see: [Create Text-to-Speech Request](/api-reference/audio/create-speech).
* `speed`: Controls the audio speed. Type: float. Default value: 1.0. Range: \[0.25, 4.0].
* `gain`: Audio gain in dB, controlling the volume of the audio. Type: float. Default value: 0.0. Range: \[-10, 10].
* `response_format`: Controls the output format. Supported formats include mp3, opus, wav, and pcm. The sampling rate varies depending on the output format.
* `sample_rate`: Controls the output sampling rate. The default value and available range vary by output type:
* Opus: Currently supports 48000 Hz only.
* Wav, pcm: Supports (8000, 16000, 24000, 32000, 44100). Default: 44100.
* Mp3: Supports (32000, 44100). Default: 44100.
### 2.1 System Preset Voices
The system currently provides the following 8 preset voices:
* Male Voices:
* Steady Male Voice: alex
* Deep Male Voice: benjamin
* Magnetic Male Voice: charles
* Cheerful Male Voice: david
* Female Voices:
* Steady Female Voice: anna
* Passionate Female Voice: bella
* Gentle Female Voice: claire
* Cheerful Female Voice: diana
To [use system preset voices](/capabilities/text-to-speech#5-1) in requests, you need to prefix the model name. For example:
`FunAudioLLM/CosyVoice2-0.5B:alex` indicates the alex voice from the FunAudioLLM/CosyVoice2-0.5B model.
{/*`fishaudio/fish-speech-1.5:anna` indicates the anna voice from the fishaudio/fish-speech-1.5 model.*/}
### 2.2 User Preset Voices
#### 2.2.1 Upload User Preset Voice via `base64` Encoding
```python
import requests
import json
url = "https://api.ap.siliconflow.com/v1/uploads/audio/voice"
headers = {
"Authorization": "Bearer your-api-key", # Obtain from https://cloud.siliconflow.com/account/ak
"Content-Type": "application/json"
}
data = {
"model": "FunAudioLLM/CosyVoice2-0.5B", # Model name
"customName": "your-voice-name", # Custom audio name
"audio": "data:audio/mpeg;base64,...", # Base64 encoded reference audio
"text": "In the midst of ignorance, a day in the dream ends, and a new cycle begins." # Text content of reference audio
}
response = requests.post(url, headers=headers, data=json.dumps(data))
# Print response status code and content
print(response.status_code)
print(response.json()) # If the response is in JSON format
```
The returned `uri` field in the response is the ID of the custom voice, which can be used as the `voice` parameter in subsequent requests.
```json
{'uri': 'speech:your-voice-name:cm04pf7az00061413w7kz5qxs:mjtkgbyuunvtybnsvbxd'}
```
To [use user preset voices](/capabilities/text-to-speech#5-2) in requests.
#### 2.2.2 Upload User Preset Voice via File
```python
import requests
url = "https://api.ap.siliconflow.com/v1/uploads/audio/voice"
headers = {
"Authorization": "Bearer your-api-key" # Obtain from https://cloud.siliconflow.com/account/ak
}
files = {
"file": open("/path/to/audio.mp3", "rb") # Reference audio file
}
data = {
"model": "FunAudioLLM/CosyVoice2-0.5B", # Model name
"customName": "your-voice-name", # Custom audio name
"text": "In the midst of ignorance, a day in the dream ends, and a new cycle begins." # Text content of reference audio
}
response = requests.post(url, headers=headers, files=files, data=data)
print(response.status_code)
print(response.json()) # Print response content (if in JSON format)
```
The returned `uri` field in the response is the ID of the custom voice, which can be used as the `voice` parameter in subsequent requests.
```json
{'uri': 'speech:your-voice-name:cm04pf7az00061413w7kz5qxs:mjtkgbyuunvtybnsvbxd'}
```
To [use user preset voices](/capabilities/text-to-speech#5-2) in requests.
### 2.3 Retrieve User Dynamic Voice List
```python
import requests
url = "https://api.ap.siliconflow.com/v1/audio/voice/list"
headers = {
"Authorization": "Bearer your-api-key" # Obtain from https://cloud.siliconflow.com/account/ak
}
response = requests.get(url, headers=headers)
print(response.status_code)
print(response.json()) # Print response content (if in JSON format)
```
The returned `uri` field in the response is the ID of the custom voice, which can be used as the `voice` parameter in subsequent requests.
```json
{'uri': 'speech:your-voice-name:cm04pf7az00061413w7kz5qxs:mjtkgbyuunvtybnsvbxd'}
```
To [use user dynamic voices](/capabilities/text-to-speech#5-3) in requests.
### 2.4 Use User Dynamic Voices
Note: Using user preset voices requires identity verification.
To [use user dynamic voices](/capabilities/text-to-speech#5-3) in requests.
### 2.5 Delete User Dynamic Voice
```python
import requests
url = "https://api.ap.siliconflow.com/v1/audio/voice/deletions"
headers = {
"Authorization": "Bearer your-api-key",
"Content-Type": "application/json"
}
payload = {
"uri": "speech:your-voice-name:cm02pf7az00061413w7kz5qxs:mttkgbyuunvtybnsvbxd"
}
response = requests.request("POST", url, json=payload, headers=headers)
print(response.status_code)
print(response.text) # Print response content
```
The `uri` field in the request parameters is the ID of the custom voice.
## 3. Supported Model List
Note: Supported TTS models may change. Please filter by the "Speech" tag on the [Models](https://cloud.siliconflow.com/models?types=speech) for the current list of supported models.Billing: Charges are based on the [UTF-8 byte](https://en.wikipedia.org/wiki/UTF-8) count of the input text. [Online byte counter demo](https://mothereff.in/byte-counter).
### 3.1 FunAudioLLM/CosyVoice2-0.5B Series Models
* Cross-language speech synthesis: Enables speech synthesis across different languages, including Chinese, English, Japanese, Korean, and Chinese dialects (Cantonese, Sichuanese, Shanghainese, Zhengzhou dialect, Changsha dialect, Tianjin dialect).
* Emotion control: Supports generating speech with various emotional expressions, such as happiness, excitement, sadness, and anger.
* Fine-grained control: Allows fine-grained control of emotions and prosody in generated speech through rich text or natural language input.
## 4. Best Practices for Reference Audio
Providing high-quality reference audio samples can improve voice cloning results.
### 4.1 Audio Quality Guidelines
* Single speaker only
* Clear articulation, stable volume, pitch, and emotion
* Short pauses (recommended: 0.5 seconds)
* Ideal conditions: No background noise, professional recording quality, no room echo
* Recommended duration: 8–10 seconds
### 4.2 File Format
* Supported formats: mp3, wav, pcm, opus
* Recommended: Use mp3 with 192kbps or higher to avoid quality loss
* Uncompressed formats (e.g., WAV) offer limited additional benefits
## 5. Examples
### 5.1 Using System Preset Voices
```python
from pathlib import Path
from openai import OpenAI
speech_file_path = Path(__file__).parent / "siliconcloud-generated-speech.mp3"
client = OpenAI(
api_key="Your API KEY", # Obtain from https://cloud.siliconflow.com/account/ak
base_url="https://api.ap.siliconflow.com/v1"
)
with client.audio.speech.with_streaming_response.create(
model="FunAudioLLM/CosyVoice2-0.5B", # Supported models: fishaudio / GPT-SoVITS / CosyVoice2-0.5B
voice="FunAudioLLM/CosyVoice2-0.5B:alex", # System preset voice
input="Can you say this with happiness? <|endofprompt|>Today is wonderful, the holidays are coming! I'm so happy, Spring Festival is coming!",
response_format="mp3" # Supported formats: mp3, wav, pcm, opus
) as response:
response.stream_to_file(speech_file_path)
```
### 5.2 Using User Preset Voices
```python
from pathlib import Path
from openai import OpenAI
speech_file_path = Path(__file__).parent / "siliconcloud-generated-speech.mp3"
client = OpenAI(
api_key="Your API KEY", # Obtain from https://cloud.siliconflow.com/account/ak
base_url="https://api.ap.siliconflow.com/v1"
)
with client.audio.speech.with_streaming_response.create(
model="FunAudioLLM/CosyVoice2-0.5B", # Supported models: fishaudio / GPT-SoVITS / CosyVoice2-0.5B
voice="speech:your-voice-name:cm02pf7az00061413w7kz5qxs:mttkgbyuunvtybnsvbxd", # Uploaded custom voice name
input="Could you mimic a Cantonese accent? <|endofprompt|>Take care and rest early.",
response_format="mp3"
) as response:
response.stream_to_file(speech_file_path)
```
### 5.3 Using User Dynamic Voices
```python
from pathlib import Path
from openai import OpenAI
client = OpenAI()
speech_file_path = Path(__file__).parent / "siliconcloud-generated-speech.mp3"
client = OpenAI(
api_key="Your API KEY", # Obtain from https://cloud.siliconflow.com/account/ak
base_url="https://api.ap.siliconflow.com/v1"
)
with client.audio.speech.with_streaming_response.create(
model="FunAudioLLM/CosyVoice2-0.5B",
voice="", # Leave empty to use dynamic voices
input="[laughter] Sometimes, watching the innocent actions of children [laughter], we can't help but smile.",
response_format="mp3",
extra_body={"references":[
{
"audio": "https://sf-maas-uat-prod.oss-cn-shanghai.aliyuncs.com/voice_template/fish_audio-Alex.mp3", # Reference audio URL. Base64 format also supported
"text": "In the midst of ignorance, a day in the dream ends, and a new cycle begins.", # Text content of reference audio
}
]}
) as response:
response.stream_to_file(speech_file_path)
```
# Video Generation
Source: https://docs.siliconflow.com/en/userguide/capabilities/video
## 1. Use Cases
Video generation models are technologies that utilize text or image descriptions to generate dynamic video content. With continuous advancements in technology, their application scenarios are becoming increasingly diverse. Below are some potential application areas:
1. Dynamic Content Generation: Video generation models can create dynamic visual content for describing and explaining information.
2. Multimodal Intelligent Interaction: By combining image and text inputs, video generation models can be used in more intelligent and interactive application scenarios.
3. Replacing Traditional Visual Technologies: Video generation models can replace or enhance traditional machine vision technologies, addressing more complex multimodal problems. As technology progresses, the multimodal capabilities of video generation models will integrate with vision-language models, driving their comprehensive applications in intelligent interaction, automated content generation, and complex scene simulation. Additionally, video generation models can combine with image generation models (image-to-video), further expanding their application scope to achieve richer and more diverse visual content generation.
## 2. Usage Recommendations
When crafting prompts, focus on detailed, chronological descriptions of actions and scenes. Include specific actions, appearances, camera angles, and environmental details. All content should be written cohesively in one paragraph, starting directly with the action. The description should be specific and precise, imagining yourself as a cinematographer describing a shot script. Keep the prompt within 200 words.
For optimal results, construct prompts using the following structure:
* Begin with a single sentence describing the main action.
* Example: A woman with light skin, wearing a blue jacket and a black hat with a veil, first looks down and to her right, then raises her head back up as she speaks.
* Add specific details about actions and gestures.
* Example: She first looks down and to her right, then raises her head back up as she speaks.
* Precisely describe the appearance of the character/object.
* Example: She has brown hair styled in an updo, light brown eyebrows, and is wearing a white collared shirt under her blue jacket.
* Include details about the background and environment.
* Example: The background is out of focus but shows trees and people in period clothing.
* Specify the camera angle and movement.
* Example: The camera remains stationary on her face as she speaks.
* Describe the lighting and color effects.
* Example: The scene is captured in real-life footage, with natural lighting and true-to-life colors.
* Note any changes or unexpected events.
* Example: A gust of wind blows through the trees, causing the woman's veil to flutter slightly.
Example video generated from the above prompt:
## 3. Experience Address
You can click [Playground](https://cloud.siliconflow.com/playground/text-to-video) to try it out.
## 4. Supported Models
### 4.1 Text-to-Video Models
Currently supported text-to-video models:
* tencent/HunyuanVideo-HD
Note: The list of supported text-to-video models may change. Please filter by the "Video" tag in the "Models" to view the list of supported models.
# Vision
Source: https://docs.siliconflow.com/en/userguide/capabilities/vision
## 1. Usage Scenarios
Vision-Language Models (VLM) are large language models capable of processing both visual (image) and linguistic (text) input modalities. Based on VLMs, you can input images and text, and the model can simultaneously understand the content of the images and the context while following instructions to respond. For example:
1. **Visual Content Interpretation**: The model can interpret and describe the information in an image, such as objects, text, spatial relationships, colors, and atmosphere.
2. **Multi-turn Conversations Combining Visual Content and Context**.
3. **Partial Replacement of Traditional Machine Vision Models like OCR**.
4. **Future Applications**: With continuous improvements in model capabilities, VLMs can be applied to areas such as visual agents and robotics.
## 2. Usage Method
For VLM models, you can invoke the `/chat/completions` API by constructing a `message` containing either an `image URL` or a `base64-encoded image`. The `detail` parameter can be used to control how the image is preprocessed.
### 2.1 Explanation of Image Detail Control Parameters
SiliconCloud provides three options for the `detail` parameter: `low`, `high`, and `auto`.
For currently supported models, if `detail` is not specified or is set to `high`, the model will use the `high` (“high resolution”) mode. If set to `low` or `auto`, the model will use the `low` (“low resolution”) mode.
### 2.2 Example Formats for `message` Containing Images
#### 2.2.1 Using Image URLs
```json
{
"role": "user",
"content":[
{
"type": "image_url",
"image_url": {
"url": "https://sf-maas.s3.us-east-1.amazonaws.com/images/recDq23epr.png",
"detail":"high"
}
},
{
"type": "text",
"text": "text-prompt here"
}
]
}
```
#### 2.2.2 Base64 Format
```json
{
"role": "user",
"content":[
{
"type": "image_url",
"image_url": {
"url": f"data:image/jpeg;base64,{base64_image}",
"detail":"low"
}
},
{
"type": "text",
"text": "text-prompt here"
}
]
}
```
```python
# Example of converting an image to base64 format
from PIL import Image
import io
import base64
def convert_image_to_webp_base64(input_image_path):
try:
with Image.open(input_image_path) as img:
byte_arr = io.BytesIO()
img.save(byte_arr, format='webp')
byte_arr = byte_arr.getvalue()
base64_str = base64.b64encode(byte_arr).decode('utf-8')
return base64_str
except IOError:
print(f"Error: Unable to open or convert the image {input_image_path}")
return None
base64_image = convert_image_to_webp_base64(input_image_path)
```
#### 2.2.3 Multiple Images, Each in Either Format
Please note that the `DeepseekVL2` series models are suitable for handling short contexts. It is recommended to input no more than 2 images. If more than 2 images are provided, the model will automatically resize them to 384x384, and the specified `detail` parameter will be ignored.
```json
{
"role": "user",
"content":[
{
"type": "image_url",
"image_url": {
"url": "https://sf-maas.s3.us-east-1.amazonaws.com/images/recDq23epr.png",
}
},
{
"type": "image_url",
"image_url": {
"url": f"data:image/jpeg;base64,{base64_image}"
}
},
{
"type": "text",
"text": "text-prompt here"
}
]
}
```
## 3. Supported Models
Currently supported VLM models:
* **Qwen Series**:
* Qwen/Qwen2-VL-72B-Instruct
* **DeepseekVL2 Series**:
* deepseek-ai/deepseek-vl2
Note: The list of supported VLM models may change. Please filter by the "Visual" tag in the "Models" to check the supported model list.
## 4. Billing for Visual Input Content
For visual inputs like images, the model converts them into tokens, which are combined with textual information as part of the model's output context. This means visual inputs are also billed. Different models use different methods for converting visual content, as outlined below.
### 4.1 Qwen Series
Rules:
* `Qwen` supports a maximum pixel area of `3584 * 3584 = 12845056` and a minimum pixel area of `56 * 56 = 3136`. Each image's longer and shorter sides are first scaled to multiples of 28 `(h * 28) * (w * 28)`. If the dimensions fall outside the minimum and maximum pixel ranges, the image is proportionally resized to fit within the range.
1. When `detail=low`, all images are resized to `448 * 448`, consuming `256 tokens`.
2. When `detail=high`, the image is proportionally scaled, with its dimensions rounded up to the nearest multiple of 28, then resized to fit within the pixel range `(3136, 12845056)`, ensuring both dimensions are multiples of 28.
Examples:
* Images with dimensions `224 * 448`, `1024 x 1024`, and `3172 x 4096` consume `256 tokens` when `detail=low`.
* An image with dimensions `224 * 448` consumes `(224/28) * (448/28) = 8 * 16 = 128 tokens` when `detail=high`.
* An image with dimensions `1024 * 1024` is rounded to `1036 * 1036` and consumes `(1036/28) * (1036/28) = 1369 tokens` when `detail=high`.
* An image with dimensions `3172 * 4096` is resized to `3136 * 4060` and consumes `(3136/28) * (4060/28) = 16240 tokens` when `detail=high`.
### 4.2 DeepseekVL2 Series
Rules:
For each image, `DeepseekVL2` processes two parts: `global_view` and `local_view`. The `global_view` resizes the original image to `384x384`, while the `local_view` divides the image into blocks of `384x384`. Additional tokens are added between blocks to maintain continuity.
1. When `detail=low`, all images are resized to `384x384`.
2. When `detail=high`, images are resized to dimensions that are multiples of `384`, ensuring `1 <= h * w <= 9`.
* The scaling dimensions `(h, w)` are chosen based on:
* Both `h` and `w` are integers, and `1 <= h * w <= 9`.
* The resized image's pixel count is compared to the original image's pixel count, minimizing the difference.
* Token consumption is calculated as:
* `(h * w + 1) * 196 + (w + 1) * 14 + 1 tokens`.
Examples:
* Images with dimensions `224 x 448`, `1024 x 1024`, and `2048 x 4096` consume `421 tokens` when `detail=low`.
* An image with dimensions `384 x 768` consumes `(1 * 2 + 1) * 196 + (2 + 1) * 14 + 1 = 631 tokens` when `detail=high`.
* An image with dimensions `1024 x 1024` is resized to `1152 x 1152` and consumes `(3 * 3 + 1) * 196 + (3 + 1) * 14 + 1 = 2017 tokens` when `detail=high`.
* An image with dimensions `2048 x 4096` is resized to `768 x 1536` and consumes `(2 * 4 + 1) * 196 + (4 + 1) * 14 + 1 = 1835 tokens` when `detail=high`.
## 5. Usage Examples
### 5.1 Example 1: Image Understanding
```python
import json
from openai import OpenAI
client = OpenAI(
api_key="YOUR_API_KEY", # Obtain from https://cloud.siliconflow.com/account/ak
base_url="https://api.ap.siliconflow.com/v1"
)
response = client.chat.completions.create(
model="Qwen/Qwen2-VL-72B-Instruct",
messages=[
{
"role": "user",
"content": [
{
"type": "image_url",
"image_url": {
"url": "https://sf-maas.s3.us-east-1.amazonaws.com/images/recu6XreBFQ0st.png"
}
},
{
"type": "text",
"text": "Describe the image."
}
]
}],
stream=True
)
for chunk in response:
chunk_message = chunk.choices[0].delta.content
print(chunk_message, end='', flush=True)
```
### 5.2 Example 2: Multi-image Understanding
```python
import json
from openai import OpenAI
client = OpenAI(
api_key="YOUR_API_KEY", # Obtain from https://cloud.siliconflow.com/account/ak
base_url="https://api.siliconflow.c/v1"
)
response = client.chat.completions.create(
model="Qwen/Qwen2-VL-72B-Instruct",
messages=[
{
"role": "user",
"content": [
{
"type": "image_url",
"image_url": {
"url": "https://sf-maas.s3.us-east-1.amazonaws.com/images/recu6XreBFQ0st.png"
}
},
{
"type": "image_url",
"image_url": {
"url": "https://sf-maas.s3.us-east-1.amazonaws.com/images/recu6Xrf2Cd0cn.png"
}
},
{
"type": "text",
"text": "Identify the similarities between these images."
}
]
}],
stream=True
)
for chunk in response:
chunk_message = chunk.choices[0].delta.content
print(chunk_message, end='', flush=True)
```
# FIM Completion
Source: https://docs.siliconflow.com/en/userguide/guides/fim
## 1. Use Cases
FIM (Fill In the Middle) completion allows users to provide the desired prefix and suffix content, enabling the model to complete the content in between. This is typically used in scenarios such as code completion and filling in missing content in text.
## 2. How to Use
### 2.1 Using the `chat/completions` Interface
```json
{
"model": "model info",
"messages": "prompt message",
"params": "params",
"extra_body": {"prefix":"prefix content", "suffix":"suffix content"}
}
```
### 2.2 Using the `completions` Interface
```json
{
"model": "model info",
"prompt": "prefix content",
"suffix": "suffix content"
}
```
## 3. Supported Models
* Deepseek Series:
* deepseek-ai/DeepSeek-V3
* Qwen Series:
* Qwen/Qwen2.5-Coder-32B-Instruct
Note: The list of supported models may change. Please refer to [this document](/features/fim) for the latest list of supported models.
{/* The maximum completion length for models is consistent with the [max_tokens parameter](/api-reference/chat-completions/chat-completions). */}
## 4. Example Usage
### 4.1 Using FIM Completion with OpenAI's `chat.completions` Interface:
```python
client = OpenAI(
api_key="Your APIKEY", # Obtain from https://cloud.siliconflow.com/account/ak
base_url="https://api.ap.siliconflow.com/v1"
)
messages = [
{"role": "user", "content": "Please write quick sort code"},
]
response = client.chat.completions.create(
model="deepseek-ai/DeepSeek-V2.5",
messages=messages,
extra_body={
"prefix": f"""
def quick_sort(arr):
# Base case: if the array length is less than or equal to 1, return the array
if len(arr) <= 1:
return arr
else:
""",
"suffix": f"""
# Test the quick_sort function
arr = [3, 6, 8, 10, 1, 2, 1]
sorted_arr = quick_sort(arr)
print("Sorted array:", sorted_arr)
"""
},
stream=True,
max_tokens=4096
)
for chunk in response:
print(chunk.choices[0].delta.content, end='')
```
### 4.2 Using FIM Completion with OpenAI's `completions` Interface:
```python
client = OpenAI(
api_key="Your APIKEY", # Obtain from https://cloud.siliconflow.com/account/ak
base_url="https://api.ap.siliconflow.com/v1"
)
response = client.completions.create(
model="deepseek-ai/DeepSeek-V2.5",
prompt=f"""
def quick_sort(arr):
# Base case: if the array length is less than or equal to 1, return the array
if len(arr) <= 1:
return arr
else:
""",
suffix=f"""
# Test the quick_sort function
arr = [3, 6, 8, 10, 1, 2, 1]
sorted_arr = quick_sort(arr)
print("Sorted array:", sorted_arr)
""",
stream=True,
max_tokens=4096
)
for chunk in response:
print(chunk.choices[0].text, end='')
```
# Function Calling
Source: https://docs.siliconflow.com/en/userguide/guides/function-calling
## 1. Use Cases
The Function Calling feature allows the model to call external tools to enhance its capabilities. This functionality enables the model to act as a brain that calls external tools (such as searching for external knowledge, checking itineraries, or specific domain tools), effectively addressing issues like hallucinations and knowledge timeliness.
## 2. How to Use
### 2.1 Add tools parameters via REST API
Include the following in the request body:
```shell
"tools": [
{
'type': 'function',
'function': {
'name': 'name of the actual function to execute',
'description': 'Description of the function',
'parameters': {
'_comments': 'Description of the function parameters'
},
}
},
{
'_comments': 'Additional function-related notes'
}
]
```
For example, a complete payload:
```shell
payload = {
"model": "deepseek-ai/DeepSeek-V2.5",
"messages": [
{
"role": "user",
"content": "What opportunities and challenges will the global large-scale AI model industry encounter in 2025?"
}
],
"tools": [
{
'type': 'function',
'function': {
'name': 'name of the actual function to execute',
'description': 'Description of the function',
'parameters': {
'_comments': 'Description of the function parameters'
},
}
},
{
'_comments': 'Additional function-related notes'
}
]
'_comments': 'List of other functions'
}
```
### 2.2 Use with OpenAI Library
This feature is compatible with OpenAI. When using the OpenAI library, add the corresponding tools parameter as `tools=[corresponding tools]`. For example:
```python
response = client.chat.completions.create(
model="deepseek-ai/DeepSeek-V2.5",
messages=messages,
tools=[
{
'type': 'function',
'function': {
'name': 'name of the actual function to execute',
'description': 'Description of the function',
'parameters': {
// Description of the function parameters
},
}
},
{
// Additional function-related notes
}
]
// Other chat.completions parameters
)
```
## 3. Supported Models
Currently supported models include:
* Qwen Series:
* Qwen/Qwen2.5-72B-Instruct
* Qwen/Qwen2.5-32B-Instruct
* Qwen/Qwen2.5-14B-Instruct
* Qwen/Qwen2.5-7B-Instruct
Note: The list of supported models is continuously updated. Please refer to [this document](/features/function_calling) for the latest list of supported models.
## 4. Examples
### 4.1 Example 1: Extending numerical computation capabilities of large language models via function calling
This code introduces four functions: addition, subtraction, comparison, and counting repeated letters in a string, demonstrating how function calling can address areas where large language models struggle, such as token prediction.
```python
from openai import OpenAI
client = OpenAI(
api_key="Your APIKEY", # Obtain from https://cloud.siliconflow.com/account/ak
base_url="https://api.ap.siliconflow.com/v1"
)
def add(a: float, b: float):
return a + b
def mul(a: float, b: float):
return a * b
def compare(a: float, b: float):
if a > b:
return f'{a} is greater than {b}'
elif a < b:
return f'{b} is greater than {a}'
else:
return f'{a} is equal to {b}'
def count_letter_in_string(a: str, b: str):
string = a.lower()
letter = b.lower()
count = string.count(letter)
return(f"The letter '{letter}' appears {count} times in the string.")
tools = [
{
'type': 'function',
'function': {
'name': 'add',
'description': 'Compute the sum of two numbers',
'parameters': {
'type': 'object',
'properties': {
'a': {
'type': 'int',
'description': 'A number',
},
'b': {
'type': 'int',
'description': 'A number',
},
},
'required': ['a', 'b'],
},
}
},
{
'type': 'function',
'function': {
'name': 'mul',
'description': 'Calculate the product of two numbers',
'parameters': {
'type': 'object',
'properties': {
'a': {
'type': 'int',
'description': 'A number',
},
'b': {
'type': 'int',
'description': 'A number',
},
},
'required': ['a', 'b'],
},
}
},
{
'type': 'function',
'function': {
'name': 'count_letter_in_string',
'description': 'Count letter number in a string',
'parameters': {
'type': 'object',
'properties': {
'a': {
'type': 'str',
'description': 'source string',
},
'b': {
'type': 'str',
'description': 'letter',
},
},
'required': ['a', 'b'],
},
}
},
{
'type': 'function',
'function': {
'name': 'compare',
'description': 'Compare two numbers and determine which is larger',
'parameters': {
'type': 'object',
'properties': {
'a': {
'type': 'float',
'description': 'A number',
},
'b': {
'type': 'float',
'description': 'A number',
},
},
'required': ['a', 'b'],
},
}
}
]
def function_call_playground(prompt):
messages = [{'role': 'user', 'content': prompt}]
response = client.chat.completions.create(
model="deepseek-ai/DeepSeek-V2.5",
messages=messages,
temperature=0.01,
top_p=0.95,
stream=False,
tools=tools)
func1_name = response.choices[0].message.tool_calls[0].function.name
func1_args = response.choices[0].message.tool_calls[0].function.arguments
func1_out = eval(f'{func1_name}(**{func1_args})')
messages.append(response.choices[0].message)
messages.append({
'role': 'tool',
'content': f'{func1_out}',
'tool_call_id': response.choices[0].message.tool_calls[0].id
})
response = client.chat.completions.create(
model="deepseek-ai/DeepSeek-V2.5",
messages=messages,
temperature=0.01,
top_p=0.95,
stream=False,
tools=tools)
return response.choices[0].message.content
prompts = [
"In Chinese: How many 'r's are in the word 'strawberry'?",
"In Chinese: Which is smaller, 9.11 or 9.9?"
]
for prompt in prompts:
print(function_call_playground(prompt))
```
The model will output:
```shell
There are 3 'r's in the word 'strawberry'.
9.11 is smaller than 9.9.
```
### 4.2 Example 2: Extending the model's understanding of external environments through function calling
This code demonstrates querying external information using one function via an external API.
```python
import requests
from openai import OpenAI
client = OpenAI(
api_key="Your APIKEY", # Obtain from https://cloud.siliconflow.com/account/ak
base_url="https://api.ap.siliconflow.com/v1"
)
# Weather query function using WeatherAPI
def get_weather(city: str):
api_key = "Your WeatherAPI APIKEY" # Replace with your own WeatherAPI APIKEY
base_url = "http://api.weatherapi.com/v1/current.json"
params = {
'key': api_key,
'q': city,
'aqi': 'no' # No air quality data needed
}
response = requests.get(base_url, params=params)
if response.status_code == 200:
data = response.json()
weather = data['current']['condition']['text']
temperature = data['current']['temp_c']
return f"The weather in {city} is {weather} with a temperature of {temperature}°C."
else:
return f"Could not retrieve weather information for {city}."
tools = [
{
'type': 'function',
'function': {
'name': 'get_weather',
'description': 'Get the current weather for a given city.',
'parameters': {
'type': 'object',
'properties': {
'city': {
'type': 'string',
'description': 'The name of the city to query weather for.',
},
},
'required': ['city'],
},
}
}
]
def function_call_playground(prompt):
messages = [{'role': 'user', 'content': prompt}]
response = client.chat.completions.create(
model="deepseek-ai/DeepSeek-V2.5",
messages=messages,
temperature=0.01,
top_p=0.95,
stream=False,
tools=tools
)
func1_name = response.choices[0].message.tool_calls[0].function.name
func1_args = response.choices[0].message.tool_calls[0].function.arguments
func1_out = eval(f'{func1_name}(**{func1_args})')
messages.append(response.choices[0].message)
messages.append({
'role': 'tool',
'content': f'{func1_out}',
'tool_call_id': response.choices[0].message.tool_calls[0].id
})
response = client.chat.completions.create(
model="deepseek-ai/DeepSeek-V2.5",
messages=messages,
temperature=0.01,
top_p=0.95,
stream=False,
tools=tools
)
return response.choices[0].message.content
prompt = "How is the weather today in New York?"
print(function_call_playground(prompt))
```
The model will output:
```shell
The weather in New York today is cloudy with a temperature of 68.2°F.
```
# JSON Mode
Source: https://docs.siliconflow.com/en/userguide/guides/json-mode
## 1. Use Cases
Currently, the SiliconFlow large model API platform, SiliconCloud, by default generates **unstructured text**. However, in certain application scenarios, you may want the model to output content in a **structured** format, but simply instructing the model via prompts might not yield the desired structured output.
As a standardized and lightweight data exchange format, JSON mode is an important feature for enabling structured outputs from large model APIs. When you make a request to the large model API, the results returned by the model are presented in JSON format, which is easy for humans to read and write, and also easy for machines to parse and generate.
Now, on the SiliconCloud platform, apart from the DeepSeek R1 series and V3 models, most other major language models support JSON mode. This allows the model to output strings in JSON format, ensuring that the model produces outputs in the expected structure, facilitating subsequent logical parsing of the output content.
For example, you can now use the SiliconCloud API to attempt structured outputs for the following cases:
* Build a news database from company-related reports, including news titles, links, etc.
* Extract sentiment analysis structures from product purchase reviews, including sentiment polarity (positive, negative, neutral), sentiment intensity, sentiment keywords, etc.
* Extract product lists from purchase histories, including product information, reasons for recommendation, prices, promotional details, etc.
## 2. How to Use
Add the following to your request:
```json
response_format={"type": "json_object"}
```
## 3. Supported Models
Currently, online models, except for the DeepSeek R1 series and V3 models, support the above parameter.
Note: The list of supported models may change. Please refer to this document for the latest list of supported models.Your application must detect and handle edge cases that may cause the model to output incomplete JSON objects.Please set `max_tokens` appropriately to prevent JSON strings from being truncated.
## 4. Example Usage
Below is an example using OpenAI:
```python
import json
from openai import OpenAI
client = OpenAI(
api_key="Your APIKEY", # Obtain from https://cloud.siliconflow.com/account/ak
base_url="https://api.ap.siliconflow.com/v1"
)
response = client.chat.completions.create(
model="deepseek-ai/DeepSeek-V2.5",
messages=[
{"role": "system", "content": "You are a helpful assistant designed to output JSON."},
{"role": "user", "content": "Who were the men's and women's singles champions in table tennis at the 2020 World Olympics? "
"Please respond in the format {\"Men's Champion\": ..., \"Women's Champion\": ...}"}
],
response_format={"type": "json_object"}
)
print(response.choices[0].message.content)
```
The model will output:
```json
{"Men's Champion": "Ma Long", "Women's Champion": "Chen Meng"}
```
# Prefix Completion
Source: https://docs.siliconflow.com/en/userguide/guides/prefix
## 1. Use Cases
In prefix completion, the user provides the desired prefix information, allowing the model to complete the rest of the content based on the prefix provided by the user.\
With this capability, the model demonstrates better instruction-following abilities and can address user requirements for specific formats in certain scenarios.
## 2. How to Use
Add the following to your request:
```json
extra_body={"prefix":"desired prefix content"}
```
## 3. Supported Models
Currently, [large language models](https://cloud.siliconflow.com/models?types=chat) support the above parameter.
Note: The list of supported models may change. Please refer to this document for the latest list of supported models.
## 4. Example Usage
Below is an example of using prefix completion with the OpenAI library:
````python
client = OpenAI(
api_key="Your APIKEY", # Obtain from https://cloud.siliconflow.com/account/ak
base_url="https://api.ap.siliconflow.com/v1"
)
messages = [
{"role": "user", "content": "Please write quick sort code"},
]
response = client.chat.completions.create(
model="deepseek-ai/DeepSeek-V2.5",
messages=messages,
extra_body={"prefix":"```python\n"}
)
print(response.choices[0].message.content)
````
# Product introduction
Source: https://docs.siliconflow.com/en/userguide/introduction
## 1. Product introduction
* As a one-stop cloud service platform integrating top-tier large language models, [SiliconCloud](https://cloud.siliconflow.com) is committed to providing developers with faster, more comprehensive, and seamlessly integrated model APIs. Our platform empowers developers and enterprises to focus on product innovation while eliminating concerns about exorbitant computational costs associated with scaling their solutions.
## 2. Product features
1. Ready-to-use large model APIs: pay-as-you-go pricing to facilitate easy application development.
* A variety of open-source large language models, image generation models, code generation models, vector and re-ranking models, and multimodal large models have been launched, covering multiple scenarios such as language, speech, images, and videos. These include DeepSeek-R1, DeepSeek-V3, QwQ32B, Llama 3.3 70B Instruct, Qwen2.5 72B Instruct, Qwen2.5 Coder 32B Instruct, FLUX.1-dev, FLUX.1-schnell, and CosyVoice2-0.5B.
2. High-performance large model inference acceleration service: enhances the user experience of GenAI applications.
## 3. Product characteristics
1. **High-Speed inference**
* Self-developed efficient operators and optimization frameworks, with a globally leading inference acceleration engine.
* Maximizes throughput capabilities, fully supporting high-throughput business scenarios.
* Significantly optimizes computational latency, providing exceptional performance for low-latency scenarios.
2. **High scalability**
* Dynamic scaling supports elastic business models, seamlessly adapting to various complex scenarios.
* One-click deployment of custom models, easily tackling scaling challenges.
* Flexible architecture design, meeting diverse task requirements and supporting hybrid cloud deployment.
3. **High cost-effectiveness**
* End-to-end optimization significantly reduces inference and deployment costs.
* Offers flexible pay-as-you-go pricing, minimizing resource waste and enabling precise budget control.
* Supports heterogeneous GPU deployment, leveraging existing enterprise investments to save costs.
4. **High stability**
* Developer-verified to ensure highly reliable and stable operation.
* Provides comprehensive monitoring and fault tolerance mechanisms to guarantee service capabilities.
* Offers professional technical support, meeting enterprise-level scenario requirements and ensuring high service availability.
5. **High intelligence**
* Delivers a variety of advanced model services, including large language models and multimodal models for audio, video, and more.
* Intelligent scaling features, flexibly adapting to business scale and meeting diverse service needs.
* Smart cost analysis, supporting business optimization and enhancing cost control and efficiency.
6. **High security**
* Supports BYOC (Bring Your Own Cloud) deployment, fully protecting data privacy and business security.
* Ensures data security through computational isolation, network isolation, and storage isolation.
* Complies with industry standards and regulatory requirements, fully meeting the security needs of enterprise users.
# SiliconCloud Platform
Source: https://docs.siliconflow.com/en/userguide/products/siliconcloud
# Quick Start
Source: https://docs.siliconflow.com/en/userguide/quickstart
## 1. Log in to the Platform
Create a [SiliconCloud](https://cloud.siliconflow.com/) account.
## 2. View Model List and Details
Visit the [Models](https://cloud.siliconflow.com/models) page to check the details of currently available models, including model pricing, maximum usage limits for users, and more. You can also test the models directly through the "Online Experience" feature on the model details page.
## 3. Experience GenAI Capabilities in the Playground
Go to the [“Playground”](https://cloud.siliconflow.com/) page. On the left sidebar, you can choose language models, text-to-image models, or image-to-image models. Select the corresponding model to start real-time testing. Enter the relevant parameters and prompt, then click the "Run" button to see the results generated by the model.
## 4. Use SiliconCloud API to Access GenAI Capabilities
### 4.1 Create an API Key
Go to the [API Keys](https://cloud.siliconflow.com/account/ak) page, click "Create API Key," and generate your API key.
### 4.2 Make Service Calls via REST API
You can directly use your API key for online calls on the platform's [“Documentation”](https://docs.siliconflow.com/cn/api-reference/chat-completions/chat-completions) page, where you can generate code snippets in the corresponding programming language.
### 4.3 Call via OpenAI Interface
Some large language models currently support being called via the OpenAI library.\
After installing Python 3.7.1 or a higher version and setting up a virtual environment, you can install the OpenAI Python library. Run the following command from your terminal/command line:
```shell
pip install --upgrade openai
```
Once completed, running `pip list` will display the Python libraries installed in your current environment. Confirm that the OpenAI Python library has been successfully installed.\
You can then call the API using OpenAI's related interfaces. The platform currently supports most OpenAI-related parameters.
```python
from openai import OpenAI
client = OpenAI(api_key="YOUR_API_KEY", base_url="https://api.ap.siliconflow.com/v1")
response = client.chat.completions.create(
model='deepseek-ai/DeepSeek-R1',
messages=[
{'role': 'user',
'content': "tell me a story"}
],
stream=True
)
for chunk in response:
print(chunk.choices[0].delta.content, end='')
```
# Rate Limits
Source: https://docs.siliconflow.com/en/userguide/rate-limits/rate-limit-and-upgradation
## 1. Overview of Rate Limits
### 1.1 What are Rate Limits?
Rate Limits refer to the rules governing the frequency of API access to the SiliconCloud platform services within a specified time frame.
### 1.2 Why Implement Rate Limits?
Rate Limits are a common practice for APIs, implemented for the following reasons:
* **Ensuring fairness and optimal resource utilization**: To ensure fair use of resources and prevent excessive requests from some users that may affect the experience of others.
* **Preventing request overload**: To enhance service reliability by managing the platform's overall load and avoiding performance issues caused by sudden surges in requests.
* **Security protection**: To prevent malicious attacks that could overload the platform or even cause service interruptions.
### 1.3 Rate Limit Metrics
Currently, Rate Limits are measured using seven metrics:
* RPM (Requests per minute): Maximum number of requests allowed per minute.
* RPH (Requests per hour): Maximum number of requests allowed per hour.
* RPD (Requests per day): Maximum number of requests allowed per day.
* TPM (Tokens per minute): Maximum number of tokens allowed per minute.
* TPD (Tokens per day): Maximum number of tokens allowed per day.
* IPM (Images per minute): Maximum number of images that can be generated per minute.
* IPD (Images per day): Maximum number of images that can be generated per day.
### 1.4 Rate Limits for Different Models
| Model Name | Rate Limit Metrics | Current Metrics |
| ------------------------------- | ------------------ | ------------------------------------- |
| Language Models (Chat) | RPM, TPM | RPM: 1000-10000, TPM: 50000-5000000 |
| Vector Models (Embedding) | RPM, TPM | RPM: 2000-10000, TPM: 500000-10000000 |
| Reranking Models (Reranker) | RPM, TPM | RPM: 2000, TPM: 500000 |
| Image Generation Models (Image) | IPM, IPD | IPM: 2-, IPD: 400- |
| Multimodal Models | - | - |
Rate Limits may be triggered when any of the options (RPM, RPH, RPD, TPM, TPD, IPM, IPD) reaches its peak, depending on which occurs first. For example, if the RPM limit is 20 and the TPM limit is 200K, and an account sends 20 requests to ChatCompletions within one minute, each containing 100 tokens, the limit will be triggered even if the total tokens in these 20 requests do not reach 200K.
### 1.5 Rate Limit Scope
1. Rate Limits are defined at the user account level, not at the API key level.
2. Each model has **separate Rate Limits**, meaning that exceeding the Rate Limits for one model does not affect the normal usage of other models.
## 2. Rate Limit Rules
* The Rate Limits for free models are fixed, while paid models have different [Rate Limit metrics](https://cloud.siliconflow.com/models) based on account [usage tiers](https://account.siliconflow.com/user/settings).
* Within the same usage tier, the peak Rate Limits vary depending on the model type and parameter size.
### 2.1 Model Rate Limits
1. Pay-as-you-go: API calls are **counted** towards the account's [billing statement](https://cloud.siliconflow.com/bills).
2. Rate Limits are tiered based on account **usage levels**. Peak Rate Limits increase as the usage tier rises.
3. Within the same usage tier, the peak Rate Limits vary depending on the model type and the size of the model's parameters.
### 2.3 User Usage Levels and Rate Limits
The platform categorizes accounts into different usage tiers based on their monthly spending, with each tier having its own Rate Limit standards. When the monthly spending reaches the standard for a higher tier, the account is automatically upgraded to the corresponding usage tier. The upgrade takes effect immediately, providing more lenient Rate Limits.
* **Monthly Spending**: Includes both recharged and gifted amounts in the account's total [monthly spending](https://cloud.siliconflow.com/bills).
* **Tier Settings**: Compares the **previous calendar month's** spending with the spending from **the 1st of the current month to today**, and uses the higher value to determine the corresponding usage tier. New users start at the initial usage tier of L0.
| Tier | RPM | TPM |
| ---- | ------ | --------- |
| L0 | 1,000 | 40,000 |
| L1 | 1,200 | 60,000 |
| L2 | 2,000 | 80,000 |
| L3 | 4,000 | 160,000 |
| L4 | 8,000 | 500,000 |
| L5 | 10,000 | 2,000,000 |
### 2.4 Specific Model Rate Limits
The platform currently provides five categories: text generation, image generation, vectorization, reranking, and speech. Specific Rate Limit metrics for each model can be found on the [Models](https://cloud.siliconflow.com/models).
### 2.5 Rate Limits for `deepseek-ai/DeepSeek-R1` and `deepseek-ai/DeepSeek-V3`:
1. Added RPH Limit (Requests Per Hour):
* Applicable Models: `deepseek-ai/DeepSeek-R1`, `deepseek-ai/DeepSeek-V3`
* Applicable Users: All users
* Limit: 30 requests/hour
2. Added RPD Limit (Requests Per Day):
* Applicable Models: `deepseek-ai/DeepSeek-R1`, `deepseek-ai/DeepSeek-V3`
* Applicable Users: Users who have not completed identity verification
* Limit: 100 requests/day
The strategy may be adjusted periodically based on traffic and load changes. SiliconFlow reserves the right of final interpretation.
## 3. Handling Exceeding Rate Limits
### 3.1 Error Messages for Exceeding Rate Limits
If API requests exceed the Rate Limits, they will fail due to the limits being exceeded. Users must wait for a period of time until the Rate Limits are satisfied before making additional requests. The corresponding HTTP error message is:
```shell
HTTP/1.1 429
Too Many Requests
Content Type: application/json
Request was rejected due to rate limiting. If you want more, please contact contact@siliconflow.com
```
### 3.2 Methods to Handle Exceeding Rate Limits
* Within the existing Rate Limits, users can refer to [Handling Rate Limit Exceedance](https://github.com/siliconflow/siliconcloud-cookbook/blob/main/examples/how-to-handle-rate-limit-in-siliconcloud.ipynb) for error mitigation.
* Alternatively, users can increase their usage tier to raise the peak Rate Limits for achieving business goals.
# Using with Cursor
Source: https://docs.siliconflow.com/en/userguide/use-docs-with-cursor
The SiliconCloud documentation site supports the [llms.txt protocol](https://llmstxt.org/), allowing users to directly browse the documentation or seamlessly integrate it with tools that support the protocol.\
For users who may not be familiar with the [llms.txt protocol](https://llmstxt.org/), the following provides a brief overview and usage guide.
## 1. Using this documentation in Cursor
1. After opening the `Cursor` project, press `Command + L` to open the chat;
2. Enter `@` in the text box, select `Docs` from the menu, click `Add new doc`, and input the document address you want to use;
3. Once added successfully, you can enter your questions in the `chat` to get the corresponding results.
## 2. Overview of the llms.txt protocol
### 2.1 Protocol Background
The llms.txt protocol is an emerging web standard designed to help large language models (LLMs) access and understand website content more effectively. By creating an llms.txt file in the root directory of a website, website owners can provide clear navigation and guidance for AI systems, improving information retrieval efficiency.
### 2.2 File Structure
The llms.txt file uses Markdown format and typically includes the following sections:
1. **Title**: The website or project name.
2. **Description (optional)**: A brief introduction to the website or project.
3. **Details (optional)**: Additional background information or links to other documentation.
4. **Sections**: A list of important parts of the website, each with links and optional detailed descriptions.
Example (refer to: [https://docs.siliconflow.com/llms.txt](https://docs.siliconflow.com/llms.txt) and [https://docs.siliconflow.com/llms-full.txt](https://docs.siliconflow.com/llms-full.txt)):
```markdown
# SiliconFlow
## Docs
- [Create Audio Transcription Request](https://docs.siliconflow.com/api-reference/audio/create-audio-transcriptions): Creates an audio transcription.
- [Create Text-to-Speech Request](https://docs.siliconflow.com/api-reference/audio/create-speech): Generates audio from input text. The API produces binary audio data, which requires further processing by the user. Reference: https://docs.siliconflow.com/capabilities/text-to-speech#5
- [Delete Reference Audio](https://docs.siliconflow.com/api-reference/audio/delete-voice): Deletes user-defined voice presets.
- [Upload Reference Audio](https://docs.siliconflow.com/api-reference/audio/upload-voice): Uploads user-defined voice presets, supporting both base64 encoding and file uploads. Reference: https://docs.siliconflow.com/capabilities/text-to-speech#2-2
- [Get Reference Audio List](https://docs.siliconflow.com/api-reference/audio/voice-list): Retrieves a list of user-defined voice presets.
...
```
### 2.3 Purpose of the File
#### 2.3.1 /llms.txt:
* **AI-Friendly Navigation**: This file provides a simplified view of the entire documentation, making it easier for LLMs like Cursor or ChatGPT to index your content.
* Think of it as search engine optimization for AI—users can now directly find specific product information through general LLMs.
#### 2.3.2 /llms-full.txt:
* The file compiles all documentation text into a marked-up file, allowing AI tools to directly load information into their context windows.
* It enables tools like Cursor to input the documentation and provide context-aware suggestions based on the specifics of your product.
### 2.4 Differences from Existing Standards
While llms.txt shares some functional overlap with existing standards like robots.txt and sitemap.xml, their purposes and uses differ:
* **robots.txt**: Used to instruct search engine crawlers on which pages can or cannot be crawled, focusing primarily on access control.
* **sitemap.xml**: Provides a structural map of the website, helping search engines understand the layout of pages, primarily for indexing purposes.
* **llms.txt**: Provides a structured content overview for large language models, helping AI systems better understand and process website information, enhancing AI interactions.
## 3. Usage in Other Tools
If other platforms support the [llms.txt protocol](https://llmstxt.org/), they can also be used directly. For example, ask ChatGPT:
```markdown
https://docs.siliconflow.com/llms-full.txt What does SiliconFlow focus on?
```
## 4. Further Reading
1. The /llms.txt file: [https://llmstxt.org/](https://llmstxt.org/)
2. @Docs: [https://docs.cursor.com/context/@-symbols/@-docs](https://docs.cursor.com/context/@-symbols/@-docs)