Agents and integrations
Use Foundry with Open WebUI.
Add Foundry to Open WebUI as an OpenAI API connection, 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.
Open WebUI reaches the gateway through its OpenAI-compatible API at https://api.usdf.fi/v1. Replace sk_YOUR_KEY below with your key.
- Go to Settings > Admin > Connections.
- In Manage OpenAI API Connections, click Add Connection.
- Set URL to
https://api.usdf.fi/v1and API Key to your key. Verify Connection checks both. - Optionally, type model ids under Model IDs and click + after each. Left empty, Open WebUI offers every model the gateway lists.
- Click Save.
From the environment
A new Open WebUI server can take the same connection from its environment when it first starts:
Environment
OPENAI_API_BASE_URL=https://api.usdf.fi/v1 OPENAI_API_KEY=sk_YOUR_KEY
Open WebUI keeps these settings in its database after the first start. Change them later in Connections.
Open WebUI reads the model list from GET /v1/models, which lists every model that serves now, embedding, image and speech models included. To offer chat models alone, list their ids under Model IDs, such as claude-sonnet-5-5. 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. |