Back to Creating Secure Tools

Secure Tool API Reference

Complete REST API contract for secure tool providers.

Authentication Model

Secure tools use a two-tier authentication model based on caller origin:

EndpointCallerAuth Method
/installORCX-Daisi-Auth shared secret header
/uninstallORCX-Daisi-Auth shared secret header
/configureManager UI (direct)Known installId (registered via /install)
/executeConsumer Host (direct)Known installId (registered via /install)

The installId is an opaque, unguessable identifier generated by the ORC on purchase. It serves as a bearer token for consumer-originated calls. Reject requests with unknown installId values with HTTP 403.

POST /install

Called by the ORC when a user purchases the tool. Register the installation so subsequent configure/execute calls can be validated.

Request
POST {baseUrl}/install
Content-Type: application/json
X-Daisi-Auth: {sharedSecret}

{
  "installId": "inst-260215143022-abcdef",
  "toolId": "weather-lookup"
}
Request Fields
FieldTypeDescription
installIdstringOpaque identifier for this installation. Store this to validate future requests.
toolIdstringThe tool ID as defined in the marketplace item.
Response
{ "success": true }

POST /uninstall

Called by the ORC when a purchase is deactivated (subscription expired, cancelled, etc.). Clean up stored data for this installation.

Request
POST {baseUrl}/uninstall
Content-Type: application/json
X-Daisi-Auth: {sharedSecret}

{
  "installId": "inst-260215143022-abcdef"
}
Response
{ "success": true }

POST /configure

Called directly by the Manager UI when a user saves their setup data (API keys, credentials). No ORC relay.

Request
POST {baseUrl}/configure
Content-Type: application/json

{
  "installId": "inst-260215143022-abcdef",
  "toolId": "weather-lookup",
  "setupValues": {
    "apiKey": "sk-...",
    "region": "US"
  }
}
Request Fields
FieldTypeDescription
installIdstringThe installation identifier (registered via /install). Validate that this is known.
toolIdstringThe tool ID as defined in the marketplace item.
setupValuesobjectKey-value pairs matching the setup parameters defined in the marketplace item.
Response
// Success
{ "success": true }

// Error
{ "success": false, "error": "Invalid API key format" }

POST /execute

Called directly by consumer hosts when the AI invokes the tool during inference. No ORC relay.

Request
POST {baseUrl}/execute
Content-Type: application/json

{
  "installId": "inst-260215143022-abcdef",
  "toolId": "weather-lookup",
  "parameters": [
    { "name": "city", "value": "San Francisco" },
    { "name": "units", "value": "fahrenheit" }
  ]
}
Request Fields
FieldTypeDescription
installIdstringThe installation identifier (registered via /install). Validate that this is known.
toolIdstringThe tool ID as defined in the marketplace item.
parametersarrayName/value pairs provided by the AI, matching the call parameters defined in the marketplace item.
Response
// Success
{
  "success": true,
  "output": "72 F, Sunny with clear skies",
  "outputFormat": "plaintext",
  "outputMessage": "Current weather for San Francisco"
}

// Error
{
  "success": false,
  "errorMessage": "API rate limit exceeded. Please try again in 60 seconds."
}
Response Fields
FieldTypeDescription
successboolWhether the tool executed successfully.
outputstringThe tool's output, returned to the AI.
outputFormatstringFormat of the output: plaintext, json, markdown, html, or base64.
outputMessagestring?Optional message to accompany the output for additional context.
errorMessagestring?Error description when success is false.

Error Handling

Providers should handle errors gracefully:

ScenarioRecommended Response
Missing or invalid X-Daisi-Auth (install/uninstall)HTTP 401 Unauthorized
Unknown installId (configure/execute)HTTP 403 Forbidden with descriptive error
Installation not configuredHTTP 200 with success: false and descriptive error message
Invalid parametersHTTP 200 with success: false and descriptive error message
External API failureHTTP 200 with success: false and error message. Do not return HTTP 500 for expected failures.
Unexpected server errorHTTP 500 (the host will return a generic "Provider returned HTTP 500" error)

Setup Parameter Types

When defining setup parameters in the marketplace item, choose the appropriate type for the Manager UI:

TypeUI RenderingUse Case
textStandard text inputRegion names, identifiers, non-sensitive strings
passwordPassword input (masked)Passwords, tokens
apikeyPassword input (masked)API keys, secret keys
urlURL text inputEndpoint URLs, webhook URLs
jsonMultiline textarea (monospace)JSON configuration objects