Public API documentation Read as Markdown ↗

Harnyx Research API reference (generated)

Generated from FastAPI OpenAPI.

Authentication and hosts

Public integrations use https://api.harnyx.ai with Authorization: Bearer <HARNYX_API_KEY>. Signing in to Developer Console does not authenticate browser requests to that public API host.

This reference covers the public bearer-authenticated Research API. The machine-readable contract is available at research.openapi.json.

Domains

research

tasks

GET /v1/research/tasks

List Research Tasks

Auth: PlatformApiKey

Parameters

ParamInReqNotes
cursorqueryoptstring (nullable)
limitqueryoptinteger (default: 50)

Responses 200 Successful Response Content-Type: application/json Body: ResearchTaskPage

1st level2nd level3rd levelReqNotes
itemsreqarray[ResearchTaskSummary]
created_atreqstring (format: date-time)
finished_atreqstring (format: date-time; nullable)
idreqstring (format: uuid)
input_previewreqstring
statusreqResearchTaskStatus
next_cursorreqstring (nullable)

400 Invalid Research Task cursor. Content-Type: application/json Body: ErrorResponse

1st level2nd level3rd levelReqNotes
billingoptErrorBillingDTO (nullable)
actual_cost_providerreqstring (enum: [openrouter, ai_gateway])
actual_cost_usdreqnumber
usageoptDecisionUsage (nullable)
input_tokensoptinteger (nullable)
output_tokensoptinteger (nullable)
error_codereqstring
messagereqstring

401 Platform API-key authentication failed. Content-Type: application/json Body: ErrorResponse

Response headers

HeaderNotes
WWW-Authenticatestring — Bearer authentication challenge when API-key authentication fails.
1st level2nd level3rd levelReqNotes
billingoptErrorBillingDTO (nullable)
actual_cost_providerreqstring (enum: [openrouter, ai_gateway])
actual_cost_usdreqnumber
usageoptDecisionUsage (nullable)
input_tokensoptinteger (nullable)
output_tokensoptinteger (nullable)
error_codereqstring
messagereqstring

422 Request validation failed (error_code: validation_failed). Content-Type: application/json Body: ErrorResponse

1st level2nd level3rd levelReqNotes
billingoptErrorBillingDTO (nullable)
actual_cost_providerreqstring (enum: [openrouter, ai_gateway])
actual_cost_usdreqnumber
usageoptDecisionUsage (nullable)
input_tokensoptinteger (nullable)
output_tokensoptinteger (nullable)
error_codereqstring
messagereqstring

POST /v1/research/tasks

Create Research Task

Auth: PlatformApiKey

Headers

HeaderReqNotes
Idempotency-Keyoptstring (nullable)

Request Content-Type: application/json Body: ResearchTaskCreateRequest

1st level2nd level3rd levelReqNotes
include_raw_tool_callsoptboolean (default: False)
inputreqstring
output_schemaoptJsonObject-Input (nullable)
streamoptboolean (default: False)

Responses 200 Current task state, recorded tool-call progress and the settled result as named SSE events. Content-Type: text/event-stream Body: oneOf: ResearchTaskStateEvent OR ResearchToolCallEvent

(no documented fields)

202 Research Task accepted. Content-Type: application/json Body: ResearchTaskResponse

Response headers

HeaderNotes
Locationstring — Relative URL for polling the accepted Research Task.
1st level2nd level3rd levelReqNotes
citationsreqarray[ResearchTaskCitation (nullable)] (nullable)
excerptsreqarray[string]
titlereqstring (nullable)
urlreqstring
created_atreqstring (format: date-time)
credits_chargedreqstring (nullable)
errorreqResearchTaskFailure (nullable)
codereqResearchTaskFailureCode
messagereqstring
finished_atreqstring (format: date-time; nullable)
idreqstring (format: uuid)
inputreqstring
outputreqanyOf: string OR JsonValue-Output OR null
output_schemaoptJsonObject-Output (nullable)
statusreqResearchTaskStatus

400 Invalid request or Idempotency-Key. Content-Type: application/json Body: ErrorResponse

