Agents and integrations
Use Foundry with n8n.
Give n8n an OpenAI credential with the gateway's address and your key, and run its AI nodes on 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.
n8n reaches the gateway through its OpenAI-compatible API at https://api.usdf.fi/v1. Replace sk_YOUR_KEY below with your key.
Create a new OpenAI credential and fill it in as below:
| Field | Value |
|---|---|
| API Key | Your key |
| Organization ID (optional) | Leave empty. |
| Base URL | https:/ |
- Add the OpenAI Chat Model node to a root node such as AI Agent, and pick the credential above. The node sends its requests to the credential's Base URL.
- In Model, switch from From List to ID and enter a model id, such as
claude-sonnet-5-5. Every id is on Models. - Leave Use Responses API off: the node then sends chat completions.
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. |
Foundry documentation