Agents and integrations
Use Foundry with LibreChat.
Add Foundry to LibreChat as a custom endpoint in librechat.yaml, and chat with the gateway's models from your USDF balance.
You need a Foundry API key with USDF on its balance. Create one in the dashboard; see Accounts and keys.
LibreChat reaches the gateway through its OpenAI-compatible API at https://api.usdf.fi/v1. Replace sk_YOUR_KEY below with your key.
LibreChat reads custom endpoints from librechat.yaml, and the key from its .env file. Add your key there:
.env
USDF_API_KEY=sk_YOUR_KEY
Add this block to librechat.yaml, under its endpoints key if the file has one, and keep the file's version line. Then restart LibreChat so it reads the file again.
librechat.yaml
endpoints: custom: - name: "Foundry" apiKey: "${USDF_API_KEY}" baseURL: "https://api.usdf.fi/v1" models: default: ["claude-sonnet-5-5"] fetch: false modelDisplayLabel: "Foundry"
What each key does:
| Key | Value |
|---|---|
name | The endpoint's name in LibreChat's menu. |
apiKey | ${USDF_ reads the key from ., so the file holds no key. |
baseURL | https:/ |
models. | The model ids the endpoint offers. |
models. | true reads the gateway's whole list, embedding, image and speech models included; false offers the ids in default alone. |
modelDisplayLabel | The name shown beside each answer. |
List chat models in models.default. claude-sonnet-5-5 is one the gateway serves now. Every id is on Models.
To check the key and the model on their own, send one request from a shell where USDF_API_KEY holds your key:
Check
curl -sS https://api.usdf.fi/v1/chat/completions \ -H "Authorization: Bearer $USDF_API_KEY" \ -H "Content-Type: application/json" \ -d '{"model": "claude-sonnet-5-5", "messages": [{"role": "user", "content": "Say hello in one word"}], "max_tokens": 256}'
| Answer | What it means |
|---|---|
200 | The key and the model work. The answer ends with its receipt: what was charged, and the request id. |
401 invalid_ | No valid key reached the gateway. Send a key that starts with sk_. |
402 insufficient_ | The balance does not cover the request. Add USDF; see Accounts and keys. |
404 model_ | The id is not one the gateway serves. The error names the closest ids; every id is on Models. |