import requests
url = "https://eu.app.clarifeye.ai/api/v1/projects/{project_id}/tools/{tool_id}/run/"
payload = {
"query": "What are the key findings about revenue growth?",
"top_k": 10
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)[
{}
]{
"error_type": "syntax_error",
"error_code": "INVALID_QUERY",
"status": "error",
"message": "Invalid query syntax"
}{
"error": "Authentication credentials were not provided."
}{
"error": "You do not have permission to perform this action."
}{
"error_type": "syntax_error",
"error_code": "INVALID_QUERY",
"status": "error",
"message": "Invalid query syntax"
}{
"error_type": "syntax_error",
"error_code": "INVALID_QUERY",
"status": "error",
"message": "Invalid query syntax"
}Run a tool
Execute a configured tool with provided parameters.
The request body varies based on the tool type. Call
getToolParameters first to discover
the exact parameter schema for a given tool — most retrieval tools
accept query and top_k, but other tool types (e.g.
document_retrieval) expect different fields.
import requests
url = "https://eu.app.clarifeye.ai/api/v1/projects/{project_id}/tools/{tool_id}/run/"
payload = {
"query": "What are the key findings about revenue growth?",
"top_k": 10
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)[
{}
]{
"error_type": "syntax_error",
"error_code": "INVALID_QUERY",
"status": "error",
"message": "Invalid query syntax"
}{
"error": "Authentication credentials were not provided."
}{
"error": "You do not have permission to perform this action."
}{
"error_type": "syntax_error",
"error_code": "INVALID_QUERY",
"status": "error",
"message": "Invalid query syntax"
}{
"error_type": "syntax_error",
"error_code": "INVALID_QUERY",
"status": "error",
"message": "Invalid query syntax"
}Authorizations
Use Authorization: Bearer <token>. The token is either a user token / OAuth access
token, or a service-account API key (cfk_...). A key is valid on every endpoint and
acts as its service account, an organization member with per-store permissions.
Refused keys answer 403 with Invalid API key., API key revoked.,
API key expired. or API key disabled..
Path Parameters
Body
Request body for running a tool. Parameters vary by tool type.
Most tools accept a query parameter and optional top_k for result count.
Response
Tool execution successful