1st level2nd level3rd levelReqNotes
billingoptErrorBillingDTO (nullable)
actual_cost_providerreqstring (enum: [openrouter, ai_gateway])
actual_cost_usdreqnumber
usageoptDecisionUsage (nullable)
input_tokensoptinteger (nullable)
output_tokensoptinteger (nullable)
error_codereqstring
messagereqstring

401 Platform API-key authentication failed. Content-Type: application/json Body: ErrorResponse

Response headers

HeaderNotes
WWW-Authenticatestring — Bearer authentication challenge when API-key authentication fails.
1st level2nd level3rd levelReqNotes
billingoptErrorBillingDTO (nullable)
actual_cost_providerreqstring (enum: [openrouter, ai_gateway])
actual_cost_usdreqnumber
usageoptDecisionUsage (nullable)
input_tokensoptinteger (nullable)
output_tokensoptinteger (nullable)
error_codereqstring
messagereqstring

409 Idempotency conflict, account task limit, or invalid account status. Content-Type: application/json Body: ErrorResponse

1st level2nd level3rd levelReqNotes
billingoptErrorBillingDTO (nullable)
actual_cost_providerreqstring (enum: [openrouter, ai_gateway])
actual_cost_usdreqnumber
usageoptDecisionUsage (nullable)
input_tokensoptinteger (nullable)
output_tokensoptinteger (nullable)
error_codereqstring
messagereqstring

422 Request validation failed (error_code: validation_failed). Content-Type: application/json Body: ErrorResponse

1st level2nd level3rd levelReqNotes
billingoptErrorBillingDTO (nullable)
actual_cost_providerreqstring (enum: [openrouter, ai_gateway])
actual_cost_usdreqnumber
usageoptDecisionUsage (nullable)
input_tokensoptinteger (nullable)
output_tokensoptinteger (nullable)
error_codereqstring
messagereqstring

{task_id}

GET /v1/research/tasks/{task_id}

Get Research Task

Auth: PlatformApiKey

Parameters

ParamInReqNotes
task_idpathreqstring (format: uuid)
include_raw_tool_callsqueryoptboolean (default: False)

Responses 200 Current task state, recorded tool-call progress and the settled result as named SSE events. Content-Type: application/json Body: ResearchTaskResponse

1st level2nd level3rd levelReqNotes
citationsreqarray[ResearchTaskCitation (nullable)] (nullable)
excerptsreqarray[string]
titlereqstring (nullable)
urlreqstring
created_atreqstring (format: date-time)
credits_chargedreqstring (nullable)
errorreqResearchTaskFailure (nullable)
codereqResearchTaskFailureCode
messagereqstring
finished_atreqstring (format: date-time; nullable)
idreqstring (format: uuid)
inputreqstring
outputreqanyOf: string OR JsonValue-Output OR null
output_schemaoptJsonObject-Output (nullable)
statusreqResearchTaskStatus

Content-Type: text/event-stream Body: oneOf: ResearchTaskStateEvent OR ResearchToolCallEvent

1st level2nd level3rd levelReqNotes
citationsreqarray[ResearchTaskCitation (nullable)] (nullable)
excerptsreqarray[string]
titlereqstring (nullable)
urlreqstring
created_atreqstring (format: date-time)
credits_chargedreqstring (nullable)
errorreqResearchTaskFailure (nullable)
codereqResearchTaskFailureCode
messagereqstring
finished_atreqstring (format: date-time; nullable)
idreqstring (format: uuid)
inputreqstring
outputreqanyOf: string OR JsonValue-Output OR null
output_schemaoptJsonObject-Output (nullable)
statusreqResearchTaskStatus

401 Platform API-key authentication failed. Content-Type: application/json Body: ErrorResponse

Response headers

HeaderNotes
WWW-Authenticatestring — Bearer authentication challenge when API-key authentication fails.
1st level2nd level3rd levelReqNotes
billingoptErrorBillingDTO (nullable)
actual_cost_providerreqstring (enum: [openrouter, ai_gateway])
actual_cost_usdreqnumber
usageoptDecisionUsage (nullable)
input_tokensoptinteger (nullable)
output_tokensoptinteger (nullable)
error_codereqstring
messagereqstring

