Agents and integrations
Use Foundry with Kilo Code.
Add Foundry to Kilo Code as a custom provider with the gateway's address and your key, and run Kilo Code 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.
Kilo Code reaches the gateway through its OpenAI-compatible API at https://api.usdf.fi/v1. Replace sk_YOUR_KEY below with your key.
- Open Settings (the gear icon) and go to the Providers tab.
- Scroll down and click Custom provider.
- Fill in the dialog as in the table below, then click Submit.
| Field | Value |
|---|---|
| Provider ID | foundry |
| Display name | Foundry |
| Provider API | OpenAI Compatible |
| Base URL | https:/ |
| API key | Your key |
| Models | The ids to offer, such as claude-sonnet-5-5 and claude-haiku-5-5 |
| Headers | Leave empty: the key is sent as a Bearer token. |
The models you added then appear in Kilo Code's model picker.
Kilo Code works through tool calls, so pick models that call tools. claude-sonnet-5-5 for the work and claude-haiku-5-5 for small tasks are the gateway's choice now. Every id is on Models, and GET /v1/models lists the models that serve now.
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. |