cocodot
← Back to guides
Local card declined for overseas AI? cocodot: one card + one key
SetupUpdated 2026-09

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.

TL;DR: Keep a working SiliconFlow integration and add a second provider as a separate route, with its own credentials, endpoint and model identifier. Do not replace a shared global API key whenever a task needs a different model. Instead, let the application select a named route whose settings travel together. Start with manual selection; add automatic routing only after you can tell which provider received each request. For an international developer maintaining an existing application, this makes the migration easier to inspect and reverse. Take the base URL from SiliconFlow's official quick start for the platform where your account was created; the official page's current value is what counts. Then verify a short text request on each route before testing tools, streaming or structured output. Keep a small acceptance dataset with expected answers, required fields and a maximum waiting time. A second endpoint is useful only when it passes your application's checks; its existence alone does not establish a working fallback. Finally, compare total spend for accepted results rather than assuming a lower token price will reduce the cost of your workload. This guide provides a configuration contract, a route-isolation test and a rollout checklist you can maintain without hard-coding a changing model catalog.

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

DecisionWhat to configureHow to verify
Keep the current workloadA named SiliconFlow routeRun the existing acceptance examples unchanged
Add another model providerA second route with independent credentialsRun a short request directly against that route
Select by taskAn explicit task-to-route mapRecord the selected route alongside each test result
Use advanced featuresA capability checklist for each routeTest the exact feature before enabling it
Handle an unavailable routeAn approved fallback and a retry limitSimulate failure without sending real user data
Compare spendingAn acceptance rubric and a cost worksheetDivide test spend by accepted results

FAQ

How do I use SiliconFlow with an OpenAI-compatible application?

Create a separate provider configuration using your account's endpoint, credential and current model ID. Verify a minimal text request, then test the application's required features individually. Keep the working configuration available while evaluating the new route.

Which SiliconFlow base URL should I use?

Use the endpoint in the official quick start for the platform where your account and credential were created. The two documentation links in section 2 provide the starting points. Do not choose a hostname solely from an example copied from another developer's setup.

Why does my SiliconFlow integration say API key invalid?

Check the selected route, whether its secret is present and whether its endpoint belongs to the intended account platform. Reproduce the error with a minimal request. Do not print or share the credential while debugging; a route label and sanitized error are safer support material.

How should I troubleshoot a model not found error?

Compare the exact model identifier against the current catalog for the configured account. Then test that route directly before testing the application selector. Avoid assuming that a familiar model name or an identifier from another provider is interchangeable.

Will a second API provider automatically reduce costs or prevent downtime?

No. Evaluate accepted results and actual test spend, including retries and manual repair. A fallback also needs compatible features, data approval and explicit routing rules. Keep it disabled until those checks pass, and retain a manual recovery procedure.

About cocodot

cocodot is a payment and AI access service for developers and cross-border teams in mainland China. It provides US-BIN virtual cards issued by a licensed institution — used to pay for overseas subscriptions and ad accounts — and an OpenAI-compatible AI API gateway for calling Claude, GPT and Gemini from within mainland China. Both share one wallet, funded by Alipay / WeChat Pay, USDT / USDC and accounted in USD. Fees are listed on the pricing page.

Service scope, pricing and limits →
OpenAI-compatible API, pay in RMBGet API access