{
  "basePath":"/api/ai-tools/v1",
  "authentication":"Authorization: Bearer <RELAYME_API_KEY>",
  "bindings":{
    "relayme_list_models":{"method":"GET","path":"/models"},
    "relayme_chat":{"method":"POST","path":"/chat/completions"},
    "relayme_generate_image":{"method":"POST","path":"/images/generations"},
    "relayme_generate_video":{"method":"POST","path":"/videos/generations"},
    "relayme_get_task":{"method":"GET","path":"/tasks/{taskId}"},
    "relayme_list_tasks":{"method":"GET","path":"/tasks","queryArguments":{"page":"page","size":"size"}},
    "relayme_list_workflows":{"method":"GET","path":"/workflows"},
    "relayme_get_workflow":{"method":"GET","path":"/workflows/{workflowId}"},
    "relayme_validate_workflow":{"method":"POST","path":"/workflows/validate"},
    "relayme_create_workflow":{"method":"POST","path":"/workflows"},
    "relayme_update_workflow":{"method":"PUT","path":"/workflows/{workflowId}"},
    "relayme_delete_workflow":{"method":"DELETE","path":"/workflows/{workflowId}"},
    "relayme_get_workflow_schema":{"method":"GET","path":"/workflows/{workflowId}/schema"},
    "relayme_estimate_workflow":{"method":"POST","path":"/workflows/{workflowId}/estimate"},
    "relayme_run_workflow":{"method":"POST","path":"/workflows/{workflowId}/runs","headerArguments":{"idempotencyKey":"Idempotency-Key"}},
    "relayme_get_workflow_run":{"method":"GET","path":"/workflow-runs/{runId}"},
    "relayme_list_workflow_runs":{"method":"GET","path":"/workflows/{workflowId}/runs"},
    "relayme_cancel_workflow_run":{"method":"POST","path":"/workflow-runs/{runId}/cancel"}
  },
  "tools":[
    {"type":"function","function":{"name":"relayme_list_models","description":"List enabled RelayMe models before choosing one for text, image, or video generation.","parameters":{"type":"object","properties":{},"additionalProperties":false}}},
    {"type":"function","function":{"name":"relayme_chat","description":"Generate a synchronous text response with a discovered TEXT or CODE model.","parameters":{"type":"object","required":["model","messages"],"properties":{"model":{"type":"string"},"messages":{"type":"array","minItems":1,"items":{"type":"object","required":["role","content"],"properties":{"role":{"type":"string","enum":["system","user","assistant"]},"content":{}},"additionalProperties":false}},"systemPrompt":{"type":"string"},"temperature":{"type":"number"},"maxTokens":{"type":"integer","minimum":1}},"additionalProperties":false}}},
    {"type":"function","function":{"name":"relayme_generate_image","description":"Submit one asynchronous image generation and retain the returned taskId. Do not blindly retry ambiguous submissions.","parameters":{"type":"object","required":["model","messages"],"properties":{"model":{"type":"string"},"messages":{"type":"array","minItems":1,"items":{"type":"object"}},"imageAspectRatio":{"type":"string"},"imageQuality":{"type":"string"},"imageSampleSize":{"type":"string"}},"additionalProperties":false}}},
    {"type":"function","function":{"name":"relayme_generate_video","description":"Submit one asynchronous video generation and retain the returned taskId. Do not blindly retry ambiguous submissions.","parameters":{"type":"object","required":["model","messages"],"properties":{"model":{"type":"string"},"messages":{"type":"array","minItems":1,"items":{"type":"object"}},"videoAspectRatio":{"type":"string"},"videoSeconds":{"type":"integer","minimum":1},"videoResolution":{"type":"string"},"videoGenerateAudio":{"type":"boolean"}},"additionalProperties":false}}},
    {"type":"function","function":{"name":"relayme_get_task","description":"Get status and final imageContent or videoContent for a creative generation task.","parameters":{"type":"object","required":["taskId"],"properties":{"taskId":{"type":"string"}},"additionalProperties":false}}},
    {"type":"function","function":{"name":"relayme_list_tasks","description":"List recent creative generation tasks to recover a lost taskId or inspect history.","parameters":{"type":"object","properties":{"page":{"type":"integer","minimum":1},"size":{"type":"integer","minimum":1,"maximum":200}},"additionalProperties":false}}},
    {"type":"function","function":{"name":"relayme_list_workflows","description":"List saved RelayMe workflows before selecting one to run.","parameters":{"type":"object","properties":{},"additionalProperties":false}}},
    {"type":"function","function":{"name":"relayme_get_workflow","description":"Read a saved workflow graph and metadata by ID.","parameters":{"type":"object","required":["workflowId"],"properties":{"workflowId":{"type":"integer","minimum":1}},"additionalProperties":false}}},
    {"type":"function","function":{"name":"relayme_validate_workflow","description":"Validate nodes, connections, ports, and DAG structure before saving a workflow.","parameters":{"type":"object","required":["data"],"properties":{"data":{"type":"object","required":["nodes","connections"],"properties":{"nodes":{"type":"array","items":{"type":"object"}},"connections":{"type":"array","items":{"type":"object"}}}}},"additionalProperties":false}}},
    {"type":"function","function":{"name":"relayme_create_workflow","description":"Create a validated saved workflow. Call only when the user authorized creation.","parameters":{"type":"object","required":["name","data"],"properties":{"name":{"type":"string"},"canvasScale":{"type":"number"},"data":{"type":"object","required":["nodes","connections"],"properties":{"nodes":{"type":"array","items":{"type":"object"}},"connections":{"type":"array","items":{"type":"object"}}}}},"additionalProperties":false}}},
    {"type":"function","function":{"name":"relayme_update_workflow","description":"Update a saved workflow. Call only when the user authorized changing it.","parameters":{"type":"object","required":["workflowId"],"properties":{"workflowId":{"type":"integer","minimum":1},"name":{"type":"string"},"canvasScale":{"type":"number"},"data":{"type":"object","required":["nodes","connections"],"properties":{"nodes":{"type":"array","items":{"type":"object"}},"connections":{"type":"array","items":{"type":"object"}}}}},"additionalProperties":false}}},
    {"type":"function","function":{"name":"relayme_delete_workflow","description":"Permanently delete a saved workflow. Require explicit user authorization and the exact workflow ID.","parameters":{"type":"object","required":["workflowId"],"properties":{"workflowId":{"type":"integer","minimum":1}},"additionalProperties":false}}},
    {"type":"function","function":{"name":"relayme_get_workflow_schema","description":"Get the accepted runtime inputs and terminal outputs for a workflow.","parameters":{"type":"object","required":["workflowId"],"properties":{"workflowId":{"type":"integer","minimum":1}},"additionalProperties":false}}},
    {"type":"function","function":{"name":"relayme_estimate_workflow","description":"Estimate cost before starting a workflow.","parameters":{"type":"object","required":["workflowId"],"properties":{"workflowId":{"type":"integer","minimum":1},"inputs":{"type":"object","additionalProperties":true}},"additionalProperties":false}}},
    {"type":"function","function":{"name":"relayme_run_workflow","description":"Start an idempotent asynchronous workflow run. Save runId and poll it.","parameters":{"type":"object","required":["workflowId","idempotencyKey"],"properties":{"workflowId":{"type":"integer","minimum":1},"idempotencyKey":{"type":"string","maxLength":128},"inputs":{"type":"object","additionalProperties":true},"callbackUrl":{"type":"string","format":"uri"},"metadata":{"type":"object"}},"additionalProperties":false}}},
    {"type":"function","function":{"name":"relayme_get_workflow_run","description":"Get status and outputs for an asynchronous workflow run.","parameters":{"type":"object","required":["runId"],"properties":{"runId":{"type":"string"}},"additionalProperties":false}}},
    {"type":"function","function":{"name":"relayme_list_workflow_runs","description":"List recent runs for a saved workflow for recovery and diagnostics.","parameters":{"type":"object","required":["workflowId"],"properties":{"workflowId":{"type":"integer","minimum":1}},"additionalProperties":false}}},
    {"type":"function","function":{"name":"relayme_cancel_workflow_run","description":"Stop scheduling further workflow nodes. In-flight provider calls may still finish and be billed.","parameters":{"type":"object","required":["runId"],"properties":{"runId":{"type":"string"},"reason":{"type":"string","maxLength":500}},"additionalProperties":false}}}
  ]
}