404 Research task not found (error_code: not_found). Content-Type: application/json Body: ErrorResponse

1st level2nd level3rd levelReqNotes
billingoptErrorBillingDTO (nullable)
actual_cost_providerreqstring (enum: [openrouter, ai_gateway])
actual_cost_usdreqnumber
usageoptDecisionUsage (nullable)
input_tokensoptinteger (nullable)
output_tokensoptinteger (nullable)
error_codereqstring
messagereqstring

422 Request validation failed (error_code: validation_failed). Content-Type: application/json Body: ErrorResponse

1st level2nd level3rd levelReqNotes
billingoptErrorBillingDTO (nullable)
actual_cost_providerreqstring (enum: [openrouter, ai_gateway])
actual_cost_usdreqnumber
usageoptDecisionUsage (nullable)
input_tokensoptinteger (nullable)
output_tokensoptinteger (nullable)
error_codereqstring
messagereqstring

Models

Model: DecisionUsage

1st level2nd level3rd levelReqNotes
input_tokensoptinteger (nullable)
output_tokensoptinteger (nullable)
JSON schema
{
  "additionalProperties": false,
  "properties": {
    "input_tokens": {
      "anyOf": [
        {
          "minimum": 0.0,
          "type": "integer"
        },
        {
          "type": "null"
        }
      ],
      "title": "Input Tokens"
    },
    "output_tokens": {
      "anyOf": [
        {
          "minimum": 0.0,
          "type": "integer"
        },
        {
          "type": "null"
        }
      ],
      "title": "Output Tokens"
    }
  },
  "title": "DecisionUsage",
  "type": "object"
}

Model: ErrorBillingDTO

1st level2nd level3rd levelReqNotes
actual_cost_providerreqstring (enum: [openrouter, ai_gateway])
actual_cost_usdreqnumber
usageoptDecisionUsage (nullable)
input_tokensoptinteger (nullable)
output_tokensoptinteger (nullable)
JSON schema
{
  "additionalProperties": false,
  "properties": {
    "actual_cost_provider": {
      "enum": [
        "openrouter",
        "ai_gateway"
      ],
      "title": "Actual Cost Provider",
      "type": "string"
    },
    "actual_cost_usd": {
      "minimum": 0.0,
      "title": "Actual Cost Usd",
      "type": "number"
    },
    "usage": {
      "anyOf": [
        {
          "$ref": "#/components/schemas/DecisionUsage"
        },
        {
          "type": "null"
        }
      ]
    }
  },
  "required": [
    "actual_cost_usd",
    "actual_cost_provider"
  ],
  "title": "ErrorBillingDTO",
  "type": "object"
}

Model: ErrorResponse

1st level2nd level3rd levelReqNotes
billingoptErrorBillingDTO (nullable)
actual_cost_providerreqstring (enum: [openrouter, ai_gateway])
actual_cost_usdreqnumber
usageoptDecisionUsage (nullable)
input_tokensoptinteger (nullable)
output_tokensoptinteger (nullable)
error_codereqstring
messagereqstring
JSON schema
{
  "properties": {
    "billing": {
      "anyOf": [
        {
          "$ref": "#/components/schemas/ErrorBillingDTO"
        },
        {
          "type": "null"
        }
      ]
    },
    "error_code": {
      "title": "Error Code",
      "type": "string"
    },
    "message": {
      "title": "Message",
      "type": "string"
    }
  },
  "required": [
    "error_code",
    "message"
  ],
  "title": "ErrorResponse",
  "type": "object"
}

Model: JsonObject-Input

(no documented fields)

JSON schema
{
  "additionalProperties": {
    "$ref": "#/components/schemas/JsonValue-Input"
  },
  "type": "object"
}

Model: JsonObject-Output

(no documented fields)

JSON schema
{
  "additionalProperties": {
    "$ref": "#/components/schemas/JsonValue-Output"
  },
  "type": "object"
}

Model: JsonValue-Input

(no documented fields)

JSON schema
{
  "anyOf": [
    {
      "type": "string"
    },
    {
      "type": "integer"
    },
    {
      "type": "number"
    },
    {
      "type": "boolean"
    },
    {
      "items": {
        "$ref": "#/components/schemas/JsonValue-Input"
      },
      "type": "array"
    },
    {
      "additionalProperties": {
        "$ref": "#/components/schemas/JsonValue-Input"
      },
      "type": "object"
    },
    {
      "type": "null"
    }
  ]
}

