Skip to main content
SiliconFlow provides an OpenAI-compatible chat completions API for open-source and proprietary models. Use Custom Endpoints in the AI Gateway to register SiliconFlow once, keep the SiliconFlow API key on the AI Gateway, and let your applications call models through a single TrueFoundry API key with access control and tracing.

Prerequisites

1

Create a SiliconFlow account

Sign up at cloud.siliconflow.com if you do not already have an account.
2

Generate a SiliconFlow API key

In the SiliconFlow dashboard, open API Keys and create a new key.Store the key securely. You will paste it into the AI Gateway’s Custom Headers configuration — not in client application code.
3

Get your TrueFoundry API key and gateway URL

You need a TrueFoundry API key (TFY_API_KEY) and your gateway base URL to call models through the AI Gateway. See Gateway base URL and Authentication.

Adding models

Add SiliconFlow to the AI Gateway using Custom Endpoints.
1

Create a Custom Endpoint model account

In the TrueFoundry dashboard, go to AI GatewayModelsCustom Endpoints and click Add Custom Endpoint.In Configure Account, set:
  • Name (Account Name): any unique label for this provider (for example, siliconflow) — this is your model account name and appears as the first path segment in every request URL ({providerAccountName})
  • Endpoint Type: None
  • Header Auth: keep disabled
2

Add a SiliconFlow endpoint

On the Endpoints step, add an integration and configure:
  • Display Name: any unique label for this endpoint (for example, chat) — this is your custom endpoint display name and appears as the second path segment in every request URL ({endpointName})
  • Base URL: https://api.siliconflow.com/v1/chat/completions
Enable Custom Headers and add:
  • Content-Type: application/json
  • Authorization: Bearer <SILICONFLOW_API_KEY>
Keep Header Auth and TLS Settings disabled unless your deployment requires them.
Custom Endpoint form for SiliconFlow with Base URL and custom headers

Endpoint settings — Base URL and upstream headers

The Authorization header here is sent from the AI Gateway to SiliconFlow. Your application should only send the TrueFoundry API key to the AI Gateway.
You can click + Add Custom Endpoint to register multiple endpoints under the same account (for example, chat, vision, or fast-inference). Each gets its own Display Name in the URL, but they can all point to the same SiliconFlow Base URL and headers. Which SiliconFlow model runs is chosen in the request body model field — not by the display name.
3

Set access control and save

On the Access Control step, choose who can manage and use this model account, then Save.
  • Manager: users/teams who can edit or delete the custom endpoint
  • User: users/teams who can call the endpoint (for example, everyone)

Inference

Once saved, call SiliconFlow through the AI Gateway’s proxy-api path. URL shape and path rules are documented under Custom Endpoints. After saving, TrueFoundry shows a Usage code snippet for the endpoint with the Base URL, Model ID, and a TrueFoundry API key.
Usage code snippet modal showing Base URL, Model ID, and API Key for SiliconFlow

Usage code snippet for the SiliconFlow custom endpoint

Because the integration Base URL already includes /v1/chat/completions, leave PROXY_PATH empty (or omit any upstream path). The AI Gateway forwards the request directly to SiliconFlow’s chat completions endpoint.

How the request URL is built

The AI Gateway URL has two values you configure in the dashboard — they are not SiliconFlow model IDs: Full URL pattern:
With the example configuration above:
The AI Gateway forwards the request to:

Choosing a SiliconFlow model

SiliconFlow hosts many models available in your workspace. You do not need a separate custom endpoint per model — set the model field in the JSON request body to whichever SiliconFlow model ID you want to run (for example, Qwen/Qwen3-32B). See the SiliconFlow models catalog for the full list. If you add multiple custom endpoints under the same account (different Display Name values), use the matching {endpointName} in the URL; each endpoint can still call any SiliconFlow model via the request body.
Replace siliconflow and chat in the URL with your own Account Name and Display Name if you used different values during setup.

Supported APIs

Before you start: Replace {GATEWAY_BASE_URL} with your gateway base URL (how to find it) and set TFY_API_KEY to your TrueFoundry API key.

Request headers (client → gateway)

Python (requests)

cURL

Support scope: Custom Endpoints proxy requests transparently to SiliconFlow. For gateway limitations on Custom Endpoints (HTTPS, streaming, and so on), see Custom Endpoints.