API reference
Platforms
Sub-keys for platforms, and providers serving their own endpoint.
On this page
GET/
The platform's sub-keys.
Auth: Platform key (Authorization: Bearer $USDF_) or the platform account's own session. An ordinary API key is refused 403 not_. See Platforms and providers.
No parameters.
GET /v1/platform/keys
curl https://api.usdf.fi/v1/platform/keys \
-H "Authorization: Bearer $USDF_PLATFORM_KEY"POST/
Revokes one sub-key.
Auth: Platform key (Authorization: Bearer $USDF_) or the platform account's own session. An ordinary API key is refused 403 not_. See Platforms and providers.
| Name | Type | Required | Description |
|---|---|---|---|
id | string | Yes | Path. The sub-key id. |
POST /v1/platform/keys/{id}/revoke
curl -X POST https://api.usdf.fi/v1/platform/keys/{id}/revoke \
-H "Authorization: Bearer $USDF_PLATFORM_KEY"GET/
Usage across sub-keys.
Auth: Platform key (Authorization: Bearer $USDF_) or the platform account's own session. An ordinary API key is refused 403 not_. See Platforms and providers.
| Name | Type | Required | Description |
|---|---|---|---|
end_ | string | No | Query. Only this end user's. |
GET /v1/platform/usage
curl https://api.usdf.fi/v1/platform/usage \
-H "Authorization: Bearer $USDF_PLATFORM_KEY"GET/
Registered providers.
Auth: None
No parameters.
GET /v1/providers
curl https://api.usdf.fi/v1/providers
POST/
Registers your own endpoint. Every field is on the Platforms and providers page, under Serve your own endpoint.
Auth: Session, not an API key: Authorization: Bearer <session token>. See Sign in.
| Name | Type | Required | Description |
|---|---|---|---|
name | string | Yes | The provider's name. |
slug | string | No | Its id in the catalog. |
base_ | string | Yes | Your OpenAI-compatible endpoint, https. |
auth | object | No | The header and value the gateway sends your endpoint. |
models | array | Yes | The models you serve, each with its prices. |
data_ | object | No | What your endpoint keeps of a request. |
POST /v1/providers
curl -X POST https://api.usdf.fi/v1/providers \ -H "Authorization: Bearer $SESSION" \ -H "Content-Type: application/json" \ -d '{"name": "Acme Compute", "slug": "acme", "base_url": "https://api.example.com/v1", "auth": {"header": "authorization", "value": "Bearer sk-..."}, "data_policy": {"retains": false, "trains": false, "region": "us"}, "models": [{"id": "llama-3.3-70b-instruct", "upstream_model": "acme/llama-70b", "input_price": 0.08, "output_price": 0.2, "context": 65536, "max_output": 8192}]}'
GET/
The account's referrals.
Auth: API key (Authorization: Bearer sk_) or a session
No parameters.
GET /v1/referrals
curl https://api.usdf.fi/v1/referrals \
-H "Authorization: Bearer $USDF_API_KEY"