SiliconFlow API Setup: Add a Second Provider Without Mixing Keys
A practical two-provider setup: separate credentials, verify each route, test features, and compare the cost of accepted results.
1. Define what the second route must add
Start with a task you cannot comfortably run through the existing configuration. It might be a coding review that needs a different evaluation result, a document workflow with another feature requirement, or a separately approved route for a customer project. Write the requirement before choosing a provider: input format, expected output, privacy constraints, acceptable waiting time and a spending allowance. Keep the existing route for tasks it already handles well. Avoid treating open versus closed models as a complete routing rule; evaluate the actual task and the model available to your account. A useful planning sheet has four columns: task, current route, candidate route and acceptance test. If the candidate adds no measurable benefit under that test, there is no need to move the task. This keeps a two-provider setup tied to a concrete application requirement instead of accumulating accounts and unused configurations.
2. Choose the correct SiliconFlow account and endpoint
Use the [global quick start](https://docs.siliconflow.com/en/userguide/quickstart) or the [China-platform quick start](https://api-docs.siliconflow.cn/docs/userguide/quickstart) for the platform where you created the account. For current model availability, pricing, limits and which endpoint a credential works with, the official documentation for that platform is the reference. For your own configuration record, keep the account label, documentation link, base URL and secret reference together. Copy the model identifier from that account's current catalog, then record when you last checked it. Do not carry an identifier across providers simply because the visible model names look similar. Before a production change, have the operator confirm the endpoint hostname without displaying the credential. An endpoint typo should be caught in configuration review before a request containing private input is sent.
3. Make endpoint, key and model one configuration unit
Create named routes such as siliconflow_primary and second_provider_review. Each route should contain a base URL, a reference to its server-side secret, a model ID, a timeout and an allowed-feature list. Keep the public task name separate from the provider's model identifier: document_summary can select a route without spreading vendor-specific strings throughout the application. Resolve that route once when preparing the request, then pass the same resolved object to the client builder and the logging layer. Reject unknown route names instead of falling back silently to a default. As a local routing test, use mock clients and deliberately pair a route with the wrong secret reference; your configuration validator should reject the pairing before any network call. This test does not prove that a credential is valid. It proves that the application cannot accidentally choose an endpoint from one route and a credential from another. Store only configuration labels in the test report.
No overseas card needed: cocodot's OpenAI-compatible API — switch your base_url to call the models on sale.
Top up via Alipay / WeChat Pay, USDT / USDC · billed per token · switch your base_url to connect
4. Verify each route before testing combined routing
Run a small non-sensitive prompt separately on each route, asking for a short answer with an obvious expected result. Record whether a request completed, whether the output was readable and whether your application accepted it. Keep a checklist for endpoint selection, account access, model identifier and response parsing. Only after both routes pass independently should you test the task selector. Include an unknown task and an unknown route in that test: both should fail clearly rather than choosing an unreviewed destination. Next, send the same harmless test through the normal application path and compare its route label with the direct test. This catches a selector that appears correct in isolation while the live application still constructs a shared default client. Do not use a model's self-description as proof of which model executed. A prompt asking for the model name can be kept as a curiosity, but it should not replace configuration checks and a repeatable task evaluation.
5. Test compatibility feature by feature
OpenAI compatibility can reduce integration work, but check the provider's current documentation for each endpoint and advanced feature you rely on. Build your own capability worksheet rather than assuming every route accepts the same request body. Begin with plain text, then add the features your application needs individually. For structured output, validate the returned object against your schema and mark an invalid result as a failed acceptance test. For tools, use a harmless local test tool and inspect its arguments before allowing any action. For streaming, test partial output, interruption and the application's cleanup behavior. For long documents, try representative inputs and inspect whether the final answer preserves required details. Keep unsupported options out of a route's request builder. If a feature cannot be verified, leave that route disabled for tasks requiring it. A successful short chat establishes only that short-chat path; it is not evidence that the entire assistant workflow is ready.
6. Diagnose invalid keys and model-not-found messages safely
Searches for SiliconFlow integration problems include API key invalid and model not found. Treat either message as a starting point for investigation rather than a complete diagnosis. First identify which route your application selected. Check that its secret is configured using a boolean present-or-missing check; never print the value, a prefix, request headers or a full environment dump. Compare the endpoint with the documentation for that account. Then compare the configured model string with the current catalog, including capitalization and punctuation. Reproduce the problem with a minimal non-sensitive request before reintroducing optional fields. Save the time, route label, sanitized error text and any safe request identifier for support. Do not paste an unreviewed raw exception into a public issue because it may include request details. If a simple request works but the application fails, compare the application's resolved configuration and optional parameters. Avoid changing the key, endpoint and model simultaneously: one change per test makes the result interpretable.
7. Set fallback and spending rules explicitly
Treat fallback as a separate product decision. A timed-out request does not tell your application whether useful work happened remotely, so consider the consequences before sending the task again. Set a retry count, a total waiting-time allowance and a rule for when to ask the user to retry. Prevent repeated provider switching by allowing only a defined fallback path. Check that the alternative route is approved to receive the same data and can produce the required format. To evaluate cost, run a fixed set of representative tasks and record accepted, rejected and manually repaired results alongside the spend shown by each provider. Include retry attempts in the worksheet. Divide the test's total spend by its accepted results, and record human repair time separately. Do not claim a savings percentage from a token-price comparison alone. Likewise, a budget email should not be treated as a spending stop unless the provider's current documentation explicitly describes that enforcement. Use application-side request admission and a manual stop procedure as additional controls.
8. Add cocodot only where the evaluated route helps
cocodot provides an OpenAI-compatible API gateway with Claude, GPT, Gemini and selected open-model options. Use its current documentation and [pricing page](https://cocodot.co/pricing) to choose the route you intend to evaluate; keep that route's credential separate from SiliconFlow's. There is no need to migrate a working workload merely to place every task on one account. Start with a small, non-sensitive evaluation, compare the accepted outputs and review the actual charges before expanding use. Keep the previous task mapping available so a configuration change can be reversed without rebuilding the application. For additional evaluation criteria, see [how to choose an API relay vendor](/hub/how-to-choose-api-relay-vendor?lang=en); for the boundary between a direct account and a gateway, see [when to use an official API or relay](/hub/llm-api-vs-official-when?lang=en). The useful outcome is a documented route for each task, with a tested capability set, a clear owner and a repeatable review procedure.
Build a separate route before adding automatic selection
| Decision | What to configure | How to verify |
|---|---|---|
| Keep the current workload | A named SiliconFlow route | Run the existing acceptance examples unchanged |
| Add another model provider | A second route with independent credentials | Run a short request directly against that route |
| Select by task | An explicit task-to-route map | Record the selected route alongside each test result |
| Use advanced features | A capability checklist for each route | Test the exact feature before enabling it |
| Handle an unavailable route | An approved fallback and a retry limit | Simulate failure without sending real user data |
| Compare spending | An acceptance rubric and a cost worksheet | Divide test spend by accepted results |