Model: JsonValue-Output

(no documented fields)

JSON schema
{
  "anyOf": [
    {
      "type": "string"
    },
    {
      "type": "integer"
    },
    {
      "type": "number"
    },
    {
      "type": "boolean"
    },
    {
      "items": {
        "$ref": "#/components/schemas/JsonValue-Output"
      },
      "type": "array"
    },
    {
      "additionalProperties": {
        "$ref": "#/components/schemas/JsonValue-Output"
      },
      "type": "object"
    },
    {
      "type": "null"
    }
  ]
}

Model: ResearchTaskCitation

1st level2nd level3rd levelReqNotes
excerptsreqarray[string]
titlereqstring (nullable)
urlreqstring
JSON schema
{
  "additionalProperties": false,
  "properties": {
    "excerpts": {
      "items": {
        "type": "string"
      },
      "title": "Excerpts",
      "type": "array"
    },
    "title": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Title"
    },
    "url": {
      "title": "Url",
      "type": "string"
    }
  },
  "required": [
    "url",
    "title",
    "excerpts"
  ],
  "title": "ResearchTaskCitation",
  "type": "object"
}

Model: ResearchTaskCreateRequest

1st level2nd level3rd levelReqNotes
include_raw_tool_callsoptboolean (default: False)
inputreqstring
output_schemaoptJsonObject-Input (nullable)
streamoptboolean (default: False)
JSON schema
{
  "additionalProperties": false,
  "properties": {
    "include_raw_tool_calls": {
      "default": false,
      "title": "Include Raw Tool Calls",
      "type": "boolean"
    },
    "input": {
      "minLength": 1,
      "title": "Input",
      "type": "string"
    },
    "output_schema": {
      "anyOf": [
        {
          "$ref": "#/components/schemas/JsonObject-Input"
        },
        {
          "type": "null"
        }
      ],
      "description": "JSON Schema Draft 2020-12 for structured output. `$ref` and `$dynamicRef` values must be local fragments beginning with `#`; external references are rejected. Schemas may contain at most 80,000 compact JSON characters."
    },
    "stream": {
      "default": false,
      "title": "Stream",
      "type": "boolean"
    }
  },
  "required": [
    "input"
  ],
  "title": "ResearchTaskCreateRequest",
  "type": "object"
}

Model: ResearchTaskFailure

1st level2nd level3rd levelReqNotes
codereqResearchTaskFailureCode
messagereqstring
JSON schema
{
  "additionalProperties": false,
  "properties": {
    "code": {
      "$ref": "#/components/schemas/ResearchTaskFailureCode"
    },
    "message": {
      "title": "Message",
      "type": "string"
    }
  },
  "required": [
    "code",
    "message"
  ],
  "title": "ResearchTaskFailure",
  "type": "object"
}

Model: ResearchTaskFailureCode

(no documented fields)

JSON schema
{
  "enum": [
    "insufficient_credits",
    "execution_timeout",
    "invalid_output",
    "execution_failed"
  ],
  "title": "ResearchTaskFailureCode",
  "type": "string"
}

Model: ResearchTaskPage

1st level2nd level3rd levelReqNotes
itemsreqarray[ResearchTaskSummary]
created_atreqstring (format: date-time)
finished_atreqstring (format: date-time; nullable)
idreqstring (format: uuid)
input_previewreqstring
statusreqResearchTaskStatus
next_cursorreqstring (nullable)
JSON schema
{
  "additionalProperties": false,
  "properties": {
    "items": {
      "items": {
        "$ref": "#/components/schemas/ResearchTaskSummary"
      },
      "title": "Items",
      "type": "array"
    },
    "next_cursor": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Next Cursor"
    }
  },
  "required": [
    "items",
    "next_cursor"
  ],
  "title": "ResearchTaskPage",
  "type": "object"
}

Model: ResearchTaskResponse

