Documentation

Client Overview

The v1 routes, which credential each one accepts, and how to hand tools to a model.

Every client works against the same small set of routes: list integrations, resolve tools, invoke a tool. Use them from the Python SDK, the TypeScript SDK, raw HTTP, or skip them and connect an MCP client.


Routes and Credentials

"API key" means x-api-key: df_live_.... "Access token" means Authorization: Bearer <token> from POST /api/v1/auth/login. See Credentials for how to get each.

RouteAcceptsPurpose
GET /api/v1/integrationsAccess tokenList your integrations, with verified for each.
POST /api/v1/integrationsAccess tokenConnect a provider (provider_key, auth_scheme, credentials).
POST /api/v1/integrations/{id}/testAccess tokenCheck the stored credentials. Returns verified.
POST /api/v1/integrations/{id}/resolve-toolsAPI key or access tokenDiscover the integration's tools and input schemas.
GET /api/v1/integrations/{id}/toolsAPI key or access tokenRead the tools already resolved.
GET /api/v1/integrations/{id}/tools/schemaAPI key or access tokenTools as OpenAI, Anthropic or MCP tool schemas.
POST /api/v1/integrations/{id}/invokeAPI key or access tokenRun a tool. Counts as one tool call.
POST /mcpAPI key or access tokenUse every verified integration from an MCP client.
GET /api/v1/connected_accounts/API keyList connection ids for the key's account.
GET /api/v1/audit/logsAccess tokenRead your organization's audit events.
GET /api/v1/providersNoneBrowse the provider catalog.

Tool schemas, tool resolution and invoke require a verified integration: one whose credentials Datafuse has seen work. On an unverified integration those routes return 403 with connection_verification_required, and GET .../tools returns tool names and short descriptions only.


Tool schemas for any framework

GET /api/v1/integrations/{id}/tools/schema returns an integration's tools in the shape a model API expects:

bash
curl -sS "https://api.datafuse.xyz/api/v1/integrations/$INTEGRATION_ID/tools/schema?format=openai" \
  -H "x-api-key: $DATAFUSE_API_KEY"
formatShape
openai (default)[{"type": "function", "function": {"name", "description", "parameters"}}]
anthropic[{"name", "description", "input_schema"}]
mcp[{"name", "description", "inputSchema"}]

!IMPORTANT The name in these schemas is the tool's display name (for example List_Models). invoke takes the tool's slug (for example deepseek_list_models). Passing the display name to invoke returns 404.

To let a model choose a tool and then run its choice, build the schemas from the resolved tools so the name the model sees is the slug:

python
import os

import requests

base_url = os.getenv("DATAFUSE_API_URL", "https://api.datafuse.xyz")
headers = {"x-api-key": os.environ["DATAFUSE_API_KEY"]}
integration_id = os.environ["INTEGRATION_ID"]

response = requests.get(f"{base_url}/api/v1/integrations/{integration_id}/tools", headers=headers)
response.raise_for_status()

openai_tools = [
    {
        "type": "function",
        "function": {
            "name": tool["slug"],
            "description": tool["description"] or "",
            "parameters": tool["input_schema"] or {"type": "object", "properties": {}},
        },
    }
    for tool in response.json()
]
print([tool["function"]["name"] for tool in openai_tools])

Pass openai_tools to the model. When it returns a tool call, send the call's name as tool_key and its arguments as arguments to POST /api/v1/integrations/{id}/invoke.

MCP clients do not need any of this: the MCP endpoint lists and runs tools under one consistent name.


Next Steps