QVeris REST API Documentation


Version: 0.1.9

QVeris exposes three core actions via REST API:

Protocol actionAPI endpointDescription
DiscoverPOST /searchFind capabilities with natural language (free)
InspectPOST /tools/by-idsGet capability details by ID
CallPOST /tools/executeInvoke a capability (1–100 credits)

Authentication

All API requests require authentication via Bearer in the Authorization header:

Authorization: Bearer YOUR_API_KEY

Get your API KEY from https://qveris.ai

Base URL

https://qveris.ai/api/v1

All endpoints described in this document are relative to this base URL.

API Endpoints

1. Discover — Search Tools

Search for capabilities based on natural language queries. This is the Discover action and is free.

Endpoint

POST /search

Request Headers

HeaderRequiredDescription
AuthorizationYesBearer token for authentication
Content-TypeYesMust be application/json

Request Body

{
  "query": "string",
  "limit": 10,
  "session_id": "string"
}

Parameters

FieldTypeRequiredDescriptionDefaultRange
querystringYesNatural language search query--
session_idstringNoSame id corresponds to the same user session--
limitintegerNoMaximum number of results to return201-100

Response

Status Code: 200 OK

{
  "search_id": "string",
  "total": 3,
  "results": [
    {
      "tool_id": "openweathermap.weather.execute.v1",
      "name": "Current Weather",
      "description": "Get current weather data for any location",
      "provider_name": "OpenWeatherMap",
      "provider_description": "Global weather data provider",
      "region": "global",
      "params": [
        {
          "name": "city",
          "type": "string",
          "required": true,
          "description": "City name"
        },
        {
          "name": "units",
          "type": "string",
          "required": false,
          "description": "Temperature units (metric/imperial)",
          "enum": ["metric", "imperial", "standard"]
        }
      ],
      "examples": {
        "sample_parameters": {
          "city": "London",
          "units": "metric"
        }
      },
      "stats": {
          "avg_execution_time_ms": 21.74,
          "success_rate": 0.909
      }
    }
  ],
  "elapsed_time_ms": 245.6
}

Response Fields

FieldTypeRequiredDescription
querystringNoOriginal search query
search_idstringYesId for this search. Used in following tool executions.
user_idstringNoOriginal search user id
totalintegerYesTotal number of results

Tool Information Fields

FieldTypeRequiredDescription
tool_idstringYesUnique identifier for the tool
namestringYesDisplay name of the tool
descriptionstringYesDetailed description of tool functionality
provider_namestringNoName of the tool provider
provider_descriptionstringNoDescription of the provider
regionstringNoRegion of the tool. “global” for global tools, "
paramsarrayNoArray of parameter definitions
examplesobjectNoUsage examples
statsobjectNoHistorical execution performance statistics

2. Inspect — Get Tools by ID

Get detailed descriptions of capabilities based on tool_id. This is the Inspect action.

Endpoint

POST /tools/by-ids

Request Headers

HeaderRequiredDescription
AuthorizationYesBearer token for authentication
Content-TypeYesMust be application/json

Request Body

{
  "tool_ids": ["string1", "string2", "..."],
  "search_id": "string",
  "session_id": "string"
}

Parameters

FieldTypeRequiredDescriptionDefaultRange
tool_idslist of stringsYesIds of tools to query--
session_idstringNoSame id corresponds to the same user session--
search_idstringNoId for the search that returned the tool(s).--

Response

Status Code: 200 OK

Same schema as the response of /search


3. Call — Execute Tool

Invoke a capability with specified parameters. This is the Call action and costs 1–100 credits per call, priced by data and task value.

Endpoint

POST /tools/execute?tool_id={tool_id}

Request Headers

HeaderRequiredDescription
AuthorizationYesBearer token for authentication
Content-TypeYesMust be application/json

URL Parameters

ParameterTypeRequiredDescription
tool_idstringYesUnique identifier of the tool to execute

Request Body

