Client SDKs

Python Client Guide

Resolve and invoke Datafuse tools with the datafuse-sdk package.

datafuse-sdk is a typed client generated from the Datafuse API. Each method maps to one v1 route.

bash
pip install datafuse-sdk

1. Create a Client

Pass the credential yourself: the SDK does not read environment variables. The client sends it as both Authorization: Bearer and x-api-key, so one client works with either credential type.

python
import os

from datafuse import Datafuse

sdk = Datafuse(api_key=os.environ["DATAFUSE_API_KEY"])
You passThe client can
An API key (df_live_...)Resolve tools, list tools, invoke tools, list connected accounts, browse providers
An access tokenEverything above except connected accounts, plus list, create, test and delete integrations

For a self-hosted deployment add base_url="https://your-datafuse-host".


2. Find Your Integration

Listing integrations needs an access token. Do this once and keep the id.

python
admin = Datafuse(api_key=os.environ["DF_TOKEN"])

page = admin.integrations.list_integrations_api_v1_integrations_get()
for integration in page.items:
    print(integration.id, integration.provider_key, integration.health_status)

# Choose the integration to use by its provider.
integration = next(item for item in page.items if item.provider_key == "deepseek")
integration_id = str(integration.id)

!NOTE Version 1.0.0 of the Python SDK does not expose the verified field on integrations, or the tools/schema route. Read verified from GET /api/v1/integrations directly, as shown in the quickstart.


3. Resolve Tools

python
tools = sdk.integrations.resolve_tools_api_v1_integrations_id_resolve_tools_post(integration_id)

for tool in tools:
    print(tool.slug, (tool.input_schema or {}).get("required", []))

On an integration whose credentials are not verified this raises datafuse.generated.exceptions.ForbiddenException.


4. Invoke a Tool

Pass a tool's slug as tool_key. This example calls DeepSeek's read-only deepseek_list_models; use a slug and arguments from your own integration.

python
from datafuse.generated import IntegrationInvokeRequest

result = sdk.integrations.invoke_tool_api_v1_integrations_id_invoke_post(
    integration_id,
    IntegrationInvokeRequest(tool_key="deepseek_list_models", arguments={}),
)

print(result.successful)
print(result.data if result.successful else result.error)

Client Layout

AttributeRoutes
sdk.integrationsIntegrations, tool resolution, invoke
sdk.providersProvider catalog
sdk.connected_accountsConnected accounts
sdk.api_keys, sdk.authenticationAPI keys, login and refresh
sdk.organizations, sdk.billing, sdk.compliance_audit_logsAccount, billing and audit

Method names follow the route they call. Use your editor's completion on each attribute to browse them.


Next Steps