1st level2nd level3rd levelReqNotes
citationsreqarray[ResearchTaskCitation (nullable)] (nullable)
excerptsreqarray[string]
titlereqstring (nullable)
urlreqstring
created_atreqstring (format: date-time)
credits_chargedreqstring (nullable)
errorreqResearchTaskFailure (nullable)
codereqResearchTaskFailureCode
messagereqstring
finished_atreqstring (format: date-time; nullable)
idreqstring (format: uuid)
inputreqstring
outputreqanyOf: string OR JsonValue-Output OR null
output_schemaoptJsonObject-Output (nullable)
statusreqResearchTaskStatus
JSON schema
{
  "additionalProperties": false,
  "properties": {
    "citations": {
      "anyOf": [
        {
          "items": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/ResearchTaskCitation"
              },
              {
                "type": "null"
              }
            ]
          },
          "type": "array"
        },
        {
          "type": "null"
        }
      ],
      "title": "Citations"
    },
    "created_at": {
      "format": "date-time",
      "title": "Created At",
      "type": "string"
    },
    "credits_charged": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Credits Charged"
    },
    "error": {
      "anyOf": [
        {
          "$ref": "#/components/schemas/ResearchTaskFailure"
        },
        {
          "type": "null"
        }
      ]
    },
    "finished_at": {
      "anyOf": [
        {
          "format": "date-time",
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Finished At"
    },
    "id": {
      "format": "uuid",
      "title": "Id",
      "type": "string"
    },
    "input": {
      "description": "Complete Research Task input.",
      "minLength": 1,
      "title": "Input",
      "type": "string"
    },
    "output": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "$ref": "#/components/schemas/JsonValue-Output"
        },
        {
          "type": "null"
        }
      ],
      "description": "Task output: text, structured JSON, or null. Use status to distinguish a pending result from a completed structured null. Structured responses may contain at most 80,000 compact JSON characters; oversized structured responses cause terminal invalid_output failure.",
      "title": "Output"
    },
    "output_schema": {
      "anyOf": [
        {
          "$ref": "#/components/schemas/JsonObject-Output"
        },
        {
          "type": "null"
        }
      ],
      "description": "Structured output schema requested for this Research Task."
    },
    "status": {
      "$ref": "#/components/schemas/ResearchTaskStatus"
    }
  },
  "required": [
    "id",
    "input",
    "status",
    "created_at",
    "finished_at",
    "output",
    "citations",
    "error",
    "credits_charged"
  ],
  "title": "ResearchTaskResponse",
  "type": "object"
}

Model: ResearchTaskStateEvent

1st level2nd level3rd levelReqNotes
taskreqResearchTaskResponse
citationsreqarray[ResearchTaskCitation (nullable)] (nullable)
excerptsreqarray[string]
titlereqstring (nullable)
urlreqstring
created_atreqstring (format: date-time)
credits_chargedreqstring (nullable)
errorreqResearchTaskFailure (nullable)
codereqResearchTaskFailureCode
messagereqstring
finished_atreqstring (format: date-time; nullable)
idreqstring (format: uuid)
inputreqstring
outputreqanyOf: string OR JsonValue-Output OR null
output_schemaoptJsonObject-Output (nullable)
statusreqResearchTaskStatus
task_idreqstring (format: uuid)
typereqstring (enum: [task.snapshot, task.completed, task.failed])
JSON schema
{
  "additionalProperties": false,
  "properties": {
    "task": {
      "$ref": "#/components/schemas/ResearchTaskResponse"
    },
    "task_id": {
      "format": "uuid",
      "title": "Task Id",
      "type": "string"
    },
    "type": {
      "enum": [
        "task.snapshot",
        "task.completed",
        "task.failed"
      ],
      "title": "Type",
      "type": "string"
    }
  },
  "required": [
    "type",
    "task_id",
    "task"
  ],
  "title": "ResearchTaskStateEvent",
  "type": "object"
}

Model: ResearchTaskStatus

(no documented fields)

JSON schema
{
  "enum": [
    "queued",
    "in_progress",
    "completed",
    "failed"
  ],
  "title": "ResearchTaskStatus",
  "type": "string"
}

Model: ResearchTaskSummary