{
  "search_id": "string",
  "session_id": "string",
  "parameters": {
    "city": "London",
    "units": "metric"
  },
  "max_response_size": 20480
}

Parameters

FieldTypeRequiredDescription
search_idstringYesId for the search that returned this tool.
session_idstringNoSame id corresponds to the same user session.
parametersobjectYesKey-value pairs of tool parameters. Value can be object.
max_response_sizeintegerNoIf the tool generates data longer than max_response_size bytes, truncate to avoid big LLM token cost. -1 means no limit. Default is 20480 (20K). See details below.

Response

Status Code: 200 OK

{
  "execution_id": "string",
  "result": {
    "data": {
      "temperature": 15.5,
      "humidity": 72,
      "description": "partly cloudy",
      "wind_speed": 12.5
    }
  },
  "success": true,
  "error_message": null,
  "elapsed_time_ms": 210.72,
  "cost": 5.0
}

Response Fields

FieldTypeRequiredDescription
execution_idstringYesUnique identifier for this execution
resultobjectYesTool execution result
successbooleanYesWhether the execution was successful
error_messagestringNoError message if execution failed
elapsed_time_msnumberNoExecution time in milliseconds
costnumberNocost deducted from account

If the call to the third-party service fails due to reasons such as insufficient balance, quota exceeded, or other issues, success will be false, and error_message will contain detailed information about the failure.

Result Fields for Long Tool Response

If the tool generates data longer than max_response_size bytes, result will have no data field but the fields below.

{
  "result": {
    "message": "Result content is too long (3210 bytes). You can reference the truncated content (200 bytes) and download the full content from the url provided.",
    "full_content_file_url": "http://qveris-tool-results-cache-bj.oss-cn-beijing.aliyuncs.com/tool_result_cache%2F20260120%2Fpubmed_refined.search_articles.v1%2F2409f329c07949a295b5ab0b704883ca.json?OSSAccessKeyId=LTAI5tM3qNRZSgSrg1iSTALm&Expires=1768920673&Signature=ThkQxoa9ryYHn%2F6XbVloiegS5ss%3D",
    "truncated_content": "{\"query\": \"evolution\", \"sort\": \"relevance\", \"total_results\": 890994, \"returned\": 10, \"articles\": [{\"pmid\": \"34099656\", \"title\": \"Towards an engineering theory of evolution.\", \"journal\": \"Nature commun",
    "content_schema": {
      "type": "object",
      "properties": {
        "query": {
          "type": "string"
        },
        "sort": {
          "type": "string"
        },
        "total_results": {
          "type": "number"
        },
        "returned": {
          "type": "number"
        },
        "articles": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "pmid": {
                "type": "string"
              },
              "title": {
                "type": "string"
              },
              "journal": {
                "type": "string"
              }
            }
          }
        }
      }
    }
  }
}
FieldTypeRequiredDescription
truncated_contentstringNoThe initial max_response_size bytes of tool response.
full_content_file_urlstringNoThe url to the file that contains the full content. Valid for 120min.
messagestringNoMessage to LLM about the truncation.
content_schemaobjectNoThe JSON schema of the full content.

Data Models

Tool Parameter Schema

Each tool parameter follows this schema:

{
  "name": "string",
  "type": "string|number|boolean|array|object",
  "required": true,
  "description": "string",
  "enum": ["option1", "option2"]
}
FieldTypeRequiredDescription
namestringYesParameter name
typestringYesData type (string, number, boolean, array, object)
requiredbooleanYesWhether parameter is required
descriptionstringYesParameter description
enumarrayNoValid values (if applicable)

Tool Historical execution performance statistics in search results

{
  "avg_execution_time_ms": 8564.43,
  "success_rate": 0.748
}
FieldTypeRequiredDescription
avg_execution_time_msnumberNoHistorical average execution time of the tool
success_ratenumberNoHistorical success rate of the tool

LLM/Agent Use Examples

For LLM/agent tool use scenario, below are example code snippets to encapsulate QVeris AI REST API calls into tools that can be invoked by large language models:

