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.

On this page

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:

KeyValue
nameThe endpoint's name in LibreChat's menu.
apiKey${USDF_API_KEY} reads the key from .env, so the file holds no key.
baseURLhttps://api.usdf.fi/v1
models.defaultThe model ids the endpoint offers.
models.fetchtrue reads the gateway's whole list, embedding, image and speech models included; false offers the ids in default alone.
modelDisplayLabelThe 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}'
AnswerWhat it means
200The key and the model work. The answer ends with its receipt: what was charged, and the request id.
401 invalid_api_keyNo valid key reached the gateway. Send a key that starts with sk_.
402 insufficient_balanceThe balance does not cover the request. Add USDF; see Accounts and keys.
404 model_not_foundThe id is not one the gateway serves. The error names the closest ids; every id is on Models.

See every client and coding agent

Foundry documentation

Confirm it's you

Confirm to continue the action you started.

Checking confirmation options…