1st level2nd level3rd levelReqNotes
created_atreqstring (format: date-time)
finished_atreqstring (format: date-time; nullable)
idreqstring (format: uuid)
input_previewreqstring
statusreqResearchTaskStatus
JSON schema
{
  "additionalProperties": false,
  "properties": {
    "created_at": {
      "format": "date-time",
      "title": "Created At",
      "type": "string"
    },
    "finished_at": {
      "anyOf": [
        {
          "format": "date-time",
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Finished At"
    },
    "id": {
      "format": "uuid",
      "title": "Id",
      "type": "string"
    },
    "input_preview": {
      "description": "First 500 characters of the Research Task input. Exact reads return the complete input.",
      "maxLength": 500,
      "minLength": 1,
      "title": "Input Preview",
      "type": "string"
    },
    "status": {
      "$ref": "#/components/schemas/ResearchTaskStatus"
    }
  },
  "required": [
    "id",
    "input_preview",
    "status",
    "created_at",
    "finished_at"
  ],
  "title": "ResearchTaskSummary",
  "type": "object"
}

Model: ResearchToolCallEvent

1st level2nd level3rd levelReqNotes
call_idreqstring
finished_atreqstring (format: date-time; nullable)
outcomereqToolCallOutcome (nullable)
rawoptResearchToolCallRaw (nullable)
requestreqJsonValue-Output (nullable)
responsereqJsonValue-Output (nullable)
started_atreqstring (format: date-time)
task_idreqstring (format: uuid)
toolreqstring (enum: [search_web, search_ai, fetch_page, embed_text, decision_query, llm_chat, test_tool, tooling_info])
typereqstring (enum: [tool_call.started, tool_call.completed, tool_call.failed])
JSON schema
{
  "additionalProperties": false,
  "properties": {
    "call_id": {
      "title": "Call Id",
      "type": "string"
    },
    "finished_at": {
      "anyOf": [
        {
          "format": "date-time",
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Finished At"
    },
    "outcome": {
      "anyOf": [
        {
          "$ref": "#/components/schemas/ToolCallOutcome"
        },
        {
          "type": "null"
        }
      ]
    },
    "raw": {
      "anyOf": [
        {
          "$ref": "#/components/schemas/ResearchToolCallRaw"
        },
        {
          "type": "null"
        }
      ]
    },
    "started_at": {
      "format": "date-time",
      "title": "Started At",
      "type": "string"
    },
    "task_id": {
      "format": "uuid",
      "title": "Task Id",
      "type": "string"
    },
    "tool": {
      "enum": [
        "search_web",
        "search_ai",
        "fetch_page",
        "embed_text",
        "decision_query",
        "llm_chat",
        "test_tool",
        "tooling_info"
      ],
      "title": "Tool",
      "type": "string"
    },
    "type": {
      "enum": [
        "tool_call.started",
        "tool_call.completed",
        "tool_call.failed"
      ],
      "title": "Type",
      "type": "string"
    }
  },
  "required": [
    "type",
    "task_id",
    "call_id",
    "tool",
    "started_at",
    "finished_at",
    "outcome"
  ],
  "title": "ResearchToolCallEvent",
  "type": "object"
}

Model: ResearchToolCallRaw

1st level2nd level3rd levelReqNotes
requestreqJsonValue-Output (nullable)
responsereqJsonValue-Output (nullable)
JSON schema
{
  "additionalProperties": false,
  "properties": {
    "request": {
      "anyOf": [
        {
          "$ref": "#/components/schemas/JsonValue-Output"
        },
        {
          "type": "null"
        }
      ]
    },
    "response": {
      "anyOf": [
        {
          "$ref": "#/components/schemas/JsonValue-Output"
        },
        {
          "type": "null"
        }
      ]
    }
  },
  "required": [
    "request",
    "response"
  ],
  "title": "ResearchToolCallRaw",
  "type": "object"
}

Model: ToolCallOutcome

(no documented fields)

JSON schema
{
  "description": "High-level outcome for a tool invocation.",
  "enum": [
    "ok",
    "provider_error",
    "budget_exceeded",
    "internal_error",
    "timeout"
  ],
  "title": "ToolCallOutcome",
  "type": "string"
}