export async function searchTools(
  query: string,
  sessionId: string,
  limit: number = 20
): Promise<SearchResponse> {
  const response = await api.post<SearchResponse>('/search', {
    query,
    limit,
    session_id: sessionId,
  })
  return response.data
}

export async function executeTool(
  toolId: string,
  searchId: string,
  sessionId: string,
  parameters: object
): Promise<ToolExecutionResponse> {
  const response = await api.post<ToolExecutionResponse>(
    `/tools/execute?tool_id=${toolId}`,
    {
      search_id: searchId,
      session_id: sessionId,
      parameters,
    }
  )
  return response.data
}

export const qverisApi = {
  searchTools,
  executeTool,
}

// Execute tool function
async function executeTool(name: string, args: Record<string, unknown>) {
  console.log(`[Tool] Executing ${name} with:`, args)

  if (name === 'search_tools') {
    const result = await qverisApi.searchTools(
      args.query as string,
      args.session_id as string,
      20
    )
    return result
  } else if (name === 'execute_tool') {
    let parsedParams: Record<string, unknown>
    try {
      parsedParams = JSON.parse(args.params_to_tool as string) as
        Record<string, unknown>
    } catch (parseError) {
      throw new Error(
        `Invalid JSON in params_to_tool: ${
          parseError instanceof Error
            ? parseError.message
            : 'Unknown parse error'
        }`
      )
    }

    const result = await qverisApi.executeTool(
      args.tool_id as string,
      args.search_id as string,
      args.session_id as string,
      parsedParams
    )
    return result
  }

  throw new Error(`Unknown tool: ${name}`)
}

Below are example declarations for the encapsulated search and execute tools. Just add them to chat completion tool list.

{
  type: 'function',
  function: {
    name: 'search_tools',
    description:
      'Search for available tools. Returns relevant tools that can help accomplish tasks.',
    parameters: {
      type: 'object',
      properties: {
        query: {
          type: 'string',
          description: 'The search query describing the general capability of the tool. Not specific params you want to pass to the tool later.',
        },
        session_id: {
          type: 'string',
          description: 'The uuid of the user session. Should be changed only if new session.'
        },
      },
      required: ['query'],
    },
  },
},
{
  type: 'function',
  function: {
    name: 'execute_tool',
    description:
      'Execute a specific remote tool with provided parameters. The tool_id must come from a previous search_tools call; The params_to_tool is where the params can be passed.',
    parameters: {
      type: 'object',
      properties: {
        tool_id: {
          type: 'string',
          description: 'The ID of the remote tool to execute (from search results)',
        },
        search_id: {
          type: 'string',
          description: 'The search_id in the response of the search_tools call that returned the information of this remote tool',
        },
        session_id: {
          type: 'string',
          description: 'The uuid of the user session. Should be changed only if new session.'
        },
        params_to_tool: {
          type: 'string',
          description: 'An JSON stringified dictionary of parameters to pass to the remote tool, where keys are param names and values can be of any type, used to pass multiple arguments to the tool. For example: { "param1": "value1", "param2": 42, "param3": { "nestedKey": "nestedValue" } }',
        },
        max_response_size: {
          type: 'integer',
          description: 'If tool generates data longer than max_response_size (in bytes), do not return the full data to avoid big LLM token cost. Default value is 20480.',
        },
      },
      required: ['tool_id', 'search_id', 'params_to_tool'],
    },
  },
}

You can then use below system prompt and start testing! Have fun exploring!

{
  role: 'system',
  content: 'You are a helpful assistant that can dynamically discover and call capabilities to help the user. First think about what kind of capabilities might be useful to accomplish the user\\'s task. Then use the search_tools tool with a query describing the capability, not the specific parameters you will pass later. Then call suitable capabilities using the execute_tool tool, passing parameters through params_to_tool. If a capability has success_rate and avg_execution_time (in seconds), consider them when selecting which to call. You can reference the examples given for each capability. You can make multiple tool calls in a single response.',
}