Endpoint

POST /v3/tools/

Description

Creates a new tool using an OpenAPI schema with custom configurations.

Authentication

API Key (x-api-key) in the header.

Request Parameters

ParameterTypeDescription
tool_set_nameStringName for the tool set (prefixed with openapi-).
openapi_schemaObjectOpenAPI schema for tool definition.
default_headersObjectOptional default headers for requests.
default_query_paramsObjectOptional default query parameters.
default_body_paramsObjectOptional default body parameters.
endpoint_defaultsObjectOptional endpoint-specific default parameters.
enhance_descriptionsBooleanWhether to enhance descriptions using OpenAI.
openai_api_keyStringOpenAI API key (if enhancement is enabled).

Request Example

{
  "tool_set_name": "hello",
  "openapi_schema": {
    "openapi": "3.0.0",
    "info": {
      "title": "Sample API",
      "version": "1.0.0",
      "description": "A sample API specification"
    },
    "servers": [
      {
        "url": "https://api.example.com/v1",
        "description": "Production server"
      }
    ]
  },
  "default_headers": {
    "Content-Type": "application/json"
  },
  "enhance_descriptions": true,
  "openai_api_key": "YOUR_OPENAI_API_KEY"
}

Curl Request

curl -X POST "https://agent-prod.studio.lyzr.ai/v3/tools/" ^
-H "accept: application/json" ^
-H "content-type: application/json" ^
-H "x-api-key: sk-default-REDACTED" ^
-d '{"tool_set_name":"string","openapi_schema":{},"default_headers":{},"default_query_params":{},"default_body_params":{},"endpoint_defaults":{},"enhance_descriptions":false,"openai_api_key":null}'

Response

Returns tool IDs for the created tools.